if(typeof IEPNGFIX=="undefined"){var IEPNGFIX={blank:"/image/iepngfix.gif",filter:"DXImageTransform.Microsoft.AlphaImageLoader",fixit:function(b,c,d){if(b.filters[this.filter]){var a=b.filters[this.filter];a.enabled=true;a.src=c;a.sizingMethod=d}else{b.style.filter="progid:"+this.filter+'(src="'+c+'",sizingMethod="'+d+'")'}},fixwidth:function(a){if(a.currentStyle.width=="auto"&&a.currentStyle.height=="auto"){a.style.width=a.offsetWidth+"px"}},fixchild:function(d,a){if(!/MSIE (5\.5|6\.)/.test(navigator.userAgent)){return}for(var c=0,e=d.childNodes.length;c<e;c++){var b=d.childNodes[c];if(b.style){if(b.style.position){b.style.position=b.style.position}else{b.style.position="relative"}}if(a&&b.hasChildNodes()){this.fixchild(b,a)}}},fix:function(c){if(!/MSIE (5\.5|6\.)/.test(navigator.userAgent)){return}var a=c.currentStyle.backgroundImage||c.style.backgroundImage;if(c.tagName=="IMG"){this.fixwidth(c);this.fixit(c,c.src,"scale");c.src=this.blank;c.runtimeStyle.behavior="none"}else{if(a&&a!="none"){if(a.match(/^url[("']+(.*\.png)[)"']+$/i)){var b=RegExp.$1;this.fixwidth(c);c.style.backgroundImage="none";this.fixit(c,b,"scale");if(c.tagName=="A"&&c.style){if(!c.style.cursor){c.style.cursor="pointer"}}this.fixchild(c);c.runtimeStyle.behavior="none"}}}},hover:function(c,b){var a=c.style.backgroundImage;if(!a&&c.currentStyle){a=c.currentStyle.backgroundImage}if(c.tagName=="IMG"&&b){var d=c.src;c.onmouseover=function(){c.src=b;IEPNGFIX.fix(c)};c.onmouseout=function(){c.src=d;IEPNGFIX.fix(c)}}else{if(a&&a!="none"&&b){c.onmouseover=function(){c.style.backgroundImage="url("+b+")";IEPNGFIX.fix(c)};c.onmouseout=function(){c.style.backgroundImage=a;IEPNGFIX.fix(c)}}}IEPNGFIX.fix(c)}}}var g_today=getToday();function parseDateTime(a){var b=a.match("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})");return new Date(Date.UTC(b[1],parseInt(b[2],10)-1,b[3],b[4],b[5],b[6]))}function parseDate(a){var b=a.match("([0-9]{4})-([0-9]{2})-([0-9]{2})");return new Date(b[1],parseInt(b[2],10)-1,b[3])}function formatDate(a){return a.getFullYear()+"-"+show2(a.getMonth()+1)+"-"+show2(a.getDate())}function show2(a){return("0"+a).slice(-2)}function isSameDay(a,b){if(a==null||b==null){return false}else{return a.getDate()==b.getDate()&&a.getMonth()==b.getMonth()&&a.getFullYear()==b.getFullYear()}}function getTodayDate(){return g_today}function getToday(){var a=new Date();return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function formatDueDate(b){var a=getTodayDate();var c=null;if(isSameDay(b,a)){c="today"}else{if(isSameDay(b,new Date(a.getTime()+24*60*60*1000))){c="tomorrow"}else{if(isSameDay(b,new Date(a.getTime()-24*60*60*1000))){c="yesterday"}}}if(c){return new Template(MESSAGES["due."+c]).evaluate({day:formatDay(b.getDay())})}else{return formatMonthDateDay(b.getMonth(),b.getDate(),b.getDay())}}AjaxUtil=Class.create({initialize:function(){},get:function(d,c,b,a){this.request(d,"GET",c,b,a)},post:function(d,c,b,a){this.request(d,"POST",c,b,a)},request:function(d,e,c,b,a){this.requestParams(d,e,c?Form.serialize(c,true):{},b,a)},requestParams:function(c,e,d,b,a){if(!a){a=typeof error!="undefined"&&error?error:alert}new Ajax.Request(c,{method:e,parameters:d||{},evalJSON:false,onSuccess:function(f){if(f.getResponseHeader("Content-Type").match(/^application\/json/)){if(f.responseText.length!=0){try{var h=this.evalJSON(f.responseText);if(b){b(h)}}catch(g){a([g.toString()])}}}else{b(f.responseText)}}.bind(this),onFailure:function(f){if(f.getResponseHeader("Content-Type").match(/^application\/json/)){a(this.evalJSON(f.responseText))}else{if(f.getResponseHeader("Content-Type").match(/^text\/plain/)){a([f.responseText])}else{a([f.status+" "+f.statusText])}}}.bind(this)})},evalJSON:function(a){if(Prototype.Browser.WebKit&&a.startsWith("/*-secure-")){return a.slice(11,-3).evalJSON(false)}else{return a.evalJSON()}}});Element.addMethods({removeAllChildren:function(a){while(a.lastChild){a.removeChild(a.lastChild)}},update2:function(a,b){if(b.nodeType){a.removeAllChildren();a.appendChild(b)}else{a.innerHTML=b}},getTransform:function(b){for(name in Element.TRANSFORM_NAMES){var a=b.getStyle(new String(Element.TRANSFORM_NAMES[name]));if(a){return a}}return undefined},setTransform:function(b,a){var c={};Element.TRANSFORM_NAMES.each(function(d){c[d]=a});b.setStyle(c)},getRotateAngle:function(b){var a=b.getTransform();if(a){if(a.match(/rotate\((-?\d+(?:.\d*)?)deg\)/)){return parseFloat(RegExp.$1)}}return 0},setRotateAngle:function(a,b){a.setTransform("rotate("+b+"deg)")},$$:function(a,b){var c=a.select("."+b);return c.length!=0?c[0]:null},$$$:function(a,c){var b=a.select(c);return b.length!=0?b[0]:null},getBounds:function(b){var c=b.cumulativeOffset();var a=b.getDimensions();return new Rectangle(c.left,c.top,a.width,a.height)}});Element.TRANSFORM_NAMES=["transform","WebkitTransform","MozTransform","MsTransform","-ms-transform","OTransform"];function showErrorDialog(a){alert(getErrorString(a))}function getErrorString(a){if(a==null||a.length==0){return MESSAGES["error.unspecified"]}else{return MESSAGES[a[0]]||a[0]}}function hilightNotification(){if(document.URL.match(/#_(\w+)$/)){var a=$(RegExp.$1);if(a){hilightNotificationElement(a)}}}function hilightNotificationElement(a){$(document.body).select(".notify").each(Element.hide);a.show();(function(){dimElement(a,Element.hide)}).delay(10)}function redirectBySuccess(a){return function(){window.location.href=a;window.location.reload(true)}}function showErrors(b,a){$(document.body).select(".notify").each(Element.hide);$(document.body).select(".error").each(Element.hide);$A(b).each(function(d){var c=$("e_"+d.sub(/^error\./,""));if(c){c.show()}else{error([d])}});if(a){$(a).contentWindow.location.href="/resource/empty.html"}}function flashElement(b){var a=["#ffff99","#ffffaa","#ffffbb","#ffffcc","#ffffdd","#ffffee","#ffffff"];var d=0;var c=function(){b.setStyle({backgroundColor:a[d]});++d;if(d<a.length){c.delay(0.1)}};c()}function removeElementWithEffect(a){a.addClassName("removeEffect");dimElement(a,Element.remove)}function dimElement(b,a){var d=1;var c=function(){d-=0.1;b.setOpacity(d);if(d>0){c.delay(0.1)}else{b.setOpacity(1);a(b)}};c()}function selectItem(b,a,c){if(b.hasClassName("selected")){return}b.up(".selector").select("li").each(function(d){d.removeClassName("selected")});b.addClassName("selected");$(document.documentElement).select("."+a).each(Element.hide);$(c).show()}function error(a){showErrorDialog(a)};
