if(typeof Zapatec=="undefined"){Zapatec={}}Zapatec.Utils={};Zapatec.Utils.getAbsolutePos=function(e){var a=0,d=0;var c=/^div$/i.test(e.tagName);if(c&&e.scrollLeft){a=e.scrollLeft}if(c&&e.scrollTop){d=e.scrollTop}var f={x:e.offsetLeft-a,y:e.offsetTop-d};if(e.offsetParent){var b=this.getAbsolutePos(e.offsetParent);f.x+=b.x;f.y+=b.y}return f};Zapatec.Utils.fixBoxPosition=function(d){if(d.x<0){d.x=0}if(d.y<0){d.y=0}var e=Zapatec.Utils.createElement("div");var c=e.style;c.position="absolute";c.right=c.bottom=c.width=c.height="0px";window.document.body.appendChild(e);var b=Zapatec.Utils.getAbsolutePos(e);window.document.body.removeChild(e);if(Zapatec.is_ie){b.y+=window.document.body.scrollTop;b.x+=window.document.body.scrollLeft}else{b.y+=window.scrollY;b.x+=window.scrollX}var a=d.x+d.width-b.x;if(a>0){d.x-=a}a=d.y+d.height-b.y;if(a>0){d.y-=a}};Zapatec.Utils.isRelated=function(c,a){a||(a=window.event);var f=a.relatedTarget;if(!f){var b=a.type;if(b=="mouseover"){f=a.fromElement}else{if(b=="mouseout"){f=a.toElement}}}try{while(f){if(f==c){return true}f=f.parentNode}}catch(d){}return false};Zapatec.Utils.removeClass=function(e,d){if(!(e&&e.className)){return}var a=e.className.split(" ");var b=[];for(var c=a.length;c>0;){if(a[--c]!=d){b[b.length]=a[c]}}e.className=b.join(" ")};Zapatec.Utils.addClass=function(b,a){Zapatec.Utils.removeClass(b,a);b.className+=" "+a};Zapatec.Utils.getElement=function(a){if(Zapatec.is_ie){return window.event.srcElement}else{return a.currentTarget}};Zapatec.Utils.getTargetElement=function(a){if(Zapatec.is_ie){return window.event.srcElement}else{return a.target}};Zapatec.Utils.stopEvent=function(a){a||(a=window.event);if(a){if(Zapatec.is_ie){a.cancelBubble=true;a.returnValue=false}else{a.preventDefault();a.stopPropagation()}}return false};Zapatec.Utils.addEvent=function(a,c,b){if(a.attachEvent){a.attachEvent("on"+c,b)}else{if(a.addEventListener){a.addEventListener(c,b,false)}else{a["on"+c]=b}}};Zapatec.Utils.removeEvent=function(a,c,b){if(a.detachEvent){a.detachEvent("on"+c,b)}else{if(a.removeEventListener){a.removeEventListener(c,b,false)}else{a["on"+c]=null}}};Zapatec.Utils.createElement=function(d,c,a){var b=null;if(window.self.document.createElementNS){b=window.self.document.createElementNS("http://www.w3.org/1999/xhtml",d)}else{b=window.self.document.createElement(d)}if(typeof c!="undefined"&&c!=null){c.appendChild(b)}if(!a){if(Zapatec.is_ie){b.setAttribute("unselectable",true)}if(Zapatec.is_gecko){b.style.setProperty("-moz-user-select","none","")}}return b};Zapatec.Utils.writeCookie=function(c,e,d,f,b){e=escape(e);var a=c+"="+e,g;if(d){a+=";domain="+d}if(f){a+=";path="+f}if(b){g=new Date();g.setTime(b*86400000+g.getTime());a+=";expires="+g.toGMTString()}document.cookie=a};Zapatec.Utils.getCookie=function(b){var e=b+"=";var d=0;while(d<document.cookie.length){var a=d+e.length;if(document.cookie.substring(d,a)==e){var c=document.cookie.indexOf(";",a);if(c==-1){c=document.cookie.length}return unescape(document.cookie.substring(a,c))}d=document.cookie.indexOf(" ",d)+1;if(d==0){break}}return null};Zapatec.Utils.makePref=function(c){function d(e){if(typeof e=="object"&&!e){return"null"}else{if(typeof e=="number"||typeof e=="boolean"){return e}else{if(typeof e=="string"){return'"'+e.replace(/\22/,"\\22")+'"'}else{return null}}}}var a="",b;for(b in c){a+=(a?",'":"'")+b+"':"+d(c[b])}return a};Zapatec.Utils.loadPref=function(txt){var obj=null;try{eval("obj={"+txt+"}")}catch(e){}return obj};Zapatec.Utils.mergeObjects=function(a,c){for(var b in c){a[b]=c[b]}};Zapatec.Utils.__wch_id=0;Zapatec.Utils.createWCH=function(a){var c=null;a=a||window.self.document.body;if(Zapatec.is_ie&&!Zapatec.is_ie5){var b="filter:progid:DXImageTransform.Microsoft.alpha(style=0,opacity=0);";var d="WCH"+(++Zapatec.Utils.__wch_id);a.insertAdjacentHTML("beforeEnd",'<iframe id="'+d+'" scroll="no" frameborder="0" style="z-index:0;position:absolute;visibility:hidden;'+b+'border:0;top:10;left:100;width:0;height:0;" src="javascript:false;"></iframe>');c=window.self.document.getElementById(d)}return c};Zapatec.Utils.setupWCH_el=function(j,a,d){if(j){var k=Zapatec.Utils.getAbsolutePos(a),g=k.x,n=k.y,c=g+a.offsetWidth,m=n+a.offsetHeight;if(d){var l=Zapatec.Utils.getAbsolutePos(d),i=l.x,e=l.y,h=i+d.offsetWidth,b=e+d.offsetHeight;if(g>i){g=i}if(n>e){n=e}if(c<h){c=h}if(m<b){m=b}}Zapatec.Utils.setupWCH(j,g,n,c-g,m-n)}};Zapatec.Utils.setupWCH=function(e,a,g,b,d){if(e){var c=e.style;(typeof a!="undefined")&&(c.left=a+"px");(typeof g!="undefined")&&(c.top=g+"px");(typeof b!="undefined")&&(c.width=b+"px");(typeof d!="undefined")&&(c.height=d+"px");c.visibility="inherit"}};Zapatec.Utils.hideWCH=function(a){if(a){a.style.visibility="hidden"}};Zapatec.Utils.getPageScrollY=function(){return window.pageYOffset||document.documentElement.scrollTop||(document.body?document.body.scrollTop:0)||0};Zapatec.ScrollWithWindow={};Zapatec.ScrollWithWindow.list=[];Zapatec.ScrollWithWindow.stickiness=0.25;Zapatec.ScrollWithWindow.register=function(a){var c=parseInt(a.style.top)||0;var b=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop||0;c-=b;if(c<0){c=0}Zapatec.ScrollWithWindow.list[Zapatec.ScrollWithWindow.list.length]={node:a,origTop:c}};Zapatec.ScrollWithWindow.unregister=function(b){for(var a=0;a<Zapatec.ScrollWithWindow.list.length;a++){var c=Zapatec.ScrollWithWindow.list[a];if(b==c.node){Zapatec.ScrollWithWindow.list.splice(a,1);return}}};Zapatec.ScrollWithWindow.handler=function(a){oldScrollY+=((a-oldScrollY)*this.stickiness);if(Math.abs(oldScrollY-a)<=1){oldScrollY=a}for(var c=0;c<Zapatec.ScrollWithWindow.list.length;c++){var d=Zapatec.ScrollWithWindow.list[c];var b=d.node;if(!d.origTop){d.origTop=Zapatec.Utils.getAbsolutePos(b).y;b.style.position="absolute"}b.style.top=d.origTop+parseInt(oldScrollY)+"px"}};var oldScrollY=Zapatec.Utils.getPageScrollY();setInterval("var newScrollY = Zapatec.Utils.getPageScrollY(); if (newScrollY != oldScrollY) { Zapatec.ScrollWithWindow.handler(newScrollY); }",50);Zapatec.Utils.destroy=function(a){if(a&&a.parentNode){a.parentNode.removeChild(a)}};Zapatec.Utils.newCenteredWindow=function(a,h,b,i,f){var d=0;var g=0;if(screen.width){d=(screen.width-b)/2}if(screen.height){g=(screen.height-i)/2}var c="height="+i+",width="+b+",top="+g+",left="+d+",scrollbars="+f+",resizable";var e=window.open(a,h,c);return e};Zapatec.Utils.getWindowSize=function(){var a=0;var b=0;if(document.compatMode&&document.compatMode=="CSS1Compat"){if(window.opera){a=document.body.clientWidth||0;b=document.body.clientHeight||0}else{a=document.documentElement.clientWidth||0;b=document.documentElement.clientHeight||0}}else{a=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth||0;b=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight||0}return{width:a,height:b}};Zapatec.Utils.selectOption=function(sel,val,call_default){var a=sel.options,i,o;for(i=a.length;--i>=0;){o=a[i];o.selected=(o.val==val)}sel.value=val;if(call_default){if(typeof sel.onchange=="function"){sel.onchange()}else{if(typeof sel.onchange=="string"){eval(sel.onchange)}}}};Zapatec.Utils.getNextSibling=function(c,a,b){c=c.nextSibling;if(!a){return c}a=a.toLowerCase();if(b){b=b.toLowerCase()}while(c){if(c.nodeType==1&&(c.tagName.toLowerCase()==a||(b&&c.tagName.toLowerCase()==b))){return c}c=c.nextSibling}return c};Zapatec.Utils.getFirstChild=function(c,a,b){if(!c){return null}c=c.firstChild;if(!c){return null}if(!a){return c}a=a.toLowerCase();if(c.nodeType==1){if(c.tagName.toLowerCase()==a){return c}else{if(b){b=b.toLowerCase();if(c.tagName.toLowerCase()==b){return c}}}}return Zapatec.Utils.getNextSibling(c,a,b)};Zapatec.Utils.getChildText=function(c){if(c==null){return""}var b=[];var a=c.firstChild;while(a!=null){if(a.nodeType==3){b.push(a.data)}a=a.nextSibling}return b.join(" ")};Zapatec.Utils.insertAfter=function(b,a){if(b.nextSibling){b.parentNode.insertBefore(a,b.nextSibling)}else{b.parentNode.appendChild(a)}};Zapatec.Utils._ids={};Zapatec.Utils.generateID=function(a,b){if(typeof b=="undefined"){if(typeof this._ids[a]=="undefined"){this._ids[a]=0}b=++this._ids[a]}return"zapatec-"+a+"-"+b};Zapatec.Utils.addTooltip=function(b,a){return new Zapatec.Tooltip(b,a)};Zapatec.isLite=true;Zapatec.Utils.checkActivation=function(){if(!Zapatec.isLite){return true}var g=[];add_product=function(j,i,k){g[j]={webdir:i,name:k,bActive:false}};add_product("calendar.js","prod1","Calendar");add_product("menu.js","prod2","Menu");add_product("tree.js","prod3","Tree");add_product("form.js","forms","Forms");add_product("effects.js","effects","Effects");add_product("hoverer.js","effects","Effects - Hoverer");add_product("slideshow.js","effects","Effects - Slidshow");add_product("zpgrid.js","grid","Grid");add_product("slider.js","slider","Slider");add_product("zptabs.js","tabs","Tabs");add_product("zptime.js","time","Time");add_product("window.js","windows","Window");var e,h,d;var b=false;var a=document.getElementsByTagName("script");for(d=0;d<a.length;d++){if(/wizard.js/i.test(a[d].src)){return true}h=a[d].src.split("/");if(h.length==0){e=a[d]}else{e=h[h.length-1]}e=e.toLowerCase();if(typeof g[e]!="undefined"){b=true;g[e].bActive=true}}if(!b){return true}var f=document.getElementsByTagName("A");for(d=0;d<f.length;d++){if(/(dev|www)\.zapatec\.com/i.test(f[d].href)){return true}}var c="You are using the Free version of the Zapatec Software.\nWhile using the Free version, a link to www.zapatec.com in this page is required.";for(d in g){if(g[d].bActive==true){c+="\nTo purchase the Zapatec "+g[d].name+" visit www.zapatec.com/website/main/products/"+g[d].webdir+"/"}}return false};Zapatec.is_opera=/opera/i.test(navigator.userAgent);Zapatec.is_ie=(/msie/i.test(navigator.userAgent)&&!Zapatec.is_opera);Zapatec.is_ie5=(Zapatec.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Zapatec.is_mac_ie=(/msie.*mac/i.test(navigator.userAgent)&&!Zapatec.is_opera);Zapatec.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Zapatec.is_konqueror=/Konqueror/i.test(navigator.userAgent);Zapatec.is_gecko=/Gecko/i.test(navigator.userAgent);if(!Function.prototype.call){Function.prototype.call=function(){var self=arguments[0];self._this_func=this;var args=new Array();for(var i=1;i<arguments.length;i++){args[args.length]="arguments["+i+"]"}var ret=eval("self._this_func("+args.join(",")+")");self._this_func=null;return ret}}if(!Array.prototype.pop){Array.prototype.pop=function(){var a;if(this.length){a=this[this.length-1];this.length-=1}return a}}if(!Array.prototype.push){Array.prototype.push=function(){for(var a=0;a<arguments.length;a++){this[this.length]=arguments[a]}return this.length}}if(!Array.prototype.shift){Array.prototype.shift=function(){var b;if(this.length){b=this[0];for(var a=0;a<this.length-1;a++){this[a]=this[a+1]}this.length-=1}return b}}if(!Array.prototype.unshift){Array.prototype.unshift=function(){if(arguments.length){var b,a=arguments.length;for(b=this.length+a-1;b>=a;b--){this[b]=this[b-a]}for(b=0;b<a;b++){this[b]=arguments[b]}}return this.length}}if(!Array.prototype.splice){Array.prototype.splice=function(a,c){var d=[],e=[],b;for(b=2;b<arguments.length;b++){d.push(arguments[b])}for(b=a;(b<a+c)&&(b<this.length);b++){e.push(this[b])}for(b=a+c;b<this.length;b++){this[b-c]=this[b]}this.length-=e.length;for(b=this.length+d.length-1;b>=a+d.length;b--){this[b]=this[b-d.length]}for(b=0;b<d.length;b++){this[a+b]=d[b]}return e}}Zapatec.Log=function(a){if(!a){return}var b=a.description;if(a.severity){b=a.severity+":\n"+b}};Zapatec.Utils.Array={};Zapatec.Utils.Array.insertBefore=function(b,f,e,a){var d=new Array();for(var c in b){if(c==a){if(e){d[e]=f}else{d.push(f)}}d[c]=b[c]}return d};
Zapatec.Calendar=function(d,c,g,b){this.bShowHistoryEvent=false;this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=g||null;this.onClose=b||null;this.onFDOW=null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.minMonth=0;this.maxMonth=11;this.dateFormat=Zapatec.Calendar.i18n("DEF_DATE_FORMAT");this.ttDateFormat=Zapatec.Calendar.i18n("TT_DATE_FORMAT");this.historyDateFormat="%B %d, %Y";this.isPopup=true;this.weekNumbers=true;this.noGrab=false;if(Zapatec.Calendar.prefs.fdow||(Zapatec.Calendar.prefs.fdow==0)){this.firstDayOfWeek=parseInt(Zapatec.Calendar.prefs.fdow,10)}else{var f=0;if(typeof d=="number"){f=d}else{if(typeof Zapatec.Calendar._FD=="number"){f=Zapatec.Calendar._FD}}this.firstDayOfWeek=f}this.showsOtherMonths=false;this.dateStr=c;this.showsTime=false;this.sortOrder="asc";this.time24=true;this.timeInterval=null;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=new Array();this.firstdayname=null;this.monthsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.yearsCombo=null;this.hilitedYear=null;this.activeYear=null;this.histCombo=null;this.hilitedHist=null;this.dateClicked=false;this.numberMonths=1;this.controlMonth=1;this.vertical=false;this.monthsInRow=1;this.titles=new Array();this.rowsOfDayNames=new Array();this.helpButton=true;this.disableFdowClick=false;Zapatec.Calendar._initSDN()};Zapatec.Calendar._initSDN=function(){if(typeof Zapatec.Calendar._TT._SDN=="undefined"){if(typeof Zapatec.Calendar._TT._SDN_len=="undefined"){Zapatec.Calendar._TT._SDN_len=3}var b=[];for(var c=8;c>0;){b[--c]=Zapatec.Calendar._TT._DN[c].substr(0,Zapatec.Calendar._TT._SDN_len)}Zapatec.Calendar._TT._SDN=b;if(typeof Zapatec.Calendar._TT._SMN_len=="undefined"){Zapatec.Calendar._TT._SMN_len=3}b=[];for(var c=12;c>0;){b[--c]=Zapatec.Calendar._TT._MN[c].substr(0,Zapatec.Calendar._TT._SMN_len)}Zapatec.Calendar._TT._SMN=b}};Zapatec.Calendar.i18n=function(d,b){var c="";if(!b){if(Zapatec.Calendar._TT){c=Zapatec.Calendar._TT[d]}if(!c&&Zapatec.Calendar._TT_en){c=Zapatec.Calendar._TT_en[d]}}else{switch(b){case"dn":c=Zapatec.Calendar._TT._DN[d];break;case"sdn":c=Zapatec.Calendar._TT._SDN[d];break;case"mn":c=Zapatec.Calendar._TT._MN[d];break;case"smn":c=Zapatec.Calendar._TT._SMN[d];break}}if(!c){c=""+d}return c};Zapatec.Calendar._C=null;Zapatec.Calendar.prefs={fdow:null,history:"",sortOrder:"asc",hsize:9};Zapatec.Calendar.savePrefs=function(){Zapatec.Utils.writeCookie("ZP_CAL",Zapatec.Utils.makePref(this.prefs),null,"/",30)};Zapatec.Calendar.loadPrefs=function(){var b=Zapatec.Utils.getCookie("ZP_CAL"),c;if(b){c=Zapatec.Utils.loadPref(b);if(c){Zapatec.Utils.mergeObjects(this.prefs,c)}}};Zapatec.Calendar._add_evs=function(b){var c=Zapatec.Calendar;Zapatec.Utils.addEvent(b,"mousedown",c.dayMouseDown);Zapatec.Utils.addEvent(b,"mouseout",c.dayMouseOut);if(Zapatec.is_ie){Zapatec.Utils.addEvent(b,"dblclick",c.dayMouseDblClick)}};Zapatec.Calendar._del_evs=function(b){var c=this;Zapatec.Utils.removeEvent(b,"mouseover",c.dayMouseOver);Zapatec.Utils.removeEvent(b,"mousedown",c.dayMouseDown);Zapatec.Utils.removeEvent(b,"mouseout",c.dayMouseOut);if(Zapatec.is_ie){Zapatec.Utils.removeEvent(b,"dblclick",c.dayMouseDblClick)}};Zapatec.Calendar.findMonth=function(b){if(typeof b.month!="undefined"){return b}else{if(b.parentNode&&typeof b.parentNode.month!="undefined"){return b.parentNode}}return null};Zapatec.Calendar.findHist=function(b){if(typeof b.histDate!="undefined"){return b}else{if(b.parentNode&&typeof b.parentNode.histDate!="undefined"){return b.parentNode}}return null};Zapatec.Calendar.findYear=function(b){if(typeof b.year!="undefined"){return b}else{if(b.parentNode&&typeof b.parentNode.year!="undefined"){return b.parentNode}}return null};Zapatec.Calendar.showMonthsCombo=function(){var c=Zapatec.Calendar._C;if(!c){return false}var f=c.activeDiv;var p=c.monthsCombo;var h=c.date,q=c.date.getMonth(),d=c.date.getFullYear(),l=(d==c.minYear),o=(d==c.maxYear);for(var n=p.firstChild;n;n=n.nextSibling){var g=n.month;Zapatec.Utils.removeClass(n,"hilite");Zapatec.Utils.removeClass(n,"active");Zapatec.Utils.removeClass(n,"disabled");n.disabled=false;if((l&&g<c.minMonth)||(o&&g>c.maxMonth)){Zapatec.Utils.addClass(n,"disabled");n.disabled=true}if(g==q){Zapatec.Utils.addClass(c.activeMonth=n,"active")}}var r=p.style;r.display="none";if(f.navtype<0){r.left=f.offsetLeft+"px"}else{var b=p.offsetWidth;if(typeof b=="undefined"){b=50}r.left=(f.offsetLeft+f.offsetWidth-b)+"px"}r.top=(f.offsetTop+f.offsetHeight)+"px";c.updateWCH(p)};Zapatec.Calendar.showHistoryCombo=function(){var c=Zapatec.Calendar._C,n,l,f,d,m,o,g,b;if(!c){return false}m=c.histCombo;while(m.firstChild){m.removeChild(m.lastChild)}if(Zapatec.Calendar.prefs.history){n=Zapatec.Calendar.prefs.history.split(/,/);f=0;while(g=n[f++]){g=g.split(/\//);l=Zapatec.Utils.createElement("div");l.className=Zapatec.is_ie?"label-IEfix":"label";l.histDate=new Date(parseInt(g[0],10),parseInt(g[1],10)-1,parseInt(g[2],10),g[3]?parseInt(g[3],10):0,g[4]?parseInt(g[4],10):0);l.appendChild(window.document.createTextNode(l.histDate.print(c.historyDateFormat)));m.appendChild(l);if(l.histDate.dateEqualsTo(c.date)){Zapatec.Utils.addClass(l,"active")}}}d=c.activeDiv;o=m.style;o.display="none";o.left=Math.floor(d.offsetLeft+(d.offsetWidth-m.offsetWidth)/2)+"px";o.top=(d.offsetTop+d.offsetHeight)+"px";c.updateWCH(m);c.bEventShowHistory=true};Zapatec.Calendar.showYearsCombo=function(f){var b=Zapatec.Calendar._C;if(!b){return false}var d=b.activeDiv;var h=b.yearsCombo;if(b.hilitedYear){Zapatec.Utils.removeClass(b.hilitedYear,"hilite")}if(b.activeYear){Zapatec.Utils.removeClass(b.activeYear,"active")}b.activeYear=null;var c=b.date.getFullYear()+(f?1:-1);var n=h.firstChild;var m=false;for(var g=12;g>0;--g){if(c>=b.minYear&&c<=b.maxYear){n.firstChild.data=c;n.year=c;n.style.display="none";m=true}else{n.style.display="none"}n=n.nextSibling;c+=f?b.yearStep:-b.yearStep}if(m){var o=h.style;o.display="none";if(d.navtype<0){o.left=d.offsetLeft+"px"}else{var l=h.offsetWidth;if(typeof l=="undefined"){l=50}o.left=(d.offsetLeft+d.offsetWidth-l)+"px"}o.top=(d.offsetTop+d.offsetHeight)+"px"}b.updateWCH(h)};Zapatec.Calendar.tableMouseUp=function(g){var l=Zapatec.Calendar._C;if(!l){return false}if(l.timeout){clearTimeout(l.timeout)}var f=l.activeDiv;if(!f){return false}var i=Zapatec.Utils.getTargetElement(g);if(typeof(f.navtype)=="undefined"){while(!i.calendar){i=i.parentNode}}g||(g=window.event);Zapatec.Utils.removeClass(f,"active");if(i==f||i.parentNode==f){Zapatec.Calendar.cellClick(f,g)}var d=Zapatec.Calendar.findMonth(i);var b=null;if(d){if(!d.disabled){b=new Date(l.date);if(d.month!=b.getMonth()){b.setMonth(d.month);l.setDate(b,true);l.dateClicked=false;l.callHandler()}}}else{var c=Zapatec.Calendar.findYear(i);if(c){b=new Date(l.date);if(c.year!=b.getFullYear()){b.setFullYear(c.year);l.setDate(b,true);l.dateClicked=false;l.callHandler()}}else{var h=Zapatec.Calendar.findHist(i);if(h&&!h.histDate.dateEqualsTo(l.date)){b=new Date(h.histDate);l._init(l.firstDayOfWeek,l.date=b);l.dateClicked=false;l.callHandler();l.updateHistory()}}}Zapatec.Utils.removeEvent(window.document,"mouseup",Zapatec.Calendar.tableMouseUp);Zapatec.Utils.removeEvent(window.document,"mouseover",Zapatec.Calendar.tableMouseOver);Zapatec.Utils.removeEvent(window.document,"mousemove",Zapatec.Calendar.tableMouseOver);l._hideCombos();Zapatec.Calendar._C=null;return Zapatec.Utils.stopEvent(g)};Zapatec.Calendar.tableMouseOver=function(B){var r=Zapatec.Calendar._C;if(!r){return}var f=r.activeDiv;var D=Zapatec.Utils.getTargetElement(B);if(D==f||D.parentNode==f){Zapatec.Utils.addClass(f,"hilite active");Zapatec.Utils.addClass(f.parentNode,"rowhilite")}else{if(typeof f.navtype=="undefined"||(f.navtype!=50&&((f.navtype==0&&!r.histCombo)||Math.abs(f.navtype)>2))){Zapatec.Utils.removeClass(f,"active")}Zapatec.Utils.removeClass(f,"hilite");Zapatec.Utils.removeClass(f.parentNode,"rowhilite")}B||(B=window.event);if(f.navtype==50&&D!=f){var l=Zapatec.Utils.getAbsolutePos(f);var o=f.offsetWidth;var n=B.clientX;var q;var b=true;if(n>l.x+o){q=n-l.x-o;b=false}else{q=l.x-n}if(q<0){q=0}var s=f._range;var u=f._current;var C=r.date;var A=(C.getHours()>=12);var c=f.firstChild.data;var m=Math.floor(q/10)%s.length;for(var z=s.length;--z>=0;){if(s[z]==u){break}}while(m-->0){if(b){if(--z<0){z=s.length-1}}else{if(++z>=s.length){z=0}}}if(r.getDateStatus){var t=null;var h=null;var d=new Date(C);if(f.className.indexOf("ampm",0)!=-1){t=C.getMinutes();if(c!=s[z]){h=(s[z]=="pm")?((C.getHours()==0)?(12):(C.getHours()+12)):(C.getHours()-12)}else{h=C.getHours()}d.setHours(h)}if(f.className.indexOf("hour",0)!=-1){t=C.getMinutes();h=(!r.time24)?((A)?((s[z]!=12)?(parseInt(s[z],10)+12):(12)):((s[z]!=12)?(s[z]):(0))):(s[z]);d.setHours(h)}if(f.className.indexOf("minute",0)!=-1){h=C.getHours();t=s[z];d.setMinutes(t)}}var v=false;if(r.getDateStatus){v=r.getDateStatus(d,C.getFullYear(),C.getMonth(),C.getDate(),parseInt(h,10),parseInt(t,10))}if(v==false){if(!((!r.time24)&&(s[z]=="pm")&&(h>23))){f.firstChild.data=s[z]}}r.onUpdateTime()}var y=Zapatec.Calendar.findMonth(D);if(y){if(!y.disabled){if(y.month!=r.date.getMonth()){if(r.hilitedMonth){Zapatec.Utils.removeClass(r.hilitedMonth,"hilite")}Zapatec.Utils.addClass(y,"hilite");r.hilitedMonth=y}else{if(r.hilitedMonth){Zapatec.Utils.removeClass(r.hilitedMonth,"hilite")}}}}else{if(r.hilitedMonth){Zapatec.Utils.removeClass(r.hilitedMonth,"hilite")}var p=Zapatec.Calendar.findYear(D);if(p){if(p.year!=r.date.getFullYear()){if(r.hilitedYear){Zapatec.Utils.removeClass(r.hilitedYear,"hilite")}Zapatec.Utils.addClass(p,"hilite");r.hilitedYear=p}else{if(r.hilitedYear){Zapatec.Utils.removeClass(r.hilitedYear,"hilite")}}}else{if(r.hilitedYear){Zapatec.Utils.removeClass(r.hilitedYear,"hilite")}var g=Zapatec.Calendar.findHist(D);if(g){if(!g.histDate.dateEqualsTo(r.date)){if(r.hilitedHist){Zapatec.Utils.removeClass(r.hilitedHist,"hilite")}Zapatec.Utils.addClass(g,"hilite");r.hilitedHist=g}else{if(r.hilitedHist){Zapatec.Utils.removeClass(r.hilitedHist,"hilite")}}}else{if(r.hilitedHist){Zapatec.Utils.removeClass(r.hilitedHist,"hilite")}}}}return Zapatec.Utils.stopEvent(B)};Zapatec.Calendar.tableMouseDown=function(b){if(Zapatec.Utils.getTargetElement(b)==Zapatec.Utils.getElement(b)){return Zapatec.Utils.stopEvent(b)}};Zapatec.Calendar.calDragIt=function(f){f||(f=window.event);var g=Zapatec.Calendar._C;if(!(g&&g.dragging)){return false}var i=f.clientX+window.document.body.scrollLeft;var h=f.clientY+window.document.body.scrollTop;g.hideShowCovered();var d=g.element.style,b=i-g.xOffs,c=h-g.yOffs;d.left=b+"px";d.top=c+"px";Zapatec.Utils.setupWCH(g.WCH,b,c);return Zapatec.Utils.stopEvent(f)};Zapatec.Calendar.calDragEnd=function(b){var c=Zapatec.Calendar._C;if(!c){return false}c.dragging=false;Zapatec.Utils.removeEvent(window.document,"mousemove",Zapatec.Calendar.calDragIt);Zapatec.Utils.removeEvent(window.document,"mouseover",Zapatec.Calendar.calDragIt);Zapatec.Utils.removeEvent(window.document,"mouseup",Zapatec.Calendar.calDragEnd);Zapatec.Calendar.tableMouseUp(b);c.hideShowCovered()};Zapatec.Calendar.dayMouseDown=function(d){var b=true;var c=Zapatec.Utils.getElement(d);if(c.disabled){return false}var f=c.calendar;while(!f){c=c.parentNode;f=c.calendar}f.bEventShowHistory=false;f.activeDiv=c;Zapatec.Calendar._C=f;if(c.navtype!=300){if(c.navtype==50){if(!((f.timeInterval==null)||((f.timeInterval<60)&&(c.className.indexOf("hour",0)!=-1)))){b=false}c._current=c.firstChild.data;if(b){Zapatec.Utils.addEvent(window.document,"mousemove",Zapatec.Calendar.tableMouseOver)}}else{if(((c.navtype==201)||(c.navtype==202))&&(f.timeInterval>30)&&(c.timePart.className.indexOf("minute",0)!=-1)){b=false}if(b){Zapatec.Utils.addEvent(window.document,Zapatec.is_ie5?"mousemove":"mouseover",Zapatec.Calendar.tableMouseOver)}}if(b){Zapatec.Utils.addClass(c,"hilite active")}Zapatec.Utils.addEvent(window.document,"mouseup",Zapatec.Calendar.tableMouseUp)}else{if(f.isPopup){f._dragStart(d)}else{Zapatec.Calendar._C=null}}if(c.navtype==-1||c.navtype==1){if(f.timeout){clearTimeout(f.timeout)}f.timeout=setTimeout("Zapatec.Calendar.showMonthsCombo()",250)}else{if(c.navtype==-2||c.navtype==2){if(f.timeout){clearTimeout(f.timeout)}f.timeout=setTimeout((c.navtype>0)?"Zapatec.Calendar.showYearsCombo(true)":"Zapatec.Calendar.showYearsCombo(false)",250)}else{if(c.navtype==0&&Zapatec.Calendar.prefs.history){if(f.timeout){clearTimeout(f.timeout)}f.timeout=setTimeout("Zapatec.Calendar.showHistoryCombo()",250)}else{f.timeout=null}}}return Zapatec.Utils.stopEvent(d)};Zapatec.Calendar.dayMouseDblClick=function(b){Zapatec.Calendar.cellClick(Zapatec.Utils.getElement(b),b||window.event);if(Zapatec.is_ie){window.document.selection.empty()}};Zapatec.Calendar.dayMouseOver=function(f){var d=Zapatec.Utils.getElement(f),b=d.caldate;while(!d.calendar){d=d.parentNode;b=d.caldate}var g=d.calendar;var c=d.timePart;if(b){b=new Date(b[0],b[1],b[2]);if(b.getDate()!=d.caldate[2]){b.setDate(d.caldate[2])}}if(Zapatec.Utils.isRelated(d,f)||Zapatec.Calendar._C||d.disabled){return false}if(d.ttip){if(d.ttip.substr(0,1)=="_"){d.ttip=b.print(d.calendar.ttDateFormat)+d.ttip.substr(1)}d.calendar.showHint(d.ttip)}if(d.navtype!=300){if(!((g.timeInterval==null)||(d.className.indexOf("ampm",0)!=-1)||((g.timeInterval<60)&&(d.className.indexOf("hour",0)!=-1)))&&(d.navtype==50)){return Zapatec.Utils.stopEvent(f)}if(((d.navtype==201)||(d.navtype==202))&&(g.timeInterval>30)&&(c.className.indexOf("minute",0)!=-1)){return Zapatec.Utils.stopEvent(f)}Zapatec.Utils.addClass(d,"hilite");if(b){Zapatec.Utils.addClass(d.parentNode,"rowhilite")}}return Zapatec.Utils.stopEvent(f)};Zapatec.Calendar.dayMouseOut=function(c){var b=Zapatec.Utils.getElement(c);while(!b.calendar){b=b.parentNode;caldate=b.caldate}if(Zapatec.Utils.isRelated(b,c)||Zapatec.Calendar._C||b.disabled){return false}Zapatec.Utils.removeClass(b,"hilite");if(b.caldate){Zapatec.Utils.removeClass(b.parentNode,"rowhilite")}if(b.calendar){b.calendar.showHint(Zapatec.Calendar.i18n(""))}return Zapatec.Utils.stopEvent(c)};var samestate=1;Zapatec.Calendar.cellClick=function(d,D){var s=d.calendar;var n=false;var c=false;var F=null;if(D!=undefined){try{if(D.target.parentNode.rowIndex>1&&D.target.cellIndex>=7){samestate=2}}catch(h){if(D.srcElement.parentNode.rowIndex>1&&D.srcElement.cellIndex>=7){samestate=2}}}while(!s){d=d.parentNode;s=d.calendar}if(typeof d.navtype=="undefined"){if(s.currentDateEl){Zapatec.Utils.removeClass(s.currentDateEl,"selected");Zapatec.Utils.addClass(d,"selected");n=(s.currentDateEl==d);if(!n){s.currentDateEl=d}}var f=new Date(d.caldate[0],d.caldate[1],d.caldate[2]);if(f.getDate()!=d.caldate[2]){f.setDate(d.caldate[2])}s.date.setDateOnly(f);s.currentDate.setDateOnly(f);F=s.date;var p=!(s.dateClicked=!d.otherMonth);if(!p&&s.multiple){s._toggleMultipleDate(new Date(F))}c=true;if(p){s._init(s.firstDayOfWeek,F)}s.onSetTime()}else{if(d.navtype==200){Zapatec.Utils.removeClass(d,"hilite");s.callCloseHandler();return}F=new Date(s.date);if(d.navtype==0&&s.bEventShowHistory){F.setDateOnly(new Date())}s.dateClicked=false;var r=F.getFullYear();var z=F.getMonth();function q(I){var J=F.getDate();var i=F.getMonthDays(I);if(J>i){F.setDate(i)}F.setMonth(I)}switch(d.navtype){case 400:Zapatec.Utils.removeClass(d,"hilite");var t=Zapatec.Calendar.i18n("ABOUT");if(typeof t!="undefined"){t+=s.showsTime?Zapatec.Calendar.i18n("ABOUT_TIME"):""}else{t='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <support@zapatec.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://www.zapatec.com\n'}return;case -21:if(r>s.minYear){F.setFullYear(r-1)}break;case -1:var E=new Date(),g=E.getDate(),y=E.getFullYear(),G=E.getMonth();if((F>E)){if((z>0)){if(r!=y){q(z-1)}else{if(z!=G){q(z-1)}}}else{if(r-->s.minYear){F.setFullYear(r);q(11)}}}break;case 1:if(z<11){q(z+1)}else{if(r<s.maxYear){F.setFullYear(r+1);q(0)}}break;case 21:if(r<s.maxYear){F.setFullYear(r+1)}break;case 1001:s.setFirstDayOfWeek(d.fdow);Zapatec.Calendar.prefs.fdow=s.firstDayOfWeek;Zapatec.Calendar.savePrefs();if(s.onFDOW){s.onFDOW(s.firstDayOfWeek)}return;case 50:var F=s.currentDate;if(d.className.indexOf("ampm",0)>=0){}else{if(!((s.timeInterval==null)||((s.timeInterval<60)&&(d.className.indexOf("hour",0)!=-1)))){break}}var u=d._range;var w=d.firstChild.data;var B=(F.getHours()>=12);for(var A=u.length;--A>=0;){if(u[A]==w){break}}if(D&&D.shiftKey){if(--A<0){A=u.length-1}}else{if(++A>=u.length){A=0}}if(s.getDateStatus){var v=null;var m=null;var b=new Date(F);if(d.className.indexOf("ampm",0)!=-1){v=F.getMinutes();m=(u[A]=="pm")?((F.getHours()==12)?(F.getHours()):(F.getHours()+12)):(F.getHours()-12);if(s.getDateStatus&&s.getDateStatus(b,F.getFullYear(),F.getMonth(),F.getDate(),parseInt(m,10),parseInt(v,10))){var o;if(u[A]=="pm"){o=-5}else{o=5}hours=m;minutes=v;do{minutes+=o;if(minutes>=60){minutes-=60;++hours;if(hours>=24){hours-=24}b.setHours(hours)}if(minutes<0){minutes+=60;--hours;if(hours<0){hours+=24}b.setHours(hours)}b.setMinutes(minutes);if(!s.getDateStatus(b,F.getFullYear(),F.getMonth(),F.getDate(),parseInt(hours,10),parseInt(minutes,10))){m=hours;v=minutes;if(m>12){A=1}else{A=0}s.date.setHours(m);s.date.setMinutes(v);s.onSetTime()}}while((m!=hours)||(v!=minutes))}b.setHours(m)}if(d.className.indexOf("hour",0)!=-1){v=F.getMinutes();m=(!s.time24)?((B)?((u[A]!=12)?(parseInt(u[A],10)+12):(12)):((u[A]!=12)?(u[A]):(0))):(u[A]);b.setHours(m)}if(d.className.indexOf("minute",0)!=-1){m=F.getHours();v=u[A];b.setMinutes(v)}}var x=false;if(s.getDateStatus){x=s.getDateStatus(b,F.getFullYear(),F.getMonth(),F.getDate(),parseInt(m,10),parseInt(v,10))}if(!x){d.firstChild.data=u[A]}s.onUpdateTime();return;case 201:case 202:var C=d.timePart;var F=s.currentDate;if((C.className.indexOf("minute",0)!=-1)&&(s.timeInterval>30)){break}var H=parseInt(C.firstChild.data,10);var B=(F.getHours()>=12);var u=C._range;for(var A=u.length;--A>=0;){if(H==u[A]){H=A;break}}var l=C._step;if(d.navtype==201){H=l*Math.floor(H/l);H+=l;if(H>=u.length){H=0}}else{H=l*Math.ceil(H/l);H-=l;if(H<0){H=u.length-l}}if(s.getDateStatus){var v=null;var m=null;var b=new Date(F);if(C.className=="hour"){v=F.getMinutes();m=(!s.time24)?((B)?((u[H]!=12)?(parseInt(u[H],10)+12):(12)):((u[H]!=12)?(u[H]):(0))):(u[H]);b.setHours(m)}if(C.className=="minute"){m=F.getHours();v=H;b.setMinutes(u[H])}}var x=false;if(s.getDateStatus){x=s.getDateStatus(b,F.getFullYear(),F.getMonth(),F.getDate(),parseInt(m,10),parseInt(v,10))}if(!x){C.firstChild.data=u[H]}s.onUpdateTime();return;case 0:F=new Date();if(s.getDateStatus&&((s.getDateStatus(F,F.getFullYear(),F.getMonth(),F.getDate())==true)||(s.getDateStatus(F,F.getFullYear(),F.getMonth(),F.getDate())=="disabled"))){return false}break}if(!F.equalsTo(s.date)){if((d.navtype>=-2&&d.navtype<=2)&&(d.navtype!=0)){s._init(s.firstDayOfWeek,F,true);return}s.setDate(F);c=!(d.navtype&&(d.navtype>=-2&&d.navtype<=2))}}if(c){s.callHandler()}if(n){Zapatec.Utils.removeClass(d,"hilite");s.callCloseHandler()}};Zapatec.Calendar.prototype.create=function(p){var h=null;if(!p){h=window.document.getElementsByTagName("body")[0];this.isPopup=true;this.WCH=Zapatec.Utils.createWCH()}else{h=p;this.isPopup=false}this.currentDate=this.date=this.dateStr?new Date(this.dateStr):new Date();var y=Zapatec.Utils.createElement("table");this.table=y;y.align="center";y.cellSpacing=0;y.cellPadding=0;y.border=0;y.calendar=this;Zapatec.Utils.addEvent(y,"mousedown",Zapatec.Calendar.tableMouseDown);var o=Zapatec.Utils.createElement("div");this.element=o;o.className="calendar";o.id="modifcal";if(Zapatec.is_opera){y.style.width=(this.monthsInRow*((this.weekNumbers)?(8):(7))*2+4.4*this.monthsInRow)+"em"}if(this.isPopup){o.style.position="absolute";o.style.display="none"}o.appendChild(y);var z=1;var A=1;var d=null;var g=null;var n=this;var f=function(D,l,i){d=Zapatec.Utils.createElement("td",g);d.colSpan=l;d.className="title";if(Math.abs(i)<=2){d.className+=" nav"}Zapatec.Calendar._add_evs(d);d.calendar=n;d.navtype=i;if(D.substr(0,1)!="&"){d.appendChild(document.createTextNode(D));if(D.indexOf("close")!=-1){d.innerHTML="";d.className="close-cal"}}else{A+=1;if(z==1){if(D.indexOf("2039")!=-1){d.className+=" prev";z=0}}if(A==5){if(D.indexOf("203a")!=-1){d.className+=" next"}}}return d};var B=((this.weekNumbers)?(8):(7))*this.monthsInRow-2;var x=Zapatec.Utils.createElement("thead",y);if(this.numberMonths==1){this.title=x}g=Zapatec.Utils.createElement("tr",x);if(this.helpButton){f(" ",1,400).ttip=Zapatec.Calendar.i18n("INFO")}else{d=Zapatec.Utils.createElement("td",g);d.colSpan=1;d.className="button";d.innerHTML="<p>&nbsp</p>"}this.title=f(" ",B,300);this.title.className="title";if(this.isPopup){this.title.ttip=Zapatec.Calendar.i18n("DRAG_TO_MOVE");this.title.style.cursor="move";a=f("close",1,200).ttip=Zapatec.Calendar.i18n("CLOSE")}else{d=Zapatec.Utils.createElement("td",g);d.colSpan=1;d.className="title";d.innerHTML="<p>&nbsp</p>"}if(this.params&&this.params.titleHtml){this.title.innerHTML=this.params.titleHtml}g=Zapatec.Utils.createElement("tr",x);var C=Math.floor(this.numberMonths/this.monthsInRow);if(this.numberMonths%this.monthsInRow>0){++C}for(var q=1;q<=C;++q){var x=Zapatec.Utils.createElement("thead",y);if(Zapatec.is_opera){x.style.display="table-row-group"}if(this.numberMonths!=1){g=Zapatec.Utils.createElement("tr",x);var B=5;this.weekNumbers&&++B;this.titles[q]=new Array();for(var r=1;(r<=this.monthsInRow)&&((q-1)*this.monthsInRow+r<=this.numberMonths);++r){this._nav_pm=f("&#x2039;",1,-1);this._nav_pm.ttip=Zapatec.Calendar.i18n("PREV_MONTH");this.titles[q][r]=f("",B,300);this.titles[q][r].className="title";this._nav_nm=f("&#x203a;",1,1);this._nav_nm.ttip=Zapatec.Calendar.i18n("NEXT_MONTH")}}g=Zapatec.Utils.createElement("tr",x);g.className="daynames";for(r=1;(r<=this.monthsInRow)&&((q-1)*this.monthsInRow+r<=this.numberMonths);++r){if(this.weekNumbers){d=Zapatec.Utils.createElement("td",g);d.className="name wn";d.appendChild(window.document.createTextNode(Zapatec.Calendar.i18n("WK")));if(r>1){Zapatec.Utils.addClass(d,"month-left-border")}var w=Zapatec.Calendar.i18n("WK");if(w==null){w=""}}for(var v=7;v>0;--v){d=Zapatec.Utils.createElement("td",g);d.appendChild(window.document.createTextNode(""))}}this.firstdayname=g.childNodes[this.weekNumbers?1:0];this.rowsOfDayNames[q]=this.firstdayname;this._displayWeekdays();var c=Zapatec.Utils.createElement("tbody",y);this.tbody[q]=c;for(v=6;v>0;--v){g=Zapatec.Utils.createElement("tr",c);for(r=1;(r<=this.monthsInRow)&&((q-1)*this.monthsInRow+r<=this.numberMonths);++r){if(this.weekNumbers){d=Zapatec.Utils.createElement("td",g);d.appendChild(document.createTextNode(""))}for(var s=7;s>0;--s){d=Zapatec.Utils.createElement("td",g);d.appendChild(document.createTextNode(""));d.calendar=this;Zapatec.Calendar._add_evs(d)}}}}var m=Zapatec.Utils.createElement("tfoot",y);if(this.showsTime){g=Zapatec.Utils.createElement("tr",m);g.className="time";var b;if(this.monthsInRow!=1){d=Zapatec.Utils.createElement("td",g);b=d.colSpan=Math.ceil((((this.weekNumbers)?8:7)*(this.monthsInRow-1))/2);d.className="timetext";d.innerHTML="&nbsp"}d=Zapatec.Utils.createElement("td",g);d.className="timetext";d.colSpan=this.weekNumbers?2:1;d.innerHTML=Zapatec.Calendar.i18n("TIME")||"&nbsp;";(function(){function G(S,W,H,V){var X,R,T,N,M;if(V){d=Zapatec.Utils.createElement("td",g);d.colSpan=1;if(n.showsTime!="seconds"){++d.colSpan}d.className="parent-"+S;X=Zapatec.Utils.createElement("table",d);X.cellSpacing=X.cellPadding=0;if(S=="hour"){X.align="right"}X.className="calendar-time-scroller";R=Zapatec.Utils.createElement("tbody",X);T=Zapatec.Utils.createElement("tr",R);N=Zapatec.Utils.createElement("tr",R)}else{T=g}M=Zapatec.Utils.createElement("td",T);M.className=S;M.appendChild(window.document.createTextNode(W));M.calendar=n;M.ttip=Zapatec.Calendar.i18n("TIME_PART");M.navtype=50;M._range=[];if(!V){M._range=H}else{M.rowSpan=2;for(var Q=H;Q<=V;++Q){var P;if(Q<10&&V>=10){P="0"+Q}else{P=""+Q}M._range[M._range.length]=P}var O=Zapatec.Utils.createElement("td",T);O.className="up";O.navtype=201;O.calendar=n;O.timePart=M;if(Zapatec.is_khtml){O.innerHTML="&nbsp;"}Zapatec.Calendar._add_evs(O);var U=Zapatec.Utils.createElement("td",N);U.className="down";U.navtype=202;U.calendar=n;U.timePart=M;if(Zapatec.is_khtml){U.innerHTML="&nbsp;"}Zapatec.Calendar._add_evs(U)}Zapatec.Calendar._add_evs(M);return M}var K=n.currentDate.getHours();var i=n.currentDate.getMinutes();if(n.showsTime=="seconds"){var E=n.currentDate.getSeconds()}var L=!n.time24;var l=(K>12);if(L&&l){K-=12}var I=G("hour",K,L?1:0,L?12:23);I._step=(n.timeInterval>30)?(n.timeInterval/60):1;d=Zapatec.Utils.createElement("td",g);d.innerHTML=":";d.className="colon";var F=G("minute",i,0,59);F._step=((n.timeInterval)&&(n.timeInterval<60))?(n.timeInterval):5;if(n.showsTime=="seconds"){d=Zapatec.Utils.createElement("td",g);d.innerHTML=":";d.className="colon";var D=G("minute",E,0,59);D._step=5}var J=null;if(L){J=G("ampm",l?"pm":"am",["am","pm"]);J.className+=" button"}else{Zapatec.Utils.createElement("td",g).innerHTML="&nbsp;"}n.onSetTime=function(){var O=this.currentDate.getHours();var P=this.currentDate.getMinutes();if(this.showsTime=="seconds"){var N=n.currentDate.getSeconds()}if(this.timeInterval){P+=this.timeInterval-((P-1+this.timeInterval)%this.timeInterval)-1}while(P>=60){P-=60;++O}if(this.timeInterval>60){var H=this.timeInterval/60;if(O%H!=0){O+=H-((O-1+H)%H)-1}if(O>=24){O-=24}}var Q=new Date(this.currentDate);if(this.getDateStatus&&this.getDateStatus(this.currentDate,this.currentDate.getFullYear(),this.currentDate.getMonth(),this.currentDate.getDate(),O,P)){hours=O;minutes=P;do{if(this.timeInterval){if(this.timeInterval<60){minutes+=this.timeInterval}else{O+=this.timeInterval/60}}else{minutes+=5}if(minutes>=60){minutes-=60;hours+=1}if(hours>=24){hours-=24}Q.setMinutes(minutes);Q.setHours(hours);if(!this.getDateStatus(Q,this.currentDate.getFullYear(),this.currentDate.getMonth(),this.currentDate.getDate(),hours,minutes)){O=hours;P=minutes}}while((O!=hours)||(P!=minutes))}this.currentDate.setMinutes(P);this.currentDate.setHours(O);var M=(O>=12);if(M&&L&&O!=12){O-=12}if(!M&&L&&O==0){O=12}I.firstChild.data=(O<10)?("0"+O):O;F.firstChild.data=(P<10)?("0"+P):P;if(this.showsTime=="seconds"){D.firstChild.data=(N<10)?("0"+N):N}if(L){J.firstChild.data=M?"pm":"am"}};n.onUpdateTime=function(){var M=this.currentDate;var N=parseInt(I.firstChild.data,10);if(L){if(/pm/i.test(J.firstChild.data)&&N<12){N+=12}else{if(/am/i.test(J.firstChild.data)&&N==12){N=0}}}var O=M.getDate();var H=M.getMonth();var P=M.getFullYear();M.setHours(N);M.setMinutes(parseInt(F.firstChild.data,10));if(this.showsTime=="seconds"){M.setSeconds(parseInt(D.firstChild.data,10))}M.setFullYear(P);M.setMonth(H);M.setDate(O);this.dateClicked=false;this.callHandler()}})();if(this.monthsInRow!=1){d=Zapatec.Utils.createElement("td",g);d.colSpan=((this.weekNumbers)?8:7)*(this.monthsInRow-1)-Math.ceil(b);d.className="timetext";d.innerHTML="&nbsp"}}else{this.onSetTime=this.onUpdateTime=function(){}}g=Zapatec.Utils.createElement("tr",m);g.className="footrow";d=f(Zapatec.Calendar.i18n(""),this.weekNumbers?(8*this.numberMonths):(7*this.numberMonths),300);d.className="ttip";if(this.isPopup){d.ttip=Zapatec.Calendar.i18n("DRAG_TO_MOVE");d.style.cursor="move"}this.tooltips=d;o=this.monthsCombo=Zapatec.Utils.createElement("div",this.element);o.className="combo";for(v=0;v<12;++v){var u=Zapatec.Utils.createElement("div");u.className=Zapatec.is_ie?"label-IEfix":"label";u.month=v;u.appendChild(window.document.createTextNode(Zapatec.Calendar.i18n(v,"smn")));o.appendChild(u)}o=this.yearsCombo=Zapatec.Utils.createElement("div",this.element);o.className="combo";for(v=12;v>0;--v){var t=Zapatec.Utils.createElement("div");t.className=Zapatec.is_ie?"label-IEfix":"label";t.appendChild(window.document.createTextNode(""));o.appendChild(t)}o=this.histCombo=Zapatec.Utils.createElement("div",this.element);o.className="combo history";this._init(this.firstDayOfWeek,this.date);h.appendChild(this.element)};Zapatec.Calendar._keyEvent=function(f){if(!window.calendar){return false}(Zapatec.is_ie)&&(f=window.event);var g=window.calendar;if(f.keyCode==9){g.callCloseHandler();return}var c=(Zapatec.is_ie||f.type=="keypress");var b=f.keyCode;var d=new Date(g.date);var h=new Date();if(f.ctrlKey){switch(b){case 37:Zapatec.Utils.stopEvent(f);break;case 38:c&&Zapatec.Calendar.cellClick(g._nav_py);break;case 32:c&&g.callCloseHandler();break;case 39:c&&Zapatec.Calendar.cellClick(g._nav_nm);break;case 40:c&&Zapatec.Calendar.cellClick(g._nav_ny);break;default:return false}}else{switch(b){case 32:c&&g.callCloseHandler();break;case 27:c&&g.callCloseHandler();break;case 37:if(c&&!g.multiple){d.setTime(d.getTime()-86400000);g.setDate(d)}break;case 38:if(c&&!g.multiple){d.setTime(d.getTime()-7*86400000);g.setDate(d)}break;case 39:if(c&&!g.multiple){d.setTime(d.getTime()+86400000);g.setDate(d)}break;case 40:if(c&&!g.multiple){d.setTime(d.getTime()+7*86400000);g.setDate(d)}break;case 13:if(c){if((d==h)||(d>h)){Zapatec.Utils.stopEvent(f);Zapatec.Calendar.cellClick(g.currentDateEl)}else{Zapatec.Utils.stopEvent(f);Zapatec.Calendar.cellClick(g.currentDateEl)}}break;default:return false}}return Zapatec.Utils.stopEvent(f)};Zapatec.Calendar.prototype._init=function(w,V,t){var o=new Date(),S=o.getDate(),H=o.getFullYear(),N=o.getMonth();if(this.getDateStatus&&!t){var F=this.getDateStatus(V,V.getFullYear(),V.getMonth(),V.getDate());var h=new Date(V);while(((F==true)||(F=="disabled"))&&(h.getMonth()==V.getMonth())){V.setTime(V.getTime()+86400000);var F=this.getDateStatus(V,V.getFullYear(),V.getMonth(),V.getDate())}if(h.getMonth()!=V.getMonth()){V=new Date(h);while(((F==true)||(F=="disabled"))&&(h.getMonth()==V.getMonth())){V.setTime(V.getTime()-86400000);var F=this.getDateStatus(V,V.getFullYear(),V.getMonth(),V.getDate())}}if(h.getMonth()!=V.getMonth()){t=true;V=new Date(h)}}var g=V.getFullYear();var b=V.getMonth();var X=Math.floor(this.numberMonths/this.monthsInRow);var v;var A,G,q;if(!this.vertical){A=(this.controlMonth-1);v=b-A}else{G=((this.numberMonths-1)%this.monthsInRow)+1;q=(this.controlMonth-1)%this.monthsInRow;bottom=(q>=(G)?(G):(q));A=(q)*(X-1)+Math.floor((this.controlMonth-1)/this.monthsInRow)+bottom;v=b-A}var s=g;if(v<0){v+=12;--s}var B=v+this.numberMonths-1;var z=s;if(B>11){B-=12;++z}function C(i){Zapatec.Calendar._del_evs(i);i.disabled=true;i.className="button";i.innerHTML="<p>&nbsp</p>"}function f(l,i){Zapatec.Calendar._add_evs(l);l.disabled=false;l.className="button nav";l.innerHTML=i}upperMonth=this.maxMonth+1;upperYear=this.maxYear;if(upperMonth>11){upperMonth-=12;++upperYear}bottomMonth=this.minMonth-1;bottomYear=this.minYear;if(bottomMonth<0){bottomMonth+=12;--bottomYear}maxDate1=new Date(z,B,V.getMonthDays(B),23,59,59,999);maxDate2=new Date(upperYear,upperMonth,1,0,0,0,0);minDate1=new Date(s,v,1,0,0,0,0);minDate2=new Date(bottomYear,bottomMonth,V.getMonthDays(bottomMonth),23,59,59,999);if(maxDate1.getTime()>maxDate2.getTime()){V.setTime(V.getTime()-(maxDate1.getTime()-maxDate2.getTime()))}if(minDate1.getTime()<minDate2.getTime()){V.setTime(V.getTime()+(minDate2.getTime()-minDate1.getTime()))}delete maxDate1;delete maxDate2;delete minDate1;delete minDate2;this.firstDayOfWeek=w;if(!t){this.currentDate=V}this.date=V;(this.date=new Date(this.date)).setDateOnly(V);g=this.date.getFullYear();b=this.date.getMonth();var n=V.getMonth();var m=this.date.getDate();var K=V.getMonthDays();var y=new Array();var x=new Date();if(this.numberMonths%this.monthsInRow>0){++X}for(var Q=1;Q<=X;++Q){y[Q]=new Array();for(var R=1;(R<=this.monthsInRow)&&((Q-1)*this.monthsInRow+R<=this.numberMonths);++R){var J=new Date(V);if(this.vertical){var W=V.getMonth()-A+((R-1)*(X-1)+(Q-1)+((G<R)?(G):(R-1)))}else{var W=V.getMonth()-A+(Q-1)*this.monthsInRow+R-1}if(W<0){J.setFullYear(J.getFullYear()-1);W=12+W}if(W>11){J.setFullYear(J.getFullYear()+1);W=W-12}J.setDate(1);J.setMonth(W);var O=(J.getDay()-this.firstDayOfWeek)%7;if(O<0){O+=7}J.setDate(-O);J.setDate(J.getDate()+1);y[Q][R]=J}}var c=Zapatec.Calendar.i18n(b,"smn");var d=Zapatec.Calendar.i18n("WEEKEND");var P=this.multiple?(this.datesCells={}):null;var L=this.getDateText;for(var Q=1;Q<=X;++Q){var p=this.tbody[Q].firstChild;for(var T=7;--T>0;p=p.nextSibling){var D=p.firstChild;var Y=false;for(var R=1;(R<=this.monthsInRow)&&((Q-1)*this.monthsInRow+R<=this.numberMonths);++R){V=y[Q][R];if(this.weekNumbers){D.className=" day wn";D.innerHTML=V.getWeekNumber();if(R>1){Zapatec.Utils.addClass(D,"month-left-border")}D=D.nextSibling}p.className="daysrow";var E;for(j=7;D&&(E=V.getDate())&&(j>0);V.setDate(E+1),((V.getDate()==E)?(V.setHours(1)&&V.setDate(E+1)):(false)),D=D.nextSibling,--j){var r=V.getDay(),I=V.getMonth(),M=V.getFullYear();D.className=" day";if((!this.weekNumbers)&&(j==7)&&(R!=1)){Zapatec.Utils.addClass(D,"month-left-border")}if((j==1)&&(R!=this.monthsInRow)){Zapatec.Utils.addClass(D,"month-right-border");D.width=15}if(this.vertical){W=n-A+((R-1)*(X-1)+(Q-1)+((G<R)?(G):(R-1)))}else{W=n-A+((Q-1)*this.monthsInRow+R-1)}if(W<0){W=12+W}if(W>11){W=W-12}var U=!(D.otherMonth=!(I==W));if(!U){if(this.showsOtherMonths){D.className+=" othermonth"}else{D.innerHTML="<p>&nbsp;</p>";D.disabled=true;continue}}else{Y=true}D.disabled=false;D.innerHTML=L?L(V,M,I,E):E;P&&(P[V.print("%Y%m%d")]=D);if(this.getDateStatus){var F=this.getDateStatus(V,M,I,E);if(this.getDateToolTip){var u=this.getDateToolTip(V,M,I,E);if(u){D.title=u}}if(F==true){D.className+=" disabled";D.disabled=true}else{if(/disabled/i.test(F)){D.disabled=true}D.className+=" "+F}}if(!D.disabled){D.caldate=[M,I,E];D.ttip="_";if(!this.multiple&&U&&E==this.currentDate.getDate()&&this.hiliteToday&&(I==this.currentDate.getMonth())&&(M==this.currentDate.getFullYear())){D.className+=" selected";this.currentDateEl=D}if(M==H&&I==N&&E==S){D.className+=" today";D.ttip+=Zapatec.Calendar.i18n("PART_TODAY")}if((d!=null)&&(d.indexOf(r.toString())!=-1)){D.className+=D.otherMonth?" oweekend":" weekend"}}}if(!(Y||this.showsOtherMonths)){p.className="daysrow"}}if((T==1)&&(Q<X)){if(p.className=="emptyrow"){p=p.previousSibling}D=p.firstChild;while(D!=null){Zapatec.Utils.addClass(D,"month-bottom-border");D=D.nextSibling}}}}if(this.numberMonths==1){this.title.innerHTML=Zapatec.Calendar.i18n(b,"mn")+", "+g}else{for(var Q=1;Q<=X;++Q){for(var R=1;(R<=this.monthsInRow)&&((Q-1)*this.monthsInRow+R<=this.numberMonths);++R){if(this.vertical){W=b-A+((R-1)*(X-1)+(Q-1)+((G<R)?(G):(R-1)))}else{W=b-A+(Q-1)*this.monthsInRow+R-1}validYear=g;if(W<0){--validYear;W=12+W}if(W>11){++validYear;W=W-12}this.titles[Q][R].innerHTML=Zapatec.Calendar.i18n(W,"mn")+", "+validYear}}}this.onSetTime();this._initMultipleDates();this.updateWCH()};Zapatec.Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var c in this.multiple){var b=this.datesCells[c];var f=this.multiple[c];if(!f){continue}if(b){b.className+=" selected"}}}};Zapatec.Calendar.prototype._toggleMultipleDate=function(c){if(this.multiple){var f=c.print("%Y%m%d");var b=this.datesCells[f];if(b){var g=this.multiple[f];if(!g){Zapatec.Utils.addClass(b,"selected");this.multiple[f]=c}else{Zapatec.Utils.removeClass(b,"selected");delete this.multiple[f]}}}};Zapatec.Calendar.prototype.setDateToolTipHandler=function(b){this.getDateToolTip=b};Zapatec.Calendar.prototype.setDate=function(c,f){if(!c){c=new Date()}if(!c.equalsTo(this.date)){var d=c.getFullYear(),b=c.getMonth();if(d==this.minYear&&b<this.minMonth){this.showHint("<div class='error'>"+Zapatec.Calendar.i18n("E_RANGE")+" »»»</div>")}else{if(d==this.maxYear&&b>this.maxMonth){this.showHint("<div class='error'>««« "+Zapatec.Calendar.i18n("E_RANGE")+"</div>")}}this._init(this.firstDayOfWeek,c,f)}};Zapatec.Calendar.prototype.showHint=function(b){this.tooltips.innerHTML=b};Zapatec.Calendar.prototype.reinit=function(){this._init(this.firstDayOfWeek,this.date)};Zapatec.Calendar.prototype.refresh=function(){var c=this.isPopup?null:this.element.parentNode;var b=parseInt(this.element.style.left);var d=parseInt(this.element.style.top);this.destroy();this.dateStr=this.date;this.create(c);if(this.isPopup){this.showAt(b,d)}else{this.show()}};Zapatec.Calendar.prototype.setFirstDayOfWeek=function(c){if(this.firstDayOfWeek!=c){this._init(c,this.date);var d=Math.floor(this.numberMonths/this.monthsInRow);if(this.numberMonths%this.monthsInRow>0){++d}for(var b=1;b<=d;++b){this.firstdayname=this.rowsOfDayNames[b];this._displayWeekdays()}}};Zapatec.Calendar.prototype.setDateStatusHandler=Zapatec.Calendar.prototype.setDisabledHandler=function(b){this.getDateStatus=b};Zapatec.Calendar.prototype.setRange=function(c,f){var b,d=Math.min(c,f),g=Math.max(c,f);this.minYear=b=Math.floor(d);this.minMonth=(b==d)?0:Math.ceil((d-b)*100-1);this.maxYear=b=Math.floor(g);this.maxMonth=(b==g)?11:Math.ceil((g-b)*100-1)};Zapatec.Calendar.prototype.setMultipleDates=function(b){if(!b||typeof b=="undefined"){return}this.multiple={};for(var c=b.length;--c>=0;){var g=b[c];var f=g.print("%Y%m%d");this.multiple[f]=g}};Zapatec.Calendar.prototype.submitFlatDates=function(){if(typeof this.params.flatCallback=="function"){Zapatec.Utils.sortOrder=(this.sortOrder!="asc"&&this.sortOrder!="desc"&&this.sortOrder!="none")?"none":this.sortOrder;if(this.multiple&&(Zapatec.Utils.sortOrder!="none")){var g=new Array();for(var c in this.multiple){var b=this.multiple[c];if(b){g[g.length]=b}g.sort(Zapatec.Utils.compareDates)}this.multiple={};for(var c=0;c<g.length;c++){var h=g[c];var f=h.print("%Y%m%d");this.multiple[f]=h}}this.params.flatCallback(this)}};Zapatec.Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Zapatec.Calendar.prototype.updateHistory=function(){var c,g,m,f,h,l="",b=Zapatec.Calendar.prefs.hsize-1;if(Zapatec.Calendar.prefs.history){c=Zapatec.Calendar.prefs.history.split(/,/);g=0;while(g<b&&(f=c[g++])){h=f.split(/\//);m=new Date(parseInt(h[0],10),parseInt(h[1],10)-1,parseInt(h[2],10),parseInt(h[3],10),parseInt(h[4],10));if(!m.dateEqualsTo(this.date)){l+=","+f}}}Zapatec.Calendar.prefs.history=this.date.print("%Y/%m/%d/%H/%M")+l;Zapatec.Calendar.savePrefs()};Zapatec.Calendar.prototype.callCloseHandler=function(){if(this.dateClicked){this.updateHistory()}if(this.onClose){this.onClose(this)}this.hideShowCovered()};Zapatec.Calendar.prototype.destroy=function(){this.hide();Zapatec.Utils.destroy(this.element);Zapatec.Utils.destroy(this.WCH);Zapatec.Calendar._C=null;window.calendar=null};Zapatec.Calendar.prototype.reparent=function(c){var b=this.element;b.parentNode.removeChild(b);c.appendChild(b)};Zapatec.Calendar._checkCalendar=function(c){if(!window.calendar){return false}var b=Zapatec.is_ie?Zapatec.Utils.getElement(c):Zapatec.Utils.getTargetElement(c);for(;b!=null&&b!=calendar.element;b=b.parentNode){}if(b==null){window.calendar.callCloseHandler();return Zapatec.Utils.stopEvent(c)}};Zapatec.Calendar.prototype.updateWCH=function(b){Zapatec.Utils.setupWCH_el(this.WCH,this.element,b)};Zapatec.Calendar.prototype.show=function(){var g=this.table.getElementsByTagName("tr");for(var f=g.length;f>0;){var h=g[--f];Zapatec.Utils.removeClass(h,"rowhilite");var d=h.getElementsByTagName("td");for(var c=d.length;c>0;){var b=d[--c];Zapatec.Utils.removeClass(b,"hilite");Zapatec.Utils.removeClass(b,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){this.updateWCH();window.calendar=this;if(!this.noGrab){Zapatec.Utils.addEvent(window.document,"keydown",Zapatec.Calendar._keyEvent);Zapatec.Utils.addEvent(window.document,"keypress",Zapatec.Calendar._keyEvent);Zapatec.Utils.addEvent(window.document,"mousedown",Zapatec.Calendar._checkCalendar)}}this.hideShowCovered()};Zapatec.Calendar.prototype.hide=function(){if(this.isPopup){Zapatec.Utils.removeEvent(window.document,"keydown",Zapatec.Calendar._keyEvent);Zapatec.Utils.removeEvent(window.document,"keypress",Zapatec.Calendar._keyEvent);Zapatec.Utils.removeEvent(window.document,"mousedown",Zapatec.Calendar._checkCalendar)}this.element.style.display="none";Zapatec.Utils.hideWCH(this.WCH);this.hidden=true;this.hideShowCovered()};Zapatec.Calendar.prototype.showAt=function(b,d){var c=this.element.style;c.left=b+"px";c.top=d+"px";this.show()};Zapatec.Calendar.prototype.showAtElement=function(g,i){var c=this;var m=Zapatec.Utils.getAbsolutePos(g);if(!i||typeof i!="string"){this.showAt(m.x,m.y+g.offsetHeight);return true}this.element.style.display="block";var b=c.element.offsetWidth;var f=c.element.offsetHeight;c.element.style.display="none";var d=i.substr(0,1);var l="l";if(i.length>1){l=i.substr(1,1)}switch(d){case"T":m.y-=f;break;case"B":m.y+=g.offsetHeight;break;case"C":m.y+=(g.offsetHeight-f)/2;break;case"t":m.y+=g.offsetHeight-f;break;case"b":break}switch(l){case"L":m.x-=b;break;case"R":m.x+=g.offsetWidth;break;case"C":m.x+=(g.offsetWidth-b)/2;break;case"l":m.x+=g.offsetWidth-b;break;case"r":break}m.width=b;m.height=f+40;c.monthsCombo.style.display="none";Zapatec.Utils.fixBoxPosition(m);c.showAt(m.x,m.y)};Zapatec.Calendar.prototype.setDateFormat=function(b){this.dateFormat=b};Zapatec.Calendar.prototype.setTtDateFormat=function(b){this.ttDateFormat=b};Zapatec.Calendar.prototype.parseDate=function(d,b){if(!d){return this.setDate(this.date)}if(!b){b=this.dateFormat}var c=Date.parseDate(d,b);return this.setDate(c)};Zapatec.Calendar.prototype.hideShowCovered=function(){if(!Zapatec.is_ie5){return}var v=this;function c(p){var i=p.style.visibility;if(!i){if(window.document.defaultView&&typeof(window.document.defaultView.getComputedStyle)=="function"){if(!Zapatec.is_khtml){i=window.document.defaultView.getComputedStyle(p,"").getPropertyValue("visibility")}else{i=""}}else{if(p.currentStyle){i=p.currentStyle.visibility}else{i=""}}}return i}var w=["applet","iframe","select"];var d=v.element;var b=Zapatec.Utils.getAbsolutePos(d);var h=b.x;var f=d.offsetWidth+h;var u=b.y;var t=d.offsetHeight+u;for(var m=w.length;m>0;){var l=window.document.getElementsByTagName(w[--m]);var g=null;for(var o=l.length;o>0;){g=l[--o];b=Zapatec.Utils.getAbsolutePos(g);var s=b.x;var r=g.offsetWidth+s;var q=b.y;var n=g.offsetHeight+q;if(v.hidden||(s>f)||(r<h)||(q>t)||(n<u)){if(!g.__msh_save_visibility){g.__msh_save_visibility=c(g)}g.style.visibility=g.__msh_save_visibility}else{if(!g.__msh_save_visibility){g.__msh_save_visibility=c(g)}g.style.visibility="hidden"}}}};Zapatec.Calendar.prototype._displayWeekdays=function(){var c=this.firstDayOfWeek;var b=this.firstdayname;var f=Zapatec.Calendar.i18n("WEEKEND");for(k=1;(k<=this.monthsInRow)&&(b);++k){for(var d=0;d<7;++d){b.className=" day name";if((!this.weekNumbers)&&(d==0)&&(k!=1)){Zapatec.Utils.addClass(b,"month-left-border")}if((d==6)&&(k!=this.monthsInRow)){Zapatec.Utils.addClass(b,"month-right-border");b.width=15}var g=(d+c)%7;if((!this.disableFdowClick)&&((this.params&&this.params.fdowClick)||d)){if(Zapatec.Calendar.i18n("DAY_FIRST")!=null){b.ttip=Zapatec.Calendar.i18n("DAY_FIRST").replace("%s",Zapatec.Calendar.i18n(g,"dn"))}b.navtype=100;b.calendar=this;b.fdow=g;Zapatec.Calendar._add_evs(b)}if((f!=null)&&(f.indexOf(g.toString())!=-1)){Zapatec.Utils.addClass(b,"weekend")}b.innerHTML=Zapatec.Calendar.i18n((d+c)%7,"sdn");b=b.nextSibling}if(this.weekNumbers&&b){b=b.nextSibling}}};Zapatec.Utils.compareDates=function(c,b){if(Zapatec.Calendar.prefs.sortOrder=="asc"){return c-b}else{return b-c}};Zapatec.Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none";this.histCombo.style.display="none";this.updateWCH()};Zapatec.Calendar.prototype._dragStart=function(c){c||(c=window.event);if(this.dragging){return}this.dragging=true;var f=c.clientX+window.document.body.scrollLeft;var d=c.clientY+window.document.body.scrollTop;var b=this.element.style;this.xOffs=f-parseInt(b.left);this.yOffs=d-parseInt(b.top);Zapatec.Utils.addEvent(window.document,"mousemove",Zapatec.Calendar.calDragIt);Zapatec.Utils.addEvent(window.document,"mouseover",Zapatec.Calendar.calDragIt);Zapatec.Utils.addEvent(window.document,"mouseup",Zapatec.Calendar.calDragEnd)};Date._MD=[31,28,31,30,31,30,31,31,30,31,30,31];Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.prototype.getMonthDays=function(c){var b=this.getFullYear();if(typeof c=="undefined"){c=this.getMonth()}if(((0==(b%4))&&((0!=(b%100))||(0==(b%400))))&&c==1){return 29}else{return Date._MD[c]}};Date.prototype.getDayOfYear=function(){var b=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var d=new Date(this.getFullYear(),0,0,0,0,0);var c=b-d;return Math.floor(c/Date.DAY)};Date.prototype.getWeekNumber=function(){var f=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var c=f.getDay();f.setDate(f.getDate()-(c+6)%7+3);var b=f.valueOf();f.setMonth(0);f.setDate(4);return Math.round((b-f.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(b){return((this.getFullYear()==b.getFullYear())&&(this.getMonth()==b.getMonth())&&(this.getDate()==b.getDate())&&(this.getHours()==b.getHours())&&(this.getMinutes()==b.getMinutes()))};Date.prototype.dateEqualsTo=function(b){return((this.getFullYear()==b.getFullYear())&&(this.getMonth()==b.getMonth())&&(this.getDate()==b.getDate()))};Date.prototype.setDateOnly=function(b){var c=new Date(b);this.setDate(1);this.setFullYear(c.getFullYear());this.setMonth(c.getMonth());this.setDate(c.getDate())};Date.prototype.print=function(p){var b=this.getMonth();var o=this.getDate();var q=this.getFullYear();var t=this.getWeekNumber();var u=this.getDay();var A={};var v=this.getHours();var c=(v>=12);var l=(c)?(v-12):v;var z=this.getDayOfYear();if(l==0){l=12}var f=this.getMinutes();var n=this.getSeconds();A["%a"]=Zapatec.Calendar.i18n(u,"sdn");A["%A"]=Zapatec.Calendar.i18n(u,"dn");A["%b"]=Zapatec.Calendar.i18n(b,"smn");A["%B"]=Zapatec.Calendar.i18n(b,"mn");A["%C"]=1+Math.floor(q/100);A["%d"]=(o<10)?("0"+o):o;A["%e"]=o;A["%H"]=(v<10)?("0"+v):v;A["%I"]=(l<10)?("0"+l):l;A["%j"]=(z<100)?((z<10)?("00"+z):("0"+z)):z;A["%k"]=v?v:"0";A["%l"]=l;A["%m"]=(b<9)?("0"+(1+b)):(1+b);A["%M"]=(f<10)?("0"+f):f;A["%n"]="\n";A["%p"]=c?"PM":"AM";A["%P"]=c?"pm":"am";A["%s"]=Math.floor(this.getTime()/1000);A["%S"]=(n<10)?("0"+n):n;A["%t"]="\t";A["%U"]=A["%W"]=A["%V"]=(t<10)?("0"+t):t;A["%u"]=(u==0)?7:u;A["%w"]=u?u:"0";A["%y"]=(""+q).substr(2,2);A["%Y"]=q;A["%%"]="%";var x=/%./g;if(!Zapatec.is_ie5&&!Zapatec.is_khtml&&!Zapatec.is_mac_ie){return p.replace(x,function(d){return A[d]||d})}var r=p.match(x);for(var h=0;h<r.length;h++){var g=A[r[h]];if(g){x=new RegExp(r[h],"g");p=p.replace(x,g)}}return p};Date.parseDate=function(q,c){if(!q){return new Date()}var r=0;var f=-1;var o=0;var u=q.split(/\W+/);var s=c.match(/%./g);var n=0,l=0;var v=0;var h=0;for(n=0;n<u.length;++n){if(!u[n]){continue}switch(s[n]){case"%d":case"%e":o=parseInt(u[n],10);break;case"%m":f=parseInt(u[n],10)-1;break;case"%Y":case"%y":r=parseInt(u[n],10);(r<100)&&(r+=(r>29)?1900:2000);break;case"%b":case"%B":for(l=0;l<12;++l){if(Zapatec.Calendar.i18n(l,"mn").substr(0,u[n].length).toLowerCase()==u[n].toLowerCase()){f=l;break}}break;case"%H":case"%I":case"%k":case"%l":v=parseInt(u[n],10);break;case"%P":case"%p":if(/pm/i.test(u[n])&&v<12){v+=12}if(/am/i.test(u[n])&&v==12){v=0}break;case"%M":h=parseInt(u[n],10);break}}var g=!isNaN(r)&&!isNaN(f)&&!isNaN(o)&&!isNaN(v)&&!isNaN(h);if(!g){return null}if(r!=0&&f!=-1&&o!=0){return new Date(r,f,o,v,h,0)}r=0;f=-1;o=0;for(n=0;n<u.length;++n){if(u[n].search(/[a-zA-Z]+/)!=-1){var w=-1;for(l=0;l<12;++l){if(Zapatec.Calendar.i18n(l,"mn").substr(0,u[n].length).toLowerCase()==u[n].toLowerCase()){w=l;break}}if(w!=-1){if(f!=-1){o=f+1}f=w}}else{if(parseInt(u[n],10)<=12&&f==-1){f=u[n]-1}else{if(parseInt(u[n],10)>31&&r==0){r=parseInt(u[n],10);(r<100)&&(r+=(r>29)?1900:2000)}else{if(o==0){o=u[n]}}}}}if(r==0){var p=new Date();r=p.getFullYear()}if(f!=-1&&o!=0){return new Date(r,f,o,v,h,0)}return null};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(c){var b=new Date(this);b.__msh_oldSetFullYear(c);if(b.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(c)};Date.prototype.compareDatesOnly=function(g,f){var d=g.getYear();var c=f.getYear();var b=g.getMonth();var l=f.getMonth();var i=g.getDate();var h=f.getDate();if(d>c){return -1}if(c>d){return 1}if(b>l){return -1}if(l>b){return 1}if(i>h){return -1}if(h>i){return 1}return 0};window.calendar=null;try{Zapatec.Calendar.loadPrefs()}catch(e){};
Zapatec.Setup=function(){};Zapatec.Setup.test=true;Zapatec.Calendar.setup=function(b){function e(i,k){if(typeof b[i]=="undefined"){b[i]=k}}e("inputField",null);e("displayArea",null);e("button",null);e("eventName","click");e("ifFormat","%Y/%m/%d");e("daFormat","%Y/%m/%d");e("singleClick",true);e("disableFunc",null);e("dateStatusFunc",b.disableFunc);e("dateText",null);e("firstDay",null);e("align","Br");e("range",[1900,2999]);e("weekNumbers",false);e("flat",null);e("flatCallback",null);e("onSelect",null);e("onClose",null);e("onUpdate",null);e("date",null);e("showsTime",false);e("sortOrder","asc");e("timeFormat","24");e("timeInterval",null);e("electric",true);e("step",2);e("position",null);e("cache",false);e("showOthers",false);e("multiple",null);e("saveDate",null);e("fdowClick",false);e("titleHtml",null);e("disableFdowChange",false);if((b.numberMonths>12)||(b.numberMonths<1)){b.numberMonths=1}else{e("numberMonths",1)}if(b.numberMonths>1){b.showOthers=false}b.numberMonths=parseInt(b.numberMonths,10);if((b.controlMonth>b.numberMonths)||(b.controlMonth<1)){b.controlMonth=1}else{e("controlMonth",samestate)}b.controlMonth=parseInt(b.controlMonth,10);e("vertical",false);if(b.monthsInRow>b.numberMonths){b.monthsInRow=b.numberMonths}e("monthsInRow",b.numberMonths);b.monthsInRow=parseInt(b.monthsInRow,10);if(b.multiple){b.singleClick=false}var c=["inputField","displayArea","button"];for(var d in c){if(typeof b[c[d]]=="string"){b[c[d]]=document.getElementById(b[c[d]])}}if(!(b.flat||b.multiple||b.inputField||b.displayArea||b.button)){return false}if(((b.timeInterval)&&((b.timeInterval!==Math.floor(b.timeInterval))||((60%b.timeInterval!==0)&&(b.timeInterval%60!==0))))||(b.timeInterval>360)){b.timeInterval=null}if(b.date&&!Date.parse(b.date)){b.date=null}if(b.saveDate){e("cookiePrefix",window.location.href+"--"+b.button.id);var h=b.cookiePrefix;var f=Zapatec.Utils.getCookie(h);if(f!=null){document.getElementById(b.inputField.id).value=f}}function g(k){var i=k.params;var m=(k.dateClicked||i.electric);if(m&&i.flat){if(typeof i.flatCallback=="function"){if(!i.multiple){i.flatCallback(k)}}else{return false}}if(m&&i.inputField){i.inputField.value=k.currentDate.print(i.ifFormat);if(typeof i.inputField.onchange=="function"){i.inputField.onchange()}}if(m&&i.displayArea){i.displayArea.innerHTML=k.currentDate.print(i.daFormat)}if(m&&i.singleClick&&k.dateClicked){k.callCloseHandler()}if(m&&typeof i.onUpdate=="function"){i.onUpdate(k)}if(i.saveDate){var l=i.cookiePrefix;Zapatec.Utils.writeCookie(l,i.inputField.value,null,"/",i.saveDate)}}if(b.flat!=null){if(typeof b.flat=="string"){b.flat=document.getElementById(b.flat)}if(!b.flat){return false}var a=new Zapatec.Calendar(b.firstDay,b.date,b.onSelect||g);b.disableFdowChange=null;a.disableFdowClick=b.disableFdowChange;a.showsOtherMonths=b.showOthers;a.showsTime=b.showsTime;a.time24=(b.timeFormat=="24");a.timeInterval=b.timeInterval;a.params=b;a.weekNumbers=b.weekNumbers;a.sortOrder=b.sortOrder.toLowerCase();a.setRange(b.range[0],b.range[1]);a.setDateStatusHandler(b.dateStatusFunc);a.getDateText=b.dateText;a.numberMonths=b.numberMonths;a.controlMonth=b.controlMonth;a.vertical=b.vertical;a.yearStep=b.step;a.monthsInRow=b.monthsInRow;a.helpButton=!b.noHelp;if(b.ifFormat){a.setDateFormat(b.ifFormat)}if(b.inputField&&b.inputField.type=="text"&&typeof b.inputField.value=="string"){a.parseDate(b.inputField.value)}if(b.multiple){a.setMultipleDates(b.multiple)}a.create(b.flat);a.show();return a}var j=b.button||b.displayArea||b.inputField;j["on"+b.eventName]=function(){var i=b.inputField||b.displayArea;var m=b.inputField?b.ifFormat:b.daFormat;var o=false;var n=window.calendar;if(n&&!n.hidden){return false}if(!(n&&b.cache)){window.calendar=n=new Zapatec.Calendar(b.firstDay,b.date,b.onSelect||g,b.onClose||function(p){if(b.cache){p.hide()}else{p.destroy()}});n.disableFdowClick=b.disableFdowChange;n.showsTime=b.showsTime;n.time24=(b.timeFormat=="24");n.timeInterval=b.timeInterval;n.weekNumbers=b.weekNumbers;n.numberMonths=b.numberMonths;n.controlMonth=b.controlMonth;n.vertical=b.vertical;n.monthsInRow=b.monthsInRow;n.historyDateFormat=b.ifFormat||b.daFormat;n.helpButton=!b.noHelp;o=true}else{if(b.date){n.setDate(b.date)}n.hide()}if(b.multiple){n.setMultipleDates(b.multiple)}n.showsOtherMonths=b.showOthers;n.yearStep=b.step;n.setRange(b.range[0],b.range[1]);n.params=b;n.setDateStatusHandler(b.dateStatusFunc);n.getDateText=b.dateText;n.setDateFormat(m);if(o){n.create()}if(i){var k;if(i.value){k=i.value}else{k=i.innerHTML}if(k!=""){var l=Date.parseDate(i.value||i.innerHTML,m);if(l!=null){n.setDate(l)}}}if(!b.position){n.showAtElement(b.button||b.displayArea||b.inputField,b.align)}else{n.showAt(b.position[0],b.position[1])}return false};if(b.closeEventName){j["on"+b.closeEventName]=function(){if(window.calendar){window.calendar.callCloseHandler()}}}return a};
Zapatec.Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Zapatec.Calendar._SDN=new Array("S","M","T","W","T","F","S","S");Zapatec.Calendar._FD=0;Zapatec.Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Zapatec.Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Zapatec.Calendar._TT_en=Zapatec.Calendar._TT={};Zapatec.Calendar._TT.INFO="About the calendar";Zapatec.Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) zapatec.com 2002-2004\nFor latest version visit: http://www.zapatec.com/\n\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Zapatec.Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Zapatec.Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Zapatec.Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Zapatec.Calendar._TT.GO_TODAY="Go Today (hold for history)";Zapatec.Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Zapatec.Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Zapatec.Calendar._TT.SEL_DATE="";Zapatec.Calendar._TT.DRAG_TO_MOVE="Drag to move";Zapatec.Calendar._TT.PART_TODAY=" (today)";Zapatec.Calendar._TT.DAY_FIRST="Display %s first";Zapatec.Calendar._TT.WEEKEND="0,6";Zapatec.Calendar._TT.CLOSE="Close";Zapatec.Calendar._TT.TODAY="Today";Zapatec.Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Zapatec.Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Zapatec.Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Zapatec.Calendar._TT.WK="wk";Zapatec.Calendar._TT.TIME="Time:";Zapatec.Calendar._TT.E_RANGE="Outside the range";if(Zapatec.Calendar._DN){Zapatec.Calendar._TT._DN=Zapatec.Calendar._DN}if(Zapatec.Calendar._SDN){Zapatec.Calendar._TT._SDN=Zapatec.Calendar._SDN}if(Zapatec.Calendar._SDN_len){Zapatec.Calendar._TT._SDN_len=Zapatec.Calendar._SDN_len}if(Zapatec.Calendar._MN){Zapatec.Calendar._TT._MN=Zapatec.Calendar._MN}if(Zapatec.Calendar._SMN){Zapatec.Calendar._TT._SMN=Zapatec.Calendar._SMN}if(Zapatec.Calendar._SMN_len){Zapatec.Calendar._TT._SMN_len=Zapatec.Calendar._SMN_len}Zapatec.Calendar._DN=Zapatec.Calendar._SDN=Zapatec.Calendar._SDN_len=Zapatec.Calendar._MN=Zapatec.Calendar._SMN=Zapatec.Calendar._SMN_len=null;
var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");var isReturn=false;var NUM_CENTYEAR=30;var BUL_TIMECOMPONENT=false;var BUL_YEARSCROLL=true;var calendars=[];var RE_NUM=/^\-?\d+$/;var monthAry=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var ARR_MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];var ARR_WEEKDAYS=["Sun","Mon","Tue","Wed","Thur","Fri","Sat"];var NUM_WEEKSTART=0;var currDate;var dt_current;var passedDate;var depdate;var dt_firstday;var curday;var curmon;year_scroll=BUL_YEARSCROLL;var sysDate="";var targetDisplayCol="";var targetDisplayColHidden="";var mflag=0;var ctflag=0;function LZ(a){return(a<0||a>9?"":"0")+a}function isDate(c,b){var a=getDateFromFormat(c,b);if(a==0){return false}return true}function compareDates(f,g,c,e){var b=getDateFromFormat(f,g);var a=getDateFromFormat(c,e);if(b==0||a==0){return -1}else{if(b>a){return 1}}return 0}function formatDate(I,D){D=D+"";var l="";var v=0;var G="";var f="";var j=I.getYear()+"";var g=I.getMonth()+1;var F=I.getDate();var o=I.getDay();var n=I.getHours();var x=I.getMinutes();var q=I.getSeconds();var t,u,b,r,J,e,C,B,z,p,N,n,L,i,a,A;var w=new Object();if(j.length<4){j=""+(j-0+1900)}w.y=""+j;w.yyyy=j;w.yy=j.substring(2,4);w.M=g;w.MM=LZ(g);w.MMM=MONTH_NAMES[g-1];w.NNN=MONTH_NAMES[g+11];w.d=F;w.dd=LZ(F);w.E=DAY_NAMES[o+7];w.EE=DAY_NAMES[o];w.H=n;w.HH=LZ(n);if(n==0){w.h=12}else{if(n>12){w.h=n-12}else{w.h=n}}w.hh=LZ(w.h);if(n>11){w.K=n-12}else{w.K=n}w.k=n+1;w.KK=LZ(w.K);w.kk=LZ(w.k);if(n>11){w.a="PM"}else{w.a="AM"}w.m=x;w.mm=LZ(x);w.s=q;w.ss=LZ(q);while(v<D.length){G=D.charAt(v);f="";while((D.charAt(v)==G)&&(v<D.length)){f+=D.charAt(v++)}if(w[f]!=null){l=l+w[f]}else{l=l+f}}return l}function _isInteger(c){var b="1234567890";for(var a=0;a<c.length;a++){if(b.indexOf(c.charAt(a))==-1){return false}}return true}function _getInt(g,e,f,c){for(var a=c;a>=f;a--){var b=g.substring(e,e+a);if(b.length<f){return null}if(_isInteger(b)){return b}}return null}function getDateFromFormat(A,r){A=A+"";r=r+"";var z=0;var n=0;var t="";var g="";var w="";var j,h;var b=new Date();var k=b.getYear();var v=b.getMonth()+1;var u=1;var e=b.getHours();var s=b.getMinutes();var p=b.getSeconds();var l="";while(n<r.length){t=r.charAt(n);g="";while((r.charAt(n)==t)&&(n<r.length)){g+=r.charAt(n++)}if(g=="yyyy"||g=="yy"||g=="y"){if(g=="yyyy"){j=4;h=4}if(g=="yy"){j=2;h=2}if(g=="y"){j=2;h=4}k=_getInt(A,z,j,h);if(k==null){return 0}z+=k.length;if(k.length==2){if(k>70){k=1900+(k-0)}else{k=2000+(k-0)}}}else{if(g=="MMM"||g=="NNN"){v=0;for(var q=0;q<MONTH_NAMES.length;q++){var f=MONTH_NAMES[q];if(A.substring(z,z+f.length).toLowerCase()==f.toLowerCase()){if(g=="MMM"||(g=="NNN"&&q>11)){v=q+1;if(v>12){v-=12}z+=f.length;break}}}if((v<1)||(v>12)){return 0}}else{if(g=="EE"||g=="E"){for(var q=0;q<DAY_NAMES.length;q++){var o=DAY_NAMES[q];if(A.substring(z,z+o.length).toLowerCase()==o.toLowerCase()){z+=o.length;break}}}else{if(g=="MM"||g=="M"){v=_getInt(A,z,g.length,2);if(v==null||(v<1)||(v>12)){return 0}z+=v.length}else{if(g=="dd"||g=="d"){u=_getInt(A,z,g.length,2);if(u==null||(u<1)||(u>31)){return 0}z+=u.length}else{if(g=="hh"||g=="h"){e=_getInt(A,z,g.length,2);if(e==null||(e<1)||(e>12)){return 0}z+=e.length}else{if(g=="HH"||g=="H"){e=_getInt(A,z,g.length,2);if(e==null||(e<0)||(e>23)){return 0}z+=e.length}else{if(g=="KK"||g=="K"){e=_getInt(A,z,g.length,2);if(e==null||(e<0)||(e>11)){return 0}z+=e.length}else{if(g=="kk"||g=="k"){e=_getInt(A,z,g.length,2);if(e==null||(e<1)||(e>24)){return 0}z+=e.length;e--}else{if(g=="mm"||g=="m"){s=_getInt(A,z,g.length,2);if(s==null||(s<0)||(s>59)){return 0}z+=s.length}else{if(g=="ss"||g=="s"){p=_getInt(A,z,g.length,2);if(p==null||(p<0)||(p>59)){return 0}z+=p.length}else{if(g=="a"){if(A.substring(z,z+2).toLowerCase()=="am"){l="AM"}else{if(A.substring(z,z+2).toLowerCase()=="pm"){l="PM"}else{return 0}}z+=2}else{if(A.substring(z,z+g.length)!=g){return 0}else{z+=g.length}}}}}}}}}}}}}}if(z!=A.length){return 0}if(v==2){if(((k%4==0)&&(k%100!=0))||(k%400==0)){if(u>29){return 0}}else{if(u>28){return 0}}}if((v==4)||(v==6)||(v==9)||(v==11)){if(u>30){return 0}}if(e<12&&l=="PM"){e=e-0+12}else{if(e>11&&l=="AM"){e-=12}}var a=new Date(k,v-1,u,e,s,p);return a.getTime()}function parseDate(h){var f=(arguments.length==2)?arguments[1]:false;generalFormats=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");var b=new Array("generalFormats",f?"dateFirst":"monthFirst",f?"monthFirst":"dateFirst");var g=null;for(var e=0;e<b.length;e++){var a=window[b[e]];for(var c=0;c<a.length;c++){g=getDateFromFormat(h,a[c]);if(g!=0){return new Date(g)}}}return null}function getdtnumber(b){var e=b.substr(b.length-4,4);var g=getMonthVal(b.substr(b.length-8,3))+"";if(g.replace(/^\s*|\s*$/g,"").length==1){g="0"+g}var c=b.substr(0,2);var f=e+g+c;return f}function initDate(c){var b=0;var f="";if(c.indexOf("-")!=-1){f=c.split("-")}else{if(c.indexOf("/")!=-1){f=c.split("/")}}var e=new Date(f[2],Number(f[1])-1,f[0]);e=e.valueOf()+(b>0?(60*60*(24*b)*1000):0);sysDate=new Date(e);currDate=new Date(sysDate);var a=currDate.valueOf();currDate=new Date(a);dt_current=new Date(currDate);dt_firstday=new Date(dt_current);dt_firstday.setDate(1);dt_firstday.setDate(1-(7+dt_firstday.getDay()-NUM_WEEKSTART)%7);curday=currDate.getDate();curmon=currDate.getMonth();if(document.getElementById("SplsDateDisp")){m=m+1+"";d=d+"";if(m.length==1){m="0"+m}if(d.length==1){d="0"+d}document.getElementById("SplsDateDisp").value=d+"/"+m+"/"+y}}function gen_date(a){return((a.getDate()<=9?"0":"")+a.getDate()+"/"+((a.getMonth()+1)<=9?"0":"")+(a.getMonth()+1)+"/"+a.getFullYear())}function gen_date_h(a){return((a.getDate()<=9?"0":"")+a.getDate()+"-"+(monthAry[a.getMonth()]<=9?"0":"")+(monthAry[a.getMonth()])+"-"+a.getFullYear())}function cal_prs_date(o,a,l,h){if(l!=null){mflag=l}else{mflag=0}if(h!=null){ctflag=h}else{ctflag=0}var n=document.getElementById(o);if((n.value=="DD/MM/YYYY")||(n.value=="")){return null}var f="";var c="";if(a){f=document.getElementById(a)}if(n.value!=""||n.value!="DD/MM/YYYY"){c=n.value}var g="";if(c.indexOf("-")!=-1){g=c.split("-")}else{if(c.indexOf("/")!=-1){g=c.split("/")}}var j=new Date(sysDate);var b=j.getYear();if(g.length!=3){alert("Invalid date format: '"+c+"'.\nFormat accepted is DD/MM/YYYY .");n.value="";if(a){f.value=""}return null}if(!g[1]){alert("Invalid month format: '"+c+"'.\nNo date value can be found.");n.value="";if(a){f.value=""}return null}if((Number(g[1])<=0)||(Number(g[1])>12)){alert("Invalid date format: '"+c+"'.\nNo month value can be found.");n.value="";if(a){f.value=""}return null}if(!RE_NUM.exec(g[1])){alert("Invalid month value: '"+g[1]+"'.\nAllowed values are unsigned integers.");n.value="";if(a){f.value=""}return null}if(!g[0]){alert("Invalid date format: '"+c+"'.\nNo day of month value can be found.");n.value="";if(a){f.value=""}return null}if(g[0]==0){alert("Invalid date format: '"+c+"'.\nNo day of month value can be found.");n.value="";if(a){f.value=""}return null}if(!RE_NUM.exec(g[0])){alert("Invalid day of month value: '"+g[0]+"'.\nAllowed values are unsigned integers.");n.value="";if(a){targetDisplayColHidden.value=""}return null}if(!g[2]){alert("Invalid date format: '"+c+"'.\nNo year value can be found.");n.value="";if(a){targetDisplayColHidden.value=""}return null}if(!RE_NUM.exec(g[2])){alert("Invalid year value: '"+g[2]+"'.\nAllowed values are unsigned integers.");n.value="";if(a){targetDisplayColHidden.value=""}return null}var k=new Date(sysDate);k.setDate(1);if(g[2]<100){g[2]=Number(g[2])+(g[2]<NUM_CENTYEAR?2000:1900)}k.setFullYear(g[2]);var e=new Date(g[2],g[0],0);k.setMonth(g[1]-1);k.setDate(g[0]);var i=(Number(k.valueOf())-Number(j.valueOf()))/(60*60*24*1000);if(ctflag==0){if(parseInt(i)>361){alert(n.value+"Date in advance exceeds 360 days.");n.value="";if(a){f.value=""}return null}}if((ctflag==1)&&(Number(getdtnumber(gen_date_h(k)))>Number(getdtnumber(gen_date_h(j))))){alert(n.value+"Not a valid date");n.value="";if(a){f.value=""}return null}if((ctflag==2)&&(Number(getdtnumber(gen_date_h(k)))<Number(getdtnumber(gen_date_h(j))))){alert(n.value+"Not a valid date");n.value="";if(a){f.value=""}return null}if(a){f.value=gen_date_h(k)}return(k)}function getdate(e,c,a,b){var g=document.getElementById(e);targetDisplayCol=g;if(document.getElementById(c)){var f=document.getElementById(c);targetDisplayColHidden=f}if(a){mflag=a}if(b){ctflag=b}var h=new calendar_disp(g,f);h.year_scroll=true;h.time_comp=false;h.popup()}function getmontharray(){var a=currDate;var k=new Array();var f=new Array();var b=a.getMonth();var c=a.getFullYear();var e=0;for(var h=0;h<12;h++){k[h]=monthAry[b++];f[h]=c;if(b>=12){b=b-12;if(e==0){c=c+1;e++}}}var l="<ul class='cal-m'>";for(var g=0;g<12;g++){if(k[g]==monthAry[dt_current.getMonth()]){l=l+'<li><a class="selected" href="javascript:changemonth(\''+k[g]+"','"+f[g]+"')\">"+k[g]+"</a></li>"}else{l=l+"<li><a href=\"javascript:changemonth('"+k[g]+"','"+f[g]+"')\">"+k[g]+"</a></li>"}}l=l+"</ul>";document.getElementById("displaymonth").innerHTML=l}function changemonth(g,f){var e=0;var c=f;var a=1;curday=a;for(var b=0;b<monthAry.length;b++){if(monthAry[b]==g){e=b}}setnewDate(new Date(c,e,a))}function set_newdate(a,f){var e=currDate.getFullYear()+""+(Number(currDate.getMonth())<=9?"0"+currDate.getMonth():currDate.getMonth());var b=0;if(a=="next_month"){b=dt_current.getFullYear()+""+((Number(dt_current.getMonth())+1)<=9?"0"+(dt_current.getMonth()+1):(dt_current.getMonth()+1))}else{if(a=="next_year"){b=(dt_current.getFullYear()+1)+""+(Number(dt_current.getMonth())<=9?"0"+dt_current.getMonth():dt_current.getMonth())}else{if(a=="next_5year"){b=(dt_current.getFullYear()+5)+""+(Number(dt_current.getMonth())<=9?"0"+dt_current.getMonth():dt_current.getMonth())}}}if(a=="prev_month"){b=dt_current.getFullYear()+""+((Number(dt_current.getMonth())-1)<=9?"0"+(dt_current.getMonth()-1):(dt_current.getMonth()-1))}else{if(a=="prev_year"){b=(dt_current.getFullYear()-1)+""+(Number(dt_current.getMonth())<=9?"0"+dt_current.getMonth():dt_current.getMonth())}else{if(a=="prev_5year"){b=(dt_current.getFullYear()-5)+""+(Number(dt_current.getMonth())<=9?"0"+dt_current.getMonth():dt_current.getMonth())}}}if((ctflag==0)||((ctflag==1)&&(b<=e))||((ctflag==2)&&(b>=e))){var g=new Date(dt_current);var c=new Date(currDate);if(f=="limited"){c.setMonth(c.getMonth()+11)}if(a=="prev_month"){if(f=="limited"){g.setMonth(g.getMonth()-1);if(Number(g.getFullYear()+""+(g.getMonth()<=9?"0"+g.getMonth():g.getMonth()))<e){g=new Date(c)}}else{g.setMonth(g.getMonth()-1)}}else{if(a=="prev_5year"){g.setFullYear(g.getFullYear()-5)}else{if(a=="prev_year"){g.setFullYear(g.getFullYear()-1)}else{if(a=="next_month"){if(f=="limited"){g.setMonth(g.getMonth()+1);if(Number(g.getFullYear()+""+(g.getMonth()<=9?"0"+g.getMonth():g.getMonth()))>Number(c.getFullYear()+""+(c.getMonth()<=9?"0"+c.getMonth():c.getMonth()))){g=new Date(currDate)}}else{g.setMonth(g.getMonth()+1)}}}}}}else{if(a=="next_5year"){g.setFullYear(g.getFullYear()+5)}else{if(a=="next_year"){g.setFullYear(g.getFullYear()+1)}}}setnewDate(g)}function setnewDate(a){var b=new Date(a);dt_current=b;dt_firstday=new Date(dt_current);dt_firstday.setDate(1);dt_firstday.setDate(1-(7+dt_firstday.getDay()-NUM_WEEKSTART)%7);curday=currDate.getDate();curmon=currDate.getMonth();set_datetime(b.valueOf())}function set_datetime(a,b){var c=new Date(a);if(b){document.getElementById(targetDisplayCol).value=gen_date(c);document.getElementById(targetDisplayColHidden).value=gen_date_h(c);document.getElementById("calendar-1").style.display="none"}else{displayCalendar(targetDisplayCol,targetDisplayColHidden,mflag,ctflag,"in")}}function closecal(){document.getElementById("calendar-1").style.display="none"}function checktxtfieldvalue(c,a){if((document.getElementById(c).value!="DD/MM/YYYY")&&(document.getElementById(c).value!="")){var e="";var b=a;if(b.indexOf("-")!=-1){e=b.split("-")}else{if(b.indexOf("/")!=-1){e=b.split("/")}}columnDatevalue=new Date(e[2],Number(e[1])-1,e[0]);dt_current=new Date(e[2],Number(e[1])-1,e[0]);dt_firstday=new Date(dt_current);dt_firstday.setDate(1);dt_firstday.setDate(1-(7+dt_firstday.getDay()-NUM_WEEKSTART)%7);curday=currDate.getDate();curmon=currDate.getMonth();passedDate=new Date(dt_current)}else{dt_current=new Date(currDate);dt_firstday=new Date(dt_current);dt_firstday.setDate(1);dt_firstday.setDate(1-(7+dt_firstday.getDay()-NUM_WEEKSTART)%7);curday=currDate.getDate();curmon=currDate.getMonth();passedDate=new Date(sysDate)}}function createDepDate(c,a){if((document.getElementById(c).value!="DD/MM/YYYY")&&(document.getElementById(c).value!="")){a=increasedatebydays(a,1);var e="";var b=a;if(b.indexOf("-")!=-1){e=b.split("-")}else{if(b.indexOf("/")!=-1){e=b.split("/")}}columnDatevalue=new Date(e[2],Number(e[1])-1,e[0]);dt_current=new Date(e[2],Number(e[1])-1,e[0]);dt_firstday=new Date(dt_current);dt_firstday.setDate(1);dt_firstday.setDate(1-(7+dt_firstday.getDay()-NUM_WEEKSTART)%7);curday=currDate.getDate();curmon=currDate.getMonth();depdate=new Date(dt_current)}else{dt_current=new Date(currDate);dt_firstday=new Date(dt_current);dt_firstday.setDate(1);dt_firstday.setDate(1-(7+dt_firstday.getDay()-NUM_WEEKSTART)%7);curday=currDate.getDate();curmon=currDate.getMonth();depdate=new Date(sysDate)}}function increasedatebydays(b,a){var e="";if(b.indexOf("-")!=-1){e=b.split("-")}else{if(b.indexOf("/")!=-1){e=b.split("/")}}var c=new Date(e[2],Number(e[1])-1,e[0]);c=c.valueOf()+(a>0?(60*60*(24*a)*1000):0);return gen_date(new Date(c))}function displayCalendar(f,g,s,k,h){if((document.getElementById(f).value!="DD/MM/YYYY")&&(document.getElementById(f).value!="")){if(cal_prs_date(f,g,s,k)==null){return null}}var l="";var q=0;var e=0;var b=currDate.getFullYear()+""+(Number(currDate.getMonth())<=9?"0"+currDate.getMonth():currDate.getMonth())+""+(Number(currDate.getDate())<=9?"0"+currDate.getDate():currDate.getDate());targetDisplayCol=f;targetDisplayColHidden=g;document.getElementById("displaymonth").innerHTML="";document.getElementById("displayDates").innerHTML="";if(!h){if(targetDisplayCol=="RFromDateDisp"){if(((document.getElementById("RFromDate").value!="DD/MM/YYYY")&&(document.getElementById("RFromDate").value!=""))&&(document.getElementById("RFromDateDisp").value=="DD/MM/YYYY"||document.getElementById("RFromDateDisp").value=="")){checktxtfieldvalue(targetDisplayColHidden,document.getElementById(targetDisplayColHidden).value)}else{checktxtfieldvalue(targetDisplayCol,document.getElementById(targetDisplayCol).value)}}else{if(targetDisplayCol=="RToDateDisp"){if(((document.getElementById("RFromDateDisp").value!="DD/MM/YYYY")&&(document.getElementById("RFromDateDisp").value!=""))&&((document.getElementById("RToDateDisp").value=="DD/MM/YYYY")||(document.getElementById("RToDateDisp").value==""))){checktxtfieldvalue("RFromDateDisp",increasedatebydays(document.getElementById("RFromDateDisp").value,1))}else{checktxtfieldvalue(targetDisplayCol,document.getElementById(targetDisplayCol).value)}}else{if(targetDisplayCol=="RFromDateDispCalBelow"){isReturn=false;if(((document.getElementById("RFromDate").value!="DD/MM/YYYY")&&(document.getElementById("RFromDate").value!=""))&&(document.getElementById("RFromDateDispCalBelow").value=="DD/MM/YYYY"||document.getElementById("RFromDateDispCalBelow").value=="")){checktxtfieldvalue(targetDisplayColHidden,increasedatebydays(document.getElementById(targetDisplayColHidden).value,5))}else{checktxtfieldvalue(targetDisplayCol,document.getElementById(targetDisplayCol).value)}}else{if(targetDisplayCol=="RToDateDispCalBelow"){isReturn=true;createDepDate("RFromDateDispCalBelow",document.getElementById("RFromDateDispCalBelow").value);if(((document.getElementById("RFromDateDispCalBelow").value!="DD/MM/YYYY")&&(document.getElementById("RFromDateDispCalBelow").value!=""))&&((document.getElementById("RToDateDispCalBelow").value=="DD/MM/YYYY")||(document.getElementById("RToDateDispCalBelow").value==""))){checktxtfieldvalue("RFromDateDispCalBelow",increasedatebydays(document.getElementById("RFromDateDispCalBelow").value,2))}else{checktxtfieldvalue(targetDisplayCol,document.getElementById(targetDisplayCol).value)}}else{checktxtfieldvalue(targetDisplayCol,document.getElementById(targetDisplayCol).value)}}}}}mflag=0;ctflag=0;getmontharray();l=l+"<table class='cal-nav'><tr><th>";if(dt_current.getMonth()==curmon){l=l+"<img src='/images/cal-arrow-left.gif' width='4' height='8' align='absmiddle' alt='back' border='0'/>&nbsp;"}else{l=l+"<a href=javascript:set_newdate('prev_month','limited')><img src='/images/cal-arrow-left.gif' width='4' height='8' align='absmiddle' alt='back' border='0'/></a>"}l=l+ARR_MONTHS[dt_current.getMonth()]+" "+dt_current.getFullYear();l=l+"<a href=javascript:set_newdate('next_month','limited')><img src='/images/cal-arrow-right.gif' width='4' height='8' align='absmiddle' alt='forward' border='0'/></a></th></tr></table>";l=l+"<table class='cal-d'>";for(var c=0;c<7;c++){l=l+"<th scope='col' width=30>"+ARR_WEEKDAYS[(NUM_WEEKSTART+c)%7]+"</th>"}var r=new Date(dt_firstday);var j=passedDate.getFullYear()+""+(Number(passedDate.getMonth())<=9?"0"+passedDate.getMonth():passedDate.getMonth())+""+(Number(passedDate.getDate())<=9?"0"+passedDate.getDate():passedDate.getDate());var i;if(isReturn){i=depdate.getFullYear()+""+(Number(depdate.getMonth())<=9?"0"+depdate.getMonth():depdate.getMonth())+""+(Number(depdate.getDate())<=9?"0"+depdate.getDate():depdate.getDate())}while(r.getMonth()==dt_current.getMonth()||r.getMonth()==dt_firstday.getMonth()){l=l+"<tr>";for(var a=0;a<7;a++){q=r.getFullYear()+""+(Number(r.getMonth())<=9?"0"+r.getMonth():r.getMonth())+""+(Number(r.getDate())<=9?"0"+r.getDate():r.getDate());l=l+"<td>";if(r.getMonth()==curmon){if(q>b){if(isReturn){if(q==j){l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);' class='selected' title='"+ARR_MONTHS[passedDate.getMonth()]+" "+passedDate.getDate()+"'>"}else{if(q<i){l=l+"<a href='javascript:void(0)' class='n-a'>"}else{l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);'>"}}}else{if(q==j){l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);' class='selected' title='"+ARR_MONTHS[passedDate.getMonth()]+" "+passedDate.getDate()+"'>"}else{l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);'>"}}}else{if(q==b){if(isReturn){if(b<i){l=l+"<a href='javascript:void(0)' class='n-a'>"}else{l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);' class='today' title='"+ARR_MONTHS[currDate.getMonth()]+" "+currDate.getDate()+"'>"}}else{if(r.getMonth()==dt_current.getMonth()){l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);' class='today' title='"+ARR_MONTHS[currDate.getMonth()]+" "+currDate.getDate()+"'>"}else{l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);' title='"+ARR_MONTHS[currDate.getMonth()]+" "+currDate.getDate()+"'>"}}}else{l=l+"<a href='javascript:void(0)' class='n-a'>"}}}else{if(q>b){if(isReturn){if(q==j){l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);' class='selected' title='"+ARR_MONTHS[passedDate.getMonth()]+" "+passedDate.getDate()+"'>"}else{if(q<i){l=l+"<a href='javascript:void(0)' class='n-a'>"}else{l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);'>"}}}else{if(q==j){l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);' class='selected' title='"+ARR_MONTHS[passedDate.getMonth()]+" "+passedDate.getDate()+"'>"}else{l=l+"<a href='javascript:set_datetime("+r.valueOf()+", true);'>"}}}else{l=l+"<a href='javascript:void(0)' class='n-a'>"}}if(r.getMonth()==dt_current.getMonth()){l=l+r.getDate()+"</a></td>"}else{if(q>b){l=l+"<font style='color:#cccccc;'>"+r.getDate()+"</font></a></td>"}}r.setDate(r.getDate()+1)}l=l+"</tr>"}l=l+"</table>";var p=0;var o=0;if(targetDisplayCol.indexOf("CalBelow")!=-1){p=findPosX(document.getElementById(targetDisplayCol))+100;o=findPosY(document.getElementById(targetDisplayCol))}else{p=findPosX(document.getElementById(targetDisplayCol))+200;o=findPosY(document.getElementById(targetDisplayCol))-100}document.getElementById("calendar-1").style.top=o+"px";document.getElementById("calendar-1").style.left=p+"px";document.getElementById("displaymonth").style.display="";document.getElementById("displayDates").innerHTML=l;document.getElementById("displayDates").style.display="block";Effect.Appear("calendar-1")}function findPosX(a){var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return a};
Zapatec.Calendar.setup({showOthers:true,step:1,electric:false,inputField:"txtdeptDateOway",button:"deptDateOwayimgExact",ifFormat:"%d/%m/%Y",daFormat:"%d/%m/%Y",numberMonths:2,displayArea:null,flat:null,multiple:null,numberMonths:2,monthsInRow:2,dateStatusFunc:dateInRange1,onUpdate:filterDates1,vertical:true});Zapatec.Calendar.setup({showOthers:true,step:1,electric:false,inputField:"txtretnDateOway",button:"retnDateOwayimg",ifFormat:"%d/%m/%Y",daFormat:"%d/%m/%Y",numberMonths:2,displayArea:null,flat:null,multiple:null,numberMonths:2,monthsInRow:2,dateStatusFunc:dateInRange2,onUpdate:filterDates2,vertical:true});Zapatec.Calendar.setup({showOthers:true,step:1,electric:false,inputField:"txtdeptDateRtrip",button:"deptDateRtripimgExact",ifFormat:"%d/%m/%Y",daFormat:"%d/%m/%Y",numberMonths:2,displayArea:null,flat:null,multiple:null,numberMonths:2,monthsInRow:2,dateStatusFunc:dateInRange1,onUpdate:filterDates1,vertical:true});Zapatec.Calendar.setup({showOthers:true,step:1,electric:false,inputField:"txtdeptDateMcity",button:"deptDateMcityimgExact",ifFormat:"%d/%m/%Y",daFormat:"%d/%m/%Y",numberMonths:2,displayArea:null,flat:null,multiple:null,numberMonths:2,monthsInRow:2,dateStatusFunc:dateInRange1,onUpdate:filterDatesMulti,vertical:true});var mcityPrevDep=new Date();function mcity1DateField(b,h,f){if(document.getElementById(b).value!="DD/MM/YYYY"){document.getElementById(h).disabled=false;var a=document.getElementById(b).value;var g;if(a!="DD/MM/YYYY"){var c=a.split("/")[0];var e=a.split("/")[1];var d=a.split("/")[2];g=new Date(d,e-1,c);g.setDate(g.getDate()+1)}Zapatec.Calendar.setup({showOthers:true,step:1,electric:false,inputField:h,button:f,ifFormat:"%d/%m/%Y",daFormat:"%d/%m/%Y",date:g,numberMonths:2,displayArea:null,flat:null,multiple:null,numberMonths:2,monthsInRow:2,dateStatusFunc:dateInRange1,onUpdate:filterDatesMulti,vertical:true})}}var deptShowCalendar=new Date();function returnDateField(){var b=document.getElementById("txtdeptDateRtrip").value;var a;if(b!="DD/MM/YYYY"){var c=b.split("/")[0];var e=b.split("/")[1];var d=b.split("/")[2];a=new Date(d,e-1,c)}Zapatec.Calendar.setup({showOthers:true,step:1,electric:false,inputField:"txtretnDateRtrip",button:"retnDateRtripimgExact",ifFormat:"%d/%m/%Y",daFormat:"%d/%m/%Y",date:a,numberMonths:2,displayArea:null,flat:null,multiple:null,numberMonths:2,monthsInRow:2,dateStatusFunc:dateInRange2,vertical:true})}var startDate;var endDate;var callbacks=0;function compareDatesOnly(e,d){var c=e.getYear();var b=d.getYear();var a=e.getMonth();var h=d.getMonth();var g=e.getDate();var f=d.getDate();if(c>b){return -1}if(b>c){return 1}if(a>h){return -1}if(h>a){return 1}if(g>f){return -1}if(f>g){return 1}return 0}function filterDates1(a){startDate=a.date;if(endDate==null){Zapatec.Calendar.setup({inputField:"arrivalDate",button:"button8b",ifFormat:"%Y-%m-%d ",timeFormat:"24",date:startDate,electric:false,showsTime:false,disableFunc:dateInRange2,onUpdate:filterDates2})}}function filterDatesMulti(a){startDate=a.date;startDate.setDate(startDate.getDate()+1);if(endDate==null){Zapatec.Calendar.setup({inputField:"arrivalDate",button:"button8b",ifFormat:"%Y-%m-%d ",timeFormat:"24",date:startDate,electric:false,showsTime:false,disableFunc:dateInRange2,onUpdate:filterDates2})}}function filterDates2(a){endDate=a.date}function dateInRange1(d){if(endDate!=null){var b=compareDatesOnly(d,endDate);if(b<0){return(true)}if(b==0){return"edges"}if(startDate!=null){var c=compareDatesOnly(d,startDate);if(c<0){return"between"}}}var a=new Date();var e=compareDatesOnly(d,a);if(e>0){return(true)}return false;return(ret)}function dateInRange2(c){if(startDate!=null){var a=compareDatesOnly(startDate,c);if(a<0){return(true)}if(a==0){return"edges"}if((endDate!=null)&&(c>startDate)&&(c<endDate)){return"between"}}var b=new Date();if(compareDatesOnly(b,c)<0){return(true)}return false}var checkInShowCalendar=new Date();Zapatec.Calendar.setup({showOthers:true,step:1,electric:false,inputField:"arrDateOway",button:"arrDateOwayimg",ifFormat:"%d/%m/%Y",daFormat:"%d/%m/%Y",numberMonths:2,displayArea:null,flat:null,multiple:null,numberMonths:2,monthsInRow:2,dateStatusFunc:dateInRange3,onUpdate:filterDates3,vertical:true});var depthtlShowCalendar=new Date();returnDateField1();function returnDateField1(){if(document.getElementById("arrDateOway")!=null){var a=document.getElementById("arrDateOway").value;var e;if(a.toUpperCase()!="DD/MM/YYYY"){var b=a.split("/")[0];var d=a.split("/")[1];var c=a.split("/")[2];e=new Date(c,d-1,b)}else{e=new Date()}Zapatec.Calendar.setup({showOthers:true,step:1,electric:false,inputField:"HdeptDateOway",button:"HdeptDateOwayimg",ifFormat:"%d/%m/%Y",daFormat:"%d/%m/%Y",date:e,numberMonths:2,displayArea:null,flat:null,multiple:null,numberMonths:2,monthsInRow:2,dateStatusFunc:dateInRange4,vertical:true})}}var controlDate=0;var htlstartDate;var htlendDate;var htlcallbacks=0;function filterDates3(a){htlstartDate=a.date;htlstartDate.setDate(htlstartDate.getDate()+1);if(htlendDate==null){Zapatec.Calendar.setup({inputField:"arrivalDate",button:"button8b",ifFormat:"%Y-%m-%d ",timeFormat:"24",date:htlstartDate,electric:false,showsTime:false,disableFunc:dateInRange4,onUpdate:filterDates4})}}function filterDates4(a){htlendDate=a.date;htlendDate.setDate(htlendDate.getDate()-1)}function dateInRange3(d){if(htlendDate!=null){var b=compareDatesOnly(d,htlendDate);if(b<0){return(true)}if(b==0){return"edges"}if(htlstartDate!=null){var c=compareDatesOnly(d,htlstartDate);if(c<0){return"between"}}}var a=new Date();a.setDate(a.getDate()+controlDate);var e=compareDatesOnly(d,a);if(e>0){return(true)}return false;return(ret)}function dateInRange4(c){if(htlstartDate!=null){var a=compareDatesOnly(htlstartDate,c);if(a<0){return(true)}if(a==0){return"edges"}if((htlendDate!=null)&&(c>htlstartDate)&&(c<htlendDate)){return"between"}}var b=new Date();b.setDate(b.getDate()+controlDate);if(compareDatesOnly(b,c)<0){return(true)}return false};