var Prototype={Version:"1.6.0.3",Browser:{IE:!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1),Opera:navigator.userAgent.indexOf("Opera")>-1,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")===-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div")["__proto__"]&&document.createElement("div")["__proto__"]!==document.createElement("form")["__proto__"]},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var B=null,D=$A(arguments);if(Object.isFunction(D[0])){B=D.shift()}function A(){this.initialize.apply(this,arguments)}Object.extend(A,Class.Methods);A.superclass=B;A.subclasses=[];if(B){var F=function(){};F.prototype=B.prototype;A.prototype=new F;B.subclasses.push(A)}for(var E=0;E<D.length;E++){A.addMethods(D[E])}if(!A.prototype.initialize){A.prototype.initialize=Prototype.emptyFunction}A.prototype.constructor=A;return A}};Class.Methods={addMethods:function(B){var F=this.superclass&&this.superclass.prototype;var E=Object.keys(B);if(!Object.keys({toString:true}).length){E.push("toString","valueOf")}for(var G=0,D=E.length;G<D;G++){var A=E[G],H=B[A];if(F&&Object.isFunction(H)&&H.argumentNames().first()=="$super"){var I=H;H=(function(J){return function(){return F[J].apply(this,arguments)}})(A).wrap(I);H.valueOf=I.valueOf.bind(I);H.toString=I.toString.bind(I)}this.prototype[A]=H}return this}};var Abstract={};Object.extend=function(D,B){for(var A in B){D[A]=B[A]}return D};Object.extend(Object,{inspect:function(A){try{if(Object.isUndefined(A)){return"undefined"}if(A===null){return"null"}return A.inspect?A.inspect():String(A)}catch(B){if(B instanceof RangeError){return"..."}throw B}},toJSON:function(D){var E=typeof D;switch(E){case"undefined":case"function":case"unknown":return;case"boolean":return D.toString()}if(D===null){return"null"}if(D.toJSON){return D.toJSON()}if(Object.isElement(D)){return}var B=[];for(var A in D){var F=Object.toJSON(D[A]);if(!Object.isUndefined(F)){B.push(A.toJSON()+": "+F)}}return"{"+B.join(", ")+"}"},toQueryString:function(A){return $H(A).toQueryString()},toHTML:function(A){return A&&A.toHTML?A.toHTML():String.interpret(A)},keys:function(B){var D=[];for(var A in B){D.push(A)}return D},values:function(B){var D=[];for(var A in B){D.push(B[A])}return D},clone:function(A){return Object.extend({},A)},isElement:function(A){return !!(A&&A.nodeType==1)},isArray:function(A){return A!=null&&typeof A=="object"&&"splice" in A&&"join" in A},isHash:function(A){return A instanceof Hash},isFunction:function(A){return typeof A=="function"},isString:function(A){return typeof A=="string"},isNumber:function(A){return typeof A=="number"},isUndefined:function(A){return typeof A=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var A=this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1].replace(/\s+/g,"").split(",");return A.length==1&&!A[0]?[]:A},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var D=this,A=$A(arguments),B=A.shift();return function(){return D.apply(B,A.concat($A(arguments)))}},bindAsEventListener:function(){var D=this,A=$A(arguments),B=A.shift();return function(E){return D.apply(B,[E||window.event].concat(A))}},curry:function(){if(!arguments.length){return this}var B=this,A=$A(arguments);return function(){return B.apply(this,A.concat($A(arguments)))}},delay:function(){var D=this,B=$A(arguments),A=B.shift()*1000;return window.setTimeout(function(){return D.apply(D,B)},A)},defer:function(){var A=[0.01].concat($A(arguments));return this.delay.apply(this,A)},wrap:function(B){var A=this;return function(){return B.apply(this,[A.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var A=this;return this._methodized=function(){return A.apply(null,[this].concat($A(arguments)))}}});Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};var Try={these:function(){var B;for(var D=0,A=arguments.length;D<A;D++){var E=arguments[D];try{B=E();break}catch(F){}}return B}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(A,B){this.callback=A;this.frequency=B;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(B,E){var F="",A=this,D;E=arguments.callee.prepareReplacement(E);while(A.length>0){if(D=A.match(B)){F+=A.slice(0,D.index);F+=String.interpret(E(D));A=A.slice(D.index+D[0].length)}else{F+=A,A=""}}return F},sub:function(A,B,D){B=this.gsub.prepareReplacement(B);D=Object.isUndefined(D)?1:D;return this.gsub(A,function(E){if(--D<0){return E[0]}return B(E)})},scan:function(A,B){this.gsub(A,B);return String(this)},truncate:function(A,B){A=A||30;B=Object.isUndefined(B)?"...":B;return this.length>A?this.slice(0,A-B.length)+B:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var B=new RegExp(Prototype.ScriptFragment,"img");var A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(B)||[]).map(function(D){return(D.match(A)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var A=arguments.callee;A.text.data=this;return A.div.innerHTML},unescapeHTML:function(){var A=new Element("div");A.innerHTML=this.stripTags();return A.childNodes[0]?(A.childNodes.length>1?$A(A.childNodes).inject("",function(B,D){return B+D.nodeValue}):A.childNodes[0].nodeValue):""},toQueryParams:function(B){var A=this.strip().match(/([^?#]*)(#.*)?$/);if(!A){return{}}return A[1].split(B||"&").inject({},function(F,G){if((G=G.split("="))[0]){var D=decodeURIComponent(G.shift());var E=G.length>1?G.join("="):G[0];if(E!=undefined){E=decodeURIComponent(E)}if(D in F){if(!Object.isArray(F[D])){F[D]=[F[D]]}F[D].push(E)}else{F[D]=E}}return F})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(A){return A<1?"":new Array(A+1).join(this)},camelize:function(){var E=this.split("-"),A=E.length;if(A==1){return E[0]}var B=this.charAt(0)=="-"?E[0].charAt(0).toUpperCase()+E[0].substring(1):E[0];for(var D=1;D<A;D++){B+=E[D].charAt(0).toUpperCase()+E[D].substring(1)}return B},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(B){var A=this.gsub(/[\x00-\x1f\\]/,function(D){var E=String.specialChar[D[0]];return E?E:"\\u00"+D[0].charCodeAt().toPaddedString(2,16)});if(B){return'"'+A.replace(/"/g,'\\"')+'"'}return"'"+A.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(A){return this.sub(A||Prototype.JSONFilter,"#{1}")},isJSON:function(){var A=this;if(A.blank()){return false}A=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(A)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(A){return this.indexOf(A)>-1},startsWith:function(A){return this.indexOf(A)===0},endsWith:function(A){var B=this.length-A.length;return B>=0&&this.lastIndexOf(A)===B},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(B,A){return new Template(this,A).evaluate(B)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.stripTags().replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(B){if(Object.isFunction(B)){return B}var A=new Template(B);return function(D){return A.evaluate(D)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);var Template=Class.create({initialize:function(B,A){this.template=B.toString();this.pattern=A||Template.Pattern},evaluate:function(A){if(Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(G){if(A==null){return""}var D=G[1]||"";if(D=="\\"){return G[2]}var E=A,H=G[3];var B=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;G=B.exec(H);if(G==null){return D}while(G!=null){var F=G[1].startsWith("[")?G[2].gsub("\\\\]","]"):G[1];E=E[F];if(null==E||""==G[3]){break}H=H.substring("["==G[3]?G[1].length:G[0].length);G=B.exec(H)}return D+String.interpret(E)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(D,B){var A=0;try{this._each(function(F){D.call(B,F,A++)})}catch(E){if(E!=$break){throw E}}return this},eachSlice:function(A,E,D){var B=-A,F=[],G=this.toArray();if(A<1){return G}while((B+=A)<G.length){F.push(G.slice(B,B+A))}return F.collect(E,D)},all:function(B,A){B=B||Prototype.K;var D=true;this.each(function(F,E){D=D&&!!B.call(A,F,E);if(!D){throw $break}});return D},any:function(B,A){B=B||Prototype.K;var D=false;this.each(function(F,E){if(D=!!B.call(A,F,E)){throw $break}});return D},collect:function(D,B){D=D||Prototype.K;var A=[];this.each(function(F,E){A.push(D.call(B,F,E))});return A},detect:function(B,A){var D;this.each(function(F,E){if(B.call(A,F,E)){D=F;throw $break}});return D},findAll:function(D,B){var A=[];this.each(function(F,E){if(D.call(B,F,E)){A.push(F)}});return A},grep:function(A,E,D){E=E||Prototype.K;var B=[];if(Object.isString(A)){A=new RegExp(A)}this.each(function(G,F){if(A.match(G)){B.push(E.call(D,G,F))}});return B},include:function(A){if(Object.isFunction(this.indexOf)){if(this.indexOf(A)!=-1){return true}}var B=false;this.each(function(D){if(D==A){B=true;throw $break}});return B},inGroupsOf:function(A,B){B=Object.isUndefined(B)?null:B;return this.eachSlice(A,function(D){while(D.length<A){D.push(B)}return D})},inject:function(A,D,B){this.each(function(F,E){A=D.call(B,A,F,E)});return A},invoke:function(B){var A=$A(arguments).slice(1);return this.map(function(D){return D[B].apply(D,A)})},max:function(B,A){B=B||Prototype.K;var D;this.each(function(F,E){F=B.call(A,F,E);if(D==null||F>=D){D=F}});return D},min:function(B,A){B=B||Prototype.K;var D;this.each(function(F,E){F=B.call(A,F,E);if(D==null||F<D){D=F}});return D},partition:function(E,B){E=E||Prototype.K;var D=[],A=[];this.each(function(G,F){(E.call(B,G,F)?D:A).push(G)});return[D,A]},pluck:function(A){var B=[];this.each(function(D){B.push(D[A])});return B},reject:function(D,B){var A=[];this.each(function(F,E){if(!D.call(B,F,E)){A.push(F)}});return A},sortBy:function(B,A){return this.map(function(E,D){return{value:E,criteria:B.call(A,E,D)}}).sort(function(G,F){var E=G.criteria,D=F.criteria;return E<D?-1:E>D?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var B=Prototype.K,A=$A(arguments);if(Object.isFunction(A.last())){B=A.pop()}var D=[this].concat(A).map($A);return this.map(function(F,E){return B(D.pluck(E))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(D){if(!D){return[]}if(D.toArray){return D.toArray()}var A=D.length||0,B=new Array(A);while(A--){B[A]=D[A]}return B}if(Prototype.Browser.WebKit){$A=function(D){if(!D){return[]}if(!(typeof D==="function"&&typeof D.length==="number"&&typeof D.item==="function")&&D.toArray){return D.toArray()}var A=D.length||0,B=new Array(A);while(A--){B[A]=D[A]}return B}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(D){for(var B=0,A=this.length;B<A;B++){D(this[B])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(A){return A!=null})},flatten:function(){return this.inject([],function(B,A){return B.concat(Object.isArray(A)?A.flatten():[A])})},without:function(){var A=$A(arguments);return this.select(function(B){return !A.include(B)})},reverse:function(A){return(A!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(A){return this.inject([],function(E,D,B){if(0==B||(A?E.last()!=D:!E.include(D))){E.push(D)}return E})},intersect:function(A){return this.uniq().findAll(function(B){return A.detect(function(D){return B===D})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var A=[];this.each(function(B){var D=Object.toJSON(B);if(!Object.isUndefined(D)){A.push(D)}});return"["+A.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(D,B){B||(B=0);var A=this.length;if(B<0){B=A+B}for(;B<A;B++){if(this[B]===D){return B}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(B,A){A=isNaN(A)?this.length:(A<0?this.length+A:A)+1;var D=this.slice(0,A).reverse().indexOf(B);return(D<0)?D:A-D-1}}Array.prototype.toArray=Array.prototype.clone;function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var F=[];for(var D=0,A=this.length;D<A;D++){F.push(this[D])}for(var D=0,A=arguments.length;D<A;D++){if(Object.isArray(arguments[D])){for(var B=0,E=arguments[D].length;B<E;B++){F.push(arguments[D][B])}}else{F.push(arguments[D])}}return F}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(B,A){$R(0,this,true).each(B,A);return this},toPaddedString:function(A,D){var B=this.toString(D||10);return"0".times(A-B.length)+B},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(A){Number.prototype[A]=Math[A].methodize()});function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function A(B,D){if(Object.isUndefined(D)){return B}return B+"="+encodeURIComponent(String.interpret(D))}return{initialize:function(B){this._object=Object.isHash(B)?B.toObject():Object.clone(B)},_each:function(D){for(var B in this._object){var E=this._object[B],F=[B,E];F.key=B;F.value=E;D(F)}},set:function(B,D){return this._object[B]=D},get:function(B){if(this._object[B]!==Object.prototype[B]){return this._object[B]}},unset:function(B){var D=this._object[B];delete this._object[B];return D},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(D){var B=this.detect(function(E){return E.value===D});return B&&B.key},merge:function(B){return this.clone().update(B)},update:function(B){return new Hash(B).inject(this,function(D,E){D.set(E.key,E.value);return D})},toQueryString:function(){return this.inject([],function(D,F){var B=encodeURIComponent(F.key),E=F.value;if(E&&typeof E=="object"){if(Object.isArray(E)){return D.concat(E.map(A.curry(B)))}}else{D.push(A(B,E))}return D}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(B){return B.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(D,A,B){this.start=D;this.end=A;this.exclusive=B},_each:function(A){var B=this.start;while(this.include(B)){A(B);B=B.succ()}},include:function(A){if(A<this.start){return false}if(this.exclusive){return A<this.end}return A<=this.end}});var $R=function(D,A,B){return new ObjectRange(D,A,B)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A)},register:function(A){if(!this.include(A)){this.responders.push(A)}},unregister:function(A){this.responders=this.responders.without(A)},dispatch:function(D,B,E,A){this.each(function(F){if(Object.isFunction(F[D])){try{F[D].apply(F,[B,E,A])}catch(G){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,A,B){$super(B);this.transport=Ajax.getTransport();this.request(A)},request:function(A){this.url=A;this.method=this.options.method;var E=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){E._method=this.method;this.method="post"}this.parameters=E;if(E=Object.toQueryString(E)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+E}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){E+="&_="}}}try{var B=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(B)}Ajax.Responders.dispatch("onCreate",this,B);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||E):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(D){this.dispatchException(D)}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var F={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){F["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){F.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var B=this.options.requestHeaders;if(Object.isFunction(B.push)){for(var E=0,A=B.length;E<A;E+=2){F[B[E]]=B[E+1]}}else{$H(B).each(function(G){F[G.key]=G.value})}}for(var D in F){this.transport.setRequestHeader(D,F[D])}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300)},getStatus:function(){try{return this.transport.status||0}catch(A){return 0}},respondToReadyState:function(A){var D=Ajax.Request.Events[A],B=new Ajax.Response(this);if(D=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON)}catch(F){this.dispatchException(F)}var E=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&E&&E.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+D]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+D,this,B,B.headerJSON)}catch(F){this.dispatchException(F)}if(D=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var A=this.url.match(/^\s*https?:\/\/[^\/]*/);return !A||(A[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(A){try{return this.transport.getResponseHeader(A)||null}catch(B){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(D){this.request=D;var E=this.transport=D.transport,A=this.readyState=E.readyState;if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(E.responseText);this.headerJSON=this._getHeaderJSON()}if(A==4){var B=E.responseXML;this.responseXML=Object.isUndefined(B)?null:B;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(A){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(A){return null}},getResponseHeader:function(A){return this.transport.getResponseHeader(A)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var A=this.getHeader("X-JSON");if(!A){return null}A=decodeURIComponent(escape(A));try{return A.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}},_getResponseJSON:function(){var A=this.request.options;if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(A.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,D,A,B){this.container={success:(D.success||D),failure:(D.failure||(D.success?null:D))};B=Object.clone(B);var E=B.onComplete;B.onComplete=(function(G,F){this.updateContent(G.responseText);if(Object.isFunction(E)){E(G,F)}}).bind(this);$super(A,B)},updateContent:function(E){var B=this.container[this.success()?"success":"failure"],D=this.options;if(!D.evalScripts){E=E.stripScripts()}if(B=$(B)){if(D.insertion){if(Object.isString(D.insertion)){var A={};A[D.insertion]=E;B.insert(A)}else{D.insertion(B,E)}}else{B.update(E)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,D,A,B){$super(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=D;this.url=A;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(D){if(arguments.length>1){for(var E=0,A=[],B=arguments.length;E<B;E++){A.push($(arguments[E]))}return A}if(Object.isString(D)){D=document.getElementById(D)}return Element.extend(D)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(G,E){var D=[];var F=document.evaluate(G,$(E)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,A=F.snapshotLength;B<A;B++){D.push(Element.extend(F.snapshotItem(B)))}return D}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(){var A=this.Element;this.Element=function(E,D){D=D||{};E=E.toLowerCase();var B=Element.cache;if(Prototype.Browser.IE&&D.name){E="<"+E+' name="'+D.name+'">';delete D.name;return Element.writeAttribute(document.createElement(E),D)}if(!B[E]){B[E]=Element.extend(document.createElement(E))}return Element.writeAttribute(B[E].cloneNode(false),D)};Object.extend(this.Element,A||{});if(A){this.Element.prototype=A.prototype}}).call(window);Element.cache={};Element.Methods={visible:function(A){return $(A).style.display!="none"},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A},hide:function(A){A=$(A);A.style.display="none";return A},show:function(A){A=$(A);A.style.display="";return A},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A},update:function(A,B){A=$(A);if(B&&B.toElement){B=B.toElement()}if(Object.isElement(B)){return A.update().insert(B)}B=Object.toHTML(B);A.innerHTML=B.stripScripts();B.evalScripts.bind(B).defer();return A},replace:function(B,D){B=$(B);if(D&&D.toElement){D=D.toElement()}else{if(!Object.isElement(D)){D=Object.toHTML(D);var A=B.ownerDocument.createRange();A.selectNode(B);D.evalScripts.bind(D).defer();D=A.createContextualFragment(D.stripScripts())}}B.parentNode.replaceChild(D,B);return B},insert:function(E,G){E=$(E);if(Object.isString(G)||Object.isNumber(G)||Object.isElement(G)||(G&&(G.toElement||G.toHTML))){G={bottom:G}}var F,B,D,H;for(var A in G){F=G[A];A=A.toLowerCase();B=Element._insertionTranslations[A];if(F&&F.toElement){F=F.toElement()}if(Object.isElement(F)){B(E,F);continue}F=Object.toHTML(F);D=((A=="before"||A=="after")?E.parentNode:E).tagName.toUpperCase();H=Element._getContentFromAnonymousElement(D,F.stripScripts());if(A=="top"||A=="after"){H.reverse()}H.each(B.curry(E));F.evalScripts.bind(F).defer()}return E},wrap:function(B,D,A){B=$(B);if(Object.isElement(D)){$(D).writeAttribute(A||{})}else{if(Object.isString(D)){D=new Element(D,A)}else{D=new Element("div",D)}}if(B.parentNode){B.parentNode.replaceChild(D,B)}D.appendChild(B);return D},inspect:function(A){A=$(A);var B="<"+A.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(G){var D=G.first(),E=G.last();var F=(A[D]||"").toString();if(F){B+=" "+E+"="+F.inspect(true)}});return B+">"},recursivelyCollect:function(D,B){D=$(D);var A=[];while(D=D[B]){if(D.nodeType==1){A.push(Element.extend(D))}}return A},ancestors:function(A){return $(A).recursivelyCollect("parentNode")},descendants:function(A){return $(A).select("*")},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling}return $(A)},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[]}while(A&&A.nodeType!=1){A=A.nextSibling}if(A){return[A].concat($(A).nextSiblings())}return[]},previousSiblings:function(A){return $(A).recursivelyCollect("previousSibling")},nextSiblings:function(A){return $(A).recursivelyCollect("nextSibling")},siblings:function(A){A=$(A);return A.previousSiblings().reverse().concat(A.nextSiblings())},match:function(B,A){if(Object.isString(A)){A=new Selector(A)}return A.match($(B))},up:function(D,E,B){D=$(D);if(arguments.length==1){return $(D.parentNode)}var A=D.ancestors();return Object.isNumber(E)?A[E]:Selector.findElement(A,E,B)},down:function(B,D,A){B=$(B);if(arguments.length==1){return B.firstDescendant()}return Object.isNumber(D)?B.descendants()[D]:Element.select(B,D)[A||0]},previous:function(B,E,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B))}var D=B.previousSiblings();return Object.isNumber(E)?D[E]:Selector.findElement(D,E,A)},next:function(B,E,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(B))}var D=B.nextSiblings();return Object.isNumber(E)?D[E]:Selector.findElement(D,E,A)},select:function(){var B=$A(arguments),A=$(B.shift());return Selector.findChildElements(A,B)},adjacent:function(){var B=$A(arguments),A=$(B.shift());return Selector.findChildElements(A.parentNode,B).without(A)},identify:function(B){B=$(B);var D=B.readAttribute("id"),A=arguments.callee;if(D){return D}do{D="anonymous_element_"+A.counter++}while($(D));B.writeAttribute("id",D);return D},readAttribute:function(B,A){B=$(B);if(Prototype.Browser.IE){var D=Element._attributeTranslations.read;if(D.values[A]){return D.values[A](B,A)}if(D.names[A]){A=D.names[A]}if(A.include(":")){return(!B.attributes||!B.attributes[A])?null:B.attributes[A].value}}return B.getAttribute(A)},writeAttribute:function(E,D,G){E=$(E);var B={},F=Element._attributeTranslations.write;if(typeof D=="object"){B=D}else{B[D]=Object.isUndefined(G)?true:G}for(var A in B){D=F.names[A]||A;G=B[A];if(F.values[A]){D=F.values[A](E,G)}if(G===false||G===null){E.removeAttribute(D)}else{if(G===true){E.setAttribute(D,D)}else{E.setAttribute(D,G)}}}return E},getHeight:function(A){return $(A).getDimensions().height},getWidth:function(A){return $(A).getDimensions().width},classNames:function(A){return new Element.ClassNames(A)},hasClassName:function(B,A){if(!(B=$(B))){return}var D=B.className;return(D.length>0&&(D==A||new RegExp("(^|\\s)"+A+"(\\s|$)").test(D)))},addClassName:function(B,A){if(!(B=$(B))){return}if(!B.hasClassName(A)){B.className+=(B.className?" ":"")+A}return B},removeClassName:function(B,A){if(!(B=$(B))){return}B.className=B.className.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," ").strip();return B},toggleClassName:function(B,A){if(!(B=$(B))){return}return B[B.hasClassName(A)?"removeClassName":"addClassName"](A)},cleanWhitespace:function(B){B=$(B);var D=B.firstChild;while(D){var A=D.nextSibling;if(D.nodeType==3&&!/\S/.test(D.nodeValue)){B.removeChild(D)}D=A}return B},empty:function(A){return $(A).innerHTML.blank()},descendantOf:function(B,A){B=$(B),A=$(A);if(B.compareDocumentPosition){return(B.compareDocumentPosition(A)&8)===8}if(A.contains){return A.contains(B)&&A!==B}while(B=B.parentNode){if(B==A){return true}}return false},scrollTo:function(A){A=$(A);var B=A.cumulativeOffset();window.scrollTo(B[0],B[1]);return A},getStyle:function(A,D){A=$(A);D=D=="float"?"cssFloat":D.camelize();var E=A.style[D];if(!E||E=="auto"){var B=document.defaultView.getComputedStyle(A,null);E=B?B[D]:null}if(D=="opacity"){return E?parseFloat(E):1}return E=="auto"?null:E},getOpacity:function(A){return $(A).getStyle("opacity")},setStyle:function(F,D){F=$(F);var B=F.style,E;if(Object.isString(D)){F.style.cssText+=";"+D;return D.include("opacity")?F.setOpacity(D.match(/opacity:\s*(\d?\.?\d*)/)[1]):F}for(var A in D){if(A=="opacity"){F.setOpacity(D[A])}else{B[(A=="float"||A=="cssFloat")?(Object.isUndefined(B.styleFloat)?"cssFloat":"styleFloat"):A]=D[A]}}return F},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A},getDimensions:function(D){D=$(D);var H=D.getStyle("display");if(H!="none"&&H!=null){return{width:D.offsetWidth,height:D.offsetHeight}}var F=D.style;var A=F.visibility;var B=F.position;var E=F.display;F.visibility="hidden";F.position="absolute";F.display="block";var I=D.clientWidth;var G=D.clientHeight;F.display=E;F.position=B;F.visibility=A;return{width:I,height:G}},makePositioned:function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;A.style.position="relative";if(Prototype.Browser.Opera){A.style.top=0;A.style.left=0}}return A},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right=""}return A},makeClipping:function(A){A=$(A);if(A._overflow){return A}A._overflow=Element.getStyle(A,"overflow")||"auto";if(A._overflow!=="hidden"){A.style.overflow="hidden"}return A},undoClipping:function(A){A=$(A);if(!A._overflow){return A}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A},cumulativeOffset:function(A){var B=0,D=0;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;A=A.offsetParent}while(A);return Element._returnOffset(D,B)},positionedOffset:function(A){var B=0,E=0;do{B+=A.offsetTop||0;E+=A.offsetLeft||0;A=A.offsetParent;if(A){if(A.tagName.toUpperCase()=="BODY"){break}var D=Element.getStyle(A,"position");if(D!=="static"){break}}}while(A);return Element._returnOffset(E,B)},absolutize:function(B){B=$(B);if(B.getStyle("position")=="absolute"){return B}var A=B.positionedOffset();var G=A[1];var F=A[0];var D=B.clientWidth;var E=B.clientHeight;B._originalLeft=F-parseFloat(B.style.left||0);B._originalTop=G-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=G+"px";B.style.left=F+"px";B.style.width=D+"px";B.style.height=E+"px";return B},relativize:function(A){A=$(A);if(A.getStyle("position")=="relative"){return A}A.style.position="relative";var D=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=D+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth;return A},cumulativeScrollOffset:function(A){var B=0,D=0;do{B+=A.scrollTop||0;D+=A.scrollLeft||0;A=A.parentNode}while(A);return Element._returnOffset(D,B)},getOffsetParent:function(A){if(A.offsetParent){return $(A.offsetParent)}if(A==document.body){return $(A)}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return $(A)}}return $(document.body)},viewportOffset:function(D){var B=0,E=0;var A=D;do{B+=A.offsetTop||0;E+=A.offsetLeft||0;if(A.offsetParent==document.body&&Element.getStyle(A,"position")=="absolute"){break}}while(A=A.offsetParent);A=D;do{if(!Prototype.Browser.Opera||(A.tagName&&(A.tagName.toUpperCase()=="BODY"))){B-=A.scrollTop||0;E-=A.scrollLeft||0}}while(A=A.parentNode);return Element._returnOffset(E,B)},clonePosition:function(D,A){var E=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});A=$(A);var F=A.viewportOffset();D=$(D);var G=[0,0];var B=null;if(Element.getStyle(D,"position")=="absolute"){B=D.getOffsetParent();G=B.viewportOffset()}if(B==document.body){G[0]-=document.body.offsetLeft;G[1]-=document.body.offsetTop}if(E.setLeft){D.style.left=(F[0]-G[0]+E.offsetLeft)+"px"}if(E.setTop){D.style.top=(F[1]-G[1]+E.offsetTop)+"px"}if(E.setWidth){D.style.width=A.offsetWidth+"px"}if(E.setHeight){D.style.height=A.offsetHeight+"px"}return D}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(A,D,E){switch(E){case"left":case"top":case"right":case"bottom":if(A(D,"position")==="static"){return null}case"height":case"width":if(!Element.visible(D)){return null}var F=parseInt(A(D,E),10);if(F!==D["offset"+E.capitalize()]){return F+"px"}var B;if(E==="height"){B=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{B=["border-left-width","padding-left","padding-right","border-right-width"]}return B.inject(F,function(H,G){var I=A(D,G);return I===null?H:H-parseInt(I,10)})+"px";default:return A(D,E)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(A,B,D){if(D==="title"){return B.title}return A(B,D)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(B,D){D=$(D);try{D.offsetParent}catch(F){return $(document.body)}var A=D.getStyle("position");if(A!=="static"){return B(D)}D.setStyle({position:"relative"});var E=B(D);D.setStyle({position:A});return E});$w("positionedOffset viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(D,E){E=$(E);try{E.offsetParent}catch(H){return Element._returnOffset(0,0)}var B=E.getStyle("position");if(B!=="static"){return D(E)}var F=E.getOffsetParent();if(F&&F.getStyle("position")==="fixed"){F.setStyle({zoom:1})}E.setStyle({position:"relative"});var G=D(E);E.setStyle({position:B});return G})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(A,B){try{B.offsetParent}catch(D){return Element._returnOffset(0,0)}return A(B)});Element.Methods.getStyle=function(A,B){A=$(A);B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var D=A.style[B];if(!D&&A.currentStyle){D=A.currentStyle[B]}if(B=="opacity"){if(D=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(D[1]){return parseFloat(D[1])/100}}return 1}if(D=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px"}return null}return D};Element.Methods.setOpacity=function(D,F){function G(H){return H.replace(/alpha\([^\)]*\)/gi,"")}D=$(D);var B=D.currentStyle;if((B&&!B.hasLayout)||(!B&&D.style.zoom=="normal")){D.style.zoom=1}var A=D.getStyle("filter"),E=D.style;if(F==1||F===""){(A=G(A))?E.filter=A:E.removeAttribute("filter");return D}else{if(F<0.00001){F=0}}E.filter=G(A)+"alpha(opacity="+(F*100)+")";return D};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(A,B){return A.getAttribute(B,2)},_getAttrNode:function(A,D){var B=A.getAttributeNode(D);return B?B.value:""},_getEv:function(A,B){B=A.getAttribute(B);return B?B.toString().slice(23,-2):null},_flag:function(A,B){return $(A).hasAttribute(B)?B:null},style:function(A){return A.style.cssText.toLowerCase()},title:function(A){return A.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B},style:function(A,B){A.style.cssText=B?B:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;Element._attributeTranslations.has[A.toLowerCase()]=A});(function(A){Object.extend(A,{href:A._getAttr,src:A._getAttr,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv})})(Element._attributeTranslations.read.values)}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName.toUpperCase()=="IMG"&&A.width){A.width++;A.width--}else{try{var E=document.createTextNode(" ");A.appendChild(E);A.removeChild(E)}catch(D){}}}return A};Element.Methods.cumulativeOffset=function(A){var B=0,D=0;do{B+=A.offsetTop||0;D+=A.offsetLeft||0;if(A.offsetParent==document.body){if(Element.getStyle(A,"position")=="absolute"){break}}A=A.offsetParent}while(A);return Element._returnOffset(D,B)}}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(B,D){B=$(B);if(D&&D.toElement){D=D.toElement()}if(Object.isElement(D)){return B.update().insert(D)}D=Object.toHTML(D);var A=B.tagName.toUpperCase();if(A in Element._insertionTranslations.tags){$A(B.childNodes).each(function(E){B.removeChild(E)});Element._getContentFromAnonymousElement(A,D.stripScripts()).each(function(E){B.appendChild(E)})}else{B.innerHTML=D.stripScripts()}D.evalScripts.bind(D).defer();return B}}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(F,G){F=$(F);if(G&&G.toElement){G=G.toElement()}if(Object.isElement(G)){F.parentNode.replaceChild(G,F);return F}G=Object.toHTML(G);var D=F.parentNode,E=D.tagName.toUpperCase();if(Element._insertionTranslations.tags[E]){var B=F.next();var A=Element._getContentFromAnonymousElement(E,G.stripScripts());D.removeChild(F);if(B){A.each(function(H){D.insertBefore(H,B)})}else{A.each(function(H){D.appendChild(H)})}}else{F.outerHTML=G.stripScripts()}G.evalScripts.bind(G).defer();return F}}Element._returnOffset=function(A,B){var D=[A,B];D.left=A;D.top=B;return D};Element._getContentFromAnonymousElement=function(A,D){var E=new Element("div"),B=Element._insertionTranslations.tags[A];if(B){E.innerHTML=B[0]+D+B[1];B[2].times(function(){E=E.firstChild})}else{E.innerHTML=D}return $A(E.childNodes)};Element._insertionTranslations={before:function(A,B){A.parentNode.insertBefore(B,A)},top:function(A,B){A.insertBefore(B,A.firstChild)},bottom:function(A,B){A.appendChild(B)},after:function(A,B){A.parentNode.insertBefore(B,A.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(A,D){D=Element._attributeTranslations.has[D]||D;var B=$(A).getAttributeNode(D);return !!(B&&B.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div")["__proto__"]){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div")["__proto__"];Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var B={},A=Element.Methods.ByTag;var D=Object.extend(function(H){if(!H||H._extendedByPrototype||H.nodeType!=1||H==window){return H}var F=Object.clone(B),G=H.tagName.toUpperCase(),E,I;if(A[G]){Object.extend(F,A[G])}for(E in F){I=F[E];if(Object.isFunction(I)&&!(E in H)){H[E]=I.methodize()}}H._extendedByPrototype=Prototype.emptyFunction;return H},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(B,Element.Methods);Object.extend(B,Element.Methods.Simulated)}}});D.refresh();return D})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B)}return Element.Methods.Simulated.hasAttribute(A,B)};Element.addMethods=function(D){var J=Prototype.BrowserFeatures,E=Element.Methods.ByTag;if(!D){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var H=D;D=arguments[1]}if(!H){Object.extend(Element.Methods,D||{})}else{if(Object.isArray(H)){H.each(A)}else{A(H)}}function A(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={}}Object.extend(Element.Methods.ByTag[F],D)}function B(L,P,O){O=O||false;for(var F in L){var M=L[F];if(!Object.isFunction(M)){continue}if(!O||!(F in P)){P[F]=M.methodize()}}}function G(L){var F;var M={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(M[L]){F="HTML"+M[L]+"Element"}if(window[F]){return window[F]}F="HTML"+L+"Element";if(window[F]){return window[F]}F="HTML"+L.capitalize()+"Element";if(window[F]){return window[F]}window[F]={};window[F].prototype=document.createElement(L)["__proto__"];return window[F]}if(J.ElementExtensions){B(Element.Methods,HTMLElement.prototype);B(Element.Methods.Simulated,HTMLElement.prototype,true)}if(J.SpecificElementExtensions){for(var K in Element.Methods.ByTag){var I=G(K);if(Object.isUndefined(I)){continue}B(E[K],I.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var A={},D=Prototype.Browser;$w("width height").each(function(E){var B=E.capitalize();if(D.WebKit&&!document.evaluate){A[E]=self["inner"+B]}else{if(D.Opera&&parseFloat(window.opera.version())<9.5){A[E]=document.body["client"+B]}else{A[E]=document.documentElement["client"+B]}}});return A},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(A){this.expression=A.strip();if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"}else{if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}}},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false}var A=this.expression;if(Prototype.Browser.WebKit&&(A.include("-of-type")||A.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(A)){return false}return true},shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(A){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var F=this.expression,G=Selector.patterns,B=Selector.xpath,E,A;if(Selector._cache[F]){this.xpath=Selector._cache[F];return}this.matcher=[".//*"];while(F&&E!=F&&(/\S/).test(F)){E=F;for(var D in G){if(A=F.match(G[D])){this.matcher.push(Object.isFunction(B[D])?B[D](A):new Template(B[D]).evaluate(A));F=F.replace(A[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(A){A=A||document;var D=this.expression,B;switch(this.mode){case"selectorsAPI":if(A!==document){var E=A.id,F=$(A).identify();D="#"+F+" "+D}B=$A(A.querySelectorAll(D)).map(Element.extend);A.id=E;return B;case"xpath":return document._getElementsByXPath(this.xpath,A);default:return this.matcher(A)}},match:function(I){this.tokens=[];var M=this.expression,B=Selector.patterns,G=Selector.assertions;var A,E,F;while(M&&A!==M&&(/\S/).test(M)){A=M;for(var J in B){E=B[J];if(F=M.match(E)){if(G[J]){this.tokens.push([J,Object.clone(F)]);M=M.replace(F[0],"")}else{return this.findElements(document).include(I)}}}}var L=true,D,K;for(var J=0,H;H=this.tokens[J];J++){D=H[0],K=H[1];if(!Selector.assertions[D](I,K)){L=false;break}}return L},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return""}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(A){A[1]=A[1].toLowerCase();return new Template("[@#{1}]").evaluate(A)},attr:function(A){A[1]=A[1].toLowerCase();A[3]=A[5]||A[6];return new Template(Selector.xpath.operators[A[2]]).evaluate(A)},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]];if(!B){return""}if(Object.isFunction(B)){return B(A)}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(B){var I=B[6],H=Selector.patterns,A=Selector.xpath,F,D;var G=[];while(I&&F!=I&&(/\S/).test(I)){F=I;for(var E in H){if(B=I.match(H[E])){D=Object.isFunction(A[E])?A[E](B):new Template(A[E]).evaluate(B);G.push("("+D.substring(1,D.length-1)+")");I=I.replace(B[0],"");break}}}return"[not("+G.join(" and ")+")]"},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A)},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A)},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A)},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A)},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A)},"last-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](A)},"only-of-type":function(A){var B=Selector.xpath.pseudos;return B["first-of-type"](A)+B["last-of-type"](A)},nth:function(E,B){var H,G=B[6],F;if(G=="even"){G="2n+0"}if(G=="odd"){G="2n+1"}if(H=G.match(/^(\d+)$/)){return"["+E+"= "+H[1]+"]"}if(H=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(H[1]=="-"){H[1]=-1}var D=H[1]?Number(H[1]):1;var A=H[2]?Number(H[2]):0;F="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(F).evaluate({fragment:E,a:D,b:A})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(A){A[3]=(A[5]||A[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(A)},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[((?:[\w]+:)?[\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase()},className:function(A,B){return Element.hasClassName(A,B[1])},id:function(A,B){return A.id===B[1]},attrPresence:function(A,B){return Element.hasAttribute(A,B[1])},attr:function(B,D){var A=Element.readAttribute(B,D[1]);return A&&Selector.operators[D[2]](A,D[5]||D[6])}},handlers:{concat:function(B,A){for(var D=0,E;E=A[D];D++){B.push(E)}return B},mark:function(A){var E=Prototype.emptyFunction;for(var B=0,D;D=A[B];B++){D._countedByPrototype=E}return A},unmark:function(A){for(var B=0,D;D=A[B];B++){D._countedByPrototype=undefined}return A},index:function(G,D,H){G._countedByPrototype=Prototype.emptyFunction;if(D){for(var A=G.childNodes,E=A.length-1,B=1;E>=0;E--){var F=A[E];if(F.nodeType==1&&(!H||F._countedByPrototype)){F.nodeIndex=B++}}}else{for(var E=0,B=1,A=G.childNodes;F=A[E];E++){if(F.nodeType==1&&(!H||F._countedByPrototype)){F.nodeIndex=B++}}}},unique:function(B){if(B.length==0){return B}var E=[],F;for(var D=0,A=B.length;D<A;D++){if(!(F=B[D])._countedByPrototype){F._countedByPrototype=Prototype.emptyFunction;E.push(Element.extend(F))}}return Selector.handlers.unmark(E)},descendant:function(A){var E=Selector.handlers;for(var D=0,B=[],F;F=A[D];D++){E.concat(B,F.getElementsByTagName("*"))}return B},child:function(A){var F=Selector.handlers;for(var E=0,D=[],G;G=A[E];E++){for(var B=0,H;H=G.childNodes[B];B++){if(H.nodeType==1&&H.tagName!="!"){D.push(H)}}}return D},adjacent:function(A){for(var D=0,B=[],F;F=A[D];D++){var E=this.nextElementSibling(F);if(E){B.push(E)}}return B},laterSibling:function(A){var E=Selector.handlers;for(var D=0,B=[],F;F=A[D];D++){E.concat(B,Element.nextSiblings(F))}return B},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A}}return null},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A}}return null},tagName:function(A,I,G,H){var J=G.toUpperCase();var E=[],F=Selector.handlers;if(A){if(H){if(H=="descendant"){for(var D=0,B;B=A[D];D++){F.concat(E,B.getElementsByTagName(G))}return E}else{A=this[H](A)}if(G=="*"){return A}}for(var D=0,B;B=A[D];D++){if(B.tagName.toUpperCase()===J){E.push(B)}}return E}else{return I.getElementsByTagName(G)}},id:function(D,B,I,A){var H=$(I),F=Selector.handlers;if(!H){return[]}if(!D&&B==document){return[H]}if(D){if(A){if(A=="child"){for(var E=0,G;G=D[E];E++){if(H.parentNode==G){return[H]}}}else{if(A=="descendant"){for(var E=0,G;G=D[E];E++){if(Element.descendantOf(H,G)){return[H]}}}else{if(A=="adjacent"){for(var E=0,G;G=D[E];E++){if(Selector.handlers.previousElementSibling(H)==G){return[H]}}}else{D=F[A](D)}}}}for(var E=0,G;G=D[E];E++){if(G==H){return[H]}}return[]}return(H&&Element.descendantOf(H,B))?[H]:[]},className:function(E,B,D,A){if(E&&A){E=this[A](E)}return Selector.handlers.byClassName(E,B,D)},byClassName:function(D,A,B){if(!D){D=Selector.handlers.descendant([A])}var I=" "+B+" ";for(var F=0,E=[],H,G;H=D[F];F++){G=H.className;if(G.length==0){continue}if(G==B||(" "+G+" ").include(I)){E.push(H)}}return E},attrPresence:function(E,D,A,B){if(!E){E=D.getElementsByTagName("*")}if(E&&B){E=this[B](E)}var G=[];for(var F=0,H;H=E[F];F++){if(Element.hasAttribute(H,A)){G.push(H)}}return G},attr:function(A,J,I,K,H,G){if(!A){A=J.getElementsByTagName("*")}if(A&&G){A=this[G](A)}var L=Selector.operators[H],E=[];for(var D=0,B;B=A[D];D++){var F=Element.readAttribute(B,I);if(F===null){continue}if(L(F,K)){E.push(B)}}return E},pseudo:function(D,E,F,B,A){if(D&&A){D=this[A](D)}if(!D){D=B.getElementsByTagName("*")}return Selector.pseudos[E](D,F,B)}},pseudos:{"first-child":function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(Selector.handlers.previousElementSibling(F)){continue}D.push(F)}return D},"last-child":function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(Selector.handlers.nextElementSibling(F)){continue}D.push(F)}return D},"only-child":function(B,H,A){var F=Selector.handlers;for(var E=0,D=[],G;G=B[E];E++){if(!F.previousElementSibling(G)&&!F.nextElementSibling(G)){D.push(G)}}return D},"nth-child":function(B,D,A){return Selector.pseudos.nth(B,D,A)},"nth-last-child":function(B,D,A){return Selector.pseudos.nth(B,D,A,true)},"nth-of-type":function(B,D,A){return Selector.pseudos.nth(B,D,A,false,true)},"nth-last-of-type":function(B,D,A){return Selector.pseudos.nth(B,D,A,true,true)},"first-of-type":function(B,D,A){return Selector.pseudos.nth(B,"1",A,false,true)},"last-of-type":function(B,D,A){return Selector.pseudos.nth(B,"1",A,true,true)},"only-of-type":function(B,E,A){var D=Selector.pseudos;return D["last-of-type"](D["first-of-type"](B,E,A),E,A)},getIndices:function(B,A,D){if(B==0){return A>0?[A]:[]}return $R(1,D).inject([],function(E,F){if(0==(F-A)%B&&(F-A)/B>=0){E.push(F)}return E})},nth:function(A,B,P,M,L){if(A.length==0){return[]}if(B=="even"){B="2n+0"}if(B=="odd"){B="2n+1"}var K=Selector.handlers,J=[],D=[],F;K.mark(A);for(var I=0,E;E=A[I];I++){if(!E.parentNode._countedByPrototype){K.index(E.parentNode,M,L);D.push(E.parentNode)}}if(B.match(/^\d+$/)){B=Number(B);for(var I=0,E;E=A[I];I++){if(E.nodeIndex==B){J.push(E)}}}else{if(F=B.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(F[1]=="-"){F[1]=-1}var Q=F[1]?Number(F[1]):1;var O=F[2]?Number(F[2]):0;var S=Selector.pseudos.getIndices(Q,O,A.length);for(var I=0,E,G=S.length;E=A[I];I++){for(var H=0;H<G;H++){if(E.nodeIndex==S[H]){J.push(E)}}}}}K.unmark(A);K.unmark(D);return J},empty:function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(F.tagName=="!"||F.firstChild){continue}D.push(F)}return D},not:function(A,E,J){var H=Selector.handlers,K,D;var I=new Selector(E).findElements(J);H.mark(I);for(var G=0,F=[],B;B=A[G];G++){if(!B._countedByPrototype){F.push(B)}}H.unmark(I);return F},enabled:function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(!F.disabled&&(!F.type||F.type!=="hidden")){D.push(F)}}return D},disabled:function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(F.disabled){D.push(F)}}return D},checked:function(B,G,A){for(var E=0,D=[],F;F=B[E];E++){if(F.checked){D.push(F)}}return D}},operators:{"=":function(B,A){return B==A},"!=":function(B,A){return B!=A},"^=":function(B,A){return B==A||B&&B.startsWith(A)},"$=":function(B,A){return B==A||B&&B.endsWith(A)},"*=":function(B,A){return B==A||B&&B.include(A)},"$=":function(B,A){return B.endsWith(A)},"*=":function(B,A){return B.include(A)},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ")},"|=":function(B,A){return("-"+(B||"").toUpperCase()+"-").include("-"+(A||"").toUpperCase()+"-")}},split:function(B){var A=[];B.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(D){A.push(D[1].strip())});return A},matchElements:function(A,H){var G=$$(H),F=Selector.handlers;F.mark(G);for(var E=0,D=[],B;B=A[E];E++){if(B._countedByPrototype){D.push(B)}}F.unmark(G);return D},findElement:function(A,D,B){if(Object.isNumber(D)){B=D;D=false}return Selector.matchElements(A,D||"*")[B||0]},findChildElements:function(D,H){H=Selector.split(H.join(","));var F=[],G=Selector.handlers;for(var E=0,B=H.length,A;E<B;E++){A=new Selector(H[E].strip());G.concat(F,A.findElements(D))}return(B>1)?G.unique(F):F}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(B,A){for(var D=0,E;E=A[D];D++){if(E.tagName!=="!"){B.push(E)}}return B},unmark:function(A){for(var B=0,D;D=A[B];B++){D.removeAttribute("_countedByPrototype")}return A}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){$(A).reset();return A},serializeElements:function(D,F){if(typeof F!="object"){F={hash:!!F}}else{if(Object.isUndefined(F.hash)){F.hash=true}}var E,H,B=false,A=F.submit;var G=D.inject({},function(J,I){if(!I.disabled&&I.name){E=I.name;H=$(I).getValue();if(H!=null&&I.type!="file"&&(I.type!="submit"||(!B&&A!==false&&(!A||E==A)&&(B=true)))){if(E in J){if(!Object.isArray(J[E])){J[E]=[J[E]]}J[E].push(H)}else{J[E]=H}}}return J});return F.hash?G:Object.toQueryString(G)}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A)},getElements:function(A){return $A($(A).getElementsByTagName("*")).inject([],function(B,D){if(Form.Element.Serializers[D.tagName.toLowerCase()]){B.push(Element.extend(D))}return B})},getInputs:function(H,F,D){H=$(H);var G=H.getElementsByTagName("input");if(!F&&!D){return $A(G).map(Element.extend)}for(var E=0,I=[],A=G.length;E<A;E++){var B=G[E];if((F&&B.type!=F)||(D&&B.name!=D)){continue}I.push(Element.extend(B))}return I},disable:function(A){A=$(A);Form.getElements(A).invoke("disable");return A},enable:function(A){A=$(A);Form.getElements(A).invoke("enable");return A},findFirstElement:function(D){var A=$(D).getElements().findAll(function(E){return"hidden"!=E.type&&!E.disabled});var B=A.findAll(function(E){return E.hasAttribute("tabIndex")&&E.tabIndex>=0}).sortBy(function(E){return E.tabIndex}).first();return B?B:A.find(function(E){return["input","select","textarea"].include(E.tagName.toLowerCase())})},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A},request:function(D,B){D=$(D),B=Object.clone(B||{});var E=B.parameters,A=D.readAttribute("action")||"";if(A.blank()){A=window.location.href}B.parameters=D.serialize(true);if(E){if(Object.isString(E)){E=E.toQueryParams()}Object.extend(B.parameters,E)}if(D.hasAttribute("method")&&!B.method){B.method=D.method}return new Ajax.Request(A,B)}};Form.Element={focus:function(A){$(A).focus();return A},select:function(A){$(A).select();return A}};Form.Element.Methods={serialize:function(A){A=$(A);if(!A.disabled&&A.name){var B=A.getValue();if(B!=undefined){var D={};D[A.name]=B;return Object.toQueryString(D)}}return""},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A)},setValue:function(A,B){A=$(A);var D=A.tagName.toLowerCase();Form.Element.Serializers[D](A,B);return A},clear:function(A){$(A).value="";return A},present:function(A){return $(A).value!=""},activate:function(A){A=$(A);try{A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(A.type))){A.select()}}catch(B){}return A},disable:function(A){A=$(A);A.disabled=true;return A},enable:function(A){A=$(A);A.disabled=false;return A}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);default:return Form.Element.Serializers.textarea(A,B)}},inputSelector:function(A,B){if(Object.isUndefined(B)){return A.checked?A.value:null}else{A.checked=!!B}},textarea:function(A,B){if(Object.isUndefined(B)){return A.value}else{A.value=B}},select:function(B,G){if(Object.isUndefined(G)){return this[B.type=="select-one"?"selectOne":"selectMany"](B)}else{var E,F,H=!Object.isArray(G);for(var D=0,A=B.length;D<A;D++){E=B.options[D];F=this.optionValue(E);if(H){if(F==G){E.selected=true;return}}else{E.selected=G.include(F)}}}},selectOne:function(B){var A=B.selectedIndex;return A>=0?this.optionValue(B.options[A]):null},selectMany:function(B){var F,A=B.length;if(!A){return null}for(var E=0,F=[];E<A;E++){var D=B.options[E];if(D.selected){F.push(this.optionValue(D))}}return F},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,D,B){$super(B,D);this.element=$(A);this.lastValue=this.getValue()},execute:function(){var A=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A);this.lastValue=A}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event={}}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(B){var A;switch(B.type){case"mouseover":A=B.fromElement;break;case"mouseout":A=B.toElement;break;default:return null}return Element.extend(A)}});Event.Methods=(function(){var B;if(Prototype.Browser.IE){var A={0:1,1:4,2:2};B=function(E,D){return E.button==A[D]}}else{if(Prototype.Browser.WebKit){B=function(E,D){switch(D){case 0:return E.which==1&&!E.metaKey;case 1:return E.which==1&&E.metaKey;default:return false}}}else{B=function(E,D){return E.which?(E.which===D+1):(E.button===D)}}}return{isLeftClick:function(D){return B(D,0)},isMiddleClick:function(D){return B(D,1)},isRightClick:function(D){return B(D,2)},element:function(F){F=Event.extend(F);var E=F.target,D=F.type,G=F.currentTarget;if(G&&G.tagName){if(D==="load"||D==="error"||(D==="click"&&G.tagName.toLowerCase()==="input"&&G.type==="radio")){E=G}}if(E.nodeType==Node.TEXT_NODE){E=E.parentNode}return Element.extend(E)},findElement:function(F,G){var E=Event.element(F);if(!G){return E}var D=[E].concat(E.ancestors());return Selector.findElement(D,G,0)},pointer:function(F){var E=document.documentElement,D=document.body||{scrollLeft:0,scrollTop:0};return{x:F.pageX||(F.clientX+(E.scrollLeft||D.scrollLeft)-(E.clientLeft||0)),y:F.pageY||(F.clientY+(E.scrollTop||D.scrollTop)-(E.clientTop||0))}},pointerX:function(D){return Event.pointer(D).x},pointerY:function(D){return Event.pointer(D).y},stop:function(D){Event.extend(D);D.preventDefault();D.stopPropagation();D.stopped=true}}})();Event.extend=(function(){var A=Object.keys(Event.Methods).inject({},function(B,D){B[D]=Event.Methods[D].methodize();return B});if(Prototype.Browser.IE){Object.extend(A,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(B){if(!B){return false}if(B._extendedByPrototype){return B}B._extendedByPrototype=Prototype.emptyFunction;var D=Event.pointer(B);Object.extend(B,{target:B.srcElement,relatedTarget:Event.relatedTarget(B),pageX:D.x,pageY:D.y});return Object.extend(B,A)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents")["__proto__"];Object.extend(Event.prototype,A);return Prototype.K}})();Object.extend(Event,(function(){var A=Event.cache;function E(K){if(K._prototypeEventID){return K._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return K._prototypeEventID=[++arguments.callee.id]}function F(K){if(K&&K.include(":")){return"dataavailable"}return K}function H(K){return A[K]=A[K]||{}}function G(M,K){var L=H(M);return L[K]=L[K]||[]}function J(L,K,M){var Q=E(L);var P=G(Q,K);if(P.pluck("handler").include(M)){return false}var O=function(S){if(!Event||!Event.extend||(S.eventName&&S.eventName!=K)){return false}Event.extend(S);M.call(L,S)};O.handler=M;P.push(O);return O}function I(O,K,L){var M=G(O,K);return M.find(function(P){return P.handler==L})}function B(O,K,L){var M=H(O);if(!M[K]){return false}M[K]=M[K].without(I(O,K,L))}function D(){for(var L in A){for(var K in A[L]){A[L][K]=null}}}if(window.attachEvent){window.attachEvent("onunload",D)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}return{observe:function(M,K,O){M=$(M);var L=F(K);var P=J(M,K,O);if(!P){return M}if(M.addEventListener){M.addEventListener(L,P,false)}else{M.attachEvent("on"+L,P)}return M},stopObserving:function(M,K,O){M=$(M);var Q=E(M),L=F(K);if(!O&&K){G(Q,K).each(function(S){M.stopObserving(K,S.handler)});return M}else{if(!K){Object.keys(H(Q)).each(function(S){M.stopObserving(S)});return M}}var P=I(Q,K,O);if(!P){return M}if(M.removeEventListener){M.removeEventListener(L,P,false)}else{M.detachEvent("on"+L,P)}B(Q,K,O);return M},fire:function(M,L,K){M=$(M);if(M==document&&document.createEvent&&!M.dispatchEvent){M=document.documentElement}var O;if(document.createEvent){O=document.createEvent("HTMLEvents");O.initEvent("dataavailable",true,true)}else{O=document.createEventObject();O.eventType="ondataavailable"}O.eventName=L;O.memo=K||{};if(document.createEvent){M.dispatchEvent(O)}else{M.fireEvent(O.eventType,O)}return Event.extend(O)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var B;function A(){if(document.loaded){return}if(B){window.clearInterval(B)}document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){B=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){A()}},0);Event.observe(window,"load",A)}else{document.addEventListener("DOMContentLoaded",A,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;A()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(A,B){return Element.insert(A,{before:B})},Top:function(A,B){return Element.insert(A,{top:B})},Bottom:function(A,B){return Element.insert(A,{bottom:B})},After:function(A,B){return Element.insert(A,{after:B})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(B,A,D){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,D)}this.xcomp=A;this.ycomp=D;this.offset=Element.cumulativeOffset(B);return(D>=this.offset[1]&&D<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,E){var D=Element.cumulativeScrollOffset(B);this.xcomp=A+D[0]-this.deltaX;this.ycomp=E+D[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth)},overlap:function(B,A){if(!B){return 0}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();return Element.absolutize(A)},relativize:function(A){Position.prepare();return Element.relativize(A)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(A,D,B){B=B||{};return Element.clonePosition(D,A,B)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(D){return D.blank()?null:"[contains(concat(' ', @class, ' '), ' "+D+" ')]"}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(E,D){D=D.toString().strip();var F=/\s/.test(D)?$w(D).map(A).join(""):A(D);return F?document._getElementsByXPath(".//*"+F,E):[]}:function(G,F){F=F.toString().strip();var D=[],I=(/\s/.test(F)?$w(F):null);if(!I&&!F){return D}var E=$(G).getElementsByTagName("*");F=" "+F+" ";for(var H=0,K,J;K=E[H];H++){if(K.className&&(J=" "+K.className+" ")&&(J.include(F)||(I&&I.all(function(L){return !L.toString().blank()&&J.include(" "+L+" ")})))){D.push(Element.extend(K))}}return D};return function(D,E){return $(E||document.body).getElementsByClassName(D)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(A){this.element=$(A)},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0})._each(A)},set:function(A){this.element.className=A},add:function(A){if(this.include(A)){return}this.set($A(this).concat(A).join(" "))},remove:function(A){if(!this.include(A)){return}this.set($A(this).without(A).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();Element.exception=undefined;if(Prototype.Browser.IE&&/MSIE\s8\.0/.test(navigator.userAgent)){Element.addMethods({readAttribute:function(B,A){B=$(B);return B.getAttribute(A)}});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}}}Element.addMethods({getElementsByTagAndClass:function(D,A){var B=arguments[0];var D=arguments[1];var A=arguments[2];var E=B.getElementsByTagName(D);return $A(E).inject([],function(G,F){if(F.className.match(new RegExp("(^|\\s)"+A+"(\\s|$)"))){G.push(Element.extend(F))}return G})},getNthElementByClassName:function(){if(arguments.length<3){return Element.exception}var E=arguments[0];var B=arguments[1];var A=parseInt(arguments[2]);var D=(arguments[3]?arguments[3]:"*");if(isNaN(A)){return Element.exception}var G=$A((E||document.body).getElementsByTagName(D));if(A==0){return Element.exception}else{if(A<0){G.reverse(true);A=Math.abs(A)}}var H=0;var I=null;for(var F=0;F<G.length;F++){if(G[F].className.match(new RegExp("(^|\\s)"+B+"(\\s|$)"))){H++;if(H==A){I=Element.extend(G[F]);break}}}return I},getFirstElementByClassName:function(){var D=arguments[0];var A=arguments[1];var B=arguments[2];if(B){return D.getNthElementByClassName(A,1,B)}else{return D.getNthElementByClassName(A,1)}},getLastElementByClassName:function(){var D=arguments[0];var A=arguments[1];var B=arguments[2];if(B){return D.getNthElementByClassName(A,-1,B)}else{return D.getNthElementByClassName(A,-1)}},containsElementWithClassName:function(){if(arguments.length<2){return null}var D=arguments[0];var A=arguments[1];var B=arguments[2];var E=null;if(B){E=D.getNthElementByClassName(A,1,arguments[2])}else{E=D.getNthElementByClassName(A,1)}if(E){return true}else{return false}},getElementsByAttribute:function(){if(arguments.length<2){return null}var D=arguments[0];var G=arguments[1];if(G.toLowerCase()=="class"||G.toLowerCase()=="classname"){log.error("getElementsByAttribute does not support 'class' or 'className' as the attribute parameter");return null}var B=D.getElementsByTagName(arguments[2]||"*");var F=$A();var H=B.length;for(var E=0;E<H;E++){var A=B[E];if(A.getAttribute(G)){F.push(Element.extend(A))}}return F},getParentByTagName:function(){var D=$A(arguments),B=D.shift(),A=D[0].toUpperCase();while(B.parentNode){if(B.tagName==A){return Element.extend(B)}B=B.parentNode}return null},getParentByClassName:function(){var D=$A(arguments),B=D.shift(),A=D[0];while(B.tagName!="HTML"){if(B.hasClassName(A)){return Element.extend(B)}B=$(B.parentNode)}return null},toggleClasses:function(E,D){var B=$A(arguments),A=B.shift();if(Element.hasClassName(A,B[0])){Element.removeClassName(A,B[0]),Element.addClassName(A,B[1])}else{if(Element.hasClassName(A,B[1])){Element.removeClassName(A,B[1]),Element.addClassName(A,B[0])}}},visibleByClass:function(){var A=arguments[0];var B=true;if(A.hasClassName("noneTableRow")||A.hasClassName("noneTableRowGroup")||A.hasClassName("noneBlock")||A.hasClassName("noneInline")||A.hasClassName("hidden")||(A.style.display=="none")||(A.style.visibility=="hidden")){B=false}return B},hideByClass:function(){for(var B=0;B<arguments.length;B++){var A=$(arguments[B]);if(A.visibleByClass()){if(A.hasClassName("tableRow")){A.removeClassName("tableRow");A.addClassName("noneTableRow")}else{if(A.hasClassName("tableRowGroup")){A.removeClassName("tableRowGroup");A.addClassName("noneTableRowGroup")}else{if(A.hasClassName("block")){A.removeClassName("block");A.addClassName("noneBlock")}else{if(A.hasClassName("inline")){A.removeClassName("inline");A.addClassName("noneInline")}else{if(A.hasClassName("visible")){A.removeClassName("visible");A.addClassName("hidden")}else{log.error("hideByClass(): missing required class for "+A)}}}}}}else{log.warning(A+" already hidden")}}if(arguments.length==1){return $(arguments[0])}},showByClass:function(){for(var B=0;B<arguments.length;B++){var A=$(arguments[B]);if(!A.visibleByClass()){if(A.hasClassName("noneTableRow")){A.removeClassName("noneTableRow");A.addClassName("tableRow")}else{if(A.hasClassName("noneTableRowGroup")){A.removeClassName("noneTableRowGroup");A.addClassName("tableRowGroup")}else{if(A.hasClassName("noneBlock")){A.removeClassName("noneBlock");A.addClassName("block")}else{if(A.hasClassName("noneInline")){A.removeClassName("noneInline");A.addClassName("inline")}else{if(A.hasClassName("hidden")){A.removeClassName("hidden");A.addClassName("visible")}else{log.error("showByClass(): missing required class for "+A)}}}}}}else{log.warning(A+" already visible")}}if(arguments.length==1){return $(arguments[0])}},toggleByClass:function(){for(var B=0;B<arguments.length;B++){var A=$(arguments[B]);if(A.visibleByClass()){A.hideByClass()}else{A.showByClass()}}},getParams:function(){var result="null";var element=arguments[0];this.params=null;var attr=(arguments[1]||"params");if(typeof(element)=="object"&&element.getAttribute(attr)){var jsonRaw=element.getAttribute(attr);var convertedString=jsonRaw.unescapeJSON();try{result=eval("({"+convertedString+"})")}catch(error){Errors.capture(error,"Error converting attributes to json object  ["+convertedString+"]")}return result}},getAgents:function(){var result;var element=arguments[0];this.params=null;if(typeof(element)=="object"&&element.getAttribute("agent")){var jsonRaw=element.getAttribute("agent");var convertedString=jsonRaw.unescapeJSON();try{result=eval("(["+convertedString+"])")}catch(error){Errors.capture(error,"Error converting attributes to json object  ["+convertedString+"]")}return result}},getPosition:function(){var B=arguments[0];var A=Position.cumulativeOffset(B);return{x:A[0],y:A[1],units:"px"}},getPositionOffset:function(A){return Position.delta(arguments[0],arguments[1])},destroy:function(){var A=$(arguments[0]);if(A){if(A.innerHTML){A.innerHTML=""}if(A.parentNode){A.parentNode.removeChild(A)}else{log.warning("Element.destroy(): no parent node - element not in DOM?")}}return null},updateAndFocus:function(E){log.debug("updateAndFocus - updating");var D=arguments[0];var F=arguments[1]?arguments[1]:1000;if(D){var B=function(){if(this&&this.parentNode&&(this.parentNode.nodeType===1)){log.debug("updateAndFocus - setting focus: "+this);this.focus()}else{log.warning("Element.updateAndFocus(): attempting to focus on a node that is not nodeType 1 (ELEMENT_NODE).Target of focus was probably removed from the document during the delay")}}.bind(D);if(window.virtualBufferManager){window.virtualBufferManager.update();clearTimeout(window.virtualBufferManager.timeout)}else{log.error("Element.updateAndFocus(): virtualBufferManager does not exist!")}var A=setTimeout(B,F);if(window.virtualBufferManager){window.virtualBufferManager.timeout=A}return A}else{log.error("Element.updateAndFocus must have an element to operate on!")}},isDOMReady:function(){var A=function(B){if(B.nextSibling){return true}else{if(B.nodeName=="HTML"){return false}else{return A(B.parentNode)}}};if(Page.isDOMReady){return true}else{return A(arguments[0])}}});String.prototype.unescapeJSON=function(){var A=this.toString();A=A.replace(/!#/,"{");A=A.replace(/#!/,"}");A=A.replace(/\r\n/g," ");A=A.replace(/\r/g," ");A=A.replace(/\n/g," ");A=A.replace(/'\s*/g,"'");A=A.replace(/'\s*(,|$|}|])/gm,"QUOTE_CONSTANT$1");A=A.replace(/((\[|:|,)\s*)'/mg,"$1QUOTE_CONSTANT");A=A.replace(/'/gm,"\\'");A=A.replace(/QUOTE_CONSTANT/gm,"'");A=A.replace(/models\['([^']*)']/g,"models[\\'$1\\']");return A};String.prototype.escapeRegex=function(){return this.toString().replace(/([\[|\\|\^|\$|\.|\||\?|\*|\+|\(|\)])/gm,"\\$1")};Form.HiddenField={add:function(B,A,E){var D=document.createElement("INPUT");D.setAttribute("name",A);D.setAttribute("type","hidden");D.setAttribute("value",E);log.debug("adding hidden field:"+A+":"+E);B.appendChild(D)}};Form.Element.resetValue=function(B){var A=B.getElementsByTagName("select")[0];if(A){A.selectedIndex=0}var E=B.getElementsByTagName("input");if(E){for(var D=0;E[D];D++){switch(E[D].type){case"radio":case"checkbox":E[D].checked=false;break;case"text":case"password":E[D].value="";break}}}};Object.extend(String.prototype,{stripNoScripts:function(){return this.replace(new RegExp("(?:<noscript.*?>)((\n|\r|.)*?)(?:</noscript>)","img"),"")},upperCaseFirst:function(){var A=this.substr(0,1).toUpperCase();return this.substr(0,1).toUpperCase()+this.substr(1,this.length)},unescapeXML:function(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#039;/g,"'").replace(/&#034;/g,'"').replace(/&amp;/g,"&")}});Date.prototype.getShortYear=function(){var A=new String(this.getFullYear());return A.substring(2)};Function.prototype.bindAsEventListener=function(B){var D=this,A=$A(arguments),B=A.shift();return function(E){return D.apply(B,[(E||window.event)].concat(A).concat($A(arguments)))}};Object.extend(Event,{_domReady:function(){if(arguments.callee.done){return}arguments.callee.done=true;if(this._timer){clearInterval(this._timer)}this._readyCallbacks.each(function(A){A()});this._readyCallbacks=null},onDOMReady:function(f){if(!this._readyCallbacks){var domReady=this._domReady.bind(this);if(document.addEventListener){document.addEventListener("DOMContentLoaded",domReady,false);
/*@cc_on @*/
/*@if (@_win32)
				  document.write("<script id=__ie_onload defer src=/script/empty.js><\/script>");
				  document.getElementById("__ie_onload").onreadystatechange = function() {
					if (this.readyState == "complete") domReady();
				  };
				  /*@end @*/
}if(/WebKit/i.test(navigator.userAgent)){this._timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){domReady()}},10)}Event.observe(window,"load",domReady);Event._readyCallbacks=[]}Event._readyCallbacks.push(f)},findElementByTagName:function(D,B){var A=Event.element(D);while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode}return A}});var Units={PX_TO_EM:12,EM_TO_PX:1/12,TYPE:"px"};Position.putInViewport=function(A,G){var F=Position.calculateViewport();var J=Position.calculateScroll();var D=Position.calculatePageHeight();G.dim=G.getDimensions();G.pos=G.getPosition();A.pos=Position.cumulativeOffset(A);A.dim=A.getDimensions();A.pos=A.getPosition();var B=A.pos.x-G.dim.width;if(A.pos.x+A.dim.width+G.dim.width<=F.width||B<=0){B=A.dim.width+A.pos.x}var I=(parseInt(J.x)+F.width-(B+G.dim.width)>=0);if(Units.TYPE=="em"){B=B/Units.PX_TO_EM}G.setStyle({left:B+Units.TYPE});F=Position.calculateViewport();var H=A.pos.y+(A.dim.height/2);if(F.height<G.dim.height||parseInt(J.y)-H>=0){H=parseInt(J.y)}else{if(H+G.dim.height>=parseInt(J.y)+F.height){H=H-(H+G.dim.height-(parseInt(J.y)+F.height))}}var E=(parseInt(J.y)+F.height-(H+G.dim.height)>=0);if(Units.TYPE=="em"){H=H/Units.PX_TO_EM}G.setStyle({top:H+Units.TYPE});return{x:B,y:H,inViewport:(I&&E),units:Units.TYPE}};Position.delta=function(A,B){A.pos=A.getPosition();B.pos=B.getPosition();return{x:(B.pos.x-A.pos.x),y:(B.pos.y-A.pos.y),units:"px"}};Position.calculatePageHeight=function(){var A=0;if(document.documentElement.scrollHeight>document.documentElement.offsetHeight){A=document.documentElement.scrollHeight}else{A=document.documentElement.offsetHeight}return{height:A,units:"px"}};Position.calculateScroll=function(){var B=0,A=0;if(window.pageYOffset&&window.pageXOffset){B=window.pageYOffset;A=window.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){B=document.documentElement.scrollTop;A=document.documentElement.scrollLeft}else{if(document.body){B=document.body.scrollTop;A=document.body.scrollLeft}}}return{x:A,y:B,units:"px"}};Position.calculateViewport=function(){var D=document.documentElement;var B=window.innerHeight;var A=window.innerWidth;if(B!=null&&D.clientHeight!=null){B=(D.clientHeight<B&&D.clientHeight>0)?D.clientHeight:B;A=(D.clientWidth<window.innerWidth&&D.clientWidth>0)?D.clientWidth:A}else{if(D&&D.clientHeight){B=D.clientHeight;A=D.clientWidth}else{if(document.body){B=document.body.clientHeight;A=document.body.clientWidth}}}return{height:B,width:A,units:"px"}};Position.cumulativeOffset=function(A){var B=Element.extend(A);var E=0,F=0;do{if(Element.getStyle(B,"position")=="fixed"){var D=Position.calculateScroll();E+=D.y+B.offsetTop;F+=D.x+B.offsetLeft;B=null}else{E+=B.offsetTop||0;F+=B.offsetLeft||0;B=$(B.offsetParent)}}while(B);return[F,E]};Ajax.Request.prototype.abort=function(){this.transport.onreadystatechange=Prototype.emptyFunction;this.transport.abort();Ajax.activeRequestCount--};Ajax.PartialRequest=function(A,B){try{var E=function(){var G=A.split("?")[1];var F=B.parameters;if(typeof F!="undefined"&&typeof G!="undefined"){throw new Error("Cannot resolve both parameters and queryString in Ajax.PartialRequest. Must choose either parameters or querystring.")}if(typeof F=="undefined"&&typeof G=="undefined"){return""}return F||G}();if(!E.match(/req=partial/)){var E=E.split("&");E.push("rep=partial");E=E.join("&")}B.parameters=E;new Ajax.Request(A.split("?")[0],B)}catch(D){Errors.capture(D)}};var ManagedEventObservers=Class.create();ManagedEventObservers.prototype={initialize:function(){this.observers=$A()},add:function(A,B,E,D){if(arguments.length>=3){A=$(A);D=D||false;Event.observe(A,B,E,D);this.observers.push([A,B,E,D])}else{throw new Error("ManagedEventObservers.add(): too few parameters")}},getFirstTriggerElement:function(){if(this.observers[0]){return this.observers[0][0]}else{return null}},remove:function(A){if($(A)){for(var B=0;B<this.observers.length;B++){if(this.observers[B][0]==A){Event.stopObserving.apply(this,this.observers[B]);this.observers[B][0]=null;this.observers.splice(B)}}}},clear:function(){for(var A=0;A<this.observers.length;A++){Event.stopObserving.apply(this,this.observers[A]);this.observers[A][0]=null}this.observers.clear();return null},isWatchingElement:function(A){var D=false;if($(A)){for(var B=0;B<this.observers.length;B++){if(this.observers[B][0]==A){D=true}}}return D}};var virtualBufferManager={initialize:function(){var A=document.createElement("input");A.type="hidden";A.name="virtualBufferHiddenField";A.value="0";this.hiddenField=document.body.appendChild(A);log.debug("virtualBufferManager initialized")},update:function(){if(this.hiddenField){if(this.hiddenField.value==="0"){this.hiddenField.value="1"}else{this.hiddenField.value="0"}log.debug("virtualBufferManager.update: "+this.hiddenField.value)}else{log.error("virtualBufferManager has not been initialized, it should have been")}}};Event.onDOMReady(window.virtualBufferManager.initialize.bind(virtualBufferManager));var Profiler={items:{},start:function(A){this.items[A]=new Object();this.items[A].startTime=new Date()},stop:function(A){if(this.items[A]){this.items[A].endTime=new Date();this.log(A)}else{log.warning("No profiler of label: "+A+" was found")}},log:function(A){this.items[A].elapsedTime=((this.items[A].endTime-this.items[A].startTime)/1000);if(this.items[A].elapsedTime==undefined){this.items[A].elapsedTime=0}var B=(A+" elapsedTime: "+this.items[A].elapsedTime+" secs");if(this.items[A].elapsedTime>=0.1){log.warning(B)}else{log.debug(B)}},toString:function(){var A=["latency profile"];for(props in this.items){A.push(props+":"+Profiler.items[props].elapsedTime)}return A.join(",\n")}};var log=new function(){this.debug=function(){};this.info=function(){};this.warning=function(){};this.error=function(){}};var Errors={list:[],capture:function(B){var A=$A(arguments),F=A.shift();var G=["name","message","description","number","fileName","sourceURL","lineNumber","line"];var E=A;for(var D=0;D<G.length;D++){if(F[G[D]]!==undefined){E.push(G[D]+":"+F[G[D]])}}if(B.message&&B.message=="Object doesn't support this property or method"){log.error("If IE only, this error often means that you are trying to use prototype.js Element extensions (eg: .getElementByClassName) on a non-extended element")}this.list.push(E);log.error(""+E.join(",\n"))},toString:function(){if(this.list.length>0){var B=["JavaScript Error"];for(var A=0;A<this.list.length;A++){B.push(this.list[A])}return B.join("")}}};var Inspector={unpack:function(A){result=[];for(prop in A){result.push(prop+":"+A[prop])}return result.join("\n")}};var report=function(A){window.open("","report").document.write("<pre>"+A+"</pre>")};String.prototype.deleteQueryStringParam=function(E,D){var B=new RegExp("^&|&$","g");var A=new RegExp("&&","g");String.prototype.deleteQueryStringParam=function(I,G){var F=I+(G===true?"[^&]*":"=[^&]*");var H=new RegExp(F,"g");return this.replace(H,"").replace(A,"&").replace(B,"")};return this.deleteQueryStringParam(E,D)};var $QS=QueryString=function(A){A=A.replace(/&amp;/,"&");var B=A.split("&");return{addParam:function(F){for(var E=0,D=arguments.length;E<D;E++){B.push(arguments[E])}B=B.uniq();return this},removeParam:function(F){for(var E=0,D=arguments.length;E<D;E++){B=B.without(arguments[E])}return this},toString:function(){return B.join("&")}}};var GoogleMapAPILoader={callbacks:[],loading:false,load:function(B){if(B){this.callbacks.push(B)}if(this.loading){return}this.loading=true;var A=document.createElement("SCRIPT");A.type="text/javascript";A.language="JavaScript";A.src="/helper/googleMapAPILoader";document.getElementsByTagName("HEAD")[0].appendChild(A)},loaded:function(A){if(A){A()}},callback:function(){this.load=this.loaded;while(this.callbacks.length){(this.callbacks.shift())()}}};var DialogManager=Class.create({initialize:function(A){this.dialogs=$A();this.$element=Element.extend(A);this.openListener=this.dialogOpen.bindAsEventListener(this);this.$element.observe("dialog:dialogOpen",this.openListener)},close:function(){this.dialogs.each(function(A){A.close()});this.dialogs.clear()},dialogOpen:function(A){if(A&&A.memo&&A.memo.dialog){this.dialogs.push(A.memo.dialog)}},destroy:function(){this.close();this.dialogs=null;this.$element.stopObserving("dialog:dialogOpen",this.openListener);this.$element=null}});var Dialog={};Dialog.Base={version:"Dialog 1.5",setProperties:function(B,D,A){this.type=B;this.content=D;this.triggerContext;this.options={anchorName:"",triggerEvent:"click",closeLabel:"",topBoundaryText:"",bottomBoundaryText:"",wrapLinkText:"",sessionTimeoutUrl:"",closeElements:$A(),classes:"",hasCustomPositioningContext:false,setUp:function(){},tearDown:function(){}};Object.extend(this.options,A||{});this.isOpen=false;this.activated=false;this.layoutBuilt=false;this.triggers=new ManagedEventObservers();this.managedEventObservers=new ManagedEventObservers();this.closeEventObservers=new ManagedEventObservers()},createMarkup:function(){log.error("You have not defined createMarkup() for your "+this.type+" object.")},showDialog:function(){log.error("You have not defined showDialog() for your "+this.type+" object.")},positionInViewport:function(){log.error("You have not defined positionInViewport() for your "+this.type+" object.")},open:function(A){log.error("You have not defined open() for your "+this.type+" object.")},close:function(A){log.error("You have not defined close() for your "+this.type+" object.")},createDialogDivs:function(){log.debug("createDialogDivs");this.markup={dialogWrapper:new Element("div",{"class":"dialogWrapper "+this.type.toLowerCase()+" "+this.options.classes}),topBoundary:new Element("p",{"class":"offscreen"}),bottomBoundary:new Element("p",{"class":"offscreen"}),dialogAnchor:new Element("a",{"class":"dialogAnchor"}),top:new Element("div",{"class":"dialogTop"}),main:new Element("div",{"class":"dialogMain"}),bottom:new Element("div",{"class":"dialogBottom"}),topLeft:new Element("div",{"class":"dialogTopLeft"}),topRight:new Element("div",{"class":"dialogTopRight"}),topCloseLink:new Element("a",{"class":"dialogTopCloseLink dialogCloseLink",href:"javascript:void(0);",tabIndex:"-1"}),mainRight:new Element("div",{"class":"dialogMainRight"}),mainContent:new Element("div",{"class":"dialogMainContent"}),mainInfo:new Element("div",{"class":"dialogMainInfo"}),dialogTitle:new Element("div",{"class":"dialogTitle"}),dialogTitleH3:new Element("h3"),bottomContent:new Element("div",{"class":"dialogBottomContent"}),bottomLeft:new Element("div",{"class":"dialogBottomLeft"}),bottomRight:new Element("div",{"class":"dialogBottomRight"}),bottomCloseLink:new Element("a",{"class":"dialogBottomCloseLink dialogCloseLink offscreen",href:"javascript:void(0);",tabIndex:"-1"}),wrapLink:new Element("a",{"class":"dialogWrapLink offscreen"})};if(this.options.id){this.markup.dialogWrapper.id=this.options.id}this.markup.topCloseLink.innerHTML=this.options.closeLabel;this.options.closeElements.push(this.markup.topCloseLink);this.markup.bottomCloseLink.innerHTML=this.options.closeLabel;this.options.closeElements.push(this.markup.bottomCloseLink);this.markup.topBoundary.innerHTML=this.options.topBoundaryText;this.markup.dialogWrapper.appendChild(this.markup.topBoundary);if(this.options.anchorName!==""){this.markup.dialogAnchor.name="_"+this.options.anchorName;this.markup.dialogAnchor.tabIndex="-1";this.markup.dialogWrapper.appendChild(this.markup.dialogAnchor);this.markup.wrapLink.tabIndex="-1";this.markup.wrapLink.href="#"+this.markup.dialogAnchor.name;this.markup.wrapLink.innerHTML=this.options.wrapLinkText}this.markup.dialogWrapper.appendChild(this.markup.top);this.markup.dialogWrapper.appendChild(this.markup.main);this.markup.dialogWrapper.appendChild(this.markup.bottom);this.markup.dialogWrapper.appendChild(this.markup.wrapLink);this.markup.bottomBoundary.innerHTML=this.options.bottomBoundaryText;this.markup.dialogWrapper.appendChild(this.markup.bottomBoundary);this.markup.top.appendChild(this.markup.topLeft);this.markup.top.appendChild(this.markup.topRight);this.markup.main.appendChild(this.markup.mainRight);this.markup.mainRight.appendChild(this.markup.mainContent);this.markup.mainContent.appendChild(this.markup.topCloseLink);if(this.options.heading){this.markup.dialogTitleH3.innerHTML=this.options.heading;this.markup.dialogTitle.appendChild(this.markup.dialogTitleH3);this.markup.mainContent.appendChild(this.markup.dialogTitle)}this.markup.mainContent.appendChild(this.markup.mainInfo);this.markup.mainContent.appendChild(this.markup.bottomCloseLink);this.markup.bottom.appendChild(this.markup.bottomLeft);this.markup.bottom.appendChild(this.markup.bottomRight)},createShim:function(){if(navigator.userAgent.toLowerCase().indexOf("msie 6")!==-1){log.debug("is ie6, creating shim");this.markup.shim=this.markup.shim?this.markup.shim.destroy():null;this.markup.shim=Element.extend(document.createElement("div"));var F=Element.extend(document.createElement("iframe"));F.style.display="none";this.markup.shim.appendChild(F);this.markup.shim.className="dialogShim "+this.options.classes;F.src="/script/empty.html";F.scrolling="no";F.frameBorder="0";this.triggerContext.activeDialogsContainer.insertBefore(this.markup.shim,this.markup.dialogWrapper);this.markup.shim.style.top=this.markup.dialogWrapper.style.top;this.markup.shim.style.left=this.markup.dialogWrapper.style.left;var D=this.markup.shim.currentStyle.paddingTop.replace("px","")*1;var E=this.markup.shim.currentStyle.paddingRight.replace("px","")*1;var A=this.markup.shim.currentStyle.paddingBottom.replace("px","")*1;var B=this.markup.shim.currentStyle.paddingLeft.replace("px","")*1;F.style.width=(this.dialogBoundingBox.x2-this.dialogBoundingBox.x1-E-B)+"px";F.style.height=(this.dialogBoundingBox.y2-this.dialogBoundingBox.y1-D-A)+"px";F.style.display="block"}},attachTriggers:function(B){if(Object.isArray(B)){if(this.triggers instanceof ManagedEventObservers){for(var A=0;B[A];A++){if(this.options.triggerEvent=="mouseover"){this.triggers.add(B[A],"mouseover",this.open.bindAsEventListener(this))}this.triggers.add(B[A],"click",this.open.bindAsEventListener(this))}log.debug("Dialog.Base triggers attached: "+B.length)}else{log.error("Dialog.Base.prototype.triggers not instance of ManagedEventObservers")}}else{log.error("newTriggers parameter either undefined, or is not an array")}},attachCloseListeners:function(B){if(this.options.closeElements){for(var A=0;this.options.closeElements[A];A++){if(!this.options.closeElements[A].isAttached){this.closeEventObservers.add(this.options.closeElements[A],"click",B);this.options.closeElements[A].isAttached=true}}}var D=this.markup.mainInfo.getElementsByClassName("closeListener");for(var A=0;D[A];A++){if(!D[A].isAttached){this.managedEventObservers.add(D[A],"click",B);D[A].isAttached=true}}},inspectTrigger:function(A){if(this.triggers.isWatchingElement(A)){this.trigger=$(A)}else{this.trigger=$(A).ancestors().find(function(B){return this.triggers.isWatchingElement(B)}.bind(this));if(!this.trigger){this.trigger=$(A)}}this.trigger.pos=this.trigger.getPosition();this.trigger.dim=this.trigger.getDimensions();this.triggerContext={};if(this.options.hasCustomPositioningContext){this.triggerContext.element=this.trigger.up(".dialogPositioningContext")}else{this.triggerContext.element=this.trigger.up(".dialogWrapper, #bodyWrapper, body")}if(this.triggerContext.element===$(document.body)){this.triggerContext.pos={x:0,y:0}}else{this.triggerContext.pos=this.triggerContext.element.getPosition()}this.triggerContext.activeDialogsContainer=this.triggerContext.element.childElements().find(function(B){return B.hasClassName("activeDialogs")});if(!this.triggerContext.activeDialogsContainer){this.triggerContext.activeDialogsContainer=new Element("div",{"class":"activeDialogs"});this.triggerContext.element.appendChild(this.triggerContext.activeDialogsContainer)}log.debug("Dialog.Base.trigger: "+this.trigger.tagName+", pos: "+this.trigger.pos.x+", "+this.trigger.pos.y+" dim: "+this.trigger.dim.width+", "+this.trigger.dim.height+", triggerContext: "+this.triggerContext+", triggerContextPos: "+this.triggerContext.pos.x+", "+this.triggerContext.pos.y)},wrapFocus:function(A){A.preventDefault();this.focusCloseLink()},attachFocusWrapListeners:function(){this.managedEventObservers.add(this.markup.wrapLink,"click",this.wrapFocus.bindAsEventListener(this))},getContent:function(){if(this.response){log.debug("Dialog.Base.getContent: response");this.showDialog(this.response)}else{if(!this.content){log.debug("Dialog.Base.getContent: null")}else{if(this.content.domNode){this.content.domNode=$(this.content.domNode);log.debug("Dialog.Base.getContent - domNode: "+this.content.domNode);this.showDialog(this.content.domNode.cloneNode(true))}else{if(this.content.url){log.debug("Dialog.Base.getContent - url: "+this.content.url);this.content.url=this.content.url.replace("&amp;","&");this.content.url=this.content.url.replace("&amp;","&");this.request=new Ajax.Request(this.content.url,{method:(this.options.ajaxParameters)?"post":"get",parameters:(this.options.ajaxParameters)?this.options.ajaxParameters:"",onComplete:this.showDialog.bind(this),onSuccess:function(A){log.debug(A.status+": Dialog.Base.getContent() content.url successful");if(this.options.sessionTimeoutUrl&&A.responseText.indexOf("<html")!=-1){this.sessionHasExpired=true;top.location.href=this.options.sessionTimeoutUrl}}.bind(this)})}else{if(this.content.string){log.debug("Dialog.Base.getContent - markup: "+this.content.string);this.showDialog(this)}else{log.error("Dialog.response is null and Dialog.content not a recognized type")}}}}}},populateDialog:function(){if(this.response){if(this.options.interstitial){this.markup.mainInfo.innerHTML=""}if(this.content.domNode){var A=$(this.content.domNode).immediateDescendants();log.debug("populateDialog: "+A.length+" nodes");for(var B=0;B<A.length;B++){this.markup.mainInfo.appendChild(A[B])}}else{if(this.content.url&&this.response.responseText){this.markup.mainInfo.update(this.response.responseText);Page.initializeDOMFragment(this.markup.mainInfo)}else{if(this.content.string){this.markup.mainInfo.update(this.content.string);Page.initializeDOMFragment(this.markup.mainInfo)}else{log.error("Dialog.populateDialog: unable to determine response type")}}}this.markup.backToTopLink=this.markup.mainInfo.getLastElementByClassName("footnoteBackToTop","A");if(this.markup.backToTopLink){this.markup.backToTopLink.style.display="none"}}},depopulateDialog:function(){if(this.markup.backToTopLink){this.markup.backToTopLink.style.display="inline"}if(this.markup.mainInfo){if(this.content.domNode){var A=this.markup.mainInfo.immediateDescendants();for(var B=0;B<A.length;B++){this.content.domNode.appendChild(A[B])}}this.markup.mainInfo.innerHTML=""}},appendToDOM:function(){if(this.triggerContext.activeDialogsContainer){this.triggerContext.activeDialogsContainer.appendChild(this.markup.dialogWrapper);this.markup.dialogWrapper.setStyle({visibility:"hidden"})}else{log.error("Dialog.Base.appendToDOM: couldn't find 'triggerContext.activeDialogContainer' container to insert new dialog")}},_removeFromDOM:function(){log.debug("Dialog._removeFromDOM()");if(this.triggerContext){this.triggerContext.element=null;this.triggerContext.activeDialogsContainer=null;this.triggerContext=null}this.markup.backToTopLink=null;this.markup.shim=this.markup.shim?this.markup.shim.destroy():null;this.markup.bottomRight=this.markup.bottomRight?this.markup.bottomRight.destroy():null;this.markup.bottomLeft=this.markup.bottomLeft?this.markup.bottomLeft.destroy():null;this.markup.bottomContent=this.markup.bottomContent?this.markup.bottomContent.destroy():null;this.markup.bottomCloseLink=this.markup.bottomCloseLink?this.markup.bottomCloseLink.destroy():null;this.markup.mainInfo=this.markup.mainInfo?this.markup.mainInfo.destroy():null;this.markup.mainContent=this.markup.mainContent?this.markup.mainContent.destroy():null;this.markup.mainRight=this.markup.mainRight?this.markup.mainRight.destroy():null;this.markup.topCloseLink=this.markup.topCloseLink?this.markup.topCloseLink.destroy():null;this.markup.topRight=this.markup.topRight?this.markup.topRight.destroy():null;this.markup.topLeft=this.markup.topLeft?this.markup.topLeft.destroy():null;this.markup.dialogTitleH3=this.markup.dialogTitleH3?this.markup.dialogTitleH3.destroy():null;this.markup.dialogTitle=this.markup.dialogTitle?this.markup.dialogTitle.destroy():null;this.markup.wrapLink=this.markup.wrapLink?this.markup.wrapLink.destroy():null;this.markup.bottom=this.markup.bottom?this.markup.bottom.destroy():null;this.markup.main=this.markup.main?this.markup.main.destroy():null;this.markup.top=this.markup.top?this.markup.top.destroy():null;this.markup.dialogAnchor=this.markup.dialogAnchor?this.markup.dialogAnchor.destroy():null;this.markup.topBoundary=this.markup.topBoundary?this.markup.topBoundary.destroy():null;this.markup.dialogWrapper=this.markup.dialogWrapper?this.markup.dialogWrapper.destroy():null},focusCloseLink:function(){clearTimeout(this.focusTimeout);if(this.markup.topCloseLink){var A=this.markup.topCloseLink.updateAndFocus(1500);this.focusTimeout=A;var B=function(D){log.debug("Clearing close link focus timeout");clearTimeout(A);this.stopObserving("mousedown",B)};$("bodyWrapper").observe("mousedown",B)}}};var Microcontent=Class.create(Dialog.Base,{initialize:function(A,E,F){var D={triggerEvent:"mouseover",triggerDelay:0,compact:false,displayBeak:true,preferredPosition:"bottomRight",debug:{enabled:false}};var A=$A(A);Object.extend(D,F||{});this.setProperties("Microcontent",E,D);this.attachTriggers(A);if(this.options.triggerEvent=="mouseover"){for(var B=0;A[B];B++){this.triggers.add(A[B],"mouseout",this.clearTriggerFocus.bindAsEventListener(this))}}else{if(this.options.triggerEvent=="click"){}else{log.error("Microcontent.options.triggerEvent: "+this.options.triggerEvent+" is not a recognized event type")}}this.focusListeners=new ManagedEventObservers();this.focusListenersAttached=false},createMarkup:function(){this.createDialogDivs();if(this.options.displayBeak){this.markup.beak=Element.extend(document.createElement("div"));this.markup.dialogWrapper.appendChild(this.markup.beak)}},showDialog:function(B){try{if(this.markup.dialogWrapper){$(this.trigger).fire("dialog:dialogOpen",{dialog:this});this.response=B;this.populateDialog();this.attachCloseListeners(this.close.bindAsEventListener(this));this.focusListenersAttached=this.attachFocusListeners();this.attachFocusWrapListeners();this.appendToDOM();this.buildLayout();var D=this.trigger.pos.y;if(Units.TYPE=="em"){D=D/Units.PX_TO_EM}this.markup.dialogWrapper.setStyle({top:D+Units.TYPE});this.positionInViewport();this.options.setUp();this.markup.dialogWrapper.setStyle({visibility:"visible"});this.focusCloseLink();this.manager=new DialogManager(this.markup.dialogWrapper);this.isOpen=true;window.setTimeout(function(){this.createShim()}.bind(this),0)}else{log.error("Microcontent.showDialog: markup.dialogWrapper doesn't exist")}}catch(A){log.error("EXCEPTION: Microcontent.showDialog: "+A.message)}finally{this.activated=false}},positionInViewport:function(){var Q={x1:this.trigger.pos.x-this.triggerContext.pos.x,y1:this.trigger.pos.y-this.triggerContext.pos.y,x2:this.trigger.pos.x-this.triggerContext.pos.x+this.trigger.dim.width,y2:this.trigger.pos.y-this.triggerContext.pos.y+this.trigger.dim.height};if(this.options.displayBeak){var J={x:Q.x1,y:Q.y1+(this.trigger.dim.height/2)};var K={x:Q.x2,y:Q.y1+(this.trigger.dim.height/2)}}else{var J={x:Q.x2,y:Q.y1+(this.trigger.dim.height/2)};var K={x:Q.x1,y:Q.y1+(this.trigger.dim.height/2)}}var e=this.markup.dialogWrapper.getDimensions();var W=function(){var o=0;var m=0;var h;var g;if(this.markup.main.currentStyle){if(this.options.displayBeak){var f=this.markup.beak.currentStyle;var o=(f.height.replace("px",""))*1;var m=(f.width.replace("px",""))*1}var l=this.markup.main.currentStyle;var k=this.markup.mainRight.currentStyle;var h=(l.paddingLeft.replace("px",""))*1;var g=(k.paddingRight.replace("px",""))*1}else{if(this.options.displayBeak){var f=document.defaultView.getComputedStyle(this.markup.beak,"");var o=(f.getPropertyValue("height").replace("px",""))*1;var m=(f.getPropertyValue("width").replace("px",""))*1}var l=document.defaultView.getComputedStyle(this.markup.main,"");var k=document.defaultView.getComputedStyle(this.markup.mainRight,"");var h=(l.getPropertyValue("padding-left").replace("px",""))*1;var g=(k.getPropertyValue("padding-right").replace("px",""))*1}if(this.options.displayBeak){this.offsets={top:(this.markup.bottom.dim.height+(o/2)),right:m-h,bottom:(0-this.markup.top.dim.height-(o/2)),left:(0-(m-g))}}else{this.offsets={top:this.markup.bottom.dim.height,right:0-h*2,bottom:0-this.markup.top.dim.height/2,left:g*2}}this.beakHeight=o}.bind(this);var H=function(){if(this.options.displayBeak){this.markup.beak.className="microcontentBeakRight";this.markup.beak.setStyle({left:e.width+"px"})}W()}.bind(this);var d=function(){if(this.options.displayBeak){this.markup.beak.className="microcontentBeakLeft";this.markup.beak.setStyle({left:"0"})}W()}.bind(this);d();var A={x1:K.x+this.offsets.right+this.triggerContext.pos.x,y1:K.y-e.height+this.offsets.top+this.triggerContext.pos.y,x2:K.x+e.width+this.offsets.right+this.triggerContext.pos.x,y2:K.y+this.offsets.top+this.triggerContext.pos.y};var U={x1:K.x+this.offsets.right+this.triggerContext.pos.x,y1:K.y+this.offsets.bottom+this.triggerContext.pos.y,x2:K.x+e.width+this.offsets.right+this.triggerContext.pos.x,y2:K.y+e.height+this.offsets.bottom+this.triggerContext.pos.y};H();var I={x1:J.x-e.width+this.offsets.left+this.triggerContext.pos.x,y1:J.y-e.height+this.offsets.top+this.triggerContext.pos.y,x2:J.x+this.offsets.left+this.triggerContext.pos.x,y2:J.y+this.offsets.top+this.triggerContext.pos.y};var Z={x1:J.x-e.width+this.offsets.left+this.triggerContext.pos.x,y1:J.y+this.offsets.bottom+this.triggerContext.pos.y,x2:J.x+this.offsets.left+this.triggerContext.pos.x,y2:J.y+e.height+this.offsets.bottom+this.triggerContext.pos.y};var Y=Position.calculateViewport();var S=Position.calculateScroll();var F={x1:S.x,y1:S.y,x2:(S.x+Y.width),y2:(S.y+Y.height)};var E=(U.x2<=F.x2)&&(U.y2<=F.y2);var O=(Z.x1>=F.x1)&&(Z.y2<=F.y2);var D=(A.x2<=F.x2)&&(A.y1>=F.y1);var c=(I.x1>=F.x1)&&(I.y1>=F.y1);this.debugPosition({dialogWrapperDimensions:e,topRightBoundingBox:A,topLeftBoundingBox:I,bottomRightBoundingBox:U,bottomLeftBoundingBox:Z,bottomRightGood:E,bottomLeftGood:O,topRightGood:D,topLeftGood:c});this.dialogBoundingBox;var B=function(){H();this.markup.dialogWrapper.setStyle({left:((this.dialogBoundingBox.x1-this.triggerContext.pos.x)/Units.PX_TO_EM)+"em"})}.bind(this);var T=function(){d();this.markup.dialogWrapper.setStyle({left:((this.dialogBoundingBox.x1-this.triggerContext.pos.x)/Units.PX_TO_EM)+"em"})}.bind(this);var V=function(){if(this.options.displayBeak){this.markup.beak.setStyle({top:this.markup.top.dim.height+this.markup.main.dim.height-this.beakHeight+"px"})}this.markup.dialogWrapper.setStyle({top:((this.dialogBoundingBox.y1-this.triggerContext.pos.y)/Units.PX_TO_EM)+"em"})}.bind(this);var G=function(){if(this.options.displayBeak){this.markup.beak.setStyle({top:this.markup.top.dim.height+"px"})}this.markup.dialogWrapper.setStyle({top:((this.dialogBoundingBox.y1-this.triggerContext.pos.y)/Units.PX_TO_EM)+"em"})}.bind(this);var a=function(){this.dialogBoundingBox=U;T();G()}.bind(this);var L=function(){this.dialogBoundingBox=A;T();V()}.bind(this);var b=function(){this.dialogBoundingBox=Z;B();G()}.bind(this);var M=function(){this.dialogBoundingBox=I;B();V()}.bind(this);var P=a;var X=false;if(this.options.preferredPosition=="bottomRight"){if(E){X=true}P=a}else{if(this.options.preferredPosition=="topRight"){if(D){X=true}P=L}else{if(this.options.preferredPosition=="bottomLeft"){if(O){X=true}P=b}else{if(this.options.preferredPosition=="topLeft"){if(c){X=true}P=M}}}}if(X){P()}else{if(E){a()}else{if(D){L()}else{if(O){b()}else{if(c){M()}else{P()}}}}}},open:function(B){log.debug("Microcontent.open()");if(B){B.preventDefault()}if(this.isOpen==false&&this.activated==false){this.triggerFocused=true;this.dialogFocused=false;this.activated=true;var A=$(Event.element(B));this.inspectTrigger(A);if(!this.markup||!this.markup.dialogWrapper){this.createMarkup()}setTimeout(function(){if(this.triggerFocused){this.getContent()}}.bind(this),this.options.triggerDelay)}else{this.focusCloseLink();log.error("already open or activated: isOpen:"+this.isOpen+", activated:"+this.activated)}},close:function(A){if(!this.isOpen){return}log.debug("Microcontent.close()");if(A){A.preventDefault()}if(this.manager){this.manager.destroy();this.manager=null}this.focusListeners.clear();this.focusListenersAttached=false;this.managedEventObservers.clear();this.closeEventObservers.clear();if(this.options.tearDown){this.options.tearDown()}this.depopulateDialog();this.removeFromDOM();this.triggerFocused=false;this.dialogFocused=false;this.activated=false;if(this.trigger.type!=="mouseover"){this.trigger.updateAndFocus()}this.isOpen=false;this.cleanUpDebug()},attachFocusListeners:function(){if(this.focusListenersAttached==false&&this.options.triggerEvent!="click"){this.focusListeners.add(this.markup.dialogWrapper,"mouseover",this.setDialogFocus.bindAsEventListener(this));this.focusListeners.add(this.markup.dialogWrapper,"mouseout",this.clearDialogFocus.bindAsEventListener(this));return true}else{return false}},checkFocus:function(){setTimeout(function(){if(this.dialogFocused==false&&this.triggerFocused==false){this.close()}}.bind(this),200)},clearTriggerFocus:function(){log.debug("trigger mouse out");this.triggerFocused=false;this.checkFocus()},setDialogFocus:function(){log.debug("dialog mouseover");this.dialogFocused=true;this.triggerFocused=false},clearDialogFocus:function(){log.debug("dialog mouseout");this.dialogFocused=false;this.checkFocus()},buildLayout:function(){if(!this.layoutBuilt){if(this.options.compact){this.markup.dialogWrapper.addClassName("dialogCompact")}this.markup.bottom.removeClassName("dialogBottom");this.markup.bottom.addClassName("dialogBottomCompact");this.markup.top.dim=this.markup.top.getDimensions();this.markup.bottom.dim=this.markup.bottom.getDimensions();this.markup.main.dim=this.markup.main.getDimensions();this.layoutBuilt=true}},removeFromDOM:function(){this.markup.beak=this.markup.beak?this.markup.beak.destroy():null;this._removeFromDOM();this.layoutBuilt=false},destroy:function(){this.content=null;this.options=null;this.closeEventObservers=this.closeEventObservers.clear();for(var A=0;A<this.managedEventObservers.observers.length;A++){this.managedEventObservers.observers[A][0].isAttached=null}this.managedEventObservers=this.managedEventObservers.clear();this.focusListeners=this.focusListeners.clear()},inspectPositioningData:function(A,E,D){var B="Microcontent.inspectPositioningData:<br/>viewport.height: "+A.height+"<br/>scroll.y: "+E.y+"<br/>this.markup.dialogWrapper.dim: "+this.markup.dialogWrapper.dim.width+","+this.markup.dialogWrapper.dim.height+"<br/>this.markup.dialogWrapper.pos: "+this.markup.dialogWrapper.pos.x+","+this.markup.dialogWrapper.pos.y+"<br/>this.trigger: "+this.trigger+"<br/>this.trigger.pos: "+this.trigger.pos.x+","+this.trigger.pos.y+"<br/>this.trigger.dim: "+this.trigger.dim.width+","+this.trigger.dim.height+"<br/>"+log.info(B)},debugPosition:function(B){log.debug("bottomRightGood: "+B.bottomRightGood+", bottomLeftGood: "+B.bottomLeftGood+", topRightGood: "+B.topRightGood+", topLeftGood: "+B.topLeftGood);var H="border:3px solid green;";var E="border:3px dashed red;";var D=B.topRightGood?H:E;var A=B.topLeftGood?H:E;var F=B.bottomRightGood?H:E;var G=B.bottomLeftGood?H:E;if(this.options.debug.enabled){this.options.debug.topRightDebugBox=new Element("div",{style:D+"z-index:40; top:"+B.topRightBoundingBox.y1+"px; left:"+B.topRightBoundingBox.x1+"px; width:"+(B.dialogWrapperDimensions.width-6)+"px; height:"+(B.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.topLeftDebugBox=new Element("div",{style:A+"z-index:40; top:"+B.topLeftBoundingBox.y1+"px; left:"+B.topLeftBoundingBox.x1+"px; width:"+(B.dialogWrapperDimensions.width-6)+"px; height:"+(B.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.bottomRightDebugBox=new Element("div",{style:F+"z-index:40; top:"+B.bottomRightBoundingBox.y1+"px; left:"+B.bottomRightBoundingBox.x1+"px; width:"+(B.dialogWrapperDimensions.width-6)+"px; height:"+(B.dialogWrapperDimensions.height-6)+"px; position:absolute;"});this.options.debug.bottomLeftDebugBox=new Element("div",{style:G+"z-index:40; top:"+B.bottomLeftBoundingBox.y1+"px; left:"+B.bottomLeftBoundingBox.x1+"px; width:"+(B.dialogWrapperDimensions.width-6)+"px; height:"+(B.dialogWrapperDimensions.height-6)+"px; position:absolute;"});$("bodyWrapper").appendChild(this.options.debug.topRightDebugBox);$("bodyWrapper").appendChild(this.options.debug.topLeftDebugBox);$("bodyWrapper").appendChild(this.options.debug.bottomRightDebugBox);$("bodyWrapper").appendChild(this.options.debug.bottomLeftDebugBox)}},cleanUpDebug:function(){if(this.options.debug.enabled){this.options.debug.topRightDebugBox.remove();this.options.debug.topLeftDebugBox.remove();this.options.debug.bottomRightDebugBox.remove();this.options.debug.bottomLeftDebugBox.remove()}}});var Lightbox=Class.create(Dialog.Base,{initialize:function(A,D,E){var B={triggerEvent:"click",interstitial:"",id:"",compact:false,openOnInit:false};Object.extend(B,E||{});this.setProperties("Lightbox",D,B);this.isFixedAtTop=null;this.isFixedAtBottom=null;this.positionFixedUnsupportedVal=null;this.attachTriggers(A);if(this.options.openOnInit){this.open()}},createMask:function(){var A=Position.calculatePageHeight();this.markup.mask=Element.extend(document.createElement("div"));this.markup.mask.className="dialogMask";this.markup.mask.style.height=A.height+A.units},createMarkup:function(){this.createDialogDivs();this.createMask()},showDialog:function(A){log.debug("Lightbox.showDialog()");if(!this.sessionHasExpired){this.displayContent(A);this.activated=false}},positionFixedUnsupported:function(){if(this.positionFixedUnsupportedVal==null){this.positionFixedUnsupportedVal=this.markup.dialogWrapper.getStyle("position")=="absolute"}return this.positionFixedUnsupportedVal},positionInViewport:function(){var A=Position.calculateViewport();var B=Position.calculateScroll();this.markup.dialogWrapper.dim=this.markup.dialogWrapper.getDimensions();if(this.positionFixedUnsupported()){this.markup.dialogWrapper.setStyle({top:B.y+"px"})}else{this.markup.dialogWrapper.setStyle({top:"0px"})}if(this.markup.dialogWrapper.dim.width<A.width){this.markup.dialogWrapper.setStyle({left:(A.width-this.markup.dialogWrapper.dim.width)/2+"px"})}this.isFixedAtTop=true;this.isFixedAtBottom=false;this.inspectScrollData(A,B,Position.calculatePageHeight())},open:function(B){if(this.isOpen==false&&this.activated==false){this.activated=true;if(B){var A=$(Event.element(B));this.inspectTrigger(A);this.options.setUp(B)}else{if(this.triggers&&this.triggers instanceof ManagedEventObservers){var A=this.triggers.getFirstTriggerElement();this.inspectTrigger(A)}this.options.setUp()}this.createMarkup();this.showMask();this.displayLightbox();setTimeout(this.getContent.bind(this),250)}else{this.focusCloseLink();log.error("isOpen: "+this.isOpen+", activated: "+this.activated+" either the lightbox is already open or activated, see Lightbox.open")}B.preventDefault()},close:function(A){A.preventDefault();if(this.request){log.debug("aborting request");this.request.abort();this.request=null}this.trigger.focus();if(this.markup.dialogWrapper){this.markup.dialogWrapper.style.visibility="hidden"}if(this.manager){this.manager.destroy();this.manager=null}this.managedEventObservers.clear();this.closeEventObservers.clear();this.depopulateDialog();this.hideMask();this.markup.mask=this.markup.mask?this.markup.mask.destroy():null;this.removeFromDOM();if(this.options.tearDown){this.options.tearDown()}window.virtualBufferManager.update();this.activated=false;this.isOpen=false;this.lastScroll=null;this.bottomOfDialog=null;this.dialogViewportDiff=null;this.isFixedAtBottom=false;this.isFixedAtTop=false;this.dialogSelects.clear();this.response=null},showMask:function(){if(this.markup.mask){this.allSelects=$A(document.getElementsByTagName("select")).each(function(A){A.style.visibility="hidden";return Element.extend(A)});this.triggerContext.activeDialogsContainer.appendChild(this.markup.mask);this.options.closeElements.push(this.markup.mask);this.markup.mask.style.display="block";this.closeEventObservers.add(this.markup.mask,"click",this.close.bindAsEventListener(this))}else{log.error("this.markup.mask doesn't exist")}},hideMask:function(){if(this.markup.mask){this.markup.mask.style.display="none"}if(this.allSelects){this.allSelects.each(function(A){A.style.visibility="inherit"});this.allSelects.clear()}},resizeMask:function(){var A=Position.calculatePageHeight();this.markup.mask.dim=this.markup.mask.getDimensions();if(A.height>this.markup.mask.dim.height){this.markup.mask.setStyle({height:A.height+"px"})}},buildLayout:function(){if(!this.layoutBuilt){if(this.options.compact){this.markup.bottom.removeClassName("dialogBottom");this.markup.bottom.addClassName("dialogBottomCompact")}else{this.markup.bottomCloseLink.removeClassName("offscreen")}this.appendToDOM();this.markup.dialogWrapper.addClassName("fixed");this.layoutBuilt=true}},resize:function(){log.debug("Lightbox.resize");this.resizeMask();this.isFixedAtBottom=false},attachResizeListeners:function(B,E){var D;if(arguments.length>1&&$(E).getElementsByClassName){D=$(E).getElementsByClassName("resizeListener")}else{D=this.markup.dialogWrapper.getElementsByClassName("resizeListener")}for(var A=0;D[A];A++){this.managedEventObservers.add(D[A],"click",B)}},displayLightbox:function(){if(this.content.url){this.markup.mainInfo.innerHTML=this.options.interstitial}this.buildLayout();this.onWindowScroll();this.managedEventObservers.add(window,"scroll",this.onWindowScroll.bindAsEventListener(this));this.managedEventObservers.add(window,"resize",this.onWindowResize.bindAsEventListener(this));this.attachCloseListeners(this.close.bindAsEventListener(this));this.attachFocusWrapListeners();this.positionInViewport();this.markup.dialogWrapper.style.visibility="visible";setTimeout(this.resize.bind(this),250);this.markup.dialogAnchor.updateAndFocus();$(this.trigger).fire("dialog:dialogOpen",{dialog:this});this.manager=new DialogManager(this.markup.dialogWrapper);this.isOpen=true;log.debug("end Lightbox.displayLightbox")},displayContent:function(A){this.response=A;this.populateDialog();this.dialogSelects=$A(this.markup.dialogWrapper.getElementsByTagName("select")).each(function(B){B.style.visibility="inherit";return Element.extend(B)});this.attachCloseListeners(this.close.bindAsEventListener(this));this.attachResizeListeners(this.onLightboxResize.bindAsEventListener(this));setTimeout(this.resize.bind(this),250);this.focusCloseLink()},replaceContent:function(A,D){if(this.isOpen==true&&this.activated==false){this.activated=true;this.response=null;this.managedEventObservers.clear();this.markup.mainInfo.innerHTML=this.options.interstitial;this.resize();var E=Position.calculatePageHeight();this.markup.mask.dim=this.markup.mask.getDimensions();if(E.height>this.markup.mask.dim.height){this.markup.mask.setStyle({height:E.height+"px"})}if(arguments.length>1){var B=$H(D).toQueryString()}if(A.indexOf("?")!=-1){this.content={url:A+"&"+B}}else{this.content={url:A+"?"+B}}this.focusCloseLink();this.getContent()}else{if(this.isOpen==false){log.error("called replaceContent on a Lightbox that was not open")}}},onWindowResize:function(){this.positionInViewport();var A=Position.calculateViewport()},onLightboxResize:function(){setTimeout(this.resize.bind(this),0)},onWindowScroll:function(){var A=Position.calculateViewport();var D=Position.calculateScroll();var B=Position.calculatePageHeight();this.markup.dialogWrapper.dim=this.markup.dialogWrapper.getDimensions();this.markup.dialogWrapper.pos=this.markup.dialogWrapper.getPosition();if(this.markup.dialogWrapper.dim.height<A.height){this.bottomOfDialog=null;this.dialogViewportDiff=null;this.markup.dialogWrapper.addClassName("fixed");this.isFixedAtTop=true;this.isFixedAtBottom=false;if(this.positionFixedUnsupported()){this.markup.dialogWrapper.setStyle({top:D.y+"px"})}else{this.markup.dialogWrapper.setStyle({top:"0px"})}}else{if(this.markup.dialogWrapper.dim.height>A.height){this.bottomOfDialog=this.markup.dialogWrapper.pos.y+this.markup.dialogWrapper.dim.height;this.dialogViewportDiff=this.markup.dialogWrapper.dim.height-A.height;if(this.markup.dialogWrapper.pos.y<D.y&&this.bottomOfDialog>(D.y+A.height)){this.isFixedAtTop=false;this.isFixedAtBottom=false;if(this.markup.dialogWrapper.hasClassName("fixed")){this.markup.dialogWrapper.setStyle({top:this.markup.dialogWrapper.pos.y+"px"});this.markup.dialogWrapper.removeClassName("fixed")}}if(this.lastScroll!=null){if(D.y>this.lastScroll.y){if(this.isFixedAtTop){this.markup.dialogWrapper.removeClassName("fixed");this.markup.dialogWrapper.setStyle({top:this.lastScroll.y+"px"});this.isFixedAtTop=false;this.bottomOfDialog=this.lastScroll.y+this.markup.dialogWrapper.dim.height}if((D.y+A.height)>this.bottomOfDialog){if(!this.isFixedAtBottom){this.markup.dialogWrapper.addClassName("fixed");this.isFixedAtBottom=true}if(this.positionFixedUnsupported()){this.markup.dialogWrapper.setStyle({top:(D.y-this.dialogViewportDiff)+"px"})}else{this.markup.dialogWrapper.setStyle({top:-(this.dialogViewportDiff)+"px"})}}}else{if(D.y<this.lastScroll.y){if(this.positionFixedUnsupported()&&D.y<=this.markup.dialogWrapper.pos.y){this.markup.dialogWrapper.setStyle({top:D.y+"px"})}else{if(this.isFixedAtBottom){this.markup.dialogWrapper.removeClassName("fixed");this.markup.dialogWrapper.setStyle({top:this.lastScroll.y-this.dialogViewportDiff+"px"});this.isFixedAtBottom=false}if(D.y<=this.markup.dialogWrapper.pos.y&&!this.isFixedAtTop){this.markup.dialogWrapper.addClassName("fixed");this.markup.dialogWrapper.setStyle({top:0});this.isFixedAtTop=true}}}}}}}this.lastScroll=D},inspectScrollData:function(A,E,D){var B="Lightbox.inspectScrollData:<br/>viewport.height: "+A.height+"<br/>scroll.y: "+E.y+"<br/>page.height: "+D.height+"<br/>this.markup.dialogWrapper.dim.height: "+this.markup.dialogWrapper.dim.height+"<br/>this.markup.dialogWrapper.pos.y: "+this.markup.dialogWrapper.pos.y+"<br/>this.markup.dialogWrapper.style.top: "+this.markup.dialogWrapper.style.top+"<br/>this.bottomOfDialog: "+this.bottomOfDialog+"<br/>this.dialogViewportDiff: "+this.dialogViewportDiff+"<br/>this.markup.dialogWrapper.className: "+this.markup.dialogWrapper.className+"<br/>this.isFixedAtTop: "+this.isFixedAtTop+"<br/>this.isFixedAtBottom: "+this.isFixedAtBottom+"<br/>this.positionFixedUnsupported: "+this.positionFixedUnsupported();if(this.lastScroll!=null){B="this.lastScroll.y: "+this.lastScroll.y+"<br/>"+B}log.info(B)},removeFromDOM:function(){this._removeFromDOM();this.layoutBuilt=false},destroy:function(){this.markup.mask.dim=null;this.markup.mask=this.markup.mask.destroy();this.removeFromDOM();this.closeEventObservers.clear();this.activated=null;this.isFixedAtBottom=null;this.isFixedAtTop=null;this.isOpen=null;this.lastScroll=null;this.managedEventObservers=null;this.options.closeLabel=null;this.options.heading=null;this.options.id=null;this.options.interstitial=null;this.options.sessionTimeoutUrl=null;this.options.triggerEvent=null;this.options.setUp=function(){};this.options.tearDown=function(){};this.positionFixedUnsupportedVal=null;this.layoutBuilt=null;this.content=null;this.triggers.clear()}});var ChangeSearchLightbox=Class.create(Lightbox,{initialize:function($super,A,B,E){$super(A,B,E);var D=this.content.url;if(D.indexOf("book")!=-1){this.content.url="/book/bookingpath"}else{this.content.url="/shop/searchForm"}D=D.substr(D.indexOf("?")+1);D=D.replace(/&amp(;|%3B)/g,"&");D=D.replace(/\+/g,"%20");D="changeSearch=true&"+D;this.options.ajaxParameters=D},populateDialog:function($super){var A=new Element("div").update(this.response.responseText);Page.initializeDOMFragment(A);this.content.domNode=A;$super();this.content.domNode=null}});var DialogPositioningContext=Class.create({initialize:function(A){this.element=A;this.element.addClassName("dialogPositioningContext");this.activeDialogContainer=new Element("div",{"class":"activeDialogs"});this.element.appendChild(this.activeDialogContainer)}});String.prototype.parseColor=function(){var A="#";if(this.slice(0,4)=="rgb("){var D=this.slice(4,this.length-1).split(",");var B=0;do{A+=parseInt(D[B]).toColorPart()}while(++B<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var B=1;B<4;B++){A+=(this.charAt(B)+this.charAt(B)).toLowerCase()}}if(this.length==7){A=this.toLowerCase()}}}return(A.length==7?A:(arguments[0]||this))};Element.collectTextNodes=function(A){return $A($(A).childNodes).collect(function(B){return(B.nodeType==3?B.nodeValue:(B.hasChildNodes()?Element.collectTextNodes(B):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(B,A){return $A($(B).childNodes).collect(function(D){return(D.nodeType==3?D.nodeValue:((D.hasChildNodes()&&!Element.hasClassName(D,A))?Element.collectTextNodesIgnoreClass(D,A):""))}).flatten().join("")};Element.setContentZoom=function(B,A){B=$(B);B.setStyle({fontSize:(A/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return B};Element.getInlineOpacity=function(A){return $(A).style.opacity||""};Element.forceRerendering=function(A){try{A=$(A);var D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D)}catch(B){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(A){return(-Math.cos(A*Math.PI)/2)+0.5},reverse:function(A){return 1-A},flicker:function(A){var A=((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4;return A>1?1:A},wobble:function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5},pulse:function(B,A){return(-Math.cos((B*((A||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6))},none:function(A){return 0},full:function(A){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(A){var B="position:relative";if(Prototype.Browser.IE){B+=";zoom:1"}A=$(A);$A(A.childNodes).each(function(D){if(D.nodeType==3){D.nodeValue.toArray().each(function(E){A.insertBefore(new Element("span",{style:B}).update(E==" "?String.fromCharCode(160):E),D)});Element.remove(D)}})},multiple:function(D,B){var A;if(((typeof D=="object")||Object.isFunction(D))&&(D.length)){A=D}else{A=$(D).childNodes}var E=Object.extend({speed:0.1,delay:0},arguments[2]||{});var F=E.delay;$A(A).each(function(H,G){new B(H,Object.extend(E,{delay:G*E.speed+F}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(B,A){B=$(B);A=(A||"appear").toLowerCase();var D=Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},arguments[2]||{});Effect[B.visible()?Effect.PAIRS[A][1]:Effect.PAIRS[A][0]](B,D)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(A){this.effects._each(A)},add:function(B){var D=new Date().getTime();var A=Object.isString(B.options.queue)?B.options.queue:B.options.queue.position;switch(A){case"front":this.effects.findAll(function(E){return E.state=="idle"}).each(function(E){E.startOn+=B.finishOn;E.finishOn+=B.finishOn});break;case"with-last":D=this.effects.pluck("startOn").max()||D;break;case"end":D=this.effects.pluck("finishOn").max()||D;break}B.startOn+=D;B.finishOn+=D;if(!B.options.queue.limit||(this.effects.length<B.options.queue.limit)){this.effects.push(B)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(A){this.effects=this.effects.reject(function(B){return B==A});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var D=new Date().getTime();for(var B=0,A=this.effects.length;B<A;B++){this.effects[B]&&this.effects[B].loop(D)}}});Effect.Queues={instances:$H(),get:function(A){if(!Object.isString(A)){return A}return this.instances.get(A)||this.instances.set(A,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(A){function B(E,D){return((E[D+"Internal"]?"this.options."+D+"Internal(this);":"")+(E[D]?"this.options."+D+"(this);":""))}if(A&&A.transition===false){A.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),A||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function D(F,E){if(F.options[E+"Internal"]){F.options[E+"Internal"](F)}if(F.options[E]){F.options[E](F)}}return function(E){if(this.state==="idle"){this.state="running";D(this,"beforeSetup");if(this.setup){this.setup()}D(this,"afterSetup")}if(this.state==="running"){E=(this.options.transition(E)*this.fromToDelta)+this.options.from;this.position=E;D(this,"beforeUpdate");if(this.update){this.update(E)}D(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(A){if(A>=this.startOn){if(A>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var D=(A-this.startOn)/this.totalTime,B=(D*this.totalFrames).round();if(B>this.currentFrame){this.render(D);this.currentFrame=B}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this)}if(this.options[A]){this.options[A](this)}},inspect:function(){var A=$H();for(property in this){if(!Object.isFunction(this[property])){A.set(property,this[property])}}return"#<Effect:"+A.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(A){this.effects=A||[];this.start(arguments[1])},update:function(A){this.effects.invoke("render",A)},finish:function(A){this.effects.each(function(B){B.render(1);B.cancel();B.event("beforeFinish");if(B.finish){B.finish(A)}B.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(D,G,F){D=Object.isString(D)?$(D):D;var A=$A(arguments),E=A.last(),B=A.length==5?A[3]:null;this.method=Object.isFunction(E)?E.bind(D):Object.isFunction(D[E])?D[E].bind(D):function(H){D[E]=H};this.start(Object.extend({from:G,to:F},B||{}))},update:function(A){this.method(A)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var B=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(B)},update:function(A){this.element.setOpacity(A)}});Effect.Move=Class.create(Effect.Base,{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}var B=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(B)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(A){this.element.setStyle({left:(this.options.x*A+this.originalLeft).round()+"px",top:(this.options.y*A+this.originalTop).round()+"px"})}});Effect.MoveBy=function(B,D,A){return new Effect.Move(B,Object.extend({x:A,y:D},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(B,A){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var D=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:A},arguments[2]||{});this.start(D)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(B){this.originalStyle[B]=this.element.style[B]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var A=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(B){if(A.indexOf(B)>0){this.fontSize=parseFloat(A);this.fontSizeType=B}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(A){var B=(this.options.scaleFrom/100)+(this.factor*A);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*B+this.fontSizeType})}this.setDimensions(this.dims[0]*B,this.dims[1]*B)},finish:function(A){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(E,D){var F={};if(this.options.scaleX){F.width=D.round()+"px"}if(this.options.scaleY){F.height=E.round()+"px"}if(this.options.scaleFromCenter){var B=(E-this.dims[0])/2;var A=(D-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){F.top=this.originalTop-B+"px"}if(this.options.scaleX){F.left=this.originalLeft-A+"px"}}else{if(this.options.scaleY){F.top=-B+"px"}if(this.options.scaleX){F.left=-A+"px"}}}this.element.setStyle(F)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}var B=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(B)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(A){return parseInt(this.options.startcolor.slice(A*2+1,A*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(A){return parseInt(this.options.endcolor.slice(A*2+1,A*2+3),16)-this._base[A]}.bind(this))},update:function(A){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(B,D,E){return B+((this._base[E]+(this._delta[E]*A)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(A){var B=arguments[1]||{},E=document.viewport.getScrollOffsets(),D=$(A).cumulativeOffset();if(B.offset){D[1]+=B.offset}return new Effect.Tween(null,E.top,D[1],B,function(F){scrollTo(E.left,F.round())})};Effect.Fade=function(B){B=$(B);var A=B.getInlineOpacity();var D=Object.extend({from:B.getOpacity()||1,to:0,afterFinishInternal:function(E){if(E.options.to!=0){return}E.element.hide().setStyle({opacity:A})}},arguments[1]||{});return new Effect.Opacity(B,D)};Effect.Appear=function(A){A=$(A);var B=Object.extend({from:(A.getStyle("display")=="none"?0:A.getOpacity()||0),to:1,afterFinishInternal:function(D){D.element.forceRerendering()},beforeSetup:function(D){D.element.setOpacity(D.options.from).show()}},arguments[1]||{});return new Effect.Opacity(A,B)};Effect.Puff=function(B){B=$(B);var A={opacity:B.getInlineOpacity(),position:B.getStyle("position"),top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};return new Effect.Parallel([new Effect.Scale(B,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(D){Position.absolutize(D.effects[0].element)},afterFinishInternal:function(D){D.effects[0].element.hide().setStyle(A)}},arguments[1]||{}))};Effect.BlindUp=function(A){A=$(A);A.makeClipping();return new Effect.Scale(A,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(B){B.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(B){B=$(B);var A=B.getDimensions();return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(D){D.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(B){B=$(B);var A=B.getInlineOpacity();return new Effect.Appear(B,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(D){new Effect.Scale(D.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(E){E.element.makePositioned().makeClipping()},afterFinishInternal:function(E){E.element.hide().undoClipping().undoPositioned().setStyle({opacity:A})}})}},arguments[1]||{}))};Effect.DropOut=function(B){B=$(B);var A={top:B.getStyle("top"),left:B.getStyle("left"),opacity:B.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(B,{x:0,y:100,sync:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(D){D.effects[0].element.makePositioned()},afterFinishInternal:function(D){D.effects[0].element.hide().undoPositioned().setStyle(A)}},arguments[1]||{}))};Effect.Shake=function(B){B=$(B);var E=Object.extend({distance:20,duration:0.5},arguments[1]||{});var F=parseFloat(E.distance);var D=parseFloat(E.duration)/10;var A={top:B.getStyle("top"),left:B.getStyle("left")};return new Effect.Move(B,{x:F,y:0,duration:D,afterFinishInternal:function(G){new Effect.Move(G.element,{x:-F*2,y:0,duration:D*2,afterFinishInternal:function(H){new Effect.Move(H.element,{x:F*2,y:0,duration:D*2,afterFinishInternal:function(I){new Effect.Move(I.element,{x:-F*2,y:0,duration:D*2,afterFinishInternal:function(J){new Effect.Move(J.element,{x:F*2,y:0,duration:D*2,afterFinishInternal:function(K){new Effect.Move(K.element,{x:-F,y:0,duration:D,afterFinishInternal:function(L){L.element.undoPositioned().setStyle(A)}})}})}})}})}})}})};Effect.SlideDown=function(B){B=$(B).cleanWhitespace();var D=B.down().getStyle("bottom");var A=B.getDimensions();return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(E){E.element.makePositioned();E.element.down().makePositioned();if(window.opera){E.element.setStyle({top:""})}E.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(E){E.element.down().setStyle({bottom:(E.dims[0]-E.element.clientHeight)+"px"})},afterFinishInternal:function(E){E.element.undoClipping().undoPositioned();E.element.down().undoPositioned().setStyle({bottom:D})}},arguments[1]||{}))};Effect.SlideUp=function(B){B=$(B).cleanWhitespace();var D=B.down().getStyle("bottom");var A=B.getDimensions();return new Effect.Scale(B,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(E){E.element.makePositioned();E.element.down().makePositioned();if(window.opera){E.element.setStyle({top:""})}E.element.makeClipping().show()},afterUpdateInternal:function(E){E.element.down().setStyle({bottom:(E.dims[0]-E.element.clientHeight)+"px"})},afterFinishInternal:function(E){E.element.hide().undoClipping().undoPositioned();E.element.down().undoPositioned().setStyle({bottom:D})}},arguments[1]||{}))};Effect.Squish=function(A){return new Effect.Scale(A,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(B){B.element.makeClipping()},afterFinishInternal:function(B){B.element.hide().undoClipping()}})};Effect.Grow=function(B){B=$(B);var D=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var A={top:B.style.top,left:B.style.left,height:B.style.height,width:B.style.width,opacity:B.getInlineOpacity()};var I=B.getDimensions();var G,H;var F,E;switch(D.direction){case"top-left":G=H=F=E=0;break;case"top-right":G=I.width;H=E=0;F=-I.width;break;case"bottom-left":G=F=0;H=I.height;E=-I.height;break;case"bottom-right":G=I.width;H=I.height;F=-I.width;E=-I.height;break;case"center":G=I.width/2;H=I.height/2;F=-I.width/2;E=-I.height/2;break}return new Effect.Move(B,{x:G,y:H,duration:0.01,beforeSetup:function(J){J.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(J){new Effect.Parallel([new Effect.Opacity(J.element,{sync:true,to:1,from:0,transition:D.opacityTransition}),new Effect.Move(J.element,{x:F,y:E,sync:true,transition:D.moveTransition}),new Effect.Scale(J.element,100,{scaleMode:{originalHeight:I.height,originalWidth:I.width},sync:true,scaleFrom:window.opera?1:0,transition:D.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(K){K.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(K){K.effects[0].element.undoClipping().undoPositioned().setStyle(A)}},D))}})};Effect.Shrink=function(B){B=$(B);var D=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var A={top:B.style.top,left:B.style.left,height:B.style.height,width:B.style.width,opacity:B.getInlineOpacity()};var G=B.getDimensions();var F,E;switch(D.direction){case"top-left":F=E=0;break;case"top-right":F=G.width;E=0;break;case"bottom-left":F=0;E=G.height;break;case"bottom-right":F=G.width;E=G.height;break;case"center":F=G.width/2;E=G.height/2;break}return new Effect.Parallel([new Effect.Opacity(B,{sync:true,to:0,from:1,transition:D.opacityTransition}),new Effect.Scale(B,window.opera?1:0,{sync:true,transition:D.scaleTransition,restoreAfterFinish:true}),new Effect.Move(B,{x:F,y:E,sync:true,transition:D.moveTransition})],Object.extend({beforeStartInternal:function(H){H.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(H){H.effects[0].element.hide().undoClipping().undoPositioned().setStyle(A)}},D))};Effect.Pulsate=function(D){D=$(D);var E=arguments[1]||{},B=D.getInlineOpacity(),F=E.transition||Effect.Transitions.linear,A=function(G){return 1-F((-Math.cos((G*(E.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(D,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(G){G.element.setStyle({opacity:B})}},E),{transition:A}))};Effect.Fold=function(B){B=$(B);var A={top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};B.makeClipping();return new Effect.Scale(B,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(D){new Effect.Scale(B,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(E){E.element.hide().undoClipping().setStyle(A)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(A){this.element=$(A);if(!this.element){throw (Effect._elementDoesNotExistError)}var D=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(D.style)){this.style=$H(D.style)}else{if(D.style.include(":")){this.style=D.style.parseStyle()}else{this.element.addClassName(D.style);this.style=$H(this.element.getStyles());this.element.removeClassName(D.style);var B=this.element.getStyles();this.style=this.style.reject(function(E){return E.value==B[E.key]});D.afterFinishInternal=function(E){E.element.addClassName(E.options.style);E.transforms.each(function(F){E.element.style[F.style]=""})}}}this.start(D)},setup:function(){function A(B){if(!B||["rgba(0, 0, 0, 0)","transparent"].include(B)){B="#ffffff"}B=B.parseColor();return $R(0,2).map(function(D){return parseInt(B.slice(D*2+1,D*2+3),16)})}this.transforms=this.style.map(function(H){var B=H[0],G=H[1],F=null;if(G.parseColor("#zzzzzz")!="#zzzzzz"){G=G.parseColor();F="color"}else{if(B=="opacity"){G=parseFloat(G);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(G)){var E=G.match(/^([\+\-]?[0-9\.]+)(.*)$/);G=parseFloat(E[1]);F=(E.length==3)?E[2]:null}}}var D=this.element.getStyle(B);return{style:B.camelize(),originalValue:F=="color"?A(D):parseFloat(D||0),targetValue:F=="color"?A(G):G,unit:F}}.bind(this)).reject(function(B){return((B.originalValue==B.targetValue)||(B.unit!="color"&&(isNaN(B.originalValue)||isNaN(B.targetValue))))})},update:function(A){var E={},B,D=this.transforms.length;while(D--){E[(B=this.transforms[D]).style]=B.unit=="color"?"#"+(Math.round(B.originalValue[0]+(B.targetValue[0]-B.originalValue[0])*A)).toColorPart()+(Math.round(B.originalValue[1]+(B.targetValue[1]-B.originalValue[1])*A)).toColorPart()+(Math.round(B.originalValue[2]+(B.targetValue[2]-B.originalValue[2])*A)).toColorPart():(B.originalValue+(B.targetValue-B.originalValue)*A).toFixed(3)+(B.unit===null?"":B.unit)}this.element.setStyle(E,true)}});Effect.Transform=Class.create({initialize:function(A){this.tracks=[];this.options=arguments[1]||{};this.addTracks(A)},addTracks:function(A){A.each(function(B){B=$H(B);var D=B.values().first();this.tracks.push($H({ids:B.keys().first(),effect:Effect.Morph,options:{style:D}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(B){var F=B.get("ids"),D=B.get("effect"),E=B.get("options");var A=[$(F)||$$(F)].flatten();return A.map(function(G){return new D(G,Object.extend({sync:true},E))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var B,A=$H();if(Prototype.Browser.WebKit){B=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';B=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(D){if(B[D]){A.set(D,B[D])}});if(Prototype.Browser.IE&&this.include("opacity")){A.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return A};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(A){var B=document.defaultView.getComputedStyle($(A),null);return Element.CSS_PROPERTIES.inject({},function(E,D){E[D]=B[D];return E})}}else{Element.getStyles=function(B){B=$(B);var D=B.currentStyle,A;A=Element.CSS_PROPERTIES.inject({},function(F,E){F[E]=D[E];return F});if(!A.opacity){A.opacity=B.getOpacity()}return A}}Effect.Methods={morph:function(A,B){A=$(A);new Effect.Morph(A,Object.extend({style:B},arguments[2]||{}));return A},visualEffect:function(D,B,E){D=$(D);var F=B.dasherize().camelize(),A=F.charAt(0).toUpperCase()+F.substring(1);new Effect[A](D,E);return D},highlight:function(A,B){A=$(A);new Effect.Highlight(A,B);return A}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(A){Effect.Methods[A]=function(B,D){B=$(B);Effect[A.charAt(0).toUpperCase()+A.substring(1)](B,D);return B}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(A){Effect.Methods[A]=Element[A]});Element.addMethods(Effect.Methods);if(!Control){var Control={}}Control.Slider=Class.create({initialize:function(A,D,E){var B=this;if(Object.isArray(A)){this.handles=A.collect(function(F){return $(F)})}else{this.handles=[$(A)]}this.track=$(D);this.options=E||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(F){return $(F)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled){this.setDisabled()}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(G,F){F=B.handles.length-1-F;B.setValue(parseFloat((Object.isArray(B.options.sliderValue)?B.options.sliderValue[F]:B.options.sliderValue)||B.range.start),F);G.makePositioned().observe("mousedown",B.eventMouseDown)});this.track.observe("mousedown",this.eventMouseDown);document.observe("mouseup",this.eventMouseUp);document.observe("mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var A=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(B){Event.stopObserving(B,"mousedown",A.eventMouseDown)})},setDisabled:function(){this.disabled=true},setEnabled:function(){this.disabled=false},getNearestValue:function(A){if(this.allowedValues){if(A>=this.allowedValues.max()){return(this.allowedValues.max())}if(A<=this.allowedValues.min()){return(this.allowedValues.min())}var D=Math.abs(this.allowedValues[0]-A);var B=this.allowedValues[0];this.allowedValues.each(function(E){var F=Math.abs(E-A);if(F<=D){B=E;D=F}});return B}if(A>this.range.end){return this.range.end}if(A<this.range.start){return this.range.start}return A},setValue:function(B,A){if(!this.active){this.activeHandleIdx=A||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles()}A=A||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((A>0)&&(B<this.values[A-1])){B=this.values[A-1]}if((A<(this.handles.length-1))&&(B>this.values[A+1])){B=this.values[A+1]}}B=this.getNearestValue(B);this.values[A]=B;this.value=this.values[0];this.handles[A].style[this.isVertical()?"top":"left"]=this.translateToPx(B);this.drawSpans();if(!this.dragging||!this.event){this.updateFinished()}},setValueBy:function(B,A){this.setValue(this.values[A||this.activeHandleIdx||0]+B,A||this.activeHandleIdx||0)},translateToPx:function(A){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(A-this.range.start))+"px"},translateToValue:function(A){return((A/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start)},getRange:function(B){var A=this.values.sortBy(Prototype.K);B=B||0;return $R(A[B],A[B+1])},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX)},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignX)},isVertical:function(){return(this.axis=="vertical")},drawSpans:function(){var A=this;if(this.spans){$R(0,this.spans.length-1).each(function(B){A.setSpan(A.spans[B],A.getRange(B))})}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value))}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))}},setSpan:function(B,A){if(this.isVertical()){B.style.top=this.translateToPx(A.start);B.style.height=this.translateToPx(A.end-A.start+this.range.start)}else{B.style.left=this.translateToPx(A.start);B.style.width=this.translateToPx(A.end-A.start+this.range.start)}},updateStyles:function(){this.handles.each(function(A){Element.removeClassName(A,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(E){if(Event.isLeftClick(E)){if(!this.disabled){this.active=true;var A=Event.element(E);var F=[Event.pointerX(E),Event.pointerY(E)];var D=A;if(D==this.track){var B=Position.cumulativeOffset(this.track);this.event=E;this.setValue(this.translateToValue((this.isVertical()?F[1]-B[1]:F[0]-B[0])-(this.handleLength/2)));var B=Position.cumulativeOffset(this.activeHandle);this.offsetX=(F[0]-B[0]);this.offsetY=(F[1]-B[1])}else{while((this.handles.indexOf(A)==-1)&&A.parentNode){A=A.parentNode}if(this.handles.indexOf(A)!=-1){this.activeHandle=A;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var B=Position.cumulativeOffset(this.activeHandle);this.offsetX=(F[0]-B[0]);this.offsetY=(F[1]-B[1])}}}Event.stop(E)}},update:function(A){if(this.active){if(!this.dragging){this.dragging=true}this.draw(A);if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(A)}},draw:function(B){var D=[Event.pointerX(B),Event.pointerY(B)];var A=Position.cumulativeOffset(this.track);D[0]-=this.offsetX+A[0];D[1]-=this.offsetY+A[1];this.event=B;this.setValue(this.translateToValue(this.isVertical()?D[1]:D[0]));if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this)}},endDrag:function(A){if(this.active&&this.dragging){this.finishDrag(A,true);Event.stop(A)}this.active=false;this.dragging=false},finishDrag:function(A,B){this.active=false;this.dragging=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this)}this.event=null}});if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")}var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(A,D,B){A=$(A);this.element=A;this.update=$(D);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(B)}else{this.options=B||{}}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(E,F){if(!F.style.position||F.style.position=="absolute"){F.style.position="absolute";Position.clone(E,F,{setHeight:false,offsetTop:E.offsetHeight})}Effect.Appear(F,{duration:0.15})};this.options.onHide=this.options.onHide||function(E,F){new Effect.Fade(F,{duration:0.15})};if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")}this.observer=null;this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)}},onKeyPress:function(A){if(this.active){switch(A.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(A);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(A);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(A);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(A);return}}else{if(A.keyCode==Event.KEY_TAB||A.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&A.keyCode==0)){return}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(B){var A=Event.findElement(B,"LI");if(this.index!=A.autocompleteIndex){this.index=A.autocompleteIndex;this.render()}Event.stop(B)},onClick:function(B){var A=Event.findElement(B,"LI");this.index=A.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(A){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var A=0;A<this.entryCount;A++){this.index==A?Element.addClassName(this.getEntry(A),"selected"):Element.removeClassName(this.getEntry(A),"selected")}if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(true)},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}this.getEntry(this.index).scrollIntoView(false)},getEntry:function(A){return this.update.firstChild.childNodes[A]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(G){if(this.options.updateElement){this.options.updateElement(G);return}var E="";if(this.options.select){var B=$(G).select("."+this.options.select)||[];if(B.length>0){E=Element.collectTextNodes(B[0],this.options.select)}}else{E=Element.collectTextNodesIgnoreClass(G,"informal")}var A=this.getTokenBounds();if(A[0]!=-1){var F=this.element.value.substr(0,A[0]);var D=this.element.value.substr(A[0]).match(/^\s+/);if(D){F+=D[0]}this.element.value=F+E+this.element.value.substr(A[1])}else{this.element.value=E}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,G)}},updateChoices:function(D){if(!this.changed&&this.hasFocus){this.update.innerHTML=D;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var A=0;A<this.entryCount;A++){var B=this.getEntry(A);B.autocompleteIndex=A;this.addObservers(B)}}else{this.entryCount=0}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},addObservers:function(A){Event.observe(A,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(A,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices()}else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var A=this.getTokenBounds();return this.element.value.substring(A[0],A[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var F=this.element.value;if(F.strip().empty()){return[-1,0]}var G=arguments.callee.getFirstDifferencePos(F,this.oldElementValue);var I=(G==this.oldElementValue.length?1:0);var E=-1,D=F.length;var H;for(var B=0,A=this.options.tokens.length;B<A;++B){H=F.lastIndexOf(this.options.tokens[B],G+I-1);if(H>E){E=H}H=F.indexOf(this.options.tokens[B],G+I);if(-1!=H&&H<D){D=H}}return(this.tokenBounds=[E+1,D])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(D,A){var E=Math.min(D.length,A.length);for(var B=0;B<E;++B){if(D[B]!=A[B]){return B}}return E};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(B,E,A,D){this.baseInitialize(B,E,D);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=A},getUpdatedChoices:function(){this.startIndicator();var A=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,A):A;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams}new Ajax.Request(this.url,this.options)},onComplete:function(A){this.updateChoices(A.responseText)}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(A,D,E,B){this.baseInitialize(A,D,B);this.options.array=E},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(A){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(B){var D=[];var F=[];var I=B.getToken();var H=0;for(var E=0;E<B.options.array.length&&D.length<B.options.choices;E++){var G=B.options.array[E];var J=B.options.ignoreCase?G.toLowerCase().indexOf(I.toLowerCase()):G.indexOf(I);while(J!=-1){if(J==0&&G.length!=I.length){D.push("<li><strong>"+G.substr(0,I.length)+"</strong>"+G.substr(I.length)+"</li>");break}else{if(I.length>=B.options.partialChars&&B.options.partialSearch&&J!=-1){if(B.options.fullSearch||/\s/.test(G.substr(J-1,1))){F.push("<li>"+G.substr(0,J)+"<strong>"+G.substr(J,I.length)+"</strong>"+G.substr(J+I.length)+"</li>");break}}}J=B.options.ignoreCase?G.toLowerCase().indexOf(I.toLowerCase(),J+1):G.indexOf(I,J+1)}}if(F.length){D=D.concat(F.slice(0,B.options.choices-D.length))}return"<ul>"+D.join("")+"</ul>"}},A||{})}});Field.scrollFreeActivate=function(A){setTimeout(function(){Field.activate(A)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(B,A,D){this.url=A;this.element=B=$(B);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(D);Object.extend(this.options,D||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId=""}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)}if(!this.options.externalControl){this.options.externalControlOnly=false}this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(A){if(!this._editing||A.ctrlKey||A.altKey||A.shiftKey){return}if(Event.KEY_ESC==A.keyCode){this.handleFormCancellation(A)}else{if(Event.KEY_RETURN==A.keyCode){this.handleFormSubmission(A)}}},createControl:function(H,D,B){var F=this.options[H+"Control"];var G=this.options[H+"Text"];if("button"==F){var A=document.createElement("input");A.type="submit";A.value=G;A.className="editor_"+H+"_button";if("cancel"==H){A.onclick=this._boundCancelHandler}this._form.appendChild(A);this._controls[H]=A}else{if("link"==F){var E=document.createElement("a");E.href="#";E.appendChild(document.createTextNode(G));E.onclick="cancel"==H?this._boundCancelHandler:this._boundSubmitHandler;E.className="editor_"+H+"_link";if(B){E.className+=" "+B}this._form.appendChild(E);this._controls[H]=E}}},createEditField:function(){var D=(this.options.loadTextURL?this.options.loadingText:this.getText());var B;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){B=document.createElement("input");B.type="text";var A=this.options.size||this.options.cols||0;if(0<A){B.size=A}}else{B=document.createElement("textarea");B.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);B.cols=this.options.cols||40}B.name=this.options.paramName;B.value=D;B.className="editor_field";if(this.options.submitOnBlur){B.onblur=this._boundSubmitHandler}this._controls.editor=B;if(this.options.loadTextURL){this.loadExternalText()}this._form.appendChild(this._controls.editor)},createForm:function(){var B=this;function A(F,D){var E=B.options["text"+F+"Controls"];if(!E||D===false){return}B._form.appendChild(document.createTextNode(E))}this._form=$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"))}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form)}A("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);A("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");A("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML}this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(A){if(this._saving||this._editing){return}this._editing=true;this.triggerCallback("onEnterEditMode");if(this.options.externalControl){this.options.externalControl.hide()}this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL){this.postProcessEditField()}if(A){Event.stop(A)}},enterHover:function(A){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML.unescapeHTML()},handleAJAXFailure:function(A){this.triggerCallback("onFailure",A);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(A){this.wrapUp();if(A){Event.stop(A)}},handleFormSubmission:function(E){var B=this._form;var D=$F(this._controls.editor);this.prepareSubmission();var F=this.options.callback(B,D)||"";if(Object.isString(F)){F=F.toQueryParams()}F.editorId=this.element.id;if(this.options.htmlResponse){var A=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(A,{parameters:F,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,A)}else{var A=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(A,{parameters:F,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,A)}if(E){Event.stop(E)}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl){this.options.externalControl.show()}this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(A){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var A=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(D){this._form.removeClassName(this.options.loadingClassName);var B=D.responseText;if(this.options.stripLoadedTextTags){B=B.stripTags()}this._controls.editor.value=B;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,A)},postProcessEditField:function(){var A=this.options.fieldPostCreation;if(A){$(this._controls.editor)["focus"==A?"focus":"activate"]()}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(A){Object.extend(this.options,A)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var A;$H(Ajax.InPlaceEditor.Listeners).each(function(B){A=this[B.value].bind(this);this._listeners[B.key]=A;if(!this.options.externalControlOnly){this.element.observe(B.key,A)}if(this.options.externalControl){this.options.externalControl.observe(B.key,A)}}.bind(this))},removeForm:function(){if(!this._form){return}this._form.remove();this._form=null;this._controls={}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(B,A){if("function"==typeof this.options[B]){this.options[B](this,A)}},unregisterListeners:function(){$H(this._listeners).each(function(A){if(!this.options.externalControlOnly){this.element.stopObserving(A.key,A.value)}if(this.options.externalControl){this.options.externalControl.stopObserving(A.key,A.value)}}.bind(this))},wrapUp:function(A){this.leaveEditMode();this._boundComplete(A,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,B,A,D){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(B,A,D)},createEditField:function(){var A=document.createElement("select");A.name=this.options.paramName;A.size=1;this._controls.editor=A;this._collection=this.options.collection||[];if(this.options.loadCollectionURL){this.loadCollection()}else{this.checkForExternalText()}this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js)){throw ("Server returned an invalid collection representation.")}this._collection=eval(js);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options)},showLoadingText:function(B){this._controls.editor.disabled=true;var A=this._controls.editor.firstChild;if(!A){A=document.createElement("option");A.value="";this._controls.editor.appendChild(A);A.selected=true}A.update((B||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();if(this.options.loadTextURL){this.loadExternalText()}else{this.buildOptionList()}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var A=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(B){this._text=B.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,A)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(E){return 2===E.length?E:[E,E].flatten()});var B=("value" in this.options)?this.options.value:this._text;var D=this._collection.any(function(E){return E[0]==B}.bind(this));this._controls.editor.update("");var A;this._collection.each(function(F,E){A=document.createElement("option");A.value=F[0];A.selected=D?F[0]==B:0==E;A.appendChild(document.createTextNode(F[1]));this._controls.editor.appendChild(A)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(A){if(!A){return}function B(D,E){if(D in A||E===undefined){return}A[D]=E}B("cancelControl",(A.cancelLink?"link":(A.cancelButton?"button":A.cancelLink==A.cancelButton==false?false:undefined)));B("okControl",(A.okLink?"link":(A.okButton?"button":A.okLink==A.okButton==false?false:undefined)));B("highlightColor",A.highlightcolor);B("highlightEndColor",A.highlightendcolor)};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(A){return Form.serialize(A)},onComplete:function(B,A){new Effect.Highlight(A,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(A){A.element.style.backgroundColor=A.options.highlightColor;if(A._effect){A._effect.cancel()}},onFailure:function(B,A){alert("Error communication with the server: "+B.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(A){A._effect=new Effect.Highlight(A.element,{startcolor:A.options.highlightColor,endcolor:A.options.highlightEndColor,restorecolor:A._originalBackground,keepBackgroundImage:true})}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};Form.Element.DelayedObserver=Class.create({initialize:function(B,A,D){this.delay=A||0.5;this.element=$(B);this.callback=D;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(A){if(this.lastValue==$F(this.element)){return}if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}});Object.extend(Autocompleter.Base.prototype,{markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}}});Object.extend(Ajax.Autocompleter.prototype,{initialize:function(B,E,A,D){this.baseInitialize(B,E,D);this.options.asynchronous=true;this.options.onShow=this.onShow.bind(this);this.options.onSuccess=this.onSuccess.bind(this);this.options.onFailure=this.onFailure.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=A},onShow:function(A,B){if(!B.style.position||B.style.position=="absolute"){B.style.position="absolute";if(Prototype.Browser.IE&&/MSIE\s8\.0/.test(navigator.userAgent)){B.show()}Position.clone(A,B,{setHeight:false,offsetTop:A.offsetHeight});B.hide()}Effect.Appear(B,{duration:0.15})},onSuccess:function(A){this.updateChoices(A.responseText)},onFailure:function(A){log.error("Ajax.Autocompleter: request failed")}});Ajax.AutocompleterJSON=Class.create(Ajax.Autocompleter,{onSuccess:function(F){try{var B=F.responseText.evalJSON(true);if(B.length>0){this.results=B}}catch(H){log.error("Ajax.Autocompleter: invalid response")}var D=new Element("div");var G=new Element("ul");D.appendChild(G);for(var A=0;A<B.length;A++){var E=new Element("li").update(B[A].suggestion);if(A%2==0){E.setAttribute("class","odd")}else{E.setAttribute("class","even")}G.appendChild(E)}if(this.options.transformResponse){G=this.options.transformResponse(G)}this.updateChoices(D.innerHTML)}});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,D,L,G,I,K,M,F,A,H){if(!document.getElementById){return}this.DETECT_KEY=H?H:"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(D){this.setAttribute("id",D)}if(L){this.setAttribute("width",L)}if(G){this.setAttribute("height",G)}if(I){this.setAttribute("version",new deconcept.PlayerVersion(I.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(K){this.addParam("bgcolor",K)}var B=M?M:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var J=(F)?F:window.location;this.setAttribute("xiRedirectUrl",J);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 D=this.getVariables();for(B in D){A.push(B+"="+D[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")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var E=this.getParams();for(var A in E){D+=[A]+'="'+E[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")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var E=this.getParams();for(var A in E){D+='<param name="'+A+'" value="'+E[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 D=(typeof A=="string")?document.getElementById(A):A;D.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var D=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){D=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(E){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");D=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(E){if(D.major==6){return D}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(E){}}if(B!=null){D=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}return D};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(E){var D=document.location.search||document.location.hash;if(D){var B=D.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==E){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var D=0;D<B.length;D++){B[D].style.display="none";for(var A in B[D]){if(typeof B[D][A]=="function"){B[D][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload)}if(Array.prototype.push==null){Array.prototype.push=function(A){this[this.length]=A;return this.length}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;(function(){if(window.google&&google.gears){return}var A=null;if(typeof GearsFactory!="undefined"){A=new GearsFactory()}else{try{A=new ActiveXObject("Gears.Factory");if(A.getBuildInfo().indexOf("ie_mobile")!=-1){A.privateSetGlobalObject(this)}}catch(B){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){A=document.createElement("object");A.style.display="none";A.width=0;A.height=0;A.type="application/x-googlegears";document.documentElement.appendChild(A)}}}if(!A){return}if(!window.google){google={}}if(!google.gears){google.gears={factory:A}}})();Persist=(function(){var H="0.2.0",G,J,A,I,F,D;D=(function(){var U="Thu, 01-Jan-1970 00:00:01 GMT",K=1000*60*60*24,T=["expires","path","domain"],M=escape,L=unescape,S=document,O;var P=function(){var V=new Date();V.setTime(V.getTime());return V};var B=function(Y,b){var X,W,a,Z=[],V=(arguments.length>2)?arguments[2]:{};Z.push(M(Y)+"="+M(b));for(X=0;X<T.length;X++){W=T[X];if(a=V[W]){Z.push(W+"="+a)}}if(V.secure){Z.push("secure")}return Z.join("; ")};var Q=function(){var W="__EC_TEST__",V=new Date();V=V.toGMTString();this.set(W,V);this.enabled=(this.remove(W)==V);return this.enabled};O={set:function(c,Y){var X=(arguments.length>2)?arguments[2]:{},W=P(),b,Z={};if(X.expires){var a=X.expires*K;Z.expires=new Date(W.getTime()+a);Z.expires=Z.expires.toGMTString()}var d=["path","domain","secure"];for(i=0;i<d.length;i++){if(X[d[i]]){Z[d[i]]=X[d[i]]}}var V=B(c,Y,Z);S.cookie=V;return Y},has:function(W){W=M(W);var Z=S.cookie,Y=Z.indexOf(W+"="),V=Y+W.length+1,X=Z.substring(0,W.length);return((!Y&&W!=X)||Y<0)?false:true},get:function(X){X=M(X);var a=S.cookie,Z=a.indexOf(X+"="),V=Z+X.length+1,Y=a.substring(0,X.length),W;if((!Z&&X!=Y)||Z<0){return null}W=a.indexOf(";",V);if(W<0){W=a.length}return L(a.substring(V,W))},remove:function(V){var X=O.get(V),W={expires:U};S.cookie=B(V,"",W);return X},keys:function(){var Z=S.cookie,Y=Z.split("; "),V,X,W=[];for(V=0;V<Y.length;V++){X=Y[V].split("=");W.push(L(X[0]))}return W},all:function(){var Z=S.cookie,Y=Z.split("; "),V,X,W=[];for(V=0;V<Y.length;V++){X=Y[V].split("=");W.push([L(X[0]),L(X[1])])}return W},version:"0.2.1",enabled:false};O.enabled=Q.call(O);return O}());var E=(function(){if(Array.prototype.indexOf){return function(B,K){return Array.prototype.indexOf.call(B,K)}}else{return function(L,M){var K,B;for(K=0,B=L.length;K<B;K++){if(L[K]==M){return K}}return -1}}})();F=function(){};A=function(B){return"PS"+B.replace(/_/g,"__").replace(/ /g,"_s")};C={search_order:["localstorage","globalstorage","whatwg_db","ie","flash"],name_re:/^[a-z][a-z0-9_ -]+$/i,methods:["init","get","set","remove","load","save"],sql:{version:"1",create:"CREATE TABLE IF NOT EXISTS persist_data (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)",get:"SELECT v FROM persist_data WHERE k = ?",set:"INSERT INTO persist_data(k, v) VALUES (?, ?)",remove:"DELETE FROM persist_data WHERE k = ?"},flash:{div_id:"_persist_flash_wrap",id:"_persist_flash",path:"/script/lib/vendor/persistjs/persist.swf",size:{w:1,h:1},args:{autostart:true}}};J={gears:{size:-1,test:function(){return(window.google&&window.google.gears)?true:false},methods:{transaction:function(K){var B=this.db;B.execute("BEGIN").close();K.call(this,B);B.execute("COMMIT").close()},init:function(){var B;B=this.db=google.gears.factory.create("beta.database");B.open(A(this.name));B.execute(C.sql.create).close()},get:function(B,L,K){var M,O=C.sql.get;if(!L){return}this.transaction(function(Q){var P,S;M=Q.execute(O,[B]);P=M.isValidRow();S=P?M.field(0):null;M.close();L.call(K||this,P,S)})},set:function(B,Q,M,L){var K=C.sql.remove,P=C.sql.set,O;this.transaction(function(S){S.execute(K,[B]).close();S.execute(P,[B,Q]).close();if(M){M.call(L||this,true,Q)}})},remove:function(K,M,L){var B=C.sql.get;sql=C.sql.remove,r,val=null,is_valid=false;this.transaction(function(O){if(M){r=O.execute(B,[K]);is_valid=r.isValidRow();val=is_valid?r.field(0):null;r.close()}if(!M||is_valid){O.execute(sql,[K]).close()}if(M){M.call(L||this,is_valid,val)}})}}},whatwg_db:{size:200*1024,test:function(){var B="PersistJS Test",K="Persistent database test.";if(!window.openDatabase){return false}if(!window.openDatabase(B,C.sql.version,K,J.whatwg_db.size)){return false}return true},methods:{transaction:function(B){if(!this.db_created){this.db.transaction(function(K){K.executeSql(C.sql.create,[],function(){this.db_created=true})},F)}this.db.transaction(B)},init:function(){this.db=openDatabase(this.name,C.sql.version,this.o.about||("Persistent storage for "+this.name),this.o.size||J.whatwg_db.size)},get:function(B,L,K){var M=C.sql.get;if(!L){return}K=K||this;this.transaction(function(O){O.executeSql(M,[B],function(P,Q){if(Q.rows.length>0){L.call(K,true,Q.rows.item(0)["v"])}else{L.call(K,false,null)}})})},set:function(B,P,M,L){var K=C.sql.remove,O=C.sql.set;this.transaction(function(Q){Q.executeSql(K,[B],function(){Q.executeSql(O,[B,P],function(S,T){if(M){M.call(L||this,true,P)}})})});return P},remove:function(K,M,L){var B=C.sql.get;sql=C.sql.remove;this.transaction(function(O){if(M){O.executeSql(B,[K],function(P,Q){if(Q.rows.length>0){var S=Q.rows.item(0)["v"];P.executeSql(sql,[K],function(T,U){M.call(L||this,true,S)})}else{M.call(L||this,false,null)}})}else{O.executeSql(sql,[K])}})}}},globalstorage:{size:5*1024*1024,test:function(){return window.globalStorage?true:false},methods:{key:function(B){return A(this.name)+A(B)},init:function(){this.store=globalStorage[this.o.domain]},get:function(B,L,K){B=this.key(B);if(L){L.call(K||this,true,this.store.getItem(B))}},set:function(B,M,L,K){B=this.key(B);this.store.setItem(B,M);if(L){L.call(K||this,true,M)}},remove:function(B,L,K){var M;B=this.key(B);M=this.store[B];this.store.removeItem(B);if(L){L.call(K||this,(M!==null),M)}}}},localstorage:{size:-1,test:function(){return window.localStorage?true:false},methods:{key:function(B){return A(this.name)+A(B)},init:function(){this.store=localStorage},get:function(B,L,K){B=this.key(B);if(L){L.call(K||this,true,this.store.getItem(B))}},set:function(B,M,L,K){B=this.key(B);this.store.setItem(B,M);if(L){L.call(K||this,true,M)}},remove:function(B,L,K){var M;B=this.key(B);M=this.getItem(B);this.store.removeItem(B);if(L){L.call(K||this,(M!==null),M)}}}},ie:{prefix:"_persist_data-",size:64*1024,test:function(){return window.ActiveXObject?true:false},make_userdata:function(K){var B=document.createElement("div");B.id=K;B.style.display="none";B.addBehavior("#default#userdata");document.body.appendChild(B);return B},methods:{init:function(){var B=J.ie.prefix+A(this.name);this.el=J.ie.make_userdata(B);if(this.o.defer){this.load()}},get:function(B,L,K){var M;B=A(B);if(!this.o.defer){this.load()}M=this.el.getAttribute(B);if(L){L.call(K||this,M?true:false,M)}},set:function(B,M,L,K){B=A(B);this.el.setAttribute(B,M);if(!this.o.defer){this.save()}if(L){L.call(K||this,true,M)}},remove:function(B,L,K){var M;B=A(B);if(!this.o.defer){this.load()}M=this.el.getAttribute(B);this.el.removeAttribute(B);if(!this.o.defer){this.save()}if(L){L.call(K||this,M?true:false,M)}},load:function(){this.el.load(A(this.name))},save:function(){this.el.save(A(this.name))}}},cookie:{delim:":",size:4000,test:function(){return G.Cookie.enabled?true:false},methods:{key:function(B){return this.name+J.cookie.delim+B},get:function(B,L,K){var M;B=this.key(B);M=D.get(B);if(L){L.call(K||this,M!=null,M)}},set:function(B,M,L,K){B=this.key(B);D.set(B,M,this.o);if(L){L.call(K||this,true,M)}},remove:function(B,M,L,K){var M;B=this.key(B);M=D.remove(B);if(L){L.call(K||this,M!=null,M)}}}},flash:{test:function(){if(!deconcept||!deconcept.SWFObjectUtil){return false}var B=deconcept.SWFObjectUtil.getPlayerVersion().major;return(B>=8)?true:false},methods:{init:function(){if(!J.flash.el){var M,K,L,B=C.flash;L=document.createElement("div");L.id=B.div_id;document.body.appendChild(L);M=new deconcept.SWFObject(this.o.swf_path||B.path,B.id,B.size.w,B.size.h,"8");for(K in B.args){M.addVariable(K,B.args[K])}M.write(L);J.flash.el=document.getElementById(B.id)}this.el=J.flash.el},get:function(B,L,K){var M;B=A(B);M=this.el.get(this.name,B);if(L){L.call(K||this,M!==null,M)}},set:function(K,O,M,L){var B;K=A(K);B=this.el.set(this.name,K,O);if(M){M.call(L||this,true,O)}},remove:function(B,L,K){var M;B=A(B);M=this.el.remove(this.name,B);if(L){L.call(K||this,true,M)}}}}};var I=function(){var O,K,B,M,L=C.methods,P=C.search_order;for(O=0,K=L.length;O<K;O++){G.Store.prototype[L[O]]=F}G.type=null;G.size=-1;for(O=0,K=P.length;!G.type&&O<K;O++){B=J[P[O]];if(B.test()){G.type=P[O];G.size=B.size;for(M in B.methods){G.Store.prototype[M]=B.methods[M]}}}G._init=true};G={VERSION:H,type:null,size:0,add:function(B){J[B.id]=B;C.search_order=[B.id].concat(C.search_order);I()},remove:function(K){var B=E(C.search_order,K);if(B<0){return}C.search_order.splice(B,1);delete J[K];I()},Cookie:D,Store:function(B,K){if(!C.name_re.exec(B)){throw new Error("Invalid name")}if(!G.type){throw new Error("No suitable storage found")}K=K||{};this.name=B;K.domain=K.domain||location.host||"localhost";K.domain=K.domain.replace(/:\d+$/,"");K.domain=(K.domain=="localhost")?"":K.domain;this.o=K;K.expires=K.expires||365*2;K.path=K.path||"/";this.init()}};I();return G})();Abstract.Agent=Class.create();Abstract.Agent.prototype={initialize:function(B,D){if(typeof(B)=="object"){try{Profiler.start(D.type);log.debug(D.type+".initialize() *");Object.extend(this,D);this.element=Element.extend(B);this.initExtend();Profiler.stop(D.type)}catch(A){Errors.capture(A,"Initialization failure : "+D.type,"Source element : "+B)}}},initializeChildren:function(){var self=this;this.childAgents=[];Page.childAgents[self.type].each(function(child,index){eval("new "+child.agent.type+"(child.element,self)");Page.childAgents[self.type][index]=null});Page.childAgents[self.type]=Page.childAgents[self.type].compact()},initExtend:function(){}};Abstract.ChildAgent=Class.create();Abstract.ChildAgent.prototype={initialize:function(D,A){if(typeof(D)=="object"){try{this.parent=A;this.element=Element.extend(D);this.agent=this.element.getAgents()[0];Object.extend(this,this.agent);Profiler.start(this.type);log.debug(this.agent.type+".initialize() *");this.initExtend.apply(this,arguments);A.childAgents.push(this);Profiler.stop(this.type)}catch(B){Errors.capture(B,"Initialization failure : "+this.agent.type,"Source element : "+D)}}},initExtend:function(){}};var Page={agents:[],childAgents:[],hideRevealRadios:[],init:function(){if(window.clientPerf){window.clientPerf.timestamp("jsRecd")}Profiler.start("Combined: Loading DOM + init");this.deferredAgents=[];this.domReadyAgents=[];var D=function(){if(!this.initPageRunning){this.initPageRunning=true;try{this.initPage()}catch(E){var F="beforeDOMReady init: "+E.name+": "+E.message;if(E.lineNumber){F+="; line "+E.lineNumber}log.error(F)}this.initPageRunning=false}else{log.error("Error: init currently running")}};var A=function(){if(!this.initPageRunning){window.clearInterval(this.initIntervalId);this.initPageRunning=true;delete this.initIntervalId;try{this.initPage(true)}catch(E){var F="onDOMReady init: "+E.name+": "+E.message;if(E.lineNumber){F+="; line "+E.lineNumber}log.error(F)}delete this.initPageRunning;Profiler.stop("Combined: Loading DOM + init")}else{window.clearInterval(this.initIntervalId);this.initIntervalId=window.setInterval(A.bind(this),100)}};var B=function(){if(window.clientPerf){window.clientPerf.timestamp("domReady")}window.clearInterval(this.initIntervalId);this.isDOMReady=true;log.info("DOM Ready");A.call(this)};this.initIntervalId=window.setInterval(D.bind(this),100);Event.onDOMReady(B.bind(this))},initAgent:function(element,agent){try{var object=(eval(("new "+agent.type+"(element, agent)")));if(!this.agents[agent.type]){this.agents[agent.type]=[]}this.agents[agent.type].push(object)}catch(e){log.warning("Error trying to instantiate agent of type "+agent.type+". Error: \n\n"+e)}},initializeAjaxResponse:function(A){var B=$(document.createElement("DIV"));B.innerHTML=A;Page.initializeDOMFragment(B)},locateAgentClass:function(F){var B=F.split(".");var D=window;try{for(var A=0;A<B.length;A++){D=D[B[A]]}}catch(E){log.error("Agent "+F+" cannot be found.");return}return D},initPage:function(H){var A=false;if(A){if(!this.pageInitNum){this.pageInitNum=1}else{this.pageInitNum++}log.info("Page.init "+this.pageInitNum+": begin")}else{log.info("Page.init begin")}Profiler.start("Page.init");if(!this.startOnTagIndex){this.startOnTagIndex=0}if(!this.workingElements){this.workingElements=[]}var K=document.getElementsByTagName("*");var L=K.length;for(var F=this.startOnTagIndex;F<L;F++){var J=K[F];if(J.getAttribute("agent")){this.workingElements.push($(J))}}for(var F=0;F<this.workingElements.length;F++){var B=this.workingElements[F];if(!B.isDOMReady()){if(A){log.warning("Not DOMReady: "+B.inspect().escapeHTML())}}else{this.workingElements[F]=null;var G=B.getAgents();if(G){if(window.clientPerf&&window.clientPerf.agentsNotStarted){window.clientPerf.timestamp("agentsStart")}for(var E=0;E<G.length;E++){var D=G[E];if(!Object.isString(D.type)){log.error("Agent type is not a string for "+this.workingElements[F+4]+". Missing quotes in SystemText popup?")}else{var I=this.locateAgentClass(D.type).prototype.beforeDOMReady;if(D.deferred=="true"){this.deferredAgents.push({element:B,agent:D})}else{if(D.childOf){if(!this.childAgents[D.childOf]){this.childAgents[D.childOf]=[]}this.childAgents[D.childOf].push({element:B,agent:D})}else{if(!I&&D.lazy!="true"){this.domReadyAgents.push({element:B,agent:D})}else{if(D.lazy!="true"){this.initAgent(B,D)}}}}}}}else{log.error("Could not retrieve agents for "+B.inspect().escapeHTML())}}}this.startOnTagIndex=L;this.workingElements=this.workingElements.compact();if(H){if(window.clientPerf&&window.clientPerf.agentsNotStarted){window.clientPerf.timestamp("agentsStart")}for(var F=0;F<this.domReadyAgents.length;F++){this.initAgent(this.domReadyAgents[F].element,this.domReadyAgents[F].agent)}for(var F=0;F<this.deferredAgents.length;F++){this.initAgent(this.deferredAgents[F].element,this.deferredAgents[F].agent)}if(window.clientPerf){window.clientPerf.timestamp("agentsFinish")}delete this.startOnTagIndex;delete this.deferredAgents;delete this.domReadyAgents}Profiler.stop("Page.init");if(A){log.info("Page.init "+this.pageInitNum+": end");if(H){delete this.pageInitNum}}},initializeDOMFragment:function(D){Profiler.start("DOMFragment.init");D=Element.extend(D);var A=D.getElementsByAttribute("agent");var B=[];var I=$A();for(var G=0;A[G];G++){var J=A[G];var H=J.getAgents();for(var F=0;H[F];F++){if(H[F].deferred=="true"){B.push({element:J,agent:H[F]})}else{if(H[F].childOf!=""&&H[F].childOf!=undefined){if(this.childAgents[H[F].childOf]==null){this.childAgents[H[F].childOf]=[]}this.childAgents[H[F].childOf].push({element:J,agent:H[F]})}else{if(H[F].lazy!="true"){this.initAgent(J,H[F])}}}}}for(var E=0;B[E];E++){this.initAgent(B[E].element,B[E].agent)}Profiler.stop("DOMFragment.init")}};var Calendar=Class.create();Calendar.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,datePattern:"",initExtend:function(){this.body=this.element.getFirstElementByClassName("calendarBody");this.dateSeparator=null;this.NUM_WEEKS=6;this.X_OFFSET=60;this.Y_OFFSET=-82;this.inputFocused=false;this.calendarFocused=false;this.daysPerMonth=[31,28,31,30,31,30,31,31,30,31,30,31];this.monthNames=this.params.months.split(",");this.dayNames=this.params.days.split(",");this.closeString=this.params.close;this.previousString=this.params.previous;this.nextString=this.params.next;var A=new Date(this.params.today);this.today=new Date(A.getFullYear(),A.getMonth(),A.getDate(),0,0,0);this.calDate=new Date(this.params.today);this.maxDate=new Date(this.params.maxDate);this.firstDayOfWeekIndex=this.params.firstDayOfWeekIndex/1;this.processPattern();var B=true;if(this.dateSeparator==null){B=false;log.warning("Calendar: unsupported date format or date separator pattern supplied.")}if(this.monthNames.length!=12){B=false;log.warning("Calendar: twelve (12) month names not defined")}if(this.dayNames.length!=7){B=false;log.warning("Calendar: seven (7) day names not defined")}if(this.pattern.string.length==0){B=false;log.warning("Calendar: invalid date format pattern")}if(B){this.isFirstDate=null;Event.observe(document,"mouseup",this.documentClick.bindAsEventListener(this));if(this.params.parentClass){this.ancestor=this.element.getParentByClassName(this.params.parentClass)}else{if(this.params.parentTag){this.ancestor=this.element.getParentByTagName(this.params.parentTag)}else{this.ancestor=$$("body")}}this.days=this.buildMarkupWithObservers();this.addInputObservers();this.repositionAndShim();this.element.addClassName("active")}else{this.gracefullyDegrade()}},gracefullyDegrade:function(){log.error("Calendar: initialization failed due to calendarRules model")},processPattern:function(){this.pattern=new Object();this.pattern.string=new String(this.params.pattern);this.pattern.localisedString=new String(this.params.localisedPattern);this.setDateSeparator(this.pattern.string);if(this.pattern.string.length!=0){this.pattern.string=this.pattern.string.toLowerCase();var A=this.pattern.string.split(this.dateSeparator);for(var D=0;D<A.length;D++){if(A[D].indexOf("y")!=-1){this.pattern.yearStringLength=A[D].length;A[D]="y"}if(A[D].indexOf("m")!=-1){A[D]="m"}if(A[D].indexOf("d")!=-1){A[D]="d"}}this.pattern.yearPosition=A.indexOf("y");this.pattern.monthPosition=A.indexOf("m");this.pattern.dayPosition=A.indexOf("d");var B=new String(A[0]+this.dateSeparator+A[1]+this.dateSeparator+A[2]);this.pattern.simpleString=B;B=B.replace("d","\\d{1,2}");B=B.replace("m","\\d{1,2}");B=B.replace("y","\\d{1,"+this.pattern.yearStringLength+"}");this.regExpPattern=new RegExp(B);Calendar.prototype.datePattern=this.pattern.string}},setDateSeparator:function(A){if(A.indexOf("/")!=-1&&A.indexOf("/")!=A.lastIndexOf("/")){this.dateSeparator="/"}else{if(A.indexOf("-")!=-1&&A.indexOf("-")!=A.lastIndexOf("-")){this.dateSeparator="-"}else{if(A.indexOf(".")!=-1&&A.indexOf(".")!=A.lastIndexOf(".")){this.dateSeparator="."}}}},formatDateString:function(D){var B=this.pattern;var F=B.simpleString;var A=D.split("_");var E=(A[0]/1)+1+"";if(E.length!=2){E="0"+E}F=F.replace("m",E);var H=A[1]+"";if(H.length!=2){H="0"+H}F=F.replace("d",H);var G=A[2]+"";if(G.length!=B.yearStringLength){while(G.length>B.yearStringLength){G=G.substr(1)}}F=F.replace("y",G);return F},buildMarkupWithObservers:function(){Event.observe(this.body,"mousedown",this.setCalendarFocus.bindAsEventListener(this));var L=$A();var F='<table cellpadding="0" cellspacing="0" border="0"><thead><tr>';F+='<th colspan="'+this.dayNames.length+'">'+this.previousString+this.nextString;F+='<span class="monthName"></span></th></tr></thead>';F+="<tbody><tr>";for(var H=0;this.dayNames[H];H++){var I=(H+this.firstDayOfWeekIndex)%this.dayNames.length;F+="<th>"+this.dayNames[I]+"</th>"}F+="</tr>";for(var D=0;D<this.NUM_WEEKS;D++){if(D==this.NUM_WEEKS-1){F+='<tr class="week last"></tr>'}else{F+='<tr class="week"></tr>'}}F+="</tbody></table>";F+='<div class="closeBar"><span>'+this.closeString+"</span></div>";this.body.update(F);var K=this.body.getElementsByClassName("arrow");this.previousArrow=K[0];this.nextArrow=K[1];Event.observe(this.nextArrow,"click",this.changeMonth.bindAsEventListener(this));Event.observe(this.previousArrow,"click",this.changeMonth.bindAsEventListener(this));var B=this.body.getFirstElementByClassName("closeBar");var J=B.getElementsByTagName("span")[0];Event.observe(J,"click",this.hideCalendar.bindAsEventListener(this));var A=this.body.getElementsByClassName("week");for(var G=0;G<A.length;G++){for(var H=0;this.dayNames[H];H++){var E=document.createElement("td");A[G].appendChild(E);L.push(E);Event.observe(E,"click",this.selectDate.bindAsEventListener(this));Event.observe(E,"mouseover",this.highlight.bindAsEventListener(this));Event.observe(E,"mouseout",this.clearHighlight.bindAsEventListener(this))}}return L},addInputObservers:function(){this.userStartDate=null;this.userEndDate=null;this.dateInputArray=$A();if(this.params.selectors){this.selectors=this.params.selectors.split(",");var B=$A();for(var J=0;this.selectors[J];J++){var I=this.ancestor.getElementsBySelector(this.selectors[J]);for(var G=0;I[G];G++){var D=I[G];var E=I[G].getElementsByTagName("input");for(var F=0;E[F];F++){var A=E[F];A.datePairParent=D;B.push(A);this.dateInputArray.push(A);if(A.value.length==0){A.value=this.pattern.localisedString}else{if(this.dateInputArray.length==1){this.userStartDate=this.validateDate(A.value)}else{this.userEndDate=this.validateDate(A.value)}}}if(this.dateInputArray.length==2){this.computeDuration(D)}}}for(var J=0;B[J];J++){Event.observe(B[J],"focus",this.showAndPosition.bindAsEventListener(this));Event.observe(B[J],"blur",this.setInputBlur.bindAsEventListener(this));if(B[J].form){var H=Element.extend(B[J].form).getInputs("submit");for(var G=0;H[G];G++){Event.observe(H[G],"click",this.clearField.bindAsEventListener(this,B[J]))}}}}},repositionAndShim:function(){var B=document.createElement("iframe");B.src="/script/empty.html";this.element.insertBefore(B,this.element.childNodes[0]);var A=this.element.parentNode;A.removeChild(this.element);this.ancestor.insertBefore(this.element,this.ancestor.childNodes[0])},showAndPosition:function(B){this.inputFocused=true;this.calendarFocused=false;var J=this.eventElement;log.info("previous event element="+J);this.eventElement=Event.element(B);if(J!=this.eventElement||!this.element.visibleByClass()){if(this.element.visibleByClass()){this.element.hideByClass()}var G=Position.positionedOffset(this.eventElement);var E=(G[0]+this.X_OFFSET)/Units.PX_TO_EM;var D=(G[1]+this.Y_OFFSET)/Units.PX_TO_EM;this.element.style.left=E+"em";this.element.style.top=D+"em";var K=this.validateDate();var F=true;var H=null;this.isFirstDate=true;for(i=1;i<this.dateInputArray.length;i++){if(this.dateInputArray[i]==this.eventElement){var I=null;var A=i-1;while(I==null&&A>=0){I=this.validateDate(this.dateInputArray[A].value);A--}this.userStartDate=I;this.isFirstDate=false}}if(this.isFirstDate){this.userStartDate=K;this.calDate=K;if(this.userStartDate==null){this.calDate=this.today;F=false}}else{this.userEndDate=K;this.calDate=K;if(this.userEndDate==null&&this.userStartDate!=null){this.calDate=this.userStartDate;H=this.userStartDate}else{if(this.userEndDate==null&&this.userStartDate==null){this.calDate=this.today;F=false}else{if(this.userStartDate!=null){if(this.compareDates(this.userEndDate,"<",this.userStartDate)){this.calDate=this.userStartDate;F=false}H=this.userStartDate}else{log.info("this.userStartDate is null, so not setting validStartDate")}}}}this.update(H,F);if(!this.element.visibleByClass()){this.element.showByClass()}}this.eventElement.select()},compareDates:function(dateA,compareString,dateB){var returnVal;try{var evalString=String(Date.parse(dateA)+compareString+Date.parse(dateB));log.info("method compareDates evaulation string = "+evalString);returnVal=eval(evalString)}catch(e){log.warning("method compareDates failed to execute properly. error message: "+e);returnVal=-1}return returnVal},validateDate:function(J){var B=null;var A=true;var E=(J==undefined?$F(this.eventElement):J);if(this.regExpPattern.test(E)){var H=E.split(this.dateSeparator);var F=H[this.pattern.dayPosition];var D=H[this.pattern.monthPosition];var G=H[this.pattern.yearPosition];if(G.length==2){G="20"+G}if(F<1||F>this.getTotalDays((D-1),G)){A=false}if(A&&(D<1||D>12)){A=false}if(A){var I=new Date(G,D-1,F,0,0,0);if(I<=this.maxDate&&I>=this.today){B=I}}}return B},update:function(K,J){log.info("calling calendar.update()");var A=false;if(K==null){K=this.today;A=true}if(this.calDate.getMonth()<=this.today.getMonth()&&this.calDate.getFullYear()==this.today.getFullYear()&&this.previousArrow.visibleByClass()){this.previousArrow.hideByClass()}else{if(this.calDate.getMonth()>this.today.getMonth()&&this.calDate.getFullYear()==this.today.getFullYear()&&!this.previousArrow.visibleByClass()){this.previousArrow.showByClass()}else{if(this.calDate.getFullYear()>this.today.getFullYear()&&!this.previousArrow.visibleByClass()){this.previousArrow.showByClass()}}}if(this.nextArrow.visibleByClass()&&this.calDate.getMonth()>=this.maxDate.getMonth()&&this.calDate.getFullYear()==this.maxDate.getFullYear()){this.nextArrow.hideByClass()}else{if(!this.nextArrow.visibleByClass()&&(A||(this.calDate.getMonth()<this.maxDate.getMonth()&&this.calDate.getFullYear()==this.maxDate.getFullYear()))){this.nextArrow.showByClass()}}var G=this.element.getFirstElementByClassName("monthName");G.innerHTML=this.monthNames[this.calDate.getMonth()]+" "+this.calDate.getFullYear();var M=this.cloneDateObject(this.calDate);M.setDate(1);var D=M.getDay()-this.firstDayOfWeekIndex;var B=(D<0?D+7:D);var F=false;var P=1;var O=this.calDate.getMonth()==K.getMonth()&&this.calDate.getFullYear()==K.getFullYear();var I=this.calDate.getMonth()==this.maxDate.getMonth()&&this.calDate.getFullYear()==this.maxDate.getFullYear();var E=(this.calDate.getFullYear()<K.getFullYear())||(this.calDate.getMonth()<K.getMonth()&&this.calDate.getFullYear()==K.getFullYear());var L=(this.calDate.getFullYear()>this.maxDate.getFullYear())||(this.calDate.getMonth()>this.maxDate.getMonth()&&this.calDate.getFullYear()==this.maxDate.getFullYear());var Q=this.getTotalDays(this.calDate.getMonth(),this.calDate.getFullYear());for(var H=0;this.days[H];H++){this.days[H].className="";this.days[H].setAttribute("date","");if(F==false){this.days[H].innerHTML="&nbsp;";if(H==B){F=true}}if(F){this.days[H].innerHTML=P;if((E||(P<K.getDate()&&O))||(L||(P>this.maxDate.getDate()&&I))){this.days[H].addClassName("inactive")}else{if(P==K.getDate()&&O&&A){this.days[H].addClassName("today")}if(P==this.calDate.getDate()&&J){this.days[H].addClassName("selected")}this.days[H].setAttribute("date",this.calDate.getMonth()+"_"+P+"_"+this.calDate.getFullYear())}if(P>=Q){F=false}P++}}},selectDate:function(D){var B=Event.element(D);var A=B.getAttribute("date");if(A){this.eventElement.value=this.formatDateString(A);if(this.isFirstDate){this.userStartDate=this.validateDate()}else{this.userEndDate=this.validateDate()}this.computeDuration(this.eventElement.datePairParent);this.hideCalendar()}},computeDuration:function(A){if(this.userStartDate!=null&&this.userEndDate!=null){A.tripDuration=Math.round((this.userEndDate-this.userStartDate)/86400000);DateDuration.prototype.updateDuration(A)}},highlight:function(B){if(Event.element){var A=Event.element(B);if(A.getAttribute("date")){A.addClassName("highlight")}}},clearHighlight:function(B){if(Event.element){var A=Event.element(B);if(A!=this.selectionElement&&A.getAttribute("date")){A.removeClassName("highlight")}}},getTotalDays:function(E,B){var D=((B%4==0&&B%100!=0)||B%400==0);var A=this.daysPerMonth[E];return(E==1&&D?A+1:A)},hideCalendar:function(){this.element.hideByClass();this.calendarFocused=false},setCalendarFocus:function(){this.calendarFocused=true},setInputBlur:function(A){if(this.isFirstDate){this.userStartDate=this.validateDate()}else{this.userEndDate=this.validateDate()}this.inputFocused=false;window.setTimeout(this.getFocus.bind(this),100)},documentClick:function(B){if(this.element.visibleByClass()){var A=Event.element(B);if(A.getParentByClassName("calendar")==null){this.calendarFocused=false;this.getFocus()}}},getFocus:function(){if(this.inputFocused==false&&this.calendarFocused==false&&this.element.visibleByClass()){this.hideCalendar()}},changeMonth:function(A){var D=Event.element(A);var B=this.cloneDateObject(this.calDate);var J=B.getMonth();var I=B.getFullYear();if(D.hasClassName("arrowPrev")){var E=J-1;if(E<0){E=11;I=I-1}var K=this.getTotalDays(E,I);if(B.getDate()>K){B.setDate(K)}B.setMonth(B.getMonth()-1);B.setYear(I);if(B.getMonth()<this.today.getMonth()&&B.getFullYear()==this.today.getFullYear()){B=this.today}}else{if(D.hasClassName("arrowNext")){var H=J+1;if(H>11){H=0;I=I+1}var K=this.getTotalDays(H,I);if(B.getDate()>K){B.setDate(K)}B.setMonth(B.getMonth()+1);B.setYear(I);if(B.getMonth()>this.maxDate.getMonth()&&B.getFullYear()==this.maxDate.getFullYear()){B=this.maxDate}}}this.calDate=B;var F=false;if((this.isFirstDate&&this.userStartDate!=null)||(!this.isFirstDate&&this.userEndDate==null&&this.userStartDate!=null)){if(this.calDate.getMonth()==this.userStartDate.getMonth()&&this.calDate.getFullYear()==this.userStartDate.getFullYear()){F=true}}else{if(!this.isFirstDate&&this.userEndDate!=null){if(this.calDate.getMonth()==this.userEndDate.getMonth()&&this.calDate.getFullYear()==this.userEndDate.getFullYear()){F=true}}}var G=null;if(!this.isFirstDate&&this.userStartDate!=null){G=this.userStartDate}this.update(G,F)},cloneDateObject:function(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate())},clearField:function(B,A){if(A.value==this.pattern.localisedString){A.value=""}}});var DateDuration=Class.create();DateDuration.prototype=Object.extend(new Abstract.Agent(),{initialized:false,initExtend:function(){var B=this.element;var A=document.createElement("label");A.className="control textInput durationLabel";A.innerHTML=this.params.labelContent;B.appendChild(A);if(B.tripDuration){this.updateDuration(B)}},updateDuration:function(B){if(B.tripDuration){var A=B.getFirstElementByClassName("durationLabel","label");if(A){var D=A.getFirstElementByClassName("readOnlyValue","span");D.innerHTML=B.tripDuration}}}});var RadioAsLink=Class.create();RadioAsLink.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){this.radio=null;var B=this.element.parentNode;var G=this.element.getElementsByTagName("a")[0];var E=document.createElement("label");var D=G.href;this.element.removeClassName("radioAsLink");var F=this.element.className;var H=(G.getAttribute("checked"))?" checked":"";E.className="radio "+F+H;var A='<input type="radio" name="'+G.getAttribute("name")+'" value="'+G.getAttribute("value")+'" ';A+='class="'+G.getAttribute("classes")+'" ';if(G.getAttribute("checked")){A+='checked="checked" '}A+="/>";E.innerHTML=A+G.innerHTML;B.replaceChild(E,this.element);E.childNodes[0].setAttribute("linkURL",D)}});var Matrix=Class.create();Matrix.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.table=this.element;var A=this.table.tBodies[0].rows[0].getElementsByTagName("TH").length;$A(this.table.tHead.rows).each(function(B){$A(B.cells).each(function(D,E){if(E<A){return}if(D.title!=""){D.title=D.title.strip()}Element.extend(D);if(D.innerHTML==""||D.hasClassName("noHighlight")){return}Event.observe(D,"mouseover",this.colHeaderMouseEvent.bind(this,E));Event.observe(D,"mouseout",this.colHeaderMouseEvent.bind(this,E));Event.observe(D,"click",this.cellClickEvent.bind(this,"TH"))}.bind(this))}.bind(this));$A(this.table.tBodies[0].rows).each(function(B){$A(B.cells).each(function(D,E){if(D.title!=""){D.title=D.title.strip()}Element.extend(D);if(D.innerHTML==""||D.hasClassName("noHighlight")){return}if(D.tagName=="TH"){Event.observe(D,"mouseover",this.rowHeaderMouseEvent.bind(this));Event.observe(D,"mouseout",this.rowHeaderMouseEvent.bind(this));Event.observe(D,"click",this.cellClickEvent.bind(this,"TH"))}else{Event.observe(D,"mouseover",this.cellMouseEvent.bind(this,E));Event.observe(D,"mouseout",this.cellMouseEvent.bind(this,E));Event.observe(D,"click",this.cellClickEvent.bind(this,"TD"))}}.bind(this))}.bind(this))},cellMouseEvent:function(A,D){var B=Event.findElementByTagName(D,"TD");var E=(D.type=="mouseover");this.highlightCell(B,E);this.highlightRowHeader(B,E);this.highlightColumnHeader(A,E)},rowHeaderMouseEvent:function(B){var A=Event.findElementByTagName(B,"TH");this.highlightRow(A,(B.type=="mouseover"))},colHeaderMouseEvent:function(A,B){this.highlightColumn(A,(B.type=="mouseover"))},cellClickEvent:function(D,B){var A=Event.findElementByTagName(B,D);if(A.getElementsByTagName("a")[0]){window.location=A.getElementsByTagName("a")[0].href}},highlightRowHeader:function(A,B){$A(A.parentNode.cells).each(function(D){if(D.tagName!="TH"){throw $break}this.highlightCell(D,B)}.bind(this))},highlightColumnHeader:function(A,B){$A(this.table.tHead.rows).each(function(D){this.highlightCell(D.cells[A],B)}.bind(this))},highlightRow:function(A,D,B){$A(A.parentNode.cells).each(function(E){this.highlightCell(E,D)}.bind(this))},highlightColumn:function(B,D,A){$A(this.table.rows).each(function(E){this.highlightCell(E.cells[B],D)}.bind(this))},highlightCell:function(A,B){if(A.hasClassName("noHighlight")){return}if(B){A.addClassName("hover")}else{A.removeClassName("hover")}}});var HideRevealRadio=Class.create();HideRevealRadio.prototype={initialize:function(A){this.hrRadio=A;this.groupName=this.hrRadio.input.name;if(!Page.hideRevealRadios[this.groupName]){Page.hideRevealRadios[this.groupName]=[]}Event.observe(this.hrRadio.input,this.hrRadio.eventType,this.groupEvent.bindAsEventListener(this));Page.hideRevealRadios[this.groupName].push(this);if(this.hrRadio.input.checked){if(!this.hrRadio.input.defaultChecked){var D=Page.hideRevealRadios[this.groupName];for(var B=0;D[B];B++){if(D[B].hrRadio.input.defaultChecked){D[B].hrRadio.toggle()}D[B].checked=false}this.hrRadio.toggle()}this.checked=true}},groupEvent:function(D){var A=Event.element(D);if(this.checked){return}var E=Page.hideRevealRadios[this.groupName];for(var B=0;E[B];B++){if(E[B].checked){E[B].hrRadio.toggle(D)}E[B].checked=false}this.hrRadio.toggle(D);this.checked=true}};var HideReveal=Class.create();HideReveal.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){log.info(this.selectors);this.targets=$A();this.swapContent=(this.swapContent)?this.swapContent:this.content;if(this.selectors){this.selectors=this.selectors.split(",")}if(this.swapSelectors){this.swapSelectors=this.swapSelectors.split(",")}switch(this.element.tagName){case"SPAN":this.hrType="link";if(!this.element.hasClassName("progressive")){this.bindObserver();this.updateContent()}break;case"A":this.hrType="link";this.bindObserver();this.updateContent();break;case"LABEL":this.inputs=this.element.getElementsByTagName("INPUT");if(this.inputs){var A=0;while(this.inputs[A]&&this.inputs[A].type=="hidden"){A++}this.input=this.inputs[A];this.hrType=this.input.type;switch(this.input.type){case"radio":new HideRevealRadio(this);break;case"checkbox":Event.observe(this.input,this.eventType,this.toggle.bindAsEventListener(this));if(this.input.checked){this.toggle()}break;default:log.warning('&lt;input type="'+this.input.type+'"&gt; not supported in HideReveal agent.');log.info("Please edit HideReveal.initExtend if you wish to implement hide/reveal functionality for this input type.")}}else{log.warning("&lt;label&gt; tag does not contain an input.")}break;case"DIV":this.bindObserver();break;default:log.warning("&lt;"+this.element.tagName+"&gt; tag not supported in HideReveal agent.");log.info("Please edit HideReveal.initExtend if you wish to implement hide/reveal functionality for this tag type.");break}},bindObserver:function(D,B){var A=D?D:this.toggle;var E=B?B:this;Event.observe(this.element,this.eventType,A.bindAsEventListener(E));if(this.radioValue){Event.observe(this.element,this.eventType,this.changeRadio.bind(this))}if(this.checkboxValue){Event.observe(this.element,this.eventType,this.toggleCheckbox.bind(this));Event.observe(this.input,this.eventType,this.toggleCheckbox.bind(this))}},toggleCheckbox:function(){this.input.checked=!(this.input.checked)},updateContent:function(A){var B=A?A:this.content;if(B){this.element.update(B);log.info("HideReveal is updating content to "+B)}this.content=this.swapContent;this.swapContent=B},findTargets:function(){this.targets=this._findTargets(this.selectors);if(this.swapSelectors){this.swapTargets=this._findTargets(this.swapSelectors)}var A=this.targets.length;log.info(A+" "+(A!=1?"targets":"target")+" found for HideReveal")},_findTargets:function(A){var B=[];A.each(function(E){if(this.parentClass){var F=this.element.getParentByClassName(this.parentClass);var D=F.getElementsBySelector(E);for(var G=0;D[G];G++){B.push(D[G])}}else{if(this.parentTag){var F=this.element.getParentByTagName(this.parentTag);var D=F.getElementsBySelector(E);for(var G=0;D[G];G++){B.push(D[G])}}else{var D=$$(E);for(var G=0;D[G];G++){B.push(D[G])}}}}.bind(this));return B},changeRadio:function(){var B=this.radioValue;var A,D;if(this.parentClass){ancestor=this.element.getParentByClassName(this.parentClass)}else{if(this.parentTag){ancestor=this.element.getParentByTagName(this.parentTag)}}if(ancestor){A=$A(ancestor.getElementsByClassName("radio"));A.each(function(F){var E=F.getElementsByTagName("input")[0];if(E.value==B){E.click()}})}},hide:function(B){for(var A=0;B[A];A++){B[A].hideByClass()}},show:function(B){for(var A=0;B[A];A++){B[A].showByClass()}},toggle:function(D){if(this.targets.length==0&&this.selectors.length>0){this.findTargets()}if(D){var A=Element.extend(Event.element(D));if(A.hasClassName("selected")){A.removeClassName("selected")}else{A.addClassName("selected")}if(this.hrType=="link"){Event.stop(D);this.updateContent()}if(this.removeOnEvent){this.element.remove()}}if(this.exclusive){if(this.currentState=="show"){this.hide(this.targets);if(this.swapTargets){this.show(this.swapTargets)}this.currentState="hide"}else{this.show(this.targets);if(this.swapTargets){this.hide(this.swapTargets)}this.currentState="show"}}else{for(var B=0;this.targets[B];B++){this.targets[B].toggleByClass()}}}});HideReveal.Progressive=Class.create();HideReveal.Progressive.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(A){if(!this.params.validIndices||!this.params.validIndices.length||this.params.currentIndex!=0&&this.params.currentIndex!=1||!this.params.expandSelectors||!this.params.expandLinks||!this.params.scopeClass||!this.params.linkClass){log.warning("HideReveal.Progressive.initExtend: exiting because required params missing or invalid");return}this.setIndex(this.params.currentIndex);this.createHideReveal(true);log.info("HideReveal.Progressive.initExtend has successfully completed")},setIndex:function(A){this.currentIndex=!isNaN(A)?A:this.getNextIndex();log.info("HideReveal.Progressive.currentIndex="+this.currentIndex)},getNextIndex:function(){var A=-1;for(var D=0;D<this.params.validIndices.length;D++){var B=parseInt(this.params.validIndices[D]);if(B>this.currentIndex){A=B;break}}return A},createLinkNode:function(){if(!this.linkNode){this.linkNode=this.element.appendChild(document.createElement("div"));this.linkNodeLink=this.linkNode.appendChild(document.createElement("span"));this.linkNodeLink.className="link "+this.params.linkClass;log.info("HideReveal.Progressive has created its link node")}},destroyLinkNode:function(){this.element.removeChild(this.linkNode);log.info("HideReveal.Progressive has destroyed its link node")},createHideReveal:function(A){if(A){this.createLinkNode()}if(this.getNextIndex()>=0){this.hideRevealLink=new HideReveal(this.linkNodeLink,{type:"HideReveal [inside HideReveal.Progressive]",eventType:"click",parentClass:this.params.scopeClass,selectors:"."+this.params.expandSelectors[this.getNextIndex()]});log.info("HideReveal.Progressive.hideRevealLink="+this.hideRevealLink);if(A){this.hideRevealLink.bindObserver(this.updateLink,this)}this.hideRevealLink.updateContent(this.params.expandLinks[this.currentIndex])}else{this.destroyLinkNode();log.info("HideReveal.Progressive has no hideRevealLink because index is out of bounds.")}},updateLink:function(){log.info("HideReveal.Progressive.updateLink called");log.info("type="+this.type);this.hideRevealLink.toggle();this.setIndex();this.createHideReveal()}});var Fixed=Class.create();Fixed.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(this.params&&this.params.adjustScrollForAnchoredPageLoads){this.adjustScrollForAnchoredPageLoads=true}else{this.adjustScrollForAnchoredPageLoads=false}this.element.addClassName("fixedAgentInPage");this.placeHolder=Element.extend(document.createElement("div"));this.placeHolder.setStyle({height:this.element.getHeight()+"px",width:this.element.getWidth()+"px"});this.placeHolder.addClassName("noneBlock");var A=Element.extend(this.element.parentNode);A.appendChild(this.placeHolder);this.iFrame=this.createIFrame(A);this.TEST_INTERVAL=100;this.initialYPos=new Position.cumulativeOffset(this.element)[1];this.initialXPos=new Position.cumulativeOffset(this.element)[0];this.fixedState=false;this.scrollingState=false;Event.observe(window,"scroll",this.setScrolling.bind(this));Event.observe(document,"mouseup",this.setScrolling.bind(this));this.testModeChange(this.adjustScrollForAnchoredPageLoads)},createIFrame:function(A){var B=null;if(this.params==null||this.params.hideIFrame==null||this.params.hideIFrame!=true){B=Element.extend(document.createElement("iframe"));B.addClassName("fixedAgentInPage");B.src="/script/empty.html";B.setStyle({height:A.getHeight()+"px",width:A.getWidth()+"px"});A.insertBefore(B,this.element)}return B},testModeChange:function(E){if(!this.fixedState){var B=new Position.cumulativeOffset(this.element)[1];if((B!=this.initialYPos)&&(B>=0)){this.initialYPos=B;log.info("Fixed Agent: Change initialYPos to "+B)}}if(!this.fixedState&&this.getVerticalScrolledDistance()>this.initialYPos){if(this.iFrame!=null){this.iFrame.removeClassName("fixedAgentInPage");this.iFrame.addClassName("fixedAgentLocked")}this.element.removeClassName("fixedAgentInPage");this.element.addClassName("fixedAgentLocked");this.placeHolder.showByClass();this.fixedState=true;if(E){var D=this.element.getDimensions();var A=D.height;if(document.body&&document.body.scrollTop){document.body.scrollTop=document.body.scrollTop+A}else{if(document.documentElement&&document.documentElement.scrollTop){document.documentElement.scrollTop=document.documentElement.scrollTop-A}}}}else{if(this.fixedState&&this.getVerticalScrolledDistance()<this.initialYPos){this.element.removeClassName("fixedAgentLocked");this.element.addClassName("fixedAgentInPage");this.element.style.left=0;this.placeHolder.hideByClass();if(this.iFrame!=null){this.iFrame.removeClassName("fixedAgentLocked");this.iFrame.addClassName("fixedAgentInPage")}this.fixedState=false}}if(this.fixedState){if(this.element.getStyle("position")=="fixed"){this.horizontalDistance=this.initialXPos-this.getHorizontalScrolledDistance();this.element.style.left=this.horizontalDistance+"px"}else{this.element.style.left=this.initialXPos}}else{this.element.style.left=0}},getVerticalScrolledDistance:function(){var A=0;if(document.body&&document.body.scrollTop){A=document.body.scrollTop}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.scrollTop}}return A},getHorizontalScrolledDistance:function(){var A=0;if(document.body&&document.body.scrollLeft){A=document.body.scrollLeft}else{if(document.documentElement&&document.documentElement.scrollLeft){A=document.documentElement.scrollLeft}}return A},setScrolling:function(){if(!this.scrollingState){this.scrollingState=true;setTimeout(function(){this.scrollingState=false}.bind(this),this.TEST_INTERVAL);setTimeout(function(){if(!this.scrollingState){this.testModeChange()}}.bind(this),(this.TEST_INTERVAL*1.5))}}});var PanelCollapse=Class.create();PanelCollapse.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.titleBar=this.element.getFirstElementByClassName("titleBar","div");if(this.titleBar.hasClassName("open")){this.opened=true}else{if(this.titleBar.hasClassName("closed")){this.opened=false}else{log.error("titleBar missing required class")}}this.panelContent=this.element.getFirstElementByClassName("panelContent","div");this.instructionLink=this.titleBar.getFirstElementByClassName("panelCollapse");this.title=this.titleBar.getElementsByTagName("H2")[0];this.titleText=this.title.getElementsByTagName("span")[0];this.expandCollapseLink=new Element("a");this.expandCollapseLink.href="#";this.title.insertBefore(this.expandCollapseLink,this.titleText);this.expandCollapseLink.innerHTML=this.params.collapseIcon+this.params.expandIcon;this.collapseIcon=this.expandCollapseLink.childElements()[0];this.expandIcon=this.expandCollapseLink.childElements()[1];if(this.opened){this.expandIcon.hide()}else{this.collapseIcon.hide();this.panelContent.hideByClass()}this.panelMessageElement=this.element.getFirstElementByClassName("panelMessage","div");this.panelMessage="";if(this.panelMessageElement!=null){this.panelMessage=this.panelMessageElement.innerHTML}this.dirtyFieldsMessage="";this.fieldsDirty=false;if(this.panelMessageElement!=null){var F=this.panelMessageElement.getParams();if((F!=null)&&(F.dirtyFieldsMessage!=null)){this.dirtyFieldsMessage=F.dirtyFieldsMessage}}this.fieldsToObserve=[];if(this.dirtyFieldsMessage!=""){var D=$A(this.element.getElementsByTagName("input"));var A=$A(this.element.getElementsByTagName("select"));var E=$A(this.element.getElementsByTagName("textArea"));this.fieldsToObserve=D.concat(A,E)}log.info(this.type+".fieldsToObserve: "+this.fieldsToObserve.length);for(var B=0;B<this.fieldsToObserve.length;B++){Event.observe(this.fieldsToObserve[B],"change",this.setFieldsDirty.bindAsEventListener(this))}Event.observe(this.expandCollapseLink,"click",this.toggleCollapse.bindAsEventListener(this));Event.observe(this.titleText,"click",this.toggleCollapse.bindAsEventListener(this));if(this.instructionLink){Event.observe(this.instructionLink,"click",this.toggleCollapse.bindAsEventListener(this))}},setFieldsDirty:function(){this.fieldsDirty=true;log.info("fields dirtied")},toggleCollapse:function(A){this.titleBar.toggleClasses("open","closed");this.opened=!(this.opened);if(this.opened){this.expandIcon.hide();this.collapseIcon.show();this.panelContent.showByClass()}else{this.collapseIcon.hide();this.expandIcon.show();this.panelContent.hideByClass()}if(this.fieldsDirty){if(this.opened){this.panelMessageElement.innerHTML=this.panelMessage}else{this.panelMessageElement.innerHTML=this.dirtyFieldsMessage}}A.preventDefault()}});var CollapseRemoteControl=Class.create();CollapseRemoteControl.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.collapseAgent;this.hideRevealAgent;this.anchor;if(this.params.anchorName!=null||this.params.anchorName!=""){this.anchor=document.anchors.namedItem(this.params.anchorName);if(this.anchor!=null){var B=this.anchor;var D=Page.agents.Collapse;while(B.parentNode!=document&&this.collapseAgent==null){B=B.parentNode;for(i=0;i<D.length;i++){if(D[i].element==B){this.collapseAgent=D[i];break}}}var A=Page.agents.HideReveal;while(this.hideRevealAgent==null){for(i=0;i<A.length;i++){if(A[i].element==this.collapseAgent.titleBar){this.hideRevealAgent=A[i];break}}}Event.observe(this.element,"click",this.expandTargetPanel.bindAsEventListener(this))}else{log.error("CollapseRemoteControl: could not find anchor named '"+this.params.anchorName+"', unable to initialize")}}else{log.error("CollapseRemoteControl: missing required param 'anchorName', unable to initialize")}},expandTargetPanel:function(){if(this.collapseAgent.opened==false){this.collapseAgent.collapse();this.hideRevealAgent.toggle()}}});var Interstitial=Class.create(Abstract.Agent,{interstitialResponseTimeout:2000,interstitialAssetsTimeout:1200,url:"/helper/interstitial",initExtend:function(){var A=this.element.tagName;this.isFramed=this.element.getParentByTagName("iframe");this.bodyWrapper=this.isFramed?Element.extend(top.document.getElementById("bodyWrapper")):Element.extend(document.getElementById("bodyWrapper"));if(A==="INPUT"){Event.observe(this.element,"click",function(){Event.observe(this.element.form,"submit",this.requestFormInterstitial.bind(this))}.bind(this))}else{if(A==="A"){Event.observe(this.element,"click",this.requestLinkInterstitial.bindAsEventListener(this))}else{if(A==="TABLE"||A==="TBODY"){Event.observe(this.element,"click",this.requestTableInterstitial.bindAsEventListener(this))}else{log.warning("Interstitial tried to initialize, but failed on element.tagName")}}}},requestFormInterstitial:function(B){log.debug("form interstitial");B.preventDefault();Form.HiddenField.add(this.element.form,this.element.name,this.element.value);var A=Form.serialize(this.element.form);this.action=function(){log.debug("interstitial: submitting form");this.element.form.submit()}.bind(this);this.getInterstitial(A.deleteQueryStringParam("_flowExecutionKey"))},requestLinkInterstitial:function(A){log.debug("link interstitial");A.preventDefault();var B=this.element.href.split("?")[1]||"";this.action=function(){log.debug("interstitial: following link");top.document.location=this.element.href}.bind(this);this.getInterstitial(B.deleteQueryStringParam("_flowExecutionKey"))},requestTableInterstitial:function(B){B.preventDefault();var A=Event.element(B);if(A.tagName!=="A"){A=Event.findElement(B,"TD");if(A!==document){A=A.getElementsByTagName("A")[0]}}if(A&&A.tagName==="A"){this.element=A;this.requestLinkInterstitial(B)}else{return false}},getInterstitial:function(E){var A=setTimeout(this.action,this.interstitialResponseTimeout);Event.observe(top,"pageshow",this.hideInterstitial.bindAsEventListener(this));var D=new Ajax.Request(this.url,{parameters:E,onSuccess:this.showInterstitial.bind(this,A)});this.bodyWrapper.addClassName("hideFromBrowser");var B=this.isFramed?Element.extend(top.document.body):Element.extend(document.body);B.addClassName("interstitial")},showInterstitial:function(A,B){clearTimeout(A);if(B.responseText.indexOf('status:"failed"')>-1){return}else{setTimeout((function(){var D=$(document.createElement("DIV"));D.innerHTML=B.responseText;Page.initializeDOMFragment(D);this.bodyWrapper.insert({before:D})}).bind(this),0)}setTimeout(this.action,this.interstitialAssetsTimeout)},hideInterstitial:function(){var A=Element.extend(top.document.getElementById("interBody"));if(A){A.remove()}if(this.bodyWrapper){this.bodyWrapper.removeClassName("hideFromBrowser")}if(Page.agents.ChangeSearchLightboxAgent){$(Page.agents.ChangeSearchLightboxAgent).each(function(B){B.dialogObject.close()})}}});var PopupWindow=Class.create();PopupWindow.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,windowProps:"width=620,height=400,left=20,top=20,resizable=yes,scrollbars=yes,status=yes",windowName:"popWin",initExtend:function(){Event.observe(this.element,"click",this.popWindow.bindAsEventListener(this))},popWindow:function(B){var A=window.open(this.element.href,this.windowName,this.windowProps);A.focus();if(B){Event.stop(B)}}});PopupWindow.FullSize=Class.create();PopupWindow.FullSize.prototype=Object.extend(new PopupWindow(),{windowProps:"width=720,height=500,left=0,top=0,resizable=yes,toolbar=yes,location=yes,scrollbars=yes,status=yes",windowName:"popWinFullSize"});PopupWindow.FullWindow=Class.create();PopupWindow.FullWindow.prototype=Object.extend(new PopupWindow(),{windowProps:"width="+screen.availWidth+",height="+screen.availHeight+",left=0,top=0,resizable=yes,toolbar=no,location=yes,scrollbars=yes,directories=no,status=no",windowName:"popWinFullScreen"});var RedirectOpenerOnClose=Class.create();RedirectOpenerOnClose.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.popupWindow=self;this.popupOpener=self.opener;if(this.popupOpener!=null&&this.params!=null&&this.params.sendOpenerTo!=null&&this.params.sendOpenerTo!=""){this.redirectOpenerURL=this.params.sendOpenerTo;Event.observe(self,"unload",this.redirectOpener.bindAsEventListener(this))}else{log.error(this.popupWindow+" missing sendOpenerTo param, or window is not a popup")}},redirectOpener:function(){if(this.redirectOpenerURL!=null){this.popupOpener.location.href=this.redirectOpenerURL}}});var ExitApp=Class.create();ExitApp.prototype=Object.extend(new Abstract.Agent(),{windowProps:"width=620,height=400,left=20,top=20,resizable=yes,scrollbars=yes,status=yes",windowName:"exitApp",popupEnabled:true,initExtend:function(){this.url="/info/bookingPathExitApp";var A=this.element.getElementsByTagName("input")[0];Event.observe(A,"click",this.disablePopup.bindAsEventListener(this));Event.observe(window,"unload",this.popExitApp.bindAsEventListener(this))},popExitApp:function(B){if(this.popupEnabled){var A=window.open(this.url,this.windowName,this.windowProps);A.blur();window.focus()}},disablePopup:function(A){ExitApp.prototype.popupEnabled=false}});var cancelExitApp=Class.create();cancelExitApp.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){Event.observe(this.element,"click",this.disableExitApp.bindAsEventListener(this))},disableExitApp:function(A){ExitApp.prototype.disablePopup()}});var ScriptContent=Class.create();ScriptContent.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!this.params.multiContent&&!this.params.content){log.warning("ScriptContent.initExtend: exiting because required params missing or invalid");return}this.insertionsToProcess=(this.params.multiContent?this.params.multiContent:[this.params]);this.insertionsToProcess.each(function(D){var E=D.targetClass?this.element.getFirstElementByClassName(D.targetClass):this.element;if(!E){log.warning("ScriptContent.initExtend: exiting because target node [class: "+D.targetClass+"] was not valid")}else{var B=document.createElement(D.containerType?D.containerType:"div");B.innerHTML=D.content;if(D.containerClass){B.className=D.containerClass}var A=D.insertAtTop?E.insertBefore(B,E.firstChild):E.appendChild(B);if(D.clickHandler){Event.observe(A,"click",D.clickHandler.bindAsEventListener(this))}Page.initializeDOMFragment(A)}}.bind(this))}});var AmenitiesList=Class.create();AmenitiesList.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.count=0;this.amenities=$A();var B=$A(this.element.getElementsByTagName("INPUT"));B.each(function(D){if(D.type!="checkbox"){return}this.amenities.push(D);if(D.checked){this.count++}}.bind(this));var A=this.params.maxSelections;this.maxSelectionsMinusOne=(A)?A-1:this.amenities.length;Event.observe(this.element,"click",this.amenityClick.bindAsEventListener(this));this.disableAmenities()},amenityClick:function(B){var A=Event.element(B);if(A.type!="checkbox"||A.disabled){return}if(A.checked){this.count++;this.disableAmenities()}else{this.count--;if(this.count==this.maxSelectionsMinusOne){this.amenities.each(function(D){D.disabled=false})}}},disableAmenities:function(){if(this.count>this.maxSelectionsMinusOne){this.amenities.each(function(A){if(!A.checked){A.disabled=true}})}}});ProductNav=Class.create();ProductNav.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.manager=new DialogManager(this.element.parentNode);this.radios=$A(this.element.getElementsByTagName("input"));this.radios.each(function(A){if(A.type=="radio"){Event.observe(A,"click",this.onClick.bindAsEventListener(this));if(A.checked){this.currentType=A.value}}}.bind(this))},onClick:function(E){if(!this.element.hasClassName("quickSearchNav")){location.href=Event.element(E).getAttribute("linkURL")}else{var B=Event.element(E).value;if(B!=this.currentType){this.manager.close();var A=B.substring(0,10)=="thirdParty";var F=A?"/helper/searchFormThirdParty":"/shop/searchForm";var D=new Ajax.Request(F,{parameters:"quickSearch=true&pathId=home&type="+B,onSuccess:this.success.bind(this),onFailure:this.failure});this.element.fire("agent:showIntrastitial");this.currentType=B}}},success:function(A){log.info("Response received from /shop/searchForm");this.element.fire("agent:hideIntrastitial",{newMarkup:A.responseText})},failure:function(){log.error("No response from /shop/searchForm")}});var QuickSearch=Class.create();QuickSearch.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!this.params.instructions){log.error("QuickSearch: No instruction content found")}this.instructions=this.params.instructions.unescapeXML();this.element.insert({before:this.instructions});this.instructions=this.element.previous();this.link=$(this.instructions.getElementsByTagName("A")[0]);if(!this.link){log.error("QuickSearch: No link found in instruction content")}this.link.observe("click",this.showContent.bindAsEventListener(this))},showContent:function(A){this.instructions.remove();this.element.showByClass();A.preventDefault()}});var SearchForm=Class.create();SearchForm.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.form=this.element.getFirstElementByClassName("searchFormForm","form");this.initializeChildren();this.listenElement=this.element.up(".searchFormPanel");if(!this.listenElement){this.listenElement=this.element}this.showListener=this.showIntrastitial.bind(this);this.listenElement.observe("agent:showIntrastitial",this.showListener);this.hideListener=this.hideIntrastitial.bind(this);this.listenElement.observe("agent:hideIntrastitial",this.hideListener)},showIntrastitial:function(A){this.element.addClassName("hidden");if(this.pi){if(this.pi.container.hasClassName("hidden")){this.pi.container.removeClassName("hidden")}this.pi.start()}else{this.pi=new ProgressIndicator();this.element.insert({top:this.pi.container})}this.pi.container.addClassName("visible");if(A){A.stopPropagation()}},hideIntrastitial:function(D){if(this.pi){this.pi.stop();if(this.pi.container.hasClassName("visible")){this.pi.container.removeClassName("visible")}this.pi.container.addClassName("hidden")}this.element.removeClassName("hidden");if(D&&D.memo&&D.memo.newMarkup){this.destroy();D.stopPropagation();var A=this.element.parentNode;this.element=null;A.update(D.memo.newMarkup.stripNoScripts());try{Page.initializeDOMFragment(A)}catch(B){Errors.capture(B,"SearchForm Ajax initialization failed")}}},destroy:function(){this.listenElement.stopObserving("agent:showIntrastitial",this.showListener);this.listenElement.stopObserving("agent:hideIntrastitial",this.hideListener);this.listenElement=null}});SearchForm.FlightTypes=Class.create();SearchForm.FlightTypes.prototype=Object.extend(new Abstract.ChildAgent(),{initExtend:function(B,A){this.searchForm=A;this.radios=$A(this.element.getElementsByTagName("input"));this.radios.each(function(D){Element.extend(D.parentNode);Event.observe(D,"click",this.onClick.bind(this));if(D.checked){this.currentType=D.value}}.bind(this))},onClick:function(){var A;this.radios.each(function(D){if(D.checked){A=D.value}});if(A!=this.currentType){this.radios.each(function(D){D.parentNode.removeClassName("checked");if(D.checked){D.parentNode.addClassName("checked")}});var B=new Ajax.Request("/shop/searchForm",{parameters:"type=air&ar.type="+A,onSuccess:this.success.bind(this),onFailure:this.failure});this.currentType=A;this.element.fire("agent:showIntrastitial")}},success:function(A){log.info("Successful response from /shop/searchForm");this.element.fire("agent:hideIntrastitial",{newMarkup:A.responseText})},failure:function(){log.error("No response from /shop/searchForm")}});SearchForm.MultiroomGuests=Class.create();SearchForm.MultiroomGuests.prototype=Object.extend(new Abstract.ChildAgent(),{initExtend:function(D,A){this.guestLabels=this.element.select("label");this.guestDropdowns=this.element.select("label select");this.guestDropdowns.each(function(E,F){if(F!=0){E.removeChild(E.down("option"))}});this.dialogManager=new DialogManager(this.element);this.multipleRoomsOptionText=this.params.multipleRoomsText;this.visibilityClass=this.params.visibilityClass;var B=$(A.form).down("div.rooms select");this.showGuestCounts(B);this.element.showByClass();Event.observe(B,"change",this.onChange.bindAsEventListener(this))},onChange:function(B){var A=Event.element(B);this.showGuestCounts(A);if(A.value<=1){this.dialogManager.close()}},showGuestCounts:function(B){var E=(B)?parseInt(B.value):1;var A=(E<=this.guestLabels.length)?E:1;var D=this.visibilityClass;var F=this.multipleRoomsOptionText;this.guestLabels.each(function(I,H){var G=I.down("span");if(A==1&&G){G.addClassName(D)}else{G.removeClassName(D)}if((A==F)||(H<A)){I.removeClassName("hidden")}else{I.addClassName("hidden")}})}});SearchForm.ChildTravelers=Class.create();SearchForm.ChildTravelers.prototype=Object.extend(new Abstract.ChildAgent(),{initExtend:function(D,B){this.childAgeDropdowns=this.element.getElementsByClassName("select");this.searchForm=Element.extend(B.form);var A=this.searchForm.getFirstElementByClassName("travelers");this.childDropdown=A.getElementsByTagName("select")[A.getElementsByTagName("select").length-1];this.showChildAges(this.childDropdown);this.childDropdownChange=this.onChange.bindAsEventListener(this);Event.observe(this.childDropdown,"change",this.childDropdownChange)},onChange:function(B){var A=Event.element(B);this.showChildAges(A)},showChildAges:function(B){var A=B.value;for(var D=0;D<this.childAgeDropdowns.length;D++){if(D<A){this.childAgeDropdowns[D].removeClassName("noneBlock")}else{this.childAgeDropdowns[D].addClassName("noneBlock")}}if(A>0){this.element.removeClassName("noneBlock")}else{this.element.addClassName("noneBlock")}}});SearchForm.APHButton=Class.create();SearchForm.APHButton.prototype=Object.extend(new Abstract.ChildAgent(),{initExtend:function(B,A){var D=this.element;var E=function(G){if(G&&D.disabled){return}D.disabled=G;D[(G)?"addClassName":"removeClassName"]("disabled")};var F=A.form.select(this.params.selectors);F.each(function(G){G.observe("click",function(){var H=false;if(this.checked){E(true)}else{F.each(function(I){if(I.checked){H=true;throw $break}});E(H)}})})}});SearchForm.CarLocationTypes=Class.create();SearchForm.CarLocationTypes.prototype=Object.extend(new Abstract.ChildAgent(),{initExtend:function(B,A){this.searchForm=A;this.pickup=B.getElementsBySelector('[name="car.pickupType"]')[0];this.dropoff=B.getElementsBySelector('[name="car.dropoffType"]')[0];Event.observe(this.pickup,"change",this.requestForm.bindAsEventListener(this));Event.observe(this.dropoff,"change",this.requestForm.bindAsEventListener(this))},requestForm:function(F){var B="";if(/\/home/.test(location.pathname)){B="&quickSearch=true"}var E="/shop/searchForm";if(/\/book/.test(location.pathname)){E="/book/bookingpath";var A=this.searchForm.form.elements._flowExecutionKey.value;B="&quickSearch=true&changeSearch=true&_eventId=changeSearchXSellCar&_flowExecutionKey="+A}var D=new Ajax.Request(E,{parameters:"type=car"+B+"&car.pickupType="+this.pickup.value+"&car.dropoffType="+this.dropoff.value,onSuccess:this.success.bind(this),onFailure:this.failure});this.element.fire("agent:showIntrastitial")},success:function(A){log.info("Response received from /shop/searchForm");this.element.fire("agent:hideIntrastitial",{newMarkup:A.responseText})},failure:function(){log.error("No response from /shop/searchForm")}});SearchForm.CarDriverAgeNote=Class.create();SearchForm.CarDriverAgeNote.prototype=Object.extend(new Abstract.ChildAgent(),{initExtend:function(D,B){var A=D.getElementsByTagName("select")[0];this.ageNote=D.getNthElementByClassName("alert",[1],"p");if(A.value=="21"){this.toggleNoteDisplay()}Event.observe(A,"change",this.toggleNoteDisplay.bindAsEventListener(this))},toggleNoteDisplay:function(){this.ageNote.toggleByClass()}});SearchForm.FauxRoomsDropdown=Class.create();SearchForm.FauxRoomsDropdown.prototype=Object.extend(new Abstract.ChildAgent(),{initExtend:function(D,B){this.formSubmits=$A();$A(B.element.getElementsByClassName("submit")).each(function(I){this.formSubmits.push(I.getElementsByTagName("input")[0])}.bind(this));this.multiBookingAlert=D.getFirstElementByClassName("alert","p");this.multipleRoomsOptionText=this.params.multipleRoomsText;if(this.multipleRoomsOptionText!=null&&this.formSubmits.length>0){if(D.getFirstElementByClassName("readOnlyValue","span")){var H=D.getFirstElementByClassName("readOnlyValue","span");var G=H.innerHTML;var A=Element.extend(D.getElementsByTagName("input")[0]);if(A){var E=A.name;var F=A.value;A.remove()}else{E="fakeRoomsSelect";F=G}optionText=G;this.fauxSelect=Element.extend(document.createElement("select"));this.fauxSelect.name=E;this.addOptionToSelect(this.fauxSelect,F,optionText);H.parentNode.appendChild(this.fauxSelect);H.remove()}else{if(D.getElementsByTagName("select")[0]){this.fauxSelect=D.getElementsByTagName("select")[0]}else{log.error("fauxRoomsDropdown: nothing to convert to a select");return false}}this.addOptionToSelect(this.fauxSelect,this.multipleRoomsOptionText,this.multipleRoomsOptionText);this.checkForFauxSelection();Event.observe(this.fauxSelect,"change",this.checkForFauxSelection.bindAsEventListener(this))}},addOptionToSelect:function(B,D,E){var A=Element.extend(document.createElement("option"));A.value=D;A.update(E);B.appendChild(A)},checkForFauxSelection:function(){if(this.fauxSelect.options[this.fauxSelect.selectedIndex].value==this.multipleRoomsOptionText){this.formSubmits.each(function(A){if(!A.disabled){this.toggleSubmitEnabled(A)}}.bind(this));this.multiBookingAlert.showByClass()}else{this.formSubmits.each(function(A){if(A.disabled){this.toggleSubmitEnabled(A)}}.bind(this));this.multiBookingAlert.hideByClass()}},toggleSubmitEnabled:function(A){A=$(A);A.disabled=!A.disabled;A.toggleClassName("disabled")}});SearchForm.SerializerLink=Class.create();SearchForm.SerializerLink.prototype=Object.extend(new Abstract.ChildAgent(),{initExtend:function(A,B){this.anchorTag=A;this.searchForm=B;Event.observe(A,"click",this.onClick.bindAsEventListener(this))},onClick:function(){var E=$A();var B=$A();var F="?";if(this.anchorTag.search!=""){var D=$A(this.anchorTag.search.substring(1,this.anchorTag.search.length).split("&"));D.each(function(G){B.push(G.split("=").first())});F="&"}Form.getElements(this.searchForm.form).each(function(H){if(B.indexOf(H.name)>-1){return}if(H.tagName.toLowerCase()=="input"&&H.type.toLowerCase()=="submit"){return}Calendar.prototype.clearField(this,H);var G=Form.Element.serialize(H);if(G){E.push(G)}});var A=F+E.join("&");this.anchorTag.href+=A}});SearchForm.RailFlyCheckbox=Class.create();SearchForm.RailFlyCheckbox.prototype=Object.extend(new Abstract.ChildAgent(),{initExtend:function(B,A){this.element=B;this.checkbox=this.element.down('input[type="checkbox"]');this.textField=this.element.getParentByTagName("form").getElementsByClassName("originText")[0].down('input[type="text"]');if(!this.checkbox){log.error("SearchForm.RailFlyCheckbox: checkbox not found");return}else{if(!this.textField){log.error("SearchForm.RailFlyCheckbox: text field not found");return}}if(this.checkbox.checked){this.checkbox.value="";this.disableTextField()}Event.observe(this.checkbox,"click",this.toggleTextField.bindAsEventListener(this))},toggleTextField:function(){this.checkbox.checked?this.disableTextField():this.enableTextField()},disableTextField:function(){this.oldTextFieldValue=this.textField.value;this.textField.value=this.params.railAndFlyText?this.params.railAndFlyText:"";this.textField.disabled=true;log.info("RailFlyCheckbox: disabled departure text")},enableTextField:function(){this.textField.value=this.oldTextFieldValue?this.oldTextFieldValue:"";this.textField.disabled=false;log.info("RailFlyCheckbox: enabled departure text")}});var ChangeSearch=Class.create();ChangeSearch.prototype=Object.extend(new Abstract.Agent("ChangeSearch"),{initExtend:function(){this.visible=false;Event.observe(this.element,"click",this.requestForm.bindAsEventListener(this))},showSelectBoxes:function(){var A=$A(document.getElementsByTagName("select"));A.each(function(B){B.style.visibility="visible"})},hideSelectBoxes:function(){var A=$A(document.getElementsByTagName("select"));A.each(function(B){B.style.visibility="hidden"})},requestForm:function(B){Event.stop(B);this.getPageDimensionsAndScroll();this.hideSelectBoxes();this.visible=true;this.modalDiv=document.createElement("div");this.modalDiv.className="modal";this.bodyWrapper=$("bodyWrapper");this.bodyWrapper.appendChild(this.modalDiv);this.modalDiv.style.height=this.pageHeight+"px";this.modalDiv.style.width=this.pageWidth+"px";this.modalDiv.style.filter="alpha(opacity=50)";this.modalDiv.style.opacity=0.5;this.modalDiv.style.MozOpacity=0.5;this.agentDiv=Element.extend(document.createElement("div"));this.bodyWrapper.appendChild(this.agentDiv);this.agentDiv.update(this.params.markup);this.closeWindowLink=this.agentDiv.getFirstElementByClassName("closeWindowLink");Event.observe(this.closeWindowLink,"click",this.close.bindAsEventListener(this));this.changeSearchDiv=this.agentDiv.getFirstElementByClassName("changeSearch");this.changeSearchDivHeight=this.changeSearchDiv.getHeight();this.changeSearchDivWidth=this.changeSearchDiv.getWidth();this.changeSearchDivTopMargin=0;if(this.changeSearchDivHeight<this.windowHeight){this.changeSearchDivTopMargin=(this.windowHeight-this.changeSearchDivHeight)*0.5}this.changeSearchDiv.style.marginTop=this.yScroll+this.changeSearchDivTopMargin+"px";this.changeSearchDivLeftMargin=0;if(this.changeSearchDivWidth<this.windowWidth){this.changeSearchDivLeftMargin=(this.windowWidth-this.changeSearchDivWidth)*0.5}this.changeSearchDiv.style.marginLeft=this.xScroll+this.changeSearchDivLeftMargin+"px";var D="";if(this.params.url){D=this.params.url;D="&"+D.substr(D.indexOf("?")+1)}else{D="&"+location.search.substring(1)}if(this.params.url&&this.params.url.indexOf("book")!=-1){D=D.replace("&amp%3B","&");D=D.replace("&amp;","&");var A=new Ajax.Request("/book/bookingpath",{parameters:"changeSearch=true"+D,onSuccess:this.success.bind(this),onFailure:this.failure})}else{var A=new Ajax.Request("/shop/searchForm",{parameters:"changeSearch=true"+D,onSuccess:this.success.bind(this),onFailure:this.failure})}},getPageDimensionsAndScroll:function(){if(window.innerHeight&&window.scrollMaxY){this.yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){this.yScroll=document.body.scrollHeight}else{this.yScroll=document.body.offsetHeight}}if(self.innerHeight){this.windowHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){this.windowHeight=document.documentElement.clientHeight}else{if(document.body){this.windowHeight=document.body.clientHeight}}}if(this.yScroll<this.windowHeight){this.pageHeight=this.windowHeight}else{this.pageHeight=this.yScroll}if(self.pageYOffset){this.yScroll=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){this.yScroll=document.documentElement.scrollTop}else{if(document.body){this.yScroll=document.body.scrollTop}}}if(window.innerWidth&&window.scrollMaxX){this.xScroll=window.innerWidth+window.scrollMaxX}else{if(document.body.scrollWidth>document.body.offsetWidth){this.xScroll=document.body.scrollWidth}else{this.xScroll=document.body.offsetWidth}}if(self.innerWidth){this.windowWidth=self.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){this.windowWidth=document.documentElement.clientWidth}else{if(document.body){this.windowWidth=document.body.clientWidth}}}if(this.xScroll<this.windowWidth){this.pageWidth=this.windowWidth}else{this.pageWidth=this.xScroll}if(self.pageXOffset){this.xScroll=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollLeft){this.xScroll=document.documentElement.scrollLeft}else{if(document.body){this.xScroll=document.body.scrollLeft}}}},close:function(A){Event.stop(A);this.visible=false;this.bodyWrapper.removeChild(this.modalDiv);this.bodyWrapper.removeChild(this.agentDiv);this.showSelectBoxes()},success:function(B){log.info("Response received from /shop/searchForm");if(this.visible){var A=this.agentDiv.getFirstElementByClassName("intrastitial");A.removeClassName("intrastitial");A.update(B.responseText);Page.initializeDOMFragment(A.parentNode.parentNode)}},failure:function(){log.error("No response from /shop/searchForm")}});var ResultsCard=Class.create();ResultsCard.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.airCarToggle=this.element.getFirstElementByClassName("airCarToggle");this.itinerary=this.element.getFirstElementByClassName("airCarResultInnerShell");this.mouseOverFlag=false;this.attachToggle()},attachToggle:function(){this.airCarToggleLink=this.airCarToggle.getFirstElementByClassName("toggleLink");var _agents=this.airCarToggleLink.getAgents();this.airCarToggleLinkHideReveal=_agents.detect(function(agent){return agent.type=="HideReveal"});this.hideRevealChild=eval("new "+this.airCarToggleLinkHideReveal.type+"(this.airCarToggleLink, this.airCarToggleLinkHideReveal)");Event.observe(this.itinerary,"click",this.toggleCard.bindAsEventListener(this));Event.observe(this.itinerary,"mouseover",this.highlight.bindAsEventListener(this));Event.observe(this.itinerary,"mouseout",this.resetCard.bindAsEventListener(this));Event.observe(this.element,"mouseout",this.resetCard.bindAsEventListener(this));Event.observe(this.airCarToggle,"mouseover",this.highlight.bindAsEventListener(this));Event.observe(this.airCarToggle,"mouseout",this.resetCard.bindAsEventListener(this))},highlight:function(A){this.mouseOverFlag=true;this.element.addClassName("airCarHighlight")},resetCard:function(A){this.mouseOverFlag=false;this.clearAll()},toggleCard:function(A){var B=Element.extend(Event.element(A));if(B.tagName!="A"&&!B.hasClassName("linkAsButton")){log.info("resultsCard triggering hideReveal toggle");this.hideRevealChild.toggle(A)}else{log.info("resultsCard allowing the click event to continue");log.info("tag name: "+B.tagName)}},clearTimer:function(A){clearTimeout(A)},clearAll:function(){if(!this.mouseOverFlag){this.element.removeClassName("airCarHighlight")}}});var miniHotelForm=Class.create();miniHotelForm.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.triggerElement=this.element;this.triggerElement.pos=this.triggerElement.getPosition();this.paramsHash=$H(this.params);Event.observe(this.triggerElement,"click",this.showForm.bindAsEventListener(this));this.makeMiniForm()},makeMiniForm:function(){if($("miniHotelFormContainer")==null&&this.params.formMarkup){var B=Element.extend(document.createElement("div"));B.id="miniHotelFormContainer";B.className="noneBlock";var D=this.params.formMarkup.stripNoScripts();B.innerHTML=D;$("main").appendChild(B);var E=B.getFirstElementByClassName("closeFlyOut","span");Event.observe(E,"click",this.hideForm.bindAsEventListener(this));try{Page.initializeDOMFragment(B)}catch(A){Errors.capture(A,"initializeDOMFragment() failed for miniHotelForm();")}}},showForm:function(D){var A=$("miniHotelFormContainer");this.fixIE7Positioning();var B=A.getElementsByTagName("form")[0];Position.putInViewport(this.triggerElement,A);A.showByClass();this.paramsHash.each(function(F){if(F.key!="formMarkup"){var E=B.getInputs("hidden",F.key)[0];if(E==null){E=new Element("input",{type:"hidden",name:F.key})}E.value=F.value;B.appendChild(E)}}.bind(this));Event.stop(D)},fixIE7Positioning:function(B){var A=this.triggerElement.getParentByClassName("column1");if(A){A.style.position="relative"}},hideForm:function(A){$("miniHotelFormContainer").hideByClass();Event.stop(A)}});var GroupedMiniHotelForm=Class.create(Object.extend(new miniHotelForm(),{initExtend:function(){this.makeMiniForm();Event.observe(this.element,"click",function(A){try{var D=Event.element(A);var B="";if(D.tagName.toLowerCase()=="a"&&(B=D.getAgents()[0])&&B.type=="MiniHotelFormData"){Event.stop(A);this.paramsHash=$H(B.params);this.triggerElement=D;this.triggerElement.pos=this.triggerElement.getPosition();this.showForm()}}catch(E){Errors.capture(E,"in capture click for miniHotelForm")}}.bind(this))}}));var SelectFromPopup=Class.create();SelectFromPopup.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var A=this.element;Event.observe(A,"click",this.loadLinkInOpener.bindAsEventListener(this))},loadLinkInOpener:function(A){self.opener.location.href=this.element.href;Event.stop(A);self.close()}});var PhotoGallery=Class.create();PhotoGallery.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var D=this.element.parentNode;this.images=$A();this.imageIndex=0;$A(D.getElementsByTagName("A")).each(function(E){this.images.push(E)}.bind(this));D.removeChild(this.element);this.image=document.createElement("IMG");this.header=document.createElement("P");this.image.src=this.images[this.imageIndex].href;this.image.alt="";this.header.appendChild(document.createTextNode("1"));this.header.appendChild(document.createTextNode(" "+this.params.numText.strip()+" "+this.images.length));if(this.images.length>1){this.header.appendChild(document.createTextNode(" : "));var A=document.createElement("A");var B=document.createElement("A");A.appendChild(document.createTextNode(this.params.nextLink.strip()));B.appendChild(document.createTextNode(this.params.previousLink.strip()));A.href="#";B.href="#";this.header.appendChild(B);this.header.appendChild(document.createTextNode(" | "));this.header.appendChild(A);Event.observe(A,"click",this.nextClick.bind(this));Event.observe(B,"click",this.previousClick.bind(this));D.appendChild(this.header)}D.appendChild(this.image)},nextClick:function(A){this.imageIndex=(this.imageIndex+1>=this.images.length)?0:this.imageIndex+1;this.image.src=this.images[this.imageIndex].href;this.image.alt=this.images[this.imageIndex].title;this.header.firstChild.nodeValue=this.imageIndex+1;Event.stop(A)},previousClick:function(A){this.imageIndex=(this.imageIndex-1<0)?this.images.length-1:this.imageIndex-1;this.image.src=this.images[this.imageIndex].href;this.image.alt=this.images[this.imageIndex].title;this.header.firstChild.nodeValue=this.imageIndex+1;Event.stop(A)}});var UserReviewOverviewGraph=Class.create();UserReviewOverviewGraph.prototype=Object.extend(new Abstract.Agent(),{pxPerUnit:27,initExtend:function(){$A(this.element.getElementsByClassName("score")).each(function(D){var F=D.innerHTML.replace(/,/g,".");var E=Math.floor(F*this.pxPerUnit);D.style.width=(E/Units.PX_TO_EM)+"em"}.bind(this));var A='<dt class="noneBlock graphHeading">&nbsp;</dt><dd class="graphHeading"><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span></dd>';var B=this.element.getElementsByTagName("dl")[0].innerHTML;this.element.getElementsByTagName("dl")[0].innerHTML=A+B;this.element.addClassName("userReviewGraph")}});var MemberSignin=Class.create();MemberSignin.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.isMember=false;this.signInModule=this.element.getElementsBySelector("div.signIn")[0];this.nonMemberText=this.element.getElementsBySelector("p.nonMemberIntroText")[0];$A(this.element.getElementsByTagName("input")).each(function(B){if(B.type=="radio"){Event.observe(B,"click",this.click.bindAsEventListener(this));if((B.checked)&&(B.value=="true")){this.isMember=true;this.nonMemberText.hideByClass();this.signInModule.showByClass()}}}.bind(this));var A=this.element.getParentByTagName("form");Event.observe(A,"submit",this.submit.bindAsEventListener(this))},click:function(A){if(Event.element(A).value=="true"){this.isMember=true;this.nonMemberText.hideByClass();this.signInModule.showByClass()}else{this.isMember=false;this.signInModule.hideByClass();this.nonMemberText.showByClass()}},submit:function(A){if(!this.isMember){log.info('Stopping submit event on Login form since user has selected "I am not a member."');Event.stop(A)}}});var SubmitSelectOnChange=Class.create();SubmitSelectOnChange.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.select=this.element.getElementsByTagName("select")[0];this.submit=this.element.getFirstElementByClassName("submit").getElementsByTagName("input")[0];if(!this.select||!this.submit){log.error("Could not find required element");return}Event.observe(this.select,"change",this.onChange.bindAsEventListener(this))},onChange:function(A){if(this.select.value){this.submit.click()}}});var CCVImage=Class.create();CCVImage.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.creditCardList=this.params.cardsInList;this.image=Element.extend(this.element.parentNode).getFirstElementByClassName("ccvImg");this.textBlock=Element.extend(this.element.parentNode).getFirstElementByClassName("ccvText");this.displayBlock=Element.extend(this.element.parentNode).getFirstElementByClassName("ccvDisplay");this.content3DSBlock=$A(this.element.parentNode.getElementsByClassName("cc3DSContent"));this.display3DSBlock=Element.extend(this.element.parentNode).getFirstElementByClassName("cc3DSDisplay");$A(this.element.getElementsByTagName("input")).each(function(A){if(A.type=="radio"){if(this.image!=null){Event.observe(A,"click",this.swapCCVImage.bindAsEventListener(this))}if(this.content3DSBlock!=null&&this.content3DSBlock.length>=3){Event.observe(A,"click",this.swap3DSContent.bindAsEventListener(this))}}}.bind(this));this.swapCCVImage();this.swap3DSContent()},swapCCVImage:function(A){for(i=0;i<this.creditCardList.length;i++){if(this.creditCardList[i].code==Event.element(A).value){this.image.innerHTML=this.creditCardList[i].img;if(this.creditCardList[i].img==""){this.displayBlock.hideByClass()}else{this.displayBlock.showByClass()}this.textBlock.innerHTML=this.creditCardList[i].text;break}}},swap3DSContent:function(E){for(i=0;i<this.creditCardList.length;i++){if(this.creditCardList[i].code==Event.element(E).value){var A=Element.extend(this.content3DSBlock[1]).getElementsBySelector(".cc3DSContentItem");var D="cc3DSContentItem"+this.creditCardList[i].code;for(var B=0;B<A.length;B++){if(D.match(A[B].id)){A[B].showByClass()}else{A[B].hideByClass()}}this.content3DSBlock[0].hideByClass();this.content3DSBlock[2].innerHTML="<p>"+this.creditCardList[i].securetext+"</p>";this.content3DSBlock[2].showByClass();if(this.creditCardList[i].securetext){this.display3DSBlock.showByClass()}else{this.display3DSBlock.hideByClass()}break}}}});var TagCloud=Class.create();TagCloud.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){Event.observe(this.element,"click",this.addTagToInput.bindAsEventListener(this))},addTagToInput:function(B){if(!this.textInput){this.textInput=this.element.up("form").down("label.keywords input")}if(!this.textInput){log.error("TagCloud: No text box found");return}var A=B.findElement("A");if(A){if(this.textInput.value.length>0){if(!this.textInput.value.strip().endsWith(",")){this.textInput.value+=","}if(!this.textInput.value.endsWith(" ")){this.textInput.value+=" "}}if(A.textContent){this.textInput.value+=A.textContent}else{if(A.innerText){this.textInput.value+=A.innerText}}}B.preventDefault()}});var SelectHideReveal=Class.create();SelectHideReveal.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.dropDown=this.element;this.parentNode=this.element.getParentByClassName(this.params.parentClass);Event.observe(this.dropDown,"change",this.toggleElements.bindAsEventListener(this))},toggleElements:function(){var A=(this.dropDown[this.dropDown.selectedIndex].value!=="")?this.dropDown[this.dropDown.selectedIndex].value:this.params.blankOptionName;for(var D=0;D<this.params.paymentOptions[A].showClasses.length;D++){$A(this.parentNode.getElementsByClassName(this.params.paymentOptions[A].showClasses[D])).each(function(E){E.showByClass()})}for(var B=0;B<this.params.paymentOptions[A].hideClasses.length;B++){$A(this.parentNode.getElementsByClassName(this.params.paymentOptions[A].hideClasses[B])).each(function(E){E.hideByClass()})}}});var AutoSubmitter=Class.create();AutoSubmitter.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){setTimeout(function(){this.element.click()}.bind(this),500)}});var CCSpecialFields=Class.create();CCSpecialFields.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.container=this.element.getParentByClassName("editBillingProfileInclude");this.targetFields=$A(this.container.getElementsByClassName(this.params.targetClassname));this.cardIDsRequiringFields=[];this.params.cardIDs.each(function(A){log.info("Adding "+A.code+" to special card array for "+this.params.targetClassname+" classed objects.");this.cardIDsRequiringFields[A.code]=true}.bind(this));$A(this.element.getElementsByTagName("input")).each(function(A){if(A.type=="radio"){Event.observe(A,"click",this.showHideFields.bindAsEventListener(this))}}.bind(this))},showHideFields:function(B){var A=Event.element(B).value;if(this.cardIDsRequiringFields[A]){this.targetFields.each(function(D){D.showByClass()}.bind(this))}else{this.targetFields.each(function(D){D.hideByClass()}.bind(this))}}});var CustomerAddressForm=Class.create();CustomerAddressForm.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.countryInput=null;this.countrySelect=null;this.countryWrapper=this.element.getFirstElementByClassName("addressCountryField");this.cityWrapper=this.element.getFirstElementByClassName("addressCityField");if(this.countryWrapper.getElementsByTagName("input").length>0){this.countryInput=this.element.getElementsByTagName("input")[0]}if(this.countryWrapper.getElementsByTagName("select").length>0){this.countrySelect=this.element.getElementsByTagName("select")[0]}this.stateProvince=this.element.getFirstElementByClassName("stateProvince");this.initialHTML=this.stateProvince.innerHTML;this.initialValue="";this.stateProvince.hasError=Element.extend(this.stateProvince.getElementsByTagName("label")[0]).hasClassName("error");if(this.stateProvince.getElementsByTagName("input").length>0){this.initialValue=this.stateProvince.getElementsByTagName("input")[0].value}if(this.stateProvince.getElementsByTagName("select").length>0){this.initialValue=this.stateProvince.getElementsByTagName("select")[0][this.stateProvince.getElementsByTagName("select")[0].selectedIndex].value}this.postalCodeWrapper=this.element.getFirstElementByClassName("postalCode");this.countriesWithoutPostalCode=$A(this.params.countriesWithoutPostalCode.split(","));this.getListAjax();this.setPostalCode();if(this.countrySelect!=null){Event.observe(this.countrySelect,"change",this.getListAjax.bindAsEventListener(this));Event.observe(this.countrySelect,"change",this.setPostalCode.bindAsEventListener(this))}},setPostalCode:function(){var A=null;if(this.countryInput!=null){A=this.countryInput.value}if(this.countrySelect!=null){A=this.countrySelect[this.countrySelect.selectedIndex].value}var B=false;for(i=0;i<this.countriesWithoutPostalCode.length;i++){if(this.countriesWithoutPostalCode[i]==A){B=true;break}}if(B){this.postalCodeWrapper.hideByClass()}else{this.postalCodeWrapper.showByClass()}},getListAjax:function(){this.stateProvince.addClassName("intrastitial");var A=null;if(this.countryInput!=null){A=this.countryInput.value}if(this.countrySelect!=null){A=this.countrySelect[this.countrySelect.selectedIndex].value}var B=new Ajax.Request("/helper/populateStateList",{parameters:"models[countryCode].countryCode="+A,onSuccess:this.success.bind(this),onFailure:this.failure.bind(this),onException:this.failure.bind(this)})},success:function(A){log.info("Response recieved from stateProvince AJAX");this.fillDiv(A.responseText);this.stateProvince.removeClassName("intrastitial")},failure:function(A){log.error("No response from stateProvince AJAX");this.initialFill(this.initialHTML);this.stateProvince.removeClassName("intrastitial")},fillDiv:function(E){var G="";var F=new RegExp('name="[^"]*"');G=E.replace(F,'name="'+this.params.stateProvinceBindNode+'"');var A=new RegExp('value="[^"]*"');G=G.replace(A,'value="'+this.initialValue+'"');this.stateProvince.update(G);if(this.stateProvince.hasError){this.stateProvince.getElementsByTagName("label")[0].addClassName("error")}if(this.stateProvince.getElementsByTagName("select").length>0){var B=this.stateProvince.getElementsByTagName("select")[0];for(var D=0;B.options[D];D++){if(B.options[D].value==this.initialValue){B.selectedIndex=D}}}},initialFill:function(A){this.stateProvince.innerHTML=A}});var ChangeShippingAddress=Class.create();ChangeShippingAddress.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var A=$A(this.element.getElementsByTagName("input"));this.radios=$A();A.each(function(B){if(B.type=="radio"){this.radios.push(B)}}.bind(this));this.newAddressForm=this.element.getElementsBySelector(".profileAddressNew .editShipping");this.useBillingAddressSelected=true;this.useNewAddressSelected=false;this.radios.each(function(B){if(Element.extend(B.parentNode.parentNode).hasClassName("useBillingAddress")){if(!B.checked){this.useBillingAddressSelected=false}Event.observe(B,"click",this.useBillingAddress.bindAsEventListener(this))}}.bind(this));this.radios.each(function(B){if(Element.extend(B.parentNode.parentNode).hasClassName("profileAddressNew")){if(this.useBillingAddressSelected){B.checked=false}if(B.checked){this.useNewAddressSelected=true}Event.observe(B,"click",this.useNewAddress.bindAsEventListener(this))}else{if(Element.extend(B.parentNode.parentNode).hasClassName("profileAddress")){if(this.useBillingAddressSelected){B.checked=false}Event.observe(B,"click",this.useOtherAddress.bindAsEventListener(this))}}}.bind(this));this.existingAddressAlert=this.element.getElementsByClassName("existingAddressAlert")[0];if(this.useNewAddressSelected){this.useNewAddress()}},useNewAddress:function(){this.showNewAddress();this.radios.each(function(A){if(Element.extend(A.parentNode.parentNode).hasClassName("useOtherAddress")){A.checked=true;throw $break}})},useOtherAddress:function(){this.hideNewAddress();this.radios.each(function(A){if(Element.extend(A.parentNode.parentNode).hasClassName("useOtherAddress")){A.checked=true;throw $break}})},useBillingAddress:function(){this.hideNewAddress();this.radios.each(function(A){if(Element.extend(A.parentNode.parentNode).hasClassName("profileAddress")){A.checked=false}})},showNewAddress:function(){this.newAddressForm.each(function(A){A.showByClass()}.bind(this));if(this.existingAddressAlert){this.existingAddressAlert.hideByClass()}},hideNewAddress:function(){this.newAddressForm.each(function(A){A.hideByClass()}.bind(this));if(this.existingAddressAlert){this.existingAddressAlert.showByClass()}}});var LoyaltyProgram=Class.create();LoyaltyProgram.prototype={initialize:function(A){this.containerElement=A;this.isVisible=A.visibleByClass();if(this.isVisible){this.completeInitialization()}},completeInitialization:function(){var B=this.containerElement.getElementsByTagName("label");this.clearableFields=$A();for(var A=0;A<B.length;A++){var D=B[A].getElementsByTagName("input")[0];if(D==null){D=B[A].getElementsByTagName("select")[0]}if(D){this.clearableFields.push(D)}}this.deleteLink=this.containerElement.getLastElementByClassName("deleteProgram","span");Event.observe(this.deleteLink,"click",this.deleteProgram.bindAsEventListener(this))},addProgram:function(){this.containerElement.showByClass();this.completeInitialization()},deleteProgram:function(){this.clearableFields.each(function(B){B.value="";if(document.fireEvent){B.fireEvent("onchange")}else{var A=document.createEvent("HTMLEvents");A.initEvent("change",true,true);B.dispatchEvent(A)}});this.containerElement.hideByClass()}};var LoyaltyPrograms=Class.create();LoyaltyPrograms.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.loyaltyPrograms=$A();this.nextAvailableLoyaltyProgram=0;var A=this.element.getElementsByTagAndClass("div","loyaltyProgram");for(var B=0;B<A.length;B++){var D=new LoyaltyProgram(A[B]);if(D.isVisible){this.nextAvailableLoyaltyProgram++}this.loyaltyPrograms.push(D)}this.numLoyaltyPrograms=this.loyaltyPrograms.length;this.addProgramLink=this.element.getLastElementByClassName("addProgramLink","p");Event.observe(this.addProgramLink,"click",this.addAnotherProgram.bindAsEventListener(this))},addAnotherProgram:function(){if(this.nextAvailableLoyaltyProgram<this.loyaltyPrograms.length){this.loyaltyPrograms[this.nextAvailableLoyaltyProgram].addProgram();this.nextAvailableLoyaltyProgram++;if(this.nextAvailableLoyaltyProgram>=this.loyaltyPrograms.length){this.addProgramLink.remove()}}else{log.error("no more to show")}}});var WebTrends=Class.create();WebTrends.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(this.enabled){this.webTrendsFuncCall="dcsSetVar('DCS.dcsuri', '"+location.pathname+"', 'WT.ti', '"+this.title+"', ";for(i in this.nameValuePairs){this.webTrendsFuncCall+="'"+this.webTrendsPrefix+i+"', '"+this.nameValuePairs[i]+"', "}this.webTrendsFuncCall=this.webTrendsFuncCall.substring(0,this.webTrendsFuncCall.length-2)+")";this.webTrendsCallback=this.webTrendsClick.bind(this);Event.observe(this.element,this.eventType,this.webTrendsCallback)}},webTrendsClick:function(){eval(this.webTrendsFuncCall);if(!this.persistent){Event.stopObserving(this.element,this.eventType,this.webTrendsCallback)}}});var RemoveLinks=Class.create();RemoveLinks.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){$A(this.element.getElementsByTagName("a")).each(function(B){var D=document.createElement("span");D.innerHTML=B.innerHTML;var A=B.parentNode;A.replaceChild(D,B)})}});var LightboxAgent=Class.create();LightboxAgent.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initialize:function(A,B){Object.extend(this,B);this.element=Element.extend(A);this.dialogObject=new Lightbox([this.element],B.params.content,B.params.options)}});var DialogPositioningContextAgent=Class.create();DialogPositioningContextAgent.prototype=Object.extend(new Abstract.Agent(),{initialize:function(A,B){Object.extend(this,B);this.element=Element.extend(A);this.dialogPositioningContextObject=new DialogPositioningContext(this.element)}});var ChangeSearchLightboxAgent=Class.create(Abstract.Agent,{beforeDOMReady:false,initialize:function(A,B){Object.extend(this,B);this.element=Element.extend(A);this.dialogObject=new ChangeSearchLightbox([this.element],B.params.content,B.params.options)}});var ElementUpdateTrigger=Class.create();ElementUpdateTrigger.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var A=this.params.event?this.params.event:"click";Event.observe(this.element,A,this.updateSummary.bindAsEventListener(this))},updateSummary:function(B){if(E(B,this.element)){document.fire("contentUpdate:started");var D=this.element.form;var F=Form.serialize(D).deleteQueryStringParam("_eventId",true)+"&"+this.params.eventId+"=true";var A=new Ajax.Request(D.action,{method:"post",parameters:F,onSuccess:function(G){document.fire("content:update",G.responseText.unescapeJSON().evalJSON())},onFailure:function(){log.error("No response from application for Element Updates")}})}function E(H,G){var I=true;if(G.tagName.toLowerCase()==="label"&&H.target.tagName.toLowerCase()!=="input"){I=false}return I}}});var ElementUpdater=Class.create();ElementUpdater.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){document.observe("content:update",this.updateContent.bindAsEventListener(this))},updateContent:function(A){if(this.params.sourceKey in A.memo){this.hideContent(this.element,function(){try{this.element.update(A.memo[this.params.sourceKey].unescapeXML());Page.initializeDOMFragment(this.element);document.fire("contentUpdate:succeeded")}catch(B){Errors.capture(B)}this.showContent(this.element)}.bind(this))}},hideContent:function(A,B){document.body.style.cursor="wait";new Effect.Fade(A,{duration:0.2,to:0.2,afterFinish:B})},showContent:function(A){new Effect.Appear(A,{duration:0.2,from:0.2,to:1});document.body.style.cursor="default"}});var AjaxStatusFlagManager=Class.create();AjaxStatusFlagManager.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){document.observe("contentUpdate:started",this.ajaxStarted.bindAsEventListener(this));document.observe("contentUpdate:succeeded",this.ajaxSucceeded.bindAsEventListener(this));this.element.value="true"},ajaxStarted:function(A){log.debug("setting ajax response status to false");this.element.value="false"},ajaxSucceeded:function(A){log.debug("setting ajax response status to true");this.element.value="true"}});var NonLocalizedContentManager=Class.create();NonLocalizedContentManager.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){Event.observe(this.element,"click",this.updateContent.bindAsEventListener(this))},updateContent:function(E){var A=document.createDocumentFragment();var D=A.appendChild(Element.extend(document.createElement("div")));D.innerHTML=this.params.content.unescapeHTML();var B=this.element.parentNode.parentNode;B.innerHTML="";B.appendChild(A);Event.stop(E)}});var Autocomplete=Class.create();Autocomplete.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!this.params.url){log.error("Autocomplete: No 'url' parameter was passed to agent");return}this.input=this.element.getElementsByTagName("input")[0];if(!this.input){log.error("Autocomplete: No input found inside element");return}$(this.input).writeAttribute("autocomplete","off");this.suggestions=new Element("div",{className:"smartFill"});this.element.parentNode.insertBefore(this.suggestions,this.element.nextSibling);this.params.parameters=Object.toQueryString(this.params.parameters);if(this.params.highlightMatches){this.params.transformResponse=this.highlightMatches.bind(this)}this.autocompleter=new Ajax.AutocompleterJSON(this.input,this.suggestions,this.params.url,this.params);if(this.params.additionalInfoParamName){Event.observe(this.element.form,"submit",this.matchResults.bindAsEventListener(this))}},highlightMatches:function(D){var B=this.input.value.strip();B=B.escapeRegex();B=new RegExp("("+B+")","im");var A=$(D).select("li");A.each(function(E){E.cleanWhitespace();$A(E.childNodes).each(function(G){if(G.nodeName=="#text"){var F=new Element("span").update(G.nodeValue.replace(B,'<span class="match">$1</span>'));E.replaceChild(F,G)}})});return D},matchResults:function(){if(this.autocompleter.results){if(!this.additionalInfo){this.additionalInfo=new Element("input",{type:"hidden",name:this.params.additionalInfoParamName});this.element.parentNode.insertBefore(this.additionalInfo,this.element.nextSibling)}var A=this.input.value.strip().toLowerCase();var D=this.autocompleter.results;for(var B=0;B<D.length;B++){if(A==D[B].suggestion.toLowerCase()){this.additionalInfo.value=D[B].additionalInfo;break}}}}});var Intrastitial=Class.create();Intrastitial.prototype={initialize:function(B,A){if(arguments.length>=2){this.targetElement=A;this.mask=new Element("div",{"class":"resultsIntrastitial"});this.messageDiv=new Element("div",{"class":"resultsIntrastitialMessage"});this.messageDiv.innerHTML="<span>"+B+"</span>";this.mask.setOpacity(0.8);this.messageDiv.setOpacity(0.8);this.hide();this.targetElement.appendChild(this.mask);this.targetElement.appendChild(this.messageDiv)}else{log.error("Intrastitial.initialize: too few arguments!")}},show:function(){if(this.mask){this.positionMessageInViewport();var A=this.targetElement.getDimensions();this.mask.setStyle({width:A.width+"px",height:A.height+"px"});this.mask.show()}if(this.messageDiv){this.messageDiv.show()}},hide:function(){if(this.mask){this.mask.hide()}if(this.messageDiv){this.messageDiv.hide()}},positionMessageInViewport:function(){if(this.messageDiv){this.messageDiv.style.top=((document.viewport.getHeight()/2)-(this.messageDiv.getDimensions().height/2))-this.targetElement.viewportOffset().top+"px"}},destroy:function(){if(this.mask){this.mask.remove()}if(this.messageDiv){this.messageDiv.remove()}}};var MultiNodeUpdaterTarget=Class.create(Abstract.Agent,{beforeDOMReady:false,initExtend:function(){Page.multiNodeTargets=Page.multiNodeTargets||{};this.dialogManager=new DialogManager(this.element);if(Page.multiNodeTargets[this.params.targetId]){try{var B=Page.multiNodeTargets[this.params.targetId];B.dialogManager.destroy();B.element.parentNode.replaceChild(this.element,B.element);delete B}catch(A){Errors.capture(A)}}Page.multiNodeTargets[this.params.targetId]=this}});var WebTrendsMultiTrackListener=Class.create();WebTrendsMultiTrackListener.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.defaultTags=$H({"DCS.dcsuri":"","DCS.dcsqry":"","WT.ti":"","WT.ad":"","WT.mc_id":"","WT.sp":""});document.observe("webtrends:multiTrackEvent",function(E){var G=E;var F=G.pathname?((G.pathname.indexOf("/")!=0)?"/"+G.pathname:G.pathname):"/";var D=G.textContent||G.innerText||G.innerHTML||"";var B=this.defaultTags.clone();B.set("DCS.dcsuri",F);B.set("DCS.dcsqry",G.search||"");B.update($H(E.memo));var A=[];B.each(function(H){A.push(H.key);A.push(H.value)});log.debug("WebTrends, sending: dcsMultiTrack() with parameters: "+A);dcsMultiTrack.apply(undefined,A);dcsCleanUp()}.bind(this))}});var WebTrendsTrackElement=Class.create();WebTrendsTrackElement.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){var A=this.element.tagName.toLowerCase();if(A!="a"){this.tags=this.params.tags;Event.observe(this.element,this.params.event,function(B){this.element.fire("webtrends:multiTrackEvent",this.params.tags)}.bind(this))}}});var WebTrendsTrackSliderChange=Class.create();WebTrendsTrackSliderChange.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.tags=this.params.tags;this.element.observe("agent:sliderChange",function(A){this.element.fire("webtrends:multiTrackEvent",this.tags)}.bind(this))}});var WebTrendsTrackCheckboxList=Class.create();WebTrendsTrackCheckboxList.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.tags=this.params.tags;this.checkboxes=this.element.select("input[type=checkbox]");this.tagPrefixes=$H();this.params.dynamicallyAddValue.each(function(A){this.tagPrefixes.set(A,this.tags[A])}.bind(this));this.checkboxes.each(function(A){A.observe("click",function(B){elem=B.element();if(elem.checked){if(this.params.dynamicallyAddValue!=null){this.params.dynamicallyAddValue.each(function(D){this.tags[D]=this.tagPrefixes.get(D)+elem.value}.bind(this))}this.element.fire("webtrends:multiTrackEvent",this.tags)}}.bind(this))}.bind(this))}});var WebTrendsTrackSelectBox=Class.create();WebTrendsTrackSelectBox.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.tags=this.params.tags;var A=this.element.select("select");for(i=0;i<A.length;i++){Event.observe(A[i],"change",function(B){elem=B.element();if(this.params.dynamicallyAddValue!=null){this.params.dynamicallyAddValue.each(function(D){this.tags[D]+=elem.value}.bind(this))}elem.fire("webtrends:multiTrackEvent",this.tags)}.bind(this))}}});var GoogleCSESearchBox=Class.create(Abstract.Agent,{initExtend:function(){var A=new Template('<form id="searchbox_#{cx}" action="/App/PrepareSearchResult"><input type="hidden" name="cx" value="#{cx}" /><input type="hidden" name="safe" value="active" /><input type="hidden" name="cof" value="FORID:9;NB:1" /><input type="hidden" class="searchValue" name="ve_kw" value="" /><input class="searchBox" name="q" size="36" value="" type="search" autosave="#{autosave}" results="10" /><span class="control submit"><input class="button" type="submit" value="#{buttonText}" /></span></form>');this.element.update(A.evaluate({cx:this.params.cx,buttonText:this.params.buttonText,autosave:this.params.autosave}));Event.observe(this.element.down("form"),"submit",this.handleSubmit.bind(this))},handleSubmit:function(D){var B=this.element.down("input.searchBox");var E=this.element.down("input.searchValue");var A=(B)?B.value:"";A=A.replace(/^\s+/,"");A=A.replace(/\s+$/,"");if(E){E.value=A}if(A==""){if(D){Event.stop(D)}return false}}});var RevealReadMore=Class.create();RevealReadMore.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.element.addClassName("revealReadLess");var A=new Element("div",{"class":"readMore"});this.collapseIcon=this.params.collapseIcon;this.expandIcon=this.params.expandIcon;A.update(this.expandIcon+this.params.readMoreLink);this.element.insert({after:A});A.observe("click",function(){if(this.element.hasClassName("revealReadMore")==true){this.element.removeClassName("revealReadMore");A.update(this.expandIcon+this.params.readMoreLink)}else{this.element.addClassName("revealReadMore");A.update(this.collapseIcon+this.params.readLessLink)}}.bind(this))}});var FixedHeightReveal=Class.create(Abstract.Agent,{initExtend:function(){this.element.style.overflow="hidden";var D=Element.extend(this.element.getElementsByTagName("a")[0]).getStyle("line-height");D=D.substring(0,D.length-2);var A=D*this.params.numberOfLines+2;var F=this.element.down();var E=F.getDimensions().height;if(D==E){this.element.style.height="auto";return}var B=new Element("div").addClassName("moreLink");var G=new Element("a").addClassName("link").update(this.params.moreLinkText);var H=function(){F.style.overflow="visible";F.style.height="auto";this.element.removeChild(B);this.element.style.height="auto"};Event.observe(G,"click",H);B.appendChild(G);if(E>=A){F.style.overflow="hidden";F.style.height=D+"em";this.element.appendChild(B)}}});var TabMenu=Class.create();TabMenu.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.tabs=$A();this.id=this.params.id;this.parent=Element.extend(this.element.parentNode);this.container=Element.extend(this.parent.parentNode);this.parent.addClassName("tabBar");var B=this.element.getElementsByTagName("li");for(var D=0,A=B.length;D<A;D++){this.tabs.push(new Tab(B[D],this.container,this))}this.busy=false},resetTabs:function(){this.tabs.each(function(A){if(A.selected){A.deselectTab()}})},loadContent:function(){if(!this.busy){log.debug("loading content from: "+this.params.ajaxURL);this.busy=true;new Ajax.Request(this.params.ajaxURL,{onSuccess:function(A){this.populateContent(A.responseText)}.bind(this),onFailure:function(){log.error("TabMenu.loadContent AJAX request failed");this.verifyContentPopulated();this.busy=false}.bind(this)})}else{log.warning("TabMenu busy, request to load content ignored")}},populateContent:function(F){try{var B=F.unescapeJSON();B=B.unescapeXML();var A=B.evalJSON();for(tabId in A){for(var D=0;D<this.tabs.length;D++){var E=this.tabs[D];if(E.type==="ajax"&&E.tabId===tabId){E.populateContentBlock(A[tabId]);break}}}this.verifyContentPopulated()}catch(G){this.verifyContentPopulated();log.error("TabMenu.populateContent: evalJSON probably failed while processing AJAX tab content: "+G.message)}finally{this.busy=false}},verifyContentPopulated:function(){for(var A=0;A<this.tabs.length;A++){if(this.tabs[A].type==="ajax"){this.tabs[A].indicateError(this.tabs[A].tabId)}}},selectTabByKey:function(A){this.tabs.each(function(B){if(B.key==A){B.selectTab();throw $break}})}});var Tab=Class.create();Tab.prototype={agentsInitialized:false,initialize:function(B,A,D){this.link=B.getElementsByTagName("A")[0];this.element=B;this.tabMenu=D;this.contentWrapper=A;this.selected=false;this.externalLinks=$A();this.contentBlock=null;this.type=this.link.rel==="ajax"?"ajax":"dom";this.tabId=this.type==="ajax"?this.element.getAttribute("data-tabId"):null;this.key=(this.tabId)?this.tabId+this.tabMenu.id:this.link.href.substring((this.link.href.indexOf("#")+1));this.contentPopulated=this.type==="ajax"?false:true;Event.observe(this.element,"click",this.click.bindAsEventListener(this));if(this.element.hasClassName("currentTab")){this.selected=true;this.externalLinks.each(function(E){E.selectLink()})}},click:function(A){if(A){A.preventDefault()}this.tabMenu.resetTabs();this.selectTab();if(this.type==="ajax"){this.tabMenu.loadContent()}else{if(!this.agentsInitialized){this.initTabAgents()}}},findContentBlock:function(){if(!this.contentBlock){var D=this.contentWrapper.getElementsByTagName("A");for(var E=0,A=D.length;E<A;E++){var B=Element.extend(D[E]);if(B.name&&B.name==this.key){this.contentBlock=B.getParentByClassName("tabContent");return}}}},populateContentBlock:function(A){log.debug("Tab: populating "+tabId);this.type="dom";this.findContentBlock();this.contentBlock.removeClassName("loadingAJAXTabContent");this.contentBlock.removeClassName("unloadedAJAXTabContent");if(this.progressIndicator){this.progressIndicator.destroy();delete this.progressIndicator}this.contentBlock.innerHTML=A.unescapeXML();Page.initializeDOMFragment(this.contentBlock);if(this.selected&&!this.agentsInitialized){this.initTabAgents()}},indicateError:function(A){log.error("Tab: "+A+" content expected but not found in response");if(this.progressIndicator){this.progressIndicator.destroy();delete this.progressIndicator}},selectTab:function(){log.debug("Tab.selectTab");this.findContentBlock();this.selected=true;this.element.addClassName("currentTab");if(this.type==="ajax"){this.contentBlock.removeClassName("unloadedAJAXTabContent");this.contentBlock.addClassName("loadingAJAXTabContent");if(this.progressIndicator===undefined){this.progressIndicator=new ProgressIndicator();this.contentBlock.appendChild(this.progressIndicator.container)}}if(this.contentBlock&&!this.contentBlock.visibleByClass()){this.contentBlock.showByClass()}this.externalLinks.each(function(A){A.selectLink()})},deselectTab:function(){this.selected=false;this.element.removeClassName("currentTab");this.findContentBlock();if(this.contentBlock&&this.contentBlock.visibleByClass()){this.contentBlock.hideByClass()}this.externalLinks.each(function(A){A.deselectLink()})},initTabAgents:function(){this.findContentBlock();var E=this.contentBlock.getElementsByAttribute("agent");for(var F=0;E[F];F++){var A=E[F];var B=A.getAgents();for(var D=0;B[D];D++){if(B[D].lazy=="true"){Page.initAgent(A,B[D])}}}this.agentsInitialized=true}};var TabMenuControl=Class.create();TabMenuControl.prototype=Object.extend(new Abstract.Agent("TabMenuControl"),{initExtend:function(){if(this.element.href&&this.element.href.indexOf("#")!=-1){this.key=this.element.href.substring((this.element.href.indexOf("#")+1))}if(!this.key){return}this.tab=this.findTabByKey(this.key);Event.observe(this.element,"click",this.click.bindAsEventListener(this));this.tab.externalLinks.push(this);if(this.tab.selected){this.selectLink()}},click:function(A){this.tab.click(A)},selectLink:function(){this.element.addClassName("selected")},deselectLink:function(){this.element.removeClassName("selected")},findTabByKey:function(B){var A=null;Page.agents.TabMenu.each(function(D){D.tabs.each(function(E){if(E.key==B){A=E;throw $break}});if(A!=null){throw $break}});return A}});var ProgressIndicator=Class.create();ProgressIndicator.prototype={initialize:function(D,J){log.debug("ProgressIndicator.initialize");var G=J?J:"&#8226;";var A=D?D*0.75:0.75;this.container=new Element("div").addClassName("progressIndicator").setStyle({position:"relative"});this.spinners=$A();for(var H=0;H<12;H++){var B=1-((H*83333)/1000000);var K=new Element("span").update(G).setOpacity(B);var F=(Math.PI*H)/6;var I=Math.sin(F)*A;var E=Math.cos(F)*A;K.setStyle({position:"absolute",top:I+"em",left:E+"em"});this.spinners.push(K);this.container.appendChild(K)}this.start()},start:function(){this.interval=setInterval(this.fadeStep.bind(this),83)},stop:function(){clearInterval(this.interval)},fadeStep:function(){this.spinners.each(function(D){var B=D.getOpacity();var A=B+0.083;if(A>=0.99){A=0}D.setOpacity(A)}.bind(this))},destroy:function(){this.stop();this.container.remove();delete this.spinners;delete this.container;return null}};var ProgressIndicatorAgent=Class.create(Abstract.Agent,{initExtend:function(){var B,A;if(this.params){B=this.params.radius;A=this.params.symbol}var D=new ProgressIndicator(B,A);this.element.appendChild(D.container)}});var AnyCheckbox=Class.create();AnyCheckbox.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){var A=new Template('<label class="control checkbox anyCheckbox">			<input name="" value="ANY" type="checkbox" />			<span>#{label}</span>		</label>');A=A.evaluate({label:this.params.label.unescapeXML()});this.checkboxes=this.element.select("input[type=checkbox]");if(!this.checkboxes||this.checkboxes.length<2){log.error("AnyCheckbox: Could not find checkboxes");return}this.checkboxes[0].up("label").insert({before:A});this.anyCheckbox=this.element.select("input[type=checkbox]")[0];if(this.shouldCheckAny()){this.checkAny()}this.element.observe("click",this.checkStatus.bindAsEventListener(this))},checkStatus:function(B){var A=B.element();if(A==this.anyCheckbox){if(A.checked){this.checkAny()}else{this.uncheckOthers()}}else{if(this.shouldCheckAny()){this.checkAny()}else{this.uncheckAny()}}},shouldCheckAny:function(){var A=this.checkboxes.length;var D=this.checkboxes[0].checked;for(var B=1;B<A;B++){if(this.checkboxes[B].checked!=D){return false}}return true},checkAny:function(){this.anyCheckbox.checked="checked";this.anyCheckbox.disabled="disabled";this.uncheckOthers()},uncheckAny:function(){this.anyCheckbox.disabled="";this.anyCheckbox.checked=""},uncheckOthers:function(){this.checkboxes.each(function(A){A.checked=""})}});var Filter=Class.create(Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.intrastitialMessage=this.params.intrastitialMessage||"";if(this.intrastitial==null){this.intrastitial=new Intrastitial(this.intrastitialMessage,$("main").select(".main")[0])}this.mostRecentRequest=null;this.element.observe("click",this.processEvent.bindAsEventListener(this,"click"));this.element.observe("agent:filter",this.processEvent.bindAsEventListener(this,"agent:filter"));var B=(this.element.tagName.toLowerCase()=="form")?this.element:this.element.up("form");B.observe("submit",this.processEvent.bindAsEventListener(this,"submit"));var A=this.element.select("select");for(i=0;i<A.length;i++){Event.observe(A[i],"change",function(F){var E=(typeof this.form!="undefined")?this.form:$(Event.findElement(F,"form"));var G=unescape(E.serialize())+"&rep=partial";var D=E.action;this.fetch(D,G)}.bind(this))}},processEvent:function(E,A){var D=Event.element(E);if((A=="agent:filter"&&!E.memo.url)||(A=="submit")||(D.tagName.toLowerCase()=="input"&&D.getAttribute("type")=="checkbox")){var B=$(Event.findElement(E,"form"));var F=unescape(B.serialize());this.fetch(B.action,F)}else{if(A=="agent:filter"&&E.memo.url){this.fetch(E.memo.url)}}if(A=="submit"){E.preventDefault()}},fetch:function(A,B){B=B||"";new Ajax.Request(A,{method:"get",parameters:B+"&rep=partial",onCreate:(function(D){if(!this.mostRecentRequest){this.intrastitial.show()}this.mostRecentRequest=D.transport}).bind(this),onSuccess:(function(D){if(D.transport==this.mostRecentRequest){Page.initializeAjaxResponse(D.responseText);this.intrastitial.hide();this.mostRecentRequest=null;document.fire("agent:resultsUpdated")}}).bind(this),onFailure:(function(D){if(D.transport==this.mostRecentRequest){this.intrastitial.hide();this.mostRecentRequest=null;window.location.reload()}}).bind(this)})}}));var FilterOnLinkClick=Class.create(Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){this.element.observe("click",this.callFilter.bindAsEventListener(this));if(this.params&&this.params.hiddenInput){this.hiddenInput=(new Element("div")).update(this.params.hiddenInput.unescapeXML()).childElements()[0];this.element.insert({bottom:this.hiddenInput})}},callFilter:function(B){var A=B.findElement("a");if(A){if(this.hiddenInput){this.hiddenInput.value=A.href.toQueryParams()[this.hiddenInput.name]||"";this.element.fire("agent:filter")}else{this.element.fire("agent:filter",{url:A.href})}B.preventDefault()}}}));var FilterLinksToggleState=Class.create(Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initExtend:function(){this.className="selected";if(this.params&&this.params.className){this.className=this.params.className.unescapeXML()}this.element.observe("click",this.toggleState.bindAsEventListener(this))},toggleState:function(D){var B=D.findElement("a");if(B){var A=B.up("li");if(A){var E=B.down("img");if(E){A.removeClassName(this.className);B.addClassName("offscreen")}else{A.addClassName(this.className);A.siblings().each(function(F){if(F.hasClassName(this.className)){F.removeClassName(this.className);if(F.down("a img")){F.down("a").remove()}}}.bind(this))}}else{log.error("FilterLinksToggleState : listItem undefined")}}}}));var GoogleHotelMap=Class.create();GoogleHotelMap.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!this.params.location||isNaN(this.params.location.latitude)||isNaN(this.params.location.longitude)){log.error("GoogleHotelMap: Location missing or invalid");return}if(isNaN(this.params.zoom)){log.error("GoogleHotelMap: Zoom missing or invalid");return}if(this.params.map===undefined||(!this.params.map&&!this.params.streetview)){this.params.map=true}this.element.update();this.element.removeClassName("staticMap");this.element.addClassName("dynamicMap");this.element.addClassName("intrastitial");if(!this.pi){this.pi=new ProgressIndicator();this.element.appendChild(this.pi.container)}GoogleMapAPILoader.load(this.initMap.bind(this))},initMap:function(){this.element.removeClassName("intrastitial");if(this.pi){this.pi.stop();this.pi.container.remove();this.pi=null}this.location=new google.maps.LatLng(this.params.location.latitude,this.params.location.longitude);if(this.params.map){this.showMap()}if(this.params.streetview){var A=new google.maps.StreetviewClient();A.getNearestPanorama(this.location,this.enableStreetview.bind(this))}},enableStreetview:function(A){if(A){this.panoData=A}if(this.panoData.code==600){log.info("GoogleHotelMap: Streetview unavailable for this location")}else{if(this.panoData.code==500){log.error("GoogleHotelMap: Streetview server error")}else{if(this.panoData.code==200){if(this.params.map){this.toggleLink=new Element("a",{"class":"link toggleLink"});this.element.insertBefore(this.toggleLink,this.mapElement);this.toggleLink.update(this.params.switchToStreetviewText);Event.observe(this.toggleLink,"click",this.toggleMaps.bindAsEventListener(this))}else{this.showStreetview()}}else{log.error("GoogleHotelMap: Streetview unknown error")}}}},toggleMaps:function(){if(this.currentMap==this.mapElement){this.showStreetview()}else{this.showMap()}},showMap:function(){if(!this.mapElement){this.mapElement=new Element("div",{"class":"standardMap"});this.element.appendChild(this.mapElement);this.map=new google.maps.Map2(this.mapElement);this.map.setCenter(this.location,this.params.zoom);var A=this.map.getDefaultUI();A.zoom.scrollwheel=false;A.controls.maptypecontrol=false;A.controls.menumaptypecontrol=false;this.map.setUI(A);var B=new google.maps.HierarchicalMapTypeControl();this.map.addControl(B,new google.maps.ControlPosition(G_ANCHOR_TOP_RIGHT,new google.maps.Size(7,7)));this.marker=new google.maps.Marker(this.location,{clickable:false});this.map.addOverlay(this.marker)}if(this.currentMap){this.currentMap.hide()}this.mapElement.show();this.map.checkResize();this.currentMap=this.mapElement;if(this.toggleLink){this.toggleLink.update(this.params.switchToStreetviewText)}},showStreetview:function(){if(!this.streetviewElement){this.streetviewElement=new Element("div",{"class":"streetview"});this.element.appendChild(this.streetviewElement);this.streetviewElement.show();this.streetview=new google.maps.StreetviewPanorama(this.streetviewElement);this.streetview.setLocationAndPOV(this.panoData.location.latlng,{yaw:this.calculateBearing(this.panoData.location.latlng,this.location),pitch:-8});google.maps.Event.addListener(this.streetview,"error",this.handleNoFlash.bind(this))}if(this.currentMap){this.currentMap.hide()}this.streetviewElement.show();this.streetview.checkResize();this.currentMap=this.streetviewElement;if(this.toggleLink){this.toggleLink.update(this.params.switchToMapText)}},calculateBearing:function(B,F){var G=F.lat()-B.lat();var A=F.lng()-B.lng();var D=Math.atan2(A,G);var E=D*180/Math.PI;if(E<0){E+=360}return E},handleNoFlash:function(){this.streetviewElement.update("You must download Adobe Flash Player to view this content.")}});var MapQuestHotelMap=Class.create();MapQuestHotelMap.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){if(!window.MQA){log.error("MapQuestHotelMap: MapQuest script not found");return}if(!this.params.location||this.params.location.latitude===undefined||this.params.location.longitude===undefined){log.error("MapQuestHotelMap: Location missing or invalid");return}if(isNaN(this.params.zoom)){log.error("MapQuestHotelMap: Zoom is missing or invalid");return}this.element.update();this.element.removeClassName("staticMap");this.element.addClassName("dynamicMap");this.mapElement=new Element("div",{"class":"standardMap"});this.element.appendChild(this.mapElement);var A=this.mapElement.getDimensions();A.height+="px";A.width+="px";this.mapElement.setStyle(A);this.location=new MQA.LatLng(this.params.location.latitude,this.params.location.longitude);this.map=new MQA.TileMap(this.mapElement,this.params.zoom,this.location,"map");this.map.addShape(new MQA.Poi(this.location));var B=new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT,new MQA.Size(25,18));this.map.addControl(new MQA.PanControl(),B);B=new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT,new MQA.Size(19,68));this.map.addControl(new MQA.ZoomControl(),B);B=new MQA.MapCornerPlacement(MQA.MapCorner.TOP_RIGHT,new MQA.Size(126,0));this.map.addControl(new MQA.ViewControl(),B)}});var MicrocontentAgent=Class.create();MicrocontentAgent.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:false,initialize:function(A,D){Object.extend(this,D);this.element=Element.extend(A);var B=$A();B.push(this.element);if(D.params.additionalTriggers){D.params.additionalTriggers.each(function(E){$$(E).each(function(F){B.push(F)})})}this.dialogObject=new Microcontent(B,D.params.content,D.params.options)}});var FlightDetailsMicrocontent=Class.create();FlightDetailsMicrocontent.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.content={string:this.params.content};this.options={heading:this.params.heading,headerless:this.params.headerless,triggerEvent:"click",closeEvent:this.params.closeEvent};this.microcontent=new Microcontent([this.element],this.content,this.options)}});var TotalPriceMicrocontent=Class.create();TotalPriceMicrocontent.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.markup=this.params.dynamicMarkup.unescapeXML();this.options={dialogGroup:"totalPrice"};this.options.setUp=function(){if(!this.domNodes){this.domNodes=new Element("div").insert(this.markup).childElements()}this.mainElement=this.microcontent.markup.mainInfo.down(".totalPriceMicrocontent");for(var A=0;A<this.domNodes.length;A++){this.mainElement.appendChild(this.domNodes[A])}}.bind(this);this.options.tearDown=function(){for(var A=0;A<this.domNodes.length;A++){this.mainElement.removeChild(this.domNodes[A])}}.bind(this);this.options=Object.extend(this.params.options,this.options);this.microcontent=new Microcontent([this.element],this.params.content,this.options);document.observe("dialog:dialogOpen",this.close.bindAsEventListener(this))},close:function(A){if(A&&A.memo&&A.memo.dialog!=this.microcontent&&A.memo.dialog.options.dialogGroup==this.options.dialogGroup){this.microcontent.close()}}});var OpinionLabsInitializer=Class.create(Abstract.Agent,{beforeROMReady:false,initExtend:function(){if(!this.params.displayLink){this.removeHeaderListItem()}this.OOobj=new OnlineOpinion.ocode();this.OOobj.Preferences.Persistence={enabled:true,cookie_name:"oo_r",cookie_type:"page",expiration:3600};this.OOobj.Preferences.Render={type:"floating",main_div_id:"oo_feedback_float",up_div_id:"olUp",over_div_id:"olOver",img_path:this.params.imagePath,feedback_span_id:"fbText",feedback_html:this.params.feedbackText,click_html:this.params.clickText};this.OOobj.Preferences.Plugins.URLRewrite={active:true,regex_search_pattern:"://",regex_replace_pattern:"://"+this.params.locale+"."};OnlineOpinion.util.SafeAddOnUnLoadEvent(function(){this.OOobj.onExit()}.bindAsEventListener(this));this.OOobj.render(function(){this.OOobj.show();this.removeHeaderListItem()}.bindAsEventListener(this));if(!this.OOobj.Cookie.matchurl(this.OOobj.Metrics.core.referer,this.OOobj.Preferences.Persistence.cookie_type)){if(this.params.displayLink){this.attachHeaderLink()}else{this.removeHeaderListItem()}}else{this.removeHeaderListItem()}},attachHeaderLink:function(){var A=new Element("a",{"class":"link",href:"#"}).update(this.params.feedbackText);var D=function(E){this.OOobj.show();Event.stopObserving(A,"click",B);this.removeHeaderListItem();E.preventDefault()};var B=D.bindAsEventListener(this);Event.observe(A,"click",B);this.element.appendChild(A)},removeHeaderListItem:function(){var A=this.element.next(0);if(typeof A=="undefined"&&this.element.tagName.toLowerCase()=="li"){this.element.previous(0).addClassName("last")}this.element.parentNode.removeChild(this.element)}});var GoogleResultsMap=Class.create();GoogleResultsMap.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.mapState="collapsed";this.expandedSelector="#main div.resultsMainPanel";this.toggleMapState=function(){var D=["collapsed","expanded"];return function(){this.mapState=D.reverse()[0]}}();if(Persist.type){var A=(Persist.type=="flash")?500:0;this.persistStore=new Persist.Store("GoogleResultsMap");var B=function(){try{this.persistStore.get("mapData",function(E,G){if(E&&G){var F=("("+G+")").evalJSON();if(F.searchKey==this.params.searchKey){if(F.state==="expanded"){this.persistMapDetails=function(){return/selectHotelDetails=true/.test(document.referrer)}();if(this.persistMapDetails){this.persistStore.mapData=F}this.toggleMapState()}}}}.bind(this))}catch(D){}this.loadMap()}.bind(this);setTimeout(B,A)}else{this.loadMap()}},loadMap:function(){GoogleMapAPILoader.load(this.mapLoadCallback.bind(this))},getWebTrendsTags:function(A){return{"DCSext.wtNav":"srmap","DCSext.srmap":1,"WT.dl":1,"WT.ti":A}},mapLoadCallback:function(){google.maps.Event.addDomListener(window,"unload",this.unload.bind(this));var F=this;google.maps.Map2.prototype.openMarkerToolTip=function(I){if(!this.markerToolTip){this.markerToolTip=new MarkerToolTip();this.addOverlay(this.markerToolTip)}this.markerToolTip.open(I)};google.maps.Map2.prototype.closeMarkerToolTip=function(){if(this.markerToolTip){this.markerToolTip.hide()}};google.maps.Map2.prototype.openCustomInfoWindow=function(I){if(!this.infoWindow){this.infoWindow=new MapInfoWindow(F);this.addOverlay(this.infoWindow)}this.infoWindow.open(I)};google.maps.Map2.prototype.closeCustomInfoWindow=function(){if(this.infoWindow){this.infoWindow.close()}};google.maps.Map2.prototype.destroyCustomInfoWindow=function(){if(this.infoWindow){this.infoWindow.close();this.removeOverlay(this.infoWindow);delete this.infoWindow}};var D=Element.extend(document.body);this.container={collapsed:this.element.parentNode,expanded:D.down(this.expandedSelector)};if(!this.container.expanded){log.error("Expanded container not found");return false}if(this.mapState==="expanded"){this.container[this.mapState].insertBefore(this.element,this.container[this.mapState].firstChild)}this.element.addClassName(this.mapState+"ResultsMap");this.element.appendChild(new Element("H3",{className:"mapLabel"})).appendChild(document.createTextNode(this.params.mapHeader));this.toggleElement=this.element.appendChild(new Element("A",{className:"mapLink",href:"javascript:void(0);",delegatedtracking:"true"}));this.toggleElement.appendChild(document.createTextNode(this.params.linkText[this.mapState]));var H=new google.maps.Map2(this.element.appendChild(new Element("DIV",{className:"mapContainer"})));var B=H.getDefaultUI();B.controls.largemapcontrol3d=true;B.controls.maptypecontrol=false;B.controls.menumaptypecontrol=false;B.zoom.scrollwheel=false;H.setUI(B);H.addControl(new google.maps.HierarchicalMapTypeControl(),new google.maps.ControlPosition(G_ANCHOR_TOP_RIGHT,new google.maps.Size(7,7)));google.maps.Event.addDomListener(this.toggleElement,"click",this.resizeMap.bind(this));document.observe("agent:resultsUpdated",this.initState.bind(this));this.infoWindowData=this.params.infoWindowData;this.datedSearch=this.params.datedSearch;this.map=H;this.initState();var A=$(this.element.down(".mapContainer").childNodes[2]);A.addClassName("legalText");if(this.persistMapDetails){var E=this.persistStore.mapData;H.setCenter(new google.maps.LatLng(E.position.lat,E.position.lng),E.zoom);if(this.persistStore.mapData.infoWindowHotelId){var G=this.getMapMarker(this.persistStore.mapData.infoWindowHotelId);if(G){this.markerClick(G)}}}},unload:function(){var B=this.map.getCenter();var A;if(this.map.infoWindow&&this.map.infoWindow.hotelId){A=this.map.infoWindow.hotelId}if(Persist.type){var E={searchKey:this.params.searchKey,state:this.mapState,zoom:this.map.getZoom(),position:{lat:B.lat(),lng:B.lng()},infoWindowHotelId:A};try{this.persistStore.set("mapData",Object.toJSON(E))}catch(D){}}google.maps.Unload()},initState:function(){if(this.map.infoWindow){this.map.destroyCustomInfoWindow()}this.setMapMarkers();this.setZoomLevel();this.setMapState[this.mapState].call(this)},resizeMap:function(){this.toggleMapState();this.element.fire("webtrends:multiTrackEvent",this.getWebTrendsTags(this.mapState+" map"));this.container[this.mapState].insertBefore(this.element,this.container[this.mapState].firstChild);this.setMapState[this.mapState].call(this);this.map.checkResize();this.map.setCenter(this.bounds.getCenter(),this.map.getBoundsZoomLevel(this.bounds));this.setZoomLevel();this.map.savePosition();this.toggleElement.replaceChild(document.createTextNode(this.params.linkText[this.mapState]),this.toggleElement.firstChild)},setMapMarkers:function(){if(this.locationMarkers){this.clearMapMarkers()}var I=this.bounds=new google.maps.LatLngBounds();var D=this.locationMarkers=[];var A=this.map;var J=$("main").select("div.hotelResultsCard");for(var E=0,H=J.length;E<H;E++){var F=J[E].getAttribute("data-hotelInfo").evalJSON();F.hotelCardElement=J[E];var B=new PriceMarker(F,this);I.extend(B.location);A.addOverlay(B);var G=B.markup;google.maps.Event.addDomListener(G,"click",this.markerClick.bind(this,B));google.maps.Event.addDomListener(G,"mouseover",this.markerMouseover.bind(this,B));google.maps.Event.addDomListener(G,"mouseout",this.markerMouseout.bind(this,B));D[E]=B}this.map.setCenter(this.bounds.getCenter(),this.map.getBoundsZoomLevel(this.bounds),G_NORMAL_MAP)},clearMapMarkers:function(){var E=this.locationMarkers;var F=this.map;for(var B=0,A=E.length;B<A;B++){var D=E[B];google.maps.Event.clearInstanceListeners(D.markup);F.removeOverlay(D)}this.locationMarkers=null;this.bounds=null},getMapMarker:function(D){var G=this.locationMarkers;var F;for(var B=0,A=G.length;B<A;B++){var E=G[B];if(E.data.id==D){F=E;break}}return F},markerClick:function(B,A){if(this.mapState=="collapsed"){return false}this.map.openCustomInfoWindow(B);if(A){this.element.fire("webtrends:multiTrackEvent",this.getWebTrendsTags("Hotel pin"))}this.repositionMap()},markerMouseover:function(A){if(this.mapState=="collapsed"){return false}A.onmouseover.call(A);this.map.openMarkerToolTip(A)},markerMouseout:function(A){if(this.mapState=="collapsed"){return false}A.onmouseout.call(A);this.map.closeMarkerToolTip()},setMapState:{collapsed:function(){if(this.map.infoWindow){this.map.destroyCustomInfoWindow()}this.map.setMapType(G_NORMAL_MAP);if(!this.mapListener){this.mapListener=google.maps.Event.addListener(this.map,"click",this.resizeMap.bind(this))}this.element.removeClassName("expandedResultsMap").addClassName("collapsedResultsMap");this.map.hideControls();this.map.disableDragging();this.map.disableInfoWindow();this.map.disableDoubleClickZoom();this.map.disablePinchToZoom();this.map.disableContinuousZoom()},expanded:function(){if(this.mapListener){google.maps.Event.removeListener(this.mapListener);delete this.mapListener}this.element.removeClassName("collapsedResultsMap").addClassName("expandedResultsMap");this.map.showControls();this.map.enableDragging();this.map.enableInfoWindow();this.map.enableDoubleClickZoom();this.map.enablePinchToZoom();this.map.enableContinuousZoom()}},repositionMap:function(){var D=this.map.infoWindow.getPoints(true);var B=width=0;var A=this.map.getSize().width;if(D.top<30){B=30-D.top}if(D.left<75){width=75-D.left}if(D.right>A){width=-(D.right-A)}this.map.panBy(new google.maps.Size(width,B))},setZoomLevel:function(){var B=this.map.getSize().width;for(var D=0,A=this.locationMarkers.length;D<A;D++){var F=this.locationMarkers[D];var G=F.markup;var E=this.map.fromLatLngToContainerPixel(F.location);if(((E.y-G.offsetHeight)<0)||((E.x-5)<0)||(E.x+(G.offsetWidth-5)>B)){this.map.zoomOut();return}}}});var PriceMarker=function(B,A){PriceMarker=function(E,D){this.location=new google.maps.LatLng(E.lat,E.lng);this.data=E;this.mapAgent=D};PriceMarker.prototype=Object.extend(new google.maps.Overlay(),{initialize:function(G){this.map=G;var E=this.markup=new Element("DIV");var F=E.appendChild(new Element("SPAN"));var D=F.appendChild(new Element("SPAN"));E.appendChild(new Element("DIV")).className="beakBorder";E.appendChild(new Element("DIV")).className="beak";E.className="priceMarker";F.className="content";D.className="label";if(!this.data.rates.rateAvailable){D.addClassName("icon")}D.innerHTML=this.getLabel[(this.mapAgent.datedSearch)?"dated":"dateless"].call(this);E.style.position="absolute";G.getPane(G_MAP_MARKER_PANE).appendChild(E)},remove:function(){this.markup.parentNode.removeChild(this.markup)},copy:function(){return new PriceMarker(this.data)},redraw:function(D){if(!D){return}var E=this.getPoints();this.markup.style.left=E.left+"px";this.markup.style.top=E.top+"px"},getPoints:function(E){var D=this.map[(E)?"fromLatLngToContainerPixel":"fromLatLngToDivPixel"](this.location);return{top:D.y-this.markup.offsetHeight,right:(D.x+this.markup.offsetWidth)-5,bottom:D.y,left:D.x-5}},getLabel:{dated:function(){if(this.data.rates.rateAvailable){return this.data.rates.leadPrice}else{if(this.data.rates.rateUnknown){return this.mapAgent.infoWindowData.checkRatesButton}else{return this.mapAgent.infoWindowData.noRates}}},dateless:function(){if(this.data.rates.rateAvailable){return this.data.rates.averageNightlyRate}else{return this.mapAgent.infoWindowData.checkAvailabilityButton}}},onmouseover:function(){this.markup.addClassName("priceMarkerHover")},onmouseout:function(){this.markup.removeClassName("priceMarkerHover")}});return new PriceMarker(B,A)};var MarkerToolTip=function(){MarkerToolTip=function(){};MarkerToolTip.prototype=Object.extend(new google.maps.Overlay(),{initialize:function(B){var A=this.markup=new Element("DIV");A.style.position="absolute";A.className="markerToolTip";B.getPane(G_MAP_MARKER_PANE).appendChild(A)},remove:function(){this.markup.parentNode.removeChild(this.markup)},copy:function(){return new MarkerToolTip()},redraw:function(A){if(!A){return}},getContent:function(){var B=this.marker.data;var A=this.marker.data.hotelCardElement.down("a.hotelNameLink");B.name=A.innerHTML},populateToolTip:function(){var B=this.marker.data;var A='<strong class="name">'+B.name+"</strong>"+((B.stars)?'<img class="stars" src="/style/global/img/star'+B.stars+'.png" alt="'+B.stars+' stars" height="13" width="70" />':"")+((B.rating)?'<span class="rating"><strong><span>'+B.rating+"</span></strong></span>":"");this.markup.update(A)},showToolTip:function(){this.setPosition();this.markup.setStyle({display:""})},open:function(A){this.marker=A;if(!A.data.name){this.getContent()}this.populateToolTip();this.showToolTip()},hide:function(){this.markup.style.display="none"},setPosition:function(){var A=this.marker.getPoints();this.markup.style.left=A.right-5+"px";this.markup.style.top=A.top-5+"px"}});return new MarkerToolTip()};var MapInfoWindow=function(A){MapInfoWindow=function(B){this.mapAgent=B};MapInfoWindow.prototype=Object.extend(new google.maps.Overlay(),Object.extend(Dialog.Base,{initialize:function(D){this.map=D;this.opened=false;this.setProperties("MapInfoWindow",{},{closeLabel:this.mapAgent.infoWindowData.closeLabel,heading:true});this.createDialogDivs();var B=this.markup.dialogWrapper;B.setStyle({display:"none"});this.markup.beak=B.appendChild(new Element("div",{"class":"microcontentBeakBottom"}));this.attachCloseListeners(this.close.bindAsEventListener(this));google.maps.Event.addDomListener(B,"mousedown",this.eventCapture);google.maps.Event.addDomListener(B,"mouseover",this.eventCapture);google.maps.Event.addDomListener(B,"mouseout",this.eventCapture);D.getPane(G_MAP_FLOAT_PANE).appendChild(B)},eventCapture:function(B){Event.extend(B);B.stopPropagation()},remove:function(){this.markup.dialogWrapper.parentNode.removeChild(this.markup.dialogWrapper)},copy:function(){return new MapInfoWindow()},redraw:function(B){if(!B){return}this.positionInViewport()},showDialog:function(){this.positionInViewport();this.markup.dialogWrapper.setStyle({display:""})},positionInViewport:function(){if(!this.marker){return}var B=this.markup.dialogWrapper;var D=this.getPoints();B.style.left=D.left+"px";B.style.top=D.top+"px"},populateDialog:function(){var K=this.marker.data;var I=this.mapAgent.infoWindowData;var G=this.marker.data.hotelCardElement;var F=new Element("div",{className:"infoWindowContent"});var J=new Element("div",{className:"price"});this.markup.mainInfo.innerHTML="";var M=G.down("a.thumbnail");if(M){this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(M.cloneNode(true)),"Hotel photo")}var S=G.down("div.hotelPriceInfo");if(S){var E=$(S.cloneNode(true));var L=E.down(".totalPriceMicrocontentLink");if(L){L.replace(L.innerHTML)}J.appendChild(E)}var Q=G.down("ul.priceDisclaimers");if(Q){J.appendChild(Q.cloneNode(true))}F.appendChild(J);var B=G.down("p.userRatingSummary");if(B){F.appendChild(B.cloneNode(true))}var H=G.down("a.detailsLink");if(H){this.addWebTrendsEventListener(F.appendChild(H.cloneNode(true)),"More hotel details")}this.markup.mainInfo.appendChild(F);var O=G.down(".priceButtonLink");if(O){if(this.mapAgent.datedSearch){this.addWebTrendsEventListener(this.markup.mainInfo.appendChild(O.cloneNode(true)),(K.rate)?"Select":"Check rates")}else{try{var D=O.down("a[agent]").getAgents()[0];if(D){this.addWebTrendsEventListener(this.markup.mainInfo.insert(D.params.content.string),"Check availability")}}catch(P){Errors.capture(error,"MiniHotelSearchForm agent not found where expected. ")}}}this.markup.mainInfo.descendants().each(function(T){T.removeAttribute("id")});Page.initializeDOMFragment(this.markup.mainInfo)},addWebTrendsEventListener:function(D,B){D.writeAttribute("delegatedtracking","true");google.maps.Event.addDomListener(D,"click",function(){this.mapAgent.element.fire("webtrends:multiTrackEvent",this.mapAgent.getWebTrendsTags(B))}.bindAsEventListener(this))},open:function(B){this.marker=B;this.setHeading();this.populateDialog();this.showDialog();this.hotelId=B.data.id},close:function(B){this.markup.dialogWrapper.setStyle({display:"none"});delete this.hotelId},setHeading:function(){var E=this.mapAgent.infoWindowData;var D=this.marker.data.hotelCardElement;this.markup.dialogTitle.innerHTML="";var B=new Element("h3");var G=D.down("a.hotelNameLink");if(G){this.addWebTrendsEventListener(B.appendChild(G.cloneNode(true)),"Hotel name");this.markup.dialogTitle.appendChild(B)}var F=D.down("img.stars");if(F){this.markup.dialogTitle.appendChild(F.cloneNode(true))}this.markup.mainInfo.descendants().each(function(H){H.removeAttribute("id")})},getPoints:function(G){var F=this.marker.getPoints(G);var B=this.markup.dialogWrapper;var H=B.getDimensions();var D=(F.left+((F.right-F.left)/2))-(H.width/2);var E=F.top-H.height;return{top:E,right:D+H.width,bottom:F.top,left:D}}}));return new MapInfoWindow(A)};var Reveal=Class.create();Reveal.prototype=Object.extend(new Abstract.Agent(),{beforeDOMReady:true,initExtend:function(){if(!this.params.label){log.error('Reveal: Required parameter "label" missing');return}if(this.params.selector){this.hiddenElements=this.element.select(this.params.selector)}else{this.hiddenElements=this.element.getElementsByTagAndClass("*","noneBlock")}if(this.hiddenElements.length!=0){this.revealLink=new Element("a",{"class":"link revealLink",href:"#"});this.revealLink.update(this.params.label.unescapeXML());this.element.insert({bottom:this.revealLink});this.revealLink.observe("click",this.reveal.bindAsEventListener(this))}},reveal:function(D){this.revealLink.remove();this.revealLink=null;for(var B=0,A=this.hiddenElements.length;B<A;B++){this.hiddenElements[B].showByClass()}D.preventDefault()}});var SavedHotelsTotal=Class.create(Abstract.Agent,{initExtend:function(){this.totalsContent=this.element.select("span.savedHotelsTotal")[0];Event.observe($(document.body),"savedHotel:saveRequestReturned",this.onSavedHotelUpdated.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:removed",this.onSavedHotelUpdated.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:listUpdated",this.onSavedHotelUpdated.bindAsEventListener(this))},onSavedHotelUpdated:function(A){if(navigator.cookieEnabled){this.totalsContent.innerHTML=A.memo.savedHotelsTotal.innerHTML}}});var SavedHotelsList=Class.create(Abstract.Agent,{initExtend:function(){if(this.params){this.noCookiesMessage=this.params.noCookiesMessage;this.updateListURL=this.params.updateListURL}else{this.noCookiesMessage="";this.updateListURL=null}this.removeLinks=new ManagedEventObservers();Event.observe(this.element,"savedHotel:removeAgentCreated",this.addRemoveLink.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:saveRequestReturned",this.onSaveRequestOrRemove.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:removed",this.onSaveRequestOrRemove.bindAsEventListener(this));if(this.updateListURL){var A=new Ajax.Request(this.updateListURL,{method:"get",parameters:{cacheBuster:new Date().getTime()},onSuccess:function(D){var B=parseSavedHotelsResponse(D);B.element=this.element;log.debug("saved hotels: "+B.savedHotelsData.savedHotels);this.update(B.savedHotelsContent);$(document.body).fire("savedHotel:listUpdated",B)}.bind(this)})}},addRemoveLink:function(D){if(D.memo.length>=3){var B=D.memo[0];var A=D.memo[1];var E=D.memo[2];this.removeLinks.add(B,A,E)}},onSaveRequestOrRemove:function(A){this.update(A.memo.savedHotelsContent)},update:function(A){this.destroy();if(!navigator.cookieEnabled&&this.noCookiesMessage!=""){this.element.innerHTML=this.noCookiesMessage}else{this.element.innerHTML=A.innerHTML;Page.initializeDOMFragment(this.element)}},destroy:function(){this.removeLinks.clear()}});var SavedHotelsStatus=Class.create(Abstract.Agent,{initExtend:function(){if(this.params){this.noCookiesMessage=this.params.noCookiesMessage}else{this.noCookiesMessage=""}this.statusMessage=this.element.select("div.savedHotelsStatus")[0];this.statusMessageTitle=this.statusMessage.select(".dialogTitle a")[0];this.statusMessageContent=this.statusMessage.select("div.savedHotelsStatusContent")[0];this.savedHotelsTotal=this.element.select("")[0];this.displayDuration=6000;this.displayTimer=null;Event.observe($(document.body),"savedHotel:saveRequestReturned",this.onSaveRequestReturned.bindAsEventListener(this))},onSaveRequestReturned:function(A){if(!navigator.cookieEnabled&&this.noCookiesMessage!=""){this.statusMessageContent.innerHTML=this.noCookiesMessage}else{this.statusMessageContent.innerHTML=A.memo.savedHotelsStatusContent.innerHTML}this.statusMessageTitle.innerHTML=A.memo.savedHotelsTotal.innerHTML;this.displayMessage()},displayMessage:function(){this.element.removeClassName("noneBlock");if(this.displayTimer!=null){window.clearTimeout(this.displayTimer)}this.displayTimer=window.setTimeout(this.hideMessage.bind(this),this.displayDuration)},hideMessage:function(){this.element.addClassName("noneBlock");this.statusMessageContent.innerHTML="";this.displayTimer=null}});var AddSavedHotel=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(A){if(this.params){this.hotelId=this.params.hotelId;this.url=this.params.url;this.notSavedLabel=this.params.notSavedLabel;this.savedLabel=this.params.savedLabel;this.saved=this.params.saved;delete this.params;Event.observe(this.element,"click",this.add.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:removed_"+this.hotelId,this.displayAsNotSaved.bindAsEventListener(this));Event.observe($(document.body),"savedHotel:listUpdated",this.onSavedHotelListUpdated.bindAsEventListener(this))}else{log.error("AddSavedHotel.initExtend: too few parameters to initialize")}},add:function(A){A.preventDefault();this.request=new Ajax.Request(this.url,{method:"get",parameters:{cacheBuster:new Date().getTime()},onSuccess:function(D){var B=parseSavedHotelsResponse(D);B.addSavedHotelAgent=this;$(document.body).fire("savedHotel:saveRequestReturned",B);if(this.hotelId==B.savedHotelsData.hotelId&&B.savedHotelsData.status=="SAVED"&&navigator.cookieEnabled){this.displayAsSaved();$(document.body).fire("savedHotel:saved",B)}else{if(this.hotelId==B.savedHotelsData.hotelId&&B.savedHotelsData.status=="DUPLICATE"&&navigator.cookieEnabled){$(document.body).fire("savedHotel:alreadySaved",B)}}}.bind(this)})},onSavedHotelListUpdated:function(B){var A=$A(B.memo.savedHotelsData.savedHotels);if(A.include(this.hotelId)){this.displayAsSaved()}else{this.displayAsNotSaved()}},displayAsSaved:function(){this.element.innerHTML=this.savedLabel;this.element.removeClassName("saveHotel");this.element.addClassName("savedHotel");this.saved=true},displayAsNotSaved:function(){this.element.innerHTML=this.notSavedLabel;this.element.removeClassName("savedHotel");this.element.addClassName("saveHotel");this.saved=false}});var RemoveSavedHotel=Class.create(Abstract.Agent,{initExtend:function(A){if(this.params){this.hotelId=this.params.hotelId;this.url=this.params.url;delete this.params;this.element.fire("savedHotel:removeAgentCreated",[this.element,"click",this.remove.bindAsEventListener(this)])}else{log.error("RemoveSavedHotel.initExtend: too few parameters to initialize")}},remove:function(A){A.preventDefault();this.request=new Ajax.Request(this.url,{method:"get",parameters:{cacheBuster:new Date().getTime()},onSuccess:function(D){var B=parseSavedHotelsResponse(D);B.element=this.element;$(document.body).fire("savedHotel:removed",B);$(document.body).fire("savedHotel:removed_"+this.hotelId,B)}.bind(this)})}});var parseSavedHotelsResponse=function(G){if(G&&G.responseText){var D=new Element("div");D.innerHTML=G.responseText;var E=D.select("div.savedHotelsData")[0].innerHTML;var H=D.select("span.savedHotelsTotal")[0];var F=D.select("div.savedHotelsStatusContent")[0];var B=D.select("div.savedHotelsContent")[0];var A={savedHotelsData:E.evalJSON(),savedHotelsTotal:H,savedHotelsStatusContent:F,savedHotelsContent:B};return A}};var SavedHotelsWebtrendsEventSender=new function(){this.onHotelSaved=function(A){var B=A.memo.addSavedHotelAgent;A.memo.addSavedHotelAgent.element.fire("webtrends:multiTrackEvent",{"DCS.dcsuri":B.url,"WT.dl":"1","WT.ti":"Link:"+B.notSavedLabel,"DCSext.fhid":B.hotelId})};this.onHotelAlreadySaved=function(A){var B=A.memo.addSavedHotelAgent;A.memo.addSavedHotelAgent.element.fire("webtrends:multiTrackEvent",{"DCS.dcsuri":B.url,"WT.dl":"1","WT.ti":"Link:"+B.savedLabel})};this.onSavedHotelsListViewed=function(D,F,G){if(arguments.length==3){var A;if(F=="SEARCH"){A="HP"}else{if(F=="RESULTS"){A="SR"}}if(G){var B=Event.findElement(G,"A");var E=B.innerText||B.textContent;var H=new RegExp("\\s*\\d+\\s*","g");E=E.strip();E=E.replace(H,"");B.fire("webtrends:multiTrackEvent",{"DCS.dcsuri":D,"WT.dl":"0","WT.si_n":"FH","WT.ti":"Link:"+E,"DCSext.fhl":A})}}else{log.error("SavedHotelsWebtrendsEventSender.onSavedHotelsListViewed(): too few parameters to execute")}};document.observe("savedHotel:saved",this.onHotelSaved.bindAsEventListener(this));document.observe("savedHotel:alreadySaved",this.onHotelAlreadySaved.bindAsEventListener(this))};var Slider=Class.create();Slider.prototype=Object.extend(new Abstract.Agent(),{initExtend:function(){this.min=this.params.min;this.max=this.params.max;this.snapInterval=this.params.snapInterval||false;this.tickSubdivisions=this.params.tickSubdivisions||1;this.tickInterval=this.params.tickInterval?this.params.tickInterval/this.tickSubdivisions:false;this.placesAfterDecimal=this.params.placesAfterDecimal||0;this.webTrendsTags=this.params.webTrendsTags||false;if(this.params.restricted===undefined){this.restricted=true}else{this.restricted=this.params.restricted}if(this.min===undefined||this.max===undefined){log.error("Required value missing");return}var B=$A(this.element.getElementsByTagName("input"));if(B.length==0){log.error("No inputs found");return}for(var F=0;F<B.length;F++){var M=parseFloat(B[F].value);B[F].value=this.correctValue(M).toFixed(this.placesAfterDecimal)}this.inputTimestamp=new Date();this.element.addClassName("slider"+B.length+"Handled");this.track=new Element("div",{"class":"sliderTrack"});this.track.setStyle({position:"relative"});this.element.insert(this.track);var A=document.createDocumentFragment();this.ticks=[];if(this.tickInterval){var H=(Math.floor(this.min/this.tickInterval)+1)*this.tickInterval;var E=(Math.ceil(this.max/this.tickInterval)-1)*this.tickInterval;var O=Math.ceil((E-H)/this.tickInterval)+3;var L=(Math.floor(this.min/this.tickSubdivisions/this.tickInterval)+1)*this.tickInterval*this.tickSubdivisions;var J=(Math.round((L-H)/this.tickInterval)+1)%this.tickSubdivisions}else{var O=2}for(var F=0;F<O;F++){var P;if(F==0){P="tick lowRange"}else{if(F==O-1){P="tick highRange"}else{if(F%this.tickSubdivisions==J){P="tick"}else{P="minorTick"}}}var G=new Element("div",{"class":P});this.ticks.push(G);A.appendChild(G)}this.trackLeft=new Element("div",{"class":"trackLeft"});A.appendChild(this.trackLeft);this.trackRight=new Element("div",{"class":"trackRight"});A.appendChild(this.trackRight);this.handles=[];for(var F=0;F<B.length;F++){var D=new Element("div",{"class":"handle handle"+F});D.style.cursor="pointer";this.handles[F]={element:D,index:F,input:B[F],lastValue:B[F].value};A.appendChild(D)}this.track.appendChild(A);var I=new Element("div",{"class":"sliderRange"});I.appendChild((new Element("span",{"class":"rangeLow"})).insert(this.min));I.appendChild((new Element("span",{"class":"rangeHigh"})).insert(this.max));this.element.appendChild(I);this.update();this.element.observe("mousedown",this.startDrag.bindAsEventListener(this));for(var F=0;F<B.length;F++){var K=$(B[F]);K.observe("blur",this.checkInputAndUpdate.bindAsEventListener(this));K.observe("keypress",this.handleInputKeyPress.bindAsEventListener(this))}},startDrag:function(F){var B=F.element();for(var D=0;D<this.handles.length;D++){if(this.handles[D].element==B){var A=this.handles[D];break}}if(!A||!Event.isLeftClick(F)){return}document.body.style.cursor="pointer";var G=0;if(this.restricted&&A.index>0){var E=this.handles[A.index-1].element;G=parseInt(E.getStyle("marginLeft"))}var H=this.width;if(this.restricted&&A.index<this.handles.length-1){var E=this.handles[A.index+1].element;H=parseInt(E.getStyle("marginLeft"))}this.drag={handle:A,mousePos:Event.pointerX(F),handlePos:parseInt(B.getStyle("marginLeft")),minimum:G,maximum:H};this.eventListeners={mousemove:this.continueDrag.bindAsEventListener(this),mouseup:this.stopDrag.bindAsEventListener(this),selectstart:this.preventTextSelection.bindAsEventListener(this)};for(var D in this.eventListeners){document.observe(D,this.eventListeners[D])}F.preventDefault()},continueDrag:function(A){if(!this.drag){return}var D=Event.pointerX(A)-this.drag.mousePos+this.drag.handlePos;if(D<this.drag.minimum){D=this.drag.minimum}else{if(D>this.drag.maximum){D=this.drag.maximum}}var B=this.pixelsToValue(D);if(this.snapInterval){var B=this.snapValue(B);D=this.valueToPixels(B)}this.moveHandle(this.drag.handle,D);this.updateInput(this.drag.handle,B);A.preventDefault()},stopDrag:function(B){if(!this.drag){return}var E=parseInt(this.drag.handle.element.getStyle("marginLeft"));var D=this.pixelsToValue(E);this.updateInput(this.drag.handle,D,true);this.drag=false;document.body.style.cursor="auto";for(var A in this.eventListeners){document.stopObserving(A,this.eventListeners[A])}this.eventListeners=null;B.preventDefault()},moveHandle:function(A,B){A.element.style.marginLeft=B+"px";if(A.index==0){this.trackLeft.style.width=B+"px"}if(A.index==this.handles.length-1){this.trackRight.style.width=this.width-B+"px"}},updateInput:function(A,B){var D=arguments[2];if(new Date()-this.inputTimestamp<50&&!D){return}B=parseFloat(B).toFixed(this.placesAfterDecimal);if(A.input.value!=B){A.input.value=B;this.inputTimestamp=new Date()}if(D&&A.lastValue!=B){A.lastValue=B;if(this.webTrendsTags){this.element.fire("webtrends:multiTrackEvent",this.webTrendsTags)}this.element.fire("agent:filter")}},checkInputAndUpdate:function(E){var B=E.element();for(var D=0;D<this.handles.length;D++){if(this.handles[D].input==B){var A=this.handles[D];break}}if(!A){return}var G=this.correctValue(A.input.value);var F=this.min;if(this.restricted&&A.index>0){F=this.handles[A.index-1].input.value}var H=this.max;if(this.restricted&&A.index<this.handles.length-1){H=this.handles[A.index+1].input.value}if(G<F){G=F}else{if(G>H){G=H}}if(this.snapInterval){G=this.snapValue(G)}this.updateInput(A,G,true);this.moveHandle(A,this.valueToPixels(G))},handleInputKeyPress:function(A){if(Event.KEY_RETURN==A.keyCode){this.checkInputAndUpdate(A)}},update:function(){this.width=this.track.getWidth();for(var A=0;A<this.handles.length;A++){this.moveHandle(this.handles[A],this.valueToPixels(this.correctValue(this.handles[A].input.value)))}this.ticks[0].setStyle({marginLeft:this.valueToPixels(this.min)+"px"});var B=(Math.floor(this.min/this.tickInterval)+1)*this.tickInterval;for(var A=1;A<this.ticks.length-1;A++){this.ticks[A].setStyle({marginLeft:this.valueToPixels(B)+"px"});B+=this.tickInterval}this.ticks[this.ticks.length-1].setStyle({marginLeft:this.valueToPixels(this.max)+"px"})},pixelsToValue:function(B){var A=((this.max-this.min)*B/this.width)+this.min;return this.correctValue(A)},valueToPixels:function(A){A=this.correctValue(A);return Math.round((A-this.min)/(this.max-this.min)*this.width)},correctValue:function(A){if(isNaN(A)){A=this.min}if(A<this.min){A=this.min}else{if(A>this.max){A=this.max}}return A},snapValue:function(A){var B=Math.round(A/this.snapInterval)*this.snapInterval;if(this.max-A<A-B){B=this.max}else{if(A-this.min<B-A){B=this.min}}return B},preventTextSelection:function(A){A.preventDefault()}});var SlideShow=Class.create(Abstract.Agent,{initExtend:function(){var F=Element.extend(this.element.parentNode);if(this.params.compactMode){F.addClassName("compactImageGallery")}var G=new ProgressIndicator();F.parentNode.appendChild(G.container);this.startSlideShowOnLoad=false;this.endlessLoop=false;this.imagesPerGroup=this.params.thumbnailCount?Number(this.params.thumbnailCount):4;this.slideShowController=false;this.slideShowWaitTime=2;this.images=$A();this.currentImageIndex=0;this.loadAdvanceImages=2;this.timeToWaitForLoad=1500;$A(F.getElementsByTagName("A")).each(function(J,I){var K=Element.extend(J);this.images.push({imageRef:K,initialized:false,parent:Element.extend(K.parentNode),imageIndex:I});if(I===0){this.images[I].parent.addClassName("current")}if(I>=this.imagesPerGroup){this.images[I].parent.hide()}}.bind(this));this.galleryExists=this.images.length>1;if(!this.galleryExists||this.params.compactMode){this.element.hide()}this.groups=this.images.inGroupsOf(this.imagesPerGroup);this.currentThumbGroup=0;this.initializeThumbGroup(this.currentThumbGroup);var H=new Element("div").addClassName("mainImage");this.image=new Element("img",{alt:""});H.appendChild(this.image);this.header=new Element("div").addClassName("galleryHeader");var E=new Element("div").addClassName("galleryControls");if(this.params.virtualTourLink){var D=new Element("div").addClassName("tourLink");D.update(this.params.virtualTourLink.unescapeXML());this.header.appendChild(D);Page.initializeDOMFragment(D)}this.currentPosition=new Element("span").update(this.currentImageIndex+1);E.appendChild(this.currentPosition);E.appendChild(new Element("span").update("&nbsp;"+this.params.numText.strip()+"&nbsp;"+this.images.length));if(this.galleryExists){this.nextButtonMarkup=this.params.nextButtonMarkup.unescapeXML();this.previousButtonMarkup=this.params.previousButtonMarkup.unescapeXML();this.nextButtonDisabledMarkup=this.params.nextButtonDisabledMarkup.unescapeXML();this.previousButtonDisabledMarkup=this.params.previousButtonDisabledMarkup.unescapeXML();this.nextButton=new Element("a",{href:"#"}).update(this.nextButtonMarkup);this.previousButton=(new Element("a",{href:"#"}).update(this.previousButtonMarkup));this.startSlideshowButtonMarkup=this.params.startSlideshowButtonMarkup.unescapeXML();this.stopSlideshowButtonMarkup=this.params.stopSlideshowButtonMarkup.unescapeXML();this.showButton=new Element("a",{href:"#"}).addClassName("slideshowControl").update(this.startSlideshowButtonMarkup);var B=function(I){if(I.findElement("a")===this.previousButton){this.previousClick(true)}if(I.findElement("a")===this.nextButton){this.nextClick(true)}if(I.findElement("a")===this.showButton){if(this.slideShowController){this.stopSlideShow()}else{this.startSlideShow()}}I.stop()}.bindAsEventListener(this);Event.observe(this.header,"click",B);E.insert({top:this.previousButton,bottom:this.nextButton});this.header.appendChild(E);this.header.appendChild(this.showButton)}F.appendChild(this.header);F.appendChild(H);this.maxWidth=H.getStyle("width");var A=(this.maxWidth.indexOf("em")!=-1);this.maxWidth=this.maxWidth.replace(/[^\d]/g,"");if(A){this.maxWidth=this.maxWidth/Units.EM_TO_PX}this.showImage(0,0);if(this.galleryExists&&!this.params.compactMode){F.appendChild(this.setupThumbnails());this.element.show()}setTimeout(function(){G.stop();F.parentNode.removeChild(G.container);F.showByClass();if(this.startSlideShowOnLoad){this.startSlideShow()}}.bindAsEventListener(this),this.timeToWaitForLoad)},setupThumbnails:function(){var B=new Element("div").addClassName("slideshowThumbnails");B.appendChild(this.element);if(this.groups.length>1){this.backControl=this.previousButton.cloneNode(true).addClassName("backControl");this.forwardControl=this.nextButton.cloneNode(true).addClassName("forwardControl");B.insert({top:this.backControl,bottom:this.forwardControl})}var A=function(D){var G=D.target;if(D.findElement("a")===this.backControl){this.previousThumbGroup()}if(D.findElement("a")===this.forwardControl){this.nextThumbGroup()}if(G.hasClassName("thumbnail")){var F=this.images.detect(function(H){if(G.src==H.imageRef){return H}});this.showImage(this.currentImageIndex,F.imageIndex);var E=this.currentImageIndex+this.loadAdvanceImages;if(E>=this.images.length){E=0}if(!this.images[E].initialized){this.initializeThumbGroup(this.currentThumbGroup+1)}this.currentPosition.update(this.currentImageIndex+1)}this.stopSlideShow();D.stop()}.bindAsEventListener(this);Event.observe(B,"click",A);return B},startSlideShow:function(){if(!this.endlessLoop&&(this.currentImageIndex)+1==this.images.length){this.swapGroupVisibility(this.currentThumbGroup,0);this.showImage(this.currentImageIndex,0)}this.slideShowController=new PeriodicalExecuter(function(A){this.nextClick(false)}.bind(this),this.slideShowWaitTime);this.showButton.update(this.stopSlideshowButtonMarkup)},stopSlideShow:function(){if(this.slideShowController){this.slideShowController.stop()}this.slideShowController=false;this.showButton.update(this.startSlideshowButtonMarkup)},initializeThumbnail:function(B,A){var D=new Element("img",{src:this.images[A].imageRef.href,"class":"thumbnail"});B.update(D);this.images[A].initialized=true},initializeThumbGroup:function(B){for(var A=0;A<this.imagesPerGroup;A++){if(this.groups[B][A]){this.groups[B][A].groupIndex=B;this.initializeThumbnail(this.groups[B][A].imageRef,this.groups[B][A].imageIndex)}}},showImage:function(B,A){this.images[B].parent.removeClassName("current");this.image.removeAttribute("width");this.currentImageIndex=A;this.currentPosition.update(this.currentImageIndex+1);this.image.src=this.images[A].imageRef.href;if(this.image.width>this.maxWidth){this.image.width=this.maxWidth}this.images[A].parent.addClassName("current");if(this.galleryExists){if(!this.endlessLoop&&A===0){this.disableLink(this.previousButton,"back")}else{this.enableLink(this.previousButton,"back")}if(!this.endlessLoop&&A===this.images.length-1){this.disableLink(this.nextButton,"forward")}else{this.enableLink(this.nextButton,"forward")}}},enableLink:function(A,B){A.innerHTML=((B=="back")?this.previousButtonMarkup:this.nextButtonMarkup)},disableLink:function(A,B){A.innerHTML=((B=="forward")?this.nextButtonDisabledMarkup:this.previousButtonDisabledMarkup)},nextClick:function(B){var F=this.currentImageIndex+1;var D=F>=this.images.length;if(this.endlessLoop&&D){F=0;D=false}if(!D){this.showImage(this.currentImageIndex,F);var A=this.currentImageIndex+this.loadAdvanceImages;if(A>=this.images.length){A=0}if(!this.images[A].initialized){var E=this.currentThumbGroup+1;if(E>this.groups.length){E=0}this.initializeThumbGroup(E)}if(this.currentThumbGroup!==this.images[this.currentImageIndex].groupIndex){this.swapGroupVisibility(this.currentThumbGroup,this.images[this.currentImageIndex].groupIndex)}D=(!this.endlessLoop&&this.currentImageIndex===this.images.length-1)}if(B||D){this.stopSlideShow()}},previousClick:function(B){var F=this.currentImageIndex-1;var D=F<0;if(this.endlessLoop&&D){F=this.images.length-1;D=false}if(!D){this.showImage(this.currentImageIndex,F);var A=this.currentImageIndex-this.loadAdvanceImages;if(A<=0){A=this.images.length-1}if(!this.images[A].initialized){var E=this.currentThumbGroup-1;if(E<=0){E=this.groups.length-1}this.initializeThumbGroup(E)}if(this.currentThumbGroup!==this.images[this.currentImageIndex].groupIndex){this.swapGroupVisibility(this.currentThumbGroup,this.images[this.currentImageIndex].groupIndex)}D=(!this.endlessLoop&&this.currentImageIndex===0)}if(B||D){this.stopSlideShow()}},nextThumbGroup:function(){var B=this.currentThumbGroup;var D=this.currentThumbGroup+1;var A=D>=this.groups.length;if(this.endlessLoop&&A){D=0;A=false}if(!A){if(!this.groups[D][0].initialized){this.initializeThumbGroup(D)}this.swapGroupVisibility(B,D)}},previousThumbGroup:function(){var B=this.currentThumbGroup;var D=this.currentThumbGroup-1;var A=D<0;if(this.endlessLoop&&A){D=this.groups.length-1;A=false}if(!A){if(!this.groups[D][0].initialized){this.initializeThumbGroup(D)}this.swapGroupVisibility(B,D)}},swapGroupVisibility:function(B,D){this.currentThumbGroup=D;for(var A=0;A<this.imagesPerGroup;A++){if(this.groups[B][A]){this.groups[B][A].parent.hide()}if(this.groups[D][A]){this.groups[D][A].parent.show()}}if(!this.endlessLoop&&D===0){this.disableLink(this.backControl,"back")}else{this.enableLink(this.backControl,"back")}if(!this.endlessLoop&&D===this.groups.length-1){this.disableLink(this.forwardControl,"forward")}else{this.enableLink(this.forwardControl,"forward")}}});var Booker=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){function A(B){document.fire("bookerName:changed",B)}$A(this.element.getElementsByTagName("select")).each(function(B){Event.observe(B,"change",function(){A(B)}.bindAsEventListener(this))});$A(this.element.getElementsByTagName("input")).each(function(B){Event.observe(B,"change",function(){A(B)}.bindAsEventListener(this))})}});var TravelerName=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.nameInputs=new Hash();function B(H){var F=this.getNameInputName(H.memo);var G=this.nameInputs.get(F);if(G){G.value=H.memo.value}var E=this.getNameInfoHash();document.fire("traveler"+this.params.travelerIndex+"Name:changed",E)}var D=null;function A(F){var E=this.getNameInfoHash();document.fire("traveler"+this.params.travelerIndex+"Name:changed",E);if(D){document.stopObserving("bookerName:changed",D)}}$A(this.element.getElementsByTagName("select")).each(function(F){var E=this.getNameInputName(F);this.nameInputs.set(E,F);Event.observe(F,"change",A.bindAsEventListener(this))}.bind(this));$A(this.element.getElementsByTagName("input")).each(function(E){var F=this.getNameInputName(E);this.nameInputs.set(F,E);Event.observe(E,"change",A.bindAsEventListener(this))}.bind(this));if(this.params.watchBooker){D=B.bindAsEventListener(this);document.observe("bookerName:changed",D)}},getNameInputName:function(A){return A.name.substring(A.name.indexOf("name.")+5)},getNameFromInputs:function(){var B=this.nameInputs.values();var A="";B.each(function(D){if(D.type=="select-one"){var E=D.options[D.selectedIndex];if(E.value!=""){A+=E.text+" "}}else{if(D.type!="radio"){A+=D.value+" "}}});return A},getNameInfoHash:function(){var A=new Hash();A.set("index",this.params.travelerIndex);A.set("name",this.getNameFromInputs());return A}});var ExistingTraveler=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.initialText=this.element.innerHTML;function A(E){var D=this.initialText;var B=E.memo.get("name");if(B.strip()!=""){D=B+" ("+this.initialText.replace(":","")+")"}this.element.update(D)}document.observe("traveler"+this.params.travelerIndex+"Name:changed",A.bindAsEventListener(this))}});var SavedTraveler=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.params=$H(this.params);this.savedMemberSelect=Element.extend(this.element.getElementsByTagName("select")[0]);this.useSavedMemberRadio=Element.extend(this.element.getElementsByTagName("input")[0]);function A(F){var E=true;if(F.target.type=="radio"){if(!F.target.checked){E=false}}if(E){var D=this.getNameInfoHash(this.savedMemberSelect.selectedIndex);document.fire("traveler"+this.params.get("travelerIndex")+"Name:changed",D)}}Event.observe(this.savedMemberSelect,"change",A.bindAsEventListener(this));Event.observe(this.useSavedMemberRadio,"change",A.bindAsEventListener(this));function B(E){var D={memo:this.getNameInfoHash(this.savedMemberSelect.selectedIndex)};E.memo.callback(D)}document.observe("traveler"+this.params.get("travelerIndex")+":getData",B.bindAsEventListener(this))},getNameInfoHash:function(B){var A=new Hash();A.set("index",this.params.get("travelerIndex"));var D=this.savedMemberSelect.options[B];A.set("name",D.value==""?"":D.text);A.set("travelerInformation",this.params.get("traveler"+this.savedMemberSelect.options[B].value));return A}});var TravelerPhoneNumber=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){this.countryCode=Element.extend(this.element.getElementsByTagName("select")[0]);this.phoneNumber=Element.extend(this.element.getElementsByTagName("input")[0]);this.extension=Element.extend(this.element.getElementsByTagName("input")[1]);var D=function(F){log.debug("TravelerPhoneNumber travelerChanged() has fired");var G=F.memo.get("travelerInformation");if(G){var E=G.phone;this.countryCode.value=E.countryCode;this.phoneNumber.value=E.phoneNumber;this.extension.value=E.extension}else{this.countryCode.value="";this.phoneNumber.value="";this.extension.value=""}};var B=D.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,B);Event.observe(this.countryCode,"change",function(E){document.stopObserving(A,B)});Event.observe(this.phoneNumber,"change",function(E){document.stopObserving(A,B)});Event.observe(this.extension,"change",function(E){document.stopObserving(A,B)});if(this.phoneNumber.value==""){log.debug("TravelerPhoneNumber firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:D.bind(this)})}}});var TravelerEmailAddress=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=Element.extend(this.element.getElementsByTagName("input")[0]);var E=function(G){log.debug("TravelerEmailAddress travelerChanged() has fired");var H=G.memo.get("travelerInformation");if(H){var F=H.email;B.value=F}else{B.value=""}};var D=E.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,D);Event.observe(B,"change",function(F){document.stopObserving(A,D)})}});var TravelerLoyaltyPrograms=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=Element.extend(this.element.getElementsByTagName("input")[0]);var E=function(F){log.debug("TravelerLoyaltyPrograms travelerChanged() has fired");var G=F.memo.get("travelerInformation");if(G){var H=$H(G.loyaltyPrograms);B.value=H.get(this.params.loyaltyProgramType+"LoyaltyProgram"+this.params.loyaltyProgramCode)}else{B.value=""}};var D=E.bindAsEventListener(this);var A="traveler"+this.params.travelerIndex+"Name:changed";document.observe(A,D);Event.observe(B,"change",function(F){document.stopObserving(A,D)});if(B.value==""){log.debug("firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:E.bind(this)})}}});var TravelerFlightSpecialRequests=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var E=false;var D=new Hash();var A=new Hash();var B=function(G){log.debug("TravelerFlightSpecialRequests travelerChanged() executing for traveler"+this.params.travelerIndex);var H=G.memo.get("travelerInformation");if(H){var F=H.flightPreferences;if(F.seat!=""&&D.keys()!=""){D.get(F.seat).checked=true}A.get("meal").value=F.meal;A.get("specialRequest").value=F.specialRequest}else{if(D.keys()!=""){D.get("N").checked=true}A.get("meal").value="";A.get("specialRequest").value=""}};this.observingFunction=B.bindAsEventListener(this);this.customEvent="traveler"+this.params.travelerIndex+"Name:changed";document.observe(this.customEvent,this.observingFunction);$A(this.element.getElementsByTagName("input")).each(function(F,G){D.set(F.value,F);if(G!=0&&F.checked){E=true}Event.observe(F,"change",this.stopObserving.bindAsEventListener(this))}.bind(this));$A(this.element.getElementsByTagName("select")).each(function(F){A.set(F.name.substr(F.name.lastIndexOf(".")+1),F);if(F.selectedIndex!=0){E=true}Event.observe(F,"change",this.stopObserving.bindAsEventListener(this))}.bind(this));if(!E){log.debug("firing travelerX:getData function");document.fire("traveler"+this.params.travelerIndex+":getData",{callback:B.bind(this)})}},stopObserving:function(A){document.stopObserving(this.customEvent,this.observingFunction)}});var RevealOtherActivitesControl=Class.create(Abstract.Agent,{initExtend:function(){var A=function(D){if(D.target.tagName.toLowerCase()=="a"){document.fire("otherActivities:reveal");B(D)}};var B=function(D){this.element.stopObserving("click",A)}.bindAsEventListener(this);Event.observe(this.element,"click",A);document.observe("otherActivitiesControl:remove",B)}});var RevealOtherActivities=Class.create(Abstract.Agent,{initExtend:function(){var D=new Element("div").addClassName("otherCategoriesReveal");var A=new Element("a").addClassName("link").update(this.params.linkText);D.appendChild(A);var E=function(F){this.element.showByClass();this.element.getElementsByTagName("input")[0].value=true;B(F);F.preventDefault()}.bindAsEventListener(this);var B=function(F){A.stopObserving("click",E);D.removeChild(A);this.element.parentNode.removeChild(D);document.fire("otherActivitiesControl:remove")}.bindAsEventListener(this);Event.observe(A,"click",E);document.observe("otherActivities:reveal",E);this.element.parentNode.appendChild(D)}});var OasOptionsToggle=Class.create(Abstract.Agent,{initExtend:function(){this.oasOptions=null;Event.observe(this.element,"click",function(A){if(!this.oasOptions){this.oasOptions=this.element.up("div.oasProductOptions")}if(this.oasOptions.hasClassName("collapsedView")){this.element.update(this.params.hideDetailsText);this.oasOptions.removeClassName("collapsedView")}else{this.element.update(this.params.showDetailsText);this.oasOptions.addClassName("collapsedView")}A.preventDefault()}.bindAsEventListener(this))}});var OasSubOptionEventManager=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=$A();$A(this.element.getElementsByTagName("input")).each(function(D){if(D.type.toLowerCase()==="checkbox"){B.push(D)}});var A=function(){var D=[];B.each(function(F){if(F.checked){var E=F.name.substring(F.name.lastIndexOf("['")+2,F.name.lastIndexOf("']"));D[D.length]=E}});return D};Event.observe(this.element,"click",function(F){var E=F.target;if(E.tagName.toLowerCase()==="input"&&E.type.toLowerCase()==="checkbox"){var D=A();document.fire("oasSubOptions"+this.params.activityKey+":changed",D)}}.bindAsEventListener(this));document.observe("oasSubOptions"+this.params.activityKey+":getKey",function(E){var D=A().toString();if(D!=E.memo.displayedKey){var F={memo:D};E.memo.callback(F)}}.bindAsEventListener(this))}});var OasOptionsTableManager=Class.create(Abstract.Agent,{beforeDOMReady:true,initExtend:function(){var B=function(I){if(I.target.tagName.toLowerCase()=="input"){var H=Element.extend(I.target).getParentByTagName("tbody").getElementsByClassName("displayedRow")[0];if(H){H.removeClassName("displayedRow")}var G=Element.extend(I.target).getParentByTagName("tr");G.addClassName("displayedRow");document.fire("oasOption"+this.params.activityKey+":changed",this.element)}}.bindAsEventListener(this);Event.observe(this.element,"click",B);if(this.params.subOptions){var F=function(){var I=$A();var J=this.element.getElementsByTagName("input");for(var H=0;H<J.length;H++){var G=J[H];if(G.type=="radio"){I.push(G)}}return I}.bindAsEventListener(this);var E=function(){var I=false;var J=F();for(var H=0;H<J.length;H++){var G=J[H];if(G.checked){I=G.value}}return I};var A=function(K){var J=F();var G=false;for(var I=0;I<J.length;I++){var H=J[I];if(H.value==K){H.click();G=true;return}}if(!G){log.debug("defaulting selected option to first radio since lists did not match");J[0].click()}};var D=function(G){if(this.params.subOptions[G.memo]){var I=E();var H=this.params.subOptions[G.memo].unescapeXML();this.element.update(H);A(I)}}.bindAsEventListener(this);document.observe("oasSubOptions"+this.params.activityKey+":changed",D);document.fire("oasSubOptions"+this.params.activityKey+":getKey",{displayedKey:this.params.displayedKey,callback:D})}}});var OnlineOpinion=new Object();OnlineOpinion.util={SafeAddOnLoadEvent:function(B){if(!document.getElementById|!document.getElementsByTagName){return}var A=window.onload;if(typeof window.onload!="function"){window.onload=B}else{window.onload=function(){A();B()}}},SafeAddOnUnLoadEvent:function(A){if(!document.getElementById|!document.getElementsByTagName){return}var B=window.onunload;if(typeof window.onunload!="function"){window.onunload=A}else{window.onunload=function(){A();B()}}},popup:function(F,A,B){var E=window.open(F,A,B);if(typeof E=="undefined"){if(document.all){document.getElementById("test").href=F;document.getElementById("test").click()}else{var D=window.open(F,"_blank");D.focus()}}return false},walkAnchors:function(H,F,I,B){var G=1000;var E=0;while(H&&F>0){E++;if(E>=G){var A=function(){OnlineOpinion.util.walkAnchors(H,F,I,B)};setTimeout(A,50);return}if(H.tagName=="A"){if(I.test(H.href)){H.onmousedown=function(){B.Preferences.Plugins.Events.poX=0}}}if(H.tagName=="INPUT"){if(H.type=="submit"||H.type=="image"){H.onmousedown=function(){B.Preferences.Plugins.Events.poX=0}}}if(H.tagName=="FORM"){if(typeof H.onsubmit!="function"){H.onsubmit=function(){B.Preferences.Plugins.Events.poX=0}}else{var J=H.onsubmit;H.onsubmit=function(){B.Preferences.Plugins.Events.poX=0;J()}}}if(H.nodeType==1){var D=/^(script|style|textarea)/i;if(!D.test(H.tagName)&&H.childNodes.length>0){H=H.childNodes[0];F++;continue}}if(H.nextSibling){H=H.nextSibling}else{while(F>0){H=H.parentNode;F--;if(H==null){break}if(H.nextSibling){H=H.nextSibling;break}}}}}};OnlineOpinion.cookie=function(){this.cookie_name="oo_r";this.expiration=24*60*60*1000;this.rhex=function(num){var hex_chr="0123456789abcdef",_s="";for(var j=0;j<=3;j++){_s+=hex_chr.charAt((num>>(j*8+4))&15)+hex_chr.charAt((num>>(j*8))&15)}return _s};this.str2blks_MD5=function(_s){var nblk=((_s.length+8)>>6)+1,blks=new Array(nblk*16);var i=0;for(;i<nblk*16;i++){blks[i]=0}for(i=0;i<_s.length;i++){blks[i>>2]|=_s.charCodeAt(i)<<((i%4)*8)}blks[i>>2]|=128<<((i%4)*8);blks[nblk*16-2]=_s.length*8;return blks};this._fSa=function(x,y){var lsw=(x&65535)+(y&65535),msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&65535)};this.rol=function(num,cnt){return(num<<cnt)|(num>>>(32-cnt))};this.cmn=function(q,a,b,x,s,t){return this._fSa(this.rol(this._fSa(this._fSa(a,q),this._fSa(x,t)),s),b)};this._fF=function(a,b,c,d,x,s){return this.cmn((b&c)|((~b)&d),a,0,x,s,0)};this._fG=function(a,b,c,d,x,s){return this.cmn((b&c)|(b&d)|(c&d),a,0,x,s,1518500249)};this._fH=function(a,b,c,d,x,s){return this.cmn(b^c^d,a,0,x,s,1859775393)};this._MD4=function(_s){var x=this.str2blks_MD5(_s),a=1732584193,b=-271733879,c=-1732584194,d=271733878;for(var i=0;i<x.length;i+=16){var olda=a,oldb=b,oldc=c,oldd=d;a=this._fF(a,b,c,d,x[i+0],3);d=this._fF(d,a,b,c,x[i+1],7);c=this._fF(c,d,a,b,x[i+2],11);b=this._fF(b,c,d,a,x[i+3],19);a=this._fF(a,b,c,d,x[i+4],3);d=this._fF(d,a,b,c,x[i+5],7);c=this._fF(c,d,a,b,x[i+6],11);b=this._fF(b,c,d,a,x[i+7],19);a=this._fF(a,b,c,d,x[i+8],3);d=this._fF(d,a,b,c,x[i+9],7);c=this._fF(c,d,a,b,x[i+10],11);b=this._fF(b,c,d,a,x[i+11],19);a=this._fF(a,b,c,d,x[i+12],3);d=this._fF(d,a,b,c,x[i+13],7);c=this._fF(c,d,a,b,x[i+14],11);b=this._fF(b,c,d,a,x[i+15],19);a=this._fG(a,b,c,d,x[i+0],3);d=this._fG(d,a,b,c,x[i+4],5);c=this._fG(c,d,a,b,x[i+8],9);b=this._fG(b,c,d,a,x[i+12],13);a=this._fG(a,b,c,d,x[i+1],3);d=this._fG(d,a,b,c,x[i+5],5);c=this._fG(c,d,a,b,x[i+9],9);b=this._fG(b,c,d,a,x[i+13],13);a=this._fG(a,b,c,d,x[i+2],3);d=this._fG(d,a,b,c,x[i+6],5);c=this._fG(c,d,a,b,x[i+10],9);b=this._fG(b,c,d,a,x[i+14],13);a=this._fG(a,b,c,d,x[i+3],3);d=this._fG(d,a,b,c,x[i+7],5);c=this._fG(c,d,a,b,x[i+11],9);b=this._fG(b,c,d,a,x[i+15],13);a=this._fH(a,b,c,d,x[i+0],3);d=this._fH(d,a,b,c,x[i+8],9);c=this._fH(c,d,a,b,x[i+4],11);b=this._fH(b,c,d,a,x[i+12],15);a=this._fH(a,b,c,d,x[i+2],3);d=this._fH(d,a,b,c,x[i+10],9);c=this._fH(c,d,a,b,x[i+6],11);b=this._fH(b,c,d,a,x[i+14],15);a=this._fH(a,b,c,d,x[i+1],3);d=this._fH(d,a,b,c,x[i+9],9);c=this._fH(c,d,a,b,x[i+5],11);b=this._fH(b,c,d,a,x[i+13],15);a=this._fH(a,b,c,d,x[i+3],3);d=this._fH(d,a,b,c,x[i+11],9);c=this._fH(c,d,a,b,x[i+7],11);b=this._fH(b,c,d,a,x[i+15],15);a=this._fSa(a,olda);b=this._fSa(b,oldb);c=this._fSa(c,oldc);d=this._fSa(d,oldd)}return this.rhex(a)+this.rhex(b)+this.rhex(c)+this.rhex(d)};this.read=function(n){var neq=n+"=";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(neq)==0){return unescape(c.substring(neq.length,c.length))}}return null};this.write=function(n,v){document.cookie=n+"="+v+";path=/;expires="+(new Date((new Date()).getTime()+this.expiration)).toGMTString()};this.matchurl=function(u,type){var i=0,c=this.read(this.cookie_name);if(type=="domain"){u=/(:\/\/)[\w\d\:\.]+/g.exec(u)[0].replace("://","")}n=this._MD4(u);if(c==null){return false}while(i<c.length){j=i+n.length;if(c.substring(i,j)==n){return(unescape(c.substring(j+1,j+2))==1)}i++}return false};this.tagurl=function(u,type){if(type=="domain"){u=/(:\/\/)[\w\d\:\.]+/g.exec(u)[0].replace("://","")}var prev_val="";if(this.read(this.cookie_name)!=null){prev_val=this.read(this.cookie_name).replace(eval("/"+escape(this._MD4(u))+"~1:/g"),"")}this.write(this.cookie_name,prev_val+(prev_val!=""?":":"")+escape(this._MD4(u))+"~1")}};OnlineOpinion.ocode=function(name){this.name=name;function rematch(val,restr){var re=new RegExp(restr);var m=re.exec(val);if(m==null||m==""){return""}else{var s="";for(i=0;i<m.length;i++){s=s+m[i]}return s}}this._fC=function(_u){_aT=this._sp+",\\/,\\.,-,_,"+this._rp+",%2F,%2E,%2D,%5F";_aA=_aT.split(",");for(i=0;i<5;i++){eval("_u=_u.replace(/"+_aA[i]+"/g,_aA[i+5])")}return _u};this._browser=function(){this.engine=null;this.version=null;var useragent=navigator.userAgent.toLowerCase();if(window.ActiveXObject){this.engine="ie";this.version=rematch(useragent,"msie\\s[0-9].[0-9]+").replace("msie ","")}else{if(window.opera){this.engine="opera";this.version=rematch(useragent,"opera.[0-9].[0-9]+").replace("opera","").replace("/","")}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){if(rematch(useragent,"applewebkit/[0-9]+")!=null){this.engine="webkit";this.version=rematch(useragent,"applewebkit/[0-9]+").replace("applewebkit/","")}else{this.engine="khtml";this.version=rematch(useragent,"khtml/[0-9].[0-9].[0-9]+").replace("khtml/","")}}else{if(document.getBoxObjectFor!=null){this.engine="gecko";this.version=rematch(useragent,"gecko/[0-9]+").replace("gecko/","")}}}}};this.serialize=function(obj,option){var str_out="",inc=0;for(var i in obj){if(typeof obj[i]!="function"&&typeof obj[i]!="undefined"&&obj[i]!=null&&obj[i]!=""){if(option==0){str_out+=(inc==0?"":"&")+i+"="+escape(obj[i])}else{if(option==1){str_out+=(inc==0?"":"|")+escape(obj[i])}}inc++}}return str_out};this.Preferences=new Object();this.Preferences.Persistence={enabled:true,cookie_type:"page",cookie_name:"oo_r",expiration:24*60*60*1000};this.Preferences.Render={type:"floating",main_div_id:"oo_feedback_float",up_div_id:"olUp",over_div_id:"olOver",img_path:"onlineopinion/oo_black.gif",feedback_span_id:"fbText",feedback_html:"FEEDBACK",click_html:"Click here to<br>rate this page",ty_html:"",float_style:"fixed"};this.Metrics=new Object();this.Metrics.core={width:screen.width,height:screen.height,referer:window.location.href,prev:document.referrer,time1:(new Date()).getTime(),time2:null};this.Metrics.custom=new Object();this.Preferences.Plugins=new Object();this.Preferences.Plugins.Events={poE:0,poX:0,poC:{id:"",value:0},poWC:0};this.onEntry=function(){if(Math.random()>=1-this.Preferences.Plugins.Events.poE){this.show();this.Preferences.Plugins.Events.poX=0}};this.onExit=function(){if(Math.random()>=1-this.Preferences.Plugins.Events.poX){this.show()}};this.OnClick=function(){if(Math.random()>=1-this.Preferences.Plugins.Events.poC){this.show();this.Preferences.Plugins.Events.poX=0;this.Preferences.Plugins.Events.poC=0}};this.Preferences.Plugins.URLRewrite={active:false,regex_search_pattern:"",regex_replace_pattern:""};this.Preferences.Plugins.CardOnPage={enabled:false,div_id:"onlineopinion_cc_window",iframe_id:"onlineopinion_cc_frame"};this.init=function(){this.resetReferer();if(typeof OnlineOpinion.cookie!="undefined"&&this.Preferences.Persistence.cookie_type!=null){this.Cookie=new OnlineOpinion.cookie();if(typeof this.Preferences.Persistence.cookie_name!="undefined"){this.Cookie.cookie_name=this.Preferences.Persistence.cookie_name}this.Cookie.expiration=1000*this.Preferences.Persistence.expiration;if(this.Cookie.matchurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)==1){this.Preferences.Plugins.Events.poX=0;this.Preferences.Plugins.Events.poE=0;return false}}else{this.Cookie=null}return true};this.render=function(onclick_func){this.init();var b=new this._browser();var d=document;var de=d.documentElement;var db=d.body;var w=window;var divID=this.Preferences.Render.main_div_id;var bVersion=parseFloat(b.version);var compliant=d.compatMode=="CSS1Compat";var sObj=compliant?de:db;if(b.engine=="webkit"){sObj=db}if(b.engine==null||b.version==null||isNaN(parseInt(b.version,10))||(b.engine=="ie"&&parseFloat(b.version)<6)||(b.engine=="opera"&&parseInt(b.version,10)<8)||(b.engine=="gecko"&&parseInt(b.version,10)<20041107)){return false}var mainDivObj=d.getElementById(divID);if(mainDivObj==null){if(this.Preferences.Render.type=="floating"){mainDivObj=db.appendChild(d.createElement("div"));mainDivObj.id=divID}}if(mainDivObj.innerHTML==""){if(this.Preferences.Render.type=="floating"){if(this.Preferences.Persistence.enabled&&this.Preferences.Persistence.cookie_type!=null){if(this.Cookie.matchurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)==1){return false}}var olUpObj=mainDivObj.appendChild(d.createElement("div"));olUpObj.id=this.Preferences.Render.up_div_id;var olOverObj=mainDivObj.appendChild(d.createElement("div"));olOverObj.id=this.Preferences.Render.over_div_id;olOverObj.style.display="none";olUpObj.onmouseover=function(){d.getElementById(olOverObj.id).style.display="block";document.getElementById(olUpObj.id).style.display="none"};olOverObj.onmouseout=function(){d.getElementById(olOverObj.id).style.display="none";document.getElementById(olUpObj.id).style.display="block"};var ooImg=olUpObj.appendChild(d.createElement("img"));ooImg.src=this.Preferences.Render.img_path;var fbText=olUpObj.appendChild(d.createElement("span"));fbText.id=this.Preferences.Render.feedback_span_id;fbText.innerHTML=this.Preferences.Render.feedback_html;var feedback_text=null;if(this.Preferences.Render.div_alt_text){feedback_text=this.Preferences.Render.div_alt_text}else{if(document.all){feedback_text=fbText.innerText}else{feedback_text=fbText.textContent}}mainDivObj.alt=feedback_text;mainDivObj.title=feedback_text;olOverObj.innerHTML=this.Preferences.Render.click_html}if(this.Preferences.Render.type=="static"){mainDivObj.innerHTML=this.Preferences.Render.main_html}}if(this.Preferences.Render.type=="floating"){if(!this.Preferences.Render.float_style){this.Preferences.Render.float_style="fixed"}var mdoStyle=mainDivObj.style;var _this=this;if(this.Preferences.Render.float_style=="rightOfContent"){function getRightOfContent(){return contentDiv.offsetWidth+contentDiv.offsetLeft+1}var contentDiv=d.getElementById(_this.Preferences.Render.main_content_id||"content");if(contentDiv==null){contentDiv=db.firstChild;while(contentDiv&&contentDiv.nodeType!=Node.ELEMENT_NODE){contentDiv=contentDiv.nextSibling}}function fixBackground(){if(_this.Preferences.Render.fix_background){db.style.backgroundAttachment="scroll";var margin=null;if(document.defaultView&&document.defaultView.getComputedStyle){margin=parseInt(document.defaultView.getComputedStyle(contentDiv,null).getPropertyValue("margin-left"),10)}else{margin=parseInt(contentDiv.currentStyle.marginLeft,10)}if(isNaN(margin)||margin==0){margin=contentDiv.offsetLeft||0}db.style.backgroundPosition=(Math.floor(contentDiv.scrollWidth*-0.5)-2+margin)+"px 0"}}}var ieSix=function(e){if(_this.Preferences.Render.float_style=="fixed"){mdoStyle.left=sObj.scrollLeft+sObj.clientWidth-mainDivObj.clientWidth}else{if(_this.Preferences.Render.float_style=="rightOfContent"){mdoStyle.left=getRightOfContent()+"px"}}mdoStyle.top=sObj.scrollTop+sObj.clientHeight-mainDivObj.clientHeight;if(e==null||e.type=="load"){mdoStyle.visibility="visible"}if(e==null||e.type=="load"||e.type=="resize"){fixBackground()}};if(b.engine=="ie"&&(bVersion<7||!compliant)){mdoStyle.position="absolute";function mapEvents(target,events){for(var idx=0;idx<events.length;idx++){var curevent=events[idx];target.attachEvent("on"+curevent,ieSix)}}mapEvents(mainDivObj,["mouseover","mouseout"]);mapEvents(w,["resize","scroll","mousewheel","load"]);ieSix()}else{mdoStyle.position="fixed";if(this.Preferences.Render.float_style=="fixed"){mdoStyle.right="0px";mdoStyle.bottom="0px"}else{if(this.Preferences.Render.float_style=="rightOfContent"){var rightOfContent=getRightOfContent()-sObj.scrollLeft+"px";mdoStyle.bottom="0px";mdoStyle.left=rightOfContent;var gutter=d.createElement("div");db.replaceChild(gutter,mainDivObj);gutter.appendChild(mainDivObj);gutter.style.position="absolute";gutter.style.width=mainDivObj.offsetWidth+"px";gutter.style.left=rightOfContent;gutter.style.top="0px";gutter.style.height=sObj.scrollHeight+"px";fixBackground();var resizeMove=function(e){var right=getRightOfContent();mdoStyle.left=right-sObj.scrollLeft+"px";if(e.type=="resize"){gutter.style.left=right+"px";fixBackground()}};if(b.engine=="ie"){w.attachEvent("onresize",resizeMove);w.attachEvent("onscroll",resizeMove)}else{w.addEventListener("resize",resizeMove,false);w.addEventListener("scroll",resizeMove,false)}}}mainDivObj.style.visibility="visible"}}mainDivObj.onclick=onclick_func;try{if(this.Preferences.Plugins.CardOnPage.enabled==true){var onPageCCdiv=db.appendChild(d.createElement("div"));onPageCCdiv.id=this.Preferences.Plugins.CardOnPage.div_id;var onPageCCiframe=onPageCCdiv.appendChild(d.createElement("iframe"));onPageCCiframe.id=this.Preferences.Plugins.CardOnPage.iframe_id;var W=(b.engine=="webkit")?w.innerWidth:(b.engine=="opera"?db.clientWidth:de.clientWidth);var H=(b.engine=="webkit")?w.innerHeight:(b.engine=="opera"?db.clientHeight:de.clientHeight);var wx=585,hy=400;onPageCCdiv.style.left=parseInt((W-wx)/2,10)+"px";onPageCCdiv.style.top=parseInt((H-hy)/2,10)+"px";if(b.engine=="ie"&&bVersion<7){onPageCCdiv.style.position="absolute"}}}catch(e){}return true};this.launchCC=function(){try{if(this.Cookie.matchurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)!=1){if(this.Preferences.Plugins.CardOnPage.enabled==true){document.getElementById(this.Preferences.Plugins.CardOnPage.iframe_id).src="https://secure.opinionlab.com/ccc01/comment_card.asp?"+(this.Preferences.Render.type=="asm"?"asm=1&":"")+"static=1&"+this.serialize(this.Metrics.core,0)+"&custom_var="+this.serialize(this.Metrics.custom,1);document.getElementById(this.Preferences.Plugins.CardOnPage.div_id).style.display="block"}else{OnlineOpinion.util.popup("https://secure.opinionlab.com/ccc01/comment_card.asp?"+(this.Preferences.Render.type=="asm"?"asm=1&":"")+this.serialize(this.Metrics.core,0)+"&custom_var="+this.serialize(this.Metrics.custom,1),"OnlineOpinion","resizable=yes,copyhistory=yes,scrollbars="+(this.Preferences.Render.type=="asm"?"yes":"no")+",location=no,status=no,fullscreen=no,width=545,height=200,top="+parseInt((this.Metrics.core.height-200)/2,10)+",left="+parseInt((this.Metrics.core.width-545)/2,10))}}}catch(e){OnlineOpinion.util.popup("https://secure.opinionlab.com/ccc01/comment_card.asp?"+(this.Preferences.Render.type=="asm"?"asm=1&":"")+this.serialize(this.Metrics.core,0)+"&custom_var="+this.serialize(this.Metrics.custom,1),"OnlineOpinion","resizable=yes,copyhistory=yes,scrollbars="+(this.Preferences.Render.type=="asm"?"yes":"no")+",location=no,status=no,fullscreen=no,width=545,height=200,top="+parseInt((this.Metrics.core.height-200)/2,10)+",left="+parseInt((this.Metrics.core.width-545)/2,10))}};this.show=function(){this.Metrics.core.time2=(new Date()).getTime();this.launchCC();if(this.Preferences.Persistence.enabled){document.getElementById(this.Preferences.Render.main_div_id).style.display="none"}if(this.Cookie!=null&&this.Preferences.Persistence.cookie_type!=null){this.Cookie.tagurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)}this.resetReferer()};this.resetReferer=function(alt_referer){var location=window.location.href;if(alt_referer){location=alt_referer}var rewriter=this.Preferences.Plugins.URLRewrite;if(rewriter&&rewriter.active==true){this.Metrics.core.referer=location.replace(rewriter.regex_search_pattern,rewriter.regex_replace_pattern)}else{this.Metrics.core.referer=location}};this.post=function(){this.Metrics.core.time2=(new Date()).getTime();var mainDivObj=document.getElementById(this.Preferences.Render.main_div_id);var JSONP=mainDivObj.appendChild(document.createElement("script"));var odata=this.serialize(this.Metrics.core,0)+"&custom_var="+this.serialize(this.Metrics.custom,1);var elements=document.forms[this.Preferences.Render.main_div_id+"_form"].elements;var formdata=[];for(idx=0;idx<elements.length;idx++){var curElement=elements[idx];try{var name=curElement.name;if(name!=undefined&&curElement.value!=undefined){switch(curElement.type){case"radio":if(curElement.checked){formdata.push(curElement.name+"="+encodeURIComponent(curElement.value))}break;case"checkbox":if(curElement.checked){formdata.push(curElement.name+"="+encodeURIComponent(curElement.value))}break;default:formdata.push(curElement.name+"="+encodeURIComponent(curElement.value))}}}catch(e){}}var cdata=formdata.join("&");var osignature=this.Cookie!=null?this.Cookie._MD4(odata):"";JSONP.src="https://secure.opinionlab.com/rate36s.asp?"+odata+"&"+cdata+"&signature="+osignature;if(this.Preferences.Persistence.enabled){var mainFormDiv=document.getElementById(this.Preferences.Render.main_div_id+"_form");mainFormDiv.style.display="none"}if(this.Preferences.Render.ty_html!=""){var TYDivObj=document.getElementById(this.Preferences.Render.ty_div_id);TYDivObj.innerHTML=this.Preferences.Render.ty_html;TYDivObj.style.display="block"}if(this.Cookie!=null&&this.Preferences.Persistence.cookie_type!=null){this.Cookie.tagurl(this.Metrics.core.referer,this.Preferences.Persistence.cookie_type)}this.resetReferer()}};function dcsCookie(){if(typeof(dcsOther)=="function"){dcsOther()}else{if(typeof(dcsPlugin)=="function"){dcsPlugin()}else{if(typeof(dcsFPC)=="function"){dcsFPC(gTimeZone)}}}}function dcsGetCookie(B){var E=document.cookie.indexOf(B+"=");if(E!=-1){var D=E+B.length+1;var A=document.cookie.indexOf(";",D);if(A==-1){A=document.cookie.length}return unescape(document.cookie.substring(D,A))}return null}function dcsGetCrumb(B,A){var E=dcsGetCookie(B).split(":");for(var D=0;D<E.length;D++){var F=E[D].split("=");if(A==F[0]){return F[1]}}return null}function dcsGetIdCrumb(D,A){var B=dcsGetCookie(D);var G=B.substring(0,B.indexOf(":lv="));var F=G.split("=");for(var E=0;E<F.length;E++){if(A==F[0]){return F[1]}}return null}function dcsFPC(F){if(typeof(F)=="undefined"){return}if(document.cookie.indexOf("WTLOPTOUT=")!=-1){return}var A=gFpc;var K=new Date();var J=(K.getTimezoneOffset()*60000)+(F*3600000);K.setTime(K.getTime()+J);var E=new Date(K.getTime()+315360000000);var L=new Date(K.getTime());if(document.cookie.indexOf(A+"=")==-1){if((typeof(gWtId)!="undefined")&&(gWtId!="")){WT.co_f=gWtId}else{if((typeof(gTempWtId)!="undefined")&&(gTempWtId!="")){WT.co_f=gTempWtId;WT.vt_f="1"}else{WT.co_f="2";var M=K.getTime().toString();for(var H=2;H<=(32-M.length);H++){WT.co_f+=Math.floor(Math.random()*16).toString(16)}WT.co_f+=M;WT.vt_f="1"}}if(typeof(gWtAccountRollup)=="undefined"){WT.vt_f_a="1"}WT.vt_f_s="1";WT.vt_f_d="1";WT.vt_f_tlh=WT.vt_f_tlv="0"}else{var B=dcsGetIdCrumb(A,"id");var D=parseInt(dcsGetCrumb(A,"lv"));var O=parseInt(dcsGetCrumb(A,"ss"));if((B==null)||(B=="null")||isNaN(D)||isNaN(O)){return}WT.co_f=B;var G=new Date(D);WT.vt_f_tlh=Math.floor((G.getTime()-J)/1000);L.setTime(O);if((K.getTime()>(G.getTime()+1800000))||(K.getTime()>(L.getTime()+28800000))){WT.vt_f_tlv=Math.floor((L.getTime()-J)/1000);L.setTime(K.getTime());WT.vt_f_s="1"}if((K.getDay()!=G.getDay())||(K.getMonth()!=G.getMonth())||(K.getYear()!=G.getYear())){WT.vt_f_d="1"}}WT.co_f=escape(WT.co_f);WT.vt_sid=WT.co_f+"."+(L.getTime()-J);var I="; expires="+E.toGMTString();document.cookie=A+"=id="+WT.co_f+":lv="+K.getTime().toString()+":ss="+L.getTime().toString()+I+"; path=/"+(((typeof(gFpcDom)!="undefined")&&(gFpcDom!=""))?("; domain="+gFpcDom):(""));if(document.cookie.indexOf(A+"=")==-1){WT.co_f=WT.vt_sid=WT.vt_f_s=WT.vt_f_d=WT.vt_f_tlh=WT.vt_f_tlv="";WT.vt_f=WT.vt_f_a="2"}}function dcsEvt(B,A){var D=B.target||B.srcElement;while(D.tagName&&(D.tagName!=A)){D=D.parentElement||D.parentNode}return D}function dcsBind(B,A){if((typeof(window[A])=="function")&&document.body){if(document.body.addEventListener){document.body.addEventListener(B,window[A],true)}else{if(document.body.attachEvent){document.body.attachEvent("on"+B,window[A])}}}}function dcsET(){var A=(navigator.appVersion.indexOf("MSIE")!=-1)?"click":"mousedown";dcsBind(A,"dcsDownload");dcsBind(A,"dcsFormButton");dcsBind("keypress","dcsFormButton");dcsBind(A,"dcsImageMap")}function dcsMultiTrack(){if(arguments.length%2==0){for(var B=0;B<arguments.length;B+=2){if(arguments[B].indexOf("WT.")==0){WT[arguments[B].substring(3)]=arguments[B+1]}else{if(arguments[B].indexOf("DCS.")==0){DCS[arguments[B].substring(4)]=arguments[B+1]}else{if(arguments[B].indexOf("DCSext.")==0){DCSext[arguments[B].substring(7)]=arguments[B+1]}}}}var A=new Date();DCS.dcsdat=A.getTime();dcsFunc("dcsCookie");dcsTag()}}function dcsSetVar(){if((arguments.length%2==0)&&(navigator.appVersion.indexOf("MSIE")!=-1)){for(var A=0;A<arguments.length;A+=2){if(arguments[A].indexOf("WT.")==0){WT[arguments[A].substring(3)]=arguments[A+1]}else{if(arguments[A].indexOf("DCS.")==0){DCS[arguments[A].substring(4)]=arguments[A+1]}else{if(arguments[A].indexOf("DCSext.")==0){DCSext[arguments[A].substring(7)]=arguments[A+1]}}}}}}function dcsSetVarCap(E){var G=E.onclick.toString();var B=G.substring(G.indexOf("dcsSetVar(")+10,G.length);var D=B.substring(0,B.indexOf(");")).replace(/\s"/gi,"").replace(/"/gi,"");var F=D.split(",");if(F.length!=-1){for(var A=0;A<F.length;A+=2){if(F[A].indexOf("WT.")==0){WT[F[A].substring(3)]=F[A+1]}else{if(F[A].indexOf("DCS.")==0){DCS[F[A].substring(4)]=F[A+1]}else{if(F[A].indexOf("DCSext.")==0){DCSext[F[A].substring(7)]=F[A+1]}}}}}}function dcsNavigation(D){try{var B=0;while(B!=1){if(D.parentNode.tagName!="DIV"){D=D.parentNode}if(D.parentNode.tagName=="DIV"){if((D.parentNode.getAttribute("id"))||(D.parentNode.className)){DCSext.wtNav=D.parentNode.getAttribute("id")||D.parentNode.className;B=1}else{D=D.parentNode}}}}catch(A){}}function dcsDownload(A){A=A||(window.event||"");if(A){var E=dcsEvt(A,"A");if(E){if(E.href&&E.hostname&&E.protocol&&(E.protocol.indexOf("http")!=-1)){if(E.getAttribute("delegatedtracking")=="true"){}else{dcsNavigation(E);if((navigator.appVersion.indexOf("MSIE")==-1)&&(E.onclick)){dcsSetVarCap(E)}var D=E.pathname?((E.pathname.indexOf("/")!=0)?"/"+E.pathname:E.pathname):"/";if(document.all){var B=E.innerText||E.innerHTML||""}else{var B=E.textContent||E.innerHTML||""}dcsMultiTrack("DCS.dcssip",E.hostname,"DCS.dcsuri",D,"DCS.dcsqry",E.search||"","WT.ti","Link:"+B,"WT.dl","1","WT.ad","","WT.mc_id","","WT.sp","");DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=B=D=""}}}}}function dcsImageMap(A){A=A||(window.event||"");if(A){var B=dcsEvt(A,"AREA");if(B){if(B.href&&B.hostname&&B.protocol&&(B.protocol.indexOf("http")!=-1)){dcsNavigation(B);var D=B.pathname?((B.pathname.indexOf("/")!=0)?"/"+B.pathname:B.pathname):"/";dcsMultiTrack("DCS.dcssip",B.hostname,"DCS.dcsuri",D,"DCS.dcsqry",B.search||"","WT.ti","Link:Image Map","WT.dl","1","WT.ad","","WT.mc_id","","WT.sp","");DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.dl=""}}}}function dcsFormButton(I){I=I||(window.event||"");if(I){var J="INPUT,BUTTON,SPAN";var H=J.toUpperCase().split(",");for(var B=0;B<H.length;B++){var E=dcsEvt(I,H[B]);var G=E.type||"";if(G&&((G=="submit")||(G=="image")||(G=="button")||(G=="reset"))||((G=="text")&&((I.which||I.keyCode)==13))){var A=gTitle=gMethod=qry="";dcsNavigation(E);if(E.form){A=E.form.action||window.location.pathname;gTitle=E.form.id||E.form.className||E.form.name||"Unknown";gMethod=E.form.method||"Unknown"}else{A=window.location.pathname;gTitle=E.name||E.id||E.className||"Unknown";gMethod="Input"}if((A!="")&&(gTitle!="")&&(gMethod!="")&&(I.keyCode!=9)){if(A.indexOf("?")!=-1){var D=A.split("?");A=D[0];qry=D[1]}if(A.indexOf("http://")!=-1||A.indexOf("https://")!=-1){var F=A.substr(7).split("/");A="";for(var B=1;B<F.length;B++){A+="/"+F[B]}}dcsMultiTrack("DCS.dcssip",E.hostname||window.location.host||"","DCS.dcsuri",A,"DCS.dcsqry",qry,"WT.ti","FormButton:"+gTitle,"WT.dl","2","WT.fm",gMethod,"WT.ad","","WT.mc_id","","WT.sp","")}DCS.dcsuri=DCS.dcsqry=qry=WT.ti=WT.dl=WT.fm=""}}}}function dcsAdSearch(){if(document.links){for(var D=0;D<document.links.length;D++){var A=document.links[D].href+"";var G=A.toUpperCase().indexOf("WT.AC=");if(G!=-1){var F=G+6;var B=A.indexOf("&",F);var E=A.substring(F,(B!=-1)?B:A.length);WT.ad=WT.ad?(WT.ad+";"+E):E}}}}function dcsCleanUp(){_DCS=new Object();_WT=new Object();_DCSext=new Object();_WT.co_f=WT.co_f;_WT.vt_sid=WT.vt_sid;_WT.Site=WT.Site;_DCSext.hostname=DCSext.hostname;_DCSext.pos=DCSext.pos;_DCSext.b=DCSext.b;_DCSext.wtEvtSrc=DCSext.wtEvtSrc;_DCSext.owwPage=DCSext.owwPage;if(arguments.length%2==0){for(var A=0;A<arguments.length;A+=2){if(arguments[A].indexOf("WT.")==0){_WT[arguments[A].substring(3)]=arguments[A+1]}else{if(arguments[A].indexOf("DCS.")==0){_DCS[arguments[A].substring(4)]=arguments[A+1]}else{if(arguments[A].indexOf("DCSext.")==0){_DCSext[arguments[A].substring(7)]=arguments[A+1]}}}}}DCS=_DCS;WT=_WT;DCSext=_DCSext}function dcsAdv(){if((typeof(gTrackEvents)!="undefined")&&gTrackEvents){WT.wtsv=1;if(typeof(WT.sp)!="undefined"){WT.sv_sp=WT.sp}if(window.addEventListener){window.addEventListener("load",dcsET,false)}else{if(window.attachEvent){window.attachEvent("onload",dcsET)}}}dcsFunc("dcsCookie");dcsFunc("dcsAdSearch");var B=document.getElementsByName("WT.ti");for(var A=0;A<B.length;A++){if(B[A].tagName==="META"){DCSext.wtEvtSrc=B[A].content;break}}}function dcsVar(){var B=new Date();DCSext.hostname=window.location.hostname;WT.Site=DCSext.hostname;WT.tz=B.getTimezoneOffset()/60*-1;if(WT.tz==0){WT.tz="0"}WT.bh=B.getHours();WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;if(typeof(screen)=="object"){WT.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;WT.sr=screen.width+"x"+screen.height}if(typeof(navigator.javaEnabled())=="boolean"){WT.jo=navigator.javaEnabled()?"Yes":"No"}if(document.title){WT.ti=gI18n?dcsEscape(dcsEncode(document.title),I18NRE):document.title}WT.js="Yes";WT.jv=dcsJV();if(document.body&&document.body.addBehavior){document.body.addBehavior("#default#clientCaps");if(document.body.connectionType){WT.ct=document.body.connectionType}document.body.addBehavior("#default#homePage");WT.hp=document.body.isHomePage(location.href)?"1":"0"}if(parseInt(navigator.appVersion)>3){if((navigator.appName=="Microsoft Internet Explorer")&&document.body){WT.bs=document.body.offsetWidth+"x"+document.body.offsetHeight}else{if(navigator.appName=="Netscape"){WT.bs=window.innerWidth+"x"+window.innerHeight}}}WT.fi="No";if(window.ActiveXObject){for(var F=10;F>0;F--){try{var E=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+F);WT.fi="Yes";WT.fv=F+".0";break}catch(H){}}}else{if(navigator.plugins&&navigator.plugins.length){for(var F=0;F<navigator.plugins.length;F++){if(navigator.plugins[F].name.indexOf("Shockwave Flash")!=-1){WT.fi="Yes";WT.fv=navigator.plugins[F].description.split(" ")[2];break}}}}if(gI18n){WT.em=(typeof(encodeURIComponent)=="function")?"uri":"esc";if(typeof(document.defaultCharset)=="string"){WT.le=document.defaultCharset}else{if(typeof(document.characterSet)=="string"){WT.le=document.characterSet}}}WT.dl="0";DCS.dcsdat=B.getTime();DCS.dcssip=window.location.hostname;DCS.dcsuri=window.location.pathname;DCSext.owwPage=window.location.pathname;if(window.location.search){DCS.dcsqry=window.location.search;if(gQP.length>0){for(var F=0;F<gQP.length;F++){var I=DCS.dcsqry.indexOf(gQP[F]);if(I!=-1){var G=DCS.dcsqry.substring(0,I);var A=DCS.dcsqry.substring(I+gQP[F].length,DCS.dcsqry.length);DCS.dcsqry=G+A}}}}if((window.document.referrer!="")&&(window.document.referrer!="-")){var D=window.document.referrer;if(D.split("?")[0].indexOf(window.location.hostname)!=-1){D=D.split("?")[0]}if(!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){DCS.dcsref=gI18n?dcsEscape(D,I18NRE):D}}}function dcsA(B,A){return"&"+B+"="+dcsEscape(A,RE)}function dcsEscape(A,B){if(typeof(B)!="undefined"){var D=new String(A);for(R in B){D=D.replace(B[R],R)}return D}else{return escape(A)}}function dcsEncode(A){return(typeof(encodeURIComponent)=="function")?encodeURIComponent(A):escape(A)}function dcsCreateImage(A){if(document.images){gImages[gIndex]=new Image;gImages[gIndex].src=A;gIndex++}else{document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+A+'">')}}function dcsMeta(){var A;if(document.all){A=document.all.tags("meta")}else{if(document.documentElement){A=document.getElementsByTagName("meta")}}if(typeof(A)!="undefined"){for(var B=1;B<=A.length;B++){var D=A.item(B-1);if(D.name){if(D.name.indexOf("WT.")==0){WT[D.name.substring(3)]=(gI18n&&(D.name.indexOf("WT.ti")==0))?dcsEscape(dcsEncode(D.content),I18NRE):D.content}else{if(D.name.indexOf("DCSext.")==0){DCSext[D.name.substring(7)]=D.content}else{if(D.name.indexOf("DCS.")==0){DCS[D.name.substring(4)]=(gI18n&&(D.name.indexOf("DCS.dcsref")==0))?dcsEscape(D.content,I18NRE):D.content}}}}}}}function dcsTag(){if(document.cookie.indexOf("WTLOPTOUT=")!=-1){return}var A="http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+gDomain+(gDcsId==""?"":"/"+gDcsId)+"/dcs.gif?";for(N in WT){if(WT[N]){A+=dcsA("WT."+N,WT[N])}}for(N in DCSext){if(DCSext[N]){A+=dcsA(N,DCSext[N])}}for(N in DCS){if(DCS[N]){A+=dcsA(N,DCS[N])}}if(A.length>2048&&navigator.userAgent.indexOf("MSIE")>=0){A=A.substring(0,2040)+"&WT.tu=1"}dcsCreateImage(A)}function dcsJV(){var B=navigator.userAgent.toLowerCase();var J=parseInt(navigator.appVersion);var I=(B.indexOf("mac")!=-1);var O=((B.indexOf("mozilla")!=-1)&&(B.indexOf("compatible")==-1));var D=(O&&(J==4));var M=(O&&(J>=5));var A=((B.indexOf("msie")!=-1)&&(B.indexOf("opera")==-1));var E=(A&&(J==4)&&(B.indexOf("msie 4")!=-1));var F=(A&&!E);var H=(B.indexOf("opera")!=-1);var L=(B.indexOf("opera 5")!=-1||B.indexOf("opera/5")!=-1);var K=(B.indexOf("opera 6")!=-1||B.indexOf("opera/6")!=-1);var G=(H&&!L&&!K);var P="1.1";if(M||G){P="1.5"}else{if((I&&F)||K){P="1.4"}else{if(F||D||L){P="1.3"}else{if(E){P="1.2"}}}}return P}function dcsFunc(A){if(typeof(window[A])=="function"){window[A]()}}function wtInit(){gService=true;gTimeZone=-6;hostName=window.location.hostname;indexOfDot=hostName.indexOf(".");lengthOfHostName=hostName.length;if(indexOfDot==-1){gFpcDom=hostName}else{gFpcDom=hostName.slice(indexOfDot,lengthOfHostName)}gImages=new Array;gIndex=0;DCS=new Object();WT=new Object();DCSext=new Object();gQP=new Array();gI18n=false;if(window.RegExp){RE={"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g};I18NRE={"%25":/\%/g}}dcsVar();dcsMeta();dcsFunc("dcsAdv");dcsTag();dcsCleanUp()}wtInit();var mboxCopyright="Copyright 1996-2009. Adobe Systems Incorporated. All rights reserved";mboxUrlBuilder=function(B,A){this.a=B;this.b=A;this.c=new Array();this.d=function(D){return D};this.f=null};mboxUrlBuilder.prototype.addParameter=function(G,F){var E=new RegExp("('|\")");if(E.exec(G)){throw"Parameter '"+G+"' contains invalid characters"}for(var D=0;D<this.c.length;D++){var B=this.c[D];if(B.name==G){B.value=F;return this}}var A=new Object();A.name=G;A.value=F;this.c[this.c.length]=A;return this};mboxUrlBuilder.prototype.addParameters=function(D){if(!D){return this}for(var B=0;B<D.length;B++){var A=D[B].indexOf("=");if(A==-1||A==0){continue}this.addParameter(D[B].substring(0,A),D[B].substring(A+1,D[B].length))}return this};mboxUrlBuilder.prototype.setServerType=function(A){this.o=A};mboxUrlBuilder.prototype.setBasePath=function(A){this.f=A};mboxUrlBuilder.prototype.setUrlProcessAction=function(A){this.d=A};mboxUrlBuilder.prototype.buildUrl=function(){var F=this.f?this.f:"/m2/"+this.b+"/mbox/"+this.o;var E=document.location.protocol=="file:"?"http:":document.location.protocol;var G=E+"//"+this.a+F;var D=G.indexOf("?")!=-1?"&":"?";for(var B=0;B<this.c.length;B++){var A=this.c[B];G+=D+encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);D="&"}return this.t(this.d(G))};mboxUrlBuilder.prototype.getParameters=function(){return this.c};mboxUrlBuilder.prototype.setParameters=function(A){this.c=A};mboxUrlBuilder.prototype.clone=function(){var B=new mboxUrlBuilder(this.a,this.b);B.setServerType(this.o);B.setBasePath(this.f);B.setUrlProcessAction(this.d);for(var A=0;A<this.c.length;A++){B.addParameter(this.c[A].name,this.c[A].value)}return B};mboxUrlBuilder.prototype.t=function(A){return A.replace(/\"/g,"&quot;").replace(/>/g,"&gt;")};mboxStandardFetcher=function(){};mboxStandardFetcher.prototype.getType=function(){return"standard"};mboxStandardFetcher.prototype.fetch=function(A){A.setServerType(this.getType());document.write('<script src="'+A.buildUrl()+'" language="JavaScript"><\/script>')};mboxStandardFetcher.prototype.cancel=function(){};mboxAjaxFetcher=function(){};mboxAjaxFetcher.prototype.getType=function(){return"ajax"};mboxAjaxFetcher.prototype.fetch=function(A){A.setServerType(this.getType());var B=A.buildUrl();this.x=document.createElement("script");this.x.src=B;document.body.appendChild(this.x)};mboxAjaxFetcher.prototype.cancel=function(){};mboxMap=function(){this.y=new Object();this.z=new Array()};mboxMap.prototype.put=function(B,D){if(!this.y[B]){this.z[this.z.length]=B}this.y[B]=D};mboxMap.prototype.get=function(B){return this.y[B]};mboxMap.prototype.remove=function(B){this.y[B]=undefined};mboxMap.prototype.each=function(F){for(var D=0;D<this.z.length;D++){var B=this.z[D];var E=this.y[B];if(E){F(B,E)}}};mboxFactory=function(G,A,F){this.D=false;this.B=G;this.C=F;this.E=new mboxList();mboxFactories.put(F,this);this.F=typeof document.createElement("div").replaceChild!="undefined"&&(function(){return true})()&&typeof document.getElementById!="undefined"&&typeof(window.attachEvent||document.addEventListener||window.addEventListener)!="undefined"&&typeof encodeURIComponent!="undefined";this.G=this.F&&mboxGetPageParameter("mboxDisable")==null;var E=F=="default";this.I=new mboxCookieManager("mbox"+(E?"":("-"+F)),(function(){return mboxCookiePageDomain()})());this.G=this.G&&this.I.isEnabled()&&(this.I.getCookie("disable")==null);if(this.isAdmin()){this.enable()}this.J=mboxGenerateId();this.K=mboxScreenHeight();this.L=mboxScreenWidth();this.M=mboxBrowserWidth();this.N=mboxBrowserHeight();this.O=mboxScreenColorDepth();this.P=mboxBrowserTimeOffset();this.Q=new mboxSession(this.J,"mboxSession","session",31*60,this.I);this.R=new mboxPC("PC",2592000,this.I);this.w=new mboxUrlBuilder(G,A);this.S(this.w,E);this.T=new Date().getTime();this.U=this.T;var D=this;this.addOnLoad(function(){D.U=new Date().getTime()});if(this.F){this.addOnLoad(function(){D.D=true;D.getMboxes().each(function(B){B.setFetcher(new mboxAjaxFetcher());B.finalize()})});this.limitTraffic(100,10368000);if(this.G){this.X();this.Y=new mboxSignaler(function(B,H){return D.create(B,H)},this.I)}}};mboxFactory.prototype.isEnabled=function(){return this.G};mboxFactory.prototype.getDisableReason=function(){return this.I.getCookie("disable")};mboxFactory.prototype.isSupported=function(){return this.F};mboxFactory.prototype.disable=function(A,B){if(typeof A=="undefined"){A=60*60}if(typeof B=="undefined"){B="unspecified"}if(!this.isAdmin()){this.G=false;this.I.setCookie("disable",B,A)}};mboxFactory.prototype.enable=function(){this.G=true;this.I.deleteCookie("disable")};mboxFactory.prototype.isAdmin=function(){return document.location.href.indexOf("mboxEnv")!=-1};mboxFactory.prototype.limitTraffic=function(B,A){};mboxFactory.prototype.addOnLoad=function(A){if(window.addEventListener){window.addEventListener("load",A,false)}else{if(document.addEventListener){document.addEventListener("load",A,false)}else{if(document.attachEvent){window.attachEvent("onload",A)}}}};mboxFactory.prototype.getEllapsedTime=function(){return this.U-this.T};mboxFactory.prototype.getEllapsedTimeUntil=function(A){return A-this.T};mboxFactory.prototype.getMboxes=function(){return this.E};mboxFactory.prototype.get=function(B,A){return this.E.get(B).getById(A||0)};mboxFactory.prototype.update=function(A,B){if(!this.isEnabled()){return}if(this.E.get(A).length()==0){throw"Mbox "+A+" is not defined"}this.E.get(A).each(function(D){D.getUrlBuilder().addParameter("mboxPage",mboxGenerateId());D.load(B)})};mboxFactory.prototype.create=function(A,J,H){if(!this.isSupported()){return null}var I=this.w.clone();I.addParameter("mboxCount",this.E.length()+1);I.addParameters(J);var M=this.E.get(A).length();var E=this.C+"-"+A+"-"+M;var L;if(H){L=new mboxLocatorNode(H)}else{if(this.D){throw"The page has already been loaded, can't write marker"}L=new mboxLocatorDefault(E)}try{var D=this;var G="mboxImported-"+E;var B=new mbox(A,M,I,L,G);if(this.G){B.setFetcher(this.D?new mboxAjaxFetcher():new mboxStandardFetcher())}B.setOnError(function(O,P){B.setMessage(O);B.activate();if(!B.isActivated()){D.disable(60*60,O);window.location.reload(false)}});this.E.add(B)}catch(K){this.disable();throw'Failed creating mbox "'+A+'", the error was: '+K}var F=new Date();I.addParameter("mboxTime",F.getTime()-(F.getTimezoneOffset()*60000));return B};mboxFactory.prototype.getCookieManager=function(){return this.I};mboxFactory.prototype.getPageId=function(){return this.J};mboxFactory.prototype.getPCId=function(){return this.R};mboxFactory.prototype.getSessionId=function(){return this.Q};mboxFactory.prototype.getSignaler=function(){return this.Y};mboxFactory.prototype.getUrlBuilder=function(){return this.w};mboxFactory.prototype.S=function(B,A){B.addParameter("mboxHost",document.location.hostname).addParameter("mboxSession",this.Q.getId());if(!A){B.addParameter("mboxFactoryId",this.C)}if(this.R.getId()!=null){B.addParameter("mboxPC",this.R.getId())}B.addParameter("mboxPage",this.J);B.addParameter("screenHeight",this.K);B.addParameter("screenWidth",this.L);B.addParameter("browserWidth",this.M);B.addParameter("browserHeight",this.N);B.addParameter("browserTimeOffset",this.P);B.addParameter("colorDepth",this.O);B.setUrlProcessAction(function(E){E+="&mboxURL="+encodeURIComponent(document.location);var D=encodeURIComponent(document.referrer);if(E.length+D.length<2000){E+="&mboxReferrer="+D}E+="&mboxVersion="+mboxVersion;return E})};mboxFactory.prototype.mb=function(){return""};mboxFactory.prototype.X=function(){document.write("<style>.mboxDefault { visibility:hidden; }</style>")};mboxFactory.prototype.isDomLoaded=function(){return this.D};mboxSignaler=function(B,F){this.I=F;var D=F.getCookieNames("signal-");for(var E=0;E<D.length;E++){var G=D[E];var H=F.getCookie(G).split("&");var A=B(H[0],H);A.load();F.deleteCookie(G)}};mboxSignaler.prototype.signal=function(B,A){this.I.setCookie("signal-"+B,mboxShiftArray(arguments).join("&"),45*60)};mboxList=function(){this.E=new Array()};mboxList.prototype.add=function(A){if(A!=null){this.E[this.E.length]=A}};mboxList.prototype.get=function(D){var E=new mboxList();for(var B=0;B<this.E.length;B++){var A=this.E[B];if(A.getName()==D){E.add(A)}}return E};mboxList.prototype.getById=function(A){return this.E[A]};mboxList.prototype.length=function(){return this.E.length};mboxList.prototype.each=function(B){if(typeof B!="function"){throw"Action must be a function, was: "+typeof(B)}for(var A=0;A<this.E.length;A++){B(this.E[A])}};mboxLocatorDefault=function(A){this.g="mboxMarker-"+A;document.write('<div id="'+this.g+'" style="visibility:hidden;display:none">&nbsp;</div>')};mboxLocatorDefault.prototype.locate=function(){var A=document.getElementById(this.g);while(A!=null){if(A.nodeType==1){if(A.className=="mboxDefault"){return A}}A=A.previousSibling}return null};mboxLocatorDefault.prototype.force=function(){var A=document.createElement("div");A.className="mboxDefault";var B=document.getElementById(this.g);B.parentNode.insertBefore(A,B);return A};mboxLocatorNode=function(A){this.ub=A};mboxLocatorNode.prototype.locate=function(){return typeof this.ub=="string"?document.getElementById(this.ub):this.ub};mboxLocatorNode.prototype.force=function(){return null};mboxCreate=function(B){var A=mboxFactoryDefault.create(B,mboxShiftArray(arguments));if(A){A.load()}return A};mboxDefine=function(B,D){var A=mboxFactoryDefault.create(D,mboxShiftArray(mboxShiftArray(arguments)),B);return A};mboxUpdate=function(A){mboxFactoryDefault.update(A,mboxShiftArray(arguments))};mbox=function(E,A,B,D,F){this.Ab=null;this.Bb=0;this.gb=D;this.hb=F;this.Cb=null;this.Db=new mboxOfferContent();this.vb=null;this.w=B;this.message="";this.Eb=new Object();this.Fb=0;this.yb=A;this.g=E;this.Gb();B.addParameter("mbox",E).addParameter("mboxId",A);this.Hb=function(){};this.Ib=function(){};this.Jb=null};mbox.prototype.getId=function(){return this.yb};mbox.prototype.Gb=function(){if(this.g.length>250){throw"Mbox Name "+this.g+" exceeds max length of 250 characters."}else{if(this.g.match(/^\s+|\s+$/g)){throw"Mbox Name "+this.g+" has leading/trailing whitespace(s)."}}};mbox.prototype.getName=function(){return this.g};mbox.prototype.getParameters=function(){var D=this.w.getParameters();var B=new Array();for(var A=0;A<D.length;A++){if(D[A].name.indexOf("mbox")!=0){B[B.length]=D[A].name+"="+D[A].value}}return B};mbox.prototype.setOnLoad=function(A){this.Ib=A;return this};mbox.prototype.setMessage=function(A){this.message=A;return this};mbox.prototype.setOnError=function(A){this.Hb=A;return this};mbox.prototype.setFetcher=function(A){if(this.Cb){this.Cb.cancel()}this.Cb=A;return this};mbox.prototype.getFetcher=function(){return this.Cb};mbox.prototype.load=function(D){if(this.Cb==null){return this}this.setEventTime("load.start");this.cancelTimeout();this.Bb=0;var B=(D&&D.length>0)?this.w.clone().addParameters(D):this.w;this.Cb.fetch(B);var A=this;this.Lb=setTimeout(function(){A.Hb("browser timeout",A.Cb.getType())},15000);this.setEventTime("load.end");return this};mbox.prototype.loaded=function(){this.cancelTimeout();if(!this.activate()){var A=this;setTimeout(function(){A.loaded()},100)}};mbox.prototype.activate=function(){if(this.Bb){return this.Bb}this.setEventTime("activate"+(++this.Fb)+".start");if(this.show()){this.cancelTimeout();this.Bb=1}this.setEventTime("activate"+this.Fb+".end");return this.Bb};mbox.prototype.isActivated=function(){return this.Bb};mbox.prototype.setOffer=function(A){if(A&&A.show&&A.setOnLoad){this.Db=A}else{throw"Invalid offer"}return this};mbox.prototype.getOffer=function(){return this.Db};mbox.prototype.show=function(){this.setEventTime("show.start");var A=this.Db.show(this);this.setEventTime(A==1?"show.end.ok":"show.end");return A};mbox.prototype.showContent=function(A){if(A==null){return 0}if(this.vb==null||!this.vb.parentNode){this.vb=this.getDefaultDiv();if(this.vb==null){return 0}}if(this.vb!=A){this.Nb(this.vb);this.vb.parentNode.replaceChild(A,this.vb);this.vb=A}this.Ob(A);this.Ib();return 1};mbox.prototype.hide=function(){this.setEventTime("hide.start");var A=this.showContent(this.getDefaultDiv());this.setEventTime(A==1?"hide.end.ok":"hide.end.fail");return A};mbox.prototype.finalize=function(){this.setEventTime("finalize.start");this.cancelTimeout();if(this.getDefaultDiv()==null){if(this.gb.force()!=null){this.setMessage("No default content, an empty one has been added")}else{this.setMessage("Unable to locate mbox")}}if(!this.activate()){this.hide();this.setEventTime("finalize.end.hide")}this.setEventTime("finalize.end.ok")};mbox.prototype.cancelTimeout=function(){if(this.Lb){clearTimeout(this.Lb)}if(this.Cb!=null){this.Cb.cancel()}};mbox.prototype.getDiv=function(){return this.vb};mbox.prototype.getDefaultDiv=function(){if(this.Jb==null){this.Jb=this.gb.locate()}return this.Jb};mbox.prototype.setEventTime=function(A){this.Eb[A]=(new Date()).getTime()};mbox.prototype.getEventTimes=function(){return this.Eb};mbox.prototype.getImportName=function(){return this.hb};mbox.prototype.getURL=function(){return this.w.buildUrl()};mbox.prototype.getUrlBuilder=function(){return this.w};mbox.prototype.Qb=function(A){return A.style.display!="none"};mbox.prototype.Ob=function(A){this.Rb(A,true)};mbox.prototype.Nb=function(A){this.Rb(A,false)};mbox.prototype.Rb=function(B,A){B.style.visibility=A?"visible":"hidden";B.style.display=A?"block":"none"};mboxOfferContent=function(){this.Ib=function(){}};mboxOfferContent.prototype.show=function(A){var B=A.showContent(document.getElementById(A.getImportName()));if(B==1){this.Ib()}return B};mboxOfferContent.prototype.setOnLoad=function(A){this.Ib=A};mboxOfferAjax=function(A){this.Mb=A;this.Ib=function(){}};mboxOfferAjax.prototype.setOnLoad=function(A){this.Ib=A};mboxOfferAjax.prototype.show=function(A){var B=document.createElement("div");B.id=A.getImportName();B.innerHTML=this.Mb;var D=A.showContent(B);if(D==1){this.Ib()}return D};mboxOfferDefault=function(){this.Ib=function(){}};mboxOfferDefault.prototype.setOnLoad=function(A){this.Ib=A};mboxOfferDefault.prototype.show=function(A){var B=A.hide();if(B==1){this.Ib()}return B};mboxCookieManager=function mboxCookieManager(B,A){this.g=B;this.Ub=A==""||A.indexOf(".")==-1?"":"; domain="+A;this.Vb=new mboxMap();this.loadCookies()};mboxCookieManager.prototype.isEnabled=function(){this.setCookie("check","true",60);this.loadCookies();return this.getCookie("check")=="true"};mboxCookieManager.prototype.setCookie=function(D,B,A){if(typeof D!="undefined"&&typeof B!="undefined"&&typeof A!="undefined"){var E=new Object();E.name=D;E.value=escape(B);E.expireOn=Math.ceil(A+new Date().getTime()/1000);this.Vb.put(D,E);this.saveCookies()}};mboxCookieManager.prototype.getCookie=function(A){var B=this.Vb.get(A);return B?unescape(B.value):null};mboxCookieManager.prototype.deleteCookie=function(A){this.Vb.remove(A);this.saveCookies()};mboxCookieManager.prototype.getCookieNames=function(A){var B=new Array();this.Vb.each(function(D,E){if(D.indexOf(A)==0){B[B.length]=D}});return B};mboxCookieManager.prototype.saveCookies=function(){var B=new Array();var A=0;this.Vb.each(function(E,F){B[B.length]=E+"#"+F.value+"#"+F.expireOn;if(A<F.expireOn){A=F.expireOn}});var D=new Date(A*1000);document.cookie=this.g+"="+B.join("|")+"; expires="+D.toGMTString()+"; path=/"+this.Ub};mboxCookieManager.prototype.loadCookies=function(){this.Vb=new mboxMap();var F=document.cookie.indexOf(this.g+"=");if(F!=-1){var H=document.cookie.indexOf(";",F);if(H==-1){H=document.cookie.indexOf(",",F);if(H==-1){H=document.cookie.length}}var A=document.cookie.substring(F+this.g.length+1,H).split("|");var D=Math.ceil(new Date().getTime()/1000);for(var B=0;B<A.length;B++){var G=A[B].split("#");if(D<=G[2]){var E=new Object();E.name=G[0];E.value=G[1];E.expireOn=G[2];this.Vb.put(E.name,E)}}}};mboxSession=function(E,F,D,A,B){this.hc=F;this.pb=D;this.ic=A;this.I=B;this.jc=false;this.yb=typeof mboxForceSessionId!="undefined"?mboxForceSessionId:mboxGetPageParameter(this.hc);if(this.yb==null||this.yb.length==0){this.yb=B.getCookie(D);if(this.yb==null||this.yb.length==0){this.yb=E;this.jc=true}}B.setCookie(D,this.yb,A)};mboxSession.prototype.getId=function(){return this.yb};mboxSession.prototype.forceId=function(A){this.yb=A;this.I.setCookie(this.pb,this.yb,this.ic)};mboxPC=function(D,A,B){this.pb=D;this.ic=A;this.I=B;this.yb=typeof mboxForcePCId!="undefined"?mboxForcePCId:B.getCookie(D);if(this.yb!=null){B.setCookie(D,this.yb,A)}};mboxPC.prototype.getId=function(){return this.yb};mboxPC.prototype.forceId=function(A){if(this.yb!=A){this.yb=A;this.I.setCookie(this.pb,this.yb,this.ic);return true}return false};mboxGetPageParameter=function(B){var E=null;var A=new RegExp(B+"=([^&]*)");var D=A.exec(document.location);if(D!=null&&D.length>=2){E=D[1]}return E};mboxSetCookie=function(D,B,A){return mboxFactoryDefault.getCookieManager().setCookie(D,B,A)};mboxGetCookie=function(A){return mboxFactoryDefault.getCookieManager().getCookie(A)};mboxCookiePageDomain=function(){var B=(/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1];var D=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/;if(!D.exec(B)){var A=(/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(B);if(A){B=A[0]}}return B?B:""};mboxShiftArray=function(B){var D=new Array();for(var A=1;A<B.length;A++){D[D.length]=B[A]}return D};mboxGenerateId=function(){return(new Date()).getTime()+"-"+Math.floor(Math.random()*999999)};mboxScreenHeight=function(){return screen.height};mboxScreenWidth=function(){return screen.width};mboxBrowserWidth=function(){return(window.innerWidth)?window.innerWidth:document.documentElement?document.documentElement.clientWidth:document.body.clientWidth};mboxBrowserHeight=function(){return(window.innerHeight)?window.innerHeight:document.documentElement?document.documentElement.clientHeight:document.body.clientHeight};mboxBrowserTimeOffset=function(){return -new Date().getTimezoneOffset()};mboxScreenColorDepth=function(){return screen.pixelDepth};if(typeof mboxVersion=="undefined"){var mboxVersion=39;var mboxFactories=new mboxMap();var mboxFactoryDefault=new mboxFactory("orbitz.tt.omtrdc.net","orbitz","default")}if(mboxGetPageParameter("mboxDebug")!=null||mboxFactoryDefault.getCookieManager().getCookie("debug")!=null){setTimeout(function(){if(typeof mboxDebugLoaded=="undefined"){alert("Could not load the remote debug.\nPlease check your connection to Test&amp;Target servers")}},60*60);document.write('<script language="Javascript1.2" src="http://admin16.testandtarget.omniture.com/admin/mbox/mbox_debug.jsp?mboxServerHost=orbitz.tt.omtrdc.net&clientCode=orbitz"><\/script>')}var mboxUtils={getCookie:function(B){var A=document.cookie.match("(^|;) ?"+B+"=([^;]*)(;|$)");if(A){return(decodeURI(A[2]))}return null},checkMyTests:function(F,G){var B=this.getCookie(F);if(B){for(var D=0,E=G.split(","),A=E.length;D<A;D++){if(B.indexOf("."+E[D].strip()+".")>=0){return true}}}return false},updateMyTests:function(H,F){var G=30;var A=new Date();var D=new Date();D.setTime(A.getTime()+(G*86400000));var E="expires="+D.toGMTString();var B=this.getCookie(H);if(B){if(B.indexOf("."+F+".")===-1){B+=F+"."}}else{B="."+F+"."}document.cookie=H+"="+B+"; "+E+"; path=/"}};