var MooTools={version:"1.2.4",build:"0d9113241a90b9cd5643b926795852a2026710d4"};var Native=function(options){options=options||{};var name=options.name;var legacy=options.legacy;var protect=options.protect;var methods=options.implement;var generics=options.generics;var initialize=options.initialize;var afterImplement=options.afterImplement||function(){};var object=initialize||legacy;generics=generics!==false;object.constructor=Native;object.$family={name:"native"};if(legacy&&initialize){object.prototype=legacy.prototype}object.prototype.constructor=object;if(name){var family=name.toLowerCase();object.prototype.$family={name:family};Native.typize(object,family)}var add=function(obj,name,method,force){if(!protect||force||!obj.prototype[name]){obj.prototype[name]=method}if(generics){Native.genericize(obj,name,protect)}afterImplement.call(obj,name,method);return obj};object.alias=function(a1,a2,a3){if(typeof a1=="string"){var pa1=this.prototype[a1];if((a1=pa1)){return add(this,a2,a1,a3)}}for(var a in a1){this.alias(a,a1[a],a2)}return this};object.implement=function(a1,a2,a3){if(typeof a1=="string"){return add(this,a1,a2,a3)}for(var p in a1){add(this,p,a1[p],a2)}return this};if(methods){object.implement(methods)}return object};Native.genericize=function(object,property,check){if((!check||!object[property])&&typeof object.prototype[property]=="function"){object[property]=function(){var args=Array.prototype.slice.call(arguments);return object.prototype[property].apply(args.shift(),args)}}};Native.implement=function(objects,properties){for(var i=0,l=objects.length;i<l;i++){objects[i].implement(properties)}};Native.typize=function(object,family){if(!object.type){object.type=function(item){return($type(item)===family)}}};(function(){var natives={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var n in natives){new Native({name:n,initialize:natives[n],protect:true})}var types={"boolean":Boolean,"native":Native,object:Object};for(var t in types){Native.typize(types[t],t)}var generics={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};for(var g in generics){for(var i=generics[g].length;i--;){Native.genericize(natives[g],generics[g][i],true)}}})();var Hash=new Native({name:"Hash",initialize:function(object){if($type(object)=="hash"){object=$unlink(object.getClean())}for(var key in object){this[key]=object[key]}return this}});Hash.implement({forEach:function(fn,bind){for(var key in this){if(this.hasOwnProperty(key)){fn.call(bind,this[key],key,this)}}},getClean:function(){var clean={};for(var key in this){if(this.hasOwnProperty(key)){clean[key]=this[key]}}return clean},getLength:function(){var length=0;for(var key in this){if(this.hasOwnProperty(key)){length++}}return length}});Hash.alias("forEach","each");Array.implement({forEach:function(fn,bind){for(var i=0,l=this.length;i<l;i++){fn.call(bind,this[i],i,this)}}});Array.alias("forEach","each");function $A(iterable){if(iterable.item){var l=iterable.length,array=new Array(l);while(l--){array[l]=iterable[l]}return array}return Array.prototype.slice.call(iterable)}function $arguments(i){return function(){return arguments[i]}}function $chk(obj){return !!(obj||obj===0)}function $clear(timer){clearTimeout(timer);clearInterval(timer);return null}function $defined(obj){return(obj!=undefined)}function $each(iterable,fn,bind){var type=$type(iterable);((type=="arguments"||type=="collection"||type=="array")?Array:Hash).each(iterable,fn,bind)}function $empty(){}function $extend(original,extended){for(var key in (extended||{})){original[key]=extended[key]}return original}function $H(object){return new Hash(object)}function $lambda(value){return($type(value)=="function")?value:function(){return value}}function $merge(){var args=Array.slice(arguments);args.unshift({});return $mixin.apply(null,args)}function $mixin(mix){for(var i=1,l=arguments.length;i<l;i++){var object=arguments[i];if($type(object)!="object"){continue}for(var key in object){var op=object[key],mp=mix[key];mix[key]=(mp&&$type(op)=="object"&&$type(mp)=="object")?$mixin(mp,op):$unlink(op)}}return mix}function $pick(){for(var i=0,l=arguments.length;i<l;i++){if(arguments[i]!=undefined){return arguments[i]}}return null}function $random(min,max){return Math.floor(Math.random()*(max-min+1)+min)}function $splat(obj){var type=$type(obj);return(type)?((type!="array"&&type!="arguments")?[obj]:obj):[]}var $time=Date.now||function(){return +new Date};function $try(){for(var i=0,l=arguments.length;i<l;i++){try{return arguments[i]()}catch(e){}}return null}function $type(obj){if(obj==undefined){return false}if(obj.$family){return(obj.$family.name=="number"&&!isFinite(obj))?false:obj.$family.name}if(obj.nodeName){switch(obj.nodeType){case 1:return"element";case 3:return(/\S/).test(obj.nodeValue)?"textnode":"whitespace"}}else{if(typeof obj.length=="number"){if(obj.callee){return"arguments"}else{if(obj.item){return"collection"}}}}return typeof obj}function $unlink(object){var unlinked;switch($type(object)){case"object":unlinked={};for(var p in object){unlinked[p]=$unlink(object[p])}break;case"hash":unlinked=new Hash(object);break;case"array":unlinked=[];for(var i=0,l=object.length;i<l;i++){unlinked[i]=$unlink(object[i])}break;default:return object}return unlinked}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925))},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?((document.querySelectorAll)?6:5):4)},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419)},gecko:function(){return(!document.getBoxObjectFor&&window.mozInnerScreenX==null)?false:((document.getElementsByClassName)?19:18)}}},Browser||{});Browser.Platform[Browser.Platform.name]=true;Browser.detect=function(){for(var engine in this.Engines){var version=this.Engines[engine]();if(version){this.Engine={name:engine,version:version};this.Engine[engine]=this.Engine[engine+version]=true;break}}return{name:engine,version:version}};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("MSXML2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var version=($try(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);return{version:parseInt(version[0]||0+"."+version[1],10)||0,build:parseInt(version[2],10)||0}})();function $exec(text){if(!text){return text}if(window.execScript){window.execScript(text)}else{var script=document.createElement("script");script.setAttribute("type","text/javascript");script[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=text;document.head.appendChild(script);document.head.removeChild(script)}return text}Native.UID=1;var $uid=(Browser.Engine.trident)?function(item){return(item.uid||(item.uid=[Native.UID++]))[0]}:function(item){return item.uid||(item.uid=Native.UID++)};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(win){$uid(win);if(!win.Element){win.Element=$empty;if(Browser.Engine.webkit){win.document.createElement("iframe")}win.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}}win.document.window=win;return $extend(win,Window.Prototype)},afterImplement:function(property,value){window[property]=Window.Prototype[property]=value}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(doc){$uid(doc);doc.head=doc.getElementsByTagName("head")[0];doc.html=doc.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){doc.execCommand("BackgroundImageCache",false,true)})}if(Browser.Engine.trident){doc.window.attachEvent("onunload",function(){doc.window.detachEvent("onunload",arguments.callee);doc.head=doc.html=doc.window=null})}return $extend(doc,Document.Prototype)},afterImplement:function(property,value){document[property]=Document.Prototype[property]=value}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(fn,bind){for(var i=0,l=this.length;i<l;i++){if(!fn.call(bind,this[i],i,this)){return false}}return true},filter:function(fn,bind){var results=[];for(var i=0,l=this.length;i<l;i++){if(fn.call(bind,this[i],i,this)){results.push(this[i])}}return results},clean:function(){return this.filter($defined)},indexOf:function(item,from){var len=this.length;for(var i=(from<0)?Math.max(0,len+from):from||0;i<len;i++){if(this[i]===item){return i}}return -1},map:function(fn,bind){var results=[];for(var i=0,l=this.length;i<l;i++){results[i]=fn.call(bind,this[i],i,this)}return results},some:function(fn,bind){for(var i=0,l=this.length;i<l;i++){if(fn.call(bind,this[i],i,this)){return true}}return false},associate:function(keys){var obj={},length=Math.min(this.length,keys.length);for(var i=0;i<length;i++){obj[keys[i]]=this[i]}return obj},link:function(object){var result={};for(var i=0,l=this.length;i<l;i++){for(var key in object){if(object[key](this[i])){result[key]=this[i];delete object[key];break}}}return result},contains:function(item,from){return this.indexOf(item,from)!=-1},extend:function(array){for(var i=0,j=array.length;i<j;i++){this.push(array[i])}return this},getLast:function(){return(this.length)?this[this.length-1]:null},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null},include:function(item){if(!this.contains(item)){this.push(item)}return this},combine:function(array){for(var i=0,l=array.length;i<l;i++){this.include(array[i])}return this},erase:function(item){for(var i=this.length;i--;i){if(this[i]===item){this.splice(i,1)}}return this},empty:function(){this.length=0;return this},flatten:function(){var array=[];for(var i=0,l=this.length;i<l;i++){var type=$type(this[i]);if(!type){continue}array=array.concat((type=="array"||type=="collection"||type=="arguments")?Array.flatten(this[i]):this[i])}return array},hexToRgb:function(array){if(this.length!=3){return null}var rgb=this.map(function(value){if(value.length==1){value+=value}return value.toInt(16)});return(array)?rgb:"rgb("+rgb+")"},rgbToHex:function(array){if(this.length<3){return null}if(this.length==4&&this[3]==0&&!array){return"transparent"}var hex=[];for(var i=0;i<3;i++){var bit=(this[i]-0).toString(16);hex.push((bit.length==1)?"0"+bit:bit)}return(array)?hex:"#"+hex.join("")}});Function.implement({extend:function(properties){for(var property in properties){this[property]=properties[property]}return this},create:function(options){var self=this;options=options||{};return function(event){var args=options.arguments;args=(args!=undefined)?$splat(args):Array.slice(arguments,(options.event)?1:0);if(options.event){args=[event||window.event].extend(args)}var returns=function(){return self.apply(options.bind||null,args)};if(options.delay){return setTimeout(returns,options.delay)}if(options.periodical){return setInterval(returns,options.periodical)}if(options.attempt){return $try(returns)}return returns()}},run:function(args,bind){return this.apply(bind,$splat(args))},pass:function(args,bind){return this.create({bind:bind,arguments:args})},bind:function(bind,args){return this.create({bind:bind,arguments:args})},bindWithEvent:function(bind,args){return this.create({bind:bind,arguments:args,event:true})},attempt:function(args,bind){return this.create({bind:bind,arguments:args,attempt:true})()},delay:function(delay,bind,args){return this.create({bind:bind,arguments:args,delay:delay})()},periodical:function(periodical,bind,args){return this.create({bind:bind,arguments:args,periodical:periodical})()}});Number.implement({limit:function(min,max){return Math.min(max,Math.max(min,this))},round:function(precision){precision=Math.pow(10,precision||0);return Math.round(this*precision)/precision},times:function(fn,bind){for(var i=0;i<this;i++){fn.call(bind,i,this)}},toFloat:function(){return parseFloat(this)},toInt:function(base){return parseInt(this,base||10)}});Number.alias("times","each");(function(math){var methods={};math.each(function(name){if(!Number[name]){methods[name]=function(){return Math[name].apply(null,[this].concat($A(arguments)))}}});Number.implement(methods)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(regex,params){return((typeof regex=="string")?new RegExp(regex,params):regex).test(this)},contains:function(string,separator){return(separator)?(separator+this+separator).indexOf(separator+string+separator)>-1:this.indexOf(string)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(match){return match.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(match){return("-"+match.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(match){return match.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(base){return parseInt(this,base||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(array){var hex=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(hex)?hex.slice(1).hexToRgb(array):null},rgbToHex:function(array){var rgb=this.match(/\d{1,3}/g);return(rgb)?rgb.rgbToHex(array):null},stripScripts:function(option){var scripts="";var text=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){scripts+=arguments[1]+"\n";return""});if(option===true){$exec(scripts)}else{if($type(option)=="function"){option(scripts,text)}}return text},substitute:function(object,regexp){return this.replace(regexp||(/\\?\{([^{}]+)\}/g),function(match,name){if(match.charAt(0)=="\\"){return match.slice(1)}return(object[name]!=undefined)?object[name]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(value){for(var key in this){if(this.hasOwnProperty(key)&&this[key]===value){return key}}return null},hasValue:function(value){return(Hash.keyOf(this,value)!==null)},extend:function(properties){Hash.each(properties||{},function(value,key){Hash.set(this,key,value)},this);return this},combine:function(properties){Hash.each(properties||{},function(value,key){Hash.include(this,key,value)},this);return this},erase:function(key){if(this.hasOwnProperty(key)){delete this[key]}return this},get:function(key){return(this.hasOwnProperty(key))?this[key]:null},set:function(key,value){if(!this[key]||this.hasOwnProperty(key)){this[key]=value}return this},empty:function(){Hash.each(this,function(value,key){delete this[key]},this);return this},include:function(key,value){if(this[key]==undefined){this[key]=value}return this},map:function(fn,bind){var results=new Hash;Hash.each(this,function(value,key){results.set(key,fn.call(bind,value,key,this))},this);return results},filter:function(fn,bind){var results=new Hash;Hash.each(this,function(value,key){if(fn.call(bind,value,key,this)){results.set(key,value)}},this);return results},every:function(fn,bind){for(var key in this){if(this.hasOwnProperty(key)&&!fn.call(bind,this[key],key)){return false}}return true},some:function(fn,bind){for(var key in this){if(this.hasOwnProperty(key)&&fn.call(bind,this[key],key)){return true}}return false},getKeys:function(){var keys=[];Hash.each(this,function(value,key){keys.push(key)});return keys},getValues:function(){var values=[];Hash.each(this,function(value){values.push(value)});return values},toQueryString:function(base){var queryString=[];Hash.each(this,function(value,key){if(base){key=base+"["+key+"]"}var result;switch($type(value)){case"object":result=Hash.toQueryString(value,key);break;case"array":var qs={};value.each(function(val,i){qs[i]=val});result=Hash.toQueryString(qs,key);break;default:result=key+"="+encodeURIComponent(value)}if(value!=undefined){queryString.push(result)}});return queryString.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(event,win){win=win||window;var doc=win.document;event=event||win.event;if(event.$extended){return event}this.$extended=true;var type=event.type;var target=event.target||event.srcElement;while(target&&target.nodeType==3){target=target.parentNode}if(type.test(/key/)){var code=event.which||event.keyCode;var key=Event.Keys.keyOf(code);if(type=="keydown"){var fKey=code-111;if(fKey>0&&fKey<13){key="f"+fKey}}key=key||String.fromCharCode(code).toLowerCase()}else{if(type.match(/(click|mouse|menu)/i)){doc=(!doc.compatMode||doc.compatMode=="CSS1Compat")?doc.html:doc.body;var page={x:event.pageX||event.clientX+doc.scrollLeft,y:event.pageY||event.clientY+doc.scrollTop};var client={x:(event.pageX)?event.pageX-win.pageXOffset:event.clientX,y:(event.pageY)?event.pageY-win.pageYOffset:event.clientY};if(type.match(/DOMMouseScroll|mousewheel/)){var wheel=(event.wheelDelta)?event.wheelDelta/120:-(event.detail||0)/3}var rightClick=(event.which==3)||(event.button==2);var related=null;if(type.match(/over|out/)){switch(type){case"mouseover":related=event.relatedTarget||event.fromElement;break;case"mouseout":related=event.relatedTarget||event.toElement}if(!(function(){while(related&&related.nodeType==3){related=related.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){related=false}}}}return $extend(this,{event:event,type:type,page:page,client:client,rightClick:rightClick,wheel:wheel,relatedTarget:related,target:target,code:code,key:key,shift:event.shiftKey,control:event.ctrlKey,alt:event.altKey,meta:event.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});function Class(params){if(params instanceof Function){params={initialize:params}}var newClass=function(){Object.reset(this);if(newClass._prototyping){return this}this._current=$empty;var value=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return value}.extend(this);newClass.implement(params);newClass.constructor=Class;newClass.prototype.constructor=newClass;return newClass}Function.prototype.protect=function(){this._protected=true;return this};Object.reset=function(object,key){if(key==null){for(var p in object){Object.reset(object,p)}return object}delete object[key];switch($type(object[key])){case"object":var F=function(){};F.prototype=object[key];var i=new F;object[key]=Object.reset(i);break;case"array":object[key]=$unlink(object[key]);break}return object};new Native({name:"Class",initialize:Class}).extend({instantiate:function(F){F._prototyping=true;var proto=new F;delete F._prototyping;return proto},wrap:function(self,key,method){if(method._origin){method=method._origin}return function(){if(method._protected&&this._current==null){throw new Error('The method "'+key+'" cannot be called.')}var caller=this.caller,current=this._current;this.caller=current;this._current=arguments.callee;var result=method.apply(this,arguments);this._current=current;this.caller=caller;return result}.extend({_owner:self,_origin:method,_name:key})}});Class.implement({implement:function(key,value){if($type(key)=="object"){for(var p in key){this.implement(p,key[p])}return this}var mutator=Class.Mutators[key];if(mutator){value=mutator.call(this,value);if(value==null){return this}}var proto=this.prototype;switch($type(value)){case"function":if(value._hidden){return this}proto[key]=Class.wrap(this,key,value);break;case"object":var previous=proto[key];if($type(previous)=="object"){$mixin(previous,value)}else{proto[key]=$unlink(value)}break;case"array":proto[key]=$unlink(value);break;default:proto[key]=value}return this}});Class.Mutators={Extends:function(parent){this.parent=parent;this.prototype=Class.instantiate(parent);this.implement("parent",function(){var name=this.caller._name,previous=this.caller._owner.parent.prototype[name];if(!previous){throw new Error('The method "'+name+'" has no parent.')}return previous.apply(this,arguments)}.protect())},Implements:function(items){$splat(items).each(function(item){if(item instanceof Function){item=Class.instantiate(item)}this.implement(item)},this)}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false},clearChain:function(){this.$chain.empty();return this}});var Events=new Class({$events:{},addEvent:function(type,fn,internal){type=Events.removeOn(type);if(fn!=$empty){this.$events[type]=this.$events[type]||[];this.$events[type].include(fn);if(internal){fn.internal=true}}return this},addEvents:function(events){for(var type in events){this.addEvent(type,events[type])}return this},fireEvent:function(type,args,delay){type=Events.removeOn(type);if(!this.$events||!this.$events[type]){return this}this.$events[type].each(function(fn){fn.create({bind:this,delay:delay,"arguments":args})()},this);return this},removeEvent:function(type,fn){type=Events.removeOn(type);if(!this.$events[type]){return this}if(!fn.internal){this.$events[type].erase(fn)}return this},removeEvents:function(events){var type;if($type(events)=="object"){for(type in events){this.removeEvent(type,events[type])}return this}if(events){events=Events.removeOn(events)}for(type in this.$events){if(events&&events!=type){continue}var fns=this.$events[type];for(var i=fns.length;i--;i){this.removeEvent(type,fns[i])}}return this}});Events.removeOn=function(string){return string.replace(/^on([A-Z])/,function(full,first){return first.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var option in this.options){if($type(this.options[option])!="function"||!(/^on[A-Z]/).test(option)){continue}this.addEvent(option,this.options[option]);delete this.options[option]}return this}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(tag,props){var konstructor=Element.Constructors.get(tag);if(konstructor){return konstructor(props)}if(typeof tag=="string"){return document.newElement(tag,props)}return document.id(tag).set(props)},afterImplement:function(key,value){Element.Prototype[key]=value;if(Array[key]){return}Elements.implement(key,function(){var items=[],elements=true;for(var i=0,j=this.length;i<j;i++){var returns=this[i][key].apply(this[i],arguments);items.push(returns);if(elements){elements=($type(returns)=="element")}}return(elements)?new Elements(items):items})}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var params=Array.link(arguments,{properties:Object.type,iframe:$defined});var props=params.properties||{};var iframe=document.id(params.iframe);var onload=props.onload||$empty;delete props.onload;props.id=props.name=$pick(props.id,props.name,iframe?(iframe.id||iframe.name):"IFrame_"+$time());iframe=new Element(iframe||"iframe",props);var onFrameLoad=function(){var host=$try(function(){return iframe.contentWindow.location.host});if(!host||host==window.location.host){var win=new Window(iframe.contentWindow);new Document(iframe.contentWindow.document);$extend(win.Element.prototype,Element.Prototype)}onload.call(iframe.contentWindow,iframe.contentWindow.document)};var contentWindow=$try(function(){return iframe.contentWindow});((contentWindow&&contentWindow.document.body)||window.frames[props.id])?onFrameLoad():iframe.addListener("load",onFrameLoad);return iframe}});var Elements=new Native({initialize:function(elements,options){options=$extend({ddup:true,cash:true},options);elements=elements||[];if(options.ddup||options.cash){var uniques={},returned=[];for(var i=0,l=elements.length;i<l;i++){var el=document.id(elements[i],!options.cash);if(options.ddup){if(uniques[el.uid]){continue}uniques[el.uid]=true}if(el){returned.push(el)}}elements=returned}return(options.cash)?$extend(elements,this):elements}});Elements.implement({filter:function(filter,bind){if(!filter){return this}return new Elements(Array.filter(this,(typeof filter=="string")?function(item){return item.match(filter)}:filter,bind))}});Document.implement({newElement:function(tag,props){if(Browser.Engine.trident&&props){["name","type","checked"].each(function(attribute){if(!props[attribute]){return}tag+=" "+attribute+'="'+props[attribute]+'"';if(attribute!="checked"){delete props[attribute]}});tag="<"+tag+">"}return document.id(this.createElement(tag)).set(props)},newTextNode:function(text){return this.createTextNode(text)},getDocument:function(){return this},getWindow:function(){return this.window},id:(function(){var types={string:function(id,nocash,doc){id=doc.getElementById(id);return(id)?types.element(id,nocash):null},element:function(el,nocash){$uid(el);if(!nocash&&!el.$family&&!(/^object|embed$/i).test(el.tagName)){var proto=Element.Prototype;for(var p in proto){el[p]=proto[p]}}return el},object:function(obj,nocash,doc){if(obj.toElement){return types.element(obj.toElement(doc),nocash)}return null}};types.textnode=types.whitespace=types.window=types.document=$arguments(0);return function(el,nocash,doc){if(el&&el.$family&&el.uid){return el}var type=$type(el);return(types[type])?types[type](el,nocash,doc||document):null}})()});if(window.$==null){Window.implement({$:function(el,nc){return document.id(el,nc,this.document)}})}Window.implement({$$:function(selector){if(arguments.length==1&&typeof selector=="string"){return this.document.getElements(selector)}var elements=[];var args=Array.flatten(arguments);for(var i=0,l=args.length;i<l;i++){var item=args[i];switch($type(item)){case"element":elements.push(item);break;case"string":elements.extend(this.document.getElements(item,true))}}return new Elements(elements)},getDocument:function(){return this.document},getWindow:function(){return this}});Native.implement([Element,Document],{getElement:function(selector,nocash){return document.id(this.getElements(selector,true)[0]||null,nocash)},getElements:function(tags,nocash){tags=tags.split(",");var elements=[];var ddup=(tags.length>1);tags.each(function(tag){var partial=this.getElementsByTagName(tag.trim());(ddup)?elements.extend(partial):elements=partial},this);return new Elements(elements,{ddup:ddup,cash:!nocash})}});(function(){var collected={},storage={};var props={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var get=function(uid){return(storage[uid]||(storage[uid]={}))};var clean=function(item,retain){if(!item){return}var uid=item.uid;if(Browser.Engine.trident){if(item.clearAttributes){var clone=retain&&item.cloneNode(false);item.clearAttributes();if(clone){item.mergeAttributes(clone)}}else{if(item.removeEvents){item.removeEvents()}}if((/object/i).test(item.tagName)){for(var p in item){if(typeof item[p]=="function"){item[p]=$empty}}Element.dispose(item)}}if(!uid){return}collected[uid]=storage[uid]=null};var purge=function(){Hash.each(collected,clean);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(clean)}if(window.CollectGarbage){CollectGarbage()}collected=storage=null};var walk=function(element,walk,start,match,all,nocash){var el=element[start||walk];var elements=[];while(el){if(el.nodeType==1&&(!match||Element.match(el,match))){if(!all){return document.id(el,nocash)}elements.push(el)}el=el[walk]}return(all)?new Elements(elements,{ddup:false,cash:!nocash}):null};var attributes={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};var bools=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var camels=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];bools=bools.associate(bools);Hash.extend(attributes,bools);Hash.extend(attributes,camels.associate(camels.map(String.toLowerCase)));var inserters={before:function(context,element){if(element.parentNode){element.parentNode.insertBefore(context,element)}},after:function(context,element){if(!element.parentNode){return}var next=element.nextSibling;(next)?element.parentNode.insertBefore(context,next):element.parentNode.appendChild(context)},bottom:function(context,element){element.appendChild(context)},top:function(context,element){var first=element.firstChild;(first)?element.insertBefore(context,first):element.appendChild(context)}};inserters.inside=inserters.bottom;Hash.each(inserters,function(inserter,where){where=where.capitalize();Element.implement("inject"+where,function(el){inserter(this,document.id(el,true));return this});Element.implement("grab"+where,function(el){inserter(document.id(el,true),this);return this})});Element.implement({set:function(prop,value){switch($type(prop)){case"object":for(var p in prop){this.set(p,prop[p])}break;case"string":var property=Element.Properties.get(prop);(property&&property.set)?property.set.apply(this,Array.slice(arguments,1)):this.setProperty(prop,value)}return this},get:function(prop){var property=Element.Properties.get(prop);return(property&&property.get)?property.get.apply(this,Array.slice(arguments,1)):this.getProperty(prop)},erase:function(prop){var property=Element.Properties.get(prop);(property&&property.erase)?property.erase.apply(this):this.removeProperty(prop);return this},setProperty:function(attribute,value){var key=attributes[attribute];if(value==undefined){return this.removeProperty(attribute)}if(key&&bools[attribute]){value=!!value}(key)?this[key]=value:this.setAttribute(attribute,""+value);return this},setProperties:function(attributes){for(var attribute in attributes){this.setProperty(attribute,attributes[attribute])}return this},getProperty:function(attribute){var key=attributes[attribute];var value=(key)?this[key]:this.getAttribute(attribute,2);return(bools[attribute])?!!value:(key)?value:value||null},getProperties:function(){var args=$A(arguments);return args.map(this.getProperty,this).associate(args)},removeProperty:function(attribute){var key=attributes[attribute];(key)?this[key]=(key&&bools[attribute])?false:"":this.removeAttribute(attribute);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this},hasClass:function(className){return this.className.contains(className," ")},addClass:function(className){if(!this.hasClass(className)){this.className=(this.className+" "+className).clean()}return this},removeClass:function(className){this.className=this.className.replace(new RegExp("(^|\\s)"+className+"(?:\\s|$)"),"$1");return this},toggleClass:function(className){return this.hasClass(className)?this.removeClass(className):this.addClass(className)},adopt:function(){Array.flatten(arguments).each(function(element){element=document.id(element,true);if(element){this.appendChild(element)}},this);return this},appendText:function(text,where){return this.grab(this.getDocument().newTextNode(text),where)},grab:function(el,where){inserters[where||"bottom"](document.id(el,true),this);return this},inject:function(el,where){inserters[where||"bottom"](this,document.id(el,true));return this},replaces:function(el){el=document.id(el,true);el.parentNode.replaceChild(this,el);return this},wraps:function(el,where){el=document.id(el,true);return this.replaces(el).grab(el,where)},getPrevious:function(match,nocash){return walk(this,"previousSibling",null,match,false,nocash)},getAllPrevious:function(match,nocash){return walk(this,"previousSibling",null,match,true,nocash)},getNext:function(match,nocash){return walk(this,"nextSibling",null,match,false,nocash)},getAllNext:function(match,nocash){return walk(this,"nextSibling",null,match,true,nocash)},getFirst:function(match,nocash){return walk(this,"nextSibling","firstChild",match,false,nocash)},getLast:function(match,nocash){return walk(this,"previousSibling","lastChild",match,false,nocash)},getParent:function(match,nocash){return walk(this,"parentNode",null,match,false,nocash)},getParents:function(match,nocash){return walk(this,"parentNode",null,match,true,nocash)},getSiblings:function(match,nocash){return this.getParent().getChildren(match,nocash).erase(this)},getChildren:function(match,nocash){return walk(this,"nextSibling","firstChild",match,true,nocash)},getWindow:function(){return this.ownerDocument.window},getDocument:function(){return this.ownerDocument},getElementById:function(id,nocash){var el=this.ownerDocument.getElementById(id);if(!el){return null}for(var parent=el.parentNode;parent!=this;parent=parent.parentNode){if(!parent){return null}}return document.id(el,nocash)},getSelected:function(){return new Elements($A(this.options).filter(function(option){return option.selected}))},getComputedStyle:function(property){if(this.currentStyle){return this.currentStyle[property.camelCase()]}var computed=this.getDocument().defaultView.getComputedStyle(this,null);return(computed)?computed.getPropertyValue([property.hyphenate()]):null},toQueryString:function(){var queryString=[];this.getElements("input, select, textarea",true).each(function(el){if(!el.name||el.disabled||el.type=="submit"||el.type=="reset"||el.type=="file"){return}var value=(el.tagName.toLowerCase()=="select")?Element.getSelected(el).map(function(opt){return opt.value}):((el.type=="radio"||el.type=="checkbox")&&!el.checked)?null:el.value;$splat(value).each(function(val){if(typeof val!="undefined"){queryString.push(el.name+"="+encodeURIComponent(val))}})});return queryString.join("&")},clone:function(contents,keepid){contents=contents!==false;var clone=this.cloneNode(contents);var clean=function(node,element){if(!keepid){node.removeAttribute("id")}if(Browser.Engine.trident){node.clearAttributes();node.mergeAttributes(element);node.removeAttribute("uid");if(node.options){var no=node.options,eo=element.options;for(var j=no.length;j--;){no[j].selected=eo[j].selected}}}var prop=props[element.tagName.toLowerCase()];if(prop&&element[prop]){node[prop]=element[prop]}};if(contents){var ce=clone.getElementsByTagName("*"),te=this.getElementsByTagName("*");for(var i=ce.length;i--;){clean(ce[i],te[i])}}clean(clone,this);return document.id(clone)},destroy:function(){Element.empty(this);Element.dispose(this);clean(this,true);return null},empty:function(){$A(this.childNodes).each(function(node){Element.destroy(node)});return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},hasChild:function(el){el=document.id(el,true);if(!el){return false}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(el.tagName)).contains(el)}return(this.contains)?(this!=el&&this.contains(el)):!!(this.compareDocumentPosition(el)&16)},match:function(tag){return(!tag||(tag==this)||(Element.get(this,"tag")==tag))}});Native.implement([Element,Window,Document],{addListener:function(type,fn){if(type=="unload"){var old=fn,self=this;fn=function(){self.removeListener("unload",fn);old()}}else{collected[this.uid]=this}if(this.addEventListener){this.addEventListener(type,fn,false)}else{this.attachEvent("on"+type,fn)}return this},removeListener:function(type,fn){if(this.removeEventListener){this.removeEventListener(type,fn,false)}else{this.detachEvent("on"+type,fn)}return this},retrieve:function(property,dflt){var storage=get(this.uid),prop=storage[property];if(dflt!=undefined&&prop==undefined){prop=storage[property]=dflt}return $pick(prop)},store:function(property,value){var storage=get(this.uid);storage[property]=value;return this},eliminate:function(property){var storage=get(this.uid);delete storage[property];return this}});window.addListener("unload",purge)})();Element.Properties=new Hash;Element.Properties.style={set:function(style){this.style.cssText=style},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}};Element.Properties.html=(function(){var wrapper=document.createElement("div");var translations={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};translations.thead=translations.tfoot=translations.tbody;var html={set:function(){var html=Array.flatten(arguments).join("");var wrap=Browser.Engine.trident&&translations[this.get("tag")];if(wrap){var first=wrapper;first.innerHTML=wrap[1]+html+wrap[2];for(var i=wrap[0];i--;){first=first.firstChild}this.empty().adopt(first.childNodes)}else{this.innerHTML=html}}};html.erase=html.set;return html})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText}var temp=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var text=temp.innerText;temp.destroy();return text}}}Element.Properties.events={set:function(events){this.addEvents(events)}};Native.implement([Element,Window,Document],{addEvent:function(type,fn){var events=this.retrieve("events",{});events[type]=events[type]||{keys:[],values:[]};if(events[type].keys.contains(fn)){return this}events[type].keys.push(fn);var realType=type,custom=Element.Events.get(type),condition=fn,self=this;if(custom){if(custom.onAdd){custom.onAdd.call(this,fn)}if(custom.condition){condition=function(event){if(custom.condition.call(this,event)){return fn.call(this,event)}return true}}realType=custom.base||realType}var defn=function(){return fn.call(self)};var nativeEvent=Element.NativeEvents[realType];if(nativeEvent){if(nativeEvent==2){defn=function(event){event=new Event(event,self.getWindow());if(condition.call(self,event)===false){event.stop()}}}this.addListener(realType,defn)}events[type].values.push(defn);return this},removeEvent:function(type,fn){var events=this.retrieve("events");if(!events||!events[type]){return this}var pos=events[type].keys.indexOf(fn);if(pos==-1){return this}events[type].keys.splice(pos,1);var value=events[type].values.splice(pos,1)[0];var custom=Element.Events.get(type);if(custom){if(custom.onRemove){custom.onRemove.call(this,fn)}type=custom.base||type}return(Element.NativeEvents[type])?this.removeListener(type,value):this},addEvents:function(events){for(var event in events){this.addEvent(event,events[event])}return this},removeEvents:function(events){var type;if($type(events)=="object"){for(type in events){this.removeEvent(type,events[type])}return this}var attached=this.retrieve("events");if(!attached){return this}if(!events){for(type in attached){this.removeEvents(type)}this.eliminate("events")}else{if(attached[events]){while(attached[events].keys[0]){this.removeEvent(events,attached[events].keys[0])}attached[events]=null}}return this},fireEvent:function(type,args,delay){var events=this.retrieve("events");if(!events||!events[type]){return this}events[type].keys.each(function(fn){fn.create({bind:this,delay:delay,"arguments":args})()},this);return this},cloneEvents:function(from,type){from=document.id(from);var fevents=from.retrieve("events");if(!fevents){return this}if(!type){for(var evType in fevents){this.cloneEvents(from,evType)}}else{if(fevents[type]){fevents[type].keys.each(function(fn){this.addEvent(type,fn)},this)}}return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var $check=function(event){var related=event.relatedTarget;if(related==undefined){return true}if(related===false){return false}return($type(this)!="document"&&related!=this&&related.prefix!="xul"&&!this.hasChild(related))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:$check},mouseleave:{base:"mouseout",condition:$check},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Properties.styles={set:function(styles){this.setStyles(styles)}};Element.Properties.opacity={set:function(opacity,novisibility){if(!novisibility){if(opacity==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(Browser.Engine.trident){this.style.filter=(opacity==1)?"":"alpha(opacity="+opacity*100+")"}this.style.opacity=opacity;this.store("opacity",opacity)},get:function(){return this.retrieve("opacity",1)}};Element.implement({setOpacity:function(value){return this.set("opacity",value,true)},getOpacity:function(){return this.get("opacity")},setStyle:function(property,value){switch(property){case"opacity":return this.set("opacity",parseFloat(value));case"float":property=(Browser.Engine.trident)?"styleFloat":"cssFloat"}property=property.camelCase();if($type(value)!="string"){var map=(Element.Styles.get(property)||"@").split(" ");value=$splat(value).map(function(val,i){if(!map[i]){return""}return($type(val)=="number")?map[i].replace("@",Math.round(val)):val}).join(" ")}else{if(value==String(Number(value))){value=Math.round(value)}}this.style[property]=value;return this},getStyle:function(property){switch(property){case"opacity":return this.get("opacity");case"float":property=(Browser.Engine.trident)?"styleFloat":"cssFloat"}property=property.camelCase();var result=this.style[property];if(!$chk(result)){result=[];for(var style in Element.ShortStyles){if(property!=style){continue}for(var s in Element.ShortStyles[style]){result.push(this.getStyle(s))}return result.join(" ")}result=this.getComputedStyle(property)}if(result){result=String(result);var color=result.match(/rgba?\([\d\s,]+\)/);if(color){result=result.replace(color[0],color[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(result,10)))){if(property.test(/^(height|width)$/)){var values=(property=="width")?["left","right"]:["top","bottom"],size=0;values.each(function(value){size+=this.getStyle("border-"+value+"-width").toInt()+this.getStyle("padding-"+value).toInt()},this);return this["offset"+property.capitalize()]-size+"px"}if((Browser.Engine.presto)&&String(result).test("px")){return result}if(property.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return result},setStyles:function(styles){for(var style in styles){this.setStyle(style,styles[style])}return this},getStyles:function(){var result={};Array.flatten(arguments).each(function(key){result[key]=this.getStyle(key)},this);return result}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(direction){var Short=Element.ShortStyles;var All=Element.Styles;["margin","padding"].each(function(style){var sd=style+direction;Short[style][sd]=All[sd]="@px"});var bd="border"+direction;Short.border[bd]=All[bd]="@px @ rgb(@, @, @)";var bdw=bd+"Width",bds=bd+"Style",bdc=bd+"Color";Short[bd]={};Short.borderWidth[bdw]=Short[bd][bdw]=All[bdw]="@px";Short.borderStyle[bds]=Short[bd][bds]=All[bds]="@";Short.borderColor[bdc]=Short[bd][bdc]=All[bdc]="rgb(@, @, @)"});(function(){Element.implement({scrollTo:function(x,y){if(isBody(this)){this.getWindow().scrollTo(x,y)}else{this.scrollLeft=x;this.scrollTop=y}return this},getSize:function(){if(isBody(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(isBody(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(isBody(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var element=this,position={x:0,y:0};while(element&&!isBody(element)){position.x+=element.scrollLeft;position.y+=element.scrollTop;element=element.parentNode}return position},getOffsetParent:function(){var element=this;if(isBody(element)){return null}if(!Browser.Engine.trident){return element.offsetParent}while((element=element.parentNode)&&!isBody(element)){if(styleString(element,"position")!="static"){return element}}return null},getOffsets:function(){if(this.getBoundingClientRect){var bound=this.getBoundingClientRect(),html=document.id(this.getDocument().documentElement),htmlScroll=html.getScroll(),elemScrolls=this.getScrolls(),elemScroll=this.getScroll(),isFixed=(styleString(this,"position")=="fixed");return{x:bound.left.toInt()+elemScrolls.x-elemScroll.x+((isFixed)?0:htmlScroll.x)-html.clientLeft,y:bound.top.toInt()+elemScrolls.y-elemScroll.y+((isFixed)?0:htmlScroll.y)-html.clientTop}}var element=this,position={x:0,y:0};if(isBody(this)){return position}while(element&&!isBody(element)){position.x+=element.offsetLeft;position.y+=element.offsetTop;if(Browser.Engine.gecko){if(!borderBox(element)){position.x+=leftBorder(element);position.y+=topBorder(element)}var parent=element.parentNode;if(parent&&styleString(parent,"overflow")!="visible"){position.x+=leftBorder(parent);position.y+=topBorder(parent)}}else{if(element!=this&&Browser.Engine.webkit){position.x+=leftBorder(element);position.y+=topBorder(element)}}element=element.offsetParent}if(Browser.Engine.gecko&&!borderBox(this)){position.x-=leftBorder(this);position.y-=topBorder(this)}return position},getPosition:function(relative){if(isBody(this)){return{x:0,y:0}}var offset=this.getOffsets(),scroll=this.getScrolls();var position={x:offset.x-scroll.x,y:offset.y-scroll.y};var relativePosition=(relative&&(relative=document.id(relative)))?relative.getPosition():{x:0,y:0};return{x:position.x-relativePosition.x,y:position.y-relativePosition.y}},getCoordinates:function(element){if(isBody(this)){return this.getWindow().getCoordinates()}var position=this.getPosition(element),size=this.getSize();var obj={left:position.x,top:position.y,width:size.x,height:size.y};obj.right=obj.left+obj.width;obj.bottom=obj.top+obj.height;return obj},computePosition:function(obj){return{left:obj.x-styleNumber(this,"margin-left"),top:obj.y-styleNumber(this,"margin-top")}},setPosition:function(obj){return this.setStyles(this.computePosition(obj))}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var win=this.getWindow();return{x:win.innerWidth,y:win.innerHeight}}var doc=getCompatElement(this);return{x:doc.clientWidth,y:doc.clientHeight}},getScroll:function(){var win=this.getWindow(),doc=getCompatElement(this);return{x:win.pageXOffset||doc.scrollLeft,y:win.pageYOffset||doc.scrollTop}},getScrollSize:function(){var doc=getCompatElement(this),min=this.getSize();return{x:Math.max(doc.scrollWidth,min.x),y:Math.max(doc.scrollHeight,min.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var size=this.getSize();return{top:0,left:0,bottom:size.y,right:size.x,height:size.y,width:size.x}}});var styleString=Element.getComputedStyle;function styleNumber(element,style){return styleString(element,style).toInt()||0}function borderBox(element){return styleString(element,"-moz-box-sizing")=="border-box"}function topBorder(element){return styleNumber(element,"border-top-width")}function leftBorder(element){return styleNumber(element,"border-left-width")}function isBody(element){return(/^(?:body|html)$/i).test(element.tagName)}function getCompatElement(element){var doc=element.getDocument();return(!doc.compatMode||doc.compatMode=="CSS1Compat")?doc.html:doc.body}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}});Native.implement([Document,Element],{getElements:function(expression,nocash){expression=expression.split(",");var items,local={};for(var i=0,l=expression.length;i<l;i++){var selector=expression[i],elements=Selectors.Utils.search(this,selector,local);if(i!=0&&elements.item){elements=$A(elements)}items=(i==0)?elements:(items.item)?$A(items).concat(elements):items.concat(elements)}return new Elements(items,{ddup:(expression.length>1),cash:!nocash})}});Element.implement({match:function(selector){if(!selector||(selector==this)){return true}var tagid=Selectors.Utils.parseTagAndID(selector);var tag=tagid[0],id=tagid[1];if(!Selectors.Filters.byID(this,id)||!Selectors.Filters.byTag(this,tag)){return false}var parsed=Selectors.Utils.parseSelector(selector);return(parsed)?Selectors.Utils.filter(this,parsed,{}):true}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(item,uniques){if(!uniques){return true}var uid=$uid(item);if(!uniques[uid]){return uniques[uid]=true}return false},parseNthArgument:function(argument){if(Selectors.Cache.nth[argument]){return Selectors.Cache.nth[argument]}var parsed=argument.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!parsed){return false}var inta=parseInt(parsed[1],10);var a=(inta||inta===0)?inta:1;var special=parsed[2]||false;var b=parseInt(parsed[3],10)||0;if(a!=0){b--;while(b<1){b+=a}while(b>=a){b-=a}}else{a=b;special="index"}switch(special){case"n":parsed={a:a,b:b,special:"n"};break;case"odd":parsed={a:2,b:0,special:"n"};break;case"even":parsed={a:2,b:1,special:"n"};break;case"first":parsed={a:0,special:"index"};break;case"last":parsed={special:"last-child"};break;case"only":parsed={special:"only-child"};break;default:parsed={a:(a-1),special:"index"}}return Selectors.Cache.nth[argument]=parsed},parseSelector:function(selector){if(Selectors.Cache.parsed[selector]){return Selectors.Cache.parsed[selector]}var m,parsed={classes:[],pseudos:[],attributes:[]};while((m=Selectors.RegExps.combined.exec(selector))){var cn=m[1],an=m[2],ao=m[3],av=m[5],pn=m[6],pa=m[7];if(cn){parsed.classes.push(cn)}else{if(pn){var parser=Selectors.Pseudo.get(pn);if(parser){parsed.pseudos.push({parser:parser,argument:pa})}else{parsed.attributes.push({name:pn,operator:"=",value:pa})}}else{if(an){parsed.attributes.push({name:an,operator:ao,value:av})}}}}if(!parsed.classes.length){delete parsed.classes}if(!parsed.attributes.length){delete parsed.attributes}if(!parsed.pseudos.length){delete parsed.pseudos}if(!parsed.classes&&!parsed.attributes&&!parsed.pseudos){parsed=null}return Selectors.Cache.parsed[selector]=parsed},parseTagAndID:function(selector){var tag=selector.match(Selectors.RegExps.tag);var id=selector.match(Selectors.RegExps.id);return[(tag)?tag[1]:"*",(id)?id[1]:false]},filter:function(item,parsed,local){var i;if(parsed.classes){for(i=parsed.classes.length;i--;i){var cn=parsed.classes[i];if(!Selectors.Filters.byClass(item,cn)){return false}}}if(parsed.attributes){for(i=parsed.attributes.length;i--;i){var att=parsed.attributes[i];if(!Selectors.Filters.byAttribute(item,att.name,att.operator,att.value)){return false}}}if(parsed.pseudos){for(i=parsed.pseudos.length;i--;i){var psd=parsed.pseudos[i];if(!Selectors.Filters.byPseudo(item,psd.parser,psd.argument,local)){return false}}}return true},getByTagAndID:function(ctx,tag,id){if(id){var item=(ctx.getElementById)?ctx.getElementById(id,true):Element.getElementById(ctx,id,true);return(item&&Selectors.Filters.byTag(item,tag))?[item]:[]}else{return ctx.getElementsByTagName(tag)}},search:function(self,expression,local){var splitters=[];var selectors=expression.trim().replace(Selectors.RegExps.splitter,function(m0,m1,m2){splitters.push(m1);return":)"+m2}).split(":)");var items,filtered,item;for(var i=0,l=selectors.length;i<l;i++){var selector=selectors[i];if(i==0&&Selectors.RegExps.quick.test(selector)){items=self.getElementsByTagName(selector);continue}var splitter=splitters[i-1];var tagid=Selectors.Utils.parseTagAndID(selector);var tag=tagid[0],id=tagid[1];if(i==0){items=Selectors.Utils.getByTagAndID(self,tag,id)}else{var uniques={},found=[];for(var j=0,k=items.length;j<k;j++){found=Selectors.Getters[splitter](found,items[j],tag,id,uniques)}items=found}var parsed=Selectors.Utils.parseSelector(selector);if(parsed){filtered=[];for(var m=0,n=items.length;m<n;m++){item=items[m];if(Selectors.Utils.filter(item,parsed,local)){filtered.push(item)}}items=filtered}}return items}};Selectors.Getters={" ":function(found,self,tag,id,uniques){var items=Selectors.Utils.getByTagAndID(self,tag,id);for(var i=0,l=items.length;i<l;i++){var item=items[i];if(Selectors.Utils.chk(item,uniques)){found.push(item)}}return found},">":function(found,self,tag,id,uniques){var children=Selectors.Utils.getByTagAndID(self,tag,id);for(var i=0,l=children.length;i<l;i++){var child=children[i];if(child.parentNode==self&&Selectors.Utils.chk(child,uniques)){found.push(child)}}return found},"+":function(found,self,tag,id,uniques){while((self=self.nextSibling)){if(self.nodeType==1){if(Selectors.Utils.chk(self,uniques)&&Selectors.Filters.byTag(self,tag)&&Selectors.Filters.byID(self,id)){found.push(self)}break}}return found},"~":function(found,self,tag,id,uniques){while((self=self.nextSibling)){if(self.nodeType==1){if(!Selectors.Utils.chk(self,uniques)){break}if(Selectors.Filters.byTag(self,tag)&&Selectors.Filters.byID(self,id)){found.push(self)}}}return found}};Selectors.Filters={byTag:function(self,tag){return(tag=="*"||(self.tagName&&self.tagName.toLowerCase()==tag))},byID:function(self,id){return(!id||(self.id&&self.id==id))},byClass:function(self,klass){return(self.className&&self.className.contains&&self.className.contains(klass," "))},byPseudo:function(self,parser,argument,local){return parser.call(self,argument,local)},byAttribute:function(self,name,operator,value){var result=Element.prototype.getProperty.call(self,name);if(!result){return(operator=="!=")}if(!operator||value==undefined){return true}switch(operator){case"=":return(result==value);case"*=":return(result.contains(value));case"^=":return(result.substr(0,value.length)==value);case"$=":return(result.substr(result.length-value.length)==value);case"!=":return(result!=value);case"~=":return result.contains(value," ");case"|=":return result.contains(value,"-")}return false}};Selectors.Pseudo=new Hash({checked:function(){return this.checked},empty:function(){return !(this.innerText||this.textContent||"").length},not:function(selector){return !Element.match(this,selector)},contains:function(text){return(this.innerText||this.textContent||"").contains(text)},"first-child":function(){return Selectors.Pseudo.index.call(this,0)},"last-child":function(){var element=this;while((element=element.nextSibling)){if(element.nodeType==1){return false}}return true},"only-child":function(){var prev=this;while((prev=prev.previousSibling)){if(prev.nodeType==1){return false}}var next=this;while((next=next.nextSibling)){if(next.nodeType==1){return false}}return true},"nth-child":function(argument,local){argument=(argument==undefined)?"n":argument;var parsed=Selectors.Utils.parseNthArgument(argument);if(parsed.special!="n"){return Selectors.Pseudo[parsed.special].call(this,parsed.a,local)}var count=0;local.positions=local.positions||{};var uid=$uid(this);if(!local.positions[uid]){var self=this;while((self=self.previousSibling)){if(self.nodeType!=1){continue}count++;var position=local.positions[$uid(self)];if(position!=undefined){count=position+count;break}}local.positions[uid]=count}return(local.positions[uid]%parsed.a==parsed.b)},index:function(index){var element=this,count=0;while((element=element.previousSibling)){if(element.nodeType==1&&++count>index){return false}}return(count==index)},even:function(argument,local){return Selectors.Pseudo["nth-child"].call(this,"2n+1",local)},odd:function(argument,local){return Selectors.Pseudo["nth-child"].call(this,"2n",local)},selected:function(){return this.selected},enabled:function(){return(this.disabled===false)}});Element.Events.domready={onAdd:function(fn){if(Browser.loaded){fn.call(this)}}};(function(){var domready=function(){if(Browser.loaded){return}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};window.addEvent("load",domready);if(Browser.Engine.trident){var temp=document.createElement("div");(function(){($try(function(){temp.doScroll();return document.id(temp).inject(document.body).set("html","temp").dispose()}))?domready():arguments.callee.delay(50)})()}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?domready():arguments.callee.delay(50)})()}else{document.addEvent("DOMContentLoaded",domready)}}})();var JSON=new Hash(this.JSON&&{stringify:JSON.stringify,parse:JSON.parse}).extend({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(chr){return JSON.$specialChars[chr]||"\\u00"+Math.floor(chr.charCodeAt()/16).toString(16)+(chr.charCodeAt()%16).toString(16)},encode:function(obj){switch($type(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(obj.map(JSON.encode).clean())+"]";case"object":case"hash":var string=[];Hash.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json)}});return"{"+string+"}";case"number":case"boolean":return String(obj);case false:return"null"}return null},decode:function(string,secure){if($type(string)!="string"||!string.length){return null}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null}return eval("("+string+")")}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this)}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(key,options){this.key=key;this.setOptions(options)},write:function(value){value=encodeURIComponent(value);if(this.options.domain){value+="; domain="+this.options.domain}if(this.options.path){value+="; path="+this.options.path}if(this.options.duration){var date=new Date();date.setTime(date.getTime()+this.options.duration*24*60*60*1000);value+="; expires="+date.toGMTString()}if(this.options.secure){value+="; secure"}this.options.document.cookie=this.key+"="+value;return this},read:function(){var value=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(value)?decodeURIComponent(value[1]):null},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this}});Cookie.write=function(key,value,options){return new Cookie(key,options).write(value)};Cookie.read=function(key){return new Cookie(key).read()};Cookie.dispose=function(key,options){return new Cookie(key,options).dispose()};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(path,options){this.instance="Swiff_"+$time();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance;var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks;var properties=$extend({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments)}})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack}params.flashVars=Hash.toQueryString(vars);if(Browser.Engine.trident){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";params.movie=path}else{properties.type="application/x-shockwave-flash";properties.data=path}var build='<object id="'+id+'"';for(var property in properties){build+=" "+property+'="'+properties[property]+'"'}build+=">";for(var param in params){if(params[param]){build+='<param name="'+param+'" value="'+params[param]+'" />'}}build+="</object>";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this},inject:function(element){document.id(element,true).appendChild(this.toElement());return this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments))}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs)};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(options){this.subject=this.subject||this;this.setOptions(options);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var wait=this.options.wait;if(wait===false){this.options.link="cancel"}},getTransition:function(){return function(p){return -(Math.cos(Math.PI*p)-1)/2}},step:function(){var time=$time();if(time<this.time+this.options.duration){var delta=this.transition((time-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,delta))}else{this.set(this.compute(this.from,this.to,1));this.complete()}},set:function(now){return now},compute:function(from,to,delta){return Fx.compute(from,to,delta)},check:function(){if(!this.timer){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},start:function(from,to){if(!this.check(from,to)){return this}this.from=from;this.to=to;this.time=0;this.transition=this.getTransition();this.startTimer();this.onStart();return this},complete:function(){if(this.stopTimer()){this.onComplete()}return this},cancel:function(){if(this.stopTimer()){this.onCancel()}return this},onStart:function(){this.fireEvent("start",this.subject)},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject)}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain()},pause:function(){this.stopTimer();return this},resume:function(){this.startTimer();return this},stopTimer:function(){if(!this.timer){return false}this.time=$time()-this.time;this.timer=$clear(this.timer);return true},startTimer:function(){if(this.timer){return false}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true}});Fx.compute=function(from,to,delta){return(to-from)*delta+from};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(element,property,values){values=$splat(values);var values1=values[1];if(!$chk(values1)){values[1]=values[0];values[0]=element.getStyle(property)}var parsed=values.map(this.parse);return{from:parsed[0],to:parsed[1]}},parse:function(value){value=$lambda(value)();value=(typeof value=="string")?value.split(" "):$splat(value);return value.map(function(val){val=String(val);var found=false;Fx.CSS.Parsers.each(function(parser,key){if(found){return}var parsed=parser.parse(val);if($chk(parsed)){found={value:parsed,parser:parser}}});found=found||{value:val,parser:Fx.CSS.Parsers.String};return found})},compute:function(from,to,delta){var computed=[];(Math.min(from.length,to.length)).times(function(i){computed.push({value:from[i].parser.compute(from[i].value,to[i].value,delta),parser:from[i].parser})});computed.$family={name:"fx:css:value"};return computed},serve:function(value,unit){if($type(value)!="fx:css:value"){value=this.parse(value)}var returned=[];value.each(function(bit){returned=returned.concat(bit.parser.serve(bit.value,unit))});return returned},render:function(element,property,value,unit){element.setStyle(property,this.serve(value,unit))},search:function(selector){if(Fx.CSS.Cache[selector]){return Fx.CSS.Cache[selector]}var to={};Array.each(document.styleSheets,function(sheet,j){var href=sheet.href;if(href&&href.contains("://")&&!href.contains(document.domain)){return}var rules=sheet.rules||sheet.cssRules;Array.each(rules,function(rule,i){if(!rule.style){return}var selectorText=(rule.selectorText)?rule.selectorText.replace(/^\w+/,function(m){return m.toLowerCase()}):null;if(!selectorText||!selectorText.test("^"+selector+"$")){return}Element.Styles.each(function(value,style){if(!rule.style[style]||Element.ShortStyles[style]){return}value=String(rule.style[style]);to[style]=(value.test(/^rgb/))?value.rgbToHex():value})})});return Fx.CSS.Cache[selector]=to}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(value){if(value.match(/^#[0-9a-f]{3,6}$/i)){return value.hexToRgb(true)}return((value=value.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[value[1],value[2],value[3]]:false},compute:function(from,to,delta){return from.map(function(value,i){return Math.round(Fx.compute(from[i],to[i],delta))})},serve:function(value){return value.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(value,unit){return(unit)?value+unit:value}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options)},set:function(property,now){if(arguments.length==1){now=property;property=this.property||this.options.property}this.render(this.element,property,now,this.options.unit);return this},start:function(property,from,to){if(!this.check(property,from,to)){return this}var args=Array.flatten(arguments);this.property=this.options.property||args.shift();var parsed=this.prepare(this.element,this.property,args);return this.parent(parsed.from,parsed.to)}});Element.Properties.tween={set:function(options){var tween=this.retrieve("tween");if(tween){tween.cancel()}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},options))},get:function(options){if(options||!this.retrieve("tween")){if(options||!this.retrieve("tween:options")){this.set("tween",options)}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")))}return this.retrieve("tween")}};Element.implement({tween:function(property,from,to){this.get("tween").start(arguments);return this},fade:function(how){var fade=this.get("tween"),o="opacity",toggle;how=$pick(how,"toggle");switch(how){case"in":fade.start(o,1);break;case"out":fade.start(o,0);break;case"show":fade.set(o,1);break;case"hide":fade.set(o,0);break;case"toggle":var flag=this.retrieve("fade:flag",this.get("opacity")==1);fade.start(o,(flag)?0:1);this.store("fade:flag",!flag);toggle=true;break;default:fade.start(o,arguments)}if(!toggle){this.eliminate("fade:flag")}return this},highlight:function(start,end){if(!end){end=this.retrieve("highlight:original",this.getStyle("background-color"));end=(end=="transparent")?"#fff":end}var tween=this.get("tween");tween.start("background-color",start||"#ffff88",end).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));tween.callChain()}.bind(this));return this}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options)},set:function(now){if(typeof now=="string"){now=this.search(now)}for(var p in now){this.render(this.element,p,now[p],this.options.unit)}return this},compute:function(from,to,delta){var now={};for(var p in from){now[p]=this.parent(from[p],to[p],delta)}return now},start:function(properties){if(!this.check(properties)){return this}if(typeof properties=="string"){properties=this.search(properties)}var from={},to={};for(var p in properties){var parsed=this.prepare(this.element,p,properties[p]);from[p]=parsed.from;to[p]=parsed.to}return this.parent(from,to)}});Element.Properties.morph={set:function(options){var morph=this.retrieve("morph");if(morph){morph.cancel()}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},options))},get:function(options){if(options||!this.retrieve("morph")){if(options||!this.retrieve("morph:options")){this.set("morph",options)}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")))}return this.retrieve("morph")}};Element.implement({morph:function(props){this.get("morph").start(props);return this}});Fx.implement({getTransition:function(){var trans=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof trans=="string"){var data=trans.split(":");trans=Fx.Transitions;trans=trans[data[0]]||trans[data[0].capitalize()];if(data[1]){trans=trans["ease"+data[1].capitalize()+(data[2]?data[2].capitalize():"")]}}return trans}});Fx.Transition=function(transition,params){params=$splat(params);return $extend(transition,{easeIn:function(pos){return transition(pos,params)},easeOut:function(pos){return 1-transition(1-pos,params)},easeInOut:function(pos){return(pos<=0.5)?transition(2*pos,params)/2:(2-transition(2*(1-pos),params))/2}})};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(transitions){for(var transition in transitions){Fx.Transitions[transition]=new Fx.Transition(transitions[transition])}};Fx.Transitions.extend({Pow:function(p,x){return Math.pow(p,x[0]||6)},Expo:function(p){return Math.pow(2,8*(p-1))},Circ:function(p){return 1-Math.sin(Math.acos(p))},Sine:function(p){return 1-Math.sin((1-p)*Math.PI/2)},Back:function(p,x){x=x[0]||1.618;return Math.pow(p,2)*((x+1)*p-x)},Bounce:function(p){var value;for(var a=0,b=1;1;a+=b,b/=2){if(p>=(7-4*a)/11){value=b*b-Math.pow((11-6*a-11*p)/4,2);break}}return value},Elastic:function(p,x){return Math.pow(2,10*--p)*Math.cos(20*p*Math.PI*(x[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(transition,i){Fx.Transitions[transition]=new Fx.Transition(function(p){return Math.pow(p,[i+2])})});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(options){this.xhr=new Browser.Request();this.setOptions(options);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers)},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml)}else{this.response={text:null,xml:null};this.failure()}},isSuccess:function(){return((this.status>=200)&&(this.status<300))},processScripts:function(text){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(text)}return text.stripScripts(this.options.evalScripts)},success:function(text,xml){this.onSuccess(this.processScripts(text),xml)},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure()},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},setHeader:function(name,value){this.headers.set(name,value);return this},getHeader:function(name){return $try(function(){return this.xhr.getResponseHeader(name)}.bind(this))},check:function(){if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},send:function(options){if(!this.check(options)){return this}this.running=true;var type=$type(options);if(type=="string"||type=="element"){options={data:options}}var old=this.options;options=$extend({data:old.data,url:old.url,method:old.method},options);var data=options.data,url=String(options.url),method=options.method.toLowerCase();switch($type(data)){case"element":data=document.id(data).toQueryString();break;case"object":case"hash":data=Hash.toQueryString(data)}if(this.options.format){var format="format="+this.options.format;data=(data)?format+"&"+data:format}if(this.options.emulation&&!["get","post"].contains(method)){var _method="_method="+method;data=(data)?_method+"&"+data:_method;method="post"}if(this.options.urlEncoded&&method=="post"){var encoding=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+encoding)}if(this.options.noCache){var noCache="noCache="+new Date().getTime();data=(data)?noCache+"&"+data:noCache}var trimPosition=url.lastIndexOf("/");if(trimPosition>-1&&(trimPosition=url.indexOf("#"))>-1){url=url.substr(0,trimPosition)}if(data&&method=="get"){url=url+(url.contains("?")?"&":"?")+data;data=null}this.xhr.open(method.toUpperCase(),url,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(value,key){try{this.xhr.setRequestHeader(key,value)}catch(e){this.fireEvent("exception",[key,value])}},this);this.fireEvent("request");this.xhr.send(data);if(!this.options.async){this.onStateChange()}return this},cancel:function(){if(!this.running){return this}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this}});(function(){var methods={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(method){methods[method]=function(){var params=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(params,{method:method}))}});Request.implement(methods)})();Element.Properties.send={set:function(options){var send=this.retrieve("send");if(send){send.cancel()}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},options))},get:function(options){if(options||!this.retrieve("send")){if(options||!this.retrieve("send:options")){this.set("send",options)}this.store("send",new Request(this.retrieve("send:options")))}return this.retrieve("send")}};Element.implement({send:function(url){var sender=this.get("send");sender.send({data:this,url:url||sender.options.url});return this}});Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(text){var match=text.match(/<body[^>]*>([\s\S]*?)<\/body>/i);text=(match)?match[1]:text;var container=new Element("div");return $try(function(){var root="<root>"+text+"</root>",doc;if(Browser.Engine.trident){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async=false;doc.loadXML(root)}else{doc=new DOMParser().parseFromString(root,"text/xml")}root=doc.getElementsByTagName("root")[0];if(!root){return null}for(var i=0,k=root.childNodes.length;i<k;i++){var child=Element.clone(root.childNodes[i],true,true);if(child){container.grab(child)}}return container})||container.set("html",text)},success:function(text){var options=this.options,response=this.response;response.html=text.stripScripts(function(script){response.javascript=script});var temp=this.processHTML(response.html);response.tree=temp.childNodes;response.elements=temp.getElements("*");if(options.filter){response.tree=response.elements.filter(options.filter)}if(options.update){document.id(options.update).empty().set("html",response.html)}else{if(options.append){document.id(options.append).adopt(temp.getChildren())}}if(options.evalScripts){$exec(response.javascript)}this.onSuccess(response.tree,response.elements,response.html,response.javascript)}});Element.Properties.load={set:function(options){var load=this.retrieve("load");if(load){load.cancel()}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},options))},get:function(options){if(options||!this.retrieve("load")){if(options||!this.retrieve("load:options")){this.set("load",options)}this.store("load",new Request.HTML(this.retrieve("load:options")))}return this.retrieve("load")}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(options){this.parent(options);this.headers.extend({Accept:"application/json","X-Request":"JSON"})},success:function(text){this.response.json=JSON.decode(text,this.options.secure);this.onSuccess(this.response.json,text)}});MooTools.More={version:"1.2.3.1"};Class.Mutators.Binds=function(binds){return binds};Class.Mutators.initialize=function(initialize){return function(){$splat(this.Binds).each(function(name){var original=this[name];if(original){this[name]=original.bind(this)}},this);return initialize.apply(this,arguments)}};Element.implement({measure:function(fn){var vis=function(el){return !!(!el||el.offsetHeight||el.offsetWidth)};if(vis(this)){return fn.apply(this)}var parent=this.getParent(),toMeasure=[],restorers=[];while(!vis(parent)&&parent!=document.body){toMeasure.push(parent.expose());parent=parent.getParent()}var restore=this.expose();var result=fn.apply(this);restore();toMeasure.each(function(restore){restore()});return result},expose:function(){if(this.getStyle("display")!="none"){return $empty}var before=this.style.cssText;this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=before}.bind(this)},getDimensions:function(options){options=$merge({computeSize:false},options);var dim={};var getSize=function(el,options){return(options.computeSize)?el.getComputedSize(options):el.getSize()};if(this.getStyle("display")=="none"){dim=this.measure(function(){return getSize(this,options)})}else{try{dim=getSize(this,options)}catch(e){}}return $chk(dim.x)?$extend(dim,{width:dim.x,height:dim.y}):$extend(dim,{x:dim.width,y:dim.height})},getComputedSize:function(options){options=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},options);var size={width:0,height:0};switch(options.mode){case"vertical":delete size.width;delete options.plains.width;break;case"horizontal":delete size.height;delete options.plains.height;break}var getStyles=[];$each(options.plains,function(plain,key){plain.each(function(edge){options.styles.each(function(style){getStyles.push((style=="border")?style+"-"+edge+"-width":style+"-"+edge)})})});var styles={};getStyles.each(function(style){styles[style]=this.getComputedStyle(style)},this);var subtracted=[];$each(options.plains,function(plain,key){var capitalized=key.capitalize();size["total"+capitalized]=0;size["computed"+capitalized]=0;plain.each(function(edge){size["computed"+edge.capitalize()]=0;getStyles.each(function(style,i){if(style.test(edge)){styles[style]=styles[style].toInt()||0;size["total"+capitalized]=size["total"+capitalized]+styles[style];size["computed"+edge.capitalize()]=size["computed"+edge.capitalize()]+styles[style]}if(style.test(edge)&&key!=style&&(style.test("border")||style.test("padding"))&&!subtracted.contains(style)){subtracted.push(style);size["computed"+capitalized]=size["computed"+capitalized]-styles[style]}})})});["Width","Height"].each(function(value){var lower=value.toLowerCase();if(!$chk(size[lower])){return}size[lower]=size[lower]+this["offset"+value]+size["computed"+value];size["total"+value]=size[lower]+size["total"+value];delete size["computed"+value]},this);return $extend(styles,size)}});(function(){var original=Element.prototype.position;Element.implement({position:function(options){if(options&&($defined(options.x)||$defined(options.y))){return original?original.apply(this,arguments):this}$each(options||{},function(v,k){if(!$defined(v)){delete options[k]}});options=$merge({relativeTo:document.body,position:{x:"center",y:"center"},edge:false,offset:{x:0,y:0},returnPos:false,relFixedPosition:false,ignoreMargins:false,allowNegative:false},options);var parentOffset={x:0,y:0};var parentPositioned=false;var offsetParent=this.measure(function(){return document.id(this.getOffsetParent())});if(offsetParent&&offsetParent!=this.getDocument().body){parentOffset=offsetParent.measure(function(){return this.getPosition()});parentPositioned=true;options.offset.x=options.offset.x-parentOffset.x;options.offset.y=options.offset.y-parentOffset.y}var fixValue=function(option){if($type(option)!="string"){return option}option=option.toLowerCase();var val={};if(option.test("left")){val.x="left"}else{if(option.test("right")){val.x="right"}else{val.x="center"}}if(option.test("upper")||option.test("top")){val.y="top"}else{if(option.test("bottom")){val.y="bottom"}else{val.y="center"}}return val};options.edge=fixValue(options.edge);options.position=fixValue(options.position);if(!options.edge){if(options.position.x=="center"&&options.position.y=="center"){options.edge={x:"center",y:"center"}}else{options.edge={x:"left",y:"top"}}}this.setStyle("position","absolute");var rel=document.id(options.relativeTo)||document.body;var calc=rel==document.body?window.getScroll():rel.getPosition();var top=calc.y;var left=calc.x;if(Browser.Engine.trident){var scrolls=rel.getScrolls();top+=scrolls.y;left+=scrolls.x}var dim=this.getDimensions({computeSize:true,styles:["padding","border","margin"]});if(options.ignoreMargins){options.offset.x=options.offset.x-dim["margin-left"];options.offset.y=options.offset.y-dim["margin-top"]}var pos={};var prefY=options.offset.y;var prefX=options.offset.x;var winSize=window.getSize();switch(options.position.x){case"left":pos.x=left+prefX;break;case"right":pos.x=left+prefX+rel.offsetWidth;break;default:pos.x=left+((rel==document.body?winSize.x:rel.offsetWidth)/2)+prefX;break}switch(options.position.y){case"top":pos.y=top+prefY;break;case"bottom":pos.y=top+prefY+rel.offsetHeight;break;default:pos.y=top+((rel==document.body?winSize.y:rel.offsetHeight)/2)+prefY;break}if(options.edge){var edgeOffset={};switch(options.edge.x){case"left":edgeOffset.x=0;break;case"right":edgeOffset.x=-dim.x-dim.computedRight-dim.computedLeft;break;default:edgeOffset.x=-(dim.x/2);break}switch(options.edge.y){case"top":edgeOffset.y=0;break;case"bottom":edgeOffset.y=-dim.y-dim.computedTop-dim.computedBottom;break;default:edgeOffset.y=-(dim.y/2);break}pos.x=pos.x+edgeOffset.x;pos.y=pos.y+edgeOffset.y}pos={left:((pos.x>=0||parentPositioned||options.allowNegative)?pos.x:0).toInt(),top:((pos.y>=0||parentPositioned||options.allowNegative)?pos.y:0).toInt()};if(rel.getStyle("position")=="fixed"||options.relFixedPosition){var winScroll=window.getScroll();pos.top=pos.top.toInt()+winScroll.y;pos.left=pos.left.toInt()+winScroll.x}if(options.returnPos){return pos}else{this.setStyles(pos)}return this}})})();Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var d;try{if("none"!=this.getStyle("display")){d=this.getStyle("display")}}catch(e){}return this.store("originalDisplay",d||"block").setStyle("display","none")},show:function(display){return this.setStyle("display",display||this.retrieve("originalDisplay")||"block")},swapClass:function(remove,add){return this.removeClass(remove).addClass(add)}});Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:false,offset:{x:0,y:0}},start:function(destination){return this.parent(this.element.position($merge(this.options,destination,{returnPos:true})))}});Element.Properties.move={set:function(options){var morph=this.retrieve("move");if(morph){morph.cancel()}return this.eliminate("move").store("move:options",$extend({link:"cancel"},options))},get:function(options){if(options||!this.retrieve("move")){if(options||!this.retrieve("move:options")){this.set("move",options)}this.store("move",new Fx.Move(this,this.retrieve("move:options")))}return this.retrieve("move")}};Element.implement({move:function(options){this.get("move").start(options);return this}});Fx.Reveal=new Class({Extends:Fx.Morph,options:{styles:["padding","border","margin"],transitionOpacity:!Browser.Engine.trident4,mode:"vertical",display:"block",hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed":false},dissolve:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true;this.showing=false;this.hidden=true;var startStyles=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});var setToAuto=(this.element.style.height===""||this.element.style.height=="auto");this.element.setStyle("display","block");if(this.options.transitionOpacity){startStyles.opacity=1}var zero={};$each(startStyles,function(style,name){zero[name]=[style,0]},this);var overflowBefore=this.element.getStyle("overflow");this.element.setStyle("overflow","hidden");var hideThese=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;this.$chain.unshift(function(){if(this.hidden){this.hiding=false;$each(startStyles,function(style,name){startStyles[name]=style},this);this.element.setStyles($merge({display:"none",overflow:overflowBefore},startStyles));if(setToAuto){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""}if(["width","both"].contains(this.options.mode)){this.element.style.width=""}}if(hideThese){hideThese.setStyle("visibility","visible")}}this.fireEvent("hide",this.element);this.callChain()}.bind(this));if(hideThese){hideThese.setStyle("visibility","hidden")}this.start(zero)}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("hide",this.element)}}else{if(this.options.link=="chain"){this.chain(this.dissolve.bind(this))}else{if(this.options.link=="cancel"&&!this.hiding){this.cancel();this.dissolve()}}}}catch(e){this.hiding=false;this.element.setStyle("display","none");this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("hide",this.element)}return this},reveal:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.showing=true;this.hiding=false;this.hidden=false;var setToAuto,startStyles;this.element.measure(function(){setToAuto=(this.element.style.height===""||this.element.style.height=="auto");startStyles=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode})}.bind(this));$each(startStyles,function(style,name){startStyles[name]=style});if($chk(this.options.heightOverride)){startStyles.height=this.options.heightOverride.toInt()}if($chk(this.options.widthOverride)){startStyles.width=this.options.widthOverride.toInt()}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);startStyles.opacity=1}var zero={height:0,display:this.options.display};$each(startStyles,function(style,name){zero[name]=0});var overflowBefore=this.element.getStyle("overflow");this.element.setStyles($merge(zero,{overflow:"hidden"}));var hideThese=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;if(hideThese){hideThese.setStyle("visibility","hidden")}this.start(startStyles);this.$chain.unshift(function(){this.element.setStyle("overflow",overflowBefore);if(!this.options.heightOverride&&setToAuto){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""}if(["width","both"].contains(this.options.mode)){this.element.style.width=""}}if(!this.hidden){this.showing=false}if(hideThese){hideThese.setStyle("visibility","visible")}this.callChain();this.fireEvent("show",this.element)}.bind(this))}else{this.callChain();this.fireEvent("complete",this.element);this.fireEvent("show",this.element)}}else{if(this.options.link=="chain"){this.chain(this.reveal.bind(this))}else{if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal()}}}}catch(e){this.element.setStyles({display:this.options.display,visiblity:"visible",opacity:1});this.showing=false;this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("show",this.element)}return this},toggle:function(){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.reveal()}else{this.dissolve()}return this}});Element.Properties.reveal={set:function(options){var reveal=this.retrieve("reveal");if(reveal){reveal.cancel()}return this.eliminate("reveal").store("reveal:options",$extend({link:"cancel"},options))},get:function(options){if(options||!this.retrieve("reveal")){if(options||!this.retrieve("reveal:options")){this.set("reveal",options)}this.store("reveal",new Fx.Reveal(this,this.retrieve("reveal:options")))}return this.retrieve("reveal")}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(options){this.get("reveal",options).reveal();return this},dissolve:function(options){this.get("reveal",options).dissolve();return this},nix:function(){var params=Array.link(arguments,{destroy:Boolean.type,options:Object.type});this.get("reveal",params.options).dissolve().chain(function(){this[params.destroy?"destroy":"dispose"]()}.bind(this));return this},wink:function(){var params=Array.link(arguments,{duration:Number.type,options:Object.type});var reveal=this.get("reveal",params.options);reveal.reveal().chain(function(){(function(){reveal.dissolve()}).delay(params.duration||2000)})}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(element,options){this.element=this.subject=document.id(element);this.parent(options);var cancel=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=document.id(this.element.getDocument().body)}var stopper=this.element;if(this.options.wheelStops){this.addEvent("start",function(){stopper.addEvent("mousewheel",cancel)},true);this.addEvent("complete",function(){stopper.removeEvent("mousewheel",cancel)},true)}},set:function(){var now=Array.flatten(arguments);this.element.scrollTo(now[0],now[1])},compute:function(from,to,delta){return[0,1].map(function(i){return Fx.compute(from[i],to[i],delta)})},start:function(x,y){if(!this.check(x,y)){return this}var offsetSize=this.element.getSize(),scrollSize=this.element.getScrollSize();var scroll=this.element.getScroll(),values={x:x,y:y};for(var z in values){var max=scrollSize[z]-offsetSize[z];if($chk(values[z])){values[z]=($type(values[z])=="number")?values[z].limit(0,max):max}else{values[z]=scroll[z]}values[z]+=this.options.offset[z]}return this.parent([scroll.x,scroll.y],[values.x,values.y])},toTop:function(){return this.start(false,0)},toLeft:function(){return this.start(0,false)},toRight:function(){return this.start("right",false)},toBottom:function(){return this.start(false,"bottom")},toElement:function(el){var position=document.id(el).getPosition(this.element);return this.start(position.x,position.y)},scrollIntoView:function(el,axes,offset){axes=axes?$splat(axes):["x","y"];var to={};el=document.id(el);var pos=el.getPosition(this.element);var size=el.getSize();var scroll=this.element.getScroll();var containerSize=this.element.getSize();var edge={x:pos.x+size.x,y:pos.y+size.y};["x","y"].each(function(axis){if(axes.contains(axis)){if(edge[axis]>scroll[axis]+containerSize[axis]){to[axis]=edge[axis]-containerSize[axis]}if(pos[axis]<scroll[axis]){to[axis]=pos[axis]}}if(to[axis]==null){to[axis]=scroll[axis]}if(offset&&offset[axis]){to[axis]=to[axis]+offset[axis]}},this);if(to.x!=scroll.x||to.y!=scroll.y){this.start(to.x,to.y)}return this}});var SmoothScroll=Fx.SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(options,context){context=context||document;this.doc=context.getDocument();var win=context.getWindow();this.parent(this.doc,options);this.links=this.options.links?$$(this.options.links):$$(this.doc.links);var location=win.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(link){if(link.href.indexOf(location)!=0){return}var anchor=link.href.substr(location.length);if(anchor){this.useLink(link,anchor)}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){win.location.hash=this.anchor},true)}},useLink:function(link,anchor){var el;link.addEvent("click",function(event){if(el!==false&&!el){el=document.id(anchor)||this.doc.getElement("a[name="+anchor+"]")}if(el){event.preventDefault();this.anchor=anchor;this.toElement(el);link.blur()}}.bind(this))}});String.implement({parseQueryString:function(){var vars=this.split(/[&;]/),res={};if(vars.length){vars.each(function(val){var index=val.indexOf("="),keys=index<0?[""]:val.substr(0,index).match(/[^\]\[]+/g),value=decodeURIComponent(val.substr(index+1)),obj=res;keys.each(function(key,i){var current=obj[key];if(i<keys.length-1){obj=obj[key]=current||{}}else{if($type(current)=="array"){current.push(value)}else{obj[key]=$defined(current)?[current,value]:value}}})})}return res},cleanQueryString:function(method){return this.split("&").filter(function(val){var index=val.indexOf("="),key=index<0?"":val.substr(0,index),value=val.substr(index+1);return method?method.run([key,value]):$chk(value)}).join("&")}});(function(){var data={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]};var cascaded;MooTools.lang=new Events();$extend(MooTools.lang,{setLanguage:function(lang){if(!data.languages[lang]){return this}data.language=lang;this.load();this.fireEvent("langChange",lang);return this},load:function(){var langs=this.cascade(this.getCurrentLanguage());cascaded={};$each(langs,function(set,setName){cascaded[setName]=this.lambda(set)},this)},getCurrentLanguage:function(){return data.language},addLanguage:function(lang){data.languages[lang]=data.languages[lang]||{};return this},cascade:function(lang){var cascades=(data.languages[lang]||{}).cascades||[];cascades.combine(data.cascades);cascades.erase(lang).push(lang);var langs=cascades.map(function(lng){return data.languages[lng]},this);return $merge.apply(this,langs)},lambda:function(set){(set||{}).get=function(key,args){return $lambda(set[key]).apply(this,$splat(args))};return set},get:function(set,key,args){if(cascaded&&cascaded[set]){return(key?cascaded[set].get(key,args):cascaded[set])}},set:function(lang,set,members){this.addLanguage(lang);langData=data.languages[lang];if(!langData[set]){langData[set]={}}$extend(langData[set],members);if(lang==this.getCurrentLanguage()){this.load();this.fireEvent("langChange",lang)}return this},list:function(){return Hash.getKeys(data.languages)}})})();(function(){var Date=this.Date;if(!Date.now){Date.now=$time}Date.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(method){Date.Methods[method.toLowerCase()]=method});var pad=function(what,length){return new Array(length-String(what).length+1).join("0")+what};Date.implement({set:function(prop,value){switch($type(prop)){case"object":for(var p in prop){this.set(p,prop[p])}break;case"string":prop=prop.toLowerCase();var m=Date.Methods;if(m[prop]){this["set"+m[prop]](value)}}return this},get:function(prop){prop=prop.toLowerCase();var m=Date.Methods;if(m[prop]){return this["get"+m[prop]]()}return null},clone:function(){return new Date(this.get("time"))},increment:function(interval,times){interval=interval||"day";times=$pick(times,1);switch(interval){case"year":return this.increment("month",times*12);case"month":var d=this.get("date");this.set("date",1).set("mo",this.get("mo")+times);return this.set("date",d.min(this.get("lastdayofmonth")));case"week":return this.increment("day",times*7);case"day":return this.set("date",this.get("date")+times)}if(!Date.units[interval]){throw new Error(interval+" is not a supported interval")}return this.set("time",this.get("time")+times*Date.units[interval]())},decrement:function(interval,times){return this.increment(interval,-1*$pick(times,1))},isLeapYear:function(){return Date.isLeapYear(this.get("year"))},clearTime:function(){return this.set({hr:0,min:0,sec:0,ms:0})},diff:function(date,resolution){if($type(date)=="string"){date=Date.parse(date)}return((date-this)/Date.units[resolution||"day"](3,3)).toInt()},getLastDayOfMonth:function(){return Date.daysInMonth(this.get("mo"),this.get("year"))},getDayOfYear:function(){return(Date.UTC(this.get("year"),this.get("mo"),this.get("date")+1)-Date.UTC(this.get("year"),0,1))/Date.units.day()},getWeek:function(){return(this.get("dayofyear")/7).ceil()},getOrdinal:function(day){return Date.getMsg("ordinal",day||this.get("date"))},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3")},getGMTOffset:function(){var off=this.get("timezoneOffset");return((off>0)?"-":"+")+pad((off.abs()/60).floor(),2)+pad(off%60,2)},setAMPM:function(ampm){ampm=ampm.toUpperCase();var hr=this.get("hr");if(hr>11&&ampm=="AM"){return this.decrement("hour",12)}else{if(hr<12&&ampm=="PM"){return this.increment("hour",12)}}return this},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM"},parse:function(str){this.set("time",Date.parse(str));return this},isValid:function(date){return !!(date||this).valueOf()},format:function(f){if(!this.isValid()){return"invalid date"}f=f||"%x %X";f=formats[f.toLowerCase()]||f;var d=this;return f.replace(/%([a-z%])/gi,function($0,$1){switch($1){case"a":return Date.getMsg("days")[d.get("day")].substr(0,3);case"A":return Date.getMsg("days")[d.get("day")];case"b":return Date.getMsg("months")[d.get("month")].substr(0,3);case"B":return Date.getMsg("months")[d.get("month")];case"c":return d.toString();case"d":return pad(d.get("date"),2);case"H":return pad(d.get("hr"),2);case"I":return((d.get("hr")%12)||12);case"j":return pad(d.get("dayofyear"),3);case"m":return pad((d.get("mo")+1),2);case"M":return pad(d.get("min"),2);case"o":return d.get("ordinal");case"p":return Date.getMsg(d.get("ampm"));case"S":return pad(d.get("seconds"),2);case"U":return pad(d.get("week"),2);case"w":return d.get("day");case"x":return d.format(Date.getMsg("shortDate"));case"X":return d.format(Date.getMsg("shortTime"));case"y":return d.get("year").toString().substr(2);case"Y":return d.get("year");case"T":return d.get("GMTOffset");case"Z":return d.get("Timezone")}return $1})},toISOString:function(){return this.format("iso8601")}});Date.alias("toISOString","toJSON");Date.alias("diff","compare");Date.alias("format","strftime");var formats={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"};var parsePatterns=[];var nativeParse=Date.parse;var parseWord=function(type,word,num){var ret=-1;var translated=Date.getMsg(type+"s");switch($type(word)){case"object":ret=translated[word.get(type)];break;case"number":ret=translated[month-1];if(!ret){throw new Error("Invalid "+type+" index: "+index)}break;case"string":var match=translated.filter(function(name){return this.test(name)},new RegExp("^"+word,"i"));if(!match.length){throw new Error("Invalid "+type+" string")}if(match.length>1){throw new Error("Ambiguous "+type)}ret=match[0]}return(num)?translated.indexOf(ret):ret};Date.extend({getMsg:function(key,args){return MooTools.lang.get("Date",key,args)},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lambda(86400000),week:$lambda(608400000),month:function(month,year){var d=new Date;return Date.daysInMonth($pick(month,d.get("mo")),$pick(year,d.get("year")))*86400000},year:function(year){year=year||new Date().get("year");return Date.isLeapYear(year)?31622400000:31536000000}},daysInMonth:function(month,year){return[31,Date.isLeapYear(year)?29:28,31,30,31,30,31,31,30,31,30,31][month]},isLeapYear:function(year){return((year%4===0)&&(year%100!==0))||(year%400===0)},parse:function(from){var t=$type(from);if(t=="number"){return new Date(from)}if(t!="string"){return from}from=from.clean();if(!from.length){return null}var parsed;parsePatterns.some(function(pattern){var bits=pattern.re.exec(from);return(bits)?(parsed=pattern.handler(bits)):false});return parsed||new Date(nativeParse(from))},parseDay:function(day,num){return parseWord("day",day,num)},parseMonth:function(month,num){return parseWord("month",month,num)},parseUTC:function(value){var localDate=new Date(value);var utcSeconds=Date.UTC(localDate.get("year"),localDate.get("mo"),localDate.get("date"),localDate.get("hr"),localDate.get("min"),localDate.get("sec"));return new Date(utcSeconds)},orderIndex:function(unit){return Date.getMsg("dateOrder").indexOf(unit)+1},defineFormat:function(name,format){formats[name]=format},defineFormats:function(formats){for(var name in formats){Date.defineFormat(name,formats[name])}},parsePatterns:parsePatterns,defineParser:function(pattern){parsePatterns.push((pattern.re&&pattern.handler)?pattern:build(pattern))},defineParsers:function(){Array.flatten(arguments).each(Date.defineParser)},define2DigitYearStart:function(year){startYear=year%100;startCentury=year-startYear}});var startCentury=1900;var startYear=70;var regexOf=function(type){return new RegExp("(?:"+Date.getMsg(type).map(function(name){return name.substr(0,3)}).join("|")+")[a-z]*")};var replacers=function(key){switch(key){case"x":return((Date.orderIndex("month")==1)?"%m[.-/]%d":"%d[.-/]%m")+"([.-/]%y)?";case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%T?"}return null};var keys={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,T:/Z|[+-]\d{2}(?::?\d{2})?/};keys.m=keys.I;keys.S=keys.M;var currentLanguage;var recompile=function(language){currentLanguage=language;keys.a=keys.A=regexOf("days");keys.b=keys.B=regexOf("months");parsePatterns.each(function(pattern,i){if(pattern.format){parsePatterns[i]=build(pattern.format)}})};var build=function(format){if(!currentLanguage){return{format:format}}var parsed=[];var re=(format.source||format).replace(/%([a-z])/gi,function($0,$1){return replacers($1)||$0}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function($0,$1){var p=keys[$1];if(!p){return $1}parsed.push($1);return"("+p.source+")"}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff]");return{format:format,re:new RegExp("^"+re+"$","i"),handler:function(bits){bits=bits.slice(1).associate(parsed);var date=new Date().clearTime();if("d" in bits){handle.call(date,"d",1)}if("m" in bits||"b" in bits||"B" in bits){handle.call(date,"m",1)}for(var key in bits){handle.call(date,key,bits[key])}return date}}};var handle=function(key,value){if(!value){return this}switch(key){case"a":case"A":return this.set("day",Date.parseDay(value,true));case"b":case"B":return this.set("mo",Date.parseMonth(value,true));case"d":return this.set("date",value);case"H":case"I":return this.set("hr",value);case"m":return this.set("mo",value-1);case"M":return this.set("min",value);case"p":return this.set("ampm",value.replace(/\./g,""));case"S":return this.set("sec",value);case"s":return this.set("ms",("0."+value)*1000);case"w":return this.set("day",value);case"Y":return this.set("year",value);case"y":value=+value;if(value<100){value+=startCentury+(value<startYear?100:0)}return this.set("year",value);case"T":if(value=="Z"){value="+00"}var offset=value.match(/([+-])(\d{2}):?(\d{2})?/);offset=(offset[1]+"1")*(offset[2]*60+(+offset[3]||0))+this.getTimezoneOffset();return this.set("time",this-offset*60000)}return this};Date.defineParsers("%Y([-./]%m([-./]%d((T| )%X)?)?)?","%Y%m%d(T%H(%M%S?)?)?","%x( %X)?","%d%o( %b( %Y)?)?( %X)?","%b( %d%o)?( %Y)?( %X)?","%Y %b( %d%o( %X)?)?","%o %b %d %X %T %Y");MooTools.lang.addEvent("langChange",function(language){if(MooTools.lang.get("Date")){recompile(language)}}).fireEvent("langChange",MooTools.lang.getCurrentLanguage())})();MooTools.lang.set("en-US","Date",{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dateOrder:["month","date","year"],shortDate:"%m/%d/%Y",shortTime:"%I:%M%p",AM:"AM",PM:"PM",ordinal:function(dayOfMonth){return(dayOfMonth>3&&dayOfMonth<21)?"th":["th","st","nd","rd","th"][Math.min(dayOfMonth%10,4)]}});var Color=new Native({initialize:function(color,type){if(arguments.length>=3){type="rgb";color=Array.slice(arguments,0,3)}else{if(typeof color=="string"){if(color.match(/rgb/)){color=color.rgbToHex().hexToRgb(true)}else{if(color.match(/hsb/)){color=color.hsbToRgb()}else{color=color.hexToRgb(true)}}}}type=type||"rgb";switch(type){case"hsb":var old=color;color=color.hsbToRgb();color.hsb=old;break;case"hex":color=color.hexToRgb(true);break}color.rgb=color.slice(0,3);color.hsb=color.hsb||color.rgbToHsb();color.hex=color.rgbToHex();return $extend(color,this)}});Color.implement({mix:function(){var colors=Array.slice(arguments);var alpha=($type(colors.getLast())=="number")?colors.pop():50;var rgb=this.slice();colors.each(function(color){color=new Color(color);for(var i=0;i<3;i++){rgb[i]=Math.round((rgb[i]/100*(100-alpha))+(color[i]/100*alpha))}});return new Color(rgb,"rgb")},invert:function(){return new Color(this.map(function(value){return 255-value}))},setHue:function(value){return new Color([value,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(percent){return new Color([this.hsb[0],percent,this.hsb[2]],"hsb")},setBrightness:function(percent){return new Color([this.hsb[0],this.hsb[1],percent],"hsb")}});var $RGB=function(r,g,b){return new Color([r,g,b],"rgb")};var $HSB=function(h,s,b){return new Color([h,s,b],"hsb")};var $HEX=function(hex){return new Color(hex,"hex")};Array.implement({rgbToHsb:function(){var red=this[0],green=this[1],blue=this[2],hue=0;var max=Math.max(red,green,blue),min=Math.min(red,green,blue);var delta=max-min;var brightness=max/255,saturation=(max!=0)?delta/max:0;if(saturation!=0){var rr=(max-red)/delta;var gr=(max-green)/delta;var br=(max-blue)/delta;if(red==max){hue=br-gr}else{if(green==max){hue=2+rr-br}else{hue=4+gr-rr}}hue/=6;if(hue<0){hue++}}return[Math.round(hue*360),Math.round(saturation*100),Math.round(brightness*100)]},hsbToRgb:function(){var br=Math.round(this[2]/100*255);if(this[1]==0){return[br,br,br]}else{var hue=this[0]%360;var f=hue%60;var p=Math.round((this[2]*(100-this[1]))/10000*255);var q=Math.round((this[2]*(6000-this[1]*f))/600000*255);var t=Math.round((this[2]*(6000-this[1]*(60-f)))/600000*255);switch(Math.floor(hue/60)){case 0:return[br,t,p];case 1:return[q,br,p];case 2:return[p,br,t];case 3:return[p,q,br];case 4:return[t,p,br];case 5:return[br,p,q]}}return false}});String.implement({rgbToHsb:function(){var rgb=this.match(/\d{1,3}/g);return(rgb)?rgb.rgbToHsb():null},hsbToRgb:function(){var hsb=this.match(/\d{1,3}/g);return(hsb)?hsb.hsbToRgb():null}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var params=Array.link(arguments,{options:Object.type,element:$defined});this.element=document.id(params.element);this.document=this.element.getDocument();this.setOptions(params.options||{});var htype=$type(this.options.handle);this.handles=((htype=="array"||htype=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach()},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this},start:function(event){if(event.rightClick){return}if(this.options.preventDefault){event.preventDefault()}if(this.options.stopPropagation){event.stopPropagation()}this.mouse.start=event.page;this.fireEvent("beforeStart",this.element);var limit=this.options.limit;this.limit={x:[],y:[]};for(var z in this.options.modifiers){if(!this.options.modifiers[z]){continue}if(this.options.style){this.value.now[z]=this.element.getStyle(this.options.modifiers[z]).toInt()}else{this.value.now[z]=this.element[this.options.modifiers[z]]}if(this.options.invert){this.value.now[z]*=-1}this.mouse.pos[z]=event.page[z]-this.value.now[z];if(limit&&limit[z]){for(var i=2;i--;i){if($chk(limit[z][i])){this.limit[z][i]=$lambda(limit[z][i])()}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop)},check:function(event){if(this.options.preventDefault){event.preventDefault()}var distance=Math.round(Math.sqrt(Math.pow(event.page.x-this.mouse.start.x,2)+Math.pow(event.page.y-this.mouse.start.y,2)));if(distance>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,event]).fireEvent("snap",this.element)}},drag:function(event){if(this.options.preventDefault){event.preventDefault()}this.mouse.now=event.page;for(var z in this.options.modifiers){if(!this.options.modifiers[z]){continue}this.value.now[z]=this.mouse.now[z]-this.mouse.pos[z];if(this.options.invert){this.value.now[z]*=-1}if(this.options.limit&&this.limit[z]){if($chk(this.limit[z][1])&&(this.value.now[z]>this.limit[z][1])){this.value.now[z]=this.limit[z][1]}else{if($chk(this.limit[z][0])&&(this.value.now[z]<this.limit[z][0])){this.value.now[z]=this.limit[z][0]}}}if(this.options.grid[z]){this.value.now[z]-=((this.value.now[z]-(this.limit[z][0]||0))%this.options.grid[z])}if(this.options.style){this.element.setStyle(this.options.modifiers[z],this.value.now[z]+this.options.unit)}else{this.element[this.options.modifiers[z]]=this.value.now[z]}}this.fireEvent("drag",[this.element,event])},cancel:function(event){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(event){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element)}},stop:function(event){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(event){this.fireEvent("complete",[this.element,event])}}});Element.implement({makeResizable:function(options){var drag=new Drag(this,$merge({modifiers:{x:"width",y:"height"}},options));this.store("resizer",drag);return drag.addEvent("drag",function(){this.fireEvent("resize",drag)}.bind(this))}});Class.Mutators.Binds=function(binds){return binds};Class.Mutators.initialize=function(initialize){return function(){$splat(this.Binds).each(function(name){var original=this[name];if(original){this[name]=original.bind(this)}},this);return initialize.apply(this,arguments)}};var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(position){if(this.options.snap){position=this.toPosition(this.step)}this.knob.setStyle(this.property,position)},initialStep:0,snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(element,knob,options){this.setOptions(options);this.element=document.id(element);this.knob=document.id(knob);this.previousChange=this.previousEnd=this.step=-1;var offset,limit={},modifiers={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";offset="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";offset="offsetWidth"}this.full=this.element.measure(function(){this.half=this.knob[offset]/2;return this.element[offset]-this.knob[offset]+(this.options.offset*2)}.bind(this));this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,this.options.initialStep?this.toPosition(this.options.initialStep):-this.options.offset);modifiers[this.axis]=this.property;limit[this.axis]=[-this.options.offset,this.full-this.options.offset];var dragOptions={snap:0,limit:limit,modifiers:modifiers,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:(function(){this.isDragging=true}).bind(this),onCancel:function(){this.isDragging=false}.bind(this),onComplete:function(){this.isDragging=false;this.draggedKnob();this.end()}.bind(this)};if(this.options.snap){dragOptions.grid=Math.ceil(this.stepWidth);dragOptions.limit[this.axis][1]=this.full}this.drag=new Drag(this.knob,dragOptions);this.attach()},attach:function(){this.element.addEvent("mousedown",this.clickedElement);if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement)}this.drag.attach();return this},detach:function(){this.element.removeEvent("mousedown",this.clickedElement);this.element.removeEvent("mousewheel",this.scrolledElement);this.drag.detach();return this},set:function(step){if(!((this.range>0)^(step<this.min))){step=this.min}if(!((this.range>0)^(step>this.max))){step=this.max}this.step=Math.round(step);this.checkStep();this.fireEvent("tick",this.toPosition(this.step));this.end();return this},clickedElement:function(event){if(this.isDragging||event.target==this.knob){return}var dir=this.range<0?-1:1;var position=event.page[this.axis]-this.element.getPosition()[this.axis]-this.half;position=position.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+dir*this.toStep(position));this.checkStep();this.fireEvent("tick",position);this.end()},scrolledElement:function(event){var mode=(this.options.mode=="horizontal")?(event.wheel<0):(event.wheel>0);this.set(mode?this.step-this.stepSize:this.step+this.stepSize);event.stop()},draggedKnob:function(){var dir=this.range<0?-1:1;var position=this.drag.value.now[this.axis];position=position.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+dir*this.toStep(position));this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"")}},toStep:function(position){var step=(position+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(step-=step%this.stepSize):step},toPosition:function(step){return(this.full*Math.abs(this.min-step))/(this.steps*this.stepSize)-this.options.offset}});var Observer=new Class({Implements:[Options,Events],options:{periodical:false,delay:1000},initialize:function(el,onFired,options){this.element=$(el)||$$(el);this.addEvent("onFired",onFired);this.setOptions(options);this.bound=this.changed.bind(this);this.resume()},changed:function(){var value=this.element.get("value");if($equals(this.value,value)){return}this.clear();this.value=value;this.timeout=this.onFired.delay(this.options.delay,this)},setValue:function(value){this.value=value;this.element.set("value",value);return this.clear()},onFired:function(){this.fireEvent("onFired",[this.value,this.element])},clear:function(){$clear(this.timeout||null);return this},pause:function(){if(this.timer){$clear(this.timer)}else{this.element.removeEvent("keyup",this.bound)}return this.clear()},resume:function(){this.value=this.element.get("value");if(this.options.periodical){this.timer=this.changed.periodical(this.options.periodical,this)}else{this.element.addEvent("keyup",this.bound)}return this}});var $equals=function(obj1,obj2){return(obj1==obj2||JSON.encode(obj1)==JSON.encode(obj2))};var Autocompleter=new Class({Implements:[Options,Events],options:{minLength:1,markQuery:true,width:"inherit",maxChoices:10,injectChoice:null,customChoices:null,emptyChoices:null,visibleChoices:true,className:"autocompleter-choices",zIndex:42,delay:400,observerOptions:{},fxOptions:{},autoSubmit:false,overflow:false,overflowMargin:25,selectFirst:false,filter:null,filterCase:false,filterSubset:false,forceSelect:false,selectMode:true,choicesMatch:null,multiple:false,separator:", ",separatorSplit:/\s*[,;]\s*/,autoTrim:false,allowDupes:false,cache:true,relative:false},initialize:function(element,options){this.element=$(element);this.setOptions(options);this.build();this.observer=new Observer(this.element,this.prefetch.bind(this),$merge({delay:this.options.delay},this.options.observerOptions));this.queryValue=null;if(this.options.filter){this.filter=this.options.filter.bind(this)}var mode=this.options.selectMode;this.typeAhead=(mode=="type-ahead");this.selectMode=(mode===true)?"selection":mode;this.cached=[]},build:function(){if($(this.options.customChoices)){this.choices=this.options.customChoices}else{this.choices=new Element("ul",{"class":this.options.className,styles:{zIndex:this.options.zIndex}}).inject(document.body);this.relative=false;if(this.options.relative){this.choices.inject(this.element,"after");this.relative=this.element.getOffsetParent()}this.fix=new OverlayFix(this.choices)}if(!this.options.separator.test(this.options.separatorSplit)){this.options.separatorSplit=this.options.separator}this.fx=(!this.options.fxOptions)?null:new Fx.Tween(this.choices,$merge({property:"opacity",link:"cancel",duration:200},this.options.fxOptions)).addEvent("onStart",Chain.prototype.clearChain).set(0);this.element.setProperty("autocomplete","off").addEvent((Browser.Engine.trident||Browser.Engine.webkit)?"keydown":"keypress",this.onCommand.bind(this)).addEvent("click",this.onCommand.bind(this,[false])).addEvent("focus",this.toggleFocus.create({bind:this,arguments:true,delay:100})).addEvent("blur",this.toggleFocus.create({bind:this,arguments:false,delay:100}))},destroy:function(){if(this.fix){this.fix.destroy()}this.choices=this.selected=this.choices.destroy()},toggleFocus:function(state){this.focussed=state;if(!state){this.hideChoices(true)}this.fireEvent((state)?"onFocus":"onBlur",[this.element])},onCommand:function(e){if(!e&&this.focussed){return this.prefetch()}if(e&&e.key&&!e.shift){switch(e.key){case"enter":if(this.element.value!=this.opted){return true}if(this.selected&&this.visible){this.choiceSelect(this.selected);return !!(this.options.autoSubmit)}break;case"up":case"down":if(!this.prefetch()&&this.queryValue!==null){var up=(e.key=="up");this.choiceOver((this.selected||this.choices)[(this.selected)?((up)?"getPrevious":"getNext"):((up)?"getLast":"getFirst")](this.options.choicesMatch),true)}return false;case"esc":case"tab":this.hideChoices(true);break}}return true},setSelection:function(finish){var input=this.selected.inputValue,value=input;var start=this.queryValue.length,end=input.length;if(input.substr(0,start).toLowerCase()!=this.queryValue.toLowerCase()){start=0}if(this.options.multiple){var split=this.options.separatorSplit;value=this.element.value;start+=this.queryIndex;end+=this.queryIndex;var old=value.substr(this.queryIndex).split(split,1)[0];value=value.substr(0,this.queryIndex)+input+value.substr(this.queryIndex+old.length);if(finish){var tokens=value.split(this.options.separatorSplit).filter(function(entry){return this.test(entry)},/[^\s,]+/);if(!this.options.allowDupes){tokens=[].combine(tokens)}var sep=this.options.separator;value=tokens.join(sep)+sep;end=value.length}}this.observer.setValue(value);this.opted=value;if(finish||this.selectMode=="pick"){start=end}this.element.selectRange(start,end);this.fireEvent("onSelection",[this.element,this.selected,value,input])},showChoices:function(){var match=this.options.choicesMatch,first=this.choices.getFirst(match);this.selected=this.selectedValue=null;if(this.fix){var pos=this.element.getCoordinates(this.relative),width=this.options.width||"auto";this.choices.setStyles({left:pos.left,top:pos.bottom,width:(width===true||width=="inherit")?pos.width:width})}if(!first){return}if(!this.visible){this.visible=true;this.choices.setStyle("display","");if(this.fx){this.fx.start(1)}this.fireEvent("onShow",[this.element,this.choices])}if(this.options.selectFirst||this.typeAhead||first.inputValue==this.queryValue){this.choiceOver(first,this.typeAhead)}var items=this.choices.getChildren(match),max=this.options.maxChoices;var styles={overflowY:"hidden",height:""};this.overflown=false;if(items.length>max){var item=items[max-1];styles.overflowY="scroll";styles.height=item.getCoordinates(this.choices).bottom;this.overflown=true}this.choices.setStyles(styles);if(this.fix){this.fix.show()}if(this.options.visibleChoices){var scroll=document.getScroll(),size=document.getSize(),coords=this.choices.getCoordinates();if(coords.right>scroll.x+size.x){scroll.x=coords.right-size.x}if(coords.bottom>scroll.y+size.y){scroll.y=coords.bottom-size.y}window.scrollTo(Math.min(scroll.x,coords.left),Math.min(scroll.y,coords.top))}},hideChoices:function(clear){if(clear){var value=this.element.value;if(this.options.forceSelect){value=this.opted}if(this.options.autoTrim){value=value.split(this.options.separatorSplit).filter($arguments(0)).join(this.options.separator)}this.observer.setValue(value)}if(!this.visible){return}this.visible=false;if(this.selected){this.selected.removeClass("autocompleter-selected")}this.observer.clear();var hide=function(){this.choices.setStyle("display","none");if(this.fix){this.fix.hide()}}.bind(this);if(this.fx){this.fx.start(0).chain(hide)}else{hide()}this.fireEvent("onHide",[this.element,this.choices])},prefetch:function(){var value=this.element.value,query=value;if(this.options.multiple){var split=this.options.separatorSplit;var values=value.split(split);var index=this.element.getSelectedRange().start;var toIndex=value.substr(0,index).split(split);var last=toIndex.length-1;index-=toIndex[last].length;query=values[last]}if(query.length<this.options.minLength){this.hideChoices()}else{if(query===this.queryValue||(this.visible&&query==this.selectedValue)){if(this.visible){return false}this.showChoices()}else{this.queryValue=query;this.queryIndex=index;if(!this.fetchCached()){this.query()}}}return true},fetchCached:function(){return false;if(!this.options.cache||!this.cached||!this.cached.length||this.cached.length>=this.options.maxChoices||this.queryValue){return false}this.update(this.filter(this.cached));return true},update:function(tokens){this.choices.empty();this.cached=tokens;var type=tokens&&$type(tokens);if(!type||(type=="array"&&!tokens.length)||(type=="hash"&&!tokens.getLength())){(this.options.emptyChoices||this.hideChoices).call(this)}else{if(this.options.maxChoices<tokens.length&&!this.options.overflow){tokens.length=this.options.maxChoices}tokens.each(this.options.injectChoice||function(token){var choice=new Element("li",{html:this.markQueryValue(token)});choice.inputValue=token;this.addChoiceEvents(choice).inject(this.choices)},this);this.showChoices()}},choiceOver:function(choice,selection){if(!choice||choice==this.selected){return}if(this.selected){this.selected.removeClass("autocompleter-selected")}this.selected=choice.addClass("autocompleter-selected");this.fireEvent("onSelect",[this.element,this.selected,selection]);if(!this.selectMode){this.opted=this.element.value}if(!selection){return}this.selectedValue=this.selected.inputValue;if(this.overflown){var coords=this.selected.getCoordinates(this.choices),margin=this.options.overflowMargin,top=this.choices.scrollTop,height=this.choices.offsetHeight,bottom=top+height;if(coords.top-margin<top&&top){this.choices.scrollTop=Math.max(coords.top-margin,0)}else{if(coords.bottom+margin>bottom){this.choices.scrollTop=Math.min(coords.bottom-height+margin,bottom)}}}if(this.selectMode){this.setSelection()}},choiceSelect:function(choice){if(choice){this.choiceOver(choice)}this.setSelection(true);this.queryValue=false;this.hideChoices()},filter:function(tokens){return(tokens||this.tokens).filter(function(token){return this.test(token)},new RegExp(((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp(),(this.options.filterCase)?"":"i"))},markQueryValue:function(str){return(!this.options.markQuery||!this.queryValue)?str:str.replace(new RegExp("("+((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp()+")",(this.options.filterCase)?"":"i"),'<span class="autocompleter-queried">$1</span>')},addChoiceEvents:function(el){return el.addEvents({mouseover:this.choiceOver.bind(this,[el]),click:this.choiceSelect.bind(this,[el])})}});var OverlayFix=new Class({initialize:function(el){this.element=$(el);this.relative=this.element.getOffsetParent();this.fix=new Element("iframe",{frameborder:"0",scrolling:"no",src:"javascript:false;",styles:{position:"absolute",border:"none",display:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}}).inject(this.element,"after")},show:function(){if(this.fix){var coords=this.element.getCoordinates(this.relative);delete coords.right;delete coords.bottom;this.fix.setStyles($extend(coords,{display:"",zIndex:(this.element.getStyle("zIndex")||1)-1}))}return this},hide:function(){if(this.fix){this.fix.setStyle("display","none")}return this},destroy:function(){if(this.fix){this.fix=this.fix.destroy()}}});Element.implement({getSelectedRange:function(){if(!Browser.Engine.trident){return{start:this.selectionStart,end:this.selectionEnd}}var pos={start:0,end:0};var range=this.getDocument().selection.createRange();if(!range||range.parentElement()!=this){return pos}var dup=range.duplicate();if(this.type=="text"){pos.start=0-dup.moveStart("character",-100000);pos.end=pos.start+range.text.length}else{var value=this.value;var offset=value.length-value.match(/[\n\r]*$/)[0].length;dup.moveToElementText(this);dup.setEndPoint("StartToEnd",range);pos.end=offset-dup.text.length;dup.setEndPoint("StartToStart",range);pos.start=offset-dup.text.length}return pos},selectRange:function(start,end){if(Browser.Engine.trident){var diff=this.value.substr(start,end-start).replace(/\r/g,"").length;start=this.value.substr(0,start).replace(/\r/g,"").length;var range=this.createTextRange();range.collapse(true);range.moveEnd("character",start+diff);range.moveStart("character",start);range.select()}else{this.focus();this.setSelectionRange(start,end)}return this}});Autocompleter.Base=Autocompleter;Autocompleter.Request=new Class({Extends:Autocompleter,options:{postData:{},ajaxOptions:{},postVar:"value"},query:function(){var data=$unlink(this.options.postData)||{};data[this.options.postVar]=this.queryValue;var indicator=$(this.options.indicator);if(indicator){indicator.setStyle("display","")}var cls=this.options.indicatorClass;if(cls){this.element.addClass(cls)}this.fireEvent("onRequest",[this.element,this.request,data,this.queryValue]);this.request.send({data:data})},queryResponse:function(){var indicator=$(this.options.indicator);if(indicator){indicator.setStyle("display","none")}var cls=this.options.indicatorClass;if(cls){this.element.removeClass(cls)}return this.fireEvent("onComplete",[this.element,this.request])}});Autocompleter.Request.JSON=new Class({Extends:Autocompleter.Request,initialize:function(el,url,options){this.parent(el,options);this.request=new Request.JSON($merge({url:url,link:"cancel"},this.options.ajaxOptions)).addEvent("onComplete",this.queryResponse.bind(this))},queryResponse:function(response){this.parent();this.update(response)}});Autocompleter.Request.HTML=new Class({Extends:Autocompleter.Request,initialize:function(el,url,options){this.parent(el,options);this.request=new Request.HTML($merge({url:url,link:"cancel",update:this.choices},this.options.ajaxOptions)).addEvent("onComplete",this.queryResponse.bind(this))},queryResponse:function(tree,elements){this.parent();if(!elements||!elements.length){this.hideChoices()}else{this.choices.getChildren(this.options.choicesMatch).each(this.options.injectChoice||function(choice){var value=choice.innerHTML;choice.inputValue=value;this.addChoiceEvents(choice.set("html",this.markQueryValue(value)))},this);this.showChoices()}}});Autocompleter.Ajax={Base:Autocompleter.Request,Json:Autocompleter.Request.JSON,Xhtml:Autocompleter.Request.HTML};var Tips=new Class({Implements:[Events,Options],options:{onShow:function(tip){IE6_overlay_fix.show(tip);tip.setStyle("visibility","visible")},onHide:function(tip){IE6_overlay_fix.hide(tip);tip.setStyle("visibility","hidden")},title:"title",text:function(el){return el.get("rel")||el.get("href")},showDelay:100,hideDelay:100,className:null,offset:{x:16,y:16},fixed:false},initialize:function(){var params=Array.link(arguments,{options:Object.type,elements:$defined});if(params.options&&params.options.offsets){params.options.offset=params.options.offsets}this.setOptions(params.options);this.container=new Element("div",{"class":"tip"});this.tip=this.getTip();this.isHiddenObjects=false;if(params.elements){this.attach(params.elements)}},getTip:function(){return new Element("div",{"class":this.options.className,styles:{visibility:"hidden",display:"none",position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})).inject(document.body)},attach:function(elements){var read=function(option,element){if(option==null){return""}return $type(option)=="function"?option(element):element.get(option)};$$(elements).each(function(element){var title=read(this.options.title,element);element.erase("title").store("tip:native",title).retrieve("tip:title",title);element.retrieve("tip:text",read(this.options.text,element));var events=["enter","leave"];if(!this.options.fixed){events.push("move")}events.each(function(value){element.addEvent("mouse"+value,element.retrieve("tip:"+value,this["element"+value.capitalize()].bindWithEvent(this,element)))},this)},this);return this},detach:function(elements){$$(elements).each(function(element){["enter","leave","move"].each(function(value){element.removeEvent("mouse"+value,element.retrieve("tip:"+value)||$empty)});element.eliminate("tip:enter").eliminate("tip:leave").eliminate("tip:move");if($type(this.options.title)=="string"&&this.options.title=="title"){var original=element.retrieve("tip:native");if(original){element.set("title",original)}}},this);return this},elementEnter:function(event,element){$A(this.container.childNodes).each(Element.dispose);["title","text"].each(function(value){var content=element.retrieve("tip:"+value);if(!content){return}this[value+"Element"]=new Element("div",{"class":"tip-"+value}).inject(this.container);this.fill(this[value+"Element"],content)},this);this.timer=$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this,element);this.tip.setStyle("display","block");this.tip.setStyle("z-index","101");this.tip.setStyle("visibility","visible");this.position((!this.options.fixed)?event:{page:element.getPosition()})},elementLeave:function(event,element){$clear(this.timer);this.tip.setStyle("display","none");this.timer=this.hide.delay(this.options.hideDelay,this,element)},elementMove:function(event){this.position(event)},position:function(event){var size=window.getSize(),scroll=window.getScroll(),tip={x:this.tip.offsetWidth,y:this.tip.offsetHeight},props={x:"left",y:"top"},obj={};for(var z in props){obj[props[z]]=event.page[z]+this.options.offset[z];if((obj[props[z]]+tip[z]-scroll[z])>size[z]){obj[props[z]]=event.page[z]-this.options.offset[z]-tip[z]}}this.tip.setStyles(obj)},hideObjects:function(){if(this.isHiddenObjects===false){$$("embed").each(function(embed){embed.set("wmode","transparent")});$$("param").each(function(param){if(param.get("name")=="wmode"){param.set("value","transparent")}});var divs=$$("#skyscraper div");if($empty!=divs){divs.each(function(div){div.setStyle("zIndex",-10000)})}this.isHiddenObjects=true}},fill:function(element,contents){if(typeof contents=="string"){element.set("html",contents)}else{element.adopt(contents)}},show:function(el){this.hideObjects();this.fireEvent("show",[this.tip,el])},hide:function(el){this.fireEvent("hide",[this.tip,el])}});var Calendar=new Class({Implements:Options,options:{blocked:[],classes:[],days:[Hc.translate("Sunday"),Hc.translate("Monday"),Hc.translate("Tuesday"),Hc.translate("Wednesday"),Hc.translate("Thursday"),Hc.translate("Friday"),Hc.translate("Saturday")],direction:0,draggable:true,months:[Hc.translate("January"),Hc.translate("February"),Hc.translate("March"),Hc.translate("April"),Hc.translate("May"),Hc.translate("June"),Hc.translate("July"),Hc.translate("August"),Hc.translate("September"),Hc.translate("October"),Hc.translate("November"),Hc.translate("December")],offset:0,pad:0,tweak:{x:0,y:0}},initialize:function(obj,options){if(!obj){return false}this.firstClick=true;this.setDefaultPad=false;this.pad=14;this.defaultPad=this.pad;this.highlightChanges=true;this.setOptions(options);var keys=["calendar","prev","next","month","year","today","invalid","valid","active","hover"];var values=keys.map(function(key,i){if(this.options.classes[i]){if(this.options.classes[i].length){key=this.options.classes[i]}}return key},this);this.classes=values.associate(keys);this.calendars=[];var id=0;var d=new Date();d.setDate(d.getDate()+this.options.direction.toInt());for(var i in obj){var button=$(i).getElementsByTagName("button")[0];var inputs=$(i).getElementsByTagName("input");var monthInput=$(i).getElement(".calendarMonthInput");var monthSelect=$(i).getElement(".calendarMonthLayer");var calendar=$(i).getElement(".calendar-pane");var calendarDays=$(i).getElement(".calendar-days");var cal={button:$(button),isContent:false,monthInput:$(monthInput),monthSelect:$(monthSelect),calendar:$(calendar),calendarDays:$(calendarDays),inputValue:inputs[1],el:inputs[0],els:[],id:id++,month:d.getMonth(),visible:false,year:d.getFullYear(),initialValue:inputs[0].value,onChange:$empty,monthDropdownInitialized:false};Hc.Calendar.setOptions(cal,this,$(i));var parent=monthSelect.getParent();if(parent){parent.addEvent("click",function(){Hc.Calendar.Holidayform.close()})}if($(cal.el).hasClass("changed")){this.highlightChanges=false}if(!this.element(inputs[0],obj[i],cal)){continue}cal.button.addEvent("click",function(cal){this.toggle(cal)}.pass(cal,this));cal.el.addEvent("click",function(cal){this.toggle(cal)}.pass(cal,this));cal.val=this.read(cal);for(var l=0;l<this.calendars.length;l++){var pad=Math.floor((cal.val-this.calendars[l].val)/1000/60/60/24);if(pad<this.defaultPad){this.defaultPad=pad;this.setDefaultPad=true}}this.calendars.push(cal)}this.calendars.each(function(cal){$extend(cal,this.bounds(cal));$extend(cal,this.values(cal));if(2==this.options.direction){cal.monthSelect.getElements(".calendarOption").each(function(ele){var date=ele.getAttribute("value").split("/");var date=new Date(date[0],date[1]);var start=new Date(cal.start.getFullYear(),cal.start.getMonth());var end=new Date(cal.end.getFullYear(),cal.end.getMonth());if(date<start||date>end){ele.destroy()}})}}.bind(this))},blocked:function(cal){var blocked=[];var offset=new Date(cal.year,cal.month,1).getDay();var last=new Date(cal.year,cal.month+1,0).getDate();this.options.blocked.each(function(date){var values=date.split(" ");for(var i=0;i<=3;i++){if(!values[i]){values[i]=(i==3)?"":"*"}values[i]=values[i].contains(",")?values[i].split(","):new Array(values[i]);var count=values[i].length-1;for(var j=count;j>=0;j--){if(values[i][j].contains("-")){var val=values[i][j].split("-");for(var k=val[0];k<=val[1];k++){if(!values[i].contains(k)){values[i].push(k+"")}}values[i].splice(j,1)}}}if(values[2].contains(cal.year+"")||values[2].contains("*")){if(values[1].contains(cal.month+1+"")||values[1].contains("*")){values[0].each(function(val){if(val>0){blocked.push(val.toInt())}});if(values[3]){for(var i=0;i<last;i++){var day=(i+offset)%7;if(values[3].contains(day+"")){blocked.push(i+1)}}}}}},this);return blocked},bounds:function(cal){if(2==this.options.direction){if($defined(cal.start)&&$defined(cal.end)){var arr=this.unformat(cal.start,"Y-m-d");var start=new Date(arr[0],arr[1],arr[2]);arr=this.unformat(cal.end,"Y-m-d");var end=new Date(arr[0],arr[1],arr[2]);return{start:start,end:end}}var start=this.calendars[0].val;var end=this.calendars[this.calendars.length-1].val;return{start:start,end:end}}var start=new Date(1000,0,1);var end=new Date(2999,11,31);var date=new Date().getDate()+this.options.direction.toInt();if(this.options.direction>0){start=new Date();start.setDate(date+this.options.pad*cal.id)}if(this.options.direction<0){end=new Date();end.setDate(date-this.options.pad*(this.calendars.length-cal.id-1))}return{start:start,end:end}},caption:function(cal){cal.prev=$(cal.calendar.getElements(".prev")[0]);cal.next=$(cal.calendar.getElements(".next")[0]);cal.prev.addEvent("click",function(cal){this.navigate(cal,-1)}.pass(cal,this));cal.next.addEvent("click",function(cal){this.navigate(cal,1)}.pass(cal,this));this.fnSelect=function(e,kal){e.stop();var selectValue=e.target.getAttribute("value").split("/");kal.year=selectValue[0].toInt();kal.month=selectValue[1].toInt();this.selectDate(cal,e.target);if($empty!=cal.monthSelect){cal.monthSelect.hide()}this.navigate(kal,0)}.create({"arguments":[cal],bind:this,event:true});if($empty!=cal.monthSelect){this.createMonthDropDown(cal);cal.monthSelect.getChildren().each(function(ele){ele.addEvent("click",this.fnSelect)}.bind(this))}},selectDate:function(cal,element){cal.monthInput.innerHTML=this.options.months[cal.month]+" "+cal.year;if($empty==cal.monthSelect){return}cal.monthSelect.getChildren().each(function(ele){ele.removeClass("calendarSelectedOption")});if($chk(element)){element.addClass("calendarSelectedOption")}else{cal.monthSelect.getChildren().each(function(ele){if(cal.year+"/"+cal.month==ele.getAttribute("value")){ele.addClass("calendarSelectedOption")}})}},changed:function(cal){cal.val=this.read(cal);$extend(cal,this.values(cal));if(!cal.val){return}if(cal.val.getDate()<cal.days[0]){cal.val.setDate(cal.days[0])}if(cal.val.getDate()>cal.days.getLast()){cal.val.setDate(cal.days.getLast())}cal.els.each(function(el){el.value=this.format(cal.val,el.format)},this);this.check(cal);this.calendars.each(function(kal){if(kal.visible){this.display(kal)}},this)},check:function(cal){this.calendars.each(function(kal,i){if(kal.val){var change=false;if(i<cal.id){var bound=new Date(Date.parse(cal.val));bound.setDate(bound.getDate()-(this.options.pad*(cal.id-i)));if(bound<kal.val){change=true}}if(i>cal.id){var bound=new Date(Date.parse(cal.val));bound.setDate(bound.getDate()+(this.options.pad*(i-cal.id)));if(bound>kal.val){this.setDefaultPad=true;change=true}}if(change){if(kal.start>bound){bound=kal.start}if(kal.end<bound){bound=kal.end}kal.month=bound.getMonth();kal.year=bound.getFullYear();$extend(kal,this.values(kal));kal.val=kal.days.contains(bound.getDate())?bound:null;this.write(kal);if(kal.visible){this.display(kal)}}}else{kal.month=cal.month;kal.year=cal.year}},this)},clicked:function(td,day,cal){cal.val=new Date(cal.year,cal.month,day);this.write(cal);if($empty!=cal.onChange){cal.onChange();return}if(!cal.val){cal.val=this.read(cal)}if(cal.val){this.check(cal);this.toggle(cal)}else{td.addClass(this.classes.valid);td.removeClass(this.classes.active)}if((this.firstClick||this.setDefaultPad)&&0==cal.id){var previousDate=cal.val;this.calendars.each(function(kal){if(0<kal.id){var d=new Date(previousDate);if(this.firstClick){var pad=this.pad}if(this.setDefaultPad){pad=this.defaultPad}kal.val=new Date(d.setDate(d.getDate()+pad));kal.month=kal.val.getMonth();kal.year=kal.val.getFullYear();this.write(kal)}}.bind(this))}this.firstClick=false;this.setDefaultPad=false},display:function(cal){cal.calendarDays.innerHTML="";var tr=new Element("div",{"class":"week"}).injectInside(cal.calendarDays);var d=new Date(cal.year,cal.month,1);var offset=((d.getDay()-this.options.offset)+7)%7;var last=new Date(cal.year,cal.month+1,0).getDate();var prev=new Date(cal.year,cal.month,0).getDate();var active=cal.val;var valid=cal.days;var invalid=[];this.calendars.each(function(kal,i){if(kal!=cal&&kal.val){if(cal.val){for(var day=1;day<=last;day++){d.setDate(day);if(1==this.options.direction&&i<cal.id&&d<kal.val){if(valid.contains(day)){valid.erase(day)}}}}}},this);var d=new Date();var today=new Date(d.getFullYear(),d.getMonth(),d.getDate()).getTime();for(var i=1;i<43;i++){if((i-1)%7==0){tr=new Element("div",{"class":"week"}).injectInside(cal.calendarDays)}var td=new Element("span").injectInside(tr);var day=i-offset;var date=new Date(cal.year,cal.month,day);var cls="";if(active.getTime()==date.getTime()){cls=this.classes.active}else{if(valid.contains(day)){cls=this.classes.valid}else{if((day>=1&&day<=last)||2==this.options.direction||(0>(date-today))){invalid.push(day);cls=this.classes.invalid;if(date.getMonth()<cal.month){cls+=" invalidMonth"}}}}if(date.getTime()==today){cls=cls+" "+this.classes.today}if(0==date.getDay()||6==date.getDay()){if(-1==cls.indexOf("invalid")){cls+=" weekend"}else{cls+=" invalidWeekend"}}td.addClass(cls);if(!invalid.contains(day)){td.addEvent("click",function(td,day,cal){this.clicked(td,day,cal)}.pass([td,day,cal],this))}td.addEvents({mouseover:function(td,cls){td.addClass(cls)}.pass([td,this.classes.hover]),mouseout:function(td,cls){td.removeClass(cls)}.pass([td,this.classes.hover])});if(day<1){day=prev+day}else{if(day>last){day=day-last}}td.appendText(day)}cal.prev.setStyle("visibility","visible");cal.next.setStyle("visibility","visible");if(cal.isContent!==true&&$empty!=cal.monthSelect){var dateCurr=new Date(cal.year,cal.month,1);var selectFirst=cal.monthSelect.getFirst().getAttribute("value").split("/");var dateFirst=new Date(selectFirst[0].toInt(),selectFirst[1].toInt(),1);var selectLast=cal.monthSelect.getLast().getAttribute("value").split("/");var dateLast=new Date(selectLast[0].toInt(),selectLast[1].toInt(),1);if(dateCurr.getTime()<=dateFirst.getTime()){cal.prev.setStyle("visibility","hidden")}if(dateCurr.getTime()>=dateLast.getTime()){cal.next.setStyle("visibility","hidden")}}},element:function(el,f,cal){if($type(f)=="object"){for(var i in f){if(!this.element(i,f[i],cal)){return false}}return true}el=$(el);if(!el){return false}el.format=f;el.readOnly=true;cal.els.push(el);return true},format:function(date,format){var str="";if(date){var j=date.getDate();var w=date.getDay();var l=this.options.days[w];var n=date.getMonth()+1;var f=this.options.months[n-1];var y=date.getFullYear()+"";for(var i=0,len=format.length;i<len;i++){var cha=format.charAt(i);switch(cha){case"y":y=y.substr(2);case"Y":str+=y;break;case"m":if(n<10){n="0"+n}case"n":str+=n;break;case"M":f=f.substr(0,3);case"F":str+=f;break;case"d":if(j<10){j="0"+j}case"j":str+=j;break;case"D":l=l.substr(0,2);case"l":str+=l;break;case"N":w+=1;case"w":str+=w;break;case"S":if(j%10==1&&j!="11"){str+="st"}else{if(j%10==2&&j!="12"){str+="nd"}else{if(j%10==3&&j!="13"){str+="rd"}else{str+="th"}}}break;default:str+=cha}}}return str},navigate:function(cal,n){if($defined(n)){var month=cal.month+n;var year=cal.year;if(0>month){month=11;year--}else{if(12==month){month=0;year++}}cal.month=month;cal.year=year;$extend(cal,this.values(cal))}if($type(cal.months)=="array"){var i=cal.months.indexOf(cal.month);if(i<0){cal.month=cal.months[0]}}this.selectDate(cal);this.display(cal)},read:function(cal){var arr=[null,null,null];cal.els.each(function(el){var values=this.unformat(cal.inputValue.value,"d.m.Y");values.each(function(val,i){if($type(val)=="number"){arr[i]=val}})},this);if($type(arr[0])=="number"){cal.year=arr[0]}if($type(arr[1])=="number"){cal.month=arr[1]}var val=null;if(arr.every(function(i){return $type(i)=="number"})){var last=new Date(arr[0],arr[1]+1,0).getDate();if(arr[2]>last){arr[2]=last}val=new Date(arr[0],arr[1],arr[2])}return val},sort:function(a,b){return a-b},toggle:function(cal){document.removeEvent("mousedown",this.fn);cal.el.blur();Hc.Calendar.Holidayform.close();if(cal.visible){Hc.Calendar.Holidayform.doNotOpen=true;cal.visible=false;cal.button.removeClass(this.classes.active);if($empty!=cal.monthSelect){cal.monthSelect.hide()}cal.calendar.toggle();IE6_overlay_fix.hide(cal.calendar)}else{if(!cal.monthDropdownInitialized){this.caption(cal);cal.monthDropdownInitialized=true}Hc.Calendar.Holidayform.doNotOpen=false;this.fn=function(e,cal){var e=new Event(e);var el=e.target;var stop=false;while(el!=document.body&&el.nodeType==1){if(el==cal.calendar){stop=true}if("holidaycalendar"==el.id){stop=true}this.calendars.each(function(kal){if(kal.button==el||kal.els.contains(el)){stop=true}});if(stop){e.stop();return false}else{el=el.parentNode}}this.toggle(cal)}.create({"arguments":cal,bind:this,event:true});document.addEvent("mousedown",this.fn);this.calendars.each(function(kal,i){if(kal==cal){kal.visible=true;kal.button.addClass(this.classes.active)}else{if(kal.visible){kal.visible=false;kal.button.removeClass(this.classes.active);kal.calendar.toggle();IE6_overlay_fix.hide(cal.calendar)}}},this);var dateSplit=cal.inputValue.value.split(".");cal.month=dateSplit[1]-1;cal.year=dateSplit[2];this.selectDate(cal);$extend(cal,this.values(cal));this.display(cal);cal.calendar.toggle();IE6_overlay_fix.show(cal.calendar)}},unformat:function(val,f){f=f.escapeRegExp();var re={d:"([0-9]{2})",j:"([0-9]{1,2})",D:"("+this.options.days.map(function(day){return day.substr(0,2)}).join("|")+")",l:"("+this.options.days.join("|")+")",S:"(st|nd|rd|th)",F:"("+this.options.months.join("|")+")",m:"([0-9]{2})",M:"("+this.options.months.map(function(month){return month.substr(0,3)}).join("|")+")",n:"([0-9]{1,2})",Y:"([0-9]{4})",y:"([0-9]{2})"};var arr=[];var g="";for(var i=0;i<f.length;i++){var c=f.charAt(i);if(re[c]){arr.push(c);g+=re[c]}else{g+=c}}var matches=val.match("^"+g+"$");var dates=new Array(3);if(matches){matches=matches.slice(1);arr.each(function(c,i){i=matches[i];switch(c){case"y":i="19"+i;case"Y":dates[0]=i.toInt();break;case"F":i=i.substr(0,3);case"M":i=this.options.months.map(function(month){return month.substr(0,3)}).indexOf(i)+1;case"m":case"n":dates[1]=i.toInt()-1;break;case"d":case"j":dates[2]=i.toInt();break}},this)}return dates},value:function(cal){var day=null;if(cal.val){if(cal.year==cal.val.getFullYear()&&cal.month==cal.val.getMonth()){day=cal.val.getDate()}}return day},values:function(cal){var years,months,days;var first=1;var last=new Date(cal.year,cal.month+1,0).getDate();if(cal.year==cal.start.getFullYear()){if(months==null&&this.options.navigation==2){months=[];for(var i=0;i<12;i++){if(i>=cal.start.getMonth()){months.push(i)}}}if(cal.month==cal.start.getMonth()){first=cal.start.getDate()}}if(cal.year==cal.end.getFullYear()){if(months==null&&this.options.navigation==2){months=[];for(var i=0;i<12;i++){if(i<=cal.end.getMonth()){months.push(i)}}}if(cal.month==cal.end.getMonth()){last=cal.end.getDate()}}var blocked=this.blocked(cal);if($type(days)=="array"){days=days.filter(function(day){if(day>=first&&day<=last&&!blocked.contains(day)){return day}})}else{days=[];for(var i=first;i<=last;i++){if(!blocked.contains(i)){days.push(i)}}}days.sort(this.sort);return{days:days,months:months,years:years}},write:function(cal){cal.el.value=this.format(cal.val,cal.el.format);cal.inputValue.value=this.format(cal.val,"d.m.Y");if(this.highlightChanges){if(cal.el.value!=cal.initialValue){cal.el.addClass("changed")}else{cal.el.removeClass("changed")}}this.selectDate(cal)},createMonthDropDown:function(cal){var d=new Date();var ele=cal.monthSelect;var allMonths=this.options.months;var currentMonth=d.getMonth();var currentYear=d.getFullYear();for(var i=0;i<15;i++){if(currentMonth>11){currentMonth=0;currentYear++}var a=new Element("a",{"class":"calendarOption",href:"javascript:void(0)"});if(cal.inputValue.value.split(".")[1]-1==currentMonth&&cal.inputValue.value.split(".")[2]==currentYear){a.addClass("calendarSelectedOption")}a.innerHTML=allMonths[currentMonth]+" "+currentYear;a.setAttribute("value",currentYear+"/"+currentMonth);ele.appendChild(a);currentMonth++}}});Calendar.implement(new Events,new Options);var Hc=Hc||{};Hc.global=this;Hc.register=function(namespace){var parts=namespace.split(".");var cur=Hc.global;if(!(parts[0] in cur)&&cur.execScript){cur.execScript("var "+parts[0])}for(var part;parts.length&&(part=parts.shift());){if(cur[part]){cur=cur[part]}else{cur=cur[part]={}}}};Hc.registerElement=function(element){element=$(element);if(!element){return}if(element.hasClass("jsInputLayer")||element.hasClass("jsLayer")||element.hasClass("jsSuggestSearch")){var baseId=element.id.replace("Layer",""),closeLayerCallback=function(event){var target=$(event.target);if((element.hasClass("jsInputLayer")&&!target.getParent("#formElementLine_"+baseId))||(element.hasClass("jsLayer")&&!target.getParent("#"+baseId))||(element.hasClass("jsSuggestSearch")&&!target.getParent(".input"))){element.toggleOff()}};if(element.hasClass("jsInputLayer")){element.addEvent("toggleOff",function(){checkLayerChangingInline(baseId)})}element.addEvent("toggleOn",function(){$(document.body).addEvent("click",closeLayerCallback)});element.addEvent("toggleOff",function(){$(document.body).removeEvent("click",closeLayerCallback)})}if(element.hasClass("jsToggler")){handle=$(element.id+"TogglerHandleOn");if(handle){handle.addEvent("click",function(){element.toggleOn()})}handle=$(element.id+"TogglerHandleOff");if(handle){handle.addEvent("click",function(){element.toggleOff()})}handle=$(element.id+"TogglerHandle");if(handle){handle.addEvent("click",function(){element.toggleOnOff()})}}if(element.hasClass("jsCharacterCounter")){new Hc.CharacterCounter(element)}if(element.hasClass("jsInputLayer")){element.addEvent("toggleOn",function(){IE6_overlay_fix.show(element)});element.addEvent("toggleOff",function(){IE6_overlay_fix.hide()})}else{if(element.hasClass("jsLayer")){element.addEvent("toggleOn",function(){IE6_overlay_fix.show(element)});element.addEvent("toggleOff",function(){IE6_overlay_fix.hide()})}}};Element.implement({toggleOn:function(){var handleOn=$(this.id+"TogglerHandleOn"),handleOff;if(this.hasClass("jsEffectTween")){Hc.Effect.tween(this,"open","jsTogglerClosed")}else{Hc.Effect.none(this,"open","jsTogglerClosed")}if(handleOn){handleOn.addClass("jsTogglerHandleClosed");handleOff=$(this.id+"TogglerHandleOff");if(handleOff){handleOff.removeClass("jsTogglerHandleClosed")}}this.fireEvent("toggleOn",arguments)},toggleOff:function(){var handleOn,handleOff=$(this.id+"TogglerHandleOff");if(this.hasClass("jsEffectTween")){Hc.Effect.tween(this,"close","jsTogglerClosed")}else{Hc.Effect.none(this,"close","jsTogglerClosed")}if(handleOff){handleOff.addClass("jsTogglerHandleClosed");handleOn=$(this.id+"TogglerHandleOn");if(handleOn){handleOn.removeClass("jsTogglerHandleClosed")}}this.fireEvent("toggleOff",arguments)},toggleOnOff:function(){if(this.hasClass("jsTogglerClosed")){this.toggleOn($A(arguments).join(","))}else{this.toggleOff($A(arguments).join(","))}}});Hc.register("Hc.Effect");Hc.Effect.none=function(element,openClose,className){if("open"==openClose){element.removeClass(className)}else{if("close"==openClose){element.addClass(className)}}};Hc.Effect.tween=function(element,openClose,className){if("open"==openClose){element.setStyle("display","none");element.removeClass(className);element.reveal({fps:50})}else{if("close"==openClose){element.dissolve({fps:50,onComplete:function(){element.addClass(className)}})}}};Element.implement({render:function(texts){this.set("html",this.get("html").substitute(texts,/\\?\{+([^{}]+)\}+/g))}});Hc.render=function(template,texts,keepId){if(!$chk(keepId)){keepId=false}keepId=Boolean(keepId);var clone=template.clone(true,keepId);clone.render(texts);return clone};Hc.register("Hc.Html5test.input");Hc.Html5test.fakeInput=new Element("input");"autocomplete autofocus list placeholder max min multiple pattern required step".split(" ").each(function(attribute){Hc.Html5test.input[attribute]=!!(attribute in Hc.Html5test.fakeInput)});delete (Hc.Html5test.fakeInput);Element.implement({enablePlaceholder:function(){if(Hc.Html5test.input.placeholder){return}if("input"!=this.get("tag")){return}var placeholder=this.get("placeholder");if(!placeholder){return}if(""===this.value.trim()){this.value=placeholder.trim()}this.addEvent("focus",function(){if(placeholder==this.value.trim()){this.value=""}}.bind(this));this.addEvent("blur",function(){if(""===this.value.trim()){this.value=placeholder}}.bind(this))}});Hc.log=function(message){if(Hc.debug){try{console.log(message)}catch(exception){}}};heatmapCount=function(url){function heatmapCountOnClick(e){r=Math.random();if(r>0.01){return true}if(!e){e=window.event;correction=1}else{correction=0}x=e.clientX+document.documentElement.scrollLeft-correction;y=e.clientY+document.documentElement.scrollTop-correction;if(x<0){x=0}if(y<0){y=0}var request=new Request({method:"get",url:url+"&x="+x+"&y="+y});request.send();return true}document.onclick=heatmapCountOnClick};gaOnClickLinkName=function(link){var name="";var node=link;while(node){if(node.id){forbiddenId=node.id.match(/travelOfferList|Tooltip|blockDetails|Travel_|check_|vacancy_|offer_/);if(!forbiddenId){pagination=node.id.match(/_Pagination_/);if(pagination){linkNameParts=node.id.split("_Pagination_");name="/"+linkNameParts[0]+"_Pagination_1/A.1";break}list=node.id.match(/_List_/);if(list){linkNameParts=node.id.split("_List_");nummer=linkNameParts[1];if(nummer>3){nummer=3}name="/"+linkNameParts[0]+"_List_"+nummer+name;break}name="/"+node.id+name;break}}name="/"+getNodeIdentification(node)+name;node=node.parentNode}return name};getNodeIdentification=function(node){var number=1;var sibling=node;var nodeName=node.nodeName;while(sibling.previousSibling){sibling=sibling.previousSibling;if(sibling.nodeName==nodeName){number++}}if(number>15){number=15}return nodeName+"."+number};var analyticsUdn=null;var analyticsAccount=null;var analyticsOnClickUdn=null;var analyticsOnClickAccount=null;var controllerAction=null;var analyticsTrans=false;var utmOrderId=null;var utmOrderSum=null;var utmCountry=null;var utmHotelId=null;var utmHotelName=null;var utmCategory=null;var utmParticipants=null;var searchQuery=null;var abTestVersionString=null;var analyticsCustomVars=new Array();function gaSetTransVars(utmOrderIdValue,utmOrderSumValue,utmCountryValue,utmHotelIdValue,utmHotelNameValue,utmCategoryValue,utmParticipantsValue){analyticsTrans=true;utmOrderId=utmOrderIdValue;utmOrderSum=utmOrderSumValue;utmCountry=utmCountryValue;utmHotelId=utmHotelIdValue;utmHotelName=utmHotelNameValue;utmCategory=utmCategoryValue;utmParticipants=utmParticipantsValue}function gaSetVars(analyticsUdnValue,analyticsAccountValue,analyticsOnClickUdnValue,analyticsOnClickAccountValue,controllerValue,actionValue,searchQueryValue,searchQueryTypeValue,testIdValue,testVariationValue,abTestVersion){analyticsUdn=analyticsUdnValue;analyticsAccount=analyticsAccountValue;analyticsOnClickUdn=analyticsOnClickUdnValue;analyticsOnClickAccount=analyticsOnClickAccountValue;controllerAction="/"+controllerValue+"/"+actionValue;searchQuery="";if(""!=searchQueryValue){searchQuery="?searchQuery="+searchQueryValue;searchQuery+="&searchQueryType="+searchQueryTypeValue}if(testIdValue&&testIdValue!=""&&testVariationValue!=""){if(searchQuery==""){searchQuery="?"}else{searchQuery+="&"}searchQuery+="testId="+testIdValue+"&testVar="+testVariationValue}if(abTestVersion!=""){abTestVersionString=abTestVersion}}function gaSetCustomVar(slot,name,value,scope){analyticsCustomVars.push({slot:slot,name:name,value:value,scope:scope})}function _gaSetCustomVars(pageTracker){try{analyticsCustomVars.each(function(data){pageTracker._setCustomVar(data.slot,data.name,data.value,data.scope)})}catch(err){}}function gaPageCount(){if(controllerAction!=null&&controllerAction.indexOf("Bouncersurvey")>=0){return}try{var pageTracker=_gat._getTracker(analyticsAccount);_gaSetCustomVars(pageTracker);pageTracker._setDomainName(analyticsUdn);pageTracker._setDetectTitle(false);pageTracker._trackPageview(controllerAction+searchQuery);pageTracker._setVar(abTestVersionString);if(analyticsTrans){pageTracker._addTrans(utmOrderId,"Hc-Buchung",utmOrderSum,"0.00","0.00","","",utmCountry);pageTracker._addItem(utmOrderId,utmHotelId,utmHotelName,utmCategory,utmOrderSum/utmParticipants,utmParticipants);pageTracker._trackTrans()}}catch(err){}}function gaABTestFooter(analyticsAccountABTest,pageABTest){try{var gwoTracker=_gat._getTracker(analyticsAccountABTest);gwoTracker._setDomainName(analyticsUdn);gwoTracker._setDetectTitle(false);gwoTracker._trackPageview(pageABTest)}catch(err){}}function gaOnclickCountName(name){gaOnclickCountPage("/"+name)}function gaOnclickCount(node){try{gaOnclickCountPage(gaOnClickLinkName(node))}catch(err){}}function gaOnclickCountPage(page){try{var pageTracker=_gat._getTracker(analyticsOnClickAccount);pageTracker._setDomainName(analyticsOnClickUdn);pageTracker._setDetectTitle(false);pageTracker._trackPageview(controllerAction+page)}catch(err){}}function gaTrackEvent(category,action,optional_label,optional_value){try{if(!optional_label){optional_label=controllerAction}var pageTracker=_gat._getTracker(analyticsAccount);pageTracker._initData();pageTracker._trackEvent(category,action,optional_label,optional_value)}catch(err){}}function trackGoogleConversion(conversionElementId,conversionId,conversionLanguage,conversionLabel){var element=document.createElement("img");element.setAttribute("height","1");element.setAttribute("width","1");element.setAttribute("border","0");element.setAttribute("src","https://www.googleadservices.com/pagead/conversion/"+conversionId+"/?label="+conversionLabel+"&script=0");document.body.appendChild(element)}initSkyscraper=function(){try{skyfill()}catch(err){}};reloadPage=function(relativeUrl){window.location.href=relativeUrl};showPopUp=function(relativeUrl,name,width,height){var popUpParamString;switch(name){case"mhcprofile":width=820;height=600;break;case"contentlightbox":width=680;height=600;break;case"flighttimelightbox":width=800;height=650;break;case"organizerlightbox":width=800;height=250;break;case"traveltainmenthotelinfo":width=800;height=600;break;case"traveltainmentlegalterms":width=520;height=500;break;case"gmhoteldetaillightbox":width=905;height=650;break;case"travelcontentlightbox":width=660;height=600;break;case"holidayautosagbusadistancespopup":width=1200;height=500;break;case"forumcomposepostpopup":width=650;height=500;break;case"forumcomposetopicpopup":width=650;height=530;break;case"forumpostactionpopup":width=530;height=530;break;case"tuevhoteldetaillightbox":width=1000;height=650;break}if(!$defined(width)){width=650}if(!$defined(height)){height=500}popUpParamString="menubar=0,location=0,toolbar=0,status=0,resizable=0,dependent=1,scrollbars=yes,height="+height+",width="+width+";";var popup=window.open(relativeUrl,name,popUpParamString);popup.focus()};reloadPopUpParent=function(){if(opener){opener.location.reload()}};forwardPopUpParentLink=function(url){opener.location.href=url;self.close()};forwardPopUpParentLinkWithoutClosing=function(url){opener.location.href=url;event.returnValue=false;return false};focusHotelInformation=function(value){var newsElement=$("hotelInfosContent_1");var switchingDiv=null;var activeClass="hotelInfosNavigationInner";var inactiveClass="hotelInfosNavigationInaktive";if(null!=newsElement){newsElement.setStyle("display","none");var newsInputElement=$("hotelNewsInput");var newsInputLabel=$("hotelNewsLabel");newsInputElement.checked="";switchingDiv=newsInputElement.parentNode.parentNode;switchingDiv.className=activeClass+" "+inactiveClass;if(value==1){newsElement.setStyle("display","block");newsInputElement.checked="checked";newsInputLabel.addClass("labelActive");switchingDiv.className=activeClass}else{newsInputLabel.removeClass("labelActive")}}var profileElement=$("hotelInfosContent_2");if(null!=profileElement){profileElement.setStyle("display","none");var profileInputElement=$("hotelProfileInput");var profileInputLabel=$("hotelProfileLabel");profileInputElement.checked="";switchingDiv=profileInputElement.parentNode.parentNode;switchingDiv.className=activeClass+" "+inactiveClass;if(value==2){profileElement.setStyle("display","block");profileInputElement.checked="checked";profileInputLabel.addClass("labelActive");switchingDiv.className=activeClass}else{profileInputLabel.removeClass("labelActive")}}var benefitElement=$("hotelInfosContent_3");if(null!=benefitElement){benefitElement.setStyle("display","none");var benefitInputElement=$("hotelBenefitInput");var benefitInputLabel=$("hotelBenefitLabel");benefitInputElement.checked="";switchingDiv=benefitInputElement.parentNode.parentNode;switchingDiv.className=activeClass+" "+inactiveClass;if(value==3){benefitElement.setStyle("display","block");benefitInputElement.checked="checked";benefitInputLabel.addClass("labelActive");switchingDiv.className=activeClass}else{benefitInputLabel.removeClass("labelActive")}}};generatePageId=function(ajaxUrl,tempId,url){showLoadingAnimation();var htmlRequest=new Request.HTML({method:"post",url:ajaxUrl,data:{tempId:tempId,url:url},onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){hideLoadingAnimation();pageId=$("pageID");pageId.innerHTML=responseHTML;pageId.setStyle("backgroundImage","none");pageId.setStyle("fontWeight","bold")},onFailure:function(xhr){hideLoadingAnimation()}});htmlRequest.send()};addCustomParamToFormForAjax=function(form,paramName,paramValue){var elementAlreadyExists=false;form.getElements("input[name="+paramName+"]").each(function(item,index){elementAlreadyExists=true;item.value=paramValue});if(elementAlreadyExists==false){var element=document.createElement("input");element.name=paramName;element.value=paramValue;element.style.display="none";form.appendChild(element)}};var openxOnClickCount=function(onclickparam){var image=new Element("img",{width:"1px",height:"1px",border:"0px",src:"http://banner.holidaycheck.de/www/delivery/ck.php?oaparams="+onclickparam});document.body.appendChild(image)};IE6_overlay_fix=function(){};IE6_overlay_fix.sublayer=false;IE6_overlay_fix.show=function(element){if(!element){return}if(!("trident"==Browser.Engine.name&&4==Browser.Engine.version)){return}if(0==document.getElementsByTagName("select").length){return}var fix=$("productsearch_ie6_overlay_fix");if("block"==fix.getStyle("display")){IE6_overlay_fix.sublayer=true;return}var size=element.getDimensions();var width=size.width;var height=size.height;var top=element.getStyle("top");var left=element.getStyle("left");if("partnerAdAdditionalAffiliatebanner"==element.id){var coordinates=element.getCoordinates();top=coordinates.top+"px";left=coordinates.left+"px"}if(element.hasClass("calendar-pane")){width+=5;height+=5}fix.setStyles({width:width+"px",height:height+"px",top:top,left:left,display:"block"});fix.inject(element,"after")};IE6_overlay_fix.hide=function(element){if(!(Browser.Engine.name=="trident"&&Browser.Engine.version==4)){return}if(0==document.getElementsByTagName("select").length){return}if(true==IE6_overlay_fix.sublayer){IE6_overlay_fix.sublayer=false;return}$("productsearch_ie6_overlay_fix").inject(document.body,"bottom");$("productsearch_ie6_overlay_fix").setStyle("display","none")};showLoadingAnimation=function(){$("globalSpinnerLayer").className="displayBlock";$("globalSpinner").className="displayBlock"};hideLoadingAnimation=function(){$("globalSpinnerLayer").className="displayNone";$("globalSpinner").className="displayNone"};var DD_roundies={ns:"DD_roundies",IE6:false,IE7:false,IE8:false,IEversion:function(){if(document.documentMode!=8&&document.namespaces&&!document.namespaces[this.ns]){this.IE6=true;this.IE7=true}else{if(document.documentMode==8){this.IE8=true}}},querySelector:document.querySelectorAll,selectorsToProcess:[],imgSize:{},createVmlNameSpace:function(){if(this.IE6||this.IE7){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}if(this.IE8){document.writeln('<?import namespace="'+this.ns+'" implementation="#default#VML" ?>')}},createVmlStyleSheet:function(){var style=document.createElement("style");document.documentElement.firstChild.insertBefore(style,document.documentElement.firstChild.firstChild);if(style.styleSheet){try{var styleSheet=style.styleSheet;styleSheet.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");this.styleSheet=styleSheet}catch(err){}}else{this.styleSheet=style}},addRule:function(selector,rad,standards){if(typeof rad=="undefined"||rad===null){rad=0}if(rad.constructor.toString().search("Array")==-1){rad=rad.toString().replace(/[^0-9 ]/g,"").split(" ")}for(var i=0;i<4;i++){rad[i]=(!rad[i]&&rad[i]!==0)?rad[Math.max((i-2),0)]:rad[i]}if(this.styleSheet){if(this.styleSheet.addRule){var selectors=selector.split(",");for(var i=0;i<selectors.length;i++){this.styleSheet.addRule(selectors[i],"behavior:expression(DD_roundies.roundify.call(this, ["+rad.join(",")+"]))")}}else{if(standards){var moz_implementation=rad.join("px ")+"px";this.styleSheet.appendChild(document.createTextNode(selector+" {border-radius:"+moz_implementation+"; -moz-border-radius:"+moz_implementation+";}"));this.styleSheet.appendChild(document.createTextNode(selector+" {-webkit-border-top-left-radius:"+rad[0]+"px "+rad[0]+"px; -webkit-border-top-right-radius:"+rad[1]+"px "+rad[1]+"px; -webkit-border-bottom-right-radius:"+rad[2]+"px "+rad[2]+"px; -webkit-border-bottom-left-radius:"+rad[3]+"px "+rad[3]+"px;}"))}}}else{if(this.IE8){this.selectorsToProcess.push({selector:selector,radii:rad})}}},readPropertyChanges:function(el){switch(event.propertyName){case"style.border":case"style.borderWidth":case"style.padding":this.applyVML(el);break;case"style.borderColor":this.vmlStrokeColor(el);break;case"style.backgroundColor":case"style.backgroundPosition":case"style.backgroundRepeat":this.applyVML(el);break;case"style.display":el.vmlBox.style.display=(el.style.display=="none")?"none":"block";break;case"style.filter":this.vmlOpacity(el);break;case"style.zIndex":el.vmlBox.style.zIndex=el.style.zIndex;break}},applyVML:function(el){el.runtimeStyle.cssText="";this.vmlFill(el);this.vmlStrokeColor(el);this.vmlStrokeWeight(el);this.vmlOffsets(el);this.vmlPath(el);this.nixBorder(el);this.vmlOpacity(el)},vmlOpacity:function(el){if(el.currentStyle.filter.search("lpha")!=-1){var trans=el.currentStyle.filter;trans=parseInt(trans.substring(trans.lastIndexOf("=")+1,trans.lastIndexOf(")")),10)/100;for(var v in el.vml){el.vml[v].filler.opacity=trans}}},vmlFill:function(el){if(!el.currentStyle){return}else{var elStyle=el.currentStyle}el.runtimeStyle.backgroundColor="";el.runtimeStyle.backgroundImage="";var noColor=(elStyle.backgroundColor=="transparent");var noImg=true;if(elStyle.backgroundImage!="none"||el.isImg){if(!el.isImg){el.vmlBg=elStyle.backgroundImage;el.vmlBg=el.vmlBg.substr(5,el.vmlBg.lastIndexOf('")')-5)}else{el.vmlBg=el.src}var lib=this;if(!lib.imgSize[el.vmlBg]){var img=document.createElement("img");img.attachEvent("onload",function(){this.width=this.offsetWidth;this.height=this.offsetHeight;lib.vmlOffsets(el)});img.className=lib.ns+"_sizeFinder";img.runtimeStyle.cssText="behavior:none; position:absolute; top:-10000px; left:-10000px; border:none;";img.src=el.vmlBg;img.removeAttribute("width");img.removeAttribute("height");document.body.insertBefore(img,document.body.firstChild);lib.imgSize[el.vmlBg]=img}el.vml.image.filler.src=el.vmlBg;noImg=false}el.vml.image.filled=!noImg;el.vml.image.fillcolor="none";el.vml.color.filled=!noColor;el.vml.color.fillcolor=elStyle.backgroundColor;el.runtimeStyle.backgroundImage="none";el.runtimeStyle.backgroundColor="transparent"},vmlStrokeColor:function(el){el.vml.stroke.fillcolor=el.currentStyle.borderColor},vmlStrokeWeight:function(el){var borders=["Top","Right","Bottom","Left"];el.bW={};for(var b=0;b<4;b++){el.bW[borders[b]]=parseInt(el.currentStyle["border"+borders[b]+"Width"],10)||0}},vmlOffsets:function(el){var dims=["Left","Top","Width","Height"];for(var d=0;d<4;d++){el.dim[dims[d]]=el["offset"+dims[d]]}var assign=function(obj,topLeft){obj.style.left=(topLeft?0:el.dim.Left)+"px";obj.style.top=(topLeft?0:el.dim.Top)+"px";obj.style.width=el.dim.Width+"px";obj.style.height=el.dim.Height+"px"};for(var v in el.vml){var mult=(v=="image")?1:2;el.vml[v].coordsize=(el.dim.Width*mult)+", "+(el.dim.Height*mult);assign(el.vml[v],true)}assign(el.vmlBox,false);if(DD_roundies.IE8){el.vml.stroke.style.margin="-1px";if(typeof el.bW=="undefined"){this.vmlStrokeWeight(el)}el.vml.color.style.margin=(el.bW.Top-1)+"px "+(el.bW.Left-1)+"px"}},vmlPath:function(el){var coords=function(direction,w,h,r,aL,aT,mult){var cmd=direction?["m","qy","l","qx","l","qy","l","qx","l"]:["qx","l","qy","l","qx","l","qy","l","m"];aL*=mult;aT*=mult;w*=mult;h*=mult;var R=r.slice();for(var i=0;i<4;i++){R[i]*=mult;R[i]=Math.min(w/2,h/2,R[i])}var coords=[cmd[0]+Math.floor(0+aL)+","+Math.floor(R[0]+aT),cmd[1]+Math.floor(R[0]+aL)+","+Math.floor(0+aT),cmd[2]+Math.ceil(w-R[1]+aL)+","+Math.floor(0+aT),cmd[3]+Math.ceil(w+aL)+","+Math.floor(R[1]+aT),cmd[4]+Math.ceil(w+aL)+","+Math.ceil(h-R[2]+aT),cmd[5]+Math.ceil(w-R[2]+aL)+","+Math.ceil(h+aT),cmd[6]+Math.floor(R[3]+aL)+","+Math.ceil(h+aT),cmd[7]+Math.floor(0+aL)+","+Math.ceil(h-R[3]+aT),cmd[8]+Math.floor(0+aL)+","+Math.floor(R[0]+aT)];if(!direction){coords.reverse()}var path=coords.join("");return path};if(typeof el.bW=="undefined"){this.vmlStrokeWeight(el)}var bW=el.bW;var rad=el.DD_radii.slice();var outer=coords(true,el.dim.Width,el.dim.Height,rad,0,0,2);rad[0]-=Math.max(bW.Left,bW.Top);rad[1]-=Math.max(bW.Top,bW.Right);rad[2]-=Math.max(bW.Right,bW.Bottom);rad[3]-=Math.max(bW.Bottom,bW.Left);for(var i=0;i<4;i++){rad[i]=Math.max(rad[i],0)}var inner=coords(false,el.dim.Width-bW.Left-bW.Right,el.dim.Height-bW.Top-bW.Bottom,rad,bW.Left,bW.Top,2);var image=coords(true,el.dim.Width-bW.Left-bW.Right+1,el.dim.Height-bW.Top-bW.Bottom+1,rad,bW.Left,bW.Top,1);el.vml.color.path=inner;el.vml.image.path=image;el.vml.stroke.path=outer+inner;this.clipImage(el)},nixBorder:function(el){var s=el.currentStyle;var sides=["Top","Left","Right","Bottom"];for(var i=0;i<4;i++){el.runtimeStyle["padding"+sides[i]]=(parseInt(s["padding"+sides[i]],10)||0)+(parseInt(s["border"+sides[i]+"Width"],10)||0)+"px"}el.runtimeStyle.border="none"},clipImage:function(el){var lib=DD_roundies;if(!el.vmlBg||!lib.imgSize[el.vmlBg]){return}var thisStyle=el.currentStyle;var bg={X:0,Y:0};var figurePercentage=function(axis,position){var fraction=true;switch(position){case"left":case"top":bg[axis]=0;break;case"center":bg[axis]=0.5;break;case"right":case"bottom":bg[axis]=1;break;default:if(position.search("%")!=-1){bg[axis]=parseInt(position,10)*0.01}else{fraction=false}}var horz=(axis=="X");bg[axis]=Math.ceil(fraction?((el.dim[horz?"Width":"Height"]-(el.bW[horz?"Left":"Top"]+el.bW[horz?"Right":"Bottom"]))*bg[axis])-(lib.imgSize[el.vmlBg][horz?"width":"height"]*bg[axis]):parseInt(position,10));bg[axis]+=1};for(var b in bg){figurePercentage(b,thisStyle["backgroundPosition"+b])}el.vml.image.filler.position=(bg.X/(el.dim.Width-el.bW.Left-el.bW.Right+1))+","+(bg.Y/(el.dim.Height-el.bW.Top-el.bW.Bottom+1));var bgR=thisStyle.backgroundRepeat;var c={T:1,R:el.dim.Width+1,B:el.dim.Height+1,L:1};var altC={X:{b1:"L",b2:"R",d:"Width"},Y:{b1:"T",b2:"B",d:"Height"}};if(bgR!="repeat"){c={T:(bg.Y),R:(bg.X+lib.imgSize[el.vmlBg].width),B:(bg.Y+lib.imgSize[el.vmlBg].height),L:(bg.X)};if(bgR.search("repeat-")!=-1){var v=bgR.split("repeat-")[1].toUpperCase();c[altC[v].b1]=1;c[altC[v].b2]=el.dim[altC[v].d]+1}if(c.B>el.dim.Height){c.B=el.dim.Height+1}}el.vml.image.style.clip="rect("+c.T+"px "+c.R+"px "+c.B+"px "+c.L+"px)"},pseudoClass:function(el){var self=this;setTimeout(function(){self.applyVML(el)},1)},reposition:function(el){this.vmlOffsets(el);this.vmlPath(el)},roundify:function(rad){this.style.behavior="none";if(!this.currentStyle){return}else{var thisStyle=this.currentStyle}var allowed={BODY:false,TABLE:false,TR:false,TD:false,SELECT:false,OPTION:false,TEXTAREA:false};if(allowed[this.nodeName]===false){return}var self=this;var lib=DD_roundies;this.DD_radii=rad;this.dim={};var handlers={resize:"reposition",move:"reposition"};if(this.nodeName=="A"){var moreForAs={mouseleave:"pseudoClass",mouseenter:"pseudoClass",focus:"pseudoClass",blur:"pseudoClass"};for(var a in moreForAs){handlers[a]=moreForAs[a]}}for(var h in handlers){this.attachEvent("on"+h,function(){lib[handlers[h]](self)})}this.attachEvent("onpropertychange",function(){lib.readPropertyChanges(self)});var giveLayout=function(el){el.style.zoom=1;if(el.currentStyle.position=="static"){el.style.position="relative"}};giveLayout(this.offsetParent);giveLayout(this);this.vmlBox=document.createElement("ignore");this.vmlBox.runtimeStyle.cssText="behavior:none; position:absolute; margin:0; padding:0; border:0; background:none;";this.vmlBox.style.zIndex=thisStyle.zIndex;this.vml={color:true,image:true,stroke:true};for(var v in this.vml){this.vml[v]=document.createElement(lib.ns+":shape");this.vml[v].filler=document.createElement(lib.ns+":fill");this.vml[v].appendChild(this.vml[v].filler);this.vml[v].stroked=false;this.vml[v].style.position="absolute";this.vml[v].style.zIndex=thisStyle.zIndex;this.vml[v].coordorigin="1,1";this.vmlBox.appendChild(this.vml[v])}this.vml.image.fillcolor="none";this.vml.image.filler.type="tile";this.parentNode.insertBefore(this.vmlBox,this);this.isImg=false;if(this.nodeName=="IMG"){this.isImg=true;this.style.visibility="hidden"}setTimeout(function(){lib.applyVML(self)},1)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}DD_roundies.IEversion();DD_roundies.createVmlNameSpace();DD_roundies.createVmlStyleSheet();if(DD_roundies.IE8&&document.attachEvent&&DD_roundies.querySelector){document.attachEvent("onreadystatechange",function(){if(document.readyState=="complete"){var selectors=DD_roundies.selectorsToProcess;var length=selectors.length;var delayedCall=function(node,radii,index){setTimeout(function(){DD_roundies.roundify.call(node,radii)},index*100)};for(var i=0;i<length;i++){var results=document.querySelectorAll(selectors[i].selector);var rLength=results.length;for(var r=0;r<rLength;r++){if(results[r].nodeName!="INPUT"){delayedCall(results[r],selectors[i].radii,r)}}}}})};updateElementGet=function(url,id,handleType,checkLogin,redirect){if(typeof handleType=="undefined"){handleType="text"}showLoadingAnimation();if(handleType=="text"){var htmlRequest=new Request.HTML({method:"get",url:url,onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){$(id).innerHTML=responseHTML;hideLoadingAnimation()},onFailure:function(xhr){hideLoadingAnimation()}});htmlRequest.send()}else{if(handleType=="json"){var jsonRequest=new Request.JSON({method:"get",url:url,onSuccess:function(responseJSON,responseText){if(checkLogin&&responseJSON.login!="logged_in"){if(redirect){window.location.reload()}else{handleMhcAjaxLogin(responseJSON,"updateElementGet('"+url+"', '"+id+"', '"+handleType+"', "+checkLogin+");",0)}}else{$(id).innerHTML=responseJSON.content}hideLoadingAnimation()},onFailure:function(xhr){hideLoadingAnimation()}});jsonRequest.send()}}};updateElementPost=function(url,id,formId,handleType,checkLogin){var form=$(formId);if(typeof handleType=="undefined"){handleType="text"}showLoadingAnimation();if(handleType=="text"){var htmlRequest=new Request.HTML({url:url,onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){$(id).innerHTML=responseHTML;hideLoadingAnimation()},onFailure:function(xhr){hideLoadingAnimation()}});htmlRequest.post(form)}else{if(handleType=="json"){var jsonRequest=new Request.JSON({url:url,onSuccess:function(responseJSON,responseText){if(checkLogin&&responseJSON.login!="logged_in"){handleMhcAjaxLogin(responseJSON,"updateElementPost('"+url+"', '"+id+"', '"+formId+"', '"+handleType+"', "+checkLogin+");",0)}else{$(id).innerHTML=responseJSON.content}hideLoadingAnimation()},onFailure:function(xhr){hideLoadingAnimation()}});jsonRequest.post(form)}}};scrollSmooth=function(aname){var anchor=$(document.body).getElement("a[name="+aname+"]");if($defined(anchor)){var fxScroll=new Fx.Scroll(window,{offset:{x:-1000,y:0}});fxScroll.toElement(anchor)}};var toggleRunning=false;toggling=function(idElement,idActivator,toggleActivatorsDisplay){var elementToToggle=$(idElement);if(!$defined(elementToToggle)){return}if(idActivator!=null){var fxReveal=new Fx.Reveal(elementToToggle,{duration:250,onShow:function(){toggleOnShow(idActivator,toggleActivatorsDisplay);toggleRunning=false},onHide:function(){toggleOnHide(idActivator,toggleActivatorsDisplay);toggleRunning=false}});if(!toggleRunning){toggleRunning=true;fxReveal.toggle()}}else{var fxReveal=new Fx.Reveal(elementToToggle,{duration:250});fxReveal.toggle()}return true};togglingOwnTime=function(idElement,idActivator,toggleActivatorsDisplay,time){var elementToToggle=$(idElement);if(!$defined(elementToToggle)){return}milliseconds=parseInt(time);var fxReveal=new Fx.Reveal(elementToToggle,{duration:milliseconds,onShow:function(){toggleOnShow(idActivator,toggleActivatorsDisplay)},onHide:function(){toggleOnHide(idActivator,toggleActivatorsDisplay)}});fxReveal.toggle();return true};revealing=function(idElement,idActivator,toggleActivatorsDisplay){var elementToToggle=$(idElement);var fxReveal=new Fx.Reveal(elementToToggle,{duration:250,onShow:function(){toggleOnShow(idActivator,toggleActivatorsDisplay)}});fxReveal.reveal()};toggleOnShow=function(idActivator,toggleActivatorsDisplay){var activatorOn=idActivator+"On";activatorOn=$(activatorOn);var activatorOff=idActivator+"Off";activatorOff=$(activatorOff);if(toggleActivatorsDisplay){activatorOff.setStyle("display","none");activatorOn.setStyle("display","block")}else{tmpHtml=activatorOn.innerHTML;activatorOn.innerHTML=activatorOff.innerHTML;activatorOff.innerHTML=tmpHtml;tmpOnClick=activatorOn.onClick}};toggleOnHide=function(idActivator,toggleActivatorsDisplay){var activatorOn=idActivator+"On";activatorOn=$(activatorOn);var activatorOff=idActivator+"Off";activatorOff=$(activatorOff);if(toggleActivatorsDisplay){activatorOn.setStyle("display","none");activatorOff.setStyle("display","block")}else{tmpHtml=activatorOff.innerHTML;activatorOff.innerHTML=activatorOn.innerHTML;activatorOn.innerHTML=tmpHtml}};getMediaForm=function(url,id){showLoadingAnimation();var jsonRequest=new Request.JSON({method:"get",url:url,onSuccess:function(responseJSON,responseText){hideLoadingAnimation();if(responseJSON.login!="logged_in"){handleMhcAjaxLogin(responseJSON,"getMediaForm('"+url+"', '"+id+"');",0)}else{$(id).innerHTML=responseJSON.content}}});jsonRequest.send()};submitMediaForm=function(url,id,formName){var form=$(formName);var jsonRequest=new Request.JSON({url:url,onSuccess:function(responseJSON,responseText){if(responseJSON.login!="logged_in"){handleMhcAjaxLogin(responseJSON,"submitMediaForm('"+url+"', '"+id+"', '"+formName+"');",0)}else{$(id).innerHTML=responseJSON.content}}});jsonRequest.post(form)};resizeShadowboxFullscreenImg=function(img,id,obj){var iFrameHeight=obj.getHcIframeHeight();$(id).setStyle("display","inline");if((img.height+52)>iFrameHeight){img.height=(iFrameHeight-52)}};showNotepad=function(type){$(type+"notepadlistcontent").toggleOn()};updateNotepadStatus=function(){if($("hotelnotepadlist").innerHTML==""){$("hotelnotepadlist").setStyle("display","none")}else{$("hotelnotepadlist").setStyle("display","")}if($("offernotepadlist").innerHTML==""){$("offernotepadlist").setStyle("display","none")}else{$("offernotepadlist").setStyle("display","")}if($("hotelnotepadlist").innerHTML==""&&$("offernotepadlist").innerHTML==""){$("notepadHeadline").setStyle("display","none")}else{$("notepadHeadline").setStyle("display","")}};fadeOutMessage=function(messageId){var fxReveal=new Fx.Reveal(messageId,{duration:500});(function(){fxReveal.dissolve()}).delay(2000)};editHotelNotepad=function(url){var htmlRequest=new Request.HTML({method:"get",url:url,onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){$("hotelnotepadlist").innerHTML=responseHTML;updateNotepadStatus();if($("hotelnotepadlist").innerHTML!=""){showNotepad("hotel");scrollSmooth("notepad");fadeOutMessage("noticehotelnotepad")}}});htmlRequest.send()};deleteOfferNotepad=function(url){var jsonRequest=new Request.JSON({method:"get",url:url,onSuccess:function(responseJSON,responseText){if(responseJSON.result>0){$("offernotepadlist").innerHTML=responseJSON.offernotepadlist;updateNotepadStatus();if($("offernotepadlist").innerHTML!=""){showNotepad("offer");try{$("noticeoffernotepad").className="notice"+responseJSON.messagetype;$("noticeoffernotepad").innerHTML=responseJSON.message;fadeOutMessage("noticeoffernotepad")}catch(err){}}}}});jsonRequest.send()};addOfferNotepadTt=function(url,offerId,parentOfferId){var form;if(!$defined(parentOfferId)){form=$("offer_"+offerId).getElement("form")}else{form=$("offer_"+parentOfferId).getElement(".offer_upselling_"+offerId).getElement("form")}var jsonRequest=new Request.JSON({url:url,onSuccess:function(responseJSON,responseText){if(responseJSON.result>0){$("offernotepadlist").innerHTML=responseJSON.offernotepadlist;updateNotepadStatus();showNotepad("offer");scrollSmooth("notepad");try{$("noticeoffernotepad").className="notice"+responseJSON.messagetype;$("noticeoffernotepad").innerHTML=responseJSON.message;fadeOutMessage("noticeoffernotepad")}catch(err){}}}});jsonRequest.post(form);return false};addOfferNotepadBookings=function(url,offerId){var form=$("offerformbk");form.getElements("input[name^=block]").set("value",0);form.getElement("input[id=block_"+offerId+"]").set("value",1);var jsonRequest=new Request.JSON({url:url,onSuccess:function(responseJSON,responseText){if(responseJSON.result>0){$("offernotepadlist").innerHTML=responseJSON.offernotepadlist;try{updateNotepadStatus();showNotepad("offer");scrollSmooth("notepad");$("noticeoffernotepad").className="notice"+responseJSON.messagetype;$("noticeoffernotepad").innerHTML=responseJSON.message;fadeOutMessage("noticeoffernotepad")}catch(err){alert(responseJSON.message)}}}});jsonRequest.post(form);return false};addOfferNotepadIan=function(url,offerId){var form=$("offer_"+offerId).getElement("form");var jsonRequest=new Request.JSON({url:url,onSuccess:function(responseJSON,responseText){if(responseJSON.result>0){$("offernotepadlist").innerHTML=responseJSON.offernotepadlist;try{updateNotepadStatus();showNotepad("offer");scrollSmooth("notepad");$("noticeoffernotepad").className="notice"+responseJSON.messagetype;$("noticeoffernotepad").innerHTML=responseJSON.message;fadeOutMessage("noticeoffernotepad")}catch(err){alert(responseJSON.message)}}}});jsonRequest.post(form);return false};addOfferNotepadBkIa=function(url,formId){var form=$(formId);var jsonRequest=new Request.JSON({url:url,onSuccess:function(responseJSON,responseText){if(responseJSON.result>0){$("offernotepadlist").innerHTML=responseJSON.offernotepadlist;try{updateNotepadStatus();showNotepad("offer");scrollSmooth("notepad");$("noticeoffernotepad").className="notice"+responseJSON.messagetype;$("noticeoffernotepad").innerHTML=responseJSON.message;fadeOutMessage("noticeoffernotepad")}catch(err){alert(responseJSON.message)}}}});jsonRequest.post(form);return false};checkOfferNotepadTt=function(notepadId){var form=$("vacancy_form_"+notepadId);if(!$defined(form)){$("not_available_"+notepadId).setStyle("display","");return false}$("vacancy_form_"+notepadId).setStyle("display","none");$("spinner_"+notepadId).setStyle("display","");var jsonRequest=new Request.JSON({url:form.get("action"),onSuccess:function(responseJSON,responseText){$("spinner_"+notepadId).setStyle("display","none");if(responseJSON.result>0||responseJSON.result==-2){form.set("action",responseJSON.bookAction);form.getElement("input[name=ttvacancyenv]").set("value",responseJSON.vacancyEnvEncoded);$("booking_button_"+notepadId).removeClass("displayNone");$("button_"+notepadId).setStyle("display","none");$("available_"+notepadId+"_price").innerHTML=responseJSON.priceFormatted;$("available_"+notepadId).setStyle("display","")}else{$("not_available_"+notepadId).setStyle("display","")}}});jsonRequest.post(form);return false};checkOfferNotepadBk=function(notepadId,price){if(price==""){$("not_available_"+notepadId).setStyle("display","")}else{$("available_"+notepadId+"_price").innerHTML=price;$("available_"+notepadId).setStyle("display","");$("vacancy_form_"+notepadId).setStyle("display","block")}return false};checkOfferNotepadIa=function(notepadId,price){if(price==""){$("not_available_"+notepadId).setStyle("display","")}else{$("available_"+notepadId+"_price").innerHTML=price;$("available_"+notepadId).setStyle("display","");$("vacancy_form_"+notepadId).setStyle("display","block")}return false};bookOfferNotepadTt=function(notepadId){gaOnclickCountName("bookingButtonFormTraveltainmentButton");var form=$("vacancy_form_"+notepadId);form.submit()};loadPrintCss=function(id){var headID=$$("head")[0];var cssNode=document.createElement("link");cssNode.type="text/css";cssNode.rel="stylesheet";cssNode.href="stylesheet/print/"+id+".css";cssNode.media="print";headID.appendChild(cssNode);var bodyID=$$("body")[0];var bodyNode=document.createElement("img");bodyNode.id="pageLogoPrint";bodyNode.src="image/logoPrint.jpg";bodyID.appendChild(bodyNode);window.print()};setCookie=function(name,value,expires){var options=(expires?{duration:expires*86400000}:false);Cookie.write(name,value,options)};window.addEvent("domready",function(ev){$$(".paginationContainer .additionalLinks").each(function(it){it.addEvent("mouseenter",function(ev){it.store("cancelHide",true);it.addClass("visible")});it.addEvent("mouseleave",function(ev){it.store("cancelHide",false);(function(){if(!it.retrieve("cancelHide")){it.removeClass("visible")}}).delay(1000)})})});mhcShowBox=function(url,width,height,reloadParentOnClose){url=encodeURI(url);var jsonRequest=new Request.JSON({method:"post",url:url,onSuccess:function(responseJSON,responseText){if(responseJSON.login!="logged_in"){handleMhcAjaxLogin(responseJSON,"mhcShowBox('"+url+"', "+width+", "+height+", "+reloadParentOnClose+");",2000)}else{Shadowbox.open({player:"html",content:responseJSON.content,width:width,height:height,options:{onClose:function(){if(reloadParentOnClose){showLoadingAnimation();window.location.reload(true)}else{return true}}}},{enableKeys:false})}}});jsonRequest.send()};logoutLightbox=function(logoutUrl){if(parent){parent.location.href=logoutUrl}else{window.location.href=logoutUrl}};toggleCheckBox=function(form,all){$(form).getElements("input[type=checkbox]").each(function(item,index){item.checked=all?true:!item.checked})};acceptBuddyRequest=function(url,id){var jsonRequest=new Request.JSON({method:"post",url:url,onSuccess:function(responseJSON,responseText){if(responseJSON.login!="logged_in"){handleMhcAjaxLogin(responseJSON,"acceptBuddyRequest('"+url+"', "+id+");",2000)}else{$("mhcBuddyRequestBox").innerHTML=responseJSON.content;if(responseJSON.subject){$("messageContent"+id+"Subject").innerHTML=responseJSON.subject}}}});jsonRequest.send()};deleteBuddy=function(url,id){var jsonRequest=new Request.JSON({method:"post",url:url,onSuccess:function(responseJSON,responseText){if(responseJSON.login!="logged_in"){handleMhcAjaxLogin(responseJSON,"deleteBuddy('"+url+"', "+id+");",2000)}else{$("mhcBuddyDelete").innerHTML=responseJSON.content;$("mhcBuddyItem"+id).innerHTML="entfernt"}}});jsonRequest.send()};var globalOriginalFunctionCall="";var globalDelayForOriginalFunctionCall=0;handleMhcAjaxLogin=function(response,originalFunctionCall,delayForOriginalFunctionCall){globalDelayForOriginalFunctionCall=delayForOriginalFunctionCall;switch(response.login){case"show":showMhcAjaxLogin(response.content,originalFunctionCall);break;case"update":updateMhcAjaxLogin(response.content);break;case"close":closeMhcAjaxLogin(response.header);break}};showMhcAjaxLogin=function(content,originalFunctionCall){globalOriginalFunctionCall=originalFunctionCall;Shadowbox.open({player:"html",content:content,width:500,height:450,options:{onClose:function(){},enableKeys:false}})};submitMhcAjaxLogin=function(){var form=$("loginMhc");var jsonRequest=new Request.JSON({url:form.get("action"),onSuccess:function(responseJSON,responseText){handleMhcAjaxLogin(responseJSON,"",globalDelayForOriginalFunctionCall)}});jsonRequest.post(form)};updateMhcAjaxLogin=function(content){$("sb-content").innerHTML=content};closeMhcAjaxLogin=function(header){Shadowbox.close();alternateSiteHeaderNavigationMhc(header);if(globalDelayForOriginalFunctionCall>0){showLoadingAnimation();(function(){hideLoadingAnimation();eval(globalOriginalFunctionCall)}).delay(globalDelayForOriginalFunctionCall)}else{eval(globalOriginalFunctionCall)}};alternateSiteHeaderNavigationMhc=function(content){var headerNavigationContainer=$("headerNavigationContainer");if(headerNavigationContainer){headerNavigationContainer.innerHTML=content}};showMhcAdditionalLogin=function(url){var jsonRequest=new Request.JSON({method:"post",url:url,onSuccess:function(responseJSON,responseText){$("mhcAdditionalLogin").innerHTML=responseJSON.content}});jsonRequest.send()};submitMhcAdditionalLogin=function(siteReload){var form=$("loginMhcAdditional");var jsonRequest=new Request.JSON({url:form.get("action"),onSuccess:function(responseJSON,responseText){if(siteReload&&responseJSON.isLoggedIn){window.location.reload()}else{$("mhcAdditionalLogin").innerHTML=responseJSON.content;alternateSiteHeaderNavigationMhc(responseJSON.header)}}});jsonRequest.post(form)};showMhcRegisterShortcut=function(url){var jsonRequest=new Request.JSON({method:"post",url:url,onSuccess:function(responseJSON,responseText){handleMhcRegisterShortcutResponse(responseJSON)}});jsonRequest.send()};submitMhcRegisterShortcut=function(){var form=$("registerMhc");var jsonRequest=new Request.JSON({url:form.get("action"),onSuccess:function(responseJSON,responseText){handleMhcRegisterShortcutResponse(responseJSON)}});jsonRequest.post(form)};handleMhcRegisterShortcutResponse=function(response){if(response.errors){$("registerMhcFormContainer").innerHTML=response.content}else{window.location.href=response.endUrl}};showMhcLoginWelcomeBox=function(url,height){url=encodeURI(url);var htmlRequest=new Request.HTML({method:"post",url:url,onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){Shadowbox.open({player:"html",content:responseHTML,width:500,height:height},{enableKeys:false})}});htmlRequest.send()};fullscreenLink=function(link){if(parent){if(parent.opener){parent.opener.location.href=link;window.close()}else{parent.location.href=link}}else{if(opener){if(opener.parent){opener.parent.location.href=link}else{opener.location.hef=link}}else{document.location.href=link}}};showTipLogin=function(){$("mhcPermanentPreLabel").className="tip tipLogin"};hideTipLogin=function(){$("mhcPermanentPreLabel").className="displayNone"};showTipNewsletterRC=function(){$("registerNewsletterRCPreLabel").className="tip tipNewsletter"};hideTipNewsletterRC=function(){$("registerNewsletterRCPreLabel").className="displayNone"};showTipNewsletterHC=function(){$("registerNewsletterHCPreLabel").className="tip tipNewsletter"};hideTipNewsletterHC=function(){$("registerNewsletterHCPreLabel").className="displayNone"};Hc.register("Hc.Layerform");Hc.Layerform.checked=false;Hc.Layerform.mousedown=function(event){var event=new Event(event);var element=$(event.target);var specialCase=false;if(("childs_0"==focusLayer||"childs_1"==focusLayer)){specialCase=true}if(!element.hasClass("productsearchInputLayerDivIcon")&&!element.hasClass("productsearchInputLayer")&&element.get("tag")!=="li"&&element.get("tag")!=="input"&&element.get("tag")!=="label"&&!element.hasClass("childOption")&&element.get("tag")!=="ul"||(element.hasClass("productsearchInputLayer")&&!element.getParent().hasClass("boxOpen")&&(element.getProperty("id").search("child")!=0))||(element.hasClass("productsearchInputLayerDivIcon")&&!element.getParent().hasClass("boxOpen"))){$$("div.boxOpen").removeClass("boxOpen")}while(!element.hasClass("formProductsearch")&&element!=document.body&&element.nodeType==1){if(specialCase&&element.hasClass("childLayer")){event.stop();return false}if(element.hasClass("productsearchLayer")||element.hasClass("hotelfilterLayer")||element.hasClass("productsearchLayerSelect")){if(specialCase){element.getElements(".childLayer").each(function(child){child.hide()})}event.stop();return false}element=$(element.parentNode)}loopAllLayerforms("close","")};Hc.Layerform.layers=new Hash();Hc.Layerform.open=function(id){if($chk($(id+"_layer_spinner"))&&$chk($(id+"_layer_spinner").innerHTML)){$(id+"_layer_spinner").setStyle("display","block")}if(!Hc.Layerform.layers.has(id)){return false}var layer=Hc.Layerform.layers.get(id);layer.setStyle("display","block");layer.setStyle("visibility","visible");var leftX=getLayerLeftSpace(id,0);if(leftX>0){shiftLayerLeft(id,leftX)}IE6_overlay_fix.show(layer);if($chk($(id+"_layer_spinner"))&&$chk($(id+"_layer_spinner").innerHTML)){$(id+"_layer_spinner").setStyle("display","none")}document.addEvent("mousedown",Hc.Layerform.mousedown);return true};Hc.Layerform.close=function(id){if(!Hc.Layerform.layers.has(id)){return}var layer=Hc.Layerform.layers.get(id);submitLayer(id);if("block"==layer.getStyle("display")){layer.setStyle("display","none");layer.setStyle("visibility","hidden");IE6_overlay_fix.hide()}if("termin"==id||"country"==id||"region"==id){Hc.Layerform.layers.erase(id)}};Hc.Layerform.submitOnClose=new Hash();loadLayerform=function(url,id,scrollToParams,callerObject,serviceUrlPrefix,siteId){if(callerObject){if(callerObject.getParent().hasClass("boxOpen")){callerObject.getParent().removeClass("boxOpen");return true}callerObject.getParent().addClass("boxOpen")}if(Hc.Layerform.open(id)){return}var loadurl=url+"&value="+$(id+"_value").value;var htmlRequest=new Request.HTML({method:"get",url:loadurl,onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){var layer=$(id+"_layer");layer.innerHTML="";var content=new Element("div");content.innerHTML=responseHTML;content.getElements("li").each(function(listItem){if(listItem.hasClass("layerSectionChoice")){if("trident"==Browser.Engine.name&&4==Browser.Engine.version){listItem.addEvents({mouseenter:function(){listItem.addClass("hover")},mouseleave:function(){listItem.removeClass("hover")}})}}});layer.appendChild(content);Hc.Layerform.layers.set(id,layer);Hc.Layerform.open(id);if(!serviceUrlPrefix||!siteId||id!="toprated"){return}var toprated=$(id+"_value").value;topratedAjax(toprated,serviceUrlPrefix,siteId)}});htmlRequest.send()};var focusLayer=null;var focusLayerException=0;var defaultValueLayer=null;var defaultValueNull="__null__";var defaultClassLayer=null;var changedClassLayer=null;var defaultValueLayerTemp=null;var defaultClassLayerTemp=null;var changedClassLayerTemp=null;getLayerLeftSpace=function(id,layerwidth){var leftPx=0;if(layerwidth<=0){layerwidth=0;if($chk($(id+"_layer"))){layerwidth=$(id+"_layer").offsetWidth}}var elementwidth=0;if($chk($(id))){elementwidth=$(id).offsetWidth}if(layerwidth>elementwidth){var mainwidth=0;if($chk($("main"))){mainwidth=$("main").offsetWidth}var additionalWidth=0;if($chk($("additional"))){additionalWidth=$("additional").offsetWidth+10}var elementLeftPosition=0;if($chk($(id))){elementLeftPosition=$(id).offsetLeft-10;if(elementLeftPosition<0){var obj=$(id);var curLeft=0;do{curLeft+=obj.offsetLeft}while(obj=obj.offsetParent);elementLeftPosition=curLeft}var child=$(id);var parentTagNode=child.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;var idName=parentTagNode.id;if(idName!="additional"&&elementLeftPosition>10){idName=parentTagNode.parentNode.parentNode.parentNode.id}var idstring=new String(idName);var result=idstring.match("custom__calendar_");if(idName=="additional"||result){elementLeftPosition=elementLeftPosition+mainwidth+additionalWidth}}var contentwidth=mainwidth+additionalWidth;if(contentwidth>0&&layerwidth>0&&elementLeftPosition>0){var widthleft=contentwidth-elementLeftPosition-5;if(layerwidth>=widthleft){var leftPx=layerwidth-elementwidth-23}}}return leftPx};shiftLayerLeft=function(id,leftPx){if("adults_0"==id||"adults_1"==id){return}if(layer=$(id+"_layer")){layer.setStyle("left","-"+leftPx+"px")}};setFocusLayer=function(id){if($chk(id)||id!="null"){focusLayer=id}};setFocusLayerStyles=function(defaultValue,defaultClass,changedClass){defaultValueLayer=defaultValue;defaultClassLayer=defaultClass;changedClassLayer=changedClass};setFocusLayerStylesTemp=function(defaultValue,defaultClass,changedClass){defaultValueLayerTemp=defaultValue;defaultClassLayerTemp=defaultClass;changedClassLayerTemp=changedClass};setFocusLayerException=function(value){focusLayerException=value};deleteAllLayerforms=function(exceptpost){loopAllLayerforms("delete",exceptpost)};loopAllLayerforms=function(action,exceptpost){loopAllLayerformsDivs(action);if(action=="close"||action=="delete"){document.removeEvent("mousedown",Hc.Layerform.mousedown)}if(action=="delete"){loopAllLayerformsElements("input","_value",exceptpost);loopAllLayerformsElements("input","_type","")}};loopAllLayerformsElements=function(type,matchString,exceptpost){var forms=document.forms;var i=0;while(forms[i]){$(forms[i]).getElements(type).each(function(item,index){var idname=item.id;var idstring=new String(idname);var result=idstring.match(matchString);if(result){var element=$(idname);if($chk(element.parentNode)){if(!$chk(element.value)||matchString=="_help"){element.parentNode.removeChild(element);if(matchString=="_value"){var split=idname.split("_");if(split[0]&&split[1]){var typeid=split[0]+"_"+split[1]+"_type";if($chk($(typeid))){var typelement=$(typeid);if(typelement.parentNode){typelement.parentNode.removeChild(typelement)}}}}}}}});i++}};loopAllLayerformsDivs=function(action){if("close"==action){Hc.Layerform.layers.each(function(layer,id){Hc.Layerform.close(id)})}else{if("delete"==action){Hc.Layerform.layers.each(function(layer,id){var layer=$(id+"_layer");if($defined(layer)){layer.destroy()}})}}};closeLayer=function(){if(focusLayerException==0){focusLayer=closeThisLayer(focusLayer);submitLayer(focusLayer)}};submitLayer=function(layer){var layerField=$(Hc.Layerform.submitOnClose.get(layer));if($chk(layerField)&&$chk(layerField.form)){gaTrackEvent("Suchmaske_Hotel","topratings_"+layerField.value);var location=window.location.href;var endPos=location.indexOf("?");var paginateAnchor="#paginateAnchor";location=location.replace(paginateAnchor,"");location=location.replace(/page=[0-99]*/,"");if(-1!=endPos){var firstPos=location.match(/\?toprated/gi);if(firstPos!=null){location=location.replace(/toprated=[0-9](-[0-9])*/,"");topratedElement="?&";location=location.replace(topratedElement,"?");window.location.href=location+"&"+layer+"="+layerField.value}else{var topratedElement="";var locationSplit=location.split("&");for(var i=0;i<locationSplit.length;i++){if(locationSplit[i].match(/toprated=/gi)){var topratedElement=locationSplit[i]}}if(topratedElement!=""){topratedElement="&"+topratedElement;location=location.replace(topratedElement,"")}location=location+"&"+layer+"="+layerField.value;topratedElement="?&";location=location.replace(topratedElement,"?");window.location.href=location}}else{window.location.href=location+"?"+layer+"="+layerField.value}}};closeThisLayer=function(thisLayerId){thisLayerId=thisLayerId.replace("_layer","");if($chk(thisLayerId)&&$chk($(thisLayerId))){Hc.Layerform.close(thisLayerId);return null}else{$(thisLayerId).hide()}return thisLayerId};setLayerValue=function(name,value,text,type,innerHtml,layerStyle,listenOnTemp){var layer=$(name);if(innerHtml&&$defined(layer)&&$chk(layer.get("text"))&&$chk(layer.innerHTML)){if("termin"==name||"country"==name||"region"==name){layer.set("text",text)}else{layer.innerHTML=text}}if($defined($(name+"_value"))){$(name+"_value").value=value}if($defined($(name+"_help"))){$(name+"_help").value=text}if($defined($(name+"_type"))&&type!=false){$(name+"_type").value=type}if(layerStyle==true){setLayerStyle(name,value,listenOnTemp)}if($defined($(name+"-"+value))){var ele=$(name+"-"+value);if("radio"==ele.type){$(ele).getParent(".formBody").getElements("input[name="+ele.name+"]").each(function(input){if("radio"==input.type){input.checked=false;input.getParent(".layerSectionChoice").removeClass("layerSectionChoiceSelected")}})}ele.checked=true;ele.getParent(".layerSectionChoice").addClass("layerSectionChoiceSelected")}};setLayerHiddenTypeHelp=function(name,value,type){if($(name+"_help")){$(name+"_help").value=value}if($(name+"_type")){$(name+"_type").value=type}};setLayerValueSelected=function(element,name,listenOnTemp){var value="";if($chk($(element.id+"_help_primary_value"))){value=$(element.id+"_help_primary_value").value}var text="";if($chk($(element.id+"_help_primary_text"))){text=$(element.id+"_help_primary_text").value}setLayerValue(name,value,text,false,true,true,listenOnTemp);if($chk($(element.id+"_help_secondary_text"))){var text=$(element.id+"_help_secondary_text").value;if($chk($(name))&&text!=""){$(name).innerHTML=text}}element=$(element);element.getParent().getElements(".productsearchLayerSelectedOption").each(function(ele){ele.removeClass("productsearchLayerSelectedOption");ele.addClass("productsearchLayerSelectOption")});element.removeClass("productsearchLayerSelectOption");element.addClass("productsearchLayerSelectedOption")};setLayerValueMerge=function(element,name,parentdefaulttext,valueSplitter,textSplitter,listenOnTemp,serviceUrlPrefix,siteId){element=$(element).getElement("input");if(!Hc.Layerform.checked&&!element.disabled){if(element.checked){element.checked=false;element.getParent(".layerSectionChoice").removeClass("layerSectionChoiceSelected")}else{element.checked=true;element.getParent(".layerSectionChoice").addClass("layerSectionChoiceSelected")}}else{if(!element.checked){element.getParent(".layerSectionChoice").removeClass("layerSectionChoiceSelected")}else{element.getParent(".layerSectionChoice").addClass("layerSectionChoiceSelected")}}Hc.Layerform.checked=false;var value=element.value;var newValue=value;if($chk($(name+"_value"))){var current=$(name+"_value").value;var currentText=parentdefaulttext;if($chk($(name+"_help_primary_"+value))){currentText=$(name+"_help_primary_"+value).value}if($chk(current)&&current!="0"){var valueArray=current.split(valueSplitter);var i=0;newValue="";currentText="";while(valueArray[i]){var valueItem=trimString(valueArray[i]);if(i>0&&valueItem!=value&&newValue!=""){newValue=newValue+valueSplitter}if(valueItem!=value){newValue=newValue+valueItem}i++}if(element.checked==true){newValue=newValue+valueSplitter+value}var valueArray=newValue.split(valueSplitter);valueArray=valueArray.sort(sortNumber);newValue="";currentText="";i=0;while(valueArray[i]){var valueItem=trimString(valueArray[i]);if(i>0){newValue=newValue+valueSplitter;currentText=currentText+textSplitter}newValue=newValue+valueItem;var itemText=valueItem;if($chk($(name+"_help_primary_"+valueItem))){itemText=$(name+"_help_primary_"+valueItem).value}currentText=currentText+itemText;i++}}if(newValue==""){newValue=defaultValueLayer;currentText=parentdefaulttext}$(name+"_value").value=newValue;$(name).innerHTML=currentText}setLayerStyle(name,newValue,listenOnTemp);if(name=="toprated"){if(!serviceUrlPrefix||!siteId){return}topratedAjax(newValue,serviceUrlPrefix,siteId)}else{if(name=="toprated_0"||name=="specialrequest_0"){var counterArray=newValue.split(";");if(counterArray.length>1){var criteria=Hc.translate("criteria");if(counterArray.length>4){var criteria=Hc.translate("criteria5")}var replaceElement="{{number}}";criteria=criteria.replace(replaceElement,counterArray.length);$(name).innerHTML=criteria}else{if(counterArray.length==1){$(name).innerHTML=Hc.translate("criterion")}}if(newValue==0){$(name).innerHTML=Hc.translate("beliebig")}}else{if(name=="room_0"){var counterArray=newValue.split(";");if(counterArray.length>1){var roomtype=Hc.translate("roomtypes");var replaceElement="{{number}}";roomtype=roomtype.replace(replaceElement,counterArray.length);$(name).innerHTML=roomtype}else{if(counterArray.length==1){$(name).innerHTML=Hc.translate("roomtype")}}if(newValue==0){$(name).innerHTML=Hc.translate("Alle Zimmertypen")}}}}};function topratedAjax(toprated,hotelAttributesSearchUrlPrefix,siteId){var rid=document.getElementById("regionId").options[document.getElementById("regionId").selectedIndex].value;var oid=document.getElementById("cityId").options[document.getElementById("cityId").selectedIndex].value;var stars=document.getElementById("stars").options[document.getElementById("stars").selectedIndex].value;var traveledwith=document.getElementById("traveledwith").options[document.getElementById("traveledwith").selectedIndex].value;var offers=document.getElementById("offers").checked;var locationType="regionId";var locationId=rid;if(oid>0){var locationType="cityId";var locationId=oid}var url=hotelAttributesSearchUrlPrefix+"hc.hotelAttributesSearch?"+locationType+"="+locationId;var strTypes=toprated.replace(/-/g,",");if(strTypes!="0"){url=url+"&types="+strTypes}if(stars!="0"){url=url+"&stars="+stars}if(traveledwith!="0"){url=url+"&traveledwith="+traveledwith}if(offers==true){url=url+"&offers="+siteId}var htmlRequest=new Request.JSON({method:"get",url:url,onSuccess:function(responseJSON,responseText){$("topratedSumAjax").innerHTML=responseJSON.results}});htmlRequest.send();var counterArray=strTypes.split(",");if(counterArray.length>1){var criteria=Hc.translate("criteria");if(counterArray.length>4){var criteria=Hc.translate("criteria5")}var replaceElement="{{number}}";criteria=criteria.replace(replaceElement,counterArray.length);$("toprated").innerHTML=criteria}else{if(counterArray.length==1){$("toprated").innerHTML=Hc.translate("criterion")}}if(strTypes==0){$("toprated").innerHTML=Hc.translate("beliebig")}}setLayerValueFromMultiLayers=function(parentname,parentdefaulttext,valueSplitter,textSplitter,multilayers,spanStyle,kid,kids){var text=[];var value=[];var layersArray=multilayers.split(",");var i=0;while(layersArray[i]){layername=trimString(layersArray[i]);if($defined($(layername+"_value"))){var toSend=$(layername+"_value").value;var toShow=$(layername+"_help").value;if(0<toSend){value.push(toSend);if("childs_0"==parentname||"childs_1"==parentname){text.push(toShow.replace(/\s/g,""))}else{text.push(toShow)}}}i++}if(0==value.length){value=defaultValueLayer;text=parentdefaulttext}else{value=value.join(valueSplitter);if("recotraveller_0"==parentname||"recotraveller_1"==parentname||"recommandation_0"==parentname||"recommandation_1"==parentname){text=text.join("<br/>")}else{if(1==text.length){outputtext=kid}else{outputtext=kids}text=text.length+" "+outputtext}}setLayerValue(parentname,value,text,"",true,true,false)};setLayerStyle=function(name,value,listenOnTemp){var element=$(name);if(!$defined(element)||name!=element.id){return}if(listenOnTemp==true&&defaultValueLayerTemp!=null&&defaultClassLayerTemp!=null&&changedClassLayerTemp!=null){if(defaultValueLayerTemp!=value){element.className=changedClassLayerTemp}else{element.className=defaultClassLayerTemp}}else{if(defaultValueLayer!=null&&defaultClassLayer!=null&&changedClassLayer!=null){if(defaultValueLayer!=value){element.className=changedClassLayer}else{element.className=defaultClassLayer}}}};setStyleInputSuggest=function(id,defaultValue,defaultText,defaultClass,changedClass){var idValue=id+"_value";var idInput=id+"_help";var idType=id+"_type";if($chk($(idValue))&&$chk($(idInput))){var value=$(idValue).value;var inputParent=$(idInput).parentNode;var help="";if($defined(value)){help=$(idInput).value;if(help!=""){value=help}else{value=defaultValue}}if(inputParent){if(value!=defaultValue){inputParent.className=changedClass;if(help!=""){$(idValue).value=help;$(idType).value="user"}else{if($(idType).value=="user"){$(idType).value="id"}}}else{inputParent.className=defaultClass;$(idInput).value=defaultText;$(idValue).value=defaultValue}}}};trimString=function(s){while(s.substring(0,1)==" "){s=s.substring(1,s.length)}while(s.substring(s.length-1,s.length)==" "){s=s.substring(0,s.length-1)}return s};sortNumber=function(a,b){return a-b};setTextIfOneValue=function(parentname,parentsplitter,idSuffixText){if($(parentname+"_value").value&&-1!=$(parentname+"_value").value){var parentValue=$(parentname+"_value").value;var values=parentValue.split(parentsplitter);var items=0;while(values[items]){items++}if(items==1){var text=$(idSuffixText+values[0]).value;if(text){$(parentname).innerHTML=text}}}};maxElementOptions=function(max,parentname,parentsplitter,elementsArray,optionBeginArray,optionSplitter,optionDefaultId){if($(parentname+"_value").value){var parentValue=$(parentname+"_value").value;var values=parentValue.split(parentsplitter);var items=0;while(values[items]){items++}if(items>(max-2)){var elements=elementsArray.split(",");var begins=optionBeginArray.split(",");var i=0;while(elements[i]){var name=trimString(elements[i]);if(items>=max){disableEnableUncheckElementOptions(name,optionSplitter,false,true,false)}else{disableEnableUncheckElementOptions(name,optionSplitter,false,false,false)}i++}}else{if(parentValue==""||parentValue=="0"){checkElementId(optionDefaultId)}}}else{checkElementId(optionDefaultId)}};disableEnableUncheckElementOptions=function(name,optionSplitter,disableCheckedElements,disable,uncheck){$("formElementLine_"+name).getElements("input[type=checkbox]").each(function(item,index){if(disable==true){if(item.checked==false||disableCheckedElements==true){disableElement(item)}}else{if(uncheck){uncheckElement(item)}enableElement(item)}})};disableElement=function(element){element.disabled=true};enableElement=function(element){element.disabled=false};uncheckAllElementOptions=function(elementsArray,optionBeginArray,optionSplitter,enableOptions){var elements=elementsArray.split(",");var begins=optionBeginArray.split(",");var i=0;while(elements[i]){var name=trimString(elements[i]);var begin=trimString(begins[i]);disableEnableUncheckElementOptions(name,optionSplitter,false,false,enableOptions);i++}};uncheckElementId=function(id){if($chk($(id))){var element=$(id);uncheckElement(element)}};checkElementId=function(id){if($chk($(id))){var element=$(id);checkElement(element)}};uncheckElement=function(element){element.getParent(".layerSectionChoice").removeClass("layerSectionChoiceSelected");element.checked=false};checkElement=function(element){if(element.hasClass("layerSectionChoice")){element.addClass("layerSectionChoiceSelected")}else{element.getParent(".layerSectionChoice").addClass("layerSectionChoiceSelected")}element.checked=true};updateLayerValue=function(element,layerLink){if($chk(layerLink)){if(!$chk(layerLink.values)){layerLink.values=layerLink.preselectedValue}var values=layerLink.values;if($chk(values)){values=values.split("-")}if(element.checked){if(values.length==1&&values[0]==0){values[0]=element.value;layerLink.values=array_implode("-",values);return}else{var alreadyAdded=false;for(var j=0;j<values.length;j++){if(values[j]==element.value){alreadyAdded=true}}if(!alreadyAdded){values[values.length]=element.value}}}else{if(values.length==1&&values[0]==element.value){values[0]=0;layerLink.values=array_implode("-",values);return}else{layerLink.values="";var newValues=new Array();for(var k=0;k<values.length;k++){if(values[k]==element.value){}else{newValues.push(values[k])}}layerLink.values=array_implode("-",newValues);return}}layerLink.values=array_implode("-",values)}};function array_implode(value,array){return((array instanceof Array)?array.join(value):array)}function submitOnClose(layer){var layerField=$(layer+"_value");Hc.Layerform.submitOnClose.set(layer,layerField)};Hc.register("Hc.Calendar");Hc.register("Hc.Calendar.Holidayform");Hc.Calendar.calendars=[];Hc.Calendar.isLoaded=false;Hc.Calendar.minMax=new Hash();Hc.Calendar.add=function(id,minMax){if(0==Hc.Calendar.calendars.length){Hc.Calendar.calendars.push([])}var lastCalendar=Hc.Calendar.calendars.length-1;Hc.Calendar.calendars[lastCalendar].push(id);if(2==Hc.Calendar.calendars[lastCalendar].length){Hc.Calendar.calendars.push([])}Hc.Calendar.minMax.set(id,minMax)};Hc.Calendar.init=function(){if(Hc.Calendar.isLoaded){return}Hc.Calendar.calendars.each(function(calendar){if(2==calendar.length){var json='{"'+calendar[0]+'": "D. d.m.Y", "'+calendar[1]+'": "D. d.m.Y"}';var cal=new Calendar(JSON.decode(json),{offset:1,direction:1})}});Hc.Calendar.isLoaded=true};Hc.Calendar.setOptions=function(calendar,calendarGroup,type){if(type.hasClass("calendarRaChannel")){}if(type.hasClass("calendarContent")){calendar.isContent=true;calendar.monthSelect.destroy();calendar.monthSelect=$empty;calendarGroup.options.direction=0}if(type.hasClass("doSubmit")){calendar.onChange=function(){calendar.el.form.submit()}}if(type.hasClass("calendarRaChannel")){calendarGroup.options.direction=2;calendar.start=Hc.Calendar.minMax.get(type.id).min;calendar.end=Hc.Calendar.minMax.get(type.id).max}if(type.hasClass("calendarTravelbookingtt")){calendarGroup.options.direction=2;calendar.onChange=function(){Hc.Rentedcar.update();calendarGroup.toggle(calendar)};calendar.start=Hc.Calendar.minMax.get(type.id).min;calendar.end=Hc.Calendar.minMax.get(type.id).max}};Hc.Calendar.Holidayform.loadInProgress=false;Hc.Calendar.Holidayform.doNotOpen=true;Hc.Calendar.Holidayform.parentId="";Hc.Calendar.Holidayform.link="";Hc.Calendar.Holidayform.textOpen="";Hc.Calendar.Holidayform.textClose="";Hc.Calendar.Holidayform.url="";Hc.Calendar.Holidayform.form=null;Hc.Calendar.Holidayform.load=function(url){if(Hc.Calendar.Holidayform.loadInProgress){return}Hc.Calendar.Holidayform.loadInProgress=true;var htmlRequest=new Request.HTML({method:"get",url:url,onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){if(null!=Hc.Calendar.Holidayform.form){Hc.Calendar.Holidayform.form.destroy();Hc.Calendar.Holidayform.form=null}Hc.Calendar.Holidayform.form=new Element("div",{id:"holidaycalendar",html:responseHTML});Hc.Calendar.Holidayform.loadInProgress=false;if(Hc.Calendar.Holidayform.doNotOpen){return}Hc.Calendar.Holidayform.open()}});htmlRequest.send()};Hc.Calendar.Holidayform.loadData=function(formname,elementIds){if(Hc.Calendar.Holidayform.loadInProgress){return}var params="";var elements=Hc.Calendar.Holidayform.form.getElement("#"+formname).elements;if(elements){var valueArray=elementIds.split(",");for(var i=0;i<valueArray.length;i++){valueItem=trimString(valueArray[i]);if(elements[valueItem]){name=elements[valueItem].name;value=elements[valueItem].value;params+="&"+name+"="+value}}}Hc.Calendar.Holidayform.load(Hc.Calendar.Holidayform.url+params)};Hc.Calendar.Holidayform.toggle=function(link,parentId,textOpen,textClose){if(Hc.Calendar.Holidayform.loadInProgress){return}Hc.Calendar.Holidayform.parentId=parentId;Hc.Calendar.Holidayform.link=link;Hc.Calendar.Holidayform.textOpen=textOpen;Hc.Calendar.Holidayform.textClose=textClose;if(null==Hc.Calendar.Holidayform.form){Hc.Calendar.Holidayform.load(Hc.Calendar.Holidayform.url);return}if("none"==Hc.Calendar.Holidayform.form.getStyle("display")){Hc.Calendar.Holidayform.open()}else{Hc.Calendar.Holidayform.close()}};Hc.Calendar.Holidayform.open=function(){if(null==Hc.Calendar.Holidayform.form){return}Hc.Calendar.Holidayform.form.inject(Hc.Calendar.Holidayform.parentId);Hc.Calendar.Holidayform.form.setStyle("display","");$(Hc.Calendar.Holidayform.link).innerHTML=Hc.Calendar.Holidayform.textClose;setFocusLayer("holidaycalendar")};Hc.Calendar.Holidayform.close=function(){if(null==Hc.Calendar.Holidayform.form){return}Hc.Calendar.Holidayform.form.setStyle("display","none");$(Hc.Calendar.Holidayform.link).innerHTML=Hc.Calendar.Holidayform.textOpen;setFocusLayer(null)};loadOfferTeaser=function(url,id){var htmlRequest=new Request.HTML({method:"get",noCache:true,url:url,onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){$(document.body).getElements("div.offerTeaserSmallActive").each(function(item,index){item.removeClass("offerTeaserSmallActive");item.addClass("offerTeaserSmallInactive")});$("offerTeaser_"+id).removeClass("offerTeaserSmallInactive");$("offerTeaser_"+id).addClass("offerTeaserSmallActive");$("offerTeaserCurrent").innerHTML=responseHTML}});htmlRequest.send()};Hc.register("Hc.Productsearch");Hc.Productsearch.submitAndOpenPopup=function(form,popupUrl,popupName){form.set("send",{onSuccess:function(responseText,responseXML){showPopUp(popupUrl,popupName)}});form.send()};Hc.Productsearch.submitAndToggle=function(form,popupUrl,containerId){if($("childs_0_layer")){var inhaltLayer0=$("childs_0_layer").get("html");$("childs_0_layer").set("html","")}if($("childs_2_layer")){var inhaltLayer2=$("childs_2_layer").get("html");$("childs_2_layer").set("html","")}if(Hc.Layerform.layers.has("child1_0")){Hc.Layerform.layers.erase("child1_0")}if(Hc.Layerform.layers.has("child2_0")){Hc.Layerform.layers.erase("child2_0")}if(Hc.Layerform.layers.has("child3_0")){Hc.Layerform.layers.erase("child3_0")}if(Hc.Layerform.layers.has("child4_0")){Hc.Layerform.layers.erase("child4_0")}if(Hc.Layerform.layers.has("child1_2")){Hc.Layerform.layers.erase("child1_2")}if(Hc.Layerform.layers.has("child2_2")){Hc.Layerform.layers.erase("child2_2")}if(Hc.Layerform.layers.has("child3_2")){Hc.Layerform.layers.erase("child3_2")}if(Hc.Layerform.layers.has("child4_2")){Hc.Layerform.layers.erase("child4_2")}form.set("send",{onSuccess:function(responseText,responseXML){var iframe='<iframe frameborder="0" scrolling="no" style="margin: 0px; padding: 0px; width: 652px; height: 570px;" src="'+popupUrl+'"></iframe>';if($(containerId).hasChild("placereserve")){toggling(containerId,null,false)}$(containerId).set("html",iframe);scrollSmooth("AnkerTravelcontactHotel")}});form.send();if($("childs_0_layer")){$("childs_0_layer").set("html",inhaltLayer0)}if($("childs_2_layer")){$("childs_2_layer").set("html",inhaltLayer2)}};changeTextSize=function(idSmall,idLarge,elementName,elementClassNameSmall,elementClassNameLarge,enlarge){if(enlarge){$(idSmall).setStyle("display","none");$(idLarge).setStyle("display","block");$(elementName).className=elementClassNameLarge}else{$(idLarge).setStyle("display","none");$(idSmall).setStyle("display","block");$(elementName).className=elementClassNameSmall}};automaticInlineExposureIn=function(id,subClass){$(id+"AIE").className="automaticInlineExposure"+subClass};automaticInlineExposureOut=function(id){$(id+"AIE").className="displayNone"};cascadingDropdownOnChange=function(id,childId,childEmptyText,childDefaultText,childNoneOfThese,url){if(id==childId){return}var value=$(id).value;if(value==""){$(childId).disabled=false;cascadingDropdownUnfill(childId,childEmptyText)}else{var jsonRequest=new Request.JSON({method:"post",url:url,data:{parentId:value},onSuccess:function(responseJSON,responseText){if(responseText.length<5){responseJSON={}}cascadingDropdownCallback(childId,childDefaultText,childNoneOfThese,responseJSON);var select=$(childId);if(value==-1){select.disabled=true;select.selectedIndex=select.length-1;if(select.onchange){select.onchange()}}else{select.disabled=false}}});jsonRequest.send()}};cascadingDropdownCallback=function(id,defaultText,childNoneOfThese,options){var select=$(id);select.getElements("option").each(function(item,index){select.removeChild(item)});optionNode=new Option(defaultText,"",false,false);select.options[select.length]=optionNode;for(var key in options){optionNode=new Option(options[key],key,false,false);select.options[select.length]=optionNode}if(childNoneOfThese!=""){optionNode=new Option(childNoneOfThese,"-1",false,false);select.options[select.length]=optionNode}select.selectedIndex=0;if(select.onchange){select.onchange()}};cascadingDropdownUnfill=function(id,emptyText){var select=$(id);select.getElements("option").each(function(item,index){select.removeChild(item)});optionNode=new Option(emptyText,"",false,false);select.options[select.length]=optionNode;if(select.onchange){select.onchange()}};Hc.CharacterCounter=new Class({Binds:["onInput"],element:null,inputElement:null,text:"",validators:{},hideOnComplete:false,cutIfToLarge:false,initialize:function(element){element=$(element);this.element=element;var id=element.id;this.inputElement=$(id.replace("JsCharacterCounter",""));if(!this.inputElement){return}this.inputElement.addEvent("keyup",this.onInput);var classNames=this.inputElement.className.split(" ");var validator;for(var i=0,len=classNames.length;i<len;i++){validator=classNames[i].split(":");if(2==validator.length){this.validators[validator[0]]=""+validator[1]}}var text=this.element.get("text");if(-1<text.indexOf("{{reverse_count}}")){this.hideOnComplete=true}if($defined(this.validators.maxLength)){this.cutIfToLarge=true}text=text.substitute({min:this.validators.minLength,max:this.validators.maxLength,count:"{{count}}",reverse_count:"{{reverse_count}}"},/\\?\{+([^{}]+)\}+/g);this.text=text;this.updateCounter()},onInput:function(event){this.updateCounter()},updateCounter:function(){this.element.set("text",this.text);var count=this.inputElement.get("value").length;var max=this.validators.maxLength;if(this.cutIfToLarge){if(count>=max){this.inputElement.set("value",this.inputElement.get("value").substr(0,max));this.element.addClass("jsCharacterCounterStoped");count=max}else{this.element.removeClass("jsCharacterCounterStoped")}}var reverseCount=this.validators.minLength-count;this.element.render({count:count,reverse_count:reverseCount});if(this.hideOnComplete){if(0>=reverseCount){this.element.toggleOff()}else{this.element.toggleOn()}}},toElement:function(){return this.element}});var closeCheckLayer=false;var lastCheckLayer=false;var checkLayerSeparator="<br />";var checkLayerMaxLength=0;checkLayerShowing=function(id){if(lastCheckLayer){checkLayerClosing(lastCheckLayer);lastCheckLayer=false}lastCheckLayer=id;var layer=$(id+"Layer");IE6_overlay_fix.show(layer);layer.setStyle("display","block");var firstBoxChecked=false;$(id+"Layer").getElements("input[id^="+id+"_]").each(function(item,index){if(firstBoxChecked==false){item.focus();firstBoxChecked=true}})};checkLayerChangingInline=function(id){var values=new Array();var i=0;$(document.body).getElements("input[id^="+id+"_]").each(function(item,index){if(item.checked){values[i]=item.id.substr(item.id.lastIndexOf("_")+1);i++}});var value="";values.each(function(key,index){if(value==""){value=key}else{value=value+","+key}});$(id).value=value;var display="";values.each(function(key,index){var itemName="";$(document.body).getElements("label[for="+id+"_"+key+"]").each(function(item,index){itemName=item.innerHTML});if(display==""){display=itemName}else{display=display+checkLayerSeparator+itemName;if(checkLayerMaxLength&&display.length>checkLayerMaxLength){display=display.substr(0,checkLayerMaxLength-3)+"..."}}});if(display==""){display=$(id+"DefaultText").innerHTML}$(id+"Display").innerHTML=display};checkLayerClosing=function(id){$(id+"Layer").setStyle("display","none");IE6_overlay_fix.hide();checkLayerChangingInline(id)};checkLayerDelayedClosing=function(id){closeCheckLayer=true;(function(){if(closeCheckLayer){checkLayerClosing(id)}}).delay(200)};checkLayerDelayedClosingAborting=function(){closeCheckLayer=false};composeValueForComposedTextField=function(elementId,fieldNr,numberOfFields,fieldComposingSeperator){var field=$(elementId+"Compose_"+fieldNr);field.value=field.value.replace(fieldComposingSeperator,"");while(field.value.indexOf(fieldComposingSeperator)>0){field.value=field.value.replace(fieldComposingSeperator,"")}var value="undefined";for(i=1;i<=numberOfFields;i++){field=$(elementId+"Compose_"+i);if(value=="undefined"){value=field.value}else{value=value+fieldComposingSeperator+field.value}}$(elementId).value=value};dateYearOnChange=function(id,childId,childEmptyText,childDefaultText,optionsMonth,yearsMonthMin,yearsMonthMax){var year=$(id).value;var select=$(childId);select.getElements("option").each(function(item,index){select.removeChild(item)});if(yearsMonthMin[year]===undefined){optionNode=new Option(childEmptyText,"",false,false);select.options[select.length]=optionNode}else{var min=yearsMonthMin[year];var max=yearsMonthMax[year];optionNode=new Option(childDefaultText,"",false,false);select.options[select.length]=optionNode;for(var key in optionsMonth){if(key>=min&&key<=max){optionNode=new Option(optionsMonth[key],key,false,false);select.options[select.length]=optionNode}}}select.selectedIndex=0};rateSliderUpdate=function(id,hoverValue,mouseDown,valueDisplayTexts){if($(id+"ValueDisplay").className=="displayNone"){return}var value=$(id).value;var valueDisplay=$(id+"ValueDisplay");if(hoverValue>0){valueDisplay.innerHTML=valueDisplayTexts[hoverValue];valueDisplay.className="valueDisplay"}else{if(value==0){valueDisplay.className="valueDisplayInvitation inactivetext"}}for(var i=1;i<=6;i++){var valueStep=$(id+"ValueStep"+i);if(value>=i){if(hoverValue>=i){if(mouseDown){valueStep.className="valueActiveMousedown"}else{valueStep.className="valueActiveHover"}}else{valueStep.className="valueActive"}}else{if(hoverValue>=i){if(mouseDown){valueStep.className="valueInactiveMousedown"}else{valueStep.className="valueInactiveHover"}}else{valueStep.className="valueInactive"}}}};rateSliderReset=function(id,valueDisplayTexts){var value=$(id).value;var valueDisplay=$(id+"ValueDisplay");valueDisplay.innerHTML=valueDisplayTexts[value];if(value==0&&valueDisplay.className!="displayNone"){valueDisplay.className="valueDisplayInvitation inactivetext"}for(var i=1;i<=6;i++){var valueStep=$(id+"ValueStep"+i);if(value>=i){valueStep.className="valueActive"}else{valueStep.className="valueInactive"}}};rateSliderValueUpdate=function(id,value){if($(id+"ValueDisplay").className=="displayNone"){return}$(id).value=value};ratingDenialCheckUpdate=function(id){var checkValue=$(document.body).getElement("input[id="+id+"RatingDenial]").checked;var valueDisplay=$(id+"ValueDisplay");if(checkValue){$(id).value=0;rateSliderUpdate(id,0,false,{});valueDisplay.className="displayNone"}else{valueDisplay.innerHTML="";valueDisplay.className="valueDisplayInvitation inactivetext"}};ratingDenialSpecifiedCheckUpdate=function(id){var checkValue=$(document.body).getElement("input[id="+id+"RatingDenialCheck]").checked;var valueDisplay=$(id+"ValueDisplay");if(checkValue){$(id).value=0;rateSliderUpdate(id,0,false,{});valueDisplay.className="displayNone";$(id+"RatingDenialSpecContainer").className="displayInline";$(id+"RatingDenial").value="denied"}else{valueDisplay.innerHTML="";valueDisplay.className="valueDisplayInvitation inactivetext";$(id+"RatingDenialSpecContainer").className="displayNone";var radios=$(document.body).getElements("input[name="+id+"RatingDenialSpec]");for(var i=0;i<radios.length;i++){radios[i].checked=false}$(id+"RatingDenial").value="notDenied"}};ratingDenialSpecifiedSpecUpdate=function(id){var radios=$(document.body).getElements("input[name="+id+"RatingDenialSpec]");for(var i=0;i<radios.length;i++){if(radios[i].checked){$(id+"RatingDenial").value=radios[i].value;break}}};Hc.register("Hc.Autocompleter");Hc.Autocompleter.MooTools=new Class({Extends:Autocompleter.Request.JSON,adapter:null,doPagination:false,doSubmit:true,itemChannel:"",initialize:function(el,url,options,focus,doSubmit){this.parent(el,url,options);if($defined(focus)&&true==focus){this.element.focus()}if($defined(doSubmit)){this.doSubmit=doSubmit}},query:function(){this.options.postData=this.adapter.getParams();this.parent()},queryResponse:function(response){var result=new Array();this.itemChannel=response.target;response.items.each(function(token){var label=token.label;result.push(token)});this.update(result)},update:function(tokens){this.choices.empty();this.cached=tokens;var type=tokens&&$type(tokens);if(!type||(type=="array"&&!tokens.length)||(type=="hash"&&!tokens.getLength())){(this.options.emptyChoices||this.hideChoices).call(this)}else{if(this.options.maxChoices<tokens.length&&!this.options.overflow){tokens.length=this.options.maxChoices}if(this.adapter.page>1){this.createPaginationElement("back")}var odd=true;var tokenCounter=0;var hintToken=false;tokens.each(this.options.injectChoice||function(token){tokenCounter++;if(tokenCounter<=this.adapter.offset){var oddClass="line-odd";if(odd){odd=false}else{oddClass="line-even";odd=true}token.label=token.label.trim();var choice=new Element("li",{html:this.markQueryValue(token.label)});choice.addClass(oddClass);choice.inputValue=token.label;choice.itemId=token.id;choice.itemType=token.typ;if(token.typ=="hint"){this.addHintEvents(choice).inject(this.choices);hintToken=true}else{this.addChoiceEvents(choice).inject(this.choices)}}},this);var numberTokens=tokens.length;if(hintToken==true){numberTokens-=1}if(numberTokens>this.adapter.offset){this.createPaginationElement("next")}this.showChoices();IE6_overlay_fix.show(this.choices)}},hideChoices:function(clear){this.parent(clear);IE6_overlay_fix.hide(this.choices)},addHintEvents:function(el){el.addClass("suggestHint");return el},onCommand:function(e){if(!e&&this.focussed){return this.prefetch()}if(e&&e.key&&!e.shift){switch(e.key){case"enter":case"tab":if(null!=this.selected){if(this.selected.hasClass("autocompleter-pagination-next")){this.nextPage(e);return false}if(this.selected.hasClass("autocompleter-pagination-back")){this.previousPage(e);return false}if(this.selected.hasClass("suggestHint")){return false}}if(this.selected&&this.visible){this.choiceSelect(this.selected);return !!(this.options.autoSubmit)}if(!this.doSubmit){var selected={itemId:"",itemType:""};this.fireEvent("onSelection",[this.element,selected,this.element.value,this.element.value]);this.hideChoices();if("enter"==e.key){return false}}break;case"up":case"down":if(!this.prefetch()&&this.queryValue!==null){var up=(e.key=="up");var choice=(this.selected||this.choices)[(this.selected)?((up)?"getPrevious":"getNext"):((up)?"getLast":"getFirst")](this.options.choicesMatch);if(null!=choice&&null!=this.selected){if("down"==e.key&&(this.selected.hasClass("autocompleter-pagination-next")||choice.hasClass("autocompleter-pagination-next"))){this.nextPage(e);return false}if("up"==e.key&&(this.selected.hasClass("autocompleter-pagination-back")||choice.hasClass("autocompleter-pagination-back"))){this.previousPage(e);return false}}this.choiceOver(choice,false)}return false;case"esc":this.hideChoices(true);break;case"left":case"right":return true}this.adapter.page=1;return true}this.adapter.page=1;this.options.postData=this.adapter.getParams();if(0<this.element.value.length&&2>=this.element.value.length){this.query()}return true},createPaginationElement:function(type){if("next"!=type&&"back"!=type){return}var paginationElement=new Element("li",{html:Hc.translate("suggest_search_"+type),"class":"autocompleter-pagination autocompleter-pagination-"+type});paginationElement.addEvents({mouseover:this.onPaginationElementMouseOver.bind(this,[paginationElement]),mouseout:this.onPaginationElementMouseOut.bind(this,[paginationElement])});if("next"==type){paginationElement.addEvents({click:this.nextPage.bind(this,[paginationElement])})}else{if("back"==type){paginationElement.addEvents({click:this.previousPage.bind(this,[paginationElement])})}}paginationElement.inject(this.choices)},onPaginationElementMouseOver:function(element){this.doPagination=true;this.choiceOver(element,false)},onPaginationElementMouseOut:function(element){this.doPagination=false},toggleFocus:function(state){if(this.doPagination){this.element.focus();state=true;this.doPagination=false}this.focussed=state;if(!state){this.hideChoices(true)}this.fireEvent((state)?"onFocus":"onBlur",[this.element])},nextPage:function(event){this.adapter.page++;this.query()},previousPage:function(event){if(this.adapter.page>1){this.adapter.page--}this.query()}});Hc.Autocompleter.MooTools.prototype.fix=false;Hc.SuggestSearch=function(type,input,output,url,defaultText){Hc.SuggestSearch.searchFields[type]=this;this.type=type;this.url=url;this.input=input;this.output=output;this.defaultText=defaultText;this.autocompleter=null;this.suggestSelectUrl="";this.id=type};Hc.SuggestSearch.searchFields=[];Hc.SuggestSearch.prototype.url="";Hc.SuggestSearch.prototype.page=1;Hc.SuggestSearch.prototype.offset=7;Hc.SuggestSearch.prototype.requestParams=[];Hc.SuggestSearch.prototype.getMin=function(){var min=1+((this.page-1)*this.offset);return min};Hc.SuggestSearch.prototype.getMax=function(){var max=this.page*this.offset;return max};Hc.SuggestSearch.prototype.getParams=function(){var params={};params.von=this.getMin();params.bis=this.getMax()+1;if(this.type=="hotelsearch"||this.type=="hotelName"){if($defined(Hc.SuggestSearch.searchFields.targetsearch)){var targetsearch=Hc.SuggestSearch.searchFields.targetsearch;var targetType=this.getTargetType($(targetsearch.id+"_type").value);var targetId=$(targetsearch.id+"_value").value;if(""!=targetType&&""!=targetId&&"0"!=targetId){params.ziel=targetType;params.zielid=targetId}}else{if($defined(Hc.SuggestSearch.searchFields.locationName)){var targetsearch=Hc.SuggestSearch.searchFields.locationName;var targetType=this.getTargetType($(targetsearch.id+"_type").value);var targetId=$(targetsearch.id+"_value").value;if(""!=targetType&&""!=targetId&&"0"!=targetId){params.ziel=targetType;params.zielid=targetId}}else{if($("target_0_help")!=null&&$("target_0_help").value!=""){var value=$("target_0_help").value;if(value=="3333"){params.distanz="nah"}else{if(value=="6666"){params.distanz="mittel"}else{if(value=="9999"){params.distanz="fern"}else{if(value==10035||value==10034||value==11||value==10033||value==10032){}else{params.ttids=value}}}}}}}}else{if(this.type=="suggestQuickSearch"){params.tags=true}else{if(this.type=="suggestForceInput"&&this.input.id=="userSearch"){params.spellchecker=false}}}return params};Hc.SuggestSearch.prototype.getRequestUrl=function(){var url=this.url;for(var i=0;i<this.requestParams.length;i++){var param=this.requestParams[i];if(-1==url.indexOf("?")){url+="?"+param.key+"="+param.value}else{url+="&"+param.key+"="+param.value}}return url};Hc.SuggestSearch.prototype.create=function(){var params=this.getParams();var options={ajaxOptions:{method:"get"},postVar:"anfrage",customChoices:$(this.output),postData:params,filterSubset:true,delay:200};this.inFocus=false;var setFocus=false;var doSubmit=true;switch(this.type){case"suggestQuickSearch":options.onSelection=function(element,selected,value,input){element.blur();if(this.autocompleter.itemChannel!=""){if(parent){parent.location.href=this.suggestSelectUrl+"?itemId="+selected.itemId+"&itemType="+selected.itemType+"&itemChannel="+this.autocompleter.itemChannel}else{window.location.href=this.suggestSelectUrl+"?itemId="+selected.itemId+"&itemType="+selected.itemType+"&itemChannel="+this.autocompleter.itemChannel}}else{if(parent){parent.location.href=this.suggestSelectUrl+"?itemId="+selected.itemId+"&itemType="+selected.itemType}else{window.location.href=this.suggestSelectUrl+"?itemId="+selected.itemId+"&itemType="+selected.itemType}}}.bind(this);var inputField=$(this.input);if(""==inputField.value.trim()){inputField.value=this.defaultText;inputField.addClass("inactivetext")}inputField.addEvent("focus",function(event){if(!this.inFocus){inputField.value="";inputField.removeClass("inactivetext")}this.inFocus=true}.bind(this));inputField.addEvent("blur",function(){if(""==inputField.value.trim()){inputField.value=this.defaultText;inputField.addClass("inactivetext");this.inFocus=false}}.bind(this));setFocus=true;break;case"suggestForce":case"suggestForceInput":case"suggestForceInputSubmit":options.forceSelect=true;options.onSelection=function(element,selected,value,input){var suggestForceItemType=null;if($chk(selected.itemType)){suggestForceItemType=selected.itemType}else{if($chk($(element.get("id")+"_itemType").value)){suggestForceItemType=$(element.get("id")+"_itemType").value}}if(this.type=="suggestForce"){element.blur();window.location.href=this.suggestSelectUrl+"&itemId="+selected.itemId+"&itemType="+suggestForceItemType}else{$(element.get("id")+"_itemId").value=selected.itemId;$(element.get("id")+"_itemType").value=suggestForceItemType;element.blur();if(this.type=="suggestForceInputSubmit"){var formNode=element;while(!formNode.match("form")){formNode=formNode.getParent()}formNode.submit()}}}.bind(this);if("suggestForceInputSubmit"==this.type&&""!=$(this.input).value.trim()){$(this.input).addEvent("blur",function(){if(""==$(this.input).value.trim()){$(this.input.id+"_itemId").value="";$(this.input.id+"_itemType").value="";this.input.form.submit()}}.bind(this))}if(this.type=="suggestForceInput"||this.type=="suggestForceInputSubmit"){options.onFocus=function(element){element.value=""}.bind(this)}if(this.type=="suggestForceInput"){doSubmit=false}break;case"targetsearch":case"hotelsearch":case"locationName":var inputField=$(this.input);var inputValue=$(this.id+"_value");var inputType=$(this.id+"_type");if(""==inputField.value.trim()){inputField.value=this.defaultText}this.offset=10;doSubmit=false;inputField.addEvent("focus",function(event){if(!this.inFocus){inputField.value="";inputValue.value="0"}this.inFocus=true}.bind(this));inputField.addEvent("blur",function(){if(""==inputField.value.trim()){inputField.value=this.defaultText;inputField.removeClass("selected");this.inFocus=false}else{if(""==inputValue.value){inputValue.value=inputField.value;inputType.value="user"}inputField.addClass("selected")}}.bind(this));if(""!=inputValue.value){inputField.addClass("selected")}if("targetsearch"==this.type||"locationName"==this.type){options.onSelection=function(element,selected,value,input){window.setTimeout(function(){this.inFocus=false}.bind(this),10);inputValue.value=selected.itemId;inputType.value=selected.itemType;inputField.addClass("selected");inputField.blur()}.bind(this)}else{if("hotelsearch"==this.type){options.onSelection=function(element,selected,value,input){window.setTimeout(function(){this.inFocus=false}.bind(this),10);inputValue.value=selected.itemId;inputType.value="id";inputField.addClass("selected");inputField.blur()}.bind(this)}}break;case"hotelName":var inputField=$(this.input);if(""==inputField.value.trim()){inputField.value=this.defaultText}this.offset=10;doSubmit=false;inputField.addEvent("focus",Hc.SuggestSearch.HotelName.onFocus.bind(this));inputField.addEvent("blur",Hc.SuggestSearch.HotelName.onBlur.bind(this));options.onSelection=Hc.SuggestSearch.HotelName.onSelection.bind(this);break}options.maxChoices=this.offset+2;this.autocompleter=new Hc.Autocompleter.MooTools(this.input,this.getRequestUrl(),options,focus,doSubmit);this.autocompleter.adapter=this;this.input=$(this.input);this.output=$(this.output)};Hc.SuggestSearch.prototype.setSuggestSelectUrl=function(url){this.suggestSelectUrl=url};Hc.SuggestSearch.prototype.setFieldIdPrefix=function(prefix){this.id=prefix};Hc.SuggestSearch.prototype.getTargetType=function(target){switch(target){case"kid":return"kontinent";case"lid":return"land";case"rid":return"region";case"oid":return"ort"}return""};Hc.SuggestSearch.HotelName={onSelection:function(element,selected,value,input){if(selected.itemType!=""){if(-1==this.suggestSelectUrl.indexOf("?")){window.location.href=this.suggestSelectUrl+"?itemId="+selected.itemId+"&itemType="+selected.itemType}else{window.location.href=this.suggestSelectUrl+"&itemId="+selected.itemId+"&itemType="+selected.itemType}}},onBlur:function(event){var inputField=event.target;if(""==inputField.value.trim()){inputField.value=this.defaultText;inputField.removeClass("selected");this.inFocus=false}else{inputField.addClass("selected")}},onFocus:function(event){var inputField=event.target;if(!this.inFocus){inputField.value=""}this.inFocus=true}};switchTabPane=function(containerId,tabIndex,paneId){var container=$(containerId);var tabSwitchesContainer=container.getElementById(containerId+"_tablist");var panesContainer=container.getElement("div[class^=hcwidgetTabPaneWrapper]");panesContainer.getChildren().each(function(item,index){if(item.id==paneId){item.setStyle("display","block")}else{item.setStyle("display","none")}});tabSwitchesContainer.getChildren().each(function(item,index){var radio=item.getElement("input[type=radio]");if(item.id==(containerId+"TabSwitch_"+tabIndex)){item.addClass("hcwidgetTabChecked");item.addClass("hcwidgetChecked");if($chk(radio)){item.getElement("input[type=radio]").checked=true}}else{item.removeClass("hcwidgetTabChecked");item.removeClass("hcwidgetChecked");if($chk(radio)){item.getElement("input[type=radio]").checked=false}}})};var moverInstanceForContentScrolling=null;startContentScrolling=function(containerId,scrollToTail){interruptContentScrolling();var container=$(containerId);var frame=container.getElement(".sliderFrame");var content=frame.getElement(".sliderContent");var containerWidth=frame.getStyle("width").replace("px","");var contentWidth=parseInt(content.getStyle("width").replace("px",""));var contentOffset=parseInt(content.getStyle("left").replace("px",""));if((containerWidth>=contentWidth)||(scrollToTail&&contentOffset<=(containerWidth-contentWidth))||(!scrollToTail&&contentOffset>=0)){return}if(scrollToTail){var edgePosition="upperRight";var moveOffset=containerWidth;var duration=4*(contentWidth+contentOffset-containerWidth+1)}else{var edgePosition="upperLeft";var moveOffset=0;var duration=4*(Math.abs(contentOffset)+1)}moverInstanceForContentScrolling=new Fx.Move(content,{relativeTo:frame,position:"upperLeft",edge:edgePosition,offset:{x:moveOffset,y:0},duration:duration,onStart:function(){updateScrollButtonsVisibility(containerId,scrollToTail,false)},onComplete:function(){updateScrollButtonsVisibility(containerId,scrollToTail,true)}});moverInstanceForContentScrolling.start()};interruptContentScrolling=function(){if($defined(moverInstanceForContentScrolling)){moverInstanceForContentScrolling.cancel();moverInstanceForContentScrolling=null}};updateScrollButtonsVisibility=function(containerId,scrollToTail,scrollingFinished){var container=$(containerId);var leftButton=container.getElement(".sliderButtonLeft");var rightButton=container.getElement(".sliderButtonRight");if(scrollToTail){fadeInScrollButton(leftButton);if(scrollingFinished){fadeOutScrollButton(rightButton)}}else{if(scrollingFinished){fadeOutScrollButton(leftButton)}fadeInScrollButton(rightButton)}};fadeInScrollButton=function(button){if(button.getStyle("display")=="none"){var buttonMorph=new Fx.Morph(button,{onStart:function(){button.setStyle("display","block")},duration:300});buttonMorph.start({opacity:[0,1]})}};fadeOutScrollButton=function(button){if(button.getStyle("display")=="block"){var buttonMorph=new Fx.Morph(button,{onComplete:function(){button.setStyle("display","none")},duration:300});buttonMorph.start({opacity:[1,0]})}};var UFO={req:["movie","width","height","majorversion","build"],opt:["play","loop","menu","quality","scale","salign","wmode","bgcolor","base","flashvars","devicefont","allowscriptaccess","seamlesstabbing","allowfullscreen","allownetworking"],optAtt:["id","name","align"],optExc:["swliveconnect"],ximovie:"ufo.swf",xiwidth:"215",xiheight:"138",ua:navigator.userAgent.toLowerCase(),pluginType:"",fv:[0,0],foList:[],create:function(FO,id){if(!UFO.uaHas("w3cdom")||UFO.uaHas("ieMac")){return}UFO.getFlashVersion();UFO.foList[id]=UFO.updateFO(FO);UFO.createCSS("#"+id,"visibility:hidden;");UFO.domLoad(id)},updateFO:function(FO){if(typeof FO.xi!="undefined"&&FO.xi=="true"){if(typeof FO.ximovie=="undefined"){FO.ximovie=UFO.ximovie}if(typeof FO.xiwidth=="undefined"){FO.xiwidth=UFO.xiwidth}if(typeof FO.xiheight=="undefined"){FO.xiheight=UFO.xiheight}}FO.mainCalled=false;return FO},domLoad:function(id){var _t=setInterval(function(){if((document.getElementsByTagName("body")[0]!=null||document.body!=null)&&document.getElementById(id)!=null){UFO.main(id);clearInterval(_t)}},250);if(typeof document.addEventListener!="undefined"){document.addEventListener("DOMContentLoaded",function(){UFO.main(id);clearInterval(_t)},null)}},main:function(id){var _fo=UFO.foList[id];if(_fo.mainCalled){return}UFO.foList[id].mainCalled=true;document.getElementById(id).style.visibility="hidden";if(UFO.hasRequired(id)){if(UFO.hasFlashVersion(parseInt(_fo.majorversion,10),parseInt(_fo.build,10))){if(typeof _fo.setcontainercss!="undefined"&&_fo.setcontainercss=="true"){UFO.setContainerCSS(id)}UFO.writeSWF(id)}else{if(_fo.xi=="true"&&UFO.hasFlashVersion(6,65)){UFO.createDialog(id)}}}document.getElementById(id).style.visibility="visible"},createCSS:function(selector,declaration){var _h=document.getElementsByTagName("head")[0];var _s=UFO.createElement("style");if(!UFO.uaHas("ieWin")){_s.appendChild(document.createTextNode(selector+" {"+declaration+"}"))}_s.setAttribute("type","text/css");_s.setAttribute("media","screen");_h.appendChild(_s);if(UFO.uaHas("ieWin")&&document.styleSheets&&document.styleSheets.length>0){var _ls=document.styleSheets[document.styleSheets.length-1];if(typeof _ls.addRule=="object"){_ls.addRule(selector,declaration)}}},setContainerCSS:function(id){var _fo=UFO.foList[id];var _w=/%/.test(_fo.width)?"":"px";var _h=/%/.test(_fo.height)?"":"px";UFO.createCSS("#"+id,"width:"+_fo.width+_w+"; height:"+_fo.height+_h+";");if(_fo.width=="100%"){UFO.createCSS("body","margin-left:0; margin-right:0; padding-left:0; padding-right:0;")}if(_fo.height=="100%"){UFO.createCSS("html","height:100%; overflow:hidden;");UFO.createCSS("body","margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;")}},createElement:function(el){return(UFO.uaHas("xml")&&typeof document.createElementNS!="undefined")?document.createElementNS("http://www.w3.org/1999/xhtml",el):document.createElement(el)},createObjParam:function(el,aName,aValue){var _p=UFO.createElement("param");_p.setAttribute("name",aName);_p.setAttribute("value",aValue);el.appendChild(_p)},uaHas:function(ft){var _u=UFO.ua;switch(ft){case"w3cdom":return(typeof document.getElementById!="undefined"&&typeof document.getElementsByTagName!="undefined"&&(typeof document.createElement!="undefined"||typeof document.createElementNS!="undefined"));case"xml":var _m=document.getElementsByTagName("meta");var _l=_m.length;for(var i=0;i<_l;i++){if(/content-type/i.test(_m[i].getAttribute("http-equiv"))&&/xml/i.test(_m[i].getAttribute("content"))){return true}}return false;case"ieMac":return/msie/.test(_u)&&!/opera/.test(_u)&&/mac/.test(_u);case"ieWin":return/msie/.test(_u)&&!/opera/.test(_u)&&/win/.test(_u);case"gecko":return/gecko/.test(_u)&&!/applewebkit/.test(_u);case"opera":return/opera/.test(_u);case"safari":return/applewebkit/.test(_u);default:return false}},getFlashVersion:function(){if(UFO.fv[0]!=0){return}if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){UFO.pluginType="npapi";var _d=navigator.plugins["Shockwave Flash"].description;if(typeof _d!="undefined"){_d=_d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var _m=parseInt(_d.replace(/^(.*)\..*$/,"$1"),10);var _r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;UFO.fv=[_m,_r]}}else{if(window.ActiveXObject){UFO.pluginType="ax";try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");UFO.fv=[6,0];_a.AllowScriptAccess="always"}catch(e){if(UFO.fv[0]==6){return}}try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(typeof _a=="object"){var _d=_a.GetVariable("$version");if(typeof _d!="undefined"){_d=_d.replace(/^\S+\s+(.*)$/,"$1").split(",");UFO.fv=[parseInt(_d[0],10),parseInt(_d[2],10)]}}}}},hasRequired:function(id){var _l=UFO.req.length;for(var i=0;i<_l;i++){if(typeof UFO.foList[id][UFO.req[i]]=="undefined"){return false}}return true},hasFlashVersion:function(major,release){return(UFO.fv[0]>major||(UFO.fv[0]==major&&UFO.fv[1]>=release))?true:false},writeSWF:function(id){var _fo=UFO.foList[id];var _e=document.getElementById(id);if(UFO.pluginType=="npapi"){if(UFO.uaHas("gecko")||UFO.uaHas("xml")){while(_e.hasChildNodes()){_e.removeChild(_e.firstChild)}var _obj=UFO.createElement("object");_obj.setAttribute("type","application/x-shockwave-flash");_obj.setAttribute("data",_fo.movie);_obj.setAttribute("width",_fo.width);_obj.setAttribute("height",_fo.height);var _l=UFO.optAtt.length;for(var i=0;i<_l;i++){if(typeof _fo[UFO.optAtt[i]]!="undefined"){_obj.setAttribute(UFO.optAtt[i],_fo[UFO.optAtt[i]])}}var _o=UFO.opt.concat(UFO.optExc);var _l=_o.length;for(var i=0;i<_l;i++){if(typeof _fo[_o[i]]!="undefined"){UFO.createObjParam(_obj,_o[i],_fo[_o[i]])}}_e.appendChild(_obj)}else{var _emb="";var _o=UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);var _l=_o.length;for(var i=0;i<_l;i++){if(typeof _fo[_o[i]]!="undefined"){_emb+=" "+_o[i]+'="'+_fo[_o[i]]+'"'}}_e.innerHTML='<embed type="application/x-shockwave-flash" src="'+_fo.movie+'" width="'+_fo.width+'" height="'+_fo.height+'" pluginspage="http://www.macromedia.com/go/getflashplayer"'+_emb+"></embed>"}}else{if(UFO.pluginType=="ax"){var _objAtt="";var _l=UFO.optAtt.length;for(var i=0;i<_l;i++){if(typeof _fo[UFO.optAtt[i]]!="undefined"){_objAtt+=" "+UFO.optAtt[i]+'="'+_fo[UFO.optAtt[i]]+'"'}}var _objPar="";var _l=UFO.opt.length;for(var i=0;i<_l;i++){if(typeof _fo[UFO.opt[i]]!="undefined"){_objPar+='<param name="'+UFO.opt[i]+'" value="'+_fo[UFO.opt[i]]+'" />'}}var _p=window.location.protocol=="https:"?"https:":"http:";_e.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+_objAtt+' width="'+_fo.width+'" height="'+_fo.height+'" codebase="'+_p+"//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+_fo.majorversion+",0,"+_fo.build+',0"><param name="movie" value="'+_fo.movie+'" />'+_objPar+"</object>"}}},createDialog:function(id){var _fo=UFO.foList[id];UFO.createCSS("html","height:100%; overflow:hidden;");UFO.createCSS("body","height:100%; overflow:hidden;");UFO.createCSS("#xi-con","position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");UFO.createCSS("#xi-dia","position:absolute; left:50%; top:50%; margin-left: -"+Math.round(parseInt(_fo.xiwidth,10)/2)+"px; margin-top: -"+Math.round(parseInt(_fo.xiheight,10)/2)+"px; width:"+_fo.xiwidth+"px; height:"+_fo.xiheight+"px;");var _b=document.getElementsByTagName("body")[0];var _c=UFO.createElement("div");_c.setAttribute("id","xi-con");var _d=UFO.createElement("div");_d.setAttribute("id","xi-dia");_c.appendChild(_d);_b.appendChild(_c);var _mmu=window.location;if(UFO.uaHas("xml")&&UFO.uaHas("safari")){var _mmd=document.getElementsByTagName("title")[0].firstChild.nodeValue=document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0,47)+" - Flash Player Installation"}else{var _mmd=document.title=document.title.slice(0,47)+" - Flash Player Installation"}var _mmp=UFO.pluginType=="ax"?"ActiveX":"PlugIn";var _uc=typeof _fo.xiurlcancel!="undefined"?"&xiUrlCancel="+_fo.xiurlcancel:"";var _uf=typeof _fo.xiurlfailed!="undefined"?"&xiUrlFailed="+_fo.xiurlfailed:"";UFO.foList["xi-dia"]={movie:_fo.ximovie,width:_fo.xiwidth,height:_fo.xiheight,majorversion:"6",build:"65",flashvars:"MMredirectURL="+_mmu+"&MMplayerType="+_mmp+"&MMdoctitle="+_mmd+_uc+_uf};UFO.writeSWF("xi-dia")},expressInstallCallback:function(){var _b=document.getElementsByTagName("body")[0];var _c=document.getElementById("xi-con");_b.removeChild(_c);UFO.createCSS("body","height:auto; overflow:auto;");UFO.createCSS("html","height:auto; overflow:auto;")},cleanupIELeaks:function(){var _o=document.getElementsByTagName("object");var _l=_o.length;for(var i=0;i<_l;i++){_o[i].style.display="none";for(var x in _o[i]){if(typeof _o[i][x]=="function"){_o[i][x]=null}}}}};if(typeof window.attachEvent!="undefined"&&UFO.uaHas("ieWin")){window.attachEvent("onunload",UFO.cleanupIELeaks)};var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();var map=null;var gmData=null;var GoogleMarker=new Class({initialize:function(){this.type=null;this.id=null;this.icon=1;this.label="";this.gMarker=null;this.longitude=0;this.latitude=0;this.draggable=false},setType:function(markerType){this.type=markerType},setLabel:function(markerLabel){this.label=markerLabel},setId:function(id){this.id=id},setIcon:function(icon){this.icon=icon},setGMarker:function(marker){this.gMarker=marker},setLongitude:function(longitude){this.longitude=longitude},setLatitude:function(latitude){this.latitude=latitude},setDraggable:function(draggable){this.draggable=draggable},getDraggable:function(){return this.draggable},getType:function(){return this.type},getLabel:function(){return this.label},getId:function(){return this.id},getIcon:function(){return this.icon},getGMarker:function(){return this.gMarker},getLongitude:function(){return this.longitude},getLatitude:function(){return this.latitude}});var GoogleMapsData=new Class({initialize:function(){this.hotelMarkers=new Array();this.poiMarkers=null;this.poiSwitchElement=$("gmPoiSwitch");this.hotelSwitchElement=$("gmHotelSwitch");this.selectedItem=null;this.infoWindow=null;this.hotelRequestId=1000;this.poiRequestId=1000;this.infoMarker=null},setPoiMarkers:function(poiMarkers){this.poiMarkers=poiMarkers},setHotelMarkers:function(hotelMarkers){this.hotelMarkers=hotelMarkers},addMarkers:function(jsonText){this.parseMarkers(jsonText)},setPoiVisibility:function(newState){this.poiVisibility=newState},setHotelVisibility:function(newState){this.hotelVisibility=newState},setMapConfig:function(mapConfigObj){this.gmConfig=mapConfigObj},getMapConfig:function(){if($chk(this.gmConfig)){return this.gmConfig}else{return null}},getHotelMarkers:function(){return this.hotelMarkers},getPoiMarkers:function(){return this.poiMarkers},isPoiVisible:function(){if($chk(this.poiVisibility)&&this.poiVisibility==true){return true}else{return false}},isHotelVisible:function(){if($chk(this.hotelVisibility)&&this.hotelVisibility==true){return true}else{return false}},getPoiSwitchElement:function(){return this.poiSwitchElement},getHotelSwitchElement:function(){return this.hotelSwitchElement},setSelectedItem:function(selectedItem){this.selectedItem=selectedItem},getSelectedItem:function(){return this.selectedItem},setInfoWindow:function(infoWindow){this.infoWindow=infoWindow},getInfoWindow:function(){return this.infoWindow},incrementHotelRequestId:function(){this.hotelRequestId++},getHotelRequestId:function(){if($chk(this.hotelRequestId)){return this.hotelRequestId}else{return 0}},incrementPoiRequestId:function(){this.poiRequestId++},getPoiRequestId:function(){if($chk(this.poiRequestId)){return this.poiRequestId}else{return 0}},getInfoPoiMarker:function(){return this.infoPoiMarker},setInfoPoiMarker:function(infoMarker){this.infoPoiMarker=infoMarker},getInfoHotelMarker:function(){return this.infoHotelMarker},setInfoHotelMarker:function(infoMarker){this.infoHotelMarker=infoMarker},parseMarkers:function(jsonDataText){var markerData=new Array();if(!$chk(this.poiMarkers)){this.poiMarkers=new Array()}if(!$chk(this.hotelMarkers)){this.hotelMarkers=new Array()}if($chk(jsonDataText)){var jsonData=eval(jsonDataText);for(i=0;i<jsonData.length;i++){var marker=new GoogleMarker();marker.setType(jsonData[i]["type"]);marker.setLabel(jsonData[i]["label"]);marker.setId(jsonData[i]["id"]);marker.setLongitude(jsonData[i]["lon"]);marker.setLatitude(jsonData[i]["lat"]);marker.setIcon(jsonData[i]["ico"]);marker.setDraggable(jsonData[i]["draggable"]);markerData.push(marker)}}return markerData},adjustMarkers:function(newMarkers,oldMarkers,type){var markersToKeep=new Array();for(i=0;i<oldMarkers.length;i++){if(!this.containsMarker(newMarkers,oldMarkers[i])){map.removeOverlay(oldMarkers[i].getGMarker())}else{markersToKeep.push(oldMarkers[i])}}var markersToAdd=new Array();if(newMarkers.length!=0){for(k=0;k<newMarkers.length;k++){if(!this.containsMarker(oldMarkers,newMarkers[k])){markersToAdd.push(newMarkers[k])}}}if(type=="hotel"){if(this.isHotelVisible()){this.publishMarkers(markersToAdd.reverse())}this.hotelMarkers=markersToAdd.concat(markersToKeep)}if(type=="poi"){if(this.isPoiVisible()){this.publishMarkers(markersToAdd)}this.poiMarkers=markersToAdd.concat(markersToKeep)}},containsMarker:function(markerArray,marker){if(typeof markerArray=="undefined"||!$chk(markerArray)||markerArray.length==0){return false}for(j=0;j<markerArray.length;j++){if(marker.id==markerArray[j].id&&marker.type==markerArray[j].type){return true}}return false},publishMarkers:function(markerArray){if($chk(map)&&markerArray.length!=0&&$chk(markerArray)){for(i=0;i<markerArray.length;i++){markerTemp=markerArray[i];var point=new GPoint(markerTemp.getLongitude(),markerTemp.getLatitude());var markerP=createMarker(point,markerTemp);if($chk(this.getSelectedItem())){var selected=this.getSelectedItem();if(selected.getId()==markerTemp.getId()&&selected.getType()==markerTemp.getType()){}else{map.addOverlay(markerP)}}else{map.addOverlay(markerP)}}}},publishSelected:function(){if($chk(this.getSelectedItem())){var point=new GPoint(this.getSelectedItem().getLongitude(),this.getSelectedItem().getLatitude());var markerP=createMarker(point,this.getSelectedItem());map.addOverlay(markerP)}}});var GoogleMapsConfig=new Class({initialize:function(mapData){this.maxLongitude=mapData[0]["maxLon"];this.minLongitude=mapData[0]["minLon"];this.maxLatitude=mapData[0]["maxLat"];this.minLatitude=mapData[0]["minLat"];this.latitude=mapData[0]["lat"];this.longitude=mapData[0]["lon"];this.zoomLevel=mapData[0]["zoom"];this.action=mapData[0]["action"];this.icons=mapData[0]["icons"];this.iconUrl=mapData[0]["iconUrl"];this.regionId=mapData[0]["regionId"];this.cityId=mapData[0]["cityId"];this.display=mapData[0]["display"]},getIcons:function(){return this.icons},getIconConfig:function(){if($chk(this.icons)){return this.icons}else{return null}},getIconUrl:function(){if($chk(this.iconUrl)){return this.iconUrl}else{return null}},getZoomLevel:function(){if($chk(this.zoomLevel)){return this.zoomLevel}else{return 0}},getAction:function(){if(null!=this.action){return this.action}else{return 0}},getMaxLongitude:function(){if($chk(this.maxLongitude)){return this.maxLongitude}else{return 0}},getMinLongitude:function(){if($chk(this.minLongitude)){return this.minLongitude}else{return 0}},getMaxLatitude:function(){if($chk(this.maxLatitude)){return this.maxLatitude}else{return 0}},getMinLatitude:function(){if($chk(this.minLatitude)){return this.minLatitude}else{return 0}},getLongitude:function(){if($chk(this.longitude)){return this.longitude}else{return 0}},getLatitude:function(){if($chk(this.latitude)){return this.latitude}else{return 0}},getRegionId:function(){return this.regionId},getCityId:function(){return this.cityId},setMinLongitude:function(longitude){this.minLongitude=longitude},setMinLatitude:function(latitude){this.minLatitude=latitude},setMaxLongitude:function(longitude){this.maxLongitude=longitude},setMaxLatitude:function(latitude){this.maxLatitude=latitude},getDisplay:function(){return this.display},setLatitude:function(latitude){this.latitude=latitude},setLongitude:function(longitude){this.longitude=longitude},setZoomLevel:function(zoomLevel){this.zoomLevel=zoomLevel}});initGoogleMap=function(){var mapElement=$("googleMap");if($chk(mapElement)&&GBrowserIsCompatible()){map=new GMap2(mapElement)}var initialMapConfig=null;var markersTemp="[]";if(typeof myConfig!="undefined"){var initialMapConfig=myConfig}if(typeof fixMarkers!="undefined"){var markersTemp=fixMarkers}var jsonDataElement=$("gmMarkerData");if($chk(initialMapConfig)&&$chk(map)){map.addControl(new GSmallMapControl);map.addControl(new GScaleControl(),new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(10,20)));map.addControl(new GMenuMapTypeControl());map.addMapType(G_PHYSICAL_MAP);map.removeMapType(G_SATELLITE_MAP);mapElement.setStyle("width","425px");gmData=new GoogleMapsData();gmConfig=new GoogleMapsConfig(initialMapConfig);gmData.setMapConfig(gmConfig);if(gmConfig.getDisplay()=="hotel"||gmConfig.getDisplay()=="hotelWide"){if(gmConfig.getDisplay()=="hotelWide"){mapElement.setStyle("width","615px")}gmData.setHotelVisibility(true);gmData.adjustMarkers(gmData.parseMarkers(markersTemp),new Array(),"hotel")}else{if(gmConfig.getDisplay()=="poi"){gmData.setPoiVisibility(true);gmData.adjustMarkers(gmData.parseMarkers(markersTemp),new Array(),"poi")}else{if(gmConfig.getDisplay()=="access"){mapElement.setStyle("width","622px");mapElement.setStyle("height","420px");var item=gmData.parseMarkers(markersTemp)[0];var point=new GPoint(item.getLongitude(),item.getLatitude());var markerP=createMarker(point,item);map.addOverlay(markerP);if($("geodataLat")&&$("geodataLng")){$("geodataLat").value=item.getLatitude();$("geodataLng").value=item.getLongitude()}GEvent.addListener(markerP,"dragend",function(latlng){if($("geodataLat")&&$("geodataLng")){$("geodataLat").value=latlng.lat();$("geodataLng").value=latlng.lng()}});gmConfig.setLatitude(item.getLatitude());gmConfig.setLongitude(item.getLongitude());gmConfig.setZoomLevel(14);map.setMapType(G_HYBRID_MAP)}else{if(gmConfig.getDisplay()=="detail"){mapElement.setStyle("width","900px");mapElement.setStyle("height","420px");gmData.setHotelVisibility(false);gmData.setPoiVisibility(false);var selectedItem=gmData.parseMarkers(markersTemp);if(selectedItem[0].getType()=="hotel"){var poiSwitch=$("poiSwitchLightbox");if($chk(poiSwitch)){gmData.setPoiVisibility(true)}}gmData.setSelectedItem(selectedItem[0]);if(gmConfig.getAction()!="insert"){gmData.publishSelected()}gmConfig.setLatitude(selectedItem[0].getLatitude());gmConfig.setLongitude(selectedItem[0].getLongitude());gmConfig.setZoomLevel(16);map.setMapType(G_HYBRID_MAP);GEvent.addListener(map,"moveend",updateMarkersOnEvent)}}}}if(gmConfig.getAction()=="insert"){gmConfig.setZoomLevel(14);var sw=new GLatLng(gmConfig.getMinLatitude(),gmConfig.getMinLongitude());var no=new GLatLng(gmConfig.getMaxLatitude(),gmConfig.getMaxLongitude());bounds=new GLatLngBounds(sw,no);var zoomLevel=map.getBoundsZoomLevel(bounds);map.setCenter(bounds.getCenter(),zoomLevel);if(gmConfig.getCityId()!=0){map.setCenter(new GLatLng(gmConfig.getLatitude(),gmConfig.getLongitude()),gmConfig.getZoomLevel());var bounds=map.getBounds();var sw=bounds.getSouthWest();var no=bounds.getNorthEast();gmData.getMapConfig().setMinLongitude(sw.lng());gmData.getMapConfig().setMinLatitude(sw.lat());gmData.getMapConfig().setMaxLongitude(no.lng());gmData.getMapConfig().setMaxLatitude(no.lat())}}else{if(gmConfig.getZoomLevel()==0){var sw=new GLatLng(gmConfig.getMinLatitude(),gmConfig.getMinLongitude());var no=new GLatLng(gmConfig.getMaxLatitude(),gmConfig.getMaxLongitude());bounds=new GLatLngBounds(sw,no);var zoomLevel=map.getBoundsZoomLevel(bounds);map.setCenter(bounds.getCenter(),zoomLevel)}else{map.setCenter(new GLatLng(gmConfig.getLatitude(),gmConfig.getLongitude()),gmConfig.getZoomLevel());var bounds=map.getBounds();var sw=bounds.getSouthWest();var no=bounds.getNorthEast();gmData.getMapConfig().setMinLongitude(sw.lng());gmData.getMapConfig().setMinLatitude(sw.lat());gmData.getMapConfig().setMaxLongitude(no.lng());gmData.getMapConfig().setMaxLatitude(no.lat())}}if(gmConfig.getDisplay()=="hotelWide"){}}var gmPoiSwitch=$("gmPoiSwitch");if($chk(gmPoiSwitch)){if($chk(gmData.getSelectedItem())&&gmData.getSelectedItem().getType()=="hotel"){gmPoiSwitch.onclick=removePoisClick;gmPoiSwitch.checked=true}else{gmPoiSwitch.onclick=updatePoiMarkers}}var gmHotelSwitch=$("gmHotelSwitch");if($chk(gmHotelSwitch)){gmHotelSwitch.onclick=updateHotelMarkers}return map};resizeGoogleMap=function(){var gmContainer=$("gmContainer");var googleMap=$("googleMap");var gmContainerMap=googleMap.getParent();var gmSelections=$("locationMapElements");var gmControls=$("gmControls");var gmResizerSwitchEnlarge=$("gmResizerSwitchEnlarge");var gmResizerSwitchShrink=$("gmResizerSwitchShrink");if(googleMap.getStyle("width")=="425px"){if($chk(gmContainerMap)&&$defined(gmContainerMap)&&gmContainerMap.className=="locationMapMap floatRight"){gmContainerMap.setStyle("width","615px")}googleMap.setStyle("width","615px");gmControls.setStyle("width","615px");gmSelections.setStyle("display","none");gmResizerSwitchShrink.setStyle("display","block");gmResizerSwitchEnlarge.setStyle("display","none")}else{if($chk(gmContainerMap)&&$defined(gmContainerMap)&&gmContainerMap.className=="locationMapMap floatRight"){gmContainerMap.setStyle("width","425px")}googleMap.setStyle("width","425px");gmControls.setStyle("width","425px");gmSelections.setStyle("display","block");gmResizerSwitchEnlarge.setStyle("display","block");gmResizerSwitchShrink.setStyle("display","none")}};bindIcons=function(){if(typeof fixMarkers!="undefined"){var markersTemp=fixMarkers;if(typeof myConfig!="undefined"){var initialMapConfig=myConfig}gmConfig=new GoogleMapsConfig(initialMapConfig);gmData=new GoogleMapsData();gmData.setMapConfig(gmConfig);markersTemp=gmData.parseMarkers(fixMarkers);for(i=0;i<markersTemp.length;i++){marker=markersTemp[i];relativeUri=getRequestUrl(marker.getType(),marker.getId());marker.uri=relativeUri;var hotelFlag=$("hotel_"+marker.getId());if(null!=hotelFlag){hotelFlag.onclick=function(){$("hideLocationMap").toggleOn();google.load("maps","2",{callback:initGoogleMap,language:"de"});getMarkerInfo(marker,marker.uri);scrollSmooth("paginateAnchor")}}}}};createMarker=function(point,marker){relativeUri=getRequestUrl(marker.getType(),marker.getId());var icon=new GIcon();var icons=gmData.getMapConfig().getIcons();icon.image=gmData.getMapConfig().getIconUrl()+icons[marker.getIcon()];icon.iconSize=new GSize(19,34);icon.iconAnchor=new GPoint(19/2,34);icon.infoWindowAnchor=new GPoint(19/2,34/2);markerOptions={draggable:marker.getDraggable(),bouncy:false,zIndexProcess:markerIndex};if(marker.getType()=="poi"){icon.iconSize=new GSize(23,23);icon.iconAnchor=new GPoint(23/2,23);icon.infoWindowAnchor=new GPoint(23/2,23/2);markerOptions={draggable:marker.getDraggable(),bouncy:false,zIndexProcess:markerIndexPoi}}if(marker.getIcon()==6){icon.iconSize=new GSize(23,44);icon.iconAnchor=new GPoint(23/2,44);icon.infoWindowAnchor=new GPoint(23/2,44/2);markerOptions={draggable:false,bouncy:false,zIndexProcess:markerIndex}}if(icons[marker.getIcon()]!=undefined){markerOptions.icon=icon}markerOptions.title=marker.getLabel();var gMarker=new GMarker(point,markerOptions);gMarker.uri=relativeUri;GEvent.addListener(gMarker,"click",function(){getMarkerInfo(gMarker,gMarker.uri)});var hotelFlag=$("hotel_"+marker.getId());if(null!=hotelFlag){hotelFlag.onclick=function(){gaTrackEvent("Suchmaske_Hotel","numerierte_Karten_Icons");if(document.getElementById("hideLocationMap").style.display!="block"){$("hideLocationMap").toggleOn()}if(typeof myConfig!="undefined"){var initialMapConfig=myConfig}gmConfig=new GoogleMapsConfig(initialMapConfig);gmData=new GoogleMapsData();gmData.setMapConfig(gmConfig);gmConfig.setZoomLevel(8);var sw=new GLatLng(gmConfig.getMinLatitude(),gmConfig.getMinLongitude());var no=new GLatLng(gmConfig.getMaxLatitude(),gmConfig.getMaxLongitude());bounds=new GLatLngBounds(sw,no);var zoomLevel=map.getBoundsZoomLevel(bounds);map.setCenter(bounds.getCenter(),zoomLevel);map.setCenter(new GLatLng(gmConfig.getLatitude(),gmConfig.getLongitude()),gmConfig.getZoomLevel());if(gmConfig.getCityId()!=0){map.setCenter(new GLatLng(gmConfig.getLatitude(),gmConfig.getLongitude()),12);var bounds=map.getBounds();var sw=bounds.getSouthWest();var no=bounds.getNorthEast();gmData.getMapConfig().setMinLongitude(sw.lng());gmData.getMapConfig().setMinLatitude(sw.lat());gmData.getMapConfig().setMaxLongitude(no.lng());gmData.getMapConfig().setMaxLatitude(no.lat())}map.checkResize();getMarkerInfo(gMarker,gMarker.uri);scrollSmooth("paginateAnchor")}}if(marker.getType()=="user"){var userFlag=$("gmUserPin_"+marker.getId());if(null!=userFlag){userFlag.onclick=function(){getMarkerInfo(gMarker,gMarker.uri);scrollSmooth("paginateAnchor")}}}if(marker.getType()=="poi"){var poiFlag=$("gmPoiPin_"+marker.getId());if(null!=poiFlag){poiFlag.onclick=function(){getMarkerInfo(gMarker,gMarker.uri);scrollSmooth("paginateAnchor",false)}}}marker.setGMarker(gMarker);return gMarker};getMarkerInfo=function(marker,relativeUrl){gmData.setInfoPoiMarker(marker);var htmlRequest=new Request.HTML({method:"get",url:relativeUrl,onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){marker.openInfoWindowHtml(responseHTML)},onFailure:function(xhr){}});htmlRequest.send()};getRequestUrl=function(type,id){if($chk(gmData)){if(gmData.getMapConfig().getDisplay()=="detail"){return"map?action=gmdetail&id="+id+"&type="+type+"&view=detail"}if(type=="hoteluser"){departureDateElement=document.getElementById("departureHidden");returnDateElement=document.getElementById("returnHidden");if(null!=departureDateElement&&null!=returnDateElement){return"map?action=gmdetail&hotelId="+id+"&type=hoteluser&returnDate="+returnDateElement.value+"&departureDate="+departureDateElement.value}}}return"map?action=gmdetail&id="+id+"&type="+type+"&view=site"};markerIndex=function(){return 1};markerIndexPoi=function(){return 0};removePoisClick=function(){if($chk(gmData)){gmData.setPoiVisibility(false);gmData.adjustMarkers(new Array(),gmData.getPoiMarkers(),"poi");if($chk(gmData.getPoiSwitchElement())){gmData.getPoiSwitchElement().onclick=updatePoiMarkers;gmData.getPoiSwitchElement().checked=""}}};removeHotelsClick=function(){if($chk(gmData)){gmData.setHotelVisibility(false);gmData.adjustMarkers(new Array(),gmData.getHotelMarkers(),"hotel");if($chk(gmData.getHotelSwitchElement())){gmData.getHotelSwitchElement().onclick=updateHotelMarkers;gmData.getHotelSwitchElement().checked=""}}};updatePoiMarkers=function(){gmData.incrementPoiRequestId();gmData.getPoiSwitchElement().onclick="";relativeUrl="map?action=updatepoi&maxLon="+gmData.getMapConfig().getMaxLongitude()+"&minLon="+gmData.getMapConfig().getMinLongitude()+"&maxLat="+gmData.getMapConfig().getMaxLatitude()+"&minLat="+gmData.getMapConfig().getMinLatitude();if($chk(gmData.getMapConfig().getRegionId())){relativeUrl+="&regionId="+gmData.getMapConfig().getRegionId()}if($chk(gmData.getMapConfig().getCityId())){relativeUrl+="&cityId="+gmData.getMapConfig().getCityId()}relativeUrl+="&requestId="+gmData.getPoiRequestId();var jsonRequest=new Request.JSON({method:"get",async:false,url:relativeUrl,onSuccess:function(responseJSON,responseText){if(responseJSON.requestId==gmData.getPoiRequestId()){gmData.setPoiVisibility(true);gmData.adjustMarkers(gmData.parseMarkers(responseJSON.markers),gmData.getPoiMarkers(),"poi");var poiSwitch=gmData.getPoiSwitchElement();poiSwitch.setStyle("checked","checked")}gmData.getPoiSwitchElement().onclick=removePoisClick},onFailure:function(xhr){}});jsonRequest.send()};updateHotelMarkers=function(){gmData.incrementHotelRequestId();gmData.getHotelSwitchElement().onclick="";relativeUrl="map?action=updatehotel&maxLon="+gmData.getMapConfig().getMaxLongitude()+"&minLon="+gmData.getMapConfig().getMinLongitude()+"&maxLat="+gmData.getMapConfig().getMaxLatitude()+"&minLat="+gmData.getMapConfig().getMinLatitude();if($chk(gmData.getMapConfig().getRegionId())){relativeUrl+="&regionId="+gmData.getMapConfig().getRegionId()}if($chk(gmData.getMapConfig().getCityId())){relativeUrl+="&cityId="+gmData.getMapConfig().getCityId()}relativeUrl+="&requestId="+gmData.getHotelRequestId();var jsonRequest=new Request.JSON({method:"get",async:false,url:relativeUrl,onSuccess:function(responseJSON,responseText){if(responseJSON.requestId==gmData.getHotelRequestId()){gmData.setHotelVisibility(true);gmData.adjustMarkers(gmData.parseMarkers(responseJSON.markers),gmData.getHotelMarkers(),"hotel");var hotelSwitch=gmData.getHotelSwitchElement();hotelSwitch.setStyle("checked","checked")}gmData.getHotelSwitchElement().onclick=removeHotelsClick},onFailure:function(xhr){}});jsonRequest.send()};updateMarkersOnEvent=function(){if($chk(gmData)&&$chk(map)){var bounds=map.getBounds();var sw=bounds.getSouthWest();var no=bounds.getNorthEast();gmData.getMapConfig().setMinLongitude(sw.lng());gmData.getMapConfig().setMinLatitude(sw.lat());gmData.getMapConfig().setMaxLongitude(no.lng());gmData.getMapConfig().setMaxLatitude(no.lat());if(gmData.isHotelVisible()){updateHotelMarkers()}if(gmData.isPoiVisible()){updatePoiMarkers()}}};addMarkerForInsert=function(){target=new GMarker(map.getCenter(),{draggable:true});map.addOverlay(target)};saveMarkerCoordinates=function(relativeUrl,successUrl,successNotice,confirmText){if(!confirm(confirmText)){return}var lon=target.getPoint().x;var lat=target.getPoint().y;relativeUrl=relativeUrl+"&lon="+lon+"&lat="+lat;var htmlRequest=new Request.HTML({method:"get",url:relativeUrl,onSuccess:function(responseTree,responseElements,responseHTML,responseJavaScript){window.setTimeout(function(){alert(successNotice);location.href=successUrl},1500)}});htmlRequest.send()};var google_adnum=0;function google_ad_request_done(google_ads){var s="";var i;if(google_ads.length==0){return}if(google_ads[0].type=="flashXXXXX"){s+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+google_ad.image_width+'" HEIGHT="'+google_ad.image_height+'"> <PARAM NAME="movie" VALUE="'+google_ad.image_url+'"><PARAM NAME="quality" VALUE="high"><PARAM NAME="AllowScriptAccess" VALUE="never"><EMBED src="'+google_ad.image_url+'" WIDTH="'+google_ad.image_width+'" HEIGHT="'+google_ad.image_height+'" TYPE="application/x-shockwave-flash" AllowScriptAccess="never"  PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>'}else{if(google_ads[0].type=="html"){s+=google_ads[0].snippet}else{if(google_ads.length==1){s+='<a href="'+google_info.feedback_url+'" class="googleABTestClick" style="color:000000">Ads by Google</a><br> <a style="text-decoration:none" class="googleABTestClick" href="'+google_ads[0].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+google_ads[0].visible_url+'\';return true"> <span id="GoogleAdsTitel"> <b>'+google_ads[0].line1+'</b><br></span></a> <span id="GoogleAdsText">'+google_ads[0].line2+"&nbsp;"+google_ads[0].line3+'</span> <span><a id="GoogleAdsLink" class="googleABTestClick" href="'+google_ads[0].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+google_ads[0].visible_url+"';return true\">"+google_ads[0].visible_url+"</span></a>"}else{if(google_ads.length==2){s+='<a href="'+google_info.feedback_url+'" class="googleABTestClick" style="color:000000">Ads by Google</a><br><div style="float:left; width:300px;"> <a style="text-decoration:none" class="googleABTestClick" href="'+google_ads[0].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+google_ads[0].visible_url+'\';return true"> <span id="GoogleAdsTitel"> <b>'+google_ads[0].line1+'</b><br></span></a> <span id="GoogleAdsText">'+google_ads[0].line2+"&nbsp;"+google_ads[0].line3+'</span> <span><a id="GoogleAdsLink" class="googleABTestClick" href="'+google_ads[0].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+google_ads[0].visible_url+"';return true\">"+google_ads[0].visible_url+'</a></span></div><div style="float:right; width:300px;"> <a style="text-decoration:none" class="googleABTestClick" href="'+google_ads[1].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+google_ads[1].visible_url+'\';return true"> <span id="GoogleAdsTitel"> <b>'+google_ads[1].line1+'</b><br></span></a> <span id="GoogleAdsText">'+google_ads[1].line2+"&nbsp;"+google_ads[1].line3+'</span> <span><a id="GoogleAdsLink" class="googleABTestClick" href="'+google_ads[1].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+google_ads[1].visible_url+"';return true\">"+google_ads[1].visible_url+'</a></span></div><div class="clearFix"></div>'}else{if(google_ads.length>1){s+='<a href="'+google_info.feedback_url+'" class="googleABTestClick" style="color:000000">Ads by Google</a><br>';for(i=0;i<google_ads.length;++i){s+='<a style="text-decoration:none" class="googleABTestClick" href="'+google_ads[i].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+google_ads[i].visible_url+'\';return true"> <span id="GoogleAdsTitel"> <b>'+google_ads[i].line1+'</b><br></span></a> <span id="GoogleAdsText">'+google_ads[i].line2+"&nbsp;"+google_ads[i].line3+'&nbsp;</span> <span><a id="GoogleAdsLink" class="googleABTestClick" href="'+google_ads[i].url+'" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to '+google_ads[i].visible_url+"';return true\">"+google_ads[i].visible_url+"</span></a>";if(i<google_ads.length-1){s+="<br><br>"}}}}}if(google_ads[0].bidtype=="CPC"){google_adnum=google_adnum+google_ads.length}}}document.write(s);return};function addScript(url){var obj=new JSONscriptRequest(url);obj.buildScriptTag();obj.addScriptTag()}function gfData(obj){var i=0;var content='<ul class="listAdditionalGutefrage">';while(i<obj.results.length){var headline="";var desc="";content=content+'<li><a class="linkItem" href="'+obj.results[i].url+'">';headline=""+obj.results[i].title+"";content=content+headline+"<br/>";if(obj.results[i].body){content=content+'<p class="gfp">'+obj.results[i].body+"</p><br/>"}content=content+"</a></li>";if(obj.results[i].subresults&&obj.results[i].subresults.length>0){content=content+'<p class="gfp"><b>Antworten</b></p>';content=content+'<ul class="gful">';var j=0;while(j<obj.results[i].subresults.length){if(obj.results[i].subresults[j].body){content=content+'<li class="gfli">'+obj.results[i].subresults[j].body+"</li>"}j++}content=content+"</ul>"}i++}content=content+"</ul>";document.getElementById("gfContent").innerHTML=content;var sourceURL=escape(window.location);var imageUrl="http://www.gutefrage.net/images/mashupWizard/blank.gif?source="+sourceURL+"&apiquery="+escape(url)+"t=1263994011"};Hc.register("Hc.Facebook");Hc.Facebook.alreadyLoaded=false;Hc.Facebook.initializeFacebook=function(apiKey,receiverRoute,appSettings){if(!Hc.Facebook.alreadyLoaded){Hc.Facebook.alreadyLoaded=true;FB.init(apiKey,receiverRoute,appSettings)}};Hc.Facebook.reloadAfterSuccess=function(){window.setTimeout(function(){parent.location.reload()},5)};Hc.Facebook.redirectAfterLogin=function(url){window.location.href=url};window.addEvent("domready",function(){var newsletterSubscribe=$("subscribenewslettersimple");if(!newsletterSubscribe){return}$("subscribenewslettersimple").addEvent("submit",function(e){e.stop();showLoadingAnimation();this.set("send",{onComplete:function(response){var messageContainer=$("subscribenewslettersimpleMessages");messageContainer.set("html",response);messageContainer.removeClass("displayNone");hideLoadingAnimation()}});this.send()})});