Prototype.Browser.versionString="";Prototype.Browser.KHTML=!Prototype.Browser.WebKit&&(navigator.appVersion.indexOf("KHTML/")>0);Prototype.Browser.Chrome=navigator.appVersion.indexOf("Chrome/")>0;Prototype.Browser.Safari=navigator.appVersion.indexOf("Safari/")>0;if(Prototype.Browser.IE){if((iOffset=navigator.appVersion.indexOf("MSIE "))>0){Prototype.Browser.versionString=navigator.appVersion.substring(iOffset+5);if((iOffset=Prototype.Browser.versionString.indexOf(";"))>0){Prototype.Browser.versionString=Prototype.Browser.versionString.substring(0,iOffset)}}}else{if(Prototype.Browser.Gecko){if((iOffset=navigator.userAgent.indexOf("Firefox/"))>0){Prototype.Browser.versionString=navigator.userAgent.substring(iOffset+8);if((iOffset=Prototype.Browser.versionString.indexOf(" "))>0){Prototype.Browser.versionString=Prototype.Browser.versionString.substring(0,iOffset)}}}else{if(Prototype.Browser.WebKit){if((iOffset=navigator.appVersion.indexOf("Version/"))>0){Prototype.Browser.versionString=navigator.appVersion.substring(iOffset+8);if((iOffset=Prototype.Browser.versionString.indexOf(" "))>0){Prototype.Browser.versionString=Prototype.Browser.versionString.substring(0,iOffset)}}}else{if(Prototype.Browser.KHTML){if((iOffset=navigator.appVersion.indexOf("KHTML/"))>0){Prototype.Browser.versionString=navigator.appVersion.substring(iOffset+6);if((iOffset=Prototype.Browser.versionString.indexOf(" "))>0){Prototype.Browser.versionString=Prototype.Browser.versionString.substring(0,iOffset)}}}else{if(Prototype.Browser.Chrome){if((iOffset=navigator.appVersion.indexOf("Chrome/"))>0){Prototype.Browser.versionString=navigator.appVersion.substring(iOffset+7);if((iOffset=Prototype.Browser.versionString.indexOf(" "))>0){Prototype.Browser.versionString=Prototype.Browser.versionString.substring(0,iOffset)}}}}}}}if(Prototype.Browser.versionString.length==0){oRegexp=new RegExp("([\\.\\d]+)");aMatches=navigator.appVersion.match(oRegexp);if(aMatches.length){Prototype.Browser.versionString=aMatches[1]}else{Prototype.Browser.versionString=navigator.appVersion}}Prototype.Browser.version=parseFloat(Prototype.Browser.versionString);if((Prototype.Browser.WebKit&&Prototype.Browser.version<4)||Prototype.Browser.Chrome){Prototype.BrowserFeatures.SelectorsAPI=false}Prototype.Browser.getDimensions=function(){if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;l=document.documentElement.scrollLeft;w=document.documentElement.scrollWidth;h=document.documentElement.scrollHeight}else{if(document.body){t=document.body.scrollTop;l=document.body.scrollLeft;w=document.body.scrollWidth;h=document.body.scrollHeight}}if(self.pageYOffset){l=self.pageXOffset;t=self.pageYOffset}iw=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;ih=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;if(!Prototype.Browser.IE){if(w>iw){ih-=Prototype.Browser.getScrollBarDimension();if(ih>h){ih-=Prototype.Browser.getScrollBarDimension()}}if(h>ih){iw-=Prototype.Browser.getScrollBarDimension();if(iw>w){iw-=Prototype.Browser.getScrollBarDimension()}}}return{offsetX:l,offsetY:t,width:w,height:h,clientWidth:iw,clientHeight:ih}};Prototype.Browser.iScrollBarDimension=-1;Prototype.Browser.getScrollBarDimension=function(){if(Prototype.Browser.iScrollBarDimension==-1){var D=new Element("p");D.setStyle({width:"100%",height:"200px"});var B=new Element("div");B.setStyle({position:"absolute",top:"0px",left:"0px",visibility:"hidden",overflow:"hidden",width:"200px",height:"150px"});B.appendChild(D);document.body.appendChild(B);var C=D.offsetWidth;B.setStyle({overflow:"scroll"});var A=D.offsetWidth;if(C==A){A=B.clientWidth}B.remove();Prototype.Browser.iScrollBarDimension=C-A+(Prototype.Browser.KHTML?4:0)}return Prototype.Browser.iScrollBarDimension};Prototype.Browser.loaded=false;Prototype.Browser.onLoadCallBack=new Array();Prototype.Browser.onLoad=function(B){if(Prototype.Browser.loaded){try{B()}catch(A){Prototype.alertError("Prototype.Browser.onLoad: "+A+" - "+A.description)}}else{Prototype.Browser.onLoadCallBack.push(B)}};Prototype.Browser.domReady=function(){if(Prototype.Browser.loaded){return}Prototype.Browser.loaded=true;for(iIndex=0;iIndex<Prototype.Browser.onLoadCallBack.length;iIndex++){try{Prototype.Browser.onLoadCallBack[iIndex]()}catch(A){Prototype.alertError("Prototype.Browser.onLoad: "+A+" - "+A.description)}}Prototype.Browser.onLoadCallBack.clear()};Event.observe(window,"load",Prototype.Browser.domReady);Event.observe(document,"DOMContentLoaded",Prototype.Browser.domReady);Event.observe(document,"dom:loaded",Prototype.Browser.domReady);Prototype.Browser.log=function(A){try{console.log(A)}catch(B){}};var OverlappingFix=Class.create();if(Prototype.Browser.IE&&Prototype.Browser.version<7){OverlappingFix.addMethods({oIFrame:null,initialize:function(){this.oIFrame=new Element("iframe",{src:"javascript:false;",frameborder:0,scrolling:"no"});this.oIFrame.setStyle({position:"absolute",filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"});this.oIFrame.hide();var A=document.getElementsByTagName("body")[0];A.appendChild(this.oIFrame)},hide:function(){this.oIFrame.hide()},show:function(C){var A=arguments.length==2&&arguments[1];if(A){if(this.oIFrame.up()!=C.up()){this.oIFrame.remove();C.insert({after:this.oIFrame})}}try{this.oIFrame.clonePosition(C);this.oIFrame.setStyle({zIndex:this.getTargetIndex(C)-1,display:"block"})}catch(B){}},update:function(B){B=$(B);var A=B.cumulativeOffset();this.oIFrame.setStyle({width:B.offsetWidth+"px",height:B.offsetHeight+"px",top:A.top+"px",left:A.left+"px",zIndex:this.getTargetIndex(B)-1})},remove:function(){this.oIFrame.remove()},getTargetIndex:function(A){if(A.getStyle("z-index")){return A.getStyle("z-index")}else{if(A.parentNode){return this.getTargetIndex(A.parentNode)}}return 0}})}else{OverlappingFix.addMethods({initialize:function(){},hide:function(){},show:function(){},remove:function(){},update:function(){}})}Prototype.Browser.activateFlashOverlappingFix=function(){if(Prototype.Browser.Gecko&&navigator.userAgent.indexOf("Linux")>-1){var A=0;if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){var B=navigator.plugins["Shockwave Flash"].description;var D=B.indexOf(".");var C=B.indexOf(" ",D);if(C>0){B=B.substring(0,C-1)}C=B.lastIndexOf(" ",D);if(C>0){B=B.substring(C+1,B.length-1);A=parseFloat(B)}}if(A<10){OverlappingFix.addMethods({oIFrame:null,initialize:function(){this.oIFrame=new Element("iframe",{src:"javascript:false;",frameborder:0,scrolling:"no",allowTransparency:"true"});this.oIFrame.setStyle({position:"absolute",opacity:0});this.oIFrame.hide();var E=document.getElementsByTagName("body")[0];E.appendChild(this.oIFrame)},hide:function(){this.oIFrame.hide()},show:function(F){var E=arguments.length==2&&arguments[1];if(E){if(this.oIFrame.up()!=F.up()){this.oIFrame.remove();F.insert({after:this.oIFrame})}}this.oIFrame.clonePosition(F);this.oIFrame.setStyle({zIndex:this.getTargetIndex(F)-1,display:"block"})},update:function(F){F=$(F);var E=F.cumulativeOffset();this.oIFrame.setStyle({width:F.offsetWidth+"px",height:F.offsetHeight+"px",top:E.top+"px",left:E.left+"px",zIndex:this.getTargetIndex(F)-1})},remove:function(){this.oIFrame.remove()},getTargetIndex:function(E){if(E.getStyle("z-index")){return E.getStyle("z-index")}else{if(E.parentNode){return this.getTargetIndex(E.parentNode)}}return 0}})}}};Prototype.Browser.history={lastLocation:"",callbacks:new Hash(),separator:":",timer:null,html5StateSupport:typeof(window.history.pushState)!="undefined",useHtml5:false};Prototype.Browser.addHistory=function(C,A){if(Prototype.Browser.history.html5StateSupport&&Prototype.Browser.history.useHtml5){try{window.history.pushState(C+Prototype.Browser.history.separator+A,document.title,A)}catch(B){Prototype.Browser.history.html5StateSupport=false}}if(!Prototype.Browser.history.html5StateSupport||!Prototype.Browser.history.useHtml5){if(Prototype.Browser.history.lastLocation!=(C+Prototype.Browser.history.separator+A)){if(Prototype.Browser.IE){if($("ajaxHistory")){$("ajaxHistory").src="/shared/history/"+C+Prototype.Browser.history.separator+A}}if(Prototype.Browser.history.timer!=null){clearTimeout(Prototype.Browser.history.timer)}if(Prototype.Browser.WebKit){document.location.hash="#"+C+Prototype.Browser.history.separator+A}else{document.location.hash="#"+C+Prototype.Browser.history.separator+escape(A)}Prototype.Browser.history.lastLocation=C+Prototype.Browser.history.separator+A;if(!Prototype.Browser.IE){Prototype.Browser.checkHistoryChange()}}}};Prototype.Browser.checkHistoryChange=function(){if(Prototype.Browser.history.html5StateSupport&&Prototype.Browser.history.useHtml5){document.body.onpopstate=function(A){Prototype.Browser.historyChanged(A.state);return true}}else{if(Prototype.Browser.IE){if($("ajaxHistory")){iOffset=$("ajaxHistory").contentWindow.document.location.lastIndexOf("/shared/history/");if(iOffset>=0){sCurrentPage=unescape($("ajaxHistory").contentWindow.document.location.substring(iOffset+16))}else{sCurrentPage=""}}else{sCurrentPage=unescape(document.location.hash.substring(1));oIFrame=new Element("IFRAME",{src:"/shared/history/"+sCurrentPage,id:"ajaxHistory",name:"ajaxHistory"});oIFrame.hide();$$("BODY")[0].appendChild(oIFrame)}}else{sCurrentPage=document.location.hash.substring(1);if(Prototype.Browser.Opera){sCurrentPage=unescape(sCurrentPage)}Prototype.Browser.historyChanged(sCurrentPage);Prototype.Browser.history.timer=setTimeout("Prototype.Browser.checkHistoryChange()",200)}}};Prototype.Browser.getCurrentHistoryPage=function(){var B=arguments.length==1?arguments[0]:document.location.hash.substring(1);if(Prototype.Browser.IE||Prototype.Browser.Opera){B=unescape(B)}var A=B.indexOf(Prototype.Browser.history.separator);if(A>0){return{hash:B.substring(0,A),location:B.substring(A+1)}}return null};Prototype.Browser.historyChanged=function(D){if(Prototype.Browser.history.lastLocation!=D){var B=D.indexOf(Prototype.Browser.history.separator);var C="";var E=null;var A="";if(B>0){C=D.substring(0,B);A=D.substring(B+1)}else{A=D}E=Prototype.Browser.history.callbacks.get(C);if(typeof(E)!="function"){E=Prototype.Browser.history.callbacks.get("*")}if(typeof(E)=="function"){E(C,A)}else{document.location.href=document.location.href}Prototype.Browser.history.lastLocation=D}};Prototype.Browser.registerHistoryCallback=function(A,B){if(A==""){A="*"}if(B==null){Prototype.Browser.history.callbacks.unset(A)}else{Prototype.Browser.history.callbacks.set(A,B)}};Prototype.requireVars={regexpFixEmptyVariable:new RegExp("var\\s+([^=;,]+);","g"),regexpFunction:new RegExp("function\\s+([^\\s\\('\"]+)\\s*\\(","g"),regexpFixBlock:new RegExp("(if|for)[s]*\\([^;]+\\)[s]\\{*$"),regexpFixIf:new RegExp("if[\\s]*\\(!([^\\)=\\+\\-]+)\\)[\\s]*(\\{?)(var[\\s]+)?([^=;]+=\\s*(\\{|\\[))","g"),regexpFixVariable:new RegExp("var\\s+","g"),path:null,included:$A(["prototype.js"])};Prototype.require=function(C){testScriptName=C;if(C.indexOf(".php")<0){if((iOffset=C.indexOf("?"))>0){testScriptName=C.substring(0,iOffset)}}if(Prototype.requireVars.included.indexOf(testScriptName)<0){if(C.indexOf(".css")>0){var A=$$("LINK[href*="+C+"]");if(!A.length){Prototype.requireVars.included.push(C);if(C.charAt(0)!="/"){C="/shared/styles/"+C;Prototype.requireVars.included.push("/shared/styles/"+C)}oLink=new Element("link",{rel:"stylesheet",type:"text/css",href:C});aRoot=$$("HEAD,BODY,HTML");if(aRoot.length){aRoot[0].appendChild(oLink)}}}else{var B=$$('SCRIPT[src*="'+C+'"]');if(!B.length){Prototype.requireVars.included.push(testScriptName);if(C.charAt(0)!="/"){if(Prototype.requireVars.path==null){B=$$("SCRIPT[src*=jojoPrototype.js]");Prototype.requireVars.path="";if(B.length){iOffset=B[0].src.indexOf("jojoPrototype.js");Prototype.requireVars.path=B[0].src.substring(0,iOffset)}}C=Prototype.requireVars.path+C;Prototype.requireVars.included.push(C)}Prototype.loadScript(C)}}}};Prototype.loadScript=function(scriptName){var bAsynchronous=arguments.length==2?(parseInt(arguments[2])?true:false):false;tagScriptName=scriptName;oScript=new Element("script",{type:'text/javascript"',src:tagScriptName});aRoot=$$("HEAD,BODY,HTML");if(aRoot.length){new Ajax.Request(scriptName,{method:"GET",evalScripts:false,evalJS:false,asynchronous:bAsynchronous,onSuccess:function(transport){if(typeof(window.execScript)!="undefined"){try{aRoot[0].appendChild(oScript);window.execScript(transport.responseText)}catch(e){Prototype.alertError("Prototype.loadScript ["+scriptName+"]: "+e+" - "+e.description)}}else{try{if(Prototype.Browser.WebKit&&Prototype.Browser.version<4){aRoot[0].appendChild(oScript);var oScript2=document.createElement("script",{type:"text/javascript",src:tagScriptName});oScript2.text=transport.responseText;try{aRoot[0].appendChild(oScript2)}catch(e){Prototype.alertError("Prototype.loadScript ["+scriptName+"]: "+e+" - "+e.description)}}else{if(Prototype.Browser.KHTML){var oScript2=document.createElement("script",{type:"text/javascript",src:tagScriptName});oScript2.innerText=transport.responseText;try{aRoot[0].appendChild(oScript2)}catch(e){Prototype.alertError("Prototype.loadScript ["+scriptName+"]: "+e+" - "+e.description)}}else{if(Prototype.Browser.Gecko&&Prototype.Browser.version<3.5){aRoot[0].appendChild(oScript);window.eval(transport.responseText)}else{aRoot[0].appendChild(oScript);eval.call(window,transport.responseText)}}}}catch(ex){try{eval(transport.responseText,window)}catch(e){Prototype.alertError("Prototype.loadScript ["+scriptName+"]: "+e+" - "+e.description)}}}}})}};Prototype.sprintf=function(){if(arguments===undefined||arguments===null||arguments.length===0){Prototype.alertWarning("sprintf without text");return""}else{if(arguments.length==1){return arguments[0]}else{text=arguments[0];var B=1,A=arguments;return text.replace(/%s/g,function(C){var D=(B in A)?A[B]:C;B++;return D})}}};if(Prototype.debugLevel===undefined||Prototype.debugLevel===null){Prototype.debugLevel=0}Prototype.errorLevel={NODEBUG:0,ERROR:1,WARNING:2,INFO:3};Prototype.getDebugLevel=function(A){if(A==0){return"No debug"}else{if(A==1){return"Erreur"}else{if(A==2){return"Warning"}else{if(A==3){return"Information"}}}}};Prototype.alert=function(B,A){if(Prototype.debugLevel>=B){alert(Prototype.getDebugLevel(B)+" - "+A)}};Prototype.alertError=function(A){Prototype.alert(1,A)};Prototype.alertWarning=function(A){Prototype.alert(2,A)};Prototype.alertInfo=function(A){Prototype.alert(3,A)};Prototype.overlayAlert=function(C,B){try{Prototype.require("superadmin/overlay.css");Prototype.require("jojoPopup.js");Prototype.require("superadmin.locale.js.php");options={title:"Confirmation",onValid:function(){},zIndex:666};Object.extend(options,B||{});Container=new Element("div",{id:"divOverlayAlert","class":"Overlay",style:"display:none"});ContainerShadow=new Element("div",{"class":"ombrage_interieur"});ContainerBlock=new Element("div",{id:"overlay_divOverlayAlert",display:"block"});ContainerHeader=new Element("div",{id:"overlay_header_divOverlayAlert","class":"headerOverlay headerOverlayBlue"});ContainerHeaderTitle=new Element("div",{id:"overlay_title_divOverlayAlert","class":"titleOverlay"});ContainerHeader.appendChild(ContainerHeaderTitle.update(options.title));ContainerBlock.appendChild(ContainerHeader);ContainerContent=new Element("div",{id:"overlay_content_divOverlayAlert","class":"contentOverlay",style:"text-align:center"});ContainerContent.update("<h4>"+C+"</h4>");ContainerBlock.appendChild(ContainerContent);ContainerFooter=new Element("div",{id:"overlay_bottom_divOverlayAlert","class":"footerOverlay",style:"padding-left: 210px;"});BtnValid=new Element("div",{id:"BtnOverlayAlertValid","class":"button1 shortValidButton",onstartselect:"return false",onmousedown:"return false",onmouseout:"this.removeClassName('button1_hover')",onmouseover:"this.addClassName('button1_hover')",style:"text-align:center"});BtnValid.observe("click",function(){$("divOverlayAlert").object.hide();this.onValid()}.bind(BtnValid));BtnValid.onValid=options.onValid;BtnValid.appendChild(new Element("img",{src:"/shared/images/superadmin/icons/16x16/ico-apply.png",style:"vertical-align: middle;"}));BtnValid.appendChild(new Element("span").update(Overlay_translation.valider));ContainerFooter.appendChild(BtnValid);ContainerBlock.appendChild(ContainerFooter);ContainerShadow.appendChild(ContainerBlock);Container.appendChild(ContainerShadow);$$("BODY")[0].appendChild(Container);$("divOverlayAlert").object=new Popup("divOverlayAlert",{fadeBackground:true,shadow:true,showEffect:{method:"appear",options:{duration:0.3}},hideEffect:{method:"fade",options:{duration:0.3}},onHide:function(){$("divOverlayAlert").remove()},zIndex:options.zIndex});$("divOverlayAlert").object.show()}catch(A){alert(A)}};Prototype.overlayConfirm=function(C,B){try{Prototype.require("superadmin/overlay.css");Prototype.require("jojoPopup.js");Prototype.require("superadmin.locale.js.php");options={title:"Confirmation",onValid:function(){},onCancel:function(){},zIndex:666};Object.extend(options,B||{});Container=new Element("div",{id:"divOverlayConfirm","class":"Overlay",style:"display:none"});ContainerShadow=new Element("div",{"class":"ombrage_interieur"});ContainerBlock=new Element("div",{id:"overlay_divOverlayConfirm",display:"block"});ContainerHeader=new Element("div",{id:"overlay_header_divOverlayConfirm","class":"headerOverlay headerOverlayBlue"});ContainerHeaderTitle=new Element("div",{id:"overlay_title_divOverlayConfirm","class":"titleOverlay"});ContainerHeader.appendChild(ContainerHeaderTitle.update(options.title));ContainerBlock.appendChild(ContainerHeader);ContainerContent=new Element("div",{id:"overlay_content_divOverlayConfirm","class":"contentOverlay",style:"text-align:center"});ContainerContent.update("<h4>"+C+"</h4>");ContainerBlock.appendChild(ContainerContent);ContainerFooter=new Element("div",{id:"overlay_bottom_divOverlayConfirm","class":"footerOverlay",style:"padding-left: 150px;"});BtnValid=new Element("div",{id:"BtnOverlayAlertValid","class":"button1 shortValidButton",onstartselect:"return false",onmousedown:"return false",onmouseout:"this.removeClassName('button1_hover')",onmouseover:"this.addClassName('button1_hover')",style:"text-align:center"});BtnValid.observe("click",function(){$("divOverlayConfirm").object.hide();this.onValid()}.bind(BtnValid));BtnValid.onValid=options.onValid;BtnValid.appendChild(new Element("img",{src:"/shared/images/superadmin/icons/16x16/ico-apply.png",style:"vertical-align: middle;"}));BtnValid.appendChild(new Element("span").update(Overlay_translation.valider));ContainerFooter.appendChild(BtnValid);BtnCancel=new Element("div",{id:"BtnOverlayAlertCancel","class":"button1 shortValidButton",onstartselect:"return false",onmousedown:"return false",onmouseout:"this.removeClassName('button1_hover')",onmouseover:"this.addClassName('button1_hover')",style:"text-align:center"});BtnCancel.observe("click",function(){$("divOverlayConfirm").object.hide();this.onCancel()}.bind(BtnCancel));BtnCancel.onCancel=options.onCancel;BtnCancel.appendChild(new Element("img",{src:"/shared/images/superadmin/icons/16x16/ico-cancel.png",style:"vertical-align: middle;"}));BtnCancel.appendChild(new Element("span").update(Overlay_translation.annuler));ContainerFooter.appendChild(BtnCancel);ContainerBlock.appendChild(ContainerFooter);ContainerShadow.appendChild(ContainerBlock);Container.appendChild(ContainerShadow);$$("BODY")[0].appendChild(Container);$("divOverlayConfirm").object=new Popup("divOverlayConfirm",{fadeBackground:true,shadow:true,showEffect:{method:"appear",options:{duration:0.3}},hideEffect:{method:"fade",options:{duration:0.3}},onHide:function(){$("divOverlayConfirm").remove()},zIndex:options.zIndex});$("divOverlayConfirm").object.show()}catch(A){alert(A)}};Date.prototype.getTradDays=function(B){Prototype.require("superadmin.locale.js.php");var A=[Date_translation.lundi,Date_translation.mardi,Date_translation.mercredi,Date_translation.jeudi,Date_translation.vendredi,Date_translation.samedi,Date_translation.dimanche];return A[(B+6)%7].ucfirst().substr(0,3)};Date.prototype.getTradMonth=function(B){Prototype.require("superadmin.locale.js.php");var A=[Date_translation.janvier,Date_translation.fevrier,Date_translation.mars,Date_translation.avril,Date_translation.mai,Date_translation.juin,Date_translation.juillet,Date_translation.aout,Date_translation.septembre,Date_translation.octobre,Date_translation.novembre,Date_translation.decembre];return A[B%12].ucfirst()};Date.prototype.clone=function(){return new Date(this.getTime())};Date.prototype.WeekNbr=function(A){var B=new Date(this.getFullYear(),0,1);firstDay=B.clone();if(firstDay.getDay()<=4){firstDay=firstDay.add(firstDay.getDay()*(-1))}else{firstDay=firstDay.add(firstDay.getDay()*(-1));firstDay=firstDay.add(7)}if(A==1){firstDay=firstDay.add(1)}var C=0;C=firstDay.dateDiffWeek(this)+1;if((C==53)&&B.getDay()<4){C=1}return C};Date.prototype.DayFromWeek=function(C,A){var B=new Date(this.getFullYear(),0,1);firstDay=B.clone();if(firstDay.getDay()<=4){firstDay=firstDay.add(firstDay.getDay()*(-1))}else{firstDay=firstDay.add(firstDay.getDay()*(-1));firstDay=firstDay.add(7)}firstDay=firstDay.add(A);firstDay=firstDay.add((C-1)*7);return firstDay};Date.prototype.daysInMonth=function(){var A=new Date(this.getFullYear(),this.getMonth(),28);var B=28;for(B=28;B<=32;B++){A.setDate(B);if(A.getMonth()!=this.getMonth()){return(B-1)}}};Date.prototype.getFirstDateMonth=function(){var A;if(this instanceof Date){A=new Date(this)}else{A=new Date()}A.setDate(1);return A};Date.prototype.getLastDateMonth=function(){var A=this.addMonth(1);A.setDate(1);return A.add(-1)};Date.prototype.dateDiff=function(A){return Math.round((A.valueOf()-this.valueOf())/86400000)};Date.prototype.dateDiffWeek=function(A){return parseInt((parseInt(this.dateDiff(A)-1)+1)/7)};Date.prototype.timeDifference=function(A){return this.getTime()-A.getTime()};Date.prototype.add=function(B){var A=new Date(this);A.setDate(A.getDate()+B);return A};Date.prototype.addHours=function(B){var A=new Date(this);A.setHours(this.getHours()+B);return A};Date.prototype.addMonth=function(B){var A=new Date(this);A.setMonth(A.getMonth()+B);return A};Date.prototype.addYear=function(B){var A=new Date(this);A.setFullYear(A.getFullYear()+B);return A};Date.prototype.isLeapYear=function(){var A=new Date(this.getFullYear(),1,29);return(A.getMonth()==1)};Date.prototype.getDayInYear=function(){return Math.floor(this.getHourInYear()/24)};Date.prototype.getHourInYear=function(){return Math.floor(this.getMinuteInYear()/60)};Date.prototype.getMinuteInYear=function(){return Math.floor(this.getSecondInYear()/60)};Date.prototype.getSecondInYear=function(){return Math.floor(this.getMillisecondInYear()/1000)};Date.prototype.getMillisecondInYear=function(){return this.timeDifference(new Date(this.getFullYear(),0,1))};Date.prototype.convertToDateOnly=function(){var A=new Date(this);A.setHours(0);A.setMinutes(0);A.setSeconds(0);A.setMilliseconds(0);return A};String.prototype.ucfirst=function(){var A=this.charAt(0).toUpperCase();return A+this.substr(1)};Ajax.Base.addMethods({abort:function(){if(!this._complete){var A=new Ajax.Response(this);this.transport.aborted=true;this.transport.abort();if(this.options.onAbort){this.options.onAbort(A)}else{if(this.options.onFailure){this.options.onFailure(A)}}}}});function simulateEvent(D,C,B,A){if(C.indexOf(":")>=0){Event.fire(D,C,B,A)}else{aMouseEvents=["click","mouseup","mousedown","mouseover","mouseout","mousemouve","mouseenter","mouseleave"];D=$(D);if(Object.isUndefined(A)){A=true}if(D==document&&document.createEvent&&!D.dispatchEvent){D=document.documentElement}var E;if(document.createEvent){if(aMouseEvents.include(C.toLowerCase())){parameters=Object.extend({detail:0,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,button:0,relatedTarget:null},arguments[4]||{});E=document.createEvent("MouseEvents");E.initMouseEvent(C,A,true,window,parameters.detail,parameters.screenX,parameters.screenY,parameters.clientX,parameters.clientY,parameters.ctrlKey,parameters.altKey,parameters.shiftKey,parameters.metaKey,parameters.button,parameters.relatedTarget)}else{E=document.createEvent("UIEvents");E.initUIEvent(C,A,true,window,0);parameters=arguments[4]||{};Object.extend(E,parameters)}}else{E=document.createEventObject();parameters=arguments[4]||{};Object.extend(E,parameters);E.eventType="on"+C}E.eventName=C;E.memo=B||{};if(document.createEvent){D.dispatchEvent(E)}else{D.fireEvent(E.eventType,E)}return Event.extend(E)}}Object.extend(Event,{simulateEvent:simulateEvent});Object.extend(document,{simulateEvent:simulateEvent.methodize()});Element.addMethods({simulateEvent:simulateEvent,updateEx:function(element,content){Element.update(element,content.stripScripts());var regexp=null;regexp=new RegExp("<script[^>]+src=\\s*(\"[^\"]+\"|'[^']+')[^>]*>([\\S\\s]*?)<\/script>","img");content=content.replace(regexp,"<SCRIPT>Prototype.loadScript($1);$2</SCRIPT>");content.extractScripts().each(function(script){try{eval(script.replace("<!--","").replace("-->",""))}catch(e){Prototype.alertError("Error : script eval error : "+e.message)}})},cumulativeZIndex:function(B){B=$(B);var C=B.getStyle("z-index");if(C){return C}var A=$(B.parentNode);if(A&&typeof(A.cumulativeZIndex)!="undefined"){return A.cumulativeZIndex()}return 0}});if(Prototype.Browser.IE&&Prototype.Browser.version>=7&&Prototype.Browser.version<8){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(B,A){A=$(A);try{if(!A.offsetParent){return $(document.body)}}catch(C){return $(document.body)}return B(A)})};