if(typeof Zapatec=="undefined"){Zapatec=function(){}}Zapatec.version="07-01";if(typeof Zapatec.zapatecPath=="undefined"){Zapatec.zapatecPath=function(){if(document.documentElement){var a=document.documentElement.innerHTML.match(/<script[^>]+src="([^"]*zapatec(-core|-src)?.js[^"]*)"/i);if(a&&a.length>=2){a=a[1].split("?");a=a[0].split("/");if(Array.prototype.pop){a.pop()}else{a.length-=1}return a.length?a.join("/")+"/":""}}return""}()}if(typeof Zapatec=="undefined"){Zapatec=function(){}}Zapatec.Utils={};Zapatec.Utils.getAbsolutePos=function(g,l){var a=0,f=0;if(!l){var e=/^div$/i.test(g.tagName);if(e&&g.scrollLeft){a=g.scrollLeft}if(e&&g.scrollTop){f=g.scrollTop}}var h={x:g.offsetLeft-a,y:g.offsetTop-f};if(g.offsetParent){var b=this.getAbsolutePos(g.offsetParent);h.x+=b.x;h.y+=b.y}return h};Zapatec.Utils.getElementOffset=function(f){var g=iTop=iWidth=iHeight=0;var e;if(f.getBoundingClientRect){var l=f.getBoundingClientRect();g=l.left;iTop=l.top;iWidth=l.right-g;iHeight=l.bottom-iTop;g+=Zapatec.Utils.getPageScrollX()-2;iTop+=Zapatec.Utils.getPageScrollY()-2}else{iWidth=f.offsetWidth;iHeight=f.offsetHeight;var a=Zapatec.Utils.getStyleProperty(f,"position");if(a=="fixed"){g=f.offsetLeft+Zapatec.Utils.getPageScrollX();iTop=f.offsetTop+Zapatec.Utils.getPageScrollY()}else{if(a=="absolute"){while(f){e=f.tagName;if(e){e=e.toLowerCase();if(e!="body"&&e!="html"){g+=parseInt(f.offsetLeft,10)||0;iTop+=parseInt(f.offsetTop,10)||0}}f=f.offsetParent;e=f?f.tagName:null;if(e){e=e.toLowerCase();if(e!="body"&&e!="html"){g-=f.scrollLeft;iTop-=f.scrollTop}}}}else{var b=(Zapatec.is_gecko&&!Zapatec.is_khtml);var m=Zapatec.Utils.getStyleProperty;var h=f;while(h){if(b){e=h.tagName;if(e){e=e.toLowerCase();if(e=="body"&&!(m(h,"-moz-box-sizing")=="border-box")){g+=parseInt(m(h,"border-left-width"));iTop+=parseInt(m(h,"border-top-width"))}}}g+=parseInt(h.offsetLeft,10)||0;iTop+=parseInt(h.offsetTop,10)||0;h=h.offsetParent}h=f;while(h.parentNode){h=h.parentNode;e=h.tagName;if(e){e=e.toLowerCase();if(e!="body"&&e!="html"&&e!="tr"){g-=h.scrollLeft;iTop-=h.scrollTop}}}}}}return{left:g,top:iTop,x:g,y:iTop,width:iWidth,height:iHeight}};Zapatec.Utils.getElementOffsetScrollable=function(b){var a=Zapatec.Utils.getElementOffset(b);if(b.scrollLeft){a.left-=b.scrollLeft;a.x=a.left}if(b.scrollTop){a.top-=b.scrollTop;a.y=a.top}return a};Zapatec.Utils.fixBoxPosition=function(g,a){var e=Zapatec.Utils.getPageScrollX();var b=Zapatec.Utils.getPageScrollY();var f=Zapatec.Utils.getWindowSize();a=parseInt(a,10)||0;if(g.x<e){g.x=e+a}if(g.y<b){g.y=b+a}if(g.x+g.width>e+f.width){g.x=e+f.width-g.width-a}if(g.y+g.height>b+f.height){g.y=b+f.height-g.height-a}};Zapatec.Utils.isRelated=function(f,a){a||(a=window.event);var h=a.relatedTarget;if(!h){var b=a.type;if(b=="mouseover"){h=a.fromElement}else{if(b=="mouseout"){h=a.toElement}}}try{while(h){if(h==f){return true}h=h.parentNode}}catch(g){}return false};Zapatec.Utils.removeClass=function(g,f){if(!(g&&g.className)){return}var a=g.className.split(" ");var b=[];for(var e=a.length;e>0;){if(a[--e]!=f){b[b.length]=a[e]}}g.className=b.join(" ")};Zapatec.Utils.addClass=function(b,a){Zapatec.Utils.removeClass(b,a);b.className+=" "+a};Zapatec.Utils.replaceClass=function(e,b,a){if(!Zapatec.isHtmlElement(e)||!b){return false}e.className.replace(b,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.getMousePos=function(f){f||(f=window.event);var e={pageX:0,pageY:0,clientX:0,clientY:0};if(f){var b=(typeof f.pageX!="undefined");var a=(typeof f.clientX!="undefined");if(b||a){if(b){e.pageX=f.pageX;e.pageY=f.pageY}else{e.pageX=f.clientX+Zapatec.Utils.getPageScrollX();e.pageY=f.clientY+Zapatec.Utils.getPageScrollY()}if(a){e.clientX=f.clientX;e.clientY=f.clientY}else{e.clientX=f.pageX-Zapatec.Utils.getPageScrollX();e.clientY=f.pageY-Zapatec.Utils.getPageScrollY()}}}return e};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.removeOnUnload=[];Zapatec.Utils.addEvent=function(e,f,b,a){if(e.addEventListener){if(!a){a=false}e.addEventListener(f,b,a)}else{if(e.attachEvent){e.detachEvent("on"+f,b);e.attachEvent("on"+f,b);if(a){e.setCapture(false)}}}Zapatec.Utils.removeOnUnload.push({element:e,event:f,listener:b,capture:a})};Zapatec.Utils.removeEvent=function(g,h,f,e){if(g.removeEventListener){g.removeEventListener(h,f,e)}else{if(g.detachEvent){g.detachEvent("on"+h,f)}}for(var b=Zapatec.Utils.removeOnUnload.length-1;b>=0;b--){var a=Zapatec.Utils.removeOnUnload[b];if(!a){continue}if(g==a.element&&h==a.event&&f==a.listener&&e==a.capture){Zapatec.Utils.removeOnUnload[b]=null;Zapatec.Utils.removeEvent(a.element,a.event,a.listener,a.capture)}}};Zapatec.Utils.createElement=function(f,e,a){var b=null;if(document.createElementNS){b=document.createElementNS("http://www.w3.org/1999/xhtml",f)}else{b=document.createElement(f)}if(typeof e!="undefined"&&e!=null){e.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(e,g,f,h,b){g=escape(g);var a=e+"="+g,l;if(f){a+=";domain="+f}if(h){a+=";path="+h}if(b){l=new Date();l.setTime(b*86400000+l.getTime());a+=";expires="+l.toGMTString()}document.cookie=a};Zapatec.Utils.getCookie=function(b){var g=b+"=";var f=0;while(f<document.cookie.length){var a=f+g.length;if(document.cookie.substring(f,a)==g){var e=document.cookie.indexOf(";",a);if(e==-1){e=document.cookie.length}return unescape(document.cookie.substring(a,e))}f=document.cookie.indexOf(" ",f)+1;if(f==0){break}}return null};Zapatec.Utils.makePref=function(e){function f(g){if(typeof g=="object"&&!g){return"null"}else{if(typeof g=="number"||typeof g=="boolean"){return g}else{if(typeof g=="string"){return'"'+g.replace(/\x22/,"\\22")+'"'}else{return null}}}}var a="",b;for(b in e){a+=(a?",'":"'")+b+"':"+f(e[b])}return a};Zapatec.Utils.loadPref=function(txt){var obj=null;try{eval("obj={"+txt+"}")}catch(e){}return obj};Zapatec.Utils.mergeObjects=function(a,e){for(var b in e){a[b]=e[b]}};Zapatec.Utils.__wch_id=0;Zapatec.Utils.createWCH=function(b){if(!Zapatec.is_ie||Zapatec.is_ie5||Zapatec.is_ie7){return null}var a="WCH"+(++Zapatec.Utils.__wch_id);var e=['<iframe id="',a,'" scrolling="no" frameborder="0" style="z-index:0;position:absolute;visibility:hidden;filter:progid:DXImageTransform.Microsoft.alpha(style=0,opacity=0);border:0;top:0;left:0;width:0;height:0" src="javascript:false"></iframe>'].join("");if(!b){b=document.body}if(Zapatec.windowLoaded){b.insertAdjacentHTML("beforeEnd",e)}else{Zapatec.Utils.addEvent(window,"load",function(){b.insertAdjacentHTML("beforeEnd",e);b=null})}return document.getElementById(a)};Zapatec.Utils.setupWCH_el=function(o,a,g){if(o){var p=Zapatec.Utils.getAbsolutePos(a),l=p.x,s=p.y,e=l+a.offsetWidth,r=s+a.offsetHeight;if(g){var q=Zapatec.Utils.getAbsolutePos(g),n=q.x,h=q.y,m=n+g.offsetWidth,b=h+g.offsetHeight;if(l>n){l=n}if(s>h){s=h}if(e<m){e=m}if(r<b){r=b}}Zapatec.Utils.setupWCH(o,l,s,e-l,r-s)}};Zapatec.Utils.setupWCH=function(l,a,m,b,g){if(l){var e=l.style;(typeof a!="undefined")&&(e.left=a+"px");(typeof m!="undefined")&&(e.top=m+"px");(typeof b!="undefined")&&(e.width=b+"px");(typeof g!="undefined")&&(e.height=g+"px");e.visibility="inherit"}};Zapatec.Utils.hideWCH=function(a){if(a){a.style.visibility="hidden"}};Zapatec.Utils.getPageScrollY=function(){if(window.pageYOffset){return window.pageYOffset}else{if(document.body&&document.body.scrollTop){return document.body.scrollTop}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}}}return 0};Zapatec.Utils.getPageScrollX=function(){if(window.pageXOffset){return window.pageXOffset}else{if(document.body&&document.body.scrollLeft){return document.body.scrollLeft}else{if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft}}}return 0};Zapatec.ScrollWithWindow={};Zapatec.ScrollWithWindow.list=[];Zapatec.ScrollWithWindow.stickiness=0.25;Zapatec.ScrollWithWindow.register=function(a){var e=a.offsetTop||0;var b=a.offsetLeft||0;Zapatec.ScrollWithWindow.list.push({node:a,origTop:e,origLeft:b});if(!Zapatec.ScrollWithWindow.interval){Zapatec.ScrollWithWindow.on()}};Zapatec.ScrollWithWindow.unregister=function(a){for(var b=0;b<Zapatec.ScrollWithWindow.list.length;b++){var e=Zapatec.ScrollWithWindow.list[b];if(a==e.node){Zapatec.ScrollWithWindow.list.splice(b,1);if(!Zapatec.ScrollWithWindow.list.length){Zapatec.ScrollWithWindow.off()}return}}};Zapatec.ScrollWithWindow.moveTop=function(e){Zapatec.ScrollWithWindow.top+=(e-Zapatec.ScrollWithWindow.top)*Zapatec.ScrollWithWindow.stickiness;if(Math.abs(Zapatec.ScrollWithWindow.top-e)<=1){Zapatec.ScrollWithWindow.top=e}for(var b=0;b<Zapatec.ScrollWithWindow.list.length;b++){var f=Zapatec.ScrollWithWindow.list[b];var a=f.node;a.style.position="absolute";if(!f.origTop&&f.origTop!==0){f.origTop=parseInt(a.style.top)||0}a.style.top=f.origTop+parseInt(Zapatec.ScrollWithWindow.top)+"px"}};Zapatec.ScrollWithWindow.moveLeft=function(e){Zapatec.ScrollWithWindow.left+=(e-Zapatec.ScrollWithWindow.left)*Zapatec.ScrollWithWindow.stickiness;if(Math.abs(Zapatec.ScrollWithWindow.left-e)<=1){Zapatec.ScrollWithWindow.left=e}for(var b=0;b<Zapatec.ScrollWithWindow.list.length;b++){var f=Zapatec.ScrollWithWindow.list[b];var a=f.node;a.style.position="absolute";if(!f.origLeft&&f.origLeft!==0){f.origLeft=parseInt(a.style.left)||0}a.style.left=f.origLeft+parseInt(Zapatec.ScrollWithWindow.left)+"px"}};Zapatec.ScrollWithWindow.cycle=function(){var b=Zapatec.Utils.getPageScrollY();var a=Zapatec.Utils.getPageScrollX();if(b!=Zapatec.ScrollWithWindow.top){Zapatec.ScrollWithWindow.moveTop(b)}if(a!=Zapatec.ScrollWithWindow.left){Zapatec.ScrollWithWindow.moveLeft(a)}};Zapatec.ScrollWithWindow.on=function(){if(Zapatec.ScrollWithWindow.interval){return}Zapatec.ScrollWithWindow.top=Zapatec.Utils.getPageScrollY();Zapatec.ScrollWithWindow.left=Zapatec.Utils.getPageScrollX();Zapatec.ScrollWithWindow.interval=setInterval(Zapatec.ScrollWithWindow.cycle,50)};Zapatec.ScrollWithWindow.off=function(){if(!Zapatec.ScrollWithWindow.interval){return}clearInterval(Zapatec.ScrollWithWindow.interval);Zapatec.ScrollWithWindow.interval=null};Zapatec.FixateOnScreen={};Zapatec.FixateOnScreen.getExpression=function(b,a){return"Zapatec.Utils.getPageScroll"+a.toUpperCase()+"() + "+b};Zapatec.FixateOnScreen.parseCoordinates=function(b){if(!this.isRegistered(b)){return false}var a=0;var f=0;var e=b.style;if(Zapatec.is_ie&&!Zapatec.is_ie7){a=e.getExpression("left").split(" ");a=parseInt(a[a.length-1],10);f=e.getExpression("top").split(" ");f=parseInt(f[f.length-1],10)}else{a=parseInt(e.left,10);f=parseInt(e.top,10)}a+=Zapatec.Utils.getPageScrollX();f+=Zapatec.Utils.getPageScrollY();return{x:a,y:f}};Zapatec.FixateOnScreen.correctCoordinates=function(a,b){position={x:a,y:b};if(position.x||position.x===0){position.x-=Zapatec.Utils.getPageScrollX();if(Zapatec.is_ie&&!Zapatec.is_ie7){position.x=this.getExpression(position.x,"X")}else{position.x+="px"}}if(position.y||position.y===0){position.y-=Zapatec.Utils.getPageScrollY();if(Zapatec.is_ie&&!Zapatec.is_ie7){position.y=this.getExpression(position.y,"Y")}else{position.y+="px"}}return position};Zapatec.FixateOnScreen.register=function(b){if(!Zapatec.isHtmlElement(b)){return false}if(this.isRegistered(b)){return true}var e=Zapatec.Utils.getElementOffset(b);e={x:parseInt(b.style.left,10)||e.x,y:parseInt(b.style.top,10)||e.y};e=this.correctCoordinates(e.x,e.y);if(!Zapatec.is_ie||Zapatec.is_ie7){var a=b.restorer;if(!a||!a.getObject||a.getObject()!=b){a=b.restorer=new Zapatec.SRProp(b)}a.saveProp("style.position");b.style.position="fixed";b.style.left=e.x;b.style.top=e.y}else{b.style.setExpression("left",e.x);b.style.setExpression("top",e.y)}b.zpFixed=true;return true};Zapatec.FixateOnScreen.unregister=function(a){if(!Zapatec.isHtmlElement(a)){return false}var b=this.parseCoordinates(a);if(b===false){return true}if(Zapatec.is_ie&&!Zapatec.is_ie7){a.style.removeExpression("left");a.style.removeExpression("top")}a.style.left=b.x+"px";a.style.top=b.y+"px";if(!Zapatec.is_ie||Zapatec.is_ie7){a.restorer.restoreProp("style.position",true)}a.zpFixed=false;return true};Zapatec.FixateOnScreen.isRegistered=function(a){if(a.zpFixed){return true}return false};Zapatec.Utils.destroy=function(a){if(a&&a.parentNode){a.parentNode.removeChild(a)}};Zapatec.Utils.newCenteredWindow=function(a,m,b,n,h){var f=0;var l=0;if(screen.width){f=(screen.width-b)/2}if(screen.height){l=(screen.height-n)/2}var e="height="+n+",width="+b+",top="+l+",left="+f+",scrollbars="+h+",resizable";var g=window.open(a,m,e);return g};Zapatec.Utils.getWindowSize=function(){var a=0;var b=0;if(Zapatec.is_opera){a=document.body.clientWidth||0;b=document.body.clientHeight||0}else{if(Zapatec.is_khtml){a=window.innerWidth||0;b=window.innerHeight||0}else{if(document.compatMode&&document.compatMode=="CSS1Compat"){a=document.documentElement.clientWidth||0;b=document.documentElement.clientHeight||0}else{a=document.body.clientWidth||0;b=document.body.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.value==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(e,a,b){e=e.nextSibling;if(!a){return e}a=a.toLowerCase();if(b){b=b.toLowerCase()}while(e){if(e.nodeType==1&&(e.tagName.toLowerCase()==a||(b&&e.tagName.toLowerCase()==b))){return e}e=e.nextSibling}return e};Zapatec.Utils.getPreviousSibling=function(e,a,b){e=e.previousSibling;if(!a){return e}a=a.toLowerCase();if(b){b=b.toLowerCase()}while(e){if(e.nodeType==1&&(e.tagName.toLowerCase()==a||(b&&e.tagName.toLowerCase()==b))){return e}e=e.previousSibling}return e};Zapatec.Utils.getFirstChild=function(e,a,b){if(!e){return null}e=e.firstChild;if(!e){return null}if(!a){return e}a=a.toLowerCase();if(e.nodeType==1){if(e.tagName.toLowerCase()==a){return e}else{if(b){b=b.toLowerCase();if(e.tagName.toLowerCase()==b){return e}}}}return Zapatec.Utils.getNextSibling(e,a,b)};Zapatec.Utils.getLastChild=function(e,a,b){if(!e){return null}e=e.lastChild;if(!e){return null}if(!a){return e}a=a.toLowerCase();if(e.nodeType==1){if(e.tagName.toLowerCase()==a){return e}else{if(b){b=b.toLowerCase();if(e.tagName.toLowerCase()==b){return e}}}}return Zapatec.Utils.getPreviousSibling(e,a,b)};Zapatec.Utils.getChildText=function(e){if(e==null){return""}var b=[];var a=e.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({target:b,tooltip:a})};Zapatec.isLite=true;Zapatec.Utils.checkLinks=function(){var b=document.getElementsByTagName("A");for(var a=0;a<b.length;a++){if(Zapatec.Utils.checkLink(b[a])){return true}}return false};Zapatec.Utils.checkLink=function(g){if(!g){return false}if(!/^https?:\/\/((dev|www)\.)?zapatec\.com/i.test(g.href)){return false}var e="";for(var b=0;b<g.childNodes.length;b++){if(g.childNodes[b].nodeType==3){e+=g.childNodes[b].nodeValue}}if(e.length<4){return false}var a=g;while(a&&a.nodeName.toLowerCase()!="html"){if(Zapatec.Utils.getStyleProperty(a,"display")=="none"||Zapatec.Utils.getStyleProperty(a,"visibility")=="hidden"||Zapatec.Utils.getStyleProperty(a,"opacity")=="0"||Zapatec.Utils.getStyleProperty(a,"-moz-opacity")=="0"||/alpha\(opacity=0\)/i.test(Zapatec.Utils.getStyleProperty(a,"filter"))){return false}a=a.parentNode}var f=Zapatec.Utils.getElementOffset(g);if(f.left<0||f.top<0){return false}return true};Zapatec.Utils.checkActivation=function(){if(!Zapatec.isLite){return true}var h=[];add_product=function(n,m,o){h[n]={webdir:m,name:o,bActive:false}};add_product("calendar.js","prod1","Calendar");add_product("zpmenu.js","menu","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 - Slideshow");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 g,l,f;var b=false;var a=document.getElementsByTagName("script");for(f=0;f<a.length;f++){if(/wizard.js/i.test(a[f].src)){return true}l=a[f].src.split("/");if(l.length==0){g=a[f]}else{g=l[l.length-1]}g=g.toLowerCase();if(typeof h[g]!="undefined"){b=true;h[g].bActive=true}}if(!b||Zapatec.Utils.checkLinks()){return true}var e="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(f in h){if(h[f].bActive==true){e+="\nTo purchase the Zapatec "+h[f].name+" visit www.zapatec.com/website/main/products/"+h[f].webdir+"/"}}return false};Zapatec.Utils.clone=function(a){if(typeof a=="object"&&a){var f=new a.constructor();var e=Zapatec.Utils.clone;for(var b in a){f[b]=e(a[b])}return f}return a};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_ie7=(Zapatec.is_ie&&/msie 7\.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);Zapatec.is_webkit=/WebKit/i.test(navigator.userAgent);Zapatec.webkitVersion=Zapatec.is_webkit?parseInt(navigator.userAgent.replace(/.+WebKit\/([0-9]+)\..+/,"$1")):-1;if(!Object.prototype.hasOwnProperty){Object.prototype.hasOwnProperty=function(a){try{var b=this.constructor.prototype;while(b){if(b[a]==this[a]){return false}b=b.prototype}}catch(e){}return true}}if(!Function.prototype.call){Function.prototype.call=function(){var objThis=arguments[0];objThis._this_func=this;var arrArgs=[];for(var iArg=1;iArg<arguments.length;iArg++){arrArgs[arrArgs.length]="arguments["+iArg+"]"}var ret=eval("objThis._this_func("+arrArgs.join(",")+")");objThis._this_func=null;return ret}}if(!Function.prototype.apply){Function.prototype.apply=function(){var objThis=arguments[0];var objArgs=arguments[1];objThis._this_func=this;var arrArgs=[];if(objArgs){for(var iArg=0;iArg<objArgs.length;iArg++){arrArgs[arrArgs.length]="objArgs["+iArg+"]"}}var ret=eval("objThis._this_func("+arrArgs.join(",")+")");objThis._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,e){var f=[],g=[],b;for(b=2;b<arguments.length;b++){f.push(arguments[b])}for(b=a;(b<a+e)&&(b<this.length);b++){g.push(this[b])}for(b=a+e;b<this.length;b++){this[b-e]=this[b]}this.length-=g.length;for(b=this.length+f.length-1;b>=a+f.length;b--){this[b]=this[b-f.length]}for(b=0;b<f.length;b++){this[a+b]=f[b]}return g}}Zapatec.Utils.arrIndexOf=function(b,a,e){if(!(b instanceof Array)){return -1}if(Array.prototype.indexOf){return b.indexOf(a,e)}if(!e){e=0}var f=b.length;for(var g=e;g<f;g++){if(b[g]==a){return g}}return -1};Zapatec.Log=function(a){if(!a){return}var b=a.description;if(a.severity){b=a.severity+":\n"+b}if(a.type!="warning"){}};Zapatec.Utils.Array={};Zapatec.Utils.Array.insertBefore=function(b,h,g,a){var f=new Array();for(var e in b){if(e==a){if(g){f[g]=h}else{f.push(h)}}f[e]=b[e]}return f};Zapatec.inherit=function(f,b,a){var e=function(){};e.prototype=b.prototype;f.prototype=new e();f.prototype.constructor=f;f.SUPERconstructor=b;f.SUPERclass=b.prototype;if(typeof b.path!="undefined"){if(a&&a.keepPath){f.path=b.path}else{f.path=Zapatec.getPath(f.id)}}};Zapatec.getPath=function(e){var a;if(typeof e=="string"){var g=document.getElementById(e);if(g){a=g.getAttribute("src")}}if(!a){if(typeof Zapatec.lastLoadedModule=="string"){return Zapatec.lastLoadedModule}if(document.documentElement){var h=document.documentElement.innerHTML;var b=h.match(/<script[^>]+src=[^>]+>/gi);if(b&&b.length){h=b[b.length-1];b=h.match(/src="([^"]+)/i);if(b&&b.length==2){a=b[1]}}}if(!a){return""}}a=a.replace(/\\/g,"/");var f=a.split("?");f=f[0].split("/");f=f.slice(0,-1);if(!f.length){return""}return f.join("/")+"/"};Zapatec.Utils.setWindowEvent=function(a){if(a){window.event=a}};Zapatec.Utils.emulateWindowEvent=function(b){if(document.addEventListener){var a=b.length;var f=Zapatec.Utils;var e;for(e=0;e<a;e++){document.addEventListener(b[e],f.setWindowEvent,true)}}};Zapatec.windowLoaded=typeof(document.readyState)!="undefined"?(document.readyState=="loaded"||document.readyState=="complete"):document.getElementsByTagName!=null&&typeof(document.getElementsByTagName("body")[0])!="undefined";Zapatec.Utils.addEvent(window,"load",function(){Zapatec.windowLoaded=true});Zapatec.Utils.warnUnload=function(b,a){Zapatec.Utils.warnUnloadFlag=true;if(typeof(b)!="string"){b="All your changes will be lost."}if(typeof(a)=="undefined"){a=window}Zapatec.Utils.addEvent(a,"beforeunload",function(e){if(Zapatec.Utils.warnUnloadFlag!=true){return true}if(typeof(e)=="undefined"){e=window.event}e.returnValue=b;return false})};Zapatec.Utils.unwarnUnload=function(b,a){Zapatec.Utils.warnUnloadFlag=false};Zapatec.Utils.warnUnloadFlag=false;Zapatec.Utils.getMaxZindex=function(){if(window.opera||Zapatec.is_khtml){return 2147483583}else{if(Zapatec.is_ie){return 2147483647}else{return 10737418239}}};Zapatec.Utils.correctCssLength=function(a){if(typeof a=="undefined"||(typeof a=="object"&&!a)){return"auto"}a+="";if(!a.length){return"auto"}if(/\d$/.test(a)){a+="px"}return a};Zapatec.Utils.destroyOnUnload=[];Zapatec.Utils.addDestroyOnUnload=function(b,a){Zapatec.Utils.destroyOnUnload.push([b,a])};Zapatec.Utils.createProperty=function(b,a,e){b[a]=e;Zapatec.Utils.addDestroyOnUnload(b,a)};Zapatec.Utils.addEvent(window,"unload",function(){for(var f=Zapatec.Utils.destroyOnUnload.length-1;f>=0;f--){var e=Zapatec.Utils.destroyOnUnload[f];e[0][e[1]]=null;e[0]=null}for(var b=Zapatec.Utils.removeOnUnload.length-1;b>=0;b--){var a=Zapatec.Utils.removeOnUnload[b];if(!a){continue}Zapatec.Utils.removeOnUnload[b]=null;Zapatec.Utils.removeEvent(a.element,a.event,a.listener,a.capture)}});Zapatec.Utils.htmlEncode=function(a){a=a.replace(/&/ig,"&amp;");a=a.replace(/</ig,"&lt;");a=a.replace(/>/ig,"&gt;");a=a.replace(/\x22/ig,"&quot;");return a};Zapatec.Utils.applyStyle=function(f,a){if(typeof(f)=="string"){f=document.getElementById(f)}if(f==null||a==null||f.style==null){return null}if(Zapatec.is_opera){var b=a.split(";");for(var o=0;o<b.length;o++){var l=b[o].split(":");if(!l[1]){continue}var m=l[1].replace(/^\s*/,"").replace(/\s*$/,"");var n="";for(var g=0;g<l[0].length;g++){if(l[0].charAt(g)=="-"){g++;if(g<l[0].length){n+=l[0].charAt(g).toUpperCase()}continue}n+=l[0].charAt(g)}switch(n){case"float":n="cssFloat";break}try{f.style[n]=m}catch(h){}}}else{f.style.cssText=a}return true};Zapatec.Utils.getStyleProperty=function(f,e){var a=document.defaultView;if(a&&a.getComputedStyle){var b=a.getComputedStyle(f,"");if(b){e=e.replace(/([A-Z])/g,"-$1").toLowerCase();return b.getPropertyValue(e)}}else{if(f.currentStyle){return f.currentStyle[e]}}return f.style[e]};Zapatec.Utils.getPrecision=function(a){return(a+"").replace(/^-?\d*\.*/,"").length};Zapatec.Utils.setPrecision=function(a,e){a*=1;if(a.toFixed){return a.toFixed(e)*1}var b=Math.pow(10,e);return parseInt(a*b,10)/b};Zapatec.Utils.setPrecisionString=function(f,h){var b=Zapatec.Utils.setPrecision(f,h)+"";var a=Zapatec.Utils.getPrecision(b);var e=h-a;if(e){if(!a){b+="."}for(var g=0;g<e;g++){b+="0"}}return b};Zapatec.Utils.createNestedHash=function(e,f,g){if(e==null||f==null){return null}var a=e;for(var b=0;b<f.length;b++){if(typeof(a[f[b]])=="undefined"){a[f[b]]={}}if(b==f.length-1&&typeof(g)!="undefined"){a[f[b]]=g}a=a[f[b]]}};Zapatec.implement=function(f,g){if(typeof g!="string"){return false}if(typeof f=="function"){f=f.prototype}if(!f||typeof f!="object"){return false}var b=window;var l=g.split(".");try{for(var a=0;a<l.length;++a){b=b[l[a]]}}catch(h){return false}if(typeof f.interfaces!="object"){f.interfaces={};f.interfaces[g]=true}else{if(f.interfaces[g]!==true){f.interfaces=Zapatec.Utils.clone(f.interfaces);f.interfaces[g]=true}else{return true}}for(var m in b){f[m]=b[m]}f.hasInterface=function(e){if(this.interfaces[e]===true){return true}return false};f.requireInterface=function(e){if(!this.hasInterface(e)){Zapatec.Log({description:"The object with ID '"+this.id+"' has no "+e+" interface!"});return false}return true};b.setNamedProperty=f.setNamedProperty=function(e,n){this[e]=n};b.getNamedProperty=f.getNamedProperty=function(e){return this[e]};return true};Zapatec.Utils.getCharFromEvent=function(a){if(!a){a=window.event}var b={};if(Zapatec.is_gecko&&!Zapatec.is_khtml&&a.type!="keydown"&&a.type!="keyup"){if(a.charCode){b.chr=String.fromCharCode(a.charCode)}else{b.charCode=a.keyCode}}else{b.charCode=a.keyCode||a.which;b.chr=String.fromCharCode(b.charCode)}if(Zapatec.is_opera&&b.charCode==0){b.charCode=null;b.chr=null}if(Zapatec.is_khtml&&b.charCode==63272){b.charCode=46;b.chr=null}return b};Zapatec.Utils.convertHTML2DOM=function(a){var e=document.createElement("div");e.innerHTML=a;var b=e.firstChild;while(!b.nodeType||b.nodeType!=1){b=b.nextSibling}Zapatec.Utils.destroy(b);return b};Zapatec.Utils.escapeRegExp=function(a){return a.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")};if(typeof Zapatec=="undefined"){Zapatec=function(){}}Zapatec.EventDriven=function(){};Zapatec.EventDriven.prototype.init=function(){this.events={}};Zapatec.EventDriven.prototype.addEventListener=function(e,a){if(typeof a!="function"){return false}var b=this.events;if(!b[e]){b[e]={listeners:[]}}else{this.removeEventListener(e,a)}b[e].listeners.push(a)};Zapatec.EventDriven.prototype.unshiftEventListener=function(e,a){if(typeof a!="function"){return false}var b=this.events;if(!b[e]){b[e]={listeners:[]}}else{this.removeEventListener(e,a)}b[e].listeners.unshift(a)};Zapatec.EventDriven.prototype.removeEventListener=function(h,e){var f=this.events;if(!f[h]){return 0}var b=f[h].listeners;var g=0;for(var a=b.length-1;a>=0;a--){if(b[a]==e){b.splice(a,1);g++}}return g};Zapatec.EventDriven.prototype.getEventListeners=function(b){var a=this.events;if(!a[b]){return[]}return a[b].listeners};Zapatec.EventDriven.prototype.isEventListener=function(g,e){var f=this.events;if(!f[g]){return false}var b=f[g].listeners;for(var a=b.length-1;a>=0;a--){if(b[a]==e){return true}}return false};Zapatec.EventDriven.prototype.isEvent=function(a){if(this.events[a]){return true}return false};Zapatec.EventDriven.prototype.removeEvent=function(e){var b=this.events;if(b[e]){var a;b[e]=a}};Zapatec.EventDriven.prototype.fireEvent=function(h){var f=this.events;if(!f[h]){return}var e=f[h].listeners.slice();var b=e.length;var g;for(var a=0;b--;a++){g=[].slice.call(arguments,1);e[a].apply(this,g)}};Zapatec.EventDriven.events={};Zapatec.EventDriven.addEventListener=function(f,a){if(typeof a!="function"){return false}var e=Zapatec.EventDriven;var b=e.events;if(!b[f]){b[f]={listeners:[]}}else{e.removeEventListener(f,a)}b[f].listeners.push(a)};Zapatec.EventDriven.unshiftEventListener=function(f,a){if(typeof a!="function"){return false}var e=Zapatec.EventDriven;var b=e.events;if(!b[f]){b[f]={listeners:[]}}else{e.removeEventListener(f,a)}b[f].listeners.unshift(a)};Zapatec.EventDriven.removeEventListener=function(h,e){var f=Zapatec.EventDriven.events;if(!f[h]){return 0}var b=f[h].listeners;var g=0;for(var a=b.length-1;a>=0;a--){if(b[a]==e){b.splice(a,1);g++}}return g};Zapatec.EventDriven.getEventListeners=function(b){var a=Zapatec.EventDriven.events;if(!a[b]){return[]}return a[b].listeners};Zapatec.EventDriven.isEventListener=function(g,e){var f=Zapatec.EventDriven.events;if(!f[g]){return false}var b=f[g].listeners;for(var a=b.length-1;a>=0;a--){if(b[a]==e){return true}}return false};Zapatec.EventDriven.isEvent=function(a){if(Zapatec.EventDriven.events[a]){return true}return false};Zapatec.EventDriven.removeEvent=function(e){var b=Zapatec.EventDriven.events;if(b[e]){var a;b[e]=a}};Zapatec.EventDriven.fireEvent=function(h){var f=Zapatec.EventDriven.events;if(!f[h]){return}var e=f[h].listeners.slice();var b=e.length;var g;for(var a=0;b--;a++){g=[].slice.call(arguments,1);e[a].apply(e[a],g)}};Zapatec.ImagePreloader=function(a){this.job=null;this.image=null;if(arguments.length>0){this.init(a)}};Zapatec.ImagePreloader.prototype.init=function(b){if(!b||!b.job){return}this.job=b.job;this.image=new Image();this.job.images.push(this.image);var a=this;this.image.onload=function(){a.job.loadedUrls.push(b.url);setTimeout(function(){a.onLoad()},0)};this.image.onerror=function(){a.job.invalidUrls.push(b.url);a.onLoad()};this.image.onabort=function(){a.job.abortedUrls.push(b.url);a.onLoad()};this.image.src=b.url;if(typeof b.timeout=="number"){setTimeout(function(){if(a.job){if(a.image.complete){a.job.loadedUrls.push(b.url)}else{a.job.abortedUrls.push(b.url)}a.onLoad()}},b.timeout)}};Zapatec.ImagePreloader.prototype.onLoad=function(){if(!this.job){return}this.image.onload=null;this.image.onerror=null;this.image.onabort=null;var b=this.job;this.job=null;b.leftToLoad--;if(b.leftToLoad==0&&typeof b.onLoad=="function"){var a=b.onLoad;b.onLoad=null;a(b)}};Zapatec.PreloadImages=function(a){this.images=[];this.leftToLoad=0;this.loadedUrls=[];this.invalidUrls=[];this.abortedUrls=[];this.onLoad=null;if(arguments.length>0){this.init(a)}};Zapatec.PreloadImages.prototype.init=function(b){if(!b){return}if(!b.urls||!b.urls.length){if(typeof b.onLoad=="function"){b.onLoad(this)}return}this.images=[];this.leftToLoad=b.urls.length;this.loadedUrls=[];this.invalidUrls=[];this.abortedUrls=[];this.onLoad=b.onLoad;for(var a=0;a<b.urls.length;a++){new Zapatec.ImagePreloader({job:this,url:b.urls[a],timeout:b.timeout})}};if(typeof Zapatec=="undefined"){Zapatec=function(){}}Zapatec.StyleSheet=function(f){if(f){if(document.createStyleSheet){if(document.styleSheets.length){this.styleSheet=document.styleSheets[document.styleSheets.length-1]}}else{var a=document.getElementsByTagName("style");if(a.length){this.styleSheet=a[a.length-1]}}}if(!this.styleSheet){if(document.createStyleSheet){try{this.styleSheet=document.createStyleSheet()}catch(e){this.styleSheet=document.styleSheets[document.styleSheets.length-1]}}else{this.styleSheet=document.createElement("style");this.styleSheet.type="text/css";var b=document.getElementsByTagName("head")[0];if(!b){b=document.documentElement}if(b){b.appendChild(this.styleSheet)}}}};Zapatec.StyleSheet.prototype.addRule=function(a,b){if(!this.styleSheet){return}if(document.createStyleSheet){this.styleSheet.cssText+=a+" { "+b+" }"}else{this.styleSheet.appendChild(document.createTextNode(a+" { "+b+" }"))}};Zapatec.StyleSheet.prototype.removeRules=function(){if(!this.styleSheet){return}if(document.createStyleSheet){var a=this.styleSheet.rules.length;for(var b=0;b<a;b++){this.styleSheet.removeRule()}}else{while(this.styleSheet.firstChild){this.styleSheet.removeChild(this.styleSheet.firstChild)}}};Zapatec.StyleSheet.prototype.addParse=function(e){var n=[];var f=e.split("/*");for(var l=0;l<f.length;l++){var a=f[l].split("*/");n.push(a[a.length-1])}e=n.join("");e=e.replace(/@[^{]*;/g,"");var g=e.split("}");for(var h=0;h<g.length;h++){var b=g[h].split("{");if(b[0]&&b[1]){var o=b[0].split(",");for(var m=0;m<o.length;m++){this.addRule(o[m],b[1])}}}};if(typeof Zapatec=="undefined"){Zapatec=function(){}}Zapatec.Transport=function(){};if(typeof ActiveXObject!="undefined"){Zapatec.Transport.XMLDOM=null;Zapatec.Transport.XMLHTTP=null;Zapatec.Transport.pickActiveXVersion=function(a){for(var f=0;f<a.length;f++){try{var b=new ActiveXObject(a[f]);if(b){return a[f]}}catch(e){}}return null};Zapatec.Transport.XMLDOM=Zapatec.Transport.pickActiveXVersion(["Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"]);Zapatec.Transport.XMLHTTP=Zapatec.Transport.pickActiveXVersion(["Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]);Zapatec.Transport.pickActiveXVersion=null}Zapatec.Transport.createXmlHttpRequest=function(){if(typeof ActiveXObject!="undefined"){try{return new ActiveXObject(Zapatec.Transport.XMLHTTP)}catch(a){}}if(typeof XMLHttpRequest!="undefined"){return new XMLHttpRequest()}return null};Zapatec.Transport.isBusy=function(g){var b=g.busyContainer;if(typeof b=="string"){b=document.getElementById(b)}if(!b){return}var a=g.busyImage;if(typeof a!="string"){a=""}a=a.split("/").pop();if(!a.length){a="zpbusy.gif"}var f=b.firstChild;if(f){f=f.firstChild;if(f){f=f.firstChild;if(f&&f.tagName&&f.tagName.toLowerCase()=="img"){var e=f.getAttribute("src");if(typeof e=="string"&&e.length){e=e.split("/").pop();if(e==a){return true}}}}}return false};Zapatec.Transport.showBusy=function(a){if(Zapatec.Transport.isBusy(a)){return}var q=a.busyContainer;if(typeof q=="string"){q=document.getElementById(q)}if(!q){return}var l=a.busyImage;var n=a.busyImageWidth;var p=a.busyImageHeight;if(typeof l!="string"||!l.length){l="zpbusy.gif"}else{if(typeof n=="number"||(typeof n=="string"&&/\d$/.test(n))){n+="px"}if(typeof p=="number"||(typeof p=="string"&&/\d$/.test(p))){p+="px"}}if(!n){n="65px"}if(!p){p="35px"}var h="";if(l.indexOf("/")<0){if(Zapatec.zapatecPath){h=Zapatec.zapatecPath}else{h=Zapatec.Transport.getPath("transport.js")}}var f=[];f.push('<img src="');f.push(h);f.push(l);f.push('"');if(n||p){f.push(' style="');if(n){f.push("width:");f.push(n);f.push(";")}if(p){f.push("height:");f.push(p)}f.push('"')}f.push(" />");var b=q.offsetWidth;var o=q.offsetHeight;var m=Zapatec.Utils.createElement("div");m.style.position="relative";m.style.zIndex=2147483583;var g=Zapatec.Utils.createElement("div",m);g.style.position="absolute";g.innerHTML=f.join("");q.insertBefore(m,q.firstChild);var r=g.offsetWidth;var e=g.offsetHeight;if(b>r){g.style.left=q.scrollLeft+(b-r)/2+"px"}if(o>e){g.style.top=q.scrollTop+(o-e)/2+"px"}};Zapatec.Transport.removeBusy=function(b){var a=b.busyContainer;if(typeof a=="string"){a=document.getElementById(a)}if(!a){return}if(Zapatec.Transport.isBusy(b)){a.removeChild(a.firstChild)}};Zapatec.Transport.fetch=function(b){if(b==null||typeof b!="object"){return null}if(!b.url){return null}if(!b.method){b.method="GET"}if(typeof b.async=="undefined"){b.async=true}if(!b.contentType&&b.method.toUpperCase()=="POST"){b.contentType="application/x-www-form-urlencoded"}if(!b.content){b.content=null}if(!b.onLoad){b.onLoad=null}if(!b.onError){b.onError=null}var e=Zapatec.Transport.createXmlHttpRequest();if(e==null){return null}Zapatec.Transport.showBusy(b);var g=false;var f=function(){Zapatec.Transport.removeBusy(b);try{if(e.status==200||e.status==304||(location.protocol=="file:"&&!e.status)){if(typeof b.onLoad=="function"){b.onLoad(e)}}else{if(!g){g=true;Zapatec.Transport.displayError(e.status,"Error: Can't fetch "+b.url+".\n"+(e.statusText||""),b.onError)}}}catch(h){if(!g){g=true;if(h.name&&h.name=="NS_ERROR_NOT_AVAILABLE"){Zapatec.Transport.displayError(0,"Error: Can't fetch "+b.url+".\nFile not found.",b.onError)}else{Zapatec.Transport.displayError(0,"Error: Can't fetch "+b.url+".\n"+(h.message||""),b.onError)}}}};try{if(typeof b.username!="undefined"&&typeof b.password!="undefined"){e.open(b.method,b.url,b.async,b.username,b.password)}else{e.open(b.method,b.url,b.async)}if(b.async){e.onreadystatechange=function(){if(e.readyState==4){f();e.onreadystatechange={}}}}if(b.contentType){e.setRequestHeader("Content-Type",b.contentType)}e.send(b.content);if(!b.async){f();return e}}catch(a){Zapatec.Transport.removeBusy(b);if(!g){g=true;if(a.name&&a.name=="NS_ERROR_FILE_NOT_FOUND"){Zapatec.Transport.displayError(0,"Error: Can't fetch "+b.url+".\nFile not found.",b.onError)}else{Zapatec.Transport.displayError(0,"Error: Can't fetch "+b.url+".\n"+(a.message||""),b.onError)}}}return null};Zapatec.Transport.parseHtml=function(b){b+="";b=b.replace(/^\s+/g,"");var a;if(document.createElementNS){a=document.createElementNS("http://www.w3.org/1999/xhtml","div")}else{a=document.createElement("div")}a.innerHTML=b;return a};Zapatec.Transport.evalGlobalScope=function(sScript){if(typeof sScript!="string"||!sScript.match(/\S/)){return}if(window.execScript){window.execScript(sScript,"javascript")}else{if(window.eval){window.eval(sScript)}}};Zapatec.Transport.setInnerHtml=function(e){if(!e||typeof e.html!="string"){return}var s=e.html;var u=null;if(typeof e.container=="string"){u=document.getElementById(e.container)}else{if(typeof e.container=="object"){u=e.container}}var q=[];if(s.match(/<\s*\/\s*script\s*>/i)){var p=s.split(/<\s*\/\s*script\s*>/i);var l=[];for(var g=p.length-1;g>=0;g--){var h=p[g];if(h.match(/\S/)){var b=h.match(/<\s*script([^>]*)>/i);if(b){var n=h.split(/<\s*script[^>]*>/i);while(n.length<2){if(h.match(/^<\s*script[^>]*>/i)){n.unshift("")}else{n.push("")}}l.unshift(n[0]);var v=b[1];var a=n[1];if(v.match(/\s+src\s*=/i)){a=""}else{a=a.replace(/function\s+([^(]+)/g,"$1=function")}q.push([v,a])}else{if(g<p.length-1){p[g-1]+="<\/script>"+h}else{l.unshift(h)}}}else{l.unshift(h)}}s=l.join("")}if(u){if(window.opera){u.innerHTML="<form></form>"}u.innerHTML=s}for(var t=0;t<q.length;t++){if(q[t][1].length){Zapatec.Transport.evalGlobalScope(q[t][1])}var v=q[t][0];v=v.replace(/\s+/g," ").replace(/^\s/,"").replace(/\s$/,"").replace(/ = /g,"=");if(v.indexOf("src=")>=0){var u=document.body;if(!u){u=document.getElementsByTagName("head")[0];if(!u){u=document}}var m=v.split(" ");var f=Zapatec.Utils.createElement("script");for(var r=0;r<m.length;r++){var o=m[r].split("=");if(o.length>1){f.setAttribute(o[0],o[1].match(/^[\s|"|']*([\s|\S]*[^'|"])[\s|"|']*$/)[1])}else{f.setAttribute(o[0],o[0])}}u.appendChild(f)}}};Zapatec.Transport.fetchXmlDoc=function(e){if(e==null||typeof e!="object"){return null}if(!e.url){return null}if(typeof e.async=="undefined"){e.async=true}if(!e.onLoad){e.onLoad=null}if(!e.onError){e.onError=null}if(!e.method&&typeof e.username=="undefined"&&typeof e.password=="undefined"){if(document.implementation&&document.implementation.createDocument){var a=null;if(!e.reliable){e.reliable=false}var g={};for(var h in e){g[h]=e[h]}if(e.async){g.onLoad=function(m){g.onLoad=null;var n=new DOMParser();a=n.parseFromString(m.responseText,"text/xml");Zapatec.Transport.removeBusy(e);Zapatec.Transport.onXmlDocLoad(a,e.onLoad,e.onError)}}else{g.onLoad=null}var f=Zapatec.Transport.fetch(g);if(!e.async&&f){var l=new DOMParser();a=l.parseFromString(f.responseText,"text/xml");Zapatec.Transport.removeBusy(e);Zapatec.Transport.onXmlDocLoad(a,e.onLoad,e.onError);return a}return null}if(typeof ActiveXObject!="undefined"){Zapatec.Transport.showBusy(e);try{var a=new ActiveXObject(Zapatec.Transport.XMLDOM);a.async=e.async;if(e.async){a.onreadystatechange=function(){if(a.readyState==4){Zapatec.Transport.removeBusy(e);Zapatec.Transport.onXmlDocLoad(a,e.onLoad,e.onError);a.onreadystatechange={}}}}a.load(e.url);if(!e.async){Zapatec.Transport.removeBusy(e);Zapatec.Transport.onXmlDocLoad(a,e.onLoad,e.onError);return a}return null}catch(b){Zapatec.Transport.removeBusy(e)}}}var g={};for(var h in e){g[h]=e[h]}if(e.async){g.onLoad=function(m){Zapatec.Transport.parseXml({strXml:m.responseText,onLoad:e.onLoad,onError:e.onError})}}else{g.onLoad=null}var f=Zapatec.Transport.fetch(g);if(!e.async&&f){return Zapatec.Transport.parseXml({strXml:f.responseText,onLoad:e.onLoad,onError:e.onError})}return null};Zapatec.Transport.parseXml=function(e){if(e==null||typeof e!="object"){return null}if(!e.strXml){return null}if(!e.onLoad){e.onLoad=null}if(!e.onError){e.onError=null}if(window.DOMParser){try{var a=(new DOMParser()).parseFromString(e.strXml,"text/xml");Zapatec.Transport.onXmlDocLoad(a,e.onLoad,e.onError);return a}catch(b){Zapatec.Transport.displayError(0,"Error: Can't parse.\nString does not appear to be a valid XML fragment.",e.onError)}return null}if(typeof ActiveXObject!="undefined"){try{var a=new ActiveXObject(Zapatec.Transport.XMLDOM);a.loadXML(e.strXml);Zapatec.Transport.onXmlDocLoad(a,e.onLoad,e.onError);return a}catch(b){}}return null};Zapatec.Transport.onXmlDocLoad=function(a,b,f){var e=null;if(a.parseError){e=a.parseError.reason;if(a.parseError.srcText){e+="Location: "+a.parseError.url+"\nLine number "+a.parseError.line+", column "+a.parseError.linepos+":\n"+a.parseError.srcText+"\n"}}else{if(a.documentElement&&a.documentElement.tagName=="parsererror"){e=a.documentElement.firstChild.data+"\n"+a.documentElement.firstChild.nextSibling.firstChild.data}else{if(!a.documentElement){e="String does not appear to be a valid XML fragment."}}}if(e){Zapatec.Transport.displayError(0,"Error: Can't parse.\n"+e,f)}else{if(typeof b=="function"){b(a)}}};Zapatec.Transport.serializeXmlDoc=function(a){if(window.XMLSerializer){return(new XMLSerializer).serializeToString(a)}if(a.xml){return a.xml}};Zapatec.Transport.fetchJsonObj=function(a){if(a==null||typeof a!="object"){return null}if(!a.url){return null}if(typeof a.async=="undefined"){a.async=true}if(!a.reliable){a.reliable=false}var e={};for(var f in a){e[f]=a[f]}if(a.async){e.onLoad=function(g){Zapatec.Transport.parseJson({strJson:g.responseText,reliable:a.reliable,onLoad:a.onLoad,onError:a.onError})}}else{e.onLoad=null}var b=Zapatec.Transport.fetch(e);if(!a.async&&b){return Zapatec.Transport.parseJson({strJson:b.responseText,reliable:a.reliable,onLoad:a.onLoad,onError:a.onError})}return null};Zapatec.Transport.parseJson=function(oArg){if(oArg==null||typeof oArg!="object"){return null}if(!oArg.reliable){oArg.reliable=false}if(!oArg.onLoad){oArg.onLoad=null}if(!oArg.onError){oArg.onError=null}var oJson=null;try{if(oArg.reliable){if(oArg.strJson){oJson=eval("("+oArg.strJson+")")}}else{oJson=Zapatec.Transport.parseJsonStr(oArg.strJson)}}catch(oExpn){var sError="Error: Can't parse.\nString doesn't appear to be a valid JSON fragment: ";sError+=oExpn.message;if(typeof oExpn.text!="undefined"&&oExpn.text.length){sError+="\n"+oExpn.text}sError+="\n"+oArg.strJson;Zapatec.Transport.displayError(0,sError,oArg.onError);return null}if(typeof oArg.onLoad=="function"){oArg.onLoad(oJson)}return oJson};Zapatec.Transport.parseJsonStr=function(text){var p=/^\s*(([,:{}\[\]])|"(\\.|[^\x00-\x1f"\\])*"|-?\d+(\.\d*)?([eE][+-]?\d+)?|true|false|null)\s*/,token,operator;function error(m,t){throw {name:"JSONError",message:m,text:t||operator||token}}function next(b){if(b&&b!=operator){error("Expected '"+b+"'")}if(text){var t=p.exec(text);if(t){if(t[2]){token=null;operator=t[2]}else{operator=null;try{token=eval(t[1])}catch(e){error("Bad token",t[1])}}text=text.substring(t[0].length)}else{error("Unrecognized token",text)}}else{token=operator=null}}function val(){var k,o;switch(operator){case"{":next("{");o={};if(operator!="}"){for(;;){if(operator||typeof token!="string"){error("Missing key")}k=token;next();next(":");o[k]=val();if(operator!=","){break}next(",")}}next("}");return o;case"[":next("[");o=[];if(operator!="]"){for(;;){o.push(val());if(operator!=","){break}next(",")}}next("]");return o;default:if(operator!==null){error("Missing value")}k=token;next();return k}}next();return val()};Zapatec.Transport.serializeJsonObj=function(f){var b=[];function l(a){b[b.length]=a}function h(a){var n,m,e,g;switch(typeof a){case"object":if(a){if(a instanceof Array){l("[");e=b.length;for(m=0;m<a.length;m+=1){g=a[m];if(typeof g!="undefined"&&typeof g!="function"){if(e<b.length){l(",")}h(g)}}l("]");return}else{if(typeof a.toString!="undefined"){l("{");e=b.length;for(m in a){g=a[m];if(a.hasOwnProperty(m)&&typeof g!="undefined"&&typeof g!="function"){if(e<b.length){l(",")}h(m);l(":");h(g)}}return l("}")}}}l("null");return;case"number":l(isFinite(a)?+a:"null");return;case"string":e=a.length;l('"');for(m=0;m<e;m+=1){n=a.charAt(m);if(n>=" "){if(n=="\\"||n=='"'){l("\\")}l(n)}else{switch(n){case"\b":l("\\b");break;case"\f":l("\\f");break;case"\n":l("\\n");break;case"\r":l("\\r");break;case"\t":l("\\t");break;default:n=n.charCodeAt();l("\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))}}}l('"');return;case"boolean":l(String(a));return;default:l("null");return}}h(f);return b.join("")};Zapatec.Transport.displayError=function(a,e,b){if(typeof b=="function"){b({errorCode:a,errorDescription:e})}else{}};Zapatec.Transport.translateUrl=function(a){if(!a||!a.url){return null}var e=a.url.split("?",2);var f=e[0];if(f.indexOf(":")>=0){return a.url}var n=document.location;var m=n.port;if(m){m=":"+m}if(f[0]=="/"){return[n.protocol,"//",n.hostname,m,f].join("")}var l;if(m){l=[n.protocol,"//",n.hostname,m,n.pathname].join("")}else{l=n.toString()}var b;if(typeof a.relativeTo!="string"){b=l.split("?",2)[0]}else{b=a.relativeTo.split("?",2)[0];if(b.indexOf("/")<0){b=l.split("?",2)[0]}else{if(b.charAt(0)!="/"&&b.indexOf(":")<0){b=Zapatec.Transport.translateUrl({url:b})}}}b=b.split("#")[0];var p=f.split("/");var o=b.split("/");o.pop();for(var g=0;g<p.length;g++){var h=p[g];if(h==".."){o.pop()}else{if(h!="."){o.push(h)}}}e[0]=o.join("/");return e.join("?")};Zapatec.Transport.loading={};Zapatec.Transport.setupEvents=function(a){if(!a){return{}}if(a.force||!Zapatec.EventDriven||!a.url){return{onLoad:a.onLoad,onError:a.onError}}var b=a.url;if(typeof a.onLoad=="function"){Zapatec.EventDriven.addEventListener("zpTransportOnLoad"+b,a.onLoad)}if(typeof a.onError=="function"){Zapatec.EventDriven.addEventListener("zpTransportOnError"+b,a.onError)}if(Zapatec.Transport.loading[b]){return{loading:true}}else{Zapatec.Transport.loading[b]=true;return{onLoad:new Function("Zapatec.EventDriven.fireEvent('zpTransportOnLoad"+b+"');Zapatec.EventDriven.removeEvent('zpTransportOnLoad"+b+"');Zapatec.EventDriven.removeEvent('zpTransportOnError"+b+"');Zapatec.Transport.loading['"+b+"'] = false;"),onError:new Function("oError","Zapatec.EventDriven.fireEvent('zpTransportOnError"+b+"',oError);Zapatec.EventDriven.removeEvent('zpTransportOnLoad"+b+"');Zapatec.EventDriven.removeEvent('zpTransportOnError"+b+"');Zapatec.Transport.loading['"+b+"'] = false;")}}};Zapatec.Transport.loadedJS={};Zapatec.Transport.isLoadedJS=function(f,g){if(typeof g=="undefined"){g=Zapatec.Transport.translateUrl({url:f})}if(Zapatec.Transport.loadedJS[g]){return true}var e=document.getElementsByTagName("script");for(var a=0;a<e.length;a++){var b=e[a].getAttribute("src")||"";if(b==f){Zapatec.Transport.loadedJS[g]=true;return true}}return false};Zapatec.Transport.getPath=function(b){var g=document.getElementsByTagName("script");for(var a=g.length-1;a>=0;a--){var e=g[a].getAttribute("src")||"";var f=e.split("/");var h=f.pop();if(h==b){return f.length?f.join("/")+"/":""}}for(var e in Zapatec.Transport.loadedJS){var f=e.split("/");var h=f.pop();if(h==b){return f.length?f.join("/")+"/":""}}return""};Zapatec.Transport.include=function(a,b,e){if(Zapatec.doNotInclude){return}var f=Zapatec.Transport.translateUrl({url:a});if(!e&&Zapatec.Transport.isLoadedJS(a,f)){return}document.write('<script type="text/javascript" src="'+a+(typeof b=="string"?'" id="'+b:"")+'"><\/script>');Zapatec.Transport.loadedJS[f]=true};Zapatec.include=Zapatec.Transport.include;Zapatec.Transport.includeJS=function(a,b){setTimeout(function(){var e=document.body;if(!e){e=document.getElementsByTagName("head")[0];if(!e){e=document}}var f=document.createElement("script");f.type="text/javascript";f.src=a;if(typeof b=="string"){f.id=b}e.appendChild(f)},0)};Zapatec.Transport.loadJS=function(e){if(!(e instanceof Object)){return}if(typeof e.async=="undefined"){e.async=true}var f=null;if(e.url){f=e.url}else{if(e.module){var a="";if(typeof e.path!="undefined"){a=e.path}else{if(typeof Zapatec.zapatecPath!="undefined"){a=Zapatec.zapatecPath}}f=a+e.module+".js"}else{return}}var g=Zapatec.Transport.translateUrl({url:f});if(!e.onLoad){e.onLoad=null}if(!e.onError){e.onError=null}if(Zapatec.doNotInclude||(!e.force&&Zapatec.Transport.isLoadedJS(f,g))){if(typeof e.onLoad=="function"){e.onLoad()}return}var b=Zapatec.Transport.setupEvents({url:g,force:e.force,onLoad:e.onLoad,onError:e.onError});if(b.loading){return}Zapatec.Transport.fetch({url:f,async:e.async,onLoad:function(l){if(e.force||!Zapatec.Transport.loadedJS[g]){var h=f.split("/");var m=h.pop();Zapatec.lastLoadedModule=h.join("/")+"/";Zapatec.Transport.evalGlobalScope(l.responseText);Zapatec.lastLoadedModule=null;Zapatec.Transport.loadedJS[g]=true}if(typeof b.onLoad=="function"){b.onLoad()}},onError:b.onError})};Zapatec.Transport.includeCSS=function(b){var a=document.getElementsByTagName("head")[0];if(!a){return}var e=document.createElement("link");e.setAttribute("rel","stylesheet");e.setAttribute("type","text/css");e.setAttribute("href",b);a.appendChild(e)};Zapatec.Transport.loadedCss={};Zapatec.Transport.loadCss=function(e){if(!(e instanceof Object)){return}if(!e.url){return}if(typeof e.async=="undefined"){e.async=true}var g=Zapatec.Transport.translateUrl({url:e.url});if(!e.force){if(Zapatec.Transport.loadedCss[g]){if(typeof e.onLoad=="function"){e.onLoad()}return}var a=document.getElementsByTagName("link");for(var h=0;h<a.length;h++){var f=a[h].getAttribute("href")||"";f=Zapatec.Transport.translateUrl({url:f});if(f==g){Zapatec.Transport.loadedCss[g]=true;if(typeof e.onLoad=="function"){e.onLoad()}return}}}var b=Zapatec.Transport.setupEvents({url:g,force:e.force,onLoad:e.onLoad,onError:e.onError});if(b.loading){return}Zapatec.Transport.fetch({url:e.url,async:e.async,onLoad:function(m){var s=m.responseText;var q=[];var t=[];var l=[];var o=0;var p=s.indexOf("url(",o);while(p>=0){p+=4;var n=s.substring(o,p);var u=/@import\s+url\($/.test(n);q.push(n);o=p;p=s.indexOf(")",o);if(p>=0){var r=s.substring(o,p);r=r.replace(/['"]/g,"");r=Zapatec.Transport.translateUrl({url:r,relativeTo:e.url});r=Zapatec.Transport.translateUrl({url:r});q.push(r);if(u){l.push(r)}else{t.push(r)}o=p;p=s.indexOf("url(",o)}}q.push(s.substr(o));s=q.join("");Zapatec.Transport.loadCssList({urls:l,async:e.async,onLoad:function(){(new Zapatec.StyleSheet()).addParse(s);if(typeof b.onLoad=="function"){b.onLoad()}}});Zapatec.Transport.loadedCss[g]=true;Zapatec.Transport.preloadImages({urls:t,timeout:60000})},onError:b.onError})};Zapatec.Transport.loadCssList=function(b){if(!(b instanceof Object)){return}if(typeof b.async=="undefined"){b.async=true}if(!b.onLoad){b.onLoad=null}if(!b.onError){b.onError=null}if(!b.urls||!b.urls.length){if(typeof b.onLoad=="function"){b.onLoad()}return}var e=b.urls.shift();var a=function(){Zapatec.Transport.loadCssList({urls:b.urls,async:b.async,force:b.force,onLoad:b.onLoad,onError:b.onError})};Zapatec.Transport.loadCss({url:e,async:b.async,force:b.force,onLoad:a,onError:function(f){Zapatec.Transport.displayError(f.errorCode,f.errorDescription,b.onError);a()}})};Zapatec.Transport.imagePreloads=[];Zapatec.Transport.preloadImages=function(a){Zapatec.Transport.imagePreloads.push(new Zapatec.PreloadImages(a))};Zapatec.Drag={};Zapatec.Utils.emulateWindowEvent(["mousedown","mousemove","mouseup"]);Zapatec.Drag.currentId=null;Zapatec.Drag.start=function(o,f,a){var e=Zapatec.Drag;var h=Zapatec.Utils;if(e.currentId){return true}var g=Zapatec.Widget.getElementById(f);if(!g||g.zpDrag){return true}if(!a){a={}}var m=h.getMousePos(o||window.event);Zapatec.EventDriven.fireEvent("dragStart",{el:g,event:o});g.zpDrag=true;if(a.resize){g.zpDragResize=true}g.zpDragPageX=m.pageX;g.zpDragPageY=m.pageY;g.zpDragWidth=g.clientWidth;g.zpDragHeight=g.clientHeight;var b;var n=g.offsetParent;if(n){b=n.tagName.toLowerCase()}if(b&&b!="body"&&b!="html"){m=h.getElementOffset(g);var l=h.getElementOffset(n);g.zpDragLeft=m.left-l.left;g.zpDragTop=m.top-l.top}else{g.zpDragLeft=g.offsetLeft;g.zpDragTop=g.offsetTop}g.zpDragRight=g.zpDragLeft+g.zpDragWidth;g.zpDragBottom=g.zpDragTop+g.zpDragHeight;g.zpDragPrevLeft=g.zpDragPrevRealLeft=g.zpDragLeft;g.zpDragPrevTop=g.zpDragPrevRealTop=g.zpDragTop;g.zpDragV=a.vertical;g.zpDragH=a.horizontal;g.zpDragLimTop=typeof a.limitTop=="number"?a.limitTop:-Infinity;g.zpDragLimBot=typeof a.limitBottom=="number"?a.limitBottom:Infinity;g.zpDragLimLft=typeof a.limitLeft=="number"?a.limitLeft:-Infinity;g.zpDragLimRgh=typeof a.limitRight=="number"?a.limitRight:Infinity;if(typeof a.step=="number"){g.zpDragStepV=g.zpDragStepH=a.step}if(typeof a.stepVertical=="number"){g.zpDragStepV=a.stepVertical}if(typeof a.stepHorizontal=="number"){g.zpDragStepH=a.stepHorizontal}e.currentId=f;h.addEvent(document,"mousemove",e.move);h.addEvent(document,"mouseup",e.end);return true};Zapatec.Drag.move=function(p){var b=Zapatec.Drag;var n=Zapatec.Utils;p||(p=window.event);if(!b.currentId){return n.stopEvent(p)}var l=document.getElementById(b.currentId);if(!(l&&l.zpDrag)){return n.stopEvent(p)}var f=l.style;var o=n.getMousePos(p);var a={el:l,startLeft:l.zpDragLeft,startTop:l.zpDragTop,prevLeft:l.zpDragPrevLeft,prevTop:l.zpDragPrevTop,left:l.zpDragLeft,top:l.zpDragTop,realLeft:l.zpDragLeft,realTop:l.zpDragTop,event:p};var m,g,h,e;m=o.pageX-l.zpDragPageX;h=l.zpDragStepH;if(h){g=l.zpDragLeft+Math.floor(m/h)*h;a.realLeft=l.zpDragPrevRealLeft=l.zpDragLeft+m}else{a.realLeft=l.zpDragPrevRealLeft=g=l.zpDragLeft+m}if(!l.zpDragV){if(l.zpDragLimLft<=g&&l.zpDragLimRgh>=g){if(f.right){f.right=""}if(l.zpDragResize){if(m>0){e=l.zpDragWidth+m;if(h){e=Math.floor(e/h)*h}f.left=l.zpDragLeft+"px"}else{e=l.zpDragWidth-m;if(h){e=Math.ceil(e/h)*h}f.left=l.zpDragLeft-e+"px"}f.width=e+"px"}else{f.left=g+"px"}a.left=g;l.zpDragPrevLeft=g}else{a.left=a.prevLeft}}m=o.pageY-l.zpDragPageY;h=l.zpDragStepV;if(h){g=l.zpDragTop+Math.floor(m/h)*h;a.realTop=l.zpDragPrevRealTop=l.zpDragTop+m}else{g=a.realTop=l.zpDragPrevRealTop=l.zpDragTop+m}if(!l.zpDragH){if(l.zpDragLimTop<=g&&l.zpDragLimBot>=g){if(f.bottom){f.bottom=""}if(l.zpDragResize){if(m>0){e=l.zpDragHeight+m;if(h){e=Math.floor(e/h)*h}f.top=l.zpDragTop+"px"}else{e=l.zpDragHeight-m;if(h){e=Math.ceil(e/h)*h}f.top=l.zpDragBottom-e+"px"}f.height=e+"px"}else{f.top=g+"px"}a.top=g;l.zpDragPrevTop=g}else{a.top=a.prevTop}}Zapatec.EventDriven.fireEvent("dragMove",a);return n.stopEvent(p)};Zapatec.Drag.end=function(b){var g=Zapatec.Drag;var f=Zapatec.Utils;b||(b=window.event);if(!g.currentId){return f.stopEvent(b)}var a=document.getElementById(g.currentId);if(!(a&&a.zpDrag)){return f.stopEvent(b)}f.removeEvent(document,"mousemove",g.move);f.removeEvent(document,"mouseup",g.end);var e={el:a,startLeft:a.zpDragLeft,startTop:a.zpDragTop,left:a.zpDragPrevLeft,top:a.zpDragPrevTop,realLeft:a.zpDragPrevRealLeft,realTop:a.zpDragPrevRealTop,event:b};g.currentId=null;a.zpDrag=null;a.zpDragPageY=null;a.zpDragPageX=null;a.zpDragTop=null;a.zpDragLeft=null;a.zpDragPrevTop=null;a.zpDragPrevLeft=null;a.zpDragPrevRealTop=null;a.zpDragPrevRealLeft=null;a.zpDragV=null;a.zpDragH=null;a.zpDragLimTop=null;a.zpDragLimBot=null;a.zpDragLimLft=null;a.zpDragLimRgh=null;a.zpDragStepV=null;a.zpDragStepH=null;Zapatec.EventDriven.fireEvent("dragEnd",e);return f.stopEvent(b)};if(typeof Zapatec=="undefined"){Zapatec=function(){}}Zapatec.Widget=function(a){this.config={};Zapatec.Widget.SUPERconstructor.call(this);this.init(a)};Zapatec.inherit(Zapatec.Widget,Zapatec.EventDriven);Zapatec.Widget.path=Zapatec.getPath("Zapatec.Widget");Zapatec.Widget.prototype.init=function(a){Zapatec.Widget.SUPERclass.init.call(this);if(typeof this.id=="undefined"){var b=0;while(Zapatec.Widget.all[b]){b++}this.id=b;Zapatec.Widget.all[b]=this}this.configure(a);this.addUserEventListeners();this.addStandardEventListeners();this.initLang();this.loadTheme()};Zapatec.Widget.prototype.reconfigure=function(a){this.configure(a);this.loadTheme();if(a.lang||a.langCountryCode||a.langEncoding){this.langStr=this.config.lang;if(this.config.langCountryCode&&this.config.langCountryCode.length>0){this.langStr+="_"+this.config.langCountryCode}if(this.config.langEncoding&&this.config.langEncoding.length>0){this.langStr+="-"+this.config.langEncoding}}if(this.config.lang&&this.config.lang.length>0&&!(Zapatec.Langs[this.config.langId]&&Zapatec.Langs[this.config.langId][this.langStr])){Zapatec.Log({description:this.config.lang+(this.config.langCountryCode?" and country code "+this.config.langCountryCode:"")+(this.config.langEncoding?" and encoding "+this.config.langEncoding:"")});this.config.lang=null;this.config.langEncoding=null;this.langStr=null}};Zapatec.Widget.prototype.configure=function(b){this.defineConfigOption("theme","default");var a=this.constructor.path;if(typeof a!="undefined"){this.defineConfigOption("themePath",a+"../themes/")}else{this.defineConfigOption("themePath","../themes/")}this.defineConfigOption("asyncTheme",false);this.defineConfigOption("source");this.defineConfigOption("sourceType");this.defineConfigOption("callbackSource");this.defineConfigOption("asyncSource",true);this.defineConfigOption("reliableSource",true);this.defineConfigOption("callbackConvertSource");this.defineConfigOption("eventListeners",{});this.defineConfigOption("langId");this.defineConfigOption("lang");this.defineConfigOption("langCountryCode");this.defineConfigOption("langEncoding");if(b){var e=this.config;for(var f in b){if(typeof e[f]!="undefined"){e[f]=b[f]}else{Zapatec.Log({description:"Unknown config option: "+f})}}}};Zapatec.Widget.prototype.getConfiguration=function(){return this.config};Zapatec.Widget.all=[];Zapatec.Widget.getWidgetById=function(a){return Zapatec.Widget.all[a]};Zapatec.Widget.prototype.addCircularRef=function(a,b){if(!this.widgetCircularRefs){this.widgetCircularRefs=[]}this.widgetCircularRefs.push([a,b])};Zapatec.Widget.prototype.createProperty=function(a,b,e){a[b]=e;this.addCircularRef(a,b)};Zapatec.Widget.prototype.removeCircularRefs=function(){if(!this.widgetCircularRefs){return}for(var a=this.widgetCircularRefs.length-1;a>=0;a--){var b=this.widgetCircularRefs[a];b[0][b[1]]=null;b[0]=null}};Zapatec.Widget.prototype.discard=function(){Zapatec.Widget.all[this.id]=null;this.removeCircularRefs()};Zapatec.Widget.removeCircularRefs=function(){for(var b=Zapatec.Widget.all.length-1;b>=0;b--){var a=Zapatec.Widget.all[b];if(a&&a.removeCircularRefs){a.removeCircularRefs()}}};Zapatec.Utils.addEvent(window,"unload",Zapatec.Widget.removeCircularRefs);Zapatec.Widget.prototype.defineConfigOption=function(b,a){if(typeof this.config[b]=="undefined"){if(typeof a=="undefined"){this.config[b]=null}else{this.config[b]=a}}};Zapatec.Widget.prototype.addUserEventListeners=function(){var f=this.config.eventListeners;var e,a,b;for(var g in f){if(f.hasOwnProperty(g)){vListener=f[g];if(vListener instanceof Array){a=vListener.length;for(b=0;b<a;b++){this.addEventListener(g,vListener[b])}}else{this.addEventListener(g,vListener)}}}};Zapatec.Widget.prototype.addStandardEventListeners=function(){this.addEventListener("loadThemeError",Zapatec.Widget.loadThemeError)};Zapatec.Widget.loadThemeError=function(b){var a="Can't load theme.";if(b&&b.errorDescription){a+=" "+b.errorDescription}Zapatec.Log({description:a})};Zapatec.Widget.prototype.loadTheme=function(){var f=this.config;if(typeof f.theme=="string"&&f.theme.length){var g=f.theme.lastIndexOf("/");if(g>=0){g++;f.themePath=f.theme.substring(0,g);f.theme=f.theme.substring(g)}g=f.theme.lastIndexOf(".");if(g>=0){f.theme=f.theme.substring(0,g)}f.theme=f.theme.toLowerCase();if(f.theme=="auto"){var b=navigator.userAgent;if(b.indexOf("Windows NT 6")!=-1){f.theme="winvista"}else{if(b.indexOf("Windows NT 5")!=-1){f.theme="winxp"}else{if(b.indexOf("Win")!=-1){f.theme="win2k"}else{if(b.indexOf("Mac")!=-1){f.theme="macosx"}else{f.theme="default"}}}}}}else{f.theme=""}if(f.theme){this.fireEvent("loadThemeStart");this.themeLoaded=false;var a=this;var e=f.themePath+f.theme+".css";Zapatec.Transport.loadCss({url:e,async:f.asyncTheme,onLoad:function(){a.fireEvent("loadThemeEnd");a.themeLoaded=true},onError:function(h){a.fireEvent("loadThemeEnd");a.fireEvent("loadThemeError",h);a.themeLoaded=true}})}};Zapatec.Widget.prototype.getClassName=function(b){var e=[];if(b&&b.prefix){e.push(b.prefix)}var a=this.config.theme;if(a!=""){e.push(a.charAt(0).toUpperCase());e.push(a.substr(1))}if(b&&b.suffix){e.push(b.suffix)}return e.join("")};Zapatec.Widget.prototype.formElementId=function(a){var b=[];if(a&&a.prefix){b.push(a.prefix)}else{b.push("zpWidget")}b.push(this.id);if(a&&a.suffix){b.push(a.suffix)}else{b.push("-")}if(typeof this.widgetUniqueIdCounter=="undefined"){this.widgetUniqueIdCounter=0}else{this.widgetUniqueIdCounter++}b.push(this.widgetUniqueIdCounter);return b.join("")};Zapatec.Widget.prototype.showContainer=function(a,e,b){return this.showHideContainer(a,e,b,true)};Zapatec.Widget.prototype.hideContainer=function(a,e,b){return this.showHideContainer(a,e,b,false)};Zapatec.Widget.prototype.showHideContainer=function(e,g,f,a){if(this.container==null){return null}if(e&&e.length>0&&typeof(Zapatec.Effects)=="undefined"){var b=this;Zapatec.Transport.loadJS({url:Zapatec.zapatecPath+"../zpeffects/src/effects.js",onLoad:function(){b.showHideContainer(e,g,f,a)}});return false}if(g==null&&isNaN(parseInt(g))){g=5}if(!e||e.length==0){if(a){this.container.style.display=this.originalContainerDisplay;this.originalContainerDisplay=null}else{this.originalContainerDisplay=this.container.style.display;this.container.style.display="none"}if(f){f()}}else{if(a){Zapatec.Effects.show(this.container,g,e,f)}else{Zapatec.Effects.hide(this.container,g,e,f)}}return true};Zapatec.Widget.prototype.loadData=function(oArg){var oConfig=this.config;if(typeof oConfig.callbackSource=="function"){var oSource=oConfig.callbackSource(oArg);if(oSource){if(typeof oSource.source!="undefined"){oConfig.source=oSource.source}if(typeof oSource.sourceType!="undefined"){oConfig.sourceType=oSource.sourceType}}}var vSource=oConfig.source;if(typeof oConfig.callbackConvertSource=="function"){vSource=oConfig.callbackConvertSource(vSource)}var sSourceType=oConfig.sourceType;if(vSource!=null&&sSourceType!=null){sSourceType=sSourceType.toLowerCase();if(sSourceType=="html"){this.fireEvent("loadDataStart");this.loadDataHtml(Zapatec.Widget.getElementById(vSource));this.fireEvent("loadDataEnd")}else{if(sSourceType=="html/text"){this.fireEvent("loadDataStart");this.loadDataHtmlText(vSource);this.fireEvent("loadDataEnd")}else{if(sSourceType=="html/url"){this.fireEvent("fetchSourceStart");var oWidget=this;Zapatec.Transport.fetch({url:vSource,async:oConfig.asyncSource,onLoad:function(oRequest){oWidget.fireEvent("fetchSourceEnd");oWidget.fireEvent("loadDataStart");oWidget.loadDataHtmlText(oRequest.responseText);oWidget.fireEvent("loadDataEnd")},onError:function(oError){oWidget.fireEvent("fetchSourceError",oError);oWidget.fireEvent("fetchSourceEnd");oWidget.fireEvent("loadDataEnd")}})}else{if(sSourceType=="json"){this.fireEvent("loadDataStart");if(typeof vSource=="object"){this.loadDataJson(vSource)}else{if(oConfig.reliableSource){this.loadDataJson(eval(["(",vSource,")"].join("")))}else{this.loadDataJson(Zapatec.Transport.parseJson({strJson:vSource}))}}this.fireEvent("loadDataEnd")}else{if(sSourceType=="json/url"){this.fireEvent("fetchSourceStart");var oWidget=this;Zapatec.Transport.fetchJsonObj({url:vSource,async:oConfig.asyncSource,reliable:oConfig.reliableSource,onLoad:function(oResult){oWidget.fireEvent("fetchSourceEnd");oWidget.fireEvent("loadDataStart");oWidget.loadDataJson(oResult);oWidget.fireEvent("loadDataEnd")},onError:function(oError){oWidget.fireEvent("fetchSourceError",oError);oWidget.fireEvent("fetchSourceEnd");oWidget.fireEvent("loadDataEnd")}})}else{if(sSourceType=="xml"){this.fireEvent("loadDataStart");if(typeof vSource=="object"){this.loadDataXml(vSource)}else{this.loadDataXml(Zapatec.Transport.parseXml({strXml:vSource}))}this.fireEvent("loadDataEnd")}else{if(sSourceType=="xml/url"){this.fireEvent("fetchSourceStart");var oWidget=this;Zapatec.Transport.fetchXmlDoc({url:vSource,async:oConfig.asyncSource,onLoad:function(oResult){oWidget.fireEvent("fetchSourceEnd");oWidget.fireEvent("loadDataStart");oWidget.loadDataXml(oResult);oWidget.fireEvent("loadDataEnd")},onError:function(oError){oWidget.fireEvent("fetchSourceError",oError);oWidget.fireEvent("fetchSourceEnd");oWidget.fireEvent("loadDataEnd")}})}}}}}}}}else{this.fireEvent("loadDataStart");this.loadDataHtml(Zapatec.Widget.getElementById(vSource));this.fireEvent("loadDataEnd")}};Zapatec.Widget.prototype.loadDataHtml=function(a){};Zapatec.Widget.prototype.loadDataHtmlText=function(a){var b=Zapatec.Transport.parseHtml(a);this.loadDataHtml(b.firstChild)};Zapatec.Widget.prototype.loadDataJson=function(a){};Zapatec.Widget.prototype.loadDataXml=function(a){};Zapatec.Widget.prototype.receiveData=function(a){if(!a){a={}}this.dataSender=a.widget;this.fireEvent("receiveData",a)};Zapatec.Widget.prototype.replyData=function(){return null};Zapatec.Widget.prototype.replyDataCancel=function(){this.fireEvent("replyDataCancel");if(typeof this.hide=="function"){this.hide()}this.dataSender=null};Zapatec.Widget.prototype.replyDataReturn=function(b){if(!b){b={}}this.fireEvent("replyDataReturn",b);var a=b.widget;if(!a){a=this.dataSender}if(!a||typeof a.acceptData!="function"){return}a.acceptData({widget:this,data:this.replyData()});this.replyDataCancel()};Zapatec.Widget.prototype.acceptData=function(a){this.fireEvent("acceptData",a)};Zapatec.Widget.prototype.initLang=function(){this.langStr=this.config.lang;if(this.config.langCountryCode&&this.config.langCountryCode.length>0){this.langStr+="_"+this.config.langCountryCode}if(this.config.langEncoding&&this.config.langEncoding.length>0){this.langStr+="-"+this.config.langEncoding}if(this.config.lang&&this.config.lang.length>0&&!(Zapatec.Langs[this.config.langId]&&Zapatec.Langs[this.config.langId][this.langStr])){Zapatec.Log({description:"No language data found for language "+this.config.lang+(this.config.langCountryCode?" and country code "+this.config.langCountryCode:"")+(this.config.langEncoding?" and encoding "+this.config.langEncoding:"")});this.config.lang=null;this.config.langCountryCode=null;this.config.langEncoding=null;this.langStr=null}};Zapatec.Widget.prototype.getMessage=function(b){if(arguments.length==0){return null}if(!Zapatec.Langs[this.config.langId]||!Zapatec.Langs[this.config.langId][this.langStr]||!Zapatec.Langs[this.config.langId][this.langStr][b]){return b}var a=Zapatec.Langs[this.config.langId][this.langStr][b];if(arguments.length>1&&typeof(a)=="string"){for(var f=1;f<arguments.length;f++){var e=new RegExp("(^|([^\\\\]))%"+f);a=a.replace(e,"$2"+arguments[f])}}return a};Zapatec.Widget.callMethod=function(b,e){var a=Zapatec.Widget.getWidgetById(b);if(a&&typeof a[e]=="function"){var f=[].slice.call(arguments,2);return a[e].apply(a,f)}};Zapatec.Widget.getElementById=function(a){if(typeof a=="string"){return document.getElementById(a)}return a};Zapatec.Widget.getStyle=function(a){var b=a.getAttribute("style")||"";if(typeof b=="string"){return b}return b.cssText};if(!window.Zapatec||(Zapatec&&!Zapatec.include)){alert("You need to include zapatec.js file!")}else{Zapatec.calendarPath=Zapatec.getPath("Zapatec.CalendarWidget")}window.calendar=null;Zapatec.Calendar=function(e,b,h,a){if(typeof this.id=="undefined"){var g=0;while(Zapatec.Widget.all[g]){g++}this.id=g;Zapatec.Widget.all[g]=this}this.bShowHistoryEvent=false;this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=h||null;this.onClose=a||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 e=="number"){f=e}else{if(typeof Zapatec.Calendar._FD=="number"){f=Zapatec.Calendar._FD}}this.firstDayOfWeek=f}this.showsOtherMonths=false;this.dateStr=b;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.title1s=new Array();this.rowsOfDayNames=new Array();this.helpButton=true;this.disableFdowClick=true;this.disableDrag=false;this.yearNav=true;this.closeButton=true;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 a=[];for(var b=8;b>0;){a[--b]=Zapatec.Calendar._TT._DN[b].substr(0,Zapatec.Calendar._TT._SDN_len)}Zapatec.Calendar._TT._SDN=a;if(typeof Zapatec.Calendar._TT._SMN_len=="undefined"){Zapatec.Calendar._TT._SMN_len=3}a=[];for(var b=12;b>0;){a[--b]=Zapatec.Calendar._TT._MN[b].substr(0,Zapatec.Calendar._TT._SMN_len)}Zapatec.Calendar._TT._SMN=a}if(typeof Zapatec.Calendar._TT._AMPM=="undefined"){Zapatec.Calendar._TT._AMPM={am:"am",pm:"pm"}}};Zapatec.Calendar.i18n=function(e,a){var b="";if(!a){if(Zapatec.Calendar._TT){b=Zapatec.Calendar._TT[e]}if(!b&&Zapatec.Calendar._TT_en){b=Zapatec.Calendar._TT_en[e]}}else{switch(a){case"dn":b=Zapatec.Calendar._TT._DN[e];break;case"sdn":b=Zapatec.Calendar._TT._SDN[e];break;case"mn":b=Zapatec.Calendar._TT._MN[e];break;case"smn":b=Zapatec.Calendar._TT._SMN[e];break;case"ampm":b=Zapatec.Calendar._TT._AMPM[e];break}}if(!b){b=""+e}return b};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 a=Zapatec.Utils.getCookie("ZP_CAL"),b;if(a){b=Zapatec.Utils.loadPref(a);if(b){Zapatec.Utils.mergeObjects(this.prefs,b)}}};Zapatec.Calendar._add_evs=function(a){var b=Zapatec.Calendar;a.onmouseover=b.dayMouseOver;a.onmousedown=b.dayMouseDown;a.onmouseout=b.dayMouseOut;if(Zapatec.is_ie){a.ondblclick=b.dayMouseDblClick}};Zapatec.Calendar._del_evs=function(a){a.onmouseover=null;a.onmousedown=null;a.onmouseout=null;if(Zapatec.is_ie){a.ondblclick=null}};Zapatec.Calendar.findMonth=function(a){if(typeof a.month!="undefined"){return a}else{if(a.parentNode&&typeof a.parentNode.month!="undefined"){return a.parentNode}}return null};Zapatec.Calendar.findHist=function(a){if(typeof a.histDate!="undefined"){return a}else{if(a.parentNode&&typeof a.parentNode.histDate!="undefined"){return a.parentNode}}return null};Zapatec.Calendar.findYear=function(a){if(typeof a.year!="undefined"){return a}else{if(a.parentNode&&typeof a.parentNode.year!="undefined"){return a.parentNode}}return null};Zapatec.Calendar.showMonthsCombo=function(){var b=Zapatec.Calendar._C;if(!b){return false}var f=b.activeDiv;var p=b.monthsCombo;var h=b.date,q=b.date.getMonth(),e=b.date.getFullYear(),l=(e==b.minYear),o=(e==b.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<b.minMonth)||(o&&g>b.maxMonth)){Zapatec.Utils.addClass(n,"disabled");n.disabled=true}if(g==q){Zapatec.Utils.addClass(b.activeMonth=n,"active")}}var r=p.style;r.display="block";if(f.navtype<0){r.left=f.offsetLeft+"px"}else{var a=p.offsetWidth;if(typeof a=="undefined"){a=50}r.left=(f.offsetLeft+f.offsetWidth-a)+"px"}r.top=(f.offsetTop+f.offsetHeight)+"px";b.updateWCH(p)};Zapatec.Calendar.showHistoryCombo=function(){var e=Zapatec.Calendar._C,o,m,g,f,n,p,l,b;if(!e){return false}n=e.histCombo;while(n.firstChild){n.removeChild(n.lastChild)}if(Zapatec.Calendar.prefs.history){o=Zapatec.Calendar.prefs.history.split(/,/);g=0;while(l=o[g++]){l=l.split(/\//);m=Zapatec.Utils.createElement("div");m.className=Zapatec.is_ie?"label-IEfix":"label";m.id="zpCal"+e.id+"HistoryDropdownItem"+(g-1);m.histDate=new Date(parseInt(l[0],10),parseInt(l[1],10)-1,parseInt(l[2],10),l[3]?parseInt(l[3],10):0,l[4]?parseInt(l[4],10):0);m.appendChild(window.document.createTextNode(m.histDate.print(e.historyDateFormat)));n.appendChild(m);if(m.histDate.dateEqualsTo(e.date)){Zapatec.Utils.addClass(m,"active")}}}f=e.activeDiv;p=n.style;p.display="block";p.left=Math.floor(f.offsetLeft+(f.offsetWidth-n.offsetWidth)/2)+"px";p.top=(f.offsetTop+f.offsetHeight)+"px";e.updateWCH(n);e.bEventShowHistory=true};Zapatec.Calendar.showYearsCombo=function(f){var a=Zapatec.Calendar._C;if(!a){return false}var e=a.activeDiv;var h=a.yearsCombo;if(a.hilitedYear){Zapatec.Utils.removeClass(a.hilitedYear,"hilite")}if(a.activeYear){Zapatec.Utils.removeClass(a.activeYear,"active")}a.activeYear=null;var b=a.date.getFullYear()+(f?1:-1);var n=h.firstChild;var m=false;for(var g=12;g>0;--g){if(b>=a.minYear&&b<=a.maxYear){n.firstChild.data=b;n.year=b;n.style.display="block";m=true}else{n.style.display="none"}n=n.nextSibling;b+=f?a.yearStep:-a.yearStep}if(m){var o=h.style;o.display="block";if(e.navtype<0){o.left=e.offsetLeft+"px"}else{var l=h.offsetWidth;if(typeof l=="undefined"){l=50}o.left=(e.offsetLeft+e.offsetWidth-l)+"px"}o.top=(e.offsetTop+e.offsetHeight)+"px"}a.updateWCH(h)};Zapatec.Calendar.tableMouseUp=function(g){var m=Zapatec.Calendar._C;if(!m){return false}if(m.timeout){clearTimeout(m.timeout)}var f=m.activeDiv;if(!f){return false}var l=Zapatec.Utils.getTargetElement(g);if(typeof(f.navtype)=="undefined"){while(l&&!l.calendar){l=l.parentNode}}g||(g=window.event);Zapatec.Utils.removeClass(f,"active");if(l==f||l.parentNode==f){Zapatec.Calendar.cellClick(f,g)}var e=Zapatec.Calendar.findMonth(l);var a=null;if(e){if(!e.disabled){a=new Date(m.date);if(e.month!=a.getMonth()){a.setMonth(e.month);m.setDate(a,true);m.dateClicked=false;m.callHandler()}}}else{var b=Zapatec.Calendar.findYear(l);if(b){a=new Date(m.date);if(b.year!=a.getFullYear()){a.setFullYear(b.year);m.setDate(a,true);m.dateClicked=false;m.callHandler()}}else{var h=Zapatec.Calendar.findHist(l);if(h&&!h.histDate.dateEqualsTo(m.date)){a=new Date(h.histDate);m._init(m.firstDayOfWeek,m.date=a);m.dateClicked=false;m.callHandler();m.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);m._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 a=true;if(n>l.x+o){q=n-l.x-o;a=false}else{q=l.x-n}if(q<0){q=0}var s=f._range;var u=f._current;var C=r.currentDate;var A=(C.getHours()>=12);var b=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(a){if(--z<0){z=s.length-1}}else{if(++z>=s.length){z=0}}}if(r.getDateStatus){var t=null;var h=null;var e=new Date(C);if(f.className.indexOf("ampm",0)!=-1){t=C.getMinutes();if(b!=s[z]){h=(s[z]==Zapatec.Calendar.i18n("pm","ampm"))?((C.getHours()==0)?(12):(C.getHours()+12)):(C.getHours()-12)}else{h=C.getHours()}e.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]);e.setHours(h)}if(f.className.indexOf("minute",0)!=-1){h=C.getHours();t=s[z];e.setMinutes(t)}}var v=false;if(r.getDateStatus){v=r.getDateStatus(e,C.getFullYear(),C.getMonth(),C.getDate(),parseInt(h,10),parseInt(t,10))}if(v==false){if(!((!r.time24)&&(s[z]==Zapatec.Calendar.i18n("pm","ampm"))&&(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(a){if(Zapatec.Utils.getTargetElement(a)==Zapatec.Utils.getElement(a)){return Zapatec.Utils.stopEvent(a)}};Zapatec.Calendar.calDragIt=function(f){f||(f=window.event);var g=Zapatec.Calendar._C;if(!g){Zapatec.Calendar.calDragEnd()}if(!g.disableDrag){if(!(g&&g.dragging)){return false}var l=f.clientX+window.document.body.scrollLeft;var h=f.clientY+window.document.body.scrollTop;g.hideShowCovered();var e=g.element.style,a=l-g.xOffs,b=h-g.yOffs;e.left=a+"px";e.top=b+"px";Zapatec.Utils.setupWCH(g.WCH,a,b)}return Zapatec.Utils.stopEvent(f)};Zapatec.Calendar.calDragEnd=function(a){var b=Zapatec.Calendar._C;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);if(!b){return false}b.dragging=false;Zapatec.Calendar.tableMouseUp(a);b.hideShowCovered()};Zapatec.Calendar.dayMouseDown=function(e){var a=true;var b=Zapatec.Utils.getElement(e);if(b.className.indexOf("disabled")!=-1||b.className.indexOf("true")!=-1){return false}var f=b.calendar;while(!f){b=b.parentNode;f=b.calendar}f.bEventShowHistory=false;f.activeDiv=b;Zapatec.Calendar._C=f;if(b.navtype!=300){if(b.navtype==50){if(!((f.timeInterval==null)||((f.timeInterval<60)&&(b.className.indexOf("hour",0)!=-1)))){a=false}b._current=b.firstChild.data;if(a){Zapatec.Utils.addEvent(window.document,"mousemove",Zapatec.Calendar.tableMouseOver)}}else{if(((b.navtype==201)||(b.navtype==202))&&(f.timeInterval>30)&&(b.timePart.className.indexOf("minute",0)!=-1)){a=false}if(a){Zapatec.Utils.addEvent(window.document,Zapatec.is_ie5?"mousemove":"mouseover",Zapatec.Calendar.tableMouseOver)}}if(a){Zapatec.Utils.addClass(b,"hilite active")}Zapatec.Utils.addEvent(window.document,"mouseup",Zapatec.Calendar.tableMouseUp)}else{if(f.isPopup){f._dragStart(e)}else{Zapatec.Calendar._C=null}}if(b.navtype==-1||b.navtype==1){if(f.timeout){clearTimeout(f.timeout)}f.timeout=setTimeout("Zapatec.Calendar.showMonthsCombo()",250)}else{if(b.navtype==-2||b.navtype==2){if(f.timeout){clearTimeout(f.timeout)}f.timeout=setTimeout((b.navtype>0)?"Zapatec.Calendar.showYearsCombo(true)":"Zapatec.Calendar.showYearsCombo(false)",250)}else{if(b.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(e)};Zapatec.Calendar.dayMouseDblClick=function(a){Zapatec.Calendar.cellClick(Zapatec.Utils.getElement(a),a||window.event);if(Zapatec.is_ie){window.document.selection.empty()}};Zapatec.Calendar.dayMouseOver=function(f){var e=Zapatec.Utils.getElement(f),a=e.caldate;while(!e.calendar){e=e.parentNode;a=e.caldate}var g=e.calendar;var b=e.timePart;if(a){a=new Date(a[0],a[1],a[2]);if(a.getDate()!=e.caldate[2]){a.setDate(e.caldate[2])}}if(Zapatec.Utils.isRelated(e,f)||Zapatec.Calendar._C||e.className.indexOf("disabled")!=-1||e.className.indexOf("true")!=-1){return false}if(e.ttip){if(e.ttip.substr(0,1)=="_"){e.ttip=a.print(e.calendar.ttDateFormat)+e.ttip.substr(1)}e.calendar.showHint(e.ttip)}if(e.navtype!=300){if(!((g.timeInterval==null)||(e.className.indexOf("ampm",0)!=-1)||((g.timeInterval<60)&&(e.className.indexOf("hour",0)!=-1)))&&(e.navtype==50)){return Zapatec.Utils.stopEvent(f)}if(((e.navtype==201)||(e.navtype==202))&&(g.timeInterval>30)&&(b.className.indexOf("minute",0)!=-1)){return Zapatec.Utils.stopEvent(f)}Zapatec.Utils.addClass(e,"hilite");if(a){Zapatec.Utils.addClass(e.parentNode,"rowhilite")}}return Zapatec.Utils.stopEvent(f)};Zapatec.Calendar.dayMouseOut=function(b){var a=Zapatec.Utils.getElement(b);while(!a.calendar){a=a.parentNode;caldate=a.caldate}if(Zapatec.Utils.isRelated(a,b)||Zapatec.Calendar._C||a.className.indexOf("disabled")!=-1||a.className.indexOf("true")!=-1){return false}Zapatec.Utils.removeClass(a,"hilite");if(a.caldate){Zapatec.Utils.removeClass(a.parentNode,"rowhilite")}if(a.calendar){a.calendar.showHint(Zapatec.Calendar.i18n("SEL_DATE"))}return Zapatec.Utils.stopEvent(b)};Zapatec.Calendar.cellClick=function(e,z){var p=e.calendar;var l=false;var b=false;var A=null;while(!p){e=e.parentNode;p=e.calendar}if(e.className.indexOf("disabled")!=-1||e.className.indexOf("true")!=-1){return false}if(typeof e.navtype=="undefined"){if(p.currentDateEl){Zapatec.Utils.removeClass(p.currentDateEl,"selected");Zapatec.Utils.addClass(e,"selected");l=(p.currentDateEl==e);if(!l){p.currentDateEl=e}}var f=new Date(e.caldate[0],e.caldate[1],e.caldate[2]);if(f.getDate()!=e.caldate[2]){f.setDate(e.caldate[2])}p.date.setDateOnly(f);p.currentDate.setDateOnly(f);A=p.date;p.dateClicked=true;if(p.multiple){p._toggleMultipleDate(new Date(A))}b=true;if(e.otherMonth){p._init(p.firstDayOfWeek,A)}p.onSetTime()}else{if(e.navtype==200){Zapatec.Utils.removeClass(e,"hilite");p.callCloseHandler();return}A=new Date(p.date);if(e.navtype==0&&!p.bEventShowHistory){A.setDateOnly(new Date())}p.dateClicked=false;var o=A.getFullYear();var v=A.getMonth();function n(D){var E=A.getDate();var C=A.getMonthDays(D);if(E>C){A.setDate(C)}A.setMonth(D)}switch(e.navtype){case 400:Zapatec.Utils.removeClass(e,"hilite");var q=Zapatec.Calendar.i18n("ABOUT");if(typeof q!="undefined"){q+=p.showsTime?Zapatec.Calendar.i18n("ABOUT_TIME"):""}else{q='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'}alert(q);return;case -2:if(o>p.minYear){A.setFullYear(o-1)}break;case -1:if(v>0){n(v-1)}else{if(o-->p.minYear){A.setFullYear(o);n(11)}}break;case 1:if(v<11){n(v+1)}else{if(o<p.maxYear){A.setFullYear(o+1);n(0)}}break;case 2:if(o<p.maxYear){A.setFullYear(o+1)}break;case 100:p.setFirstDayOfWeek(e.fdow);Zapatec.Calendar.prefs.fdow=p.firstDayOfWeek;Zapatec.Calendar.savePrefs();if(p.onFDOW){p.onFDOW(p.firstDayOfWeek)}return;case 50:var A=p.currentDate;if(e.className.indexOf("ampm",0)>=0){}else{if(!((p.timeInterval==null)||((p.timeInterval<60)&&(e.className.indexOf("hour",0)!=-1)))){break}}var r=e._range;var t=e.firstChild.data;var x=(A.getHours()>=12);for(var w=r.length;--w>=0;){if(r[w]==t){break}}if(z&&z.shiftKey){if(--w<0){w=r.length-1}}else{if(++w>=r.length){w=0}}if(p.getDateStatus){var s=null;var h=null;var a=new Date(A);if(e.className.indexOf("ampm",0)!=-1){s=A.getMinutes();h=(r[w]==Zapatec.Calendar.i18n("pm","ampm"))?((A.getHours()==12)?(A.getHours()):(A.getHours()+12)):(A.getHours()-12);if(p.getDateStatus&&p.getDateStatus(a,A.getFullYear(),A.getMonth(),A.getDate(),parseInt(h,10),parseInt(s,10))){var m;if(r[w]==Zapatec.Calendar.i18n("pm","ampm")){m=-5}else{m=5}hours=h;minutes=s;do{minutes+=m;if(minutes>=60){minutes-=60;++hours;if(hours>=24){hours-=24}a.setHours(hours)}if(minutes<0){minutes+=60;--hours;if(hours<0){hours+=24}a.setHours(hours)}a.setMinutes(minutes);if(!p.getDateStatus(a,A.getFullYear(),A.getMonth(),A.getDate(),parseInt(hours,10),parseInt(minutes,10))){h=hours;s=minutes;if(h>12){w=1}else{w=0}p.date.setHours(h);p.date.setMinutes(s);p.onSetTime()}}while((h!=hours)||(s!=minutes))}a.setHours(h)}if(e.className.indexOf("hour",0)!=-1){s=A.getMinutes();h=(!p.time24)?((x)?((r[w]!=12)?(parseInt(r[w],10)+12):(12)):((r[w]!=12)?(r[w]):(0))):(r[w]);a.setHours(h)}if(e.className.indexOf("minute",0)!=-1){h=A.getHours();s=r[w];a.setMinutes(s)}}var u=false;if(p.getDateStatus){u=p.getDateStatus(a,A.getFullYear(),A.getMonth(),A.getDate(),parseInt(h,10),parseInt(s,10))}if(!u){e.firstChild.data=r[w]}p.onUpdateTime();return;case 201:case 202:var y=e.timePart;var A=p.currentDate;if((y.className.indexOf("minute",0)!=-1)&&(p.timeInterval>30)){break}var B=parseInt(y.firstChild.data,10);var x=(A.getHours()>=12);var r=y._range;for(var w=r.length;--w>=0;){if(B==r[w]){B=w;break}}var g=y._step;if(e.navtype==201){B=g*Math.floor(B/g);B+=g;if(B>=r.length){B=0}}else{B=g*Math.ceil(B/g);B-=g;if(B<0){B=r.length-g}}if(p.getDateStatus){var s=null;var h=null;var a=new Date(A);if(y.className=="hour"){s=A.getMinutes();h=(!p.time24)?((x)?((r[B]!=12)?(parseInt(r[B],10)+12):(12)):((r[B]!=12)?(r[B]):(0))):(r[B]);a.setHours(h)}if(y.className=="minute"){h=A.getHours();s=B;a.setMinutes(r[B])}}var u=false;if(p.getDateStatus){u=p.getDateStatus(a,A.getFullYear(),A.getMonth(),A.getDate(),parseInt(h,10),parseInt(s,10))}if(!u){y.firstChild.data=r[B]}p.onUpdateTime();return;case 0:if(p.getDateStatus&&((p.getDateStatus(A,A.getFullYear(),A.getMonth(),A.getDate())==true)||(p.getDateStatus(A,A.getFullYear(),A.getMonth(),A.getDate())=="disabled"))){return false}break}if(!A.equalsTo(p.date)){if((e.navtype>=-2&&e.navtype<=2)&&(e.navtype!=0)){p._init(p.firstDayOfWeek,A,true);return}p.setDate(A);b=!(e.navtype&&(e.navtype>=-2&&e.navtype<=2))}}if(b){p.callHandler()}if(l){Zapatec.Utils.removeClass(e,"hilite");p.callCloseHandler()}};Zapatec.Calendar.prototype.create=function(r){var m=null;if(!r){m=window.document.getElementsByTagName("body")[0];this.isPopup=true;this.WCH=Zapatec.Utils.createWCH()}else{m=r;this.isPopup=false}this.currentDate=this.date=this.dateStr?new Date(this.dateStr):new Date();var A=Zapatec.Utils.createElement("table");this.table=A;A.cellSpacing=0;A.cellPadding=0;Zapatec.Utils.createProperty(A,"calendar",this);Zapatec.Utils.addEvent(A,"mousedown",Zapatec.Calendar.tableMouseDown);var p=Zapatec.Utils.createElement("div");this.element=p;p.className="calendar";p.id="zpCal"+this.id+"Container";if(Zapatec.is_opera){A.style.width=(this.monthsInRow*((this.weekNumbers)?(8):(7))*2+4.4*this.monthsInRow)+"em"}if(this.isPopup){p.style.position="absolute";p.style.display="none"}p.appendChild(A);var e=null;var h=null;var o=this;var f=function(E,D,C,l){e=Zapatec.Utils.createElement("td",h);if(l){e.id="zpCal"+o.id+l+"ButtonStatus"}e.colSpan=D;e.className="button";if(Math.abs(C)<=2){e.className+=" nav"}Zapatec.Calendar._add_evs(e);Zapatec.Utils.createProperty(e,"calendar",o);e.navtype=C;if(E.substr(0,1)!="&"){e.appendChild(document.createTextNode(E))}else{e.innerHTML=E}return e};var g=function(C,D,l){e=Zapatec.Utils.createElement("td",C);if(l){e.id="zpCal"+o.id+l+"ButtonStatus"}e.colSpan=D;e.className="button";e.innerHTML="<div>&nbsp</div>";return e};var q=((this.weekNumbers)?(8):(7))*this.monthsInRow-2;var z=Zapatec.Utils.createElement("thead",A);if(this.numberMonths==1){this.title1=z}h=Zapatec.Utils.createElement("tr",z);if(this.helpButton){f("?",1,400,"Help").ttip=Zapatec.Calendar.i18n("INFO")}else{g(h,1,"Help")}this.title1=f("&nbsp;",q,300);this.title1.className="title1";this.title1.id="zpCal"+this.id+"title1";if(this.isPopup){if(!this.disableDrag){this.title1.ttip=Zapatec.Calendar.i18n("DRAG_TO_MOVE");this.title1.style.cursor="move"}if(this.closeButton){f("&#x00d7;",1,200,"Close").ttip=Zapatec.Calendar.i18n("CLOSE")}else{g(h,1,"Close")}}else{g(h,1,"Close")}h=Zapatec.Utils.createElement("tr",z);this._nav_py=f("&#x00ab;",1,-2,"PrevYear");this._nav_py.ttip=Zapatec.Calendar.i18n("PREV_YEAR");this._nav_pm=f("&#x2039;",1,-1,"PrevMonth");this._nav_pm.ttip=Zapatec.Calendar.i18n("PREV_MONTH");this._nav_now=f(Zapatec.Calendar.i18n("TODAY"),q-2,0,"Today");this._nav_now.ttip=Zapatec.Calendar.i18n("GO_TODAY");this._nav_nm=f("&#x203a;",1,1,"NextMonth");this._nav_nm.ttip=Zapatec.Calendar.i18n("NEXT_MONTH");this._nav_ny=f("&#x00bb;",1,2,"NextYear");this._nav_ny.ttip=Zapatec.Calendar.i18n("NEXT_YEAR");var B=Math.floor(this.numberMonths/this.monthsInRow);if(this.numberMonths%this.monthsInRow>0){++B}for(var s=1;s<=B;++s){var z=Zapatec.Utils.createElement("thead",A);if(Zapatec.is_opera){z.style.display="table-row-group"}if(this.numberMonths!=1){h=Zapatec.Utils.createElement("tr",z);var q=5;this.weekNumbers&&++q;this.title1s[s]=new Array();for(var t=1;(t<=this.monthsInRow)&&((s-1)*this.monthsInRow+t<=this.numberMonths);++t){g(h,1);this.title1s[s][t]=f("&nbsp;",q,300);this.title1s[s][t].className="title1";this.title1s[s][t].id="zpCal"+this.id+"Subtitle1"+((s-1)*this.monthsInRow+t);g(h,1)}}h=Zapatec.Utils.createElement("tr",z);h.className="daynames";for(t=1;(t<=this.monthsInRow)&&((s-1)*this.monthsInRow+t<=this.numberMonths);++t){if(this.weekNumbers){e=Zapatec.Utils.createElement("td",h);e.className="name wn";e.appendChild(window.document.createTextNode(Zapatec.Calendar.i18n("WK")));if(t>1){Zapatec.Utils.addClass(e,"month-left-border")}var y=Zapatec.Calendar.i18n("WK");if(y==null){y=""}}for(var x=7;x>0;--x){e=Zapatec.Utils.createElement("td",h);e.appendChild(document.createTextNode("&nbsp;"));e.id="zpCal"+this.id+"WeekDayButton"+(7-x)+"Status"}}this.firstdayname=h.childNodes[this.weekNumbers?1:0];this.rowsOfDayNames[s]=this.firstdayname;this._displayWeekdays();var b=Zapatec.Utils.createElement("tbody",A);this.tbody[s]=b;for(x=6;x>0;--x){h=Zapatec.Utils.createElement("tr",b);for(t=1;(t<=this.monthsInRow)&&((s-1)*this.monthsInRow+t<=this.numberMonths);++t){if(this.weekNumbers){e=Zapatec.Utils.createElement("td",h);e.id="zpCal"+this.id+"WeekNumber"+(6-x);e.appendChild(document.createTextNode("&nbsp;"))}for(var u=7;u>0;--u){e=Zapatec.Utils.createElement("td",h);e.id="zpCal"+this.id+"DateCell"+((s-1)*this.monthsInRow+t)+"-"+(6-x)+"-"+(7-u);e.appendChild(document.createTextNode("&nbsp;"));Zapatec.Utils.createProperty(e,"calendar",this);Zapatec.Calendar._add_evs(e)}}}}var n=Zapatec.Utils.createElement("tfoot",A);if(this.showsTime){h=Zapatec.Utils.createElement("tr",n);h.className="time";var a;if(this.monthsInRow!=1){e=Zapatec.Utils.createElement("td",h);a=e.colSpan=Math.ceil((((this.weekNumbers)?8:7)*(this.monthsInRow-1))/2);e.className="timetext";e.innerHTML="&nbsp"}e=Zapatec.Utils.createElement("td",h);e.className="timetext";e.colSpan=this.weekNumbers?2:1;e.innerHTML=Zapatec.Calendar.i18n("TIME")||"&nbsp;";(function(){function G(T,S,X,H,W){var Y,R,U,N,M;if(W){e=Zapatec.Utils.createElement("td",h);e.colSpan=1;if(o.showsTime!="seconds"){++e.colSpan}e.className="parent-"+T;Y=Zapatec.Utils.createElement("table",e);Y.cellSpacing=Y.cellPadding=0;if(T=="hour"){Y.align="right"}Y.className="calendar-time-scroller";R=Zapatec.Utils.createElement("tbody",Y);U=Zapatec.Utils.createElement("tr",R);N=Zapatec.Utils.createElement("tr",R)}else{U=h}M=Zapatec.Utils.createElement("td",U);M.className=T;M.id="zpTime"+o.id+S+"SelectStatus";M.appendChild(window.document.createTextNode(X));Zapatec.Utils.createProperty(M,"calendar",o);M.ttip=Zapatec.Calendar.i18n("TIME_PART");M.navtype=50;M._range=[];if(!W){M._range=H}else{M.rowSpan=2;for(var Q=H;Q<=W;++Q){var P;if(Q<10&&W>=10){P="0"+Q}else{P=""+Q}M._range[M._range.length]=P}var O=Zapatec.Utils.createElement("td",U);O.className="up";O.navtype=201;O.id="zpTime"+o.id+S+"UpButtonStatus";Zapatec.Utils.createProperty(O,"calendar",o);O.timePart=M;if(Zapatec.is_khtml){O.innerHTML="&nbsp;"}Zapatec.Calendar._add_evs(O);var V=Zapatec.Utils.createElement("td",N);V.className="down";V.navtype=202;V.id="zpTime"+o.id+S+"DownButtonStatus";Zapatec.Utils.createProperty(V,"calendar",o);V.timePart=M;if(Zapatec.is_khtml){V.innerHTML="&nbsp;"}Zapatec.Calendar._add_evs(V)}Zapatec.Calendar._add_evs(M);return M}var K=o.currentDate.getHours();var l=o.currentDate.getMinutes();if(o.showsTime=="seconds"){var E=o.currentDate.getSeconds()}var L=!o.time24;var C=(K>12);if(L&&C){K-=12}var I=G("hour","Hours",K,L?1:0,L?12:23);I._step=(o.timeInterval>30)?(o.timeInterval/60):1;e=Zapatec.Utils.createElement("td",h);e.innerHTML=":";e.className="colon";var F=G("minute","Minutes",l,0,59);F._step=((o.timeInterval)&&(o.timeInterval<60))?(o.timeInterval):5;if(o.showsTime=="seconds"){e=Zapatec.Utils.createElement("td",h);e.innerHTML=":";e.className="colon";var D=G("minute","Seconds",E,0,59);D._step=5}var J=null;if(L){J=G("ampm","AMPM",C?Zapatec.Calendar.i18n("pm","ampm"):Zapatec.Calendar.i18n("am","ampm"),[Zapatec.Calendar.i18n("am","ampm"),Zapatec.Calendar.i18n("pm","ampm")]);J.className+=" button"}else{Zapatec.Utils.createElement("td",h).innerHTML="&nbsp;"}o.onSetTime=function(){var O=this.currentDate.getHours();var P=this.currentDate.getMinutes();if(this.showsTime=="seconds"){var N=o.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?Zapatec.Calendar.i18n("pm","ampm"):Zapatec.Calendar.i18n("am","ampm")}};o.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){e=Zapatec.Utils.createElement("td",h);e.colSpan=((this.weekNumbers)?8:7)*(this.monthsInRow-1)-Math.ceil(a);e.className="timetext";e.innerHTML="&nbsp"}}else{this.onSetTime=this.onUpdateTime=function(){}}h=Zapatec.Utils.createElement("tr",n);h.className="footrow";e=f(Zapatec.Calendar.i18n("SEL_DATE"),this.weekNumbers?(8*this.numberMonths):(7*this.numberMonths),300);e.className="ttip";e.id="zpCal"+this.id+"Status";if(this.isPopup&&!this.disableDrag){e.ttip=Zapatec.Calendar.i18n("DRAG_TO_MOVE");e.style.cursor="move"}this.tooltips=e;p=this.monthsCombo=Zapatec.Utils.createElement("div",this.element);p.className="combo";p.id="zpCal"+this.id+"MonthDropdownCombo";for(x=0;x<12;++x){var w=Zapatec.Utils.createElement("div");w.className=Zapatec.is_ie?"label-IEfix":"label";w.id="zpCal"+this.id+"MonthDropdownItem"+x;w.month=x;w.appendChild(window.document.createTextNode(Zapatec.Calendar.i18n(x,"smn")));p.appendChild(w)}p=this.yearsCombo=Zapatec.Utils.createElement("div",this.element);p.className="combo";p.id="zpCal"+this.id+"YearDropdownCombo";for(x=0;x<12;++x){var v=Zapatec.Utils.createElement("div");v.className=Zapatec.is_ie?"label-IEfix":"label";v.id="zpCal"+this.id+"YearDropdownItem"+x;v.appendChild(window.document.createTextNode("&nbsp;"));p.appendChild(v)}p=this.histCombo=Zapatec.Utils.createElement("div",this.element);p.id="zpCal"+this.id+"HistoryDropdownCombo";p.className="combo history";this._init(this.firstDayOfWeek,this.date);m.appendChild(this.element)};Zapatec.Calendar._keyEvent=function(f){if(!window.calendar){return false}(Zapatec.is_ie)&&(f=window.event);var g=window.calendar;var b=(Zapatec.is_ie||f.type=="keypress");var a=f.keyCode;var e=new Date(g.date);if(f.ctrlKey){switch(a){case 37:b&&Zapatec.Calendar.cellClick(g._nav_pm);break;case 38:b&&Zapatec.Calendar.cellClick(g._nav_py);break;case 39:b&&Zapatec.Calendar.cellClick(g._nav_nm);break;case 40:b&&Zapatec.Calendar.cellClick(g._nav_ny);break;default:return false}}else{switch(a){case 32:Zapatec.Calendar.cellClick(g._nav_now);break;case 27:b&&g.callCloseHandler();break;case 37:if(b&&!g.multiple){e.setTime(e.getTime()-86400000);g.setDate(e)}break;case 38:if(b&&!g.multiple){e.setTime(e.getTime()-7*86400000);g.setDate(e)}break;case 39:if(b&&!g.multiple){e.setTime(e.getTime()+86400000);g.setDate(e)}break;case 40:if(b&&!g.multiple){e.setTime(e.getTime()+7*86400000);g.setDate(e)}break;case 13:if(b){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 a=V.getMonth();var X=Math.floor(this.numberMonths/this.monthsInRow);var v;var z,G,q;if(!this.vertical){z=(this.controlMonth-1);v=a-z}else{G=((this.numberMonths-1)%this.monthsInRow)+1;q=(this.controlMonth-1)%this.monthsInRow;bottom=(q>=(G)?(G):(q));z=(q)*(X-1)+Math.floor((this.controlMonth-1)/this.monthsInRow)+bottom;v=a-z}var s=g;if(v<0){v+=12;--s}var A=v+this.numberMonths-1;var y=s;if(A>11){A-=12;++y}function C(l){Zapatec.Calendar._del_evs(l);l.disabled=true;l.className="button";l.innerHTML="<div>&nbsp</div>"}function f(Z,l){Zapatec.Calendar._add_evs(Z);Z.disabled=false;Z.className="button nav";Z.innerHTML=l}if((s<=this.minYear)||!this.yearNav){if(!this._nav_py.disabled){C(this._nav_py)}}else{if(this._nav_py.disabled){f(this._nav_py,"&#x00ab;")}}if(y>=this.maxYear||!this.yearNav){if(!this._nav_ny.disabled){C(this._nav_ny)}}else{if(this._nav_ny.disabled){f(this._nav_ny,"&#x00bb;")}}if(((s==this.minYear)&&(v<=this.minMonth))||(s<this.minYear)){if(!this._nav_pm.disabled){C(this._nav_pm)}}else{if(this._nav_pm.disabled){f(this._nav_pm,"&#x2039;")}}if(((y==this.maxYear)&&(A>=this.maxMonth))||(y>this.maxYear)){if(!this._nav_nm.disabled){C(this._nav_nm)}}else{if(this._nav_nm.disabled){f(this._nav_nm,"&#x203a;")}}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(y,A,V.getMonthDays(A),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())+1)}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();a=this.date.getMonth();var n=V.getMonth();var m=this.date.getDate();var K=V.getMonthDays();var x=new Array();if(this.numberMonths%this.monthsInRow>0){++X}for(var Q=1;Q<=X;++Q){x[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()-z+((R-1)*(X-1)+(Q-1)+((G<R)?(G):(R-1)))}else{var W=V.getMonth()-z+(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}var B=J.getHours();J.setDate(-O);J.setDate(J.getDate()+1);if(B!=J.getHours()){J.setDate(1);J.setMonth(W);J.setDate(-O);J.setDate(J.getDate()+1)}x[Q][R]=J}}var b=Zapatec.Calendar.i18n(a,"smn");var e=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=x[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";p.id="zpCal"+this.id+"Daysrow"+(6-T);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")}if(this.vertical){W=n-z+((R-1)*(X-1)+(Q-1)+((G<R)?(G):(R-1)))}else{W=n-z+((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.className+=" true";D.innerHTML="<div>&nbsp;</div>";continue}}else{Y=true}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.title1=u}}if(F==true){D.className+=" disabled"}else{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((e!=null)&&(e.indexOf(r.toString())!=-1)){D.className+=D.otherMonth?" oweekend":" weekend"}}}if(!(Y||this.showsOtherMonths)){p.className="emptyrow"}}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.title1.innerHTML=Zapatec.Calendar.i18n(a,"mn")+", "+g;if(this.params&&this.params.title1Html){if(typeof this.params.title1Html=="function"){this.title1.innerHTML=this.params.title1Html(this.title1.innerHTML,a,g)}else{this.title1.innerHTML+=this.params.title1Html}}}else{if(this.params&&this.params.title1Html){if(typeof this.params.title1Html=="function"){this.title1.innerHTML=this.params.title1Html(Zapatec.Calendar.i18n(a,"mn")+", "+g,a,g)}else{this.title1.innerHTML=this.params.title1Html}}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=a-z+((R-1)*(X-1)+(Q-1)+((G<R)?(G):(R-1)))}else{W=a-z+(Q-1)*this.monthsInRow+R-1}validYear=g;if(W<0){--validYear;W=12+W}if(W>11){++validYear;W=W-12}this.title1s[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 b in this.multiple){var a=this.datesCells[b];var e=this.multiple[b];if(!e){continue}if(a){a.className+=" selected"}}}};Zapatec.Calendar.prototype._toggleMultipleDate=function(b){if(this.multiple){var e=b.print("%Y%m%d");var a=this.datesCells[e];if(a){var f=this.multiple[e];if(!f){Zapatec.Utils.addClass(a,"selected");this.multiple[e]=b}else{Zapatec.Utils.removeClass(a,"selected");delete this.multiple[e]}}}};Zapatec.Calendar.prototype.setDateToolTipHandler=function(a){this.getDateToolTip=a};Zapatec.Calendar.prototype.setDate=function(b,f){if(!b){b=new Date()}if(!b.equalsTo(this.date)){var e=b.getFullYear(),a=b.getMonth();if(e<this.minYear||(e==this.minYear&&a<this.minMonth)){this.showHint("<div class='error'>"+Zapatec.Calendar.i18n("E_RANGE")+" ???</div>")}else{if(e>this.maxYear||(e==this.maxYear&&a>this.maxMonth)){this.showHint("<div class='error'>??? "+Zapatec.Calendar.i18n("E_RANGE")+"</div>")}}this._init(this.firstDayOfWeek,b,f)}};Zapatec.Calendar.prototype.showHint=function(a){this.tooltips.innerHTML=a};Zapatec.Calendar.prototype.reinit=function(){this._init(this.firstDayOfWeek,this.date)};Zapatec.Calendar.prototype.refresh=function(){var b=this.isPopup?null:this.element.parentNode;var a=parseInt(this.element.style.left);var e=parseInt(this.element.style.top);this.destroy();this.dateStr=this.date;this.create(b);if(this.isPopup){this.showAt(a,e)}else{this.show()}};Zapatec.Calendar.prototype.setFirstDayOfWeek=function(b){if(this.firstDayOfWeek!=b){this._init(b,this.date);var e=Math.floor(this.numberMonths/this.monthsInRow);if(this.numberMonths%this.monthsInRow>0){++e}for(var a=1;a<=e;++a){this.firstdayname=this.rowsOfDayNames[a];this._displayWeekdays()}}};Zapatec.Calendar.prototype.setDateStatusHandler=Zapatec.Calendar.prototype.setDisabledHandler=function(a){this.getDateStatus=a};Zapatec.Calendar.prototype.setRange=function(e,g){var b,f=Math.min(e,g),h=Math.max(e,g);this.minYear=b=Math.floor(f);this.minMonth=(b==f)?0:Math.ceil((f-b)*100-1);this.maxYear=b=Math.floor(h);this.maxMonth=(b==h)?11:Math.ceil((h-b)*100-1)};Zapatec.Calendar.prototype.setMultipleDates=function(a){if(!a||typeof a=="undefined"){return}this.multiple={};for(var b=a.length;--b>=0;){var f=a[b];var e=f.print("%Y%m%d");this.multiple[e]=f}};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 f=new Array();for(var b in this.multiple){var a=this.multiple[b];if(a){f[f.length]=a}f.sort(Zapatec.Utils.compareDates)}this.multiple={};for(var b=0;b<f.length;b++){var g=f[b];var e=g.print("%Y%m%d");this.multiple[e]=g}}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 e,g,m,f,h,l="",b=Zapatec.Calendar.prefs.hsize-1;if(Zapatec.Calendar.prefs.history){e=Zapatec.Calendar.prefs.history.split(/,/);g=0;while(g<b&&(f=e[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(b){var a=this.element;a.parentNode.removeChild(a);b.appendChild(a)};Zapatec.Calendar._checkCalendar=function(b){if(!window.calendar){return false}var a=Zapatec.is_ie?Zapatec.Utils.getElement(b):Zapatec.Utils.getTargetElement(b);for(;a!=null&&a!=calendar.element;a=a.parentNode){}if(a==null){window.calendar.callCloseHandler()}};Zapatec.Calendar.prototype.updateWCH=function(a){Zapatec.Utils.setupWCH_el(this.WCH,this.element,a)};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 e=h.getElementsByTagName("td");for(var b=e.length;b>0;){var a=e[--b];Zapatec.Utils.removeClass(a,"hilite");Zapatec.Utils.removeClass(a,"active")}}if(this.element.style.display!="block"){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(a,e){var b=this.element.style;b.left=a+"px";b.top=e+"px";this.show()};Zapatec.Calendar.prototype.showAtElement=function(g,l){var b=this;var n=Zapatec.Utils.getElementOffset(g);if(!l||typeof l!="string"){this.showAt(n.x,n.y+g.offsetHeight);return true}this.element.style.display="block";var a=b.element.offsetWidth;var f=b.element.offsetHeight;b.element.style.display="none";var e=l.substr(0,1);var m="l";if(l.length>1){m=l.substr(1,1)}switch(e){case"T":n.y-=f;break;case"B":n.y+=g.offsetHeight;break;case"C":n.y+=(g.offsetHeight-f)/2;break;case"t":n.y+=g.offsetHeight-f;break;case"b":break}switch(m){case"L":n.x-=a;break;case"R":n.x+=g.offsetWidth;break;case"C":n.x+=(g.offsetWidth-a)/2;break;case"l":n.x+=g.offsetWidth-a;break;case"r":break}n.width=a;n.height=f;b.monthsCombo.style.display="none";Zapatec.Utils.fixBoxPosition(n,10);b.showAt(n.x,n.y)};Zapatec.Calendar.prototype.setDateFormat=function(a){this.dateFormat=a};Zapatec.Calendar.prototype.setTtDateFormat=function(a){this.ttDateFormat=a};Zapatec.Calendar.prototype.parseDate=function(e,a){if(!e){return this.setDate(this.date)}if(!a){a=this.dateFormat}var b=Date.parseDate(e,a);return this.setDate(b)};Zapatec.Calendar.prototype.hideShowCovered=function(){if(!Zapatec.is_ie5){return}var v=this;function b(x){var p=x.style.visibility;if(!p){if(window.document.defaultView&&typeof(window.document.defaultView.getComputedStyle)=="function"){if(!Zapatec.is_khtml){p=window.document.defaultView.getComputedStyle(x,"").getPropertyValue("visibility")}else{p=""}}else{if(x.currentStyle){p=x.currentStyle.visibility}else{p=""}}}return p}var w=["applet","iframe","select"];var e=v.element;var a=Zapatec.Utils.getAbsolutePos(e);var h=a.x;var f=e.offsetWidth+h;var u=a.y;var t=e.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];a=Zapatec.Utils.getAbsolutePos(g);var s=a.x;var r=g.offsetWidth+s;var q=a.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=b(g)}g.style.visibility=g.__msh_save_visibility}else{if(!g.__msh_save_visibility){g.__msh_save_visibility=b(g)}g.style.visibility="hidden"}}}};Zapatec.Calendar.prototype._displayWeekdays=function(){var b=this.firstDayOfWeek;var a=this.firstdayname;var f=Zapatec.Calendar.i18n("WEEKEND");for(k=1;(k<=this.monthsInRow)&&(a);++k){for(var e=0;e<7;++e){a.className=" day name";if((!this.weekNumbers)&&(e==0)&&(k!=1)){Zapatec.Utils.addClass(a,"month-left-border")}if((e==6)&&(k!=this.monthsInRow)){Zapatec.Utils.addClass(a,"month-right-border")}var g=(e+b)%7;if((!this.disableFdowClick)&&((this.params&&this.params.fdowClick)||e)){if(Zapatec.Calendar.i18n("DAY_FIRST")!=null){a.ttip=Zapatec.Calendar.i18n("DAY_FIRST").replace("%s",Zapatec.Calendar.i18n(g,"dn"))}a.navtype=100;a.calendar=this;a.fdow=g;Zapatec.Calendar._add_evs(a)}if((f!=null)&&(f.indexOf(g.toString())!=-1)){Zapatec.Utils.addClass(a,"weekend")}a.innerHTML=Zapatec.Calendar.i18n((e+b)%7,"sdn");a=a.nextSibling}if(this.weekNumbers&&a){a=a.nextSibling}}};Zapatec.Utils.compareDates=function(b,a){if(Zapatec.Calendar.prefs.sortOrder=="asc"){return b-a}else{return a-b}};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(b){b||(b=window.event);if(this.dragging){return}this.dragging=true;var f=b.clientX+window.document.body.scrollLeft;var e=b.clientY+window.document.body.scrollTop;var a=this.element.style;this.xOffs=f-parseInt(a.left);this.yOffs=e-parseInt(a.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(b){var a=this.getFullYear();if(typeof b=="undefined"){b=this.getMonth()}if(((0==(a%4))&&((0!=(a%100))||(0==(a%400))))&&b==1){return 29}else{return Date._MD[b]}};Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var e=new Date(this.getFullYear(),0,0,0,0,0);var b=a-e;return Math.round(b/Date.DAY)};Date.prototype.getWeekNumber=function(){var e=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var b=e.getDay();e.setDate(e.getDate()-(b+6)%7+3);var a=e.valueOf();e.setMonth(0);e.setDate(4);return Math.round((a-e.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(a){return((this.getFullYear()==a.getFullYear())&&(this.getMonth()==a.getMonth())&&(this.getDate()==a.getDate())&&(this.getHours()==a.getHours())&&(this.getMinutes()==a.getMinutes()))};Date.prototype.dateEqualsTo=function(a){return((this.getFullYear()==a.getFullYear())&&(this.getMonth()==a.getMonth())&&(this.getDate()==a.getDate()))};Date.prototype.setDateOnly=function(a){var b=new Date(a);this.setDate(1);this.setFullYear(b.getFullYear());this.setMonth(b.getMonth());this.setDate(b.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 e=(v>=12);var l=(e)?(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"]=e?"PM":"AM";A["%P"]=e?"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%100;if(A["%y"]<10){A["%y"]="0"+A["%y"]}A["%Y"]=q;A["%%"]="%";var x=/%./g;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(w,A){var b=A,a=0,l=null,n=null,x=null,s=null,D=null,E=new Date(),e={};var t=["%d","%H","%I","%m","%M","%S","%s","%W","%u","%w","%y","%e","%k","%l","%s","%Y","%C"];function f(G){if(Zapatec.Utils.arrIndexOf(t,G)!=-1){return true}return false}function m(){for(var G=s[0];G<s[1];++G){var H=Zapatec.Calendar.i18n(G,D);if(!H){return null}if(H==w.substr(a,H.length)){x=H.length;return G}}return null}function q(){var G=w.substr(a,x);if(G.length!=x||/$\d+^/.test(G)){return null}return parseInt(G,10)}function y(){var G=(w.substr(a,x).toLowerCase()==Zapatec.Calendar.i18n("pm","ampm"))?true:false;return G||((w.substr(a,x).toLowerCase()==Zapatec.Calendar.i18n("am","ampm"))?false:null)}function p(){return""}function o(G){return(e[G]=n())}function u(G){if(typeof G=="undefined"||G===null){return false}return true}function g(){for(var G=0;G<arguments.length;++G){if(arguments[G]!==null&&typeof arguments[G]!="undefined"&&!isNaN(arguments[G])){return arguments[G]}}return null}if(typeof b!="string"||typeof w!="string"||w==""||b==""){return null}while(b){n=q;x=b.indexOf("%");x=(x==-1)?b.length:x;l=b.slice(0,x);if(l!=w.substr(a,x)){return null}a+=x;b=b.slice(x);if(b==""){break}l=b.slice(0,2);x=2;switch(l){case"%A":case"%a":D=(l=="%A")?"dn":"sdn";s=[0,7];n=m;break;case"%B":case"%b":D=(l=="%B")?"mn":"smn";s=[0,12];n=m;break;case"%p":case"%P":n=y;break;case"%Y":x=4;if(f(b.substr(2,2))){return null}while(isNaN(parseInt(w.charAt(a+x-1)))&&x>0){--x}if(x==0){break}break;case"%C":case"%s":x=1;if(f(b.substr(2,2))){return null}while(!isNaN(parseInt(w.charAt(a+x)))){++x}break;case"%k":case"%l":case"%e":x=1;if(f(b.substr(2,2))){return null}if(!isNaN(parseInt(w.charAt(a+1)))){++x}break;case"%j":x=3;break;case"%u":case"%w":x=1;case"%y":case"%m":case"%d":case"%W":case"%H":case"%I":case"%M":case"%S":break}if(o(l)===null){return null}a+=x;b=b.slice(2)}if(u(e["%s"])){E.setTime(e["%s"]*1000)}else{var r=g(e["%Y"],e["%y"]+ --e["%C"]*100,e["%y"]+(E.getFullYear()-E.getFullYear()%100),e["%C"]*100+E.getFullYear()%100);var F=g(e["%m"]-1,e["%b"],e["%B"]);var z=g(e["%d"]||e["%e"]);if(z===null||F===null){var v=g(e["%a"],e["%A"],e["%u"]==7?0:e["%u"],e["%w"])}var h=g(e["%H"],e["%k"]);if(h===null&&(u(e["%p"])||u(e["%P"]))){var C=g(e["%p"],e["%P"]);h=g(e["%I"],e["%l"]);h=C?((h==12)?12:(h+12)):((h==12)?(0):h)}if(r||r===0){E.setFullYear(r)}if(F||F===0){E.setMonth(F)}if(z||z===0){E.setDate(z)}if(u(e["%j"])){E.setMonth(0);E.setDate(1);E.setDate(e["%j"])}if(u(v)){E.setDate(E.getDate()+(v-E.getDay()))}if(u(e["%W"])){var B=E.getWeekNumber();if(B!=e["%W"]){E.setDate(E.getDate()+(e["%W"]-B)*7)}}if(h!==null){E.setHours(h)}if(u(e["%M"])){E.setMinutes(e["%M"])}if(u(e["%S"])){E.setSeconds(e["%S"])}}if(E.print(A)!=w){return null}return E};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(b){var a=new Date(this);a.__msh_oldSetFullYear(b);if(a.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(b)};Date.prototype.compareDatesOnly=function(g,f){var e=g.getYear();var b=f.getYear();var a=g.getMonth();var m=f.getMonth();var l=g.getDate();var h=f.getDate();if(e>b){return -1}if(b>e){return 1}if(a>m){return -1}if(m>a){return 1}if(l>h){return -1}if(h>l){return 1}return 0};Zapatec.Setup=function(){};Zapatec.Setup.test=true;Zapatec.Calendar.setup=function(b){paramsList=["id"];function h(q,r){if(typeof b[q]=="undefined"){b[q]=r}paramsList.push(q)}b.id=Zapatec.Utils.generateID("calendar");h("inputField",null);h("displayArea",null);h("button",null);h("eventName","click");h("closeEventName",null);h("ifFormat","%Y/%m/%d");h("daFormat","%Y/%m/%d");h("singleClick",true);h("disableFunc",null);h("dateStatusFunc",b.disableFunc);h("dateText",null);h("firstDay",null);h("align","Br");h("range",[1900,2999]);h("weekNumbers",true);h("flat",null);h("flatCallback",null);h("onSelect",null);h("onClose",null);h("onUpdate",null);h("date",null);h("showsTime",false);h("sortOrder","asc");h("timeFormat","24");h("timeInterval",null);h("electric",true);h("step",2);h("position",null);h("cache",false);h("showOthers",false);h("multiple",null);h("saveDate",null);h("fdowClick",false);h("title1Html",null);h("noHelp",false);h("noCloseButton",false);h("disableYearNav",false);h("disableFdowChange",false);if(b.weekNumbers){b.disableFdowChange=true;b.firstDay=1}h("disableDrag",false);h("numberMonths",1);if((b.numberMonths>12)||(b.numberMonths<1)){b.numberMonths=1}if(b.numberMonths>1){b.showOthers=false}b.numberMonths=parseInt(b.numberMonths,10);h("controlMonth",1);if((b.controlMonth>b.numberMonths)||(b.controlMonth<1)){b.controlMonth=1}b.controlMonth=parseInt(b.controlMonth,10);h("vertical",false);if(b.monthsInRow>b.numberMonths){b.monthsInRow=b.numberMonths}h("monthsInRow",b.numberMonths);b.monthsInRow=parseInt(b.monthsInRow,10);h("multiple",false);if(b.multiple){b.singleClick=false}h("canType",false);var f=["inputField","displayArea","button"];for(var g in f){if(typeof b[f[g]]=="string"){b[f[g]]=document.getElementById(b[f[g]])}}if(!b.inputField){b.canType=false}else{b.inputField.setAttribute("autocomplete","off")}if(!(b.flat||b.multiple||b.inputField||b.displayArea||b.button)){alert("Calendar.setup '"+b.id+"':\n  Nothing to setup (no fields found).  Please check your code");return false}if(((b.timeInterval)&&((b.timeInterval!==Math.floor(b.timeInterval))||((60%b.timeInterval!==0)&&(b.timeInterval%60!==0))))||(b.timeInterval>360)){alert("'"+b.id+"': timeInterval option can only have the following number of minutes:\n1, 2, 3, 4, 5, 6, 10, 15, 30,  60, 120, 180, 240, 300, 360 ");b.timeInterval=null}if(b.date&&!Date.parse(b.date)){alert("'"+b.id+"' Start Date Invalid: "+b.date+".\nSee date option.\nDefaulting to today.");b.date=null}if(b.saveDate){h("cookiePrefix",window.location.href+"--"+b.button.id);var n=b.cookiePrefix;var l=Zapatec.Utils.getCookie(n);if(l!=null){document.getElementById(b.inputField.id).value=l}}for(var o in b){if(typeof b.constructor.prototype[o]!="undefined"){continue}if(Zapatec.Utils.arrIndexOf(paramsList,o)==-1){alert("Wrong config option: "+o)}}function m(r){var q=r.params;var t=(r.dateClicked||q.electric);if(t&&q.flat){if(typeof q.flatCallback=="function"){if(!q.multiple){q.flatCallback(r)}}else{alert("'"+r.id+"': No flatCallback given -- doing nothing.")}return false}if(t&&q.inputField){q.inputField.value=r.currentDate.print(q.ifFormat);if(typeof q.inputField.onchange=="function"){q.inputField.onchange()}}if(t&&q.displayArea){q.displayArea.innerHTML=r.currentDate.print(q.daFormat)}if(t&&q.singleClick&&r.dateClicked){r.callCloseHandler()}if(t&&typeof q.onUpdate=="function"){q.onUpdate(r)}if(q.saveDate){var s=q.cookiePrefix;Zapatec.Utils.writeCookie(s,q.inputField.value,null,"/",q.saveDate)}}if(b.flat!=null){if(typeof b.flat=="string"){b.flat=document.getElementById(b.flat)}if(!b.flat){alert("Calendar.setup '"+b.id+"':\n  Flat specified but can't find parent.");return false}var a=new Zapatec.Calendar(b.firstDay,b.date,b.onSelect||m);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;a.closeButton=!b.noCloseButton;a.yearNav=!b.disableYearNav;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 p=b.button||b.displayArea||b.inputField;if(b.canType){function e(q){q=q||window.event;if(Zapatec.is_ie){q.cancelBubble=true}else{q.stopPropagation()}}Zapatec.Utils.addEvent(b.inputField,"mousedown",e);Zapatec.Utils.addEvent(b.inputField,"keydown",e);Zapatec.Utils.addEvent(b.inputField,"keypress",e);Zapatec.Utils.addEvent(b.inputField,"keyup",function(r){var t=b.inputField?b.ifFormat:b.daFormat;var q=Date.parseDate(b.inputField.value,t);var s=window.calendar;if(s&&q&&!s.hidden){s.setDate(q)}})}p["on"+b.eventName]=function(){var q=b.inputField||b.displayArea;if((!b.canType||b.inputField!=p)&&p.blur){p.blur()}var t=b.inputField?b.ifFormat:b.daFormat;var v=false;var u=window.calendar;if(b.canType&&(b.inputField==p)&&u&&!u.hidden){return}if(!(u&&b.cache)){window.calendar=u=new Zapatec.Calendar(b.firstDay,b.date,b.onSelect||m,b.onClose||function(w){if(b.cache){w.hide()}else{w.destroy()}});u.disableFdowClick=b.disableFdowChange;u.showsTime=b.showsTime;u.time24=(b.timeFormat=="24");u.timeInterval=b.timeInterval;u.weekNumbers=b.weekNumbers;u.numberMonths=b.numberMonths;u.controlMonth=b.controlMonth;u.vertical=b.vertical;u.monthsInRow=b.monthsInRow;u.historyDateFormat=b.ifFormat||b.daFormat;u.helpButton=!b.noHelp;u.disableDrag=b.disableDrag;u.closeButton=!b.noCloseButton;u.yearNav=!b.disableYearNav;u.sortOrder=b.sortOrder.toLowerCase();v=true}else{if(b.date){u.setDate(b.date)}u.hide()}if(b.multiple){u.setMultipleDates(b.multiple)}u.showsOtherMonths=b.showOthers;u.yearStep=b.step;u.setRange(b.range[0],b.range[1]);u.params=b;u.setDateStatusHandler(b.dateStatusFunc);u.getDateText=b.dateText;u.setDateFormat(t);if(v){u.create()}if(q){var r;if(q.value){r=q.value}else{r=q.innerHTML}if(r!=""){var s=Date.parseDate(q.value||q.innerHTML,t);if(s!=null){u.setDate(s)}}}if(!b.position){u.showAtElement(b.button||b.displayArea||b.inputField,b.align)}else{u.showAt(b.position[0],b.position[1])}return false};if(b.closeEventName){p["on"+b.closeEventName]=function(){if(window.calendar){window.calendar.callCloseHandler()}}}return a};Zapatec.Utils.addEvent(window,"load",Zapatec.Utils.checkActivation);Zapatec.Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Zapatec.Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");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-2007\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="Select 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="%m-%d%-Y";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";Zapatec.Calendar._TT._AMPM={am:"am",pm:"pm"};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;function useXMLHTTPRequest(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}}}else{alert("Status: Cound not create XmlHttpRequest Object.  Consider upgrading your browser.");return false}}}function genTime(){var f=new Date();var b=f.getHours();var e=f.getMinutes();var g=f.getSeconds();var a="AM";if(b>=12){a="PM"}if(b>12){b=b-12}if(b==0){b=12}if(e<=9){e="0"+e}if(g<=9){g="0"+g}document.getElementById("time_now").value=b+":"+e+" "+a}function setDpart(){if(document.getElementById("txtNights").value<=0){document.getElementById("txtNights").value=1}if(document.getElementById("txtNights").value>31){document.getElementById("txtNights").value=31}if(document.getElementById("txtDateStart").value==""){document.getElementById("txtNights").value=""}else{var g=new Date();var f=g.getFullYear();var q=document.getElementById("txtDateStart").value;var r=document.getElementById("txtNights").value;var e=q.split("-");var m=e[2];var l=e[1];var h=e[0];var p=parseInt((m-0)+(r-0));var o=parseInt(l);var n=parseInt(f);if(l=="01"){if(p>31){p=p-31;o=(o-0)+1}}else{if(l=="02"){if(p>28){p=p-28;o=(o-0)+1}}else{if(l=="03"){if(p>31){p=p-31;o=(o-0)+1}}else{if(l=="04"){if(p>30){p=p-30;o=(o-0)+1}}else{if(l=="05"){if(p>31){p=p-31;o=(o-0)+1}}else{if(l=="06"){if(p>30){p=p-30;o=(o-0)+1}}else{if(l=="07"){if(p>31){p=p-31;o=(o-0)+1}}else{if(l=="08"){if(p>31){p=p-31;o=(o-0)+1}}else{if(l=="09"){if(p>30){p=p-30;o=(o-0)+1}}else{if(l=="10"){if(p>31){p=p-31;o=(o-0)+1}}else{if(l=="11"){if(p>30){p=p-30;o=(o-0)+1}}else{if(l=="12"){if(p>31){p=p-31;o=1;n=n+1}}}}}}}}}}}}}o=(o<10)?"0"+o:o;p=(p<10)?"0"+p:p;document.getElementById("txtDateEnd").value=n+"-"+o+"-"+p}}function setDpart2(){if(document.getElementById("txtDateStart").value!=""){var g=document.getElementById("txtDateStart").value;var e=document.getElementById("txtDateEnd").value;g=g.split("-");e=e.split("-");var f=new Date(g[0]+"/"+g[1]+"/"+g[2]);var b=new Date(e[0]+"/"+e[1]+"/"+e[2]);var a=Math.abs(Math.round((f-b)/86400000));if(a==0){a=1}document.getElementById("txtNights").value=a}else{alert("Select date of arrival first.");document.getElementById("txtDateEnd").value=""}}function adjustDep(){var s=document.getElementById("txtDateStart").value;var r=document.getElementById("txtDateEnd").value;if(r==""){r="0000-00-00"}s=s.split("-");r=r.split("-");var h=s[0]+s[1]+s[2];var q=r[0]+r[1]+r[2];var f=parseInt(h);var e=parseInt(q);if(f>=e){var b=new Date(s[0]+"/"+s[1]+"/"+s[2]);var l=b.valueOf()+(24*60*60*1000);var p=new Date(l);var o=p.toLocaleDateString();var a=new Date(o);var n=a.getDate();var g=a.getMonth()+1;var m=a.getFullYear();g=(g<10)?"0"+g:g;n=(n<10)?"0"+n:n;document.getElementById("txtDateEnd").value=m+"-"+g+"-"+n}}function valGuest(){if(document.getElementById("lname").value==""){alert("All fields with * are required!");document.getElementById("lname").focus();return(false)}else{if(document.getElementById("fname").value==""){alert("All fields with * are required!");document.getElementById("fname").focus();return(false)}else{if(document.getElementById("address").value==""){alert("All fields with * are required!");document.getElementById("address").focus();return(false)}else{if(document.getElementById("city").value==""){alert("All fields with * are required!");document.getElementById("city").focus();return(false)}else{if(document.getElementById("phone").value==""){alert("All fields with * are required!");document.getElementById("phone").focus();return(false)}else{if(document.getElementById("email").value==""){alert("All fields with * are required!");document.getElementById("email").focus();return(false)}else{return(true)}}}}}}}function sendValue(b){var a=useXMLHTTPRequest();if(b!=""){var e="online_hid="+encodeURI(b);if(a){a.onreadystatechange=function(){window.location.href="booking3.php"};a.open("POST","session_maker.php",true);a.setRequestHeader("Content-type","application/x-www-form-urlencoded");a.setRequestHeader("Content-length",e.length);a.setRequestHeader("Connection","close");a.send(e)}}else{alert("Undefined Item.")}}function IsNumeric(b,e){var f="0123456789.";var a;for(i=0;i<b.length;i++){a=b.charAt(i);if(f.indexOf(a)==-1){document.getElementById(e).value=0;setDpart();i=b.length}}IsNumeric2(b,e)}function IsNumeric2(a,b){if(document.getElementById(b).value>31){document.getElementById(b).value=31}}function setListLimit(a){set_cookie("listLimit",a,365);window.location.reload()}function set_cookie(f,h,b,m,g,l){var e=f+"="+escape(h);var a=new Date();b?a.setTime(a.getTime()+((216000*24)*b)):a.setTime(a.getTime()+3600);e+="; expires="+a.toGMTString();if(m){e+="; path="+escape(m)}if(g){e+="; domain="+escape(g)}if(l){e+="; secure"}document.cookie=e}function updateBook(objID,fldNO){var requestSave=useXMLHTTPRequest();var obj=document.getElementById(objID);var mdis=document.getElementById("divButton"+fldNO);var param=submitReq(obj,"Post");if(obj!=null){if(confirm("Are you sure you want to edit this booking? \n\n Would you like to continue?")){mdis.innerHTML='<img src="images/miniloader.gif" border="0" />';if(requestSave){requestSave.onreadystatechange=function(){if(requestSave.readyState==4){if(requestSave.status==200){respData=eval("("+requestSave.responseText+")");alert(respData.error);window.location.reload()}else{alert("Cannot process your request!")}}};requestSave.open("POST","book/updateBook.php",true);requestSave.setRequestHeader("Content-type","application/x-www-form-urlencoded");requestSave.setRequestHeader("Content-length",param.length);requestSave.setRequestHeader("Connection","close");requestSave.send(param)}}}}function submitReq(a,f){var g=a;var b=f;var h="";for(i=0;i<g.elements.length;i++){if(g.elements[i].tagName=="INPUT"){if(g.elements[i].type=="file"){h+=g.elements[i].name+"="+(b=="POST"?encodeURI(g.elements[i].value.replaceAll('"',"''")):g.elements[i].value.replaceAll('"',"''"))+"&"}if(g.elements[i].type=="hidden"){h+=g.elements[i].name+"="+(b=="POST"?encodeURI(g.elements[i].value.replaceAll('"',"''")):g.elements[i].value.replaceAll('"',"''"))+"&"}if(g.elements[i].type=="text"){h+=g.elements[i].name+"="+(b=="POST"?encodeURI(g.elements[i].value.replaceAll('"',"''")):g.elements[i].value.replaceAll('"',"''"))+"&"}if(g.elements[i].type=="password"){h+=g.elements[i].name+"="+(b=="POST"?encodeURI(g.elements[i].value.replaceAll('"',"''")):g.elements[i].value.replaceAll('"',"''"))+"&"}if(g.elements[i].type=="checkbox"){if(g.elements[i].checked){h+=g.elements[i].name+"="+(b=="POST"?encodeURI(g.elements[i].value.replaceAll('"',"''")):g.elements[i].value.replaceAll('"',"''"))+"&"}}if(g.elements[i].type=="radio"){if(g.elements[i].checked){h+=g.elements[i].name+"="+(b=="POST"?encodeURI(g.elements[i].value.replaceAll('"',"''")):g.elements[i].value.replaceAll('"',"''"))+"&"}}}if(g.elements[i].tagName=="TEXTAREA"){h+=g.elements[i].name+"="+(b=="POST"?encodeURI(g.elements[i].value.replaceAll('"',"''")):g.elements[i].value.replaceAll('"',"''"))+"&"}if(g.elements[i].tagName=="SELECT"){var e=g.elements[i];h+=e.name+"="+(b=="POST"?encodeURI(e.options[e.selectedIndex].value.replaceAll('"',"''")):e.options[e.selectedIndex].value.replaceAll('"',"''"))+"&"}}return h}String.prototype.replaceAll=function(e,b){var a=this.indexOf(e);var f=this;while(a>-1){f=f.replace(e,b);a=f.indexOf(e)}return f};function restrictNumeric(b,f){var e=false;var a="0123456789"+(f!=null?f:"");for(c=0;c<=(b.value.length-1);c++){e=false;for(d=0;d<=(a.length-1);d++){if(a.charAt(d)==b.value.charAt(c)){e=true}}if(!e){b.value=b.value.replaceAll(b.value.charAt(c),"")}}}function winStatMsg(a){window.defaultStatus="";window.status=a!=null?a:"";return true}function getAbsoluteX(b){var a=0;if(b&&typeof b.offsetParent!="undefined"){while(b&&typeof b.offsetLeft=="number"){a+=b.offsetLeft;b=b.offsetParent}}return a}function getAbsoluteY(b){var a=0;if(b&&typeof b.offsetParent!="undefined"){while(b&&typeof b.offsetTop=="number"){a+=b.offsetTop;b=b.offsetParent}}return a}function checkBrowser(){var a=navigator.appName;if(a=="Netscape"){this.b="ns"}else{if(a=="Microsoft Internet Explorer"){this.b="ie"}else{this.b=a}}this.v=parseInt(navigator.appVersion);this.ns=(this.b=="ns"&&this.v>=4);this.ns4=(this.b=="ns"&&this.v==4);this.ns5=(this.b=="ns"&&this.v==5);this.ie=(this.b=="ie"&&this.v>=4);this.ie4=(navigator.userAgent.indexOf("MSIE 4")>0);this.ie5=(navigator.userAgent.indexOf("MSIE 5")>0);if(this.ie5){this.v=5}this.min=(this.ns||this.ie)}var is=new checkBrowser();function xy_mouse(g){var a,h;if(parseInt(navigator.appVersion)>3){screenW=parseInt(screen.width);screenH=parseInt(screen.height);a=(is.ns)?g.pageX:event.x+document.body.scrollLeft;h=(is.ns)?g.pageY:event.y+document.body.scrollTop;a=a>(screenW-120)?(a-105):a+5;h=h>(screenH-200)?(h-185):h+5}else{if(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)==3&&navigator.javaEnabled()){var f=java.awt.Toolkit.getDefaultToolkit();var b=f.getScreenSize();screenW=b.width;screenH=b.height;a=(is.ns)?g.pageX:event.x+document.body.scrollLeft;h=(is.ns)?g.pageY:event.y+document.body.scrollTop;a=a>(screenW-120)?(a-105):a+5;h=h>(screenH-200)?(h-185):h+5}}return'{"x": '+a+', "y": '+h+"}"}function textResize(g){var f=document.getElementById(g+"-less");var e=document.getElementById(g+"-more");if(e.style.display=="none"){f.style.display="none";e.style.display="block"}else{f.style.display="block";e.style.display="none"}};
