(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context)};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context)}else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3]){return jQuery().find(selector)}return jQuery(elem)}selector=[]}}else{return jQuery(context).find(selector)}}else{if(jQuery.isFunction(selector)){return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector)}}return this.setArray(jQuery.makeArray(selector))},jquery:"1.2.6",size:function(){return this.length},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num]},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this},each:function(callback,args){return jQuery.each(this,callback,args)},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this)},attr:function(name,value,type){var options=name;if(name.constructor==String){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name)}else{options={};options[name]=value}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))}})},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined}return this.attr(key,value,"curCSS")},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])}})});return ret},wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild)}})},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})},end:function(){return this.prevObject||jQuery([])},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem)});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems)},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0]}else{return this.cloneNode(true)}});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null}});if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return }var events=jQuery.data(this,"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data)}}})}return ret},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)})||jQuery.multiFilter(selector,this))},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true))}else{selector=jQuery.multiFilter(selector,this)}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector})},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=="string"?jQuery(selector):jQuery.makeArray(selector))))},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0},hasClass:function(selector){return this.is("."+selector)},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one){return value}values.push(value)}}return values}else{return(this[0].value||"").replace(/\r/g,"")}}return undefined}if(value.constructor==Number){value+=""}return this.each(function(){if(this.nodeType!=1){return }if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0)}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)});if(!values.length){this.selectedIndex=-1}}else{this.value=value}}})},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value)},replaceWith:function(value){return this.after(value).remove()},eq:function(i){return this.slice(i,i+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},andSelf:function(){return this.add(this.prevObject)},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key)}return data===undefined&&parts[1]?this.data(parts[0]):data}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)})}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse){elems.reverse()}}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"))}var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem)}else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove())}callback.call(obj,elem)}});scripts.each(evalScript)})}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}if(elem.parentNode){elem.parentNode.removeChild(elem)}}function now(){return +new Date}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2}if(typeof target!="object"&&typeof target!="function"){target={}}if(length==i){target=this;--i}for(;i<length;i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];if(target===copy){continue}if(deep&&copy&&typeof copy=="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy)}else{if(copy!==undefined){target[name]=copy}}}}}return target};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery}return jQuery},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"")},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie){script.text=data}else{script.appendChild(document.createTextNode(data))}head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id){id=elem[expando]=++uuid}if(name&&!jQuery.cache[id]){jQuery.cache[id]={}}if(data!==undefined){jQuery.cache[id][name]=data}return name?jQuery.cache[id][name]:id},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id]){break}if(!name){jQuery.removeData(elem)}}}else{try{delete elem[expando]}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando)}}delete jQuery.cache[id]}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object){if(callback.apply(object[name],args)===false){break}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break}}}}else{if(length==undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i)}return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className}})},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className)}).join(" "):""}},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(var name in options){elem.style[name]=old[name]}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0});val-=Math.round(padding+border)}if(jQuery(elem).is(":visible")){getWH()}else{jQuery.swap(elem,props,getWH)}return Math.max(0,val)}return jQuery.curCSS(elem,name,force)},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari){return false}var ret=defaultView.getComputedStyle(elem,null);return !ret||ret.getPropertyValue("color")==""}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save}if(name.match(/float/i)){name=styleFloat}if(!force&&style&&style[name]){ret=style[name]}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float"}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name)}else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode){stack.unshift(a)}for(;i<stack.length;i++){if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block"}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++){if(swap[i]!=null){stack[i].style.display=swap[i]}}}if(name=="opacity"&&ret==""){ret="1"}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft}}}}return ret},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}jQuery.each(elems,function(i,elem){if(!elem){return }if(elem.constructor==Number){elem+=""}if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">"});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--){div=div.lastChild}if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild)}}elem=jQuery.makeArray(div.childNodes)}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return }if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem)}else{ret=jQuery.merge(ret,elem)}});return ret},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed"}elem[name]=value}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue}return elem[name]}if(msie&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value)}if(set){elem.setAttribute(name,""+value)}var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")")}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()});if(set){elem[name]=value}return elem[name]},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call){ret[0]=array}else{while(i){ret[--i]=array[i]}}}return ret},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}return -1},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem}}}else{while(elem=second[i++]){first[pos++]=elem}}return first},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i])}}}catch(e){ret=array}return ret},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i])}}return ret},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null){ret[ret.length]=value}}return ret.concat.apply([],ret)}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode},parents:function(elem){return jQuery.dir(elem,"parentNode")},next:function(elem){return jQuery.nth(elem,2,"nextSibling")},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret)}return this.pushStack(jQuery.unique(ret))}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++){jQuery(args[i])[original](this)}})}});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1){this.removeAttribute(name)}},addClass:function(classNames){jQuery.className.add(this,classNames)},removeClass:function(classNames){jQuery.className.remove(this,classNames)},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames)},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){jQuery(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)}});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px")}});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2])},"#":function(a,i,m){return a.getAttribute("id")==m[2]},":":{lt:function(a,i,m){return i<m[3]-0},gt:function(a,i,m){return i>m[3]-0},nth:function(a,i,m){return m[3]-0==i},eq:function(a,i,m){return m[3]-0==i},first:function(a,i){return i==0},last:function(a,i,m,r){return i==r.length-1},even:function(a,i){return i%2==0},odd:function(a,i){return i%2},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a},"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling")},parent:function(a){return a.firstChild},empty:function(a){return !a.firstChild},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"},enabled:function(a){return !a.disabled},disabled:function(a){return a.disabled},checked:function(a){return a.checked},selected:function(a){return a.selected||jQuery.attr(a,"selected")},text:function(a){return"text"==a.type},radio:function(a){return"radio"==a.type},checkbox:function(a){return"checkbox"==a.type},file:function(a){return"file"==a.type},password:function(a){return"password"==a.type},submit:function(a){return"submit"==a.type},image:function(a){return"image"==a.type},reset:function(a){return"reset"==a.type},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button")},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},has:function(a,i,m){return jQuery.find(m[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem}).length}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r)}return cur},find:function(t,context){if(typeof t!="string"){return[t]}if(context&&context.nodeType!=1&&context.nodeType!=9){return[]}context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++){for(var c=ret[i].firstChild;c;c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c)}}}ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0){continue}foundToken=true}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id]){break}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true}r.push(n)}if(m=="+"){break}}}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length)}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]]}else{re2=quickClass;m=re2.exec(t)}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0]}ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[]}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param"}r=jQuery.merge(r,ret[i].getElementsByTagName(tag))}if(m[1]=="."){r=jQuery.classFilter(r,m[2])}if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break}}r=tmp}ret=r}t=t.replace(re2,"")}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t)}}if(t){ret=[]}if(ret&&context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);return done},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass){tmp.push(r[i])}}return tmp},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break}}if(!m){break}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3])}else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not)}else{if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||""}if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a)}}r=tmp}else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++}}merge[id]=true}var add=false;if(first==0){if(node.nodeIndex==last){add=true}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true}}if(add^not){tmp.push(node)}}r=tmp}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object"){fn=fn[m[2]]}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}")}r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r)},not)}}}}}return{r:r,t:t}},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur)}cur=cur[dir]}return matched},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType==1&&++num==result){break}}return cur},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n)}}return r}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return }if(jQuery.browser.msie&&elem.setInterval){elem=window}if(!handler.guid){handler.guid=this.guid++}if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments)});handler.data=data}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered){return jQuery.event.handle.apply(arguments.callee.elem,arguments)}});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)}}}}handlers[handler.guid]=handler;jQuery.event.global[type]=true});elem=null},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return }var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""))}}else{if(types.type){handler=types.handler;types=types.type}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler){delete events[type][handler.guid]}else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler]}}}for(ret in events[type]){break}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false)}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))}}}ret=null;delete events[type]}}})}for(ret in events){break}if(!ret){var handle=jQuery.data(elem,"handle");if(handle){handle.elem=null}jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle")}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true}if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data)}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined}var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true}data[0].type=type;if(exclusive){data[0].exclusive=true}var handle=jQuery.data(elem,"handle");if(handle){val=handle.apply(elem,data)}if((!fn||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false}if(event){data.shift()}if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined){val=ret}}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;try{elem[type]()}catch(e){}}this.triggered=false}return val},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false){val=ret}if(ret===false){event.preventDefault();event.stopPropagation()}}}return val},fix:function(event){if(event[expando]==true){return event}var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--){event[props[i]]=originalEvent[props[i]]}event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault()}originalEvent.returnValue=false};event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation()}originalEvent.cancelBubble=true};event.timeStamp=event.timeStamp||now();if(!event.target){event.target=event.srcElement||document}if(event.target.nodeType==3){event.target=event.target.parentNode}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollcenter||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}return event},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy},special:{ready:{setup:function(){bindReady();return },teardown:function(){return }},mouseenter:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true},handler:function(event){if(withinElement(event,this)){return true}event.type="mouseenter";return jQuery.event.handle.apply(this,arguments)}},mouseleave:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true},handler:function(event){if(withinElement(event,this)){return true}event.type="mouseleave";return jQuery.event.handle.apply(this,arguments)}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data)})},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments)});return this.each(function(){jQuery.event.add(this,type,one,fn&&data)})},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)})},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn)})},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn)},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.event.proxy(fn,args[i++])}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false}))},hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut)},ready:function(fn){bindReady();if(jQuery.isReady){fn.call(document,jQuery)}else{jQuery.readyList.push(function(){return fn.call(this,jQuery)})}return this}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document)});jQuery.readyList=null}jQuery(document).triggerHandler("ready")}}});var readyBound=false;function bindReady(){if(readyBound){return }readyBound=true;if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false)}if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return }try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return }jQuery.ready()})()}if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return }for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return }}jQuery.ready()},false)}if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady){return }if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return }if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length}if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return }jQuery.ready()})()}jQuery.event.add(window,"load",jQuery.ready)}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)}});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem){try{parent=parent.parentNode}catch(error){parent=elem}}return parent==elem};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind()});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!="string"){return this._load(url)}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}callback=callback||function(){};var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else{params=jQuery.param(params);type="POST"}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText)}self.each(callback,[res.responseText,status,res])}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data)}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}}s.dataType="json"}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}if(head){head.removeChild(script)}}}if(s.dataType=="script"&&s.cache==null){s.cache=false}if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script)}}}head.appendChild(script);return undefined}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)}else{xhr.open(type,s.url,s.async)}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType)}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s])}var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter)}catch(e){status="parsererror"}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified")}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes}if(!jsonp){success()}}else{jQuery.handleError(s,xhr,status)}complete();if(s.async){xhr=null}}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort();if(!requestDone){onreadystatechange("timeout")}}},s.timeout)}}try{xhr.send(s.data)}catch(e){jQuery.handleError(s,xhr,null,e)}if(!s.async){onreadystatechange()}function success(){if(s.success){s.success(data,status)}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s])}}function complete(){if(s.complete){s.complete(xhr,status)}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s])}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}return xhr},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e)}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e])}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined}catch(e){}return false},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined}catch(e){}return false},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror"}if(filter){data=filter(data,type)}if(type=="script"){jQuery.globalEval(data)}if(type=="json"){data=eval("("+data+")")}return data},param:function(a){var s=[];if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value))})}else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this))})}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]))}}}return s.join("&").replace(/%20/g,"+")}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none"){this.style.display="block"}elem.remove()}}).end()},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none"}).end()},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]()})},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback)},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback)},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback)},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback)},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback)},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false}var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this)}if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}}if(opt.overflow!=null){this.style.overflow="hidden"}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop)}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start}e.custom(start,end,unit)}else{e.custom(start,val,"")}}});return true})},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx"}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type)}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn)}else{queue(this,type).push(fn);if(queue(this,type).length==1){fn.call(this)}}})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true)}timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}return this}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array){q=jQuery.data(elem,type+"queue",jQuery.makeArray(array))}}return q};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length){q[0].call(this)}})};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()}if(jQuery.isFunction(opt.old)){opt.old.call(this)}};return opt},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block"}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop]}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px"}jQuery(this.elem).show()},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){this.elem.style.display="none"}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p])}}}if(done){this.options.complete.call(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now},scrollTop:function(fx){fx.elem.scrollTop=fx.now},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem){with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop)}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent)}if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop)}if(mozilla&&css(parent,"overflow")!="visible"){border(parent)}parent=parent.parentNode}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop)}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop))}}results={top:top,left:left}}}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true))}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0}return results};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,"marginTop");offset.left-=num(this,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent}return jQuery(offsetParent)}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){if(!this[0]){return }return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method]}});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br)};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0)}})})();jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}};(function(H){H.fn.indexer=function(I){return this[0]&&E(this[0],I)||null};H.indexer=function(I){return E(document,I)};var D=H.event,A=D.special,G=H.listen=function(J,L,I,K){if(typeof L!="object"){K=I;I=L;L=document}F(J.split(/\s+/),function(N){N=G.fixes[N]||N;var M=E(L,N)||E(L,N,new B(N,L));M.append(I,K);M.start()})},E=function(J,I,K){return H.data(J,I+".indexer",K)};H.extend(G,{regex:/^((?:\w*?|\*))(?:([#.])([\w-]+))?$/,fixes:{focus:"focusin",blur:"focusout"},cache:function(I){this.caching=I}});H.each(G.fixes,function(J,I){A[I]={setup:function(){if(H.browser.msie){return false}this.addEventListener(J,A[I].handler,true)},teardown:function(){if(H.browser.msie){return false}this.removeEventListener(J,A[I].handler,true)},handler:function(K){arguments[0]=K=D.fix(K);K.type=I;return D.handle.apply(this,arguments)}}});H.fn.listen=function(J,I,K){return this.each(function(){G(J,this,I,K)})};function B(I,J){H.extend(this,{ids:{},tags:{},listener:J,event:I});this.id=B.instances.push(this)}B.instances=[];B.prototype={constructor:B,handle:function(J){var I=J.stopPropagation;J.stopPropagation=function(){J.stopped=true;I.apply(this,arguments)};E(this,J.type).parse(J);J.stopPropagation=I;I=J.data=null},on:false,bubbles:false,start:function(){if(!this.on){D.add(this.listener,this.event,this.handle);this.on=true}},stop:function(){if(this.on){D.remove(this.listener,this.event,this.handle);this.on=false}},cache:function(J,I){return H.data(J,"listenCache_"+this.id,I)},parse:function(L){var K=L.data||L.target,J=arguments,I;if(!G.caching||!(I=this.cache(K))){I=[];if(K.id&&this.ids[K.id]){C(I,this.ids[K.id])}F([K.nodeName,"*"],function(M){var N=this.tags[M];if(N){F((K.className+" *").split(" "),function(O){if(O&&N[O]){C(I,N[O])}})}},this);if(G.caching){this.cache(K,I)}}if(I[0]){F(I,function(M){if(M.apply(K,J)===false){L.preventDefault();L.stopPropagation()}})}if(!L.stopped&&(K=K.parentNode)&&(K.nodeName=="A"||this.bubbles&&K!=this.listener)){L.data=K;this.parse(L)}I=J=K=null},append:function(I,J){F(I.split(/\s*,\s*/),function(M){var N=G.regex.exec(M);if(!N){throw'$.listen > "'+M+'" is not a supported selector.'}var O=N[2]=="#"&&N[3],L=N[1].toUpperCase()||"*",K=N[3]||"*";if(O){(this.ids[O]||(this.ids[O]=[])).push(J)}else{if(L){L=this.tags[L]=this.tags[L]||{};(L[K]||(L[K]=[])).push(J)}}},this)}};function F(I,M,L){for(var K=0,J=I.length;K<J;K++){M.call(L,I[K],K)}}function C(I,J){I.push.apply(I,J);return I}H(window).unload(function(){if(typeof B=="function"){F(B.instances,function(I){I.stop();H.removeData(I.listener,I.event+".indexer");I.ids=I.names=I.listener=null})}})})(jQuery);(function(A){function B(C){return/(http|https):\/\//.test(C)}A.extend({requireConfig:{routeJs:"_js/",routeCss:"_css/"},queue:[],pending:null,requireJs:function(E,K,C,H,L){if(C!=undefined||C==null){A.extend(A.requireConfig,C)}var G={url:E,callback:K,opts:C,obj:H,scope:L};if(this.pending){this.queue.push(G);return }this.pending=G;var J=this;var F=(B(E))?E:A.requireConfig.routeJs+E;var I=document.getElementsByTagName("head")[0];var D=document.createElement("script");A(D).bind("load",function(){J.requestComplete()});D.onreadystatechange=function(){if(this.readyState==="loaded"||this.readyState==="complete"){J.requestComplete()}};D.type="text/javascript";D.src=F;I.appendChild(D)},requestComplete:function(){if(this.pending.callback){if(this.pending.obj){if(this.pending.scope){this.pending.callback.call(this.pending.obj)}else{this.pending.callback.call(window,this.pending.obj)}}else{this.pending.callback.call()}}this.pending=null;if(this.queue.length>0){var C=this.queue.shift();this.requireJs(C.url,C.callback,C.opts,C.obj,C.scope)}},requireCss:function(D){if(document.createStyleSheet){document.createStyleSheet(A.requireConfig.routeCss+D)}else{var C=document.createElement("link");A(C).attr({href:A.requireConfig.routeCss+D,type:"text/css",media:"screen",rel:"stylesheet"}).appendTo(A("head").get(0))}}})})(jQuery);if(!window.s_code){var s_code="",s_objectID;function s_gi(un,pg,ss){var d="function s_dr(x,o,n){var i=x.indexOf(o);if(i>=0&&x.split)x=(x.split(o)).join(n);else while(i>=0){x=x.substring(0,i)+n+x.substring(i+o.length);i=x.indexOf(o)}return x}function s_d(x) {var t='`^@$#',l='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',d,n=0,b,k,w,i=x.lastIndexOf('~~');if(i>0){d=x.substring(0,i);x=x.substring(i+2);while(d){w=d;i=d.indexOf('~');if(i>0){w=d.substring(0,i);d=d.substring(i+1)}else d='';b=parseInt(n/62);k=n-b*62;k=t.substring(b,b+1)+l.substring(k,k+1);x=s_dr(x,k,w);n++}for(i=0;i<5;i++){w=t.substring(i,i+1);x=s_dr(x,w+' ',w)}}return x}",c=".substring(~.indexOf(~return ~=f`K(~){`Ms=^u~';`At`h~;$2~.toLowerCase()~`ZF`K('e`z`Ms=s_c_il['+@g+']~};s.~`s $2~.length~`ZObject~.toUpperCase~s.wd~.location~')q='~link~s.apv~$f$U~unction~)$2x^W!Object||!Object.prototype||!Object.prototype[x])~var ~s.pt(~ookieDomainPeriods~,`z,'~while(~);s.~.protocol~){$2~:'')~=''~;@F^Us[k],255)}~javaEnabled~connection^E~=new ~.lastIndexOf('~tm.get~@5\"$Os.b.addBehavior('# default# ~onclick~ternalFilters~entElement~Name~=='~javascriptVersion~=parseFloat(~=s.dynamicAccount~s_c_il['+@g+'].mrq(\"'+un+'\")'~visitor~cookie~parseInt(~s.^I~o@6oid~browser~else~referrer~colorDepth~String~.host~s.rep(~}catch(e){~','~r=s.m(f)?s[f](~}$2~s.un~s.eo~s.sq~t=s.ot(o)~track~j='1.~)?'Y':'N'~$ZURL~@6c_i~s.ismac~lugins~;for(~Type~s.rc[un]~s.b.addEventListener~Download~tfs~resolution~.get@I()~s.eh~s.isie~s.vl_l~s.vl_t~Height~t,h){t=t?t~isopera~escape(~screen.~s.fl(~harCode~&&(~variableProvider~s.gg('objectID')~&&s.~:'';h=h?h~e&&l$eSESSION'~');~f',~_'+~Date~name~home$Z~s_c2~s.c_r(~s.rl[u~o.href~Lifetime~Width~sEnabled~'){q='~transactionID~b.attachEvent~&&l$eNONE'){~ExternalLinks~this~charSet~onerror~currencyCode~s=s_gi(~e$QElement~;s.gl(s.vl_g~.parent~Array~lnk~Opera~eval(~.s_~Math.~s.fsg~s.ns6~docum~s.oun~InlineStats~Track~'0123456789~s[k]=~window~onload~Time~s.epa(~s.c_w(~(s.ssl~n=s.oid(o)~LeaveQuery~')>=~&&t~'=')~){n=~+1))~' '+~s.t()}~\",''),~=s.oh(o);~+(y<1900?~ingServer~true~sess~campaign~lif~s_gs(~,100)~s.co(~s._in~x in ~='s_~ffset~s.c_d~'&pe~s.gv(~s.qav~s.pl~=(apn~Sampling~sqs',q);~Year(~=s.n.app~(''+~)+'/~',s~'||t~s()+':'+~a):f(~){v=s.n.~channel~if(~un)~.target~o.value~\".tl(\")~etscape~(ns?ns:~s_')t=t~omePage~++}~&&!~')<~){x~1);~e))~'+n~height~events~trk~random~code~un,~try{~'MSIE ~.src~floor(~s.pg~s.num(~s.ape(~s.c_gd~s.dc~.inner~Events~page~.set~.fromC~++){~?'':~!='~='+~?'&~+';~(f){~){p=~>=5)~&&i>~[b](~=l[n];~~f`K ^ife$i`Mx`V,s=0,e,a,b,c;`Q1){e=f`1'\"@w);b=f`1'\\\\',s);c=f`1\"\\n\",s)`6e<0||(b>=0&&b<$Ge=b`6e<0||(c>=0&&c<$Ge=c`6e>=0$E+=(e>s?f`0s,e)`U+(e==c?'\\\\n':'\\\\'+f`0e,e@S;s=e+1}`s `2x+f`0s)}`2f}f`K ^ifa$i`Ms=f`1'(')+1,e=f`1')'),a`V,c;`Qs>=0&&s<e){c=f`0s,s+1)`6c`h,')a+='\",\"';`A(\"\\n\\r\\t \")`1c)<0)a+=c;s$B`2a?'\"'+a+'\"':a}f`K ^if(cc){cc`V+cc;`Mfc='`Mf`ZF`K(@w=cc`1';',cc`1'{')),e=cc`a}'),o,a,d,q,c,f,h,x;fc+=^ifa(cc)+',\"`Ms`C;';c=cc`0s+1,e);s=c`1'f`K^c`Qs>=0){d=1;q`V;x=0;f=c`0s);a=^ifa(f);e=o=c`1'{@w);e++;`Qd>0){h=c`0e,e+1)`6q`Th==q$Cx)q`V`6h`h\\\\')x=x?0:1;`s x=0}`s{$2h`h\"'||h==\"'\")q=h`6h`h{')d++`6h`h}')d--^1d>0)e$Bc=c`00,s)+'new F`K('+(a?a+`z`U+'\"'+^ife(c`0o+1,$G+'\")'+c`0e+$Fs=c`1'f`K')}fc+=^ife(c)$h`2s\");';@5fc);`2f}f`K s_co(o){`M^y\"^ \",1,$F`2@fo)}f`K @d$3{`M^y$N1,$F`2@Uf`K s_dc($3{`M^y$N$F`2@Uf`K s_c($Npg,ss`4;s._c@ic';`E=@G`6!`E^An){`E^Al`Z@2;`E^An=0;}s._il=`E^Al;@g=`E^An;s._il[@g]=s;`E^An++;s.m`3m){`2@um)`1'{$D0`9fl`3x,l){`2x?@ux)`00,l):x`9co`3o`T!o)`2o;`Mn`C,x^D@ho)$2x`1'select$D0&&x`1'filter$D0)n[x]=o[x];`2n`9num`3x$E`V+x^D`Mp=0;p<x`B;p++)$2(@E')`1x`0p,p@S<0)`20;`21`9rep`3x,o,n){`Mi=x`1o);`Qx$l=0$E=x`00,i)+n+x`0i+o`B);i=x`1o,i+n`B)}`2x`9ape`3x`4,h=@EABCDEF',i,c=s.^v,n,l,e,y`V;c=c?c`D():''`6x$E`V+x`6c`hAUTO'^W'').c^VAt){for(i=0;i<x`B;i$cc=x`0i,i+$Fn=x.c^VAt(i)`6n>127){l=0;e`V;`Qn||l<4){e=h`0n%16,n%16+1)+e;n=`on/16);l$By+='%u'+e}`Ac`h+')y+='%2B';`s y+=^Sc)}x=y}`s{x=x?`x^S''+x),'+`z%2B'):x`6x&&c^Zem==1&&x`1'%u$D0&&x`1'%U$D0){i=x`1'%^c`Qi>=0){i++`6h`08)`1x`0i,i+1)`D())>=0)`2x`00,i)+'u00'+x`0i);i=x`1'%',i)}}}}`2x`9epa`3x`4;`2x?un^S`x''+x,'+`z ')):x`9pt`3x,d,f,a`4,t=x,z=0,y,r;`Qt){y=t`1d);y=y<0?t`B:y;t=t`00,y);^0t,@zt,a)`6r)`2r;z+=y+d`B;t=x`0z,x`B);t=z<x`B?t:''}`2''`9isf`3t,a){`Mc=a`1':')`6c>=0)a=a`00,c)`6t`00,2)`h$9`02);`2(t!`V@P==a)`9fsf`3t,a`4`6`Na`Pis^dt))@8+=(@8!`V?`z`U+t;`20`9fs`3x,f`4;@8`V;`Nx`Pfs^df);`2@8`9c_d`V;$Vf`3t,a`4`6!$Tt))`21;`20`9c_gd`3`4,d=`E`F`w^g,n=s.fpC`O,p`6!n)n=s.c`O`6d$C@k@Rn?`on):2;n=n>2?n:2;p=d`a.')`6p>=0){`Qp>=0&&n>1$jd`a.',p-$Fn--}@k=p>0&&`Nd,'.`zc_gd^d0)?d`0p):d}}`2@k`9c_r`3k`4;k=$Uk);`Mc=@Ts.d.`n,i=c`1@Tk+@Q,e=i<0?i:c`1';',i),v=i<0$d@Jc`0i+2+k`B,e<0?c`B:$G;`2v$e[[B]]'?v:''`9c_w`3k,v,e`4,d=$V(),l=s.`n^m,t;v`V+v;l=l?@ul)`D():''`6^b^st=(v!`V?`ol?l:0):-60)`6t){e`Z^f;e$a@I(e^K+(t*1000))}^1k^ss.d.`n=k+'`Jv!`V?v:'[[B]]')$h path=/;'+(^b?' expires$fe.toGMT`v()$h'`U+(d?' domain$fd$h'`U;`2^jk)==v}`20`9eh`3o,e,r,f`4,b='s^ee+'^e@g,n=-1,l,i,x`6!^Ll)^Ll`Z@2;l=^Ll^Di=0;i<l`B&&n<0;i++`Tl[i].o==o&&l[i].e==e)n=i^1n<0@Ri;l[n]`C}x$nx.o=o;x.e=e;f=r?x.b:f`6r||f$E.b=r?0:o[e];x.o[e]=f^1x.b$E.o[b]=x.b;`2b}`20`9cet`3f,a,t,o,b`4,r`6`I>=5^W!s.^R||`I>=7))@5'$O^0@za)`yr=s.m(t)?s[t](e):t(e)}^c`s{$2^B^Zu`1$P4@O0)r=s.m(b)?s$ma):b(a);`s{^L(`E,'^w',0,o);^0@za`Reh(`E,'^w',1)}}`2r`9g^Iet`3e`4;`2`p`9g^Ioe`8;^L(@G,\"^w\",1`Re^I=1;`Mc=s.t()`6c)s.d.write(c`Re^I=0;`2@Z'`Rg^Ifb`3a){`2@G`9g^If`3w`4,p=w@1,l=w`F;`p=w`6p&&p`F!=l&&p`F`w==l`w){`p=p;`2s.g^If(`p)}`2`p`9g^I`3`4`6!`p){`p=`E`6!s.e^I)`p=s.cet('g^I^d`p,'g^Iet@w.g^Ioe,'g^Ifb')}`2`p`9mrq`3u`4,l=^k],n,r;^k]=0`6l)for(n=0;n<l`B;n$cr$ns.mr(0,0,r.t,r.u,r.r)}`9mr`3@a,q,ta,u,rs`4,dc=$W,t1=s.^6@Y,t2=s.^6@YSecure,ns=s.`m`gspace,un=u?u:$8s.f$3,unc=`x$N'_`z-'),r`C,l,imn@ii^e($3,im,b,e`6!rs){rs='http'+@L?'s'`U+'://'+(t1?@L@P2?t2:t1):($8@L?'102':unc))+'.'+($W?$W:112)+'.2o7.net')@vb/ss/'+^2+'/1/H.13-Pdvu-2/'+@a+'?[AQB]&ndh=1'+(q?q`U+'&[AQE]'`6^M$C^B`T`I>5.5)rs=^Urs,4095);`s rs=^Urs,2047)}^1s.d.images&&`I>=3^W!s.^R||`I>=7)^W@9<0||`I>=6.1)`T!s.rc)s.rc`C`6!^F){^F=1`6!s.rl)s.rl`C;^kn]`Z@2;set@Iout('`l,750)}`s{l=^kn]`6l){r.t=ta;r.u=un;r.r=rs;l[l`B]=r;`2''}imn+='^e^F;^F$Bim=`E[imn]`6!im)im=`E[imn]`ZImage;im@6l=0;im.@H`ZF`K('e`z^u@6l=1;`l);im$Q=rs`6rs`1@l=@O0^W!ta||ta`h_self@xa`h_top'||(`E.^g@Pa==`E.^g))){b=e`Z^f;`Q!im@6l&&e^K-b^K<500)e`Z^f}`2''}`2'<im'+'g sr'+'c=\"'+rs+'\" width=1 $I=1 border=0 alt=\"\">'`9gg`3v`4`6!`E['s^ev])`E['s^ev]`V;`2`E['s^ev]`9glf`3t,a`Tt`00,2)`h$9`02);`Ms=^u,v=s.gg(t)`6v)s[t]=v`9gl`3v`4`6$S)`Nv`Pgl^d0)`9gv`3v`4;`2s['vpm^ev]?s['vpv^ev]:(s[v]?s[v]`U`9havf`3t,a`4,b=t`00,4),x=t`04),n=`ox),k='g^et,m='vpm^et,q=t,v=s.`H@DVars,e=s.`H@D$Y;@F@mt)`6s.@3||^3){v=v?v+`z+^N+`z+^N2:''`6v$C`Nv`Pis^dt))s[k]`V`6t`h$J'&&e)@Fs.fs(s[k],e)}s[m]=0`6t`h`mID`Gvid`5^9^pg'`W`At`h`t^pr'`W`At`hvmk`Gvmt`5^v^pce'`6s[k]&&s[k]`D()`hAUTO')@F'ISO8859-1';`As[k]^Zem==2)@F'UTF-8'}`At`h`m`gspace`Gns`5c`O`Gcdp`5`n^m`Gcl`5^X`Gvvp`5^x`Gcc`5$1`Gch`5^q`Gxact`5@b`Gv0`5^J`Gs`5`u`Gc`5`i`Gj`5`X`Gv`5`n^o`Gk`5`r^n`Gbw`5`r^P`Gbh`5`Y`Gct`5^h`Ghp`5p^C`Gp';`A$Tx)`Tb`hprop`Gc$H;`Ab`heVar`Gv$H;`Ab`hhier^ph$H`W^1s[k]@P$e`H`g'@P$e`H^E')@n+='&'+q+'`Js[k]);`2''`9hav`3`4;@n`V;`N^O`Phav^d0);`2@n`9lnf`3^Q`7^a`7:'';`Mte=t`1@Q`6t@Pe>0&&h`1t`0te@S>=0)`2t`00,te);`2''`9ln`3h`4,n=s.`H`gs`6n)`2`Nn`Pln^dh);`2''`9ltdf`3^Q`7^a`7:'';`Mqi=h`1'?^ch=qi>=0?h`00,qi):h`6t&&h`0h`B-(t`B@S`h.'+t)`21;`20`9ltef`3^Q`7^a`7:''`6t&&h`1t)>=0)`21;`20`9lt`3h`4,lft=s.`H^HFile^Es,lef=s.`HEx`e,@c=s.`HIn`e;@c=@c?@c:`E`F`w^g;h=h`7`6s.^6^HLinks&&lft&&`Nlft`Pltd^dh))`2'd'`6s.^6^t^Wlef||@c)^W!lef||`Nlef`Plte^dh))^W!@c||!`N@c`Plte^dh)))`2'e';`2''`9lc`8,b=^L(^u,\"`d\"`R@3=@f^u`Rt(`R@3=0`6b)`2^u$me);`2@Z'`Rbc`8,f`6s.d^Zd.all^Zd.all.cppXYctnr)return;^3=^z?^z:e$4;@5\"$O$2^3^W^3.tag`g||^3.par`f||^3@1Nod$G@Ucatch$i}\"`Reo=0'`Roh`3o`4,l=`E`F,h=^l?^l:'',i,j,k,p;i=h`1':^cj=h`1'?^ck=h`1'/')`6h^Wi<0||(j>=0$lj)||(k>=0$lk))$jo`S&&o`S`B>1?o`S:(l`S?l`S`U;i=l.path^g`a/^ch=(p?p+'//'`U+(o`w?o`w:(l`w?l`w`U)+(h`00,1)$e/'?l.path^g`00,i<0?0:i@v'`U+h}`2h`9ot`3o){`Ma=o.type,b=o.tag`g;`2(a&&a`D?a:b&&b`D?b:^l?'A'`U`D()`9oid`3o`4,^5,p=o`S,c=o.`d,n`V,x=0`6!`q`T^l^Wt`hA@x`hAREA')^W!c||!p||p`7`1'javascript$D0))n@W`Ac@R`xs.rep(`xs.rep@uc,\"\\r@V\"\\n@V\"\\t@V' `z^cx=2}`A$5^Wt`hINPUT@x`hSUBMIT')@R$5;x=3}`Ao$Q@P`hIMAGE')n=o$Q`6n){`q=^Un@e;`qt=x}}`2`q`9rqf`3t,un`4,e=t`1@Q,u=e>=0?`z+t`00,e)+`z:'';`2u&&u`1`z+un+`z)>=0?@Jt`0e@S:''`9rq`3un`4,c=un`1`z),v=^j's_sq'),q`V`6c<0)`2`Nv,'&`zrq^d$3;`2`Nun`Prq',0)`9sqp`3t,a`4,e=t`1@Q,q=e<0$d@Jt`0e+1)`Rsqq[q]`V`6e>=0)`Nt`00,e)`P@r`20`9sqs`3$Nq`4;^4u[un]=q;`20`9sq`3q`4,k@isq',v=^jk),x,c=0;^4q`C;^4u`C;^4q[q]`V;`Nv,'&`zsqp',0);`N^2`P@rv`V^D@h^4u`L)^4q[^4u[x]]+=(^4q[^4u[x]]?`z`U+x^D@h^4q`L&&^4q[x]^Wx==q||c<2)){v+=(v$g'`U+^4q[x]+'`Jx);c$B`2@Kk,v,0)`9wdl`8,r=@Z,b=^L(`E,\"@H\"),i,o,oc`6b)r=^u$me)^Di=0;i<s.d.`Hs`B;i$co=s.d.`Hs[i];oc=o.`d?\"\"+o.`d:\"\"`6(oc`1\"@d\")<0||oc`1\"@6oc(\")>=0)&&oc`1$6<0)^L(o,\"`d\",0,s.lc);}`2r^c`Es`3`4`6`I>3^W!^M||!^B||`I$k`Ts.b^Z^r)s.^r('`d@w.bc);`As.b&&^G)^G('click@w.bc,false);`s ^L(`E,'@H',0,`El)}`9vs`3x`4,v=s.`m@q,g=s.`m@qGroup,k@ivsn^e^2+(g?'^eg`U,n=^jk),e`Z^f,y=e.get@s);e$a@sy+10@X1900:0))`6v){v*=100`6!n`T!@Kk,x,$G`20;n=x^1n%10000>v)`20}`21`9dyasmf`3t,m`Tt&&m&&m`1t)>=0)`21;`20`9dyasf`3t,m`4,i=t?t`1@Q:-1,n,x`6i>=0&&m){`Mn=t`00,i),x=t`0i+1)`6`Nx`Pdyasm^dm))`2n}`20`9uns`3`4,x`kSelection,l`kList,m`kMatch,n,i;^2=^2`7`6x&&l`T!m)m=`E`F`w`6!m.toLowerCase)m`V+m;l=l`7;m=m`7;n=`Nl,';`zdyas^dm)`6n)^2=n}i=^2`1`z`Rfun=i<0?^2:^2`00,i)`9sa`3un`4;^2=un`6!@B)@B=un;`A(`z+@B+`z)`1$3<0)@B+=`z+un;^2s()`9t`3`4,$K=1,tm`Z^f,sed=Math&&@7$L?@7$R@7$L()*10000000000000):`b@I(),@a='s'+@7$R`b@I()/10800000)%10+sed,y=`b@s),vt=`b^f(@v'+`bMonth(@v'@Xy+1900:y)+@T`bHour@y`bMinute@y`bSeconds()+@T`bDay()+@T`b@IzoneO@j(),^I=s.g^I(),ta`V,q`V,qs`V@0`Runs()`6!s.td){`Mtl=^I`F,a,o,i,x`V,c`V,v`V,p`V,bw`V,bh`V,^70',k=@K's_cc`z@Z',0^8,hp`V,ct`V,pn=0,ps`6`v&&`v.prototype){^71'`6j.match){^72'`6tm$aUTC^f){^73'`6^M&&^B&&`I$k^74'`6pn.toPrecision){^75';a`Z@2`6a.forEach){^76';i=0;o`C;@5'$Oi`ZIterator(o)`y}')`6i&&i.next)^77'}}}}^1`I>=4)x=^Twidth+'x'+^T$I`6s.isns||s.^R`T`I>=3$0`X(^8`6`I>=4){c=^TpixelDepth;bw=`E$X^n;bh=`E$X^P}}@o=s.n.p^C}`A^M`T`I>=4$0`X(^8;c=^T`u`6`I$k{bw=s.d.@A`f.o@j^n;bh=s.d.@A`f.o@j^P`6!^B^Zb){`ch$A^chp=s.b.isH$A(tl^8`y}\");`cclientCaps^cct=s.b.`Y`y}\")}}}`s r`V^1@o)`Qpn<@o`B&&pn<30){ps=^U@o[pn].^g@e$h'`6p`1ps)<0)p+=ps;pn$Bs.^J=x;s.`u=c;s.`i=j;s.`X=v;s.`n^o=k;s.`r^n=bw;s.`r^P=bh;s.`Y=ct;s.^h=hp;s.p^C=p;s.td=1^1s.useP^C)s.doP^C(s);`Ml=`E`F,r=^I.@Aent.`t`6!s.^9)s.^9=l`6!s.`t)s.`t=r`6s.@3||^3){`Mo=^3?^3:s.@3`6!o)`2'';`Mp=@m'$Z`g'),w=1,^5,@M,x=`qt,h,l,i,oc`6^3&&o==^3){`Qo$Cn@P$eBODY'){o=o.par`f?o.par`f:o@1Node`6!o)`2'';^5;@M;x=`qt}oc=o.`d?''+o.`d:''`6(oc`1\"@d\")>=0&&oc`1\"@6oc(\")<0)||oc`1$6>=0)`2''}ta=n?o$4:1;h@Wi=h`1'?^ch=s.`H@N`v||i<0?h:h`00,i);l=s.`H`g?s.`H`g:s.ln(h);t=s.`H^E?s.`H^E`7:s.lt(h)`6t^Wh||l))q+=@l=@3^e(t`hd@x`he'?$Ut):'o')+(h?@lv1`Jh)`U+(l?@lv2`Jl)`U;`s $K=0`6s.^6@C`T!p$j@m'^9^cw=0}^5;i=o.sourceIndex`6^Y@R^Y;x=1;i=1^1p&&n@P)qs='&pid`J^Up,255))+(w$gpidt$fw`U+'&oid`J^Un@e)+(x$goidt$fx`U+'&ot`Jt)+(i$goi$fi`U}^1!$K$Cqs)`2''`6s.p_r)s.p_r();`M$M`V`6$K^Zvs(sed))$M=s.mr(@a,(vt$gt`Jvt)`U+s.hav()+q+(qs?qs:s.rq(^2)),ta`Rsq($K$dqs`R@3=^3=s.`H`g=s.`H^E=`E@6objectID=s.ppu`V`6$S)`E@6@3=`E@6eo=`E@6`H`g=`E@6`H^E`V;`2$M`9tl`3o,t,n`4;s.@3=@fo`R`H^E=t;s.`H`g=n;s.t()`9ssl=(`E`F`S`7`1'https@O0`Rd=@Aent;s.b=s.d.body;s.n=navigator;s.u=s.n.userAgent;@9=s.u`1'N$76/^c`Mapn@t`g,v@tVersion,ie=v`1$P'),o=s.u`1'@4 '),i`6v`1'@4@O0||o>0)apn='@4';^M@p`hMicrosoft Internet Explorer'`Risns@p`hN$7'`R^R@p`h@4'`Rismac=(s.u`1'Mac@O0)`6o>0)`I`js.u`0o+6));`Aie>0){`I=`oi=v`0ie+5))`6`I>3)`I`ji)}`A@9>0)`I`js.u`0@9+10));`s `I`jv`Rem=0`6`v$b^V){i=^S`v$b^V(256))`D(`Rem=(i`h%C4%80'?2:(i`h%U0100'?1:0))}s.sa(un`Rvl_l='`mID,vmk,ppu,^v,`m`gspace,c`O,`n^m,$Z`g,^9,`t,^x';^O=^N+',^X,$1,server,$Z^E,^q,purchaseID,@b,state,zip,$J,products,`H`g,`H^E'^D`Mn=1;n<51;n++)^O+=',prop$H+',eVar$H+',hier$H;^N2='^J,`u,`i,`X,`n^o,`r^n,`r^P,`Y,^h,p^C';^O+=`z+^N2;s.vl_g=^O+',^6^HLinks,^6^t,^6@C,`H@N`v,`H^HFile^Es,`HEx`e,`HIn`e,`H@DVars,`H@D$Y,`H`gs,@3';$S=pg@0)`6!ss)`Es()}",w=window,l=w.s_c_il,n=navigator,u=n.userAgent,v=n.appVersion,e=v.indexOf("MSIE "),m=u.indexOf("Netscape6/"),a,i,s;if(un){un=un.toLowerCase();if(l){for(i=0;i<l.length;i++){s=l[i];if(s._c=="s_c"){if(s.oun==un){return s}else{if(s.fs(s.oun,un)){s.sa(un);return s}}}}}}w.eval(d);c=s_d(c);i=c.indexOf("function s_c(");w.eval(c.substring(0,i));if(!un){return 0}c=c.substring(i);if(e>0){a=parseInt(i=v.substring(e+5));if(a>3){a=parseFloat(i)}}else{if(m>0){a=parseFloat(u.substring(m+10))}else{a=parseFloat(v)}}if(a>=5&&v.indexOf("Opera")<0&&u.indexOf("Opera")<0){eval(c);return new s_c(un,pg,ss)}else{s=s_c2f(c)}return s(un,pg,ss)}s_gi()}var CachePriority={Low:1,Normal:2,High:4};function Cache(A){this.items={};this.count=0;if(A===null){A=-1}this.maxSize=A;this.fillFactor=0.75;this.purgeSize=Math.round(this.maxSize*this.fillFactor);this.stats={};this.stats.hits=0;this.stats.misses=0}Cache.prototype.getItem=function(A){var C=this.items[A];if(C){if(!this._isExpired(C)){C.lastAccessed=new Date().getTime()}else{this._removeItem(A);C=null}}var B=null;if(C){B=C.value;this.stats.hits++}else{this.stats.misses++}return B};Cache.prototype.setItem=function(C,D,B){function A(F,E,G){if((F==null)||(F=="")){throw new Error("key cannot be null or empty")}this.key=F;this.value=E;if(G==null){G={}}if(G.expirationAbsolute!=null){G.expirationAbsolute=G.expirationAbsolute.getTime()}if(G.priority==null){G.priority=CachePriority.Normal}this.options=G;this.lastAccessed=new Date().getTime()}if(this.items[C]!=null){this._removeItem(C)}this._addItem(new A(C,D,B));if((this.maxSize>0)&&(this.count>this.maxSize)){this._purge()}};Cache.prototype.clear=function(){for(var A in this.items){this._removeItem(A)}};Cache.prototype._purge=function(){var D=new Array();for(var A in this.items){var B=this.items[A];if(this._isExpired(B)){this._removeItem(A)}else{D.push(B)}}if(D.length>this.purgeSize){D=D.sort(function(F,E){if(F.options.priority!=E.options.priority){return E.options.priority-F.options.priority}else{return E.lastAccessed-F.lastAccessed}});while(D.length>this.purgeSize){var C=D.pop();this._removeItem(C.key)}}};Cache.prototype._addItem=function(A){this.items[A.key]=A;this.count++};Cache.prototype._removeItem=function(A){var B=this.items[A];delete this.items[A];this.count--;if(B.options.callback!=null){var C=function(){B.options.callback(B.key,B.value)};setTimeout(C,0)}};Cache.prototype._isExpired=function(C){var A=new Date().getTime();var B=false;if((C.options.expirationAbsolute)&&(C.options.expirationAbsolute<A)){B=true}if((B==false)&&(C.options.expirationSliding)){var D=C.lastAccessed+(C.options.expirationSliding*1000);if(D<A){B=true}}return B};Cache.prototype.toHtmlString=function(){var B=this.count+" item(s) in cache<br /><ul>";for(var A in this.items){var C=this.items[A];B=B+"<li>"+C.key.toString()+" = "+C.value.toString()+"</li>"}B=B+"</ul>";return B}
/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
;var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return }addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<script id=__ie_ondomload defer=true src=//:><\/script>");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState)}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function checkReadyState(){if(script.readyState=="complete"){script.parentNode.removeChild(script);callDomLoadFunctions()}}function callDomLoadFunctions(){if(isDomLoaded){return }if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return }}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(el){if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function removeSWF(id){var obj=getElementById(id);if(obj&&(obj.nodeName=="OBJECT"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id)}else{win.attachEvent("onload",function(){removeObjectInIE(id)})}}else{obj.parentNode.removeChild(obj)}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null}}obj.parentNode.removeChild(obj)}}function getElementById(id){var el=null;try{el=doc.getElementById(id)}catch(e){}return el}function createElement(el){return doc.createElement(el)}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn]}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return }var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars?encodeURIComponent(s):s}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2])}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j])}for(var k in ua){ua[k]=null}ua=null;for(var l in swfobject){swfobject[l]=null}swfobject=null})}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return }var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return }widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){if(attObj[i]!=Object.prototype[i]){att[i]=attObj[i]}}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par[j]=parObj[j]}}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(flashvarsObj[k]!=Object.prototype[k]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k]}else{par.flashvars=k+"="+flashvarsObj[k]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){isExpressInstallActive=true;setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},removeSWF:function(objElemIdStr){if(ua.w3cdom){removeSWF(objElemIdStr)}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return urlEncodeIfNecessary(q)}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false}}}}}();$.extend(String.prototype,{toArray:function(){return this.split("")},toCapitalCase:function(){return this.charAt(0).toUpperCase()+this.substr(1)},startsWith:function(A){return this.indexOf(A)===0},endsWith:function(A){var B=this.length-A.length;return B>=0&&this.lastIndexOf(A)===B},asCharValueArray:function(){var B=[],A=this.length;for(var C=0;C<A;C++){B.push(this.charCodeAt(C))}return B},cleanWhiteSpace:function(){return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g," ")},requestParams:function(G){var E={},B=this.split(G||"&"),A=B.length,D,F;for(var C=0;C<A;C++){D=B[C].split("=");F=typeof D[1]==="string"?decodeURIComponent(D[1].replace(/\+/g," ")):null;E[decodeURIComponent(D[0])]=F}return E}});Object.filter=function(E,D){var B={},C,A;for(A in E){if(E.hasOwnProperty(A)){C=E[A];if(D(A,C)){B[A]=C}}}return B};Object.getReferenceToNestedName=function(B){var E=B.split(".");for(var D=0,A=E.length,C=window;D<A&&(C=C[E[D++]]);){}return C||null};Object.getKeys=function(C){var B=[];for(var A in C){if(C.hasOwnProperty(A)){B.push(A)}}return B};RegExp.escape=function(B){if(!arguments.callee.re){var A=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.re=new RegExp("(\\"+A.join("|\\")+")","g")}return B.replace(arguments.callee.re,"\\$1")};if(!window.s){window.s=window.s_gi(hcom.locale.rules.OMNITURE_S_ACCOUNT);window.s.cookieDomainPeriods="3";window.s.trackDownloadLinks=true;window.s.trackExternalLinks=true;window.s.trackInlineStats=true;window.s.linkDownloadFileTypes="exe,zip,wav,mp3,mov,mpg,avi,wmv,doc,pdf,xls";window.s.linkInternalFilters=[["java","script:"].join(""),hcom.locale.url,hcom.locale.secureUrl].join(",");window.s.linkLeaveQueryString=false;window.s.linkTrackVars="None";window.s.linkTrackEvents="None";window.s.usePlugins=false;window.s.doPlugins=function(){};window.s.visitorNamespace="bangalorebestcom";window.s.dc=122;window.s.charSet="UTF-8"}window.console=function(){var L=null,F,A=0,N=false,S={},I=(typeof hcom!=="undefined")&&(typeof hcom.locale!=="undefined")&&(hcom.locale.rules.JAVASCRIPT_DEVELOPMENT===true);if(I){$.ready(function(){N=true})}function K(){$("body").append('<div id="hcomConsole" style="opacity: 0.6; position: absolute; top: 0px; left: 0px; border: 2px solid #a00; background: #fff; font-size: 9px; z-index: 255; width: 530px; height: 60px;"></div>');F=$("#hcomConsole");F.html('<h1 style="display: block; margin: 0; padding: 0; background: #a00; color: #fff;">bangalorebest.com javascript console</h1><div style="width: 100%; height: 100%; overflow: scroll;"></div>');L=F.find("div:first")}function R(V,W){if(I&&N){if(L===null){K()}L.append("<pre>"+V.join("")+"</pre>");A+=65536;L.scrollTop(A)}}function H(W){try{return W+""}catch(V){return null}}function Q(W){function V(X){switch(X){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";case"'":return"&#39;";case'"':return"&quot;"}return"?"}return String(W).replace(/[<>&"']/g,V)}function T(V,W){W.push(Q(H(V)))}function O(V,W){W.push('<span class="objectBox-string">&quot;',Q(H(V)),"&quot;</span>")}function J(V,W){W.push('<span class="objectBox-number">',Q(H(V)),"</span>")}function E(V,W){W.push('<span class="objectBox-number">',Q(H(V)),"</span>")}function U(V,W){W.push('<span class="objectBox-null">',Q(H(V)),"</span>")}function P(X,Y){var Z=/function ?(.*?)\(/;var V=Z.exec(H(X));var W=V?V[1]:"function";Y.push('<span class="objectBox-function">',Q(W),"()</span>")}function B(V,W){W.push('<span class="objectBox-selector">');W.push('<span class="selectorTag">',Q(V.nodeName.toLowerCase()),"</span>");if(V.id){W.push('<span class="selectorId">#',Q(V.id),"</span>")}if(V.className){W.push('<span class="selectorClass">.',Q(V.className),"</span>")}W.push("</span>")}function G(X,Y){var Z=H(X);var W=/\[object (.*?)\]/;var V=W.exec(Z);Y.push('<span class="objectBox-object">',V?V[1]:Z,"</span>")}function M(W,X){try{if(W===undefined){U("undefined",X)}else{if(W===null){U("null",X)}else{if(typeof W==="string"){O(W,X)}else{if(typeof W==="number"){J(W,X)}else{if(typeof W==="function"){P(W,X)}else{if(W.nodeType===1){B(W,X)}else{if(typeof W==="object"){G(W,X)}else{T(W,X)}}}}}}}}catch(V){}}function C(c){var b=[];var a=/((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/;var W={s:T,d:J,i:J,f:E};for(var V=a.exec(c);V;V=a.exec(c)){var Z=V[8]?V[8]:V[5];var Y=Z in W?W[Z]:M;var X=V[3]?parseInt(V[3],10):(V[4]==="."?-1:0);b.push(c.substr(0,V[0][0]==="%"?V.index:V.index+1));b.push({appender:Y,precision:X});c=c.substr(V.index+V[0].length)}b.push(c);return b}function D(d,b){var a=[],Z,X;var c=d[0];var W=0;if(typeof (c)!=="string"){c="";W=-1}var Y=C(c);for(Z=0;Z<Y.length;++Z){var V=Y[Z];if(V&&typeof (V)==="object"){X=d[++W];V.appender(X,a)}else{T(V,a)}}for(Z=W+1;Z<d.length;++Z){T(" ",a);X=d[Z];if(typeof (X)==="string"){T(X,a)}else{M(X,a)}}R(a,b)}return(!I||!("console" in window)||!("firebug" in console))?{firebug:"1.05 emulated",assert:function(V,Y){if(!V){var W=[];for(var X=1;X<arguments.length;++X){W.push(arguments[X])}D(W.length?W:["Assertion Failure"],"error");throw Y?Y:"Assertion Failure"}},count:function(){},debug:function(){D(arguments,"debug")},dir:function(){},dirxml:function(){},error:function(){D(arguments,"error")},group:function(){},groupEnd:function(){},info:function(){D(arguments,"info")},log:function(){D(arguments,"")},profile:function(){},profileEnd:function(){},time:function(V){S[V]=new Date().getTime()},timeEnd:function(V){if(V in S){var W=new Date().getTime()-S[V];D([V+":",W+"ms"]);delete S[V]}},trace:function(){},warn:function(){D(arguments,"warn")}}:window.console}();(function(A){A.extend({bookmark:function(D){var B=location.href,C=document.title;if(window.sidebar){window.sidebar.addPanel(C,B,"")}else{if(window.external){window.external.AddFavorite(B,C)}else{if(window.opera&&window.print&&D){A(D).attr("href",B).attr("title",C).attr("rel","sidebar")}}}}})})(jQuery);(function(A){A.extend({iterate:function(D,F,C){if(D&&A.isFunction(F)){var B=0;if(D.constructor===Array){for(B=0;B<D.length;B++){if(F.apply(C?C:this,[D[B],{index:B,first:B===0,last:B===D.length-1}])===false){break}}}else{if(typeof D==="object"){for(var E in D){if(D.hasOwnProperty(E)){if(F.apply(C?C:this,[D[E],{index:B,first:B===0,last:B++===D.length-1}])===false){break}}}}}}}});A.fn.extend({visible:function(C,B){if(C===undefined){return this.is(":visible")}else{if(C){return this.each(function(){if(B){A(this).css("visibility","visible")}else{A(this).show()}})}else{return this.each(function(){if(B){A(this).css("visibility","hidden")}else{A(this).hide()}})}}}})})(jQuery);(function(A){var B={};console.assert((A.format&&A.formatter)===undefined);A.format=function(D,E){var C;if(arguments.length>1){if(E.constructor!==Array){E=Array.prototype.slice.call(arguments,1)}else{console.assert(arguments.length===2)}C=E.length;return D.replace(/\{([0-9]+)\}/g,function(H,I,G){var F=parseInt(I,10);return G>0&&D.charAt(G-1)==="\\"?H:(F<C?E[F]:"")})}return D};A.formatter=function(C){this.bundle=C||{}};A.extend(A.formatter,{extendGlobal:function(C){A.extend(B,C)}});A.formatter.prototype={format:function(D){var C=Array.prototype.slice.call(arguments,1);C.unshift(this.bundle[D]||B[D]||D);return A.format.apply(undefined,C)},loadMessages:function(D){var C=this.bundle;D.find("message").each(function(){var E=A(this);var F=E.attr("key");C[F]=A.trim(E.text())});return this},setGlobal:function(){A.formatter.extendGlobal(this.bundle)}}})(jQuery);(function(C){var D,A="domgcieBin";function B(){D=document.getElementById(A);if(!D){D=document.createElement("DIV");D.id=A;D.style.display="none";document.body.appendChild(D)}}C.extend({discardElement:function(F,E){if(D||B()){D.appendChild(F);D.innerHTML=""}}})})(jQuery);(function(A){A.fn.extend({html:function(C){if(C===undefined){var B=[];this.each(function(){B.push(this.innerHTML)});B=B.join("");if(A.browser.msie&&A.browser.version<8){A.map(A.fn.html.ieFilters,function(D){B=B.replace(D,"")})}return B}return this.each(function(){if(A.browser.msie&&this.tagName.toLowerCase()==="select"){A(this).empty().append(C)}else{this.innerHTML=C}})},htmlAppend:function(B){this.html([this.html(),B].join(""));return this},htmlPrepend:function(B){this.html([B,this.html()].join(""));return this}});A.fn.html.ieFilters=[/\s+jQuery[0-9]+="[0-9]+"/g]})(jQuery);jQuery.fn.extend({isDirty:function(){if(this.length<1){return false}else{if(this.length>1){for(var C=0;C<this.length;C++){if(this.eq(C).isDirty()){return true}}return false}}var D=this[0].type,B=this[0].tagName?this[0].tagName.toLowerCase():null,A=this[0];if(D==="text"||D==="password"||B==="textarea"){return this.val()!==A.submittedValue}else{if(D==="checkbox"||D==="radio"){return A.checked!==A.submittedValue}else{if(B==="select"){return A.submittedValue!==A.selectedIndex}}}return this.find(":input").isDirty()},setSubmitted:function(){return this.each(function(){var B=this.type,A=this.tagName?this.tagName.toLowerCase():null;if(B==="text"||B==="password"||A==="textarea"){this.submittedValue=jQuery(this).val()}else{if(B==="checkbox"||B==="radio"){this.submittedValue=this.checked}else{if(A==="select"){this.submittedValue=this.selectedIndex}else{jQuery(this).children().setSubmitted()}}}})},setEmptyValue:function(A){return this.each(function(){var B=jQuery(this);this.emptyValue=A;if(B.realVal()===""){B.val(A)}B.focus(function(){if(B.realVal()===this.emptyValue){B.realVal("")}}).blur(function(){if(B.realVal()===""){B.val(this.emptyValue)}});B.parents("form:first").submit(function(){if(B.realVal()===B[0].emptyValue){B.realVal("")}})})}});jQuery.fn.realVal=jQuery.fn.val;jQuery.fn.emptyVal=function(B){var A=this.realVal();if(B===undefined){if(this.length){if(this[0].emptyValue!==undefined&&A===this[0].emptyValue){return""}else{return A}}return undefined}else{return this.realVal(((B===""||B===null)&&this[0].emptyValue)?this[0].emptyValue:B)}};jQuery.fn.val=jQuery.fn.emptyVal;(function(B){var A={},C={};B.extend({isPreloadEnabled:function(D){var F=(D?D:0),E=true;if(F>0&&B.browser.msie&&B.browser.version<7){E=false}return E},preloadImages:function(H,J,G){if(!B.isPreloadEnabled(G)){if(J){J()}return }var E=H,D=false;if(H.constructor===String){E=[H]}var I=E.length;function F(K){A[K].domref.unbind();if(--I===0&&J){J(D)}delete A[K].domref;A[K].loadFailed=D}B.map(E,function(K){if(A[K]===undefined){A[K]={domref:B("<img>")};A[K].domref.bind("load",function(){F(K)}).bind("error",function(){D=true;F(K)}).bind("abort",function(){F(K)}).attr("src",K)}else{D=A[K].loadFailed;if(--I===0&&J){J(D)}}})},preloadAsyncImage:function(F,H,E){var G=false,D=function(I,J){C[F].$domref.unbind();if(H){H(I,J);G=true}};if(!B.isPreloadEnabled(E)){D();return }if(C[F]===undefined){C[F]={$domref:B("<img>")};C[F].$domref.bind("load",function(){D(false,C[F].$domref)}).bind("error",function(){D(true)}).bind("abort",function(){D(true)}).attr("src",F)}else{D(false,C[F].$domref)}}})})(jQuery);(function(F){var C={},B={impl:function(){return{}},dependencies:[],externalDependencies:[],images:[],imageUrlPrefix:"/images/"};function E(J,N){var O=J.split(".");for(var M=0,I=O.length-1,L=window,K;M<I;M++){K=L[O[M]];if(K===undefined){K={};L[O[M]]=K}L=K}if(L[O[M]]!==undefined){console.error("registerModule: possible namespace collision object %s overwritten!",J)}L[O[M]]=N;return N}function G(I){return Object.getReferenceToNestedName(I)!==null}function D(I){console.info("loadModule: loading module %s",I);var J=E(I,C[I].impl(I));if(!J){console.error("loadModule: module construction failure %s implCallback did not return the module object!",I)}J.getName=function(){return I};F.map(C[I].dependencies,function(K){F.loadModule(K)});F.map(C[I].images,function(K){F.preloadImages(C[I].imageUrlPrefix+K,null,1)});if(F.isFunction(J.init)){J.init();delete J.init}}function A(I){var J=C[I].externalDependencies;F.map(C[I].dependencies,function(K){J=J.concat(A(K))});return J}function H(I){C[I].externalDependencies=[];F.map(C[I].dependencies,function(J){H(J)})}F.extend({registerModule:function(I){if(!I.name){throw ("registerModule: setting a module name is mandatory!")}if(C.hasOwnProperty(I.name)){throw ("registerModule: namespace collision: module "+I.name+" already registered!")}C[I.name]=F.extend({},B,I)},namespace:function(J,I){if(C.hasOwnProperty(J)){throw ("namespace collision with module "+J)}return E(J,I||{})},loadModule:function(I){if(!G(I)){if(!C[I]){throw ("loadModule: unregistered module name: "+I)}var K=A(I),J=0;F.unique(K);if(K.length>0){F.map(K,function(M,L){F.requireJs(M,function(){if(++J===K.length){H(I);D(I)}})})}else{D(I)}}},extendCls:function(O,N){var K=Object.prototype.constructor,J=N.constructor!==K?N.constructor:function(){O.apply(this,arguments)},I=function(){},M,L=O.prototype;I.prototype=L;M=J.prototype=new I();M.constructor=J;J.superclass=L;if(L.constructor===K){L.constructor=O}F.map(Object.getKeys(N),function(P){M[P]=N[P]});return J},isModuleLoaded:G})})(jQuery);jQuery.autocomplete=function(D,S){var N=this;var W=$(D).attr("autocomplete","off");var O=document.createElement("div");var H=$(O);var f=null;var V="";var g=-1;var I={};var Y=false;var J=false;var A=null;var P;function L(){I={};I.data={};I.length=0}function E(k,i){if(!i||!k||!S.cacheLength){return }if(!I.length||I.length>S.cacheLength){L();I.length++}else{if(!I[k]){I.length++}}I.data[k]=i}function T(){if(f){clearTimeout(f)}W.removeClass(S.loadingClass);if(H.is(":visible")){H.hide()}if(S.mustMatch){var i=W.val();if(i!==D.lastSelected){P(null)}}}function C(){if(f){clearTimeout(f)}f=setTimeout(T,200)}function j(p){var v=document.createElement("ul"),t=p.length,r=function(){$("li",v).removeClass("ac_over");$(this).addClass("ac_over");g=$("li",v).indexOf($(this).get(0))},u=function(){$(this).removeClass("ac_over")},x=function(i){i.preventDefault();i.stopPropagation();P(this)};if((S.maxItemsToShow>0)&&(S.maxItemsToShow<t)){t=S.maxItemsToShow}for(var q=0;q<t;q++){var y=p[q];if(!y){continue}var w=document.createElement("li");if(S.formatItem){w.innerHTML=S.formatItem(y,q,t);w.selectValue=y[0]}else{w.innerHTML=y[0];w.selectValue=y[0]}var k=null;if(y.length>1){k=[];for(var o=1;o<y.length;o++){k[k.length]=y[o]}}w.extra=k;v.appendChild(w);$(w).hover(r,u).click(x)}return v}function b(k){var i=$("li",O);if(!i||(i.size()<1)){return }g+=k;if(g<0){g=0}else{if(g>=i.size()){g=i.size()-1}}i.removeClass("ac_over");$(i[g]).addClass("ac_over")}function Z(p,o){if(!S.matchCase){p=p.toLowerCase()}var k=p.indexOf(o);if(k===-1){return false}return k===0||S.matchContains}function m(v){if(v){if(I.data[v]){return I.data[v]}if(S.matchSubset){for(var t=v.length-1;t>=S.minChars;t--){var o=v.substr(0,t);var w=I.data[o];if(w){var u=[];for(var p=0;p<w.length;p++){var k=w[p];var r=k[0];if(Z(r,v)){u[u.length]=k}}return u}}}}return null}function M(p){var k=S.url+"?param="+encodeURI(p);for(var o in S.extraParams){if(S.extraParams.hasOwnProperty(o)){k+="&"+o+"="+encodeURI(S.extraParams[o])}}return k}function F(p){if(!p){return null}var k=p.indexOf("),");p=p.substring(53,k-1).split('", "');for(var o=0;o<p.length;o++){p[o]=[$.trim(p[o])]}return p}function B(p,k){var o=W.get(0);if(o.createTextRange){var i=o.createTextRange();i.collapse(true);i.moveStart("character",p);i.moveEnd("character",k);i.select()}else{if(o.setSelectionRange){o.setSelectionRange(p,k)}else{if(o.selectionStart){o.selectionStart=p;o.selectionEnd=k}}}o.focus()}function U(i){if(A!==8){W.val(W.val()+i.substring(V.length));B(V.length,i.length)}}function c(){var k=W.offset();var i=(S.width>0)?S.width:W.width();H.css({width:parseInt(i,10)+"px",top:String(k.top+W.height())+"px",left:String(k.left)+"px"}).show()}function G(k,i){if(i){W.removeClass(S.loadingClass);O.innerHTML="";if(!J||i.length===0||i[0]===""){return T()}if($.browser.msie){H.append(document.createElement("iframe"))}O.appendChild(j(i));if(S.autoFill&&(W.val().toLowerCase()===k.toLowerCase())){U(i[0][0])}c()}else{T()}}function a(k){if(!S.matchCase){k=k.toLowerCase()}var i=S.cacheLength?m(k):null;if((typeof S.url==="string")&&(S.url.length>0)){$.post(M(k),function(o){o=S.dataParser?S.dataParser(o):F(o);E(k,o);G(k,o)})}else{W.removeClass(S.loadingClass)}}function R(){if(A===46||(A>8&&A<32)){return H.hide()}var i=W.val();if(i===V){return }V=i;if(i.length>=S.minChars){W.addClass(S.loadingClass);a(i)}else{W.removeClass(S.loadingClass);H.hide()}}function d(){var i=$("li.ac_over",O)[0];if(!i){var k=$("li",O);if(S.selectOnly){if(k.length===1){i=k[0]}}else{if(S.selectFirst){i=k[0]}}}if(i){P(i);return true}else{return false}}function e(v,u){if(u){W.removeClass(S.loadingClass)}var r=(u)?u.length:0;var o=null;for(var t=0;t<r;t++){var w=u[t];if(w[0].toLowerCase()===v.toLowerCase()){o=document.createElement("li");if(S.formatItem){o.innerHTML=S.formatItem(w,t,r);o.selectValue=w[0]}else{o.innerHTML=w[0];o.selectValue=w[0]}var k=null;if(w.length>1){k=[];for(var p=1;p<w.length;p++){k[k.length]=w[p]}}o.extra=k}}if(S.onFindValue){setTimeout(function(){S.onFindValue(o)},1)}}function X(k){var o=k.offsetLeft||0;var i=k.offsetTop||0;while(k===k.offsetParent){o+=k.offsetLeft;i+=k.offsetTop}return{x:o,y:i}}P=function(i){if(!i){i=document.createElement("li");i.extra=[];i.selectValue=""}var k=$.trim(i.selectValue?i.selectValue:i.innerHTML);D.lastSelected=k;V=k;H.html("");W.val(k);T();if(S.onItemSelect){setTimeout(function(){S.onItemSelect(i)},1)}};if(S.inputClass){W.addClass(S.inputClass)}$("div.ac_results").remove();H.hide().addClass(S.resultsClass).css("position","absolute");if(S.width>0){H.css("width",S.width)}$("body").append(O);D.autocompleter=N;L();if(S.data!==null){var Q="",n={},K=[];if(typeof S.url!=="string"){S.cacheLength=1}for(var l=0;l<S.data.length;l++){K=((typeof S.data[l]==="string")?[S.data[l]]:S.data[l]);if(K[0].length>0){Q=K[0].substring(0,1).toLowerCase();if(!n[Q]){n[Q]=[]}n[Q].push(K)}}for(var h in n){if(n.hasOwnProperty(h)){S.cacheLength++;E(h,n[h])}}}W.keydown(function(k){A=k.keyCode;switch(k.keyCode){case 38:k.preventDefault();b(-1);break;case 40:k.preventDefault();b(1);break;case 9:case 13:if(!d()){b(1);d()}W.get(0).blur();var i=W.parents("form:first").find(":input");i.eq(i.index(W[0])+1).focus();k.preventDefault();break;default:g=-1;if(f){clearTimeout(f)}f=setTimeout(function(){R()},S.delay);break}}).focus(function(){J=true}).blur(function(){J=false;C()});T();this.flushCache=function(){L()};this.setExtraParams=function(i){S.extraParams=i};this.findValue=function(){var k=W.val();if(!S.matchCase){k=k.toLowerCase()}var i=S.cacheLength?m(k):null;if(i){e(k,i)}else{if((typeof S.url==="string")&&(S.url.length>0)){$.get(M(k),function(o){o=F(o);E(k,o);e(k,o)})}else{e(k,null)}}}};jQuery.fn.autocomplete=function(B,A,C){A=A||{};A.url=B;A.data=((typeof C==="object")&&(C.constructor===Array))?C:null;A.inputClass=A.inputClass||"ac_input";A.resultsClass=A.resultsClass||"ac_results";A.lineSeparator=A.lineSeparator||"\n";A.cellSeparator=A.cellSeparator||"|";A.minChars=A.minChars||1;A.delay=A.delay||300;A.matchCase=A.matchCase||0;A.matchSubset=A.matchSubset||1;A.matchContains=A.matchContains||0;A.cacheLength=A.cacheLength||1;A.mustMatch=A.mustMatch||0;A.extraParams=A.extraParams||{};A.loadingClass=A.loadingClass||"ac_loading";A.selectFirst=A.selectFirst||false;A.selectOnly=A.selectOnly||false;A.maxItemsToShow=A.maxItemsToShow||-1;A.autoFill=A.autoFill||false;A.width=parseInt(A.width,10)||0;this.each(function(){var D=this;return new jQuery.autocomplete(D,A)});return this};jQuery.fn.autocompleteArray=function(B,A){return this.autocomplete(null,A,B)};jQuery.fn.indexOf=function(B){for(var A=0;A<this.length;A++){if(this[A]===B){return A}}return -1};jQuery.extend({historyCurrentHash:undefined,historyCallback:undefined,historyFrameId:"hcomHistory",historyCheckIntervalId:undefined,historyIFrame:undefined,historySuspendCheck:function(){if(jQuery.historyCheckIntervalId!==undefined){window.clearInterval(jQuery.historyCheckIntervalId);jQuery.historyCheckIntervalId=undefined}else{console.warn("trying to suspend already suspended historyCheck")}},historyResumeCheck:function(){if(jQuery.historyCheckIntervalId===undefined){jQuery.historyCheckIntervalId=window.setInterval(jQuery.historyCheck,100)}else{console.warn("trying to resume historyCheck but it's not suspended")}},historyInit:function(F){jQuery.historyCallback=F;var B=location.hash,E,D;jQuery.historyCurrentHash=B;if(jQuery.browser.msie){if(jQuery.historyCurrentHash===""){jQuery.historyCurrentHash="#"}var C=$('<iframe id="'+jQuery.historyFrameId+'" style="display: none;"></iframe>');$("body").prepend(C);jQuery.historyIFrame=C[0];var A=jQuery.historyIFrame.contentWindow.document;A.open();A.close();A.location.hash=B}else{if(jQuery.browser.safari){jQuery.historyBackStack=[];jQuery.historyBackStack.length=history.length;jQuery.historyForwardStack=[];jQuery.isFirst=true}}jQuery.historyCallback(B.replace(/^#/,""));jQuery.historyResumeCheck()},historyAddHistory:function(A){jQuery.historyBackStack.push(A);jQuery.historyForwardStack.length=0;this.isFirst=true},historyCheck:function(){var E;if(jQuery.browser.msie){var C=jQuery.historyIFrame.contentDocument||jQuery.historyIFrame.contentWindow.document;E=C.location.hash;if(E!==jQuery.historyCurrentHash){console.log("jQuery.historyCurrentHash: "+jQuery.historyCurrentHash+" != current_hash: "+E);location.hash=E;jQuery.historyCurrentHash=E;jQuery.historyCallback(E.replace(/^#/,""))}}else{if(jQuery.browser.safari){if(!jQuery.dontCheck){var A=history.length-jQuery.historyBackStack.length,B;if(A){jQuery.isFirst=false;if(A<0){for(B=0;B<Math.abs(A);B++){jQuery.historyForwardStack.unshift(jQuery.historyBackStack.pop())}}else{for(B=0;B<A;B++){jQuery.historyBackStack.push(jQuery.historyForwardStack.shift())}}var D=jQuery.historyBackStack[jQuery.historyBackStack.length-1];if(D!==undefined){jQuery.historyCurrentHash=location.hash;jQuery.historyCallback(D)}}else{if(jQuery.historyBackStack[jQuery.historyBackStack.length-1]===undefined&&!jQuery.isFirst){if(document.URL.indexOf("#")>=0){jQuery.historyCallback(document.URL.split("#")[1])}else{E=location.hash;jQuery.historyCallback("")}jQuery.isFirst=true}}}}else{E=location.hash;if(E!==jQuery.historyCurrentHash){jQuery.historyCurrentHash=E;jQuery.historyCallback(E.replace(/^#/,""))}}}},historyLoad:function(C){var D;if(jQuery.browser.safari){D=C}else{D="#"+C;location.hash=D}jQuery.historyCurrentHash=D;if(jQuery.browser.msie){var B=jQuery.historyIFrame.contentWindow.document;B.open();B.close();B.location.hash=D;jQuery.historyCallback(C)}else{if(jQuery.browser.safari){jQuery.dontCheck=true;this.historyAddHistory(C);var A=function(){jQuery.dontCheck=false};window.setTimeout(A,200);jQuery.historyCallback(C);location.hash=D}else{jQuery.historyCallback(C)}}}});(function(C){function A(F){if(!F){return }F.setHours(0);F.setMinutes(0);F.setSeconds(0);F.setMilliseconds(0);return F}function D(F,G){if(F&&!isNaN(G)){return new Date(F.getFullYear(),F.getMonth()+G)}}function B(H,I){var F=[String(H)];for(var G=F[0].length;G<I;G++){F.unshift("0")}return F.join("")}function E(F,G){C.extend(this,{dateFormat:hcom.configuration.DEFAULT_DATE_FORMAT,dateFormatSymbols:hcom.locale.dateFormatSymbols,firstDayOfWeek:hcom.locale.firstDayOfWeek,offset:{top:5,left:0},hideOncreate:true,minDate:new Date(),maxDate:new Date(new Date().getTime()+330*24*60*60*1000),dateChanged:function(){},opened:function(){}},G);F.dateEnabled=true;A(this.minDate);A(this.maxDate);this.separators=this.dateFormat.split(/y+|M+|d+/);if(C.browser.msie&&this.separators.length===2){this.separators.unshift("");this.separators.push("")}this.symbols=C.grep(this.dateFormat.split(/[^yy+|MM+|d+]/),function(H){return H});this.input=C(F);this.bindMethodsToObj("show","hide","hideIfClickOutside","selectDate","prevMonth","nextMonth");this.build();this.selectDate();this.bindTriggers();if(this.hideOncreate){this.hide()}else{this.show()}}E.prototype={build:function(){this.monthNameSpan=C('<span class="month_name"></span>');this.prevMonthLink=C('<a href="#" class="prev"><div class="icon_sprite_calendar"><div class="calendar_0"></div></div></a>');this.nextMonthLink=C('<a href="#" class="next"><div class="icon_sprite_calendar"><div class="calendar_1"></div></div></a>');var F=C('<p class="month_nav"></p>').append(this.prevMonthLink.click(this.prevMonth)," ",this.monthNameSpan," ",this.nextMonthLink.click(this.nextMonth));var G="<table><thead><tr>";C(this.adjustDays(this.dateFormatSymbols.shortWeekdays)).each(function(){G+="<th>"+this+"</th>"});G+="</tr></thead><tbody></tbody></table>";this.dateSelector=this.rootLayers=C('<div class="date_selector"></div>').css({display:"none",position:"absolute",zIndex:100}).append(F,G).appendTo(document.body);if(C.browser.msie&&C.browser.version<7){this.ieframe=C('<iframe class="date_selector_ieframe" frameborder="0" src=""></iframe>').css({position:"absolute",display:"none",zIndex:99}).insertBefore(this.dateSelector);this.rootLayers=this.rootLayers.add(this.ieframe)}this.tbody=C("tbody",this.dateSelector);this.input.change(this.bindToObj(function(){this.selectDate()}));this.input.keydown(this.bindToObj(function(H){switch(H.keyCode){case 9:this.hide();break;case 27:this.hide();break;case 38:this.prevMonth();break;case 40:this.nextMonth();break}}))},selectMonth:function(G){if(!this.isMonthSelectable(G)){return }this.currentMonth=G;var L=this.rangeStart(G),K=this.rangeEnd(G);var F=this.daysBetween(L,K);var I=[];for(var H=0;H<=F;H++){var J=new Date(L.getFullYear(),L.getMonth(),L.getDate()+H);if(this.isFirstDayOfWeek(J)){I.push("<tr>")}if(J.getMonth()===G.getMonth()){if(this.isDateSelectable(J)){I.push('<td><a href="#" rel="',this.formatDate(J),'">',J.getDate(),"</a></td>")}else{I.push('<td class="disabled_day"><a rel="',this.formatDate(J),'">',J.getDate(),"</a></td>")}}else{if(this.isDateSelectable(J)){I.push('<td class="unselected_month"><a href="#" rel="',this.formatDate(J),'">',J.getDate(),"</a></td>")}else{I.push('<td class="unselected_month">',J.getDate(),"</td>")}}if(this.isLastDayOfWeek(J)){I.push("</tr>")}}this.monthNameSpan.empty().append(this.monthName(G)+" "+G.getFullYear());this.prevMonthLink.visible(this.isMonthSelectable(D(G,-1)),true);this.nextMonthLink.visible(this.isMonthSelectable(D(G,1)),true);this.tbody.empty().append(I.join(""));C("a",this.tbody).click(this.bindToObj(function(M){if(!C(M.target).parent().hasClass("disabled_day")){this.selectDate(this.parseDate(C(M.target).attr("rel")));if(C.browser.msie){this.hiddenBecauseOfDateSelection=true}this.input[0].focus();this.hide();M.preventDefault();return false}}));C("a[rel="+this.formatDate(new Date())+"]").parent().addClass("today")},selectDate:function(F){if(F===undefined){F=this.parseDate(this.input.val())}if(this.isDateSelectable(F)){this.selectedDate=F;this.selectMonth(F);var G=this.formatDate(F);if(this.input.val()!==G){this.input.val(G).change();this.dateChanged(F)}this.opened()}else{this.selectMonth(new Date(this.minDate.valueOf()));this.opened()}},show:function(){this.rootLayers.show();this.setPosition();this.input.unbind("focus.calendar")[0].focus();C([window,document.body]).click(this.hideIfClickOutside)},hide:function(){this.rootLayers.hide();C([window,document.body]).unbind("click",this.hideIfClickOutside);this.input.bind("focus.calendar",this.bindToObj(function(){if(C.browser.msie&&this.hiddenBecauseOfDateSelection){this.hiddenBecauseOfDateSelection=false}else{this.show()}}));this.input[0].blur()},hideIfClickOutside:function(G){if(this.trigger){var F=false;this.trigger.find("*").add(this.trigger).each(function(){if(this===G.target){F=true;return false}});if(F){return }}if(G.target!==this.input[0]&&!this.insideSelector(G)){this.hide()}},parseDate:function(H){var J=[],I=H,G,K,F;if(!H){return null}C.iterate(this.separators,function(M,L){if(L.first){return }I=I.substr(I.indexOf(this.separators[L.index-1])+this.separators[L.index-1].length);if(L.last){J.push(I.substr(0,I.lastIndexOf(M)))}else{J.push(I.substr(0,I.indexOf(M)))}},this);C.iterate(J,function(M,L){switch(this.symbols[L.index].charAt(0)){case"y":if(M.length<4){G=parseInt(M,10)+2000}else{G=parseInt(M,10)}break;case"M":if(this.symbols[L.index].length<3){K=parseInt(M,10)-1}else{if(this.symbols[L.index].length===3){K=C.inArray(M,this.dateFormatSymbols.shortMonths)}else{K=C.inArray(M,this.dateFormatSymbols.months)}}break;case"d":F=parseInt(M,10);break}},this);if(G>0&&K>=0&&F>0){return new Date(G,K,F)}return null},formatDate:function(F){var G=[];if(!F){return""}G.push(this.separators[0]);C.iterate(this.symbols,function(I,H){switch(I.charAt(0)){case"y":if(I.length<4){G.push(B(F.getFullYear()-2000,I.length))}else{G.push(F.getFullYear())}break;case"M":if(I.length<3){G.push(B(F.getMonth()+1,I.length))}else{if(I.length===3){G.push(this.dateFormatSymbols.shortMonths[F.getMonth()])}else{G.push(this.dateFormatSymbols.months[F.getMonth()])}}break;case"d":G.push(B(F.getDate(),I.length));break}G.push(this.separators[H.index+1])},this);return G.join("")},setPosition:function(){var F=this.input.offset();this.rootLayers.css({top:this.offset.top+F.top+this.input.outerHeight(),left:this.offset.left+F.left});if(this.ieframe){this.ieframe.css({width:this.dateSelector.outerWidth(),height:this.dateSelector.outerHeight()})}},moveMonthBy:function(F){this.selectMonth(D(this.currentMonth,F));this.opened()},prevMonth:function(){this.moveMonthBy(-1);return false},nextMonth:function(){this.moveMonthBy(1);return false},monthName:function(F){return this.dateFormatSymbols.months[F.getMonth()]},insideSelector:function(F){var G=this.dateSelector.offset();G.right=G.left+this.dateSelector.outerWidth();G.bottom=G.top+this.dateSelector.outerHeight();return F.pageY<G.bottom&&F.pageY>G.top&&F.pageX<G.right&&F.pageX>G.left},bindToObj:function(G){var F=this;return function(){return G.apply(F,arguments)}},bindMethodsToObj:function(){for(var F=0;F<arguments.length;F++){this[arguments[F]]=this.bindToObj(this[arguments[F]])}},bindTriggers:function(){var F=this.input.next();if(F.is(".hcomDate")){this.trigger=F;F.click(this.bindToObj(function(G){G.preventDefault();this.show()}))}},indexFor:function(H,G){for(var F=0;F<H.length;F++){if(G===H[F]){return F}}},monthNum:function(F){return this.indexFor(this.dateFormatSymbols.months,F)},shortMonthNum:function(F){return this.indexFor(this.dateFormatSymbols.shortMonths,F)},shortDayNum:function(F){return this.indexFor(this.dateFormatSymbols.shortWeekdays,F)},daysBetween:function(G,F){G=Date.UTC(G.getFullYear(),G.getMonth(),G.getDate());F=Date.UTC(F.getFullYear(),F.getMonth(),F.getDate());return(F-G)/86400000},changeDayTo:function(I,F,G){var H=G*(Math.abs(F.getDay()-I-(G*7))%7);return new Date(F.getFullYear(),F.getMonth(),F.getDate()+H)},rangeStart:function(F){return this.changeDayTo(this.firstDayOfWeek,new Date(F.getFullYear(),F.getMonth()),-1)},rangeEnd:function(F){return this.changeDayTo((this.firstDayOfWeek-1)%7,new Date(F.getFullYear(),F.getMonth()+1,0),1)},isFirstDayOfWeek:function(F){return F.getDay()===this.firstDayOfWeek},isLastDayOfWeek:function(F){return F.getDay()===(this.firstDayOfWeek-1)%7},adjustDays:function(H){var G=[];for(var F=0;F<H.length;F++){G[F]=H[(F+this.firstDayOfWeek)%7]}return G},isDateSelectable:function(F){return F&&F>=this.minDate&&F<this.maxDate},isMonthSelectable:function(F){return F&&(this.isDateSelectable(new Date(F.getFullYear(),F.getMonth()+1,0))||this.isDateSelectable(new Date(F.getFullYear(),F.getMonth(),1)))}};C.fn.dateInput=function(F){return this.each(function(){return new E(this,F)})}})(jQuery);(function(I){function B(O){return/radio|checkbox/i.test(O.type)}function N(O,P){return I(document.getElementsByName(O)).map(function(Q,R){return R.form===P&&R.name===O&&R||null})}function L(Q,O,P){switch(O.nodeName.toLowerCase()){case"select":return I("option:selected",O).length;case"input":if(B(O)){return N(O.name,P).filter(":checked").length}}return Q.length}function K(O){return I(O)[0]}function D(O,P,Q,R){if(Q.msgKeyPrefix&&O.messageKey){O.messageKey=[Q.msgKeyPrefix,O.messageKey].join(".")}if(Q.validationId){O.validationId=Q.validationId}}function E(O){if(typeof O==="string"){O=[O]}console.assert(O.constructor===Array);return O}function G(P){var O=[];if(typeof P==="string"){P=P.split(/\s/)}console.assert(P.constructor===Array);I.map(P,function(Q){O.push(E(Q))});return O}function M(O,T){var P,Q,S,R;if(!O){P=this.state.clone()}R=T();if(!O){Q=this.state.diffErrors(P);S=this.state.diffFields(P);if((R===true||Q.changes>0||S.changes>0)&&I.isFunction(this.settings.fieldsChanged)){this.settings.fieldsChanged(this.state,Q,S)}}}var F={"boolean":function(P,O){return P},string:function(P,O){return !!I(P,O.form).length},"function":function(P,O){return P(O)}};function A(P,O){return F[typeof P]?F[typeof P](P,O):true}var J=function(P,R,Q,O){this.element=P;this.message=R;this.messageKey=Q;this.validationId=O};J.prototype={compare:function(O){console.assert(O instanceof J);return this.element===O.element&&this.messageKey===O.messageKey}};var C=function(P,O){this.validator=P;this.bound=false;this.enabled=this.validator.settings.validateLastOnScroll;this.scrollEvtname=["scroll.validator",O.attr("id")].join("_")};C.prototype={validateLast:function(){var O=this.validator.state.lastActive;if(O){this.validator.element(O)}},bind:function(){var O=this;if(this.enabled&&!this.bound){this.bound=true;I(window).bind(this.scrollEvtname,function(){O.validateLast()});console.debug("ScrollValidator %s bound",this.scrollEvtname)}},unbind:function(){if(this.enabled&&this.bound){this.bound=false;I(window).unbind(this.scrollEvtname);console.debug("ScrollValidator %s unbound",this.scrollEvtname)}}};var H=function(){this.lastElement=undefined;this.lastActive=null;this.fieldsValidated={};this.errors={}};H.prototype=function(){function O(S){var Q,R=true;for(Q in S){if(S.hasOwnProperty(Q)){if(!(R=S[Q])){break}}}return R}function P(T,U){var Q={removed:{},added:{},changed:{}},R,S=0;for(R in U){if(U.hasOwnProperty(R)){if(!T.hasOwnProperty(R)){Q.added[R]=U[R];S++}}}for(R in T){if(T.hasOwnProperty(R)){if(!U.hasOwnProperty(R)){Q.removed[R]=T[R];S++}else{if(!(U[R]===T[R])){Q.changed[R]=U[R];S++}}}}Q.changes=S;return Q}return{hasFieldErrors:function(){return !O(this.fieldsValidated)},clone:function(){var Q=new H();Q.lastElement=this.lastElement;Q.lastActive=this.lastActive;Q.fieldsValidated=I.extend({},this.fieldsValidated);Q.errors=I.extend({},this.errors);return Q},diffErrors:function(Q){console.assert(Q instanceof H);return P(Q.errors,this.errors)},diffFields:function(Q){console.assert(Q instanceof H);return P(Q.fieldsValidated,this.fieldsValidated)}}}();I.fn.extend({validate:function(O){console.assert(!!this.length);var P=I.data(this[0],"validator");if(P){return P}P=new I.validator(O,this[0]);I.data(this[0],"validator",P);if(P.settings.onsubmit){this.find(".cancel:submit").click(function(){P.cancelSubmit=true});this.submit(function(Q){if(P.settings.debug){Q.preventDefault()}function R(S){if(P.settings.submitHandler){return P.settings.submitHandler.call(P,P.currentForm,S)}else{return true}}if(P.cancelSubmit){P.cancelSubmit=false;return R(Q)}if(P.form()){return R(Q)}else{return false}})}return P},valid:function(O){if(I(this[0]).is("form")){return this.validate().form(O)}else{var Q=true,P=I(this[0].form).validate();this.each(function(){Q=P.element(this);return Q});return Q}}});I.extend(I.expr[":"],{blank:function(O){return !I.trim(O.value)},filled:function(O){return !!I.trim(O.value)},unchecked:function(O){return !O.checked}});I.validator=function(O,P){this.settings=I.extend({},I.validator.defaults,O);this.currentForm=P;this.init()};I.validator.result=function(P,O){this.valid=P;this.messageKey=O;this.exclusive=false;this.messageParams=undefined;this.affected=[];this.validationId=undefined};I.validator.result.prototype={setExclusive:function(O){this.exclusive=O===undefined||!!O;return this},setMessageParams:function(){this.messageParams=Array.prototype.slice.call(arguments,0);return this},setAffected:function(O){this.affected=O;return this},setValidationId:function(O){this.validationId=O;return this}};I.extend(I.validator,{defaults:{messages:{},rules:{},related:{},errorClass:"error",onsubmit:true,clearLastError:false,validateLastOnScroll:false,validateIfDirty:false,onfocusin:function(O){this.state.lastActive=O;this.scrollValidator.bind();this.clearLastError(O);if(this.settings.focusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,O,this.settings.errorClass)}}},onfocusout:function(O){this.state.lastActive=null;this.scrollValidator.unbind();if(!B(O)){this.element(O)}},onkeyup:function(O){if(O===this.state.lastElement){this.element(O)}},onclick:function(O){this.state.lastActive=null;this.scrollValidator.unbind();this.element(O)},highlight:function(P,O){I(P).addClass(O)},unhighlight:function(P,O){I(P).removeClass(O)},messageResolver:function(Q,P,O){var S=I.validator.messages,U=this.settings.messages,R=[Q.name,P].join("."),T=[Q.name,O].join(".");return U[R]||U[T]||U[P]||U[O]||S[P]||S[O]||P||O}},setDefaults:function(O){I.extend(I.validator.defaults,O)},rulesForElement:function(P){var O=I.data(P.form,"validator"),Q;if(O.settings.rules){Q=O.settings.rules[P.name]||[]}else{Q=[]}return Q},addMethod:function(Q,T,R){var P=I.validator.methods,S=I.validator.messages,O;console.assert(!P.hasOwnProperty(Q));P[Q]=T;if(R!==undefined){for(O in R){if(R.hasOwnProperty(O)){console.assert(!S.hasOwnProperty(O));S[O]=R[O]}}}},prototype:{init:function(){this.reset();var Q=this.settings.rules,O=I(this.currentForm);I.each(Q,function(R,S){Q[R]=G(S)});if(this.settings.validateIfDirty){console.assert(!!I.fn.setSubmitted&&!!I.fn.isDirty);O.setSubmitted()}this.scrollValidator=new C(this,O);function P(S){var R=I.data(this[0].form,"validator");if(R.settings["on"+S.type]){R.settings["on"+S.type].call(R,this[0])}}O.delegate("focusin focusout keyup",":text, :password, :file, select, textarea",P).delegate("click",":radio, :checkbox",P)},form:function(O){var Q,P=this;M.call(this,O,function(){Q=P.checkElements(P.elements(),O)});if(!O){if(!Q){I(this.currentForm).triggerHandler("invalid-form.validate",[this])}}return Q},element:function(O,R){O=K(O);this.state.lastElement=O;if(typeof R!==undefined&&R===true){delete this.state.errors[O.name]}var Q,P=this;M.call(this,false,function(){Q=P.checkElements([O])});return Q},elements:function(){var P=this,O,R,Q={};return I([]).add(this.currentForm.elements).not(":submit, :reset, [disabled]").filter(function(){var S=this.tagName.toUpperCase();if(S==="INPUT"||S==="TEXTAREA"||S==="SELECT"){R=this.name;console.assert(R);O=P.settings.rules[R];if(!Q.hasOwnProperty(R)&&O&&O.length>0){return(Q[R]=true)}}return false})},reset:function(){this.state=new H()},addRules:function(O){I.extend(this.settings.rules,O)},clearLastError:function(Q){var S,O,T=this.state.fieldsValidated,R=this,P=0;if(this.settings.clearLastError){for(O in T){if(T.hasOwnProperty(O)){if(T[O]===false){S=O;P++;if(P>1){break}}}}if(P===1&&Q.name&&S===Q.name){M.call(this,false,function(){R.state.fieldsValidated[Q.name]=true;delete R.state.errors[Q.name]})}}},removeRules:function(P,O){var R=this.state,T=this.settings.rules,Q=I.isFunction(this.settings.ruleChangeListener)&&this.settings.ruleChangeListener,S=[];M.call(this,O,function(){for(var V,U=0;(V=P[U]);U++){delete R.errors[V];delete R.fieldsValidated[V];if(T.hasOwnProperty(V)){delete T[V];S.push(V)}}});if(Q){Q([],S)}},checkElements:function(X,a){var O,c,b,S,Q,U,Z,Y=true,e=I.validator.methods,T,f,W,V,d,R=[],P=this.state;while(X.length){d=[];for(c=0;(O=X[c]);c++){O=K(O);if(I.inArray(O.name,R)<0){R.push(O.name)}else{continue}if(B(O)){O=N(O.name,this.currentForm)[0]}S=this.settings.rules[O.name]||[];for(b=0;(Q=S[b]);b++){T=Q[0];f=Q[1];W=Q[2];U=e[T].call(this,I.trim(O.value),O,f);d.push.apply(d,U.affected);if(W){D.call(this,U,T,W,f)}if(!U.valid){V=this.settings.messageResolver.call(this,O,U.messageKey,T);V=U.messageParams?I.format(V,U.messageParams):I.format(V);if(!a){P.errors[O.name]=new J(O,V,U.messageKey,U.validationId)}break}if(U.exclusive){break}}Z=!S.length||U.valid;Y=Z&&Y;if(Z&&!a){delete P.errors[O.name]}P.fieldsValidated[O.name]=Z}X=d}return a?P:Y}},messages:{required:"This field is required.",minlength:"Please enter at least {0} characters.",maxlength:"Please enter no more than {0} characters.",rangelength:"Please enter a value between {0} and {1} characters long.",min:"Please enter a value greater than or equal to {0}.",max:"Please enter a value less than or equal to {0}.",range:"Please enter a value between {0} and {1}.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card.","creditcard.invalidchars":"Please enter only digits and hyphens for credit card number.",accept:"Please enter a value with a valid extension.",equalTo:"Please enter the same value again.",regexp:"Invalid field entry."},methods:{required:function(R,P,T){var S,Q,U,O;S=A(T,P);U=P.nodeName.toLowerCase();if(U==="select"){O=I("option:selected",P);Q=O.length>0&&(P.type==="select-multiple"||(I.browser.msie&&!O[0].attributes.value.specified?O[0].text:O[0].value).length>0)}else{if(U==="input"&&B(P)){Q=L(R,P,this.currentForm)>0}else{Q=R.length>0}}return new I.validator.result((S&&Q)||!S,"required").setExclusive(!S&&!Q)},minlength:function(P,O,Q){return new I.validator.result(L(P,O,this.currentForm)>=Q,"minlength").setMessageParams(String(Q))},maxlength:function(P,O,Q){return new I.validator.result(L(P,O,this.currentForm)<=Q,"maxlength").setMessageParams(String(Q))},rangelength:function(S,Q,T){var R=L(S,Q,this.currentForm),P=T[0],O=T[1];return new I.validator.result((R>=P)&&(R<=O),"rangelength").setMessageParams(String(P),String(O))},min:function(P,O,Q){return new I.validator.result(P>=Q,"min").setMessageParams(String(Q))},max:function(P,O,Q){return new I.validator.result(P<=Q,"max").setMessageParams(String(Q))},range:function(R,Q,S){var P=S[0],O=S[1];return new I.validator.result((R>=P)&&(R<=O),"range").setMessageParams(String(P),String(O))},email:function(P,O){return new I.validator.result(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(O.value),"email")},url:function(P,O){return new I.validator.result(/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(O.value),"url")},date:function(P,O){return new I.validator.result(!/Invalid|NaN/.test(new Date(P)),"date")},dateISO:function(P,O){return new I.validator.result(/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(P),"dateISO")},number:function(P,O){return new I.validator.result(/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(P),"number")},digits:function(P,O){return new I.validator.result(/^\d+$/.test(P),"digits")},creditcard:function(T,Q){var U=0,S=0,R,V,O=false,P=!/[^0-9\-]+/.test(T);if(P){T=T.replace(/\D/g,"");for(V=T.length-1;V>=0;V--){R=T.charAt(V);S=parseInt(R,10);if(O){if((S*=2)>9){S-=9}}U+=S;O=!O}}return new I.validator.result(P&&((U%10)===0),P?"creditcard":"creditcard.invalidchars")},accept:function(P,O,Q){Q=typeof Q==="string"?Q:"png|jpe?g|gif";return new I.validator.result(P.match(new RegExp(".("+Q+")$","i")),"accept")},equalTo:function(P,O,Q){return new I.validator.result(P===I(Q).val(),"equalTo")},regexp:function(Q,O,R){var P=R.test(O.value);return new I.validator.result(P,P&&"regexp")}}})})(jQuery);(function(C){var B=C.ajax;var A={};C.ajax=function(E){E=jQuery.extend(E,jQuery.extend({},jQuery.ajaxSettings,E));var D=E.port;if(E.mode==="abort"){if(A[D]){A[D].abort()}return(A[D]=B.apply(this,arguments))}return B.apply(this,arguments)}})(jQuery);(function(A){A.each({focus:"focusin",blur:"focusout"},function(C,B){A.event.special[B]={setup:function(){if(A.browser.msie){return false}this.addEventListener(C,A.event.special[B].handler,true)},teardown:function(){if(A.browser.msie){return false}this.removeEventListener(C,A.event.special[B].handler,true)},handler:function(E){var D=jQuery.makeArray(arguments);D[0]=A.event.fix(E);D[0].type=B;return A.event.handle.apply(this,D)}}});A.extend(A.fn,{delegate:function(D,C,B){return this.bind(D,function(E){var F=A(E.target);if(F.is(C)){return B.apply(F,arguments)}})},triggerEvent:function(B,C){return this.triggerHandler(B,[jQuery.event.fix({type:B,target:C})])}})})(jQuery);$.registerModule({name:"hcom.common.ascii85",impl:function(B){var A={"#":"v","?":"w","%":"x","<":"y",">":"{","\\":"|","`":"}",'"':"~"},G={v:"#",w:"?",x:"%",y:"<","{":">","|":"\\","}":"`","~":'"'},F=/([#%?<>\\`"])/g,E=/([vwxy{|}~])/g;function D(K,N,I,J){var M,L,O,H=[0,0,0,0,0];for(M=0;M<N;M+=4){O=((K[M]*256+K[M+1])*256+K[M+2])*256+K[M+3];if(!O){I.push("z")}else{for(L=0;L<5;L++){H[L]=O%85+J;O=Math.floor(O/85)}}I.push(String.fromCharCode(H[4],H[3],H[2],H[1],H[0]))}}function C(I,H,J){return I.replace(H,function(K){return J[K]})}return{encode:function(L,K){var I=[],J=L.length%4,N=L.length-J;K=K||33;D(L,N,I,K);if(J){var M=L.slice(N);while(M.length<4){M.push(0)}D(M,4,I,K);var H=I.pop();if(H==="z"){H="!!!!!"}I.push(H.substr(0,J+1))}return I.join("")},decode:function(Q,I){I=I||33;var J=Q.length,H=[],O=[0,0,0,0,0],L,K,R,P,N,M;for(L=0;L<J;++L){if(Q.charAt(L)==="z"){H.push(0,0,0,0);continue}for(K=0;K<5;++K){O[K]=Q.charCodeAt(L+K)-I}M=J-L;if(M<5){for(K=M;K<4;O[++K]=0){}O[M]=85}R=(((O[0]*85+O[1])*85+O[2])*85+O[3])*85+O[4];P=R&255;R>>>=8;N=R&255;R>>>=8;H.push(R>>>8,R&255,N,P);for(K=M;K<5;++K){H.pop()}L+=4}return H},encodeHash:function(H){return C(H,F,A)},decodeHash:function(H){return C(H,E,G)}}}});$.registerModule({name:"hcom.common.crc",impl:function(B){var A={crc8:{order:8,init:[0,0,0,0,0,0,0,0],polynom:[0,0,0,0,0,0,0,7],mask:[0,0,0,0,0,0,0,255],xor:[0,0,0,0,0,0,0,0]},crc16:{order:16,init:[0,0,0,0,0,0,0,0],polynom:[0,0,0,0,0,0,128,5],mask:[0,0,0,0,0,0,255,255],xor:[0,0,0,0,0,0,0,0]},crc32:{order:32,init:[0,0,0,0,255,255,255,255],polynom:[0,0,0,0,4,193,29,183],mask:[0,0,0,0,255,255,255,255],xor:[0,0,0,0,255,255,255,255]}};var C=function(D,E){this.setup=D;this.crc=this.setup.init.slice(0);this.crc.push(0);if(E){this.update(E)}return this};C.prototype={update:function(H){var D=this.setup.order,F=this.setup.polynom,J=this.crc,M=this.setup.mask,K,L;for(var I=0;(L=H[I]);I++){for(var G=0;G<8;G++){K=0;if(J[7-((D-1)>>3)]&(1<<((D-1)&7))){K=1}if(L&128){K^=1}L<<=1;for(var E=0;E<8;E++){J[E]=((J[E]<<1)|(J[E+1]>>7))&M[E];if(K){J[E]^=F[E]}}}}return this},digest:function(){var D,E=0;for(D=0;D<8;D++){E<<=8;E+=(this.crc[D]^this.setup.xor[D])}return E},hexDigest:function(){return this.digest().toString(16)}};$.extend(C,{presets:A,getDigest:function(D,E){return new C(D,E).digest()}});return C}});$.registerModule({name:"hcom.common.listener",impl:function(B){var D=function(){this.listenerHosts=[];this.listeners=[];return this};function C(G,F){var H=$.inArray(G,this.listenerHosts),I,E=false;if(H<0){this.listenerHosts.push(G);E=true;I=[];this.listeners.push(I)}else{I=this.listeners[H]}if(F!==undefined&&(E||$.inArray(F,I)<0)){I.push(F)}else{if(!E!==(F!==undefined)){throw"DuplicateListener"}}}function A(F,E){var H=$.inArray(F,this.listenerHosts),I,G;if(H>=0){if(E!==undefined){I=this.listeners[H];G=$.map(I,function(K,J){return(K===E?null:K)});if(G.length===I.length){console.error("listener callable not found");throw"ListenerNotFound"}}if(E===undefined||G.length===0){this.listenerHosts.splice(H,1);this.listeners.splice(H,1)}else{this.listeners[H]=G}}else{console.error("host not found while unregistering: %s",F);throw"HostNotFound"}}D.prototype={addListener:function(F,E){C.call(this,F,E);return this},removeListener:function(F,E){A.call(this,F,E);return this},fireEvent:function(){var E=Array.prototype.slice.call(arguments),G=this.listeners.slice(),F=this.listenerHosts.slice();$.map(F,function(H,I){$.map(G[I],function(J){J.apply((H.constructor===String?Object.getReferenceToNestedName(H):H),E)})});return this},fireOnHost:function(F){var E=Array.prototype.slice.call(arguments);E.splice(0,1);$.map(this.listenerHosts,function(G,H){F.apply((G.constructor===String?Object.getReferenceToNestedName(G):G),E)});return this},clear:function(){this.listeners=[];this.listenerHosts=[];return this}};return D}});$.registerModule({name:"hcom.common.pickler",impl:function(A){var B=function(){this.pickle=[];if(arguments.length>0){this.push.apply(this,arguments)}};$.extend(B,{fromString:function(H){var G=H.split(","),E=0,F=0,D=function(I){F=I.length;return""},C=function(J){var L,I=[],K=J||0;for(var M;(M=G[E]);E++){if(K>0){M=M.substring(K)}L=M.charAt(0);if(L==="]"){F--;return I}M=M.substring(1);M=M.replace(/\]+$/,D);if(L==="N"){I.push(parseFloat(M))}else{if(L==="S"){I.push(decodeURIComponent(M))}else{if(L==="b"){I.push(M==="0"?false:true)}else{if(L==="n"){I.push(null)}else{if(L==="["){I.push(C(K+1))}}}}}if(F-->0){return I}K=0}return I};return C()}});B.prototype={push:function(){var F,C,G=this.pickle;for(var D=0;D<arguments.length;D++){F=arguments[D];C=typeof F;if(C==="number"){G.push("N"+F)}else{if(C==="string"){G.push("S"+encodeURIComponent(F))}else{if(C==="boolean"){G.push("b"+(F?"1":"0"))}else{if(F===null){G.push("n")}else{if((C==="object")&&(F.constructor&&F.constructor===Array)){if(F.length===0){G.push("[]")}else{var E=G.length;this.push.apply(this,F);G[E]="["+G[E];G.push(G.pop()+"]")}}else{throw new Error("unsupported argument type")}}}}}}},toString:function(){return this.pickle.join(",")}};return B}});$.registerModule({name:"hcom.common.template",impl:function(C){var A=function(G){this.message=G;this.name="TemplateException"};A.prototype={toString:function(){return this.name+': "'+this.message+'"'}};var E=function(){this.modules={};this.templates={}};function F(I,G,H){if(!I.hasOwnProperty(G)){throw new A("requesting undefined "+H+": "+G)}return I[G]}function D(G,H){H.children("template").each(function(J){var I=$(this);G.templates[I.attr("name")]=I.text()});H.children("module").each(function(K){var J=$(this),I=J.attr("name");if(!G.modules.hasOwnProperty(I)){G.modules[I]=new E()}D(G.modules[I],J)});return G}function B(I,K){var G,J,H;for(G in K){if(K.hasOwnProperty(G)){if(!I.modules.hasOwnProperty(G)){I.modules[G]=new E()}H=K[G];for(J in H){if(H.hasOwnProperty(J)){I.modules[G].templates[J]=H[J]}}}}return I}E.prototype={getModule:function(G){return F(this.modules,G,"module")},getTemplate:function(G){return F(this.templates,G,"template")},hasModule:function(G){return this.modules.hasOwnProperty(G)},hasTemplate:function(G){return this.templates.hasOwnProperty(G)}};$.extend(E,{build:function(G){return D(new E(),G)},buildJson:function(G){return B(new E(),G)}});return E}});$.registerModule({name:"hcom.common.modules.adbanner",impl:function(){function A(){$("iframe[id^=bannerAd]").each(function(){this.src=this.src})}return{reloadAdBanners:A}}});$.registerModule({name:"hcom.common.modules.html",impl:function(A){return{centerBox:function(F,E,C){var G=$.browser.msie?$(window).scrollTop():0,B=(E===undefined?F.width():E)/2,D=(C===undefined?F.height():C)/2;F.css({top:String(Math.round($(window).height()/2-D+G))+"px",position:$.browser.msie?"absolute":"fixed"})}}}});$.registerModule({name:"hcom.common.modules.ajax",impl:function(C){var D=false,A={start:"ajaxStart.hcomGlobal",stop:"ajaxStop.hcomGlobal"};function B(E){if(E){$(document).bind(A.start,function(){D=true}).bind(A.stop,function(){D=false})}else{$(document).unbind(A.start).unbind(A.stop)}}return{init:function(){B(true)},isAjaxActive:function(){return D}}}});$.registerModule({name:"hcom.common.modules.events",impl:function(){function C(E){return E||$("body")}function D(){$(this).parents("form:first").submit()}function A(E){C(E).find(".hcomSubmitChange").bind("change",D)}function B(E){A(E)}return{attachSubmitChange:A,attachAllEvents:B}}});$.registerModule({name:"hcom.common.modules.emitter",impl:function(A){var B;B=function(){this.emitSuspended=false};B.prototype={addEvents:function(){var E,C,D;D=(this.events=this.events||{});for(E=0;(C=arguments[E]);E++){D[C]=D[C]||true}},suspendEmit:function(){this.emitSuspended=true},resumeEmit:function(){this.emitSuspended=false},emitEvent:function(C){var D;if(!this.emitSuspended){D=this.events[C];if(D!==true){D.emit.apply(D,Array.prototype.slice.call(arguments,1))}}},addReceiver:function(C,F,D){var E=this.events[C]||true;if(E===true){E=(this.events[C]=new B.Event(C,this))}E.addReceiver(F,D);return this},addReceivers:function(G){var F,D,C,I,H,E=Object.getKeys(G);for(F=0;(H=E[F]);F++){C=G[H];if(C.constructor!==Array){C=[C]}for(D=0;(I=C[D]);D++){this.addReceiver(H,I.receiver,I.scope)}}},removeReceiver:function(C,E,D){var F=this.events[C];if(F!==true){return F.removeReceiver(E,D)}return false},purgeReceivers:function(){var D,C;for(D in this.events){if(this.events.hasOwnProperty(D)){C=this.events[D];if(C!==true){C.purgeReceivers()}}}return this}};B.Event=function(C,D){this.scope=D;this.name=C;this.receivers=[];this.emitting=false};B.Event.prototype={addReceiver:function(C,D){var E;D=D||this.scope;if(this.getReceiverIndex(C,D)<0){E=this.createReceiver(C,D);if(this.emitting){this.receivers=this.receivers.slice(0)}this.receivers.push(E)}},createReceiver:function(C,D){var E={handler:C,scope:D};return E},getReceiverIndex:function(C,F){var D,E=this.receivers,G;for(D=0;(G=E[D]);D++){if(G.handler===C&&G.scope===F){return D}}return -1},removeReceiver:function(D,F){var E=this.emitting?(this.receivers=this.receivers.slice(0)):this.receivers,C=this.getReceiverIndex(D,F),G=C>=0;if(G){E.splice(C,1)}return G},purgeReceivers:function(){this.receivers=[]},emit:function(){var D,F,C,E=this.receivers[D];if(this.receivers.length){C=Array.prototype.slice.call(arguments,0);this.emitting=true;for(D=0;(F=this.receivers[D]);D++){F.handler.apply(F.scope||this.scope||window,C)}this.emitting=false}}};return B}});$.registerModule({name:"hcom.common.modules.itemtoggler",impl:function(A){var B,D,C;function E(H){var G=$(this),J,I=null,F;for(J in C){if(C.hasOwnProperty(J)){if(G.is(J)){I=C[J];break}}}if(I!==null){if(H){H.preventDefault()}I.onClick(G)}}B=function(F){var I,H,G,J=this;this.cfg=$.extend({},D,F);if(C.hasOwnProperty(this.cfg.clickFilter)){throw ("duplicate clickFilter")}I=this.cfg.containers;if(I.length){this.$containers=$(I[0]);for(G=1;(H=I[G]);G++){this.$containers=this.$containers.add(H)}}C[this.cfg.clickFilter]=this;if(this.cfg.hasOwnProperty("init")){this.cfg.init()}$.listen("click",this.cfg.clickFilter,E);if(this.cfg.clickOnInit!==null){this.$containers.find(this.cfg.clickOnInit).each(function(){J.onClick($(this))})}return this};B.prototype={onClick:function(F){var G=this.cfg.findContainerFromClick.call(this,F);G.toggleClass(this.cfg.contractedClass)}};B.init=function(){C={};D={clickFilter:"a.hcomItemToggler",contractedClass:"hcomContracted",clickOnInit:null,findContainerFromClick:function(F){return F.parent()}}};return B}});$.registerModule({name:"hcom.common.modules.state",impl:function(){function C(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}function B(){return this.name&&(/select|textarea/i.test(this.nodeName)||/text|hidden|password|checkbox/i.test(this.type))}function A(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this}function D(E,F){if(E){F.attr("checked","checked")}else{F.removeAttr("checked")}}return{formSerialize:function(F){var E={};F.map(A).filter(C).map(function(K,L){var J=$(L),H;if(J.is("select")&&J.attr("multiple")){H=[];for(var I=0,G=L.options.length;I<G;I++){if(L.options[I].selected){H.push(L.options[I].value)}}}else{H=J.val()}if(E.hasOwnProperty(L.name)){if(E[L.name].constructor!==Array){E[L.name]=[E[L.name]]}E[L.name].push(H)}else{E[L.name]=H}});return E},formRestore:function(F,E){E.map(A).filter(B).map(function(I,K){var H=$(K),G=H.attr("type");if(F.hasOwnProperty(K.name)){var J=F[K.name];if(J.constructor===String){if(G==="checkbox"){D(H.val()===J,H)}else{if(H.is("select")){if(typeof J==="string"){H.val(J)}else{if(K.options.length<J){K.selectedIndex=J}}}else{H.val(J)}}}else{if(G==="checkbox"){D($.inArray(H.val(),J)>=0,H)}else{if(H.is("select")){H.val(J)}}}}else{if(G==="checkbox"){D(false,H)}else{H.val("")}}})},formRestoreConditional:function(F,E){E.map(A).filter(B).map(function(I,K){var H=$(K),G=H.attr("type"),J=F[K.name];if(F.hasOwnProperty(K.name)&&typeof J!=="undefined"&&J.length!==0&&H.val().length===0){if(J.constructor===String){if(G==="checkbox"){D(H.val()===J,H)}else{if(H.is("select")){if(K.options.length<J){K.selectedIndex=J}}else{H.val(J)}}}else{if(G==="checkbox"){D($.inArray(H.val(),J)>=0,H)}else{if(H.is("select")){H.val(J)}}}}})}}}});$.registerModule({name:"hcom.common.modules.print",impl:function(A){return{init:function(){$.listen("click",".hcomPrint",function(B){if(window.print){window.print()}B.preventDefault()})}}}});$.registerModule({name:"hcom.common.modules.popup",impl:function(A){var B={height:600,width:600,toolbar:0,scrollbars:1,status:1,resizable:1,left:0,top:0,center:1};function C(K){var F=K.which?(K.which===1):(K.button===0);if(F){var E,H={},J=$(this);if(this.tagName.toLowerCase()!=="a"){J=$(this).parents("a:first")}var D=(J.attr("rel")||"").split(",");for(var G=0;G<D.length;G++){E=D[G].split(":");if(H[E[0]]!==undefined&&E.length===2){H[E[0]]=E[1]}}H=$.extend({},B,H);if(H.center===1){H.top=(screen.height-(H.height+110))/2;H.left=(screen.width-H.width)/2}var I=["height=",H.height,",width=",H.width,",toolbar=",H.toolbar,",scrollbars=",H.scrollbars,",status=",H.status,",resizable=",H.resizable,",left=",H.left,",screenX=",H.left,",top=",H.top,",screenY=",H.top];window.open(J.attr("href"),"popup",I.join("")).focus();K.preventDefault()}}return{init:function(){$.listen("click",".hcomPopup",C)}}}});$.registerModule({name:"hcom.common.modules.dropdown",dependencies:["hcom.common.modules.emitter","hcom.common.modules.ie6popupplate"],impl:function(B){var C,A;A=function(){var D,E;this.opened=null;for(D=0;(E=arguments[D]);D++){this.addMenu(E)}};A.prototype={addMenu:function(D){if(D instanceof C){D.addReceiver("open",this.onOpen,this);D.addReceiver("close",this.onClose,this)}else{console.error("invalid argument")}return this},onOpen:function(D){if(this.opened&&this.opened!==D){this.opened.hide()}this.opened=D},onClose:function(D){if(this.opened===D){this.opened=null}}};C=$.extendCls(hcom.common.modules.emitter,{constructor:function(D){C.superclass.constructor.call(this);this.addEvents("open","close");this.cfg=$.extend({},C.defaultConfig,D);if(!D.container){this.cfg.container=D.menu.parent()}this.state={active:false,focusTS:0};this.ie6plate=new hcom.common.modules.ie6popupplate({$aligner:this.cfg.menu});this.bind()},isInsideEvent:function(E){var D=E.target||E.srcElement;return $.inArray(this.cfg.container[0],$(D).parents())>=0},bind:function(){var D=this.cfg,E=this;D.trigger.bind("click."+D.ns,function(F){E.onTriggerClick(F)}).bind("focus."+D.ns,function(F){E.onTriggerFocus(F)})},onDocumentClick:function(D){if(this.state.active&&!this.isInsideEvent(D)){this.hide()}},onDocumentFocus:function(D){if(this.state.active&&D.target!==document&&!this.isInsideEvent(D)){this.hide()}},onDocumentKeyUp:function(D){if(this.state.active&&!this.isInsideEvent(D)){this.hide()}},onTriggerClick:function(D){var E=this.state,F;D.preventDefault();F=new Date().getTime()-E.focusTS;if(F>800){this.setActive(!E.active)}},onTriggerFocus:function(D){this.state.focusTS=new Date().getTime();this.show()},setActive:function(I){var H=this.state,E=this.cfg,F,G,D,J;if(I!==H.active){H.active=I;this.emitEvent(I?"open":"close",this);G="focus."+E.ns;F="click."+E.ns;D="keyup."+E.ns;if(I){J=this;$(document).bind(G,function(K){J.onDocumentFocus(K)}).bind(F,function(K){J.onDocumentClick(K)}).bind(D,function(K){J.onDocumentKeyUp(K)})}else{$(document).unbind(G).unbind(F).unbind(D)}E.container[I?"addClass":"removeClass"](E.activeClass);this.ie6plate[I?"show":"hide"]()}},show:function(){this.setActive(true)},hide:function(){this.setActive(false)}});C.defaultConfig={ns:"DDMenu"};return{menu:C,bar:A}}});$.registerModule({name:"hcom.common.modules.calendar",dependencies:["hcom.common.pages.common"],impl:function(){return{init:function(){$.map(["click","focus"],function(A){$.listen(A,".hcomDate",function(C){var D=$(this),B=new Date().valueOf();if(D.is("img")){D=D.prev()}else{if(D.is("span")){D=D.parent().prev()}}if(D[0].dateEnabled){return true}if(D.is("input")){D.dateInput({hideOncreate:false,minDate:D.is("[class*='hcomCheckout']")?new Date(B+1000*60*60*24):new Date(B),dateChanged:function(G){var K=this.input.attr("class").match(/hcomCheckin(\w*)/),E=this.input.attr("class").match(/hcomCheckout(\w*)/);if(K){var F=$("input.hcomCheckout"+K[1]),J=this.parseDate(F.val());if(J&&G>=J){F.val(this.formatDate(new Date(G.getFullYear(),G.getMonth(),G.getDate()+1))).change()}}else{if(E){var I=$("input.hcomCheckin"+E[1]),H=this.parseDate(I.val());if(H&&G<=H){I.val(this.formatDate(new Date(G.getFullYear(),G.getMonth(),G.getDate()-1))).change()}}}},opened:function(){var H=this.input.attr("class").match(/hcomCheckin(\w*)/),G=this.input.attr("class").match(/hcomCheckout(\w*)/);var M=H?H[1]:(G?G[1]:"");var J=$("input.hcomCheckout"+M),E=this.parseDate(J.val());var F=$("input.hcomCheckin"+M),I=this.parseDate(F.val());$(".checkin_day").removeClass("checkin_day");$(".checkout_day").removeClass("checkout_day");$(".interval").removeClass("interval");$("a[rel="+this.formatDate(I)+"]").parent().addClass("checkin_day");$("a[rel="+this.formatDate(E)+"]").parent().addClass("checkout_day");if(I&&E){var K=new Date(I.getFullYear(),I.getMonth(),I.getDate()+1);var L=new Date(K.getDate()+31);while(K<L&&K<E){$("a[rel="+this.formatDate(K)+"]").parent().addClass("interval");K.setDate(K.getDate()+1)}}}})}return false})})}}}});$.registerModule({name:"hcom.common.modules.popdiv",impl:function(R){var T,E,Q={top:1,right:2,bottom:3,left:4},H={delayIn:1,transIn:2,on:3,delayOut:4,transOut:5,off:6,waitClose:7},O,C;function N(b,c){this.x=b;this.y=c}function Z(d,b){var c,g=b.length-1,e,f=0;for(c=0;c<g;c++){if(((b[c].y<=d.y)&&(b[c+1].y>d.y))||((b[c].y>d.y)&&(b[c+1].y<=d.y))){e=(d.y-b[c].y)/(b[c+1].y-b[c].y);if(d.x<b[c].x+e*(b[c+1].x-b[c].x)){f++}}}return(f%2)===1}function X(c,b){c.css("display",b?"block":"none")}function L(b){if(b){window.clearTimeout(b)}}function V(){return null}function G(){var b=this.d.callbacks,d=this.d.callbackScope,c;$.map(E,d?function(e){if(b.hasOwnProperty(e)){c=function(){arguments.callee.callback.apply(d,arguments)};c.callback=b[e];b[e]=c}else{b[e]=V}}:function(e){if(!b.hasOwnProperty(e)){b[e]=V}})}function M(d,g,e,f,c){if(c){return[new N(d-c,g-c),new N(d+e+c,g-c),new N(d+e+c,g+f+c),new N(d-c,g+f+c)]}else{return[new N(d,g),new N(d+e,g),new N(d+e,g+f),new N(d,g+f)]}}function P(c){var b=M.call(this,c.thumbLeft,c.thumbTop,c.thumbWidth,c.thumbHeight,5);b.push(b[0]);return b}function D(e){var d=M.call(this,e.left,e.top,e.width,e.height),c=P.call(this,e),b,f=e.alignment;if(f===Q.top){b=[c[0],c[3],c[2],c[1],d[2],d[1],d[0],d[3]]}else{if(f===Q.right){b=[c[0],c[1],d[0],d[1],d[2],d[3],c[2],c[3]]}else{if(f===Q.bottom){b=[c[3],c[0],c[1],c[2],d[1],d[2],d[3],d[0]]}else{if(f===Q.left){b=[d[0],d[1],c[0],c[1],c[2],c[3],d[2],d[3]]}}}}b.push(b[0]);return b}function Y(c){var d=$(document),b=this;if(c){d.bind("mousemove."+this.d.namespace,function(e){if(!Z({x:e.pageX,y:e.pageY},b.d.cHotSpot)){b.d.cHotSpotMouseOutCallback.call(b)}else{if(b.d.cHotSpotMouseInCallback){b.d.cHotSpotMouseInCallback.call(b)}}})}else{d.unbind("mousemove."+this.d.namespace)}}function S(f){var e=new Date().getTime(),c=e-this.d.transStart,d=this.d.transLen,b=(d>0?Math.min(1,c/this.d.transLen):1);return Math.round(f*b)}function A(){var b=this.d.state;if(b===H.transIn||(b===H.delayIn&&!this.d.fadeEnabled)){this.d.state=H.on;this.d.callbacks.activate()}}function U(){if(this.d.mouseWithinHotspot===true){this.d.mouseWithinHotspot=false;if(this.d.state===H.delayIn){Y.call(this,false);this.d.state=H.off;L(this.d.cDelayInTimerId);this.d.cDelayInTimerId=null;this.d.callbacks.setThumbOverlayAnim(false,this.d.$cThumb);this.d.callbacks.setThumbOverlay(false,this.d.$cThumb)}}}function W(){var c=this.d.state;if(c===H.transOut||(c===H.delayOut&&!this.d.fadeEnabled)){this.d.state=H.off;this.d.setVisible.call(this,this.d.$container,false);this.d.callbacks.destroy();Y.call(this,false);this.d.cHotSpotMouseInCallback=null}else{if(c===H.waitClose){var b=this;this.d.callbacks.destroy();Y.call(this,false);this.d.thumbnailCoords=this.d.waitThumbnailCoords;this.d.hotspotCoords=this.d.waitHotspotCoords;this.d.cHotSpot=this.d.thumbnailCoords;this.d.cHotSpotMouseOutCallback=U;this.d.$cThumb=this.d.$cWaitThumb;this.d.state=H.delayIn;Y.call(this,true);if(!this.d.fadeEnabled){this.d.transLen=0}if(this.d.transLen<this.d.delayIn){this.d.cDelayInTimerId=window.setTimeout(function(){C.call(b)},this.d.delayIn-this.d.transLen)}else{C.call(this)}}}}function B(d,b){var e=new Date().getTime(),c=this;this.d.transStart=e;this.d.transLen=b;if(d){this.d.$container.stop().fadeTo(b,1,function(){c.d.transStart=null;c.d.transLen=null;A.call(c)})}else{this.d.$container.stop().fadeTo(b,0,function(){c.d.transStart=null;c.d.transLen=null;W.call(c)})}}function J(){if(this.d.mouseWithinHotspot===false){this.d.mouseWithinHotspot=true;var b=this.d.state,c;if(b===H.delayOut){this.d.cHotSpotMouseInCallback=null;this.d.cHotSpot=this.d.hotspotCoords;L(this.d.cDelayOutTimerId);this.d.cDelayOutTimerId=null;this.d.state=H.on}else{if(b===H.transOut){this.d.state=H.transIn;this.d.callbacks.setThumbOverlay(true,this.d.$cThumb);this.d.cHotSpot=this.d.hotspotCoords;c=S.call(this,this.d.fadeInTime);B.call(this,true,c)}}}}function F(){if(this.d.state===H.delayOut){this.d.cHotSpot=this.d.thumbnailCoords;this.d.cDelayOutTimerId=null;this.d.cHotSpotMouseInCallback=J;this.d.callbacks.passivate();this.d.callbacks.setThumbOverlay(false,this.d.$cThumb);if(this.d.fadeEnabled){this.d.state=H.transOut;B.call(this,false,this.d.fadeOutTime)}else{this.d.setVisible.call(this,this.d.$container,false);W.call(this)}}}function a(){if(this.d.mouseWithinHotspot===true){this.d.mouseWithinHotspot=false;var c=this.d.state,b=this,d;if(c===H.transIn){this.d.state=H.transOut;this.d.callbacks.setThumbOverlay(false,this.d.$cThumb);this.d.cHotSpot=this.d.thumbnailCoords;this.d.cHotSpotMouseInCallback=J;d=S.call(this,this.d.fadeOutTime);B.call(this,false,d)}else{if(c===H.on){this.d.cHotSpotMouseInCallback=J;this.d.cHotSpot=this.d.hotspotCoords;this.d.state=H.delayOut;this.d.cDelayOutTimerId=window.setTimeout(function(){F.call(b)},this.d.delayOut)}}}}C=function(){if(this.d.state===H.delayIn){this.d.cDelayInTimerId=null;if(this.d.fadeEnabled){this.d.state=H.transIn}this.d.cHotSpot=this.d.hotspotCoords;this.d.cHotSpotMouseOutCallback=a;this.d.mouseWithinHotspot=true;this.d.$container.attr("style",this.d.containerStyle);this.d.callbacks.initialize();this.d.callbacks.setThumbOverlayAnim(false,this.d.$cThumb);if(this.d.fadeEnabled){this.d.$container.css("opacity","0");this.d.setVisible.call(this,this.d.$container,true);B.call(this,true,this.d.fadeInTime)}else{this.d.setVisible.call(this,this.d.$container,true);A.call(this)}}else{}};function I(){var b=this.d;if(b.mouseWithinHotspot){b.mouseWithinHotspot=false;if(b.state===H.waitClose){b.callbacks.setThumbOverlayAnim(false,b.$cWaitThumb);b.callbacks.setThumbOverlay(false,b.$cWaitThumb);b.cHotSpot=b.thumbnailCoords;b.state=H.transOut;b.cHotSpotMouseOutCallback=a;b.cHotSpotMouseInCallback=J;delete b.$cWaitThumb;delete b.waitThumbnailCoords;delete b.waitHotspotCoords}}}function K(b){if(b===H.delayIn){L(this.d.cDelayInTimerId);this.d.cDelayInTimerId=null}else{if(b===H.delayOut){L(this.d.cDelayOutTimerId);this.d.cDelayOutTimerId=null;this.d.callbacks.passivate()}}}T=function(b){this.d=$.extend({},O,b);this.d.containerStyle=this.d.$container.attr("style");G.call(this,this.d.callbacks,this.d.callbackScope)};T.init=function(){E=["setThumbOverlay","setThumbOverlayAnim","initialize","destroy","activate","passivate"];O={delayIn:800,delayOut:700,fadeInTime:300,fadeOutTime:300,fadeEnabled:false,state:H.off,transStart:null,transLen:null,cDelayInTimerId:null,cDelayOutTimerId:null,callbackScope:null,callbacks:{},setVisible:X};if(O.fadeEnabled&&$.browser.msie&&$.browser.version<7){O.fadeEnabled=false;console.info("popdiv fading disabled, IE6 detected")}};T.prototype={states:H,alignments:Q,currentState:function(){return this.d.state},onThumbnailHoover:function(d,c,b){var g=this.d.state,f=this;if(g===H.off){this.d.thumbnailCoords=P.call(this,b);this.d.hotspotCoords=D.call(this,b);this.d.cHotSpot=this.d.thumbnailCoords;this.d.cHotSpotMouseOutCallback=U;this.d.cHotSpotMouseInCallback=null;this.d.mouseWithinHotspot=true;this.d.$cThumb=c;Y.call(this,true);this.d.callbacks.setThumbOverlay(true,c);this.d.callbacks.setThumbOverlayAnim(true,c);this.d.state=H.delayIn;L(this.d.cDelayInTimerId);this.d.cDelayInTimerId=window.setTimeout(function(){C.call(f)},this.d.delayIn)}else{if(!Z({x:d.pageX,y:d.pageY},this.d.thumbnailCoords)&&(g!==H.waitClose)){this.d.state=H.waitClose;Y.call(this,false);this.d.waitThumbnailCoords=P.call(this,b);this.d.waitHotspotCoords=D.call(this,b);this.d.cHotSpot=this.d.waitThumbnailCoords;this.d.cHotSpotMouseOutCallback=I;this.d.cHotSpotMouseInCallback=null;this.d.mouseWithinHotspot=true;this.d.$cWaitThumb=c;Y.call(this,true);K.call(this,g);if(g!==H.transOut){this.d.callbacks.setThumbOverlay(false,this.d.$cThumb)}if(this.d.fadeEnabled){if(g!==H.transOut){var e=(g===H.transIn?S.call(this,this.d.fadeOutTime):this.d.fadeOutTime);B.call(this,false,e)}}else{this.d.setVisible.call(this,this.d.$container,false);W.call(this)}this.d.callbacks.setThumbOverlay(true,c);this.d.callbacks.setThumbOverlayAnim(true,c)}}},destroy:function(){var b=this.d.state;this.d.state=H.destroy;if(b!==H.off){Y.call(this,false);this.d.cHotSpotMouseInCallback=null;if(b===H.transIn||b===H.transOut||b===H.waitClose){if(this.d.fadeEnabled){this.d.$container.stop()}if(b===H.waitClose){this.d.callbacks.setThumbOverlayAnim(false,this.d.$cWaitThumb);this.d.callbacks.setThumbOverlay(false,this.d.$cWaitThumb);this.d.$cWaitThumb=null}}K.call(this,b);if(b===H.delayIn){this.d.callbacks.setThumbOverlayAnim(false,this.d.$cThumb)}else{this.d.setVisible.call(this,this.d.$container,false);this.d.callbacks.destroy()}if(b===H.transIn||b===H.on||b===H.delayOut){this.d.callbacks.setThumbOverlay(false,this.d.$cThumb)}}},forceClose:function(){this.destroy();this.d.state=H.off},forceOpen:function(){console.debug("popDiv.%s - forceOpen",this.d.namespace);if(this.d.state===H.delayIn){L(this.d.cDelayInTimerId);C.call(this)}}};return T}});$.registerModule({name:"hcom.common.modules.searchpopdiv",dependencies:["hcom.common.modules.popdiv"],impl:function(C){var D,A;function B(){return{setThumbOverlay:this.popDivSetThumbOverlay,setThumbOverlayAnim:this.popDivSetThumbOverlayAnim,initialize:this.popDivInitialize,activate:this.popDivActivate,passivate:this.popDivPassivate,destroy:this.popDivDestroy}}D=$.extendCls(hcom.common.modules.popdiv,{constructor:function(F){var E=(this.config=$.extend({},F,A));this.$popDiv=$(E.$container);this.$popupPlate=($.browser.msie&&($.browser.version<7))?$(E.plateContainer):null;this.cHotelId=null;this.cPosition=null;if(E.clickFilter){$.listen("click",E.clickFilter,function(G){G.preventDefault();return false})}$.extend(E,{callbacks:B.call(this),callbackScope:this});D.superclass.constructor.call(this,E);if(!E.manualEventAttachment){this.attachEvents()}},thumbDim:{height:64,width:64},attachEvents:function(){var F=this,H=function(I){F.handleMouseOver(I)},E=function(I){F.forceOpen()},G=function(I){F.forceClose()};if(this.config.mouseOverObjects){this.config.mouseOverObjects().bind(["mouseover",this.config.eventNameSpace].join("."),H)}$.listen("mouseover",this.config.mouseoverFilter,H);if(this.config.closeSelect){$.listen("click",this.config.closeSelect,G)}$.map(this.config.clickFilters,function(I){$.listen("click",I,E)});return this},handleMouseOver:function(E){var F=$(E.target);this.onThumbnailHoover(E,F,(this.cPosition=this.calculatePopDivPosition(F)))},popDivSetThumbOverlay:function(F,G){var E=this.getGadgetsFromThumb(G);E.$promptIcon[F?"hide":"show"]();E.$overlay[F?"show":"hide"]()},popDivSetThumbOverlayAnim:function(E,G){var F=G.parent().parent().find("img.thumbnail_popDiv_animation:first");F[E?"show":"hide"]()},setPopDiv:function(E){this.$popDiv.css({top:E.top+"px",left:E.left+"px"})},plateOffsets:null,setPlate:function(F){var E=["top","left","width","height"],H,G,I={top:F.top,left:F.left,width:this.popDivDim.width,height:this.popDivDim.height};if(this.$popupPlate){if(this.plateOffsets){for(H=0;(G=E[H]);H++){I[G]+=this.plateOffsets[G]}}for(H=0;(G=E[H]);H++){I[G]=I[G]+"px"}this.$popupPlate.css(I).show()}},popDivInitialize:function(F,G){var E=this.cPosition;this.setPopDiv(E);this.setPlate(E);this.setTail(E)},popDivActivate:function(E,F){},popDivPassivate:function(E,F){},popDivDestroy:function(E,F){}});D.init=function(){A={plateContainer:"#popupPlate",manualEventAttachment:false}};return D}});$.registerModule({name:"hcom.common.modules.slideshow",depends:["hcom.common.modules.emitter"],impl:function(D){var A,C,B,E;A=$.extendCls(hcom.common.modules.emitter,{constructor:function(F){$.extend(this,{config:$.extend({},C,F),started:false,slideTimer:null,currentSlide:null,fadeState:B.transparent,resumeTransition:false,fadeStarted:null,slideStates:{},restartTimer:false,preloadingSince:0});A.superclass.constructor.call(this);this.addEvents("change","start","stop");this.resetImage();if(this.config.fade){this.config.$image.hide()}if(this.config.autoStart){this.started=true;this.changeSlide(this.getNextSlide(),false)}},isStarted:function(){return this.started},preloadSlide:function(F){var G=this;if(!this.slideStates.hasOwnProperty(F)){this.slideStates[F]=E.preloading;$.preloadAsyncImage(this.config.images[F],function(H,I){G.changeCallback(F,H,I)})}},slidePreloaded:function(G,F,H){this.slideStates[G]=E[F?"failed":"preloaded"];if(this.resumeTransition===G){this.continueTransition(H);this.resumeTransition=false}},changeCallback:function(G,F,H){if(G!==undefined){this.slidePreloaded(G,F,H);if(this.started){this.startPlayTimer()}}else{if(this.slideStates[this.currentSlide]===E.preloaded||this.preloadingSince>=3){this.changeSlide(this.getNextSlide(),true);this.preloadingSince=0}else{if(this.slideStates[this.currentSlide]!==E.preloaded){this.preloadingSince++}}}},stopPlayTimer:function(){if(this.slideTimer){clearInterval(this.slideTimer);this.slideTimer=null}},startPlayTimer:function(){var F=this;this.stopPlayTimer();this.slideTimer=setInterval(function(){F.changeCallback()},this.config.interval)},getPrevSlide:function(){var F=this.currentSlide;if(F===null||--F<0){F=this.config.images.length-1}return F},getNextSlide:function(){var F=this.currentSlide;if(F===null||++F>=this.config.images.length){F=0}return F},start:function(){var F=this.config.images.length>1;if(!this.started){this.started=F;if(this.currentSlide===null){this.changeSlide(this.getNextSlide(),!F)}else{if(F){this.startPlayTimer()}}if(F){this.emitEvent("start")}}},stop:function(){if(this.started){this.stopPlayTimer();this.started=false;this.emitEvent("stop")}},togglePlay:function(){if(this.started){this.stop()}else{this.start()}},gotoNext:function(){this.changeSlide(this.getNextSlide())},gotoPrev:function(){this.changeSlide(this.getPrevSlide())},continueTransition:function(K){var I=this,J,G,F;if(this.fadeState===B.transparent){F=this.slideStates[this.currentSlide];if(F===E.preloaded){if(K){var H=this.config.$image.parent(":first");K.css("display",this.config.$image.css("display")).css("opacity",this.config.$image.css("opacity"));this.config.$image.remove();H.append(K);this.config.$image=K}else{this.config.$image.attr("src",this.config.images[this.currentSlide])}this.fadeState=B.fadeIn;this.fadeStarted=new Date().getTime();this.config.$image.fadeIn(this.config.fade,function(){I.fadeInComplete()})}else{if(F===E.preloading){this.resumeTransition=this.currentSlide}}}else{if(this.fadeState===B.fadeIn){this.config.$image.stop();J=new Date().getTime();G=J-this.fadeStarted;this.fadeStarted=J-this.config.fade+G;this.fadeState=B.fadeOut;this.config.$image.fadeOut(G,function(){I.fadeOutComplete()})}else{if(this.fadeState===B.opaque){this.fadeState=B.fadeOut;this.config.$image.fadeOut(this.config.fade,function(){I.fadeOutComplete()})}}}},resetImage:function(){this.fadeState=B.transparent;this.config.$image.css({opacity:null,display:"none"})},fadeOutComplete:function(){this.resetImage();this.continueTransition()},fadeInComplete:function(){this.fadeState=B.opaque;if(this.restartTimer){this.restartTimer=false;this.startPlayTimer()}},changeSlide:function(F,G){var H;if(this.currentSlide!==F&&F>=0&&F<this.config.images.length){H=this.currentSlide;this.currentSlide=F;this.preloadSlide(F);this.preloadSlide(this.getNextSlide());this.emitEvent("change",H,F);this.restartTimer=this.started&&!G;if(this.restartTimer){this.stopPlayTimer()}if(this.config.fade){this.continueTransition()}else{this.config.$image.attr("src",this.config.images[this.currentSlide])}}},destroy:function(){this.stopPlayTimer();this.purgeReceivers()}});A.init=function(){C={autoStart:true,interval:3000,fade:600};B={opaque:0,fadeIn:1,fadeOut:2,transparent:3};E={failed:0,preloading:1,preloaded:2}};return A}});$.registerModule({name:"hcom.common.modules.hotelimagepopdiv",dependencies:["hcom.common.modules.searchpopdiv","hcom.common.modules.slideshow"],images:["image_pop_top.png","image_pop_left_main.png","image_pop_bg.png","image_pop_right.png","image_pop_left_top.png","image_pop_left_bottom.png"],imageUrlPrefix:"/images/search/pop_divs/",impl:function(C){var D,B,A;B=function(E){this.records=E&&E.data||null};B.prototype={get:function(E){return this.records&&this.records.hasOwnProperty(E)?this.records[E]:null},load:function(E){this.records=E}};D=$.extendCls(hcom.common.modules.searchpopdiv,{constructor:function(E){E=$.extend({},A,E);this.tailId=this.tailPosition.center;this.hotelId=null;this.slideShow=null;this.ssControlVisible=true;D.superclass.constructor.call(this,E)},popDivDim:{width:385,height:330},calculatePopDivPosition:function(M){var E,G,F=M.offset(),I=$(document).scrollTop(),H=$(window).height(),K=F.top+Math.round(this.thumbDim.height/2),L=Math.round(this.popDivDim.height/2),J;if((K-I)<L){E=K-50;J=this.tailPosition.top}else{if((K+L)>(H+I)){E=K-this.popDivDim.height+50;J=this.tailPosition.bottom}else{E=K-L;J=this.tailPosition.center}}G=F.left+this.thumbDim.width-10;return{top:E,left:G,width:this.popDivDim.width,height:this.popDivDim.height,thumbTop:F.top,thumbLeft:F.left,thumbWidth:this.thumbDim.width,thumbHeight:this.thumbDim.height,alignment:this.alignments.right,tail:J}},attachEvents:function(){var E=this,F=this.config.buttonSelectors;$(F.prev).bind("click",function(G){E.onPrevClick(G)});$(F.stop).bind("click",function(G){E.onPauseClick(G)});$(F.next).bind("click",function(G){E.onNextClick(G)});D.superclass.attachEvents.call(this)},getHotelIdFromThumbId:function(E){return parseInt(E.substring(7),10)},handleMouseOver:function(E){var F=$(E.target);if(F.is("div.photoPrompt")){E.target=F.parent().find(this.mouseoverFilter+":first").get(0)}this.hotelId=this.getHotelIdFromThumbId(F.attr("id"));D.superclass.handleMouseOver.call(this,E)},getGadgetsFromThumb:function(F){var E=F.parents("div:first");return{$promptIcon:E.find("div.photoPrompt:first"),$overlay:E.find("div.thumbnail_popDiv_overlay:first")}},plateOffsets:{top:12,left:21,width:-30,height:-28},tailPosition:{top:"imagePopLeftTop",bottom:"imagePopLeftBottom",center:"imagePopLeft"},setTail:function(E){this.$popDiv.find("td#"+this.tailId).attr("id",E.tail);this.tailId=E.tail},setSlideshowControlsVisible:function(I){var F,H,E,G=this.config.buttonSelectors;if(this.ssControlVisible!==I){this.ssControlVisible=I;F=Object.getKeys(G);for(H=0;(E=F[H]);H++){$(G[E])[I?"show":"hide"]()}}},popDivInitialize:function(E,H){var G=this.config.store.get(this.hotelId),F;$(this.config.titleSelect).text(G.name);$(this.config.maxSlideNumSelect).text(String(G.imgURLs.length));$(this.config.descriptionLinkSelect).attr("href",G.href);D.superclass.popDivInitialize.call(this);if(G){this.setSlideshowControlsVisible(G.imgURLs.length>1);this.slideShow=(F=new hcom.common.modules.slideshow({autoStart:false,images:G.imgURLs,$image:$("#imagePopImage img:first")}));F.addReceivers({change:{receiver:this.onSlideChange,scope:this},start:{receiver:this.onSlideStart,scope:this},stop:{receiver:this.onSlideStop,scope:this}})}},setStopButtonCls:function(F,G){var E=$(this.config.buttonSelectors.stop);if(E.hasClass(F)){E.addClass(G).removeClass(F)}},onSlideStart:function(){this.setStopButtonCls("imagePopControls_ply","imagePopControls_pse")},onSlideStop:function(){this.setStopButtonCls("imagePopControls_pse","imagePopControls_ply")},onSlideChange:function(F,E){$(this.config.currentSlideNumSelect).text(String(E+1))},relayClickToSlideShow:function(F,G){var E=this.slideShow;if(F){F.preventDefault()}if(E){E[G].call(E)}},onNextClick:function(E){this.relayClickToSlideShow(E,"gotoNext")},onPrevClick:function(E){this.relayClickToSlideShow(E,"gotoPrev")},onPauseClick:function(E){this.relayClickToSlideShow(E,"togglePlay")},popDivActivate:function(E,F){if(this.slideShow){this.slideShow.start()}},popDivPassivate:function(E,F){if(this.slideShow){this.slideShow.stop()}},popDivDestroy:function(E,F){if(this.$popupPlate){this.$popupPlate.hide()}if(this.slideShow){this.slideShow.destroy()}this.slideShow=null}});D.init=function(){A={mouseOverObjects:function(){return $("#twoColLeftContainer > div.resultBox > table > tbody > tr > td.resulsBoxDetails").find("div.photoPrompt:first")},eventNameSpace:"himg",mouseoverFilter:"img.imagePopDivThumb",clickFilters:["div.photoPopDiv_overlay","img.photoPopDiv_animation"],buttonSelectors:{stop:"#imgStop",prev:"#imgPrev",next:"#imgNext"},closeSelect:"#forceClose",currentSlideNumSelect:"#slideNumCurrent",maxSlideNumSelect:"#slideNumMax",titleSelect:"#imagePopHotelname",descriptionLinkSelect:"#popDivFullDescription"}};D.JSONStore=B;return D}});$.registerModule({name:"hcom.common.modules.simplepopdiv",impl:function(D){var F={TOP_CENTER:1,RIGHT_CENTER:2,BOTTOM_CENTER:3,LEFT_CENTER:4};function E(H){this.setVisible(false,H)}function B(H){this.setVisible(true,H)}function C(K,I,J,N,M){var L,H,O;if(I.constructor!==Array){I=[I]}for(L=0;(H=I[L]);L++){if(H instanceof $){H.bind(J,N)}else{O=M?$(H):$(H,K);O.bind(J,N)}}}function A(){var L=this.$positionGuide,K=L.offset(),H={top:K.top+Math.round(L.height()/2),left:K.left+Math.round(L.width()/2)},J,I;if(this.positioningType===F.BOTTOM_CENTER){J=H.top-this.$pd.height();I=H.left-Math.round(this.$pd.width()/2)}else{console.assert(false,"not implemented");return false}this.$pd.css({top:String(J+this.positionOffset.top)+"px",left:String(I+this.positionOffset.left)+"px"})}function G(L,J,I,H){var K=this;this.$pd=$(J);this.visible=false;this.clickEvt=["click",L].join(".");this.selfOrigin=false;this.positioningType=false;this.$pd.bind(this.clickEvt,function(M){K.selfOrigin=true});C(this.$pd,I,this.clickEvt,function(M){B.call(K,M);return false},true);C(this.$pd,H,this.clickEvt,function(M){E.call(K,M);return false},false)}G.prototype={setVisible:function(L,I){var H,K=this,J=function(M){if(K.selfOrigin){K.selfOrigin=false}else{E.call(K,M)}};if(L!==this.visible){if(L){if(this.onOpen){this.onOpen.call(this)}if(this.positioningType){A.call(this)}}this.$pd[L?"show":"hide"]();H=$("body");if(L){H.bind(this.clickEvt,J)}else{H.unbind(this.clickEvt)}if(!L&&this.onClose){this.onClose.call(this)}this.visible=L}if(I){I.preventDefault()}},hide:function(){E.call(this)},show:function(){B.call(this)},setPositioning:function(I,H,J){this.$positionGuide=I;this.positioningType=H;this.positionOffset=J||{top:0,left:0};return this},setOnClose:function(H){this.onClose=H;return this},setOnOpen:function(H){this.onOpen=H;return this}};G.positionTypes=F;return G}});$.registerModule({name:"hcom.common.modules.sitecatalyst",impl:function(){var D={},B={};function A(){for(var G in B){if(B.hasOwnProperty(G)){delete s[G]}}}function F(G,H){if(G){B[G]=true;if(H===undefined||H===null){s[G]=D[G]}else{s[G]=H}}}function E(G){F("events",G)}function C(){A();for(var G in D){if(D.hasOwnProperty(G)){s[G]=D[G];B[G]=true}}}return{storeProperties:function(H){for(var G in H){if(H.hasOwnProperty(G)){D[G]=H[G];B[G]=true}}},sendFullReport:function(H){if(H===undefined){C()}else{for(var G in H){if(H.hasOwnProperty(G)){D[G]=H[G];B[G]=true}}}var I={};$.extend(I,D);setTimeout(function(){A();for(var J in I){if(I.hasOwnProperty(J)){s[J]=I[J]}}s.t();console.info("sitecatalyst full report sent")},0)},sendPartialReport:function(H,I,G){setTimeout(function(){A();if(I){E(I)}if(H){for(var J in H){if(H.hasOwnProperty(J)){F(J,H[J])}}}if(H===null&&I===null){C()}s.tl();if(G){console.info("partial sitecatalyst report sent: "+G)}},0)}}}});$.registerModule({name:"hcom.common.modules.map",impl:function(C){function A(){var E=0;$("#MSVE_navAction_styleGroup div:visible").css("width","auto").each(function(){E+=$(this).width()+8});E+=97;if($.browser.msie&&$.browser.version<7){$("#MSVE_navAction_container").removeClass("notraffic").attr("style","width: "+E+"px !important")}else{$("#MSVE_navAction_container").removeClass("notraffic").css("width",E+"px")}}function D(E){$("#MSVE_navAction_FlatlandMapMode").add("#MSVE_navAction_separator3").add("#MSVE_navAction_showLabels").add("#MSVE_navAction_View3DMapMode").add("#MSVE_navAction_separator0").add("#MSVE_navAction_separator2").add("#MSVE_navAction_rotatorContainer").remove();$("#Compass").attr("title",E.format("sfsearch.mapview.control.compass.title"));$("#MSVE_ZoomBar_plus").add("#MSVE_navAction_tinyZoomBar_plus").attr("title",E.format("sfsearch.mapview.control.zoomin.title"));$("#MSVE_ZoomBar_minus").add("#MSVE_navAction_tinyZoomBar_minus").attr("title",E.format("sfsearch.mapview.control.zoomout.title"));$("#MSVE_navAction_toggleGlyphWrapper").attr("title",E.format("sfsearch.mapview.control.hide.title"));$("#MSVE_navAction_RoadMapStyle").attr("title",E.format("sfsearch.mapview.control.road.title")).html(E.format("sfsearch.mapview.control.road"));$("#MSVE_navAction_AerialMapStyle").attr("title",E.format("sfsearch.mapview.control.aerial.title")).html(E.format("sfsearch.mapview.control.aerial"));$("#MSVE_navAction_HybridMapStyle").attr("title",E.format("sfsearch.mapview.control.hybrid.title")).html(E.format("sfsearch.mapview.control.hybrid"));$("#MSVE_navAction_ObliqueMapView").attr("title",E.format("sfsearch.mapview.control.birdseye.title")).html(E.format("sfsearch.mapview.control.birdseye"));$("#MSVE_obliqueNotifyText").html(E.format("sfsearch.mapview.control.birdseye.obliqueNotifyText"))}function B(E){$("#MSVE_navAction_toggleGlyphInner").click(function(){setTimeout(function F(){if($("#MSVE_navAction_container").is(".collapsed")){$("#MSVE_navAction_toggleGlyphWrapper").attr("title",E.format("sfsearch.mapview.control.show.title"))}else{$("#MSVE_navAction_toggleGlyphWrapper").attr("title",E.format("sfsearch.mapview.control.hide.title"))}},200)})}return{fixControlWidth:A,localizeControls:D,fixBirdsEyeView:B}}});$.registerModule({name:"hcom.common.modules.autosuggest",dependencies:["hcom.common.modules.sitecatalyst","hcom.common.modules.ie6popupplate","hcom.common.keyhandling"],impl:function(R){var B="<tr></tr>",F='<td nowrap="nowrap"></td>',V="<span></span>",D=/^[\s]*/g,G=/[\s]+$/g,S,M=1,E=500,X=/[\;\,\ \.]/ig,T=3,A=100;function L(a){if(a.assambleAutoSuggestUrl){return a.assambleAutoSuggestUrl(a)}var Z=hcom.common.modules.autosuggest.CATEGORY_INDICATOR.CITY|hcom.common.modules.autosuggest.CATEGORY_INDICATOR.LANDMARK|hcom.common.modules.autosuggest.CATEGORY_INDICATOR.AIRPORT;var b=a.sendDataTo_Search_Do?hcom.common.modules.autosuggest.DESTINATION_ID_TYPE.SIMPLE_ID:hcom.common.modules.autosuggest.DESTINATION_ID_TYPE.GLOBAL_UUID;return[a.urlBase,"/a",a.inputControlId,"/b",b,"/c",4,"/d",Z,"/e",a.itemsNrPerCategory,"/f",a.lang,"/g"].join("")}function W(c){var b=false,a,Z=4;for(a=0;a<Z;a++){if(c[a].length!==0){b=true;break}}return b}function K(Z){if($.browser.msie){Z.cancelBubble=true}else{Z.stopPropagation()}}function H(Z){if($.browser.msie){Z.returnValue=false}else{Z.preventDefault()}}function O(Z){var a=Z.charCode?Z.charCode:Z.keyCode?Z.keyCode:0;if(a===13){console.debug("preventing on Enter");H(Z);K(Z);return false}}function N(c){var b=c.split(/ |\\./),Z,a="";b.sort(function(e,d){return -e.length+d.length});for(Z=0;Z<b.length;Z++){if(a!==""){a+="|"+b[Z]}else{a+=b[Z]}}a=new RegExp("(\\ |\\(|\\-)("+a+")","ig");return a}function Q(Z){return Z.replace(S,"")}function P(Z){return Z.replace(X," ")}function I(Z){return Z.replace(D,"")}function C(Z){return Z.replace(G,"")}function U(Z){return I(C(Z))}function Y(e){var d=Q(e);var Z=U(d);var f=P(Z);return f}function J(AI){var AD=this,f,x,c,h,AL,j,AG,d=[],m="",g=false,t=null,k=null,p=null,l=-1,AK=true,e=false,Z,AJ={};AD.lastSelected={};AJ={focusInputField:true,isActive:hcom.locale.autosuggest.isAsaActive,onFormSubmitSupplementary:function(AN){},onFormSubmitCommon:function(AQ){var AP=AQ.settings,AS=AQ.lastSelected,AR=AQ.isDestinationInputChanged,AV=AP.selectSearchForm(),AO,AT,AU,AN;if($("[name='searchParams.landmark']",AV).length===0){AV.append("<input type='hidden' name='searchParams.landmark' value='' />")}if($("[name='hotelId']",AV).length===0){AV.append("<input type='hidden' name='hotelId' id='hotelId' value='' />")}if($("[name='destinationId']",AV).length===0){AV.append("<input type='hidden' name='destinationId' value='' />")}if($("[name='queryFormState']",AV).length===0){AV.append("<input type='hidden' name='queryFormState' value='CLOSED' />")}else{$("[name='queryFormState']",AV).attr("value","CLOSED")}if($("[name='searchParams.needPossibleResults']",AV).length===0){AV.append("<input type='hidden' name='searchParams.needPossibleResults' value='true' />")}else{$("[name='searchParams.needPossibleResults']",AV).attr("value","true")}if($("[name='activeTab']",AV).length===0){AV.append("<input type='hidden' name='activeTab' value='DESTINATION' />")}else{$("[name='activeTab']",AV).attr("value","DESTINATION")}if($("[name='page']",AV).length===0){AV.append("<input type='hidden' name='page' value='1' />")}else{$("[name='page']",AV).attr("value","1")}if(AS.rowData){$("input[name='destinationId']",AV).val(typeof AS.rowData[1]==="undefined"?"":AS.rowData[1]);if(typeof AS.rowData[2]!=="undefined"){if($("[name='searchParams.sortControl']",AV).length===0){AV.append("<input type='hidden' name='searchParams.sortControl' value='DISTANCE-DESCENDING' />")}else{$("input[name='searchParams.sortControl']",AV).attr("value","DISTANCE-DESCENDING")}AN="LANDMARK-"+AS.rowData[2]}else{AN=""}$("input[name='searchParams.landmark']",AV).val(AN);$("[name='hotelId']",AV).val(typeof AS.rowData[3]==="undefined"?"":AS.rowData[3]);if($("[name='hotelId']",AV).val().length>0){AV.attr("action",AP.hotelAction);AO=AV.find("select").filter(function(){var AW=false,AX=$(this).attr("id");if(AX.match(new RegExp(".*search_room_.*_adults","i"))){AW=true}return AW});AO.each(function(AW){$(this).attr("name","adultsPerRoom")});AT=AV.find("select").filter(function(){var AW=false,AX=$(this).attr("name");if(AX.match(new RegExp(".*children\\[.*","i"))){AW=true}return AW});AT.each(function(AW){$(this).attr("name","childrenPerRoom")});AU=AV.find("select").filter(function(){var AW=false,AX=$(this).attr("name");if(AX.match(new RegExp(".*childrenAges.*","i"))){console.debug("Match: "+AX);AW=true}return AW});AU.each(function(AW){$(this).attr("name","childAgesPerRoom")})}}else{if(AR){$("[name='searchParams.landmark']",AV).remove();$("[name='hotelId']",AV).remove();$("[name='destinationId']",AV).remove()}}return false}};function AE(){$(document).unbind("keypress.autosuggest",O);if(x){x.hide();AG.hide()}e=false}function a(){var AN="NoSuggest";if(AD.lastSelected.id){AN=AD.lastSelected.id[0]}AN=["Search::",AJ.pageName,"::Autosuggest::",AN].join("");console.debug("Reporting:"+AN);hcom.common.modules.sitecatalyst.sendFullReport({pageName:AJ.pageName,channel:"Autosuggest",eVar33:AN,prop33:AN})}function AB(AN){console.debug("Sending the form");if(e){AE();return false}$(document).unbind("keypress.autosuggest");a();AJ.onFormSubmitSupplementary({lastSelected:AN.data.lastSelected,settings:AJ,isDestinationInputChanged:g});AJ.onFormSubmitCommon({lastSelected:AN.data.lastSelected,settings:AJ,isDestinationInputChanged:g});if($.browser.safari){var AO=this;setTimeout(function(){AO.submit()},1000);return false}else{return true}}function q(){AD.lastSelected.$row=null;AD.lastSelected.id=null;AD.lastSelected.rowData=null;p=null;t=null;k=null}function AC(){x=$('<div class="auto_suggest"></div>');AL=$('<table class="asPopup"></table>');j=$("<tbody></tbody>");AL.append(j);x.append(AL);$("body").append(x);AG=new hcom.common.modules.ie6popupplate({$aligner:x});x.hide();AL.bind("mouseout.autosuggest",function(){AK=true});AL.bind("mouseover.autosuggest",function(){AK=false})}function z(){if(!x){AC()}$(document).bind("keypress.autosuggest",O);x.css("top",f.offset().top+f.outerHeight());x.css("left",f.offset().left);AL.css("position","relative");x.show();AG.show();e=true}function o(){clearTimeout(l);l=-1}function r(AP){var AN,AO;AN=$(B).addClass("divider");AO=$(F).attr("colSpan",T);AN.append(AO);j.append(AN)}function AM(AO){var AP,AN;AP=$("<tr></tr>");j.append(AP);c=$("<td></td>").addClass("more");if(-1===AO){c.html("&nbsp;")}else{if("0"===AO){c.html(AJ.i18nMessages.noSuggestionMatch);AL.css("width",f.outerWidth())}else{c.html(AJ.i18nMessages.moreSuggestion.replace("{0}",AO))}}h=$("<span></span>").addClass("link").html(AI.i18nMessages.close).bind("click.autosuggest",AE);AP.append(c);AN=$("<td colspan='2'></td>");AN.append(h);AP.append(AN)}function b(AO){var AN={};switch(AO){case 0:AN.message=AJ.i18nMessages.categories.cities;AN.code="City";AN.cssClass="cities";break;case 1:AN.message=AJ.i18nMessages.categories.landmarks;AN.code="Landmark";AN.cssClass="landmarks";break;case 2:AN.message=AJ.i18nMessages.categories.airports;AN.code="Airport";AN.cssClass="airports";break;case 3:AN.message=AJ.i18nMessages.categories.hotels;AN.code="Hotel";AN.cssClass="hotels";break}return AN}function AH(AN){var AO;if(!AN||typeof AN.attr("id")==="undefined"){return }p=AD.lastSelected.$row=AN;AD.lastSelected.id=AO=AN.attr("id").split("_");AD.lastSelected.rowData=null;if(AO.length===3&&d.hasOwnProperty(m)){AD.lastSelected.rowData=d[m][2][parseInt(AO[1],10)][parseInt(AO[2],10)];f.val(AD.lastSelected.rowData[0].substring(1))}}function n(){AH($(this));AE();return false}function AA(){if(!p&&!AD.lastSelected.$row){AE();return }else{AH(p)}}function v(){if(p){p.removeClass("highlightedRow")}$(this).addClass("highlightedRow");p=$(this);return false}function AF(){$(this).removeClass("highlightedRow");return false}function u(AP){var AO=null;if(p){AO=p.removeClass("highlightedRow")}var AR,AN,AQ;AQ=f[0];if("selectionStart" in AQ){AR=AQ.selectionStart;AN=AQ.selectionEnd}if(AP===hcom.common.keyhandling.FUNCTION_KEYS.UP){if(!AO||AO.attr("id")===t.attr("id")){AO=k}else{AO=AO.prev();if(AO.attr("class")==="divider"){AO=AO.prev()}}}else{if(AP===hcom.common.keyhandling.FUNCTION_KEYS.DOWN){if(!AO||AO.attr("id")===k.attr("id")){AO=t}else{AO=AO.next();if(AO.attr("class")==="divider"){AO=AO.next()}}}}if(AO){p=AO.addClass("highlightedRow")}}function y(AN){g=true;var AO=Y(f.val()).toLowerCase();if(l===-1&&AO.length>=AJ.minCharLength){AD.fireAutoSuggest.input=AO;setTimeout(function(){AD.fireAutoSuggest()},M)}else{if(e){o();AE()}}}function i(AN){console.debug("handleFunctionKeys");var AO=AN.charCode?AN.charCode:AN.keyCode?AN.keyCode:0;if(!e){console.debug("Ignore function keys");return true}switch(AO){case hcom.common.keyhandling.FUNCTION_KEYS.ESC:AE();return false;case hcom.common.keyhandling.FUNCTION_KEYS.TAB:case hcom.common.keyhandling.FUNCTION_KEYS.ENTER:H(AN);K(AN);AA();AE();return false;case hcom.common.keyhandling.FUNCTION_KEYS.UP:case hcom.common.keyhandling.FUNCTION_KEYS.DOWN:H(AN);K(AN);u(AO);return false}return true}this.timeOut=function(){if(l===-1){return }AE();l=-1};this.processResponse=function(AQ){var AX,AP,Aa,AW,AT,AR,AY,AV,AO,AZ,AN;o();if(!AQ){return }AR=AQ[1];AY=AQ[2];AV=AQ[3];if(!x){AC()}if(j.html()!==""){j.empty()}q();AN=N(AR);if(!d.hasOwnProperty(AR.toLowerCase())){d[AR.toLowerCase()]=AQ}for(AW=0;AW<AY.length;AW++){AO=AY[AW];for(AT=0;AT<AO.length;AT++){AX=$(B);AP=$(F);if(AO[AT][0].charAt(0)!==" "){AO[AT][0]=" "+AO[AT][0]}AP.html(AO[AT][0].replace(AN,"$1<em>$2</em>"));AX.append(AP);if(AT===0){AZ=b(AW);AP=$(F);Aa=$("<td></td>");Aa.addClass("asaSprite");AP.addClass("asaResultCategory");AX.append(AP);AX.append(Aa);var AU=$(V);var AS=$("<span></span>");AU.html(AZ.message);Aa.append(AS);AP.append(AU);AS.addClass(AZ.cssClass).addClass("asaSprite")}else{AX.append($(F));AX.append($(F))}AX.attr("id",[AZ.code,"_",AW,"_",AT].join(""));AX.bind("mouseover.autosuggest",v);AX.bind("mouseout.autosuggest",AF);AX.bind("click.autosuggest",AD,n);j.append(AX);if(!t){t=AX}}if(AO.length>0){r(AW)}}k=AX;if("0"===AV&&W(AY)){AV=-1}AM(AV);if(!e){z()}AG.align();f.focus()};this.fireAutoSuggest=function(){var AN=arguments.callee.input;m=AN;if(!d[AN]||d[AN].length===0){$.ajax({type:"GET",url:Z+encodeURIComponent(AN),data:null,success:null,cache:true,dataType:"script"});setTimeout(function(){AD.timeOut()},E)}else{this.processResponse(d[AN])}};$.extend(AJ,AI);if(AJ.isActive){f=$("#"+AI.inputControlId);var w=new hcom.common.keyhandling.KeyListener(f,i,y);if(parseInt(f.attr("maxlength"),10)<A){f.attr("maxlength",A)}$(document).bind("click.autosuggest",function(){if(AK){AE()}});Z=L(AJ);if(AI.selectSearchForm){AI.selectSearchForm().bind("submit.autosuggest",AD,AB)}else{if(AI.formId){$("#"+AI.formId).bind("submit.autosuggest",AD,AB)}}if(AJ.focusInputField){f.focus()}f.attr("autocomplete","off");q()}return this}return{init:function(){S=/[\u00A7\"\+\!\%\/\=\(\)\?\:\_\\\>\<\|\:\]\}\[\{\@\#\$\^\&\*]+/ig;hcom.common.modules.autosuggest.rp=function(Z){hcom.common.modules.autosuggest[Z[0]].processResponse(Z)};hcom.common.modules.autosuggest.CATEGORY_INDICATOR={CITY:2,HOTEL:4,LANDMARK:8,AIRPORT:16};hcom.common.modules.autosuggest.DESTINATION_ID_TYPE={GLOBAL_UUID:1,SIMPLE_ID:0}},AutoSuggest:J}}});$.registerModule({name:"hcom.common.modules.checkavailabilitydialog",dependencies:["hcom.search.modules.basicinput","hcom.search.modules.glasspane"],impl:function(C){var E=100;function B(){return this.$dialog||(this.$dialog=$("#queryModuleOverlay"))}function F(I){var H=this.$dialog.find("div.buttonBorder1:first");if(I){if(H.hasClass("notActive")){H.removeClass("notActive").find("button").removeAttr("disabled")}}else{if(!H.hasClass("notActive")){H.addClass("notActive").find("button").attr("disabled","disabled")}}}var G=function(){var H=false,J;function I(){F(this.basicInput.validate())}return{set:function(K){var L=this;if(K!==H){H=K;if(K){J=setInterval(function(){I.call(L)},200)}else{clearInterval(J)}}}}}();function D(H){var I=B();if(H){if(!I.is(":visible")){hcom.search.modules.glasspane.show();I.show();G.set.call(this,true)}}else{if(I.is(":visible")){G.set.call(this,false);I.hide();hcom.search.modules.glasspane.hide()}}}function A(J,K,I,H){this.prefix=J;this.prefixStr=J!==undefined?J+"_":"";this.containerSelector="#page_container";this.basicInput=new hcom.search.modules.basicinput(this.prefix,K,I,H);$.extend(this,H);this.basicInput.initState(B()).attachEvents();return this}A.prototype={close:function(H){H.preventDefault();D.call(this,false)},getHotelId:function(J){var I;if(J.currentTarget&&J.currentTarget.rel){I=J.currentTarget.rel}else{if(J.srcElement){var H=J.srcElement.parentElement;if(H.tagName!=="A"){H=H.parentElement}I=H.rel}else{I=J.target.rel||J.data.rel}}return I},open:function(H){H.preventDefault();this.hotelid=this.getHotelId(H);D.call(this,true)},submit:function(H){H.preventDefault();if(this.basicInput.validate()){if(!this.basicInput.redirectGroupBooking()){D.call(this,false);this.submitForm()}}},buildTemplate:function(H){this.basicInput.setTemplates(H)},attachEvents:function(){var H=this;$("#checkAvailabilityHolder").listen("click",".closeWindowEvent",function(I){H.close(I)}).listen("click","#ca_continueCheckAvailability",function(I){H.submit(I)});$.map(["#chooseAlternate","#chooseAlternateLink","a.hcomCheckAvailability"],function(I){$(H.containerSelector).listen("click",I,function(J){H.open(J)})})}};A.init=function(){};return A}});$.registerModule({name:"hcom.common.modules.ie6popupplate",impl:function(E){var A,C=[],H,G,D=$.browser.msie&&$.browser.version<7;function F(){var I;if(C.length>0){return C.pop()}else{I=$('<iframe style="display: none; filter: mask(); position: absolute; z-index: 1;"></iframe>');H.append(I);return I}}function B(I){C.push(I)}A=function(I){this.cfg=$.extend({},A.defaultConfig,I);this.$iframe=null;this.resetFrameCSS={}};A.defaultConfig={offsetTop:0,offsetLeft:0,z_index:1};A.init=function(){H=$("#page_container");if(!H.length){H=$("body")}else{G=H}};A.prototype={align:function(O){var K,J,N,M,L,I;if(D&&this.$iframe){K=this.cfg;J=O||K.$aligner;N=J.offset();L=J.outerWidth();I=J.outerHeight();if(G){M=G.offset();N.top-=M.top;N.left-=M.left}this.$iframe.css({top:N.top+K.offsetTop,left:N.left+K.offsetLeft,width:L,height:I})}return this.$iframe},show:function(K){var J,I;if(D){J=(this.$iframe=F());if(1<(I=this.cfg.z_index)){J.css({"z-index":I});this.resetFrameCSS["z-index"]=A.defaultConfig.z_index}this.align().show()}},hide:function(){var I=this.$iframe;if(I){this.$iframe=null;I.hide();I.css(this.resetFrameCSS);this.resetFrameCSS={};B(I)}}};return A}});$.registerModule({name:"hcom.common.pages.common",dependencies:["hcom.gadgets.modules.headmenu","hcom.common.modules.print","hcom.common.modules.popup","hcom.common.modules.events"],impl:function(B){function A(C){O_LC();return false}return{init:function(){var D=$("#header_mailto_or_oo");var C=$("#toplinks_mailto_or_oo");if(D.attr("showoo")){D.click(A)}if(C.attr("showoo")){C.click(A)}},setFeedbackHref:function(C){if($([]).add("div:first > div:first > div:first > div:first > a.site_feedback:first").add("#footer > div:eq(1) > div:eq(1) > ul > li > a.site_feedback:first").attr("href",C).length<2){console.warn("unable to set all site feedback urls, is markup changed?")}}}}});$.registerModule({name:"hcom.search.modules.cookie",dependencies:["hcom.search.modules.core"],impl:function(A){function B(D){var C=D.$response.find("#cookies cookie");C.each(function(){var E=$(this);$.cookie(E.attr("name"),E.attr("value"),{expires:365,path:"/",domain:E.attr("domain")})})}return{init:function(){hcom.search.modules.core.addAfterAjaxReqListener(A,B)}}}});$.registerModule({name:"hcom.search.modules.core",dependencies:["hcom.common.listener"],impl:function(A){var D,F=null,B;var C={unknown:0,select:1,filter:2,checkAvail:3,backButton:4,stateRestore:5,pagination:6,sort:7};var H=function(){var J;return{init:function(){J={};$.map(["template","ajaxReqSuccess","beforeAjaxReq","afterAjaxReq","afterAjaxComplete","stateChange","contentReloaded","hashedState"],function(L,M){var K=L.toCapitalCase()+"Listener",N=new hcom.common.listener();J[L]=N;D["add"+K]=function(P,O){N.addListener(P,O)};D["remove"+K]=function(P,O){N.removeListener(P,O)}})},get:function(K){return J[K]},cleanup:function(){for(var K in J){if(J.hasOwnProperty(K)){J[K].clear()}}}}}();var E=function(J){this.options=$.extend({url:"/search.do?ajax=true",data:{},cause:D.reloadCauses.select,retryCount:0,cancel:function(){},success:function(){}},J);this.errorOccurred=false;this.cancelled=false;this.$doc=undefined;this.currentXHTTPreq=null};E.prototype=function(){function J(){console.info("%s.load: XHR retry attempt %i",A,++this.options.retryCount);D.load(this.options)}function K(L){return{$response:this.$doc,errorOccurred:this.errorOccurred,hasValidationErrors:L.getResponseHeader("X-Errors")==="true",cause:this.options.cause,path:this.options.url}}return{buildAjaxEvent:K,error:function(N,O,M){var L=this;this.errorOccurred=true;console.group();console.error("%s.load: error communicating with server %s",A,O);console.dir(N);console.dir(M);console.groupEnd();if(this.options.retryCount<2){setTimeout(function(){J.call(L)},1000)}else{if(hcom.locale.rules.JAVASCRIPT_DEVELOPMENT===true){console.error("%s.load: fatal error during execution of XHR, retry limit exceeded",A)}else{window.location="/"}}},success:function(L){if(this.cancelled){this.options.cancel();return }this.$doc=$(L).find("listview_partial");if(this.$doc.length===0){this.error(null,"invalid response format");return false}D.listeners.get("ajaxReqSuccess").fireEvent(this)},cancel:function(){if(this.currentXHTTPreq){this.currentXHTTPreq.abort();this.currentXHTTPreq=null}},beforeSend:function(L,M){console.time(A+".load");D.listeners.get("beforeAjaxReq").fireEvent(this.options)},complete:function(N,M){var P=this.buildAjaxEvent(N),O=P.hasValidationErrors,L;this.currentXHTTPreq=null;if(this.cancelled){this.options.cancel();return }D.listeners.get("afterAjaxReq").fireEvent(P);if(!this.errorOccurred){this.options.success();L={$head:$("#twoColLeftHeadContainer"),$body:$("#twoColLeftContainer"),hasValidationErrors:O,cause:this.options.cause};D.listeners.get("contentReloaded").fireEvent(L);D.listeners.get("afterAjaxComplete").fireEvent(P)}console.timeEnd(A+".load")}}}();function G(K){var L=K.$doc,J=L.find("listview_initial_content:first");if(J.length>0){B.loadMessages(J.find("messages")).setGlobal();D.listeners.get("template").fireEvent(hcom.common.template.build(L.find("templates")))}else{K.error(null,"invalid response format missing initial content");return }}function I(J){if(F===null){F=new D.AjaxEvents(J);$.ajax({url:F.options.url,dataType:"xml",type:"POST",data:F.options.data,beforeSend:function(K){F.beforeSend.call(F,K)},success:function(K){F.success.call(F,K)},complete:function(L,K){F.complete.call(F,L,K);F=null},error:function(L,M,K){F.error.call(F,L,M,K)}})}else{console.error("load called while there is an ongoing ajax REQ")}}return{init:function(){D=hcom.search.modules.core;D.listeners.init()},listeners:H,load:I,scriptLoad:function(){D.listeners.get("ajaxReqSuccess").addListener(A,G);B=new $.formatter();D.loadInitialUrlFromLoc()},loadInitialUrlFromLoc:function(){var K=window.location,J;J=[K.pathname,K.search,(K.search?"&":"?"),"ajax=true&init=true"].join("");D.load({url:J})},AjaxEvents:E,cancel:function(){if(F){F.cancel();F=null}},reloadCauses:C}}});$.registerModule({name:"hcom.search.modules.core.ajax",dependencies:["hcom.common.pages.common","hcom.search.modules.core","hcom.common.ascii85","hcom.common.crc","hcom.common.pickler","hcom.common.template"],impl:function(I){var d=false,R=false,A=false,M,S,P;var K,J;var H;var V={expirationAbsolute:null,priority:2},L=false,W=false;var Z,D,C,b=null,Q,N=null,B=1;var X={unknown:0,select:1,filter:2,checkAvail:3,backButton:4,stateRestore:5,pagination:6,sort:7};function G(){if(!H){H=new Cache()}return H}function j(l,m,k){return G().setItem(l,m,k)}function T(k){return G().getItem(k)}function F(k){hcom.search.modules.sitecatalyst.onPaginationBegin();S.reload({url:this.href+"&ajax=true",cause:S.reloadCauses.pagination,success:hcom.search.modules.sitecatalyst.onPaginationComplete,cancel:hcom.search.modules.sitecatalyst.onPaginationCancel});k.preventDefault()}function U(k){hcom.search.modules.sitecatalyst.onSortBegin(M.format("sfsearch.nonlocalized.sortorder."+$(this).attr("rel")));S.reload({url:this.href+"&ajax=true",cause:S.reloadCauses.sort,success:hcom.search.modules.sitecatalyst.onSortComplete,cancel:hcom.search.modules.sitecatalyst.onSortCancel,message:M.format("sfsearch.filterModule.action.sort")});k.preventDefault()}function i(l){d=true;K=$("#twoColLeftHeadContainer");J=$("#twoColLeftContainer");$("#filterBoxContainer").html(l.filterBoxContent);var k=$("#page_container");$.map(["#lnk_perviousPage","#lnk_nextPage","#lnk_perviousPageMiddle","#lnk_nextPageMiddle","#lnk_perviousPageBottom","#lnk_nextPageBottom"],function(m){k.listen("click",m,F)});$.map(["#lnk_sortByBestSeller","#lnk_sortByPrice","#lnk_sortByStarRating_ASCENDING","#lnk_sortByStarRating_DESCENDING","#lnk_sortByGuestRating","#lnk_sortByDistance"],function(m){k.listen("click",m,U)});M.loadMessages(l.messages).setGlobal();S.listeners.get("template").fireEvent(l.templates)}function E(m,l,q,p,o){var r,n=!p||A,k=!p||o===S.reloadCauses.select||A;console.time("search.setContent");if(k){K.html(m)}if(n){J.html(l);$("#filterBoxContainer").html(q)}console.timeEnd("search.setContent");console.time("search.events");r={$head:K,$body:J,hasValidationErrors:p,cause:o};S.listeners.get("contentReloaded").fireEvent(r);console.timeEnd("search.events")}function g(){var l={},k;console.debug("firing stateChange.getState()");S.listeners.get("stateChange").fireOnHost(function(){var m=this.getName();l[m]=this.getState()});l.main={};k=l.main;k.headContent=Z;k.bodyContent=D;k.pageIndex=B;return l}function e(l){var k=l.main;Q=l;Z=k.headContent;D=k.bodyContent;B=k.pageIndex;E(Z,D,k.filterBoxContent);console.debug("firing stateChange.setState()");S.listeners.get("stateChange").fireOnHost(function(){var m=this.getName();if(l.hasOwnProperty(m)){this.setState(l[m])}})}function O(){var m=new hcom.common.pickler(),l,k,n;(function(){var q="searchParams.",v=Q["hcom.search.modules.queryform.ajax"],z=v.basicInput||{},p=[],w,o,x,r,y,u,t;for(u=0;u<8;u++){w="rooms["+u+"].";o=z[q+w+"numberOfAdults"];if(o===undefined){break}x=[];r=q+w+"childrenAges[";for(t=0;t<3;t++){y=z[r+t+"]"];if(y===undefined){break}x[t]=y}for(t=0;t<x.length;t++){if(x[t]===undefined){x[t]=null}}p.push([o,x])}m.push(z.destination,z.destinationId,z[q+"sortOrder"]||"DEFAULT",z[q+"sortDirection"]||"DESCENDING",z[q+"sortControl"]||"BEST_SELLER-DESCENDING",z[q+"name"]||"",z[q+"arrivalDate"]||null,z[q+"departureDate"]||null,p,z.searchViewType||"LIST")})();(function(){var t=Q["hcom.search.modules.filterform.ajax"],p=t.form||{},o=hcom.search.modules.filterform.queryFields;for(var q=0,r;(r=o[q]);q++){m.push(p[r]||null)}})();(function(){m.push(Q["hcom.search.modules.checkavailabilitydialog.ajax"].hotelId)})();m.push(B);S.listeners.get("hashedState").fireOnHost(function(){m.push(this.savePickleState())});l=m.toString();k=l.asCharValueArray();n=hcom.common.crc.getDigest(hcom.common.crc.presets.crc8,k);k.push(n);return hcom.common.ascii85.encodeHash(hcom.common.ascii85.encode(k))}function Y(q){var l=hcom.common.ascii85.decode(hcom.common.ascii85.decodeHash(q)),p=l.pop(),k=hcom.common.crc.getDigest(hcom.common.crc.presets.crc8,l),m,n,o={};(function(){var r=[];for(var t=0,u=l.length;t<u;t++){r.push(String.fromCharCode(l[t]))}m=r.join("")})();if(p!==k){console.warn("invalid hash value received");return false}else{n=hcom.common.pickler.fromString(m);(function(){var t="searchParams.",r,y,z,w;o.destination=n.shift();o.destinationId=n.shift();o[t+"sortOrder"]=n.shift()||"DEFAULT";o[t+"sortDirection"]=n.shift()||"DESCENDING";o[t+"sortControl"]=n.shift()||"BEST_SELLER-DESCENDING";o[t+"name"]=n.shift()||"";w=n.shift();if(w){o[t+"arrivalDate"]=w}w=n.shift();if(w){o[t+"departureDate"]=w}r=n.shift();for(var x=0,u=r.length;x<u;x++){y=t+"rooms["+x+"].";o[y+"numberOfAdults"]=r[x][0];z=r[x][1];for(var v=0,AA=z.length;v<AA;v++){o[y+"childrenAges["+v+"]"]=z[v]}}o.searchViewType=n.shift()||"LIST"})();(function(){var r=hcom.search.modules.filterform.queryFields,v,u;for(var t=0;(u=r[t]);t++){v=n.shift();if(v!==null){o[u]=v}}})();(function(){var r=n.shift();if(null!==r){o["searchParams.hotelId"]=r;hcom.search.modules.checkavailabilitydialog.ajax.setHotelId(r)}})();B=n.shift();N=n;return o}}function c(){var k=g(),l;Q=k;l=O();j(l,k,V);L=true;$.historyLoad(l)}function a(m){if(L){console.debug("search.main.historyBack: forward: nothing to do");L=false}else{var l;if(m){l=T(m);if(l===null){console.debug("search.main.historyBack: restoring state from hash");var k=Y(m);if(k){k.init=true;k.ajax=true;k.page=B;S.load({url:window.location.pathname,data:k,cause:X.stateRestore})}else{if(b!==null){console.debug("search.main.historyBack: unpickling failed resetting initial state");e(b)}else{console.debug("search.main.historyBack: hash is invalid, recovering from search params");S.loadInitialUrlFromLoc()}}}else{console.debug("search.main.historyBack: back button callback with hash = "+m);e(l)}}else{if(b){console.debug("search.main.historyBack: resetting initial state");W=true;e(b)}}}}function h(l){var n=l.$doc,k;B=Number(n.attr("page"));$("#currencyTargetURL").attr("value",n.attr("url"));P.setFeedbackHref(n.attr("feedback"));if(!d){k=n.find("listview_initial_content:first");if(k.length>0){var m={templates:hcom.common.template.build(n.find("templates")),messages:k.find("messages")};i(m);A=true}else{l.error(null,"invalid response format missing initial content");return }}Z=n.find("#header").text();D=n.find("#body").text();C=n.find("#filter_box").text()}function f(){S=hcom.search.modules.core;P=hcom.common.pages.common;$.extend(S,{reloadCauses:X,scriptLoad:function(){var k=window.location;R=true;$.historyInit(a);R=false;if((!k.hash)&&(!W)){S.loadInitialUrlFromLoc()}},reload:function(k){if(!k){k={}}k.reload=true;S.load(k)},getState:function(){return Q}});$.extend(S.AjaxEvents.prototype,{beforeSend:function(k){console.time(I+".load");if(!R){$.historySuspendCheck()}this.currentXHTTPreq=k;S.listeners.get("beforeAjaxReq").fireEvent(this.options)},complete:function(l,k){var n=this.buildAjaxEvent(l),m=n.hasValidationErrors;this.currentXHTTPreq=null;if(this.cancelled){this.options.cancel();return }$(window).scrollTop(0);S.listeners.get("afterAjaxReq").fireEvent(n);if(!this.errorOccurred){console.debug("search.main.load: setContent");E(Z,D,C,m,this.options.cause);if(this.options.reload){if(!m){console.debug("search.main.load: historyForward");c()}}else{console.debug("search.main.load: setting initial state");b=g();Q=b}if(N!==null){console.time("search.load.restorePickledState.fire");S.listeners.get("hashedState").fireOnHost(function(){this.restorePickleState(N.shift())});N=null;console.timeEnd("search.load.restorePickledState.fire")}this.options.success();S.listeners.get("afterAjaxComplete").fireEvent(n);if(!R){$.historyResumeCheck()}A=false}console.timeEnd(I+".load")}});S.listeners.get("ajaxReqSuccess").addListener(I,h);M=new $.formatter();$(window).unload(function(){if(H){H.clear()}S.listeners.cleanup()})}return{init:f}}});$.registerModule({name:"hcom.search.modules.sitecatalyst",dependencies:["hcom.search.modules.core","hcom.common.modules.sitecatalyst"],impl:function(A){var C=true,B={};function D(F){if(F.errorOccurred||F.hasValidationErrors){return }if(s===undefined){console.error("Sitecatalyst not loaded, load sitecatalyst script before invoking this module")}var E=F.$response.find("#sitecatalyst prop");var G={};E.each(function(){var H=$(this),I=H.attr("name"),J=H.attr("value");console.debug("%s: prop %s = %s",A,I,J);G[I]=J});hcom.common.modules.sitecatalyst.storeProperties(G);if(C){C=false;hcom.common.modules.sitecatalyst.sendFullReport()}if(F.$response.find("#sitecatalyst").attr("hotelUnavailable")){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event17","hotel unavailable")}}return{init:function(){var E=hcom.search.modules.core;E.addAfterAjaxReqListener(A,D);E.addStateChangeListener(A)},getState:function(){return B},setState:function(E){B=E;hcom.common.modules.sitecatalyst.storeProperties(B)},onFilterSelect:function(F,G){var E={};if(F){E.prop22=F;E.eVar10=F}else{if(G){E.prop23=G;E.eVar11=G}}hcom.common.modules.sitecatalyst.sendPartialReport(E,"event3","filter select "+(F||G))},onFilterApply:function(E){var F={};if(E){F.prop24=E;F.eVar12=E}hcom.common.modules.sitecatalyst.sendPartialReport(F,"event4","filter apply")},onFilterCancel:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event7","filter cancel")},onFilterComplete:function(){hcom.common.modules.sitecatalyst.sendPartialReport({prop7:null,prop8:null,prop9:null},"event10","filter complete")},onSortBegin:function(F){var E={};if(F){E.prop2=F;E.eVar9=F}hcom.common.modules.sitecatalyst.sendPartialReport(E,"event5","sort begin:"+F)},onSortCancel:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event8","sort cancel")},onSortComplete:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event11","sort complete")},onPaginationBegin:function(){hcom.common.modules.sitecatalyst.sendPartialReport({prop4:null},"event6","pagination begin")},onPaginationCancel:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event9","pagination cancel")},onPaginationComplete:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event12","pagination complete")},onCheckAvailabilityClick:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event13","check availability click")},onPhotoPopdivShow:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event14","photo popdiv show")},onNeighborhoodPopdivShow:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event15","neighborhood popdiv show")},onFindSimilarHotelClick:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,"event16","find similar hotel click")},onSearchComplete:function(){hcom.common.modules.sitecatalyst.sendPartialReport(null,null,"search complete")}}}});$.registerModule({name:"hcom.search.modules.basicinput",dependencies:["hcom.common.template","hcom.common.modules.calendar"],images:["indicator.gif"],impl:function(V){var C=function(d,f,e){this.name=d;this.id=f;this.optionId=e};var a=new C("hcom.js.changeSearch.adultFieldName","hcom.js.changeSearch.adultFieldId","hcom.js.changeSearch.adultFieldOptionId"),J=new C("hcom.js.changeSearch.childFieldName","hcom.js.changeSearch.childFieldId","hcom.js.changeSearch.childFieldOptionId"),F=new C("hcom.js.changeSearch.childAgeFieldName","hcom.js.changeSearch.childAgeFieldId","hcom.js.changeSearch.childAgeOptionId"),G,S=/\.rooms\[([0-9]+)\]\.(?:childrenAges\[([0-9]+)\])?/,c="/basicInput.do",W=9,b=["lnk_search_tab_destination","lnk_search_tab_hotelname"],D,R;function L(){var f="";var j=parent.hcom.configuration.DEFAULT_DATE_FORMAT;var h="";var e=j.length;var d=0;for(var g=0;g<e;g++){switch(j.charAt(g).toLowerCase()){case"d":if(h===""||h==="d"){h="d";d++}break;case"m":if(h===""||h==="m"){h="m";d++}break;case"y":if(h===""||h==="y"){h="y";d++}break;default:if(h==="m"){if(d===1){f=f+"[0-9]{1}"}else{if(d===2){f=f+"[0-9]{2}"}}}else{if(h==="d"){if(d===1){f=f+"[0-9]{1}"}else{if(d===2){f=f+"[0-9]{2}"}}}else{if(h==="y"){if(d===2){f=f+"[0-9]{2}"}else{f=f+"[0-9]{4}"}}}}h="";d=0;if(j.charAt(g).toLowerCase()!=="'"){f=f+"[\\"+j.charAt(g)+"]"}}}if(h==="m"){if(d===1){f=f+"[0-9]{1}"}else{if(d===2){f=f+"[0-9]{2}"}}}else{if(h==="d"){if(d===1){f=f+"[0-9]{1}"}else{if(d===2){f=f+"[0-9]{2}"}}}else{if(h==="y"){if(d===2){f=f+"[0-9]{2}"}else{f=f+"[0-9]{4}"}}}}return"^"+f+"$"}function T(d){if(d.realVal()!==""){d.val(d.val().replace(/%+/g,"").replace(/\s{2,}/g," ").replace(/^\s+/,""))}}function K(f,g,e,d){this.isAutoCompleteOn=true;this.roomSelector="select[name=rooms]:first";this.childSelector="select[name^=children]";this.adultSelector="select[name$=numberOfAdults]";this.prefix=f;this.prefixStr=f.length?f+"_":"";this.hasTabs=g||false;this.callbacks=e||{};$.extend(this,d);return this}function Q(e,k,j){var h=this.$main.find("div.roomAgesOfChildren:first tbody tr:eq("+e+")"),d=this,f,g=function(i){$(this).attr("id",G.format(F.optionId,d.prefix,String(e),String(f),String(i)))};if(j===0){h.replaceWith(this.childAgeEmptyRow)}else{if(j<k){h.find("td:gt("+String(j-1)+")").remove()}else{if(j>k){if(k===0){h.empty()}for(f=k;f<j;f++){h.append(this.childAgeCell);h.find("td:last").find("select").attr("name",G.format(F.name,String(e),String(f))).attr("id",G.format(F.id,this.prefix,String(e),String(f))).find("option").each(g)}}}}}function Z(h,f,j,k){var e,d;if((f>0)&&(k===0)){this.$main.find("div.roomAgesOfChildren:first").remove()}else{if((k>0)&&(f===0)){this.$main.find("div.roomDetails:first").after(this.childTable);var g=this.$main.find("div.roomAgesOfChildren:last tbody");for(e=0;e<this.cRooms;e++){g.append(this.childAgeEmptyRow)}}}for(e=0,d=j.length;e<d;e++){if(h[e]!==j[e]){Q.call(this,e,h[e],j[e])}}}function I(){var f=[],d,e=0;$(this.childSelector,this.$main).each(function(g){d=parseInt(this.value,10);e+=d;f.push(d)});return{child:f,childCount:e}}function Y(){var d=I.call(this);Z.call(this,this.cChild,this.cChildCount,d.child,d.childCount);this.cChild=d.child;this.cChildCount=d.childCount}function M(e,f){var d=this;f.find("label:first").text(G.format("sfsearch.changeSearch.room",String(e+1))).end();$(this.childSelector+":first",f).bind("change.basicInput",function(){Y.call(d)}).val("0");$(this.adultSelector+":first",f).val("2")}function E(h){var g=/(id|for|name)="?([^\s"]+)"?/g,k=String(h),i=[G.format(a.id,this.prefix,k),G.format(J.id,this.prefix,k)],o=[G.format(a.name,k),G.format(J.name,k)],j=-1,f=0,m=[a.optionId,J.optionId],n,d,l=this;function e(v,p,r,u,q){var t;if(p==="name"){t=o[f++]}else{if(p==="for"){t=i[0]}else{if(r.indexOf("_option_")>=0){t=G.format(m[j],l.prefix,k,n++)}else{n=0;j+=1;t=i[j]}}}if(t===undefined){return""}else{return[p,'="',t,'"'].join("")}}d=this.roomHtml.replace(g,e);return d}function H(l,k){var f,h="div.roomsPeople:first > table:first > tbody:first";if(k<l){$(h,this.$main).find(["> tr:gt(",String(k-1),")"].join("")).find(this.childSelector).each(function(){$(this).unbind()}).end().remove();var e=this.cChildCount,j=this.cChild.slice(0);for(f=l;f>k;f--){this.cChildCount-=this.cChild.pop()}Z.call(this,j,e,this.cChild,this.cChildCount);if((e>0)&&(this.cChildCount>0)){$(["div.roomAgesOfChildren:first table:first > tbody:first > tr:gt(",String(k-1),")"].join(""),this.$main).remove()}}else{if(k>l){var g=$(h,this.$main).find("> tr:last"),d;if(this.roomHtml===undefined){d=g.clone();$("option",d).removeAttr("selected");this.roomHtml=["<tr>",d.html(),"</tr>"].join("");if($.browser.msie){this.roomHtml=this.roomHtml.replace(/jQuery[0-9]+[^\s>]+/g,"")}}for(f=l;f<k;f++){g.after(E.call(this,f));g=$(h,this.$main).find("> tr:last");M.call(this,f,g);this.cChild.push(0)}if(this.cChildCount>0){g=this.$main.find("div.roomAgesOfChildren:first tbody:first");for(f=l;f<k;f++){g.append(this.childAgeEmptyRow)}}}}}function O(){var d=parseInt(this.$main.find(this.roomSelector).val(),10);this.isGroupBooking=(d>=W);return d}function X(d){var e="div.roomsPeople:first",f="div.roomAgesOfChildren:first";if(d&&!this.isPeopleSelectorEnabled){this.$main.find(e).show().end().find(f).show();this.isPeopleSelectorEnabled=true}else{if(!d&&this.isPeopleSelectorEnabled){this.$main.find(e).hide().end().find(f).hide();this.isPeopleSelectorEnabled=false}}}function P(){var e=this.cRooms,d=this.isGroupBooking,f=O.call(this);if(!d&&this.isGroupBooking){X.call(this,false)}else{if(d&&!this.isGroupBooking){X.call(this,true)}this.cRooms=f;H.call(this,e,f)}}function B(d){var g=0,k,m,l,e=[],o,f,h=0;for(var n in d){if(d.hasOwnProperty(n)){k=S.exec(n);if(k){m=parseInt(k[1],10);g=Math.max(g,m);if(k[2]!==undefined){e[m]=Math.max(e[m]||0,parseInt(k[2],10))}}}}l=this.cRooms;this.cRooms=g+1;H.call(this,l,this.cRooms);for(var j=0;j<this.cRooms;j++){if(e[j]===undefined){e[j]=0}else{e[j]+=1}h+=e[j]}o=this.cChild;f=this.cChildCount;this.cChild=e;this.cChildCount=h;Z.call(this,o,f,this.cChild,this.cChildCount)}function N(d){var e=d.getModule("basic_input");this.childTable=e.getTemplate("child_table");this.childAgeCell=e.getTemplate("child_age_cell");this.childAgeEmptyRow=e.getTemplate("child_age_empty_row")}function A(e){var d=$("div.buttonBorder1:first",this.$main);if(e){if(d.hasClass("notActive")){d.removeClass("notActive").find("button").removeAttr("disabled")}}else{if(!d.hasClass("notActive")){d.addClass("notActive").find("button").attr("disabled","disabled")}}}function U(f){var e=this.$tabContainer.find("a"),g="click."+this.prefix,d=this;if(f){e.bind(g,function(h){h.preventDefault();R.call(d,$(this))})}else{e.unbind(g)}}R=function(e){var i=e.text(),h=e.parent(),f=-1,d=-1;U.call(this,false);this.$tabContainer.find("li").each(function(j){var l=$(this),k=l.children("a");if(k.length===0){f=j;var m=l.text();l.removeClass("active").html(['<a href="#" id="',this.prefixStr,b[j],'"></a>'].join("")).children("a").text(m)}if(this===h[0]){d=j}});if(f===1||d===1){var g=this.$main.find("div.search_hotelName:first");if(f===1){g.hide();$("#search_hotelNameInput").attr("disabled","disabled")}else{$("#search_hotelNameInput").removeAttr("disabled");g.show()}}h.addClass("active");h.empty().text(i);if(this.callbacks.hasOwnProperty("tabClicked")){this.callbacks.tabClicked(d,f)}U.call(this,true)};K.prototype={initState:function(e,g){var d,f;this.$main=e;this.$form=(g===true?e.parent("form:first"):e.find("form:first"));if(this.hasTabs){this.$tabContainer=e.find("ul.searchOptions:first")}d=this.$form.find("input[name=destination]:first");this.hasDestination=((d.length>0)&&(d.attr("type")!=="hidden"));A.call(this,this.hasDestination&&d.val().length>0);this.cRooms=O.call(this);this.isPeopleSelectorEnabled=!this.isGroupBooking;f=I.call(this);this.cChild=f.child;this.cChildCount=f.childCount;return this},setTemplates:function(d){N.call(this,d);return this},loadPartial:function(h){var d=this,g,e,f={};e=function(){$.ajax({url:c,dataType:"xml",type:"POST",data:f,success:function(i){var k=$(i).find("basic_input:first"),j;if(k.length===0){return false}j=hcom.common.template.build(k.find("templates:first"));N.call(d,j);G.loadMessages(k.find("messages:first"));console.debug("%s.loadPartial: got contents, firing callback.",V);h()},error:function(){if(g++<3){console.warn("%s.loadPartial: unable to fetch contents, retrying (attempt #%d).",V,g);window.setTimeout(e,1000)}else{console.warn("%s.loadPartial: unable to fetch contents, giving up after %d tries.",V,g)}}})};e();return this},attachEvents:function(){var d=this;this.$main.find(this.roomSelector).bind("change.basicInput",function(){P.call(d)}).end().find(this.childSelector).bind("change.basicInput",function(){Y.call(d)}).end().find("input.hcomACCity:first").bind("blur.basicInput",function(e){A.call(d,$(this).val().length>0)});if(this.hasDestination&&hcom.locale.autosuggest.isAsaActive&&this.isAutoCompleteOn){this.$main.find("input.hcomACCity").autocomplete("/CitySuggestServlet")}if(this.hasTabs){U.call(d,true);$("#search_hotelNameInput").setEmptyValue(G.format("sfsearch.filterModule.defaulthotelnameinput")).blur(function(){T($(this))})}return this},detectFieldCounts:function(){B.call(this)},validate:function(){var d=($.trim($("#"+this.prefixStr+"search_checkIn").val()).length>0)&&($.trim($("#"+this.prefixStr+"search_checkOut").val()).length>0);d=d&&D.test($.trim($("#"+this.prefixStr+"search_checkIn").val()))&&D.test($.trim($("#"+this.prefixStr+"search_checkOut").val()));if(d){this.$main.find("div.roomAgesOfChildren:first").find("select").each(function(){d=$(this).val()!=="-1";return d})}return d||this.isGroupBooking},redirectGroupBooking:function(){if(this.isGroupBooking){window.location="/group_booking.do"}return this.isGroupBooking}};K.init=function(){D=new RegExp(L());G=new $.formatter()};K.filterHotelName=T;return K}});$.registerModule({name:"hcom.search.modules.queryform",dependencies:["hcom.search.modules.basicinput","hcom.search.modules.core"],impl:function(E){var C,D,B;var A=function(){var J;function H(){return $("#mainContainerSize1").find("div.searchModule:first")}function I(P,M,L,N){var O;if(N){O=M;M=L;L=O}P.removeClass(M).addClass(L)}function K(L){var M=$("#mainContainerSize1");if(J!==L){J=L;I(H(),"searchModuleClosed","sm_border",!L);I(M.find("div.search_changeSearchLink:first"),"search_changeSearchClose","search_changeSearchOpen",!L);M.find("div.sm_container")[L?"show":"hide"]();M.find("span.search_changeSearchCloseInfo:first")[L?"hide":"show"]();L=!L}}function G(){K(!J)}return{init:function(){J=!H().hasClass("searchModuleClosed")},toggle:G,set:K,isVisible:function(){return J}}}();var F=function(){function H(I){if($.browser.msie&&$.browser.version<7){I.find("div.search_changeSearchLink").bind("mouseenter",function(J){$(this).toggleClass("hover");if(!C.visibility.isVisible()){I.find("div.searchModule").addClass("searchModuleClosedhover").removeClass("searchModuleClosednohover")}}).bind("mouseleave",function(J){$(this).toggleClass("hover");if(!C.visibility.isVisible()){I.find("div.searchModule").removeClass("searchModuleClosedhover").addClass("searchModuleClosednohover")}})}}function G(){var I=$("#mainContainerSize1");D.initState(I).attachEvents();I.find("div.search_changeSearchLink").click(function(J){J.preventDefault();C.visibility.toggle()});H(I)}return{attach:G}}();return{init:function(){D=new hcom.search.modules.basicinput("",true);C=hcom.search.modules.queryform;B=hcom.search.modules.core;C.visibility.init();C.events.attach();B.addTemplateListener(E,function(G){D.setTemplates(G)})},visibility:A,events:F,getBasicInput:function(){return D}}}});$.registerModule({name:"hcom.search.modules.queryform.ajax",dependencies:["hcom.search.modules.queryform","hcom.search.modules.core","hcom.search.modules.sitecatalyst","hcom.common.modules.state"],impl:function(A){var G,J,E;function D(){return hcom.common.modules.state.formSerialize(G.$form)}function B(K){G.detectFieldCounts(K);hcom.common.modules.state.formRestore(K,G.$form)}function I(){var K=$.extend({},D(),E.getState()["hcom.search.modules.filterform.ajax"].form);delete K.rooms;K=Object.filter(K,function(L,M){return((String!==M.constructor)||($.trim(M).length>0))});$("#mainContainerSize1").setSubmitted();E.reload({data:K,cause:E.reloadCauses.select,success:hcom.search.modules.sitecatalyst.onSearchComplete})}function H(K){if(G.redirectGroupBooking()){K.preventDefault()}else{if($("#search_destination").isDirty()&&!$("#search_hotelNameInput").val()){$("#search_hotelNameInput").attr({disabled:"disabled"})}else{K.preventDefault();I()}}}function F(){$.map(["#btn_CheckAvailablility","#btn_Search"],function(K){$("#page_container").listen("click",K,H)})}function C(K){if(!K.hasValidationErrors||E.reloadCauses.select===K.cause){$("#mainContainerSize1").setSubmitted();J.events.attach();console.debug(A+": contentReloaded")}}return{init:function(){J=hcom.search.modules.queryform;E=hcom.search.modules.core;G=J.getBasicInput();E.addTemplateListener(A,function(K){F()});E.addContentReloadedListener(A,C);E.addStateChangeListener(A)},getState:function(){var K={basicInput:D()};return K},setState:function(K){if(typeof K.basicInput!=="undefined"){B(K.basicInput)}}}}});$.registerModule({name:"hcom.search.modules.namesearch",impl:function(D){var B,A,H,F="#text_enterHotelName";function G(){var J=$(F).val(),I=false;if(J.length>0){I=true}return I}function E(I){var K="sfsearch.namesearch.submit.title",J=$("#btn_submit_nameSearch");if(I){J.removeAttr("disabled").removeClass("inactive")}else{J.attr("disabled","disabled").addClass("inactive")}J.attr("title",A.format([K,I?"active":"inactive"].join(".")))}function C(){H.initSubmitButton();$.listen("keyup",F,function(I){E(G())});$.listen("submit",F,function(I){if(!G()){I.preventDefault()}})}return{init:function(){A=new $.formatter();B=$("#form_nameSearch");H=hcom.search.modules.namesearch;if(hcom.search.modules.core){hcom.search.modules.core.addTemplateListener(D,function(I){console.log("%s.buildTemplate",D);C()})}else{C()}},initSubmitButton:function(){E(G());B.setSubmitted();$(F).setEmptyValue(A.format("sfsearch.filterModule.defaulthotelnameinput"))}}}});$.registerModule({name:"hcom.search.modules.namesearch.ajax",dependencies:["hcom.search.modules.namesearch","hcom.common.modules.state","hcom.search.modules.core","hcom.search.modules.sitecatalyst"],impl:function(C){var B,A,G;function F(H){hcom.common.modules.state.formRestore(H.form,B)}function E(){if(!$("#btn_submit_nameSearch").attr("disabled")){var J=hcom.common.modules.state.formSerialize(B);var I=A.format("sfsearch.filterModule.action.filter");J=Object.filter(J,function(K,L){return((String!==L.constructor)||($.trim(L).length>0))});B.setSubmitted();var H=B.find("#text_enterHotelName").val();hcom.search.modules.sitecatalyst.onFilterApply(H);if(H!==""){I=I+": "+A.format("sfsearch.filterModule.action.name",H)}hcom.search.modules.core.reload({data:J,cause:hcom.search.modules.core.reloadCauses.filter,success:hcom.search.modules.sitecatalyst.onFilterComplete,cancel:function(){hcom.search.modules.sitecatalyst.onFilterCancel();F(hcom.search.modules.core.getState()["hcom.search.modules.namesearch.ajax"])},message:I})}}function D(H){if(!H.hasValidationErrors||hcom.search.modules.core.reloadCauses.select===H.cause){B=$("#form_nameSearch");G.initSubmitButton();console.debug(C+": contentReloaded")}}return{init:function(){A=new $.formatter();G=hcom.search.modules.namesearch;hcom.search.modules.core.addStateChangeListener(C);hcom.search.modules.core.addTemplateListener(C,function(H){console.log("%s.buildTemplate",C);$.listen("click","#btn_submit_nameSearch",function(I){I.preventDefault();E()})});hcom.search.modules.core.addContentReloadedListener(C,D)},getState:function(){return{form:hcom.common.modules.state.formSerialize(B)}},setState:F}}});$.registerModule({name:"hcom.search.modules.sortcontrol",impl:function(A){var E,F=false;function D(){$("#sct_sortOrder").parent("form").submit()}function C(){if($.browser.msie){$("#sct_sortOrder").bind("change",function(){E.submit()})}else{if(!F){F=true;$("#page_container").listen("change","#sct_sortOrder",function(G){E.submit()})}}}function B(){C()}return{init:function(){E=hcom.search.modules.sortcontrol;E.attachEvents();$("#btn_submit_sortOrder").hide()},initStatic:B,attachEvents:C,submit:D}}});$.registerModule({name:"hcom.search.modules.sortcontrol.ajax",dependencies:["hcom.search.modules.sortcontrol","hcom.common.modules.state","hcom.search.modules.core","hcom.search.modules.sitecatalyst"],impl:function(C){var B=null,A,F;function G(H){hcom.common.modules.state.formRestore(H.form,B)}function E(){var I=hcom.common.modules.state.formSerialize(B);I=Object.filter(I,function(J,K){return((String!==K.constructor)||($.trim(K).length>0))});B.setSubmitted();var H=B.find("#sct_sortOrder").val();hcom.search.modules.sitecatalyst.onSortBegin(A.format("sfsearch.nonlocalized.sortorder."+H));hcom.search.modules.core.reload({data:I,cause:hcom.search.modules.core.reloadCauses.sort,success:hcom.search.modules.sitecatalyst.onSortComplete,cancel:function(){hcom.search.modules.sitecatalyst.onSortCancel();G(hcom.search.modules.core.getState()[C])},message:A.format("sfsearch.filterModule.action.sort")})}function D(H){if(!H.hasValidationErrors||hcom.search.modules.core.reloadCauses.select===H.cause){B=$("#form_sortOrder");F.attachEvents();B.setSubmitted();console.debug(C+": contentReloaded")}}return{init:function(){F=hcom.search.modules.sortcontrol;$.extend(F,{submit:E});A=new $.formatter();B=$("#form_sortOrder");hcom.search.modules.core.addStateChangeListener(C);hcom.search.modules.core.addContentReloadedListener(C,D)},getState:function(){var H={form:hcom.common.modules.state.formSerialize(B)};return H},setState:G}}});$.registerModule({name:"hcom.search.modules.filterform",dependencies:["hcom.search.modules.basicinput"],impl:function(B){var A,G,F,D;A=function(J,I,H){this.obj=J;this.type=I;this.handlerFn=H};A.prototype={bind:function(){$.fn.bind.apply(this.obj,[this.type,this.handlerFn])},unbind:function(){$.fn.unbind.apply(this.obj,[this.type])}};F=function(){this.$hotelNameEdit=$("#text_enterHotelName")};F.prototype={init:function(){this.$filterForm=$("#GradientContainer form:first");this.$landmarkSelector=$("#sct_search_landmark");this.$distanceSelector=$("#sct_search_distanceTo");this.$brandSelector=$("#sct_brand")}};var C=function(){var H;function I(J){var M,K=G.Event,L=G.getFormObjects();J=J||J===undefined;if(J){L.$filterForm.setSubmitted();M=K.prototype.bind;if(H!==undefined){throw B+".bind: duplicate event binding"}H=G.getEvents()}else{M=K.prototype.unbind}$.map(H,function(N){M.apply(N)});if(J){G.checkSelections()}else{H=undefined}}return{bind:function(){I(true)},unbind:function(){I(false)},reset:function(){H=undefined}}}();function E(){D=new G.FormObjects();D.init();G.eventMapper.bind()}return{init:function(){G=hcom.search.modules.filterform},initStatic:E,Event:A,FormObjects:F,applyFilter:function(){D.$filterForm.submit()},events:{formSubmit:function(H){H.preventDefault()},checkboxClick:function(H){G.applyFilter()},selectorChange:function(H){if(this.options[this.selectedIndex].disabled!==true){this.previousIndex=this.selectedIndex;G.applyFilter()}else{this.selectedIndex=this.previousIndex?this.previousIndex:this.submitted;H.preventDefault();return false}},hotelName:function(H){G.checkSelections()}},eventMapper:C,getEvents:function(){var H=G.Event,I=G.events,J=G.getFormObjects();return[new H(J.$filterForm,"submit",I.formSubmit),new H(J.$filterForm.find(":checkbox"),"click",I.checkboxClick),new H(J.$landmarkSelector,"change",I.selectorChange),new H(J.$distanceSelector,"change",I.selectorChange),new H(J.$brandSelector,"change",I.selectorChange),new H(J.$hotelNameEdit,"blur",I.hotelName),new H(J.$hotelNameEdit,"keyup",I.hotelName)]},getFormObjects:function(){return D},checkSelections:function(){hcom.search.modules.basicinput.filterHotelName(G.getFormObjects().$hotelNameEdit)}}}});$.registerModule({name:"hcom.search.modules.filterform.ajax",dependencies:["hcom.common.modules.state","hcom.search.modules.core","hcom.search.modules.sitecatalyst"],images:["filter_error_bottom.png","filter_error_mid.png","filter_error_top.png"],imageUrlPrefix:"/images/search/",impl:function(K){var T,R,O,A,P=0,S,M,H,G,D;var J=null,E=null;function N(X,W){var V=X[0];V.selectedIndex=W;V.submittedValue=W}function Q(V){hcom.common.modules.state.formRestore(V.form,S.$filterForm);N(S.$landmarkSelector,V.formIndexes.landmarkSelector);N(S.$distanceSelector,V.formIndexes.distanceSelector);N(S.$brandSelector,V.formIndexes.brandSelector)}function C(){var V=O.getState()["hcom.search.modules.queryform.ajax"].basicInput;delete V.rooms;delete V["searchParams.name"];V=$.extend({},V,hcom.common.modules.state.formSerialize(S.$filterForm));V=Object.filter(V,function(W,X){return((String!==X.constructor)||($.trim(X).length>0))});return V}function U(Y){var d=0,c,X,e,b=A.format("sfsearch.filterModule.action.filter"),Z,f=false;if(Y["searchParams.starRatings"]!==undefined&&Y["searchParams.starRatings"].length>0){Z=Y["searchParams.starRatings"];if(Z.constructor===Array){var W="";for(c=0;c<Z.length;c++){W=W+(W!==""?", ":"");W=W+Z[c]}b=b+": "+A.format("sfsearch.filterModule.action.starring",W)}else{b=b+": "+A.format("sfsearch.filterModule.action.starring",Z)}f=true;d++}if(Y["searchParams.landmark"]!==undefined&&Y["searchParams.landmark"].length>0){if(d<2){if(f){b=b+(b!==""?"; ":"")}else{b=b+": "}X=/(.*)(\([0-9]+\))/.exec(S.$filterForm.find("option[value="+Y["searchParams.landmark"]+"]").text());e=X&&X[1];b=b+A.format("sfsearch.filterModule.action.distance",S.$filterForm.find("option[value="+Y["searchParams.distance"]+"]").text(),$.trim(e));f=true}d++}var a="";if(Y["searchParams.breakFastIncluded"]!==undefined){a=A.format("sfsearch.filterModule.action.breakfast")}if(Y["searchParams.allInclusive"]!==undefined){a=a+(a!==""?", ":"");a=A.format("sfsearch.filterModule.action.all")}if(a!==""){if(d<2){if(f){b=b+(b!==""?"; ":"")}else{b=b+": "}b=b+A.format("sfsearch.filterModule.action.inclusion",a);f=true}d++}if(Y["searchParams.facilities"]!==undefined){if(d<2){var V="";if(f){b=b+(b!==""?"; ":"")}else{b=b+": "}Z=Y["searchParams.facilities"];if(Z.constructor===Array){for(c=0;c<Z.length;c++){V=V+(V!==""?", ":"");X=/(\S+[^0-9\(\)]*)(\([0-9]+\))/.exec(S.$filterForm.find("label[for=chbox_facilities_"+Z[c]+"]").text());e=X&&X[1];V=V+$.trim(e)}}else{V=V+(V!==""?", ":"");X=/(\S+[^0-9\(\)]*)(\([0-9]+\))/.exec(S.$filterForm.find("label[for=chbox_facilities_"+Z+"]").text());e=X&&X[1];V=V+$.trim(e)}b=b+A.format("sfsearch.filterModule.action.facility",V);f=true}d++}if(Y["searchParams.brand"]!==undefined){if(d<2){if(f){b=b+(b!==""?"; ":"")}else{b=b+": "}X=/(.*)(\([0-9]+\))/.exec(S.$filterForm.find("option[value="+Y["searchParams.brand"]+"]").text());e=X&&X[1];b=b+A.format("sfsearch.filterModule.action.brand",$.trim(e));f=true}d++}if(Y["searchParams.name"]!==undefined&&Y["searchParams.name"].length>0){if(d<2){if(f){b=b+(b!==""?"; ":"")}else{b=b+": "}b=b+A.format("sfsearch.filterModule.action.name",Y["searchParams.name"]);f=true}d++}if(d>2){b=b+(b!==""?"; ":"");b=b+A.format("sfsearch.filterModule.action.more")}return b}function F(W,V){}H=function(V){T.checkSelections();F(C(),V)};M=function(V){O.removeAfterAjaxReqListener(K,M);H()};function L(V){V.preventDefault();var W=this.rel.split("|");if(W.length>1){T.setLandmark(W[1]);hcom.search.modules.sitecatalyst.onFilterSelect(null,"Neighbourhood - "+W[1].substring(W[1].indexOf("-")+1))}if(W.length>2){T.setStarRatings(W[2].split(","));hcom.search.modules.sitecatalyst.onFilterSelect("Star rating - "+W[2])}hcom.search.modules.sitecatalyst.onFindSimilarHotelClick();T.applyFilter()}function B(){P="";S.$filterForm.find("span.bigNumber").each(function(){P+=$.trim($(this).text())});P=parseInt(P,10)}function I(V){P=V.matchingHotels;if(V.doc){}else{T.eventMapper.unbind();S.$filterForm.html(V.filterForm);S.init();if($.browser.msie&&$.browser.version<8&&S.$hotelNameEdit.val()===D){S.$hotelNameEdit.val("")}G=S.$hotelNameEdit.val().length>0;T.eventMapper.bind()}Q(V)}return{init:function(){var V;A=new $.formatter();T=hcom.search.modules.filterform;V=T.getEvents;R=hcom.search.modules.sitecatalyst;O=hcom.search.modules.core;S=new T.FormObjects();$.extend(T,{queryFields:["searchParams.starRatings","searchParams.distance","searchParams.landmark","searchParams.breakFastIncluded","searchParams.allInclusive","searchParams.facilities","searchParams.themesAndTypes","searchParams.brand","searchParams.name"],setStarRatings:function(W){S.$filterForm.find("div.starRating :checkbox").removeAttr("checked").val(W?W:[]).setSubmitted()},setLandmark:function(X,W){S.$landmarkSelector.val(X?X:"").setSubmitted();if(W!==undefined){T.setDistance(W)}},setDistance:function(W){if(isNaN(W)){S.$distanceSelector.val("").setSubmitted()}else{S.$distanceSelector.find("option").each(function(){if(Number(W)===Number(this.value)){S.$distanceSelector.val(this.value).setSubmitted()}})}},setBreakFast:function(W){$("#chbox_breakfastInc").attr("checked",W?W:false).setSubmitted()},setAllinclusive:function(W){$("#chbox_allInclusive").attr("checked",W?W:false).setSubmitted()},setFacilities:function(W){$("#FilterBox-facilities :checkbox").removeAttr("checked").val(W?W:[]).setSubmitted()},setThemes:function(W){$("#FilterBox-themesTypes :checkbox").removeAttr("checked").val(W?W:[]).setSubmitted()},setBrand:function(W){S.$brandSelector.val(W?W:"").setSubmitted()},setName:function(W){S.$hotelNameEdit.val(W?W:"").setSubmitted()},removeAllOptions:function(){T.setStarRatings();T.setLandmark();T.setBreakFast(false);T.setAllinclusive(false);T.setFacilities();T.setThemes();T.setBrand();T.setName()},applyFilter:function(){var W=C();R.onFilterApply(S.$hotelNameEdit.val());O.reload({data:W,cause:O.reloadCauses.filter,message:U(W),success:function(){R.onFilterComplete();H()},cancel:function(){R.onFilterCancel();I(O.getState()["hcom.search.modules.filterform.ajax"])}})},getFormObjects:function(){return S},getEvents:function(){var X=V(),W=T.Event;Array.prototype.push.apply(X,[new W(S.$filterForm.find("div.starRating :checkbox"),"click",function(){if(this.checked){R.onFilterSelect("Star rating - "+this.value)}}),new W($("#chbox_breakfastInc"),"click",function(){if(this.checked){R.onFilterSelect("Inclusions - Breakfast included")}}),new W($("#chbox_allInclusive"),"click",function(){if(this.checked){R.onFilterSelect("Inclusions - All inclusive")}}),new W($("#FilterBox-facilities input"),"click",function(){if(this.checked){R.onFilterSelect("Facilities - "+this.value)}}),new W($("#FilterBox-themesTypes input"),"click",function(){if(this.checked){if(this.value.indexOf("true")>-1){R.onFilterSelect("Hotel Theme / Types - theme "+this.value.substring(this.value.indexOf("-")+1))}else{R.onFilterSelect("Hotel Theme / Types - type "+this.value.substring(this.value.indexOf("-")+1))}}}),new W(S.$landmarkSelector,"change",function(){if(this.value){if(this.value.indexOf("LANDMARK")>-1){R.onFilterSelect(null,"Landmark - "+this.value.substring(this.value.indexOf("-")+1))}else{if(this.value.indexOf("NEIGHBORHOOD")>-1){R.onFilterSelect(null,"Neighbourhood - "+this.value.substring(this.value.indexOf("-")+1))}}}}),new W(S.$brandSelector,"change",function(){if(this.value){R.onFilterSelect("Brand - "+this.value)}})]);return X}});O.addStateChangeListener(K);O.addTemplateListener(K,function(){D=A.format("sfsearch.filterModule.defaulthotelnameinput")});O.addContentReloadedListener(K,function(){console.log("%s.buildTemplate",K);S.$hotelNameEdit=$("#text_enterHotelName");G=S.$hotelNameEdit.val().length>0;S.init();T.eventMapper.reset();T.eventMapper.bind();B();$("#page_container").listen("click","a.findSimilar",L)})},getState:function(){var V={};V.form=hcom.common.modules.state.formSerialize(S.$filterForm);V.doc=J;V.filterForm=(J?null:S.$filterForm.html());V.formIndexes={landmarkSelector:S.$landmarkSelector[0].selectedIndex,distanceSelector:S.$distanceSelector[0].selectedIndex,brandSelector:S.$brandSelector[0].selectedIndex};V.matchingHotels=P;E=V;return V},setState:I}}});$.registerModule({name:"hcom.search.modules.hotelimagepopdiv",dependencies:["hcom.common.modules.popdiv","hcom.search.modules.core"],images:["image_pop_top.png","image_pop_left_main.png","image_pop_bg.png","image_pop_right.png","image_pop_left_top.png","image_pop_left_bottom.png"],imageUrlPrefix:"/images/search/pop_divs/",impl:function(K){var H={width:385,height:330},d={height:64,width:64},A,a=null,f=null,R=0,E,V,c,b=false,F=null,S,Y,e,i={top:"imagePopLeftTop",bottom:"imagePopLeftBottom",center:"imagePopLeft"},D=i.center,N,C,T=false,j=3000,h;function U(u){var l,n,m=u.offset(),p=$(document).scrollTop(),o=$(window).height(),r=m.top+Math.round(d.height/2),t=Math.round(H.height/2),q;if((r-p)<t){l=r-50;q=i.top}else{if((r+t)>(o+p)){l=r-H.height+50;q=i.bottom}else{l=r-t;q=i.center}}n=m.left+d.width-10;V={left:m.left,top:m.top};c={left:n,top:l};e={top:l,left:n,width:H.width,height:H.height,thumbTop:m.top,thumbLeft:m.left,thumbWidth:d.width,thumbHeight:d.height,alignment:F.alignments.right,tail:q};return e}function G(){if(a!==null){clearTimeout(a);a=null}}function P(l){if(a===null){a=setTimeout(function(m){C()},l)}}C=function(){R++;if(R>f.length-1){R=0}$.preloadImages(f[R],function(l){if(!l){N(f[R],String((R+1)))}else{G();if(!b&&(f.length>1)){P(1)}else{R++;if(R>f.length-1){R=0}N(f[R],String((R+1)))}}})};N=function(q,p,l,m,o){var n=E.find("#imagePopImage img");G();n.fadeOut("slow",function(){n.attr("src",q)});n.fadeIn("slow",function(){if(!b&&(f.length>1)){P(j)}});if(p!==undefined){E.find("#slideNumCurrent").html(p)}if(l!==undefined){E.find("#slideNumMax").html(l)}if(m!==undefined){E.find("#popDivFullDescription").attr("href",m)}if(o!==undefined){E.find("#imagePopHotelname").text(o)}};function k(){R--;if(R<0){R=f.length-1}$.preloadImages(f[R],function(l){if(!l){N(f[R],String((R+1)))}else{R--;if(R<0){R=f.length-1}N(f[R],String((R+1)))}})}function J(){E.find("#imagePopImage img").hide();b=false;f=A[Y]&&A[Y].images||null;if(f!==null){$.preloadImages(f);N("/images/blank.gif","1",String(f.length),A[Y].detailsUrl,A[Y].name);N(f[0]);R=0;if(f.length>1){E.find("div#imgPrev").show();E.find("div#imgNext").show();E.find("div#imgStop").show();E.find("div.slideNumber_text").show();P(j)}else{E.find("div#imgPrev").hide();E.find("div#imgNext").hide();E.find("div#imgStop").hide();E.find("div.slideNumber_text").hide()}}}function O(l,m){E.find(l).attr("class",m)}function Q(l){if(!l.hasValidationErrors&&!l.errorOccurred){var m={},n=l.$response.find("popdiv_data:first");n.find("imgpopdiv").each(function(r){var p=$(this),q=$.trim(p.find("name:first").text()),o=p.attr("id"),u=p.attr("details-href"),t=[];p.find("img").each(function(v){t.push(this.attributes[0].nodeValue);if(v===0){$.preloadImages(this.attributes[0].nodeValue)}});m[o]={name:q,images:t,detailsUrl:u}});A=m;console.debug("popdiv data has been built")}}function B(l){l.preventDefault();$(document).unbind("mousemove.himgpd");G();F.forceClose()}function g(l){l.preventDefault();G();O("div.imagePopControls_pse","imagePopControls_button imagePopControls_ply");k();b=true}function M(l){l.preventDefault();G();O("div.imagePopControls_pse","imagePopControls_button imagePopControls_ply");C();b=true}function X(l){l.preventDefault();if(b){b=false;O("div.imagePopControls_ply","imagePopControls_button imagePopControls_pse");P(j)}else{b=true;G();O("div.imagePopControls_pse","imagePopControls_button imagePopControls_ply")}}function W(l){var m=$(this);if(m.is("div.photoPrompt")){m=m.parent().find("img.imagePopDivThumb:first")}Y=m.attr("id");F.onThumbnailHoover(l,m,U(m))}function I(){if(!T){T=true;$.listen("mouseover","img.imagePopDivThumb",W);$.map(["div.photoPopDiv_overlay","img.photoPopDiv_animation"],function(l){$.listen("click",l,function(){if(F){F.forceOpen()}})})}}function L(m){var l="click.himg";console.log("%s.attachEvents",K);$("#forceClose").bind(l,B);$("#imgPrev").bind(l,g);$("#imgStop").bind(l,X);$("#imgNext").bind(l,M);if($.browser.msie&&$.browser.version<7){$.each(["pre","ply","pse","nxt"],function(n,o){E.find("div.imagePopControls_"+o).bind("mouseenter.himg",function(p){$(this).toggleClass("imagePopControls_"+o+"hover").toggleClass("imagePopControls_"+o)}).bind("mouseleave.himg",function(p){$(this).toggleClass("imagePopControls_"+o+"hover").toggleClass("imagePopControls_"+o)})})}I()}function Z(l){l.$body.find("div.photoPrompt").bind("mouseover.himg",W);if(F){F.destroy()}F=new hcom.common.modules.popdiv({namespace:"himgpd",$container:E,callbacks:{setThumbOverlay:function(n,q){var o=q.parents("div:first"),p=o.find("div.photoPrompt"),m=o.find("div.thumbnail_popDiv_overlay:first");if(n){p.hide();m.show()}else{m.hide();p.show()}},setThumbOverlayAnim:function(m,o){var n=o.parent().parent().find("img.thumbnail_popDiv_animation:first");if(m){n.show()}else{n.hide()}},initialize:function(){var m=e.tail;E.css({top:e.top+"px",left:e.left+"px"}).find("td#"+D).attr("id",m);D=m;if(S){S.css({top:(e.top+12)+"px",left:(e.left+21)+"px",width:(H.width-30)+"px",height:(H.height-28)+"px"}).show()}J()},activate:function(){E.find("#imagePopImage img").hide();h.reportActivate()},passivate:function(){G()},destroy:function(){if(S){S.hide()}}}})}return{init:function(){h=hcom.search.modules.hotelimagepopdiv;E=$("#imagePopDiv");if($.browser.msie&&($.browser.version<7)){S=$("#popupPlate")}$.listen("click","a.hotelDetailsPhoto",function(l){l.preventDefault();return false});hcom.search.modules.core.addTemplateListener(K,L);hcom.search.modules.core.addStateChangeListener(K);hcom.search.modules.core.addContentReloadedListener(K,Z);hcom.search.modules.core.addAfterAjaxReqListener(K,Q)},reportActivate:function(){},getState:function(){var l={};l.imgPopDiv=$.extend({},A);return l},setState:function(l){G();A=l.imgPopDiv}}}});$.registerModule({name:"hcom.search.modules.hotelimagepopdiv.ajax",dependencies:["hcom.search.modules.hotelimagepopdiv","hcom.search.modules.sitecatalyst"],impl:function(A){return{init:function(){$.extend(hcom.search.modules.hotelimagepopdiv,{reportActivate:function(){hcom.search.modules.sitecatalyst.onPhotoPopdivShow()}})}}}});$.registerModule({name:"hcom.search.modules.neighbourhoodpopdiv",dependencies:["hcom.common.modules.popdiv","hcom.search.modules.core","hcom.search.modules.filterform","hcom.search.modules.sitecatalyst"],images:["map_pop_div_container_top_type1.png","map_pop_div_container_top_type2.png","map_pop_div_container_mid_type1.png","map_pop_div_container_bottom_type1.png","map_pop_div_container_bottom_type2.png"],imageUrlPrefix:"/images/search/",impl:function(X){var C={width:603,height:334},f={height:48,width:48},e,R,g,b=null,Y,a,Q=null,W=null,J=null,A,D,K,G,F=null,P=null,T,V,B,H=true;function O(o){var n,l=o.offset(),k=Math.round(l.left+(f.width-C.width)/2)+1,j,i,m=$(window),h=f.height/2;if(m.height()/2+m.scrollTop()-l.top-h>0){j=l.top+f.height-10;i=true}else{j=l.top-C.height+10;i=false}n={top:j,left:k,width:C.width,height:C.height,thumbTop:l.top,thumbLeft:l.left,thumbWidth:f.width,thumbHeight:f.height,alignment:(i?F.alignments.bottom:F.alignments.top)};P=n;return n}function N(k,i){var h,j;if(k&&G.hasOwnProperty(k)){h=G[k].content;g=k}else{h=R}T.html(h);e=T.children(":first");j=e.find("strong.mapTitle:first");Y=e.find("img#neighbourhoodMap").attr("src");if(i){$("#lnk_showOnMap").attr("href",$("#lnk_neighborhoodImg_"+i).attr("href")).attr("title",A.format("sfsearch.neighbourhoodpopdiv.showonmap.title",$("#lnk_hotelTitle_"+i).text()));Q=$("#lnk_neighborhoodImg_"+i).parent("div");b=k;if(!D){a=j.text()}}else{if(!D){j.text(a)}}if(i&&k!==b){j.text(A.format("sfsearch.neighbourhoodpopdiv.title.nohotel"));e.find("div.buttonBorder1").remove()}if(!i&&W){$("#lnk_showOnMap").attr("href",$("#lnk_neighborhoodImg_"+W).attr("href")).attr("title",A.format("sfsearch.neighbourhoodpopdiv.showonmap.title",$("#lnk_hotelTitle_"+W).text()))}if(V){B()}}function U(){if(P.alignment===F.alignments.top){e.find("div.mapBottom").addClass("mapBottomTail").removeClass("mapBottom")}else{e.find("div.mapTop").addClass("mapTopTail").removeClass("mapTop")}}function Z(h){h.preventDefault();if(H&&G.hasOwnProperty(this.id)){N(this.id);if(!D){U()}}}function S(){if(H&&G.hasOwnProperty(this.id)){var h=G[this.id]&&G[this.id].mapSrc;if(h){$("#neighbourhoodMap").attr("src",h)}}}function L(){if(H){$("#neighbourhoodMap").attr("src",Y)}}B=function(){e.find("area.nhoodCoords").bind("mouseover.nbhcords",S);e.find("area.nhoodCoords").bind("mouseout.nbhcords",L);e.find("area.nhoodCoords").bind("click.nbhcords",Z)};function E(i){var h=i.$response.find("neighbourhood_data neighbourhood");G={};G.length=0;h.each(function(){var j=$(this),k=j.attr("nbhId");G[k]={content:j.text(),mapSrc:j.attr("mapSrc")};G.length+=1;if(g===undefined&&j.is("[active=true]")){g=k}$.preloadImages(j.attr("mapSrc"))});hcom.search.modules.core.removeAfterAjaxReqListener(X,E)}function c(h){var i=h.getModule("neighbourhood");console.log("%s.buildTemplate",X);R=i.getTemplate("neighbourhood_overview_popdiv");D=$.isModuleLoaded("hcom.search.modules.map");if($.browser.msie&&$.browser.version<7){K=$("#popupPlate")}}function d(j){var l=$(this),k=l.parent();if(l.is("div.nhoodPrompt")){l=k.find("img.nbhImage:first");if(l.length!==1){console.warn("nbhpd - unable to select thumbnail");return false}k=l.parent()}var h=k.attr("rel"),i=h&&h.split(",");if(i&&i.length===2&&G.hasOwnProperty(i[0])){W=i[1];J=i[0];F.onThumbnailHoover(j,l,O(l))}}function I(h){h.$body.find("div.nhoodPrompt").bind("mouseover",d);T=$("#nhoodContainer");if(D){if(G.length>0){N(g)}}else{if(F){F.destroy()}F=new hcom.common.modules.popdiv({namespace:"nbh",$container:T,callbacks:{setThumbOverlay:function(j,m){var k=m.parents("div:first"),l=k.find("div.nhoodPrompt"),i=k.find("div.thumbnail_popDiv_overlay:first");if(j){l.hide();i.show()}else{i.hide();l.show()}},setThumbOverlayAnim:function(i,k){var j=k.parent().parent().find("img.thumbnail_popDiv_animation:first");if(i){j.show()}else{j.hide()}},initialize:function(){T.css({top:P.top+"px",left:P.left+"px"});if(K){K.css({top:(P.top+21)+"px",left:(P.left+9)+"px",width:(C.width-18)+"px",height:(C.height-42)+"px"}).show()}N(J,W);U()},activate:function(){hcom.search.modules.sitecatalyst.onNeighborhoodPopdivShow();H=true},passivate:function(){H=false},destroy:function(){Q=null;if(K){K.hide()}}}})}}function M(){$.map(["div.nbhPopDiv_overlay","img.nbhPopDiv_animation"],function(h){$.listen("click",h,function(){if(F){F.forceOpen()}})});$.listen("mouseover","img.nbhImage",d);$.listen("click","a.nbhLink",function(h){h.preventDefault();return false});if(!V){$.listen("mouseover","area.nhoodCoords",S);$.listen("mouseout","area.nhoodCoords",L);$.listen("click","area.nhoodCoords",Z)}$.listen("click","#closeNhood",function(h){h.preventDefault();if(H){F.forceClose()}});$.listen("click","#lnk_showHotelsByNeighborhood",function(h){h.preventDefault();if(H){hcom.search.modules.filterform.setLandmark("NEIGHBORHOOD-"+g,"");hcom.search.modules.core.reload({url:this.href+"&ajax=true"});if(!D){F.forceClose()}}})}return{init:function(){A=new $.formatter();V=($.browser.msie&&$.browser.version<7)||$.browser.safari;hcom.search.modules.core.addTemplateListener(X,c);hcom.search.modules.core.addContentReloadedListener(X,I);hcom.search.modules.core.addAfterAjaxReqListener(X,E);M()}}}});$.registerModule({name:"hcom.search.modules.interstitial",dependencies:["hcom.search.modules.core","hcom.search.modules.glasspane"],images:["overlay_box_1_top.png","overlay_box_1_bg.png","overlay_box_1_bottom.png","wake_up_happy_size_2.png","intersticial_bar.gif"],imageUrlPrefix:"/images/search/",impl:function(A){var C,H,B=document.title,F,D;function I(){D.cancel();if(H){H();H=undefined}hcom.search.modules.interstitial.hide()}function G(J,K){document.title=C.format("sfsearch.holdingpage.title");H=J;hcom.search.modules.glasspane.show();F.find("p.msgTxt2").html(K?K:"").end().show()}function E(){hcom.search.modules.glasspane.hide();F.hide();H=undefined;document.title=B}return{init:function(){D=hcom.search.modules.core;C=new $.formatter();D.addTemplateListener(A,function(){F=$("#filterModuleOverlay");F.find("#interstitialCancel").click(function(J){J.preventDefault();I()});$(window).keydown(function(J){if(J.keyCode===27){J.preventDefault();if(F.is(":visible")){I()}return false}});$(window).unload(function(){H=undefined})});D.addBeforeAjaxReqListener(A,function(J){H=J.cancel;if(J.reload){G(J.cancel,J.message)}});D.addAfterAjaxCompleteListener(A,function(){E()})},show:G,hide:E}}});$.registerModule({name:"hcom.search.modules.checkavailabilitydialog",dependencies:["hcom.search.modules.core","hcom.common.listener","hcom.search.modules.glasspane"],impl:function(C){var B,I=null,H,E=100,D,M;function F(){return D||(D=$("#queryModuleOverlay"))}function J(O){var N=D.find("div.buttonBorder1:first");if(O){if(N.hasClass("notActive")){N.removeClass("notActive").find("button").removeAttr("disabled")}}else{if(!N.hasClass("notActive")){N.addClass("notActive").find("button").attr("disabled","disabled")}}}var A=function(){var N=false,P;function O(){J(B.getBasicInput().validate())}return{set:function(Q){if(Q!==N){N=Q;if(Q){P=setInterval(O,200)}else{clearInterval(P)}}}}}();function G(N){var O=F();if(N){if(!O.is(":visible")){hcom.search.modules.glasspane.show();O.show();A.set(true)}}else{if(O.is(":visible")){A.set(false);O.hide();hcom.search.modules.glasspane.hide()}}}function K(N){B.getBasicInput().setTemplates(N)}function L(){D=F();if(D.length){B.getBasicInput().initState(D).attachEvents();hcom.search.modules.core.addTemplateListener(C,K);B.attachEvents()}}M=function(){return{close:function(N){N.preventDefault();G(false)},open:function(N){N.preventDefault();I=N.target.rel;G(true)},submit:function(N){N.preventDefault();if(H.validate()){if(!H.redirectGroupBooking()){G(false);B.submit()}}}}}();return{init:function(){B=hcom.search.modules.checkavailabilitydialog;H=new hcom.search.modules.basicinput("ca")},initStatic:L,submit:function(){$("#checkAvailabilityHolder").find("form:first").attr("action","/search.do").find("input[name=searchParams.hotelId]").val(I).end().submit()},events:M,setDialog:G,set$Dialog:function(N){return(D=N)},attachEvents:function(){$("#checkAvailabilityHolder").listen("click",".closeWindowEvent",M.close).listen("click","#ca_continueCheckAvailability",M.submit);$.map(["#chooseAlternate","#chooseAlternateLink","a.hcomCheckAvailability"],function(N){$("#page_container").listen("click",N,M.open)})},getHotelId:function(){return I},setHotelId:function(N){I=N},getBasicInput:function(){return H}}}});$.registerModule({name:"hcom.search.modules.checkavailabilitydialog.ajax",dependencies:["hcom.common.template","hcom.search.modules.core","hcom.search.modules.sitecatalyst"],impl:function(C){var B,F="check_availibility",D,I=null,E;function H(J){$("#checkAvailabilityHolder").html(J);D=B.set$Dialog($("#queryModuleOverlay"));B.getBasicInput().initState(D).attachEvents()}function G(J){console.log("%s.buildTemplate",C);var K=J.getModule(F);if(K.hasTemplate("dialog")){H(K.getTemplate("dialog"))}B.getBasicInput().setTemplates(J)}function A(K){if(K.hasValidationErrors&&(K.cause===E.reloadCauses.checkAvail)){var J=hcom.common.template.build(K.$response.children("templates"));H(J.getModule(F).getTemplate("dialog"));B.setDialog(true)}}return{init:function(){var J;E=hcom.search.modules.core;B=hcom.search.modules.checkavailabilitydialog;$.extend(B,{submit:function K(){var M=D.find("form:first"),L=B.getHotelId();M.find("input[name=searchParams.hotelId]:first").val(L);var O=$.extend({},E.getState()["hcom.search.modules.filterform.ajax"].form,hcom.common.modules.state.formSerialize(M));O=Object.filter(O,function(Q,R){return((String!==R.constructor)||($.trim(R).length>0))});I=L;if($.isModuleLoaded("hcom.search.modules.map")){O.searchViewType="LIST";var P=[];for(var N in O){if(O.hasOwnProperty(N)){P.push(N+"="+O[N])}}window.location="/search.do?"+P.join("&")}else{E.reload({data:O,cause:E.reloadCauses.checkAvail,sucess:hcom.search.modules.sitecatalyst.onSearchComplete})}}});J=B.events.open;$.extend(B.events,{open:function(L){J(L);hcom.search.modules.sitecatalyst.onCheckAvailabilityClick()}});B.attachEvents();E.addTemplateListener(C,G);E.addAfterAjaxCompleteListener(C,A);E.addStateChangeListener(C)},showDialog:function(J){B.setHotelId(J);hcom.search.modules.sitecatalyst.onCheckAvailabilityClick();B.setDialog(true)},getState:function(){return{hotelId:I}},setState:function(J){I=(J&&J.hotelId)||null},setHotelId:function(J){I=J}}}});$.registerModule({name:"hcom.search.modules.glasspane",impl:function(C){var E,B,D=false,A=0.85;function F(){if(!D){D=true;E=$("#holding")}return B}function G(H){console.log("%s.buildTemplate",C);F()}return{init:function(){B=hcom.search.modules.glasspane;if(hcom.search.modules.core){hcom.search.modules.core.addTemplateListener(C,G)}else{F()}},initStatic:F,show:function(H){var I=H!==undefined?H:A;E.css({opacity:I,height:$(document).height()}).show()},hide:function(){E.hide()},toggle:function(H){if(E.is(":visible")){hcom.search.modules.glasspane.hide()}else{hcom.search.modules.glasspane.show(H)}},visible:function(){return E.is(":visible")}}}});$.registerModule({name:"hcom.search.modules.map",dependencies:["hcom.common.modules.map","hcom.search.modules.core"],externalDependencies:[],images:["hotels_map_pop_div_top.png","hotels_map_pop_div_bg.png","hotels_map_pop_div_bottom.png"],imageUrlPrefix:"/images/search/",impl:function(T){var a=null,B,C,N;var X,Z,c,E,H,V=null;var J,b;var A,Q,U=false;function R(e){Q=e;e.SetCustomIcon(e.GetCustomIcon().replace('class="pushPin"','class="pushPinOn"'));e.SetZIndex(1001)}function d(){if(Q){Q.SetCustomIcon(Q.GetCustomIcon().replace('class="pushPinOn"','class="pushPin"'));Q.SetZIndex(1000);Q=null}}function M(e){d();R(X[e])}function S(e){e.addClass("mapScrollRowHighlight");A=e}function F(){if(A){A.removeClass("mapScrollRowHighlight");A=null}}function D(){U=false;d();F()}function W(){U=false}function K(f,h){F();U=false;d();R(f);var e=function(){a.ShowInfoBox(f,f.GetPoints[0],new VEPixel(8,-2))},g=function(){setTimeout(e,500);a.DetachEvent("onendpan",g)};if(f){if(h){a.AttachEvent("onendpan",g);a.PanToLatLong(f.GetPoints()[0])}else{e()}}}function L(e){K(X[e],true)}function I(g){if(g.errorOccurred||g.hasValidationErrors){V=null;return }var f=g.$response.find("map_data"),e,h;V=[];Z=null;c=null;E=f.attr("distanceunit")&&(f.attr("distanceunit")==="KILOMETER");f.find("hotel").each(function(){var i=$(this);h=new VELatLong(i.attr("lat"),i.attr("lon"));if(i.attr("center")==="true"){Z=h;c=i.attr("hotelId")}var j=i.text();if($.browser.msie&&$.browser.version<7){j=N+j}V.push({loc:h,id:i.attr("hotelId"),index:i.attr("index"),text:j})});e=f.find("landmark");if(e.length===1){H={loc:new VELatLong(e.attr("lat"),e.attr("lon")),icon:C.replace("{0}",e.attr("name"))}}else{H=null}console.debug(T+": afterAjax: buildMapData()")}function O(j){var o=$(".mapScrollBox tr"),n,h,l,k,e,m,g=2,f;for(h in X){if(X[h]===j){n=h;break}}for(h=0;h<o.length;h++){l=$(o[h]);if(l.attr("id")==="hotelRow"+n){F();S(l);k=$(".mapScrollBox").scrollTop();e=l.height()*h;if((e>k&&(e-k>l.height()*3)||e<k)){m=l.height()*(h>2?h-2:0);f=(m-k)/2;while((f<0&&k>m)||(f>0&&k<m)){if(Math.abs(k-m)<g){f=m-k}else{f=(m-k)/2}$(".mapScrollBox").scrollTop(k+f);k+=f}break}}}}function Y(){var f=[],g,e,k=[],j,h;a.SetScaleBarDistanceUnit(E?VEDistanceUnit.Kilometers:VEDistanceUnit.Miles);hcom.common.modules.map.localizeControls(B);a.AttachEvent("onobliqueenter",function(){setTimeout(function(){hcom.common.modules.map.localizeControls(B)},200)});a.AttachEvent("onclick",function(i){var l=a.GetShapeByID(i.elementID);if(l&&!l.isShadow){K(l,false);O(l)}});a.AttachEvent("onmouseover",function(i){var l=a.GetShapeByID(i.elementID);if(l&&!l.isShadow){U=false;d(l);R(l);O(l)}});$("#myMap").bind("mouseout",function(i){var l=$("#myMap");if(i.pageX<=l.offset().left||i.pageX>=l.offset().left+l.width()||i.pageY<=l.offset().top||i.pageY>=l.offset().top+l.height()){D()}else{$("#page_container").bind("mouseenter",function(q){if(q.pageX<l.offset().left||q.pageX>l.offset().left+l.width()||q.pageY<l.offset().top||q.pageY>l.offset().top+l.height()){D();W()}$("#page_container").unbind("mouseenter")})}});$("#tabnav").find("a").removeClass("MSVE_PushPin");X=[];for(j=0,h=V.length;j<h;j++){g=V[j];if(!($.browser.msie&&$.browser.version<7)){e=new VEShape(VEShapeType.Pushpin,g.loc);e.isShadow=true;e.SetCustomIcon('<div class="pushPinShadow"><img src="/images/map/map_pin_shadow.png" border="0" alt="" title="" /></div>');f.push(e);X[g.id]=e}e=new VEShape(VEShapeType.Pushpin,g.loc);e.SetTitle("");e.SetDescription(g.text);e.SetCustomIcon('<span class="pushPin">'+g.index+"</span>");f.push(e);k.push(g.loc);X[g.id]=e}if(H!==null){e=new VEShape(VEShapeType.Pushpin,H.loc);e.SetCustomIcon(H.icon);f.push(e);k.push(H.loc)}a.AddShape(f);a.SetMapView(k);if(Z){if(c){L(c);var p=$(".mapScrollBox tr");for(j=0;j<p.length;j++){var m=$(p[j]);if(m.attr("id")==="hotelRow"+c){$(".mapScrollBox").scrollTop(j*m.height());break}}}else{a.SetCenter(Z)}}setTimeout(hcom.common.modules.map.fixControlWidth,100);$(".mapScrollBox tr.row1").add(".mapScrollBox tr.row2").click(function(){L($(this).attr("id").substring(8));U=true});$(".mapScrollBox tr.row1").add(".mapScrollBox tr.row2").bind("mouseenter",function(){if(!U){M($(this).attr("id").substring(8))}});var n=$.cookie("map_state");if(n){var o=n.split("|");if(o.length>5&&o[5]==="restore"){console.debug("Restoring map state");J=new VELatLong(o[0],o[1]);b=o[4]}else{console.debug("no map state restore needed")}$.cookie("map_state",null)}if(J){a.SetCenterAndZoom(J,b);J=null;b=null}}function G(){if(V===null||V.length===0){return }if(a!==null){a.Dispose()}a=new VEMap("myMap");a.onLoadMap=Y;a.LoadMap();hcom.common.modules.map.fixBirdsEyeView(B);if($.browser.msie&&$.browser.version<7){$("#twoColLeftContainer .mapScrollBox tr").bind("mouseenter",function(e){$(this).toggleClass("hover").find("td.icon").addClass("iconhover").removeClass("icon").end().find("td.star1").css("background-color","#fbd78b").end().find("td.star2").css("background-color","#fbd78b")}).bind("mouseleave",function(e){$(this).toggleClass("hover").find("td.iconhover").removeClass("iconhover").addClass("icon").end().find("td.star1").css("background-color","#f2f2f2").end().find("td.star2").css("background-color","#fff")})}console.debug(T+".contentReloaded")}function P(){if(a){F();d();a.HideInfoBox()}}return{savePickleState:function(){var e=a.GetCenter();var g=a.GetZoomLevel();var f=[e.Latitude,e.Longitude,e.Altitude,e.AltitudeMode,g].join("|");$.cookie("map_state",f);return f},restorePickleState:function(f){var e=f.split("|");b=e[4];J=new VELatLong(e[0],e[1]);a.SetCenterAndZoom(J,b)},init:function(){B=new $.formatter();hcom.search.modules.core.addTemplateListener(T,function(e){console.log("%s.buildTemplate",T);var f=e.getModule("map");C=f.getTemplate("landmark_pushpin");N=f.getTemplate("infobox_cover")});hcom.search.modules.core.addAfterAjaxReqListener(T,I);hcom.search.modules.core.addContentReloadedListener(T,G);hcom.search.modules.core.addBeforeAjaxReqListener(T,P);hcom.search.modules.core.addHashedStateListener(T)},hideInfoBox:P}}});$.registerModule({name:"hcom.search.modules.explanationpopdiv",dependencies:["hcom.search.modules.core","hcom.search.modules.glasspane","hcom.search.modules.queryform"],images:["popdiv_overlay_style_1_top.png","popdiv_overlay_style_1_mid.png","popdiv_overlay_style_1_bottom.png"],imageUrlPrefix:"/images/search/",impl:function(A){var F;function C(){$("#explanationPopDiv").hide();hcom.search.modules.glasspane.hide()}function E(){F.show();hcom.search.modules.glasspane.show()}function D(){C();hcom.search.modules.queryform.visibility.set(true);while($(window).scrollTop()>0){$(window).scrollTop($(window).scrollTop()-10)}}function B(H){var J=H.rel.split("|"),K=hcom.search.modules.filterform,I;J.shift();for(var G=0;G<J.length;G++){I=J[G];if(I.startsWith("name")){K.setName()}else{if(I.startsWith("brand")){K.setBrand()}else{if(I.startsWith("theme")){K.setThemes()}else{if(I.startsWith("breakfast")){K.setBreakFast(false)}else{if(I.startsWith("allinclusive")){K.setAllinclusive(false)}else{if(I.startsWith("landmark")){K.setLandmark()}else{if(I.startsWith("distance")){K.setDistance(I.substring(I.indexOf(",")+1))}else{if(I.startsWith("starrating")){K.setStarRatings()}else{if(I.startsWith("facility")){K.setFacilities()}else{K.removeAllOptions()}}}}}}}}}}$("#explanationPopDiv").hide();hcom.search.modules.core.reload({url:H.href+"&ajax=true",cause:hcom.search.modules.core.reloadCauses.select})}return{init:function(){$.listen("click","#lnk_explain",function(G){E();G.preventDefault();return false});$.listen("click","a.lnk_changetraveldates",function(G){D();G.preventDefault();return false});$.listen("click","a.backout",function(G){B(this);G.preventDefault();return false});hcom.search.modules.core.addAfterAjaxReqListener(A,function(G){$("#explanationPopDivHolder").html(G.$response.find("#explanation_popdiv").text());F=$("#explanationPopDiv");F.find(".close").click(function(H){C();H.preventDefault();return false})})}}}});$.registerModule({name:"hcom.search.pages.common",dependencies:["hcom.common.pages.common","hcom.common.modules.ajax","hcom.search.modules.cookie"]});$.registerModule({name:"hcom.search.pages.listview",dependencies:["hcom.search.modules.core","hcom.search.modules.core.ajax","hcom.search.pages.common","hcom.search.modules.neighbourhoodpopdiv","hcom.search.modules.interstitial","hcom.search.modules.hotelimagepopdiv","hcom.search.modules.hotelimagepopdiv.ajax","hcom.search.modules.namesearch","hcom.search.modules.namesearch.ajax","hcom.search.modules.filterform","hcom.search.modules.filterform.ajax","hcom.search.modules.checkavailabilitydialog","hcom.search.modules.checkavailabilitydialog.ajax","hcom.search.modules.queryform","hcom.search.modules.queryform.ajax","hcom.search.modules.explanationpopdiv","hcom.search.modules.sortcontrol","hcom.search.modules.sortcontrol.ajax"],images:["overlay_px_1.png"],imageUrlPrefix:"/images/search/",impl:function(){return{init:function(){console.info("MVT 22 variant 0");hcom.common.modules.events.attachAllEvents();hcom.search.modules.core.scriptLoad();$.cookie("map_state",null)}}}});$.registerModule({name:"hcom.search.pages.mapview",dependencies:["hcom.search.modules.core","hcom.search.modules.core.ajax","hcom.search.pages.common","hcom.search.modules.neighbourhoodpopdiv","hcom.search.modules.interstitial","hcom.search.modules.map","hcom.search.modules.namesearch","hcom.search.modules.namesearch.ajax","hcom.search.modules.filterform","hcom.search.modules.filterform.ajax","hcom.search.modules.checkavailabilitydialog","hcom.search.modules.checkavailabilitydialog.ajax","hcom.search.modules.queryform","hcom.search.modules.queryform.ajax","hcom.search.modules.explanationpopdiv","hcom.search.modules.sortcontrol","hcom.search.modules.sortcontrol.ajax"],impl:function(){return{init:function(){console.info("MVT variant 0");hcom.common.modules.events.attachAllEvents();hcom.search.modules.core.scriptLoad()}}}});$.registerModule({name:"hcom.search.pages.listview.1",dependencies:["hcom.common.pages.common","hcom.search.modules.sortcontrol","hcom.search.modules.filterform"],impl:function(){return{init:function(){console.info("MVT variant 1");hcom.common.modules.events.attachSubmitChange($("#footerChangeCurrencyForm").add("#footerChangeCountryForm"));hcom.search.modules.filterform.initStatic();$.cookie("map_state",null)}}}});$.registerModule({name:"hcom.search.pages.listview.2",dependencies:["hcom.search.pages.common","hcom.search.modules.queryform","hcom.search.modules.hotelimagepopdiv","hcom.search.modules.namesearch","hcom.search.modules.sortcontrol","hcom.search.modules.filterform","hcom.search.modules.glasspane","hcom.search.modules.checkavailabilitydialog"],impl:function(){return{init:function(){console.info("MVT variant 2");hcom.common.modules.events.attachSubmitChange($("#footerChangeCurrencyForm").add("#footerChangeCountryForm"));$.cookie("map_state",null);hcom.search.modules.filterform.initStatic();hcom.search.modules.checkavailabilitydialog.initStatic();hcom.search.modules.core.scriptLoad();hcom.search.modules.glasspane.initStatic().hide()}}}});$.registerModule({name:"hcom.search.pages.advsearch",dependencies:["hcom.common.pages.common","hcom.search.modules.basicinput"],impl:function(B){var A;function D(){A.initState($("#mainContainerSize1"),true).attachEvents()}function C(E,G){var F=$("#search_tab_destination");if(E===1||G===1){if(G===1){F.show()}else{F.hide()}}}return{init:function(){hcom.common.modules.events.attachAllEvents();A=new hcom.search.modules.basicinput("adv",true,{tabClicked:C});A.loadPartial(D)}}}});$.registerModule({name:"hcom.search.pages.advsearch_mvt_27_1",dependencies:["hcom.common.pages.common","hcom.search.modules.basicinput","hcom.search.pages.advsearch.autosuggest"],impl:function(B){var A;function D(){A.initState($("#mainContainerSize1"),true).attachEvents()}function C(E,G){var F=$("#search_tab_destination");if(E===1||G===1){if(G===1){F.show()}else{F.hide()}}}return{init:function(){hcom.common.modules.events.attachAllEvents();A=new hcom.search.modules.basicinput("adv",true,{tabClicked:C},{isAutoCompleteOn:false});A.loadPartial(D)}}}});$.registerModule({name:"hcom.landing.pages.landing.hmvt_27_1_queryform",dependencies:["hcom.landing.pages.landing.basic","hcom.common.modules.state","hcom.search.modules.basicinput","hcom.landing.modules.autosuggest"],impl:function(A){function B(){var C=$("#queryForm"),D;if(C.length){D=new hcom.search.modules.basicinput("",false,{},{isAutoCompleteOn:false});D.loadPartial(function(){D.initState($("#queryForm"),true).attachEvents(false)})}}return{init:function(){B();$("#moreSearchOptions").click(function(E){E.preventDefault();var D=hcom.common.modules.state.formSerialize($("#searchForm")),C=[];for(var F in D){if(D.hasOwnProperty(F)&&D[F]!==null){if(String===D[F].constructor&&$.trim(D[F]).length>0){C.push("&"+F+"="+D[F])}else{if(Array===D[F].constructor&&D[F].length>0){C.push("&"+F+"="+D[F].join(","))}}}}window.location="/search.do?advanced=true"+C.join("");return false})}}}});$.registerModule({name:"hcom.search.pages.disambiguation",dependencies:["hcom.common.pages.common","hcom.search.modules.basicinput"],impl:function(B){var A;function C(){A.initState($("#mainContainerSize1")).attachEvents(false)}return{init:function(){hcom.common.modules.events.attachAllEvents();A=new hcom.search.modules.basicinput("da",true);A.loadPartial(C)}}}});$.registerModule({name:"hcom.hotel_details.pages.common",dependencies:["hcom.common.pages.common","hcom.hotel_details.modules.core","hcom.hotel_details.modules.tabmanager","hcom.hotel_details.modules.photos","hcom.hotel_details.modules.yourhotels","hcom.hotel_details.queryform"]});$.registerModule({name:"hcom.hotel_details.modules.checkavailabilitydialog",dependencies:["hcom.common.modules.checkavailabilitydialog"],impl:function(A){var B=$("#checkAvailabilityHolder");var C=$.extendCls(hcom.common.modules.checkavailabilitydialog,{constructor:function(F,G,E,D){if($.browser.mozilla){B.find("select").each(function(){var H=$(this);H.html(H.html())})}C.superclass.constructor.call(this,F,G,E,D)},submitForm:function(){B.find("form:first").submit()}});C.init=function(){};return C}});$.registerModule({name:"hcom.hotel_details.modules.hdimagepopdiv",dependencies:["hcom.common.modules.hotelimagepopdiv"],impl:function(C){var F,A,B=1,D=2,E=3,G=4;F=$.extendCls(hcom.common.modules.hotelimagepopdiv,{constructor:function(I){I=$.extend({},A,I);F.superclass.constructor.call(this,I);this.$popupPlate=($.browser.msie&&($.browser.version<7))?$("#popupPlate"):null;this.tailClasses=[this.tailPosition.top_left,this.tailPosition.bottom_left,this.tailPosition.middle_left,this.tailPosition.top_right,this.tailPosition.bottom_right,this.tailPosition.middle_right,this.tailPosition.top_middle,this.tailPosition.bottom_middle].join(" ");this.$captionBar=$(this.config.captionSelect);this.existsCaptionBar=this.$captionBar.length>0;if(this.config.cross_sell){var H=this;$("#popDivFullDescription").click(function(){var J=H.hotelId===2,K=H.hotelId===3;if(J||K){H.config.cross_sell.sendReport("click",J,K)}})}},calculatePopDivPosition:function(T){var e,d,Q=T.offset(),g=Q.left,c=Q.top,W=g+this.thumbDim.width,f=c+this.thumbDim.height,I=$(window).height(),V=$(window).width(),L=$(document).scrollTop(),b=$(document).scrollLeft(),O=L+I,N=b+V,Z=c+Math.round(this.thumbDim.height/2),P=g+Math.round(this.thumbDim.height/2),U=Math.round(this.popDivDim.height/2),J=Math.round(this.popDivDim.width/2),K=g-b,X=c-L,M=b+V-W,R=L+I-f,S,Y,a;if(M>this.popDivDim.width){Y=D}else{if(K>this.popDivDim.width){Y=B}else{if(X>this.popDivDim.height){Y=E}else{if(R>this.popDivDim.height){Y=G}else{var H=Math.max(Math.max(M,K),Math.max(X,R));if(X>=H){Y=E}else{if(R>=H){Y=G}else{if(M>=H){Y=D}else{Y=B}}}}}}}switch(Y){case D:if(O-Z<U&&c-L>this.popDivDim.height){e=c-this.popDivDim.height;d=W-5;S=this.tailPosition.bottom_left}else{if(Z-L<U&&O-f>this.popDivDim.height){e=f-20;d=W-5;S=this.tailPosition.top_left}else{e=Z-U-10;d=W-5;S=this.tailPosition.middle_left}}a=this.alignments.right;break;case B:if(O-Z<U&&c-L>this.popDivDim.height){e=c-this.popDivDim.height;d=g-this.popDivDim.width+10;S=this.tailPosition.bottom_right}else{if(Z-L<U&&O-f>this.popDivDim.height){e=f-20;d=g-this.popDivDim.width+10;S=this.tailPosition.top_right}else{e=Z-U-10;d=g-this.popDivDim.width+10;S=this.tailPosition.middle_right}}a=this.alignments.left;break;case E:e=c-this.popDivDim.height;d=P-J;S=this.tailPosition.bottom_middle;a=this.alignments.top;break;case G:e=f-10;d=P-J;S=this.tailPosition.top_middle;a=this.alignments.bottom;break}return{top:e,left:d,width:this.popDivDim.width,height:this.popDivDim.height,thumbTop:Q.top,thumbLeft:Q.left,thumbWidth:this.thumbDim.width,thumbHeight:this.thumbDim.height,alignment:a,tail:S}},setPhotoCaption:function(H){if(H!==undefined){this.$captionBar.text(H)}},onSlideStart:function(){var H=this.config.store.get(this.hotelId);if(this.existsCaptionBar&&H.imgCaptions){this.setPhotoCaption(H.imgCaptions[0])}F.superclass.onSlideStart.call(this)},onSlideChange:function(J,H){var I=this.config.store.get(this.hotelId);if(this.existsCaptionBar&&I.imgCaptions){this.setPhotoCaption(I.imgCaptions[H])}F.superclass.onSlideChange.call(this,J,H)},onThumbnailHoover:function(J,I,H){if(this.config.beforeThumbnailHoover){this.config.beforeThumbnailHoover.call(this,I)}F.superclass.onThumbnailHoover.call(this,J,I,H)},popDivDestroy:function(H,I){if(this.$popupPlate){this.$popupPlate.hide()}F.superclass.popDivDestroy.call(this,H,I)},tailPosition:{top_left:"tail_top_left",bottom_left:"tail_bottom_left",middle_left:"tail_left",top_right:"tail_top_right",bottom_right:"tail_bottom_right",middle_right:"tail_right",top_middle:"tail_top",bottom_middle:"tail_bottom"},plateOffsets:{top:22,left:17,width:-27,height:-16},setTail:function(H){this.$popDiv.children("div:first").removeClass(this.tailClasses).addClass(H.tail);this.tailId=H.tail}});F.init=function(){A={captionSelect:"#imgCaption"}};return F}});$.registerModule({name:"hcom.hotel_details.modules.core",dependencies:["hcom.hotel_details.modules.hoteldata","hcom.common.modules.checkavailabilitydialog","hcom.hotel_details.modules.checkavailabilitydialog"],impl:function(B){var A;function D(){A=new $.formatter(hcom.landing.data.staticMessages);A.setGlobal()}function C(){if($("#checkAvailabilityHolder").length>0){var G;G=new hcom.hotel_details.modules.checkavailabilitydialog("ca",false,null,{containerSelector:"#page_container",roomSelector:"select[name=roomno]:first"});G.attachEvents();G.buildTemplate(hcom.common.template.buildJson(hcom.landing.data.staticTemplates));hcom.search.modules.glasspane.initStatic().hide()}}function E(){$("a.JS_toggle_next").click(function(H){var I=$(this),G=I.find(".icon_sprite_open_close > span");if(G.hasClass("closed")){I.next().show("slow");G.removeClass("closed");G.addClass("opened")}else{I.next().hide("slow");G.removeClass("opened");G.addClass("closed")}H.preventDefault()})}function F(){if($.browser.safari){$("a.favorites").remove()}else{$("a.favorites").click(function(G){if(!$.browser.opera){G.preventDefault()}$.bookmark(".propertydetails_toolbar a.favorites")})}}return{init:function(){D();C();E();F();hcom.hotel_details.modules.hoteldata.loadHotelData()}}}});$.registerModule({name:"hcom.hotel_details.modules.hoteldata",dependencies:["hcom.hotel_details.modules.cross_sell","hcom.hotel_details.modules.ta_photo","hcom.hotel_details.modules.ta_review","hcom.hotel_details.modules.expedia_review"],impl:function(A){var C,J,B,E,F={},H;function G(K){if(K!==null){$.ajax({url:K.url,dataType:"xml",type:"GET",data:K.data,success:function(L){K.success.call(K,$(L))},complete:function(M,L){K.complete.call(K,M,L);K=null},error:function(M,N,L){K.error.call(K,M,N,L)}})}}function I(P){$("body:first").append(P);var K=$("#imagePopDiv"),M,O,N,L;if($.browser.msie){M=$("#popdiv_workdiv_ie");O=K.find(".caption_bar:first");N=K.find(".description_link:first");L=K.find(".tripadvisor_logo:first")}return new hcom.hotel_details.modules.hdimagepopdiv({$container:K,clickFilter:"a.hotelDetailsPhoto",store:new hcom.common.modules.hotelimagepopdiv.JSONStore({data:F}),beforeThumbnailHoover:function(R){var Q="hcom_popdiv_tripadvisor";if(R.hasClass("cross_sell")){if(M){M.find(".buttonBorder1:first").appendTo(N);L.find("div.tripadvisor:first").appendTo(M);O.find("div.message:first").appendTo(M)}K.removeClass(Q)}else{if(M){N.find(".buttonBorder1:first").appendTo(M);M.find(".message:first").appendTo(O);M.find(".tripadvisor:first").appendTo(L)}K.addClass(Q)}},cross_sell:C})}function D(){try{H=hcom.hotel_details.data.additionalDataUrl}catch(K){H="/hotel/hoteldata.html"}C=new hcom.hotel_details.modules.cross_sell();J=new hcom.hotel_details.modules.ta_photo();B=new hcom.hotel_details.modules.ta_review();E=new hcom.hotel_details.modules.expedia_review();G({url:H,data:{},success:function(T){var Q=T.find("cross-sell"),M=Q.children("html-content"),W=T.find("photo-popdiv"),L=T.find("venere-desc"),O,U;if(W.length>0){U=W.text()}if(M.length>0){O=M.text()}if(O&&U){C.start(O,Q.children("cross-sell-data"),Q.children("up-sell-data"));$.extend(F,C.hotels)}var b=T.find("trip-advisor"),a=b.children("photo-trigger"),Y=b.children("ta-reviews-trigger"),Z=b.children("trip-advisor-photos"),R=T.find("expedia-reviews-trigger"),S=T.find("expedia-reviews-toppanel-trigger"),X=b.children("hotel-name").text(),c,V,N,P;if(a.length>0){c=a.text()}if(Y.length>0){V=Y.text()}if(R.length>0){N=R.text()}if(S.length>0){P=S.text()}if(c&&U){J.start(c,Z,X);$.extend(F,J.hotels)}if(V){B.start(V)}if(N){E.start(N,".property_details_review_expedia")}if(P){E.start(P,".property_details_review_toppanel_expedia")}if(U&&(C.started||J.started)){I(U)}if(L.length>0){$(".venere_desc .venere_more_desc").append(L.text());$(".venere_more_desc a.toggle_link").click(function(e){var f=$(this),d=f.find(".closed");d.removeClass("closed");d.addClass("opened");f.next().show("slow",function(){f.remove()});e.preventDefault()})}},complete:function(M,L){},error:function(M,N,L){}})}return{loadHotelData:D}}});$.registerModule({name:"hcom.hotel_details.modules.cross_sell",dependencies:["hcom.common.modules.sitecatalyst"],impl:function(B){function A(C){this.verticalClass="propertydetails_widgets";$.extend(this,C);this.$crossSell=$(".property_details_crosssell .crosssell_content");this.vertical=this.$crossSell.parent().hasClass(this.verticalClass);this.hotels={};this.started=false;return this}A.prototype={start:function(J,E,I){this.started=true;var C=[],F=[];E.children("photos").children("photo-url").each(function(){C.push($.trim($(this).text()))});I.children("photos").children("photo-url").each(function(){F.push($.trim($(this).text()))});var G=C.length>0,H=F.length>0;if(G){$.extend(this.hotels,{2:{name:$.trim(E.children("name").text()),imgURLs:C,href:$.trim(E.children("hotel-url").text())}})}if(H){$.extend(this.hotels,{3:{name:$.trim(I.children("name").text()),imgURLs:F,href:$.trim(I.children("hotel-url").text())}})}this.$crossSell.html(J);if(this.vertical){this.$crossSell.find(".crosssell_module_last").removeClass("crosssell_module_last")}else{this.$crossSell.find(".divider").remove()}this.$crossSell.removeClass("hidden");this.sendReport("show",G,H);var D=this;$(".hotel_upsell_link").click(function(K){D.sendReport("click",false,true)});$(".hotel_crosssell_link").click(function(K){D.sendReport("click",true,false)})},sendReport:function(D,E,F){var C;if(D==="show"){if(E&&F){C="cross sell and upsell property shown"}else{if(E){C="cross sell property shown"}else{if(F){C="upsell property shown"}}}}else{if(D==="click"){if(E){C="cross sell property clicked"}else{if(F){C="upsell property clicked"}}}}if(C){hcom.common.modules.sitecatalyst.sendPartialReport({eVar33:hcom.hotel_details.modules.tabmanager.getPageName(),prop33:C},null,C)}}};A.init=function(){};return A}});$.registerModule({name:"hcom.hotel_details.modules.ta_photo",dependencies:["hcom.common.modules.emitter","hcom.common.modules.slideshow","hcom.common.modules.popdiv","hcom.common.modules.searchpopdiv","hcom.common.modules.hotelimagepopdiv","hcom.hotel_details.modules.hdimagepopdiv"],impl:function(B){function A(C){$.extend(this,C);this.$taPhoto=$(".property_details_photo_tripadvisor");this.started=false;return this}A.prototype={start:function(E,D,C){this.started=true;var G=[],F=[];D.children().each(function(){var H=$(this);G.push(H.children("url").text());F.push(H.children("caption").text())});if(G.length>0){this.hotels={1:{name:C,imgURLs:G,imgCaptions:F}};this.$taPhoto.html(E);this.$taPhoto.removeClass("hidden")}}};A.init=function(){};return A}});$.registerModule({name:"hcom.hotel_details.modules.ta_review",impl:function(A){function B(C){$.extend(this,C);this.$taReview=$(".property_details_review_tripadvisor");this.started=false;return this}B.prototype={start:function(C){this.started=true;this.$taReview.html(C);this.$taReview.removeClass("hidden")}};B.init=function(){};return B}});$.registerModule({name:"hcom.hotel_details.modules.expedia_review",impl:function(B){function A(C){$.extend(this,C);this.started=false;return this}A.prototype={start:function(D,C){this.started=true;this.$expediaReview=$(C);this.$expediaReview.html(D);this.$expediaReview.removeClass("hidden")}};A.init=function(){};return A}});$.registerModule({name:"hcom.hotel_details.modules.photos",impl:function(B){var C,D,E,K=400,J=2000,I,F=1;function A(){return $(".top_panel").filter(function(){var L=$(this);return L.hasClass("photos")&&!L.hasClass("hidden")})}function H(){D=A();if(D.length>0){var M=D.find(".content a"),L=D.find(".content img");L.fadeOut(K,function(){$.preloadAsyncImage(E[F].href,function(N,O){if(!N&&O){L.remove();M.css("display","none");M.append(O);L=M.find("img");L.css("display","none");M.css("display","block");L.fadeIn(K,function(){F++;if(F>=I){F=0}D=A();if(D.length>0){setTimeout(function(){H()},J)}})}})})}}function G(){E=$(".thumbnail_photos li a");if(E.length>1){I=E.length;setTimeout(function(){H()},J)}}return{init:function(){C=$(".large_photo img");D=A();if(D.length>0){G()}$(".thumbnail_photos a").click(function(L){C.attr("src",this.href);L.preventDefault()})}}}});$.registerModule({name:"hcom.hotel_details.modules.yourhotels",impl:function(A){return{init:function(){var B=$(".propertydetails_toolbar a").filter(function(){var C=false;if($(this).find("span:first-child").hasClass("save")){C=true}return C});B.click(function(C){$.ajax({url:B.attr("href"),success:function(){B.remove();$(".propertydetails_toolbar .icon_sprite_toolbar strong").removeClass("hidden")}});C.preventDefault()})}}}});$.registerModule({name:"hcom.hotel_details.modules.tabmanager",dependencies:["hcom.common.modules.adbanner","hcom.common.modules.sitecatalyst","hcom.hotel_details.modules.map"],impl:function(M){var L,U="tab_inactive",R={description:{name:"description",tabselector:"div.tabs li.description",pageName:{landing:"Hotel Details Landing Description Tab",dateless:"hotel details without dates description tab",dateful:"hotel details page description tab"}},photos:{name:"photos",tabselector:"div.tabs li.photos",pageName:{landing:"Hotel Details Landing Photos Tab",dateless:"hotel details without dates photos tab",dateful:"hotel details page photos tab"}},maps:{name:"maps",tabselector:"div.tabs li.maps",pageName:{landing:"Hotel Details Landing Maps Tab",dateless:"hotel details without dates maps tab",dateful:"hotel details page maps tab"},activate:function(){try{hcom.hotel_details.modules.map.initMap()}catch(V){setTimeout(arguments.callee,500)}}},reviews:{name:"reviews",tabselector:"div.tabs li.reviews",pageName:{landing:"Hotel Details Landing Ratings Tab",dateless:"hotel details without dates ratings tab",dateful:"hotel details page ratings tab"}},prices:{name:"prices",tabselector:"div.tabs li.prices",pageName:{dateful:"hotel details page prices tab"}}},D=R.description,S=false,G=false,B,T,E,Q,A=$(".page_header a.site_feedback:first");function O(){B.each(function(){var V=$(this);if(V.hasClass(D.name)){V.removeClass(U)}else{V.addClass(U)}});$("div.tabs li.active_tab").removeClass("active_tab");$("div.tabs li."+D.name).addClass("active_tab")}function C(W){if(W.activate){try{W.activate()}catch(V){console.error("error activating tab: "+D.name);console.dir(V)}}}function I(W){var V=false;if(R.prices.name===R[W].name){$("#hotel_details_price_guarantee").css("cursor","default")}else{$("#hotel_details_price_guarantee").css("cursor","pointer")}if(R.prices.name===R[W].name){$("#hotel_details_price_guarantee").css("cursor","default")}else{$("#hotel_details_price_guarantee").css("cursor","pointer")}if(W&&R[W]&&R[W].enabled){D=R[W];V=true;O();C(D)}return V}function H(V){Q.each(function(){var W=$(this);if(W.hasClass(R[V].name)){W.addClass("hidden")}else{W.removeClass("hidden")}})}function F(){var V;switch(hcom.hotel_details.data.pageType){case"dateless":V=D.pageName.dateless;break;case"dateful":V=D.pageName.dateful;break;default:V=D.pageName.landing;break}return V}function N(){try{hcom.common.modules.sitecatalyst.sendPartialReport({pageName:F()},"prodview","tab changed to "+D.name+" tab")}catch(V){}}function K(){$.iterate(R,function(X,W){var V=$(X.tabselector);if(V.length>0){X.enabled=true}})}function J(){if(D.name==="prices"){E.removeClass("hidden");T.addClass("hidden")}else{if(D.name==="description"){T.removeClass("hidden");E.addClass("hidden")}}}function P(V){if(location.hash!==""){if(!I(V)){location.hash=D.name;if($.browser.msie){P(D.name)}}else{if(L!==V){L=V;hcom.common.modules.adbanner.reloadAdBanners();if(S){if(!G){$(".top_panel_mpu div:first").appendTo($("#MpuAdId"));G=true}Q.remove()}else{H(L)}J();$(window).scrollTop(0);A.attr("href",$.format(hcom.hotel_details.data.feedbackHref,F()));N()}}}S=true}return{init:function(){R.ratings=R.reviews;var V=D.name;try{V=hcom.hotel_details.data.serverSideTab}catch(W){}$("div.tabs li."+V).addClass("active_tab");if(!location.hash&&R[V]){C(R[V])}if(!$("#property_details_tab_content_reviews").hasClass("pagination_page")){K();B=$(".tab");Q=$(".top_panel");$("a.tab_title").each(function(){var X=$(this);X.replaceWith(X.html())});T=$(".property_details_module_title .guestrooms_title");E=$(".property_details_module_title .select_rooms_title");$.historyInit(P);if($.browser.msie||$.browser.safari){$("div.tabs a").add(".bottom_tab a").add(".top_panel a").add("a.guestRatingLink").add(".propertydetails_price a").click(function(X){$.historyLoad(this.hash.replace(/^#/,""));X.preventDefault()})}}},getPageName:F}}});$.registerModule({name:"hcom.hotel_details.modules.map",dependencies:["hcom.common.modules.map"],impl:function(B){var C;function A(){try{var E=$("meta[name=geo.position]").attr("content").split(","),G=new VELatLong(E[0],E[1]),D=new $.formatter(),H=new VEMap("myMap");VEPushpin.ShowDetailOnMouseOver=false;H.onLoadMap=function(){if(!($.browser.msie&&$.browser.version<7)){H.AddPushpin(new VEPushpin("VEPushpinShadow",G,"/images/map/map_pin_shadow.png"))}H.AddPushpin(new VEPushpin("VEPushpin",G,"/images/map/map_pin_hotel_active.png","","","iconStyle"));H.SetMapView([G]);H.SetZoomLevel(16);hcom.common.modules.map.localizeControls(D);H.AttachEvent("onobliqueenter",function(){setTimeout(function(){hcom.common.modules.map.localizeControls(D)},200)});hcom.common.modules.map.fixBirdsEyeView(D);setTimeout(function(){hcom.common.modules.map.fixControlWidth()},300)};H.LoadMap();C=true}catch(F){setTimeout(arguments.callee,500)}}return{initMap:function(){if(!C){if(window.VEPushpin){A()}else{$.requireJs("",function(){setTimeout(function(){A()},300)})}}}}}});$.registerModule({name:"hcom.hotel_details.queryform",dependencies:["hcom.search.modules.basicinput"],impl:function(B){var A;function C(){var E=$("#hotelDetailsForm"),F=$("div.searchModuleClosed");if($.browser.mozilla){E.find("select").each(function(){var G=$(this);G.html(G.html())})}A.initState($("#queryForm"),true).attachEvents(false);F.click(function(){F.hide();E.show()});$("span.search_changeLinkContainer").click(function(){F.show();E.hide()});$("#changeSearch").click(function(G){G.preventDefault();return true})}function D(E){if(!E.match("^searchParams")){E="searchParams."+E}return E}return{init:function(){A=new hcom.search.modules.basicinput("",false,null,{roomSelector:"select[name=roomno]:first"});A.setTemplates(hcom.common.template.buildJson(hcom.landing.data.staticTemplates));C();var H=$("#queryForm").find("input[name=destination]"),E=0,G=false;H.keypress(function(I){G=true});var F=$("#hotelDetailsForm");F.submit(function(K){if(G){F.attr("action","/search.do");var L=F.find("select").filter(function(){var M=false,N=$(this).attr("id");if(N.match(new RegExp(".*search_room_.*_.*","i"))){M=true}return M});L.each(function(M){$(this).attr("name",D($(this).attr("name")))});var J=F.find("#search_checkIn"),I=F.find("#search_checkOut");J.attr("name",D(J.attr("name")));I.attr("name",D(I.attr("name")));G=false}})}}}});$.registerModule({name:"hcom.landing.modules.common",dependencies:["hcom.common.template","hcom.common.pages.common","hcom.common.modules.calendar","hcom.landing.modules.topratedhotel","hcom.common.modules.ie6popupplate","hcom.common.modules.slideshow","hcom.common.modules.popdiv","hcom.common.modules.checkavailabilitydialog","hcom.landing.modules.checkavailabilitydialog","hcom.common.modules.searchpopdiv","hcom.common.modules.hotelimagepopdiv","hcom.landing.modules.hotelimagepopdiv","hcom.landing.modules.emailtofriend","hcom.landing.modules.socialbookmark","hcom.landing.modules.basicinput","hcom.landing.modules.querymodule"],impl:function(D){var B;function G(){B=new $.formatter(hcom.landing.data.staticMessages);B.setGlobal()}function E(){if(hcom.landing.data&&hcom.landing.data.popdiv){return new hcom.landing.modules.hotelimagepopdiv({$container:$("#imagePopDiv"),clickFilter:"a.hotelDetailsPhoto",store:new hcom.common.modules.hotelimagepopdiv.JSONStore({data:hcom.landing.data.popdiv})})}}function C(){return new hcom.landing.modules.emailtofriend({titlebar:"div.citylanding_titlebar:first",popdiv:"div.citylanding_emailfriend:first",z_index:"4"})}function A(){return new hcom.landing.modules.socialbookmark({titlebar:"div.citylanding_titlebar:first",popdiv:"div.city_landing_social_bookmarks:first",z_index:"4"})}function H(){if($.browser.safari){$("a.favorites").remove()}else{$("a.favorites").click(function(I){if(!$.browser.opera){I.preventDefault()}$.bookmark(".icon_sprite_toolbar a.favorites")})}}function F(){var I;I=new hcom.landing.modules.checkavailabilitydialog("ca");I.attachEvents();I.buildTemplate(hcom.common.template.buildJson(hcom.landing.data.staticTemplates));hcom.search.modules.glasspane.initStatic().hide()}return{init:function(){G();E();C();A();H();F()}}}});$.registerModule({name:"hcom.landing.modules.map",dependencies:["hcom.common.modules.map"],impl:function(B){function A(){var E=new VELatLong(Lat,Lon),F=new VEMap("myMap"),D=new $.formatter();VEPushpin.ShowDetailOnMouseOver=false;F.onLoadMap=function(){F.AddPushpin(new VEPushpin(0,E,"/images/map/hotel_icon.gif","","","iconStyle"));F.SetMapView([E]);F.SetZoomLevel(16);hcom.common.modules.map.localizeControls(D);F.AttachEvent("onobliqueenter",function(){setTimeout(function(){hcom.common.modules.map.localizeControls(D)},200)});hcom.common.modules.map.fixBirdsEyeView(D);setTimeout(function(){hcom.common.modules.map.fixControlWidth()},300)};F.LoadMap()}function C(){if(VEMap){A()}else{setTimeout(C,500)}}return{init:C}}});$.registerModule({name:"hcom.landing.modules.checkavailabilitydialog",dependencies:["hcom.common.modules.checkavailabilitydialog","hcom.search.modules.basicinput"],impl:function(A){var B=$.extendCls(hcom.common.modules.checkavailabilitydialog,{constructor:function(C){B.superclass.constructor.call(this,C)},submitForm:function(){$("#checkAvailabilityHolder").find("form:first").attr("action","/search.do").find("input[name=searchParams.hotelId]").val(this.hotelid).end().submit()},attachEvents:function(){var C=this;$("a.hcomCheckAvailability","div.citylanding_hlist").listen("click","span",function(D){C.open(D)});B.superclass.attachEvents.call(this)}});B.init=function(){};return B}});$.registerModule({name:"hcom.landing.modules.hotelimagepopdiv",dependencies:["hcom.common.modules.hotelimagepopdiv"],impl:function(B){var A=$.extendCls(hcom.common.modules.hotelimagepopdiv,{getGadgetsFromThumb:function(D){var C=D.parents("div:first");return{$promptIcon:C.find("div.popdiv_prompt_icon:first"),$overlay:C.find("div.overlay:first")}},popDivSetThumbOverlayAnim:function(C,E){var D=E.parent().parent().find("img.animation:first");D[C?"show":"hide"]()}});A.init=function(){};return A}});$.registerModule({name:"hcom.landing.modules.neighbourhoodmap",dependencies:["hcom.search.modules.core"],impl:function(C){var D;function B(F){var G=F.target,E;if(this.mapData.hasOwnProperty(G.id)){E=this.mapData[G.id]&&this.mapData[G.id].mapURL;if(E){this.$mapContainer.attr("src",E)}}}function A(){if(this.active){this.$mapContainer.attr("src",this.activeNeighbourhoodMapUrl)}else{this.$mapContainer.attr("src",this.originalNeighbourhoodMapUrl)}}D=function(E){this.$mapContainer=$(E.mapContainer);this.mapData=hcom.landing.data.neighbourhoodmap;this.activeNeighbourhoodMapUrl="";this.originalNeighbourhoodMapUrl="";this.originalNeighbourhoodMapUrl=this.$mapContainer.attr("src")};D.prototype={registerEvents:function(){var E=this;$.listen("mouseover","area.nhoodCoords",function(F){B.call(E,F)});$.listen("mouseout","area.nhoodCoords",function(F){A.call(E)})}};return D}});$.registerModule({name:"hcom.landing.modules.neighbourhoodinline",dependencies:["hcom.search.modules.core","hcom.landing.modules.neighbourhoodmap"],impl:function(A){var C;function D(E){this.$headerTitle.empty();this.$headerTitle.append(this.mapData[E].title);this.$seeAllLink.empty();this.$seeAllLink.append("See all hotels in "+this.mapData[E].title);this.$seeAllLink.parent().attr("href",this.mapData[E].seeAllHref);this.$descriptionHolder.empty();this.$descriptionHolder.append(this.mapData[E].descripton);this.active=true;this.activeNeighbourhoodMapUrl=this.$mapContainer.attr("src")}function B(E){E.preventDefault();D.call(this,E.target.id)}C=$.extendCls(hcom.landing.modules.neighbourhoodmap,{constructor:function(E){this.$headerTitle=$(E.headerTitle);this.$descriptionHolder=$(E.descriptionHolder);this.$seeAllLink=$(E.seeAllLink);this.active=false;C.superclass.constructor.call(this,{mapContainer:E.mapContainer,mapData:E.mapData});this.registerEvents()},registerEvents:function(){var E=this;$.listen("click","area.nhoodCoords",function(F){B.call(E,F)});C.superclass.registerEvents.call(this)}});return C}});$.registerModule({name:"hcom.landing.modules.neighbourhoodpopup",dependencies:["hcom.search.modules.core","hcom.landing.modules.neighbourhoodmap"],impl:function(B){var A;function D(F){this.$popup.show();this.$headerTitle.empty();this.$headerTitle.append(this.mapData[F].title);this.$descriptionHolder.empty();this.$descriptionHolder.append(this.mapData[F].descripton);this.$seeAllLink.empty();this.$seeAllLink.append("See all hotels in "+this.mapData[F].title);this.$seeAllLink.parent().attr("href",this.mapData[F].seeAllHref);this.active=true}function E(F){F.preventDefault();this.$mapContainer.attr("src",this.originalNeighbourhoodMapUrl);this.$popup.hide();this.active=false}function C(F){F.preventDefault();D.call(this,F.target.id);this.activeNeighbourhoodMapUrl=this.$mapContainer.attr("src")}A=$.extendCls(hcom.landing.modules.neighbourhoodmap,{constructor:function(F){this.$mapContainer=$(F.mapContainer);this.$headerTitle=$(F.headerTitle);this.$descriptionHolder=$(F.descriptionHolder);this.$seeAllLink=$(F.seeAllLink);this.$popup=$(F.popup);A.superclass.constructor.call(this,{mapContainer:F.mapContainer,mapData:F.mapData});this.registerEvents()},registerEvents:function(){var F=this;$.listen("click","area.nhoodCoords",function(G){C.call(F,G)});$.listen("click","a.close_button",function(G){E.call(F,G)});$.listen("click","a.close_link",function(G){E.call(F,G)});A.superclass.registerEvents.call(this)}});return A}});$.registerModule({name:"hcom.landing.modules.emailtofriend",dependencies:["hcom.common.modules.state","hcom.common.modules.ie6popupplate"],impl:function(C){var A,B,D;var E=500;B=function(){var H="has_error",I="error",J=$("table.tail_top_middle_right",this.$popdiv),G=J.hasClass(H);function F(){$("label",J).add($("input",J)).removeClass(I)}function K(N,M){var L;F();if(N!==G){G=N;L=N?"addClass":"removeClass";J.toggleClass(H)}if(G&&M){$.each(M,function(){$("label[for="+this+"]",J).add($("input#"+this,J)).addClass(I)})}}return{set:K,reset:function(){if(G){K(!G)}}}}();D=function(){var G=$("#emailfriend_form").add("#emailfriend_success"),H=true;function F(){H=!H;G.toggle()}return{toggle:F,reset:function(){if(!H){F()}}}}();A=$.extendCls(hcom.common.modules.ie6popupplate,{constructor:function(F){this.$titlebar=$(F.titlebar);this.$popdiv=$(F.popdiv,this.$titleBar);this.$errorContainer="";this.$successContainer="";this.$counterLeftChars=$("p.char_counter span#char_counter_left_chars");F.$aligner=this.$popdiv;A.superclass.constructor.call(this,F);this.registerEvents()},registerEvents:function(){var F=this;$("span.email:first",this.$titleBar).parent().bind("click",function(G){if(!F.$popdiv.is(":visible")){F.$popdiv.show();F.show();D.reset.call(F);B.reset.call(F);F.$counterLeftChars.text(E);$("form#emailToFriendForm",F.$popdiv)[0].reset()}});$("div.foot > a:first",this.$popdiv).add("div.foot:eq(1) > a:first").add("#emailfriend_close").add("span.share:first").add("span.print:first").add("span.favorites:first").bind("click",function(G){G.preventDefault();D.reset.call(F);B.reset.call(F);F.$popdiv.hide();F.hide()});$("button#btn_emailfriend_submit",this.$popdiv).bind("click",function(G){G.preventDefault();F.submit()});$("textarea#personalMessage",this.$popdiv).bind("keyup",function(G){var H=$(this);var I=H.attr("value");if(I.length>500){H.attr("value",I.substr(0,E))}else{F.$counterLeftChars.text(E-I.length)}})},submit:function(){var G=$("form#emailToFriendForm",this.$popdiv),H=hcom.common.modules.state.formSerialize(G),F=this;$.ajax({url:"/emailtofriend.html",dataType:"xml",type:"POST",data:H,success:function(K){var M={};$("email-response > addresses > address",K).map(function(){M[this.nodeName]=$(this).attr("value")});var N=$("> email-response",K);if(N.length===0){console.error("invalid response")}else{if(M.address){var I=[];var P=$("div#emailfriend_success > ul");P.empty();$("> addresses > address",N).each(function(){var Q=$(this).attr("value");I.push("<li>"+Q+"</li>");P.append("<li>"+Q+"</li>")});B.reset.call(F);D.toggle.call(F)}else{var O=[];var J=[];var L=$("div.error_icon > ul",this.$popdiv);L.empty();$("> errors > error",N).each(function(){var S=$(this);var Q=S.attr("message");O.push("<li>"+Q+"</li>");L.append("<li>"+Q+"</li>");var R=S.attr("field");J.push(R)});B.set.call(F,true,J)}}},error:function(J,K,I){},complete:function(J,K,I){}})}});return A}});$.registerModule({name:"hcom.landing.modules.socialbookmark",dependencies:["hcom.common.modules.ie6popupplate"],impl:function(A){var B;B=$.extendCls(hcom.common.modules.ie6popupplate,{constructor:function(C){this.$titlebar=$(C.titlebar);this.$popdiv=$(C.popdiv,this.$titleBar);C.$aligner=this.$popdiv;B.superclass.constructor.call(this,C);this.registerEvents()},registerEvents:function(){var C=this;$("span.share:first",C.$titleBar).parent().click(function(D){if(!C.$popdiv.is(":visible")){C.show();C.$popdiv.show()}});$("#socialbookmark_close").add("span.email:first").add("span.print:first").add("span.favorites:first").click(function(D){D.preventDefault();C.$popdiv.hide();C.hide()})}});return B}});$.registerModule({name:"hcom.landing.modules.querymodule",dependencies:["hcom.common.modules.state","hcom.landing.pages.landing.basic","hcom.landing.modules.basicinput"],impl:function(A){var B;function C(){var D=$("#searchForm"),E;if(D.length){E=new hcom.landing.modules.basicinput("txt",false);E.initState($("#searchForm"),true).attachEvents(false);E.setTemplates(hcom.common.template.buildJson(hcom.landing.querymodule.data.staticTemplates))}}B=function(D){this.registerEvents()};B.prototype={registerEvents:function(){var D=this}};B.init=function(){C()};return B}});$.registerModule({name:"hcom.landing.modules.topratedhotel",dependencies:["hcom.common.modules.sitecatalyst"],impl:function(A){function B(C){hcom.common.modules.sitecatalyst.sendPartialReport({server:C.server,prop33:C.sprop33,prop1:C.sprop1,eVar33:C.sprop33},null,"top rated hotel clicked")}return{init:function(){$.listen("click","a.topratedhotel",function(C){var D=hcom.landing.data.topratedhotel[this.rel];B(D)})}}}});$.registerModule({name:"hcom.landing.modules.basicinput",dependencies:["hcom.common.template","hcom.common.modules.calendar"],images:["indicator.gif"],impl:function(T){var C=function(b,d,c){this.name=b;this.id=d;this.optionId=c};var Y=new C("hcom.js.changeSearch.adultFieldName","hcom.js.changeSearch.adultFieldId","hcom.js.changeSearch.adultFieldOptionId"),J=new C("hcom.js.changeSearch.childFieldName","hcom.js.changeSearch.childFieldId","hcom.js.changeSearch.childFieldOptionId"),F=new C("hcom.js.changeSearch.childAgeFieldName","hcom.js.changeSearch.childAgeFieldId","hcom.js.changeSearch.childAgeOptionId"),G,S=/\.rooms\[([0-9]+)\]\.(?:childrenAges\[([0-9]+)\])?/,a="/basicInput.do",U=9,Z=["lnk_search_tab_destination","lnk_search_tab_hotelname"],D,R;function L(){var d="";var g=parent.hcom.configuration.DEFAULT_DATE_FORMAT;var f="";var c=g.length;var b=0;for(var e=0;e<c;e++){switch(g.charAt(e).toLowerCase()){case"d":if(f===""||f==="d"){f="d";b++}break;case"m":if(f===""||f==="m"){f="m";b++}break;case"y":if(f===""||f==="y"){f="y";b++}break;default:if(f==="m"){if(b===1){d=d+"[0-9]{1}"}else{if(b===2){d=d+"[0-9]{2}"}}}else{if(f==="d"){if(b===1){d=d+"[0-9]{1}"}else{if(b===2){d=d+"[0-9]{2}"}}}else{if(f==="y"){if(b===2){d=d+"[0-9]{2}"}else{d=d+"[0-9]{4}"}}}}f="";b=0;if(g.charAt(e).toLowerCase()!=="'"){d=d+"[\\"+g.charAt(e)+"]"}}}if(f==="m"){if(b===1){d=d+"[0-9]{1}"}else{if(b===2){d=d+"[0-9]{2}"}}}else{if(f==="d"){if(b===1){d=d+"[0-9]{1}"}else{if(b===2){d=d+"[0-9]{2}"}}}else{if(f==="y"){if(b===2){d=d+"[0-9]{2}"}else{d=d+"[0-9]{4}"}}}}return"^"+d+"$"}function K(d,e,c,b){this.roomSelector="select[name=rooms]:first";this.childSelector="select[name^=children]";this.adultSelector="select[name$=numberOfAdults]";this.childrenAgesSelector="select[name^=childrenAges]";this.prefix=d;this.prefixStr=d.length?d+"_":"";this.hasTabs=e||false;this.callbacks=c||{};$.extend(this,b);return this}function A(c){var b=$("div.buttonBorder1:first",this.$main);if(c){if(b.hasClass("notActive")){b.removeClass("notActive").find("button").removeAttr("disabled")}}else{if(!b.hasClass("notActive")){b.addClass("notActive").find("button").attr("disabled","disabled")}}}function Q(c,h,g){var f=this.$main.find("div.dates_rooms ~ table > tbody > tr:eq("+c+")"),b=this,d,e=function(i){$(this).attr("id",G.format(F.optionId,b.prefix,String(c),String(d),String(i)))};if(g===0){f.find("td.children_age_col").find("select").unbind().end().empty()}else{if(g<h){for(d=h;d>g;d--){f.find("td.children_age_col").find("select:last").unbind().remove()}}else{if(g>h){if(h===0){f.find("td.children_age_col").empty()}for(d=h;d<g;d++){f.find("td.children_age_col").append(this.childAgeSelect);f.find("td.children_age_col").find("select:last").attr("name",G.format(F.name,String(c),String(d))).attr("id",G.format(F.id,this.prefix,String(c),String(d))).find("option").each(e)}}}}}function X(e,d,f,g){var c,b;if((d>0)&&(g===0)){this.setExpanded(false)}else{if((g>0)&&(d===0)){this.setExpanded(true)}}for(c=0,b=f.length;c<b;c++){if(e[c]!==f[c]){Q.call(this,c,e[c],f[c])}}}function I(){var e=[],b,d=0;$(this.childSelector,this.$main).each(function(c){b=parseInt(this.value,10);d+=b;e.push(b)});return{child:e,childCount:d}}function W(){var b=I.call(this);X.call(this,this.cChild,this.cChildCount,b.child,b.childCount);this.cChild=b.child;this.cChildCount=b.childCount}function M(c,d){var b=this;d.find("label:first").text(G.format("sfsearch.changeSearch.room",String(c+1))).end();$(this.childSelector+":first",d).bind("change.basicInput",function(){W.call(b)}).val("0");$(this.adultSelector+":first",d).val("2")}function E(f){var e=/(id|for|name)="?([^\s"]+)"?/g,i=String(f),g=[G.format(Y.id,this.prefix,i),G.format(J.id,this.prefix,i)],m=[G.format(Y.name,i),G.format(J.name,i)],h=-1,d=0,k=[Y.optionId,J.optionId],l,b,j=this;function c(t,n,p,r,o){var q;if(n==="name"){q=m[d++]}else{if(n==="for"){q=g[0]}else{if(p.indexOf("_option_")>=0){q=G.format(k[h],j.prefix,i,l++)}else{l=0;h+=1;q=g[h]}}}if(q===undefined){return""}else{return[n,'="',q,'"'].join("")}}b=this.roomHtml.replace(e,c);return b}function H(j,h){var d,f="div.dates_rooms ~ table > tbody";if(h<j){$(f,this.$main).find(["> tr:gt(",String(h-1),")"].join("")).find(this.childSelector).each(function(){$(this).unbind()}).end().remove();var c=this.cChildCount,g=this.cChild.slice(0);for(d=j;d>h;d--){this.cChildCount-=this.cChild.pop()}if(this.cChildCount===0){this.setExpanded(false)}}else{if(h>j){var e=$(f,this.$main).find("> tr:last"),b;if(this.roomHtml===undefined){b=e.clone();b.find("td.children_age_col").empty();$("option",b).removeAttr("selected");this.roomHtml=["<tr>",b.html(),"</tr>"].join("");if($.browser.msie){this.roomHtml=this.roomHtml.replace(/jQuery[0-9]+[^\s>]+/g,"")}}for(d=j;d<h;d++){e.after(E.call(this,d));e=$(f,this.$main).find("> tr:last");M.call(this,d,e);this.cChild.push(0)}}}}function O(){var b=parseInt(this.$main.find(this.roomSelector).val(),10);this.isGroupBooking=(b>=U);return b}function V(c){var e="div.dates_rooms ~ table > thead",b="div.dates_rooms ~ table > tbody",d="div.dates_rooms ~ table > tfoot";if(c&&!this.isPeopleSelectorEnabled){this.$main.find(e).show().end().find(b).show().end().find(d).show();this.isPeopleSelectorEnabled=true;if(this.cChildCount>0){this.setExpanded(true)}}else{if(!c&&this.isPeopleSelectorEnabled){this.$main.find(e).hide().end().find(b).hide().end().find(d).hide();this.isPeopleSelectorEnabled=false;if(this.cChildCount>0){this.setExpanded(false)}}}}function P(){var c=this.cRooms,b=this.isGroupBooking,d=O.call(this);if(!b&&this.isGroupBooking){V.call(this,false)}else{if(b&&!this.isGroupBooking){V.call(this,true)}this.cRooms=d;H.call(this,c,d)}}function B(b){var e=0,h,k,j,c=[],m,d,f=0;for(var l in b){if(b.hasOwnProperty(l)){h=S.exec(l);if(h){k=parseInt(h[1],10);e=Math.max(e,k);if(h[2]!==undefined){c[k]=Math.max(c[k]||0,parseInt(h[2],10))}}}}j=this.cRooms;this.cRooms=e+1;H.call(this,j,this.cRooms);for(var g=0;g<this.cRooms;g++){if(c[g]===undefined){c[g]=0}else{c[g]+=1}f+=c[g]}m=this.cChild;d=this.cChildCount;this.cChild=c;this.cChildCount=f;X.call(this,m,d,this.cChild,this.cChildCount)}function N(b){var c=b.getModule("landing_city_basic_input");this.roomEmptyRow=c.getTemplate("room_empty_row");this.adultNumberSelect=c.getTemplate("adult_number_select");this.childNumberSelect=c.getTemplate("child_number_select");this.childAgeSelect=c.getTemplate("child_age_select")}K.prototype={initState:function(b,d){var c;this.$main=b;this.$form=(d===true?b.parent("form:first"):b.find("form:first"));if(this.hasTabs){this.$tabContainer=b.find("ul.searchOptions:first")}this.cRooms=O.call(this);this.isPeopleSelectorEnabled=!this.isGroupBooking;c=I.call(this);this.cChild=c.child;this.cChildCount=c.childCount;this.$formContainer=$("div.query_container");this.isExapanded=false;this.isRippedOff=false;this.isErrorContainerVisible=false;this.fieldErrors={};this.formContainerConfig={wideClass:"citylanding_query_wide",errorClass:"has_error",expandedClass:"citylanding_query_expanded",ripOffClass:"citylanding_query_ripoff"};this.currentHeight=this.$formContainer.outerHeight();this.originalWidth=this.$formContainer.width();this.isWide=this.$formContainer.hasClass(this.formContainerConfig.wideClass);this.errorMessages=hcom.landing.querymodule.data.staticMessages;return this},dateValidator:function(d,b){var c=false;if(!isNaN(d)){if(isNaN(b)){b=new Date()}c=d>=b}return c},setRippedOff:function(b){if(b!==this.isRippedOff){this.isRippedOff=b;if(!this.isWide){this.$formContainer.css("width",this.originalWidth).parent()[b?"addClass":"removeClass"](this.formContainerConfig.ripOffClass)}}},setExpanded:function(b){if(b!==this.isExpanded){this.isExpanded=b;if(!this.isWide){this.setRippedOff(b)}this.$formContainer.css("width",b?null:this.originalWidth).parent()[b?"addClass":"removeClass"](this.formContainerConfig.expandedClass);if($.browser.msie){$(".children_age_col",this.$queryContainer).css("display",b?"block":"none")}}return this},setErrorContainer:function(b){if(b!==this.isErrorContainerVisible){this.isErrorContainerVisible=b;this.$formContainer[b?"addClass":"removeClass"](this.formContainerConfig.errorClass)}return this},setFieldError:function(c,d){var e=d?!this.fieldErrors.hasOwnProperty(c):this.fieldErrors[c]===true,b;if(e){if(d){this.fieldErrors[c]=true}else{delete this.fieldErrors[c]}b=d?"addClass":"removeClass";$("> form > div > div:first > label[for="+c+"]",this.$formContainer)[b](this.formContainerConfig.errorClass);$("#"+c)[b](this.formContainerConfig.errorClass)}return this},setErrorMessages:function(d){var c=$("div.error_container > ul"),b=this;c.empty();$.each(d,function(){c.append("<li>"+b.errorMessages[this]+"</li>")})},setTemplates:function(b){N.call(this,b);return this},attachEvents:function(){var b=this;this.$main.find(this.roomSelector).bind("change.basicInput",function(){P.call(b)}).end().find(this.childSelector).bind("change.basicInput",function(){W.call(b)}).end().find("#btn_search_submit").bind("click",function(c){if(!b.validate()){c.preventDefault()}});return this},detectFieldCounts:function(){B.call(this)},initDateSettings:function(){var c=parent.hcom.configuration.DEFAULT_DATE_FORMAT,b=c.indexOf("yyyy");this.dateSettings={yearIndex:b<0?c.indexOf("yy"):b,yearDigits:b<0?2:4,monthIndex:c.indexOf("MM"),monthDigits:2,dayIndex:c.indexOf("dd"),dayDigits:2}},parseLocalizedDate:function(d){if(!this.dateSettings){this.initDateSettings()}var e=d.substr(this.dateSettings.yearIndex,this.dateSettings.yearDigits),f=d.substr(this.dateSettings.monthIndex,this.dateSettings.monthDigits).replace(/^0/,""),b=d.substr(this.dateSettings.dayIndex,this.dateSettings.dayDigits).replace(/^0/,""),c;if(e.length===this.dateSettings.yearDigits&&f&&b&&!isNaN(e)&&!isNaN(f)&&!isNaN(b)){c=new Date((this.dateSettings.yearDigits===2?"20":"")+e,f-1,b)}return c},validate:function(){var h=true,e=this,c=[],g=$.trim($("#"+this.prefixStr+"search_ci").val()),d=$.trim($("#"+this.prefixStr+"search_co").val()),f=this.parseLocalizedDate(g),b=this.parseLocalizedDate(d);if(isNaN(f)&&isNaN(b)){c[c.length]="landing.city.querymodule.error.dates.empty";this.setFieldError(this.prefixStr+"search_ci",true);this.setFieldError(this.prefixStr+"search_co",true)}else{if(isNaN(f)){c[c.length]="landing.city.querymodule.error.checkin.empty";this.setFieldError(this.prefixStr+"search_ci",true)}else{if(!D.test(g)||!this.dateValidator(f)){c[c.length]="landing.city.querymodule.checkin.error";this.setFieldError(this.prefixStr+"search_ci",true)}else{this.setFieldError(this.prefixStr+"search_ci",false)}}if(isNaN(b)){c[c.length]="landing.city.querymodule.error.checkout.empty";this.setFieldError(this.prefixStr+"search_co",true)}else{if(!D.test(d)||!this.dateValidator(b,f)){c[c.length]="landing.city.querymodule.checkout.error";this.setFieldError(this.prefixStr+"search_co",true)}else{this.setFieldError(this.prefixStr+"search_co",false)}}}this.$main.find("td.children_age_col").find("select").each(function(){if($(this).val()==="-1"){if($.inArray("landing.city.querymodule.childrenages.error",c)===-1){c[c.length]="landing.city.querymodule.childrenages.error"}e.setFieldError($(this).attr("id"),true)}else{e.setFieldError($(this).attr("id"),false)}});if(c.length>0){h=false}this.setErrorContainer(!h);this.setErrorMessages(c);return h},redirectGroupBooking:function(){if(this.isGroupBooking){window.location="/group_booking.do"}return this.isGroupBooking}};K.init=function(){D=new RegExp(L());G=new $.formatter()};return K}});$.registerModule({name:"hcom.landing.pages.landing.basic",dependencies:["hcom.common.pages.common","hcom.common.modules.itemtoggler"],impl:function(A){return{init:function(){var B,C;B=new hcom.common.modules.itemtoggler({containers:["#GradientContainer","#threeColLeftContainer","#threeColRightContainer",".col_2"],clickFilter:"a.listboxControl",clickOnInit:"a.listboxControl:not(.expand)",findContainerFromClick:function(E){var D=E.is(".expand")?E.hide().next():E.hide().prev();return D.show().parent().find("ul.expandable:first")}});C=new hcom.common.modules.itemtoggler({containers:["#twoColLeftHeadContainer > p.headerH"],clickFilter:"a.x-didYouMeanControl",clickOnInit:"a.x-didYouMeanControl",findContainerFromClick:function(D){return D.toggleClass("hidden").parent()}});hcom.common.modules.events.attachSubmitChange($("#footerChangeCurrencyForm").add("#footerChangeCountryForm"))}}}});$.registerModule({name:"hcom.landing.pages.landing.queryform",dependencies:["hcom.landing.pages.landing.basic","hcom.common.modules.state","hcom.search.modules.basicinput"],impl:function(A){function B(){var C=$("#queryForm"),D;if(C.length){D=new hcom.search.modules.basicinput("",false);D.loadPartial(function(){D.initState($("#queryForm"),true).attachEvents(false)})}}return{init:function(){B();$("#moreSearchOptions").click(function(E){E.preventDefault();var D=hcom.common.modules.state.formSerialize($("#searchForm")),C=[];for(var F in D){if(D.hasOwnProperty(F)&&D[F]!==null){if(String===D[F].constructor&&$.trim(D[F]).length>0){C.push("&"+F+"="+D[F])}else{if(Array===D[F].constructor&&D[F].length>0){C.push("&"+F+"="+D[F].join(","))}}}}window.location="/search.do?advanced=true"+C.join("");return false})}}}});$.registerModule({name:"hcom.landing.pages.landing.city",dependencies:["hcom.common.template","hcom.landing.pages.landing.queryform","hcom.common.modules.checkavailabilitydialog","hcom.landing.modules.checkavailabilitydialog","hcom.common.modules.emitter","hcom.common.modules.slideshow","hcom.common.modules.popdiv","hcom.common.modules.searchpopdiv","hcom.common.modules.hotelimagepopdiv","hcom.search.modules.sortcontrol","hcom.search.modules.namesearch"],impl:function(B){var A;function F(){A=new $.formatter(hcom.landing.data.staticMessages);A.setGlobal()}function E(){var G;G=new hcom.landing.modules.checkavailabilitydialog("ca");G.attachEvents();G.buildTemplate(hcom.common.template.buildJson(hcom.landing.data.staticTemplates));hcom.search.modules.glasspane.initStatic().hide()}function D(){if(hcom.landing.data&&hcom.landing.data.popdiv){return new hcom.common.modules.hotelimagepopdiv({$container:$("#imagePopDiv"),clickFilter:"a.hotelDetailsPhoto",store:new hcom.common.modules.hotelimagepopdiv.JSONStore({data:hcom.landing.data.popdiv})})}}function C(){$("#text_enterHotelName").setEmptyValue(A.format("sfsearch.filterModule.defaulthotelnameinput"))}return{init:function(){F();if(hcom.search.modules.namesearch){hcom.search.modules.namesearch.initSubmitButton()}E();D();C()}}}});$.registerModule({name:"hcom.landing.pages.landing.city_j5c",dependencies:["hcom.landing.modules.common","hcom.landing.modules.neighbourhoodmap","hcom.landing.modules.neighbourhoodpopup"],impl:function(A){function B(){if(hcom.landing.data&&hcom.landing.data.neighbourhoodmap){return new hcom.landing.modules.neighbourhoodpopup({mapContainer:"img#neighbourhoodMap",mapData:hcom.landing.data.neighbourhoodmap,headerTitle:"span.cl_popup_title",descriptionHolder:"div#holder > p",seeAllLink:"div#holder > a.link_more>span:first",popup:"div.neighbourhood_popup"})}}return{init:function(){B()}}}});$.registerModule({name:"hcom.landing.pages.landing.city_j6c",dependencies:["hcom.landing.modules.common","hcom.landing.modules.neighbourhoodmap","hcom.landing.modules.neighbourhoodinline"],impl:function(A){function B(){if(hcom.landing.data&&hcom.landing.data.neighbourhoodmap){return new hcom.landing.modules.neighbourhoodinline({mapContainer:"img#neighbourhoodMap",mapData:hcom.landing.data.neighbourhoodmap,headerTitle:"div.neighbourhood_data > h3",descriptionHolder:"div.neighbourhood_data > div.textarea > p",seeAllLink:"a.link_more > span:first"})}}return{init:function(){B()}}}});$.registerModule({name:"hcom.landing.pages.landing.city_listing",dependencies:["hcom.landing.modules.common"],impl:function(A){return{}}});$.registerModule({name:"hcom.landing.pages.landing_pgn",dependencies:["hcom.landing.pages.landing.queryform","hcom.landing.modules.emailtofriend","hcom.landing.modules.socialbookmark"],impl:function(A){function B(){if($.browser.safari){$("a.favorites").remove()}else{$("a.favorites").click(function(C){if(!$.browser.opera){C.preventDefault()}$.bookmark(".icon_sprite_toolbar a.favorites")})}}return{init:function(){var D=new hcom.landing.modules.emailtofriend({titlebar:"div.citylanding_titlebar:first",popdiv:"div.citylanding_emailfriend:first",z_index:"4"}),C=new hcom.landing.modules.socialbookmark({titlebar:"div.citylanding_titlebar:first",popdiv:"div.city_landing_social_bookmarks:first",z_index:"4"});B()}}}});$.registerModule({name:"hcom.landing.pages.landing_pgn.hmvt_27_1",dependencies:["hcom.landing.pages.landing.hmvt_27_1_queryform","hcom.landing.modules.emailtofriend","hcom.landing.modules.socialbookmark","hcom.landing.modules.autosuggest"],impl:function(A){function B(){if($.browser.safari){$("a.favorites").remove()}else{$("a.favorites").click(function(C){if(!$.browser.opera){C.preventDefault()}$.bookmark(".icon_sprite_toolbar a.favorites")})}}return{init:function(){var D=new hcom.landing.modules.emailtofriend({titlebar:"div.citylanding_titlebar:first",popdiv:"div.citylanding_emailfriend:first",z_index:"4"}),C=new hcom.landing.modules.socialbookmark({titlebar:"div.citylanding_titlebar:first",popdiv:"div.city_landing_social_bookmarks:first",z_index:"4"});B()}}}});$.registerModule({name:"hcom.booking.modules.overlay",dependencies:["hcom.booking.modules.holding"],impl:function(A){var E,C=false,H="#booking_overlay_cnt",I,B,F;function J(K){var L=$(K.target).attr("href");B(false,E[C]);I.hide();window.location.replace(L);return false}B=function(L,M){if(M!==true){var K=M[L?"setup":"teardown"];if(K){K()}else{if(typeof M==="string"){if(L){$(M).bind("click.overlay",J)}else{$(M).unbind("click.overlay")}}}}};function D(){if(C){B(false,E[C]);F.setVisible(false);I.hide();C=false}}function G(L,K){var M;if(!C&&E.hasOwnProperty(L)){C=L;F.setHoldingVisible(false);F.setGlassVisible(true);if(!I||I.length<=0){$("body:first").htmlAppend('<div id="booking_overlay_cnt" style="display: none;"></div>');I=$(H)}M=I.html(K).find("> div:first").css({visibility:"hidden"});if($.browser.msie){M.css({position:"absolute"})}I.show();hcom.common.modules.html.centerBox(M);M.css({visibility:"visible"});B(true,E[L])}}return{init:function(){var K="#lnk_duplicate_booking_cancel";F=hcom.booking.modules.holding;E={"fastbooking.ian.error.hotel.duplicateBooking":K,"fastbooking.ian.error.hotel.hotelNotAvailable":"#lnk_hotel_not_available_cancel","fastbooking.ian.error.hotel.priceDrop":true,"fastbooking.ian.error.hotel.priceRise":"#lnk_price_rise_cancel","fastbooking.error.duplicateBooking":K};I=$(H)},show:G,hide:D}}});$.registerModule({name:"hcom.booking.modules.errorpopdiv",dependencies:["hcom.common.modules.popdiv"],impl:function(X){var R,Y,K,c,f,d,E,C,F,P=true,S,H,h,U=5,e=1,g=[],G=false,L=["sct_expire_month","sct_expire_year","sct_start_month","sct_start_year","sct_booking_state","sct_booking_country"],b="text_room_first_name_",I="text_room_last_name_",a={},V=false;function Q(){R.forceClose()}function D(){if(V){$("#"+V).focus()}V=false}function B(l){var k,i,n,m,j;l.preventDefault();if(!V){Q();V=l.target.hash.substring(1);k=$(window).scrollTop();i=k+$(window).height();j=H.containerDim(V);if(j.top<k){n=j.top}else{if(j.bottom>i){n=k-j.bottom+i}}if(n!==undefined){m=Math.abs(n-k);$("html, body").animate({scrollTop:n},Math.min(m,1000),"swing",D)}else{D()}}}function Z(m){var k=[],j,l=e;if(l>m){E.children("li").slice(m).find("a:first").unbind().end().remove()}else{if(l<m){for(j=l;j<m;j++){k.push(S)}E.append(k.join(""));$("li > a",E).slice(l,m).bind("click.errorPopDiv",B)}}e=m}function T(i){return $(["#"+i].join("")).parent().children(["label[@for^='",i,"']"].join("")).text()}function J(i){return document.getElementById(i).options[0].text}function A(l,j){var i=l.substring(j.length),k=T(l);return[$([".booking_room_details > .container:eq(",i,") > .rooms > strong"].join("")).text()," : ",k].join("")}function O(j){var i=a[j];if(typeof i!=="undefined"&&i.length!==0){return i}else{if($.inArray(j,L)>-1){return J(j)}else{if(j.indexOf(b)>-1){return A(j,b)}else{if(j.indexOf(I)>-1){return A(j,I)}else{return T(j)}}}}return j}function N(k){var r=[],p,o,u,t,l,n,v,q=h.fieldsValidated,m=H.getFieldIndexes();k=k||{};for(p=0,o=0;(t=m.idList[p])&&(o<U);p++){n=document.getElementById(t);u=n.name;G=G||k.hasOwnProperty(u);if(q[u]===false){v={element:n}}else{v=(G&&k[u])||undefined}if(v!==undefined){r[o++]=v}}if(!r.length){G=false;$("#btn_submit_booking").attr("title",F.format("clickToCompleteOrder"));Q()}else{$("#btn_submit_booking").attr("title","");Z(r.length);for(p=0;(v=r[p]);p++){if(p>=g.length||g[p].element.name!==v.element.name){if(!l){l=$("> li",E)}$("a:first",l[p]).text(O(v.element.id)).attr("href",["#",v.element.id].join(""))}}}g=r}function W(){var i=d.offset(),k=d.width(),j=d.height();return{top:Math.round(j/2+i.top-K.height/2),left:i.left+k,width:K.width,height:K.height,thumbTop:i.top,thumbLeft:i.left,thumbWidth:k,thumbHeight:j,alignment:R.alignments.right}}function M(i){var j;if(P){j=$(i.target);R.onThumbnailHoover(i,j,W())}}return{init:function(){Y=hcom.common.modules.popdiv;C=hcom.booking.modules.errorpopdiv;K={width:319,height:161};f=$("#popdiv_submit_error_container");c=$("#popdiv_submit_error");E=$("#popdiv_submit_error_list");d=$("#btn_submit_booking").parent();$("li > a",E).bind("click.errorPopDiv",B);S=E.html();R=new Y({namespace:"errorPopDiv",$container:f,setVisible:function(j,i){j[i?"show":"hide"]()},delayIn:0});$([]).add(d).bind("mouseover.errorPopDiv",M)},setMessageMap:function(i){a=i;return C},setFieldHandler:function(i){H=i;return C},setFormState:function(i){h=i;N();return C},setFormatter:function(i){F=i;$("#popdiv_submit_error_label").text(F.format("formProblems"));return C},setEnabled:function(i){P=i;return C},hasExternalErrors:function(){return G},isOneOrZeroErrorLeft:function(){if(g.length<=1){return true}else{return false}},hide:Q,update:N}}});$.registerModule({name:"hcom.booking.modules.core",dependencies:["hcom.booking.modules.signin","hcom.booking.modules.coupon","hcom.common.modules.popup","hcom.booking.modules.validator.rules","hcom.common.modules.state","hcom.booking.modules.holding","hcom.common.listener","hcom.common.modules.html","hcom.booking.modules.overlay","hcom.common.modules.simplepopdiv","hcom.booking.modules.errorpopdiv","hcom.booking.modules.securecode"],impl:function(R){var F,D,U,X,C,Y,P,d,G,N,b,K=false,A,c,H={},O,B,a;function Q(){var e=$("#supplierType").val();if(e==="SABRE"||e==="WORLDSPAN"){return"GDS"}else{if(e==="VENERE"){return"Venere"}else{return"Merchant"}}}function Z(){return true===window.hcom.locale.rules.secureCodeEnabled}B=function(){var h=false,g="fillingStart";function e(){F.unbind(["keydown",g].join(".")).unbind(["click",g].join("."))}function i(){if(!h){h=true;e();setTimeout(function(){s.events="event19";s.eVar33="FormStarted";s.prop33="FormStarted";s.tl();s.events=null;s.eVar33=null;s.prop33=null})}}function f(){F.bind(["keydown",g].join("."),function(j){if(j.which!==13&&j.target.id&&j.target.id!=="btn_submit_booking"){i()}}).bind(["click",g].join("."),function(j){i()})}return{init:function(){f()}}}();A=function(){function e(g,m,l,k,j,f){var n,h;if($(["#",j].join("")).text().length!==0||$([".",f].join("")).text().length!==0){return }if(typeof l!=="undefined"&&$(["#",k].join("")).attr("checked")!==true){for(h=0;h<l.length;h++){if(document.referrer.indexOf(l[h])>=0){return }}}if(typeof m==="undefined"||m.length===0){n=g[0].elements}else{n=$.grep(g[0].elements,function(i,o){return $.inArray(i.id,m)===-1})}if(!a){$.map(n,function(q,r){var p=$(q),o=p.attr("type"),i;if(o==="checkbox"||o==="radio"){p.removeAttr("checked")}else{if(p.is("select")){if(p.attr("multiple")){for(i=0;i<q.options.length;i++){if(q.options[i].selected){q.options[i].selected=false}}}q.selectedIndex=0}else{if(o==="text"||o==="password"){p.val("")}}}})}}return{init:function(){},clearFields:e}}();P=function(){var AM={},AL,o,v,z,AH,AA=[{reg:/^text_room_first_name_[0-9]+$/,val:1},{reg:/^text_room_last_name_[0-9]+$/,val:1},{reg:/^sct_bedding_preferences_[0-9]+$/,val:0},{reg:/^text_room_frequent_guest_number_[0-9]+$/,val:1}],AG={sct_booking_title:0,text_booking_first_name:1,text_booking_last_name:1,sct_booking_ccard_type:0,text_booking_ccard_number:1,text_booking_security_code:1,sct_expire_month:0,sct_expire_year:0,sct_start_month:0,sct_start_year:0,text_booking_issue_number:0,text_booking_street_address_line_1:1,text_booking_street_address_line_2:1,text_booking_town:1,sct_booking_state:0,text_booking_county:0,text_booking_company:1,text_booking_post_code:1,text_booking_email_address:1,text_booking_telephone_number:1,sct_booking_mobile_country:0,text_booking_mobile_number:1,sct_booking_country:1,chbox_agree_to_terms:0},u=function(AQ,AO){var AP,AN=AQ.indexOf("1")>0?"text_booking_street_address_line_2":"text_booking_street_address_line_1";if(!AM.hasOwnProperty[AN]){AP=$("div.currency_information",F);if(AO){AP.hide()}else{AP.show()}}},y=$("div.security_information:first",F),j=$("div.security_image:first",F),AC=function(){y.hide()},e=function(){y.show()},AE=false,AI=false,w=$("div.expiry:first",F),AK=false,AD=false,AJ=function(AN){if(AN){if(!AK&&!AD){w.css("clear","both")}}else{if(!(AK&&AD)){w.css("clear","none")}}},n=false,i={text_booking_first_name:{show:function(){AC();AE=true},hide:function(){if(!AI){e()}AE=false}},text_booking_last_name:{show:function(){AC();AI=true},hide:function(){if(!AE){e()}AI=false}},text_booking_street_address_line_1:{show:function(AN){u(AN,true)},hide:function(AN){u(AN,false)}},text_booking_security_code:{highlight:function(AO,AN){if(AM.hasOwnProperty("text_booking_security_code")){j.css({display:"block"})}},unhighlight:function(AO,AN){j.css({display:"none"})},show:function(AO,AN){j.css({display:"none"})},hide:function(AO,AN){j.css({display:"block"})}},sct_expire_month:{show:function(AP,AO,AN){AJ(true);AD=true;AN.parent().parent().find(".error_message:eq(0)").show().addClass("error").text(AO)},hide:function(AO,AN){AJ(false);AD=false;AN.parent().parent().find(".error_message:eq(0)").hide().removeClass("error").text("")}},sct_expire_year:{show:function(AP,AO,AN){AJ(true);AK=true;AN.parent().parent().find(".error_message:eq(1)").show().addClass("error").text(AO)},hide:function(AO,AN){AJ(false);AK=false;AN.parent().parent().find(".error_message:eq(1)").hide().removeClass("error").text("")}},sct_start_month:{show:function(AP,AO,AN){AN.parent().find(".error_message:first").show().addClass("error no_margin").text(AO)},hide:function(AO,AN){AN.parent().find(".error_message:first").hide().removeClass("error no_margin").text("")}},sct_start_year:{show:function(AP,AO,AN){AN.parent().find(".error_message:first").show().addClass("error no_margin").text(AO)},hide:function(AO,AN){AN.parent().find(".error_message:first").hide().removeClass("error no_margin").text("")}},text_booking_issue_number:{show:function(AP,AO,AN){AN.addClass("error").parent().find("div.error_message:first").show().addClass("error").text(AO)},hide:function(AO,AN){AN.removeClass("error").parent().find("div.error_message:first").hide().removeClass("error").text("")}},sct_booking_state:{show:function(AP,AO,AN){AN.addClass("error").parent().find("div.error_message:first").show().addClass("error error-margin").text(AO)},hide:function(AO,AN){AN.removeClass("error").parent().find("div.error_message:first").hide().removeClass("error error-margin").text("")}}};function x(AR){var AO=AG[AR],AQ=0,AP=$(document.getElementById(AR));console.assert(AP.length);if(AO===undefined){for(var AN;(AN=AA[AQ]);AQ++){if(AN.reg.test(AR)){AO=AN.val;break}}}console.assert(AO!==undefined);return AP.parents(":eq("+AO+")")}function k(AR,AQ,AN){if(AM[AR]!==AQ&&z!==undefined&&z>=v[AR]){var AO=x(AR),AP=i[AR];AM[AR]=AQ;if(AO&&AO.length){AO.addClass("error").find("div.error_message:first").text(AQ)}if(AP&&AP.show){AP.show(AR,AQ,AO)}hcom.booking.modules.sitecatalyst.onValidationError(Q(),AN)}}function h(AQ){var AP=document.getElementById(AQ).name,AO,AN;if(AL===AQ){AN=x(AQ);AL=undefined;AN.removeClass("active");if((AO=i[AQ])&&AO.unhighlight){AO.unhighlight(AQ,AN)}}if(!AM[AQ]&&d.errors[AP]){k(AQ,d.errors[AP].message,d.errors[AP].validationId)}}function q(AP){var AN,AO;if(!AL||AL!==AP){if(AL){h(AL)}if(!AM.hasOwnProperty(AP)){AN=x(AP);AL=AP;AN.addClass("active");if((AO=i[AP])&&AO.highlight){AO.highlight(AP,AN)}}}}function r(AP){var AN=x(AP),AO;if(AN&&AN.length){AN.removeClass("error")}if(AM.hasOwnProperty(AP)){delete AM[AP]}if((AO=i[AP])&&AO.hide){AO.hide(AP,AN)}}function AB(AR){var AO=x(AR),AQ=AO.offset(),AN=AO.width(),AP=AO.height();return{top:AQ.top,right:AQ.left+AN,bottom:AQ.top+AP,left:AQ.left,width:AN,height:AP}}function m(AN){if(AN&&!n){n=true;if("roomOccupations[0].guestFirstName"===AN.name){return AN.value.length>0}}return true}function l(){var AO,AN,AP=d.errors;for(AN in AP){if(AP.hasOwnProperty(AN)){AO=AP[AN];k(AO.element.id,AO.message,AO.validationId)}}}function f(){var AQ=G.elements(),AS=[],AN={},AP,AT,AR,AO;for(AO=0;(AP=AQ[AO]);AO++){AN[AP.id]=AO;AS.push(AP.id)}if(AH){AT=AN[AH];if(AT===undefined){AO=z;while(AO>0){AO--;if(AN.hasOwnProperty(o[AO])){AT=AO;AR=o[AO];break}}AH=AR}z=AT;l()}o=AS;v=AN}function t(AN){var AO;if(v.hasOwnProperty(AN.id)){AO=v[AN.id];if(z===undefined||AO>z){z=AO;AH=AN.id;l()}}}function g(){var AO,AN;if(o.length){AN=o[o.length-1];AO=v[AN];if(z===undefined||AO>z){z=AO;AH=AN;l()}}}function p(){return{idList:o,indexMap:v}}function AF(){f()}return{init:AF,rebuildFieldIndex:f,getFieldIndexes:p,setFieldIndex:t,setFieldIndexToLast:g,highlight:q,unhighlight:h,showError:k,hideError:r,containerDim:AB,firstNameFilter:m}}();C=function(){var f,i,g,e,j=false,k=false;function l(m){if(m!==f){if(!$.browser.msie){g.attr("type",m?"submit":"button")}i[m?"removeClass":"addClass"]("notActive");e[m?"hide":"show"]();U.setEnabled(!m);f=m}return f}function h(){var m=d.lastActive;if(m){G.element(m)}}return{set:l,init:function(){var m=$("div.booking_submit:first",F);g=$("#btn_submit_booking").bind("focus.submitButton",function(){j=true}).bind("blur.submitButton",function(){j=false}).bind("click.submitButton",function(){g.focus()}).bind("mouseover.validateLast",function(){h()});i=g.parents(":eq(1)");i.bind("click.submitButton",function(){P.setFieldIndexToLast();F.valid()});f=!i.hasClass("notActive");U.setEnabled(!f);e=m.children("p").text(D.format("fillOutNeed"));l(!d.hasFieldErrors());g.attr("title","");k=true},isInitialized:function(){return k},isEnabled:function(){return f},isFocused:function(){return j}}}();Y=function(){var m,j,o,q,n,k=true,f,i;function g(){if(o.selectedIndex!==n){n=o.selectedIndex;if(!i||n>0){f.selectedIndex=n-1;if(!i){q.text(D.format("notUKAddress",$(o.options[o.selectedIndex]).text()))}}}}function e(r){if(k!==r){m[r?"hide":"show"]();j[r?"show":"hide"]();if(r){j.focus()}else{g()}k=r}}function l(){e(true)}function p(){e(false)}function h(){g()}return{init:function(){i=hcom.locale.rules.billingCountryRequired===true;j=$("#sct_booking_country");j.bind("change.core blur.core",i?h:p);o=j[0];f=$("#sct_booking_mobile_country")[0];if(!i){m=$("div.country_selector:first > div.selector:first",F).bind("click.core",l);q=$("div.copy:first",m);e(false)}},setActive:e}}();function V(f){P.setFieldIndex(f);if(P.firstNameFilter(f)){$.validator.defaults.onfocusout.call(this,f)}U.update();P.unhighlight(f.id)}function T(f){$.validator.defaults.onfocusin.call(this,f);P.highlight(f.id)}function S(f){P.setFieldIndex(f);$.validator.defaults.onclick.call(this,f);U.update()}function E(g,e,f){if(e.changes){$.each($.extend({},e.added,e.changed),function(){P.showError(this.element.id,this.message,this.validationId)});$.each(e.removed,function(){P.hideError(this.element.id)})}if(e.changes||f.changes){if(U){U.update()}if(C.isInitialized()){C.set(!d.hasFieldErrors())}}}function L(f,e,g){return $.validator.defaults.messageResolver.call(this,{name:f.name.replace(L.reg,"")},e,g)}L.reg=/^roomOccupations\[[0-9]+\]\./;function I(e,g){for(var f in g){if(g.hasOwnProperty(f)){e[f]=e[f].substring(0,g[f])}}}function W(e){var f=$("> fieldErrors > field",e),g={};f.each(function(){var j=$(this),h=j.attr("name"),k=j.attr("message"),i;i=F[0][h];g[h]={message:k,element:i};console.assert(i);console.assert(i.id);P.showError(i.id,k)});if(f.length){U.update(g);$(window).scrollTop(0);C.set(false)}return f.length>0}function M(){var g=false,j=false,e,f;if(!K&&C.isEnabled()&&(C.isFocused()||O.getSecCodePaymentStarted())){setTimeout(function(){s.events="event20";s.eVar33="OrderSubmitted";s.prop33="OrderSubmitted";s.tl();s.events=null;s.eVar33=null;s.prop33=null},0);var i=hcom.common.modules.state.formSerialize(F);var h=hcom.booking.modules.coupon.getCurrentCouponId();if(h){i["couponIdentifier.code"]=h}if(Z()&&N.isSecCardSet()&&!O.getSecCodePaymentStarted()){hcom.booking.modules.sitecatalyst.onSecureCode(Q(),"SecureCode Started")}else{if(O.getSecCodePaymentStarted()){e=hcom.booking.modules.securecode;i.transactionId=e.getTransactionId();i.itineraryId=e.getItineraryId();i.paRes=e.getPaRes()}}I(i,H);i.ajax=true;b.setVisible(true);$.ajax({url:"/booking/details.html",dataType:"xml",type:"POST",data:i,success:function(l){var q=$(l).find("> submit_result:first"),r,k,n;if(q.length){r=$("> success:first",q).attr("value");if(r==="true"){window.location.assign("/booking/confirmation.html");g=true;if(O.getSecCodePaymentStarted()){O.setSecCodePaymentStarted(false)}}else{if($("> secureCode",q).length!==0&&!O.getSecCodePaymentStarted()){f=$("> secureCode:first > authenticationResult:first",q).text();O.setOmniture(f);n=$("> secureCode:first > loadUrl:first",q).text();if(f!=="Y"||typeof n==="undefined"||n===""){b.setVisible(false);O.showErrorBar();return }O.setSecCodePaymentStarted(true);hcom.booking.modules.sitecatalyst.onSecureCode(Q(),"SecureCode Authetication Required");j=true;hcom.booking.modules.securecode.show(["https://",document.location.host,n].join(""),{acsUrl:$("> secureCode:first > acsUrl:first",q).text(),md:$("> secureCode:first > md:first",q).text(),paReq:$("> secureCode:first > paReq:first",q).text(),xid:$("> secureCode:first > xid:first",q).text(),authenticationResult:$("> secureCode:first > authenticationResult:first",q).text()},[document.location.host,$("> secureCode:first > termUrl:first",q).text()].join(""),b);return }else{if(O.getSecCodePaymentStarted()){O.setSecCodePaymentStarted(false);b.setVisible(false);O.showErrorBar();return }}k=$("> overlay:first",q);if(k.length){g=true;var m=k.attr("type");if(m==="fastbooking.error.duplicateBooking"){hcom.booking.modules.sitecatalyst.onDuplicateBooking()}c.show(m,k.text())}else{var o=$("> global-error:first",q).attr("value");if(o){if(o==="fastbooking.ian.error.creditCardValidation.formData"){$("#text_booking_security_code").val("");d=F.valid(true);U.update();C.set(!d.hasFieldErrors())}if(o.indexOf("fastbooking.ian.")===0){var p={};$("> global-error:first > siteCatalystProperties > *",q).each(function(){p[this.nodeName]=$(this).text()});hcom.booking.modules.sitecatalyst.onIanError(p.pageName,p.channel,p.eVar33,p.prop33)}}o=$("> global-error:first > error-module:first",q).text();if(o){document.getElementById("IANError").innerHTML=o}else{$("#IANError").text("")}W(q);console.error("%s: unknown error occured",R)}}}else{console.error("invalid server side AJAX response")}},error:function(l,m,k){console.error("server side error while generating AJAX response");if(O.getSecCodePaymentStarted()){O.setSecCodePaymentStarted(false);b.setVisible(false);O.showErrorBar();K=false}},complete:function(k,l){if(!g){if(!j){b.setVisible(false)}K=false}}})}return false}function J(){var j,l=hcom.locale.validation.data,p="text_room_first_name_",e="text_room_last_name_",k=0,g,m,h=[],f="roomOccupations[{0}].guestFirstName",q="roomOccupations[{0}].guestLastName",o,n;while($(["#",p,k].join("")).size()){h.push($(["#",e,String(k)].join("")));k++}console.assert(k>0);g=[["ruleRemoveNotLatin1AndPlus",{vowels:l.UTF_VOWELS,ys:l.UTF_YS}],["required",true,{msgKeyPrefix:"first_name",validationId:"F_B_1_5"}],["ruleDisallowSpecialWords",{specialWords:l.company,messageKey:"contains.company"},{msgKeyPrefix:"first_name",validationId:"F_B_1_1"}],["ruleDisallowSpecialWords",{specialWords:l.salutations,messageKey:"contains.salutation"},{msgKeyPrefix:"first_name",validationId:"F_B_1_2"}],["maxlength",13,{msgKeyPrefix:"first_name",validationId:"F_B_1_4"}],["ruleAcceptOnlyUnicode",{vowels:l.UTF_VOWELS,ys:l.UTF_YS},{msgKeyPrefix:"first_name",validationId:"F_B_1_7"}],["bfUniqueNameHelper",{affected:h}],["copyValue",{target:"#text_booking_first_name",overwrite:true}]];m=[["ruleRemoveNotLatin1AndPlus",{vowels:l.UTF_VOWELS,ys:l.UTF_YS}],["required",true,{msgKeyPrefix:"last_name",validationId:"F_B_2_6"}],["ruleDisallowSpecialWords",{specialWords:l.company,messageKey:"contains.company"},{msgKeyPrefix:"last_name",validationId:"F_B_2_1"}],["ruleDisallowNumber",null,{msgKeyPrefix:"last_name",validationId:"F_B_2_2"}],["ruleDisallowSpecialWords",{specialWords:l.salutations,messageKey:"contains.salutation"},{msgKeyPrefix:"last_name",validationId:"F_B_2_3"}],["maxlength",15,{msgKeyPrefix:"last_name",validationId:"F_B_2_5"}],["ruleAcceptOnlyUnicode",{vowels:l.UTF_VOWELS,ys:l.UTF_YS},{msgKeyPrefix:"last_name",validationId:"F_B_2_8"}],["bfUniqueName",{firstNamePrefix:p,lastNamePrefix:e,numberOfRooms:k,affected:h},{msgKeyPrefix:"last_name",validationId:"F_B_1_3"}],["copyValue",{target:"#text_booking_last_name",overwrite:true}]];o={"contactDetails.emailAddress":[["required",true,{msgKeyPrefix:"bfEmailCommon",validationId:"F_B_11_1"}],["minlength",5,{msgKeyPrefix:"bfEmailCommon",validationId:"F_B_11_7"}],["maxlength",50,{msgKeyPrefix:"bfEmailCommon",validationId:"F_B_11_6"}],["bfEmail",{tldList:l.tldList,validationIdPref:"F_B_11"}]],"contactDetails.phoneNumber":[["requiredIfOtherIsEmpty",{other:$("#text_booking_mobile_number")},{msgKeyPrefix:"telephone_number",validationId:"F_B_13_1"}],["bfTelephoneNumber",{countryControlId:"sct_booking_country",validationIdPref:"F_B_13"},{msgKeyPrefix:"telephone_number"}]],"contactDetails.mobileNumber":[["requiredIfOtherIsEmpty",{other:$("#text_booking_telephone_number"),primary:false},{msgKeyPrefix:"telephone_number",validationId:"NFO-1118_1"}],["bfTelephoneNumber",{countryControlId:"sct_booking_country",validationIdPref:"NFO-1118"},{msgKeyPrefix:"telephone_number"}]],"billingInformation.firstName":[["ruleRemoveNotLatin1AndPlus",{vowels:l.UTF_VOWELS,ys:l.UTF_YS}],["required",true,{msgKeyPrefix:"first_name",validationId:"F_B_9_7:F_B_9_4"}],["ruleDisallowSpecialWords",{specialWords:l.company,messageKey:"contains.company"},{msgKeyPrefix:"first_name",validationId:"F_B_9_1"}],["ruleDisallowSpecialWords",{specialWords:l.salutations,messageKey:"contains.salutation"},{msgKeyPrefix:"first_name",validationId:"F_B_9_2"}],["maxlength",13,{msgKeyPrefix:"first_name",validationId:"F_B_9_3"}],["ruleAcceptOnlyUnicode",{vowels:l.UTF_VOWELS,ys:l.UTF_YS},{msgKeyPrefix:"first_name",validationId:"F_B_9_6"}]],"billingInformation.lastName":[["ruleRemoveNotLatin1AndPlus",{vowels:l.UTF_VOWELS,ys:l.UTF_YS}],["required",true,{msgKeyPrefix:"last_name",validationId:"F_B_10_9"}],["ruleDisallowSpecialWords",{specialWords:l.company,messageKey:"contains.company"},{msgKeyPrefix:"last_name",validationId:"F_B_10_1"}],["ruleDisallowNumber",null,{msgKeyPrefix:"last_name",validationId:"F_B_10_2"}],["ruleDisallowSpecialWords",{specialWords:l.salutations,messageKey:"contains.salutation"},{msgKeyPrefix:"last_name",validationId:"F_B_10_3"}],["maxlength",15,{msgKeyPrefix:"last_name",validationId:"F_B_10_5"}],["ruleAcceptOnlyUnicode",{vowels:l.UTF_VOWELS,ys:l.UTF_YS},{msgKeyPrefix:"last_name",validationId:"F_B_10_8"}]],"creditCardDetails.paymentOption.type":[["ruleCardTypeChanged",{affected:[$("#text_booking_security_code"),$("#sct_expire_month"),$("#sct_expire_year"),$("#sct_start_month"),$("#sct_start_year"),$("#text_booking_issue_number")]}]],"creditCardDetails.cardNumber":[["required",true,{msgKeyPrefix:"ccard_number",validationId:"F_B_18_1"}],["ruleSetCreditCardType",{$cardTypeField:$("#sct_booking_ccard_type")},{msgKeyPrefix:"ccard_number"}],["bfCreditCards",{cardTypeControlId:"sct_booking_ccard_type",validationIdPref:"F_B_18"},{msgKeyPrefix:"ccard_number"}],["ruleLuhnAlgorithm",{},{msgKeyPrefix:"ccard_number",validationId:"F_B_18_8"}]],"creditCardDetails.securityCode":[["required",true,{msgKeyPrefix:"security_code",validationId:"F_B_19_1"}],["bfSecurityCode",{cardTypeControlId:"sct_booking_ccard_type",validationIdPref:"F_B_19"},{msgKeyPrefix:"security_code"}]],"creditCardDetails.expiryMonth":[["required",true,{msgKeyPrefix:"expire_month",validationId:"F_B_21_3"}],["bfExpiry",{cardTypeControlId:"sct_booking_ccard_type",expiryMonthControlId:"sct_expire_month",expiryYearControlId:"sct_expire_year",startMonthControlId:"sct_start_month",startYearControlId:"sct_start_year"},{msgKeyPrefix:"expire_month",validationId:"F_B_21_4"}]],"creditCardDetails.expiryYear":[["required",true,{msgKeyPrefix:"expire_year",validationId:"F_B_22"}],["bfExpiry",{cardTypeControlId:"sct_booking_ccard_type",expiryMonthControlId:"sct_expire_month",expiryYearControlId:"sct_expire_year",startMonthControlId:"sct_start_month",startYearControlId:"sct_start_year"},{msgKeyPrefix:"expire_year",validationId:"F_B_22_4"}]],"billingInformation.country":[["required",true,{validationId:"F_B_26_2"}],["bfCountry",{affected:[$("#text_booking_telephone_number"),$("#sct_booking_state"),$("#text_booking_post_code")]},{validationId:"F_B_26_2"}]],"billingInformation.address1":[["ruleRemoveNotLatin1AndPlus",{vowels:l.UTF_VOWELS,ys:l.UTF_YS}],["required",true,{validationId:"F_B_27_1"}],["maxlength",28,{validationId:"F_B_27_2"}],["minlength",2,{validationId:"F_B_27_3"}]],"billingInformation.address2":[["ruleRemoveNotLatin1AndPlus",{vowels:l.UTF_VOWELS,ys:l.UTF_YS}],["required",false],["maxlength",28,{validationId:"F_B_28_3"}]],"billingInformation.city":[["ruleRemoveNotLatin1AndPlus",{vowels:l.UTF_VOWELS,ys:l.UTF_YS}],["ruleRemoveNumbers"],["required",true,{validationId:"F_B_29_5"}],["maxlength",20,{validationId:"F_B_29_1"}],["minlength",2,{validationId:"F_B_29_2"}]],agreeToTerms:[["required",true,{validationId:"F_B_7"}]]};n=$.format(f,0);o[n]=g.slice(0);console.assert(g[1][0]==="required");g.splice(1,1,["required",false,{msgKeyPrefix:"first_name"}]);g.pop();H[n]=13;n=$.format(q,0);o[n]=m.slice(0);m.pop();H[n]=15;H["billingInformation.firstName"]=13;H["billingInformation.lastName"]=15;H["billingInformation.county"]=2;for(j=1;j<k;j++){n=$.format(f,j);o[n]=g;H[n]=13;n=$.format(q,j);o[n]=m;H[n]=15}G=F.validate({onkeyup:function(i){P.hideError(i.id);P.highlight(i.id);this.clearLastError(i);if(U.hasExternalErrors()){U.update();C.set(d.hasFieldErrors())}},onfocusin:T,onfocusout:V,onclick:S,fieldsChanged:E,messageResolver:L,validateIfDirty:true,clearLastError:true,submitHandler:M,rules:o,messages:hcom.locale.validation.validatorMessages});F.valid(true);d=G.state;return o}N=function(){var z,AN,n,AK,g,AQ,h,f,t,AM,AO={},AC={},i={},AR={},AI,r,m,u,v,l,j,e,AL,AE=true,q,y='<option value="{0}">{1}</option>',AF="";function k(AV,AX){var AU=[$.format(y,"",AV)],AT,AS,AW;for(AW=0;(AS=AX[AW]);AW++){AT=AS.split("|");AU.push($.format(y,AT[0],AT[1]))}return AU.join("")}function w(AS,AV,AT,AU,AX){var AW;if(AS!==AV){AW=AT.hasOwnProperty(AV);if(AT.hasOwnProperty(AS)!==AW){if(AW){G.addRules(AU);P.rebuildFieldIndex();AX.show()}else{AX.hide();G.removeRules(Object.getKeys(AU));P.rebuildFieldIndex()}}}}function AJ(AS){w(e,AS,AO,u,z)}function AG(AS){w(e,AS,AC,m,AN)}function AD(AS){var AT;if(AS!==e){AT=r[r.hasOwnProperty(AS)?AS:"*"];if(f.attr("src")!==AT){f.attr("src",AT)}}}function x(AS){O.hideErrorBar();w(e,AS,AR,null,t)}function AA(AS){w(AL,AS,i,v,n)}function AB(AT){var AU=AI.hasOwnProperty(AT)?AI[AT]:undefined,AS="#sct_booking_state";if(AU){if(AU.label&&AU.stateList){AU=k(AU.label,AU.stateList);AI[AT]=AU}if(AL!==AT||AE){$("select",AK).html(AU);$(AS).removeAttr("disabled")}}else{if(AL!==AT||AE){$(AS).attr("disabled","disabled")}}w(AL,AT,AI,l,AK)}function AH(AT){var AU="00000",AS="label.postCode";if(AT==="US"){AS="label.zipCode"}if(AF!==AS){h.text(hcom.locale.validation.validatorMessages[AS]+" *");AF=AS}if(AL==="IE"&&AQ.val()===AU){AQ.val("")}if(AT==="IE"){AQ.val(AU);g.hide();G.removeRules(Object.getKeys(j));P.rebuildFieldIndex()}else{g.show();G.addRules(j);P.rebuildFieldIndex()}}function o(AS){var AT=$(AS.target).val();AJ(AT);AG(AT);AD(AT);x(AT);e=AT;if(!AE){hcom.booking.modules.sitecatalyst.onCardTypeSelection(AT)}}function AP(AS){var AT=$(AS.target).val();if(AE){q=AT}else{if(AT!==q){AM.show()}else{AM.hide()}}AA(AT);AB(AT);AH(AT);AL=AT}function p(AT,AS){for(var AV=0,AU;(AU=AT[AV]);AV++){AS[AU]=true}}return{init:function(AS,AV,AU,AX,AW){var AT=$("> div.booking_payment_details:first > div.container:first",F),AY=$("> div.booking_billing_address:first > div.container:first",F);p(["MAESTRO","SWITCH","SOLO","ELECTRON"],AO);p(["MAESTRO","SWITCH","SOLO","ELECTRON","DANKORT"],AC);p(["GB"],i);if(Z()){p(["MAESTRO"],AR)}AI=$.extend({},hcom.locale.booking.stateProvince);z=$("> div.issue_number:first",AT);AN=$("> div.start:first",AT);n=$("> div.county:first",AY);AK=$("> div.state_province:first",AY);g=$("> div.post_code:first",AY);AQ=$("#text_booking_post_code");h=AQ.parent().children("label[@for^='text_booking_post_code']");f=$("> div.security_code:first > div.security_image:first > img:first",AT);t=$("> div.booking_securecode_warning:first",F);AM=$("div.currency_mismatch",F);u=AV;m=AS;v=AU;l=AX;j=AW;r={AMEX:"/images/generic/payment-types/cc_amex_ccv.gif","*":"/images/generic/payment-types/cc_mastercard_ccv.gif"};e="";$("#sct_booking_ccard_type").bind("change.dynFields",o).trigger("change");AL="GB";$("#sct_booking_country").bind("change.dynFields",AP).trigger("change");AE=false},isSecCardSet:function(){return e==="MAESTRO"}}}();O=function(){var g,h,j=true,k=false;function l(o){var q=o.offset(),n=o.width(),p=o.height();return{top:q.top,right:q.left+n,bottom:q.top+p,left:q.left,width:n,height:p}}function f(){var p=$(window).scrollTop(),n=p+$(window).height(),r,q,o;h.show();o=l($(".col_6"));if(o.top<p){r=o.top}else{if(o.top>n){r=p-o.bottom+n}}q=Math.abs(r-p);$("html, body").animate({scrollTop:r},Math.min(q,1000),"swing",function(){h.focus()})}function m(){if(j){j=false;return }h.hide()}function e(n){var o=hcom.booking.modules.sitecatalyst.onSecureCode;if(n==="A"){o(Q(),"SecureCode Authenication failed")}else{if(n==="U"){o(Q(),"SecureCode system error")}else{if(n===""){o(Q(),"SecureCode certifacte error")}else{if(n==="N"){o(Q(),"SecureCode Authenication failure")}else{if(n==="Y"){o(Q(),"SecureCode Authenicated")}}}}}}function i(n){if(n===g.closeEventTypes.USER_CLOSE){console.info("USER_CLOSE");k=false}else{if(n===g.closeEventTypes.TURN_URL){console.info("TURN_URL");M()}else{if(n===g.closeEventTypes.RELOAD_COUNT_EXCEEDED){console.info("RELOAD_COUNT_EXCEEDED");f();k=false}else{if(n===g.closeEventTypes.UNKNOWN){console.info("UNKNOWN");f();k=false}}}}}return{init:function(){h=$("#booking_securecode_error_bar");g=hcom.booking.modules.securecode;g.addFrameCloseListener(R,i)},hideErrorBar:m,showErrorBar:f,getSecCodePaymentStarted:function(){return k},setSecCodePaymentStarted:function(n){k=n},setOmniture:e}}();return{init:function(){var e;b=hcom.booking.modules.holding;c=hcom.booking.modules.overlay;e=hcom.locale.booking;hcom.booking.modules.holding.setHotelData(e.hotelName,e.hotelLocation);D=new $.formatter(hcom.locale.validation.messages);a=hcom.userState.signedIn;F=$("#booking_form");F.bind("keydown.swallowEnter",function(f){if(f.which===13){if(!f.target.id||f.target.id!=="btn_submit_booking"){if($.browser.msie){f.returnValue=false}else{f.preventDefault()}return false}}});B.init();A.clearFields(F,["sct_booking_country"],["http://travel.ian.com/index.jsp?cid=270825"],"chbox_agree_to_terms","IANError","common_errormodule");Y.init();J();N.init({"creditCardDetails.startMonth":[["bfExpiryStart",{cardTypeControlId:"sct_booking_ccard_type",expiryMonthControlId:"sct_expire_month",expiryYearControlId:"sct_expire_year",issueNumberControlId:"text_booking_issue_number",startMonthControlId:"sct_start_month",startYearControlId:"sct_start_year",validationIdPref:"F_B_23"},{msgKeyPrefix:"start_date"}]],"creditCardDetails.startYear":[["bfExpiryStart",{cardTypeControlId:"sct_booking_ccard_type",issueNumberControlId:"text_booking_issue_number",expiryMonthControlId:"sct_expire_month",expiryYearControlId:"sct_expire_year",startMonthControlId:"sct_start_month",startYearControlId:"sct_start_year",validationIdPref:"F_B_24"},{msgKeyPrefix:"start_date"}]]},{"creditCardDetails.issueNumber":[["bfIssueNumber",{cardTypeControlId:"sct_booking_ccard_type",startMonthControlId:"sct_start_month",startYearControlId:"sct_start_year",validationIdPref:"F_B_25"},{msgKeyPrefix:"issue_number"}],["ruleZeroPadding",{digits:2}]]},{},{"billingInformation.stateProvince":[["bfState",{countryControlId:"sct_booking_country"},{validationId:"F_B_31_1"}]]},{"billingInformation.postalCode":[["required",true,{msgKeyPrefix:"bfPostCode",validationId:"F_B_32_3"}],["bfPostCode",{countryControlId:"sct_booking_country",validationIdPref:"F_B_32"}],["maxlength",10,{validationId:"F_B_32_2"}]]});P.init();U=hcom.booking.modules.errorpopdiv;U.setMessageMap({chbox_agree_to_terms:hcom.locale.validation.validatorMessages["bookingform.iagree"]}).setFieldHandler(P).setFormState(d).setFormatter(D);C.init();O.init();(function(){var f=hcom.common.modules.simplepopdiv,g=$("> div.booking_booking_details:first div.sms:first div.icon_sprite_information",F);X=new f("cellDisclaimer","#popdiv_cellDisclaimer",g,[]).setPositioning(g,f.positionTypes.BOTTOM_CENTER)})();$("#text_room_first_name_0").focus();$("#ajax").attr("value","true")}}}});$.registerModule({name:"hcom.booking.modules.coupon",dependencies:["hcom.booking.modules.validator.rules","hcom.common.modules.state","hcom.booking.modules.sitecatalyst","hcom.booking.modules.overlay","hcom.common.modules.simplepopdiv"],impl:function(D){var I,E,C,J,L,F,M;I=function(){var P,S=false,Q;function N(V){if(P!==V){Q.addClass("error").find("span.message:first").text(V);P=V;hcom.booking.modules.sitecatalyst.onValidationError("Merchant","BAD_COUPON")}}function T(){var V="couponIdentifier.code";if(S){S=false;Q.removeClass("active")}if(!P&&E.errors[V]){N(E.errors[V].message)}}function O(){if(S){T()}if(!P){S=true;Q.addClass("active")}}function R(){if(P){Q.removeClass("error");P=undefined}}function U(){Q=$("#text_discountcode").parent()}return{highlight:O,unhighlight:T,showError:N,hideError:R,init:U}}();J=function(){var P=false,O,N;function R(S){if(S!==P){if(S){N.css({height:O.height()})}N[S?"show":"hide"]();P=S}}function Q(){N=$("#booking_overlay").css({opacity:0.85});O=N.parent()}return{setVisible:R,init:Q}}();L=function(){var V,U,Y,P,W,Q,N,c,X,R,a,d;function T(f){f.hide()}function e(f){f.show()}function b(f){$.map([Y,U],f?e:T);P[f?"hide":"show"]()}function S(f,g){console.assert(!V);Q.text(f.total);W.text(f.discount);N.text(f.averageNightly);c.text(f.subtotal);X.text(f.taxes);R.text(f.offer);d.text(f.couponTerms);if(a){a.text(f.charged)}F=f.couponId;b(g)}function O(h){h.preventDefault();J.setVisible(true);F=undefined;var g=$("#booking_form");var f=hcom.common.modules.state.formSerialize(g);$.ajax({url:"/booking/apply_coupon.html",dataType:"xml",type:"POST",data:f,success:function(j){var i={};$("coupon-applied > *",j).map(function(){i[this.nodeName]=$(this).attr("value")});S(i,false);hcom.booking.modules.sitecatalyst.onCouponRemove()},error:function(j,k,i){},complete:function(i,j){J.setVisible(false)}})}function Z(){U=$("tr.discount:first",M);V=U.css("display")!=="none";Y=U.prev();Q=$("tfoot:first td.price:first strong:first",M);a=$("tfoot:first tr:eq(1) td.price");W=$("td.price:first span:first",U);N=$("thead:first tr:first td.price",M);c=$("tbody:first tr:first td.price");R=$("thead:first tr.offer td.price");X=$("tbody:first tr:eq(1) td.price");d=$("#popdiv_terms_and_conditons_content");P=$("> div:first",M);$("#btn_removeDiscount").bind("click.coupon",O)}return{init:Z,applyDiscount:S,removeDiscount:O}}();function G(N){$.validator.defaults.onfocusout.call(this,N);I.unhighlight(N.id)}function A(N){$.validator.defaults.onfocusin.call(this,N);I.highlight(N.id)}function H(P,N,O){$.each($.extend({},N.added,N.changed),function(){I.showError(this.message)});$.each(N.removed,function(){I.hideError()})}function K(O,R,Q){var S=$.trim($("#text_discountcode").val());if(S){J.setVisible(true);var P=$("#booking_form"),N=hcom.common.modules.state.formSerialize(P);N["couponIdentifier.code"]=S;$.ajax({url:"/booking/apply_coupon.html",dataType:"xml",type:"POST",data:N,success:function(W){var U={};$("coupon-applied > *",W).map(function(){U[this.nodeName]=$(this).attr("value")});if(U.valid==="true"){hcom.booking.modules.sitecatalyst.onCouponAccept(U.couponId);L.applyDiscount(U,true)}else{var X=$("> coupon-applied",W),V=[],T;if(X.length===0){console.error("invalid response")}else{$("> errors > error",X).each(function(){V.push($(this).attr("description"))});I.showError(V.join("<br />"));T=$("> overlay:first",X);if(T.length===1){hcom.booking.modules.overlay.show(T.attr("type"),T.text())}}}},error:function(U,V,T){},complete:function(T,U){J.setVisible(false)}})}return false}function B(){var O=hcom.common.modules.simplepopdiv,P,Q,N;P=new O("gdsPPRPNPD","#popdiv_gdspprpn","#lnk_explPopup",["a.close_button:first","a.close_link:first"]).setPositioning($("#lnk_explPopup"),O.positionTypes.BOTTOM_CENTER);N=$(".popdiv_terms_and_conditons_open:first",M);P=new O("termsPopDiv","#popdiv_terms_and_conditons",N,["a.close_button:first","a.close_link:first"]).setPositioning($("span.openpopup:first",N),O.positionTypes.BOTTOM_CENTER);Q=$("a.discountcode_info:first",M);P=new O("discountPopDiv","#popdiv_discountcode",[$("label[for='text_discountcode']",M),Q],["a.close_button:first","a.close_link:first"]).setOnClose(function(){$("#chbox_booking_email_deals")[0].checked=$("#chbox_discount_email_deals")[0].checked}).setOnOpen(function(){$("#chbox_discount_email_deals")[0].checked=$("#chbox_booking_email_deals")[0].checked}).setPositioning(Q,O.positionTypes.BOTTOM_CENTER)}return{init:function(){M=$("#booking_discount_form");C=M.validate({onkeyup:I.hideError,onfocusin:A,onfocusout:G,fieldsChanged:H,messages:hcom.locale.validation.validatorMessages,submitHandler:K,rules:{"couponIdentifier.code":[["requiredCoupon",true,{msgKeyPrefix:"discountcode"}],["regexp",/^(?:[0-9A-Z]+_)*[0-9A-Z]+(?:-[0-9]{1,23})?$/i]]}});M.valid(true);E=C.state;J.init();I.init();L.init();B()},getCurrentCouponId:function(){return F}}}});$.registerModule({dependencies:["hcom.booking.modules.validator.rules","hcom.common.modules.state"],name:"hcom.booking.modules.signin",impl:function(C){var P,L,N,O,E,I,B,G;function H(){var Q=$("#supplierType").val();if(Q==="SABRE"||Q==="WORLDSPAN"){return"GDS"}else{if(Q==="VENERE"){return"Venere"}else{return"Merchant"}}}function D(Q){if(O!==Q){L.toggleClass("closed");O=Q}}G=function(){var T,R,Q;function V(W){if(W!==Q){if(!$.browser.msie){R.attr("type",W?"submit":"button")}T[W?"removeClass":"addClass"]("notActive");Q=W}return Q}function S(){var W=E.lastActive;if(W){B.element(W)}}function U(){R=$("#btn_signin");T=R.parents(":eq(1)");Q=R.attr("type")==="submit";V(!E.hasFieldErrors());T.bind("mouseover.validateLast",function(){S()})}return{init:U,set:V,isEnabled:function(){return Q}}}();I=function(){var X={},W,R,a,T;function d(){var e="> p.error_message:eq(1) > span:eq(1)";a=$("> p.error_message:first > span:eq(1)",P);T=$(e,P);if(!T.length){P.append(a.parent().clone());T=$(e,P);console.assert(T.length>0)}}function Y(g,f,e){$(document.getElementById(g)).parent()[f?"addClass":"removeClass"](e)}function V(g,e,f){if(e){g.text(f).parent().show()}else{g.parent().hide()}return f}function U(g,f,e){if(X[g]!==f){Y(g,true,"error");R=V(a,true,f);X[g]=f;hcom.booking.modules.sitecatalyst.onValidationError(H(),e)}}function b(f){var e;if(X.hasOwnProperty(f)){Y(f,false,"error");delete X[f];for(e in X){if(X.hasOwnProperty(e)){R=V(a,true,X[e]);break}}if(!e){V(a,false)}}}function Z(f){var e=document.getElementById(f).name;if(W===f){Y(f,false,"active")}if(!X[f]&&E.errors[e]){U(f,E.errors[e].message,E.errors[e].validationId)}}function S(f){var e=X.hasOwnProperty(f)?X[f]:undefined;if(W&&W!==f){Z(W)}if(!e){W=f;Y(f,true,"active")}else{if(R!==e){R=V(a,true,e)}}}function c(e){V(T,true,e)}function Q(){V(T,false)}return{init:d,highlight:S,unhighlight:Z,showError:U,hideError:b,showGlobalError:c,hideGlobalError:Q}}();function K(S,Q,R){$.each($.extend({},Q.added,Q.changed),function(){I.showError(this.element.id,this.message,this.validationId)});$.each(Q.removed,function(){I.hideError(this.element.id)});G.set(!E.hasFieldErrors())}function J(Q){$.validator.defaults.onfocusout.call(this,Q);I.unhighlight(Q.id)}function A(Q){$.validator.defaults.onfocusin.call(this,Q);I.highlight(Q.id)}function F(T){var R=$("#booking_form")[0].elements,S,Q;hcom.common.modules.state.formRestoreConditional(T,$("#booking_form"));for(Q=0;(S=R[Q]);Q++){if(T.hasOwnProperty(S.name)){$(S).valid()}}}function M(){if(G.isEnabled()){var Q=hcom.common.modules.state.formSerialize(P);G.set(false);I.hideGlobalError();$.ajax({url:"/booking/sign_in.html",dataType:"xml",type:"POST",data:Q,success:function(S){var V=$(S).find("sign-in-result"),T={},R=0,U;$("> booking-form-entry",V).each(function(){var W=$(this);T[W.attr("key")]=W.attr("value");R++});if(R){F(T)}U=$("> global-error:first",V).attr("value");if(!U){U=$("> field-error:first",V).attr("value")}if(U){I.showGlobalError(U)}else{N.show();L.hide()}console.info("sign in request was successfull")},error:function(S,T,R){I.showGlobalError("Sorry, we are unable to process your request, please try again in a few moments.")},complete:function(R,S){console.info("sign in request completed");G.set(true)}})}return false}return{init:function(){L=$("#booking_signin");if(L.length){N=$("#booking_signout");P=$("#booking_signin_form");B=P.validate({onkeyup:function(Q){I.hideError(Q.id);this.clearLastError(Q)},onfocusin:A,onfocusout:J,fieldsChanged:K,submitHandler:M,clearLastError:true,rules:{email:[["required",true,{msgKeyPrefix:"bfEmailCommon",validationId:"F_B_34_1"}],["minlength",5,{msgKeyPrefix:"bfEmailCommon",validationId:"F_B_34_7"}],["maxlength",50,{msgKeyPrefix:"bfEmailCommon",validationId:"F_B_34_6"}],["bfEmail",{tldList:hcom.locale.validation.data.tldList,validationIdPref:"F_B_34"}]],password:[["required",true,{validationId:"F_B_35_4"}],["minlength",8,{validationId:"F_B_35_1"}]]},messages:hcom.locale.validation.validatorMessages});P.valid(true);E=B.state;I.init();G.init();O=L.hasClass("closed");$.listen("click","a#lnk_signin_toggle",function(Q){D(!O);Q.preventDefault()})}}}}});$.registerModule({name:"hcom.booking.modules.validator.rules",dependencies:["hcom.common.crc"],impl:function(N){var I,S,D={AMEX:"AMEX",Airplus:"AIRPLUS",CarteBlanche:"CARTE_BLANCHE",CarteBleue:"CARTE_BLEUE",CarteSi:"CARTE_SI",Dankort:"DANKORT",Delta:"DELTA",Discover:"DISCOVER",Diners:"DINERS_CLUB",Electron:"ELECTRON",JCB:"JCB",Maestro:"MAESTRO",Mastercard:"MASTERCARD",Solo:"SOLO",Switch:"SWITCH",Visa:"VISA",Postepay:"POSTEPAY"},L={13:{4:"VISA"},14:{304:"DINERS_CLUB",305:"DINERS_CLUB",36:"DINERS_CLUB",38:"DINERS_CLUB",389:"CARTE_BLANCHE",60:"DINERS_CLUB",94:"CARTE_BLANCHE",95:"CARTE_BLANCHE"},15:{34:"AMEX",35:"JCB",37:"AMEX"},16:{35:"JCB",4:"VISA",4137:"VISA",4462:"VISA",45:"VISA",450875:"VISA",4571:"VISA",46:"VISA",48:"VISA",4844:"VISA",49:"VISA",4903:"VISA",4911:"VISA",4917:"VISA",491880:"VISA",4936:"VISA",5020:"MAESTRO",5038:"MAESTRO",51:"MASTERCARD",52:"MASTERCARD",53:"MASTERCARD",54:"MASTERCARD",55:"MASTERCARD",564182:"SWITCH",60110:"DISCOVER",60112:"DISCOVER",60114:"DISCOVER",60119:"DISCOVER",63:"SWITCH",6304:"MAESTRO",6334:"SOLO",67:"SOLO",6759:"MAESTRO",6761:"MAESTRO"},18:{4903:"VISA",4911:"VISA",4936:"VISA",5020:"MAESTRO",5038:"MAESTRO",564182:"SWITCH",63:"SWITCH",6304:"MAESTRO",6334:"SOLO",67:"SOLO",6759:"MAESTRO",6761:"MAESTRO"},19:{4903:"VISA",4911:"VISA",4936:"VISA",5020:"MAESTRO",5038:"MAESTRO",564182:"SWITCH",63:"SWITCH",6304:"MAESTRO",6334:"SOLO",67:"SOLO",6759:"MAESTRO",6761:"MAESTRO"}},O={VISA:[D.Visa,D.Postepay,D.Electron,D.Delta]};function G(W){return parseInt(arguments.callee.re.exec(W.name)[1],10)}G.re=/\[([0-9]+)\]/;function M(W){return W.replace(arguments.callee.re,"")}M.re=/[^\d]+/g;function A(X,a,Z){var W=$(["#",a,String(X)].join("")).val(),Y=$(["#",Z,String(X)].join("")).val();if(typeof W==="undefined"||typeof Y==="undefined"){return false}if(W.length&&Y.length){return[W,Y].join(" ")}else{if(W.length&&!Y.length){return W}else{if(!W.length&&Y.length){return Y}}}return false}function K(W){return $(["#"+W].join("")).parent().children(["label[@for^='",W,"']"].join("")).text()}function V(X){var Y=document.getElementById(X),W=Y?Y.selectedIndex:-1;return{selectedItem:W>=0?Y.options[Y.selectedIndex]:undefined,defaultItem:W>=0?Y.options[0]:undefined}}function F(c,b){var X="",Z,W=0,d="",Y=0,a=false;for(Z=0;Z<c.length;Z++){X=c.charAt(Z).toLowerCase();if(d===""){d=X;Y++;W=Y}else{if(d!==""&&d===X){Y++;if(Y>W){W=Y}}else{Y=1;d=X}}}if(W>b){a=true}return a}function P(Y,X){var W,Z=false;for(W=0;W<Y.length;W++){if(X.indexOf(Y.charAt(W))>=0){Z=true;break}}return Z}function Q(Z,W){var X=false;var Y=O[Z];if(Y!==undefined){X=$.inArray(W,O[Z])===-1?false:true}return X}function C(Y,a){var W,X={},Z=false;X.contains=false;X.chToVisa=false;if(Y.length===0){return X}for(W=0;W<Y[0].length;W++){if(Y[0].options[W].value===a){X.contains=true}if(Y[0].options[W].value===D.Visa){Z=true}}X.chToVisa=!X.contains&&(a===D.Delta)&&Z;X.contains=X.contains||X.chToVisa;return X}function R(c,d,f,b,X){var a=0,Z,W=0,e=false,Y=false;if(!arguments.callee.re){arguments.callee.re={letters:new RegExp(["[a-zA-Z",d,f,"\\_\\-\\.\\(\\)\\' ]+"].join(""),"i"),vowels:new RegExp(["[",d,"]+"].join(""),"i")}}if(!arguments.callee.test){arguments.callee.test=function(g,h,i){return i?g.vowels.test(h):(g.letters.test(h)&&!g.vowels.test(h))}}for(Z=0;Z<c.length;Z++){if(arguments.callee.test(arguments.callee.re,c.charAt(Z),X)){if(!e){a=1;e=true}else{a++;if(a>W){W=a}}}else{e=false}}if(W>b){Y=true}return Y}function U(Z){var X,Y,W;W=L[Z.length];if(typeof (W)==="undefined"){return"unknown"}Y=[];for(X in W){if(W.hasOwnProperty(X)){Y.push(X)}}Y.sort();for(X=Y.length;X>=0;X--){if(Z.indexOf(Y[X])===0){return W[Y[X]]}}return"unknown"}function T(X,Z){var Y,W;Y=V(X);W=V(Z);return Y.selectedItem.text===Y.defaultItem.text||W.selectedItem.text===W.defaultItem.text}function H(Z){var Y={},W=0,X;for(X=0;X<Z.length;X++){if(typeof Y[Z.charAt(X)]==="undefined"){Y[Z.charAt(X)]=1;W++}}return W}function E(b){var X,a=0,Y,W=1,Z=false;for(Y=b.length-1;Y>=0;Y--){X=Number(b.charAt(Y))*W;if(X>9){a=a+1;X=X-10}a=a+X;if(W===1){W=2}else{W=1}}if(a%10!==0){Z=false}else{Z=true}return Z}function J(Z,Y){var W,X=0;for(W=0;W<Z.length;W++){if(Y.indexOf(Z.charAt(W))>=0){X++}}return X}function B(X,Y){var W;for(W=0;W<X.length;W++){if(X.options[W].text===Y){X.selectedIndex=W;break}}}I={ruleAcceptOnlyUnicode:function(X,W,Y){if(!new RegExp(["^[a-zA-Z",Y.vowels,Y.ys,"\\_\\-\\.\\(\\)\\' ]+$"].join("")).test(X)){return new $.validator.result(false,"contains.invalidChars")}return new $.validator.result(true)},ruleDisallowNumber:function(X,W,Y){if(/[0-9]+/.test(X)){return new $.validator.result(false,"contains.number")}return new $.validator.result(true)},ruleDisallowSpecialWords:function(X,W,Y){if(new RegExp(["\\b(",Y.specialWords,")\\b"].join(""),"i").test(X)){return new $.validator.result(false,Y.messageKey)}return new $.validator.result(true)},ruleLastNameVowels:function(Y,W,Z){var X=J(Y,Z.vowels+Z.ys);if(Y.length>=13&&X<3){return new $.validator.result(false,"3vowels").setValidationId(Z.validationIdPref)}else{if(Y.length<13&&Y.length>=9&&X<2){return new $.validator.result(false,"2vowels").setValidationId([Z.validationIdPref,"_1"].join(""))}else{if(Y.length<9&&X<1){return new $.validator.result(false,"1vowel").setValidationId([Z.validationIdPref,"_2"].join(""))}}}return new $.validator.result(true)},ruleLuhnAlgorithm:function(Y,W,Z){var X=M(Y);if(!E(X)&&hcom.common.crc.getDigest(hcom.common.crc.presets.crc32,X.asCharValueArray())!==1134749337){return new $.validator.result(false,"reenter.card.number")}return new $.validator.result(true)},ruleCardTypeChanged:function(X,W,Y){return new $.validator.result(true).setAffected(Y.affected)},ruleMinimumOneConsonant:function(Z,Y,a){var W=0;if(!arguments.callee.re){arguments.callee.re={letters:new RegExp(["[a-zA-Z",a.vowels,a.ys,"\\_\\-\\.\\(\\)\\' ]+"].join(""),"i"),vowels:new RegExp(["[",a.vowels,"]+"].join(""),"i")}}if(!arguments.callee.test){arguments.callee.test=function(b,c){return b.letters.test(c)&&!b.vowels.test(c)}}for(var X=0;X<Z.length;X++){if(arguments.callee.test(arguments.callee.re,Z.charAt(X))){W++}}if(W===0){return new $.validator.result(false,"consonant.min")}return new $.validator.result(true)},ruleMinimumOneVowel:function(X,W,Y){if(X.length>0&&!P(X,Y.vowels+Y.ys)){return new $.validator.result(false,"contains.noVowel")}return new $.validator.result(true)},ruleRepeatation:function(a,Y,b){var X,Z,W;if(a.length<2){return new $.validator.result(false,"min2Chars").setMessageParams(K(Y.id)).setValidationId(typeof b.validationIdPref!=="undefined"?b.validationIdPref+"_1":undefined)}if(F(a,3)){return new $.validator.result(false,"contains.repeatedChars").setMessageParams(K(Y.id)).setValidationId(typeof b.validationIdPref!=="undefined"?b.validationIdPref:undefined)}if(R(a,b.vowels,b.ys,5,true)){return new $.validator.result(false,"max5ConsecutiveVowels").setMessageParams(K(Y.id)).setValidationId(typeof b.validationIdPref!=="undefined"?b.validationIdPref+"_2":undefined)}Z=5;X="allow5ConsecutiveConsonants";W="_5";if(a.length>9){Z=6;X="allow6ConsecutiveConsonants";W="_4"}if(R(a,b.vowels,b.ys,Z,false)){return new $.validator.result(false,X).setMessageParams(K(Y.id)).setValidationId(typeof b.validationIdPref!=="undefined"?b.validationIdPref+W:undefined)}return new $.validator.result(true)},ruleRemoveNotLatin1AndPlus:function(X,W,Y){W.value=X.replace(new RegExp(["[^0-9a-zA-Z",Y.vowels,Y.ys,"\\_\\-\\.\\(\\)\\' ]+"].join(""),"ig"),"");return new $.validator.result(true)},ruleRemoveNumbers:function(X,W,Y){W.value=X.replace(/\d+/g,"");return new $.validator.result(true)},ruleSetCreditCardType:function(X,W,Z){var Y;var a={};console.assert(Z.$cardTypeField.length);Y=U(M(X));a=C(Z.$cardTypeField,Y);if(a.chToVisa){Y=D.Visa}if((Y!=="unknown")&&(!a.contains)){return new $.validator.result(false,"notAllowedCardType")}else{if((Z.$cardTypeField.val()==="")||(Y!=="unknown")&&(Z.$cardTypeField.val()!==Y)&&!Q(Y,Z.$cardTypeField.val())){Z.$cardTypeField.val(Y).trigger("change")}}return new $.validator.result(true)},ruleZeroPadding:function(Z,Y,a){if(Z.length>0){var W=a.digits-Z.length;for(var X=0;X<W;X++){Y.value="0"+Y.value}}return new $.validator.result(true)},bfCreditCards:function(h,d,b){var a,Z,W,g,e,f="",Y=false,X="",c=M(h);W=V(b.cardTypeControlId);Y=false;switch(W.selectedItem.value){case D.Visa:case D.Postepay:case D.Airplus:case D.CarteBleue:a=[13,16];g="contains.digits13Or16AndNoSpaces";X="_2";f=W.selectedItem.text;break;case D.CarteBlanche:case D.Diners:a=[14];g="contains.digits14AndNoSpaces";X="_3";break;case D.AMEX:a=[15];g="contains.digits15AndNoSpaces";X="_4";break;case D.JCB:a=[15,16];g="contains.digints15Or16AndNoSpaces";X="_5";break;case D.Mastercard:case D.Discover:case D.Electron:case D.Dankort:case D.Delta:case D.CarteSi:a=[16];g="contains.digits16AndNoSpaces";X="_6";break;case D.Solo:case D.Switch:case D.Maestro:a=[16,18,19];g="contains.digits16Or18Or19AndNoSpaces";X="_7";f=W.selectedItem.text;break;default:a=[];g="";X="";break}if(g===""){Y=true}else{for(e=0;e<a.length;e++){if(c.length===a[e]){Y=true;break}}}if(!Y){return new $.validator.result(false,g).setMessageParams(f).setValidationId(typeof b.validationIdPref!=="undefined"?[b.validationIdPref,X].join(""):undefined)}Y=false;switch(W.selectedItem.value){case D.Maestro:Z=[5020,5038,6304,6759,6761];g="contains.maestro.digits16Or18Or19AndNoSpaces";X="_10";break;case D.Diners:Z=[304,305,36,38,60];g="contains.digits14AndNoSpaces";X="_11";break;case D.AMEX:Z=[34,37];g="contains.digits15AndNoSpaces";X="_12";break;case D.JCB:Z=[35];g="contains.digints15Or16AndNoSpaces";X="_13";break;case D.Visa:case D.Postepay:case D.CarteBleue:case D.CarteSi:case D.Airplus:Z=[4];g="contains.digits16AndNoSpaces";X="_14";break;case D.Delta:Z=[4137,4462,45,46,48,49];g="contains.delta.digits16AndNoSpaces";X="_15";break;case D.Electron:Z=[450875,4844,4917,491880];g="electron.digits16AndNoSpaces";X="_16";break;case D.Dankort:Z=[4571];g="dankort.digits16AndNoSpaces";X="_17";break;case D.Switch:Z=[4903,4911,4936,564182,63,6759];g="switch.digits16Or18Or19AndNoSpaces";X="_18";break;case D.Mastercard:Z=[51,52,53,54,55];g="contains.digits16AndNoSpaces";X="_19";break;case D.Discover:Z=[60110,60112,60113,60114,60119];g="contains.digits16AndNoSpaces";X="_20";break;case D.Solo:Z=[6334,67];g="solo.digits16Or18Or19AndNoSpaces";X="_21";break;case D.CarteBlanche:Z=[94,95,389];g="contains.digits14AndNoSpaces";X="_22";break;default:Z=[];g="";X="";Y=true;break}for(e=0;e<Z.length;e++){if(c.indexOf(Z[e].toString())===0){Y=true;break}}if(!Y){return new $.validator.result(false,g).setValidationId(typeof b.validationIdPref!=="undefined"?[b.validationIdPref,X].join(""):undefined)}return new $.validator.result(true)},bfEmail:function(Y,X,Z){var W;if(!arguments.callee.re){arguments.callee.re={RFC822:/^[a-zA-Z0-9\@!#\$\%\&\'\*\+\-\/=\?\^_`{\|}~\.]+$/,parts:/([^@]+)@(.*)/}}if(!arguments.callee.test){arguments.callee.test=function(j,h){var f=h.indexOf("@"),b,c,g,a,e,d;if(h.indexOf("..")>=0){return["consecFullStops","2"]}if(f===0){return["startsWithAt","3"]}if(f===-1){return["noAt","9"]}if(h.indexOf("@",f+1)>=0){return["moreAt","11"]}if(h.indexOf(" ")>=0){return["spaces","12"]}if(!j.RFC822.test(h)){return["rfc822",10]}b=j.parts.exec(h);g=b[1];c=b[2];a=c.substring(c.lastIndexOf(".")+1).toUpperCase();if(c.indexOf(".")===0){return["domainStartFullStop","4"]}if(c.length<2){return["domainShort","8"]}for(d=0;(e=Z.tldList[d]);d++){if(e===a){break}}if(e!==a){return["invalidTLD","5"]}}}W=arguments.callee.test(arguments.callee.re,Y);return !W?new $.validator.result(true):new $.validator.result(false,["bfEmail",W[0]].join(".")).setValidationId(typeof Z.validationIdPref!=="undefined"?[Z.validationIdPref,"_",W[1]].join(""):undefined)},bfExpiry:function(g,a,Z){var W,X=Z.expiryMonthControlId,c,e,Y=Z.expiryYearControlId,f,b=Z.startMonthControlId,d=Z.startYearControlId;W=V(Z.cardTypeControlId);if(W.selectedItem.value===D.Dankort&&T(X,Y)&&!T(b,d)){B($(["#",X].join(""))[0],V(b).selectedItem.text);c=parseInt(V(d).selectedItem.text,10)+12;e=$(["#",Y].join(""))[0];if(e.options[1].text>c){f=document.createElement("option");f.value=c;f.appendChild(document.createTextNode(c));e.insertBefore(f,e.options[1]);e.selectedIndex=1}}else{if(W.selectedItem.value===D.Dankort&&T(X,Y)&&T(b,d)){return new $.validator.result(false,"select")}}return new $.validator.result(true)},bfExpiryStart:function(a,Y,b){var W=V(b.cardTypeControlId),X=T(b.startMonthControlId,b.startYearControlId),Z=V(Y.id===b.startYearControlId?b.startMonthControlId:b.startYearControlId);if(W.selectedItem.value===D.Dankort&&X&&T(b.expiryMonthControlId,b.expiryYearControlId)){return new $.validator.result(false,"required.dankort.expiry.date").setValidationId(typeof b.validationIdPref!=="undefined"?[b.validationIdPref,"_1"].join(""):undefined)}if((W.selectedItem.value===D.Solo||W.selectedItem.value===D.Maestro||W.selectedItem.value===D.Switch)&&X&&!(a.length===0&&Z.selectedItem.value.length===0&&/^\d{1,2}$/.test($(["#",b.issueNumberControlId].join(""))[0].value))){return new $.validator.result(false,"required.solo.issue.number").setMessageParams(W.selectedItem.text).setValidationId(typeof b.validationIdPref!=="undefined"?[b.validationIdPref,"_2"].join(""):undefined)}return new $.validator.result(true).setAffected([$(["#",b.startYearControlId].join("")),$(["#",b.startMonthControlId].join("")),$(["#",b.issueNumberControlId].join(""))])},bfCountry:function(X,W,Y){var Z;if(X.length!==2){return new $.validator.result(false,"required")}Z=$.grep(Y.affected,function(a,b){return a.length>0});return new $.validator.result(true).setAffected(Z)},bfCoupon:function(a,X,b){var Y=$(["#",b.btn].join("")),Z,W=a.length>0;Z=Y.parents(":eq(1)");if(W){Y.removeAttr("disabled")}else{Y.attr("disabled","true")}Z[W?"removeClass":"addClass"]("notActive");return new $.validator.result(true)},bfIssueNumber:function(a,Z,b){var W,X=b.startMonthControlId,Y=b.startYearControlId;W=V(b.cardTypeControlId);if((W.selectedItem.value===D.Switch||W.selectedItem.value===D.Solo||W.selectedItem.value===D.Maestro)&&(a===""&&T(X,Y))){return new $.validator.result(false,"required.switch.issue.number").setValidationId(typeof b.validationIdPref!=="undefined"?[b.validationIdPref,"_1"].join(""):undefined)}if(W.selectedItem.value===D.Solo&&a.length!==2){return new $.validator.result(false,"length").setValidationId(typeof b.validationIdPref!=="undefined"?[b.validationIdPref,"_3"].join(""):undefined)}if(a.length>0&&new RegExp("[^\\d]+").test(a)){return new $.validator.result(false,"only.numeric.chars").setValidationId(typeof b.validationIdPref!=="undefined"?[b.validationIdPref,"_4"].join(""):undefined)}return new $.validator.result(true).setAffected([$(["#",b.startMonthControlId].join("")),$(["#",b.startYearControlId].join(""))])},bfPostCode:function(X,W,Z){var Y=V(Z.countryControlId);if(Y.selectedItem.value==="US"&&X.length<5){return new $.validator.result(false,"bfPostCode.length.min.us").setValidationId(typeof Z.validationIdPref!=="undefined"?[Z.validationIdPref,"_1"].join(""):undefined)}else{if(X.length<4){return new $.validator.result(false,"bfPostCode.length.min.notUS").setValidationId(typeof Z.validationIdPref!=="undefined"?[Z.validationIdPref,"_4"].join(""):undefined)}}return new $.validator.result(true)},bfSecurityCode:function(e,a,Z){var X=[],d,b,c,Y=false,W="";c=$(["#",Z.cardTypeControlId].join(""))[0];if(c.options[c.selectedIndex].value!==D.AMEX){d="security.code.alltype";X=[3];W="_2"}else{d="security.code.amex";X=[3,4];W="_3"}for(b=0;b<X.length;b++){if(e.length===X[b]){Y=true;break}}if(!Y){return new $.validator.result(false,d).setValidationId(typeof Z.validationIdPref!=="undefined"?[Z.validationIdPref,W].join(""):undefined)}if(!/^\d*$/.test(e)){return new $.validator.result(false,"invalid.chars").setValidationId(typeof Z.validationIdPref!=="undefined"?[Z.validationIdPref,"_4"].join(""):undefined)}return new $.validator.result(true)},bfState:function(Z,X,b){var a,Y,W;a=V(b.countryControlId);Y=V(X.id);W=!a.selectedItem||($.inArray(a.selectedItem.value,["US","CA","AU"])!==-1)&&(!Y.selectedItem||!Y.defaultItem||Y.selectedItem.text===Y.defaultItem.text);return new $.validator.result(!W,W?"bfState.required":undefined)},bfTelephoneNumber:function(Z,X,a){var W,Y;if(new RegExp("[a-zA-Z]+").test(Z)){return new $.validator.result(false,"contains.letters").setValidationId(typeof a.validationIdPref!=="undefined"?[a.validationIdPref,"_2"].join(""):undefined)}Y=$(["#",a.countryControlId].join(""))[0];W=6;if(Y.options[Y.selectedIndex].value==="US"){W=9}if(Z.length<W){return new $.validator.result(false,"minlength").setValidationId(typeof a.validationIdPref!=="undefined"?[a.validationIdPref,"_3"].join(""):undefined)}if(H(Z)<2){return new $.validator.result(false,"minimum.distinct.chars").setValidationId(typeof a.validationIdPref!=="undefined"?[a.validationIdPref,"_4"].join(""):undefined)}return new $.validator.result(true)},bfUniqueNameHelper:function(X,W,Y){return new $.validator.result(true).setAffected(Y.affected)},bfUniqueName:function(d,a,Y){var e,X,b,c=false,W=true,Z=G(a);X=A(Z,Y.firstNamePrefix,Y.lastNamePrefix);if(X!==false&&X.length>0){for(b=0;b<Y.numberOfRooms;b++){if(b===Z&&c){W=false;break}else{if(b===Z){continue}}e=A(b,Y.firstNamePrefix,Y.lastNamePrefix);if(e===false){break}else{if(e===X&&b<Z&&!c){c=true}else{if(e===X&&b>Z&&c){W=false;break}}}}}return new $.validator.result(W,"bfUniqueName").setAffected(Y.affected)},copyValue:function(Z,Y,a){var W=$(a.target),c=$(Y),X=c.val(),b;if(!!a.blank||!!X){if(!!a.overwrite||!W.val()){W.val(X);b=[W[0]]}}return new $.validator.result(true).setAffected(b||[])},requiredCoupon:function(Y,X,Z){var W=$.validator.methods.required.apply(this,arguments);if(!W.valid){W.setMessageParams("A-Z-0-9").setValidationId("F_B_33_2")}return W},requiredIfOtherIsEmpty:function(a,X,c){var b=c.other.val().length===0,Z=a.length===0,Y=c.primary!==false,W=new $.validator.result((b&&!Z)||!b||(!Y&&Z),"required").setExclusive((!b&&Z)||(!Y&&Z));W.setAffected([c.other[0]]);return W}};S={};return{init:function(){var W;for(W in I){if(I.hasOwnProperty(W)){$.validator.addMethod(W,I[W],S[W])}}}}}});$.registerModule({name:"hcom.booking.modules.holding",dependencies:["hcom.common.modules.html"],impl:function(B){var C,G,M,F,O,Q,N,H,J,D,E;function L(S,R){this.text=D.format(S);this.delay=R}function I(R){if(R!==G){Q.css({height:$(document).height()})[R?"show":"hide"]();G=R}}function A(){var R=F[O++];if(R){N.text(R.text);C=R.delay?window.setTimeout(arguments.callee,R.delay):undefined}else{N.text("");C=undefined}}function K(R){if(M!==R){M=R;if(C){window.clearTimeout(C)}if(R){J.show();O=0;A()}else{J.hide()}}}function P(R){I(R);K(R)}return{init:function(){G=false;M=false;D=new $.formatter(hcom.locale.validation.messages);Q=$("#holding").css({opacity:0.85});J=$("#booking_holding");if($.browser.msie&&$.browser.version<7){J.css({position:"absolute"})}else{J.css({marginLeft:"115px"})}N=$("p.dynamic:first",J);H=$("p.location:first",J);E=$.browser.msie?$(Q.get(0).contentWindow.document):$(Q.get(0).contentWindow.document).find("html");F=[new L("holding.beingValidated",2000),new L("holding.beingProcessed",3000),new L("holding.contactingHotel",3000),new L("holding.checkAvail",3000),new L("holding.checkPayment",3000),new L("holding.emailConfirm")]},setHotelData:function(S,R){H.text(D.format("holding.location",S,R))},setVisible:P,setGlassVisible:I,setHoldingVisible:K}}});$.registerModule({name:"hcom.booking.modules.securecode",dependencies:["hcom.booking.modules.holding","hcom.common.listener"],impl:function(Q){var X,G,I,B,J,W,M,K,H,L,A={UNKNOWN:0,USER_CLOSE:1,TURN_URL:2,RELOAD_COUNT_EXCEEDED:3},Y,E,T="",C="",F="";function P(Z){if(Z!==J){X[Z?"show":"hide"]();J=Z;W.setGlassVisible(Z)}}function D(){var Z=G.get(0).contentWindow.document;M=true;if(G.attr("src")!==I){G.attr("src",I)}Z.open();Z.write(B);Z.close()}function N(Z){Z.preventDefault();if(H++>=3){P(false);L.fireEvent(A.RELOAD_COUNT_EXCEEDED)}else{D()}}function O(){var Z;try{Z=G.get(0).contentWindow;if(typeof Z.paRes!=="undefined"){F=Z.paRes}if(typeof Z.transactionId!=="undefined"){T=Z.transactionId}if(typeof Z.itineraryId!=="undefined"){C=Z.itineraryId}}catch(a){G.remove();P(false);L.fireEvent(A.UNKNOWN);console.error(a.description)}}function R(b){var a;if(M){console.debug("frame reload completed");M=false}else{try{a=G.get(0).contentWindow.document.location;if(K.exec(a)){O();G.remove();P(false);L.fireEvent(A.TURN_URL)}}catch(Z){console.error(Z.description)}}}function V(Z){Z.preventDefault();P(false);L.fireEvent(A.USER_CLOSE)}function S(a,Z){if(Z==="success"){B=a;D();H=0;Y.setVisible(false);P(true)}else{L.fireEvent(A.UNKNOWN);Y.setVisible(false)}}function U(a,c,Z,b){if(document.getElementById(E)===null){L.fireEvent(A.UNKNOWN);Y.setVisible(false);return }Y=b;K=new RegExp(["^https?://",Z].join(""),"i");$.post(a,c,S)}return{init:function(){I="/html/blank.html";X=$("#booking_securecode");E="securecode_externalFrame";G=$(["#",E].join("")).bind("load.secureCode",R);M=true;G.attr("src",I);$("#lnk_securecode_resubmit").bind("click.secureCode",N);$("#lnk_securecode_cancel").bind("click.secureCode",V);J=false;W=hcom.booking.modules.holding;L=new hcom.common.listener()},show:U,hide:function(){P(false)},addFrameCloseListener:function(a,Z){L.addListener(a,Z)},getTransactionId:function(){return T},getItineraryId:function(){return C},getPaRes:function(){return F},closeEventTypes:A}}});$.registerModule({name:"hcom.booking.modules.sitecatalyst",dependencies:["hcom.common.modules.sitecatalyst"],impl:function(A){var B=true;return{init:function(){},onCouponAccept:function(C){hcom.common.modules.sitecatalyst.sendPartialReport({eVar30:C},null,"coupon applied "+C)},onCouponRemove:function(){hcom.common.modules.sitecatalyst.sendPartialReport({eVar30:"none"},null,"coupon removed")},onValidationError:function(D,C){hcom.common.modules.sitecatalyst.sendFullReport({pageName:D+"Booking Form - Dynamic Validation Error",channel:"Booking Form with Error",eVar33:C,prop33:C})},onCardTypeSelection:function(C){hcom.common.modules.sitecatalyst.sendPartialReport({eVar18:C},null,"card type selected")},onDuplicateBooking:function(){hcom.common.modules.sitecatalyst.sendFullReport({pageName:"duplicate hotel booking",channel:"duplicate hotel booking",eVar33:"duplicate booking",prop33:"duplicate booking"})},onSubmitError:function(C,D){hcom.common.modules.sitecatalyst.sendFullReport({pageName:C+"Booking Form - Dynamic Validation Error",channel:"Booking Form with Error",eVar33:D.join(":"),prop33:D.join(":")})},onIanError:function(C,E,D,F){hcom.common.modules.sitecatalyst.sendFullReport({pageName:C,channel:E,eVar33:D,prop33:F})},onSecureCode:function(C,D){hcom.common.modules.sitecatalyst.sendFullReport({pageName:C+"Booking Form - Dynamic Validation Error",channel:"Booking Form SecureCode",eVar33:D,prop33:D})}}}});$.registerModule({name:"hcom.gadgets.modules.headmenu",dependencies:["hcom.common.modules.emitter","hcom.common.modules.dropdown"],impl:function(A){var C;function B(){$("#currency_menu a").click(function(){var E=$("#currencyTargetURL")[0].value,D=this.href;D=D.substring(0,D.indexOf("&sourceUrl="));D+="&sourceUrl="+E;this.href=D});return new hcom.common.modules.dropdown.bar(new C({ns:"DDMenuLanguage",trigger:$("#page_container > div.page_header div.language:first > a"),activeClass:"languageActive",menu:$("#language_menu")}),new C({ns:"DDMenuCurrency",trigger:$("#page_container > div.page_header div.currency:first > a"),activeClass:"currencyActive",menu:$("#currency_menu")}))}return{init:function(){C=hcom.common.modules.dropdown.menu;B()}}}});$.registerModule({name:"hcom.search.pages.autosuggest",dependencies:["hcom.common.modules.autosuggest"],impl:function(){function A(){var B={inputControlId:"search_destination",i18nMessages:hcom.locale.autosuggest.i18nMessages,minCharLength:hcom.locale.autosuggest.activationCharLength,itemsNrPerCategory:5,urlBase:hcom.locale.autosuggest.asURL,lang:hcom.locale.language,hotelAction:"http://travel.ian.com/index.jsp?cid=270825",pageName:"SearchResultPage",sendDataTo_Search_Do:true,selectSearchForm:function(){return $("#mainContainerSize1 form[name='sfSearchForm']")}};if(!$("#"+B.inputControlId).attr("hasAutoSuggest")){$("#"+B.inputControlId).attr("hasAutoSuggest",true);console.debug("Parameters has been set up 4 search result page");console.debug("Instantiating the Autosuggest...");hcom.common.modules.autosuggest[B.inputControlId]=new hcom.common.modules.autosuggest.AutoSuggest(B);console.debug("Instantiated the autosuggest for search result page")}}return{init:function(){$(document).bind("ajaxComplete.asaReady",function(){A()})}}}});$.registerModule({name:"hcom.homepage.pages.home",dependencies:["hcom.common.modules.calendar","hcom.homepage.modules.autosuggest","hcom.common.pages.common"],impl:function(A){return{init:function(){}}}});$.registerModule({name:"hcom.homepage.modules.autosuggest",dependencies:["hcom.common.modules.autosuggest","hcom.common.pages.common"],impl:function(A){return{init:function(){$(document).ready(function(){var B={inputControlId:"Fcity1",formId:"searchForm",i18nMessages:hcom.locale.autosuggest.i18nMessages,minCharLength:hcom.locale.autosuggest.activationCharLength,itemsNrPerCategory:5,urlBase:hcom.locale.autosuggest.asURL,lang:hcom.locale.language,hotelAction:"/http://travel.ian.com/index.jsp?cid=270825",formId:"searchForm",sendDataTo_Search_Do:false,pageName:"HomePage",selectDestinationIdField:function(){return $("#destinationId")},selectLandmarkIdField:function(){return $("#landmarkId")},selectHotelIdField:function(){return $("#hotelId")},onFormSubmitCommon:function(F){var D=F.settings,E=F.lastSelected,C=F.isDestinationInputChanged;$("#"+D.formId).append("<input type='hidden' name='landmarkId' id='landmarkId' value='' />");$("#"+D.formId).append("<input type='hidden' name='hotelId' id='hotelId' value='' />");if(E.rowData){D.selectDestinationIdField().val(typeof E.rowData[1]==="undefined"?"":E.rowData[1]);D.selectLandmarkIdField().val(typeof E.rowData[2]==="undefined"?"":E.rowData[2]);D.selectHotelIdField().val(typeof E.rowData[3]==="undefined"?"":E.rowData[3])}if(D.selectHotelIdField().val().length>0){$(["#",D.formId].join("")).attr("action",D.hotelAction)}}};hcom.common.modules.autosuggest[B.inputControlId]=new hcom.common.modules.autosuggest.AutoSuggest(B)})}}}});$.registerModule({name:"hcom.search.pages.listview_hmvt_27_1",dependencies:["hcom.search.modules.core","hcom.search.modules.core.ajax","hcom.search.pages.common","hcom.search.modules.neighbourhoodpopdiv","hcom.search.modules.interstitial","hcom.search.modules.hotelimagepopdiv","hcom.search.modules.hotelimagepopdiv.ajax","hcom.search.modules.namesearch","hcom.search.modules.namesearch.ajax","hcom.search.modules.filterform","hcom.search.modules.filterform.ajax","hcom.search.modules.checkavailabilitydialog","hcom.search.modules.checkavailabilitydialog.ajax","hcom.search.modules.queryform_mvt_27_1","hcom.search.modules.queryform.ajax","hcom.search.modules.explanationpopdiv","hcom.search.modules.sortcontrol","hcom.search.modules.sortcontrol.ajax","hcom.search.modules.sitecatalyst","hcom.search.pages.autosuggest","hcom.search.modules.hotelsearch.autosuggest"],images:["overlay_px_1.png"],imageUrlPrefix:"/images/search/",impl:function(){return{init:function(){console.info("MVT 22 variant 0");hcom.common.modules.events.attachAllEvents();hcom.search.modules.core.scriptLoad();$.cookie("map_state",null)}}}});$.registerModule({name:"hcom.search.pages.mapview_hmvt_27_1",dependencies:["hcom.search.modules.core","hcom.search.modules.core.ajax","hcom.search.pages.common","hcom.search.modules.neighbourhoodpopdiv","hcom.search.modules.interstitial","hcom.search.modules.map","hcom.search.modules.namesearch","hcom.search.modules.namesearch.ajax","hcom.search.modules.filterform","hcom.search.modules.filterform.ajax","hcom.search.modules.checkavailabilitydialog","hcom.search.modules.checkavailabilitydialog.ajax","hcom.search.modules.queryform_mvt_27_1","hcom.search.modules.queryform.ajax","hcom.search.modules.explanationpopdiv","hcom.search.modules.sortcontrol","hcom.search.modules.sortcontrol.ajax","hcom.search.pages.autosuggest","hcom.search.modules.hotelsearch.autosuggest"],impl:function(){return{init:function(){console.info("MVT 22 variant 0");hcom.common.modules.events.attachAllEvents();hcom.search.modules.core.scriptLoad()}}}});$.registerModule({name:"hcom.search.modules.queryform_mvt_27_1",dependencies:["hcom.search.modules.basicinput","hcom.search.modules.core"],impl:function(E){var C,D,B;var A=function(){var J;function H(){return $("#mainContainerSize1").find("div.searchModule:first")}function I(P,M,L,N){var O;if(N){O=M;M=L;L=O}P.removeClass(M).addClass(L)}function K(L){var M=$("#mainContainerSize1");if(J!==L){J=L;I(H(),"searchModuleClosed","sm_border",!L);I(M.find("div.search_changeSearchLink:first"),"search_changeSearchClose","search_changeSearchOpen",!L);M.find("div.sm_container")[L?"show":"hide"]();M.find("span.search_changeSearchCloseInfo:first")[L?"hide":"show"]();L=!L}}function G(){K(!J)}return{init:function(){J=!H().hasClass("searchModuleClosed")},toggle:G,set:K,isVisible:function(){return J}}}();var F=function(){function H(I){if($.browser.msie&&$.browser.version<7){I.find("div.search_changeSearchLink").bind("mouseenter",function(J){$(this).toggleClass("hover");if(!C.visibility.isVisible()){I.find("div.searchModule").addClass("searchModuleClosedhover").removeClass("searchModuleClosednohover")}}).bind("mouseleave",function(J){$(this).toggleClass("hover");if(!C.visibility.isVisible()){I.find("div.searchModule").removeClass("searchModuleClosedhover").addClass("searchModuleClosednohover")}})}}function G(){var I=$("#mainContainerSize1");D.initState(I).attachEvents();I.find("div.search_changeSearchLink").click(function(J){J.preventDefault();C.visibility.toggle()});H(I)}return{attach:G}}();return{init:function(){hcom.search.modules.queryform=hcom.search.modules.queryform_mvt_27_1;D=new hcom.search.modules.basicinput("",true,{},{isAutoCompleteOn:false});C=hcom.search.modules.queryform;B=hcom.search.modules.core;C.visibility.init();C.events.attach();B.addTemplateListener(E,function(G){D.setTemplates(G)})},visibility:A,events:F,getBasicInput:function(){return D}}}});$.registerModule({name:"hcom.search.pages.advsearch.autosuggest",dependencies:["hcom.common.modules.autosuggest"],impl:function(){function A(){var B={inputControlId:"search_destination",i18nMessages:hcom.locale.autosuggest.i18nMessages,minCharLength:hcom.locale.autosuggest.activationCharLength,itemsNrPerCategory:5,urlBase:hcom.locale.autosuggest.asURL,lang:hcom.locale.language,hotelAction:"/http://travel.ian.com/index.jsp?cid=270825",pageName:"AdvancedSearch",sendDataTo_Search_Do:true,selectSearchForm:function(){return $("[name='sfSearchForm']")},onFormSubmitSupplementary:function(H){var F=H.settings,G=H.lastSelected,E=H.isDestinationInputChanged;console.debug("Adjusting supplimentary form send");var D=F.selectSearchForm(),C=$("#hotelId",D);if(C.val()&&C.val().length>0){F.selectSearchForm().attr("action",F.hotelAction);$("#chbox_stars_1").attr("checked",false);$("#chbox_stars_2").attr("checked",false);$("#chbox_stars_3").attr("checked",false);$("#chbox_stars_4").attr("checked",false);$("#chbox_stars_5").attr("checked",false);$("#chbox_breakfastInc").attr("checked",false);$("#chbox_allInclusive").attr("checked",false);$("#FilterBox-facilities input").attr("checked",false);$("[class='searchCol searchColModule checkboxList'] input").attr("checked",false);$($("#brand option")[0]).attr("selected","selected");console.debug("Hotel seatch. Aditional filters are clean")}}};console.debug("Parameters has been set up 4 advanced search pages");$.loadModule("hcom.common.modules.autosuggest");console.debug("Instantiating the Autosuggest...");hcom.common.modules.autosuggest[B.inputControlId]=new hcom.common.modules.autosuggest.AutoSuggest(B);console.debug("Instantiated the autosuggest for advanced search pages")}return{init:function(){A()}}}});$.registerModule({name:"hcom.search.modules.hotelsearch.autosuggest",dependencies:["hcom.common.modules.autosuggest"],impl:function(){function A(){var B="text_enterHotelName";var C={};if(!$("#"+B).attr("hasAutoSuggest")){$("#"+B).attr("hasAutoSuggest",true);C={inputControlId:B,i18nMessages:hcom.locale.autosuggest.i18nMessages,isActive:hcom.locale.autosuggest.isHotelSearchActive,minCharLength:hcom.locale.autosuggest.activationCharLength,itemsNrPerCategory:20,lang:hcom.locale.language,hotelAction:"/http://travel.ian.com/index.jsp?cid=270825",pageName:"Hotel Name Search",sendDataTo_Search_Do:true,urlBase:hcom.locale.autosuggest.asURL,focusInputField:false,selectDestinationIdField:function(){return $("#form_nameSearch [name='destinationId']")},selectSearchForm:function(){return $("#form_nameSearch")},assambleAutoSuggestUrl:function(D){var E=D.selectDestinationIdField().val();return[D.urlBase,"/a",D.inputControlId,"/b",hcom.common.modules.autosuggest.DESTINATION_ID_TYPE.SIMPLE_ID,"/c",4,"/d",hcom.common.modules.autosuggest.CATEGORY_INDICATOR.HOTEL,"/e",D.itemsNrPerCategory,"/f",D.lang,"/h",E,"/g"].join("")},onFormSubmitSupplementary:function(D){},onFormSubmitCommon:function(D){}};console.debug("Parameters has been set up 4 hotel name search");console.debug("Instantiating the Autosuggest...");hcom.common.modules.autosuggest[C.inputControlId]=new hcom.common.modules.autosuggest.AutoSuggest(C);console.debug("Instantiated the autosuggest for the hotel name search")}}return{init:function(){$(document).bind("ajaxComplete.asaReady",function(){console.debug("Loading response...");A()})}}}});$.registerModule({name:"hcom.search.pages.disambiguation_hmvt_27_1",dependencies:["hcom.common.pages.common","hcom.search.modules.basicinput","hcom.search.modules.disambiguation.autosuggest"],impl:function(B){var A;function C(){A.initState($("#mainContainerSize1")).attachEvents(false)}return{init:function(){hcom.common.modules.events.attachAllEvents();A=new hcom.search.modules.basicinput("da",true,{},{isAutoCompleteOn:false});A.loadPartial(C)}}}});$.registerModule({name:"hcom.search.modules.disambiguation.autosuggest",dependencies:["hcom.common.modules.autosuggest"],impl:function(){function A(){var B={inputControlId:"search_destination",i18nMessages:hcom.locale.autosuggest.i18nMessages,minCharLength:hcom.locale.autosuggest.activationCharLength,itemsNrPerCategory:5,urlBase:hcom.locale.autosuggest.asURL,lang:hcom.locale.language,hotelAction:"/http://travel.ian.com/index.jsp?cid=270825",hfDestinationId:"destinationId",hfHotelId:"hotelId",pageName:"Disambiguation",sendDataTo_Search_Do:true,focusInputField:false,selectSearchForm:function(){return $($("[name='sfSearchForm']")[0])},onFormSubmitSupplementary:function(F){var D=F.settings,E=F.lastSelected,C=F.isDestinationInputChanged;D.selectSearchForm().attr("action","/search.do");$("[name='searchParams.name']").remove()}};console.debug("Parameters has been set up 4 disambiguatino page");console.debug("Instantiating the Autosuggest...");hcom.common.modules.autosuggest[B.inputControlId]=new hcom.common.modules.autosuggest.AutoSuggest(B);console.debug("Instantiated the autosuggest for disambiguation page")}return{init:function(){A()}}}});$.registerModule({name:"hcom.landing.modules.autosuggest",dependencies:["hcom.common.modules.autosuggest"],impl:function(){function A(){var B={inputControlId:"search_destination",i18nMessages:hcom.locale.autosuggest.i18nMessages,minCharLength:hcom.locale.autosuggest.activationCharLength,itemsNrPerCategory:5,urlBase:hcom.locale.autosuggest.asURL,lang:hcom.locale.language,hotelAction:"/http://travel.ian.com/index.jsp?cid=270825",sendDataTo_Search_Do:true,pageName:"Landing",focusInputField:false,selectSearchForm:function(){return $("#searchForm")}};console.debug("Parameters has been set up 4 landing pages");console.debug("Instantiating the Autosuggest...");hcom.common.modules.autosuggest[B.inputControlId]=new hcom.common.modules.autosuggest.AutoSuggest(B);console.debug("Instantiated the autosuggest for landing pages")}return{init:function(){A()}}}});$.registerModule({name:"hcom.hotel_details.modules.autosuggest",dependencies:["hcom.common.modules.autosuggest"],impl:function(){function B(C){if(!C.match("^searchParams")){C="searchParams."+C}return C}function A(){var C={inputControlId:"search_destination",i18nMessages:hcom.locale.autosuggest.i18nMessages,minCharLength:hcom.locale.autosuggest.activationCharLength,itemsNrPerCategory:5,urlBase:hcom.locale.autosuggest.asURL,lang:hcom.locale.language,hotelAction:"/http://travel.ian.com/index.jsp?cid=270825",sendDataTo_Search_Do:true,pageName:"Hotel Details",onFormSubmitSupplementary:function(H){var E=H.settings,F=H.lastSelected,D=H.isDestinationInputChanged;if(D){E.selectSearchForm().attr("action","/search.do");if(!(F.rowData&&F.rowData[3])){var G=E.selectSearchForm().find("select").filter(function(){var I=false,J=$(this).attr("id");if(J.match(new RegExp(".*search_room_.*_.*","i"))){I=true}return I});G.each(function(I){$(this).attr("name",B($(this).attr("name")))});$("input[name='arrivalDate']",E.selectSearchForm()).attr("name","searchParams.arrivalDate");$("input[name='departureDate']",E.selectSearchForm()).attr("name","searchParams.departureDate")}$("input[name='destinationId']").remove()}},selectSearchForm:function(){return $("#hotelDetailsForm")}};console.debug("Parameters has been set up 4 hotel details pages");console.debug("Instantiating the Autosuggest...");hcom.common.modules.autosuggest[C.inputControlId]=new hcom.common.modules.autosuggest.AutoSuggest(C);console.debug("Instantiated the autosuggest for hotel details pages")}return{init:function(){A()}}}});$.registerModule({name:"hcom.hotel_details.pages.common_hmvt_27_1",dependencies:["hcom.common.pages.common","hcom.hotel_details.modules.core","hcom.hotel_details.modules.tabmanager","hcom.hotel_details.modules.photos","hcom.hotel_details.modules.yourhotels","hcom.hotel_details.modules.queryform_hmvt_27_1","hcom.hotel_details.modules.autosuggest"]});$.registerModule({name:"hcom.hotel_details.modules.queryform_hmvt_27_1",dependencies:["hcom.search.modules.basicinput"],impl:function(B){var A;function C(){var D=$("#hotelDetailsForm"),E=$("div.searchModuleClosed");if($.browser.mozilla){D.find("select").each(function(){var F=$(this);F.html(F.html())})}A.initState($("#queryForm"),true).attachEvents(false);E.click(function(){E.hide();D.show()});$("span.search_changeLinkContainer").click(function(){E.show();D.hide()});$("#changeSearch").click(function(F){F.preventDefault();return true})}return{init:function(){A=new hcom.search.modules.basicinput("",false,null,{roomSelector:"select[name=roomno]:first",isAutoCompleteOn:false});A.setTemplates(hcom.common.template.buildJson(hcom.landing.data.staticTemplates));C()}}}});$.registerModule({name:"hcom.common.keyhandling",impl:function(B){var D={DOWN:40,UP:38,ESC:27,ENTER:13,LEFT:37,RIGHT:39,TAB:9};function F(G){var H;H=G.charCode?G.charCode:G.keyCode?G.keyCode:0;if((H===D.TAB)||(H===D.ENTER)||(H===D.ESC)||(H===D.DOWN)||(H===D.UP)||(H===D.LEFT)||(H===D.RIGHT)){return true}return false}function E(G){if(F(G)){console.debug("Function key pressed or continuously pressed... Drop");return false}else{console.debug("typing");G.data.alphaNumericKeyHandler(G)}}function A(G){if(F(G)){console.debug("Function key pressed or continuously pressed... Handling");return G.data.functionKeyHandler(G)}return true}function C(H,I,G){this.object=H;this.functionKeyHandler=I;this.alphaNumericKeyHandler=G;console.debug("--------- initializing keybinding:"+H);if($.browser.mozilla){this.object.bind("keyup.autosuggest",this,E);this.object.bind("keypress.autosuggest",this,A)}else{this.object.bind("keyup.autosuggest",this,E);this.object.bind("keydown.autosuggest",this,A)}}return{init:function(){hcom.common.keyhandling.FUNCTION_KEYS=D;hcom.common.keyhandling.KeyListener=C}}}});