//MooTools, <http://mootools.net>, My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2008 Valerio Proietti, <http://mad4milk.net>, MIT Style License.

var MooTools={version:"1.2.1",build:"0d4845aab3d9a4fdee2f0d4a6dd59210e4b697cf"};var Native=function(K){K=K||{};var A=K.name;var I=K.legacy;var B=K.protect;
var C=K.implement;var H=K.generics;var F=K.initialize;var G=K.afterImplement||function(){};var D=F||I;H=H!==false;D.constructor=Native;D.$family={name:"native"};
if(I&&F){D.prototype=I.prototype;}D.prototype.constructor=D;if(A){var E=A.toLowerCase();D.prototype.$family={name:E};Native.typize(D,E);}var J=function(N,L,O,M){if(!B||M||!N.prototype[L]){N.prototype[L]=O;
}if(H){Native.genericize(N,L,B);}G.call(N,L,O);return N;};D.alias=function(N,L,O){if(typeof N=="string"){if((N=this.prototype[N])){return J(this,L,N,O);
}}for(var M in N){this.alias(M,N[M],L);}return this;};D.implement=function(M,L,O){if(typeof M=="string"){return J(this,M,L,O);}for(var N in M){J(this,N,M[N],L);
}return this;};if(C){D.implement(C);}return D;};Native.genericize=function(B,C,A){if((!A||!B[C])&&typeof B.prototype[C]=="function"){B[C]=function(){var D=Array.prototype.slice.call(arguments);
return B.prototype[C].apply(D.shift(),D);};}};Native.implement=function(D,C){for(var B=0,A=D.length;B<A;B++){D[B].implement(C);}};Native.typize=function(A,B){if(!A.type){A.type=function(C){return($type(C)===B);
};}};(function(){var A={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var G in A){new Native({name:G,initialize:A[G],protect:true});
}var D={"boolean":Boolean,"native":Native,object:Object};for(var C in D){Native.typize(D[C],C);}var F={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};
for(var E in F){for(var B=F[E].length;B--;){Native.genericize(window[E],F[E][B],true);}}})();var Hash=new Native({name:"Hash",initialize:function(A){if($type(A)=="hash"){A=$unlink(A.getClean());
}for(var B in A){this[B]=A[B];}return this;}});Hash.implement({forEach:function(B,C){for(var A in this){if(this.hasOwnProperty(A)){B.call(C,this[A],A,this);
}}},getClean:function(){var B={};for(var A in this){if(this.hasOwnProperty(A)){B[A]=this[A];}}return B;},getLength:function(){var B=0;for(var A in this){if(this.hasOwnProperty(A)){B++;
}}return B;}});Hash.alias("forEach","each");Array.implement({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this);}}});Array.alias("forEach","each");
function $A(C){if(C.item){var D=[];for(var B=0,A=C.length;B<A;B++){D[B]=C[B];}return D;}return Array.prototype.slice.call(C);}function $arguments(A){return function(){return arguments[A];
};}function $chk(A){return !!(A||A===0);}function $clear(A){clearTimeout(A);clearInterval(A);return null;}function $defined(A){return(A!=undefined);}function $each(C,B,D){var A=$type(C);
((A=="arguments"||A=="collection"||A=="array")?Array:Hash).each(C,B,D);}function $empty(){}function $extend(C,A){for(var B in (A||{})){C[B]=A[B];}return C;
}function $H(A){return new Hash(A);}function $lambda(A){return(typeof A=="function")?A:function(){return A;};}function $merge(){var E={};for(var D=0,A=arguments.length;
D<A;D++){var B=arguments[D];if($type(B)!="object"){continue;}for(var C in B){var G=B[C],F=E[C];E[C]=(F&&$type(G)=="object"&&$type(F)=="object")?$merge(F,G):$unlink(G);
}}return E;}function $pick(){for(var B=0,A=arguments.length;B<A;B++){if(arguments[B]!=undefined){return arguments[B];}}return null;}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B);
}function $splat(B){var A=$type(B);return(A)?((A!="array"&&A!="arguments")?[B]:B):[];}var $time=Date.now||function(){return +new Date;};function $try(){for(var B=0,A=arguments.length;
B<A;B++){try{return arguments[B]();}catch(C){}}return null;}function $type(A){if(A==undefined){return false;}if(A.$family){return(A.$family.name=="number"&&!isFinite(A))?false:A.$family.name;
}if(A.nodeName){switch(A.nodeType){case 1:return"element";case 3:return(/\S/).test(A.nodeValue)?"textnode":"whitespace";}}else{if(typeof A.length=="number"){if(A.callee){return"arguments";
}else{if(A.item){return"collection";}}}}return typeof A;}function $unlink(C){var B;switch($type(C)){case"object":B={};for(var E in C){B[E]=$unlink(C[E]);
}break;case"hash":B=new Hash(C);break;case"array":B=[];for(var D=0,A=C.length;D<A;D++){B[D]=$unlink(C[D]);}break;default:return C;}return B;}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925));
},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?5:4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419);
},gecko:function(){return(document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true;
Browser.detect=function(){for(var B in this.Engines){var A=this.Engines[B]();if(A){this.Engine={name:B,version:A};this.Engine[B]=this.Engine[B+A]=true;
break;}}return{name:B,version:A};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("MSXML2.XMLHTTP");
});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var A=($try(function(){return navigator.plugins["Shockwave Flash"].description;
},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(A[0]||0+"."+A[1]||0),build:parseInt(A[2]||0)};
})();function $exec(B){if(!B){return B;}if(window.execScript){window.execScript(B);}else{var A=document.createElement("script");A.setAttribute("type","text/javascript");
A[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=B;document.head.appendChild(A);document.head.removeChild(A);}return B;}Native.UID=1;
var $uid=(Browser.Engine.trident)?function(A){return(A.uid||(A.uid=[Native.UID++]))[0];}:function(A){return A.uid||(A.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(A){$uid(A);
if(!A.Element){A.Element=$empty;if(Browser.Engine.webkit){A.document.createElement("iframe");}A.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{};
}A.document.window=A;return $extend(A,Window.Prototype);},afterImplement:function(B,A){window[B]=Window.Prototype[B]=A;}});Window.Prototype={$family:{name:"window"}};
new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(A){$uid(A);A.head=A.getElementsByTagName("head")[0];
A.html=A.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){A.execCommand("BackgroundImageCache",false,true);
});}if(Browser.Engine.trident){A.window.attachEvent("onunload",function(){A.window.detachEvent("onunload",arguments.callee);A.head=A.html=A.window=null;
});}return $extend(A,Document.Prototype);},afterImplement:function(B,A){document[B]=Document.Prototype[B]=A;}});Document.Prototype={$family:{name:"document"}};
new Document(document);Array.implement({every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false;}}return true;
},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B]);}}return C;},clean:function(){return this.filter($defined);
},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B;}}return -1;},map:function(D,E){var C=[];
for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this);}return C;},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true;
}}return false;},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A];}return D;},link:function(C){var A={};
for(var E=0,B=this.length;E<B;E++){for(var D in C){if(C[D](this[E])){A[D]=this[E];delete C[D];break;}}}return A;},contains:function(A,B){return this.indexOf(A,B)!=-1;
},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B]);}return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null;
},include:function(A){if(!this.contains(A)){this.push(A);}return this;},combine:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B]);}return this;
},erase:function(B){for(var A=this.length;A--;A){if(this[A]===B){this.splice(A,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var D=[];
for(var B=0,A=this.length;B<A;B++){var C=$type(this[B]);if(!C){continue;}D=D.concat((C=="array"||C=="collection"||C=="arguments")?Array.flatten(this[B]):this[B]);
}return D;},hexToRgb:function(B){if(this.length!=3){return null;}var A=this.map(function(C){if(C.length==1){C+=C;}return C.toInt(16);});return(B)?A:"rgb("+A+")";
},rgbToHex:function(D){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!D){return"transparent";}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);
B.push((C.length==1)?"0"+C:C);}return(D)?B:"#"+B.join("");}});Function.implement({extend:function(A){for(var B in A){this[B]=A[B];}return this;},create:function(B){var A=this;
B=B||{};return function(D){var C=B.arguments;C=(C!=undefined)?$splat(C):Array.slice(arguments,(B.event)?1:0);if(B.event){C=[D||window.event].extend(C);
}var E=function(){return A.apply(B.bind||null,C);};if(B.delay){return setTimeout(E,B.delay);}if(B.periodical){return setInterval(E,B.periodical);}if(B.attempt){return $try(E);
}return E();};},run:function(A,B){return this.apply(B,$splat(A));},pass:function(A,B){return this.create({bind:B,arguments:A});},bind:function(B,A){return this.create({bind:B,arguments:A});
},bindWithEvent:function(B,A){return this.create({bind:B,arguments:A,event:true});},attempt:function(A,B){return this.create({bind:B,arguments:A,attempt:true})();
},delay:function(B,C,A){return this.create({bind:C,arguments:A,delay:B})();},periodical:function(C,B,A){return this.create({bind:B,arguments:A,periodical:C})();
}});Number.implement({limit:function(B,A){return Math.min(A,Math.max(B,this));},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A;},times:function(B,C){for(var A=0;
A<this;A++){B.call(C,A,this);}},toFloat:function(){return parseFloat(this);},toInt:function(A){return parseInt(this,A||10);}});Number.alias("times","each");
(function(B){var A={};B.each(function(C){if(!Number[C]){A[C]=function(){return Math[C].apply(null,[this].concat($A(arguments)));};}});Number.implement(A);
})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(A,B){return((typeof A=="string")?new RegExp(A,B):A).test(this);
},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim();
},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(A){return("-"+A.charAt(0).toLowerCase());
});},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");
},toInt:function(A){return parseInt(this,A||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);
return(A)?A.slice(1).hexToRgb(B):null;},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):null;},stripScripts:function(B){var A="";
var C=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){A+=arguments[1]+"\n";return"";});if(B===true){$exec(A);}else{if($type(B)=="function"){B(A,C);
}}return C;},substitute:function(A,B){return this.replace(B||(/\\?\{([^{}]+)\}/g),function(D,C){if(D.charAt(0)=="\\"){return D.slice(1);}return(A[C]!=undefined)?A[C]:"";
});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(B){for(var A in this){if(this.hasOwnProperty(A)&&this[A]===B){return A;}}return null;
},hasValue:function(A){return(Hash.keyOf(this,A)!==null);},extend:function(A){Hash.each(A,function(C,B){Hash.set(this,B,C);},this);return this;},combine:function(A){Hash.each(A,function(C,B){Hash.include(this,B,C);
},this);return this;},erase:function(A){if(this.hasOwnProperty(A)){delete this[A];}return this;},get:function(A){return(this.hasOwnProperty(A))?this[A]:null;
},set:function(A,B){if(!this[A]||this.hasOwnProperty(A)){this[A]=B;}return this;},empty:function(){Hash.each(this,function(B,A){delete this[A];},this);
return this;},include:function(B,C){var A=this[B];if(A==undefined){this[B]=C;}return this;},map:function(B,C){var A=new Hash;Hash.each(this,function(E,D){A.set(D,B.call(C,E,D,this));
},this);return A;},filter:function(B,C){var A=new Hash;Hash.each(this,function(E,D){if(B.call(C,E,D,this)){A.set(D,E);}},this);return A;},every:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&!B.call(C,this[A],A)){return false;
}}return true;},some:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&B.call(C,this[A],A)){return true;}}return false;},getKeys:function(){var A=[];
Hash.each(this,function(C,B){A.push(B);});return A;},getValues:function(){var A=[];Hash.each(this,function(B){A.push(B);});return A;},toQueryString:function(A){var B=[];
Hash.each(this,function(F,E){if(A){E=A+"["+E+"]";}var D;switch($type(F)){case"object":D=Hash.toQueryString(F,E);break;case"array":var C={};F.each(function(H,G){C[G]=H;
});D=Hash.toQueryString(C,E);break;default:D=E+"="+encodeURIComponent(F);}if(F!=undefined){B.push(D);}});return B.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});
var Event=new Native({name:"Event",initialize:function(A,F){F=F||window;var K=F.document;A=A||F.event;if(A.$extended){return A;}this.$extended=true;var J=A.type;
var G=A.target||A.srcElement;while(G&&G.nodeType==3){G=G.parentNode;}if(J.test(/key/)){var B=A.which||A.keyCode;var M=Event.Keys.keyOf(B);if(J=="keydown"){var D=B-111;
if(D>0&&D<13){M="f"+D;}}M=M||String.fromCharCode(B).toLowerCase();}else{if(J.match(/(click|mouse|menu)/i)){K=(!K.compatMode||K.compatMode=="CSS1Compat")?K.html:K.body;
var I={x:A.pageX||A.clientX+K.scrollLeft,y:A.pageY||A.clientY+K.scrollTop};var C={x:(A.pageX)?A.pageX-F.pageXOffset:A.clientX,y:(A.pageY)?A.pageY-F.pageYOffset:A.clientY};
if(J.match(/DOMMouseScroll|mousewheel/)){var H=(A.wheelDelta)?A.wheelDelta/120:-(A.detail||0)/3;}var E=(A.which==3)||(A.button==2);var L=null;if(J.match(/over|out/)){switch(J){case"mouseover":L=A.relatedTarget||A.fromElement;
break;case"mouseout":L=A.relatedTarget||A.toElement;}if(!(function(){while(L&&L.nodeType==3){L=L.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){L=false;
}}}}return $extend(this,{event:A,type:J,page:I,client:C,rightClick:E,wheel:H,relatedTarget:L,target:G,code:B,key:M,shift:A.shiftKey,control:A.ctrlKey,alt:A.altKey,meta:A.metaKey});
}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault();
},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();
}else{this.event.returnValue=false;}return this;}});var Class=new Native({name:"Class",initialize:function(B){B=B||{};var A=function(){for(var E in this){if($type(this[E])!="function"){this[E]=$unlink(this[E]);
}}this.constructor=A;if(Class.prototyping){return this;}var D=(this.initialize)?this.initialize.apply(this,arguments):this;if(this.options&&this.options.initialize){this.options.initialize.call(this);
}return D;};for(var C in Class.Mutators){if(!B[C]){continue;}B=Class.Mutators[C](B,B[C]);delete B[C];}$extend(A,this);A.constructor=Class;A.prototype=B;
return A;}});Class.Mutators={Extends:function(C,A){Class.prototyping=A.prototype;var B=new A;delete B.parent;B=Class.inherit(B,C);delete Class.prototyping;
return B;},Implements:function(A,B){$splat(B).each(function(C){Class.prototying=C;$extend(A,($type(C)=="class")?new C:C);delete Class.prototyping;});return A;
}};Class.extend({inherit:function(B,E){var A=arguments.callee.caller;for(var D in E){var C=E[D];var G=B[D];var F=$type(C);if(G&&F=="function"){if(C!=G){if(A){C.__parent=G;
B[D]=C;}else{Class.override(B,D,C);}}}else{if(F=="object"){B[D]=$merge(G,C);}else{B[D]=C;}}}if(A){B.parent=function(){return arguments.callee.caller.__parent.apply(this,arguments);
};}return B;},override:function(B,A,E){var D=Class.prototyping;if(D&&B[A]!=D[A]){D=null;}var C=function(){var F=this.parent;this.parent=D?D[A]:B[A];var G=E.apply(this,arguments);
this.parent=F;return G;};B[A]=C;}});Class.implement({implement:function(){var A=this.prototype;$each(arguments,function(B){Class.inherit(A,B);});return this;
}});var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;
},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(C,B,A){C=Events.removeOn(C);if(B!=$empty){this.$events[C]=this.$events[C]||[];
this.$events[C].include(B);if(A){B.internal=true;}}return this;},addEvents:function(A){for(var B in A){this.addEvent(B,A[B]);}return this;},fireEvent:function(C,B,A){C=Events.removeOn(C);
if(!this.$events||!this.$events[C]){return this;}this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})();},this);return this;},removeEvent:function(B,A){B=Events.removeOn(B);
if(!this.$events[B]){return this;}if(!A.internal){this.$events[B].erase(A);}return this;},removeEvents:function(C){if($type(C)=="object"){for(var D in C){this.removeEvent(D,C[D]);
}return this;}if(C){C=Events.removeOn(C);}for(var D in this.$events){if(C&&C!=D){continue;}var B=this.$events[D];for(var A=B.length;A--;A){this.removeEvent(D,B[A]);
}}return this;}});Events.removeOn=function(A){return A.replace(/^on([A-Z])/,function(B,C){return C.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));
if(!this.addEvent){return this;}for(var A in this.options){if($type(this.options[A])!="function"||!(/^on[A-Z]/).test(A)){continue;}this.addEvent(A,this.options[A]);
delete this.options[A];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(A,B){var C=Element.Constructors.get(A);
if(C){return C(B);}if(typeof A=="string"){return document.newElement(A,B);}return $(A).set(B);},afterImplement:function(A,B){Element.Prototype[A]=B;if(Array[A]){return ;
}Elements.implement(A,function(){var C=[],G=true;for(var E=0,D=this.length;E<D;E++){var F=this[E][A].apply(this[E],arguments);C.push(F);if(G){G=($type(F)=="element");
}}return(G)?new Elements(C):C;});}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var E=Array.link(arguments,{properties:Object.type,iframe:$defined});
var C=E.properties||{};var B=$(E.iframe)||false;var D=C.onload||$empty;delete C.onload;C.id=C.name=$pick(C.id,C.name,B.id,B.name,"IFrame_"+$time());B=new Element(B||"iframe",C);
var A=function(){var F=$try(function(){return B.contentWindow.location.host;});if(F&&F==window.location.host){var G=new Window(B.contentWindow);new Document(B.contentWindow.document);
$extend(G.Element.prototype,Element.Prototype);}D.call(B.contentWindow,B.contentWindow.document);};(window.frames[C.id])?A():B.addListener("load",A);return B;
}});var Elements=new Native({initialize:function(F,B){B=$extend({ddup:true,cash:true},B);F=F||[];if(B.ddup||B.cash){var G={},E=[];for(var C=0,A=F.length;
C<A;C++){var D=$.element(F[C],!B.cash);if(B.ddup){if(G[D.uid]){continue;}G[D.uid]=true;}E.push(D);}F=E;}return(B.cash)?$extend(F,this):F;}});Elements.implement({filter:function(A,B){if(!A){return this;
}return new Elements(Array.filter(this,(typeof A=="string")?function(C){return C.match(A);}:A,B));}});Document.implement({newElement:function(A,B){if(Browser.Engine.trident&&B){["name","type","checked"].each(function(C){if(!B[C]){return ;
}A+=" "+C+'="'+B[C]+'"';if(C!="checked"){delete B[C];}});A="<"+A+">";}return $.element(this.createElement(A)).set(B);},newTextNode:function(A){return this.createTextNode(A);
},getDocument:function(){return this;},getWindow:function(){return this.window;}});Window.implement({$:function(B,C){if(B&&B.$family&&B.uid){return B;}var A=$type(B);
return($[A])?$[A](B,C,this.document):null;},$$:function(A){if(arguments.length==1&&typeof A=="string"){return this.document.getElements(A);}var F=[];var C=Array.flatten(arguments);
for(var D=0,B=C.length;D<B;D++){var E=C[D];switch($type(E)){case"element":F.push(E);break;case"string":F.extend(this.document.getElements(E,true));}}return new Elements(F);
},getDocument:function(){return this.document;},getWindow:function(){return this;}});$.string=function(C,B,A){C=A.getElementById(C);return(C)?$.element(C,B):null;
};$.element=function(A,D){$uid(A);if(!D&&!A.$family&&!(/^object|embed$/i).test(A.tagName)){var B=Element.Prototype;for(var C in B){A[C]=B[C];}}return A;
};$.object=function(B,C,A){if(B.toElement){return $.element(B.toElement(A),C);}return null;};$.textnode=$.whitespace=$.window=$.document=$arguments(0);
Native.implement([Element,Document],{getElement:function(A,B){return $(this.getElements(A,true)[0]||null,B);},getElements:function(A,D){A=A.split(",");
var C=[];var B=(A.length>1);A.each(function(E){var F=this.getElementsByTagName(E.trim());(B)?C.extend(F):C=F;},this);return new Elements(C,{ddup:B,cash:!D});
}});(function(){var H={},F={};var I={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};
var C=function(L){return(F[L]||(F[L]={}));};var G=function(N,L){if(!N){return ;}var M=N.uid;if(Browser.Engine.trident){if(N.clearAttributes){var P=L&&N.cloneNode(false);
N.clearAttributes();if(P){N.mergeAttributes(P);}}else{if(N.removeEvents){N.removeEvents();}}if((/object/i).test(N.tagName)){for(var O in N){if(typeof N[O]=="function"){N[O]=$empty;
}}Element.dispose(N);}}if(!M){return ;}H[M]=F[M]=null;};var D=function(){Hash.each(H,G);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(G);
}if(window.CollectGarbage){CollectGarbage();}H=F=null;};var J=function(N,L,S,M,P,R){var O=N[S||L];var Q=[];while(O){if(O.nodeType==1&&(!M||Element.match(O,M))){if(!P){return $(O,R);
}Q.push(O);}O=O[L];}return(P)?new Elements(Q,{ddup:false,cash:!R}):null;};var E={html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};
var B=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var K=["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];
Hash.extend(E,B.associate(B));Hash.extend(E,K.associate(K.map(String.toLowerCase)));var A={before:function(M,L){if(L.parentNode){L.parentNode.insertBefore(M,L);
}},after:function(M,L){if(!L.parentNode){return ;}var N=L.nextSibling;(N)?L.parentNode.insertBefore(M,N):L.parentNode.appendChild(M);},bottom:function(M,L){L.appendChild(M);
},top:function(M,L){var N=L.firstChild;(N)?L.insertBefore(M,N):L.appendChild(M);}};A.inside=A.bottom;Hash.each(A,function(L,M){M=M.capitalize();Element.implement("inject"+M,function(N){L(this,$(N,true));
return this;});Element.implement("grab"+M,function(N){L($(N,true),this);return this;});});Element.implement({set:function(O,M){switch($type(O)){case"object":for(var N in O){this.set(N,O[N]);
}break;case"string":var L=Element.Properties.get(O);(L&&L.set)?L.set.apply(this,Array.slice(arguments,1)):this.setProperty(O,M);}return this;},get:function(M){var L=Element.Properties.get(M);
return(L&&L.get)?L.get.apply(this,Array.slice(arguments,1)):this.getProperty(M);},erase:function(M){var L=Element.Properties.get(M);(L&&L.erase)?L.erase.apply(this):this.removeProperty(M);
return this;},setProperty:function(M,N){var L=E[M];if(N==undefined){return this.removeProperty(M);}if(L&&B[M]){N=!!N;}(L)?this[L]=N:this.setAttribute(M,""+N);
return this;},setProperties:function(L){for(var M in L){this.setProperty(M,L[M]);}return this;},getProperty:function(M){var L=E[M];var N=(L)?this[L]:this.getAttribute(M,2);
return(B[M])?!!N:(L)?N:N||null;},getProperties:function(){var L=$A(arguments);return L.map(this.getProperty,this).associate(L);},removeProperty:function(M){var L=E[M];
(L)?this[L]=(L&&B[M])?false:"":this.removeAttribute(M);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;
},hasClass:function(L){return this.className.contains(L," ");},addClass:function(L){if(!this.hasClass(L)){this.className=(this.className+" "+L).clean();
}return this;},removeClass:function(L){this.className=this.className.replace(new RegExp("(^|\\s)"+L+"(?:\\s|$)"),"$1");return this;},toggleClass:function(L){return this.hasClass(L)?this.removeClass(L):this.addClass(L);
},adopt:function(){Array.flatten(arguments).each(function(L){L=$(L,true);if(L){this.appendChild(L);}},this);return this;},appendText:function(M,L){return this.grab(this.getDocument().newTextNode(M),L);
},grab:function(M,L){A[L||"bottom"]($(M,true),this);return this;},inject:function(M,L){A[L||"bottom"](this,$(M,true));return this;},replaces:function(L){L=$(L,true);
L.parentNode.replaceChild(this,L);return this;},wraps:function(M,L){M=$(M,true);return this.replaces(M).grab(M,L);},getPrevious:function(L,M){return J(this,"previousSibling",null,L,false,M);
},getAllPrevious:function(L,M){return J(this,"previousSibling",null,L,true,M);},getNext:function(L,M){return J(this,"nextSibling",null,L,false,M);},getAllNext:function(L,M){return J(this,"nextSibling",null,L,true,M);
},getFirst:function(L,M){return J(this,"nextSibling","firstChild",L,false,M);},getLast:function(L,M){return J(this,"previousSibling","lastChild",L,false,M);
},getParent:function(L,M){return J(this,"parentNode",null,L,false,M);},getParents:function(L,M){return J(this,"parentNode",null,L,true,M);},getChildren:function(L,M){return J(this,"nextSibling","firstChild",L,true,M);
},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(O,N){var M=this.ownerDocument.getElementById(O);
if(!M){return null;}for(var L=M.parentNode;L!=this;L=L.parentNode){if(!L){return null;}}return $.element(M,N);},getSelected:function(){return new Elements($A(this.options).filter(function(L){return L.selected;
}));},getComputedStyle:function(M){if(this.currentStyle){return this.currentStyle[M.camelCase()];}var L=this.getDocument().defaultView.getComputedStyle(this,null);
return(L)?L.getPropertyValue([M.hyphenate()]):null;},toQueryString:function(){var L=[];this.getElements("input, select, textarea",true).each(function(M){if(!M.name||M.disabled){return ;
}var N=(M.tagName.toLowerCase()=="select")?Element.getSelected(M).map(function(O){return O.value;}):((M.type=="radio"||M.type=="checkbox")&&!M.checked)?null:M.value;
$splat(N).each(function(O){if(typeof O!="undefined"){L.push(M.name+"="+encodeURIComponent(O));}});});return L.join("&");},clone:function(O,L){O=O!==false;
var R=this.cloneNode(O);var N=function(V,U){if(!L){V.removeAttribute("id");}if(Browser.Engine.trident){V.clearAttributes();V.mergeAttributes(U);V.removeAttribute("uid");
if(V.options){var W=V.options,S=U.options;for(var T=W.length;T--;){W[T].selected=S[T].selected;}}}var X=I[U.tagName.toLowerCase()];if(X&&U[X]){V[X]=U[X];
}};if(O){var P=R.getElementsByTagName("*"),Q=this.getElementsByTagName("*");for(var M=P.length;M--;){N(P[M],Q[M]);}}N(R,this);return $(R);},destroy:function(){Element.empty(this);
Element.dispose(this);G(this,true);return null;},empty:function(){$A(this.childNodes).each(function(L){Element.destroy(L);});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;
},hasChild:function(L){L=$(L,true);if(!L){return false;}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(L.tagName)).contains(L);
}return(this.contains)?(this!=L&&this.contains(L)):!!(this.compareDocumentPosition(L)&16);},match:function(L){return(!L||(L==this)||(Element.get(this,"tag")==L));
}});Native.implement([Element,Window,Document],{addListener:function(O,N){if(O=="unload"){var L=N,M=this;N=function(){M.removeListener("unload",N);L();
};}else{H[this.uid]=this;}if(this.addEventListener){this.addEventListener(O,N,false);}else{this.attachEvent("on"+O,N);}return this;},removeListener:function(M,L){if(this.removeEventListener){this.removeEventListener(M,L,false);
}else{this.detachEvent("on"+M,L);}return this;},retrieve:function(M,L){var O=C(this.uid),N=O[M];if(L!=undefined&&N==undefined){N=O[M]=L;}return $pick(N);
},store:function(M,L){var N=C(this.uid);N[M]=L;return this;},eliminate:function(L){var M=C(this.uid);delete M[L];return this;}});window.addListener("unload",D);
})();Element.Properties=new Hash;Element.Properties.style={set:function(A){this.style.cssText=A;},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";
}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};Element.Properties.html=(function(){var C=document.createElement("div");
var A={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};
A.thead=A.tfoot=A.tbody;var B={set:function(){var E=Array.flatten(arguments).join("");var F=Browser.Engine.trident&&A[this.get("tag")];if(F){var G=C;G.innerHTML=F[1]+E+F[2];
for(var D=F[0];D--;){G=G.firstChild;}this.empty().adopt(G.childNodes);}else{this.innerHTML=E;}}};B.erase=B.set;return B;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText;
}var A=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var B=A.innerText;A.destroy();return B;}};}Element.Properties.events={set:function(A){this.addEvents(A);
}};Native.implement([Element,Window,Document],{addEvent:function(E,G){var H=this.retrieve("events",{});H[E]=H[E]||{keys:[],values:[]};if(H[E].keys.contains(G)){return this;
}H[E].keys.push(G);var F=E,A=Element.Events.get(E),C=G,I=this;if(A){if(A.onAdd){A.onAdd.call(this,G);}if(A.condition){C=function(J){if(A.condition.call(this,J)){return G.call(this,J);
}return true;};}F=A.base||F;}var D=function(){return G.call(I);};var B=Element.NativeEvents[F];if(B){if(B==2){D=function(J){J=new Event(J,I.getWindow());
if(C.call(I,J)===false){J.stop();}};}this.addListener(F,D);}H[E].values.push(D);return this;},removeEvent:function(C,B){var A=this.retrieve("events");if(!A||!A[C]){return this;
}var F=A[C].keys.indexOf(B);if(F==-1){return this;}A[C].keys.splice(F,1);var E=A[C].values.splice(F,1)[0];var D=Element.Events.get(C);if(D){if(D.onRemove){D.onRemove.call(this,B);
}C=D.base||C;}return(Element.NativeEvents[C])?this.removeListener(C,E):this;},addEvents:function(A){for(var B in A){this.addEvent(B,A[B]);}return this;
},removeEvents:function(A){if($type(A)=="object"){for(var C in A){this.removeEvent(C,A[C]);}return this;}var B=this.retrieve("events");if(!B){return this;
}if(!A){for(var C in B){this.removeEvents(C);}this.eliminate("events");}else{if(B[A]){while(B[A].keys[0]){this.removeEvent(A,B[A].keys[0]);}B[A]=null;}}return this;
},fireEvent:function(D,B,A){var C=this.retrieve("events");if(!C||!C[D]){return this;}C[D].keys.each(function(E){E.create({bind:this,delay:A,"arguments":B})();
},this);return this;},cloneEvents:function(D,A){D=$(D);var C=D.retrieve("events");if(!C){return this;}if(!A){for(var B in C){this.cloneEvents(D,B);}}else{if(C[A]){C[A].keys.each(function(E){this.addEvent(A,E);
},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};
(function(){var A=function(B){var C=B.relatedTarget;if(C==undefined){return true;}if(C===false){return false;}return($type(this)!="document"&&C!=this&&C.prefix!="xul"&&!this.hasChild(C));
};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:A},mouseleave:{base:"mouseout",condition:A},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}});
})();Element.Properties.styles={set:function(A){this.setStyles(A);}};Element.Properties.opacity={set:function(A,B){if(!B){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden";
}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")";
}this.style.opacity=A;this.store("opacity",A);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(A){return this.set("opacity",A,true);
},getOpacity:function(){return this.get("opacity");},setStyle:function(B,A){switch(B){case"opacity":return this.set("opacity",parseFloat(A));case"float":B=(Browser.Engine.trident)?"styleFloat":"cssFloat";
}B=B.camelCase();if($type(A)!="string"){var C=(Element.Styles.get(B)||"@").split(" ");A=$splat(A).map(function(E,D){if(!C[D]){return"";}return($type(E)=="number")?C[D].replace("@",Math.round(E)):E;
}).join(" ");}else{if(A==String(Number(A))){A=Math.round(A);}}this.style[B]=A;return this;},getStyle:function(G){switch(G){case"opacity":return this.get("opacity");
case"float":G=(Browser.Engine.trident)?"styleFloat":"cssFloat";}G=G.camelCase();var A=this.style[G];if(!$chk(A)){A=[];for(var F in Element.ShortStyles){if(G!=F){continue;
}for(var E in Element.ShortStyles[F]){A.push(this.getStyle(E));}return A.join(" ");}A=this.getComputedStyle(G);}if(A){A=String(A);var C=A.match(/rgba?\([\d\s,]+\)/);
if(C){A=A.replace(C[0],C[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(A)))){if(G.test(/^(height|width)$/)){var B=(G=="width")?["left","right"]:["top","bottom"],D=0;
B.each(function(H){D+=this.getStyle("border-"+H+"-width").toInt()+this.getStyle("padding-"+H).toInt();},this);return this["offset"+G.capitalize()]-D+"px";
}if((Browser.Engine.presto)&&String(A).test("px")){return A;}if(G.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return A;},setStyles:function(B){for(var A in B){this.setStyle(A,B[A]);
}return this;},getStyles:function(){var A={};Array.each(arguments,function(B){A[B]=this.getStyle(B);},this);return A;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});
Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(G){var F=Element.ShortStyles;
var B=Element.Styles;["margin","padding"].each(function(H){var I=H+G;F[H][I]=B[I]="@px";});var E="border"+G;F.border[E]=B[E]="@px @ rgb(@, @, @)";var D=E+"Width",A=E+"Style",C=E+"Color";
F[E]={};F.borderWidth[D]=F[E][D]=B[D]="@px";F.borderStyle[A]=F[E][A]=B[A]="@";F.borderColor[C]=F[E][C]=B[C]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(H,I){if(B(this)){this.getWindow().scrollTo(H,I);
}else{this.scrollLeft=H;this.scrollTop=I;}return this;},getSize:function(){if(B(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight};
},getScrollSize:function(){if(B(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(B(this)){return this.getWindow().getScroll();
}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var I=this,H={x:0,y:0};while(I&&!B(I)){H.x+=I.scrollLeft;H.y+=I.scrollTop;I=I.parentNode;
}return H;},getOffsetParent:function(){var H=this;if(B(H)){return null;}if(!Browser.Engine.trident){return H.offsetParent;}while((H=H.parentNode)&&!B(H)){if(D(H,"position")!="static"){return H;
}}return null;},getOffsets:function(){if(Browser.Engine.trident){var L=this.getBoundingClientRect(),J=this.getDocument().documentElement;return{x:L.left+J.scrollLeft-J.clientLeft,y:L.top+J.scrollTop-J.clientTop};
}var I=this,H={x:0,y:0};if(B(this)){return H;}while(I&&!B(I)){H.x+=I.offsetLeft;H.y+=I.offsetTop;if(Browser.Engine.gecko){if(!F(I)){H.x+=C(I);H.y+=G(I);
}var K=I.parentNode;if(K&&D(K,"overflow")!="visible"){H.x+=C(K);H.y+=G(K);}}else{if(I!=this&&Browser.Engine.webkit){H.x+=C(I);H.y+=G(I);}}I=I.offsetParent;
}if(Browser.Engine.gecko&&!F(this)){H.x-=C(this);H.y-=G(this);}return H;},getPosition:function(K){if(B(this)){return{x:0,y:0};}var L=this.getOffsets(),I=this.getScrolls();
var H={x:L.x-I.x,y:L.y-I.y};var J=(K&&(K=$(K)))?K.getPosition():{x:0,y:0};return{x:H.x-J.x,y:H.y-J.y};},getCoordinates:function(J){if(B(this)){return this.getWindow().getCoordinates();
}var H=this.getPosition(J),I=this.getSize();var K={left:H.x,top:H.y,width:I.x,height:I.y};K.right=K.left+K.width;K.bottom=K.top+K.height;return K;},computePosition:function(H){return{left:H.x-E(this,"margin-left"),top:H.y-E(this,"margin-top")};
},position:function(H){return this.setStyles(this.computePosition(H));}});Native.implement([Document,Window],{getSize:function(){var I=this.getWindow();
if(Browser.Engine.presto||Browser.Engine.webkit){return{x:I.innerWidth,y:I.innerHeight};}var H=A(this);return{x:H.clientWidth,y:H.clientHeight};},getScroll:function(){var I=this.getWindow();
var H=A(this);return{x:I.pageXOffset||H.scrollLeft,y:I.pageYOffset||H.scrollTop};},getScrollSize:function(){var I=A(this);var H=this.getSize();return{x:Math.max(I.scrollWidth,H.x),y:Math.max(I.scrollHeight,H.y)};
},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var H=this.getSize();return{top:0,left:0,bottom:H.y,right:H.x,height:H.y,width:H.x};
}});var D=Element.getComputedStyle;function E(H,I){return D(H,I).toInt()||0;}function F(H){return D(H,"-moz-box-sizing")=="border-box";}function G(H){return E(H,"border-top-width");
}function C(H){return E(H,"border-left-width");}function B(H){return(/^(?:body|html)$/i).test(H.tagName);}function A(H){var I=H.getDocument();return(!I.compatMode||I.compatMode=="CSS1Compat")?I.html:I.body;
}})();Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;
},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;
},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});Native.implement([Document,Element],{getElements:function(H,G){H=H.split(",");
var C,E={};for(var D=0,B=H.length;D<B;D++){var A=H[D],F=Selectors.Utils.search(this,A,E);if(D!=0&&F.item){F=$A(F);}C=(D==0)?F:(C.item)?$A(C).concat(F):C.concat(F);
}return new Elements(C,{ddup:(H.length>1),cash:!G});}});Element.implement({match:function(B){if(!B||(B==this)){return true;}var D=Selectors.Utils.parseTagAndID(B);
var A=D[0],E=D[1];if(!Selectors.Filters.byID(this,E)||!Selectors.Filters.byTag(this,A)){return false;}var C=Selectors.Utils.parseSelector(B);return(C)?Selectors.Utils.filter(this,C,{}):true;
}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};
Selectors.Utils={chk:function(B,C){if(!C){return true;}var A=$uid(B);if(!C[A]){return C[A]=true;}return false;},parseNthArgument:function(F){if(Selectors.Cache.nth[F]){return Selectors.Cache.nth[F];
}var C=F.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!C){return false;}var E=parseInt(C[1]);var B=(E||E===0)?E:1;var D=C[2]||false;var A=parseInt(C[3])||0;
if(B!=0){A--;while(A<1){A+=B;}while(A>=B){A-=B;}}else{B=A;D="index";}switch(D){case"n":C={a:B,b:A,special:"n"};break;case"odd":C={a:2,b:0,special:"n"};
break;case"even":C={a:2,b:1,special:"n"};break;case"first":C={a:0,special:"index"};break;case"last":C={special:"last-child"};break;case"only":C={special:"only-child"};
break;default:C={a:(B-1),special:"index"};}return Selectors.Cache.nth[F]=C;},parseSelector:function(E){if(Selectors.Cache.parsed[E]){return Selectors.Cache.parsed[E];
}var D,H={classes:[],pseudos:[],attributes:[]};while((D=Selectors.RegExps.combined.exec(E))){var I=D[1],G=D[2],F=D[3],B=D[5],C=D[6],J=D[7];if(I){H.classes.push(I);
}else{if(C){var A=Selectors.Pseudo.get(C);if(A){H.pseudos.push({parser:A,argument:J});}else{H.attributes.push({name:C,operator:"=",value:J});}}else{if(G){H.attributes.push({name:G,operator:F,value:B});
}}}}if(!H.classes.length){delete H.classes;}if(!H.attributes.length){delete H.attributes;}if(!H.pseudos.length){delete H.pseudos;}if(!H.classes&&!H.attributes&&!H.pseudos){H=null;
}return Selectors.Cache.parsed[E]=H;},parseTagAndID:function(B){var A=B.match(Selectors.RegExps.tag);var C=B.match(Selectors.RegExps.id);return[(A)?A[1]:"*",(C)?C[1]:false];
},filter:function(F,C,E){var D;if(C.classes){for(D=C.classes.length;D--;D){var G=C.classes[D];if(!Selectors.Filters.byClass(F,G)){return false;}}}if(C.attributes){for(D=C.attributes.length;
D--;D){var B=C.attributes[D];if(!Selectors.Filters.byAttribute(F,B.name,B.operator,B.value)){return false;}}}if(C.pseudos){for(D=C.pseudos.length;D--;D){var A=C.pseudos[D];
if(!Selectors.Filters.byPseudo(F,A.parser,A.argument,E)){return false;}}}return true;},getByTagAndID:function(B,A,D){if(D){var C=(B.getElementById)?B.getElementById(D,true):Element.getElementById(B,D,true);
return(C&&Selectors.Filters.byTag(C,A))?[C]:[];}else{return B.getElementsByTagName(A);}},search:function(I,H,N){var B=[];var C=H.trim().replace(Selectors.RegExps.splitter,function(Y,X,W){B.push(X);
return":)"+W;}).split(":)");var J,E,U;for(var T=0,P=C.length;T<P;T++){var S=C[T];if(T==0&&Selectors.RegExps.quick.test(S)){J=I.getElementsByTagName(S);
continue;}var A=B[T-1];var K=Selectors.Utils.parseTagAndID(S);var V=K[0],L=K[1];if(T==0){J=Selectors.Utils.getByTagAndID(I,V,L);}else{var D={},G=[];for(var R=0,Q=J.length;
R<Q;R++){G=Selectors.Getters[A](G,J[R],V,L,D);}J=G;}var F=Selectors.Utils.parseSelector(S);if(F){E=[];for(var O=0,M=J.length;O<M;O++){U=J[O];if(Selectors.Utils.filter(U,F,N)){E.push(U);
}}J=E;}}return J;}};Selectors.Getters={" ":function(H,G,I,A,E){var D=Selectors.Utils.getByTagAndID(G,I,A);for(var C=0,B=D.length;C<B;C++){var F=D[C];if(Selectors.Utils.chk(F,E)){H.push(F);
}}return H;},">":function(H,G,I,A,F){var C=Selectors.Utils.getByTagAndID(G,I,A);for(var E=0,D=C.length;E<D;E++){var B=C[E];if(B.parentNode==G&&Selectors.Utils.chk(B,F)){H.push(B);
}}return H;},"+":function(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(Selectors.Utils.chk(B,D)&&Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B);
}break;}}return C;},"~":function(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(!Selectors.Utils.chk(B,D)){break;}if(Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B);
}}}return C;}};Selectors.Filters={byTag:function(B,A){return(A=="*"||(B.tagName&&B.tagName.toLowerCase()==A));},byID:function(A,B){return(!B||(A.id&&A.id==B));
},byClass:function(B,A){return(B.className&&B.className.contains(A," "));},byPseudo:function(A,D,C,B){return D.call(A,C,B);},byAttribute:function(C,D,B,E){var A=Element.prototype.getProperty.call(C,D);
if(!A){return(B=="!=");}if(!B||E==undefined){return true;}switch(B){case"=":return(A==E);case"*=":return(A.contains(E));case"^=":return(A.substr(0,E.length)==E);
case"$=":return(A.substr(A.length-E.length)==E);case"!=":return(A!=E);case"~=":return A.contains(E," ");case"|=":return A.contains(E,"-");}return false;
}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return !(this.innerText||this.textContent||"").length;},not:function(A){return !Element.match(this,A);
},contains:function(A){return(this.innerText||this.textContent||"").contains(A);},"first-child":function(){return Selectors.Pseudo.index.call(this,0);},"last-child":function(){var A=this;
while((A=A.nextSibling)){if(A.nodeType==1){return false;}}return true;},"only-child":function(){var B=this;while((B=B.previousSibling)){if(B.nodeType==1){return false;
}}var A=this;while((A=A.nextSibling)){if(A.nodeType==1){return false;}}return true;},"nth-child":function(G,E){G=(G==undefined)?"n":G;var C=Selectors.Utils.parseNthArgument(G);
if(C.special!="n"){return Selectors.Pseudo[C.special].call(this,C.a,E);}var F=0;E.positions=E.positions||{};var D=$uid(this);if(!E.positions[D]){var B=this;
while((B=B.previousSibling)){if(B.nodeType!=1){continue;}F++;var A=E.positions[$uid(B)];if(A!=undefined){F=A+F;break;}}E.positions[D]=F;}return(E.positions[D]%C.a==C.b);
},index:function(A){var B=this,C=0;while((B=B.previousSibling)){if(B.nodeType==1&&++C>A){return false;}}return(C==A);},even:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n+1",A);
},odd:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n",A);}});Element.Events.domready={onAdd:function(A){if(Browser.loaded){A.call(this);
}}};(function(){var B=function(){if(Browser.loaded){return ;}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready");};if(Browser.Engine.trident){var A=document.createElement("div");
(function(){($try(function(){A.doScroll("left");return $(A).inject(document.body).set("html","temp").dispose();}))?B():arguments.callee.delay(50);})();
}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?B():arguments.callee.delay(50);
})();}else{window.addEvent("load",B);document.addEvent("DOMContentLoaded",B);}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(A){return JSON.$specialChars[A]||"\\u00"+Math.floor(A.charCodeAt()/16).toString(16)+(A.charCodeAt()%16).toString(16);
},encode:function(B){switch($type(B)){case"string":return'"'+B.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(B.map(JSON.encode).filter($defined))+"]";
case"object":case"hash":var A=[];Hash.each(B,function(E,D){var C=JSON.encode(E);if(C){A.push(JSON.encode(D)+":"+C);}});return"{"+A+"}";case"number":case"boolean":return String(B);
case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null;
}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(B,A){this.key=B;
this.setOptions(A);},write:function(B){B=encodeURIComponent(B);if(this.options.domain){B+="; domain="+this.options.domain;}if(this.options.path){B+="; path="+this.options.path;
}if(this.options.duration){var A=new Date();A.setTime(A.getTime()+this.options.duration*24*60*60*1000);B+="; expires="+A.toGMTString();}if(this.options.secure){B+="; secure";
}this.options.document.cookie=this.key+"="+B;return this;},read:function(){var A=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");
return(A)?decodeURIComponent(A[1]):null;},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this;}});Cookie.write=function(B,C,A){return new Cookie(B,A).write(C);
};Cookie.read=function(A){return new Cookie(A).read();};Cookie.dispose=function(B,A){return new Cookie(B,A).dispose();};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(A){this.subject=this.subject||this;
this.setOptions(A);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var B=this.options.wait;if(B===false){this.options.link="cancel";
}},getTransition:function(){return function(A){return -(Math.cos(Math.PI*A)-1)/2;};},step:function(){var A=$time();if(A<this.time+this.options.duration){var B=this.transition((A-this.time)/this.options.duration);
this.set(this.compute(this.from,this.to,B));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(A){return A;},compute:function(C,B,A){return Fx.compute(C,B,A);
},check:function(A){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(A.bind(this,Array.slice(arguments,1)));
return false;}return false;},start:function(B,A){if(!this.check(arguments.callee,B,A)){return this;}this.from=B;this.to=A;this.time=0;this.transition=this.getTransition();
this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer()){this.onComplete();}return this;},cancel:function(){if(this.stopTimer()){this.onCancel();
}return this;},onStart:function(){this.fireEvent("start",this.subject);},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject);
}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer();
return this;},stopTimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer){return false;
}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(C,B,A){return(B-C)*A+C;
};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(D,E,B){B=$splat(B);var C=B[1];if(!$chk(C)){B[1]=B[0];
B[0]=D.getStyle(E);}var A=B.map(this.parse);return{from:A[0],to:A[1]};},parse:function(A){A=$lambda(A)();A=(typeof A=="string")?A.split(" "):$splat(A);
return A.map(function(C){C=String(C);var B=false;Fx.CSS.Parsers.each(function(F,E){if(B){return ;}var D=F.parse(C);if($chk(D)){B={value:D,parser:F};}});
B=B||{value:C,parser:Fx.CSS.Parsers.String};return B;});},compute:function(D,C,B){var A=[];(Math.min(D.length,C.length)).times(function(E){A.push({value:D[E].parser.compute(D[E].value,C[E].value,B),parser:D[E].parser});
});A.$family={name:"fx:css:value"};return A;},serve:function(C,B){if($type(C)!="fx:css:value"){C=this.parse(C);}var A=[];C.each(function(D){A=A.concat(D.parser.serve(D.value,B));
});return A;},render:function(A,D,C,B){A.setStyle(D,this.serve(C,B));},search:function(A){if(Fx.CSS.Cache[A]){return Fx.CSS.Cache[A];}var B={};Array.each(document.styleSheets,function(E,D){var C=E.href;
if(C&&C.contains("://")&&!C.contains(document.domain)){return ;}var F=E.rules||E.cssRules;Array.each(F,function(I,G){if(!I.style){return ;}var H=(I.selectorText)?I.selectorText.replace(/^\w+/,function(J){return J.toLowerCase();
}):null;if(!H||!H.test("^"+A+"$")){return ;}Element.Styles.each(function(K,J){if(!I.style[J]||Element.ShortStyles[J]){return ;}K=String(I.style[J]);B[J]=(K.test(/^rgb/))?K.rgbToHex():K;
});});});return Fx.CSS.Cache[A]=B;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(A){if(A.match(/^#[0-9a-f]{3,6}$/i)){return A.hexToRgb(true);
}return((A=A.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[A[1],A[2],A[3]]:false;},compute:function(C,B,A){return C.map(function(E,D){return Math.round(Fx.compute(C[D],B[D],A));
});},serve:function(A){return A.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(B,A){return(A)?B+A:B;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});
Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);},set:function(B,A){if(arguments.length==1){A=B;
B=this.property||this.options.property;}this.render(this.element,B,A,this.options.unit);return this;},start:function(C,E,D){if(!this.check(arguments.callee,C,E,D)){return this;
}var B=Array.flatten(arguments);this.property=this.options.property||B.shift();var A=this.prepare(this.element,this.property,B);return this.parent(A.from,A.to);
}});Element.Properties.tween={set:function(A){var B=this.retrieve("tween");if(B){B.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},A));
},get:function(A){if(A||!this.retrieve("tween")){if(A||!this.retrieve("tween:options")){this.set("tween",A);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")));
}return this.retrieve("tween");}};Element.implement({tween:function(A,C,B){this.get("tween").start(arguments);return this;},fade:function(C){var E=this.get("tween"),D="opacity",A;
C=$pick(C,"toggle");switch(C){case"in":E.start(D,1);break;case"out":E.start(D,0);break;case"show":E.set(D,1);break;case"hide":E.set(D,0);break;case"toggle":var B=this.retrieve("fade:flag",this.get("opacity")==1);
E.start(D,(B)?0:1);this.store("fade:flag",!B);A=true;break;default:E.start(D,arguments);}if(!A){this.eliminate("fade:flag");}return this;},highlight:function(C,A){if(!A){A=this.retrieve("highlight:original",this.getStyle("background-color"));
A=(A=="transparent")?"#fff":A;}var B=this.get("tween");B.start("background-color",C||"#ffff88",A).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));
B.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);},set:function(A){if(typeof A=="string"){A=this.search(A);
}for(var B in A){this.render(this.element,B,A[B],this.options.unit);}return this;},compute:function(E,D,C){var A={};for(var B in E){A[B]=this.parent(E[B],D[B],C);
}return A;},start:function(B){if(!this.check(arguments.callee,B)){return this;}if(typeof B=="string"){B=this.search(B);}var E={},D={};for(var C in B){var A=this.prepare(this.element,C,B[C]);
E[C]=A.from;D[C]=A.to;}return this.parent(E,D);}});Element.Properties.morph={set:function(A){var B=this.retrieve("morph");if(B){B.cancel();}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},A));
},get:function(A){if(A||!this.retrieve("morph")){if(A||!this.retrieve("morph:options")){this.set("morph",A);}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));
}return this.retrieve("morph");}};Element.implement({morph:function(A){this.get("morph").start(A);return this;}});Fx.implement({getTransition:function(){var A=this.options.transition||Fx.Transitions.Sine.easeInOut;
if(typeof A=="string"){var B=A.split(":");A=Fx.Transitions;A=A[B[0]]||A[B[0].capitalize()];if(B[1]){A=A["ease"+B[1].capitalize()+(B[2]?B[2].capitalize():"")];
}}return A;}});Fx.Transition=function(B,A){A=$splat(A);return $extend(B,{easeIn:function(C){return B(C,A);},easeOut:function(C){return 1-B(1-C,A);},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2;
}});};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[B]=new Fx.Transition(A[B]);}};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6);
},Expo:function(A){return Math.pow(2,8*(A-1));},Circ:function(A){return 1-Math.sin(Math.acos(A));},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2);
},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A);},Bounce:function(D){var C;for(var B=0,A=1;1;B+=A,A/=2){if(D>=(7-4*B)/11){C=A*A-Math.pow((11-6*B-11*D)/4,2);
break;}}return C;},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2]);
});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false},initialize:function(A){this.xhr=new Browser.Request();
this.setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return ;
}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};
this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}this.xhr.onreadystatechange=$empty;},isSuccess:function(){return((this.status>=200)&&(this.status<300));
},processScripts:function(A){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(A);}return A.stripScripts(this.options.evalScripts);
},success:function(B,A){this.onSuccess(this.processScripts(B),A);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();
},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(A,B){this.headers.set(A,B);
return this;},getHeader:function(A){return $try(function(){return this.xhr.getResponseHeader(A);}.bind(this));},check:function(A){if(!this.running){return true;
}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(A.bind(this,Array.slice(arguments,1)));return false;}return false;
},send:function(I){if(!this.check(arguments.callee,I)){return this;}this.running=true;var G=$type(I);if(G=="string"||G=="element"){I={data:I};}var D=this.options;
I=$extend({data:D.data,url:D.url,method:D.method},I);var E=I.data,B=I.url,A=I.method;switch($type(E)){case"element":E=$(E).toQueryString();break;case"object":case"hash":E=Hash.toQueryString(E);
}if(this.options.format){var H="format="+this.options.format;E=(E)?H+"&"+E:H;}if(this.options.emulation&&["put","delete"].contains(A)){var F="_method="+A;
E=(E)?F+"&"+E:F;A="post";}if(this.options.urlEncoded&&A=="post"){var C=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+C);
}if(E&&A=="get"){B=B+(B.contains("?")?"&":"?")+E;E=null;}this.xhr.open(A.toUpperCase(),B,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);
this.headers.each(function(K,J){try{this.xhr.setRequestHeader(J,K);}catch(L){this.fireEvent("exception",[J,K]);}},this);this.fireEvent("request");this.xhr.send(E);
if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this;}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;
this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var A={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(B){A[B]=function(){var C=Array.link(arguments,{url:String.type,data:$defined});
return this.send($extend(C,{method:B.toLowerCase()}));};});Request.implement(A);})();Element.Properties.send={set:function(A){var B=this.retrieve("send");
if(B){B.cancel();}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},A));
},get:function(A){if(A||!this.retrieve("send")){if(A||!this.retrieve("send:options")){this.set("send",A);}this.store("send",new Request(this.retrieve("send:options")));
}return this.retrieve("send");}};Element.implement({send:function(A){var B=this.get("send");B.send({data:this,url:A||B.options.url});return this;}});Request.HTML=new Class({Extends:Request,options:{update:false,evalScripts:true,filter:false},processHTML:function(C){var B=C.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
C=(B)?B[1]:C;var A=new Element("div");return $try(function(){var D="<root>"+C+"</root>",G;if(Browser.Engine.trident){G=new ActiveXObject("Microsoft.XMLDOM");
G.async=false;G.loadXML(D);}else{G=new DOMParser().parseFromString(D,"text/xml");}D=G.getElementsByTagName("root")[0];for(var F=0,E=D.childNodes.length;
F<E;F++){var H=Element.clone(D.childNodes[F],true,true);if(H){A.grab(H);}}return A;})||A.set("html",C);},success:function(D){var C=this.options,B=this.response;
B.html=D.stripScripts(function(E){B.javascript=E;});var A=this.processHTML(B.html);B.tree=A.childNodes;B.elements=A.getElements("*");if(C.filter){B.tree=B.elements.filter(C.filter);
}if(C.update){$(C.update).empty().set("html",B.html);}if(C.evalScripts){$exec(B.javascript);}this.onSuccess(B.tree,B.elements,B.html,B.javascript);}});
Element.Properties.load={set:function(A){var B=this.retrieve("load");if(B){B.cancel();}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},A));
},get:function(A){if(A||!this.retrieve("load")){if(A||!this.retrieve("load:options")){this.set("load",A);}this.store("load",new Request.HTML(this.retrieve("load:options")));
}return this.retrieve("load");}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this;
}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(A){this.parent(A);this.headers.extend({Accept:"application/json","X-Request":"JSON"});
},success:function(A){this.response.json=JSON.decode(A,this.options.secure);this.onSuccess(this.response.json,A);}});//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2008 Valerio Proietti, <http://mad4milk.net>, MIT Style License.

Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(B,A){this.elements=this.subject=$$(B);this.parent(A);},compute:function(G,H,I){var C={};for(var D in G){var A=G[D],E=H[D],F=C[D]={};
for(var B in A){F[B]=this.parent(A[B],E[B],I);}}return C;},set:function(B){for(var C in B){var A=B[C];for(var D in A){this.render(this.elements[C],D,A[D],this.options.unit);
}}return this;},start:function(C){if(!this.check(arguments.callee,C)){return this;}var H={},I={};for(var D in C){var F=C[D],A=H[D]={},G=I[D]={};for(var B in F){var E=this.prepare(this.elements[D],B,F[B]);
A[B]=E.from;G[B]=E.to;}}return this.parent(H,I);}});var Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});
this.parent(C.elements,C.options);this.togglers=$$(C.togglers);this.container=$(C.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true;
}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}if(this.options.start){this.options.display=false;this.options.show=false;
}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity";}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth";
}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight";}for(var B=0,A=this.togglers.length;B<A;B++){this.addSection(this.togglers[B],this.elements[B]);
}this.elements.each(function(E,D){if(this.options.show===D){this.fireEvent("active",[this.togglers[D],E]);}else{for(var F in this.effects){E.setStyle(F,0);
}}},this);if($chk(this.options.display)){this.display(this.options.display);}},addSection:function(E,C,G){E=$(E);C=$(C);var F=this.togglers.contains(E);
var B=this.togglers.length;this.togglers.include(E);this.elements.include(C);if(B&&(!F||G)){G=$pick(G,B-1);E.inject(this.togglers[G],"before");C.inject(E,"after");
}else{if(this.container&&!F){E.inject(this.container);C.inject(this.container);}}var A=this.togglers.indexOf(E);E.addEvent("click",this.display.bind(this,A));
if(this.options.height){C.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"});}if(this.options.width){C.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"});
}C.fullOpacity=1;if(this.options.fixedWidth){C.fullWidth=this.options.fixedWidth;}if(this.options.fixedHeight){C.fullHeight=this.options.fixedHeight;}C.setStyle("overflow","hidden");
if(!F){for(var D in this.effects){C.setStyle(D,0);}}return this;},display:function(A){A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this;
}this.previous=A;var B={};this.elements.each(function(E,D){B[D]={};var C=(D!=A)||(this.options.alwaysHide&&(E.offsetHeight>0));this.fireEvent(C?"background":"active",[this.togglers[D],E]);
for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]];}},this);return this.start(B);}});(function(){var a={};var b=(window.navigator.userAgent.indexOf("MSIE")>0);var c=(window.navigator.userAgent.indexOf("MSIE 7")>0);window['CQS']=a;window['isIE']=b;window['isIE7']=c;})();CQS.Common=new function(){var _i=null;this.redirectTo=function(a){window.location.href=a;};this.reloadPage=function(){document.location.reload(true);};this.addEvent=function(b,d,f){try{b.addEventListener(d,f,false);}catch(e){b.attachEvent('on'+d,f);}};this.removeEvent=function(b,d,f){try{b.removeEventListener(d,f,false);}catch(e){b.detachEvent('on'+d,f);}};this.getClientWidth=function(){if(typeof(window.innerWidth)=='number'){if(this.getWindowHeight()<this.getPageHeightWithScroll())return window.innerWidth-23;else return window.innerWidth;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return document.documentElement.clientWidth;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){return document.body.clientWidth;}};this.getClientHeight=function(g){if(_i==null){_i=document.createElement("div");document.body.appendChild(_i);}var _j=parseInt(this.getPageY(_i))+15;if(_j<this.getWindowHeight()){_j=this.getWindowHeight();}return _j;};this.getWindowHeight=function(){if(typeof(window.innerWidth)=='number'){return window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){return document.body.clientHeight;}};this.getPageHeightWithScroll=function(){if(window.innerHeight&&window.scrollMaxY){return window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){return document.body.scrollHeight;}else{return document.body.offsetHeight;}};this.getPageWidthWithScroll=function(){if(window.innerWidth&&window.scrollMaxX){return window.innerWidth+window.scrollMaxX;}else if(document.body.scrollWidth>document.body.offsetWidth){return document.body.scrollWidth;}else{return document.body.offsetWidth;}};this.getScrollX=function(){if(!isIE){return window.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft;}else if(document.body){return document.body.scrollLeft;}}return 0;};this.getScrollY=function(){if(!isIE){return window.pageYOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop;}else if(document.body){return document.body.scrollTop;}}return 0;};this.getPageX=function(e){var x=0;while(e){if(this.isDefined(e.offsetLeft))x+=e.offsetLeft;e=this.isDefined(e.offsetParent)?e.offsetParent:null;}return x;};this.getPageY=function(e){var y=0;while(e){if(this.isDefined(e.offsetTop))y+=e.offsetTop;e=this.isDefined(e.offsetParent)?e.offsetParent:null;}return y;};this.isDefined=function(){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])=='undefined')return false;}return true;};this.setOpacity=function(h,j){try{j=(j==100)?99.999:j;h.style.filter="alpha(opacity:"+j+")";h.style.KHTMLOpacity=j/100;h.style.MozOpacity=j/100;h.style.j=j/100;}catch(e){}};this.innerHTML=function(k){return document.getElementById(k).innerHTML;};this.showBrowserOfflineMessage=function(){alert("Your browser is currently in offline mode. Please set your browser to run in online mode. This page will now be refreshed.");};if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};};if(!String.prototype.ltrim){String.prototype.ltrim=function(){return this.replace(/^\s+/,"");};};if(!String.prototype.rtrim){String.prototype.rtrim=function(){return this.replace(/\s+$/,"");};};if(!String.prototype.removeAllWhitespace){String.prototype.removeAllWhitespace=function(){return this.replace(/\s+/g,'');};};this.getPreviousSibling=function(l){while(l!=null){if(l.previousSibling)l=l.previousSibling;else l=null;if(l){if(l.nodeType==1)break;}}return l;};this.getNextSibling=function(l){while(l!=null){if(l.nextSibling)l=l.nextSibling;else l=null;if(l){if(l.nodeType==1)break;}}return l;};this.getElementWithId=function(m,k){var _k=null;var _l=m.getElementsByTagName("\x2a");var _m=_l.length;for(var _n=0;_n<_m;_n++){var l=_l[_n];if(!l.id)continue;if(l.id+""==k+""){_k=l;break;}}return _k;};this.getElementEndingWithId=function(n,o){var _k=null;var _l=n.getElementsByTagName("\x2a");var _m=_l.length;for(var _n=0;_n<_m;_n++){var l=_l[_n];if(!l.id)continue;var _o=(l.id+"");if(_o.indexOf(o)>=0){_o=_o.substring(_o.indexOf(o),_o.length);if((_o.length==o.length)&&(_o.indexOf(o)>=0)){_k=l;break;}}}return _k;};this.getElementsEndingWithId=function(n,o,p){var _p=new Array();var _l;if(p){_l=n.getElementsByTagName(p);}else{_l=n.getElementsByTagName("\x2a");}var _m=_l.length;for(var _n=0;_n<_m;_n++){var l=_l[_n];if(!l.id)continue;var _o=(l.id+"");if(_o.indexOf(o)>=0){_o=_o.substring(_o.indexOf(o),_o.length);if((_o.length==o.length)&&(_o.indexOf(o)>=0)){_p[_p.length]=l;continue;}}}return _p;};this.getElementsEndingWithId=function(n,o){var _p=new Array();var _l=n.getElementsByTagName("\x2a");var _m=_l.length;for(var _n=0;_n<_m;_n++){var l=_l[_n];if(!l.id)continue;var _o=(l.id+"");if(_o.indexOf(o)>=0){_o=_o.substring(_o.indexOf(o),_o.length);if((_o.length==o.length)&&(_o.indexOf(o)>=0)){_p[_p.length]=l;continue;}}}return _p;};this.getElementWithIdContaining=function(n,o){var _k=null;var _l=n.getElementsByTagName("\x2a");var _m=_l.length;for(var _n=0;_n<_m;_n++){var l=_l[_n];if(!l.id)continue;if((l.id+"").indexOf(o)>=0){_k=l;break;}}return _k;};this.getElementsWithIdContaining=function(n,o,p){var _p=new Array();var _l;if(p){_l=n.getElementsByTagName(p);}else{_l=n.getElementsByTagName("\x2a");}var _m=_l.length;for(var _n=0;_n<_m;_n++){var l=_l[_n];if(!l.id)continue;if((l.id+"").indexOf(o)>=0){_p[_p.length]=l;continue;}}return _p;};this.getElementsWithNameContaining=function(n,q){var _p=new Array();var _l=n.getElementsByTagName("\x2a");var _m=_l.length;for(var _n=0;_n<_m;_n++){var l=_l[_n];if(!l.name)continue;if((l.name+"").indexOf(q)>=0){_p[_p.length]=l;continue;}}return _p;};this.getElementsWithContainingAttribute=function(n,r,s){var _p=new Array();var _l=n.getElementsByTagName("\x2a");var _m=_l.length;for(var _n=0;_n<_m;_n++){var l=_l[_n];if(CQS.Common.elementHasAttribute(l,r)){if(CQS.Common.elementGetAttribute(l,r)==s){_p[_p.length]=l;}}}return _p;};this.dateIsValid=function(t,u,v){var _q=new Date();_q.setFullYear(v,u-1,t);if(((_q.getMonth()+1)+'')!=(u+'')){return false;}else{return true;}};this.elementHasAttribute=function(w,z){if(this.isDefined(w)&&this.isDefined(z)){var _r=w.getAttribute(z);return(_r!=null&&_r.length>0)?true:false;}return false;};this.elementGetAttribute=function(w,z){if(this.elementHasAttribute(w,z)){return w.getAttribute(z);}return"";};this.elementSetAttribute=function(w,_a,_b){if(this.elementHasAttribute(w,_a)){w.setAttribute(_a,_b);}else{eval("document.getElementById('"+w.id+"')."+_a+" = '"+_b+"'");}};this.removeAllChildNodes=function(l){try{if(l&&l.hasChildNodes&&l.removeChild){while(l.hasChildNodes()){l.removeChild(l.firstChild);}}}catch(e){}};this.removeChildNode=function(parentNode,_c){try{if(parentNode&&parentNode.hasChildNodes&&parentNode.removeChild){parentNode.removeChild(_c);}}catch(e){}};this.appendChildNode=function(parentNode,_d){try{if(parentNode&&parentNode.appendChild){parentNode.appendChild(_d);}}catch(e){}};this.onFAQSearchBlur=function(_e){var b=$defined(_e.target)?$(_e.target):$(_e.srcElement);var _s=b.get('value');if(_s==''){b.set('value',getCMSFAQContent());}};this.onFAQSearchFocus=function(_e){var b=$defined(_e.target)?$(_e.target):$(_e.srcElement);b.set('value','');};this.createCookie=function(_f,_g,_h){if(_h){var _t=new Date();_t.setTime(_t.getTime()+(_h*24*60*60*1000));var _u="; expires="+_t.toGMTString();}else var _u="";document.cookie=_f+"="+_g+_u+"; path=/";};this.readCookie=function(_f){var _v=_f+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(_v)==0)return c.substring(_v.length,c.length);}return null;};this.eraseCookie=function(_f){CQS.Common.createCookie(_f,'',-1);};}();CQS.AT=new function(){this.MessageBox=new function(){var z;var r;var _a;var _b=-1;var _c;var _d=false;var _e=false;var _f=false;this.init=function(a){z=new CQS.Popup(460,180,a,true);};this.setupLoadingBoxAndShow=function(b,c,d,e,f,g,h,j){ShowWaitingScreen(e,j);if(d.length>0){if(typeof(LogAnalyticsMessageView)!='undefined'){LogAnalyticsMessageView(d);}}else{if(typeof(LogAnalyticsMessageView)!='undefined'){LogAnalyticsMessageView(e);}}if(_f&&_d){if(typeof(AnalyticsLoadingBoxEnd)!='undefined'){AnalyticsLoadingBoxEnd(_e);}_d=false;_f=false;}if(typeof(AnalyticsLoadingBoxStart)!='undefined'){_d=true;_f=true;_e=e;AnalyticsLoadingBoxStart(_e);}};this.setupMessageBoxAndShow=function(b,c,d,e,k,l,m,n,o,f,g,h,p,q){if(z){if(z.frame){var _g=z.frame.contentWindow.YT_SetMessagePropertiesAndShow;if(_g){CQS.Block.setup(undefined,50);if(c<180){c=180;}var s=null
r=460;_a=c;_c=p;z.frame.contentWindow.YT_SetMessagePropertiesAndShow(r,c,d,e,k,l,m,n,o,f,g,h,p,s,q);if(d.length>0){if(typeof(LogAnalyticsMessageView)!='undefined'){LogAnalyticsMessageView(d);}}else{if(typeof(LogAnalyticsMessageView)!='undefined'){LogAnalyticsMessageView(e);}}if(_f&&_d){if(typeof(AnalyticsLoadingBoxEnd)!='undefined'){AnalyticsLoadingBoxEnd(_e);}_d=false;_f=false;}}}}};this.showMessageBox=function(){HideWaitingScreen(false);CQS.Block.setup(undefined,50);z.showCenter(undefined,r,_a);z.frame.focus();};this.cancelLoadingBox=function(){_c="";CQS.Callback.abortAllCallbacks();HideWaitingScreen(true);};this.requestMessageBoxHide=function(){if(z.frame.contentWindow.HideMessageBox){z.frame.contentWindow.HideMessageBox();}else{this.hideMessageBox(-1);}};this.messageBoxOnUnload=function(){if(_f&&_d){if(typeof(AnalyticsLoadingBoxEnd)!='undefined'){AnalyticsLoadingBoxEnd(_e);}_d=false;_f=false;}};this.hideMessageBox=function(t,q){if(t>=0){_b=t;}else{_b=-1;}z.hide(q);if(t==-1&&_f&&_d){if(typeof(AnalyticsLoadingBoxEnd)!='undefined'){AnalyticsLoadingBoxEnd(_e);}_d=false;_f=false;}if(_c!=undefined){if(_c.length>0){eval(_c+"('"+_b+"')");}}CQS.CursorAnimation.StopAnimation();};};this.ValidationMessage=new function(){var _h="ValidationInputError";var _i="ValidationSelectError";var _j="ValidationSetError";this.init=function(){CQS.Notify.create("INPUT",_h,8,8);CQS.Notify.create("SELECT",_i,8,8);CQS.Notify.create("DIV",_j,8,8,true);};this.show=function(u,v,w){CQS.Notify.show(_h,u,"",v,w);};this.hide=function(u){CQS.Notify.hide(_h,u);};this.showSelect=function(u,v){CQS.Notify.show(_i,u,"",v);};this.hideSelect=function(u){CQS.Notify.hide(_i,u);};this.showSet=function(u,v,w){CQS.Notify.show(_j,u,"",v,w);};this.hideSet=function(u){CQS.Notify.hide(_j,u);};this.hideAll=function(){CQS.Notify.hideAll();};this.redraw=function(){CQS.Notify.redraw();};};this.FAQ=new function(){var _k=null;var _l=730;var _m=505;var _n=function(){if(_k.style.display=="block"){_k.style.top=(CQS.Common.getScrollY()+(CQS.Common.getWindowHeight()/2))-(_m/2)+"px";_k.style.left=CQS.Common.getScrollX()+(CQS.Common.getClientWidth()/2)-(_l/2)+"px";}};this.init=function(){_k=CQS.Common.getElementEndingWithId(document,"ifFAQ");this.frame=_k;};this.show=function(){_k.style.top=(CQS.Common.getScrollY()+(CQS.Common.getWindowHeight()/2))-(_m/2)+"px";_k.style.left=CQS.Common.getScrollX()+(CQS.Common.getClientWidth()/2)-(_l/2)+"px";CQS.Block.setup(undefined,50);CQS.Block.show();_k.width=_l+"px";_k.height=_m+"px";_k.style.position="absolute";_k.style.display="block";CQS.Common.addEvent(window,'resize',function(){_n();});CQS.Common.addEvent(window,'scroll',function(){_n();});};this.hide=function(){_k.style.display="none";CQS.Common.removeEvent(window,'resize',function(){_n();});CQS.Common.removeEvent(window,'scroll',function(){_n();});CQS.Block.hide();};this.frame=_k;};}();CQS.Common.addEvent(window,'load',function(){CQS.AT.ValidationMessage.init();});CQS.Common.addEvent(window,'resize',function(){CQS.AT.ValidationMessage.redraw();});function ValidateBrowserOnline(){if(BrowserDetect.browser==='Safari'||BrowserDetect.browser==='Chrome'){return true;}if(navigator){if(typeof(navigator.onLine)==='undefined'){return true;}if(!navigator.onLine){CQS.Common.showBrowserOfflineMessage();CQS.Common.reloadPage();return false;}}return true;}this.BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(x){for(var i=0;i<x.length;i++){var y=x[i].string;var _o=x[i].prop;this.versionSearchString=x[i].versionSearch||x[i].identity;if(y){if(y.indexOf(x[i].subString)!=-1)return x[i].identity;}else if(_o)return x[i].identity;}},searchVersion:function(y){var _p=y.indexOf(this.versionSearchString);if(_p==-1)return;return parseFloat(y.substring(_p+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();function PleaseLoad(){};window.addEvent('ondomready',function(){var _q=document.getElementsByTagName('a');for(var _r=0;_r<_q.length;_r++){if(!_q[_r].href||_q[_r].href.length===0||_q[_r].href.contains('#')){_q[_r].href='javascript:PleaseLoad();';}}});CQS.Block=new function(){this.init=function(){Madurodam.Block.init();};this.setup=function(a,b){if($defined(b)){b=b/100;}Madurodam.Block.setup(b);};this.show=function(c){Madurodam.Block.show(0.5);};this.redraw=function(){Madurodam.Block.redraw();};this.hide=function(){Madurodam.Block.hide();};this.isVisible=function(){return Madurodam.Block.isVisible();};}();CQS.Popup=function(a,b,c){var h=new Madurodam.Popup(a,b,{URL:c,blockBackground:true});this.showCenter=function(d,e,f){if($defined(d)){d=d/100;}h.showCenter(d,e,f);};this.hide=function(g){h.hide(!g);};this.frame=h.frame;};this.allAirtradeCalendars=new Array();function HideAllAirtradeCalendars(){for(var _i=0;_i<allAirtradeCalendars.length;_i++){if(allAirtradeCalendars[_i].isVisible()){allAirtradeCalendars[_i].hide();}}};function AtLeastOneAirtradeCalendarIsVisible(){for(var _i=0;_i<allAirtradeCalendars.length;_i++){if(allAirtradeCalendars[_i].isVisible()){return true;}}return false;};function RemoveAllAirtradeCalendars(){for(var _i=allAirtradeCalendars.length-1;_i>=0;_i--){allAirtradeCalendars[_i].removeResizeEvent();allAirtradeCalendars[_i]=null;}allAirtradeCalendars.length=0;};AirtradeCalendar=function(a,b,c,d,e,f,g,h,k){var _j=0;var _k=1;var _l=1;var _m=new Date();var _n=new Date();var _o=new Date(_m);_o.setDate(1);var _p=new Date(_m);_p.setFullYear(_p.getFullYear()+1,_p.getMonth(),1);_p.setDate(_p.getDate()-1);var _q=a;var _r=b;var _s=new Date(parseDate(c));var _t=new Date(parseDate(d));var w=new Date(parseDate(e));var _u=eval(f);var _v=false;var _w=$(g);var _x=h;var _y=k;if(_x==2){_l=0;}var _z=0;var _aa=22;var _ab=0;var _ac=0;setPosition();validateVariables();this.show=function(){try{_am(w);_v=true;showCalendar(_v);}catch(u){_ak(u);}};this.hide=function(){try{_v=false;showCalendar(_v);}catch(u){_ak(u);}};this.reset=function(l,m,o,p){try{_s=new Date(parseDate(l));_t=new Date(parseDate(m));w=new Date(parseDate(o));_y=p;validateVariables();_am(w);}catch(u){_ak(u);}};this.redraw=function(){try{validateVariables();_am(w);}catch(u){_ak(u);}};this.getSelectedDate=function(){return w;};this.setSelectedDate=function(o){w=o;};this.isVisible=function(){return _v;};this.removeResizeEvent=function(){CQS.Common.removeEvent(window,'resize',eval(_q+".resizeHandler"));};this.resizeHandler=function(){setPosition();if(_v){_an(w);}};function setPosition(){_ab=CQS.Common.getPageX(_w)+_z;_ac=CQS.Common.getPageY(_w)+_aa;};function showCalendar(q){var _ad=q?'':'none';var _ae=q?'block':'none';setPosition();$("divAirtradeCalendar"+_q).style.top=_ac+"px";$("divAirtradeCalendar"+_q).style.left=_ab+"px";$("displaymonth_"+_q).style.display=_ad;$("displayDates_"+_q).style.display=_ad;if(_x==1){$("displaySelectedDate_"+_q).style.display=_ad;}$("divAirtradeCalendar"+_q).style.display=_ad;if((!window.XMLHttpRequest)&&(_x==1)){if(!AtLeastOneAirtradeCalendarIsVisible()||q){$("ifCalBlock").style.top=_ac+"px";$("ifCalBlock").style.left=_ab+"px";$("ifCalBlock").style.width=$("divAirtradeCalendar"+_q).offsetWidth+"px";$("ifCalBlock").style.height=$("divAirtradeCalendar"+_q).offsetHeight+"px";$("ifCalBlock").style.display=_ae;}}};function parseDate(r){if(r.length!=8){throw("["+r+"] not a valid length of 8");}var _af=new Date();var _f=r.substring(0,4);var y=r.substring(4,6)-1;var _a=r.substring(6,8);_af.setFullYear(_f,y,_a);var _ag=getYYYYMMDD(_af);if(_ag!=r){throw("["+r+"] turned into ["+_ag+"], perhaps it has some strange values");}return _af;};function getYYYYMMDD(s){var _ah=s.getFullYear();var _ai=s.getMonth()+1;var _aj=s.getDate();var _ag=_ah+((_ai<=9)?"0"+_ai:_ai+"")+((_aj<=9)?"0"+_aj:_aj+"");return _ag;};function validateVariables(){if(_t<_s){throw("enabledToDate["+_t.toDateString()+"] before enabledFromDate["+_s.toDateString()+"]");}if(w<_s){w=_s;}return true;};var _ak=function(u){alert("ERROR: \n"+u);};var _al=function(){try{if(_u!=""){_u(_q,w);}}catch(u){_ak(u);}};var _am=function(v){_n=new Date(v);_firstday=new Date(_n);_firstday.setDate(1);_firstday.setDate(1-(7+_firstday.getDay()-_k)%7);_firstday.setHours(0,0,0,0);_an(w);};var _an=function(w){var monthdata=(_x==2?"":_ar());var _ao=(_x==2?_ba():_ay());var _ap=new Date(w);var _aq=false;_ap=_ap.getDate()+" "+_bd(_ap.getMonth(),_aq)+" "+_ap.getFullYear();setPosition();$("divAirtradeCalendar"+_q).style.top=_ac+"px";$("divAirtradeCalendar"+_q).style.left=_ab+"px";$("displaymonth_"+_q).innerHTML=monthdata;$("displayDates_"+_q).innerHTML=_ao;if(_x==1){$("displaySelectedDate_"+_q).innerHTML=_ap;}if((!window.XMLHttpRequest)&&(_x==1)){$("ifCalBlock").style.top=_ac+"px";$("ifCalBlock").style.left=_ab+"px";$("ifCalBlock").style.width=$("divAirtradeCalendar"+_q).offsetWidth;$("ifCalBlock").style.height=$("divAirtradeCalendar"+_q).offsetHeight;}};var _ar=function(){var startmonth=_m.getMonth();var _as=_m.getFullYear();var _at=0;var _au=new Array();var _av=new Array();for(var i=0;i<12;i++){_au[i]=startmonth++;_av[i]=_as;if(startmonth>=12){startmonth=startmonth-12;if(_at==0){_as=_as+1;_at++;}}}var _ao="<table class='cal-m'><tr>";var _aw=_n.getMonth();var _aq=false;for(var j=0;j<12;j++){var _ax=(_au[j]==_aw?'class="selected"':'');_ao+='<td '+_ax+'>';_ao+='<a href="javascript:'+_q+'.changeMonth(\''+_au[j]+'\',\''+_av[j]+'\')">'+_bd(_au[j],_aq)+'</a>';_ao+='</td>';if(j==5){_ao+="</tr><tr>";}}_ao+="</tr></table>";return _ao;};var _ay=function(){var _ao='';var _az=true;_ao+=_bc(_n,_az);_ao+=_cb(_n);return _ao;};var _ba=function(){var _ao='';var _az=false;_ao+="<table><tr>";_ao+="<td>";_ao+="<a href=javascript:"+_q+".changeDate('prev_month')><b class='cal-nav-arrow-left'>&nbsp;</b></a>";_ao+="</td>";var _bb=new Date(_n);_bb.setDate(1);for(var tlr=0;tlr<3;tlr++){_ao+='<td valign="top">';_ao+=_bc(_bb,_az);_ao+=_cb(_bb);_ao+="</td>";_bb.setMonth(_bb.getMonth()+1);}_ao+="<td>";_ao+="<a href=javascript:"+_q+".changeDate('next_month')><b class='cal-nav-arrow-right'>&nbsp;</b></a>";_ao+="</td>";_ao+="</tr></table>";return _ao;};var _bc=function(s,x){var _ao='';var _aq=true;_ao+="<table class='cal-nav'><tr>";_ao+="<td>";if(x){_ao+="<a href=javascript:"+_q+".changeDate('prev_month')><b class='cal-nav-arrow-left'>&nbsp;</b></a>";}_ao+=_bd(s.getMonth(),_aq)+' '+s.getFullYear();if(x){_ao+="<a href=javascript:"+_q+".changeDate('next_month')><b class='cal-nav-arrow-right'>&nbsp;</b></a>";}_ao+="</td>";_ao+="</tr></table>";return _ao;};this.getMonthName=function(y,z){return _bd(y,z);};var _bd=function(y,z){var months_1031=new Array("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");var _be=new Array("Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez");var _bf=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var _bg=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var _bh=new Array("Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December");var _bi=new Array("Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec");var _bj=_bh;var _bk=_bi;var _bl=new Array("Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre");var _bm=new Array("Janv.","Févr.","Mars","Avr.","Mai","Juin","Juill.","Août","Sept.","Oct.","Nov.","Déc.");var _bn=_bl;var _bo=_bm;var _bp="";switch(_r){case"1031":_bp=months_1031[y];break;case"1033":_bp=_bf[y];break;case"1043":_bp=_bh[y];break;case"2067":_bp=_bj[y];break;case"1036":_bp=_bl[y];break;case"2060":_bp=_bn[y];break;default:_bp=_bf[y];}if(!z){if(_bp!='undefined'){switch(_r){case"1031":_bp=_be[y];break;case"1033":_bp=_bg[y];break;case"1043":_bp=_bi[y];break;case"2067":_bp=_bk[y];break;case"1036":_bp=_bm[y];break;case"2060":_bp=_bo[y];break;default:_bp=_bg[y];break;}}}return _bp;};var _bq=function(_a,z){var days_1031=new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");var _br=new Array("So","Mo","Di","Mi","Do","Fr","Sa");var _bs=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");var _bt=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");var _bu=new Array("Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag");var _bv=new Array("Zo","Ma","Di","Wo","Do","Vr","Za");var _bw=_bu;var _bx=_bv;var _by=new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");var _bz=new Array("Dim","Lun","Mar","Mer","Jeu","Ven","Sam");var _ca=_by;var _ca=_bz;var _bp="";switch(_r){case"1031":_bp=days_1031[_a];break;case"1033":_bp=_bs[_a];break;case"1043":_bp=_bu[_a];break;case"2067":_bp=_bw[_a];break;case"1036":_bp=_by[_a];break;case"2060":_bp=_ca[_a];break;default:_bp=_bs[_a];}if(!z){switch(_r){case"1031":_bp=_br[_a];break;case"1033":_bp=_bt[_a];break;case"1043":_bp=_bv[_a];break;case"2067":_bp=_bx[_a];break;case"1036":_bp=_bz[_a];break;case"2060":_bp=days_short_2060[_a];break;default:_bp=_br[_a];break;}}return _bp;};var _cb=function(s){var _ao='';var _cc=false;_ao+="<table class='cal-d'>";for(var n=0;n<7;n++){_ao+="<th scope='col' width=30>"+_bq((_k+n)%7,_cc)+"</th>";}var _cd=new Date(s);_cd.setDate(1);_cd.setDate(1-(7+_cd.getDay()-_k)%7);_cd.setHours(0,0,0,0);var _ce=new Date(_cd);_s.setHours(0,0,0,0);_t.setHours(0,0,0,0);var _cf=0;while(_ce.getMonth()==s.getMonth()||_ce.getMonth()==_cd.getMonth()){_ao+='<tr>';for(var _cg=0;_cg<7;_cg++){_ao+="<td>";_ao+=_ch(_ce,s);_ao+="</td>";_ce.setDate(_ce.getDate()+1);}_ao+='</tr>';_cf++;}if((h==2)&&(_cf<6)){_ao+='<tr><td style="line-height: 22px;">&nbsp;</td></tr>';}_ao+="</table>";return _ao;};var _ch=function(_b,s){if((_b>=_s)&&(_b<=_t)){return _ck(_b,s);}else{return _ci(_b,s);}};var _ci=function(_b,s){var _c="n-a";if(_b.toDateString()==_m.toDateString()){_c+=" today";}if(_b.getMonth()!=s.getMonth()){_c+=' o-m';}var _cj=false;return _cl(_b,_c,_cj);};var _ck=function(_b,s){var _c="";var _cj=true;if((_b.toDateString()==_m.toDateString())&&(_b.getMonth()==s.getMonth())){_c+=" today";}if(_y!=null&&_y!="undefined"){if(_cm(_b)){_c+=" available";}else{_c+=" n-a";_cj=false;}}if((_b.toDateString()==w.toDateString())&&(_b.getMonth()==s.getMonth())){_c+=" selected";}if(_b.getMonth()!=s.getMonth()){_c='o-m';}return _cl(_b,_c,_cj);};var _cl=function(_b,_c,_d){var _ao="";if(_d){_ao+="<a ";if(h==1){_ao+="onmouseover='javascript:"+_q+".onDateHover("+_b.getTime()+")'";}_ao+=" href='javascript:"+_q+".setSelectedDate("+_b.getTime()+")' class='"+_c+"' >";_ao+=_b.getDate();_ao+="</a>";}else{_ao+="<a href='javascript:void(0)' class='"+_c+"' >";_ao+=_b.getDate();_ao+="</a>";}return _ao;};var _cm=function(_b){var t=0;var _cn=false;while(t<_y.length){if(_y[t]==getYYYYMMDD(_b)){_cn=true;break;}t++;}return _cn;};this.changeMonth=function(_e,_f){_am(new Date(_f,_e,1));};this.setSelectedDate=function(_g){w=new Date(_g);_al();if(_l){this.hide();}else{_an(w);}};this.onDateHover=function(_g){var _ap=new Date(_g);var _aq=false;_ap=_ap.getDate()+" "+_bd(_ap.getMonth(),_aq)+" "+_ap.getFullYear();if(_x==1){$("displaySelectedDate_"+_q).innerHTML=_ap;}};this.changeDate=function(_h){var _co=new Date(_n);if(_h=="next_month"){_co.setMonth(_co.getMonth()+1);}if(_h=="prev_month"){_co.setMonth(_co.getMonth()-1);}if(_j){alert('startCalendar: '+_o.toDateString()+'\nendCalendar: '+_p.toDateString()+'\nchangedDate: '+_co.toDateString());}if((_co>=_o)&&(_co<=_p)){_am(_co);}};};CQS.Callback=new function(){this.doAsynchronousCallBack=function(a,b,d){if(!ValidateBrowserOnline()){return false;}this.Ajax.doAsynchronousCallBack(a,b,d,AjaxCallbackURL());};this.doAsyncCallback=function(a,f,g){if(!ValidateBrowserOnline()){return false;}var v='';var w=0;if(f.constructor==Array){if(f.length>0){for(w=0;w<f.length;w++){v+=f[w]+'##';}}}this.Ajax.doAsynchronousCallBack(a,v+'<?xml version="1.0" ?>'+this.getAllInputElementsAsXML(g),true,AjaxCallbackURL());};this.getAllInputElementsAsXML=function(h){var s='';var c;var x,y;var z;s='<form>';x=h.getElementsByTagName('INPUT');if(x.length>0){s+='<input>';for(z=0;z<x.length;z++){c=x[z];if(c.type=='radio'||c.type=='checkbox'){if(c.checked)s+='<field id="'+c.id+'" value="true"/>';else s+='<field id="'+c.id+'" value="false"/>';}else s+='<field id="'+c.id+'" value="'+c.value+'"/>';}s+='</input>';}y=h.getElementsByTagName('SELECT');if(y.length>0){s+='<select>';for(z=0;z<y.length;z++){c=y[z];s+='<field id="'+c.id+'" value="'+c.value+'"/>';}s+='</select>';}s+='</form>';return s;};this.abortAllCallbacks=function(){this.Ajax.abortAllCallbacks();};this.reloadUpdatePanel=function(a,b,j,d){if(!ValidateBrowserOnline()){return false;}this.Ajax.reloadUpdatePanel(a,b,j,d,AjaxCallbackURL());};this.doCallbackAndReloadUpdatePanel=function(a,b,j,k,l,d){this.reloadUpdatePanel(a,'DoCallback,'+a+','+b+',UPC,'+k+','+l,j,d);};this.doCallbackAndReloadMainContent=function(a,b,d){if(CQS_GetContentUpdatePanelID&&CQS_GetContentUpdatePanelCallbackID&&CQS_GetContentUpdatePanelCallbackArgs){this.doCallbackAndReloadUpdatePanel(a,b,CQS_GetContentUpdatePanelID(),CQS_GetContentUpdatePanelCallbackID(),CQS_GetContentUpdatePanelCallbackArgs(),d);}};this.Ajax=new function(){var _a=new Array();var _b=new Array();this.doAsynchronousCallBack=function(a,b,d,m){var _c="__EVENTTARGET=&"+"__CALLBACKID=__Page"+"&hidvsid="+document.getElementById('hidvsid').value+"&__CALLBACKPARAM="+_o(a,b,d,false);var _d=_n();var _e=new Object();_e.eventCallback=_v;_e.context=a;_e.errorCallback=_w;_e.async=true;_l(_a,_e);_d.onreadystatechange=_g;_e.xmlRequest=_d;if(CQS.Common.isDefined(m))_d.open("POST",m,true);else _d.open("POST",window.document.forms[0].action,true);_d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");_d.send(_c);};this.reloadUpdatePanel=function(a,b,j,d,m){var _c="__EVENTTARGET=&"+"__CALLBACKID=__Page"+"&hidvsid="+document.getElementById('hidvsid').value+"&__CALLBACKPARAM="+_o(a,b,d,true);var _d=_n();var _e=new Object();_e.eventCallback=_x;_e.context=a+','+j;_e.errorCallback=_af;_e.async=true;_l(_b,_e);_d.onreadystatechange=_g;_e.xmlRequest=_d;if(CQS.Common.isDefined(m))_d.open("POST",m,true);else _d.open("POST",window.document.forms[0].action,true);_d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");_d.send(_c);};this.pushToDifferentPage=function(a,b,m,d){var _c="__EVENTTARGET=&__CALLBACKID=__Page&__CALLBACKPARAM="+_o(a,b,d,false);var _d=_n();_d.open("POST",m,true);_d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");_d.send(_c);_d=null;};this.abortAllCallbacks=function(){var _f=_a.length;var ii=_f;while(ii-->0){if(_a[ii]!=null&&_a[ii]!=undefined){_a[ii].xmlRequest.abort();}}_a.length=0;var ii=_b.length;while(ii-->0){if(_b[ii]!=null&&_b[ii]!=undefined){_b[ii].xmlRequest.abort();}}_b.length=0;};this.isCallbackComplete=function(a){var _f=_a.length;var ii=_f;while(ii-->0){if(_a[ii]!=null&&_a[ii]!=undefined){if(_a[ii].context.indexOf(a)>-1){return'false';}}}return'true';};var _g=function(){for(i=0;i<_a.length;i++){n=_a[i];if(n&&n.xmlRequest&&(n.xmlRequest.readyState==4)){_a[i]=null;_h(n);return;}}for(i=0;i<_b.length;i++){n=_b[i];if(n&&n.xmlRequest&&(n.xmlRequest.readyState==4)){_b[i]=null;_h(n);return;}}};var _h=function(n){var response=n.xmlRequest.responseText;if(response.charAt(0)=="s"){if((typeof(n.eventCallback)!="undefined")&&(n.eventCallback!=null))n.eventCallback(response.substring(1),n.context);}else if(response.charAt(0)=="e"){if((typeof(n.errorCallback)!="undefined")&&(n.errorCallback!=null))n.errorCallback(response.substring(1),n.context);}else{var _i=response.indexOf("|");if(_i!=-1){var _j=parseInt(response.substring(0,_i));if(!isNaN(_j)){var _k=response.substring(_i+1,_i+_j+1);if((typeof(n.eventCallback)!="undefined")&&(n.eventCallback!=null)){n.eventCallback(response.substring(_i+_j+1),n.context);}}}}};var _l=function(o,p){var i;for(i=0;i<o.length;i++){if(!o[i])break;}o[i]=p;return i;};var _m=function(q){if(encodeURIComponent){return encodeURIComponent(q);}else{return escape(q);}};var _n=function(){var _d,e;try{_d=new XMLHttpRequest();}catch(e){try{_d=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}return _d;};var _o=function(a,b,d,r){var callBackStr="";if(CQS.Common.isDefined(a)&&CQS.Common.isDefined(b)){if(a.length>0||b.length>0){if(CQS.Common.isDefined(d)&&d==true){if((b+"").indexOf("DoCallback")>=0)callBackStr=b+"";else callBackStr=a+"##"+b;if(r)callBackStr=callBackStr+"ISUPC";}else{if((b+"").indexOf("DoCallback")>=0)callBackStr=b+"";else callBackStr=a+","+b;if(r)callBackStr=callBackStr+"ISUPC";}callBackStr=_m(callBackStr);}}return callBackStr;};var _p=function(t){var resEndIdx=t.indexOf("___");var _q=resEndIdx+3;var _r=t.length;var _s=t.substring(0,resEndIdx);var js=t.substring(_q,_r);if(js.length>0){eval(js);}return _s;};var _t=function(t){return t.substring(0,t.indexOf("___"));};var _u=function(t){var _q=t.indexOf("___")+3;var _r=t.length;return t.substring(_q,_r);};var _v=function(u,a){u=_p(u);if(u.indexOf("__Error")>=0){_w(u.substring(7,u.length),a);u="";return;}if(typeof(CQS_OnCompleteAsynch)!='undefined')CQS_OnCompleteAsynch(u,a);};var _w=function(u,a){if(typeof(CQS_OnErrorAsynch)!='undefined'){CQS_OnErrorAsynch(u,a);}};var _x=function(u,a){var responseJS=_u(u);u=_t(u);if(window.location.href.contains('Finalize.aspx')){while(u.contains("background-image: url('../../images/empty.gif');")){u=u.replace("background-image: url('../../images/empty.gif');","");}}var _y=a.indexOf(",");var _z=a.substring(_y+1,a.length);a=a.substring(0,_y);if(u.indexOf("__Error")>=0){_af(u.substring(7,u.length),a);u="";return;}var _aa=document.getElementById(_z);var _ab=document.createElement("div");_ab.style.display="none";_ab.innerHTML=u;var _ac=CQS.Common.getElementWithId(_ab,_z);var _ad=_aa.parentNode;if(_ac==null)return;if(_ad==null)return;_ac.parentNode.removeChild(_ac);var _ae=CQS.Common.getNextSibling(_aa);if(_ae!=null)_ad.insertBefore(_ac,_ae);else _ad.appendChild(_ac);_ad.removeChild(_aa);_ab=null;if(responseJS!=null&&responseJS.length>0){eval(responseJS);}setTimeout('RedrawFooter();',200);if(typeof(CQS_OnCompleteReloadUpdatePanel)!='undefined'){CQS_OnCompleteReloadUpdatePanel(a);}window.fireEvent('updatepanelcomplete',a);};var _af=function(u,a){if(typeof(CQS_OnErrorAsynch)!='undefined'){CQS_OnErrorAsynch(u,a);}};};}();CQS.ServerElement=new function(){var c=[];this.register=function(a){c.push(a);};this.get=function(b){var a="";for(var i=0;i<c.length;i++){a=c[i];if(a.indexOf(b)>=0){break;}}return document.getElementById(a);};};var _c=new Array();CQS.Notify=new function(){function NotificationElement(a,b,c,d,f,g){this.ElementID=a+'';this.NotifyText=b;this.ErrorText=c;this.Visible=false;this.ContainerID=d;this.HeaderID=g;this.TextID=f;};function Notification(h,j,k,l,m){this.ID=j;this.Left=0;if(CQS.Common.isDefined(k)){this.Left=k;}this.Top=0;if(CQS.Common.isDefined(l)){this.Top=l;}this.ElementType=h;this.m=false;if(CQS.Common.isDefined(m)){this.m=m;}this.Elements=new Array();this.Add=function(a,b,c,d,f,g){this.Elements[this.Elements.length]=new NotificationElement(a,b,c,d,f,g);};this.getElement=function(n){for(var i=0;i<this.Elements.length;i++){if(this.Elements[i].ElementID==n){return this.Elements[i];}}return null;};};this.create=function(h,j,k,l,m){if(!CQS.Common.isDefined(m)){m=false;}var _a=new Notification(h,j,k,l,m);var _d=document.getElementsByTagName(h);for(var i=0;i<_d.length;i++){if(CQS.Common.elementHasAttribute(_d[i],'CQSEnableNotification')&&CQS.Common.elementGetAttribute(_d[i],'CQSEnableNotification')=='true'&&_d[i].id!=null&&_d[i].id.length>0){var _e=document.createElement('div');_e.id=_d[i].id+'_NotifyContainer';_e.style.zIndex=999999;_e.style.display='none';_e.className='notificationpopup';var _f=document.createElement('div');_f.className='np-top';_e.appendChild(_f);var _g=document.createElement('div');_g.className='np-body';_e.appendChild(_g);var _h=document.createElement('h1');_h.id=_d[i].id+'_TextHeader';_g.appendChild(_h);var _i=document.createElement('p');_i.id=_d[i].id+'_TextContainer';_i.innerHTML='No body text provided';_g.appendChild(_i);var _j=document.createElement('div');_j.className='np-bottom';_e.appendChild(_j);document.body.appendChild(_e);if(!m){_d[i].style.borderTopWidth='1px';_d[i].style.borderLeftWidth='1px';_d[i].style.borderBottomWidth='1px';_d[i].style.borderRightWidth='1px';_d[i].style.borderTopStyle='solid';_d[i].style.borderLeftStyle='solid';_d[i].style.borderBottomStyle='solid';_d[i].style.borderRightStyle='solid';_d[i].style.borderColor='Silver';}_a.Add(_d[i].id,CQS.Common.elementGetAttribute(_d[i],'CQSNotifyText'),CQS.Common.elementGetAttribute(_d[i],'CQSErrorText'),_e.id,_i.id,_h.id);}};for(var _k=0;_k<_c.length;_k++){if(_c[_k].ElementType==h&&_c[_k].ID==j){_c[_k]=_a;return;}}_c[_c.length]=_a;};this.show=function(j,n,o,p,q){var r=_s(j);if(r!=null){var s=r.getElement(n);var _l='';var t='';if(CQS.Common.isDefined(p)&&p.length>0){_l=p;if(CQS.Common.isDefined(q)&&q.length>0){t=q;}}else{if(o=='error')_l=s.ErrorText;else _l=s.NotifyText;}_m(r,s,n,_l,t);return true;}return false;};var _m=function(r,s,n,p,t){var _b=$(s.ContainerID);var _n=$(s.HeaderID);var _o=$(s.TextID);var _p=$(n);if(CQS.Common.isDefined(t)&&t.length>0){_n.innerHTML=t;_n.style.height='';}else{_n.style.height='0px';}if(CQS.Common.isDefined(p)&&p.length>0){_o.innerHTML=p;}_b.x=_t(_p,'left')+r.Left;_b.y=_t(_p,'top')+r.Top;_b.style.left=_b.x-_v(_p,'rightedge',r,_b)+_p.offsetWidth+'px';_b.style.top=_b.y-_v(_p,'bottomedge',r,_b)+'px';if(!window.XMLHttpRequest){var _q=$("ifNotificationBlock");_q.style.left=_b.x-_v(_p,'rightedge',r,_b)+_p.offsetWidth+18+'px';_q.style.top=_b.y-_v(_p,'bottomedge',r,_b)-18+'px';_q.style.height=_p.offsetHeight+58;_q.style.zIndex=999998;_q.style.display='block';}_b.style.display='block';try{_p.style.border='red 1px solid';_p.focus();_p.select();}catch(e){}s.Visible=true;};this.redraw=function(){for(var _k=0;_k<_c.length;_k++){for(var _r=0;_r<_c[_k].Elements.length;_r++){if(_c[_k].Elements[_r].Visible){_m(_c[_k],_c[_k].Elements[_r],_c[_k].Elements[_r].ElementID,'');}}}};this.hide=function(j,n){var r=_s(j);if(r!=null){var s=r.getElement(n);$(s.ContainerID).style.display='none';_p=$(s.ElementID);_p.style.border='';if(!r.m){_p.style.borderTopWidth='1px';_p.style.borderLeftWidth='1px';_p.style.borderBottomWidth='1px';_p.style.borderRightWidth='1px';_p.style.borderTopStyle='solid';_p.style.borderLeftStyle='solid';_p.style.borderBottomStyle='solid';_p.style.borderRightStyle='solid';_p.style.borderColor='Silver';}s.Visible=false;if($("ifNotificationBlock")){$("ifNotificationBlock").style.display='none';}return true;}return false;};this.hideAll=function(){for(var _k=0;_k<_c.length;_k++){for(var _r=0;_r<_c[_k].Elements.length;_r++){if(_c[_k].Elements[_r].Visible){this.hide(_c[_k].ID,_c[_k].Elements[_r].ElementID);}}}};var _s=function(j){for(var i=0;i<_c.length;i++){if(_c[i].ID==j){return _c[i];}}return null;};var _t=function(u,v){var totaloffset=(v=='left')?u.offsetLeft:u.offsetTop;var _u=u.offsetParent;while(_u!=null){totaloffset=(v=='left')?totaloffset+_u.offsetLeft:totaloffset+_u.offsetTop;_u=_u.offsetParent;}return totaloffset;};var _v=function(w,z,_a,_b){if(z=='rightedge'){edgeoffsetx=0;var _w=isIE&&!window.opera?_y().scrollLeft+_y().clientWidth-15:window.pageXOffset+window.innerWidth-15;_b.contentmeasure=_b.offsetWidth;if(_w-_b.x<_b.contentmeasure)edgeoffsetx=_b.contentmeasure-w.offsetWidth;return edgeoffsetx;}else{edgeoffsety=0;var _x=isIE&&!window.opera?_y().scrollTop:window.pageYOffset;var _w=isIE&&!window.opera?_y().scrollTop+_y().clientHeight-15:window.pageYOffset+window.innerHeight-18;_b.contentmeasure=_b.offsetHeight;if(_w-_b.y<_b.contentmeasure)edgeoffsety=_b.contentmeasure+w.offsetHeight+(_a.Top*2);return edgeoffsety;}};var _y=function(){return(document.compatMode&&document.compatMode!='BackCompat')?document.documentElement:document.body};};CQS.SlideShowManger=new function(){var o=new Array();this.createNewSlideShow=function(a,b,c,d,f,g){var p=new CQS.SlideShow(a,b,c,d,f,g);o[o.length]=p;return p;};this.getSlideShow=function(a){for(var i=0;i<o.length;i++){if(o[i].ID==a){return o[i];}}return null;};};CQS.SlideShow=function(a,b,c,h,f,g){var q=function(j,k,l){this.isVisible=l;this.fx=j;this.ID=k.id;var r=k.className;var s=k;var t=k.parentNode;this.removeFromParent=function(){CQS.Common.removeChildNode(t,s);};this.addToParent=function(){CQS.Common.appendChildNode(t,s);};};this.EventHandlers=new function(){this.onSlideOutStart=undefined;this.onSlideInStart=undefined;this.onSlideOutComplete=undefined;this.onSlideInComplete=undefined;};this.ID=a;var u=h;var v=h.style.width.substring(0,h.style.width.indexOf('px'));var w=b;var x=c;var y=g;var f=f;var z=0;var _a=0;var _b=new Array();var _c=new Array();var _d=this.EventHandlers;var _e=false;var _f="right";$(w).addEvent('click',function(e){e=new Event(e);if(!_e&&_c.length>0){_e=true;_f="left";z=_a;if(_c.length>1){if(_a==0){_a=_c.length-1;}else{_a=_a-1;}}else{_a=0;}_h(_a);}e.stop();});$(x).addEvent('click',function(e){e=new Event(e);if(!_e&&_c.length>0){_e=true;_f="right";z=_a;if(_c.length>1){if(_a==_c.length-1){_a=0;}else{_a=_a+1;}}else{_a=0;}_h(_a);}e.stop();});this.addSlide=function(m){var _g=new Fx.Morph(u,{duration:f});_g.set({'width':'0px','margin-left':v+'px'});if(_c.length==0){_c[_c.length]=new q(_g,$(m),true);}else{_c[_c.length]=new q(_g,$(m),false);_c[_c.length-1].removeFromParent();}};var _h=function(n){_c[n].isVisible=true;_c[z].isVisible=false;if(_f=="left"){_c[z].fx.set({'width':'0px','margin-left':v+'px'});_c[z].fx.start({'width':v+'px','margin-left':'0px'});}else{_c[z].fx.set({'width':'0px','margin-left':'0px'});_c[z].fx.start({'width':v+'px','margin-left':'0px'});}setTimeout("CQS.SlideShowManger.getSlideShow('"+a+"').exchangeSlides()",f+100);};this.exchangeSlides=function(){_c[z].removeFromParent();_c[_a].addToParent();_c[_a].isVisible=true;if(_f=="right"){_c[_a].fx.set({'width':v+'px','margin-left':'0px'});_c[_a].fx.start({'width':'0px','margin-left':v+'px'});}else{_c[_a].fx.set({'width':v+'px','margin-left':'0px'});_c[_a].fx.start({'width':'0px','margin-left':'0px'});}setTimeout("CQS.SlideShowManger.getSlideShow('"+a+"').transitionEnded()",f+50);};this.transitionEnded=function(){_e=false;};};var _a=(window.navigator.appName.toLowerCase().indexOf('explorer')==-1);var _b=true;function PreventSessionTimeout(){if(_b){_b=false;}else{CQS.Callback.Ajax.pushToDifferentPage('','',GetSessionExpireURL());}setTimeout('PreventSessionTimeout()',300000);};function fadeOut(a,b){if(document.getElementById){g=document.getElementById(a);if(b>=0){SetOpacity(g,b);b-=10;window.setTimeout("fadeOut('"+a+"',"+b+")",10);}else{g.style.display='none';}}};function PrintPage(){if(window.print){window.print();}else if(VBS){printIt();}else{alert('It is not possible to print this page from script. Please utilize your browsers print function to print this page.');}};function PrintContent(c,d){try{var _c=CQS.Common.getElementsWithIdContaining(document,c);for(var _d=0;_d<_c.length;_d++){var _e=_c[_d];if(_e.style.display!='none'){var _f=CQS.Common.getElementWithIdContaining(document,'divPrintLogo');var _g=CQS.Common.getElementWithIdContaining(document,'_ctl0'+_d+'_'+c);var _h=window.open('','','left=50,top=0,width=600,height=400,location=center,toolbar=0,scrollbars=1,status=0');_h.document.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"/Styles/airtrade-home.css\" /></head><body>"+_f.innerHTML+"<div class=\""+d+"\">"+_g.innerHTML+"</div></body></html>");_h.document.close();_h.focus();_h.print();_h.close();}}}catch(e){alert('It is not possible to print this page from script. Please utilize your browsers print function to print this page.');}};function fadeIn(a,b){if(document.getElementById){g=document.getElementById(a);if(b<=100){SetOpacity(g,b);b+=5;window.setTimeout("fadeIn('"+a+"',"+b+")",10);}else{g.style.display='block';}}};function MakeTransparent(f){SetOpacity(f,0);};function SetOpacity(g,b){b=(b==100)?99.999:b;g.style.filter='alpha(opacity:'+b+')';g.style.KHTMLOpacity=b/100;g.style.MozOpacity=b/100;g.style.b=b/100;};var _i;function YT_top(){if(document.body.scrollTop!=0||document.documentElement.scrollTop!=0){window.scrollBy(0,-20);_i=setTimeout('YT_top()',10);}else clearTimeout(_i);};function YT_ScrollToTop(){window.scrollTo(0,0);};function YT_ScrollToElement(h){window.scrollTo(0,getPageY(h));};function YT_ScrollTo(x,y){window.scrollTo(x,y);};function YT_GetScrollX(){if(_a){return window.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft;}else if(document.body){return document.body.scrollLeft;}}return 0;};function YT_GetScrollY(){if(_a){return window.pageYOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop;}else if(document.body){return document.body.scrollTop;}}return 0;};function YT_GetWindowHeight(){if(parseInt(navigator.appVersion)>3){if(navigator.appName=='Netscape'){return window.innerHeight;}if(navigator.appName.indexOf('Microsoft')!=-1){return document.body.offsetHeight;}}};function getPageX(e){if(!(e=xGetElementById(e)))return 0;var x=0;while(e){if(xDef(e.offsetLeft)){x+=e.offsetLeft;}e=xDef(e.offsetParent)?e.offsetParent:null;}return x;};function getPageY(e){if(!(e=xGetElementById(e))){return 0;}var y=0;while(e){if(xDef(e.offsetTop)){y+=e.offsetTop;}e=xDef(e.offsetParent)?e.offsetParent:null;}return y;};function xGetElementById(e){if(typeof(e)!='string'){return e;}if(document.getElementById){e=document.getElementById(e);}else if(document.all){e=document.all[e];}else{e=null;}return e;};function xDef(){for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])=='undefined')return false;}return true;};var _j=new Array();function DisableElement(h,j,k,l){var _k;var _l=document.getElementById(h+'iframe');if(_l==null||_l==undefined){_l=document.createElement('iframe');_l.id=h+'iframe';_l.src='../../block.aspx';_l.className='filterBlockIFrame';_l.frameBorder=0;_l.scrolling='no';_l.style.position='absolute';document.body.insertBefore(_l,document.body.firstChild);_k={ElementID:'',ElementWidth:0,ElementHeight:0};_k.ElementID=h;_k.ElementWidth=j;_k.ElementHeight=k;_j[_j.length]=_k;}else{_k=GetGrayOutObject(h);if(l==true){_k.ElementWidth=j;_k.ElementHeight=k;}}_l.style.top=getPageY(h)+'px';_l.style.left=getPageX(h)+'px';_l.style.width=_k.ElementWidth+'px';_l.style.height=_k.ElementHeight+'px';_l.style.display='block';};function EnableElement(h){var _l=document.getElementById(h+'iframe');if(_l!=null&&_l!=undefined){_l.style.display='none';}};function RedrawGrayOutIFrames(){for(ytCount=0;ytCount<_j.length;ytCount++){var _l=document.getElementById(_j[ytCount].ElementID+'iframe');if(_l!=null&&_l!=undefined){if(_l.style.display=='block'){DisableElement(_j[ytCount].ElementID,_j[ytCount].ElementWidth,_j[ytCount].ElementHeight,false);}}}};function GetGrayOutObject(h){for(ytCount=0;ytCount<_j.length;ytCount++){if(_j[ytCount].ElementID==h){return _j[ytCount];}}return null;};var LB={init:function(){var menu=document.getElementById('mainmenu');if(menu)new LB.Foldout(menu);var _m=document.getElementById('shoppingcart');if(_m)new LB.SimpleFoldout(_m);LB.EventListener.addEvent(document,'mouseup',LB.blurButtons);LB.EventListener.addEvent(window,'resize',RedrawGrayOutIFrames);},EventListener:{addEvent:function(m,n,o){try{m.addEventListener(n,o,false);}catch(e){m.attachEvent('on'+n,o);}},getTarget:function(e,p){var _n=e.target||e.srcElement;if(_n.nodeType>1){_n=_n.parentNode;}return p?LB.bubble(_n,p):_n;}},r:function(q,r){return function(){q.apply(r,arguments);}},bubble:function(s,n){var _o=new RegExp('^'+n+'$','i');while(s&&!_o.test(s.nodeName)){s=s.parentNode;}return s;},blurButtons:function(e){var _p=LB.EventListener.getTarget(e,'a');if(_p&&/button/i.test(_p.className)){_p.blur();}},ClassName:{add:function(s,p){s.className+=s.className?(' '+p):p;},remove:function(s,p){var _o=new RegExp('(^|\\s)'+p+'(\\s|$)','g');if(_o.test(s.className))s.className=s.className.replace(_o,' ');}}};LB.Foldout=function(t){this.container=t;this.current=null;this.coolDown=null;LB.EventListener.addEvent(t,'mouseover',LB.r(this.handleMouseover,this));LB.EventListener.addEvent(document,'mouseover',LB.r(this.handleMouseout,this));};LB.Foldout.prototype={LIST:/^li$/i,KEEPALIVE:1000,handleMouseover:function(e){this.close();var _n=LB.EventListener.getTarget(e,'li');if(_n){clearTimeout(this.coolDown);this.coolDown=null;var s=_n;while(s&&s!=this.container){if(this.LIST.test(s.nodeName)){LB.ClassName.add(s,'active');}s=s.parentNode;}this.current=_n;}},handleMouseout:function(e){if(this.current&&!this.coolDown){var s=LB.EventListener.getTarget(e);while(s){if(s==this.container)return;s=s.parentNode;}this.coolDown=setTimeout(LB.r(this.close,this),this.KEEPALIVE);}},close:function(){var s=this.current;while(s&&s!=this.container){if(this.LIST.test(s.nodeName)){LB.ClassName.remove(s,'active');}s=s.parentNode;}this.current=null;}};LB.SimpleFoldout=function(t){this.container=t;LB.EventListener.addEvent(t,'mouseover',LB.r(this.handleMouseover,this));LB.EventListener.addEvent(document,'mouseover',LB.r(this.handleMouseout,this));};LB.SimpleFoldout.prototype={KEEPALIVE:1000,handleMouseover:function(e){clearTimeout(this.coolDown);this.coolDown=null;if(!this.isOpen){LB.ClassName.add(this.container,'active');this.isOpen=true;}},handleMouseout:function(e){if(this.isOpen&&!this.coolDown){var s=LB.EventListener.getTarget(e);while(s){if(s==this.container)return;s=s.parentNode;}this.coolDown=setTimeout(LB.r(this.close,this),this.KEEPALIVE);}},close:function(){LB.ClassName.remove(this.container,'active');this.isOpen=false;if(this.container.id=='shoppingcart'){if(typeof(ShowSelectBoxInIE)!='undefined'){ShowSelectBoxInIE();}}}};LB.EventListener.addEvent(window,'load',function(){});function ValidateDayInput(u){ValidateNonDecimalNumericInput(u);};function ValidateDayOnBlur(u){ValidateNonDecimalNumericInput(u);if(u.value.length==0){u.value='DD';}else if(parseFloat(u.value)>31){u.value='31';}else if(parseFloat(u.value)<=0){u.value='1';}ValidateDayAgainstMonth(u);if(u.value.length==1){u.value='0'+u.value;}};function ValidateDayAgainstMonth(v){var _q=v.id.substring(0,v.id.indexOf('inDay'));var _r=_q+'inMonth';var _s=document.getElementById(_r);if(_s.value.length>0&&_s.value!='MM'&&v.value.length>0&&v.value!='DD'){var _t=parseFloat(_s.value);var _u=document.getElementById(_q+'inYear');if(_u.value.length>0&&_u.value!='YYYY'&&parseFloat(_u.value)==YT_GetCurrentYear()&&_t>YT_MonthOfYear()){_s.value=YT_MonthOfYear();if(_s.value.length==1){_s.value='0'+_s.value;}_t=YT_MonthOfYear();v.value='01';}if(_t==1||_t==3||_t==5||_t==7||_t==8||_t==10||_t==12){if(parseFloat(v.value)>31){v.value='31';}}else if(_t==4||_t==6||_t==9||_t==11){if(parseFloat(v.value)>30){v.value='30';}}else if(_t==2){if(YT_IsLeapYear()){if(parseFloat(v.value)>29){v.value='29';}}else{if(parseFloat(v.value)>28){v.value='28';}}}}};function ValidateMonthAgainstDay(w){var _v=document.getElementById(w.id.substring(0,w.id.indexOf('inMonth'))+'inDay');ValidateDayAgainstMonth(_v);};function ValidateMonthAndDayAgainstYear(z){var _v=document.getElementById(z.id.substring(0,z.id.indexOf('inYear'))+'inDay');ValidateDayAgainstMonth(_v);};function ValidateMonthInput(w){ValidateNonDecimalNumericInput(w);};function ValidateMonthOnBlur(w){ValidateNonDecimalNumericInput(w);if(w.value.length==0){w.value='MM';}else if(parseFloat(w.value)>12){w.value='12';}else if(parseFloat(w.value)<=0){w.value='01';}ValidateMonthAgainstDay(w);if(w.value.length==1){w.value='0'+w.value;}};function ValidateYearInput(u){ValidateNonDecimalNumericInput(u);};function ValidateYearOnBlur(u){ValidateNonDecimalNumericInput(u);if(u.value.length==0){u.value='YYYY';}else if(parseFloat(u.value)>YT_GetCurrentYear()||parseFloat(u.value)<1900){u.value=YT_GetCurrentYear();}if(parseFloat(u.value)==YT_GetCurrentYear()){ValidateMonthAndDayAgainstYear(u);}};function YT_ShowDelayedLoadingBox(a,b,c,d,e,f,g,h){CQS.AT.MessageBox.setupLoadingBoxAndShow(a,b,c,d,e,f,g,h);}function YT_ShowLoadingBox(a,b,c,d,f,g,h){YT_ShowDelayedLoadingBox(a,b,c,d,0,f,g,h);}function YT_HideLoadingBox(){HideWaitingScreen(true);}function YT_CancelLoadingBox(){CQS.AT.MessageBox.cancelLoadingBox();}function YT_MessageBoxShowYesNo(a,b,c,d,i){return YT_MessageBoxShow(a,b,c,d,true,true,false,false,false,0,0,0,i);}function YT_MessageBoxShowYesNoCancel(a,b,c,d,i){return YT_MessageBoxShow(a,b,c,d,true,true,true,false,false,0,0,0,i);}function YT_MessageBoxShowYesCancel(a,b,c,d,i){return YT_MessageBoxShow(a,b,c,d,true,false,true,false,false,0,0,0,i);}function YT_MessageBoxShowOkClose(a,b,c,d,i){return YT_MessageBoxShow(a,b,c,d,false,false,false,true,true,0,0,0,i);}function YT_MessageBoxShowClose(a,b,c,d,i){return YT_MessageBoxShow(a,b,c,d,false,false,false,false,true,0,0,0,i);}function YT_MessageBoxShowOk(a,b,c,d,i,j){YT_MessageBoxShow(a,b,c,d,false,false,false,true,false,0,0,0,i,j);}function YT_MessageBoxShowOkDelayed(a,b,c,d,i,e){return setTimeout("YT_MessageBoxShow("+a+", "+b+", \""+c+"\", \""+d+"\", false, false, false, true, false, 0, 0, 0, \""+i+"\")",e);}function YT_MessageBoxShow(a,b,c,d,k,l,m,n,o,e,f,g,i,j){CQS.AT.MessageBox.setupMessageBoxAndShow(a,b,c,d,k,l,m,n,o,e,f,g,i,j);}function YT_MessageBoxHide(){CQS.AT.MessageBox.requestMessageBoxHide();}function MessageBoxHide(p,j){CQS.AT.MessageBox.hideMessageBox(p,j);}function MessageBoxShow(){CQS.AT.MessageBox.showMessageBox();}var t;function YT_MessageBoxShowSessionExpire(q,c,d){t=q;return YT_MessageBoxShow(400,200,c,d,false,false,false,true,false,0,0,0,"SessionExpireErrorOnClose");}function SessionExpireErrorOnClose(r){window.location.href=t;}function YT_MessageBoxShowErrorBox(c,d){return YT_MessageBoxShow(600,400,c,d,false,false,false,true,false,0,0,0,"ErrorBoxOnClose");}function YT_MessageBoxHandleOnHide(){if(typeof(YT_MessageBoxOnHide)!='undefined')YT_MessageBoxOnHide();}function DoNothing(){}function HideMessageBoxBlock(){CQS.Block.hide();CQS.CursorAnimation.StopAnimation();}function ShowMessageBoxBlock(){CQS.Block.show(0.01);}function EB(s){Madurodam.Block.hide();}function BB(s){if(!Madurodam.Block.isVisible()){Madurodam.Block.show(0.01);;}}function YT_DoAsynchronousCallBack(a,b,c){CQS.Callback.doAsynchronousCallBack(a,b,c);}function YT_ReloadUpdatePanelMSAjax(d,a,b){Sys.WebForms.PageRequestManager.getInstance()._doPostBack(d,a+','+b);}function YT_ReloadUpdatePanel(d,a,b){if(RadCallbackNamespace.Prefix!='undefined'&&RadCallbackNamespace.Prefix!=undefined){RadCallbackNamespace.AsyncRequest(d,a+','+b,d);}else{setTimeout("YT_ReloadUpdatePanel(\""+d+"\", \""+a+"\", \""+b+"\")",1000);}}function YT_DoCallbackAndReloadUpdatePanel(a,b,d,e,f){RadCallbackNamespace.AsyncRequest(d,'DoCallback,'+a+','+b+',UPC,'+e+','+f,d);}function CQS_ReloadUpdatePanel(d,a,b){CQS.Callback.reloadUpdatePanel(a,b,d);}function CQS_DoCallbackAndReloadUpdatePanel(a,b,d,e,f){CQS.Callback.doCallbackAndReloadUpdatePanel(a,b,d,e,f);}function CQS_DoCallbackAndReloadMainContent(a,b){CQS.Callback.doCallbackAndReloadMainContent(a,b);}function CQS_OnErrorAsynch(g,a){}function CQS_GetContentUpdatePanelID(){if(typeof(GetContentUpdatePanelID)!='undefined'){return GetContentUpdatePanelID();}else{return"";}}function CQS_GetContentUpdatePanelCallbackID(){if(typeof(GetContentUpdatePanelCallbackID)!='undefined'){return GetContentUpdatePanelCallbackID();}else{return"";}}function CQS_GetContentUpdatePanelCallbackArgs(){if(typeof(GetContentUpdatePanelCallbackArgs)!='undefined'){return GetContentUpdatePanelCallbackArgs();}else{return"";}}function roundNumber(a,b){if(a>8191&&a<10485){a=a-5000;var c=Math.round(a*Math.pow(10,b))/Math.pow(10,b);}else{var c=Math.round(a*Math.pow(10,b))/Math.pow(10,b);}return c;}function ValidateEmailAddress(a){var c=document.getElementById(a).value.trim();var j=/^([\w\xc0-\xff-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/
if(!j.test(c)){CQS.AT.ValidationMessage.show(a,InvalidEmailAddressMessage(),NotValidMessageHeader());return false;}return true;}function ValidateEmptyInput(a){var k=document.getElementById(a).value.trim();if(k.length<=0){CQS.AT.ValidationMessage.show(a,MandatoryFieldMessage(),NotValidMessageHeader());return false;}return true;}function ValidateNumeric(a){try{var l=document.getElementById(a).value.trim();for(i=0;i<l.length;i++){var m=parseInt(l.substring(i,i+1));if(m!=0&&m!=-0){if(!m){document.getElementById(a).value="";return false;}}}return true;}catch(err){document.getElementById(a).value="";return false;}}function ValidateAlpha(b){for(i=0;i<b.length;i++){if(!IsAlphaChar(b.substring(i,i+1))){return false;}}return true;}function ValidatePositive(a){var l=parseInt(document.getElementById(a).value);if(l<=0){l=1;document.getElementById(a).value="1";}return l;}function IsAlphaChar(c){if(((c>="a")&&(c<="z"))||((c>="A")&&(c<="Z"))||IsUmlaut(c)){return true;}return false;}function IsNumeric(d){var n="0123456789.";var o=true;var p;for(i=0;i<d.length&&o==true;i++){p=d.charAt(i);if(n.indexOf(p)==-1){o=false;}}return o;}function IsNumericChar(c){if((c>="0")&&(c<="9")){return true;}return false;}function IsSpace(c){if((c==" ")){return true;}return false;}function IsUmlaut(e){var q="üéâäàåçêëèïîìæÆôöòûùÿýáíóúñÑŠŽšœžŸÝÀÁÂÃÄÅÈÉÊËÌÍÎÏÐÒÓÔÕÖØÙÚÛÜãßÇŒ`´‘’'";var r;for(var s=0;s<e.length;s++){r=e.charAt(s);if(q.indexOf(r)==-1){return false;}}return true;};function ValidateTelephoneNumber(a){try{if(document.getElementById(a).value.trim().length<=0){CQS.AT.ValidationMessage.show(a,NotValidFieldMessage(),NotValidMessageHeader());return false;}var l=document.getElementById(a).value.trim();var t=l.substring(0,1)=="+"?true:false;if(t){if(l.length==1){CQS.AT.ValidationMessage.show(a,NotValidFieldMessage(),NotValidMessageHeader());return false;}l=l.substring(1,l.length);}for(i=0;i<l.length;i++){if(!(IsNumericChar(l.substring(i,i+1))||IsSpace(l.substring(i,i+1)))){CQS.AT.ValidationMessage.show(a,NotValidFieldMessage(),NotValidMessageHeader());return false;}}return true;}catch(err){CQS.AT.ValidationMessage.show(a,NotValidFieldMessage(),NotValidMessageHeader());return false;}}function IsTelephoneChar(c){if(c=="+"){return true;}return false;}function ValidateTelephoneInputBoxForKeyPress(a){ValidateTelephoneInput(document.getElementById(a));}function ValidateTelephoneInput(f){var u="";if(f.value.length==0){return;}for(i=0;i<f.value.length;i++){if(i==0&&(IsTelephoneChar(f.value.substring(i,i+1))==true||IsNumericChar(f.value.substring(i,i+1))==true)){u+=f.value.substring(i,i+1);}else if(i!=0&&(IsNumericChar(f.value.substring(i,i+1))||(IsSpace(f.value.substring(i,i+1))&&!IsSpace(f.value.substring(i-1,i))&&!IsTelephoneChar(f.value.substring(i-1,i))))){u+=f.value.substring(i,i+1);}}if(f.value.length!=u.length){f.value=u;}return;}function ValidateNonDecimalNumericInputBoxForKeyPress(a){ValidateNonDecimalNumericInput(document.getElementById(a));}function ValidateNonDecimalNumericInput(f){var u="";if(f.value.length==0){return;}for(i=0;i<f.value.length;i++){if(IsNumericChar(f.value.substring(i,i+1))){u+=f.value.substring(i,i+1);}}if(f.value.length!=u.length){f.value=u;}return;}function ValidateMaxNumericInputValue(g){try{var f=$(g);var v=f.getProperty('MaxNumericValue');if(v!=null&&v.length>0){if(parseFloat(f.value)>parseFloat(v)){f.value=v;}}}catch(err){}}function ValidateKeyPressNumeric(){if(IsNavigationKeyCode(event.h)){return true;}if(IsNumericKeyCode(event.h)){return true;}return false;}function IsNumericKeyCode(h){if(h>=48&&h<=57){return true;}else{return false;}}function IsNavigationKeyCode(h){if(h==8){return true;}if(h==9){return true;}if(h==27){return true;}if(h==16){return true;}if(h==17){return true;}if(h==18){return true;}if(h==91){return true;}if(h==37||h==38||h==39||h==40){return true;}return false;}CQS.CursorAnimation=new function(){var f=null;var g,h,i;this.showAnimation=false;this.document;this.defaultImageId='imgLoadingCursorAnimation';this.StartAnimation=function(a){try{if(f!=null){f.style.display='block';if(a){var j=CQS.Common.getElementWithIdContaining(document,a);CQS.CursorAnimation.showOnlyImageCursor(j.id);}else{var j=CQS.Common.getElementWithIdContaining(document,CQS.CursorAnimation.defaultImageId);CQS.CursorAnimation.showOnlyImageCursor(j.id);}CQS.CursorAnimation.showAnimation=true;CQS.Common.addEvent(document,'mousemove',CQS.CursorAnimation.moveMouse);}}catch(e){}};this.showOnlyImageCursor=function(b){var k=CQS.Common.getElementWithIdContaining(document,'ifLoadingAnimation');if(k){imgCursorIDs=k.getElementsByTagName('img');for(var l=0;l<imgCursorIDs.length;l++){if(imgCursorIDs[l].id.contains(b)){imgCursorIDs[l].style["display"]='';}else{imgCursorIDs[l].style["display"]='none';}}}};this.SubscribeToCursorAnimation=function(c){CQS.Common.addEvent(c,'mousemove',CQS.CursorAnimation.moveMouse);};this.StopAnimation=function(){try{f.style.display='none';CQS.CursorAnimation.showAnimation=false;CQS.Common.removeEvent(document,'mousemove',CQS.CursorAnimation.moveMouse);}catch(e){}};this.init=function(d){f=document.getElementById(d);};this.timerID=null;var m=false;var n=true;var o;this.moveMouse=function(e){if(CQS.CursorAnimation.showAnimation==true){e?g=e:g=event;if(parent){CQS.CursorAnimation.document?o=CQS.CursorAnimation.document:o=parent.document;}else{CQS.CursorAnimation.document?o=CQS.CursorAnimation.document:o=document;}scrollTop=CQS.Common.getScrollY();scrollLeft=o.documentElement&&o.documentElement.scrollLeft?o.documentElement.scrollLeft:o.body.scrollLeft;h=g.clientX-50;i=g.clientY+10;f.style.left=h+"px";f.style.top=i+"px";f.isVisible='true';f.style.display="block";}else{f.isVisible='false';f.style.display="none";}};this.moveMouseTransistion=function(e){if(CQS.CursorAnimation.showAnimation==true){e?g=e:g=event;scrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;scrollLeft=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;if(g.clientX>scrollLeft){h=g.clientX-scrollLeft+5;}else{h=g.clientX+scrollLeft+5;}if(g.clientY>scrollTop){i=g.clientY+scrollTop+5;}else{i=g.clientY-scrollTop+5;}f.isVisible='true';f.style.display="block";fx.start({'left':h,'top':i});}else{f.isVisible='false';f.style.display="none";}};};function YT_CalendarDaySelected(a,b){}function ToggleCalendar(c,d,e,f,g){var h=eval(c);if(!h.isVisible()){HideAllCalendars();h.show();if(typeof(CalendarPopupOpened)!='undefined')CalendarPopupOpened(c);if(typeof(FlightsCalendarPopupOpened)!='undefined')FlightsCalendarPopupOpened(c);if(typeof(CarsCalendarPopupOpened)!='undefined')CarsCalendarPopupOpened(c);if(typeof(HotelsCalendarPopupOpened)!='undefined')HotelsCalendarPopupOpened(c);if(typeof(AvailabilityCalendarPopupOpened)!='undefined')AvailabilityCalendarPopupOpened(c);if(typeof(TravelInsuranceCalendarPopupOpened)!='undefined')TravelInsuranceCalendarPopupOpened(c);}else{h.hide();}}function HideCalendar(c,d,e){var a=eval(c);if(typeof(a)!='undefined'){a.hide();}}function HideAllCalendars(){HideAllAirtradeCalendars();}var m_EkTbStopAtRoot = 0;
var m_EkTbStopAtCss = 1;
var m_EkTbStopAtOffset = 2;
var m_EkTbLastObj;
var m_bEkTbReady = false;

function addEkTbLoadEvent() 
{
    var oldonload = window.onload;
    window.onload = function() 
        {
            if (typeof oldonload == 'function') 
            {
                oldonload();
            }
            setTimeout("m_bEkTbReady = true;", 500);
        }
}

function EkTbWebMenuPopUpWindow (url, hWind, nWidth, nHeight, nScroll, nResize) {
	if (!m_bEkTbReady) return false;
	if (nWidth > screen.width) {
		nWidth = screen.width;
	}
	if (nHeight > screen.height) {
		nHeight = screen.height;
	}
	var cToolBar = 'toolbar=0,location=0,directories=0,status=' + nResize + ',menubar=0,scrollbars=' + nScroll + ',resizable=' + nResize + ',width=' + nWidth + ',height=' + nHeight;
	var popupwin = window.open(url, hWind, cToolBar);
	return popupwin;
}
			
function EkTbFade(opacity, speed, change, holdTime, startDelay, fadeType, name) {
	if (!m_bEkTbReady) return false;
	var MyObj = document.getElementById(name);
	if (startDelay == 0) {
		if (!document.all) {
			MyObj.style.MozOpacity = (opacity / 100);
		}
		else {
			MyObj.filters.alpha.opacity = (opacity);
		}
		if (((opacity >= 0) && (change < 0)) || ((opacity < 99) && (change > 0))) {
			opacity += change;
			if (opacity > 99) {
				opacity = 99;
			}
			setTimeout("EkTbFade(" + opacity + "," + speed + "," + change + "," + holdTime + "," + startDelay + ",'" + fadeType + "','" + name + "')", speed);
		}
		else {
			change = (0 - change);
			opacity += change;
			if (fadeType.toLowerCase() == "cycle") {
				setTimeout("EkTbFade(" + opacity + "," + speed + "," + change + "," + holdTime + "," + startDelay + ",'" + fadeType + "','" + name + "')", holdTime);
			}
		}
	}
	else {
		var tmp = startDelay;
		startDelay = 0;
		setTimeout("EkTbFade(" + opacity + "," + speed + "," + change + "," + holdTime + "," + startDelay + ",'" + fadeType + "','" + name + "')", tmp);
	}
}

var m_isMac = false;
var m_isMacInit = false;
function IsPlatformMac() {
	if (m_isMacInit) {
		return (m_isMac);
	} else {
		var posn;
		var sUsrAgent = new String(navigator.userAgent);
		sUsrAgent = sUsrAgent.toLowerCase();
		posn = parseInt(sUsrAgent.indexOf('mac'));
		m_isMac = (0 <= posn);
		m_isMacInit = true;
		return (m_isMac);
	}
}

var m_isSafari = false;
var m_isSafariInit = false;
function IsBrowserSafari() {
	if (m_isSafariInit) {
		return (m_isSafari);
	} else {
		var posn;
		var sUsrAgent = new String(navigator.userAgent);
		sUsrAgent = sUsrAgent.toLowerCase();
		posn = parseInt(sUsrAgent.indexOf('safari'));
		m_isSafari = (0 <= posn);
		m_isSafariInit = true;
		return (m_isSafari);
	}
}

function EkTbRollOver(e, MyObj) {
	if (!m_bEkTbReady) return false;
	var top = 0;
	var tmpTop = 0;
	var left = 0;
	var tmpLeft = 0;
	var width = 0;
	var height = 0;
	var toolbarNumArray = (MyObj.id).split("_");
	var automaticBorder = true;
	var outsideBorder = true;
	var menuBorderWidth = 3;
	var localTimeout = null;
	var ekTbOuterElement = null;

	// ensure previous object is deactivated (fixes Safari ghosting problem):
	if (m_EkTbLastObj && (m_EkTbLastObj != MyObj)) {
		EkTbOffNow(m_EkTbLastObj.id)
	}
	m_EkTbLastObj = MyObj;

	eval("localTimeout = m_EkTbTimeout_" + toolbarNumArray[1] + ";");
	if (localTimeout != null) {
		localTimeout = clearTimeout(localTimeout);
		eval("m_EkTbTimeout_" + toolbarNumArray[1] + " = localTimeout;");
	}
	
	// Mac-Safari returns invalid offsetHeight values for DIV elements, 
	// which are used for the new EkWebToolbar (to bracket the content), 
	// workaround - when needed, use the outer table cell instead of the DIV:
	if (IsPlatformMac()){
		eval("ekTbOuterElement = EkTbOuterElmt_" + toolbarNumArray[1] + ";");
		if (ekTbOuterElement != null) {
			height = ekTbOuterElement.offsetHeight;
		} else {
			height = MyObj.offsetHeight;
		}
	} else {
		height = MyObj.offsetHeight;
	}
	
	tmpLeft = EkTbFindParentPositionLeft(MyObj, (m_EkTbStopAtRoot));
	width = MyObj.offsetWidth;
	tmpTop = EkTbFindParentPositionTop(MyObj, (m_EkTbStopAtRoot));
	eval("automaticBorder = m_EkTbAutomaticOutsideBorder_" + toolbarNumArray[1] + ";");
	eval("outsideBorder = m_EkTbOutsideBorder_" + toolbarNumArray[1] + ";");
	eval("menuBorderWidth = m_EkTbMenuBorderWidth_" + toolbarNumArray[1] + ";");
	if (outsideBorder == true) {
		if (((tmpLeft - menuBorderWidth) < 0) && (automaticBorder)) {
			left = 0;
		}
		else {
			left = tmpLeft - menuBorderWidth;
		}
		if (((tmpTop - menuBorderWidth) < 0) && (automaticBorder)) {
			top = 0;
		}
		else {
			top = tmpTop - menuBorderWidth;
		}
		if ( ((((left + width) == document.body.clientWidth) && ((tmpLeft - menuBorderWidth) < 0)) 
			|| (((left + width + menuBorderWidth) == document.body.clientWidth) && ((tmpLeft - menuBorderWidth) >= 0)))
			&& (automaticBorder)
			) {
			width = (document.body.clientWidth - left);
		}
		else {
			width += (menuBorderWidth * 2);
		}
		if ( ((((top + height) == document.body.clientHeight) && ((tmpTop - menuBorderWidth) < 0)) 
			|| (((top + height + menuBorderWidth) == document.body.clientHeight) && ((tmpTop - menuBorderWidth) >= 0)))
			&& (automaticBorder)
			) {
			height = (document.body.clientHeight - top);
		}
		else {
			height += (menuBorderWidth * 2);
		}
	}
	else {
		left = tmpLeft;
		top = tmpTop;
	}
	
	// Mac needs positioning to be adjusted:
	if (IsPlatformMac()){
		if (IsBrowserSafari) {
			left +=4;
			top +=6;
		} else {
			left +=4;
			top +=14;
		}
	}	

	if (document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).parentNode != document.body) {
		var BodyObj = document.body;
		var toolObj1 = document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]);
		toolObj1.parentNode.removeChild(toolObj1);
		var tmpObj1 = BodyObj.appendChild(toolObj1);
		var toolObj2 = document.getElementById("EkTbRightBar_" + toolbarNumArray[1]);
		toolObj2.parentNode.removeChild(toolObj2);
		var tmpObj2 = BodyObj.appendChild(toolObj2);
		var toolObj3 = document.getElementById("EkTbTopBar_" + toolbarNumArray[1]);
		toolObj3.parentNode.removeChild(toolObj3);
		var tmpObj3 = BodyObj.appendChild(toolObj3);
		var toolObj4 = document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]);
		toolObj4.parentNode.removeChild(toolObj4);
		var tmpObj4 = BodyObj.appendChild(toolObj4);
		var toolObj5 = document.getElementById("EkTbToolbar_" + toolbarNumArray[1]);
		toolObj5.parentNode.removeChild(toolObj5);
		var tmpObj5 = BodyObj.appendChild(toolObj5);
	}
	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.top = top + "px";
	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.left = left + "px";
	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.width = menuBorderWidth + "px";
	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.height = height + "px";

	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.top = top + "px";
	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.left = ((left + width) - menuBorderWidth) + "px";
	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.width = menuBorderWidth + "px";
	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.height = height + "px";;

	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.top = top + "px";
	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.left = left + "px";
	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.width = width + "px";;
	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.height = menuBorderWidth + "px";

	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.top = ((top + height) - menuBorderWidth) + "px";
	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.left = left + "px";
	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.width = width + "px";;
	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.height = menuBorderWidth + "px";

	document.getElementById("EkTbLeftBar_" + toolbarNumArray[1]).style.display = "";
	document.getElementById("EkTbRightBar_" + toolbarNumArray[1]).style.display = "";
	document.getElementById("EkTbTopBar_" + toolbarNumArray[1]).style.display = "";
	document.getElementById("EkTbBottomBar_" + toolbarNumArray[1]).style.display = "";
}

function EkTbRollOut(e, MyObj) {
	if (!m_bEkTbReady) return false;
	var toElement = "";
	var srcElement = "";

	if (document.all) {
		toElement = e.toElement;
		srcElement = e.srcElement;
	}
	else {
		toElement = e.relatedTarget;
		srcElement = e.target;
	}
	if ((srcElement.id != MyObj.id)
		&& (!EkTbIsChild(srcElement, MyObj))) {
		//alert("No: " + srcElement.id);
		return;
	}
	if ((toElement == null) || (!((EkTbIsChild(toElement, MyObj)) || (MyObj.id == toElement.id)))) {
		var tmpArray = MyObj.id.split("_");
		eval("m_EkTbTimeout_" + tmpArray[1] + " = setTimeout(\"EkTbOff('" + MyObj.id + "')\", m_EkTbMenuOffDelay_" + tmpArray[1] + ")");
	}
}

function EkTbOff(MyObjId) {
	if (!m_bEkTbReady) return false;
	var tmpArray = MyObjId.split("_");
	if (eval("m_EkTbTimeout_" + tmpArray[1] + " != null")) {
		eval("m_EkTbTimeout_" + tmpArray[1] + " = null");
		document.getElementById("EkTbLeftBar_" + tmpArray[1]).style.display = "none";
		document.getElementById("EkTbRightBar_" + tmpArray[1]).style.display = "none";
		document.getElementById("EkTbTopBar_" + tmpArray[1]).style.display = "none";
		document.getElementById("EkTbBottomBar_" + tmpArray[1]).style.display = "none";
		document.getElementById("EkTbToolbar_" + tmpArray[1]).style.display = "none";
	}
}

function EkTbOffNow(MyObjId) {
	if (!m_bEkTbReady) return false;
	var tmpArray = MyObjId.split("_");
	if (eval("m_EkTbTimeout_" + tmpArray[1] + " != null")) {
		eval("m_EkTbTimeout_" + tmpArray[1] + " = null");
	}
	document.getElementById("EkTbLeftBar_" + tmpArray[1]).style.display = "none";
	document.getElementById("EkTbRightBar_" + tmpArray[1]).style.display = "none";
	document.getElementById("EkTbTopBar_" + tmpArray[1]).style.display = "none";
	document.getElementById("EkTbBottomBar_" + tmpArray[1]).style.display = "none";
	document.getElementById("EkTbToolbar_" + tmpArray[1]).style.display = "none";
}

function EkTbCancelOff(MyObj) {
	if (!m_bEkTbReady) return false;
	var tmpArray = MyObj.id.split("_");
	var tmpTimeout = eval("m_EkTbTimeout_" + tmpArray[1]);
	if (tmpTimeout != null) {
		clearTimeout(tmpTimeout);
		eval("m_EkTbTimeout_" + tmpArray[1] + " = null;");
	}
}

function EkTbFindParentPositionLeft(Obj, StopAt) {
	if (!m_bEkTbReady) return false;
	var curLeft = 0;
	
	if (Obj.offsetParent) {
		while (Obj && (null != Obj.offsetLeft)) {
			if ((StopAt != m_EkTbStopAtRoot) 
				&& (EkTbIsStopTag(Obj, StopAt)) )
			{
				break;
			}
			curLeft += Obj.offsetLeft;
			Obj = Obj.offsetParent;
		}
	}
	else if (Obj.x)	{
		curLeft += Obj.x;
	}
	return (curLeft);
}

function EkTbFindParentPositionTop(Obj, StopAt) {
	if (!m_bEkTbReady) return false;
	var curTop = 0;
	
	if (Obj.offsetParent) {
		while (Obj && (null != Obj.offsetTop)) {		
			if ((StopAt != m_EkTbStopAtRoot) 
				&& (EkTbIsStopTag(Obj, StopAt)) )
			{
				break;
			}
			curTop += Obj.offsetTop;
			Obj = Obj.offsetParent;
		}
	}
	else if (Obj.x) {
		curleft += Obj.x;
	}
	return (curTop);
}

function EkTbGetScrollTop()
{
	if (EkTbIsInQuirksMode())
	{
		return (document.body.scrollTop);
	}
	else
	{
		return (document.documentElement.scrollTop);
	}
}

function EkTbGetScrollLeft()
{
	if (EkTbIsInQuirksMode())
	{
		return (document.body.scrollLeft);
	}
	else
	{
		return (document.documentElement.scrollLeft);
	}
}

function EkTbIsInQuirksMode()
{
	// document.compatMode "BackCompat" : No DocType 
	// document.compatMode "CSS1Compat" : DocType specified 
	// Also 
	// document.documentElement.clientHeight == 0 : No DocType 
	// document.documentElement.clientHeight != 0 : DocType specified 
	return (0 == document.documentElement.clientHeight);
}

// Not currently used
function EkTbFindTopDifference(ChildObj, ParentObj) {
	if (!m_bEkTbReady) return false;
	var curTop = 0;

	if (ChildObj != ParentObj) {	
		curTop += ChildObj.offsetTop;
		if (ChildObj.offsetParent) {
			while ((ChildObj.offsetParent) && (ChildObj != ParentObj)) {
				curTop += ChildObj.offsetTop;
				ChildObj = ChildObj.offsetParent;
			}
		}
	}
	return (curTop);
}

// Not currently used
function EkTbFindLeftDifference(ChildObj, ParentObj) {
	if (!m_bEkTbReady) return false;
	var curLeft = 0;

	if (ChildObj != ParentObj) {	
		curLeft += ChildObj.offsetLeft;
		if (ChildObj.offsetParent) {
			while ((ChildObj.offsetParent) && (ChildObj != ParentObj)) {
				curLeft += ChildObj.offsetLeft;
				ChildObj = ChildObj.offsetParent;
			}
		}
	}
	return (curLeft);
}

function EkTbIsChild(obj, ParentObj) {
	if (!m_bEkTbReady) return false;
	var retVal = false;
	var tmpArray = "";
	if (obj) {
		if (((obj.id).indexOf("EkTbToolbar_") > -1)
			|| ((obj.id).indexOf("EkTbLeftBar_") > -1)
			|| ((obj.id).indexOf("EkTbRightBar_") > -1)
			|| ((obj.id).indexOf("EkTbTopBar_") > -1)
			|| ((obj.id).indexOf("EkTbBottomBar_") > -1)) {
			retVal = true;
		}
		else {
			if (obj.parentNode) {
				while (obj.parentNode) {
					obj = obj.parentNode;
					if ((ParentObj.id).indexOf("EkTb") > -1) {
						tmpArray = (ParentObj.id).split("_");
					}
					else {
						tmpArray = new Array;
						tmpArray[0] = "";
						tmpArray[1] = "";
					}
					if ((obj == ParentObj) 
						|| (obj == document.getElementById("EkTbToolbar_"+ tmpArray[1]))
						|| (obj == document.getElementById("EkTbLeftBar_"+ tmpArray[1]))
						|| (obj == document.getElementById("EkTbRightBar_"+ tmpArray[1]))
						|| (obj == document.getElementById("EkTbTopBar_"+ tmpArray[1]))
						|| (obj == document.getElementById("EkTbBottomBar_"+ tmpArray[1])) ) {
						retVal = true;
						break;
					}
				}
			}
		}
	}
	return (retVal);
}

function EkTbIsStopTag(Obj, StopAt) {
	if (!m_bEkTbReady) return false;
	var retVal = false;
	
	if ( (((Obj.style.position).toLowerCase() == "relative") && (StopAt & m_EkTbStopAtCss))
		 || (((Obj.style.position).toLowerCase() == "absolute") && (StopAt & m_EkTbStopAtOffset)) ) {
		if (!document.all) {
			if ((Obj.tagName).toLowerCase() != "table") {
				retVal = true;
			}
		}
		else {
			retVal = true;
		}
	}
	return (retVal);
}

function EkTbMacShowToolbar(e, MyObj) {
	if (!m_bEkTbReady) return false;
	var retVal = true;
	
	if (navigator.userAgent.indexOf("Mac") > -1) {
		if (e.shiftKey) {
			retVal = EkTbShowToolbar(e, MyObj);
		}
	}
	return(retVal);
}

function EkTbShowToolbar(e, MyObj) {
	if (!m_bEkTbReady) return false;
	var retVal = true;
	var toElement = "";
	var srcElement = "";
	var locationX = 0;
	var locationY = 0;
	if (document.all) {
		toElement = e.toElement;
		srcElement = e.srcElement;
		if (e.y == event.clientY)
		{
		    // operate normally
		    locationY = (e.y + (EkTbFindParentPositionTop(srcElement, m_EkTbStopAtRoot) - EkTbFindParentPositionTop(srcElement, m_EkTbStopAtCss) + EkTbGetScrollTop()) );
		    locationX = (e.x + (EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtRoot)  - EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtCss) + EkTbGetScrollLeft()) );
		}
		else
		{
		    //special case for a div in a div (blogs)
		    //alert('Y= ' + e.y + " - " + event.clientY + " - " + event.screenY + " - " + ((EkTbFindParentPositionTop(srcElement, m_EkTbStopAtRoot) - EkTbFindParentPositionTop(srcElement, m_EkTbStopAtCss) + EkTbGetScrollTop()) ));
		    locationY = (event.clientY + EkTbFindParentPositionTop(srcElement, m_EkTbStopAtRoot) - EkTbFindParentPositionTop(srcElement, m_EkTbStopAtCss) + EkTbGetScrollTop() );
		    if (event.screenX != e.clientX)
		    {
		        locationX = (event.clientX + (e.x + (EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtRoot)  - EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtCss) + EkTbGetScrollLeft()) )) - e.x;
		    }
		    else
		    {
		        locationX = (event.screenX); // e.x + (EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtRoot)  - EkTbFindParentPositionLeft(srcElement, m_EkTbStopAtCss) + EkTbGetScrollLeft()) );
		    }
		}
	}
	else {
		toElement = e.relatedTarget;
		srcElement = e.target;
		locationY = e.pageY;
		locationX = e.pageX;
	}
	if (!e.ctrlKey) {
		var tmpArray = MyObj.id.split("_");
		var rightEdge = (EkTbFindParentPositionLeft(document.getElementById("EkTbBase_" + tmpArray[1]), (m_EkTbStopAtRoot)) + document.getElementById("EkTbBase_" + tmpArray[1]).offsetWidth);
		if (locationX > rightEdge) {
			locationX = rightEdge;
		}
		document.getElementById("EkTbToolbar_" + tmpArray[1]).style.top = ((locationY)) + "px";
		document.getElementById("EkTbToolbar_" + tmpArray[1]).style.left = ((locationX)) + "px";
		document.getElementById("EkTbToolbar_" + tmpArray[1]).style.display = "";
		retVal = false;
	}
	return (retVal);
}

function EkTbStopBubble(e, MyObj) {
	e.cancelBubble = true;
}


this.CallbackSearchHotels=function(){if(!VerifyMinimumRoomsAndAdults()){YT_MessageBoxShowOk(350,150,GetMinTravellersNotSelectedHeader(),GetMinTravellersNotSelectedContent(),'DoNothing');return;}var j=[];var k=false;var l=false;var m=0;var n=$$('div[TravellerListItem=true]');for(var i=0;i<n.length;i++){if(n[i].getElement('input').checked){j.push(n[i].getElement('input').getProperty('personId'));}};if(j.length>GetNumberOfAdults()){YT_MessageBoxShowOk(350,150,GetMoreTravellersThanPeopleHeader(),GetMoreTravellersThanPeopleContent(),'DoNothing');return;}selectedTravellerList=j.toString();if(CQS.Common.getElementWithIdContaining(document,'optTravellerPreferences')!=null){k=CQS.Common.getElementWithIdContaining(document,'optTravellerPreferences').checked;}if(CQS.Common.getElementWithIdContaining(document,'optMyPreferences')!=null){l=CQS.Common.getElementWithIdContaining(document,'optMyPreferences').checked;}if(typeof HotelSearchGetMinStarsID=='function'){m=document.getElementById(HotelSearchGetMinStarsID()).value}var o=document.getElementById(HotelSearchGetMaxPriceID());HotelSearchRemoveDefaultText(o);var p=document.getElementById(HotelSearchGetHotelNameID());HotelSearchRemoveDefaultText(p);ShowWaitingScreen(GetSearchingForHotelsMessage());var q=document.getElementById(HotelSearchGetNrNightsID());var r=parseFloat(q.value);var s=HotelSearchGetArrivalDateInputObj().GetDate();var t=new Date();t.setFullYear(s.getFullYear(),s.getMonth(),s.getDate());t.setDate(s.getDate()+r);HotelSearchGetDepartureDateInputObj().SetDate(t);var u=HotelSearchGetArrivalDateInputObj().GetDate();var v=HotelSearchGetDepartureDateInputObj().GetDate();var w='';try{w=document.getElementById(HotelSearchGetLocationsID()).firstChild.value;}catch(ex1){try{w=document.getElementById(HotelSearchGetLocationsID()).value;}catch(ex2){}}YT_DoAsynchronousCallBack('HotelMainSearchClicked',w+'##'+document.getElementById(HotelSearchGetMaxPriceID()).value+'##'+document.getElementById(HotelSearchGetHotelNameID()).value+'##'+document.getElementById(HotelSearchGetOnlyAvailHotelsID()).checked+'##'+u.getFullYear()+'##'+(u.getMonth()+1)+'##'+u.getDate()+'##'+v.getFullYear()+'##'+(v.getMonth()+1)+'##'+v.getDate()+'##'+CollateRoomOccupancies()+'##'+selectedTravellerList+'##'+k+'##'+l+'##'+m,true);};this.GetNumberOfAdults=function(){var x=0;var y=$("tblRoomOccupancies").getElements("tr[name=rowRoomOccupancy]");var z=HotelSearchNumberOfRoomsSelected();for(var _a=0;_a<y.length;_a++){if(parseInt(CQS.Common.elementGetAttribute(y[_a],"roomOccupancyId"))<=parseInt(z)){x+=parseInt(CQS.Common.getElementWithIdContaining(y[_a],"ddlAdults").options[CQS.Common.getElementWithIdContaining(y[_a],"ddlAdults").selectedIndex].value);}}return x;};this.VerifyMinimumRoomsAndAdults=function(){var y=$("tblRoomOccupancies").getElements("tr[name=rowRoomOccupancy]");var _b=$('tblRoomOccupancies').getElement("tr[firstRow=true]");var _c=parseInt(CQS.Common.elementGetAttribute(_b,"minAdults"));var _d=HotelSearchNumberOfRoomsSelected();if(y.length>0){for(var _a=0;_a<y.length;_a++){if(parseInt(CQS.Common.elementGetAttribute(y[_a],"roomOccupancyId"))<=parseInt(_d)){var _e=CQS.Common.getElementWithIdContaining(y[_a],"ddlAdults").options[CQS.Common.getElementWithIdContaining(y[_a],"ddlAdults").selectedIndex].value;if(parseInt(_e)<_c){return false;}}}return true;}return false;};this.CollateRoomOccupancies=function(){var _f="";var y=$("tblRoomOccupancies").getElements("tr[name=rowRoomOccupancy]");var z=HotelSearchNumberOfRoomsSelected();for(var _a=0;_a<y.length;_a++){if(parseInt(CQS.Common.elementGetAttribute(y[_a],"roomOccupancyId"))<=parseInt(z)){var _e=CQS.Common.getElementWithIdContaining(y[_a],"ddlAdults").options[CQS.Common.getElementWithIdContaining(y[_a],"ddlAdults").selectedIndex].value;var _g=CQS.Common.getElementWithIdContaining(y[_a],"ddlChildren").options[CQS.Common.getElementWithIdContaining(y[_a],"ddlChildren").selectedIndex].value;_f+=_e+","+_g+"@";}}if(_f.length>0){_f=_f.substring(0,_f.length-1);}return _f;};this.HotelCallbackSearch=function(){CallbackSearchHotels();};var _h;this.HotelSearchNrNightsOnFocus=function(){_h=parseFloat(document.getElementById(HotelSearchGetNrNightsID()).value);};this.HotelSearchNrNightsOnBlur=function(){var q=document.getElementById(HotelSearchGetNrNightsID());if(q.value.length==0){q.value='1';}else{if(parseFloat(q.value)==0){q.value='1';}}var r=parseFloat(q.value);if(_h!=r){var _i=HotelSearchGetArrivalDateInputObj().GetDate();var s=new Date();s.setFullYear(_i.getFullYear(),_i.getMonth(),_i.getDate());s.setDate(s.getDate()+r);HotelSearchGetDepartureDateInputObj().SetDate(s);var u=HotelSearchGetArrivalDateInputObj().GetDate();YT_DoAsynchronousCallBack('UpdateHotelDepartureCalendar',u.getFullYear()+'##'+(u.getMonth()+1)+'##'+u.getDate()+'##'+s.getFullYear()+'##'+(s.getMonth()+1)+'##'+s.getDate(),true);_h=r;}};this.HotelSearchNrNightsKeyPressed=function(){ValidateNonDecimalNumericInputBoxForKeyPress(HotelSearchGetNrNightsID());ValidateMaxNumericInputValue(HotelSearchGetNrNightsID());};this.HotelSearchMaxPriceKeyPressed=function(a){ValidateNonDecimalNumericInputBoxForKeyPress(HotelSearchGetMaxPriceID());HotelSearchAddDefaultText(a);};this.HotelSearchRemoveDefaultText=function(b){if(b.value==GetNoPreferenceText()){b.value='';}};this.HotelSearchAddDefaultText=function(b){if(b.value==''){b.value=GetNoPreferenceText();}};this.HotelSearchMaximumPriceChanged=function(b){HotelSearchMaxPriceKeyPressed(b);};this.HotelSearchOnlyAvailHotelsChanged=function(){var _j=document.getElementById(HotelSearchGetMaxPriceID());_j.value=GetNoPreferenceText();if(document.getElementById(HotelSearchGetOnlyAvailHotelsID()).checked){_j.disabled=false;}else{_j.disabled=true;}};this.HotelSearchRADCalendarArrival_OnDaySelected=function(c,d){var _k=new Date();_k.setFullYear(d.getFullYear(),d.getMonth(),d.getDate());HotelSearchGetArrivalDateInputObj().SetDate(_k);HideCalendar(HotelSearchGetArrivalDatePickerContainerID());var v=HotelSearchGetDepartureDateInputObj().GetDate();YT_DoAsynchronousCallBack('UpdateHotelDepartureCalendar',d.getFullYear()+'##'+(d.getMonth()+1)+'##'+d.getDate()+'##'+v.getFullYear()+'##'+(v.getMonth()+1)+'##'+v.getDate(),true);};this.HotelSearchRADCalendarDeparture_OnDaySelected=function(c,d){var v=new Date();v.setFullYear(d.getFullYear(),d.getMonth(),d.getDate());HotelSearchGetDepartureDateInputObj().SetDate(v);HideCalendar(HotelSearchGetDepartureDatePickerContainerID());HotelSearchSetNrNights(HotelSearchGetArrivalDateInputObj().GetDate(),v);};this.HotelSearchSetNrNights=function(e,f){var _l=1000*60*60*24;document.getElementById(HotelSearchGetNrNightsID()).value=Math.ceil((f.getTime()-e.getTime())/(_l));};this.HotelsCalendarPopupOpened=function(g){if(typeof(HotelSearchGetArrivalDatePickerContainerID)!='undefined'){if(g==HotelSearchGetArrivalDatePickerContainerID()){HideCalendar(HotelSearchGetDepartureDatePickerContainerID());}else{HideCalendar(HotelSearchGetArrivalDatePickerContainerID());}}};this.ShowAutoCompleteNoResultsMessage=function(h){if(typeof(GetAutoCompleteNoResultsMessage)!='undefined'&&typeof(GetNoResultsMessage)!='undefined'){YT_MessageBoxShowOk(350,150,GetNoResultsMessage(),GetAutoCompleteNoResultsMessage(h),'DoNothing');}};this.HotelSearchHandleWindowOnResize=function(){if(typeof(RadComboBoxHandleWindowOnResize)!="undefined"){RadComboBoxHandleWindowOnResize();}};function CallbackSearchCarsMain(){var o="";var p=false;var q=false;var r=$$('div[TravellerListItem=true]');for(var i=0;i<r.length;i++){if(r[i].getElement('input').checked){o=r[i].getElement('input').getProperty('personId');}};if(CQS.Common.getElementWithIdContaining(document,'optTravellerPreferences')!=null){p=CQS.Common.getElementWithIdContaining(document,'optTravellerPreferences').checked;}if(CQS.Common.getElementWithIdContaining(document,'optMyPreferences')!=null){q=CQS.Common.getElementWithIdContaining(document,'optMyPreferences').checked;}YT_ShowDelayedLoadingBox(400,150,"",GetSearchingForCarsMessage(),0,2000,300000);var j=GetPickupDatePickerInput().GetDate();var k=GetDropoffDatePickerInput().GetDate();YT_DoAsynchronousCallBack('CarSearchClicked',$(GetDriverAgeListClientID()).value+'##'+$(GetACPickupLocationsClientID()).firstChild.value+'##'+$(GetACDropoffLocationsClientID()).firstChild.value+'##'+j.getFullYear()+'##'+(j.getMonth()+1)+'##'+j.getDate()+'##'+$(GetPickupTimeClientID()).value+'##'+k.getFullYear()+'##'+(k.getMonth()+1)+'##'+k.getDate()+'##'+$(GetDropoffTimeClientID()).value+'##'+$(GetCarTypeListClientID()).value+'##'+$(GetRentalCompanyListClientID()).value+'##'+o+'##'+p+'##'+q,true);};function CallbackSearchCarsSmall(){YT_ShowDelayedLoadingBox(400,150,"",GetSearchingForCarsMessage(),0,2000,300000);var j=GetPickupDatePickerInput().GetDate();var k=GetDropoffDatePickerInput().GetDate();YT_DoAsynchronousCallBack('CarSearchClicked',$(GetACPickupLocationsClientID()).firstChild.value+'##'+$(GetACDropoffLocationsClientID()).firstChild.value+'##'+j.getFullYear()+'##'+(j.getMonth()+1)+'##'+j.getDate()+'##'+$(GetPickupTimeClientID()).value+'##'+k.getFullYear()+'##'+(k.getMonth()+1)+'##'+k.getDate()+'##'+$(GetDropoffTimeClientID()).value+'##'+$(GetCarTypeListClientID()).value+'##'+$(GetRentalCompanyListClientID()).value,true);};function CarSearch_OnLoad(){RADHandleOnLoad(GetACPickupLocations());RADHandleOnLoad(GetACDropoffLocations());try{$(GetDriverAgeListClientID()).focus();}catch(e){try{$(GetACPickupLocationsClientID()).firstChild.focus();}catch(e){}}};function SetDropoffTimeToPickupTime(){if(!SameDaySelected()){$(GetDropoffTimeClientID()).selectedIndex=$(GetPickupTimeClientID()).selectedIndex;}};var s;function CarNrDaysOnFocus(){s=parseFloat($(GetNrDaysClientID()).value);};function CarNrDaysOnBlur(){var t=$(GetNrDaysClientID());if(t.value.length==0){t.value="1";}else{if(parseInt(t.value)==0){t.value="1";}}var u=parseInt(t.value);if(s!=u){var v=GetPickupDatePickerInput().GetDate();var w=new Date();w.setFullYear(v.getFullYear(),v.getMonth(),v.getDate());w.setDate(w.getDate()+u);GetDropoffDatePickerInput().SetDate(w);var j=v;YT_DoAsynchronousCallBack('UpdateCarDepartureCalendar',j.getFullYear()+'##'+(j.getMonth()+1)+'##'+j.getDate()+'##'+w.getFullYear()+'##'+(w.getMonth()+1)+'##'+w.getDate(),true);s=u;}};function NrDaysKeyPressed(){ValidateNonDecimalNumericInputBoxForKeyPress(GetNrDaysClientID());};function RefreshTimeSelectLists(a){var x=$(GetPickupTimeClientID());var y=$(GetDropoffTimeClientID());if(SameDaySelected()){var z=x.selectedIndex;var _a=y.selectedIndex+(48-y.options.length);if(a){x.options.length=0;}y.options.length=0;if(z==47){z=46;_a=0;}else{if(_a<=z){_a=0;}else{_a=_a-z-1;}}if(a){PopulateDDL(x,0,47);x.selectedIndex=z;}PopulateDDL(y,z+1,48);y.selectedIndex=_a;}else{var z=x.selectedIndex;var _a=y.selectedIndex+(48-y.options.length);if(a){x.options.length=0;}y.options.length=0;if(a){PopulateDDL(x,0,48);x.selectedIndex=z;}PopulateDDL(y,0,48);y.selectedIndex=_a;}window.setTimeout("SetNrDays(GetPickupDatePickerInput().GetDate(),GetDropoffDatePickerInput().GetDate())",100);};function PopulateDDL(b,c,f){for(cnt=c;cnt<f;cnt++){var _b;var _c;if((cnt%2)>0){_b=Math.floor(cnt/2)<10?"0"+Math.floor(cnt/2)+":30":Math.floor(cnt/2)+":30";_c=Math.floor(cnt/2)+".5";}else{_b=Math.floor(cnt/2)<10?"0"+Math.floor(cnt/2)+":00":Math.floor(cnt/2)+":00";_c=Math.floor(cnt/2);}b.options[b.length]=new Option(_b,_c);}};function SameDaySelected(){var j=GetPickupDatePickerInput().GetDate();var k=GetDropoffDatePickerInput().GetDate();if(j.getFullYear()==k.getFullYear()&&j.getMonth()==k.getMonth()&&j.getDate()==k.getDate()){return true;}return false;};function RADCalendarCarArrival_OnDaySelected(g,h){var d=new Date();d.setFullYear(h.getFullYear(),h.getMonth(),h.getDate());d.setHours(0,0,0,0);GetPickupDatePickerInput().SetDate(d);HideCalendar(GetPickupCalendarContainerClientID());var k=GetDropoffDatePickerInput().GetDate();YT_DoAsynchronousCallBack('UpdateCarDepartureCalendar',h.getFullYear()+'##'+(h.getMonth()+1)+'##'+h.getDate()+'##'+k.getFullYear()+'##'+(k.getMonth()+1)+'##'+k.getDate(),true);setTimeout("SetDropoffTimeToPickupTime()",1000);};function RADCalendarCarDeparture_OnDaySelected(g,h){var k=new Date();k.setFullYear(h.getFullYear(),h.getMonth(),h.getDate());k.setHours(0,0,0,0);GetDropoffDatePickerInput().SetDate(k);HideCalendar(GetDropoffCalendarContainerClientID());if($(GetDropoffTimeClientID()).options.length<48){window.setTimeout("RefreshTimeSelectLists(true);if (!SameDaySelected()) SetDropoffTimeToPickupTime();",100);}else{window.setTimeout("RefreshTimeSelectLists(true);",100);}};function SetNrDays(j,k){if(SameDaySelected()){$(GetNrDaysClientID()).value="1";}else{var _d=1000*60*60*24;var _e=parseFloat($(GetDropoffTimeClientID()).value);var _f=parseFloat($(GetPickupTimeClientID()).value);var _g=k.getTime()+1000*60*60*_e;var _h=j.getTime()+1000*60*60*_f;var _i=_g-_h;var u=Math.ceil(_i/_d);$(GetNrDaysClientID()).value=u;}};function CarsCalendarPopupOpened(l){if(typeof(GetPickupCalendarContainerClientID)!='undefined'){if(l==GetPickupCalendarContainerClientID()){HideCalendar(GetDropoffCalendarContainerClientID());}else if(l==GetDropoffCalendarContainerClientID()){HideCalendar(GetPickupCalendarContainerClientID());}}};function ShowAutoCompleteNoResultsMessage(m){if(typeof(GetAutoCompleteNoResultsMessage)!='undefined'&&typeof(GetNoResultsMessage)!='undefined'){YT_MessageBoxShowOk(350,150,GetNoResultsMessage(),GetAutoCompleteNoResultsMessage(m),"DoNothing");}};function PickUpTimeChanged(){var _j=$(GetPickupTimeClientID());if(SameDaySelected()){window.setTimeout("RefreshTimeSelectLists(false)",100);}else{SetNrDays(GetPickupDatePickerInput().GetDate(),GetDropoffDatePickerInput().GetDate());}};function DropOffTimeChanged(){SetNrDays(GetPickupDatePickerInput().GetDate(),GetDropoffDatePickerInput().GetDate());};function YT_ACDropdownClosing(n){if(typeof(GetACPickupLocationsClientID)!='undefined'){if(n.ClientID==GetACPickupLocationsClientID()&&$(n.InputID).value.length>=GetMinAutoCompleteLength()){if($(GetACDropoffLocations().InputID).value.length<=0){$(GetACDropoffLocations().InputID).value=$(n.InputID).value;eval(GetACDropoffLocationsClientID()+".la(false, 84)");}}}};function YT_ACDropdownOpening(n){if(typeof(GetACPickupLocationsClientID)!='undefined'){if(n.ClientID==GetACPickupLocationsClientID()){eval(GetACDropoffLocationsClientID()+".HideDropDown()");}else{eval(GetACPickupLocationsClientID()+".HideDropDown()");}}};CQS.AT.Flight=new function(){};CQS.AT.Flight.Search=new function(){var t=false;this.onLoad=function(){if(!t){if(typeof(getDepart1CityControl)!='undefined'){RADHandleOnLoad(getDepart1CityControl());RADHandleOnLoad(getArrive1CityControl());}if(typeof(getDepart2CityControl)!='undefined'){RADHandleOnLoad(getDepart2CityControl());RADHandleOnLoad(getArrive2CityControl());}t=true;}};this.showFlightSearchTab=function(a){switch(a){case 1:CQS.ServerElement.get('divFlightBox2').style.visibility='visible';CQS.ServerElement.get('divFlightBox2').style.height='auto';CQS.ServerElement.get('divFlightBox2Date').style.visibility='visible';CQS.ServerElement.get('divFlightBox2Date').style.height='auto';CQS.ServerElement.get('divFlightSearchReturnTab').style.visibility='visible';CQS.ServerElement.get('divFlightSearchOneWayTab').style.visibility='hidden';CQS.ServerElement.get('divFlightSearchMultiTripTab').style.visibility='hidden';CQS.ServerElement.get('optSearchReturn').checked=true;break;case 2:CQS.ServerElement.get('divFlightBox2').style.visibility='hidden';CQS.ServerElement.get('divFlightBox2').style.height='0px';CQS.ServerElement.get('divFlightBox2Date').style.visibility='hidden';CQS.ServerElement.get('divFlightSearchReturnTab').style.visibility='hidden';CQS.ServerElement.get('divFlightSearchOneWayTab').style.visibility='visible';CQS.ServerElement.get('divFlightSearchMultiTripTab').style.visibility='hidden';CQS.ServerElement.get('optSearchOneWay').checked=true;break;case 3:CQS.ServerElement.get('divFlightBox2').style.visibility='visible';CQS.ServerElement.get('divFlightBox2').style.height='auto';CQS.ServerElement.get('divFlightBox2Date').style.visibility='visible';CQS.ServerElement.get('divFlightBox2Date').style.height='auto';CQS.ServerElement.get('divFlightSearchReturnTab').style.visibility='hidden';CQS.ServerElement.get('divFlightSearchOneWayTab').style.visibility='hidden';CQS.ServerElement.get('divFlightSearchMultiTripTab').style.visibility='visible';CQS.ServerElement.get('optSearchMultiTrip').checked=true;break;}};this.showFlightResultsTab=function(a){document.getElementById('divFlightResultsReturn').style.display='none';document.getElementById('divFlightResultsCombineSingle').style.display='none';switch(a){case 1:document.getElementById('divFlightResultsReturn').style.display='block';document.getElementById('divFlightResultsCombineSingle').style.display='none';break;case 2:document.getElementById('divFlightResultsCombineSingle').style.display='block';document.getElementById('divFlightResultsReturn').style.display='none';break;}};this.addFlightLeg=function(){var u=0;var v=0;var w=document.getElementById('divFlightBoxParent');var x=document.getElementById('prgAddButton');var y=null;var z=null;var _a=0;var _b=null;var _c=0;for(u=0;u<w.childNodes.length;u++){if(w.childNodes[u].nodeName=='DIV'){_c++;if(w.childNodes[u].style.display=='none'){y=w.childNodes[u];break;}else z=w.childNodes[u];}v++;}if(_c>3){_b=z.getElementsByTagName("A");if(_b.length>0){_b[0].style.display='none';}}y.style.display='';for(u=v;u<w.childNodes.length;u++){if(w.childNodes[u].nodeName=='DIV'){if(w.childNodes[u].style.display=='none'){_a=1;break;}}}if(!_a){x.style.display='none';}RedrawFooter();};this.removeFlightLeg=function(){var w=document.getElementById('divFlightBoxParent');var x=document.getElementById('prgAddButton');var z=null;var _d=null;var u=0;var _c=0;var _e=0;var _b=null;for(u=w.childNodes.length-1;u>=0;u--){if(w.childNodes[u].nodeName=='DIV'){_c++;if(w.childNodes[u].style.display==''){_e++;if(_e==1)z=w.childNodes[u];else if(_e==2){_d=w.childNodes[u];break;}}}}x.style.display='';z.style.display='none';if(_d){_b=_d.getElementsByTagName("A");if(_b.length>0){_b[0].style.display='';}}RedrawFooter();};this.RADCalendarDeparture1_OnDaySelected=function(b,e){var d=new Date();d.setFullYear(e.getFullYear(),e.getMonth(),e.getDate());d.setHours(0,0,0,0);getDepart1DatePickerInput().SetDate(d);HideCalendar(getDepart1CalendarContainerClientID());CQS.Callback.doAsyncCallback('FlightSearchUpdateCalendar',new Array([getDepart1DatePickerClientID()]),document.getElementById('divFlightSearchForm'));};this.RADCalendarDeparture2_OnDaySelected=function(b,e){var d=new Date();d.setFullYear(e.getFullYear(),e.getMonth(),e.getDate());d.setHours(0,0,0,0);getDepart2DatePickerInput().SetDate(d);HideCalendar(getDepart2CalendarContainerClientID());window.setTimeout("CQS.AT.Flight.Search.RefreshTimeSelectLists()",100);};this.DepartureTimeChanged=function(f){window.setTimeout("CQS.AT.Flight.Search.RefreshTimeSelectLists()",100);};this.SameDaySelected=function(g,h){if(g.getFullYear()==h.getFullYear()&&g.getMonth()==h.getMonth()&&g.getDate()==h.getDate()){return true;}return false;};this.RefreshTimeSelectLists=function(){if(this.SameDaySelected(getDepart1DatePickerInput().GetDate(),getDepart2DatePickerInput().GetDate())){this.RefreshTimePairWithSameDate(CQS.ServerElement.get('ddlDepartTimeCache'),CQS.ServerElement.get('ddlDepart1Time'),CQS.ServerElement.get('ddlDepart2Time'));}else{this.RefreshTimeList(CQS.ServerElement.get('ddlDepartTimeCache'),CQS.ServerElement.get('ddlDepart1Time'));this.RefreshTimeList(CQS.ServerElement.get('ddlDepartTimeCache'),CQS.ServerElement.get('ddlDepart2Time'));}};this.RefreshTimeList=function(i,j){if(i.options.length!=j.options.length){var _f=j.value;j.options.length=0;this.PopulateTimeDDL(i,j,0,i.options.length);j.value=_f;}};this.RefreshTimePairWithSameDate=function(i,k,l){var _g=k.selectedIndex;var _h=l.selectedIndex+(k.options.length-l.options.length);k.options.length=0;l.options.length=0;if(_g==48){_g=47;_h=0;}else{if(_h<=_g){_h=0;}else{_h=_h-_g;}}this.PopulateTimeDDL(i,k,0,48);this.PopulateTimeDDL(i,l,_g+1,49);k.selectedIndex=_g;l.selectedIndex=_h;};this.PopulateTimeDDL=function(m,n,o,p){for(Idx=o;Idx<p;Idx++){n.options[n.length]=new Option(m[Idx].text,m[Idx].value);}};this.traverseDOMTreeInputs=function(q){var s='';var c;var _j,_k;var _l;_j=q.getElementsByTagName('INPUT');_k=q.getElementsByTagName('SELECT');for(_l=0;_l<_j.length;_l++){c=_j[_l];if(c.type=='radio'||c.type=='checkbox'){if(c.checked)s+='<'+c.id+' v="true"/>';else s+='<'+c.id+' v="false"/>';}else s+='<'+c.id+' v="'+c.value.replace(/\s/,"")+'"/>';}for(_l=0;_l<_k.length;_l++){c=_k[_l];s+='<'+c.id+' v="'+c.value.replace(/\s/,"")+'"/>';}return s;};};CQS.AT.Flight.Callback=new function(){this.searchFlightsMain=function(){YT_ShowDelayedLoadingBox(400,150,"",GetSearchingForFlightsMessage(),0,2000,300000);CQS.Callback.doAsyncCallback('FlightSearchAdvancedClicked',GetSelectedTravelers(),document.getElementById('divFlightSearchForm'));};this.searchFlightsHome=function(){YT_ShowDelayedLoadingBox(400,150,"",GetSearchingForFlightsMessage(),0,2000,300000);CQS.Callback.doAsyncCallback('FlightSearchHomeClicked',[],document.getElementById('divFlightSearchForm'));};this.searchFlightsSmall=function(){YT_ShowDelayedLoadingBox(400,150,"",GetSearchingForFlightsMessage(),0,2000,300000);CQS.Callback.doAsyncCallback('FlightSearchSmallClicked',[],document.getElementById('divFlightSearchForm'));};this.selectFlightsMain=function(){var _m=location.href;var u=_m.indexOf('RIA');window.setTimeout("window.location.href = '"+_m.substr(0,u+3)+"/FlightReserve/FlightSelected/FlightSelected.aspx'",500);};function GetSelectedTravelers(){var _n=$$('input[groupName=TravellerList]');if(_n.length==0){return[];}var _o=new Array();for(var _i=0;_i<_n.length;_i++){if(_n[_i].checked){_o.push(_n[_i].getProperty('personId'));}}return _o;};};FlightsCalendarPopupOpened=function(r){if(typeof(getDepart1CalendarContainerClientID)!='undefined'){if(r==getDepart1CalendarContainerClientID()){HideCalendar(getDepart2CalendarContainerClientID());}else if(r==getDepart2CalendarContainerClientID()){HideCalendar(getDepart1CalendarContainerClientID());}}};window.addEvent('ondomready',function(){CQS.AT.Flight.Search.onLoad();});CQS.AT.Flights=new function(){};CQS.AT.Flights.FlightResults=new function(){this.SetSelectedTab=function(a){CQS.ServerElement.get('tabFlightResultsSummary').className='';CQS.ServerElement.get('tabFlightResultsCombined').className='';switch(a){case 1:CQS.ServerElement.get('tabFlightResultsSummary').className='active';CQS.ServerElement.get('divFlightResultsSummaryContainer').style.display='';CQS.ServerElement.get('divFlightResultsCombinedContainer').style.display='none';CQS.ServerElement.get('divFlightResultsCombinedFooter').style.display='';break;case 2:CQS.ServerElement.get('tabFlightResultsCombined').className='active';CQS.ServerElement.get('divFlightResultsSummaryContainer').style.display='none';CQS.ServerElement.get('divFlightResultsCombinedContainer').style.display='';CQS.ServerElement.get('divFlightResultsCombinedFooter').style.display='none';break;}RedrawFooter();};this.ToggleSearchAndFilters=function(b){switch(b){case true:CQS.ServerElement.get('divFlightSearchSmallContainer').style.display='none';CQS.ServerElement.get('divFlightResultsFilterBoxContainer').style.display='';break;case false:CQS.ServerElement.get('divFlightSearchSmallContainer').style.display='';CQS.ServerElement.get('divFlightResultsFilterBoxContainer').style.display='none';break;}RedrawFooter();};var y=null;this.ShowFlightDetailsAndConditions=function(c,d){window.open(GetDetailsAndConditionsSRCForFlights(c,d),"FlightsDetailsAndConditions","status=0, toolbar=0, location=0, menubar=0, directory=0, scrollbars=1, resizable, height=525px, width=750px");};this.HideGeneralConditions=function(){y.hide();};this.GetDualTimeSliderUpperCountLimit=function(){try{if(CQS.ServerElement.get('rowInboundTimeFilterHeaders').style.display!='none'){return 4;}return 2;}catch(e){return 2;}};this.ToggleOutboundSliderFilterVisibility=function(f){CQS.AT.Flights.FlightResults.ToggleOutboundSliderFilter(CQS.Common.getElementWithIdContaining(document,'rbFilterOutboundSlidersLeave').checked,f);};this.ToggleInboundSliderFilterVisibility=function(f){CQS.AT.Flights.FlightResults.ToggleInboundSliderFilter(CQS.Common.getElementWithIdContaining(document,'rbFilterInboundSlidersLeave').checked,f);};this.ToggleOutboundSliderFilter=function(g){CQS.AT.Flights.FlightResults.ToggleOutboundSliderFilter(g,false);};this.ToggleOutboundSliderFilter=function(g,f){var z=CQS.Common.getElementWithIdContaining(document,'chkOutboundTimeFilter');var _a=CQS.Common.getElementWithIdContaining(document,'rowOutboundTimeFilterHeaders');var _b=CQS.Common.getElementWithIdContaining(document,'divFilterOutboundLeave');var _c=CQS.Common.getElementWithIdContaining(document,'divFilterOutboundArrive');if(_b!=null&&_c!=null){var _d=CQS.Common.getElementsWithIdContaining(document,'divBGTimeMinMax')
var _e;var _f;for(var _g=0;_g<_d.length;_g++){if(_d[_g].id.contains('ctlTimeFilterDepartureLeave')){_e=_d[_g];}if(_d[_g].id.contains('ctlTimeFilterDepartureArrive')){_f=_d[_g];}}if(z.checked){_a.style.display='';if(g){_b.style.display='';_c.style.display='none';}else{_b.style.display='none';_c.style.display='';}}else{_a.style.display='none';_b.style.display='none';_c.style.display='none';if(f){var _h=CQS.Common.getElementWithIdContaining(_e,'hidRawMinTime').value;var _i=CQS.Common.getElementWithIdContaining(_e,'hidRawMaxTime').value;var _j=CQS.Common.getElementWithIdContaining(_e,'hidRawCurrMinTime').value;var _k=CQS.Common.getElementWithIdContaining(_e,'hidRawCurrMaxTime').value;var _l=CQS.Common.getElementWithIdContaining(_f,'hidRawMinTime').value;var _m=CQS.Common.getElementWithIdContaining(_f,'hidRawMaxTime').value;var _n=CQS.Common.getElementWithIdContaining(_f,'hidRawCurrMinTime').value;var _o=CQS.Common.getElementWithIdContaining(_f,'hidRawCurrMaxTime').value;if(_h!=_j||_i!=_k||_l!=_n||_m!=_o){CQS.AT.Flights.FlightResults.ResetOutboundSliderFilters(_b,_c,_h,_i,_l,_m);CQS.Common.getElementWithIdContaining(document,'rbFilterOutboundSlidersLeave').checked=true;}}}}};this.ToggleInboundSliderFilter=function(g){CQS.AT.Flights.FlightResults.ToggleInboundSliderFilter(g,false);};this.ToggleInboundSliderFilter=function(g,f){var z=CQS.Common.getElementWithIdContaining(document,'chkInboundTimeFilter');var _p=CQS.Common.getElementWithIdContaining(document,'rowInboundTimeFilterHeaders');var _q=CQS.Common.getElementWithIdContaining(document,'divFilterInboundLeave');var _r=CQS.Common.getElementWithIdContaining(document,'divFilterInboundArrive');if(_q!=null&&_r!=null){var _d=CQS.Common.getElementsWithIdContaining(document,'divBGTimeMinMax')
var _s;var _t;for(var _g=0;_g<_d.length;_g++){if(_d[_g].id.contains('ctlTimeFilterReturnLeave')){_s=_d[_g];}if(_d[_g].id.contains('ctlTimeFilterReturnArrive')){_t=_d[_g];}}if(z.checked){_p.style.display='';if(g){_q.style.display='';_r.style.display='none';}else{_q.style.display='none';_r.style.display='';}}else{_p.style.display='none';_q.style.display='none';_r.style.display='none';if(f){var _h=CQS.Common.getElementWithIdContaining(_s,'hidRawMinTime').value;var _i=CQS.Common.getElementWithIdContaining(_s,'hidRawMaxTime').value;var _j=CQS.Common.getElementWithIdContaining(_s,'hidRawCurrMinTime').value;var _k=CQS.Common.getElementWithIdContaining(_s,'hidRawCurrMaxTime').value;var _l=CQS.Common.getElementWithIdContaining(_t,'hidRawMinTime').value;var _m=CQS.Common.getElementWithIdContaining(_t,'hidRawMaxTime').value;var _n=CQS.Common.getElementWithIdContaining(_t,'hidRawCurrMinTime').value;var _o=CQS.Common.getElementWithIdContaining(_t,'hidRawCurrMaxTime').value;if(_h!=_j||_i!=_k||_l!=_n||_m!=_o){CQS.AT.Flights.FlightResults.ResetInboundSliderFilters(_q,_r,_h,_i,_l,_m);CQS.Common.getElementWithIdContaining(document,'rbFilterInboundSlidersLeave').checked=true;}}}}};this.ResetOutboundSliderFilters=function(h,i,j,k,l,m){var _u=h.style.display;var _v=i.style.display;h.style.display='';CQS.Slider.SliderManager.get('DepartureLeaveTimeFilterChanged').reset(j,k);h.style.display=_u;i.style.display='';CQS.Slider.SliderManager.get('DepartureArriveTimeFilterChanged').reset(l,m);i.style.display=_v;CQS.Slider.DualFilterCallback('OutboundTimeFilterReset',GetFlightResultsDetailsUpdatePanel(),'ReloadFlightResults',0,0);};this.ResetInboundSliderFilters=function(n,o,j,k,l,m){var _u=n.style.display;var _v=o.style.display;n.style.display='';CQS.Slider.SliderManager.get('ReturnLeaveTimeFilterChanged').reset(j,k);n.style.display=_u;o.style.display='';CQS.Slider.SliderManager.get('ReturnArriveTimeFilterChanged').reset(l,m);o.style.display=_v;CQS.Slider.DualFilterCallback('InboundTimeFilterReset',GetFlightResultsDetailsUpdatePanel(),'ReloadFlightResults',0,0);};this.SelectFlight=function(p){var _w=CQS.Common.getElementEndingWithId(document,'divFlightProperties_'+p);var _x=CQS.Common.elementGetAttribute(_w,'SelectedOutboundLegId');var _y=CQS.Common.elementGetAttribute(_w,'SelectedInboundLegId');YT_ShowLoadingBox(350,200,'',ShowSelectingFlight(),1000,0);YT_DoAsynchronousCallBack('SelectFlight',p+'##'+_x+'##'+_y,true);};this.SelectFlightLeg=function(q,r){var _z=CQS.Common.getElementEndingWithId(document,q);var _aa=CQS.Common.elementGetAttribute(_z,'FlightId');var _ab=CQS.Common.getElementEndingWithId(document,'divFlightProperties_'+_aa);var _ac=CQS.Common.elementGetAttribute(_ab,'SelectedOutboundLegId');var _ad=CQS.Common.elementGetAttribute(_ab,'SelectedInboundLegId');var _ae=CQS.Common.elementGetAttribute(_ab,'AdditionalLegsVisible');var _af=CQS.Common.getElementsWithIdContaining(_z.parentNode,"rdSelectLeg");var _ag=CQS.Common.elementGetAttribute(_z,'SectionIsOutbound');if(_ae=='true'){for(var _ah=0;_ah<_af.length;_ah++){var _ai=_af[_ah];var _aj=CQS.Common.elementGetAttribute(_ai.parentNode.parentNode,'SectionIsOutbound');if(_aj==_ag){if(_ai.checked==true){CQS.AT.Flights.FlightResults.SetAllLegsUnSelected(_ai.parentNode.parentNode);}else{_ai.parentNode.parentNode.className=CQS.AT.Flights.FlightResults.RemoveSelectedLegStyle(_ai.parentNode.parentNode.className);CQS.Common.elementSetAttribute(_ai.parentNode.parentNode,'SegmentIsSelected',"false");_ai.checked=false;}}}if(_ag=='true'){_ac=CQS.Common.elementGetAttribute(_z,'LegId');CQS.Common.elementSetAttribute(_ab,'SelectedOutboundLegId',''+_ac+'');}else{_ad=CQS.Common.elementGetAttribute(_z,'LegId');CQS.Common.elementSetAttribute(_ab,'SelectedInboundLegId',''+_ad+'');}CQS.AT.Flights.FlightResults.SetAllLegsSelected(_z);YT_DoAsynchronousCallBack('SetSelectedLegs',_aa+'##'+_ac+'##'+_ad,true);}};this.SetAllLegsSelected=function(s){var _ak=CQS.Common.elementGetAttribute(s,"selectlegid");var _al=s.previousSibling;s.className=CQS.AT.Flights.FlightResults.AddSelectedLegStyle(s.className);CQS.Common.elementSetAttribute(s,'SegmentIsSelected',"true");CQS.AT.Flights.FlightResults.SetCheckBox(s,true);while(_al){if(_al.tagName=="TR"||_al.tagName=="TH"){var _am=CQS.Common.elementGetAttribute(_al,"selectlegid");if(_am){if(_am==_ak){_al.className=CQS.AT.Flights.FlightResults.AddSelectedLegStyle(_al.className);CQS.Common.elementSetAttribute(_al,'SegmentIsSelected',"true");CQS.AT.Flights.FlightResults.SetCheckBox(_al,true);}else{break;}}}_al=_al.previousSibling;}var _an=s.nextSibling;while(_an){if(_an.tagName=="TR"||_an.tagName=="TH"){var _ao=CQS.Common.elementGetAttribute(_an,"selectlegid");if(_ao){if(_ao==_ak){_an.className=CQS.AT.Flights.FlightResults.AddSelectedLegStyle(_an.className);CQS.Common.elementSetAttribute(_an,'SegmentIsSelected',"true");CQS.AT.Flights.FlightResults.SetCheckBox(_an,true);}else{break;}}}_an=_an.nextSibling;}};this.SetCheckBox=function(t,u){r=CQS.Common.getElementWithIdContaining(t,"rdSelectLeg");if(r){r.checked=u;}};this.SetAllLegsUnSelected=function(s){var _ak=CQS.Common.elementGetAttribute(s,"selectlegid");var _al=s.previousSibling;s.className=CQS.AT.Flights.FlightResults.RemoveSelectedLegStyle(s.className);CQS.Common.elementSetAttribute(s,'SegmentIsSelected',"false");CQS.AT.Flights.FlightResults.SetCheckBox(s,false);while(_al){if(_al.tagName=="TR"||_al.tagName=="TH"){var _am=CQS.Common.elementGetAttribute(_al,"selectlegid");if(_am){if(_am==_ak){_al.className=CQS.AT.Flights.FlightResults.RemoveSelectedLegStyle(_al.className);CQS.Common.elementSetAttribute(_al,'SegmentIsSelected',"false");CQS.AT.Flights.FlightResults.SetCheckBox(_al,false);}else{break;}}}_al=_al.previousSibling;}var _an=s.nextSibling;while(_an){if(_an.tagName=="TR"||_an.tagName=="TH"){var _ao=CQS.Common.elementGetAttribute(_an,"selectlegid");if(_ao){if(_ao==_ak){_an.className=CQS.AT.Flights.FlightResults.RemoveSelectedLegStyle(_an.className);CQS.Common.elementSetAttribute(_an,'SegmentIsSelected',"false");CQS.AT.Flights.FlightResults.SetCheckBox(_an,false);}else{break;}}}_an=_an.nextSibling;}};this.AddSelectedLegStyle=function(v){var _ap="selected";var _aq=" ";var _ar=v.trim();if(_ar!=""&&_ar.indexOf(_ap)==-1){_ar=_ar+_aq+_ap;}else if(_ar==""){_ar=_ap;}return _ar;};this.RemoveSelectedLegStyle=function(v){var _ap="selected";var _ar=v.trim();if(_ar.indexOf(_ap)>-1){_ar=_ar.substring(0,_ar.indexOf(_ap));}return _ar.trim();};this.ToggleFlightAdditionalLegs=function(p){var _w=CQS.Common.getElementEndingWithId(document,'divFlightProperties_'+p);var _as=CQS.Common.elementGetAttribute(_w,'AdditionalLegsVisible');if(_as=='true'){CQS.Common.elementSetAttribute(_w,'AdditionalLegsVisible','false');this.RefreshFlight(p);}else{CQS.Common.elementSetAttribute(_w,'AdditionalLegsVisible','true');this.RefreshFlight(p);}RedrawFooter();};this.RefreshFlight1=function(p){var _w=CQS.Common.getElementEndingWithId(document,'divFlightProperties_'+p);var _as=CQS.Common.elementGetAttribute(_w,'AdditionalLegsVisible');var _at=CQS.Common.elementGetAttribute(_w,'SegmentID');if(_as=='false'){var _au=CQS.Common.getElementsWithIdContaining(_w.parentNode,_at);for(var cnt=0;cnt<_au.length;cnt++){var _av=_au[cnt];_av.style["cursor"]="default";_av.className='';}}else{var _au=CQS.Common.getElementsWithIdContaining(_w.parentNode,_at);for(var cnt=0;cnt<_au.length;cnt++){var _av=_au[cnt];_av.style.display='';_av.style["cursor"]="pointer";}}};this.RefreshFlight=function(p){var _w=CQS.Common.getElementEndingWithId(document,'divFlightProperties_'+p);var _as=CQS.Common.elementGetAttribute(_w,'AdditionalLegsVisible');var _aw=CQS.Common.elementGetAttribute(_w,'ShowOtherTimesID');var _ax=CQS.Common.getElementEndingWithId(_w.parentNode,_aw);var _ay=CQS.Common.elementGetAttribute(_w,'FlightLegBodyID');var _az=CQS.Common.elementGetAttribute(_w,'FlightLegRowBottom');var _ba=CQS.Common.getElementEndingWithId(_w.parentNode,_ay);var _bb=CQS.Common.getElementEndingWithId(_w.parentNode,_az);var _at=CQS.Common.elementGetAttribute(_w,'SegmentID');if(_as=='false'){_ba.className='';_bb.style.display='none';_ax.innerHTML=ShowOtherTimes();var _au=CQS.Common.getElementsEndingWithId(_w.parentNode,_at);for(var cnt=0;cnt<_au.length;cnt++){var _av=_au[cnt];var _bc=CQS.Common.elementGetAttribute(_av,'SegmentIsSelected');if(_bc=='false'){_av.style.display='none';}else{var _bd=CQS.Common.elementGetAttribute(_av,'SegmentIsInFirstLeg');var _be=CQS.Common.elementGetAttribute(_av,'SegmentIsFirst');var _bf=CQS.Common.elementGetAttribute(_av,'SectionIsInbound');var _bg=CQS.Common.elementGetAttribute(_av,'SectionIsOutbound');if(_bd=='true'){if(_be=='true'){_av.className='';}else{_av.className='continued';}}else{if(_be=='true'){_av.className='';}else{_av.className='continued';}}var _bh=CQS.Common.elementGetAttribute(_av,'SegmentFirstCellId');var _bi=CQS.Common.elementGetAttribute(_av,'SegmentLastCellId');var _bj=CQS.Common.getElementWithIdContaining(_av.parentNode,_bh);var _bk=CQS.Common.getElementWithIdContaining(_av.parentNode,_bi);_bj.className='';_bk.className='';}_av.style["cursor"]="default";}}else{_ba.className='flight-times';_bb.style.display='';_ax.innerHTML=CloseOtherTimes();var _au=CQS.Common.getElementsEndingWithId(_w.parentNode,_at);for(var cnt=0;cnt<_au.length;cnt++){var _av=_au[cnt];_av.style.display='';var _bd=CQS.Common.elementGetAttribute(_av,'SegmentIsInFirstLeg');var _be=CQS.Common.elementGetAttribute(_av,'SegmentIsFirst');var _bl=CQS.Common.elementGetAttribute(_av,'SegmentIsLastInbound');var _bf=CQS.Common.elementGetAttribute(_av,'SectionIsInbound');var _bg=CQS.Common.elementGetAttribute(_av,'SectionIsOutbound');if(_bd=='true'){if(_be=='true'){if(_bf=='true'){_av.className='return-section';}else if(_bg=='true'){_av.className='';}}else{_av.className='continued';}}else{if(_be=='true'){_av.className='';}else{_av.className='continued';}}var _bc=CQS.Common.elementGetAttribute(_av,'SegmentIsSelected');_bb.className='continued';if(_bc=='true'){_av.className=_av.className+' selected';if(_bl=='true'){_bb.className='continued selected';}}_av.style["cursor"]="pointer";}}};this.RefreshResultsCounters=function(w,x){if(parseInt(x)>0){CQS.Common.getElementWithIdContaining(document,'lblVisibleResultsCount').innerHTML=w;CQS.Common.getElementWithIdContaining(document,'divResultsCounters').style.display="inline";}else{CQS.Common.getElementWithIdContaining(document,'divResultsCounters').style.display="none";}};};;CQS.Hover=new function(){var i=document.createElement("div");var j=document.createElement("div");var k=document.createElement("div");var l,m,n,o,p,q,r,t,u,v,w,y,z,_a,_b,_c,_d,_e,_f,_g;_e=false;u=10;v=10;p=0;q=0;this.init=function(){i.style.position="absolute";i.style.display='none';i.isVisible='false';document.body.insertBefore(i,document.body.firstChild);};var _h=function(){};var _i=function(){j.innerHTML='<img  style="vertical-align:middle"  src="info.gif">&nbsp;&nbsp;'+j.innerHTML;j.style.fontWeight='bold';j.style._y='150px';j.style.fontFamily='arial';j.style.border='1px solid #A5CFE9';j.style.padding='3';j.style.fontSize='11';j.style.color='#4B7A98';j.style.background='#D5EBF9';j.style.filter='alpha(opacity=85)';j.style.opacity='0.85';};var _j=function(){k.style.borderBottom='1px solid #A5CFE9';k.style.borderLeft='1px solid #A5CFE9';k.style.borderRight='1px solid #A5CFE9';k.style._y='150px';k.style.fontFamily='arial';k.style.fontSize='11';k.style.padding='3';k.style.color='#1B4966';k.style.background='#FFFFFF';k.style.filter='alpha(opacity=85)';k.style.opacity='0.85';};var _k=function(a){if(!a||typeof(a)!='string')return false;if((a.indexOf('div=')>-1||a.indexOf('body=')>-1)&&(a.indexOf('[')>-1)&&(a.indexOf('[')>-1))return true;else return false;};var _l=function(b){if(_k(b.title)){b.boHDR=_m('CQS.Hover.header',b.title);b.boBDY=_m('CQS.Hover.body',b.title);b.boDIV=_m('CQS.Hover.div',b.title);b.boCSSMAIN=_m('CQS.Hover.cssmain',b.title);b.boCSSBDY=_m('CQS.Hover.cssbody',b.title);b.boCSSHDR=_m('CQS.Hover.cssheader',b.title);b.IEbugfix=(_m('CQS.Hover.hideselects',b.title)=='on')?true:false;b.fixX=parseInt(_m('CQS.Hover.fixedrelx',b.title));b.fixY=parseInt(_m('CQS.Hover.fixedrely',b.title));b.absX=parseInt(_m('CQS.Hover.fixedabsx',b.title));b.absY=parseInt(_m('CQS.Hover.fixedabsy',b.title));b.offY=(_m('CQS.Hover.offsety',b.title)!='')?parseInt(_m('offsety',b.title)):10;b.offX=(_m('CQS.Hover.offsetx',b.title)!='')?parseInt(_m('offsetx',b.title)):10;b.fade=(_m('CQS.Hover.fade',b.title)=='on')?true:false;b.fadespeed=(_m('CQS.Hover.fadespeed',b.title)!='')?_m('fadespeed',b.title):0.04;b.delay=(_m('CQS.Hover.delay',b.title)!='')?parseInt(_m('delay',b.title)):0;if(_m('CQS.Hover.requireclick',b.title)=='on'){b.requireclick=true;document.all?b.attachEvent('onclick',showHideBox):b.addEventListener('click',showHideBox,false);document.all?b.attachEvent('onmouseover',hideBox):b.addEventListener('mouseover',hideBox,false);}else{if(_m('CQS.Hover.doubleclickstop',b.title)!='off'){document.all?b.attachEvent('ondblclick',_ad):b.addEventListener('dblclick',_ad,false);}if(_m('CQS.Hover.singleclickstop',b.title)=='on'){document.all?b.attachEvent('onclick',_ad):b.addEventListener('click',_ad,false);}}b.windowLock=_m('windowlock',b.title).toLowerCase()=='off'?false:true;b.title='';b.hasbox=1;}else{b.hasbox=2;}};var _m=function(c,f){var reg=new RegExp('([^a-zA-Z]'+c+'|^'+c+')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]');var _n=reg.exec(f);var _o;if(_n){return _n[2].replace('[[','[').replace(']]',']');}else{return'';}};var _p=function(g){var x=0;if(g.calcLeft){return g.calcLeft;}var _q=g;while(g){if((g.currentStyle)&&(!isNaN(parseInt(g.currentStyle.borderLeftWidth)))&&(x!=0)){x+=parseInt(g.currentStyle.borderLeftWidth);}x+=g.offsetLeft;g=g.offsetParent;}_q.calcLeft=x;return x;};var _r=function(g){var x=0;if(g.calcTop){return g.calcTop;}var _q=g;while(g){if((g.currentStyle)&&(!isNaN(parseInt(g.currentStyle.borderTopWidth)))&&(x!=0)){x+=parseInt(g.currentStyle.borderTopWidth);}x+=g.offsetTop;g=g.offsetParent;}_q.calcTop=x;return x;};var ah,ab;var _s=function(){if(ab){i.removeChild(k);}if(ah){i.removeChild(j);}_w.boCSSMAIN?i.className=_w.boCSSMAIN:_h();ah=false;ab=false;if(_w.boHDR!=''){j=document.createElement("div");_w.boCSSHDR?j.className=_w.boCSSHDR:_i();j.innerHTML=_w.boHDR;i.appendChild(j);ah=true;}if(_w.boBDY!=''){k=document.createElement("div");_w.boCSSBDY?k.className=_w.boCSSBDY:_j();k.innerHTML=_w.boBDY;i.appendChild(k);ab=true;}if(_w.boDIV!=''){k=document.createElement("div");_w.boCSSBDY?k.className=_w.boCSSBDY:_j();k.innerHTML=document.getElementById(_w.boDIV).innerHTML;i.appendChild(k);ab=true;}};var _t,_u,_v,_w,_x,_g,_f,_y,_z;var ini=false;var SHW=function(){if(document.body&&(document.body.clientWidth!=0)){_y=document.body.clientWidth;_z=document.body.clientHeight;}if(document.documentElement&&(document.documentElement.clientWidth!=0)&&(document.body.clientWidth+20>=document.documentElement.clientWidth)){_y=document.documentElement.clientWidth;_z=document.documentElement.clientHeight;}return[_y,_z];};this.timerID=null;var _aa=false;var _ab=true;this.moveMouse=function(e){_ab=false;if(_aa==false){_aa=true;_ab=true;e?_b=e:_b=event;_t=_b.target?_b.target:_b.srcElement;if(!_t.hasbox){iElem=_t;while((iElem.parentNode)&&(!iElem.hasbox)){_l(iElem);iElem=iElem.parentNode;}}if(!_ab){_aa=false;return;}if((_t!=_v)&&(!_ag(_t,j))&&(!_ag(_t,k))){if(!_t.boxItem){_u=_t;while((_u.hasbox==2)&&(_u.parentNode)){_u=_u.parentNode;}_t.boxItem=_u;}_u=_t.boxItem;if(!_ab){_aa=false;return;}if(_t.boxItem&&(_t.boxItem.hasbox==1)){_x=_w;_w=_u;if(_w!=_x){_s();if(!_w.requireclick&&_ab){if(_w.fade){if(this.timerID!=null)clearTimeout(this.timerID);this.timerID=setTimeout("CQS.Hover.fadeIn1("+_w.fadespeed+")",_w.delay);}else{if(this.timerID!=null){clearTimeout(this.timerID);}COL=1;if(_x){if(_x.hasbox==1){this.timerID=null;}else{if(_w.delay==0){CQS.Hover.showHideBox();CQS.Hover.timerID=null;}else{this.timerID=setTimeout("CQS.Hover.showHideBox();CQS.Hover.timerID=null;",_w.delay);}}}else{if(_w.delay==0){CQS.Hover.showHideBox();CQS.Hover.timerID=null;}else{this.timerID=setTimeout("CQS.Hover.showHideBox();CQS.Hover.timerID=null;",_w.delay);}}}}if(!_ab){this.timerID=null;}if(_w.IEbugfix){_aj();}n=!isNaN(_w.fixX)?_p(_w)+_w.fixX:_w.absX;o=!isNaN(_w.fixY)?_r(_w)+_w.fixY:_w.absY;p=0;q=0;m=true;u=_w.offX?_w.offX:10;v=_w.offY?_w.offY:10;}}else if(!_ag(_t,j)&&!_ag(_t,k)&&(m)){if(!_ab){_aa=false;return;}if((!_ag(_w,_t))||(_t.tagName!='TABLE')){_w=null;if(this.timerID!=null){clearTimeout(this.timerID);}_af();_ai();}}if(!_ab){_aa=false;return;}_v=_t;}else if(((_ag(_t,j)||_ag(_t,k))&&(m))){_g=0;_f=0;if(!_ab){_aa=false;return;}_u=_t;while(_u){if(!isNaN(parseInt(_u.scrollTop))){_f+=parseInt(_u.scrollTop);}if(!isNaN(parseInt(_u.scrollLeft))){_g+=parseInt(_u.scrollLeft);}_u=_u.parentNode;}if(!_ab){_aa=false;return;}if(_w!=null){w=_p(_w)-_g;y=parseInt(_p(_w)+_w.offsetWidth)-_g;z=_r(_w)-_f;_a=parseInt(_r(_w)+_w.offsetHeight)-_f;_ac();}}if(!_ab){_aa=false;return;}if(m&&_w){bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;_c=_b.pageX?_b.pageX-bodyScrollLet:_b.clientX-document.body.clientLeft;_d=_b.pageY?_b.pageY-bodyScrollTop:_b.clientY-document.body.clientTop;if(!_ab){_aa=false;return;}_d<-v?q=-_d-v:q=0;_c<-u?p=-_c-u:p=0;_d>(SHW()[1]-i.offsetHeight-v)?q=-_d+SHW()[1]-i.offsetHeight-v:q=q;_c>(SHW()[0]-k.offsetWidth-u)?p=-_c-u+SHW()[0]-k.offsetWidth:p=p;i.style.left=((n)||(n==0))?n:bodyScrollLet+_c+u+p-10+"px";i.style.top=((o)||(o==0))?o:bodyScrollTop+_d+v+q+"px";}_aa=false;}};var _ac=function(){if((_c<w)||(_c>y)||(_d<z)||(_d>_a)){if(!_w.requireclick){_af();}if(_w.IEbugfix){_ai();}_w=null;}};var _ad=function(e){e?_b=e:_b=event;m=false;_b.cancelBubble=true;};this.showHideBox=function(e){if(i.isVisible=='false'){i.style.display='block';i.isVisible='true';}else{i.style.display='none';i.isVisible='false';}};function hideBox(e){i.style.display='none';i.isVisible='false';};var COL=0;var _ae=false;this.fadeIn1=function(h){this.timerID=null;COL=0;i.style.display='block';i.isVisible='true';fadeIn2(h);};this.fadeIn2=function(h){COL=COL+h;COL=(COL>1)?1:COL;i.style.filter='alpha(opacity='+parseInt(100*COL)+')';i.style.opacity=COL;if(COL<1){setTimeout("CQS.Hover.fadeIn2("+h+")",20);}};var _af=function(){i.style.display='none';i.isVisible='false';};var _ag=function(s,d){while(s){if(s==d){return true;}s=s.parentNode;}return false;};var _ah;this.checkMove=function(e){e?_b=e:_b=event;_ah=_b.target?_b.target:_b.srcElement;if((!m)&&(!_ag(_ah,i))){_af();if(_w&&_w.IEbugfix){_ai();}m=true;_w=null;}};var _ai=function(){};var _aj=function(){};};CQS.Common.addEvent(window,'load',CQS.Hover.init);CQS.Common.addEvent(document,'mousemove',CQS.Hover.moveMouse);CQS.Common.addEvent(document,'click',CQS.Hover.checkMove);(function(){window['Madurodam']={};})();Madurodam.Block=new function(){var c;this.init=function(a,b){if(!$defined(c)){c=$('ifYTBlock');c.src=a;}if(!$defined(c)){c=new IFrame({'frameBorder':'0','src':a,'allowTransparency':true,'scrolling':'no','class':'waitScreenBlockIFrame','styles':{'top':0,'left':0,'border':'none','zIndex':10000,'display':'none','position':'absolute','opacity':b}});document.body.insertBefore(c,document.body.firstChild);}};var d=false;this.setup=function(b){if($defined(b)){c.setStyle('opacity',b);}};this.show=function(b){d=false;if($defined(b)){c.setStyle('opacity',b);}SetBlockWidthAndHight();c.setStyle('position','absolute');c.setStyle('display','block');};this.redraw=function(){if($defined(c)){if(c.getStyle('display')==="block"){SetBlockWidthAndHight();}}};this.hide=function(){d=true;setTimeout("Madurodam.Block.private_hide()",200);};this.private_hide=function(){if(typeof(c)!='undefined'){if(c.style.display=="block"&&d){c.setStyle('display','none');d=false;}}};this.isVisible=function(){if(!$defined(c)){return true;}return(c.getStyle('display')==='block');};function SetBlockWidthAndHight(){if($(window).getScroll().x>0){if(BrowserDetect.browser==='Safari'||BrowserDetect.browser==='Chrome'){if(window.getScrollSize().y>window.getSize().y){c.setStyle('width',$(window).getScrollSize().x-18+'px');}else{c.setStyle('width',$(window).getScrollSize().x+'px');}}else{c.setStyle('width',$(window).getScrollSize().x+'px');}}else{if(BrowserDetect.browser==='Safari'||BrowserDetect.browser==='Chrome'){if(window.getScrollSize().y>window.getSize().y){c.setStyle('width',$(window).getSize().x-18+'px');}else{c.setStyle('width',$(window).getSize().x+'px');}}else{c.setStyle('width',$(window).getSize().x+'px');}}c.setStyle('height',$(window).getScrollSize().y+'px');};}();window.addEvent('ondomready',function(){Madurodam.Block.init(GetBlockSRC(),0.5);window.addEvent('resize',Madurodam.Block.redraw);window.addEvent('scroll',Madurodam.Block.redraw);});Madurodam.Ajax=new function(){this.doCallback=function(a,d,f){if(_m()){this._ajax.doCallback(a,d,f);}};this.reloadUpdatePanel=function(a,d,g,f){if(_m()){this._ajax.reloadUpdatePanel(a,d,g,f);}};this.doCallbackAndReloadUpdatePanel=function(a,d,g,h,j,f){if(_m()){this._ajax.doCallbackAndReloadUpdatePanel(a,d,g,h,j,f);}};this.doCallbackAndReloadMainContent=function(a,d,f){if(_m()){if(typeof(Madurodam_GetContentUpdatePanelID)!='undefined'&&typeof(Madurodam_GetContentUpdatePanelCallbackID)!='undefined'&&typeof(Madurodam_GetContentUpdatePanelCallbackData)!='undefined'){this._ajax.doCallbackAndReloadUpdatePanel(a,d,Madurodam_GetContentUpdatePanelID(),Madurodam_GetContentUpdatePanelCallbackID(),Madurodam_GetContentUpdatePanelCallbackData(),f);}}};this.doCallbackToDifferentUrl=function(a,d,k,f){this._ajax.doCallbackToDifferentUrl(a,d,k,f);};this.expandTemplate=function(a,d,l,m,f){if(f==undefined||f==null){f=new Object();}f.templateElementId=l;f.targetElementId=m;f.onCompleteHandler=_l;this._ajax.doCallback(a,d,f);};this.abortAllCallbacks=function(){this._ajax.abortAllCallbacks();};this.registerScript=function(o){var _j=document.getElementsByTagName('head')[0];var _k=$(document.createElement('script'));_k.setProperty('type','text/javascript');_k.text=o;_j.appendChild(_k);};var _l=function(p,q){_expandTemplate(q.templateElementId,q.targetElementId,p)};var _m=function(){if(BrowserDetect.browser==='Safari'||BrowserDetect.browser==='Chrome'){return true;}if(navigator){if(typeof(navigator.onLine)==='undefined'){return true;}if(!navigator.onLine){alert("Your browser is currently in offline mode. Please set your browser to run in online mode and refresh this page.");return false;}}return true;};this._ajax=new function(){var _n=new Array();this.doCallback=function(a,d,f){_q(a,d,undefined,undefined,undefined,false,_p(),f);};this.reloadUpdatePanel=function(a,d,g,f){_q(undefined,undefined,g,a,d,true,_p(),f);};this.doCallbackAndReloadUpdatePanel=function(a,d,g,h,j,f){_q(a,d,g,h,j,true,_p(),f);};this.doCallbackToDifferentUrl=function(a,d,k,f){_q(a,d,undefined,undefined,undefined,false,k,f);};this.abortAllCallbacks=function(){var _o=_n.length;var ii=_o;while(ii-->0){if(_n[ii]!=null&&_n[ii]!=undefined){_n[ii].xmlRequest.abort();}}_n.length=0;};this.isCallbackComplete=function(a){var _o=_n.length;var ii=_o;while(ii-->0){if(_n[ii]!=null&&_n[ii]!=undefined){if(_n[ii].ajaxCallbackId.indexOf(a)>-1){return'false';}}}return'true';};var _p=function(){if(typeof(AjaxCallbackURL)!='undefined'){return AjaxCallbackURL();}return undefined;};var _q=function(a,d,g,h,j,r,k,f){var _postData=_ac(a,d,g,h,j,f);var _r=_s(a,h,g,r,f);_t(_r,_u,k,_postData);};var _s=function(a,h,g,r,f){var _r=new Object();_r.ajaxCallbackId=a;_r.updatePanelCallbackID=h;_r.updatePanelID=g;if(r){_r.eventOnCompleteCallback=_ay;_r.eventOnErrorCallback=_bi;}else{_r.eventOnCompleteCallback=_aw;_r.eventOnErrorCallback=_ax;}if(f!=undefined&&f!=null){_r.clientOnCompleteCallback=f.onCompleteHandler;_r.clientOnErrorCallback=f.onErrorHandler;_r.templateElementId=f.templateElementId;_r.targetElementId=f.targetElementId;}_r.async=true;_z(_n,_r);return _r;};var _t=function(s,t,k,u){var _xmlRequest=_ab();_xmlRequest.onreadystatechange=t;s.xmlRequest=_xmlRequest;if($defined(k)){_xmlRequest.open("POST",k,true);}else{_xmlRequest.open("POST",window.document.forms[0].action,true);}_xmlRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");_xmlRequest.send(u);};var _u=function(){for(i=0;i<_n.length;i++){callbackObject=_n[i];if(callbackObject&&callbackObject.xmlRequest&&(callbackObject.xmlRequest.readyState==4)){_n[i]=null;_v(callbackObject);return;}}};var _v=function(v){var response=v.xmlRequest.responseText;if(response.charAt(0)=="s"){if((typeof(v.eventOnCompleteCallback)!="undefined")&&(v.eventOnCompleteCallback!=null))v.eventOnCompleteCallback(response.substring(1),v);}else if(response.charAt(0)=="e"){if((typeof(v.eventOnErrorCallback)!="undefined")&&(v.eventOnErrorCallback!=null))v.eventOnErrorCallback(response.substring(1),v);}else{var _w=response.indexOf("|");if(_w!=-1){var _x=parseInt(response.substring(0,_w));if(!isNaN(_x)){var _y=response.substring(_w+1,_w+_x+1);if((typeof(v.eventOnCompleteCallback)!="undefined")&&(v.eventOnCompleteCallback!=null)){v.eventOnCompleteCallback(response.substring(_w+_x+1),v);}}}}};var _z=function(w,x){var i;for(i=0;i<w.length;i++){if(!w[i])break;}w[i]=x;return i;};var _aa=function(y){if(encodeURIComponent){return encodeURIComponent(y);}else{return escape(y).replace(/\=/gi,"%3d").replace(/\+/gi,"%2b").replace(/\&/gi,"%26").replace(/\?/gi,"%3F");}};var _ab=function(){var _xmlRequest,e;try{_xmlRequest=new XMLHttpRequest();}catch(e){try{_xmlRequest=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}return _xmlRequest;};var _ac=function(a,d,g,h,j,f){var _callbackObject=new Object();if(a!=null&&a!=undefined){_callbackObject.A=a;}if(h!=null&&h!=undefined){_callbackObject.C=h;}if(f!=undefined&&f!=null){if(f.stateContainerId!=undefined&&f.stateContainerId!=null){var _ad=new Array();var _ae=new Array();if(_aj(_ad,_ae,f)){_callbackObject.E=_ad;_callbackObject.F=_ae;}}}if($defined(g)){_callbackObject.G=g;}if(d===null&&d===undefined){d='';}if(j===null&&j===undefined){j='';}var _af=JSON.encode(d);var _ag=JSON.encode(j);var _ah=JSON.encode(_callbackObject);_ah=_ah+'___'+_af+'___'+_ag;var _ai=document.getElementById('hidvsid').value;return"__EVENTTARGET=&__CALLBACKID=__Page&hidvsid="+_ai+"&__CALLBACKPARAM="+_aa(_ah);};var _aj=function(z,_a,f){var _stateObjectContainer=$(f.stateContainerId);if(_stateObjectContainer!=undefined){var _ak=_stateObjectContainer.getElementsByTagName('input');if(_ak.length>0){for(var _al=0;_al<_ak.length;_al++){var _am=_ak[_al];if(_am.id!=undefined&&_am.id.length>0){if(_am.type=='radio'||_am.type=='checkbox'){if(_am.checked){z[z.length]=_am.id;_a[_a.length]='true';}else{z[z.length]=_am.id;_a[_a.length]='false';}}else{if(_am.type!='button'){z[z.length]=_am.id;_a[_a.length]=_am.value;}}}}}_an(z,_a,_stateObjectContainer,'select');_an(z,_a,_stateObjectContainer,'textarea');if(z.length>0){return true;}}return false;};var _an=function(z,_a,_b,_c){var _ctls=_b.getElementsByTagName(_c);if(_ctls.length>0){for(var _ao=0;_ao<_ctls.length;_ao++){var _ap=_ctls[_ao];if(_ap.id!=undefined&&_ap.id.length>0){z[z.length]=_ap.id;_a[_a.length]=_ap.value;}}}};var _aq=function(_d){var _resultArray=_d.split("___");var _ar=_resultArray[0];var _as=_resultArray[2];if(_as.length>0){eval(_as);}return _ar;};var _at=function(_d){return _d.split("___")[0];};var _au=function(_d){return _d.split("___")[1];};var _av=function(_d){return _d.split("___")[2];};var _aw=function(_e,q){var _az=_aq(_e);if(_az.indexOf("__Error")>=0){_ax(_az.substring(7,_az.length),q);_az="";return;}if(q.clientOnCompleteCallback!=undefined&&q.clientOnCompleteCallback!='undefined'){q.clientOnCompleteCallback(JSON.decode(_az,true),q);}};var _ax=function(_e,q){if(q.clientOnErrorCallback!=undefined&&q.clientOnErrorCallback!='undefined'){var _jsonDecoded=JSON.decode(_e,true);q.clientOnErrorCallback(_jsonDecoded,q.ajaxCallbackId);}};var _ay=function(_e,q){var _responseJS=_av(_e);var _az=_at(_e);_e=_au(_e);var _ba=q.updatePanelID;if(_az.indexOf("__Error")>=0){_bi(_az.substring(7,_az.length),q);return;}var _bb=document.getElementById(_ba);var _bc=document.createElement("div");_bc.style.display="none";_bc.innerHTML=_e;var _bd=_bj(_bc,_ba);var _be=_bb.parentNode;if(_bd!=null&&_be!=null){_bd.parentNode.removeChild(_bd);var _bf=_bn(_bb);if(_bf!=null){_be.insertBefore(_bd,_bf);}else{_be.appendChild(_bd);}_be.removeChild(_bb);_bc=null;}if(_responseJS!=null&&_responseJS.length>0){eval(_responseJS);}var _bg=JSON.decode(_az,true);if(q.clientOnCompleteCallback!=undefined&&q.clientOnCompleteCallback!='undefined'){q.clientOnCompleteCallback(_bg,q);}var _bh=new Array();_bh[0]=_bg;_bh[1]=q;window.fireEvent('updatepanelcomplete',_bh);};var _bi=function(_e,q){if(q.clientOnErrorCallback!=undefined&&q.clientOnErrorCallback!='undefined'){var _az=_at(_e);q.clientOnErrorCallback(JSON.decode(_az,true),q.updatePanelCallbackID);}};var _bj=function(_f,_g){var _foundElement=null;var _bk=_f.getElementsByTagName('*');var _bl=_bk.length;for(var cnt=0;cnt<_bl;cnt++){var _bm=_bk[cnt];if(!_bm.id)continue;if(_bm.id+""==_g+""){_foundElement=_bm;break;}}return _foundElement;};var _bn=function(_h){while(_h!=null){if(_h._bf){_h=_h._bf;}else{_h=null;}if(_h){if(_h.nodeType==1){break;}}}return _h;};};}();var _bo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";if(!String.prototype.b){String.prototype.b=function(){var _bp=this.length;var _bq=new String();var _i,_b1,_b2,_b3;for(_i=0;_i<_bp;_i+=3){_b1=this.charCodeAt(_i);_b2=this.charCodeAt(_i+1);_b3=this.charCodeAt(_i+2);_bq+=(_bo.charAt(_b1>>2))+(_bo.charAt(((_b1&3)<<4)|((_i+1<_bp)?(_b2>>4):0)))+((_i+1<_bp)?_bo.charAt(((_b2&15)<<2)|((_i+2<_bp)?(_b3>>6):0)):"=")+((_i+2<_bp)?_bo.charAt(_b3&63):"=");}return _bq;};};if(!String.prototype.en){String.prototype.en=function(){var _bq=new String();var _bp=this.length;for(var _i=_bp-1;_i>=0;_i--){_bq+=this.charAt(_i);}return _bq;};};if(!String.prototype.encodeUTF8){String.prototype.encodeUTF8=function(){var _br=this.replace(/\r\n/g,"\n");var _bs="";for(var n=0;n<_br.length;n++){var c=_br.charCodeAt(n);if(c<128){_bs+=String.fromCharCode(c);}else if((c>127)&&(c<2048)){_bs+=String.fromCharCode((c>>6)|192);_bs+=String.fromCharCode((c&63)|128);}else{_bs+=String.fromCharCode((c>>12)|224);_bs+=String.fromCharCode(((c>>6)&63)|128);_bs+=String.fromCharCode((c&63)|128);}}return _bs;};};var l=10001;Madurodam.Popup=function(a,b,c){l++;var m;var n=false;var o=false;if(b=='MAX'||b=='max'){b=0;n=true;}if(a=='MAX'||a=='max'){a=0;o=true;}if(b=='CLEAR'||b=='clear'||a=='CLEAR'||a=='clear'){b=-1;a=-1;}var p=b;var q=a;if($defined(c.elementId)){m=$(c.elementId);m.setStyles({'position':'absolute','zIndex':l});}else{m=new Element("IFRAME").set({'frameBorder':'0','src':c.URL,'allowTransparency':true,'scrolling':'no','styles':{'border':'none','zIndex':l+'','position':'absolute','display':'none'}});}if(b>-1&&a>-1){m.setStyles({'height':b+'px','width':a+'px'});}document.body.insertBefore(m,document.body.firstChild);window.addEvent('resize',redrawCenterFromEvent);window.addEvent('scroll',redrawCenterFromEvent);this.show=function(d,e,f){l++;m.setStyle('zIndex',l+'');m.style.top=e+'px';m.style.left=d+'px';if($defined(c.blockBackground)&&c.blockBackground){if($defined(Madurodam.Block)){if(!Madurodam.Block.isVisible()){if($defined(f)){Madurodam.Block.setup(f);}Madurodam.Block.show();}}}m.setStyles({'position':'absolute','display':'block'});};var r=new Date().getTime();var s=false;var t=400;var u=false;function tryRedrawCenter(g){if(g){r=new Date().getTime();if(u){return;}}if(g){u=true;}if(!s){var v=new Date();if(v.getTime()>(r+t)&&!g){s=true;redrawCenter();s=false;u=false;}else{setTimeout(function(){tryRedrawCenter();},100);}}else{setTimeout(function(){tryRedrawCenter();},100);}};function redrawCenterFromEvent(){if($defined(m)&&m.style.display=='block'){tryRedrawCenter(true);}};var w=null;function redrawCenter(){if(m.style.display=='block'){if(w==null){w=new Fx.Morph(m,{duration:1000,transition:'expo:out'});}var z;if(p>(window.getSize().y-20)||n){z=window.getSize().y-20;}else{z=p;}var _a;if(q>(window.getSize().x-20)||o){_a=window.getSize().x-20;}else{_a=q;}if(BrowserDetect.browser==='Safari'||BrowserDetect.browser==='Chrome'){if(window.getScrollSize().x>window.getSize().x){z=z-30;}}if(b==-1||a==-1){var _b=$(window).getScroll().y+(window.getSize().y/2)-($(m).getSize().y/2)+'px';var _c=$(window).getScroll().x+(window.getSize().x/2)-($(m).getSize().x/2)+'px';w.start({'top':_b,'left':_c}).chain(redrawPopupContainer);}else{var _b=$(window).getScroll().y+(window.getSize().y/2)-(z/2)+'px';var _c=$(window).getScroll().x+(window.getSize().x/2)-(_a/2)+'px';w.start({'top':_b,'left':_c,'width':_a+'px','height':z+'px'}).chain(redrawPopupContainer);}}};function redrawPopupContainer(){Madurodam.Notification.redraw();};this.clearDimensions=function(){m.setStyles({'width':'','height':''});};this.showCenter=function(f,h,i){if(m.style.position=='absolute'){l++;if($defined(h)){if(h=='MAX'||h=='max'){h=0;o=true;}q=h;}if($defined(i)){if(i=='MAX'||i=='max'){i=00;n=true;}p=i;}m.setStyle('zIndex',l+'');m.style.top=($(window).getScroll().y+(window.getSize().y/2))-($(m).getStyle("height").toInt()/2)+'px';m.style.left=$(window).getScroll().x+(window.getSize().x/2)-($(m).getStyle("width").toInt()/2)+'px';if($defined(c.blockBackground)&&c.blockBackground){if($defined(Madurodam.Block)){if($defined(f)){Madurodam.Block.setup(f);}if(!Madurodam.Block.isVisible()){Madurodam.Block.show();}}}m.setStyles({'position':'absolute','display':'block'});redrawCenter();}};this.setSrc=function(j){m.src=j;};this.hide=function(k){if($defined(k)&&k==false){}else{if($defined(c.blockBackground)&&c.blockBackground){Madurodam.Block.hide();}}m.setStyle('display','none');};this.frame=m;};Madurodam.FilteringBox=new function(){var g;var h=false;var i=false;var j=false;var k=true;this.init=function(a){if($defined($(a))){g=new Madurodam.Popup('CLEAR','CLEAR',{elementId:a,blockBackground:true});}};this.show=function(b,c,d){if($defined(g)){if(!h){h=true;if($defined(Madurodam.Block)){if(!Madurodam.Block.isVisible()){Madurodam.Block.setup(d);}}if($defined(c)){SetFilteringBoxProperties(c);}g.showCenter();i=false;j=false;k=true;if($defined(b)&&b>0){setTimeout(MinDisplayTimeEnd,b);}else{i=true;}}}};this.hide=function(e){if($defined(g)){if(i){g.hide(e);h=false;i=false;j=false;}else{j=true;k=e;}}};function MinDisplayTimeEnd(){i=true;if(j){Madurodam.FilteringBox.hide(k);}};};function ShowFilteringScreen(f){Madurodam.FilteringBox.show(1000,f,0.2);};function HideFilteringScreen(){Madurodam.FilteringBox.hide(true);};function CancelFilteringScreen(e){Madurodam.FilteringBox.hide(true);};window.addEvent('ondomready',function(){Madurodam.FilteringBox.init('divFilteringBox');});Madurodam.LoadingBox=new function(){var g;var h=false;var i=false;var j=false;var k=true;this.init=function(a){if($defined($(a))){g=new Madurodam.Popup('CLEAR','CLEAR',{elementId:a,blockBackground:true});}};this.show=function(b,c,d,e){if($defined(g)){if(!h){h=true;if($defined(Madurodam.Block)){if(!Madurodam.Block.isVisible()){Madurodam.Block.setup(d);}}if($defined(c)){SetLoadingBoxProperties(c,e);}g.showCenter();i=false;j=false;k=true;if($defined(b)&&b>0){setTimeout(MinDisplayTimeEnd,b);}else{i=true;}}}};this.hide=function(f){if($defined(g)){if(i){g.hide(f);h=false;i=false;j=false;}else{j=true;k=f;}}};function MinDisplayTimeEnd(){i=true;if(j){Madurodam.LoadingBox.hide(k);}};};function ShowWaitingScreen(c,e){Madurodam.LoadingBox.show(0,c,0.5,e);};function HideWaitingScreen(f){Madurodam.LoadingBox.hide(f);};function CancelWaitingScreen(f){CQS.AT.MessageBox.cancelLoadingBox();Madurodam.LoadingBox.hide(f);};window.addEvent('ondomready',function(){Madurodam.LoadingBox.init('divLoadingBox');});Madurodam.Notification=new function(){function NotificationElement(a,b,c,d,f,g){this.ElementID=a+'';this.Visible=false;this.ContainerID=b;this.HeaderID=d;this.TextID=c;this.OffsetLeft=0;if($defined(f)){this.OffsetLeft=f;}this.OffsetTop=0;if($defined(g)){this.OffsetTop=g;}};var t=new Array();var u=function(a,b,c,d,f,g){t[t.length]=new NotificationElement(a,b,c,d,f,g);};var v=function(h){for(var i=0;i<t.length;i++){if(t[i].ElementID==h){return t[i];}}return null;};this.initType=function(j,f,g){var w=$$(j+'[NotificationEnabled=true]');for(var i=0;i<w.length;i++){if(w[i].id!=null&&w[i].id.length>0){var z=document.createElement('div');z.id=w[i].id+'_NotifyContainer';z.style.zIndex=999999;z.style.display='none';z.className='notificationpopup';var _a=document.createElement('div');_a.className='np-top';z.appendChild(_a);var _b=document.createElement('div');_b.className='np-body';z.appendChild(_b);var _c=document.createElement('h1');_c.id=w[i].id+'_TextHeader';_b.appendChild(_c);var _d=document.createElement('p');_d.id=w[i].id+'_TextContainer';_d.innerHTML='No body text provided';_b.appendChild(_d);var _e=document.createElement('div');_e.className='np-bottom';z.appendChild(_e);document.body.appendChild(z);var _f=$(w[i].parentNode);while(_f&&!isBody(_f)){if(_f.getStyle('overflow')=='auto'){try{_f.removeEvent('scroll',Madurodam.Notification.hideAll);}catch(e){}_f.addEvent('scroll',Madurodam.Notification.hideAll);}_f=$(_f.parentNode);}u(w[i].id,z.id,_d.id,_c.id,f,g);}};};function isBody(k){return(/^(?:body|html)$/i).test(k.tagName);};this.show=function(l,m,n){var o=v(l);if($defined(o)){var _g='Not Valid';if($defined(m)&&m.length>0){_g=m;}var _h=undefined;if($defined(n)&&n.length>0){_h=n;}_i(o,l,_g,_h);return true;}return false;};var _i=function(o,h,m,p){var _m=$(o.ContainerID);var _j=$(o.HeaderID);var _k=$(o.TextID);var _l=$(h);if($defined(p)&&p.length>0){_j.innerHTML=p;_j.style.height='';}else{_j.style.height='0px';}if($defined(m)&&m.length>0){_k.innerHTML=m;}try{_l.focus();_l.select();}catch(e){}o.Visible=true;setTimeout('Madurodam.Notification._displayNotification("'+h+'")',100);};this._displayNotification=function(q){var o=v(q);var _m=$(o.ContainerID);var _l=$(q);var _n=_l.getOffsets();var _o;if(BrowserDetect.browser==='Firefox'){var _p=_l.getScrolls();_o={x:_n.x-_p.x,y:_n.y-_p.y};}else{_o=_n;}_m.x=_o.x+o.OffsetLeft+_l.getSize().x;_m.y=_o.y+_l.getSize().y+o.OffsetTop;_m.style.left=_m.x+'px';_m.style.top=_m.y+'px';_m.style.display='block';};this.redraw=function(){for(var _q=0;_q<t.length;_q++){if(t[_q].Visible){Madurodam.Notification._displayNotification(t[_q].ElementID);}}};this.hide=function(h){var o=v(h);if($defined(o)){$(o.ContainerID).style.display='none';o.Visible=false;return true;}return false;};this.hideAll=function(){for(var _q=0;_q<t.length;_q++){Madurodam.Notification.hide(t[_q].ElementID);}};var _r=function(r,s){var totaloffset=(s=='left')?r.offsetLeft:r.offsetTop;var _s=r.offsetParent;while(_s!=null){totaloffset=(s=='left')?totaloffset+_s.offsetLeft:totaloffset+_s.offsetTop;_s=_s.offsetParent;}return totaloffset;};var _t=function(){return(document.compatMode&&document.compatMode!='BackCompat')?document.documentElement:document.body};};Madurodam.Validate=new function(){this.NumericInput=function(a,b){var _ab=9999;if($defined(b)){_ab=b;}if(a.value.length==0){return;}var _ac='';for(var cnt=0;cnt<a.value.length;cnt++){var _ad=a.value.substring(cnt,cnt+1);if(Madurodam.Validate.IsNumericChar(_ad)){if(_ac.length<b){_ac+=a.value.substring(cnt,cnt+1);}}}if(a.value.length!=_ac.length){a.value=_ac;}return;};this.IsAlphaChar=function(c){if(((c>='a')&&(c<='z'))||((c>='A')&&(c<='Z'))||Madurodam.Validate.IsUmlaut(c)){return true;}return false;};this.IsNumericChar=function(c){var _ae='0123456789.';var _m;for(var cnt=0;cnt<c.length;cnt++){_m=c.charAt(cnt);if(_ae.indexOf(_m)==-1){return false;}}return true;};this.IsSpecialChar=function(c){var _ae='!#$%*/?|^{}`~,()[]\;:<>';var _m;for(var cnt=0;cnt<c.length;cnt++){_m=c.charAt(cnt);if(_ae.indexOf(_m)==-1){return false;}}return true;};this.IsSpace=function(c){var _ae=' ';var _m;for(var cnt=0;cnt<c.length;cnt++){_m=c.charAt(cnt);if(_ae.indexOf(_m)==-1){return false;}}return true;};this.IsUmlaut=function(d){var _ae="üéâäàåçêëèïîìæÆôöòûùÿýáíóúñÑŠŽšœžŸÝÀÁÂÃÄÅÈÉÊËÌÍÎÏÐÒÓÔÕÖØÙÚÛÜãßÇŒ`´‘’'";var _m;for(var cnt=0;cnt<d.length;cnt++){_m=d.charAt(cnt);if(_ae.indexOf(_m)==-1){return false;}}return true;};this.ValidateAlphaNumericSpecialInput=function(a,b,f,g,h,i,j){var _ab=9999;if($defined(b)){_ab=b;}if(a.value.length==0){return;}var _ac='';for(var cnt=0;cnt<a.value.length;cnt++){if(_ac.length<b){var _af=Madurodam.Validate.IsAlphaChar(a.value.substring(cnt,cnt+1));var _ag=Madurodam.Validate.IsNumericChar(a.value.substring(cnt,cnt+1));var _ah=Madurodam.Validate.IsSpace(a.value.substring(cnt,cnt+1));if(f&&_ah){_ac+=a.value.substring(cnt,cnt+1);}else{if(_af){if(g<=cnt&&cnt<=h){_ac+=a.value.substring(cnt,cnt+1);}}else if(_ag){if(i<=cnt&&cnt<=j){_ac+=a.value.substring(cnt,cnt+1);}}}}}if(a.value.length!=_ac.length){a.value=_ac;}return;};};Madurodam.Validation=new function(){this.init=function(){Madurodam.Validation.Notification.init();Madurodam.Validation.Validators.init();};this.isValid=function(k){return Madurodam.Validation.Validators.groupIsValid(k);};this.itemIsValid=function(k,l){return Madurodam.Validation.Validators.itemIsValid(k,l);};this.Notification=new function(){this.init=function(){Madurodam.Notification.initType("INPUT",2,-10);Madurodam.Notification.initType("SELECT",2,-10);Madurodam.Notification.initType("TEXTAREA",2,-10);};this.show=function(m,n,o){Madurodam.Notification.show(m,n,o);};this.hide=function(m){Madurodam.Notification.hide(m);};this.showSelect=function(m,n){Madurodam.Notification.show(m,"",n);};this.hideSelect=function(m){Madurodam.Notification.hide(m);};this.hideAll=function(){Madurodam.Notification.hideAll();};this.redraw=function(){Madurodam.Notification.redraw();};};this.Validators=new function(){var _ai=new Array();var _aj=function(k){this.groupName=k;this.items=new Array();};var _ak=function(p,q,r,s,t,u,v,w,x,y,z,_a,_b,_c){this.element=p;this.validationType=q;this.minLength=r;this.b=s;this.minValue=t;this.maxValue=u;this.compareToId=v;this.specialCharacters=w;this.notAllowedCharacters=x;this.dateFormat=y;this.message=z;this.headerMsg=_a;this.notificationId=_b;this._c=_c;};this.init=function(){_ai=new Array();var _al=$$('[ValidatorTypes]');_al.each(function(_d){applyValidatorToElement(_d);});};this.groupIsValid=function(k){if(!$defined(k)){k='global';}var _g=GetOrCreateValidationGroup(k);for(var _am=0;_am<_g.items.length;_am++){var _an=_g.items[_am];if(!ValidateItem(k,_an)){return false;}}return true;};function ValidateItem(k,_e){if(!ValidatorIsValid(_e,k)){if($defined(_e.notificationId)){Madurodam.Validation.Notification.show(_e.notificationId,_e.message,_e.headerMsg);}return false;}return true;}this.itemIsValid=function(k,l){var _ao=GetOrCreateValidationGroup(k);for(var cnt=0;cnt<_ao.items.length;cnt++){var _e=_ao.items[cnt];var _ap=_e.element.getProperty("viewitem");if(_ap==l){if(!ValidateItem(k,_e)){return false;}}}return true;};function applyValidatorToElement(_d){var _aq=_d.getProperty('ValidatorTypes');if(_aq!=null){var _ar=_d.getProperty('ValidatorTypes').split(',');_ar.each(function(_f){_f=_f.trim();var _as=new Array();var _at=_d.getProperty('SpecialChars');if(_at!=null){var _au=_at.split('|');if(_au.length>0){_as=_au;}}var _av=new Array();var _aw=_d.getProperty('CharsNotAllowed');if(_aw!=null){var _ax=_aw.split('|');if(_ax.length>0){_av=_ax;}}var _ay=undefined;if(_f==='MinLength'){if(_d.getProperty(_f)!=null){_ay=_d.getProperty(_f).toInt();}}var _az=undefined;if(_f==='MaxLength'){if(_d.getProperty(_f)!=null){_az=_d.getProperty(_f).toInt();}}var _ba=undefined;if(_f==='MinValue'){if(_d.getProperty(_f)!=null){_ba=_d.getProperty(_f).toFloat();}}var _bb=undefined;if(_f==='MaxValue'){if(_d.getProperty(_f)!=null){_bb=_d.getProperty(_f).toFloat();}}var _bc=undefined;if(_f==='CompareToEqual'){if(_d.getProperty(_f+'ControlId')!=null){_bc=_d.getProperty(_f+'ControlId');}}else if(_f==='CompareToNotEqual'){if(_d.getProperty(_f+'ControlId')!=null){_bc=_d.getProperty(_f+'ControlId');}}else if(_f==='CompareToDateGreaterThan'){if(_d.getProperty(_f+'ControlId')!=null){_bc=_d.getProperty(_f+'ControlId');}}else if(_f==='CompareToDateGreaterThanEqual'){if(_d.getProperty(_f+'ControlId')!=null){_bc=_d.getProperty(_f+'ControlId');}}else if(_f==='CompareToDateLessThan'){if(_d.getProperty(_f+'ControlId')!=null){_bc=_d.getProperty(_f+'ControlId');}}else if(_f==='CompareToDateEqual'){if(_d.getProperty(_f+'ControlId')!=null){_bc=_d.getProperty(_f+'ControlId');}}var _bd=undefined;if(_d.getProperty(_f+'Format')!=null){_bd=_d.getProperty(_f+'Format');}var _be='Not Valid';if(_d.getProperty(_f+'Message')!=null){_be=_d.getProperty(_f+'Message');}var _bf=null;if(_d.getProperty(_f+'HeaderMessage')!=null){_bf=_d.getProperty(_f+'HeaderMessage');}var _bg=null;if(_d.getProperty('NotificationEnabled')){if(_d.getProperty('NotificationEnabled')=='true'){_bg=_d.id;}}var _bh=_d.getProperty('ValidationGroup');if(_bh===null){_bh='global';}var _g=GetOrCreateValidationGroup(_bh);var _bi=_d.getProperty('EnabledDelegate');var _bj=new _ak(_d,_f,_ay,_az,_ba,_bb,_bc,_as,_av,_bd,_be,_bf,_bg,_bi);_g.items.push(_bj);_bj.element.addEvent('blur',function(){Madurodam.Validation.Notification.hideAll();});ApplyValidator(_bj);});}}function GetOrCreateValidationGroup(k){var _bk=null;_ai.each(function(_g){if(_g.groupName===k){_bk=_g;return;}});if(!$defined(_bk)){_bk=new _aj(k);_ai.push(_bk);}return _bk;};function ApplyValidator(_h){var _bl=_h;switch(_bl.validationType){case'Alpha':_bl.element.addEvent('keyup',function(){ForceValidateInput(_bl,IsAlphaChar);});if(!_bl.element.readonly&&!_bl.element.disabled){_bl.element.addEvent('blur',function(){ForceValidateInput(_bl,IsAlphaChar);});}_bl.element.addEvent('mouseup',function(){ForceValidateInput(_bl,IsAlphaChar);});break;case'Numeric':_bl.element.addEvent('keyup',function(){ForceValidateInput(_bl,IsNumericChar);});if(!_bl.element.readonly&&!_bl.element.disabled){_bl.element.addEvent('blur',function(){ForceValidateInput(_bl,IsNumericChar);});}_bl.element.addEvent('mouseup',function(){ForceValidateInput(_bl,IsNumericChar);});break;case'AlphaNumeric':_bl.element.addEvent('keyup',function(){ForceValidateInput(_bl,IsAlphaNumericChar);});if(!_bl.element.readonly&&!_bl.element.disabled){_bl.element.addEvent('blur',function(){ForceValidateInput(_bl,IsAlphaNumericChar);});}_bl.element.addEvent('mouseup',function(){ForceValidateInput(_bl,IsAlphaNumericChar);});break;case'CharsNotAllowed':_bl.element.addEvent('keyup',function(){ForceValidateInput(_bl,IsAlwaysValidChar);});if(!_bl.element.readonly&&!_bl.element.disabled){_bl.element.addEvent('blur',function(){ForceValidateInput(_bl,IsAlwaysValidChar);});}_bl.element.addEvent('mouseup',function(){ForceValidateInput(_bl,IsAlwaysValidChar);});break;case'Required':break;case'Email':break;case'PhoneNumber':_bl.element.addEvent('keyup',function(){ValidateTelephoneInput(_bl.element);});if(!_bl.element.readonly&&!_bl.element.disabled){_bl.element.addEvent('blur',function(){ValidateTelephoneInput(_bl.element);});}_bl.element.addEvent('mouseup',function(){ValidateTelephoneInput(_bl.element);});break;case'Custom':break;case'MinValue':break;case'MaxValue':break;case'MinLength':break;case'MaxLength':break;case'CompareToEqual':break;case'CompareToNotEqual':break;}};function ValidatorIsValid(_h,k){var _bl=_h;if(_bl._c==null||eval(_bl._c)){var _bm=$(_h.element);switch(_bl.validationType){case'Alpha':return IsValidInputPerChar(_bm.value,_h.specialCharacters,IsAlphaChar);break;case'Numeric':return IsValidInputPerChar(_bm.value,_h.specialCharacters,IsNumericChar);break;case'AlphaNumeric':return IsValidInputPerChar(_bm.value,_h.specialCharacters,IsAlphaNumericChar);break;case'Required':if($defined(_bm.type)){if(_bm.type.contains('text')||_bm.type.contains('password')){if(_bm.value.trim().length<=0){return false;}}else if(_bm.type.contains('select')){if(_bm.options[_bm.selectedIndex].value.trim().length<=0){return false;}if(_bm.options[_bm.selectedIndex].value.trim()=="0"){return false;}if(_bm.options[_bm.selectedIndex].value.trim()=="-1"){return false;}if(_bm.options[_bm.selectedIndex].value.trim()=="YYYY"){return false;}if(_bm.options[_bm.selectedIndex].value.trim()=="MM"){return false;}if(_bm.options[_bm.selectedIndex].value.trim()=="DD"){return false;}}}break;case"Email":if(!IsValidInputValue(_bm.value.trim(),SatisfiesEmailAddress)){return false;}break;case"PhoneNumber":if(!IsValidInputValue(_bm.value.trim(),SatisfiesPhoneNumber)){return false;}break;case"Custom":var _bn=k+"CustomValidation('";var _bo=_bm.getProperty('viewitem');_bn=_bn+_bo+"','";_bn=_bn+_bm.value.trim()+"');";if(!eval(_bn)){return false;}break;case'MinValue':if(!IsValidForBoundary(_bm.value,_bl.minValue,SatisfiesMinValue)){return false;}break;case'MaxValue':if(!IsValidForBoundary(_bm.value,_bl.maxValue,SatisfiesMaxValue)){return false;}break;case'MinLength':if(!IsValidForBoundary(_bm.value,_bl.minLength,SatisfiesMinLength)){return false;}break;case'MaxLength':if(!IsValidForBoundary(_bm.value,_bl.b,SatisfiesMaxLength)){return false;}break;case'CompareToEqual':if(!IsValidForCompare(_bm.value,_bl.compareToId,SatisfiesCompareToEqual)){return false;}break;case'CompareToNotEqual':if(_bm.type.contains('radio')){if(_bm.checked==$(_bl.compareToId).checked){return false;}}else{if(!IsValidForCompare(_bm.value,_bl.compareToId,SatisfiesCompareToNotEqual)){return false;}}break;case'CompareToDateGreaterThan':if(!IsDateInputValidForCompare(_bm.value,_bl.dateFormat,_bl.compareToId,CompareDatesGreater)){return false;}break;case'CompareToDateGreaterThanEqual':if(!IsDateInputValidForCompare(_bm.value,_bl.dateFormat,_bl.compareToId,CompareDatesGreaterEqual)){return false;}break;case'CompareToDateLessThan':if(!IsDateInputValidForCompare(_bm.value,_bl.dateFormat,_bl.compareToId,CompareDatesLess)){return false;}break;case'CompareToDateEqual':if(!IsDateInputValidForCompare(_bm.value,_bl.dateFormat,_bl.compareToId,CompareDatesEqual)){return false;}break;}}return true;};function ForceValidateInput(_h,_i){var _ab=9999;if($defined(_h.b)){_ab=_h.b;}var _bp=new Array();if($defined(_h.specialCharacters)){_bp=_h.specialCharacters;}var _bq=new Array();if($defined(_h.notAllowedCharacters)){_bq=_h.notAllowedCharacters;}if(_h.element.value.length==0){return;}var _ac='';for(var cnt=0;cnt<_h.element.value.length;cnt++){var _j=_h.element.value.substring(cnt,cnt+1);if((_i(_j)||_bp.contains(_j))&&!_bq.contains(_j)){if(_ac.length<_ab){_ac+=_j;}else{break;}}}if(_h.element.value.length!=_ac.length){_h.element.value=_ac;}return;};function IsValidInputPerChar(_k,_l,_i){if(!$defined(_l)){_l=new Array();}for(var cnt=0;cnt<_k.length;cnt++){_m=_k.charAt(cnt);if(!_i(_m)&&!_l.contains(_m)){return false;}}return true;};function IsValidInputValue(_k,_n){if(_k.trim().length>0){if(!_n(_k)){return false;}}return true;};function IsValidForBoundary(_k,_o,_p){if(_k.trim().length>0){if($defined(_k)&&$defined(_o)&&$defined(_p)){var _br=_p(_k,_o);if(!_br){return false;}}}return true;};function IsValidForCompare(_k,v,_q){if($defined(_k)&&$defined(v)&&$defined(_q)){var _bs=_k.trim().length;if(_bs>0||$(v).value.length>0){var _br=_q(_k,v);if(!_br){return false;}}}return true;};function IsDateInputValidForCompare(_r,y,v,_s){if($defined(_r)&&$defined(y)&&$defined(v)&&$defined(_s)){var _bt=_r.trim().length;var _bu=y.trim().length;var _bv=v.trim().length;if(_bt>0&&_bu>0&&_bv>0){if(!SatisfiesCompareToDate(_r,y,v,_s)){return false;}}}return true;};function IsAlphaString(_k){for(var cnt=0;cnt<_k.length;cnt++){_m=_k.charAt(cnt);if(!IsAlphaChar(_m)){return false;}}return true;};function IsAlphaChar(d){if(((d>='a')&&(d<='z'))||((d>='A')&&(d<='Z'))||IsSpace(d)||IsUmlaut(d)){return true;}else{return false;}};function IsUmlaut(d){var _ae="üéâäàåçêëèïîìæÆôöòûùÿýáíóúñÑŠŽšœžŸÝÀÁÂÃÄÅÈÉÊËÌÍÎÏÐÒÓÔÕÖØÙÚÛÜãßÇŒ`´‘’'";var _m;for(var cnt=0;cnt<d.length;cnt++){_m=d.charAt(cnt);if(_ae.indexOf(_m)==-1){return false;}}return true;};function IsSpace(d){var _ae=' ';var _m;for(var cnt=0;cnt<d.length;cnt++){_m=d.charAt(cnt);if(_ae.indexOf(_m)==-1){return false;}}return true;};function IsNumericString(_k){var _ae='0123456789';var _m;for(var cnt=0;cnt<_k.length;cnt++){_m=_k.charAt(cnt);if(!IsNumericChar(_m)){return false;}}return true;};function IsNumericChar(d){var _ae='0123456789';if(_ae.indexOf(d)==-1){return false;}return true;};function IsAlphaNumericString(_k){for(var cnt=0;cnt<_k.length;cnt++){if(!IsAlphaNumericChar(_k[cnt])){return false;}}return true;};function IsAlphaNumericChar(d){if(IsNumericChar(d)||IsAlphaChar(d)){return true;}else{return false;}};function IsAlwaysValidChar(d){return true;};function SatisfiesEmailAddress(_k){var _bw=/^([\w\xc0-\xff-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;if(!_bw.test(_k)){return false;}return true;};function SatisfiesPhoneNumber(_k){var _bx=/^[0-9\+]?[0-9\-\s]*$/;if(!_bx.test(_k)){return false;}return true;};function SatisfiesMinValue(_k,_o){try{var _by=_k.toFloat();if(_by>=_o){return true;}}catch(e){}return false;};function SatisfiesMaxValue(_k,_o){try{var _by=_k.toFloat();if(_by<=_o){return true;}}catch(e){}return false;};function SatisfiesMinLength(_k,_o){try{var _bs=_k.trim().length;if(_bs>=_o){return true;}}catch(e){}return false;};function SatisfiesMaxLength(_k,_o){try{var _bs=_k.trim().length;if(_bs<=_o){return true;}}catch(e){}return false;};function SatisfiesCompareToEqual(_k,v){try{var _bz=$(v);if($defined(_bz)){if(_k===_bz.value){return true;}}}catch(e){}return false;};function SatisfiesCompareToNotEqual(_k,v){try{var _bz=$(v);if($defined(_bz)){if(_k!=_bz.value){return true;}}}catch(e){}return false;};function SatisfiesCompareToDate(_r,_t,v,_u){try{var _ca=$(v).value;if(_r.length<=0||_ca<=0){return true;}var _v=parseDate(_r,_t);var _w=parseDate(_ca,_t);if(_u(_v,_w)){return true;}}catch(e){}return false;};function CompareDatesGreater(_x,_y){if(_x>_y){return true;}return false;};function CompareDatesGreaterEqual(_x,_y){if(_x>=_y){return true;}return false;};function CompareDatesLess(_x,_y){if(_x<_y){return true;}return false;};function CompareDatesEqual(_x,_y){if(_x===_y){return true;}return false;};};};window.addEvent('ondomready',function(){Madurodam.Validation.init();window.addEvent('updatepanelcomplete',function(_z,_aa){Madurodam.Validation.init();});window.addEvent('resize',function(){Madurodam.Validation.Notification.redraw();});window.addEvent('scroll',function(){Madurodam.Validation.Notification.redraw();});});Madurodam.AccordionController=function(a,b){var n=null;var o=new Array();var p=new Array();var q=new Array();var r=0;var s=false;var t=null;var u,v,w;var x=this;var y=function(c,d,e,f,g,h){this.index=d;this.ID=c;this.container=e;this.z=f;this._a=g;this.m=h;this.open=false;};a.forEach(function(i){var z=i.getElement('div[accordion_header_hidden=true]');var _a=i.getElement('h2[accordion_header=true]');if(_a==null||_a==undefined){_a=i.getElement('h3[accordion_header=true]');}var _b=i.getElement('div[accordion_body=true]');var c=CQS.Common.elementGetAttribute(z,'accordion_id');var _c=CQS.Common.elementGetAttribute(z,'accordion_open');p.push(z);q.push(_b);o[o.length]=new y(c,r,i,z,_a,_b);if(CQS.Common.isDefined(_c)){if(_c=='true'){t=o[o.length-1];s=true;}}r++;});function GetItem(j){var _d=null;for(var _e=0;_e<o.length;_e++){if(o[_e].ID==j){_d=o[_e];break;}}return _d;};this.getItem=function(j){var _d=null;for(var _e=0;_e<o.length;_e++){if(o[_e].ID==j){_d=o[_e];break;}}return _d;};this.t=function(j){var _d=GetItem(j);if(_d!=null){if(!_d.open){x.toggle(j);setTimeout('RedrawFooter();',800);}}};this.closeItem=function(j){var _d=GetItem(j);if(_d!=null){if(_d.open){x.toggle(j);setTimeout('RedrawFooter();',800);}}};var _f;this.toggle=function(j,k){var _d=GetItem(j);if(_d!=null){_d.open=!_d.open;_g=_d;_f=k;n.display(_d.index);}};var _g;function onCompleteEvent(){if(_g.open){u.style.height='auto';u.style.overflow='visible';if(w){if(_g.container.id!=w.id&&!w.className.contains(b)){w.className=w.className.trim()+' '+b;}}}else{if(_g.container){if(!_g.container.className.contains(b)){_g.container.className=_g.container.className.trim()+' '+b;}}w=undefined;}if(CQS.Common.isDefined(_f)){_f(_g);}RedrawFooter();};function onOpenElement(l,m){if(u){if(u.offsetHeight>10){u.style.height=(u.offsetHeight-10)+'px';}u.style.overflow='hidden';}var c=CQS.Common.elementGetAttribute(l,'accordion_id');var _d=GetItem(c);_g=_d;_g.open=true;w=v;_d.container.className=_d.container.className.replace(new RegExp('(^|\\s)'+b+'(\\s|$)','g'),' ');if(m.offsetHeight>=20){m.style.height=m.offsetHeight-20+'px';}else{m.style.height=m.offsetHeight+'px';}m.style.overflow='hidden';v=_d.container;u=m;};n=new Accordion(p,q,{start:'closed',opacity:false,alwaysHide:true,duration:1000,onActive:onOpenElement,onComplete:onCompleteEvent});if(s){this.toggle(t.ID);}};AppLogger=new function(){this.LogWebBrowserError=function(a,b,c){try{CQS.Callback.doAsynchronousCallBack('LogWebBrowserError',a+'##'+b+'##'+c,true);}catch(e){}};}();var YAHOO=function(){
return{
util:{},
widget:{},
example:{},
namespace:function(sNameSpace){
if(!sNameSpace||!sNameSpace.length){
return null;
}
var levels=sNameSpace.split(".");
var currentNS=YAHOO;
for(var i=(levels[0]=="YAHOO")?1:0;i<levels.length;++i){
currentNS[levels[i]]=currentNS[levels[i]]||{};
currentNS=currentNS[levels[i]];
}
return currentNS;
}
};
}();
YAHOO.util.Dom=new function(){
this.get=function(el){
if(typeof el=='string'){
el=document.getElementById(el);
}
return el;
};
this.getStyle=function(el,property){
var value=null;
var dv=document.defaultView;
el=this.get(el);
if(property=='opacity'&&el.filters){
value=1;
try{
value=el.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;
}catch(e){
try{
value=el.filters.item('alpha').opacity/100;
}catch(e){}
}
}
else if(el.style[property]){
value=el.style[property];
}
else if(el.currentStyle&&el.currentStyle[property]){
value=el.currentStyle[property];
}
else if(dv&&dv.getComputedStyle)
{
var converted='';
for(i=0,len=property.length;i<len;++i){
if(property.charAt(i)==property.charAt(i).toUpperCase()){
converted=converted+'-'+property.charAt(i).toLowerCase();
}else{
converted=converted+property.charAt(i);
}
}
if(dv.getComputedStyle(el,'').getPropertyValue(converted)){
value=dv.getComputedStyle(el,'').getPropertyValue(converted);
}
}
return value;
};
this.setStyle=function(el,property,val){
el=this.get(el);
switch(property){
case'opacity':
if(el.filters){
el.style.filter='alpha(opacity='+val*100+')';
if(!el.currentStyle.hasLayout){
el.style.zoom=1;
}
}else{
el.style.opacity=val;
el.style['-moz-opacity']=val;
el.style['-khtml-opacity']=val;
}
break;
default:
el.style[property]=val;
}
};
this.getXY=function(el){
el=this.get(el);
if(el.parentNode===null||this.getStyle(el,'display')=='none'){
return false;
}
var parent=null;
var pos=[];
var box;
if(el.getBoundingClientRect){
box=el.getBoundingClientRect();
var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;
var scrollLeft=document.documentElement.scrollLeft||document.body.scrollLeft;
return[box.left+scrollLeft,box.top+scrollTop];
}
else if(document.getBoxObjectFor){
box=document.getBoxObjectFor(el);
pos=[box.x,box.y];
}
else{
pos=[el.offsetLeft,el.offsetTop];
parent=el.offsetParent;
if(parent!=el){
while(parent){
pos[0]+=parent.offsetLeft;
pos[1]+=parent.offsetTop;
parent=parent.offsetParent;
}
}
var ua=navigator.userAgent.toLowerCase();
if(
ua.indexOf('opera')!=-1
||(ua.indexOf('safari')!=-1&&this.getStyle(el,'position')=='absolute')
){
pos[1]-=document.body.offsetTop;
}
}
if(el.parentNode){parent=el.parentNode;}
else{parent=null;}
while(parent&&parent.tagName!='BODY'&&parent.tagName!='HTML'){
pos[0]-=parent.scrollLeft;
pos[1]-=parent.scrollTop;
if(parent.parentNode){parent=parent.parentNode;}
else{parent=null;}
}
return pos;
};
this.getX=function(el){
return this.getXY(el)[0];
};
this.getY=function(el){
return this.getXY(el)[1];
};
this.setXY=function(el,pos,noRetry){
el=this.get(el);
var pageXY=YAHOO.util.Dom.getXY(el);
if(pageXY===false){return false;}
if(this.getStyle(el,'position')=='static'){
this.setStyle(el,'position','relative');
}
var delta=[
parseInt(YAHOO.util.Dom.getStyle(el,'left'),10),
parseInt(YAHOO.util.Dom.getStyle(el,'top'),10)
];
if(isNaN(delta[0])){delta[0]=0;}
if(isNaN(delta[1])){delta[1]=0;}
if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
var newXY=this.getXY(el);
if(!noRetry&&(newXY[0]!=pos[0]||newXY[1]!=pos[1])){
this.setXY(el,pos,true);
}
return true;
};
this.setX=function(el,x){
return this.setXY(el,[x,null]);
};
this.setY=function(el,y){
return this.setXY(el,[null,y]);
};
this.getRegion=function(el){
el=this.get(el);
return new YAHOO.util.Region.getRegion(el);
};
this.getClientWidth=function(){
return(
document.documentElement.offsetWidth
||document.body.offsetWidth
);
};
this.getClientHeight=function(){
return(
self.innerHeight
||document.documentElement.clientHeight
||document.body.clientHeight
);
};
};
YAHOO.util.Region=function(t,r,b,l){
this.top=t;
this.right=r;
this.bottom=b;
this.left=l;
};
YAHOO.util.Region.prototype.contains=function(region){
return(region.left>=this.left&&
region.right<=this.right&&
region.top>=this.top&&
region.bottom<=this.bottom);
};
YAHOO.util.Region.prototype.getArea=function(){
return((this.bottom-this.top)*(this.right-this.left));
};
YAHOO.util.Region.prototype.intersect=function(region){
var t=Math.max(this.top,region.top);
var r=Math.min(this.right,region.right);
var b=Math.min(this.bottom,region.bottom);
var l=Math.max(this.left,region.left);
if(b>=t&&r>=l){
return new YAHOO.util.Region(t,r,b,l);
}else{
return null;
}
};
YAHOO.util.Region.prototype.union=function(region){
var t=Math.min(this.top,region.top);
var r=Math.max(this.right,region.right);
var b=Math.max(this.bottom,region.bottom);
var l=Math.min(this.left,region.left);
return new YAHOO.util.Region(t,r,b,l);
};
YAHOO.util.Region.prototype.toString=function(){
return("Region {"+
"  t: "+this.top+
", r: "+this.right+
", b: "+this.bottom+
", l: "+this.left+
"}");
}
YAHOO.util.Region.getRegion=function(el){
var p=YAHOO.util.Dom.getXY(el);
var t=p[1];
var r=p[0]+el.offsetWidth;
var b=p[1]+el.offsetHeight;
var l=p[0];
return new YAHOO.util.Region(t,r,b,l);
};
YAHOO.util.Point=function(x,y){
this.x=x;
this.y=y;
this.top=y;
this.right=x;
this.bottom=y;
this.left=x;
};
YAHOO.util.Point.prototype=new YAHOO.util.Region();
YAHOO.util.CustomEvent=function(_1,_2){this.type=_1;this.scope=_2||window;this.subscribers=[];if(YAHOO.util["Event"]){YAHOO.util.Event.regCE(this);}};YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_4,_5){this.subscribers.push(new YAHOO.util.Subscriber(fn,_4,_5));},unsubscribe:function(fn,_6){var _7=false;for(var i=0;i<this.subscribers.length;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_6)){this._delete(i);_7=true;}}return _7;},fire:function(){for(var i=0;i<this.subscribers.length;++i){var s=this.subscribers[i];if(s){var _10=(s.override)?s.obj:this.scope;s.fn.call(_10,this.type,arguments,s.obj);}}},unsubscribeAll:function(){for(var i=0;i<this.subscribers.length;++i){this._delete(i);}},_delete:function(_11){var s=this.subscribers[_11];if(s){delete s.fn;delete s.obj;}delete this.subscribers[_11];}};YAHOO.util.Subscriber=function(fn,obj,_13){this.fn=fn;this.obj=obj||null;this.override=(_13);};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){return(this.fn==fn&&this.obj==obj);};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var _14=false;var _15=[];var _16=[];var _17=[];var _18=[];var _19=[];var _20=[];return{EL:0,TYPE:1,FN:2,WFN:3,SCOPE:3,ADJ_SCOPE:4,isSafari:(navigator.userAgent.match(/safari/gi)),isIE:(!this.isSafari&&navigator.userAgent.match(/msie/gi)),addListener:function(el,_22,fn,_23,_24){if(this._isValidCollection(el)){var ok=true;for(var i=0;i<el.length;++i){ok=(this.on(el[i],_22,fn,_23,_24)&&ok);}return ok;}else{if(typeof el=="string"){if(_14){el=this.getEl(el);}else{_16[_16.length]=[el,_22,fn,_23,_24];return true;}}}if(!el){return false;}if("unload"==_22&&_23!==this){_17[_17.length]=[el,_22,fn,_23,_24];return true;}var _26=(_24)?_23:el;var _27=function(e){return fn.call(_26,YAHOO.util.Event.getEvent(e),_23);};var li=[el,_22,fn,_27,_26];var _30=_15.length;_15[_30]=li;if(this.useLegacyEvent(el,_22)){var _31=this.getLegacyIndex(el,_22);if(_31==-1){_31=_19.length;_19[_31]=[el,_22,el["on"+_22]];_20[_31]=[];el["on"+_22]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_31);};}_20[_31].push(_30);}else{if(el.addEventListener){el.addEventListener(_22,_27,false);}else{if(el.attachEvent){el.attachEvent("on"+_22,_27);}}}return true;},fireLegacyEvent:function(e,_32){var ok=true;var le=_20[_32];for(i=0;i<le.length;++i){var _34=le[i];if(_34){var li=_15[_34];var _35=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_35,e);ok=(ok&&ret);}}return ok;},getLegacyIndex:function(el,_37){for(var i=0;i<_19.length;++i){var le=_19[i];if(le&&le[0]==el&&le[1]==_37){return i;}}return-1;},useLegacyEvent:function(el,_38){return((!el.addEventListener&&!el.attachEvent)||(_38=="click"&&this.isSafari));},removeListener:function(el,_39,fn){if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(var i=0;i<el.length;++i){ok=(this.removeListener(el[i],_39,fn)&&ok);}return ok;}}var _40=null;var _41=this._getCacheIndex(el,_39,fn);if(_41>=0){_40=_15[_41];}if(!el||!_40){return false;}if(el.removeEventListener){el.removeEventListener(_39,_40[this.WFN],false);}else{if(el.detachEvent){el.detachEvent("on"+_39,_40[this.WFN]);}}delete _15[_41][this.WFN];delete _15[_41][this.FN];delete _15[_41];return true;},getTarget:function(ev,_43){var t=ev.target||ev.srcElement;if(_43&&t&&"#text"==t.nodeName){return t.parentNode;}else{return t;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return t;},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){return ev.charCode||(ev.type=="keypress")?ev.keyCode:0;},_getCacheIndex:function(el,_48,fn){for(var i=0;i<_15.length;++i){var li=_15[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_48){return i;}}return-1;},_isValidCollection:function(o){return(o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){for(i in this.elCache){delete this.elCache[i];}},regCE:function(ce){_18.push(ce);},_load:function(e){_14=true;},_tryPreloadAttach:function(){var _52=!_14;for(var i=0;i<_16.length;++i){var d=_16[i];if(d){var el=this.getEl(d[this.EL]);if(el){this.on(el,d[this.TYPE],d[this.FN],d[this.SCOPE],d[this.ADJ_SCOPE]);delete _16[i];}}}if(_52){setTimeout("YAHOO.util.Event._tryPreloadAttach()",50);}},_unload:function(e,me){for(var i=0;i<_17.length;++i){var l=_17[i];if(l){var _56=(l[this.ADJ_SCOPE])?l[this.SCOPE]:window;l[this.FN].call(_56,this.getEvent(e),l[this.SCOPE]);}}if(_15&&_15.length>0){for(i=0;i<_15.length;++i){l=_15[i];if(l){this.removeListener(l[this.EL],l[this.TYPE],l[this.FN]);}}this.clearCache();}for(i=0;i<_18.length;++i){_18[i].unsubscribeAll();delete _18[i];}for(i=0;i<_19.length;++i){delete _19[i][0];delete _19[i];}},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement;db=document.body;if(dd&&dd.scrollTop){return[dd.scrollTop,dd.scrollLeft];}else{if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}}}};}();YAHOO.util.Event.on=YAHOO.util.Event.addListener;if(document&&document.body){YAHOO.util.Event._load();}else{YAHOO.util.Event.on(window,"load",YAHOO.util.Event._load,YAHOO.util.Event,true);}YAHOO.util.Event.on(window,"unload",YAHOO.util.Event._unload,YAHOO.util.Event,true);YAHOO.util.Event._tryPreloadAttach();}
YAHOO.util.DragDrop=function(id,sGroup){
if(id){
this.init(id,sGroup);
}
};
YAHOO.util.DragDrop.prototype={
id:null,
dragElId:null,
handleElId:null,
invalidHandleTypes:null,
startPageX:0,
startPageY:0,
groups:null,
locked:false,
lock:function(){this.locked=true;},
unlock:function(){this.locked=false;},
isTarget:true,
padding:null,
_domRef:null,
__ygDragDrop:true,
constrainX:false,
constrainY:false,
minX:0,
maxX:0,
minY:0,
maxY:0,
maintainOffset:false,
xTicks:null,
yTicks:null,
primaryButtonOnly:true,
b4StartDrag:function(x,y){},
startDrag:function(x,y){},
b4Drag:function(e){},
onDrag:function(e){},
onDragEnter:function(e,id){},
b4DragOver:function(e){},
onDragOver:function(e,id){},
b4DragOut:function(e){},
onDragOut:function(e,id){},
b4DragDrop:function(e){},
onDragDrop:function(e,id){},
b4EndDrag:function(e){},
endDrag:function(e){},
b4MouseDown:function(e){},
onMouseDown:function(e){},
onMouseUp:function(e){},
getEl:function(){
if(!this._domRef){
this._domRef=this.DDM.getElement(this.id);
}
return this._domRef;
},
getDragEl:function(){
return this.DDM.getElement(this.dragElId);
},
init:function(id,sGroup){
this.initTarget(id,sGroup);
YAHOO.util.Event.addListener(id,"mousedown",
this.handleMouseDown,this,true);
},
initTarget:function(id,sGroup){
this.DDM=YAHOO.util.DDM;
this.padding=[0,0,0,0];
this.groups={};
this.id=id;
this.setDragElId(id);
this.invalidHandleTypes={a:"a"};
this.handleElId=id;
if(document&&document.body){
this.setInitPosition();
}
this.addToGroup((sGroup)?sGroup:"default");
},
setPadding:function(iTop,iRight,iBot,iLeft){
if(!iRight&&0!==iRight){
this.padding=[iTop,iTop,iTop,iTop];
}else if(!iBot&&0!==iBot){
this.padding=[iTop,iRight,iTop,iRight];
}else{
this.padding=[iTop,iRight,iBot,iLeft];
}
},
setInitPosition:function(diffX,diffY){
var el=this.getEl();
if(!this.DDM.verifyEl(el)){
return;
}
var dx=diffX||0;
var dy=diffY||0;
var p=YAHOO.util.Dom.getXY(el);
this.initPageX=p[0]-dx;
this.initPageY=p[1]-dy;
this.lastPageX=p[0];
this.lastPageY=p[1];
this.setStartPosition(p);
},
setStartPosition:function(pos){
var p=pos||YAHOO.util.Dom.getXY(this.getEl());
this.startPageX=p[0];
this.startPageY=p[1];
},
addToGroup:function(sGroup){
this.groups[sGroup]=true;
this.DDM.regDragDrop(this,sGroup);
},
setDragElId:function(id){
this.dragElId=id;
},
setHandleElId:function(id){
this.handleElId=id;
this.DDM.regHandle(this.id,id);
},
setOuterHandleElId:function(id){
YAHOO.util.Event.addListener(id,"mousedown",
this.handleMouseDown,this,true);
this.setHandleElId(id);
},
unreg:function(){
YAHOO.util.Event.removeListener(this.id,"mousedown",
this.handleMouseDown);
this._domRef=null;
this.DDM._remove(this);
},
isLocked:function(){
return(this.DDM.isLocked()||this.locked);
},
handleMouseDown:function(e,oDD){
if(oDD.id.substring(0,8)=="sliderBG")
{
return;
}
var EU=YAHOO.util.Event;
var button=e.which||e.button;
if(this.primaryButtonOnly&&button>1){
return;
}
if(this.isLocked()){
return;
}
this.DDM.refreshCache(this.groups);
var pt=new YAHOO.util.Point(EU.getPageX(e),EU.getPageY(e));
if(this.DDM.isOverTarget(pt,this)){
var srcEl=EU.getTarget(e);
if(this.isValidHandleChild(srcEl)&&
(this.id==this.handleElId||
this.DDM.handleWasClicked(srcEl,this.id))){
this.setStartPosition();
this.b4MouseDown(e);
this.onMouseDown(e);
this.DDM.handleMouseDown(e,this);
this.DDM.stopEvent(e);
}
}
},
addInvalidHandleType:function(tagName){
var type=tagName.toUpperCase();
this.invalidHandleTypes[type]=type;
},
removeInvalidHandleType:function(tagName){
var type=tagName.toUpperCase();
this.invalidHandleTypes[type]=null;
},
isValidHandleChild:function(node){
var type=node.nodeName;
if(type=="#text"){
type=node.parentNode.nodeName;
}
return(!this.invalidHandleTypes[type]);
},
setXTicks:function(iStartX,iTickSize){
this.xTicks=[];
this.xTickSize=iTickSize;
var tickMap={};
for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){
if(!tickMap[i]){
this.xTicks[this.xTicks.length]=i;
tickMap[i]=true;
}
}
for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){
if(!tickMap[i]){
this.xTicks[this.xTicks.length]=i;
tickMap[i]=true;
}
}
this.xTicks.sort(this.DDM.numericSort);
},
setYTicks:function(iStartY,iTickSize){
this.yTicks=[];
this.yTickSize=iTickSize;
var tickMap={};
for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){
if(!tickMap[i]){
this.yTicks[this.yTicks.length]=i;
tickMap[i]=true;
}
}
for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){
if(!tickMap[i]){
this.yTicks[this.yTicks.length]=i;
tickMap[i]=true;
}
}
this.yTicks.sort(this.DDM.numericSort);
},
setXConstraint:function(iLeft,iRight,iTickSize){
this.leftConstraint=iLeft;
this.rightConstraint=iRight;
this.minX=this.initPageX-iLeft;
this.maxX=this.initPageX+iRight;
if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}
this.constrainX=true;
},
setYConstraint:function(iUp,iDown,iTickSize){
this.topConstraint=iUp;
this.bottomConstraint=iDown;
this.minY=this.initPageY-iUp;
this.maxY=this.initPageY+iDown;
if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}
this.constrainY=true;
},
resetConstraints:function(){
var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;
var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;
this.setInitPosition(dx,dy);
if(this.constrainX){
this.setXConstraint(this.leftConstraint,
this.rightConstraint,
this.xTickSize);
}
if(this.constrainY){
this.setYConstraint(this.topConstraint,
this.bottomConstraint,
this.yTickSize);
}
},
getTick:function(val,tickArray){
if(!tickArray){
return val;
}else if(tickArray[0]>=val){
return tickArray[0];
}else{
for(var i=0;i<tickArray.length;++i){
var next=i+1;
if(tickArray[next]&&tickArray[next]>=val){
var diff1=val-tickArray[i];
var diff2=tickArray[next]-val;
return(diff2>diff1)?tickArray[i]:tickArray[next];
}
}
return tickArray[tickArray.length-1];
}
},
toString:function(val,tickArray){
return("YAHOO.util.DragDrop {"+this.id+"}");
}
};
if(!YAHOO.util.DragDropMgr){
YAHOO.util.DragDropMgr=new function(){
var UTIL=YAHOO.util;
this.ids={};
this.handleIds={};
this.dragCurrent=null;
this.dragOvers={};
this.deltaX=0;
this.deltaY=0;
this.preventDefault=true;
this.stopPropagation=true;
this.initalized=false;
this.locked=false;
this.init=function(){
};
this.POINT=0;
this.INTERSECT=1;
this.mode=this.POINT;
this._execOnAll=function(sMethod,args){
for(var i in this.ids){
for(var j in this.ids[i]){
var oDD=this.ids[i][j];
if(!this.isTypeOfDD(oDD)){
continue;
}
oDD[sMethod].apply(oDD,args);
}
}
};
this._onLoad=function(){
this._execOnAll("setInitPosition",[]);
var EU=UTIL.Event;
EU.addListener(document,"mouseup",this.handleMouseUp,this,true);
EU.addListener(document,"mousemove",this.handleMouseMove,this,true);
EU.addListener(window,"resize",this._onResize,this,true);
this.initalized=true;
};
this._onResize=function(e){
this._execOnAll("resetConstraints",[]);
};
this.lock=function(){this.locked=true;};
this.unlock=function(){this.locked=false;};
this.isLocked=function(){return this.locked;};
this.locationCache={};
this.useCache=true;
this.clickPixelThresh=3;
this.clickTimeThresh=1000;
this.dragThreshMet=false;
this.clickTimeout=null;
this.startX=0;
this.startY=0;
this.regDragDrop=function(oDD,sGroup){
if(!this.initialized){this.init();}
if(!this.ids[sGroup]){
this.ids[sGroup]={};
}
this.ids[sGroup][oDD.id]=oDD;
};
this._remove=function(oDD){
for(var g in oDD.groups){
if(g&&this.ids[g][oDD.id]){
delete this.ids[g][oDD.id];
}
}
delete this.handleIds[oDD.id];
};
this.regHandle=function(sDDId,sHandleId){
if(!this.handleIds[sDDId]){
this.handleIds[sDDId]={};
}
this.handleIds[sDDId][sHandleId]=sHandleId;
};
this.isDragDrop=function(id){
return(this.getDDById(id))?true:false;
};
this.getRelated=function(p_oDD,bTargetsOnly){
var oDDs=[];
for(var i in p_oDD.groups){
for(j in this.ids[i]){
var dd=this.ids[i][j];
if(!this.isTypeOfDD(dd)){
continue;
}
if(!bTargetsOnly||dd.isTarget){
oDDs[oDDs.length]=dd;
}
}
}
return oDDs;
};
this.isLegalTarget=function(oDD,oTargetDD){
var targets=this.getRelated(oDD);
for(var i=0;i<targets.length;++i){
if(targets[i].id==oTargetDD.id){
return true;
}
}
return false;
};
this.isTypeOfDD=function(oDD){
return(oDD&&oDD.__ygDragDrop);
};
this.isHandle=function(sDDId,sHandleId){
return(this.handleIds[sDDId]&&
this.handleIds[sDDId][sHandleId]);
};
this.getDDById=function(id){
for(var i in this.ids){
if(this.ids[i][id]){
return this.ids[i][id];
}
}
return null;
};
this.handleMouseDown=function(e,oDD){
this.dragCurrent=oDD;
var el=oDD.getEl();
this.startX=UTIL.Event.getPageX(e);
this.startY=UTIL.Event.getPageY(e);
this.deltaX=this.startX-el.offsetLeft;
this.deltaY=this.startY-el.offsetTop;
this.dragThreshMet=false;
this.clickTimeout=setTimeout(
"var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX, DDM.startY)",
this.clickTimeThresh);
};
this.startDrag=function(x,y){
clearTimeout(this.clickTimeout);
if(this.dragCurrent){
this.dragCurrent.b4StartDrag(x,y);
this.dragCurrent.startDrag(x,y);
}
this.dragThreshMet=true;
};
this.handleMouseUp=function(e){
if(!this.dragCurrent){
return;
}
clearTimeout(this.clickTimeout);
if(this.dragThreshMet){
this.fireEvents(e,true);
}else{
}
this.stopDrag(e);
this.stopEvent(e);
};
this.stopEvent=function(e){
if(this.stopPropagation){
UTIL.Event.stopPropagation(e);
}
if(this.preventDefault){
UTIL.Event.preventDefault(e);
}
};
this.stopDrag=function(e){
if(this.dragCurrent){
if(this.dragThreshMet){
this.dragCurrent.b4EndDrag(e);
this.dragCurrent.endDrag(e);
}
this.dragCurrent.onMouseUp(e);
}
this.dragCurrent=null;
this.dragOvers={};
};
this.handleMouseMove=function(e){
if(!this.dragCurrent){
return;
}
if(UTIL.Event.isIE&&!e.button){
this.stopEvent(e);
return this.handleMouseUp(e);
}
if(!this.dragThreshMet){
var diffX=Math.abs(this.startX-UTIL.Event.getPageX(e));
var diffY=Math.abs(this.startY-UTIL.Event.getPageY(e));
if(diffX>this.clickPixelThresh||
diffY>this.clickPixelThresh){
this.startDrag(this.startX,this.startY);
}
}
if(this.dragThreshMet){
this.dragCurrent.b4Drag(e);
this.dragCurrent.onDrag(e);
this.fireEvents(e,false);
}
this.stopEvent(e);
};
this.fireEvents=function(e,isDrop){
var dc=this.dragCurrent;
if(!dc||dc.isLocked()){
return;
}
var x=UTIL.Event.getPageX(e);
var y=UTIL.Event.getPageY(e);
var pt=new YAHOO.util.Point(x,y);
var oldOvers=[];
var outEvts=[];
var overEvts=[];
var dropEvts=[];
var enterEvts=[];
for(var i in this.dragOvers){
var ddo=this.dragOvers[i];
if(!this.isTypeOfDD(ddo)){
continue;
}
if(!this.isOverTarget(pt,ddo,this.mode)){
outEvts.push(ddo);
}
oldOvers[i]=true;
delete this.dragOvers[i];
}
for(var sGroup in dc.groups){
if("string"!=typeof sGroup){
continue;
}
for(i in this.ids[sGroup]){
var oDD=this.ids[sGroup][i];
if(!this.isTypeOfDD(oDD)){
continue;
}
if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){
if(this.isOverTarget(pt,oDD,this.mode)){
if(isDrop){
dropEvts.push(oDD);
}else{
if(!oldOvers[oDD.id]){
enterEvts.push(oDD);
}else{
overEvts.push(oDD);
}
this.dragOvers[oDD.id]=oDD;
}
}
}
}
}
if(this.mode){
if(outEvts.length>0){
dc.b4DragOut(e,outEvts);
dc.onDragOut(e,outEvts);
}
if(enterEvts.length>0){
dc.onDragEnter(e,enterEvts);
}
if(overEvts.length>0){
dc.b4DragOver(e,overEvts);
dc.onDragOver(e,overEvts);
}
if(dropEvts.length>0){
dc.b4DragDrop(e,dropEvts);
dc.onDragDrop(e,dropEvts);
}
}else{
for(i=0;i<outEvts.length;++i){
dc.b4DragOut(e,outEvts[i].id);
dc.onDragOut(e,outEvts[i].id);
}
for(i=0;i<enterEvts.length;++i){
dc.onDragEnter(e,enterEvts[i].id);
}
for(i=0;i<overEvts.length;++i){
dc.b4DragOver(e,overEvts[i].id);
dc.onDragOver(e,overEvts[i].id);
}
for(i=0;i<dropEvts.length;++i){
dc.b4DragDrop(e,dropEvts[i].id);
dc.onDragDrop(e,dropEvts[i].id);
}
}
};
this.getBestMatch=function(dds){
var winner=null;
if(dds.length==1){
winner=dds[0];
}else{
for(var i=0;i<dds.length;++i){
var dd=dds[i];
if(dd.cursorIsOver){
winner=dd;
break;
}else{
if(!winner||
winner.overlap.getArea()<dd.overlap.getArea()){
winner=dd;
}
}
}
}
return winner;
};
this.refreshCache=function(aGroups){
for(sGroup in aGroups){
if("string"!=typeof sGroup){
continue;
}
for(i in this.ids[sGroup]){
var oDD=this.ids[sGroup][i];
if(this.isTypeOfDD(oDD)){
var loc=this.getLocation(oDD);
if(loc){
this.locationCache[oDD.id]=loc;
}else{
delete this.locationCache[oDD.id];
oDD.unreg();
}
}
}
}
};
this.verifyEl=function(el){
try{
if(el){
var parent=el.offsetParent;
if(parent){
return true;
}
}
}catch(e){
}
return false;
};
this.getLocation=function(oDD){
if(!this.isTypeOfDD(oDD)){
return null;
}
var el=oDD.getEl();
if(!this.verifyEl(el)){
return null;
}
var aPos=YAHOO.util.Dom.getXY(el);
x1=aPos[0];
x2=x1+el.offsetWidth;
y1=aPos[1];
y2=y1+el.offsetHeight;
var t=y1-oDD.padding[0];
var r=x2+oDD.padding[1];
var b=y2+oDD.padding[2];
var l=x1-oDD.padding[3];
return new YAHOO.util.Region(t,r,b,l);
};
this.isOverTarget=function(pt,oDDTarget,intersect){
var loc=this.locationCache[oDDTarget.id];
if(!loc||!this.useCache){
loc=this.getLocation(oDDTarget);
this.locationCache[oDDTarget.id]=loc;
}
oDDTarget.cursorIsOver=loc.contains(pt);
oDDTarget.overlap=null;
if(intersect){
var curRegion=
YAHOO.util.Region.getRegion(this.dragCurrent.getDragEl());
var overlap=curRegion.intersect(loc);
if(overlap){
oDDTarget.overlap=overlap;
return true;
}else{
return false;
}
}else{
return oDDTarget.cursorIsOver;
}
};
this._onUnload=function(e,me){
this.unregAll();
};
this.unregAll=function(){
if(this.dragCurrent){
this.stopDrag();
this.dragCurrent=null;
}
this._execOnAll("unreg",[]);
for(i in this.elementCache){
delete this.elementCache[i];
}
this.elementCache={};
this.ids={};
};
this.elementCache={};
this.getElWrapper=function(id){
var oWrapper=this.elementCache[id];
if(!oWrapper||!oWrapper.el){
oWrapper=this.elementCache[id]=
new this.ElementWrapper(document.getElementById(id));
}
return oWrapper;
};
this.getElement=function(id){
return document.getElementById(id);
};
this.getCss=function(id){
var css=null;
var el=document.getElementById(id);
if(el){
css=el.style;
}
return css;
};
this.ElementWrapper=function(el){
this.el=el||null;
this.id=this.el&&el.id;
this.css=this.el&&el.style;
};
this.getPosX=function(el){
return YAHOO.util.Dom.getX(el);
};
this.getPosY=function(el){
return YAHOO.util.Dom.getY(el);
};
this.swapNode=function(n1,n2){
if(n1.swapNode){
n1.swapNode(n2);
}else{
var p=n2.parentNode;
var s=n2.nextSibling;
n1.parentNode.replaceChild(n2,n1);
p.insertBefore(n1,s);
}
};
this.getScroll=function(){
var t,l;
if(document.documentElement&&document.documentElement.scrollTop){
t=document.documentElement.scrollTop;
l=document.documentElement.scrollLeft;
}else if(document.body){
t=document.body.scrollTop;
l=document.body.scrollLeft;
}
return{top:t,left:l};
};
this.getStyle=function(el,styleProp){
if(el.style.styleProp){
return el.style.styleProp;
}else if(el.currentStyle){
return el.currentStyle[styleProp];
}else if(document.defaultView){
return document.defaultView.getComputedStyle(el,null).
getPropertyValue(styleProp);
}
};
this.getScrollTop=function(){return this.getScroll().top;};
this.getScrollLeft=function(){return this.getScroll().left;};
this.moveToEl=function(moveEl,targetEl){
var aCoord=YAHOO.util.Dom.getXY(targetEl);
YAHOO.util.Dom.setXY(moveEl,aCoord);
};
this.getClientHeight=function(){
return(window.innerHeight)?window.innerHeight:
(document.documentElement&&document.documentElement.clientHeight)?
document.documentElement.clientHeight:document.body.offsetHeight;
};
this.getClientWidth=function(){
return(window.innerWidth)?window.innerWidth:
(document.documentElement&&document.documentElement.clientWidth)?
document.documentElement.clientWidth:document.body.offsetWidth;
};
this.numericSort=function(a,b){return(a-b);};
this._timeoutCount=0;
this._addListeners=function(){
if(UTIL.Event&&
document&&
document.body){
this._onLoad();
}else{
if(this._timeoutCount>500){
}else{
setTimeout("YAHOO.util.DDM._addListeners()",10);
this._timeoutCount+=1;
}
}
};
this.handleWasClicked=function(node,id){
if(this.isHandle(id,node.id)){
return true;
}else{
var p=node.parentNode;
while(p){
if(this.isHandle(id,p.id)){
return true;
}else{
p=p.parentNode;
}
}
}
return false;
};
};
YAHOO.util.DDM=YAHOO.util.DragDropMgr;
YAHOO.util.DDM._addListeners();
}
YAHOO.util.DD=function(id,sGroup){
if(id){
this.init(id,sGroup);
}
};
YAHOO.util.DD.prototype=new YAHOO.util.DragDrop();
YAHOO.util.DD.prototype.scroll=true;
YAHOO.util.DD.prototype.autoOffset=function(iPageX,iPageY){
var el=this.getEl();
var aCoord=YAHOO.util.Dom.getXY(el);
var x=iPageX-aCoord[0];
var y=iPageY-aCoord[1];
this.setDelta(x,y);
};
YAHOO.util.DD.prototype.setDelta=function(iDeltaX,iDeltaY){
this.deltaX=iDeltaX;
this.deltaY=iDeltaY;
};
YAHOO.util.DD.prototype.setDragElPos=function(iPageX,iPageY){
this.alignElWithMouse(this.getDragEl(),iPageX,iPageY);
};
YAHOO.util.DD.prototype.alignElWithMouse=function(el,iPageX,iPageY){
var oCoord=this.getTargetCoord(iPageX,iPageY);
var aCoord=[oCoord.x,oCoord.y];
YAHOO.util.Dom.setXY(el,aCoord);
this.cachePosition(oCoord.x,oCoord.y);
};
YAHOO.util.DD.prototype.cachePosition=function(iPageX,iPageY){
if(iPageX){
this.lastPageX=iPageX;
this.lastPageY=iPageY;
}else{
var aCoord=YAHOO.util.Dom.getXY(this.getEl());
this.lastPageX=aCoord[0];
this.lastPageY=aCoord[1];
}
};
YAHOO.util.DD.prototype.autoScroll=function(x,y,h,w){
if(this.scroll){
var clientH=this.DDM.getClientHeight();
var clientW=this.DDM.getClientWidth();
var st=this.DDM.getScrollTop();
var sl=this.DDM.getScrollLeft();
var bot=h+y;
var right=w+x;
var toBot=(clientH+st-y-this.deltaY);
var toRight=(clientW+sl-x-this.deltaX);
var thresh=40;
var scrAmt=(document.all)?80:30;
if(bot>clientH&&toBot<thresh){
window.scrollTo(sl,st+scrAmt);
}
if(y<st&&st>0&&y-st<thresh){
window.scrollTo(sl,st-scrAmt);
}
if(right>clientW&&toRight<thresh){
window.scrollTo(sl+scrAmt,st);
}
if(x<sl&&sl>0&&x-sl<thresh){
window.scrollTo(sl-scrAmt,st);
}
}
};
YAHOO.util.DD.prototype.getTargetCoord=function(iPageX,iPageY){
var x;
var y;
if(this.deltaX==undefined)
x=iPageX;
else
x=iPageX-this.deltaX;
if(this.deltaY==undefined)
y=iPageY
else
y=iPageY-this.deltaY;
if(this.constrainX){
if(x<this.minX){x=this.minX;}
if(x>this.maxX){x=this.maxX;}
}
if(this.constrainY){
if(y<this.minY){y=this.minY;}
if(y>this.maxY){y=this.maxY;}
}
x=this.getTick(x,this.xTicks);
y=this.getTick(y,this.yTicks);
return{x:x,y:y};
};
YAHOO.util.DD.prototype.b4MouseDown=function(e){
this.autoOffset(YAHOO.util.Event.getPageX(e),
YAHOO.util.Event.getPageY(e));
};
YAHOO.util.DD.prototype.b4Drag=function(e){
this.setDragElPos(YAHOO.util.Event.getPageX(e),
YAHOO.util.Event.getPageY(e));
};
YAHOO.util.DDProxy=function(id,sGroup){
if(id){
this.init(id,sGroup);
this.initFrame();
}
};
YAHOO.util.DDProxy.prototype=new YAHOO.util.DD();
YAHOO.util.DDProxy.frameDiv=null;
YAHOO.util.DDProxy.dragElId="ygddfdiv";
YAHOO.util.DDProxy.prototype.borderWidth=2;
YAHOO.util.DDProxy.prototype.resizeFrame=true;
YAHOO.util.DDProxy.prototype.centerFrame=false;
YAHOO.util.DDProxy.createFrame=function(){
var THIS=YAHOO.util.DDProxy;
if(!document||!document.body){
setTimeout(THIS.createFrame,50);
return;
}
if(!THIS.frameDiv){
THIS.frameDiv=document.createElement("div");
THIS.frameDiv.id=THIS.dragElId;
var s=THIS.frameDiv.style;
s.position="absolute";
s.visibility="hidden";
s.cursor="move";
s.border="2px solid #aaa";
s.zIndex=999;
document.body.appendChild(THIS.frameDiv);
}
};
YAHOO.util.DDProxy.prototype.initFrame=function(){
YAHOO.util.DDProxy.createFrame();
this.setDragElId(YAHOO.util.DDProxy.dragElId);
this.useAbsMath=true;
};
YAHOO.util.DDProxy.prototype.showFrame=function(iPageX,iPageY){
var el=this.getEl();
var s=this.getDragEl().style;
if(this.resizeFrame){
s.width=(parseInt(el.offsetWidth)-(2*this.borderWidth))+"px";
s.height=(parseInt(el.offsetHeight)-(2*this.borderWidth))+"px";
}
if(this.centerFrame){
this.setDelta(Math.round(parseInt(s.width)/2),
Math.round(parseInt(s.width)/2));
}
this.setDragElPos(iPageX,iPageY);
s.visibility="";
};
YAHOO.util.DDProxy.prototype.b4MouseDown=function(e){
var x=YAHOO.util.Event.getPageX(e);
var y=YAHOO.util.Event.getPageY(e);
this.autoOffset(x,y);
this.setDragElPos(x,y);
};
YAHOO.util.DDProxy.prototype.b4StartDrag=function(x,y){
this.showFrame(x,y);
};
YAHOO.util.DDProxy.prototype.b4EndDrag=function(e){
var s=this.getDragEl().style;
s.visibility="hidden";
};
YAHOO.util.DDProxy.prototype.endDrag=function(e){
var lel=this.getEl();
var del=this.getDragEl();
del.style.visibility="";
lel.style.visibility="hidden";
YAHOO.util.DDM.moveToEl(lel,del);
del.style.visibility="hidden";
lel.style.visibility="";
};
YAHOO.util.DDTarget=function(id,sGroup){
if(id){
this.initTarget(id,sGroup);
}
};
YAHOO.util.DDTarget.prototype=new YAHOO.util.DragDrop();
YAHOO.widget.Slider=function(sElementId,sGroup,oThumb){
if(sElementId){
this.init(sElementId,sGroup,true);
var self=this;
this.thumb=oThumb;
oThumb.onChange=function(){
self.onThumbChange();
};
var el=oThumb.getEl();
this.thumbCenterPoint={x:el.offsetWidth/2,y:el.offsetHeight/2};
this.isTarget=false;
this.animate=YAHOO.widget.Slider.ANIM_AVAIL;
this.backgroundEnabled=true;
this.baselinePos=YAHOO.util.Dom.getXY(this.getEl());
this.tickPause=40;
if(oThumb._isHoriz&&oThumb.xTicks){
this.tickPause=Math.round(360/oThumb.xTicks.length);
}else if(oThumb.yTicks){
this.tickPause=Math.round(360/oThumb.yTicks.length);
}
oThumb.onMouseDown=function(){return self.focus();};
oThumb.b4MouseDown=function(){return self.b4MouseDown();};
oThumb.onMouseUp=function(){self.onMouseUp();};
oThumb.onDrag=function(){self.fireEvents();};
}
};
YAHOO.widget.Slider.prototype=new YAHOO.util.DragDrop();
YAHOO.widget.Slider.getHorizSlider=
function(sBGElId,sHandleElId,iLeft,iRight,iTickSize){
return new YAHOO.widget.Slider(sBGElId,sBGElId,
new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,
iLeft,iRight,0,0,iTickSize));
};
YAHOO.widget.Slider.getVertSlider=
function(sBGElId,sHandleElId,iUp,iDown,iTickSize){
return new YAHOO.widget.Slider(sBGElId,sBGElId,
new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,0,0,
iUp,iDown,iTickSize));
};
YAHOO.widget.Slider.getSliderRegion=
function(sBGElId,sHandleElId,iLeft,iRight,iUp,iDown,iTickSize){
return new YAHOO.widget.Slider(sBGElId,sBGElId,
new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,
iUp,iDown,iTickSize));
};
YAHOO.widget.Slider.ANIM_AVAIL=true;
YAHOO.widget.Slider.prototype.lock=function(){
this.thumb.lock();
this.locked=true;
};
YAHOO.widget.Slider.prototype.unlock=function(){
this.thumb.unlock();
this.locked=false;
};
YAHOO.widget.Slider.prototype.onMouseUp=function(){
this._deferSlideEnd=true;
this.fireEvents();
};
YAHOO.widget.Slider.prototype.focus=function(){
var el=this.getEl();
if(el.focus){
el.focus();
}
this.verifyOffset();
if(this.isLocked()){
return false;
}else{
this.onSlideStart();
return true;
}
};
YAHOO.widget.Slider.prototype.onChange=function(firstOffset,secondOffset){
};
YAHOO.widget.Slider.prototype.onSlideStart=function(){
};
YAHOO.widget.Slider.prototype.onSlideEnd=function(){
};
YAHOO.widget.Slider.prototype.getValue=function(){
return this.thumb.getValue();
};
YAHOO.widget.Slider.prototype.getXValue=function(){
return this.thumb.getXValue();
};
YAHOO.widget.Slider.prototype.getYValue=function(){
return this.thumb.getYValue();
};
YAHOO.widget.Slider.prototype.onThumbChange=function(){
var t=this.thumb;
if(t._isRegion){
t.onChange(t.getXValue(),t.getYValue());
}else{
t.onChange(t.getValue());
}
};
YAHOO.widget.Slider.prototype.setValue=function(newOffset,skipAnim){
if(this.isLocked()){
return false;
}
if(isNaN(newOffset)){
return false;
}
var t=this.thumb;
var newX,newY;
if(t._isRegion){
return false;
}else if(t._isHoriz){
newX=t.initPageX+newOffset+this.thumbCenterPoint.x;
this.moveThumb(newX,t.initPageY,skipAnim);
}else{
newY=t.initPageY+newOffset+this.thumbCenterPoint.y;
this.moveThumb(t.initPageX,newY,skipAnim);
}
return true;
};
YAHOO.widget.Slider.prototype.setRegionValue=function(newOffset,newOffset2,skipAnim){
if(this.isLocked()){
return false;
}
if(isNaN(newOffset)){
return false;
}
var t=this.thumb;
if(t._isRegion){
var newX=t.initPageX+newOffset+this.thumbCenterPoint.x;
var newY=t.initPageY+newOffset2+this.thumbCenterPoint.y;
this.moveThumb(newX,newY,skipAnim);
return true;
}
return false;
};
YAHOO.widget.Slider.prototype.verifyOffset=function(){
var newPos=YAHOO.util.Dom.getXY(this.getEl());
if(newPos[0]!=this.baselinePos[0]||newPos[1]!=this.baselinePos[1]){
this.thumb.resetConstraints();
this.baselinePos=newPos;
return false;
}
return true;
};
YAHOO.widget.Slider.prototype.moveThumb=function(x,y,skipAnim){
this.verifyOffset();
var self=this;
var t=this.thumb;
t.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);
var _p=t.getTargetCoord(x,y);
var p=[_p.x,_p.y];
if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&t._graduated&&!skipAnim){
this.lock();
setTimeout(function(){self.moveOneTick(p);},this.tickPause);
}else if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&!skipAnim){
this.lock();
var oAnim=new YAHOO.util.Motion(
t.id,{points:{to:p}},0.4,YAHOO.util.Easing.easeOut);
oAnim.onComplete.subscribe(function(){self.endAnim();});
oAnim.animate();
}else{
t.setDragElPos(x,y);
this.fireEvents();
}
};
YAHOO.widget.Slider.prototype.moveOneTick=function(finalCoord){
var t=this.thumb;
var curCoord=YAHOO.util.Dom.getXY(t.getEl());
var tmp;
var nextCoord=null;
if(t._isRegion){
nextCoord=this._getNextX(curCoord,finalCoord);
var tmpX=(nextCoord)?nextCoord[0]:curCoord[0];
nextCoord=this._getNextY([tmpX,curCoord[1]],finalCoord);
}else if(t._isHoriz){
nextCoord=this._getNextX(curCoord,finalCoord);
}else{
nextCoord=this._getNextY(curCoord,finalCoord);
}
if(nextCoord){
YAHOO.util.Dom.setXY(t.getEl(),nextCoord);
if(!(nextCoord[0]==finalCoord[0]&&nextCoord[1]==finalCoord[1])){
var self=this;
setTimeout(function(){self.moveOneTick(finalCoord);},
this.tickPause);
}else{
this.unlock();
this.fireEvents();
}
}else{
this.unlock();
this.fireEvents();
}
};
YAHOO.widget.Slider.prototype._getNextX=function(curCoord,finalCoord){
var t=this.thumb;
var thresh;
var tmp=[];
var nextCoord=null;
if(curCoord[0]>finalCoord[0]){
thresh=t.tickSize-this.thumbCenterPoint.x;
tmp=t.getTargetCoord(curCoord[0]-thresh,curCoord[1]);
nextCoord=[tmp.x,tmp.y];
}else if(curCoord[0]<finalCoord[0]){
thresh=t.tickSize+this.thumbCenterPoint.x;
tmp=t.getTargetCoord(curCoord[0]+thresh,curCoord[1]);
nextCoord=[tmp.x,tmp.y];
}else{
}
return nextCoord;
};
YAHOO.widget.Slider.prototype._getNextY=function(curCoord,finalCoord){
var t=this.thumb;
var thresh;
var tmp=[];
var nextCoord=null;
if(curCoord[1]>finalCoord[1]){
thresh=t.tickSize-this.thumbCenterPoint.y;
tmp=t.getTargetCoord(curCoord[0],curCoord[1]-thresh);
nextCoord=[tmp.x,tmp.y];
}else if(curCoord[1]<finalCoord[1]){
thresh=t.tickSize+this.thumbCenterPoint.y;
tmp=t.getTargetCoord(curCoord[0],curCoord[1]+thresh);
nextCoord=[tmp.x,tmp.y];
}else{
}
return nextCoord;
};
YAHOO.widget.Slider.prototype.b4MouseDown=function(e){
this.thumb.resetConstraints();
};
YAHOO.widget.Slider.prototype.onMouseDown=function(e){
if(!this.isLocked()&&this.backgroundEnabled){
var x=YAHOO.util.Event.getPageX(e);
var y=YAHOO.util.Event.getPageY(e);
this.moveThumb(x,y);
this.focus();
}
};
YAHOO.widget.Slider.prototype.onDrag=function(e){
if(!this.isLocked()&&this.backgroundEnabled){
var x=YAHOO.util.Event.getPageX(e);
var y=YAHOO.util.Event.getPageY(e);
this.moveThumb(x,y,true);
}
};
YAHOO.widget.Slider.prototype.endAnim=function(){
this.unlock();
this.fireEvents();
};
YAHOO.widget.Slider.prototype.fireEvents=function(){
var t=this.thumb;
t.cachePosition();
if(!this.isLocked()){
if(t._isRegion){
var newX=t.getXValue();
var newY=t.getYValue();
if(newX!=this.previousX||newY!=this.previousY){
this.onChange(newX,newY);
}
this.previousX=newX;
this.previousY=newY;
}else{
var newVal=t.getValue();
if(newVal!=this.previousVal){
this.onChange(newVal);
}
this.previousVal=newVal;
}
if(this._deferSlideEnd){
this.onSlideEnd();
this._deferSlideEnd=false;
}
}
};
YAHOO.widget.SliderThumb=function(id,sGroup,iLeft,iRight,iUp,iDown,iTickSize){
if(id){
this.init(id,sGroup);
this.parentElId=sGroup;
this.initSlider(iLeft,iRight,iUp,iDown,iTickSize);
}
this.isTarget=false;
this.tickSize=iTickSize;
this.maintainOffset=true;
};
YAHOO.widget.SliderThumb.prototype=new YAHOO.util.DD();
YAHOO.widget.SliderThumb.prototype.getOffsetFromParent=function(){
var myPos=YAHOO.util.Dom.getXY(this.getEl());
var parentPos=YAHOO.util.Dom.getXY(this.parentElId);
return[(myPos[0]-parentPos[0]),(myPos[1]-parentPos[1])];
};
YAHOO.widget.SliderThumb.prototype.startOffset=null;
YAHOO.widget.SliderThumb.prototype._isHoriz=false;
YAHOO.widget.SliderThumb.prototype._prevVal=0;
YAHOO.widget.SliderThumb.prototype._graduated=false;
YAHOO.widget.SliderThumb.prototype.initSlider=function(iLeft,iRight,iUp,iDown,
iTickSize){
this.setXConstraint(iLeft,iRight,iTickSize);
this.setYConstraint(iUp,iDown,iTickSize);
if(iTickSize&&iTickSize>1){
this._graduated=true;
}
this._isHoriz=(iLeft>0||iRight>0);
this._isVert=(iUp>0||iDown>0);
this._isRegion=(this._isHoriz&&this._isVert);
this.startOffset=this.getOffsetFromParent();
};
YAHOO.widget.SliderThumb.prototype.getValue=function(){
var val=(this._isHoriz)?this.getXValue():this.getYValue();
return val;
};
YAHOO.widget.SliderThumb.prototype.getXValue=function(){
var newOffset=this.getOffsetFromParent();
return(newOffset[0]-this.startOffset[0]);
};
YAHOO.widget.SliderThumb.prototype.getYValue=function(){
var newOffset=this.getOffsetFromParent();
return(newOffset[1]-this.startOffset[1]);
};
YAHOO.widget.SliderThumb.prototype.onChange=function(x,y){};
if("undefined"==typeof YAHOO.util.Anim){
YAHOO.widget.Slider.ANIM_AVAIL=false;
}
/*
    Author          : Roger   
    Date Created    : 31/05/2007
    Description     : This library provides a collection a custom sliders
    Implemented     : DualTimeSlider, DualNumberSlider
    Based on        : YAHOO.widget.Slider
    
*/

CQS.Slider = new function() {
    var sliders = new Array();

    this.SliderManager = new function() {
        this.add = function(slider) {
            sliders.push(slider);
        };

        this.get = function(id) {
            for (var i = 0; i < sliders.length; i++) {
                if (sliders[i].id == id) {
                    return sliders[i]
                }
            }

            return null;
        };

        this.getAll = function() {
            return sliders;
        };
    };

    this.DualTimeSlider = function(sCallBackID, sUpdatePanelID, sUpdatePanelCallbackID, elBG, elMinThumb, elMaxThumb, elRange, elDay, lblMinTime, lblMaxTime, lblCurrMinTime, lblCurrMaxTime, hidRawMinTime, hidRawMaxTime, hidRawCurrMinTime, hidRawCurrMaxTime, iLeft, iRight) {
        var seperator = '_';
        var timeFilterArray = new Array();
        var sliderTimeMin;
        var sliderTimeMax;
        var pixelTimeValue;
        var prevMinOffset = 0;
        var prevMaxOffset = 0;
        var maxWidth = 0;
        var prevMinTime = hidRawMinTime.value;
        var prevMaxTime = hidRawMaxTime.value;
        var prevCurrMinTime = hidRawCurrMinTime.value;
        var prevCurrMaxTime = hidRawCurrMaxTime.value;

        var calcOffsetFromStart = function(timeArray, timeValue, pixelTimeValue) {
            for (i = 0; i < timeArray.length; i++) {
                if (timeArray[i] == timeValue) {
                    return roundNumber(i * pixelTimeValue, 0)
                }
            }
        };

        var GetFilterDate = function(elDateTime) {
            // dateTimes[0] = {date} e.g. "yyyymmdd" 
            // dateTimes[1] = {time} e.g. "hh:mm"
            var dateTimes = elDateTime.split(seperator);
            return dateTimes[0];
        };

        var GetFilterTime = function(elDateTime) {
            // dateTimes[0] = {date} e.g. "yyyymmdd" 
            // dateTimes[1] = {time} e.g. "hh:mm"
            var dateTimes = elDateTime.split(seperator);
            return dateTimes[1];
        };

        var setDayMarker = function(timeArray, elDay, elMinThumb, pixelTimeValue) {
            elDay.style.display = 'none';
            for (i = 0; i < timeArray.length; i++) {

                if (GetFilterTime(timeArray[i]) == '00:00') {
                    elDay.style.display = '';
                    elDay.style.left = (i * pixelTimeValue) + elMinThumb.offsetWidth + 'px';
                    break;
                }
            }
        };

        var loadTimeFilterArray = function(timeArray, startTime, endTime) {
            var startLoading = 0;
            var stopLoading = 0;
            var strDate = GetFilterDate(startTime);
            var strValue = null;
            var prevHour = null;

            if (timeArray.constructor == Array) {
                timeArray.length = 0;
                while (!stopLoading) {
                    for (cnt = 0; cnt < 48; cnt++) {
                        var hour = Math.floor(cnt / 2);
                        if ((cnt % 2) > 0) {
                            strValue = hour < 10 ? '0' + hour + ':30' : hour + ':30';
                        }
                        else {
                            strValue = hour < 10 ? '0' + hour + ':00' : hour + ':00';
                        }
                        if (strDate != GetFilterDate(endTime)) {
                            if (prevHour != null) {
                                // times crossing over midnight, so date must be adjusted
                                if (hour < prevHour) {
                                    strDate = GetFilterDate(endTime);
                                }
                            }
                        }
                        prevHour = hour;
                        // format: "yyyyMMdd_HH:mm"
                        strValue = strDate + seperator + strValue;

                        if (strValue == startTime) {
                            startLoading = 1;
                        }

                        if (startLoading) {
                            timeArray[timeArray.length] = strValue;
                        }

                        if (strValue == endTime && startLoading) {
                            stopLoading = 1;
                            break;
                        }
                    }
                }
            }
        };

        var moveSliderTimeMin = function(offsetFromStart) {
            hidRawCurrMinTime.value = timeFilterArray[roundNumber(offsetFromStart / pixelTimeValue, 0)];
            lblCurrMinTime.innerHTML = GetFilterTime(hidRawCurrMinTime.value);
            sliderTimeMax.thumb.setXConstraint(iRight - offsetFromStart, 0, 1);
            elRange.style.left = offsetFromStart + 'px';
            elMinThumb.style.left = '0px';
            elRange.style.width = ((elBG.offsetWidth + prevMaxOffset) - offsetFromStart) + 'px';
            prevMinOffset = offsetFromStart;

            if (lblCurrMaxTime.offsetWidth > maxWidth)
                lblCurrMaxTime.style.left = '';

            if (elRange.offsetWidth <= (lblCurrMinTime.offsetWidth + lblCurrMaxTime.offsetWidth)) {
                lblCurrMinTime.style.left = (elRange.offsetWidth - (lblCurrMinTime.offsetWidth + lblCurrMaxTime.offsetWidth)) + 'px';
            }
            else {
                lblCurrMinTime.style.left = '';
            }
        };

        var moveSliderTimeMax = function(offsetFromStart) {
            hidRawCurrMaxTime.value = timeFilterArray[(timeFilterArray.length - 1) - roundNumber((offsetFromStart * -1) / pixelTimeValue, 0)];
            lblCurrMaxTime.innerHTML = GetFilterTime(hidRawCurrMaxTime.value);
            sliderTimeMin.thumb.setXConstraint(0, iRight + offsetFromStart, 1);
            elRange.style.width = ((elBG.offsetWidth - elRange.offsetLeft) + offsetFromStart) + 'px';
            elMaxThumb.style.left = '0px';
            prevMaxOffset = offsetFromStart;

            if (lblCurrMaxTime.offsetLeft <= (lblCurrMinTime.offsetLeft + lblCurrMinTime.offsetWidth))
                lblCurrMaxTime.style.left = (lblCurrMinTime.offsetLeft + lblCurrMinTime.offsetWidth) + 'px';

            if (elMaxThumb.offsetLeft > (lblCurrMinTime.offsetLeft + lblCurrMinTime.offsetWidth + lblCurrMinTime.offsetWidth))
                lblCurrMaxTime.style.left = '';

            maxWidth = lblCurrMaxTime.offsetWidth
        };

        sliderTimeMin = YAHOO.widget.Slider.getHorizSlider(elBG.id, elMinThumb.id, iLeft, iRight);
        sliderTimeMax = YAHOO.widget.Slider.getHorizSlider(elBG.id, elMaxThumb.id, iRight, iLeft);

        sliderTimeMin.backgroundEnabled = false;
        sliderTimeMax.backgroundEnabled = false;

        // initialize core variables
        loadTimeFilterArray(timeFilterArray, hidRawMinTime.value, hidRawMaxTime.value);
        pixelTimeValue = iRight / (timeFilterArray.length - 1);

        prevMinOffset = calcOffsetFromStart(timeFilterArray, prevCurrMinTime, pixelTimeValue);
        sliderTimeMin.setValue(prevMinOffset, true, true);
        moveSliderTimeMin(prevMinOffset);

        prevMaxOffset = calcOffsetFromStart(timeFilterArray, prevCurrMaxTime, pixelTimeValue) - iRight;
        sliderTimeMax.setValue(prevMaxOffset, true, true);
        moveSliderTimeMax(prevMaxOffset);

        setDayMarker(timeFilterArray, elDay, elMinThumb, pixelTimeValue);

        sliderTimeMin.onChange = function(offsetFromStart) {
            moveSliderTimeMin(offsetFromStart)
        };

        sliderTimeMax.onChange = function(offsetFromStart) {
            moveSliderTimeMax(offsetFromStart);
        };

        sliderTimeMin.onSlideEnd = function() {
            if (prevMinTime != hidRawCurrMinTime.value) {
                DualFilterCallback(sCallBackID, sUpdatePanelID, sUpdatePanelCallbackID, hidRawCurrMinTime.value, hidRawCurrMaxTime.value);
            }
            prevMinTime = hidRawCurrMinTime.value;
        };

        sliderTimeMax.onSlideEnd = function() {
            if (prevMaxTime != hidRawCurrMaxTime.value) {
                DualFilterCallback(sCallBackID, sUpdatePanelID, sUpdatePanelCallbackID, hidRawCurrMinTime.value, hidRawCurrMaxTime.value);
            }
            prevMaxTime = hidRawCurrMaxTime.value;
        };

        this.id = sCallBackID;
        this.reset = function(newMinValue, newMaxValue) {
            // reset default values
            hidRawMinTime.value = newMinValue;
            hidRawMaxTime.value = newMaxValue;
            hidRawCurrMinTime.value = newMinValue;
            hidRawCurrMaxTime.value = newMaxValue;

            lblMinNumber.innerHTML = GetFilterTime(hidRawMinTime.value);
            lblMaxNumber.innerHTML = GetFilterTime(hidRawMaxTime.value);
            lblCurrMinNumber.innerHTML = GetFilterTime(hidRawCurrMinTime.value);
            lblCurrMaxNumber.innerHTML = GetFilterTime(hidRawCurrMaxTime.value);
            prevMinOffset = 0;
            prevMaxOffset = 0;
            maxWidth = 0;
            prevMinTime = hidRawMinTime.value;
            prevMaxTime = hidRawMaxTime.value;

            // reset default styles
            elRange.style.left = '';
            elRange.style.width = '';
            elMinThumb.style.left = '';
            elMaxThumb.style.left = '';
            lblCurrMinTime.style.left = '';
            lblCurrMaxTime.style.left = '';

            loadTimeFilterArray(timeFilterArray, newMinValue, newMaxValue);
            pixelTimeValue = iRight / (timeFilterArray.length - 1);
            setDayMarker(timeFilterArray, elDay, elMinThumb, pixelTimeValue);

            sliderTimeMin.thumb.maintainOffset = false;
            sliderTimeMax.thumb.maintainOffset = false;
            sliderTimeMin.thumb.resetConstraints();
            sliderTimeMax.thumb.resetConstraints();
            sliderTimeMin.thumb.maintainOffset = true;
            sliderTimeMax.thumb.maintainOffset = true;
        };

        if (typeof (DualTimeSliderInitializationFinished) != 'undefined') {
            DualTimeSliderInitializationFinished(sCallBackID);
        };
    };

    this.DualNumberSlider = function(sCallBackID, sUpdatePanelID, sUpdatePanelCallbackID, sNumberFormat, elBG, elMinThumb, elMaxThumb, elRange, lblMinNumber, lblMaxNumber, lblCurrMinNumber, lblCurrMaxNumber, hidRawMinNumber, hidRawMaxNumber, hidRawCurrMinNumber, hidRawCurrMaxNumber, bMinSliderVisible, bMaxSliderVisible, iLeft, iRight) {
        var decimalFormat = 1;
        var minutesFormat = 2;
        var sliderNumberMin;
        var sliderNumberMax;
        var pixelNumberValue;
        var prevMinOffset = 0;
        var prevMaxOffset = 0;
        var maxWidth = 0;
        var prevMinNumber = hidRawMinNumber.value;
        var prevMaxNumber = hidRawMaxNumber.value;
        var prevCurrMinNumber = hidRawCurrMinNumber.value;
        var prevCurrMaxNumber = hidRawCurrMaxNumber.value;

        var formatDisplayedValue = function(numberFormat, rawValue) {
            switch (parseFloat(numberFormat)) {
                case minutesFormat:
                    // display value in {hh}.{MM)
                    var hours = parseInt(rawValue / 60);
                    var minutes = rawValue - (hours * 60);
                    if (minutes < 10) { minutes = "0" + minutes; }
                    return (hours + "." + minutes);

                case decimalFormat:
                default:
                    // display value "as is" (decimal)
                    return rawValue;
            }
        };

        var moveSliderNumberMin = function(offsetFromStart) {
            hidRawCurrMinNumber.value = roundNumber(Number(hidRawMinNumber.value) + (offsetFromStart * pixelNumberValue), 0);
            lblCurrMinNumber.innerHTML = formatDisplayedValue(sNumberFormat, hidRawCurrMinNumber.value);
            sliderNumberMax.thumb.setXConstraint(iRight - offsetFromStart, 0, 1);
            elRange.style.left = offsetFromStart + 'px';
            elMinThumb.style.left = '0px';
            elRange.style.width = ((elBG.offsetWidth + prevMaxOffset) - offsetFromStart) + 'px';
            prevMinOffset = offsetFromStart;

            if (lblCurrMaxNumber.offsetWidth > maxWidth)
                lblCurrMaxNumber.style.left = '';

            if (elRange.offsetWidth <= (lblCurrMinNumber.offsetWidth + lblCurrMaxNumber.offsetWidth)) {
                lblCurrMinNumber.style.left = (elRange.offsetWidth - (lblCurrMinNumber.offsetWidth + lblCurrMaxNumber.offsetWidth)) + 'px';
            }
            else
                lblCurrMinNumber.style.left = '';

            if (!bMinSliderVisible) {
                elMinThumb.style.display = "none";
                lblCurrMinNumber.style.display = "none";
            }
        };

        var moveSliderNumberMax = function(offsetFromStart) {
            hidRawCurrMaxNumber.value = roundNumber(Number(hidRawMaxNumber.value) - ((offsetFromStart * -1) * pixelNumberValue), 0);
            lblCurrMaxNumber.innerHTML = formatDisplayedValue(sNumberFormat, hidRawCurrMaxNumber.value);
            sliderNumberMin.thumb.setXConstraint(0, iRight + offsetFromStart, 1);
            elRange.style.width = ((elBG.offsetWidth - elRange.offsetLeft) + offsetFromStart) + 'px';
            elMaxThumb.style.left = '0px';
            prevMaxOffset = offsetFromStart;

            if (lblCurrMaxNumber.offsetLeft <= (lblCurrMinNumber.offsetLeft + lblCurrMinNumber.offsetWidth))
                lblCurrMaxNumber.style.left = (lblCurrMinNumber.offsetLeft + lblCurrMinNumber.offsetWidth) + 'px';

            if (elMaxThumb.offsetLeft > (lblCurrMinNumber.offsetLeft + lblCurrMinNumber.offsetWidth + lblCurrMinNumber.offsetWidth))
                lblCurrMaxNumber.style.left = '';

            maxWidth = lblCurrMaxNumber.offsetWidth

            if (!bMaxSliderVisible) {
                elMaxThumb.style.display = "none";
                lblCurrMaxNumber.style.display = "none";
            }
        };

        sliderNumberMin = YAHOO.widget.Slider.getHorizSlider(elBG.id, elMinThumb.id, iLeft, iRight);
        sliderNumberMax = YAHOO.widget.Slider.getHorizSlider(elBG.id, elMaxThumb.id, iRight, iLeft);

        sliderNumberMin.backgroundEnabled = false;
        sliderNumberMax.backgroundEnabled = false;

        // initialize core variables
        pixelNumberValue = (hidRawMaxNumber.value - hidRawMinNumber.value) / iRight;

        prevMinOffset = roundNumber((prevCurrMinNumber - prevMinNumber) / pixelNumberValue, 0);
        sliderNumberMin.setValue(prevMinOffset, true, true);
        moveSliderNumberMin(prevMinOffset);

        prevMaxOffset = roundNumber((prevCurrMaxNumber - prevMaxNumber) / pixelNumberValue, 0);
        sliderNumberMax.setValue(prevMaxOffset, true, true);
        moveSliderNumberMax(prevMaxOffset);

        sliderNumberMin.onChange = function(offsetFromStart) {
            if (isNaN(offsetFromStart)) {
                offsetFromStart = 0;
            }
            moveSliderNumberMin(offsetFromStart);
        };

        sliderNumberMax.onChange = function(offsetFromStart) {
            moveSliderNumberMax(offsetFromStart);
        };

        sliderNumberMin.onSlideEnd = function() {
            if (prevMinNumber != hidRawCurrMinNumber.value) {
                DualFilterCallback(sCallBackID, sUpdatePanelID, sUpdatePanelCallbackID, hidRawCurrMinNumber.value, hidRawCurrMaxNumber.value);
            }
            prevMinNumber = hidRawCurrMinNumber.value;
        };

        sliderNumberMax.onSlideEnd = function() {
            if (prevMaxNumber != hidRawCurrMaxNumber.value) {
                DualFilterCallback(sCallBackID, sUpdatePanelID, sUpdatePanelCallbackID, hidRawCurrMinNumber.value, hidRawCurrMaxNumber.value);
            }
            prevMaxNumber = hidRawCurrMaxNumber.value;
        };

        // change constraints to ensure that two thumbs do not overlap
        sliderNumberMin.thumb.setXConstraint(0, iRight, 1);
        sliderNumberMax.thumb.setXConstraint(iRight, 0, 1);

        this.id = sCallBackID;
        this.reset = function(newMinValue, newMaxValue) {
            // reset default values
            hidRawMinNumber.value = newMinValue;
            hidRawMaxNumber.value = newMaxValue;
            hidRawCurrMinNumber.value = newMinValue;
            hidRawCurrMaxNumber.value = newMaxValue;

            lblMinNumber.innerHTML = hidRawMinNumber.value;
            lblMaxNumber.innerHTML = hidRawMaxNumber.value;
            lblCurrMinNumber.innerHTML = hidRawCurrMinNumber.value;
            lblCurrMaxNumber.innerHTML = hidRawCurrMaxNumber.value;

            prevMinOffset = 0;
            prevMaxOffset = 0;
            maxWidth = 0;
            prevMinNumber = hidRawMinNumber.value;
            prevMaxNumber = hidRawMaxNumber.value;

            // reset default styles
            elRange.style.left = '';
            elRange.style.width = '';
            elMinThumb.style.left = '';
            elMaxThumb.style.left = '';
            lblCurrMinNumber.style.left = '';
            lblCurrMaxNumber.style.left = '';

            pixelNumberValue = (newMaxValue - newMinValue) / iRight;

            sliderNumberMin.thumb.maintainOffset = false;
            sliderNumberMax.thumb.maintainOffset = false;
            sliderNumberMin.thumb.resetConstraints();
            sliderNumberMax.thumb.resetConstraints();
            sliderNumberMin.thumb.maintainOffset = true;
            sliderNumberMax.thumb.maintainOffset = true;

            if (!bMinSliderVisible) {
                elMinThumb.style.display = "none";
                lblCurrMinNumber.style.display = "none";
            }

            if (!bMaxSliderVisible) {
                elMaxThumb.style.display = "none";
                lblCurrMaxNumber.style.display = "none";
            }
        };
    };

    /*
    The following properties/methods are common to all sliders
    ----------------------------------------------------------
    */
    var DualFilterCallback = function(sCallBackID, sUpdatePanelID, sUpdatePanelCallbackID, sMinValue, sMaxValue) {
        ShowFilteringResultsBox();
        CQS.Callback.doCallbackAndReloadUpdatePanel(sCallBackID, sMinValue + ',' + sMaxValue, sUpdatePanelID, sUpdatePanelCallbackID, '', false);
    };

    this.DualFilterCallback = function(sCallBackID, sUpdatePanelID, sUpdatePanelCallbackID, sMinValue, sMaxValue) {
        DualFilterCallback(sCallBackID, sUpdatePanelID, sUpdatePanelCallbackID, sMinValue, sMaxValue);
    };
}/*
GoogleMaps.js
    
Google Map API methods for the SearchResultMap control
*/



var _toggleAllMap = function(coordList, mapCont) {
    _toggleAllMap(coordList, mapCont, null);
}

var _toggleAllMap = function(coordList, mapCont, defaultCenter) {


    var divObj = $(mapCont);

    if (divObj.style.display == 'none') {
        _showAllMapResults(coordList, divObj, defaultCenter);
    }
    else {
        _hideAllMapResults(divObj);
    }
}

/*
the coordList is an array of objects with the following structure, it basically represents the MapCoordinate object on the google map control
    
var coord = coordList[0];
    
coord.lat               - Latitude coordinate                                   (double)
coord.lng               - Longitude coordinate                                  (double)

coord.type              - type of coordinate, hotel, point of interest, car     (string)
coord.iconUrl           - url for the icon marker                               (string)
coord.iconSharowUrl     - shadow image for the icon marker                      (string)

coord.anchorPoint.x     - x anchor point for image                              (int)
coord.anchorPoint.x     - x anchor point for image                              (int)

coord.iconSize.width    - width of the icon                                     (int)
coord.iconSize.height   - height of the icon                                    (int)

coord.shadowSize.width  - height of the icon shadow                             (int)
coord.shadowSize.height - width of the icon shadow                              (int)

coord.centerLat         - the center latitude point of the map                  (double)
coord.centerLng         - the center longitude point of the map                 (double)

coord.markerClick       - javascript that eval() would be run against           (string)
coord.content           - content text that can be used as tooltip, name, etc.  (string)

coord.id                - can be used as a unique identifier                    (string)
    
*/

var _showAllMapResults = function(coordList, divObj) {
    _showAllMapResults(coordList, divObj, null);
}


var _getMapObj = function(divObj) {
    var mapObj;
    var mapVarName = divObj.id + "Map";
    eval("if (typeof(" + mapVarName + ") != 'undefined') mapObj = " + mapVarName + ";");
    
    return mapObj;
}

var _setMapObj = function(divObj) {
    var mapObj;
    var mapVarName = divObj.id + "Map";
    eval("var " + mapVarName);
    eval(mapVarName + " = new google.maps.Map2(divObj)");
    eval("mapObj = " + mapVarName);

    if (typeof (mapObj) != "undefined") {
        mapObj.addControl(new GSmallMapControl());
        mapObj.addControl(new GMenuMapTypeControl());
    }

    return mapObj;
}

var _clearMapItemArray = function(divObj) {
    var itemArray = _getMapItems(divObj);
    itemArray.empty();
}

// create an array associated to the specified divObj
var _createMapItemArray = function(divObj) {
    var arrayObj;
    var arrayVarName = divObj.id + "ItemArray";             // the name of the variable specific to divObj
    eval("var " + arrayVarName + " = new Array();");        // initialsing the variable with an array
    eval("arrayObj = " + arrayVarName);                     // returning the array
    return arrayObj;
}

// add an object to the divObj item array
var _addMapItem = function(mapItem, divObj) {
    var itemArray = _getMapItems(divObj);
    itemArray.push(mapItem);
}

// get the array of map overlay items associated with the divObj and create it if it does not exist
var _getMapItems = function(divObj) {
    var arrayObj;
    var arrayVarName = divObj.id + "ItemArray";
    eval("if (typeof(" + arrayVarName + ") != 'undefined') arrayObj = " + arrayVarName + "; else " + arrayVarName + " = arrayObj = _createMapItemArray(divObj);");

    return arrayObj;
}


var _setSelectedMapItem = function(itemId, divObj, selectedImageUrl, unselectedImageUrl) {
    var arrayObj = _getMapItems(divObj);

    if (arrayObj.length > 0) {


        for (var i = 0; i < arrayObj.length; i++) {
            if (arrayObj[i].coord.id == itemId + "") {
                arrayObj[i].icon.image = selectedImageUrl;
            }
            else {
                arrayObj[i].icon.image = unselectedImageUrl;
            }

            arrayObj[i].marker.remove();
            arrayObj[i].marker.icon = arrayObj[i].icon;
            arrayObj[i].marker.initialize(arrayObj[0].map);
            arrayObj[i].marker.redraw(true);
        }
    }
}

var _showAllMapResults = function(coordList, divObj, defaultCenter) {

    divObj.style.display = "block";

    // create uniquely identified map object per map control div if it does not exist already
    var map = _getMapObj(divObj);

    if (typeof (mapObj) == "undefined") {
        map = _setMapObj(divObj);
    }

    if (typeof (coordList) == "string") {
        coordList = JSON.decode(coordList);
    }
    if (typeof (defaultCenter) == "string") {
        defaultCenter = JSON.decode(defaultCenter);
    }

    map.disableDoubleClickZoom();

    if (typeof (defaultCenter) != "undefined" && defaultCenter != null && defaultCenter != "null" && defaultCenter.length > 0) {
        map.setCenter(new google.maps.LatLng(defaultCenter[0].lat, defaultCenter[0].lng));
    }

    _clearMapItemArray(divObj);

    if (coordList.length > 0) {

        var coord, ico, latlng, marker, coords = [];

        for (var i = 0; i < coordList.length; i++) {
            coord = coordList[i];

            /* Marker Image support */

            if (coord.iconUrl != null && coord.iconUrl != "") {
                ico = new google.maps.Icon(G_DEFAULT_ICON);

                ico.image = coord.iconUrl;
                ico.iconSize = new google.maps.Size(coord.iconSize.width, coord.iconSize.height);

                // set icon anchor point otherwise default to center of image
                if (typeof (coord.anchorPoint) != "undefined" && coord.anchorPoint != null) {
                    ico.iconAnchor = new google.maps.Point(coord.anchorPoint.x, coord.anchorPoint.y);
                }
                else {
                    ico.iconAnchor = new google.maps.Point(ico.iconSize.width / 2, ico.iconSize.height / 2);
                }

                var w = ico.iconSize.width - 1;
                ico.imageMap = [0, 0,
                                w, 0,
                                w, w,
                                0, w,
                                0, 0];

                ico.shadow = "";
                if (coord.iconSharowUrl != null && coord.iconSharowUrl != "") {
                    ico.shadow = coord.iconSharowUrl;
                    if (typeof (coord.shadowSize) != "undefined" && coord.shadowSize != null) {
                        ico.shadowSize = new google.maps.Size(coord.shadowSize.width, coord.shadowSize.height);
                    }
                }
            }
            else { // load the default google map icon
                ico = new google.maps.Icon(G_DEFAULT_ICON);
            }


            latlng = new google.maps.LatLng(coord.lat, coord.lng);
            marker = new google.maps.Marker(latlng, { icon: ico });

            // add item to map item array
            _addMapItem({ coord: coord, marker: marker, icon: ico, map: map, latlng: latlng }, divObj);

            // handle marker click
            if (coordList[i].markerClick != "") {
                var markerMethod = null;
                var markerMethod = eval("markerMethod = " + coordList[i].markerClick); // this should be "function() { /* code to be executed on marker click*/ }"
                if (typeof (markerMethod) != "undefined" && markerMethod != null) {
                    google.maps.Event.addListener(marker, "click", markerMethod);
                }
            }

            if (typeof (coord.content) == "string" && coord.content != "") {
                marker.bubbleContent = coord.content;
                google.maps.Event.addListener(marker, "mouseover", function(pt) {

                    if (typeof (this.bubbleContent) != "undefined") {
                        map.openInfoWindowHtml(pt, this.bubbleContent);
                    }
                });
            }

            map.addOverlay(marker);

            coords.push(latlng); // used for zooming bounds of all coordinates

        } // for (var i = 0; i < coordList.length; i++)

        var bounds, zoom, defaultZoom;

        bounds = new google.maps.Polygon(coords).getBounds();
        zoom = map.getBoundsZoomLevel(bounds);

        // see if we can find setting from web.config and only apply if one item on map
        if (typeof (_GoogleMapDefaultZoom) == "string" && coords.length == 1) {
            defaultZoom = parseInt(_GoogleMapDefaultZoom);

            if (zoom > defaultZoom) {
                zoom = defaultZoom;
            }
        }

        map.setCenter(bounds.getCenter(), zoom - 1);

    } // if (coordList.length > 0)
}

var _hideAllMapResults = function(divObj) {
    divObj.style.display = 'none';
    divObj.innerHTML = '';
}
var AirtradeOpenXScriptController = new function() {
    this.CallOpenXScript = function(zoneids) {
        var OA_zoneids = '';
        if (typeof (OA_zones) != 'undefined') {
            for (var zonename in OA_zones)
                OA_zoneids += escape(zonename + '=' + OA_zones[zonename] + "|");
            OA_zoneids += '&amp;nz=1';
        }
        else {
            OA_zoneids = escape(zoneids);
        }
        if (typeof (OA_source) == 'undefined') { OA_source = ''; }
        var OA_p = location.protocol == 'https:' ? 'https:' : 'http:';
        var OA_r = Math.floor(Math.random() * 99999999);

        OA_output = new Array();
        var OA_spc = "<" + "script type='text/javascript' ";
        OA_spc += "src='" + OA_p + "//d1.openx.org/spc.php?zones=" + OA_zoneids;
        OA_spc += "&amp;source=" + escape(OA_source) + "&amp;r=" + OA_r;
        OA_spc += (document.charset ? '&amp;charset=' + document.charset : (document.characterSet ? '&amp;charset=' + document.characterSet : ''));

        if (window.location) OA_spc += "&amp;loc=" + escape(window.location);
        if (document.referrer) OA_spc += "&amp;referer=" + escape(document.referrer);
        OA_spc += "'><" + "/script>";
        document.write(OA_spc);

        var OA_fo = '';
        OA_fo += "<" + "script type=\'text/javascript\' src='" + OA_p + "//d1.openx.org/fl.js\'><" + "/script>\n";
        document.write(OA_fo);
    };

    this.Show = function(name) {
        if (typeof (OA_output[name]) == 'undefined') {
            return;
        }
        else {
            document.write(OA_output[name]);
        }
    };

    this.PositionIt = function(objDiv) {
        if (!isIE) {
            setTimeout('MoveAds(\'' + objDiv + '\')', 2000);
        }
        else {
            MoveAds(objDiv);
        }
    };
};
function MoveAds(objDiv) {

    if (isIE) {

        var theParams = document.getElementById(objDiv + 'Hidden').getElementsByTagName("param");

        var theParamsLength = theParams.length;

        for (var j = 0; j < theParamsLength; j++) 
        {
            if (theParams[j].name.toLowerCase() == 'flashvars') {
                var theFlashVars = theParams[j].value;
            }
        }

        document.getElementById(objDiv).innerHTML = document.getElementById(objDiv + 'Hidden').innerHTML;

        var re = /<param name="FlashVars" value="">/ig;

        document.getElementById(objDiv).innerHTML = document.getElementById(objDiv).innerHTML.replace(re, "<param name='FlashVars' value='" + theFlashVars + "'>");

        document.getElementById(objDiv + 'Hidden').innerHTML = "";

    }

    else {

        document.getElementById(objDiv).innerHTML = document.getElementById(objDiv + 'Hidden').innerHTML;

        document.getElementById(objDiv + 'Hidden').innerHTML = "";

    }
};

