var MooTools={version:"1.11"};function $defined(A){return(A!=undefined)}function $type(B){if(!$defined(B)){return false}if(B.htmlElement){return"element"}var A=typeof B;if(A=="object"&&B.nodeName){switch(B.nodeType){case 1:return"element";case 3:return(/\S/).test(B.nodeValue)?"textnode":"whitespace"}}if(A=="object"||A=="function"){switch(B.constructor){case Array:return"array";case RegExp:return"regexp";case Class:return"class"}if(typeof B.length=="number"){if(B.item){return"collection"}if(B.callee){return"arguments"}}}return A}function $merge(){var C={};for(var B=0;B<arguments.length;B++){for(var E in arguments[B]){var A=arguments[B][E];var D=C[E];if(D&&$type(A)=="object"&&$type(D)=="object"){C[E]=$merge(D,A)}else{C[E]=A}}}return C}var $extend=function(){var A=arguments;if(!A[1]){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};var $native=function(){for(var B=0,A=arguments.length;B<A;B++){arguments[B].extend=function(C){for(var D in C){if(!this.prototype[D]){this.prototype[D]=C[D]}if(!this[D]){this[D]=$native.generic(D)}}}}};$native.generic=function(A){return function(B){return this.prototype[A].apply(B,Array.prototype.slice.call(arguments,1))}};$native(Function,Array,String,Number);function $chk(A){return !!(A||A===0)}function $pick(B,A){return $defined(B)?B:A}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B)}function $time(){return new Date().getTime()}function $clear(A){clearTimeout(A);clearInterval(A);return null}var Abstract=function(A){A=A||{};A.extend=$extend;return A};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName("head")[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.webkit=window[window.xpath?"webkit420":"webkit419"]=true}else{if(document.getBoxObjectFor!=null){window.gecko=true}}}window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=="undefined"){var HTMLElement=function(){};if(window.webkit){document.createElement("iframe")}HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{}}HTMLElement.prototype.htmlElement=function(){};if(window.ie6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}var Class=function(B){var A=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function")?this.initialize.apply(this,arguments):this};$extend(A,this);A.prototype=B;A.constructor=Class;return A};Class.empty=function(){};Class.prototype={extend:function(B){var C=new this(null);for(var D in B){var A=C[D];C[D]=Class.Merge(A,B[D])}return new Class(C)},implement:function(){for(var B=0,A=arguments.length;B<A;B++){$extend(this.prototype,arguments[B])}}};Class.Merge=function(C,D){if(C&&C!=D){var B=$type(D);if(B!=$type(C)){return D}switch(B){case"function":var A=function(){this.parent=arguments.callee.parent;return D.apply(this,arguments)};A.parent=C;return A;case"object":return $merge(C,D)}}return D};var Chain=new Class({chain:function(A){this.chains=this.chains||[];this.chains.push(A);return this},callChain:function(){if(this.chains&&this.chains.length){this.chains.shift().delay(10,this)}},clearChain:function(){this.chains=[]}});var Events=new Class({addEvent:function(B,A){if(A!=Class.empty){this.$events=this.$events||{};this.$events[B]=this.$events[B]||[];this.$events[B].include(A)}return this},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].each(function(D){D.create({"bind":this,"delay":A,"arguments":B})()},this)}return this},removeEvent:function(B,A){if(this.$events&&this.$events[B]){this.$events[B].remove(A)}return this}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent){for(var A in this.options){if($type(this.options[A]=="function")&&(/^on[A-Z]/).test(A)){this.addEvent(A,this.options[A])}}}return this}});Array.extend({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}},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},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},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},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},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},copy:function(D,C){D=D||0;if(D<0){D=this.length+D}C=C||(this.length-D);var A=[];for(var B=0;B<C;B++){A[B]=this[D++]}return A},remove:function(C){var B=0;var A=this.length;while(B<A){if(this[B]===C){this.splice(B,1);A--}else{B++}}return this},contains:function(A,B){return this.indexOf(A,B)!=-1},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},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B])}return this},merge:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B])}return this},include:function(A){if(!this.contains(A)){this.push(A)}return this},getRandom:function(){return this[$random(0,this.length-1)]||null},getLast:function(){return this[this.length-1]||null}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(A){return Array.copy(A)}function $each(C,B,D){if(C&&typeof C.length=="number"&&$type(C)!="object"){Array.forEach(C,B,D)}else{for(var A in C){B.call(D||C,C[A],A)}}}Array.prototype.test=Array.prototype.contains;String.extend({test:function(A,B){return(($type(A)=="string")?new RegExp(A,B):A).test(this)},toInt:function(){return parseInt(this,10)},toFloat:function(){return parseFloat(this)},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(A){return(A.charAt(0)+"-"+A.charAt(1).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase()})},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s{2,}/g," ").trim()},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):false},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):false},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")}});Array.extend({rgbToHex:function(D){if(this.length<3){return false}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("")},hexToRgb:function(C){if(this.length!=3){return false}var A=[];for(var B=0;B<3;B++){A.push(parseInt((this[B].length==1)?this[B]+this[B]:this[B],16))}return C?A:"rgb("+A.join(",")+")"}});Function.extend({create:function(A){var B=this;A=$merge({"bind":B,"event":false,"arguments":null,"delay":false,"periodical":false,"attempt":false},A);if($chk(A.arguments)&&$type(A.arguments)!="array"){A.arguments=[A.arguments]}return function(E){var C;if(A.event){E=E||window.event;C=[(A.event===true)?E:new A.event(E)];if(A.arguments){C.extend(A.arguments)}}else{C=A.arguments||arguments}var F=function(){return B.apply($pick(A.bind,B),C)};if(A.delay){return setTimeout(F,A.delay)}if(A.periodical){return setInterval(F,A.periodical)}if(A.attempt){try{return F()}catch(D){return false}}return F()}},pass:function(A,B){return this.create({"arguments":A,"bind":B})},attempt:function(A,B){return this.create({"arguments":A,"bind":B,"attempt":true})()},bind:function(B,A){return this.create({"bind":B,"arguments":A})},bindAsEventListener:function(B,A){return this.create({"bind":B,"event":true,"arguments":A})},delay:function(B,C,A){return this.create({"delay":B,"bind":C,"arguments":A})()},periodical:function(A,C,B){return this.create({"periodical":A,"bind":C,"arguments":B})()}});Number.extend({toInt:function(){return parseInt(this)},toFloat:function(){return parseFloat(this)},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){for(var A=0;A<this;A++){B(A)}}});var Element=new Class({initialize:function(D,C){if($type(D)=="string"){if(window.ie&&C&&(C.name||C.type)){var A=(C.name)?' name="'+C.name+'"':"";var B=(C.type)?' type="'+C.type+'"':"";delete C.name;delete C.type;D="<"+D+A+B+">"}D=document.createElement(D)}D=$(D);return(!C||!D)?D:D.set(C)}});var Elements=new Class({initialize:function(A){return(A)?$extend(A,this):this}});Elements.extend=function(A){for(var B in A){this.prototype[B]=A[B];this[B]=$native.generic(B)}};function $(B){if(!B){return null}if(B.htmlElement){return Garbage.collect(B)}if([window,document].contains(B)){return B}var A=$type(B);if(A=="string"){B=document.getElementById(B);A=(B)?"element":false}if(A!="element"){return null}if(B.htmlElement){return Garbage.collect(B)}if(["object","embed"].contains(B.tagName.toLowerCase())){return B}$extend(B,Element.prototype);B.htmlElement=function(){};return Garbage.collect(B)}document.getElementsBySelector=document.getElementsByTagName;function $$(){var D=[];for(var C=0,B=arguments.length;C<B;C++){var A=arguments[C];switch($type(A)){case"element":D.push(A);case"boolean":break;case false:break;case"string":A=document.getElementsBySelector(A,true);default:D.extend(A)}}return $$.unique(D)}$$.unique=function(G){var D=[];for(var C=0,A=G.length;C<A;C++){if(G[C].$included){continue}var B=$(G[C]);if(B&&!B.$included){B.$included=true;D.push(B)}}for(var F=0,E=D.length;F<E;F++){D[F].$included=null}return new Elements(D)};Elements.Multi=function(A){return function(){var D=arguments;var B=[];var G=true;for(var E=0,C=this.length,F;E<C;E++){F=this[E][A].apply(this[E],D);if($type(F)!="element"){G=false}B.push(F)}return(G)?$$.unique(B):B}};Element.extend=function(A){for(var B in A){HTMLElement.prototype[B]=A[B];Element.prototype[B]=A[B];Element[B]=$native.generic(B);var C=(Array.prototype[B])?B+"Elements":B;Elements.prototype[C]=Elements.Multi(B)}};Element.extend({set:function(A){for(var C in A){var B=A[C];switch(C){case"styles":this.setStyles(B);break;case"events":if(this.addEvents){this.addEvents(B)}break;case"properties":this.setProperties(B);break;default:this.setProperty(C,B)}}return this},inject:function(C,A){C=$(C);switch(A){case"before":C.parentNode.insertBefore(this,C);break;case"after":var B=C.getNext();if(!B){C.parentNode.appendChild(this)}else{C.parentNode.insertBefore(this,B)}break;case"top":var D=C.firstChild;if(D){C.insertBefore(this,D);break}default:C.appendChild(this)}return this},injectBefore:function(A){return this.inject(A,"before")},injectAfter:function(A){return this.inject(A,"after")},injectInside:function(A){return this.inject(A,"bottom")},injectTop:function(A){return this.inject(A,"top")},adopt:function(){var A=[];$each(arguments,function(B){A=A.concat(B)});$$(A).inject(this);return this},remove:function(){return this.parentNode.removeChild(this)},clone:function(C){var B=$(this.cloneNode(C!==false));if(!B.$events){return B}B.$events={};for(var A in this.$events){B.$events[A]={"keys":$A(this.$events[A].keys),"values":$A(this.$events[A].values)}}return B.removeEvents()},replaceWith:function(A){A=$(A);this.parentNode.replaceChild(A,this);return A},appendText:function(A){this.appendChild(document.createTextNode(A));return this},hasClass:function(A){return this.className.contains(A," ")},addClass:function(A){if(!this.hasClass(A)){this.className=(this.className+" "+A).clean()}return this},removeClass:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(A){return this.hasClass(A)?this.removeClass(A):this.addClass(A)},setStyle:function(B,A){switch(B){case"opacity":return this.setOpacity(parseFloat(A));case"float":B=(window.ie)?"styleFloat":"cssFloat"}B=B.camelCase();switch($type(A)){case"number":if(!["zIndex","zoom"].contains(B)){A+="px"}break;case"array":A="rgb("+A.join(",")+")"}this.style[B]=A;return this},setStyles:function(A){switch($type(A)){case"object":Element.setMany(this,"setStyle",A);break;case"string":this.style.cssText=A}return this},setOpacity:function(A){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(window.ie){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=this.$tmp.opacity=A;return this},getStyle:function(C){C=C.camelCase();var A=this.style[C];if(!$chk(A)){if(C=="opacity"){return this.$tmp.opacity}A=[];for(var B in Element.Styles){if(C==B){Element.Styles[B].each(function(F){var E=this.getStyle(F);A.push(parseInt(E)?E:"0px")},this);if(C=="border"){var D=A.every(function(E){return(E==A[0])});return(D)?A[0]:false}return A.join(" ")}}if(C.contains("border")){if(Element.Styles.border.contains(C)){return["Width","Style","Color"].map(function(E){return this.getStyle(C+E)},this).join(" ")}else{if(Element.borderShort.contains(C)){return["Top","Right","Bottom","Left"].map(function(E){return this.getStyle("border"+E+C.replace("border",""))},this).join(" ")}}}if(document.defaultView){A=document.defaultView.getComputedStyle(this,null).getPropertyValue(C.hyphenate())}else{if(this.currentStyle){A=this.currentStyle[C]}}}if(window.ie){A=Element.fixStyle(C,A,this)}if(A&&C.test(/color/i)&&A.contains("rgb")){return A.split("rgb").splice(1,4).map(function(E){return E.rgbToHex()}).join(" ")}return A},getStyles:function(){return Element.getMany(this,"getStyle",arguments)},walk:function(A,C){A+="Sibling";var B=(C)?this[C]:this[A];while(B&&$type(B)!="element"){B=B[A]}return $(B)},getPrevious:function(){return this.walk("previous")},getNext:function(){return this.walk("next")},getFirst:function(){return this.walk("next","firstChild")},getLast:function(){return this.walk("previous","lastChild")},getParent:function(){return $(this.parentNode)},getChildren:function(){return $$(this.childNodes)},hasChild:function(A){return !!$A(this.getElementsByTagName("*")).contains(A)},getProperty:function(D){var B=Element.Properties[D];if(B){return this[B]}var A=Element.PropertiesIFlag[D]||0;if(!window.ie||A){return this.getAttribute(D,A)}var C=this.attributes[D];return(C)?C.nodeValue:null},removeProperty:function(B){var A=Element.Properties[B];if(A){this[A]=""}else{this.removeAttribute(B)}return this},getProperties:function(){return Element.getMany(this,"getProperty",arguments)},setProperty:function(C,B){var A=Element.Properties[C];if(A){this[A]=B}else{this.setAttribute(C,B)}return this},setProperties:function(A){return Element.setMany(this,"setProperty",A)},setHTML:function(){this.innerHTML=$A(arguments).join("");return this},setText:function(B){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){this.styleSheet.cssText=B}else{if(A=="script"){this.setProperty("text",B)}}return this}else{this.removeChild(this.firstChild);return this.appendText(B)}}this[$defined(this.innerText)?"innerText":"textContent"]=B;return this},getText:function(){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){return this.styleSheet.cssText}else{if(A=="script"){return this.getProperty("text")}}}else{return this.innerHTML}}return($pick(this.innerText,this.textContent))},getTag:function(){return this.tagName.toLowerCase()},empty:function(){Garbage.trash(this.getElementsByTagName("*"));return this.setHTML("")}});Element.fixStyle=function(E,A,D){if($chk(parseInt(A))){return A}if(["height","width"].contains(E)){var B=(E=="width")?["left","right"]:["top","bottom"];var C=0;B.each(function(F){C+=D.getStyle("border-"+F+"-width").toInt()+D.getStyle("padding-"+F).toInt()});return D["offset"+E.capitalize()]-C+"px"}else{if(E.test(/border(.+)Width|margin|padding/)){return"0px"}}return A};Element.Styles={"border":[],"padding":[],"margin":[]};["Top","Right","Bottom","Left"].each(function(B){for(var A in Element.Styles){Element.Styles[A].push(A+B)}});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(B,D,C){var A={};$each(C,function(E){A[E]=B[D](E)});return A};Element.setMany=function(B,D,C){for(var A in C){B[D](A,C[A])}return B};Element.Properties=new Abstract({"class":"className","for":"htmlFor","colspan":"colSpan","rowspan":"rowSpan","accesskey":"accessKey","tabindex":"tabIndex","maxlength":"maxLength","readonly":"readOnly","frameborder":"frameBorder","value":"value","disabled":"disabled","checked":"checked","multiple":"multiple","selected":"selected"});Element.PropertiesIFlag={"href":2,"src":2};Element.Methods={Listeners:{addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false)}else{this.attachEvent("on"+B,A)}return this},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false)}else{this.detachEvent("on"+B,A)}return this}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(A){if(!A.$tmp){Garbage.elements.push(A);A.$tmp={"opacity":1}}return A},trash:function(D){for(var B=0,A=D.length,C;B<A;B++){if(!(C=D[B])||!C.$tmp){continue}if(C.$events){C.fireEvent("trash").removeEvents()}for(var E in C.$tmp){C.$tmp[E]=null}for(var F in Element.prototype){C[F]=null}Garbage.elements[Garbage.elements.indexOf(C)]=null;C.htmlElement=C.$tmp=C=null}Garbage.elements.remove(null)},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements)}};window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);if(window.ie){window.addListener("unload",CollectGarbage)}});var Event=new Class({initialize:function(C){if(C&&C.$extended){return C}this.$extended=true;C=C||window.event;this.event=C;this.type=C.type;this.target=C.target||C.srcElement;if(this.target.nodeType==3){this.target=this.target.parentNode}this.shift=C.shiftKey;this.control=C.ctrlKey;this.alt=C.altKey;this.meta=C.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheel=(C.wheelDelta)?C.wheelDelta/120:-(C.detail||0)/3}else{if(this.type.contains("key")){this.code=C.which||C.keyCode;for(var B in Event.keys){if(Event.keys[B]==this.code){this.key=B;break}}if(this.type=="keydown"){var A=this.code-111;if(A>0&&A<13){this.key="f"+A}}this.key=this.key||String.fromCharCode(this.code).toLowerCase()}else{if(this.type.test(/(click|mouse|menu)/)){this.page={"x":C.pageX||C.clientX+document.documentElement.scrollLeft,"y":C.pageY||C.clientY+document.documentElement.scrollTop};this.client={"x":C.pageX?C.pageX-window.pageXOffset:C.clientX,"y":C.pageY?C.pageY-window.pageYOffset:C.clientY};this.rightClick=(C.which==3)||(C.button==2);switch(this.type){case"mouseover":this.relatedTarget=C.relatedTarget||C.fromElement;break;case"mouseout":this.relatedTarget=C.relatedTarget||C.toElement}this.fixRelatedTarget()}}}return this},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}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode}},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this)}catch(A){this.relatedTarget=this.target}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({"enter":13,"up":38,"down":40,"left":37,"right":39,"esc":27,"space":32,"backspace":8,"tab":9,"delete":46});Element.Methods.Events={addEvent:function(C,B){this.$events=this.$events||{};this.$events[C]=this.$events[C]||{"keys":[],"values":[]};if(this.$events[C].keys.contains(B)){return this}this.$events[C].keys.push(B);var A=C;var D=Element.Events[C];if(D){if(D.add){D.add.call(this,B)}if(D.map){B=D.map}if(D.type){A=D.type}}if(!this.addEventListener){B=B.create({"bind":this,"event":true})}this.$events[C].values.push(B);return(Element.NativeEvents.contains(A))?this.addListener(A,B):this},removeEvent:function(C,B){if(!this.$events||!this.$events[C]){return this}var F=this.$events[C].keys.indexOf(B);if(F==-1){return this}var A=this.$events[C].keys.splice(F,1)[0];var E=this.$events[C].values.splice(F,1)[0];var D=Element.Events[C];if(D){if(D.remove){D.remove.call(this,B)}if(D.type){C=D.type}}return(Element.NativeEvents.contains(C))?this.removeListener(C,E):this},addEvents:function(A){return Element.setMany(this,"addEvent",A)},removeEvents:function(A){if(!this.$events){return this}if(!A){for(var B in this.$events){this.removeEvents(B)}this.$events=null}else{if(this.$events[A]){this.$events[A].keys.each(function(C){this.removeEvent(A,C)},this);this.$events[A]=null}}return this},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].keys.each(function(D){D.create({"bind":this,"delay":A,"arguments":B})()},this)}return this},cloneEvents:function(C,A){if(!C.$events){return this}if(!A){for(var B in C.$events){this.cloneEvents(C,B)}}else{if(C.$events[A]){C.$events[A].keys.each(function(D){this.addEvent(A,D)},this)}}return this}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({"mouseenter":{type:"mouseover",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseenter",A)}}},"mouseleave":{type:"mouseout",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseleave",A)}}},"mousewheel":{type:(window.gecko)?"DOMMouseScroll":"mousewheel"}});Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];Function.extend({bindWithEvent:function(B,A){return this.create({"bind":B,"arguments":A,"event":Event})}});Elements.extend({filterByTag:function(A){return new Elements(this.filter(function(B){return(Element.getTag(B)==A)}))},filterByClass:function(A,C){var B=this.filter(function(D){return(D.className&&D.className.contains(A," "))});return(C)?B:new Elements(B)},filterById:function(C,B){var A=this.filter(function(D){return(D.id==C)});return(B)?A:new Elements(A)},filterByAttribute:function(B,A,D,E){var C=this.filter(function(F){var G=Element.getProperty(F,B);if(!G){return false}if(!A){return true}switch(A){case"=":return(G==D);case"*=":return(G.contains(D));case"^=":return(G.substr(0,D.length)==D);case"$=":return(G.substr(G.length-D.length)==D);case"!=":return(G!=D);case"~=":return G.contains(D," ")}return false});return(E)?C:new Elements(C)}});function $E(A,B){return($(B)||document).getElement(A)}function $ES(A,B){return($(B)||document).getElementsBySelector(A)}$$.shared={"regexp":/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,"xpath":{getParam:function(B,D,E,C){var A=[D.namespaceURI?"xhtml:":"",E[1]];if(E[2]){A.push('[@id="',E[2],'"]')}if(E[3]){A.push('[contains(concat(" ", @class, " "), " ',E[3],' ")]')}if(E[4]){if(E[5]&&E[6]){switch(E[5]){case"*=":A.push("[contains(@",E[4],', "',E[6],'")]');break;case"^=":A.push("[starts-with(@",E[4],', "',E[6],'")]');break;case"$=":A.push("[substring(@",E[4],", string-length(@",E[4],") - ",E[6].length,' + 1) = "',E[6],'"]');break;case"=":A.push("[@",E[4],'="',E[6],'"]');break;case"!=":A.push("[@",E[4],'!="',E[6],'"]')}}else{A.push("[@",E[4],"]")}}B.push(A.join(""));return B},getItems:function(B,E,G){var F=[];var A=document.evaluate(".//"+B.join("//"),E,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var D=0,C=A.snapshotLength;D<C;D++){F.push(A.snapshotItem(D))}return(G)?F:new Elements(F.map($))}},"normal":{getParam:function(A,C,E,B){if(B==0){if(E[2]){var D=C.getElementById(E[2]);if(!D||((E[1]!="*")&&(Element.getTag(D)!=E[1]))){return false}A=[D]}else{A=$A(C.getElementsByTagName(E[1]))}}else{A=$$.shared.getElementsByTagName(A,E[1]);if(E[2]){A=Elements.filterById(A,E[2],true)}}if(E[3]){A=Elements.filterByClass(A,E[3],true)}if(E[4]){A=Elements.filterByAttribute(A,E[4],E[5],E[6],true)}return A},getItems:function(A,B,C){return(C)?A:$$.unique(A)}},resolver:function(A){return(A=="xhtml")?"http://www.w3.org/1999/xhtml":false},getElementsByTagName:function(D,C){var E=[];for(var B=0,A=D.length;B<A;B++){E.extend(D[B].getElementsByTagName(C))}return E}};$$.shared.method=(window.xpath)?"xpath":"normal";Element.Methods.Dom={getElements:function(A,H){var C=[];A=A.trim().split(" ");for(var E=0,D=A.length;E<D;E++){var F=A[E];var G=F.match($$.shared.regexp);if(!G){break}G[1]=G[1]||"*";var B=$$.shared[$$.shared.method].getParam(C,this,G,E);if(!B){break}C=B}return $$.shared[$$.shared.method].getItems(C,this,H)},getElement:function(A){return $(this.getElements(A,true)[0]||false)},getElementsBySelector:function(A,E){var D=[];A=A.split(",");for(var C=0,B=A.length;C<B;C++){D=D.concat(this.getElements(A[C],true))}return(E)?D:$$.unique(D)}};Element.extend({getElementById:function(C){var B=document.getElementById(C);if(!B){return false}for(var A=B.parentNode;A!=this;A=A.parentNode){if(!A){return false}}return B},getElementsByClassName:function(A){return this.getElements("."+A)}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case"select":var A=[];$each(this.options,function(B){if(B.selected){A.push($pick(B.value,B.text))}});return(this.multiple)?A:A[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break}case"textarea":return this.value}return false},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"))},toQueryString:function(){var A=[];this.getFormElements().each(function(D){var C=D.name;var E=D.getValue();if(E===false||!C||D.disabled){return }var B=function(F){A.push(C+"="+encodeURIComponent(F))};if($type(E)=="array"){E.each(B)}else{B(E)}});return A.join("&")}});Element.extend({scrollTo:function(A,B){this.scrollLeft=A;this.scrollTop=B},getSize:function(){return{"scroll":{"x":this.scrollLeft,"y":this.scrollTop},"size":{"x":this.offsetWidth,"y":this.offsetHeight},"scrollSize":{"x":this.scrollWidth,"y":this.scrollHeight}}},getPosition:function(A){A=A||[];var B=this,D=0,C=0;do{D+=B.offsetLeft||0;C+=B.offsetTop||0;B=B.offsetParent}while(B);A.each(function(E){D-=E.scrollLeft||0;C-=E.scrollTop||0});return{"x":D,"y":C}},getTop:function(A){return this.getPosition(A).y},getLeft:function(A){return this.getPosition(A).x},getCoordinates:function(B){var A=this.getPosition(B);var C={"width":this.offsetWidth,"height":this.offsetHeight,"left":A.x,"top":A.y};C.right=C.left+C.width;C.bottom=C.top+C.height;return C}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(A){return -(Math.cos(Math.PI*A)-1)/2},duration:500,unit:"px",wait:true,fps:50},initialize:function(A){this.element=this.element||null;this.setOptions(A);if(this.options.initialize){this.options.initialize.call(this)}},step:function(){var A=$time();if(A<this.time+this.options.duration){this.delta=this.options.transition((A-this.time)/this.options.duration);this.setNow();this.increase()}else{this.stop(true);this.set(this.to);this.fireEvent("onComplete",this.element,10);this.callChain()}},set:function(A){this.now=A;this.increase();return this},setNow:function(){this.now=this.compute(this.from,this.to)},compute:function(B,A){return(A-B)*this.delta+B},start:function(B,A){if(!this.options.wait){this.stop()}else{if(this.timer){return this}}this.from=B;this.to=A;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);this.fireEvent("onStart",this.element);return this},stop:function(A){if(!this.timer){return this}this.timer=$clear(this.timer);if(!A){this.fireEvent("onCancel",this.element)}return this},custom:function(B,A){return this.start(B,A)},clearTimer:function(A){return this.stop(A)}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(B,C){if(B.test(/color/i)){return this.Color}var A=$type(C);if((A=="array")||(A=="string"&&C.contains(" "))){return this.Multi}return this.Single},parse:function(C,D,A){if(!A.push){A=[A]}var F=A[0],E=A[1];if(!$chk(E)){E=F;F=C.getStyle(D)}var B=this.select(D,E);return{"from":B.parse(F),"to":B.parse(E),"css":B}}};Fx.CSS.Single={parse:function(A){return parseFloat(A)},getNow:function(C,B,A){return A.compute(C,B)},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=Math.round(C)}return C+A}};Fx.CSS.Multi={parse:function(A){return A.push?A:A.split(" ").map(function(B){return parseFloat(B)})},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[B]=C.compute(E[B],D[B])}return A},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=C.map(Math.round)}return C.join(A+" ")+A}};Fx.CSS.Color={parse:function(A){return A.push?A:A.hexToRgb(true)},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[B]=Math.round(C.compute(E[B],D[B]))}return A},getValue:function(A){return"rgb("+A.join(",")+")"}};Fx.Elements=Fx.Base.extend({initialize:function(B,A){this.elements=$$(B);this.parent(A)},setNow:function(){for(var C in this.from){var F=this.from[C],E=this.to[C],B=this.css[C],A=this.now[C]={};for(var D in F){A[D]=B[D].getNow(F[D],E[D],this)}}},set:function(G){var B={};this.css={};for(var D in G){var F=G[D],C=this.css[D]={},A=B[D]={};for(var E in F){C[E]=Fx.CSS.select(E,F[E]);A[E]=C[E].parse(F[E])}}return this.parent(B)},start:function(D){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var I={},J={};for(var E in D){var G=D[E],A=I[E]={},H=J[E]={},C=this.css[E]={};for(var B in G){var F=Fx.CSS.parse(this.elements[E],B,G[B]);A[B]=F.from;H[B]=F.to;C[B]=F.css}}return this.parent(I,J)},increase:function(){for(var C in this.now){var A=this.now[C],B=this.css[C];for(var D in A){this.elements[C].setStyle(D,B[D].getValue(A[D],this.options.unit,D))}}}});var Drag={};Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.handle=$(this.options.handle)||this.element;this.mouse={"now":{},"pos":{}};this.value={"start":{},"now":{}};this.bound={"start":this.start.bindWithEvent(this),"check":this.check.bindWithEvent(this),"drag":this.drag.bindWithEvent(this),"stop":this.stop.bind(this)};this.attach();if(this.options.initialize){this.options.initialize.call(this)}},attach:function(){this.handle.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);return this},start:function(C){this.fireEvent("onBeforeStart",this.element);this.mouse.start=C.page;var A=this.options.limit;this.limit={"x":[],"y":[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue}this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=0;B<2;B++){if($chk(A[D][B])){this.limit[D][B]=($type(A[D][B])=="function")?A[D][B]():A[D][B]}}}}if($type(this.options.grid)=="number"){this.options.grid={"x":this.options.grid,"y":this.options.grid}}document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);this.fireEvent("onStart",this.element);C.stop()},check:function(A){var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);this.drag(A);this.fireEvent("onSnap",this.element)}A.stop()},drag:function(A){this.out=false;this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];this.out=true}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0];this.out=true}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B])}this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit)}this.fireEvent("onDrag",this.element);A.stop()},stop:function(){document.removeListener("mousemove",this.bound.check);document.removeListener("mousemove",this.bound.drag);document.removeListener("mouseup",this.bound.stop);this.fireEvent("onComplete",this.element)}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(A){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},A))}});Drag.Move=Drag.Base.extend({options:{droppables:[],container:false,overflown:[]},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);this.position={"element":this.element.getStyle("position"),"container":false};if(this.container){this.position.container=this.container.getStyle("position")}if(!["relative","absolute","fixed"].contains(this.position.element)){this.position.element="absolute"}var D=this.element.getStyle("top").toInt();var C=this.element.getStyle("left").toInt();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){D=$chk(D)?D:this.element.getTop(this.options.overflown);C=$chk(C)?C:this.element.getLeft(this.options.overflown)}else{D=$chk(D)?D:0;C=$chk(C)?C:0}this.element.setStyles({"top":D,"left":C,"position":this.position.element});this.parent(this.element)},start:function(C){this.overed=null;if(this.container){var A=this.container.getCoordinates();var B=this.element.getCoordinates();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){this.options.limit={"x":[A.left,A.right-B.width],"y":[A.top,A.bottom-B.height]}}else{this.options.limit={"y":[0,A.height-B.height],"x":[0,A.width-B.width]}}}this.parent(C)},drag:function(A){this.parent(A);var B=this.out?false:this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=B){if(this.overed){this.overed.fireEvent("leave",[this.element,this])}this.overed=B?B.fireEvent("over",[this.element,this]):null}return this},checkAgainst:function(B){B=B.getCoordinates(this.options.overflown);var A=this.mouse.now;return(A.x>B.left&&A.x<B.right&&A.y<B.bottom&&A.y>B.top)},stop:function(){if(this.overed&&!this.out){this.overed.fireEvent("drop",[this.element,this])}else{this.element.fireEvent("emptydrop",this)}this.parent();return this}});Element.extend({makeDraggable:function(A){return new Drag.Move(this,A)}});var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false);return this},initialize:function(A){this.setTransport().setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method=="post"){var B=(this.options.encoding)?"; charset="+this.options.encoding:"";this.setHeader("Content-type","application/x-www-form-urlencoded"+B)}if(this.options.initialize){this.options.initialize.call(this)}},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return }this.running=false;var A=0;try{A=this.transport.status}catch(B){}if(this.options.isSuccess.call(this,A)){this.onSuccess()}else{this.onFailure()}this.transport.onreadystatechange=Class.empty},isSuccess:function(A){return((A>=200)&&(A<300))},onSuccess:function(){this.response={"text":this.transport.responseText,"xml":this.transport.responseXML};this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain()},onFailure:function(){this.fireEvent("onFailure",this.transport)},setHeader:function(A,B){this.headers[A]=B;return this},send:function(A,C){if(this.options.autoCancel){this.cancel()}else{if(this.running){return this}}this.running=true;if(C&&this.options.method=="get"){A=A+(A.contains("?")?"&":"?")+C;C=null}this.transport.open(this.options.method.toUpperCase(),A,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=="post")&&this.transport.overrideMimeType){this.setHeader("Connection","close")}$extend(this.headers,this.options.headers);for(var B in this.headers){try{this.transport.setRequestHeader(B,this.headers[B])}catch(D){}}this.fireEvent("onRequest");this.transport.send($pick(C,null));return this},cancel:function(){if(!this.running){return this}this.running=false;this.transport.abort();this.transport.onreadystatechange=Class.empty;this.setTransport();this.fireEvent("onCancel");return this}});XHR.implement(new Chain,new Events,new Options);var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(B,A){this.addEvent("onSuccess",this.onComplete);this.setOptions(A);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;this.options.method="post"}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.url=B},onComplete:function(){if(this.options.update){$(this.options.update).empty().setHTML(this.response.text)}if(this.options.evalScripts||this.options.evalResponse){this.evalScripts()}this.fireEvent("onComplete",[this.response.text,this.response.xml],20)},request:function(A){A=A||this.options.data;switch($type(A)){case"element":A=$(A).toQueryString();break;case"object":A=Object.toQueryString(A)}if(this._method){A=(A)?[this._method,A].join("&"):this._method}return this.send(this.url,A)},evalScripts:function(){var B,A;if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){A=this.response.text}else{A=[];var C=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((B=C.exec(this.response.text))){A.push(B[1])}A=A.join("\n")}if(A){(window.execScript)?window.execScript(A):window.setTimeout(A,0)}},getHeader:function(A){try{return this.transport.getResponseHeader(A)}catch(B){}return null}});Object.toQueryString=function(B){var C=[];for(var A in B){C.push(encodeURIComponent(A)+"="+encodeURIComponent(B[A]))}return C.join("&")};Element.extend({send:function(A){return new Ajax(this.getProperty("action"),$merge({data:this.toQueryString()},A,{method:"post"})).request()}});var Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C,E,F,B;$each(arguments,function(I,H){switch($type(I)){case"object":C=I;break;case"element":B=$(I);break;default:var G=$$(I);if(!E){E=G}else{F=G}}});this.togglers=E||[];this.elements=F||[];this.container=$(B);this.setOptions(C);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 D=0,A=this.togglers.length;D<A;D++){this.addSection(this.togglers[D],this.elements[D])}this.elements.each(function(H,G){if(this.options.show===G){this.fireEvent("onActive",[this.togglers[G],H])}else{for(var I in this.effects){H.setStyle(I,0)}}},this);this.parent(this.elements);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.injectBefore(this.togglers[G]);C.injectAfter(E)}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?"onBackground":"onActive",[this.togglers[D],E]);for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]]}},this);return this.start(B)},showThisHideOpen:function(A){return this.display(A)}});Fx.Accordion=Accordion;function validEmail(B){var A=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return A.test(B)}if(!bic){var bic=new Object()}bic.Recommend=new Class();bic.Recommend.prototype={saveUrl:"/send-to-friend.php",fromName:"",fromEmail:"",toName:"",toEmail:"",pageId:"",el:null,x:"500px",y:"65px",initialize:function(A){this.pageId=A;this.el=new Element("div",{"styles":{"left":this.x,"top":this.y,"z-index":"100"},"id":"sendFriendNote"}).injectAfter($("wrapperInner"));this.addHtml();new Drag.Move("sendFriendNote",{container:$("wrapper"),handle:"dragger"})},addHtml:function(){var A='<a href="#" id="noteClose" title="Close this note"><img src="/images/buttons/close-x-light.gif" alt="Close" width="11" height="12" /></a>';A+='<h4 id="dragger">Send to a friend</h4>';A+='<div id="noteContent">';A+='<p class="small">To send this page to a friend, please fill in all the details.</p>';A+='<form action="#" id="sendFriendForm"><div>';A+="<dl>";A+='<dt><label for="noteFromName">Your name</label></dt><dd><input id="noteFromName" class="inputContent" type="text" /></dd>';A+='<dt><label for="notefromEmail">Your email</label></dt><dd><input id="notefromEmail" class="inputContent" type="text" /></dd>';A+='<dt><label for="noteToName">Your friend\'s name</label></dt><dd><input id="noteToName" class="inputContent" type="text" /></dd>';A+='<dt><label for="notetoEmail">Your friend\'s email</label></dt><dd><input id="notetoEmail" class="inputContent" type="text" /></dd>';A+="</dl>";A+='<input type="image" src="/images/buttons/send-light.gif" id="noteSend" value="send" alt="Send" /> <input type="image" src="/images/buttons/cancel-light.gif" id="noteCancel" value="cancel" alt="Cancel" />';A+="</div></div></form>";this.el.innerHTML=A;var C=$("noteClose");var D=$("noteCancel");var B=$("noteSend");C.onclick=this.remove.bind(this);D.onclick=this.remove.bind(this);B.onclick=function(){this.validate();return false}.bind(this)},remove:function(){this.el.remove();return false},validate:function(){this.fromName=this.el.getElementsByTagName("input")[0].value;this.fromEmail=this.el.getElementsByTagName("input")[1].value;this.toName=this.el.getElementsByTagName("input")[2].value;this.toEmail=this.el.getElementsByTagName("input")[3].value;var B=Array();if(!this.fromName||!this.fromEmail||!this.toName||!this.toEmail){B.push("Please enter all the details.")}if(!validEmail(this.fromEmail)){B.push("Your email address is invalid.")}if(!validEmail(this.toEmail)){B.push("Your friend's email address is invalid.")}if(!B.length){this.save()}else{var A='<ul class="error">';for(i=0;i<B.length;i++){A+="<li>"+B[i]+"</li>"}A+="</ul>";$("noteContent").getElementsByTagName("p")[0].innerHTML+=A}return false},save:function(){$("noteContent").innerHTML="<p>Please wait...</p>";new Ajax(this.saveUrl,{method:"post",data:{fromName:this.fromName,fromEmail:this.fromEmail,toName:this.toName,toEmail:this.toEmail,pageId:this.pageId},onComplete:function(B){if(B=="true"){$("noteContent").innerHTML="<p>Your email has been sent.</p>";var A=$("noteClose");A.onclick=this.remove.bind(this)}else{$("noteContent").innerHTML='<p class="error">An error occured while sending your message. Please try again later.</p>';var A=$("noteClose");A.onclick=this.remove.bind(this)}}.bind(this)}).request()}};window.addEvent("load",function(){if($("sendToFriend")){$("sendToFriend").onclick=function(){var A=this.href.split("=")[1];new bic.Recommend(A);return false}}});if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(E,C,K,F,H,J,L,G,A,D){if(!document.getElementById){return }this.DETECT_KEY=D?D:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(E){this.setAttribute("swf",E)}if(C){this.setAttribute("id",C)}if(K){this.setAttribute("width",K)}if(F){this.setAttribute("height",F)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(J){this.addParam("bgcolor",J)}var B=L?L:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var I=(G)?G:window.location;this.setAttribute("xiRedirectUrl",I);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(A,B){this.params[A]=B},getParams:function(){return this.params},addVariable:function(A,B){this.variables[A]=B},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var A=new Array();var B;var C=this.getVariables();for(B in C){A[A.length]=B+"="+C[B]}return A},getSWFHTML:function(){var D="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}D='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var C=this.getParams();for(var A in C){D+=[A]+'="'+C[A]+'" '}var B=this.getVariablePairs().join("&");if(B.length>0){D+='flashvars="'+B+'"'}D+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}D='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var A in C){D+='<param name="'+A+'" value="'+C[A]+'" />'}var B=this.getVariablePairs().join("&");if(B.length>0){D+='<param name="flashvars" value="'+B+'" />'}D+="</object>"}return D},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof A=="string")?document.getElementById(A):A;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var C=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){C=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var D=1;var B=3;while(D){try{B++;D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+B);C=new deconcept.PlayerVersion([B,0,0])}catch(E){D=null}}}else{try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(E){try{var D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");C=new deconcept.PlayerVersion([6,0,21]);D.AllowScriptAccess="always"}catch(E){if(C.major==6){return C}}try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(E){}}if(D!=null){C=new deconcept.PlayerVersion(D.GetVariable("$version").split(" ")[1].split(","))}}}return C};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(D){var C=document.location.search||document.location.hash;if(D==null){return C}if(C){var B=C.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==D){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var C=document.getElementsByTagName("OBJECT");for(var B=C.length-1;B>=0;B--){C[B].style.display="none";for(var A in C[B]){if(typeof C[B][A]=="function"){C[B][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var JSTarget={init:function(J,D,K){if(document.getElementById&&document.createElement&&document.appendChild){var B=((typeof J=="undefined")||(J==null))?"class":J;var I=((typeof D=="undefined")||(D==null))?"non-html":D;var E=((typeof K=="undefined")||(K==null))?"":K;var H;var A=document.getElementsByTagName("a");var G;var C=new RegExp("(^|\\s)"+I+"(\\s|$)");for(var F=0;F<A.length;F++){G=A[F];if((A[F].href.indexOf("http://")!=-1&&A[F].href.split("/")[2]!=window.location.href.split("/")[2])){H=document.createElement("em");H.appendChild(document.createTextNode(E));G.appendChild(H);G.className+="external";G.onclick=JSTarget.openWin}}H=null}},openWin:function(C){var B=(!C)?window.event:C;if(B.shiftKey||B.altKey||B.ctrlKey||B.metaKey){return true}else{var A=window.open(this.getAttribute("href"),"_blank");if(A){if(A.focus){A.focus()}return false}A=null;return true}}};window.addEvent("load",function(){JSTarget.init("class","external")});SuggestionList=function(C,B,A){this.textBoxEl=C;this.suggestEl=B;this.url=A;C.setProperty("autocomplete","off");this.textBoxEl.onkeydown=function(D){if(!D){D=window.event}switch(D.keyCode){case 38:this.selectionUp();return false;break;case 40:this.selectionDown();return false;break;case 13:this.hideSuggestions()}}.bind(this);this.textBoxEl.onkeyup=function(D){if(!D){D=window.event}if(D.keyCode!=38&&D.keyCode!=40&&D.keyCode!=13){this.refine(this.textBoxEl.value)}}.bind(this);this.textBoxEl.addEvent("blur",this.hideSuggestions.bind(this));this.listEl=document.createElement("ul");B.appendChild(this.listEl);this.hideSuggestions()};SuggestionList.prototype={selectedIndex:0,suggestionsCache:[],suggestions:[],refine:function(str){if(!str){this.populateList([])}else{if(this.suggestionsCache[str]){this.populateList(this.suggestionsCache[str])}else{new Ajax(this.url,{method:"get",data:{query:str},onComplete:function(response){var results=eval(response);this.suggestionsCache[str]=results;this.populateList(results)}.bind(this)}).request()}}},populateList:function(A){this.suggestions=A;this.selectedIndex=0;this.listEl.innerHTML="";if(A&&A.length){A.each(function(C,E){var F=document.createElement("li");var D=document.createTextNode(C);F.appendChild(D);this.listEl.appendChild(F);F.selectionIndex=E;var B=this;F.onmousedown=function(){B.selectedIndex=this.selectionIndex+1;B.updateSelection()}}.bind(this));this.showSuggestions()}else{this.hideSuggestions()}},selectionUp:function(){this.selectedIndex--;if(this.selectedIndex<0){this.selectedIndex=this.suggestions.length}this.updateSelection()},selectionDown:function(){this.selectedIndex++;if(this.selectedIndex>this.suggestions.length){this.selectedIndex=0}this.updateSelection()},updateSelection:function(){var A=this.listEl.getElementsByTagName("li");$A(A).each(function(B){B.className=""});if(this.selectedIndex>0){A[this.selectedIndex-1].className="active";this.textBoxEl.value=this.suggestions[this.selectedIndex-1]}},showSuggestions:function(){this.suggestEl.style.display="block"},hideSuggestions:function(){this.suggestEl.style.display="none"}};window.addEvent("load",function(){new SuggestionList($("search"),$("searchSuggestions"),"/suggest.php")});var helveticalight={src:"/flash/helveticaneue-lightcondensed.swf",ratios:[7,1.32,11,1.31,13,1.24,14,1.25,19,1.23,27,1.2,34,1.19,42,1.18,47,1.17,48,1.18,69,1.17,74,1.16,75,1.17,1.16]};var helveticamedium={src:"/flash/helveticaneue-mediumcondensed.swf",ratios:[7,1.32,11,1.31,13,1.24,14,1.25,19,1.23,27,1.2,34,1.19,42,1.18,47,1.17,48,1.18,69,1.17,74,1.16,75,1.17,1.16]};sIFR.delayCSS=true;sIFR.activate(helveticalight,helveticamedium);sIFR.replace(helveticalight,{selector:"#pageTitle h2",css:[".sIFR-root { color: #393939; text-transform: uppercase; }"],tuneHeight:"-8px",fitExactly:"true",wmode:"transparent"});sIFR.replace(helveticalight,{selector:"#mainContent .sectionDark h2",css:[".sIFR-root { color: #C5C6C7; text-transform: uppercase; }"],tuneHeight:"-8px",fitExactly:"true",wmode:"transparent"});sIFR.replace(helveticalight, {selector: '#mainContent .sectionLight h2',css: ['.sIFR-root { color: #C5C6C7; text-transform: uppercase; }'],tuneHeight: '-8px',fitExactly: 'true',wmode: 'transparent'});sIFR.replace(helveticalight,{selector:"#footerContent h2",css:[".sIFR-root { color: #C5C6C7; text-transform: uppercase; }"],tuneHeight:"-8px",fitExactly:"true",wmode:"transparent"});sIFR.replace(helveticamedium,{selector:".section h3",css:[".sIFR-root { color: #393939; text-transform: uppercase; }","a:link { color: #393939; text-decoration:none; }","a:hover { color: #008cd6; }"],tuneHeight:"-6px",fitExactly:"true",wmode:"transparent"});sIFR.replace(helveticamedium,{selector:"#home h2",css:[".sIFR-root { color: #cf142b; text-transform: uppercase; }"],tuneHeight:"-6px",fitExactly:"true",wmode:"transparent"});function newsletterForm(){if(!$("newsSideForm")){return false}var A=$("newsSideForm");var C=A.getElementsByTagName("input");var B=$("emailNewsSide");if(B.type=="text"){B.onFocus=function(){clearDefaultText};B.onBlur=function(){replaceDefaultText};if(B.value!=""){B.defaultText=B.value}}A.onsubmit=function(){var D=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!B.value||B.value=="Email"){alert("Email is required");return false}else{if(!D.test(B.value)){alert("Email is not valid");return false}}}}function formFieldReplace(){if(!$$("input.txtReplace")){return false}var C=$$("input.txtReplace");for(var A=0;A<C.length;A++){var B=C[A];if(B.type=="text"){B.addEvents({"focus":clearDefaultText,"blur":replaceDefaultText});if(B.value!=""){B.defaultText=B.value}}}}function clearDefaultText(B){var A=window.event?window.event.srcElement:B?B.target:null;if(!A){return }if(A.value==A.defaultText){A.value=""}}function replaceDefaultText(B){var A=window.event?window.event.srcElement:B?B.target:null;if(!A){return }if(A.value==""&&A.defaultText){A.value=A.defaultText}}window.addEvent("load",newsletterForm);window.addEvent("load",formFieldReplace);function Epoch(T,J,Q,I){var L=this;function H(){L.versionNumber="2.0.1";L.displayYearInitial=L.curDate.getFullYear();L.displayMonthInitial=L.curDate.getMonth();L.displayYear=L.displayYearInitial;L.displayMonth=L.displayMonthInitial;L.minDate=new Date(2005,3,1);L.maxDate=new Date(2009,6,31);L.startDay=0;L.showWeeks=true;L.selCurMonthOnly=true}function C(){L.daylist=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun","Mon","Tue","Wed","Thu","Fri","Sat");L.months_sh=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");L.monthup_title="Go to the next month";L.monthdn_title="Go to the previous month";L.clearbtn_caption="Clear";L.clearbtn_title="Clears any dates selected on the calendar";L.maxrange_caption="This is the maximum range";L.closebtn_caption="Close";L.closebtn_title="Close the calendar"}function K(){L.daynames=new Array();var U=0;for(var V=L.startDay;V<L.startDay+7;V++){L.daynames[U++]=L.daylist[V]}L.monthDayCount=new Array(31,((L.curDate.getFullYear()-2000)%4?28:29),31,30,31,30,31,31,30,31,30,31)}function M(){var U,V,W;L.calendar=document.createElement("table");L.calendar.setAttribute("id",L.name+"_calendar");S(L.calendar,"calendar");L.calendar.style.display="none";addEventHandler(L.calendar,"selectstart",function(){return false});addEventHandler(L.calendar,"drag",function(){return false});U=document.createElement("tbody");V=document.createElement("tr");W=document.createElement("td");W.appendChild(F());V.appendChild(W);U.appendChild(V);V=document.createElement("tr");W=document.createElement("td");L.calendar.celltable=document.createElement("table");S(L.calendar.celltable,"cells");L.calendar.celltable.appendChild(D());L.calendar.celltable.appendChild(G());W.appendChild(L.calendar.celltable);V.appendChild(W);U.appendChild(V);V=document.createElement("tr");W=document.createElement("td");W.appendChild(E());V.appendChild(W);U.appendChild(V);L.calendar.appendChild(U);addEventHandler(L.calendar,"mouseover",P);addEventHandler(L.calendar,"mouseout",A)}function F(){var U=document.createElement("div");S(U,"mainheading");L.monthSelect=document.createElement("select");L.yearSelect=document.createElement("select");var b=document.createElement("input"),Z=document.createElement("input");var X,W;for(W=0;W<12;W++){X=document.createElement("option");X.setAttribute("value",W);if(L.displayMonth==W){X.setAttribute("selected","selected")}X.appendChild(document.createTextNode(L.months_sh[W]));L.monthSelect.appendChild(X)}var Y=L.maxDate.getFullYear(),a=L.minDate.getFullYear();for(W=a;W<=Y;W++){X=document.createElement("option");X.setAttribute("value",W);if(L.displayYear==W){X.setAttribute("selected","selected")}X.appendChild(document.createTextNode(W));L.yearSelect.appendChild(X)}Z.setAttribute("type","button");Z.setAttribute("value",">");Z.setAttribute("title",L.monthup_title);b.setAttribute("type","button");b.setAttribute("value","<");b.setAttribute("title",L.monthdn_title);L.monthSelect.owner=L.yearSelect.owner=Z.owner=b.owner=L;function V(){if(L.goToMonth(L.yearSelect.value,L.monthSelect.value)){L.displayMonth=L.monthSelect.value;L.displayYear=L.yearSelect.value}else{L.monthSelect.value=L.displayMonth;L.yearSelect.value=L.displayYear}}addEventHandler(Z,"click",function(){L.nextMonth()});addEventHandler(b,"click",function(){L.prevMonth()});addEventHandler(L.monthSelect,"change",V);addEventHandler(L.yearSelect,"change",V);U.appendChild(b);U.appendChild(L.monthSelect);U.appendChild(L.yearSelect);U.appendChild(Z);return U}function E(){var U=document.createElement("div");var V=document.createElement("input");V.setAttribute("type","button");V.setAttribute("value",L.clearbtn_caption);V.setAttribute("title",L.clearbtn_title);V.owner=L;addEventHandler(V,"click",function(){L.resetSelections(false)});U.appendChild(V);if(L.mode=="popup"){var W=document.createElement("input");W.setAttribute("type","button");W.setAttribute("value",L.closebtn_caption);W.setAttribute("title",L.closebtn_title);addEventHandler(W,"click",function(){L.hide()});S(W,"closeBtn");U.appendChild(W)}return U}function D(){L.calHeading=document.createElement("thead");S(L.calHeading,"caldayheading");var V=document.createElement("tr"),U;L.cols=new Array(false,false,false,false,false,false,false);if(L.showWeeks){U=document.createElement("th");S(U,"wkhead");V.appendChild(U)}for(var W=0;W<7;W++){U=document.createElement("th");U.appendChild(document.createTextNode(L.daynames[W]));if(L.selectMultiple){U.headObj=new CalHeading(L,U,(W+L.startDay<7?W+L.startDay:W+L.startDay-7))}V.appendChild(U)}L.calHeading.appendChild(V);return L.calHeading}function G(){L.rows=new Array(false,false,false,false,false,false);L.cells=new Array();var g=-1,Y=(L.showWeeks?48:42);var Z=new Date(L.displayYear,L.displayMonth,1);var b=new Date(L.displayYear,L.displayMonth,L.monthDayCount[L.displayMonth]);var W=new Date(Z);W.setDate(W.getDate()+(L.startDay-Z.getDay())-(L.startDay-Z.getDay()>0?7:0));L.calCells=document.createElement("tbody");var c,X;var U=0,d,V,f;for(var a=0;a<Y;a++){if(L.showWeeks){if(a%8==0){g++;V=W.getWeek(L.startDay);c=document.createElement("tr");X=document.createElement("td");if(L.selectMultiple){X.weekObj=new WeekHeading(L,X,V,g)}else{S(X,"wkhead")}X.appendChild(document.createTextNode(V));c.appendChild(X);a++}}else{if(a%7==0){g++;V=W.getWeek(L.startDay);c=document.createElement("tr")}}f=W.getDate();X=document.createElement("td");X.appendChild(document.createTextNode(f));d=new CalCell(L,X,W,g,V);L.cells[U]=d;X.cellObj=d;c.appendChild(X);L.calCells.appendChild(c);L.reDraw(U++);W.setDate(f+1)}return L.calCells}function O(U){if(L.mode=="popup"){L.calendar.style.position="absolute"}if(U){switch(L.mode){case"flat":L.tgt=U;L.tgt.appendChild(L.calendar);L.visible=true;break;case"popup":L.calendar.style.position="absolute";document.body.appendChild(L.calendar);L.setTarget(U,false);break}}else{document.body.appendChild(L.calendar);L.visible=false}}function N(){L.calendar.celltable.removeChild(L.calendar.celltable.childNodes[1])}function S(U,V){U.setAttribute("class",V);U.setAttribute("className",V)}function B(W){var U=L.cells[W];var V;idx=L.dateInArray(L.dates,U.date);if(idx>-1){V=L.dates[idx];U.date.selected=V.selected||false;U.date.type=V.type;U.date.canSelect=V.canSelect;U.setTitle(V.title);U.setURL(V.href);U.setHTML(V.cellHTML)}else{U.date.selected=false}if(U.date.getTime()<L.minDate.getTime()||U.date.getTime()>L.maxDate.getTime()){U.date.canSelect=false}U.setClass()}function P(){L.mousein=true}function A(){L.mousein=false}function R(){var U=0;L.selectedDates=new Array();for(i=0;i<L.dates.length;i++){if(L.dates[i].selected){L.selectedDates[U++]=L.dates[i]}}}L.dateInArray=function(U,V,X){X=(X!=null?X:0);for(var W=X;W<U.length;W++){if(V.getUeDay()==U[W].getUeDay()){return W}}return -1};L.setTarget=function(X,U){if(L.mode=="popup"){function W(){L.show()}function V(){if(!L.mousein){L.hide()}}function a(){L.hide()}if(L.tgt){removeEventHandler(L.tgt,"focus",W);removeEventHandler(L.tgt,"blur",V);removeEventHandler(L.tgt,"keydown",a)}L.tgt=X;var Z=L.tgt.dateObj,Y=new Array;if(Z){if(L.tgt.value.length){Y[0]=Z}L.goToMonth(Z.getFullYear(),Z.getMonth())}L.selectDates(Y,true,true,true);L.topOffset=L.tgt.offsetHeight;L.leftOffset=0;L.updatePos(L.tgt);addEventHandler(L.tgt,"focus",W);addEventHandler(L.tgt,"blur",V);addEventHandler(L.tgt,"keydown",a);if(U!==false){W()}}else{if(L.tgt){L.tgt.removeChild(L.calendar)}L.tgt=X;L.tgt.appendChild(L.calendar);L.show()}};L.nextMonth=function(){var V=L.displayMonth;var U=L.displayYear;if(L.displayMonth<11){V++}else{if(L.yearSelect.value<L.maxDate.getFullYear()){V=0;U++}}return L.goToMonth(U,V)};L.prevMonth=function(){var V=L.displayMonth;var U=L.displayYear;if(L.displayMonth>0){V--}else{V=11;U--}return L.goToMonth(U,V)};L.goToMonth=function(V,X){var W=new Date(V,X,31);var U=new Date(V,X,1);if(W>=L.minDate&&U<=L.maxDate){L.monthSelect.value=L.displayMonth=X;L.yearSelect.value=L.displayYear=V;G();N();L.calendar.celltable.appendChild(L.calCells);return true}else{alert(L.maxrange_caption);return false}};L.updatePos=function(U){if(L.mode=="popup"){L.calendar.style.top=getTop(U)+L.topOffset+"px";L.calendar.style.left=getLeft(U)+L.leftOffset+"px"}};L.show=function(){L.updatePos(L.tgt);L.calendar.style.display="block";L.visible=true};L.hide=function(){L.calendar.style.display="none";L.visible=false};L.toggle=function(){L.visible?L.hide():L.show()};L.addDates=function(V,W){var U;for(U=0;U<V.length;U++){if(L.dateInArray(L.dates,V[U])==-1){L.dates[L.dates.length]=V[U]}}R();if(W!=false){L.reDraw()}};L.removeDates=function(W,X){var U;for(var V=0;V<W.length;V++){U=L.dateInArray(L.dates,W[V]);if(U!=-1){L.dates.splice(U,1)}}R();if(X!=false){L.reDraw()}};L.selectDates=function(X,V,Z,Y){var W,U;if(Y==true){for(W=0;W<L.dates.length;W++){L.dates[W].selected=false}}for(W=0;W<X.length;W++){U=L.dateInArray(L.dates,X[W]);if(V==true){X[W].selected=true;if(U==-1){L.dates[L.dates.length]=X[W]}else{L.dates[U].selected=true}}else{if(U>-1){L.dates[U].selected=X[W].selected=false;if(L.dates[U].type=="normal"){L.dates.splice(U,1)}}}}R();if(Z!=false){L.reDraw()}};L.sendForm=function(X,W){var V=W||"epochdates";for(var U=0;U<L.dates.length;U++){V=document.createElement("input");V.setAttribute("type","hidden");V.setAttribute("name",W+"[]");V.setAttribute("value",encodeURIComponent(L.dates[U].dateFormat("Y-m-d")));X.appendChild(V)}};L.resetSelections=function(X){var W=new Array();var V=L.dates;for(var U=0;U<V.length;U++){if(V[U].selected){W[W.length]=V[U]}}L.selectDates(W,false,false);L.rows=new Array(false,false,false,false,false,false,false);L.cols=new Array(false,false,false,false,false,false,false);if(L.mode=="popup"){L.tgt.value="";L.hide()}X==true?L.goToMonth(L.displayYearInitial,L.displayMonthInitial):L.reDraw()};L.reDraw=function(V){L.state=1;var U=V?V+1:L.cells.length;for(var W=V||0;W<U;W++){B(W)}L.state=2};L.getCellIndex=function(U){for(var V=0;V<L.cells.length;V++){if(L.cells[V].date.getUeDay()==U.getUeDay()){return V}}return -1};L.state=0;L.name=T;L.curDate=new Date();L.mode=J;L.selectMultiple=(I==true);L.dates=new Array();L.selectedDates=new Array();L.calendar;L.calHeading;L.calCells;L.rows;L.cols;L.cells=new Array();L.monthSelect;L.yearSelect;L.mousein=false;H();C();K();M();O(Q);L.state=2;L.visible?L.show():L.hide()}function CalHeading(A,E,C){function D(){var H=A.dates;var F=A.cells;var I=new Array();A.cols[C]=!A.cols[C];for(var G=0;G<F.length;G++){if(F[G].dayOfWeek==C&&F[G].date.canSelect&&(!A.selCurMonthOnly||F[G].date.getMonth()==A.displayMonth&&F[G].date.getFullYear()==A.displayYear)){I[I.length]=F[G].date}}A.selectDates(I,A.cols[C],true)}var B=this;B.dayOfWeek=C;addEventHandler(E,"mouseup",D)}function WeekHeading(C,F,E,B){function A(){var G=C.cells;var I=C.dates;var J=new Array();C.rows[B]=!C.rows[B];for(var H=0;H<G.length;H++){if(G[H].tableRow==B&&G[H].date.canSelect&&(!C.selCurMonthOnly||G[H].date.getMonth()==C.displayMonth&&G[H].date.getFullYear()==C.displayYear)){J[J.length]=G[H].date}}C.selectDates(J,C.rows[B],true)}var D=this;D.week=E;F.setAttribute("class","wkhead");F.setAttribute("className","wkhead");addEventHandler(F,"mouseup",A)}function CalCell(C,F,I,H,B){var G=this;function A(){if(G.date.canSelect){if(C.selectMultiple==true){C.selectDates(new Array(G.date),!G.date.selected,false);G.setClass()}else{C.selectDates(new Array(G.date),true,false,true);if(C.mode=="popup"){C.tgt.value=G.date.dateFormat();C.tgt.dateObj=new Date(G.date);C.hide()}C.reDraw()}}}function E(){if(G.date.canSelect){F.setAttribute("class",G.cellClass+" hover");F.setAttribute("className",G.cellClass+" hover")}}function D(){G.setClass()}G.setClass=function(){if(G.date.canSelect!==false){if(G.date.selected){G.cellClass="cell_selected"}else{if(C.displayMonth!=G.date.getMonth()){G.cellClass="notmnth"}else{if(G.date.type=="holiday"){G.cellClass="hlday"}else{if(G.dayOfWeek>0&&G.dayOfWeek<6){G.cellClass="wkday"}else{G.cellClass="wkend"}}}}}else{G.cellClass="noselect"}if(G.date.getUeDay()==C.curDate.getUeDay()){G.cellClass=G.cellClass+" curdate"}F.setAttribute("class",G.cellClass);F.setAttribute("className",G.cellClass)};G.setURL=function(J,L){if(J){if(L=="js"){addEventHandler(G.tableCell,"mousedown",function(){window.location.href=J})}else{var K=document.createElement("a");K.setAttribute("href",J);K.appendChild(document.createTextNode(G.date.getDate()));G.tableCell.replaceChild(K,G.tableCell.firstChild)}}};G.setTitle=function(J){if(J&&J.length>0){G.title=J;G.tableCell.setAttribute("title",J)}};G.setHTML=function(K){if(K&&K.length>0){if(G.tableCell.childNodes[1]){G.tableCell.childNodes[1].innerHTML=K}else{var J=document.createElement("div");J.innerHTML=K;G.tableCell.appendChild(J)}}};G.cellClass;G.tableRow=H;G.tableCell=F;G.date=new Date(I);G.date.canSelect=true;G.date.type="normal";G.date.selected=false;G.date.cellHTML="";G.dayOfWeek=G.date.getDay();G.week=B;addEventHandler(F,"click",A);addEventHandler(F,"mouseover",E);addEventHandler(F,"mouseout",D);G.setClass()}Date.prototype.getDayOfYear=function(){return parseInt((this.getTime()-new Date(this.getFullYear(),0,1).getTime())/86400000+1)};Date.prototype.getWeek=function(D){D=typeof (D)=="int"?D:0;var C=new Date(this.getFullYear(),0,1);var A=C.getDay()-D;A=(A>=0?A:A+7);var E,B=Math.floor((this.getTime()-C.getTime()-(this.getTimezoneOffset()-C.getTimezoneOffset())*60000)/86400000)+1;if(A<4){E=Math.floor((B+A-1)/7)+1;if(E>52){nYear=new Date(this.getFullYear()+1,0,1);nday=nYear.getDay()-D;nday=nday>=0?nday:nday+7;E=nday<4?1:53}}else{E=Math.floor((B+A-1)/7)}return E};Date.prototype.getUeDay=function(){return parseInt(Math.floor((this.getTime()-this.getTimezoneOffset()*60000)/86400000))};Date.prototype.dateFormat=function(L){if(!L){L="d/m/Y"}LZ=function(E){return(E<0||E>9?"":"0")+E};var D=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var F=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");var Q="";var C=0;var J="";var B="";var K=this.getFullYear().toString();var I=this.getMonth()+1;var G=this.getDate();var P=this.getDay();var N=this.getHours();var A=this.getMinutes();var O=this.getSeconds();value={Y:K.toString(),y:K.substring(2),n:I,m:LZ(I),F:D[I-1],M:D[I+11],j:G,d:LZ(G),D:F[P+7],l:F[P],G:N,H:LZ(N)};if(N==0){value["g"]=12}else{if(N>12){value["g"]=N-12}else{value["g"]=N}}value["h"]=LZ(value["g"]);if(N>11){value["a"]="pm";value["A"]="PM"}else{value["a"]="am";value["A"]="AM"}value["i"]=LZ(A);value["s"]=LZ(O);while(C<L.length){J=L.charAt(C);B="";while((L.charAt(C)==J)&&(C<L.length)){B+=L.charAt(C++)}if(value[B]!=null){Q=Q+value[B]}else{Q=Q+B}}return Q};function addEventHandler(A,B,C){if(A.addEventListener){A.addEventListener(B,C,false)}else{if(A.attachEvent){A.attachEvent("on"+B,C)}}}function removeEventHandler(A,B,C){if(A.removeEventListener){A.removeEventListener(B,C,false)}else{if(A.attachEvent){A.detachEvent("on"+B,C)}}}function getTop(A){var C=A;var B=0;while(C.tagName!="HTML"){B+=C.offsetTop||0;if(C.offsetParent){C=C.offsetParent}else{break}}return B}function getLeft(A){var C=A;var B=0;while(C.tagName!="HTML"){B+=C.offsetLeft||0;if(C.offsetParent){C=C.offsetParent}else{break}}return B}var calendar;function strToDate(F){var D=F.split("/");var C=D[2];var E=D[1]-1;var B=D[0];var A=new Date(C,E,B);A.canSelect=true;return A}function dateForm(){if($("viewByDate")&&$("dateSelect")){var C=$("viewByDate");var A=$("viewDate");A.setProperty("autocomplete","off");var B=new Epoch("viewDate","popup",A,false);B.maxDate=new Date();B.updatePos=function(E){var D=B.offsetHeight;B.calendar.style.top=(getTop(E)-B.calendar.offsetHeight-6)+"px";B.calendar.style.left=getLeft(E)+B.leftOffset+"px"};if(A.value){A.dateObj=strToDate(A.value)}else{A.dateObj=new Date();A.canSelect=true}$("dateSelect").onclick=function(){A.focus()};A.onfocus=function(){B.setTarget(this)};C.onsubmit=function(){if(!A.value){alert("Please select a date");return false}}}}window.addEvent("load",dateForm)

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function imageDiv(){

	if (document.getElementById('imageTypeNav')) {
		var imageTabs = document.getElementById('imageTypeNav').getElementsByTagName('li');
		var imageDivScreen = document.getElementById('imageDivScreen');
		var imageDivPrint = document.getElementById('imageDivPrint');
		
		imageTabs[0].onclick = function(){
			imageTabs[0].className = 'active';
			imageTabs[1].className = '';
			imageDivScreen.className = '';
			imageDivPrint.className = 'hidden';
			return false;
		}
		imageTabs[1].onclick = function(){
			imageTabs[0].className = '';
			imageTabs[1].className = 'active';
			imageDivScreen.className = 'hidden';
			imageDivPrint.className = '';
			return false;
		}
	}
	
}

addLoadEvent(imageDiv);