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}},$$: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)}});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)}