/**
  /home/httpd/extlib/jquery/core/1.3.2/jquery-1.3.2.min.js
  /home/httpd/extlib/jquery/ui/1.7.2/ui.core.js
  /home/httpd/extlib/jquery/ui/1.7.2/ui.datepicker.js
  common/js/ajax/vaw_jquery.js -> 1.3   ( (none) )
  common/js/utility_funcs.js -> 1.6   ( (none) )
  common/js/currency_display_list.js -> 1.3   ( (none) )
  common/js/SearchWidgetNoFrm.js -> 1.8   ( (none) )
  common/js/country_touristic.js -> 1.65   ( (none) )
  common/js/toolbox/date/1.02/date.js -> 1.2   ( (none) )
  common/js/site/useful_funs.js -> 1.22   ( (none) )
  common/js/hotel_page/constants.js -> 1.8   ( (none) )
  common/js/hotel_page/model.js -> 1.18   ( (none) )
  common/js/hotel_page/view.js -> 1.21   ( (none) )
  common/js/cookieManager.js -> 1.3   ( (none) )
  common/js/SiteMVTManager.js -> 1.10   ( (none) )
  common/js/hotel_page/controller.js -> 1.18   ( (none) )
  common/js/hotel_page/service_manager.js -> 1.3   ( (none) )
  common/js/hotel_page/init_hotel_page.js -> 1.3   ( (none) )
  common/js/hotel_page/jquery.galleriffic_custom_v1.js -> 1.3   ( (none) )
  common/js/history.js -> 1.3   ( (none) )
  common/js/jslib/tracking/hotelPageConstants.js -> 1.3   ( (none) )
  common/js/jslib/tracking/tracker.js -> 1.5   ( (none) )
**/
(function(){var W=this,ab,F=W.jQuery,S=W.$,T=W.jQuery=W.$=function(b,a){return new T.fn.init(b,a)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ac=/^.[^:#\[\.,]*$/;T.fn=T.prototype={init:function(e,b){e=e||document;if(e.nodeType){this[0]=e;this.length=1;this.context=e;return this}if(typeof e==="string"){var c=M.exec(e);if(c&&(c[1]||!b)){if(c[1]){e=T.clean([c[1]],b)}else{var a=document.getElementById(c[3]);if(a&&a.id!=c[3]){return T().find(e)}var d=T(a||[]);d.context=document;d.selector=e;return d}}else{return T(b).find(e)}}else{if(T.isFunction(e)){return T(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(T.isArray(e)?e:T.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===ab?Array.prototype.slice.call(this):this[a]},pushStack:function(c,a,d){var b=T(c);b.prevObject=this;b.context=this.context;if(a==="find"){b.selector=this.selector+(this.selector?" ":"")+d}else{if(a){b.selector=this.selector+"."+a+"("+d+")"}}return b},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return T.each(this,a,b)},index:function(a){return T.inArray(a&&a.jquery?a[0]:a,this)},attr:function(c,a,b){var d=c;if(typeof c==="string"){if(a===ab){return this[0]&&T[b||"attr"](this[0],c)}else{d={};d[c]=a}}return this.each(function(e){for(c in d){T.attr(b?this.style:this,c,T.prop(this,d[c],b,e,c))}})},css:function(b,a){if((b=="width"||b=="height")&&parseFloat(a)<0){a=ab}return this.attr(b,a,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a))}var b="";T.each(a||this,function(){T.each(this.childNodes,function(){if(this.nodeType!=8){b+=this.nodeType!=1?this.nodeValue:T.fn.text([this])}})});return b},wrapAll:function(b){if(this[0]){var a=T(b,this[0].ownerDocument).clone();if(this[0].parentNode){a.insertBefore(this[0])}a.map(function(){var c=this;while(c.firstChild){c=c.firstChild}return c}).append(this)}return this},wrapInner:function(a){return this.each(function(){T(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){T(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.appendChild(a)}})},prepend:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.insertBefore(a,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||T([])},push:[].push,sort:[].sort,splice:[].splice,find:function(b){if(this.length===1){var a=this.pushStack([],"find",b);a.length=0;T.find(b,this[0],a);return a}else{return this.pushStack(T.unique(T.map(this,function(c){return T.find(b,c)})),"find",b)}},clone:function(b){var d=this.map(function(){if(!T.support.noCloneEvent&&!T.isXMLDoc(this)){var f=this.outerHTML;if(!f){var e=this.ownerDocument.createElement("div");e.appendChild(this.cloneNode(true));f=e.innerHTML}return T.clean([f.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(b===true){var a=this.find("*").andSelf(),c=0;d.find("*").andSelf().each(function(){if(this.nodeName!==a[c].nodeName){return}var g=T.data(a[c],"events");for(var e in g){for(var f in g[e]){T.event.add(this,e,g[e][f],g[e][f].data)}}c++})}return d},filter:function(a){return this.pushStack(T.isFunction(a)&&T.grep(this,function(b,c){return a.call(b,c)})||T.multiFilter(a,T.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(c){var a=T.expr.match.POS.test(c)?T(c):null,b=0;return this.map(function(){var d=this;while(d&&d.ownerDocument){if(a?a.index(d)>-1:T(d).is(c)){T.data(d,"closest",b);return d}d=d.parentNode;b++}})},not:function(b){if(typeof b==="string"){if(ac.test(b)){return this.pushStack(T.multiFilter(b,this,true),"not",b)}else{b=T.multiFilter(b,this)}}var a=b.length&&b[b.length-1]!==ab&&!b.nodeType;return this.filter(function(){return a?T.inArray(this,b)<0:this!=b})},add:function(a){return this.pushStack(T.unique(T.merge(this.get(),typeof a==="string"?T(a):T.makeArray(a))))},is:function(a){return !!a&&T.multiFilter(a,this).length>0},hasClass:function(a){return !!a&&this.is("."+a)},val:function(c){if(c===ab){var j=this[0];if(j){if(T.nodeName(j,"option")){return(j.attributes.value||{}).specified?j.value:j.text}if(T.nodeName(j,"select")){var e=j.selectedIndex,b=[],a=j.options,f=j.type=="select-one";if(e<0){return null}for(var h=f?e:0,d=f?e+1:a.length;h<d;h++){var g=a[h];if(g.selected){c=T(g).val();if(f){return c}b.push(c)}}return b}return(j.value||"").replace(/\r/g,"")}return ab}if(typeof c==="number"){c+=""}return this.each(function(){if(this.nodeType!=1){return}if(T.isArray(c)&&/radio|checkbox/.test(this.type)){this.checked=(T.inArray(this.value,c)>=0||T.inArray(this.name,c)>=0)}else{if(T.nodeName(this,"select")){var k=T.makeArray(c);T("option",this).each(function(){this.selected=(T.inArray(this.value,k)>=0||T.inArray(this.text,k)>=0)});if(!k.length){this.selectedIndex=-1}}else{this.value=c}}})},html:function(a){return a===ab?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(T.map(this,function(b,c){return a.call(b,c,b)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(d,a,b){if(this[0]){var e=(this[0].ownerDocument||this[0]).createDocumentFragment(),h=T.clean(d,(this[0].ownerDocument||this[0]),e),f=e.firstChild;if(f){for(var g=0,j=this.length;g<j;g++){b.call(c(this[g],f),this.length>1||g>0?e.cloneNode(true):e)}}if(h){T.each(h,E)}}return this;function c(l,k){return a&&T.nodeName(l,"table")&&T.nodeName(k,"tr")?(l.getElementsByTagName("tbody")[0]||l.appendChild(l.ownerDocument.createElement("tbody"))):l}}};T.fn.init.prototype=T.fn;function E(b,a){if(a.src){T.ajax({url:a.src,async:false,dataType:"script"})}else{T.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function ad(){return +new Date}T.extend=T.fn.extend=function(){var c=arguments[0]||{},e=1,d=arguments.length,h=false,f;if(typeof c==="boolean"){h=c;c=arguments[1]||{};e=2}if(typeof c!=="object"&&!T.isFunction(c)){c={}}if(d==e){c=this;--e}for(;e<d;e++){if((f=arguments[e])!=null){for(var g in f){var b=c[g],a=f[g];if(c===a){continue}if(h&&a&&typeof a==="object"&&!a.nodeType){c[g]=T.extend(h,b||(a.length!=null?[]:{}),a)}else{if(a!==ab){c[g]=a}}}}}return c};var ag=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},L=Object.prototype.toString;T.extend({noConflict:function(a){W.$=S;if(a){W.jQuery=F}return T},isFunction:function(a){return L.call(a)==="[object Function]"},isArray:function(a){return L.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&T.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,c=document.createElement("script");c.type="text/javascript";if(T.support.scriptEval){c.appendChild(document.createTextNode(a))}else{c.text=a}b.insertBefore(c,b.firstChild);b.removeChild(c)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},each:function(e,a,f){var g,d=0,c=e.length;if(f){if(c===ab){for(g in e){if(a.apply(e[g],f)===false){break}}}else{for(;d<c;){if(a.apply(e[d++],f)===false){break}}}}else{if(c===ab){for(g in e){if(a.call(e[g],g,e[g])===false){break}}}else{for(var b=e[0];d<c&&a.call(b,d,b)!==false;b=e[++d]){}}}return e},prop:function(b,a,c,d,e){if(T.isFunction(a)){a=a.call(b,d)}return typeof a==="number"&&c=="curCSS"&&!ag.test(e)?a+"px":a},className:{add:function(b,a){T.each((a||"").split(/\s+/),function(d,c){if(b.nodeType==1&&!T.className.has(b.className,c)){b.className+=(b.className?" ":"")+c}})},remove:function(b,a){if(b.nodeType==1){b.className=a!==ab?T.grep(b.className.split(/\s+/),function(c){return !T.className.has(a,c)}).join(" "):""}},has:function(a,b){return a&&T.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(b,c,a){var e={};for(var d in c){e[d]=b.style[d];b.style[d]=c[d]}a.call(b);for(var d in c){b.style[d]=e[d]}},css:function(e,g,c,h){if(g=="width"||g=="height"){var a,f={position:"absolute",visibility:"hidden",display:"block"},b=g=="width"?["Left","Right"]:["Top","Bottom"];function d(){a=g=="width"?e.offsetWidth:e.offsetHeight;if(h==="border"){return}T.each(b,function(){if(!h){a-=parseFloat(T.curCSS(e,"padding"+this,true))||0}if(h==="margin"){a+=parseFloat(T.curCSS(e,"margin"+this,true))||0}else{a-=parseFloat(T.curCSS(e,"border"+this+"Width",true))||0}})}if(e.offsetWidth!==0){d()}else{T.swap(e,f,d)}return Math.max(0,Math.round(a))}return T.curCSS(e,g,c)},curCSS:function(e,h,g){var b,j=e.style;if(h=="opacity"&&!T.support.opacity){b=T.attr(j,"opacity");return b==""?"1":b}if(h.match(/float/i)){h=H}if(!g&&j&&j[h]){b=j[h]}else{if(Q.getComputedStyle){if(h.match(/float/i)){h="float"}h=h.replace(/([A-Z])/g,"-$1").toLowerCase();var a=Q.getComputedStyle(e,null);if(a){b=a.getPropertyValue(h)}if(h=="opacity"&&b==""){b="1"}}else{if(e.currentStyle){var d=h.replace(/\-(\w)/g,function(l,k){return k.toUpperCase()});b=e.currentStyle[h]||e.currentStyle[d];if(!/^\d+(px)?$/i.test(b)&&/^\d/.test(b)){var f=j.left,c=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left;j.left=b||0;b=j.pixelLeft+"px";j.left=f;e.runtimeStyle.left=c}}}}return b},clean:function(g,b,d){b=b||document;if(typeof b.createElement==="undefined"){b=b.ownerDocument||b[0]&&b[0].ownerDocument||document}if(!d&&g.length===1&&typeof g[0]==="string"){var e=/^<(\w+)\s*\/?>$/.exec(g[0]);if(e){return[b.createElement(e[1])]}}var f=[],h=[],a=b.createElement("div");T.each(g,function(m,j){if(typeof j==="number"){j+=""}if(!j){return}if(typeof j==="string"){j=j.replace(/(<(\w+)[^>]*?)\/>/g,function(t,s,u){return u.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?t:s+"></"+u+">"});var n=j.replace(/^\s+/,"").substring(0,10).toLowerCase();var l=!n.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!n.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||n.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!n.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!n.indexOf("<td")||!n.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!n.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!T.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];a.innerHTML=l[1]+j+l[2];while(l[0]--){a=a.lastChild}if(!T.support.tbody){var k=/<tbody/i.test(j),o=!n.indexOf("<table")&&!k?a.firstChild&&a.firstChild.childNodes:l[1]=="<table>"&&!k?a.childNodes:[];for(var q=o.length-1;q>=0;--q){if(T.nodeName(o[q],"tbody")&&!o[q].childNodes.length){o[q].parentNode.removeChild(o[q])}}}if(!T.support.leadingWhitespace&&/^\s/.test(j)){a.insertBefore(b.createTextNode(j.match(/^\s*/)[0]),a.firstChild)}j=T.makeArray(a.childNodes)}if(j.nodeType){f.push(j)}else{f=T.merge(f,j)}});if(d){for(var c=0;f[c];c++){if(T.nodeName(f[c],"script")&&(!f[c].type||f[c].type.toLowerCase()==="text/javascript")){h.push(f[c].parentNode?f[c].parentNode.removeChild(f[c]):f[c])}else{if(f[c].nodeType===1){f.splice.apply(f,[c+1,0].concat(T.makeArray(f[c].getElementsByTagName("script"))))}d.appendChild(f[c])}}return h}return f},attr:function(c,f,b){if(!c||c.nodeType==3||c.nodeType==8){return ab}var e=!T.isXMLDoc(c),a=b!==ab;f=e&&T.props[f]||f;if(c.tagName){var g=/href|src|style/.test(f);if(f=="selected"&&c.parentNode){c.parentNode.selectedIndex}if(f in c&&e&&!g){if(a){if(f=="type"&&T.nodeName(c,"input")&&c.parentNode){throw"type property can't be changed"}c[f]=b}if(T.nodeName(c,"form")&&c.getAttributeNode(f)){return c.getAttributeNode(f).nodeValue}if(f=="tabIndex"){var d=c.getAttributeNode("tabIndex");return d&&d.specified?d.value:c.nodeName.match(/(button|input|object|select|textarea)/i)?0:c.nodeName.match(/^(a|area)$/i)&&c.href?0:ab}return c[f]}if(!T.support.style&&e&&f=="style"){return T.attr(c.style,"cssText",b)}if(a){c.setAttribute(f,""+b)}var h=!T.support.hrefNormalized&&e&&g?c.getAttribute(f,2):c.getAttribute(f);return h===null?ab:h}if(!T.support.opacity&&f=="opacity"){if(a){c.zoom=1;c.filter=(c.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(b)+""=="NaN"?"":"alpha(opacity="+b*100+")")}return c.filter&&c.filter.indexOf("opacity=")>=0?(parseFloat(c.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}f=f.replace(/-([a-z])/ig,function(k,j){return j.toUpperCase()});if(a){c[f]=b}return c[f]},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var c=[];if(a!=null){var b=a.length;if(b==null||typeof a==="string"||T.isFunction(a)||a.setInterval){c[0]=a}else{while(b){c[--b]=a[b]}}}return c},inArray:function(b,a){for(var d=0,c=a.length;d<c;d++){if(a[d]===b){return d}}return -1},merge:function(b,e){var d=0,c,a=b.length;if(!T.support.getAll){while((c=e[d++])!=null){if(c.nodeType!=8){b[a++]=c}}}else{while((c=e[d++])!=null){b[a++]=c}}return b},unique:function(a){var f=[],g={};try{for(var e=0,d=a.length;e<d;e++){var b=T.data(a[e]);if(!g[b]){g[b]=true;f.push(a[e])}}}catch(c){f=a}return f},grep:function(e,a,f){var d=[];for(var c=0,b=e.length;c<b;c++){if(!f!=!a(e[c],c)){d.push(e[c])}}return d},map:function(f,a){var e=[];for(var d=0,c=f.length;d<c;d++){var b=a(f[d],d);if(b!=null){e[e.length]=b}}return e.concat.apply([],e)}});var O=navigator.userAgent.toLowerCase();T.browser={version:(O.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(O),opera:/opera/.test(O),msie:/msie/.test(O)&&!/opera/.test(O),mozilla:/mozilla/.test(O)&&!/(compatible|webkit)/.test(O)};T.each({parent:function(a){return a.parentNode},parents:function(a){return T.dir(a,"parentNode")},next:function(a){return T.nth(a,2,"nextSibling")},prev:function(a){return T.nth(a,2,"previousSibling")},nextAll:function(a){return T.dir(a,"nextSibling")},prevAll:function(a){return T.dir(a,"previousSibling")},siblings:function(a){return T.sibling(a.parentNode.firstChild,a)},children:function(a){return T.sibling(a.firstChild)},contents:function(a){return T.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:T.makeArray(a.childNodes)}},function(b,a){T.fn[b]=function(d){var c=T.map(this,a);if(d&&typeof d=="string"){c=T.multiFilter(d,c)}return this.pushStack(T.unique(c),b,d)}});T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,a){T.fn[b]=function(h){var e=[],c=T(h);for(var d=0,g=c.length;d<g;d++){var f=(d>0?this.clone(true):this).get();T.fn[a].apply(T(c[d]),f);e=e.concat(f)}return this.pushStack(e,b,h)}});T.each({removeAttr:function(a){T.attr(this,a,"");if(this.nodeType==1){this.removeAttribute(a)}},addClass:function(a){T.className.add(this,a)},removeClass:function(a){T.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean"){b=!T.className.has(this,a)}T.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||T.filter(a,[this]).length){T("*",this).add([this]).each(function(){T.event.remove(this);T.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){T(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(b,a){T.fn[b]=function(){return this.each(a,arguments)}});function Y(b,a){return b[0]&&parseInt(T.curCSS(b[0],a,true),10)||0}var aa="jQuery"+ad(),I=0,R={};T.extend({cache:{},data:function(c,d,b){c=c==W?R:c;var a=c[aa];if(!a){a=c[aa]=++I}if(d&&!T.cache[a]){T.cache[a]={}}if(b!==ab){T.cache[a][d]=b}return d?T.cache[a][d]:a},removeData:function(c,d){c=c==W?R:c;var a=c[aa];if(d){if(T.cache[a]){delete T.cache[a][d];d="";for(d in T.cache[a]){break}if(!d){T.removeData(c)}}}else{try{delete c[aa]}catch(b){if(c.removeAttribute){c.removeAttribute(aa)}}delete T.cache[a]}},queue:function(c,d,a){if(c){d=(d||"fx")+"queue";var b=T.data(c,d);if(!b||T.isArray(a)){b=T.data(c,d,T.makeArray(a))}else{if(a){b.push(a)}}}return b},dequeue:function(a,b){var d=T.queue(a,b),c=d.shift();if(!b||b==="fx"){c=d[0]}if(c!==ab){c.call(a)}}});T.fn.extend({data:function(d,b){var a=d.split(".");a[1]=a[1]?"."+a[1]:"";if(b===ab){var c=this.triggerHandler("getData"+a[1]+"!",[a[0]]);if(c===ab&&this.length){c=T.data(this[0],d)}return c===ab&&a[1]?this.data(a[0]):c}else{return this.trigger("setData"+a[1]+"!",[a[0],b]).each(function(){T.data(this,d,b)})}},removeData:function(a){return this.each(function(){T.removeData(this,a)})},queue:function(b,a){if(typeof b!=="string"){a=b;b="fx"}if(a===ab){return T.queue(this[0],b)}return this.each(function(){var c=T.queue(this,b,a);if(b=="fx"&&c.length==1){c[0].call(this)}})},dequeue:function(a){return this.each(function(){T.dequeue(this,a)})}});(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,h=0,m=Object.prototype.toString;var o=function(u,y,al,ak){al=al||[];y=y||document;if(y.nodeType!==1&&y.nodeType!==9){return[]}if(!u||typeof u!=="string"){return al}var t=[],w,D,A,z,aj,x,v=true;b.lastIndex=0;while((w=b.exec(u))!==null){t.push(w[1]);if(w[2]){x=RegExp.rightContext;break}}if(t.length>1&&g.exec(u)){if(t.length===2&&l.relative[t[0]]){D=k(t[0]+t[1],y)}else{D=l.relative[t[0]]?[y]:o(t.shift(),y);while(t.length){u=t.shift();if(l.relative[u]){u+=t.shift()}D=k(u,D)}}}else{var ai=ak?{expr:t.pop(),set:q(ak)}:o.find(t.pop(),t.length===1&&y.parentNode?y.parentNode:y,c(y));D=o.filter(ai.expr,ai.set);if(t.length>0){A=q(D)}else{v=false}while(t.length){var B=t.pop(),C=B;if(!l.relative[B]){B=""}else{C=t.pop()}if(C==null){C=y}l.relative[B](A,C,c(y))}}if(!A){A=D}if(!A){throw"Syntax error, unrecognized expression: "+(B||u)}if(m.call(A)==="[object Array]"){if(!v){al.push.apply(al,A)}else{if(y.nodeType===1){for(var s=0;A[s]!=null;s++){if(A[s]&&(A[s]===true||A[s].nodeType===1&&j(y,A[s]))){al.push(D[s])}}}else{for(var s=0;A[s]!=null;s++){if(A[s]&&A[s].nodeType===1){al.push(D[s])}}}}}else{q(A,al)}if(x){o(x,y,al,ak);if(n){hasDuplicate=false;al.sort(n);if(hasDuplicate){for(var s=1;s<al.length;s++){if(al[s]===al[s-1]){al.splice(s--,1)}}}}}return al};o.matches=function(t,s){return o(t,null,null,s)};o.find=function(s,z,A){var t,v;if(!s){return[]}for(var w=0,x=l.order.length;w<x;w++){var u=l.order[w],v;if((v=l.match[u].exec(s))){var y=RegExp.leftContext;if(y.substr(y.length-1)!=="\\"){v[1]=(v[1]||"").replace(/\\/g,"");t=l.find[u](v,z,A);if(t!=null){s=s.replace(l.match[u],"");break}}}}if(!t){t=z.getElementsByTagName("*")}return{set:t,expr:s}};o.filter=function(aj,ak,C,w){var x=aj,A=[],s=ak,u,z,t=ak&&ak[0]&&c(ak[0]);while(aj&&ak.length){for(var al in l.filter){if((u=l.match[al].exec(aj))!=null){var y=l.filter[al],B,D;z=false;if(s==A){A=[]}if(l.preFilter[al]){u=l.preFilter[al](u,s,C,A,w,t);if(!u){z=B=true}else{if(u===true){continue}}}if(u){for(var v=0;(D=s[v])!=null;v++){if(D){B=y(D,u,v,s);var ai=w^!!B;if(C&&B!=null){if(ai){z=true}else{s[v]=false}}else{if(ai){A.push(D);z=true}}}}}if(B!==ab){if(!C){s=A}aj=aj.replace(l.match[al],"");if(!z){return[]}break}}}if(aj==x){if(z==null){throw"Syntax error, unrecognized expression: "+aj}else{break}}x=aj}return s};var l=o.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(s){return s.getAttribute("href")}},relative:{"+":function(s,z,t){var v=typeof z==="string",A=v&&!/\W/.test(z),u=v&&!A;if(A&&!t){z=z.toUpperCase()}for(var w=0,x=s.length,y;w<x;w++){if((y=s[w])){while((y=y.previousSibling)&&y.nodeType!==1){}s[w]=u||y&&y.nodeName===z?y||false:y===z}}if(u){o.filter(z,s,true)}},">":function(x,u,w){var z=typeof u==="string";if(z&&!/\W/.test(u)){u=w?u:u.toUpperCase();for(var t=0,v=x.length;t<v;t++){var y=x[t];if(y){var s=y.parentNode;x[t]=s.nodeName===u?s:false}}}else{for(var t=0,v=x.length;t<v;t++){var y=x[t];if(y){x[t]=z?y.parentNode:y.parentNode===u}}if(z){o.filter(u,x,true)}}},"":function(s,u,w){var t=h++,v=a;if(!u.match(/\W/)){var x=u=w?u:u.toUpperCase();v=d}v("parentNode",u,t,s,x,w)},"~":function(s,u,w){var t=h++,v=a;if(typeof u==="string"&&!u.match(/\W/)){var x=u=w?u:u.toUpperCase();v=d}v("previousSibling",u,t,s,x,w)}},find:{ID:function(u,t,s){if(typeof t.getElementById!=="undefined"&&!s){var v=t.getElementById(u[1]);return v?[v]:[]}},NAME:function(t,x,w){if(typeof x.getElementsByName!=="undefined"){var u=[],y=x.getElementsByName(t[1]);for(var s=0,v=y.length;s<v;s++){if(y[s].getAttribute("name")===t[1]){u.push(y[s])}}return u.length===0?null:u}},TAG:function(t,s){return s.getElementsByTagName(t[1])}},preFilter:{CLASS:function(s,u,t,v,x,w){s=" "+s[1].replace(/\\/g,"")+" ";if(w){return s}for(var z=0,y;(y=u[z])!=null;z++){if(y){if(x^(y.className&&(" "+y.className+" ").indexOf(s)>=0)){if(!t){v.push(y)}}else{if(t){u[z]=false}}}}return false},ID:function(s){return s[1].replace(/\\/g,"")},TAG:function(t,u){for(var s=0;u[s]===false;s++){}return u[s]&&c(u[s])?t[1]:t[1].toUpperCase()},CHILD:function(t){if(t[1]=="nth"){var s=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(t[2]=="even"&&"2n"||t[2]=="odd"&&"2n+1"||!/\D/.test(t[2])&&"0n+"+t[2]||t[2]);t[2]=(s[1]+(s[2]||1))-0;t[3]=s[3]-0}t[0]=h++;return t},ATTR:function(y,u,t,v,x,w){var s=y[1].replace(/\\/g,"");if(!w&&l.attrMap[s]){y[1]=l.attrMap[s]}if(y[2]==="~="){y[4]=" "+y[4]+" "}return y},PSEUDO:function(x,u,t,v,w){if(x[1]==="not"){if(x[3].match(b).length>1||/^\w/.test(x[3])){x[3]=o(x[3],null,null,u)}else{var s=o.filter(x[3],u,t,true^w);if(!t){v.push.apply(v,s)}return false}}else{if(l.match.POS.test(x[0])||l.match.CHILD.test(x[0])){return true}}return x},POS:function(s){s.unshift(true);return s}},filters:{enabled:function(s){return s.disabled===false&&s.type!=="hidden"},disabled:function(s){return s.disabled===true},checked:function(s){return s.checked===true},selected:function(s){s.parentNode.selectedIndex;return s.selected===true},parent:function(s){return !!s.firstChild},empty:function(s){return !s.firstChild},has:function(s,t,u){return !!o(u[3],s).length},header:function(s){return/h\d/i.test(s.nodeName)},text:function(s){return"text"===s.type},radio:function(s){return"radio"===s.type},checkbox:function(s){return"checkbox"===s.type},file:function(s){return"file"===s.type},password:function(s){return"password"===s.type},submit:function(s){return"submit"===s.type},image:function(s){return"image"===s.type},reset:function(s){return"reset"===s.type},button:function(s){return"button"===s.type||s.nodeName.toUpperCase()==="BUTTON"},input:function(s){return/input|select|textarea|button/i.test(s.nodeName)}},setFilters:{first:function(s,t){return t===0},last:function(t,u,v,s){return u===s.length-1},even:function(s,t){return t%2===0},odd:function(s,t){return t%2===1},lt:function(s,t,u){return t<u[3]-0},gt:function(s,t,u){return t>u[3]-0},nth:function(s,t,u){return u[3]-0==t},eq:function(s,t,u){return u[3]-0==t}},filter:{PSEUDO:function(x,t,s,w){var u=t[1],z=l.filters[u];if(z){return z(x,s,t,w)}else{if(u==="contains"){return(x.textContent||x.innerText||"").indexOf(t[3])>=0}else{if(u==="not"){var y=t[3];for(var s=0,v=y.length;s<v;s++){if(y[s]===x){return false}}return true}}}},CHILD:function(z,w){var t=w[1],y=z;switch(t){case"only":case"first":while(y=y.previousSibling){if(y.nodeType===1){return false}}if(t=="first"){return true}y=z;case"last":while(y=y.nextSibling){if(y.nodeType===1){return false}}return true;case"nth":var x=w[2],A=w[3];if(x==1&&A==0){return true}var u=w[0],B=z.parentNode;if(B&&(B.sizcache!==u||!z.nodeIndex)){var v=0;for(y=B.firstChild;y;y=y.nextSibling){if(y.nodeType===1){y.nodeIndex=++v}}B.sizcache=u}var s=z.nodeIndex-A;if(x==0){return s==0}else{return(s%x==0&&s/x>=0)}}},ID:function(s,t){return s.nodeType===1&&s.getAttribute("id")===t},TAG:function(s,t){return(t==="*"&&s.nodeType===1)||s.nodeName===t},CLASS:function(s,t){return(" "+(s.className||s.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(x,s){var t=s[1],v=l.attrHandle[t]?l.attrHandle[t](x):x[t]!=null?x[t]:x.getAttribute(t),w=v+"",y=s[2],u=s[4];return v==null?y==="!=":y==="="?w===u:y==="*="?w.indexOf(u)>=0:y==="~="?(" "+w+" ").indexOf(u)>=0:!u?w&&v!==false:y==="!="?w!=u:y==="^="?w.indexOf(u)===0:y==="$="?w.substr(w.length-u.length)===u:y==="|="?w===u||w.substr(0,u.length+1)===u+"-":false},POS:function(x,u,t,w){var v=u[2],s=l.setFilters[v];if(s){return s(x,t,u,w)}}}};var g=l.match.POS;for(var e in l.match){l.match[e]=RegExp(l.match[e].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var q=function(s,t){s=Array.prototype.slice.call(s);if(t){t.push.apply(t,s);return t}return s};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(f){q=function(w,s){var u=s||[];if(m.call(w)==="[object Array]"){Array.prototype.push.apply(u,w)}else{if(typeof w.length==="number"){for(var t=0,v=w.length;t<v;t++){u.push(w[t])}}else{for(var t=0;w[t];t++){u.push(w[t])}}}return u}}var n;if(document.documentElement.compareDocumentPosition){n=function(t,u){var s=t.compareDocumentPosition(u)&4?-1:t===u?0:1;if(s===0){hasDuplicate=true}return s}}else{if("sourceIndex" in document.documentElement){n=function(t,u){var s=t.sourceIndex-u.sourceIndex;if(s===0){hasDuplicate=true}return s}}else{if(document.createRange){n=function(s,u){var t=s.ownerDocument.createRange(),v=u.ownerDocument.createRange();t.selectNode(s);t.collapse(true);v.selectNode(u);v.collapse(true);var w=t.compareBoundaryPoints(Range.START_TO_END,v);if(w===0){hasDuplicate=true}return w}}}}(function(){var t=document.createElement("form"),s="script"+(new Date).getTime();t.innerHTML="<input name='"+s+"'/>";var u=document.documentElement;u.insertBefore(t,u.firstChild);if(!!document.getElementById(s)){l.find.ID=function(y,x,w){if(typeof x.getElementById!=="undefined"&&!w){var v=x.getElementById(y[1]);return v?v.id===y[1]||typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id").nodeValue===y[1]?[v]:ab:[]}};l.filter.ID=function(w,v){var x=typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id");return w.nodeType===1&&x&&x.nodeValue===v}}u.removeChild(t)})();(function(){var s=document.createElement("div");s.appendChild(document.createComment(""));if(s.getElementsByTagName("*").length>0){l.find.TAG=function(v,w){var x=w.getElementsByTagName(v[1]);if(v[1]==="*"){var t=[];for(var u=0;x[u];u++){if(x[u].nodeType===1){t.push(x[u])}}x=t}return x}}s.innerHTML="<a href='#'></a>";if(s.firstChild&&typeof s.firstChild.getAttribute!=="undefined"&&s.firstChild.getAttribute("href")!=="#"){l.attrHandle.href=function(t){return t.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var t=o,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}o=function(x,y,v,u){y=y||document;if(!u&&y.nodeType===9&&!c(y)){try{return q(y.querySelectorAll(x),v)}catch(w){}}return t(x,y,v,u)};o.find=t.find;o.filter=t.filter;o.selectors=t.selectors;o.matches=t.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var s=document.createElement("div");s.innerHTML="<div class='test e'></div><div class='test'></div>";if(s.getElementsByClassName("e").length===0){return}s.lastChild.className="e";if(s.getElementsByClassName("e").length===1){return}l.order.splice(1,0,"CLASS");l.find.CLASS=function(v,u,t){if(typeof u.getElementsByClassName!=="undefined"&&!t){return u.getElementsByClassName(v[1])}}})()}function d(y,t,u,A,s,B){var C=y=="previousSibling"&&!B;for(var w=0,x=A.length;w<x;w++){var z=A[w];if(z){if(C&&z.nodeType===1){z.sizcache=u;z.sizset=w}z=z[y];var v=false;while(z){if(z.sizcache===u){v=A[z.sizset];break}if(z.nodeType===1&&!B){z.sizcache=u;z.sizset=w}if(z.nodeName===t){v=z;break}z=z[y]}A[w]=v}}}function a(y,t,u,A,s,B){var C=y=="previousSibling"&&!B;for(var w=0,x=A.length;w<x;w++){var z=A[w];if(z){if(C&&z.nodeType===1){z.sizcache=u;z.sizset=w}z=z[y];var v=false;while(z){if(z.sizcache===u){v=A[z.sizset];break}if(z.nodeType===1){if(!B){z.sizcache=u;z.sizset=w}if(typeof t!=="string"){if(z===t){v=true;break}}else{if(o.filter(t,[z]).length>0){v=z;break}}}z=z[y]}A[w]=v}}}var j=document.compareDocumentPosition?function(s,t){return s.compareDocumentPosition(t)&16}:function(s,t){return s!==t&&(s.contains?s.contains(t):true)};var c=function(s){return s.nodeType===9&&s.documentElement.nodeName!=="HTML"||!!s.ownerDocument&&c(s.ownerDocument)};var k=function(v,x){var s=[],z="",y,t=x.nodeType?[x]:x;while((y=l.match.PSEUDO.exec(v))){z+=y[0];v=v.replace(l.match.PSEUDO,"")}v=l.relative[v]?v+"*":v;for(var w=0,u=t.length;w<u;w++){o(v,t[w],s)}return o.filter(z,s)};T.find=o;T.filter=o.filter;T.expr=o.selectors;T.expr[":"]=T.expr.filters;o.selectors.filters.hidden=function(s){return s.offsetWidth===0||s.offsetHeight===0};o.selectors.filters.visible=function(s){return s.offsetWidth>0||s.offsetHeight>0};o.selectors.filters.animated=function(s){return T.grep(T.timers,function(t){return s===t.elem}).length};T.multiFilter=function(s,u,t){if(t){s=":not("+s+")"}return o.matches(s,u)};T.dir=function(t,u){var v=[],s=t[u];while(s&&s!=document){if(s.nodeType==1){v.push(s)}s=s[u]}return v};T.nth=function(w,v,t,s){v=v||1;var u=0;for(;w;w=w[t]){if(w.nodeType==1&&++u==v){break}}return w};T.sibling=function(s,t){var u=[];for(;s;s=s.nextSibling){if(s.nodeType==1&&s!=t){u.push(s)}}return u};return;W.Sizzle=o})();T.event={add:function(c,f,d,a){if(c.nodeType==3||c.nodeType==8){return}if(c.setInterval&&c!=W){c=W}if(!d.guid){d.guid=this.guid++}if(a!==ab){var e=d;d=this.proxy(e);d.data=a}var g=T.data(c,"events")||T.data(c,"events",{}),b=T.data(c,"handle")||T.data(c,"handle",function(){return typeof T!=="undefined"&&!T.event.triggered?T.event.handle.apply(arguments.callee.elem,arguments):ab});b.elem=c;T.each(f.split(/\s+/),function(l,k){var j=k.split(".");k=j.shift();d.type=j.slice().sort().join(".");var h=g[k];if(T.event.specialAll[k]){T.event.specialAll[k].setup.call(c,a,j)}if(!h){h=g[k]={};if(!T.event.special[k]||T.event.special[k].setup.call(c,a,j)===false){if(c.addEventListener){c.addEventListener(k,b,false)}else{if(c.attachEvent){c.attachEvent("on"+k,b)}}}}h[d.guid]=d;T.event.global[k]=true});c=null},guid:1,global:{},remove:function(b,e,c){if(b.nodeType==3||b.nodeType==8){return}var f=T.data(b,"events"),g,h;if(f){if(e===ab||(typeof e==="string"&&e.charAt(0)==".")){for(var d in f){this.remove(b,d+(e||""))}}else{if(e.type){c=e.handler;e=e.type}T.each(e.split(/\s+/),function(n,l){var j=l.split(".");l=j.shift();var m=RegExp("(^|\\.)"+j.slice().sort().join(".*\\.")+"(\\.|$)");if(f[l]){if(c){delete f[l][c.guid]}else{for(var k in f[l]){if(m.test(f[l][k].type)){delete f[l][k]}}}if(T.event.specialAll[l]){T.event.specialAll[l].teardown.call(b,j)}for(g in f[l]){break}if(!g){if(!T.event.special[l]||T.event.special[l].teardown.call(b,j)===false){if(b.removeEventListener){b.removeEventListener(l,T.data(b,"handle"),false)}else{if(b.detachEvent){b.detachEvent("on"+l,T.data(b,"handle"))}}}g=null;delete f[l]}}})}for(g in f){break}if(!g){var a=T.data(b,"handle");if(a){a.elem=null}T.removeData(b,"events");T.removeData(b,"handle")}}},trigger:function(d,b,e,h){var f=d.type||d;if(!h){d=typeof d==="object"?d[aa]?d:T.extend(T.Event(f),d):T.Event(f);if(f.indexOf("!")>=0){d.type=f=f.slice(0,-1);d.exclusive=true}if(!e){d.stopPropagation();if(this.global[f]){T.each(T.cache,function(){if(this.events&&this.events[f]){T.event.trigger(d,b,this.handle.elem)}})}}if(!e||e.nodeType==3||e.nodeType==8){return ab}d.result=ab;d.target=e;b=T.makeArray(b);b.unshift(d)}d.currentTarget=e;var c=T.data(e,"handle");if(c){c.apply(e,b)}if((!e[f]||(T.nodeName(e,"a")&&f=="click"))&&e["on"+f]&&e["on"+f].apply(e,b)===false){d.result=false}if(!h&&e[f]&&!d.isDefaultPrevented()&&!(T.nodeName(e,"a")&&f=="click")){this.triggered=true;try{e[f]()}catch(a){}}this.triggered=false;if(!d.isPropagationStopped()){var g=e.parentNode||e.ownerDocument;if(g){T.event.trigger(d,b,g,true)}}},handle:function(b){var c,h;b=arguments[0]=T.event.fix(b||W.event);b.currentTarget=this;var a=b.type.split(".");b.type=a.shift();c=!a.length&&!b.exclusive;var d=RegExp("(^|\\.)"+a.slice().sort().join(".*\\.")+"(\\.|$)");h=(T.data(this,"events")||{})[b.type];for(var f in h){var e=h[f];if(c||d.test(e.type)){b.handler=e;b.data=e.data;var g=e.apply(this,arguments);if(g!==ab){b.result=g;if(g===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped()){break}}}},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 toElement view wheelDelta which".split(" "),fix:function(c){if(c[aa]){return c}var e=c;c=T.Event(e);for(var d=this.props.length,a;d;){a=this.props[--d];c[a]=e[a]}if(!c.target){c.target=c.srcElement||document}if(c.target.nodeType==3){c.target=c.target.parentNode}if(!c.relatedTarget&&c.fromElement){c.relatedTarget=c.fromElement==c.target?c.toElement:c.fromElement}if(c.pageX==null&&c.clientX!=null){var b=document.documentElement,f=document.body;c.pageX=c.clientX+(b&&b.scrollLeft||f&&f.scrollLeft||0)-(b.clientLeft||0);c.pageY=c.clientY+(b&&b.scrollTop||f&&f.scrollTop||0)-(b.clientTop||0)}if(!c.which&&((c.charCode||c.charCode===0)?c.charCode:c.keyCode)){c.which=c.charCode||c.keyCode}if(!c.metaKey&&c.ctrlKey){c.metaKey=c.ctrlKey}if(!c.which&&c.button){c.which=(c.button&1?1:(c.button&2?3:(c.button&4?2:0)))}return c},proxy:function(a,b){b=b||function(){return a.apply(this,arguments)};b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:P,teardown:function(){}}},specialAll:{live:{setup:function(b,a){T.event.add(this,a[0],af)},teardown:function(a){if(a.length){var c=0,b=RegExp("(^|\\.)"+a[0]+"(\\.|$)");T.each((T.data(this,"events").live||{}),function(){if(b.test(this.type)){c++}});if(c<1){T.event.remove(this,a[0],af)}}}}}};T.Event=function(a){if(!this.preventDefault){return new T.Event(a)}if(a&&a.type){this.originalEvent=a;this.type=a.type}else{this.type=a}this.timeStamp=ad();this[aa]=true};function X(){return false}function J(){return true}T.Event.prototype={preventDefault:function(){this.isDefaultPrevented=J;var a=this.originalEvent;if(!a){return}if(a.preventDefault){a.preventDefault()}a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=J;var a=this.originalEvent;if(!a){return}if(a.stopPropagation){a.stopPropagation()}a.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=J;this.stopPropagation()},isDefaultPrevented:X,isPropagationStopped:X,isImmediatePropagationStopped:X};var ah=function(b){var c=b.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(a){c=this}}if(c!=this){b.type=b.data;T.event.handle.apply(this,arguments)}};T.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){T.event.special[b]={setup:function(){T.event.add(this,a,ah,b)},teardown:function(){T.event.remove(this,a,ah)}}});T.fn.extend({bind:function(b,a,c){return b=="unload"?this.one(b,a,c):this.each(function(){T.event.add(this,b,c||a,c&&a)})},one:function(b,a,c){var d=T.event.proxy(c||a,function(e){T(this).unbind(e,d);return(c||a).apply(this,arguments)});return this.each(function(){T.event.add(this,b,d,c&&a)})},unbind:function(a,b){return this.each(function(){T.event.remove(this,a,b)})},trigger:function(b,a){return this.each(function(){T.event.trigger(b,a,this)})},triggerHandler:function(c,a){if(this[0]){var b=T.Event(c);b.preventDefault();b.stopPropagation();T.event.trigger(b,a,this[0]);return b.result}},toggle:function(a){var c=arguments,b=1;while(b<c.length){T.event.proxy(a,c[b++])}return this.click(T.event.proxy(a,function(d){this.lastToggle=(this.lastToggle||0)%b;d.preventDefault();return c[this.lastToggle++].apply(this,arguments)||false}))},hover:function(b,a){return this.mouseenter(b).mouseleave(a)},ready:function(a){P();if(T.isReady){a.call(document,T)}else{T.readyList.push(a)}return this},live:function(a,b){var c=T.event.proxy(b);c.guid+=this.selector+a;T(document).bind(Z(a,this.selector),this.selector,c);return this},die:function(a,b){T(document).unbind(Z(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});function af(a){var d=RegExp("(^|\\.)"+a.type+"(\\.|$)"),b=true,c=[];T.each(T.data(this,"events").live||[],function(g,f){if(d.test(f.type)){var e=T(a.target).closest(f.data)[0];if(e){c.push({elem:e,fn:f})}}});c.sort(function(e,f){return T.data(e.elem,"closest")-T.data(f.elem,"closest")});T.each(c,function(){if(this.fn.call(this.elem,a,this.fn.data)===false){return(b=false)}});return b}function Z(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}T.extend({isReady:false,readyList:[],ready:function(){if(!T.isReady){T.isReady=true;if(T.readyList){T.each(T.readyList,function(){this.call(document,T)});T.readyList=null}T(document).triggerHandler("ready")}}});var G=false;function P(){if(G){return}G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);T.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);T.ready()}});if(document.documentElement.doScroll&&W==W.top){(function(){if(T.isReady){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}T.ready()})()}}}T.event.add(W,"load",T.ready)}T.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(a,b){T.fn[b]=function(c){return c?this.bind(b,c):this.trigger(b)}});T(W).bind("unload",function(){for(var a in T.cache){if(a!=1&&T.cache[a].handle){T.event.remove(T.cache[a].handle.elem)}}});(function(){T.support={};var f=document.documentElement,e=document.createElement("script"),a=document.createElement("div"),b="script"+(new Date).getTime();a.style.display="none";a.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var d=a.getElementsByTagName("*"),g=a.getElementsByTagName("a")[0];if(!d||!d.length||!g){return}T.support={leadingWhitespace:a.firstChild.nodeType==3,tbody:!a.getElementsByTagName("tbody").length,objectAll:!!a.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/red/.test(g.getAttribute("style")),hrefNormalized:g.getAttribute("href")==="/a",opacity:g.style.opacity==="0.5",cssFloat:!!g.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};e.type="text/javascript";try{e.appendChild(document.createTextNode("window."+b+"=1;"))}catch(c){}f.insertBefore(e,f.firstChild);if(W[b]){T.support.scriptEval=true;delete W[b]}f.removeChild(e);if(a.attachEvent&&a.fireEvent){a.attachEvent("onclick",function(){T.support.noCloneEvent=false;a.detachEvent("onclick",arguments.callee)});a.cloneNode(true).fireEvent("onclick")}T(function(){var h=document.createElement("div");h.style.width=h.style.paddingLeft="1px";document.body.appendChild(h);T.boxModel=T.support.boxModel=h.offsetWidth===2;document.body.removeChild(h).style.display="none"})})();var H=T.support.cssFloat?"cssFloat":"styleFloat";T.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};T.fn.extend({_load:T.fn.load,load:function(e,b,a){if(typeof e!=="string"){return this._load(e)}var c=e.indexOf(" ");if(c>=0){var g=e.slice(c,e.length);e=e.slice(0,c)}var d="GET";if(b){if(T.isFunction(b)){a=b;b=null}else{if(typeof b==="object"){b=T.param(b);d="POST"}}}var f=this;T.ajax({url:e,type:d,dataType:"html",data:b,complete:function(j,h){if(h=="success"||h=="notmodified"){f.html(g?T("<div/>").append(j.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(g):j.responseText)}if(a){f.each(a,[j.responseText,h,j])}}});return this},serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?T.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(c,b){var a=T(this).val();return a==null?null:T.isArray(a)?T.map(a,function(d,e){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});T.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(b,a){T.fn[a]=function(c){return this.bind(a,c)}});var N=ad();T.extend({get:function(d,b,a,c){if(T.isFunction(b)){a=b;b=null}return T.ajax({type:"GET",url:d,data:b,success:a,dataType:c})},getScript:function(b,a){return T.get(b,null,a,"script")},getJSON:function(c,b,a){return T.get(c,b,a,"json")},post:function(d,b,a,c){if(T.isFunction(b)){a=b;b={}}return T.ajax({type:"POST",url:d,data:b,success:a,dataType:c})},ajaxSetup:function(a){T.extend(T.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return W.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},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(l){l=T.extend(true,l,T.extend(true,{},T.ajaxSettings,l));var a,u=/=\?(&|$)/g,f,b,t=l.type.toUpperCase();if(l.data&&l.processData&&typeof l.data!=="string"){l.data=T.param(l.data)}if(l.dataType=="jsonp"){if(t=="GET"){if(!l.url.match(u)){l.url+=(l.url.match(/\?/)?"&":"?")+(l.jsonp||"callback")+"=?"}}else{if(!l.data||!l.data.match(u)){l.data=(l.data?l.data+"&":"")+(l.jsonp||"callback")+"=?"}}l.dataType="json"}if(l.dataType=="json"&&(l.data&&l.data.match(u)||l.url.match(u))){a="jsonp"+N++;if(l.data){l.data=(l.data+"").replace(u,"="+a+"$1")}l.url=l.url.replace(u,"="+a+"$1");l.dataType="script";W[a]=function(x){b=x;q();m();W[a]=ab;try{delete W[a]}catch(w){}if(s){s.removeChild(d)}}}if(l.dataType=="script"&&l.cache==null){l.cache=false}if(l.cache===false&&t=="GET"){var v=ad();var c=l.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+v+"$2");l.url=c+((c==l.url)?(l.url.match(/\?/)?"&":"?")+"_="+v:"")}if(l.data&&t=="GET"){l.url+=(l.url.match(/\?/)?"&":"?")+l.data;l.data=null}if(l.global&&!T.active++){T.event.trigger("ajaxStart")}var g=/^(\w+:)?\/\/([^\/?#]+)/.exec(l.url);if(l.dataType=="script"&&t=="GET"&&g&&(g[1]&&g[1]!=location.protocol||g[2]!=location.host)){var s=document.getElementsByTagName("head")[0];var d=document.createElement("script");d.src=l.url;if(l.scriptCharset){d.charset=l.scriptCharset}if(!a){var j=false;d.onload=d.onreadystatechange=function(){if(!j&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){j=true;q();m();d.onload=d.onreadystatechange=null;s.removeChild(d)}}}s.appendChild(d);return ab}var n=false;var o=l.xhr();if(l.username){o.open(t,l.url,l.async,l.username,l.password)}else{o.open(t,l.url,l.async)}try{if(l.data){o.setRequestHeader("Content-Type",l.contentType)}if(l.ifModified){o.setRequestHeader("If-Modified-Since",T.lastModified[l.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}o.setRequestHeader("X-Requested-With","XMLHttpRequest");o.setRequestHeader("Accept",l.dataType&&l.accepts[l.dataType]?l.accepts[l.dataType]+", */*":l.accepts._default)}catch(e){}if(l.beforeSend&&l.beforeSend(o,l)===false){if(l.global&&!--T.active){T.event.trigger("ajaxStop")}o.abort();return false}if(l.global){T.event.trigger("ajaxSend",[o,l])}var k=function(y){if(o.readyState==0){if(h){clearInterval(h);h=null;if(l.global&&!--T.active){T.event.trigger("ajaxStop")}}}else{if(!n&&o&&(o.readyState==4||y=="timeout")){n=true;if(h){clearInterval(h);h=null}f=y=="timeout"?"timeout":!T.httpSuccess(o)?"error":l.ifModified&&T.httpNotModified(o,l.url)?"notmodified":"success";if(f=="success"){try{b=T.httpData(o,l.dataType,l)}catch(w){f="parsererror"}}if(f=="success"){var x;try{x=o.getResponseHeader("Last-Modified")}catch(w){}if(l.ifModified&&x){T.lastModified[l.url]=x}if(!a){q()}}else{T.handleError(l,o,f)}m();if(y){o.abort()}if(l.async){o=null}}}};if(l.async){var h=setInterval(k,13);if(l.timeout>0){setTimeout(function(){if(o&&!n){k("timeout")}},l.timeout)}}try{o.send(l.data)}catch(e){T.handleError(l,o,null,e)}if(!l.async){k()}function q(){if(l.success){l.success(b,f)}if(l.global){T.event.trigger("ajaxSuccess",[o,l])}}function m(){if(l.complete){l.complete(o,f)}if(l.global){T.event.trigger("ajaxComplete",[o,l])}if(l.global&&!--T.active){T.event.trigger("ajaxStop")}}return o},handleError:function(c,a,d,b){if(c.error){c.error(a,d,b)}if(c.global){T.event.trigger("ajaxError",[a,c,b])}},active:0,httpSuccess:function(a){try{return !a.status&&location.protocol=="file:"||(a.status>=200&&a.status<300)||a.status==304||a.status==1223}catch(b){}return false},httpNotModified:function(b,d){try{var a=b.getResponseHeader("Last-Modified");return b.status==304||a==T.lastModified[d]}catch(c){}return false},httpData:function(a,c,d){var e=a.getResponseHeader("content-type"),f=c=="xml"||!c&&e&&e.indexOf("xml")>=0,b=f?a.responseXML:a.responseText;if(f&&b.documentElement.tagName=="parsererror"){throw"parsererror"}if(d&&d.dataFilter){b=d.dataFilter(b,c)}if(typeof b==="string"){if(c=="script"){T.globalEval(b)}if(c=="json"){b=W["eval"]("("+b+")")}}return b},param:function(d){var b=[];function a(f,e){b[b.length]=encodeURIComponent(f)+"="+encodeURIComponent(e)}if(T.isArray(d)||d.jquery){T.each(d,function(){a(this.name,this.value)})}else{for(var c in d){if(T.isArray(d[c])){T.each(d[c],function(){a(c,this)})}else{a(c,T.isFunction(d[c])?d[c]():d[c])}}}return b.join("&").replace(/%20/g,"+")}});var V={},U,ae=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(b,c){var a={};T.each(ae.concat.apply([],ae.slice(0,c)),function(){a[this]=b});return a}T.fn.extend({show:function(c,a){if(c){return this.animate(K("show",3),c,a)}else{for(var e=0,g=this.length;e<g;e++){var h=T.data(this[e],"olddisplay");this[e].style.display=h||"";if(T.css(this[e],"display")==="none"){var f=this[e].tagName,b;if(V[f]){b=V[f]}else{var d=T("<"+f+" />").appendTo("body");b=d.css("display");if(b==="none"){b="block"}d.remove();V[f]=b}T.data(this[e],"olddisplay",b)}}for(var e=0,g=this.length;e<g;e++){this[e].style.display=T.data(this[e],"olddisplay")||""}return this}},hide:function(b,a){if(b){return this.animate(K("hide",3),b,a)}else{for(var c=0,d=this.length;c<d;c++){var e=T.data(this[c],"olddisplay");if(!e&&e!=="none"){T.data(this[c],"olddisplay",T.css(this[c],"display"))}}for(var c=0,d=this.length;c<d;c++){this[c].style.display="none"}return this}},_toggle:T.fn.toggle,toggle:function(a,b){var c=typeof a==="boolean";return T.isFunction(a)&&T.isFunction(b)?this._toggle.apply(this,arguments):a==null||c?this.each(function(){var d=c?a:T(this).is(":hidden");T(this)[d?"show":"hide"]()}):this.animate(K("toggle",3),a,b)},fadeTo:function(c,a,b){return this.animate({opacity:a},c,b)},animate:function(a,d,b,c){var e=T.speed(d,b,c);return this[e.queue===false?"each":"queue"](function(){var g=T.extend({},e),j,f=this.nodeType==1&&T(this).is(":hidden"),h=this;for(j in a){if(a[j]=="hide"&&f||a[j]=="show"&&!f){return g.complete.call(this)}if((j=="height"||j=="width")&&this.style){g.display=T.css(this,"display");g.overflow=this.style.overflow}}if(g.overflow!=null){this.style.overflow="hidden"}g.curAnim=T.extend({},a);T.each(a,function(q,l){var m=new T.fx(h,g,q);if(/toggle|show|hide/.test(l)){m[l=="toggle"?f?"show":"hide":l](a)}else{var n=l.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),k=m.cur(true)||0;if(n){var s=parseFloat(n[2]),o=n[3]||"px";if(o!="px"){h.style[q]=(s||1)+o;k=((s||1)/m.cur(true))*k;h.style[q]=k+o}if(n[1]){s=((n[1]=="-="?-1:1)*s)+k}m.custom(k,s,o)}else{m.custom(k,l,"")}}});return true})},stop:function(b,c){var a=T.timers;if(b){this.queue([])}this.each(function(){for(var d=a.length-1;d>=0;d--){if(a[d].elem==this){if(c){a[d](true)}a.splice(d,1)}}});if(!c){this.dequeue()}return this}});T.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,a){T.fn[b]=function(d,c){return this.animate(a,d,c)}});T.extend({speed:function(b,a,c){var d=typeof b==="object"?b:{complete:c||!c&&a||T.isFunction(b)&&b,duration:b,easing:c&&a||a&&!T.isFunction(a)&&a};d.duration=T.fx.off?0:typeof d.duration==="number"?d.duration:T.fx.speeds[d.duration]||T.fx.speeds._default;d.old=d.complete;d.complete=function(){if(d.queue!==false){T(this).dequeue()}if(T.isFunction(d.old)){d.old.call(this)}};return d},easing:{linear:function(b,a,d,c){return d+c*b},swing:function(b,a,d,c){return((-Math.cos(b*Math.PI)/2)+0.5)*c+d}},timers:[],fx:function(b,c,a){this.options=c;this.elem=b;this.prop=a;if(!c.orig){c.orig={}}}});T.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(T.fx.step[this.prop]||T.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var b=parseFloat(T.css(this.elem,this.prop,a));return b&&b>-10000?b:parseFloat(T.curCSS(this.elem,this.prop))||0},custom:function(a,b,c){this.startTime=ad();this.start=a;this.end=b;this.unit=c||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;function d(f){return e.step(f)}d.elem=this.elem;if(d()&&T.timers.push(d)&&!U){U=setInterval(function(){var f=T.timers;for(var g=0;g<f.length;g++){if(!f[g]()){f.splice(g--,1)}}if(!f.length){clearInterval(U);U=ab}},13)}},show:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());T(this.elem).show()},hide:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var d=ad();if(c||d>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var f=true;for(var e in this.options.curAnim){if(this.options.curAnim[e]!==true){f=false}}if(f){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(T.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){T(this.elem).hide()}if(this.options.hide||this.options.show){for(var b in this.options.curAnim){T.attr(this.elem.style,b,this.options.orig[b])}}this.options.complete.call(this.elem)}return false}else{var a=d-this.startTime;this.state=a/this.options.duration;this.pos=T.easing[this.options.easing||(T.easing.swing?"swing":"linear")](this.state,a,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};T.extend(T.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){T.attr(a.elem.style,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}}});if(document.documentElement.getBoundingClientRect){T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}var f=this[0].getBoundingClientRect(),c=this[0].ownerDocument,g=c.body,h=c.documentElement,a=h.clientTop||g.clientTop||0,b=h.clientLeft||g.clientLeft||0,d=f.top+(self.pageYOffset||T.boxModel&&h.scrollTop||g.scrollTop)-a,e=f.left+(self.pageXOffset||T.boxModel&&h.scrollLeft||g.scrollLeft)-b;return{top:d,left:e}}}else{T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}T.offset.initialized||T.offset.initialize();var f=this[0],j=f.offsetParent,k=f,a=f.ownerDocument,c,h=a.documentElement,e=a.body,d=a.defaultView,l=d.getComputedStyle(f,null),b=f.offsetTop,g=f.offsetLeft;while((f=f.parentNode)&&f!==e&&f!==h){c=d.getComputedStyle(f,null);b-=f.scrollTop,g-=f.scrollLeft;if(f===j){b+=f.offsetTop,g+=f.offsetLeft;if(T.offset.doesNotAddBorder&&!(T.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.tagName))){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}k=j,j=f.offsetParent}if(T.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}l=c}if(l.position==="relative"||l.position==="static"){b+=e.offsetTop,g+=e.offsetLeft}if(l.position==="fixed"){b+=Math.max(h.scrollTop,e.scrollTop),g+=Math.max(h.scrollLeft,e.scrollLeft)}return{top:b,left:g}}}T.offset={initialize:function(){if(this.initialized){return}var c=document.body,j=document.createElement("div"),g,h,a,f,b,k,e=c.style.marginTop,d='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';b={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(k in b){j.style[k]=b[k]}j.innerHTML=d;c.insertBefore(j,c.firstChild);g=j.firstChild,h=g.firstChild,f=g.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(h.offsetTop!==5);this.doesAddBorderForTableAndCells=(f.offsetTop===5);g.style.overflow="hidden",g.style.position="relative";this.subtractsBorderForOverflowNotVisible=(h.offsetTop===-5);c.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(c.offsetTop===0);c.style.marginTop=e;c.removeChild(j);this.initialized=true},bodyOffset:function(c){T.offset.initialized||T.offset.initialize();var a=c.offsetTop,b=c.offsetLeft;if(T.offset.doesNotIncludeMarginInBodyOffset){a+=parseInt(T.curCSS(c,"marginTop",true),10)||0,b+=parseInt(T.curCSS(c,"marginLeft",true),10)||0}return{top:a,left:b}}};T.fn.extend({position:function(){var b=0,c=0,e;if(this[0]){var d=this.offsetParent(),a=this.offset(),f=/^body|html$/i.test(d[0].tagName)?{top:0,left:0}:d.offset();a.top-=Y(this,"marginTop");a.left-=Y(this,"marginLeft");f.top+=Y(d,"borderTopWidth");f.left+=Y(d,"borderLeftWidth");e={top:a.top-f.top,left:a.left-f.left}}return e},offsetParent:function(){var a=this[0].offsetParent||document.body;while(a&&(!/^body|html$/i.test(a.tagName)&&T.css(a,"position")=="static")){a=a.offsetParent}return T(a)}});T.each(["Left","Top"],function(b,c){var a="scroll"+c;T.fn[a]=function(d){if(!this[0]){return null}return d!==ab?this.each(function(){this==W||this==document?W.scrollTo(!b?d:T(W).scrollLeft(),b?d:T(W).scrollTop()):this[a]=d}):this[0]==W||this[0]==document?self[b?"pageYOffset":"pageXOffset"]||T.boxModel&&document.documentElement[a]||document.body[a]:this[0][a]}});T.each(["Height","Width"],function(b,d){var f=b?"Left":"Top",c=b?"Right":"Bottom",e=d.toLowerCase();T.fn["inner"+d]=function(){return this[0]?T.css(this[0],e,false,"padding"):null};T.fn["outer"+d]=function(g){return this[0]?T.css(this[0],e,false,g?"margin":"border"):null};var a=d.toLowerCase();T.fn[a]=function(g){return this[0]==W?document.compatMode=="CSS1Compat"&&document.documentElement["client"+d]||document.body["client"+d]:this[0]==document?Math.max(document.documentElement["client"+d],document.body["scroll"+d],document.documentElement["scroll"+d],document.body["offset"+d],document.documentElement["offset"+d]):g===ab?(this.length?T.css(this[0],a):null):this.css(a,typeof g==="string"?g:g+"px")}})})();jQuery.ui||(function(c){var j=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(l,m,o){var n=c.ui[l].prototype;for(var k in o){n.plugins[k]=n.plugins[k]||[];n.plugins[k].push([m,o[k]])}},call:function(k,m,l){var o=k.plugins[m];if(!o||!k.element[0].parentNode){return}for(var n=0;n<o.length;n++){if(k.options[o[n][0]]){o[n][1].apply(k.element,l)}}}},contains:function(l,k){return document.compareDocumentPosition?l.compareDocumentPosition(k)&16:l!==k&&l.contains(k)},hasScroll:function(n,l){if(c(n).css("overflow")=="hidden"){return false}var k=(l&&l=="left")?"scrollLeft":"scrollTop",m=false;if(n[k]>0){return true}n[k]=1;m=(n[k]>0);n[k]=0;return m},isOverAxis:function(l,k,m){return(l>k)&&(l<(k+m))},isOver:function(q,l,o,n,k,m){return c.ui.isOverAxis(q,o,k)&&c.ui.isOverAxis(l,n,m)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(l,k,m){var n=m!==undefined;return(k=="role"?(n?f.call(this,l,k,"wairole:"+m):(f.apply(this,arguments)||"").replace(b,"")):(a.test(k)?(n?l.setAttributeNS(h,k.replace(a,"aaa:"),m):f.call(this,l,k.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(k){return(a.test(k)?this.each(function(){this.removeAttributeNS(h,k.replace(a,""))}):e.call(this,k))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return j.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var k;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){k=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{k=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!k.length?c(document):k}});c.extend(c.expr[":"],{data:function(m,l,k){return !!c.data(m,k[3])},focusable:function(l){var m=l.nodeName.toLowerCase(),k=c.attr(l,"tabindex");return(/input|select|textarea|button|object/.test(m)?!l.disabled:"a"==m||"area"==m?l.href||!isNaN(k):!isNaN(k))&&!c(l)["area"==m?"parents":"closest"](":hidden").length},tabbable:function(l){var k=c.attr(l,"tabindex");return(isNaN(k)||k>=0)&&c(l).is(":focusable")}});function g(n,o,q,m){function l(t){var s=c[n][o][t]||[];return(typeof s=="string"?s.split(/,?\s+/):s)}var k=l("getter");if(m.length==1&&typeof m[0]=="string"){k=k.concat(l("getterSetter"))}return(c.inArray(q,k)!=-1)}c.widget=function(l,k){var m=l.split(".")[0];l=l.split(".")[1];c.fn[l]=function(s){var o=(typeof s=="string"),q=Array.prototype.slice.call(arguments,1);if(o&&s.substring(0,1)=="_"){return this}if(o&&g(m,l,s,q)){var n=c.data(this[0],l);return(n?n[s].apply(n,q):undefined)}return this.each(function(){var t=c.data(this,l);(!t&&!o&&c.data(this,l,new c[m][l](this,s))._init());(t&&o&&c.isFunction(t[s])&&t[s].apply(t,q))})};c[m]=c[m]||{};c[m][l]=function(q,o){var n=this;this.namespace=m;this.widgetName=l;this.widgetEventPrefix=c[m][l].eventPrefix||l;this.widgetBaseClass=m+"-"+l;this.options=c.extend({},c.widget.defaults,c[m][l].defaults,c.metadata&&c.metadata.get(q)[l],o);this.element=c(q).bind("setData."+l,function(t,s,u){if(t.target==q){return n._setData(s,u)}}).bind("getData."+l,function(t,s){if(t.target==q){return n._getData(s)}}).bind("remove",function(){return n.destroy()})};c[m][l].prototype=c.extend({},c.widget.prototype,k);c[m][l].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(m,n){var l=m,k=this;if(typeof m=="string"){if(n===undefined){return this._getData(m)}l={};l[m]=n}c.each(l,function(o,q){k._setData(o,q)})},_getData:function(k){return this.options[k]},_setData:function(k,l){this.options[k]=l;if(k=="disabled"){this.element[l?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",l)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(m,n,o){var s=this.options[m],k=(m==this.widgetEventPrefix?m:this.widgetEventPrefix+m);n=c.Event(n);n.type=k;if(n.originalEvent){for(var l=c.event.props.length,q;l;){q=c.event.props[--l];n[q]=n.originalEvent[q]}}this.element.trigger(n,o);return !(c.isFunction(s)&&s.call(this.element[0],n,o)===false||n.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var k=this;this.element.bind("mousedown."+this.widgetName,function(l){return k._mouseDown(l)}).bind("click."+this.widgetName,function(l){if(k._preventClickEvent){k._preventClickEvent=false;l.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(m){m.originalEvent=m.originalEvent||{};if(m.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(m));this._mouseDownEvent=m;var l=this,n=(m.which==1),k=(typeof this.options.cancel=="string"?c(m.target).parents().add(m.target).filter(this.options.cancel).length:false);if(!n||k||!this._mouseCapture(m)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){l.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(m)&&this._mouseDelayMet(m)){this._mouseStarted=(this._mouseStart(m)!==false);if(!this._mouseStarted){m.preventDefault();return true}}this._mouseMoveDelegate=function(o){return l._mouseMove(o)};this._mouseUpDelegate=function(o){return l._mouseUp(o)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||m.preventDefault());m.originalEvent.mouseHandled=true;return true},_mouseMove:function(k){if(c.browser.msie&&!k.button){return this._mouseUp(k)}if(this._mouseStarted){this._mouseDrag(k);return k.preventDefault()}if(this._mouseDistanceMet(k)&&this._mouseDelayMet(k)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,k)!==false);(this._mouseStarted?this._mouseDrag(k):this._mouseUp(k))}return !this._mouseStarted},_mouseUp:function(k){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(k.target==this._mouseDownEvent.target);this._mouseStop(k)}return false},_mouseDistanceMet:function(k){return(Math.max(Math.abs(this._mouseDownEvent.pageX-k.pageX),Math.abs(this._mouseDownEvent.pageY-k.pageY))>=this.options.distance)},_mouseDelayMet:function(k){return this.mouseDelayMet},_mouseStart:function(k){},_mouseDrag:function(k){},_mouseStop:function(k){},_mouseCapture:function(k){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="middle";cornerClass="";break}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():"&#xa0;"):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?"&#xa0;":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?"&#xa0;":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);venere_ajax_call=function(b,f,d,e){var a=$.get;if(f=="GET"||f=="get"){a=$.get}else{if(f=="POST"||f=="post"){a=$.post}}var c=function(g,h){e(g)};a(b,d,c)};function trim(c){if(typeof c!="string"){return c}var b=c;var a=b.substring(0,1);while(a==" "){b=b.substring(1,b.length);a=b.substring(0,1)}a=b.substring(b.length-1,b.length);while(a==" "){b=b.substring(0,b.length-1);a=b.substring(b.length-1,b.length)}while(b.indexOf("  ")!=-1){b=b.substring(0,b.indexOf("  "))+b.substring(b.indexOf("  ")+1,b.length)}return b}function setVenereCookie(f,h,g){var c=new Date();var e=f+"="+(h==null?"":h);if(g!=null){c.setSeconds(g);e+="; expires="+c.toGMTString()}e+="; path=/";var b=document.location.hostname.toLowerCase();var d=b.indexOf("venere");var a="."+b.substr(d);e+="; domain="+a;document.cookie=e}function str_replace(e,d,c){var b="";var a=0;for(i=c.indexOf(e);i>-1;i=c.indexOf(e,i)){b+=c.substring(a,i);b+=d;i+=e.length;a=i}return b+c.substring(a,c.length)}function readCookie(f){var a=new String();var e=document.cookie;if(e.length>0){var b=f+"=";var d=e.indexOf(b);var c=0;if(d>-1){d+=b.length;c=e.indexOf(";",d);if(c<d){c=e.length}a=e.substring(d,c)}}return unescape(a)}function setUserPreference(a,b){return setVenereCookie(a,b)}function readUserPreference(a){return readCookie(a)}function readUserPreferredCurrency(){return readUserPreference("pref_currency")}function setUserPreferredCurrency(a){setUserPreference("pref_currency",a)}utility_funcs_loaded=true;var currencyDisplayList={EUR:1,GBP:1,USD:1,AUD:1,BRL:1,CAD:1,CHF:1,CNY:1,JPY:1,NOK:1,RUB:1,SEK:1};function StayParams(){var c,b,a,d,e;this.getCheckIn=function(){return c};this.setCheckIn=function(f){c=f};this.getCheckOut=function(){return b};this.setCheckOut=function(f){b=f};this.getDestination=function(){return a};this.setDestination=function(f){a=f};this.getPersons=function(){return d};this.setPersons=function(f){d=f};this.getRooms=function(){return e};this.setRooms=function(f){e=f};this.isEmptyDate=function(f){return f==""}}var NO_ACTION=0,SEARCH_WA=1,SEARCH_WOA=2,ERASE_COOKIES=3,AVAIL_COOKIES_EXPIRE=3600;function SearchWidget(b){this.stayParams=b;this.errors=new Array();this.action=NO_ACTION;this.isAllowedSearchWOA=false;var a=new Date();this.today=new Date(a.getFullYear(),a.getMonth(),a.getDate());this.config=new Object()}SearchWidget.prototype.init=function(a){this.config=a;if(this.config.hasDestination){this.isAllowedSearchWOA=true}};SearchWidget.prototype.getStayParams=function(){return this.stayParams.getStayParams()};SearchWidget.prototype.setStayParams=function(a){this.stayParams.setStayParams(a)};SearchWidget.prototype.getDestinationDefaultText=function(){return this.config.destinationDefaultText};SearchWidget.prototype.setDestinationDefaultText=function(a){this.config.destinationDefaultText=a};SearchWidget.prototype.process=function(){this.stayParamsValidation();this.actionChoise(this)};SearchWidget.prototype.hasErrors=function(){return this.errors.length!=0};SearchWidget.prototype.getErrors=function(){return this.errors};SearchWidget.prototype.getAction=function(){return this.action};SearchWidget.prototype.exceptionRaised=function(a){for(var b=0;b<this.errors.length;b++){if(this.errors[b]==a){return true}}return false};SearchWidget.prototype.setErrors=function(a){this.errors.push(a)};SearchWidget.prototype.stayParamsValidation=function(){if(this.config.hasDestination&&(this.stayParams.getDestination()==""||this.stayParams.getDestination()==this.config.destinationDefaultText)){this.setErrors("DESTINATION_EMPTY")}if(!this.isAllowedSearchWOA||!this.stayParams.isEmptyDate(this.stayParams.getCheckIn())||!this.stayParams.isEmptyDate(this.stayParams.getCheckOut())){var a=new Date(this.today.getTime()),c=new Date(this.today.getTime()),b=new Date(this.today.getTime());a.add("d",this.config.MIN_CHECKIN_ALLOWED_OFFSET);c.add("d",this.config.MAX_CHECKIN_ALLOWED_OFFSET);b.add("d",this.config.MAX_CHECKOUT_ALLOWED_OFFSET);if(this.stayParams.getCheckIn()==null||this.stayParams.isEmptyDate(this.stayParams.getCheckIn())){this.setErrors("INVALID_CHECKIN_DATE")}if(!this.exceptionRaised("INVALID_CHECKIN_DATE")&&(this.stayParams.getCheckIn().isBefore(a)||this.stayParams.getCheckIn().isAfter(c))){this.setErrors("INVALID_CHECKIN_DATE")}if(this.stayParams.getCheckOut()==null||this.stayParams.isEmptyDate(this.stayParams.getCheckOut())){this.setErrors("INVALID_CHECKOUT_DATE")}if(!this.exceptionRaised("INVALID_CHECKOUT_DATE")&&this.stayParams.getCheckOut().isAfter(b)){this.setErrors("INVALID_CHECKOUT_DATE")}if(!this.exceptionRaised("INVALID_CHECKOUT_DATE")&&!this.exceptionRaised("INVALID_CHECKIN_DATE")){if(this.stayParams.getCheckOut().isAfter(this.stayParams.getCheckIn())==false){this.setErrors("CHECKOUT_LESS_THAN_CHECKIN")}else{b.setTime(this.stayParams.getCheckIn().getTime());b.add("d",this.config.MAX_STAY_LENGTH_ALLOWED);if(this.stayParams.getCheckOut().isAfter(b)){this.setErrors("INVALID_CHECKOUT_DATE")}}}if(this.stayParams.getPersons()==""){this.setErrors("PERSONS_EMPTY")}if(this.stayParams.getRooms()==""){this.setErrors("ROOMS_EMPTY")}if(!this.exceptionRaised("PERSONS_EMPTY")&&!this.exceptionRaised("ROOMS_EMPTY")&&parseInt(this.stayParams.getRooms())>parseInt(this.stayParams.getPersons())){this.setErrors("PERSONS_LESS_THAN_ROOMS")}}};SearchWidget.prototype.actionChoise=function(a){if(this.isAllowedSearchWOA&&this.stayParams.isEmptyDate(this.stayParams.getCheckIn())&&this.stayParams.isEmptyDate(this.stayParams.getCheckOut())&&!this.exceptionRaised("DESTINATION_EMPTY")){this.setAction(SEARCH_WOA);return}if(!a.hasErrors()){this.setAction(SEARCH_WA);return}if((!this.config.hasDestination||this.exceptionRaised("DESTINATION_EMPTY"))&&this.stayParams.isEmptyDate(this.stayParams.getCheckIn())&&this.stayParams.isEmptyDate(this.stayParams.getCheckOut())){this.setAction(ERASE_COOKIES)}};SearchWidget.prototype.setAction=function(a){this.action=a};function SearchFormDAO(a){this.config=new Object();this.form=a;this.allowedUrlParams=new Object()}SearchFormDAO.prototype.init=function(a){this.config=a};SearchFormDAO.prototype.getDestinationCtrl=function(){return this.form.city};SearchFormDAO.prototype.getDestination=function(){destCtrl=this.getDestinationCtrl();if(destCtrl){return trim(destCtrl.value)}else{return""}};SearchFormDAO.prototype.setDestination=function(a){destCtrl=this.getDestinationCtrl();if(destCtrl){destCtrl.value=a}};SearchFormDAO.prototype.isEmptyDateCtrl=function(a){if(a.value==""||a.value==this.config.dateInputLabel){return true}return false};SearchFormDAO.prototype.getCheckInCtrl=function(){return this.form.checkin};SearchFormDAO.prototype.getDate=function(a){if(this.isEmptyDateCtrl(a)){return""}return Date.parseString(a.value,this.config.toolboxDateFormat)};SearchFormDAO.prototype.getCheckIn=function(){return this.getDate(this.getCheckInCtrl())};SearchFormDAO.prototype.getCheckOutCtrl=function(){return this.form.checkout};SearchFormDAO.prototype.getCheckOut=function(){return this.getDate(this.getCheckOutCtrl())};SearchFormDAO.prototype.getPersonsCtrl=function(){return this.form.pval};SearchFormDAO.prototype.getPersons=function(){var a=this.getPersonsCtrl();if(a.value!=""){return parseInt(a.value)}return a.value};SearchFormDAO.prototype.getRoomsCtrl=function(){return this.form.rval};SearchFormDAO.prototype.getRooms=function(){var a=this.getRoomsCtrl();if(a.value!=""){return parseInt(a.value)}return a.value};SearchFormDAO.prototype.setCheckIn=function(a){if(a!=null&&a instanceof Date){this.form.checkin.value=a.format(this.config.toolboxDateFormat);this.form.checkin.dateValue=a}};SearchFormDAO.prototype.setCheckOut=function(a){if(a!=null&&a instanceof Date){this.form.checkout.value=a.format(this.config.toolboxDateFormat);this.form.checkout.dateValue=a}};SearchFormDAO.prototype.setPersons=function(a){if(a&&a>0){this.setSelectedValue(this.getPersonsCtrl(),a)}};SearchFormDAO.prototype.setRooms=function(a){if(a&&a>0){this.setSelectedValue(this.getRoomsCtrl(),a)}};SearchFormDAO.prototype.setAllowedUrlParams=function(a){this.allowedUrlParams=a};SearchFormDAO.prototype.getGeoId=function(){if(this.form.geoid){return parseInt(this.form.geoid.value)}else{return""}};SearchFormDAO.prototype.getHotelId=function(){if(this.form.htid){return parseInt(this.form.htid.value,10)}else{return""}};SearchFormDAO.prototype.getLg=function(){if(this.form.lg){return trim(this.form.lg.value)}else{return""}};SearchFormDAO.prototype.setSelectedValue=function(b,a){for(i=0;i<b.length;i++){if(b.options[i].value==a){b.selectedIndex=i;break}}};SearchFormDAO.prototype.getStayParams=function(){var a=new StayParams;a.setCheckIn(this.getCheckIn());a.setCheckOut(this.getCheckOut());a.setDestination(this.getDestination());a.setPersons(this.getPersons());a.setRooms(this.getRooms());return a};SearchFormDAO.prototype.setStayParams=function(a){if(this.config.hasDestination&&a.getDestination()){this.setDestination(a.getDestination())}this.setCheckIn(a.getCheckIn());this.setCheckOut(a.getCheckOut());this.setPersons(a.getPersons());this.setRooms(a.getRooms())};function NextAction(){}NextAction.prototype.execute=function(){return false};NextAction.prototype.init=function(a,b){return false};PerformSearchAction.prototype=new NextAction;PerformSearchAction.prototype.constructor=PerformSearchAction;function PerformSearchAction(){}PerformSearchAction.prototype.init=function(b,a,c){this.DAO=b;this.actionToDo=a;this.preSetDAO=new PreSetDAO(c);this.config=c};PerformSearchAction.prototype.execute=function(){if(this.actionToDo==ERASE_COOKIES){this.preSetDAO.deleteAvailCookies()}else{var e=new Object();var d=new Object();if(this.actionToDo==SEARCH_WA){d.sd=e.sd=padZero(String(this.DAO.getCheckIn().getDate()));d.sm=e.sm=padZero(String(this.DAO.getCheckIn().getMonth()+1));d.sy=e.sy=this.DAO.getCheckIn().getFullYear();d.ed=e.ed=padZero(String(this.DAO.getCheckOut().getDate()));d.em=e.em=padZero(String(this.DAO.getCheckOut().getMonth()+1));d.ey=e.ey=this.DAO.getCheckOut().getFullYear();d.pval=e.pval=this.DAO.getPersons();d.rval=e.rval=this.DAO.getRooms();this.preSetDAO.setAvailCookies(e)}else{if(this.actionToDo==SEARCH_WOA){this.preSetDAO.deleteAvailCookies()}}var b,a=this.DAO.form.elements.length;var c=null;for(b=0;b<a;b++){if(this.DAO.form.elements[b].type=="hidden"&&this.DAO.form.elements[b].value!=""){e[this.DAO.form.elements[b].name]=this.DAO.form.elements[b].value}}if(this.config.defaultCity&&this.config.defaultCity.toLowerCase()==this.DAO.getDestination().toLowerCase()){if(this.config.defaultGeoId){e.geoid=this.config.defaultGeoId}else{if(this.config.defaultGeoUrl){c=this.config.defaultGeoUrl;delete e.lg}}d.cityChanged=false}else{d.cityChanged=true}d.city=this.DAO.getDestination();d.geoid=(typeof(e.geoid)=="undefined"?null:e.geoid);if(this.DAO.getDestination()!=""&&typeof(e.geoid)=="undefined"&&c==null){e.city=this.DAO.getDestination()}var f=this.preSetDAO.getAllowedUrlParams();delete f.sd;delete f.sm;delete f.sy;delete f.ed;delete f.em;delete f.ey;delete f.pval;delete f.rval;delete f.lg;delete f.htid;for(var g in f){e[g]=f[g]}var h=buildQueryStr(e);if(c!=null){c+=h}else{if(this.DAO.config.useCurrentUrlAsAction){c=window.location.pathname+h}else{if(this.DAO.getGeoId()!=""||typeof(e.geoid)!="undefined"){c="/search/index.php"+h}else{c="/site/index.php"+h}}}if(typeof(this.config.tracking_fun)=="function"){this.config.tracking_fun(d)}window.location=c}};function FinderPerformSearchAction(){}FinderPerformSearchAction.prototype.init=function(b,a,c){this.DAO=b;this.preSetDAO=new PreSetDAO(c);this.actionToDo=a};FinderPerformSearchAction.prototype.execute=function(){if(this.actionToDo==ERASE_COOKIES){this.preSetDAO.deleteAvailCookies()}else{var c=new Object();if(this.actionToDo==SEARCH_WA){c.sd=padZero(String(this.DAO.getCheckIn().getDate()));c.sm=padZero(String(this.DAO.getCheckIn().getMonth()+1));c.sy=this.DAO.getCheckIn().getFullYear();c.ed=padZero(String(this.DAO.getCheckOut().getDate()));c.em=padZero(String(this.DAO.getCheckOut().getMonth()+1));c.ey=this.DAO.getCheckOut().getFullYear();c.pval=this.DAO.getPersons();c.rval=this.DAO.getRooms();this.preSetDAO.setAvailCookies(c)}else{if(this.actionToDo==SEARCH_WOA){this.preSetDAO.deleteAvailCookies()}}if(this.DAO.getDestination()!=""){c.city=this.DAO.getDestination()}var b,a=this.DAO.form.elements.length;for(b=0;b<a;b++){if(this.DAO.form.elements[b].type=="hidden"&&this.DAO.form.elements[b].value!=""){c[this.DAO.form.elements[b].name]=this.DAO.form.elements[b].value}}var d=this.preSetDAO.getAllowedUrlParams();delete d.sd;delete d.sm;delete d.sy;delete d.ed;delete d.em;delete d.ey;delete d.pval;delete d.rval;delete d.lg;delete d.htid;for(var e in d){c[e]=d[e]}ctrl.search(c)}};HotelPerformSearchAction.prototype=new NextAction;HotelPerformSearchAction.prototype.constructor=HotelPerformSearchAction;function HotelPerformSearchAction(){}HotelPerformSearchAction.prototype.init=function(b,a,c){this.DAO=b;this.preSetDAO=new PreSetDAO(c);this.actionToDo=a};HotelPerformSearchAction.prototype.execute=function(){if(this.actionToDo==ERASE_COOKIES){this.preSetDAO.deleteAvailCookies()}else{var c=new Object();c.availParams=new Object();c.availParams.sd=padZero(String(this.DAO.getCheckIn().getDate()));c.availParams.sm=padZero(String(this.DAO.getCheckIn().getMonth()+1));c.availParams.sy=this.DAO.getCheckIn().getFullYear();c.availParams.ed=padZero(String(this.DAO.getCheckOut().getDate()));c.availParams.em=padZero(String(this.DAO.getCheckOut().getMonth()+1));c.availParams.ey=this.DAO.getCheckOut().getFullYear();c.availParams.pval=this.DAO.getPersons();c.availParams.rval=this.DAO.getRooms();this.preSetDAO.setAvailCookies(c.availParams);c.baseParams=new Object();c.baseParams.htid=this.DAO.getHotelId();c.baseParams.lg=this.DAO.getLg();var d=this.preSetDAO.getAllowedUrlParams();delete d.sd;delete d.sm;delete d.sy;delete d.ed;delete d.em;delete d.ey;delete d.pval;delete d.rval;delete d.lg;if(typeof(c.baseParams.htid)=="undefined"||c.baseParams.htid==""){c.baseParams.htid=d.htid}delete d.htid;c.extraParams=new Object();for(var e in d){c.extraParams[e]=d[e]}if(typeof(window.disableInternalRequestTracking)=="undefined"||!window.disableInternalRequestTracking){var b={};var a=c.availParams;b.checkin=a.sy+"-"+a.sm+"-"+a.sd;b.checkout=a.ey+"-"+a.em+"-"+a.ed;b.persons=a.pval;b.rooms=a.rval;window.search_dto=b;if(typeof(window.track_hotel_page_search_widget)!="undefined"){window.track_hotel_page_search_widget()}}ctrl.getSearchAvailabilities(c)}};NotifyErrorAction.prototype=new NextAction;NotifyErrorAction.prototype.constructor=NotifyErrorAction;function NotifyErrorAction(){}NotifyErrorAction.prototype.errorsMsg=new Array();NotifyErrorAction.prototype.errors={INVALID_CHECKIN_DATE:1,INVALID_CHECKOUT_DATE:2,CHECKIN_LESS_THAN_TODAY:3,CHECKOUT_LESS_THAN_CHECKIN:4,DESTINATION_EMPTY:5,PERSONS_EMPTY:6,ROOMS_EMPTY:7,PERSONS_LESS_THAN_ROOMS:8};NotifyErrorAction.prototype.init=function(a,b){this.DAO=a;this.errorsToNotify=b};NotifyErrorAction.prototype.execute=function(){var b="";for(var a=0;a<this.errorsToNotify.length;a++){b=b+"\n"+this.errorsMsg[this.errorsToNotify[a]]}alert(b)};function syncDates(c,a){if(c.syncCtrl){var b=Date.parseString(c.value,a);if(b){var d=Date.parseString(c.syncCtrl.value,a);if(!d||d==null){d=new Date(b.getTime()).add("d",((c.isBefore)?1:-1))}else{if(c.isBefore&&!b.isBefore(d)){d=new Date(b.getTime()).add("d",1)}else{if(!c.isBefore&&!b.isAfter(d)){d=new Date(b.getTime()).add("d",-1)}}}c.syncCtrl.value=d.format(a)}}}function PreSetDAO(a){this.urlParams=this.getQueryStringArgs(a);this.dateFormat="dd/M/yyyy";this.isoDateFormat="yyyyMMdd"}PreSetDAO.prototype={formatDayMonthIsoDate:function(a){if(!isNaN(a)&&(a%1==0)&&(a.length==1)){return"0"+a}return a},extractFieldFromAvailCookie:function(c){var b=this.getCookie("cavail");if(b!=undefined){var a=b.split(",");if(a.length>c){return a[c]}}return null},getCheckIn:function(){if(this.urlParams.sd&&this.urlParams.sm&&this.urlParams.sy){var b=this.formatDayMonthIsoDate(this.urlParams.sm)+"/"+this.urlParams.sy;return Date.parseString((this.formatDayMonthIsoDate(this.urlParams.sd)+"/"+b),this.dateFormat)}else{var a=this.extractFieldFromAvailCookie(0);if(a){return Date.parseString(a,this.isoDateFormat)}}return null},getCheckOut:function(){if(this.urlParams.ed&&this.urlParams.em&&this.urlParams.ey){var a=this.formatDayMonthIsoDate(this.urlParams.em)+"/"+this.urlParams.ey;return Date.parseString((this.formatDayMonthIsoDate(this.urlParams.ed)+"/"+a),this.dateFormat)}else{var b=this.extractFieldFromAvailCookie(1);if(b){return Date.parseString(b,this.isoDateFormat)}}return null},getPersons:function(){if(this.urlParams.pval){return parseInt(this.urlParams.pval)}else{if(this.extractFieldFromAvailCookie(2)){return parseInt(this.extractFieldFromAvailCookie(2))}}return 2},getRooms:function(){if(this.urlParams.rval){return parseInt(this.urlParams.rval)}else{if(this.extractFieldFromAvailCookie(3)){return parseInt(this.extractFieldFromAvailCookie(3))}}return 1},getAllowedUrlParams:function(){return this.urlParams},getCookie:function(b){var a=b+"=";if(document.cookie.length>0){offset=document.cookie.indexOf(a);if(offset!=-1){offset+=a.length;end=document.cookie.indexOf(";",offset);if(end==-1){end=document.cookie.length}return unescape(document.cookie.substring(offset,end))}}},setAvailCookies:function(a){sd=""+a.sd;ed=""+a.ed;sm=""+a.sm;em=""+a.em;pv=a.pval;rv=a.rval;if(sd.length==1){sd="0"+sd}if(ed.length==1){ed="0"+ed}if(sm.length==1){sm="0"+sm}if(em.length==1){em="0"+em}var b=a.sy+sm+sd+","+a.ey+em+ed+","+pv+","+rv;setVenereCookie("cavail",b,AVAIL_COOKIES_EXPIRE)},deleteAvailCookies:function(){setVenereCookie("cavail",null,-AVAIL_COOKIES_EXPIRE)},getQueryStringArgs:function(c){var a=new Object();var f=window.location.search.substring(1);var e=f.split("&");for(var b=0;b<e.length;b++){var h=e[b].indexOf("=");if(h==-1){continue}var g=e[b].substring(0,h);var d=e[b].substring(h+1);if(typeof(c.allowedUrlParameters[g])=="undefined"){continue}d=decodeURIComponent(d);a[g]=d}return a}};function SubmitController(a){this.config=a}SubmitController.prototype.doSubmitSW=function(){var e=false;var c=this.config.formDao;var b=this.config.performAction;var f=this.config.errorAction;c.init(this.config);var d=new StayParams;d.setCheckIn(c.getCheckIn());d.setCheckOut(c.getCheckOut());d.setDestination(c.getDestination());d.setPersons(c.getPersons());d.setRooms(c.getRooms());var a=new SearchWidget(d);a.init(this.config);a.process();if(a.hasErrors()){f.init(c,a.getErrors());toDo=f;e=false}else{b.init(c,a.getAction(),this.config);toDo=b;e=true}toDo.execute();return e};SubmitController.prototype.submitByEnter=function(b){var a=b.keyCode;if(a==13){this.doSubmitSW()}};function closeCalendarByEnterOrTab(c,b){var a=c.keyCode;if(a==13||a==9){b.over=false;b.hide()}}function setInputDefaultValue(d,b){var c;if(d&&d.data){b=d.data}if(b.ctrlId){c=document.getElementById(b.ctrlId)}else{if(b.getCtrlFun){c=b.getCtrlFun()}else{c=b.ctrl}}if(c&&c.tagName=="INPUT"){if(c.value&&b.isDate){var a=Date.parseString(c.value,b.dateFormat);if(!a){c.value=""}}if(c.value==""){c.value=b.defaultText;if(b.defaultStyle){for(prop in b.defaultStyle){c.style[prop]=b.defaultStyle[prop]}}}}}function resetInputDefaultValue(c,a){var b;if(c&&c.data){a=c.data}if(a.ctrlId){b=document.getElementById(a.ctrlId)}else{if(a.getCtrlFun){b=a.getCtrlFun()}else{b=a.ctrl}}if(b&&b.tagName=="INPUT"){if(b.value==a.defaultText){b.value=""}if(a.typeInStyle){for(prop in a.typeInStyle){b.style[prop]=a.typeInStyle[prop]}}}}var colBack="#FFFF66";var colFore="#000000";var myback=colBack;var mycount=0;var h_blink=null;var myform;function ckOnClick(b,a){if(!a){a=document.vSearch}if(b==0){a.txtCity.value="";a.txtCity.style.backgroundColor="#FFFFFF";a.txtCity.style.color="#000000";if(a.touristic_area!=null){a.touristic_area.value=a.tmp_area_tag.value}}else{if(a.touristic_area!=null){a.touristic_area.value=""}if(a.chk_city!=null){a.chk_city[1].checked=true}}}function PC(b,a){if(!a){a=document.vSearch}C2(b,0,a)}function CheckPR(a){if(!a){a=document.vSearch}p=a.pval.value;r=a.rval.value;if(p==""){p=0}if(r==""){r=0}if((p==0)&&(r==0)){if(typeof(err_no_room_person)!="string"){err_no_room_person="Please select the number of rooms and persons."}alert(err_no_room_person);return false}if((p!=0)&&(r==0)){alert(err_room_number);return false}if((r!=0)&&(p==0)){alert(err_person_number);return false}if(parseInt(r)>parseInt(p)){alert(err_room_le_person);return false}return true}function C2(c,b,a){window.location.href="#top";if(!a){a=document.vSearch}if(b){a.geoid.value=b}if(b==0){a.geoid.value=""}if(a.chk_city!=null){a.chk_city[1].checked=true}a.city.value=c.replace(/\+/g," ");if(a.find_tag!=null){a.find_tag.value="0"}if(go_submit){a.submit()}}function PA(b,a){if(!a){a=document.vSearch}window.location.href="#top";A2(b,a)}function A2(b,a){C2(b,null,a);if(!a){a=document.vSearch}a.find_tag.value="1";a.action=actLink2;if(go_submit){a.submit()}}function changeBackground(){if(!myform){myf1=document.vSearch}else{myf1=myform}myf=myf1.txtCity;if(myback==colBack){myf.style.backgroundColor=myback;myf.style.color=colFore;myback=colFore;if(mycount>=4){window.clearInterval(h_blink)}}else{myf.style.backgroundColor=myback;myback=colBack;myf.style.color=myback}mycount++}function ResetDate(a){if(!a){a=document.vSearch}a.cb_sd.selectedIndex=0;a.cb_smy.selectedIndex=0;a.cb_ed.selectedIndex=0;a.cb_emy.selectedIndex=0;a.sd.value="";a.sm.value="";a.sy.value="";a.ed.value="";a.em.value="";a.ey.value=""}function CheckDate(a){if(!a){a=document.vSearch}set_cookies_onsubmit(a);if((a.chk_city==null)||(a.chk_city[1].checked)){if(!check_city(a)){return false}if(!_CheckDate(a)){return false}}else{if(!_CheckDate(a)){return false}}return true}function _CheckDate(g){var u=new Date();var s=u.getDate();var v=u.getMonth()+1;var j=u.getFullYear();if(!g){g=document.vSearch}sel_sd=g.cb_sd;sel_smy=g.cb_smy;sel_ed=g.cb_ed;sel_emy=g.cb_emy;sel_pval=g.pval;sel_rval=g.rval;if(typeof(err_wrong_ci_date)!="string"){err_wrong_ci_date="The check-in date you entered is not valid."}if(typeof(err_wrong_co_date)!="string"){err_wrong_co_date="The check-out date you entered is not valid."}if(typeof(err_wrong_ci_90max)!="string"){err_wrong_ci_90max="The maximum length of your stay cannot exceed 90 days."}if(typeof(err_co_before_ci)!="string"){err_co_before_ci="The check-in date must be before the check-out date."}if(typeof(err_room_le_person)!="string"){err_room_le_person="Number of persons must be greater or equal of number of rooms"}if(typeof(err_person_number)!="string"){err_person_number="Please specify the number of persons"}if(typeof(err_room_number)!="string"){err_room_number="Please specify the number of rooms"}if(!((sel_sd.selectedIndex==0)&&(sel_smy.selectedIndex==0)&&(sel_ed.selectedIndex==0)&&(sel_emy.selectedIndex==0)&&(sel_pval.selectedIndex==0)&&(sel_rval.selectedIndex==0))){if(!CheckPR(g)){return false}var w=sel_sd.value;var f=new String(sel_smy.value).split("/");var a=new Number(f[0]);var q=new Number(f[1]);var d=sel_sd.options[sel_sd.selectedIndex].value;var y=f[0];var o=f[1];var l=sel_ed.value;var k=new String(sel_emy.value).split("/");var m=new Number(k[0]);var n=new Number(k[1]);var h=sel_ed.options[sel_ed.selectedIndex].value;var e=k[0];var x=k[1];if(d==0||sel_smy.selectedIndex==0){alert(err_wrong_ci_date);return false}if(h==0||sel_emy.selectedIndex==0){alert(err_wrong_co_date);return false}if((w==31&&((a==4)||(a==6)||(a==9)||(a==11)))||((w>29)&&(a==2))||((q%4!=0)&&(a==2)&&(w>28))){alert(err_wrong_ci_date);return false}if(a==v&&q==j&&w<s){alert(err_wrong_ci_date);return false}if((l==31)&&((m==4)||(m==6)||(m==9)||(m==11))||((l>29)&&(m==2))||((n%4!=0)&&(m==2)&&(l>28))){alert(err_wrong_co_date);return false}var c=new Date(q,a-1,w);var t=new Date(n,m-1,l);var b=90*24*3600*1000;if(t.getTime()-c.getTime()>b){alert(err_wrong_ci_90max);return false}else{if(t.getTime()-c.getTime()<=0){alert(err_co_before_ci);return false}}g.sd.value=d;g.sm.value=y;g.sy.value=o;g.ed.value=h;g.em.value=e;g.ey.value=x;return true}return true}function clearAll(a){a.cb_sd.selectedIndex=0;a.cb_smy.selectedIndex=0;a.cb_ed.selectedIndex=0;a.cb_emy.selectedIndex=0;a.pval.selectedIndex=0;a.rval.selectedIndex=0}function checkSelNum(a){if(a!=null&&a.selectedIndex==0){clearAll(a.form);return true}}function StartDateCheck(c){if(c!=null&&c.selectedIndex==0){clearAll(c.form);return true}var b=!c?document.vSearch:c.form;if(!b){b=document.vSearch}var l=new Date();var m=l.getDate();var j=l.getMonth()+1;var k=l.getFullYear();var g=b.cb_sd.selectedIndex;if(g==0){return true}var e=b.cb_smy.selectedIndex;if(e==0){return true}var n=new String(b.cb_smy[e].value).split("/");var a=new Number(n[0]);var h=new Number(n[1]);if(g==31){if((a==4)||(a==6)||(a==9)||(a==11)){g=30}}if((g>29)&&(a==2)){g=29}if((h%4!=0)&&(a==2)&&(g>28)){g=28}if(a==j&&h==k){if(g<m){g=m}}b.cb_sd.selectedIndex=g;var d=g+1;var o=a;var f=h;if(d>31){d=-1}if(d==31){if((o==4)||(o==6)||(o==9)||(o==11)){d=-1}}if((d>29)&&(o==2)){d=-1}if((f%4!=0)&&(o==2)&&(d>28)){d=-1}if(d==-1){d=1;e=e+1}if(e>=b.cb_emy.options.length){d=b.cb_sd.selectedIndex;e=b.cb_smy.selectedIndex}if(b.cb_ed.selectedIndex==0&&b.cb_emy.selectedIndex==0){b.cb_ed.selectedIndex=d;b.cb_emy.selectedIndex=e}if(b.cb_sd.selectedIndex>0&&b.cb_smy.selectedIndex&&b.cb_ed.selectedIndex>0&&b.cb_emy.selectedIndex>0&&b.pval.selectedIndex==0&&b.rval.selectedIndex==0){b.pval.selectedIndex=2;b.rval.selectedIndex=1}}function EndDateCheck(c){if(c!=null&&c.selectedIndex==0){clearAll(c.form);return true}var k=new Date();var m=k.getDate();var g=k.get=k.getMonth()+1;var j=k.getFullYear();if(!c){myf=document.vSearch}else{myf=c.form}if(!myf){myf=document.vSearch}myed=myf.cb_ed.selectedIndex;if(myed==0){return true}tmp=myf.cb_emy.selectedIndex;if(tmp==0){return true}var n=new String(myf.cb_emy[tmp].value).split("/");var q=new Number(n[0]);var d=new Number(n[1]);if(myed==31){if((q==4)||(q==6)||(q==9)||(q==11)){myed=30}}if((myed>29)&&(q==2)){myed=29}if((d%4!=0)&&(q==2)&&(myed>28)){myed=28}if(q==g&&d==j){if(myed<m){myed=m}}var o=new String(myf.cb_smy.value).split("/");var b=new Number(o[0]);var l=new Number(o[1]);var h=myf.cb_sd.value;var a=new Date(l,b-1,h);var e=new Date(d,q-1,myed);var f=90*24*3600*1000;if(e.getTime()-a.getTime()>f){e.setTime(a.getTime()+f);myed=String(e.getDate());while(myed.length<2){myed=String("0")+myed}q=String(e.getMonth()+1);while(q.length<2){q=String("0")+q}d=String(e.getFullYear());myf.cb_emy.value=String(q)+"/"+d}myf.cb_ed.selectedIndex=myed}function CheckSearchForm(a){sel_sd=myf.cb_sd.selectedIndex;sel_smy=myf.cb_smy.selectedIndex;sel_ed=myf.cb_ed.selectedIndex;sel_emy=myf.cb_emy.selectedIndex;sel_pval=myf.pval.selectedIndex;sel_rval=myf.rval.selectedIndex}function Sel(d,e,c,a){if(!a){a=document.vSearch}if(d==""){a.city.value=a.txtCity.value;var b=0;if(a.myc){do{a.myc[b].checked=false}while(++b<a.myc.length)}a.city.value=a.txtCity.value}else{a.city.value=d;a.txtCity.value=d}if(c=="selgeoid"){a.geoid.value=e}a.geoid.value=e}function set_null(a){if(!a){a=document.vSearch}a.geoid.value=0}function set_null_selgeoid(a){if(!a){a=document.vSearch}a.geoid.value=""}function check_city(a){if(!a){a=document.vSearch}if(a.txtCity.value.length==0){alert(err_textcity);return false}return true}function _Check_city(a){if(!a){a=document.vSearch}if(a.city.value.length==0){if(typeof(err_textcity)!="string"){err_textcity="Insert a destination"}alert(err_textcity);return false}return true}function getday(g){var l=2;var c=new Date();var h=c.getYear();if(h<1000){h+=1900}var j=new Date(h,c.getMonth(),c.getDate()+1);var h=j.getYear();if(h<1000){h+=1900}var n=new Date(h,j.getMonth(),j.getDate()+l);var a=n.getYear();if(a<1000){a+=1900}var d=j.getDate();var f=(j.getMonth()+1)+"/"+h;var m=j.getMonth()+1;if((j.getMonth()+1)<10){f="0"+f}if(d<10){d="0"+d}var b=n.getDate();var e=(n.getMonth()+1)+"/"+a;var k=n.getMonth()+1;if((n.getMonth()+1)<10){e="0"+e}if(b<10){b="0"+b}setvalues(g,d,f,b,e,2,1);setvalues_hidden(g,d,m,h,b,k,a,2,1);SetCookie(d,f,b,e,2,1)}function setvalues(e,d,g,b,a,c,f){e.cb_sd.value=d;e.cb_smy.value=g;e.cb_ed.value=b;e.cb_emy.value=a;e.pval.value=c;e.rval.value=f}function setvalues_hidden(d,g,c,h,e,a,f,j,b){d.sd.value=g;d.sm.value=c;d.sy.value=h;d.ed.value=e;d.em.value=a;d.ey.value=f;d.pval.value=j;d.rval.value=b}function setAvailabilityCookies(f,j,e,h,k,b){var d=j.substring(3)+j.substring(0,2)+f;var c=h.substring(3)+h.substring(0,2)+e;var g=/^\d{8},\d{8},\d+,\d+$/;var a=d+","+c+","+k+","+b;if(g.test(a)){setVenereCookie("cavail",a,3600)}}function getCookieVal(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return document.cookie.substring(b,a)}function GetCookie(d){var b=d+"=";var f=b.length;var a=document.cookie.length;var e=0;while(e<a){var c=e+f;if(document.cookie.substring(e,c)==b){return getCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return null}function EraseCooKie(a){setVenereCookie("savail["+a+"]",null,-1000*24*60*60)}function cookieControll(c){var d=c.cb_sd.value;var e=c.cb_smy.value;var b=c.cb_ed.value;var a=c.cb_emy.value;if(!d&&!e&&!b&&!a){EraseCooKie("_sd");EraseCooKie("_smy");EraseCooKie("_ed");EraseCooKie("_emy");EraseCooKie("_pv");EraseCooKie("_rv")}else{set_cookies_onsubmit(c)}}function getArgs(){var b=new Object();var f=location.search.substring(1);var e=f.split("&");for(var c=0;c<e.length;c++){var g=e[c].indexOf("=");if(g==-1){continue}var a=e[c].substring(0,g);var d=e[c].substring(g+1);b[a]=d}return b}function check_cookies_onload(c){query_params=getArgs();if(query_params.sd&&query_params.sm&&query_params.sy&&query_params.ed&&query_params.em&&query_params.ey&&query_params.pval&&query_params.rval){sd=query_params.sd;while(sd.length<2){sd="0"+String(sd)}smy=query_params.sm+"/"+query_params.sy;ed=query_params.ed;while(ed.length<2){ed="0"+String(ed)}emy=query_params.em+"/"+query_params.ey;pv=query_params.pval;rv=query_params.rval;setvalues(c,sd,smy,ed,emy,pv,rv)}else{if(query_params.checkin&&(query_params.checkout||query_params.nights)){var b=query_params.checkin;sd=b.substr(8,2);smy=b.substr(5,2)+"/"+b.substr(0,4);if(query_params.checkout){var a=query_params.checkout;ed=a.substr(8,2);emy=a.substr(5,2)+"/"+a.substr(0,4)}else{ed="";emy=""}pv=2;rv=1;setvalues(c,sd,smy,ed,emy,pv,rv)}if(!query_params.checkin&&!query_params.sd){if(visit=GetCookie("savail[_sd]")){sd=GetCookie("savail[_sd]");smy=GetCookie("savail[_smy]");ed=GetCookie("savail[_ed]");emy=GetCookie("savail[_emy]");pv=GetCookie("savail[_pv]");rv=GetCookie("savail[_rv]");setvalues(c,sd,smy,ed,emy,pv,rv)}}}}function set_cookies_onsubmit(c){sd=c.cb_sd.value;smy=c.cb_smy.value;ed=c.cb_ed.value;emy=c.cb_emy.value;pv=c.pval.value;rv=c.rval.value;var a=""+sd;var b=""+ed;if(a.length==1){sd="0"+sd}if(b.length==1){ed="0"+ed}if(smy.length==6){smy="0"+smy}if(emy.length==6){emy="0"+emy}setAvailabilityCookies(sd,smy,ed,emy,pv,rv)}function EraseCookies(){EraseCooKie("_sd");EraseCooKie("_smy");EraseCooKie("_ed");EraseCooKie("_emy");EraseCooKie("_pv");EraseCooKie("_rv")}function check_email(a){ok="1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";for(i=0;i<a.length;i++){if(ok.indexOf(a.charAt(i))<0){return(false)}}if(document.images){re=/(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;re_two=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;if(!a.match(re)&&a.match(re_two)){return(-1)}}}function check_form(a){if(!check_email(a.email.value)){alert("Invalid email detected, please retype it!");a.email.focus();if(document.all||document.getElementByID){a.email.style.background="yellow"}return false}return true}function OC(c,f,b,a,d,e,a,d){WOpen("/cgi/ihr/vcom/calendar.php?name_form="+c+"&inout="+f+"&lg="+b+"&mese="+a+"&anno="+d+"&gi=0&load=1&dg="+e+"&dm="+a+"&da="+d,"","top=300,left=300,location=0,height=158,width=150,scrollbars=0,status=0,resizable=0");void (0)}if(typeof(utility_funcs_loaded)=="undefined"||!utility_funcs_loaded){function includeUtilityFuncsJS(){var a=document.getElementsByTagName("head")[0];var b=document.createDocumentFragment();var c=document.createElement("script");c.setAttribute("src","/common/js/utility_funcs.js");b.appendChild(c);a.appendChild(b)}function addEventHandler(b,c,a){if(b.addEventListener){b.addEventListener(c,a,false)}else{if(b.attachEvent){b.attachEvent("on"+c,a)}else{b["on"+c]=a}}}addEventHandler(window,"load",includeUtilityFuncsJS)}function execSearchTracking(a){if(typeof window.track_site_search_widget=="function"){window.track_site_search_widget(a)}return true}Date.$VERSION=1.02;Date.LZ=function(a){return(a<0||a>9?"":"0")+a};Date.monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Date.monthAbbreviations=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Date.dayNames=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");Date.dayAbbreviations=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");Date.preferAmericanFormat=true;if(!Date.prototype.getFullYear){Date.prototype.getFullYear=function(){var a=this.getYear();return(a<1900?a+1900:a)}}Date.parseString=function(J,C){if(typeof(C)=="undefined"||C==null||C==""){var o=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d","MMM-d","d-MMM");var b=new Array("M/d/y","M-d-y","M.d.y","M/d","M-d");var n=new Array("d/M/y","d-M-y","d.M.y","d/M","d-M");var e=new Array(o,Date.preferAmericanFormat?b:n,Date.preferAmericanFormat?n:b);for(var A=0;A<e.length;A++){var w=e[A];for(var z=0;z<w.length;z++){var D=Date.parseString(J,w[z]);if(D!=null){return D}}}return null}this.isInteger=function(d){for(var c=0;c<d.length;c++){if("1234567890".indexOf(d.charAt(c))==-1){return false}}return true};this.getInt=function(K,l,y,j){for(var c=j;c>=y;c--){var d=K.substring(l,l+c);if(d.length<y){return null}if(this.isInteger(d)){return d}}return null};J=J+"";C=C+"";var I=0;var t=0;var F="";var g="";var H="";var k,h;var m=new Date().getFullYear();var G=1;var E=1;var a=0;var B=0;var v=0;var s="";while(t<C.length){F=C.charAt(t);g="";while((C.charAt(t)==F)&&(t<C.length)){g+=C.charAt(t++)}if(g=="yyyy"||g=="yy"||g=="y"){if(g=="yyyy"){k=4;h=4}if(g=="yy"){k=2;h=2}if(g=="y"){k=2;h=4}m=this.getInt(J,I,k,h);if(m==null){return null}I+=m.length;if(m.length==2){if(m>70){m=1900+(m-0)}else{m=2000+(m-0)}}}else{if(g=="MMM"||g=="NNN"){G=0;var q=(g=="MMM"?(Date.monthNames.concat(Date.monthAbbreviations)):Date.monthAbbreviations);for(var A=0;A<q.length;A++){var f=q[A];if(J.substring(I,I+f.length).toLowerCase()==f.toLowerCase()){G=(A%12)+1;I+=f.length;break}}if((G<1)||(G>12)){return null}}else{if(g=="EE"||g=="E"){var q=(g=="EE"?Date.dayNames:Date.dayAbbreviations);for(var A=0;A<q.length;A++){var u=q[A];if(J.substring(I,I+u.length).toLowerCase()==u.toLowerCase()){I+=u.length;break}}}else{if(g=="MM"||g=="M"){G=this.getInt(J,I,g.length,2);if(G==null||(G<1)||(G>12)){return null}I+=G.length}else{if(g=="dd"||g=="d"){E=this.getInt(J,I,g.length,2);if(E==null||(E<1)||(E>31)){return null}I+=E.length}else{if(g=="hh"||g=="h"){a=this.getInt(J,I,g.length,2);if(a==null||(a<1)||(a>12)){return null}I+=a.length}else{if(g=="HH"||g=="H"){a=this.getInt(J,I,g.length,2);if(a==null||(a<0)||(a>23)){return null}I+=a.length}else{if(g=="KK"||g=="K"){a=this.getInt(J,I,g.length,2);if(a==null||(a<0)||(a>11)){return null}I+=a.length;a++}else{if(g=="kk"||g=="k"){a=this.getInt(J,I,g.length,2);if(a==null||(a<1)||(a>24)){return null}I+=a.length;a--}else{if(g=="mm"||g=="m"){B=this.getInt(J,I,g.length,2);if(B==null||(B<0)||(B>59)){return null}I+=B.length}else{if(g=="ss"||g=="s"){v=this.getInt(J,I,g.length,2);if(v==null||(v<0)||(v>59)){return null}I+=v.length}else{if(g=="a"){if(J.substring(I,I+2).toLowerCase()=="am"){s="AM"}else{if(J.substring(I,I+2).toLowerCase()=="pm"){s="PM"}else{return null}}I+=2}else{if(J.substring(I,I+g.length)!=g){return null}else{I+=g.length}}}}}}}}}}}}}}if(I!=J.length){return null}if(G==2){if(((m%4==0)&&(m%100!=0))||(m%400==0)){if(E>29){return null}}else{if(E>28){return null}}}if((G==4)||(G==6)||(G==9)||(G==11)){if(E>30){return null}}if(a<12&&s=="PM"){a=a-0+12}else{if(a>11&&s=="AM"){a-=12}}return new Date(m,G-1,E,a,B,v)};Date.isValid=function(b,a){return(Date.parseString(b,a)!=null)};Date.prototype.isBefore=function(a){if(a==null){return false}return(this.getTime()<a.getTime())};Date.prototype.isAfter=function(a){if(a==null){return false}return(this.getTime()>a.getTime())};Date.prototype.equals=function(a){if(a==null){return false}return(this.getTime()==a.getTime())};Date.prototype.equalsIgnoreTime=function(c){if(c==null){return false}var b=new Date(this.getTime()).clearTime();var a=new Date(c.getTime()).clearTime();return(b.getTime()==a.getTime())};Date.prototype.format=function(I){I=I+"";var n="";var z=0;var L="";var f="";var l=this.getYear()+"";var g=this.getMonth()+1;var J=this.getDate();var q=this.getDay();var o=this.getHours();var B=this.getMinutes();var u=this.getSeconds();var w,x,b,v,N,e,G,F,C,t,P,o,O,j,a,D;var A=new Object();if(l.length<4){l=""+(+l+1900)}A.y=""+l;A.yyyy=l;A.yy=l.substring(2,4);A.M=g;A.MM=Date.LZ(g);A.MMM=Date.monthNames[g-1];A.NNN=Date.monthAbbreviations[g-1];A.d=J;A.dd=Date.LZ(J);A.E=Date.dayAbbreviations[q];A.EE=Date.dayNames[q];A.H=o;A.HH=Date.LZ(o);if(o==0){A.h=12}else{if(o>12){A.h=o-12}else{A.h=o}}A.hh=Date.LZ(A.h);A.K=A.h-1;A.k=A.H+1;A.KK=Date.LZ(A.K);A.kk=Date.LZ(A.k);if(o>11){A.a="PM"}else{A.a="AM"}A.m=B;A.mm=Date.LZ(B);A.s=u;A.ss=Date.LZ(u);while(z<I.length){L=I.charAt(z);f="";while((I.charAt(z)==L)&&(z<I.length)){f+=I.charAt(z++)}if(typeof(A[f])!="undefined"){n=n+A[f]}else{n=n+f}}return n};Date.prototype.getDayName=function(){return Date.dayNames[this.getDay()]};Date.prototype.getDayAbbreviation=function(){return Date.dayAbbreviations[this.getDay()]};Date.prototype.getMonthName=function(){return Date.monthNames[this.getMonth()]};Date.prototype.getMonthAbbreviation=function(){return Date.monthAbbreviations[this.getMonth()]};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};Date.prototype.add=function(a,c){if(typeof(a)=="undefined"||a==null||typeof(c)=="undefined"||c==null){return this}c=+c;if(a=="y"){this.setFullYear(this.getFullYear()+c)}else{if(a=="M"){this.setMonth(this.getMonth()+c)}else{if(a=="d"){this.setDate(this.getDate()+c)}else{if(a=="w"){var b=(c>0)?1:-1;while(c!=0){this.add("d",b);while(this.getDay()==0||this.getDay()==6){this.add("d",b)}c-=b}}else{if(a=="h"){this.setHours(this.getHours()+c)}else{if(a=="m"){this.setMinutes(this.getMinutes()+c)}else{if(a=="s"){this.setSeconds(this.getSeconds()+c)}}}}}}}return this};vcomSv="http://www.venere.com";vcomCp="/aboutus/";vcomCpWOpt="width=700,height=400,scrollbars=1,status=0,resize=0";function WOpen(f,e,d,g,a,h,b,c){if(!d){d=""}d+=g?(d?",":"")+"width="+g:"";d+=a?(d?",":"")+"height="+a:"";d+=h!==(void 0)?(d?",":"")+"scrollbars="+h:"";d+=b!==(void 0)?(d?",":"")+"status="+b:"";d+=c!==(void 0)?(d?",":"")+"resizable="+c:"";new_w=window.open(f,e,d);if(new_w){new_w.focus()}}function GoTo_old(a){location.href=a;return void 0}function empty(a){return a==null||a==""}function buildQueryObj(e){if(e==null||e==""){e=window.location.search}var c=new Object();if(e.length>0&&e.charAt(0)=="?"){e=e.substr(1)}var a=e.split("&");var b;for(b=0;b<a.length;b++){var d=a[b].split("=");if(d[0].length>0){c[d[0]]=d.length>1?d[1]:""}}return c}function buildQueryStr(b){var c="";for(var a in b){if(typeof(b[a])=="function"){continue}c+=((c=="")?"?":"&");c+=a+"="+b[a]}return c}function setParam(){var d=buildQueryObj(window.location.search);for(var b=0;b<setParam.arguments.length;b+=2){var a=setParam.arguments[b];var c=setParam.arguments[b+1];d[a]=c}window.location=window.location.pathname+buildQueryStr(d)}function setParamWithAnchor(b){var e=buildQueryObj(window.location.search);for(var c=1;c<setParamWithAnchor.arguments.length;c+=2){var a=setParamWithAnchor.arguments[c];var d=setParamWithAnchor.arguments[c+1];e[a]=d}window.location=window.location.pathname+buildQueryStr(e)+"#"+b}function delParam(){var c=buildQueryObj(window.location.search);for(var b=0;b<delParam.arguments.length;b++){var a=delParam.arguments[b];delete c[a]}window.location=window.location.pathname+buildQueryStr(c)}function delSetParam(d,c,h){var f=buildQueryObj(window.location.search);var g="";var a=false;for(var b in f){if(b!=d){var e="";if(b!=c){e=f[b]}else{a=true;e=h}if(e!=""){g+=g.length==0?"?":"&";g+=b+"="+e}}}if(!a){g+=(g.length==0?"?":"&")+c+"="+h}window.location=window.location.pathname+g}function delAvail(){delParam("sd","sm","sy","ed","em","ey","pval","rval")}function setM(b,a){setQuery("/search/","geoid",b,"view","map","type","","seltype","ALL","city_area",a)}function setQuery(){var e=setQuery.arguments.length>0?setQuery.arguments[0]:null;if(e==null||e==""){e=window.location.pathname}var d=buildQueryObj();for(var b=1;b<setQuery.arguments.length;b+=2){var a=setQuery.arguments[b];var c=setQuery.arguments[b+1];d[a]=c}window.location=e+buildQueryStr(d)}function setCookie(d,f,e,a){var b=new Date();var c=d+"="+f;if(e!=null){b.setSeconds(e);c+="; expires="+b.toGMTString()}if(a!=null){c+="; path="+a}document.cookie=c}function getCookie(d){var b=document.cookie.split("; ");for(var c=0;c<b.length;c++){var a=b[c].split("=");if(d==a[0]){return a[1]}}return""}function TrackCount(a,c,b){var d=b-a.value.length;if(d<0){a.value=a.value.substring(0,b);d=b-a.value.length}if(c){c.value=d}}function LimitText(b,c){var a=true;if(b.value.length>=c){a=false}if(window.event){window.event.returnValue=a}return a}function padZero(a){while(a.length<2){a=String("0")+a}return a}var HotelConstants={ajaxCallDefaultTimeout:15000,servicePath:"http://www.venere.com/passthru/ajax/hotel_services.php",currenciesService:"http://www.venere.com/passthru/ajax/get_currencies_info.php",tripAdvReviewsUrl:"http://www.venere.com/passthru/apps/get_tripadvisor_review_widget.php",tripAdvUrlReviewListScope:"hp",tripAdvUrlSummaryScope:"hps",feedbackService:"feedback",availabilityService:"availability",mlg:"mlg",ping:"ping",cookieUserPrefName:"user_pref",cookieUserPrefSeparator:"|",cookieNoAvailPrefix:"no_avail_",eurCurrency:"EUR",noAvailabilityDiagnosticCode:3301,invalidParametersDiagnosticCode:3302,propertyNotActiveDiagnosticCode:3303,availDateTypeFrom:"from",availDateTypeTo:"to",availabilitySearchBlockID:"availability_rooms",availLoadiadingDivId:"avail_loading",availLoadingDivContainerID:"availability_rooms",onLoadAvailLoadingDivContainerID:"CheckAvailabilityContainer",roomAvailabilityFormDivID:"availability_form",availabilitySearchSummaryDivID:"availability-search-summary",roomDetailsCancPolicyDivId:"cancellation_policy",roomDescriptionDivClass:"room_description",thumbsDivId:"thumbs",stripBookNowDivId:"hotelstrip-book",availroomlist_strip_class:"availroomlist_strip",reviewListDivId:"reviews-list-box",reviewSummaryDivId:"avg_guest_review",tripAdvSumIFrameName:"tripAdvSum",bookFormIDPrefix:"book_form_",otherHotelDivIDPrefix:"htl",otherHotelCurrencySelector:".other-hotels-price span.currency-symbol",otherHotelPriceSelector:".other-hotels-price span.avg-price",hotelDescriptionDivId:"hotel_description",hotelDescriptionBodyDivId:"hotel-description-body",readFullDescriptionDivId:"read-full-description",hotelFullDescrClass:"full-description",noRoomsInfoClassName:"no-rooms-info",effectVelocity:500,scrollVelocity:"slow",brokenImageURL:"http://www.venere.com/img/background/htlpage_nophoto.png",brokenThumbURL:"http://www.venere.com/img/background/htlpage_nophoto.png",imageViewerNoImageWidth:200,avgPriceField:"price_for_room_night",avgStrikeThroughPriceField:"price_no_promo_for_room_night",avgPriceColumnLabelKey:"price_per_night_th",sectionIDSuffix:"-section",sectionsIDs:{overview:"overview-section",location:"location-section",reviews:"reviews-section"},defaultSectionId:"overview-section",tabsBarId:"tabs",tabIDs:{overviewTab:"overview_tab",locationTab:"location_tab",reviewsTab:"reviews_tab"},widgets:{photogallery:0,gmap:1,reviews:2},gmapLibrayURL:"http://maps.google.com/maps/api/js?sensor=false",propertyMapLibrayURL:"map.js",propertyMapDivId:"location_map_container",propertyMapIcon:"http://www.venere.com/img/search2/mappe/icon_gmap_blue.png",history_switch:true,mainSeparator:";",changeCurrency:{updatingDomElementsModelFieldsMap:{1:{selector:".availroom_price_tot_num",repository:"combinationRate",repositoryField:"totalPrice"},2:{selector:".avg_price",repository:"combinationRate",repositoryField:"avgPrice"},3:{selector:".strike_through",repository:"combinationRate",repositoryField:"avgStrikeThroughPrice"},4:{selector:"td[class$='availroom_price_tot']>div>p>span",repository:"combinationRate",repositoryField:"savedAmount"},5:{selector:".stripdetailsummary_totprice>p>strong",repository:"combinationRate",repositoryField:"totalPrice"},6:{selector:".total_price",repository:"combinationRate",repositoryField:"totalPrice"},7:{selector:".deal_save_price>p>span",repository:"combinationRate",repositoryField:"savedAmount"},8:{selector:".stp_totalprice>span",repository:"combinationRate",repositoryField:"strikeThroughPrice"},9:{selector:".stp_total_price",repository:"combinationRate",repositoryField:"strikeThroughPrice"},10:{selector:".deal-infopopup>div>span",repository:"combinationRate",repositoryField:"savedAmount"}}},valueAddsCategories:{1:{cssClass:"va-food-meal"},2:{cssClass:"va-parking"},3:{cssClass:"va-all-inclusive"},4:{cssClass:"va-internet"},5:{cssClass:"va-shuttle"},6:{cssClass:"va-free-room-upgrade"},7:{cssClass:"va-sport-recreation"},8:{cssClass:"va-nightlife"},breakfastIncludedClass:"va-breakfast-included"},VisualizationTypeNoDeal:1,VisualizationTypeDealPercent:2,VisualizationTypeDealNoPercent:3,VisualizationTypeDealSTP60:4};function Model(){this.property=null;this.info=null;this.generalInfo=null;this.servicesVersion=null;this.imageGalleryUtil=null;this.SiteSearchFormConfig=null;this.RoomSearchFormConfig=null;this.mlg=null;this.parsedMlg=null;this.roomGenericDetails=null;this.roomsDetails=null;this.searchQueryObj=null;this.extendedDataRequired=false;this.blockGroupBySection=null;this.movedBlocks=null;this.selectedSection=null;this.displayCurrencyCode=null;this.oldDisplayCurrencyCode=null;this.currencyDisplayList=null;this.pageStatus=null;this.isChangedCurrency=false;this.lowestPriceWoAvail=null;this.noTripAdvReviews=false;this.isIE7=/MSIE 7/i.test(navigator.userAgent);this.otherHotelPrices=null;this.hotelDescriptionHeights=null;this.widgets={isLoadedPhotogallery:false,isLoadedGmap:false,isLoadedReviews:false};this.lowest_price_4_room_4_night=null;this.availResultCurrency=null;this.availResultCurrencyCode=null;this.ESRBillingCurrencyLabel=null;this.CurrencyNames={EUR:"",GBP:"",USD:""};this.useRefDiscount=false;this.min_combination_price=0}Model.prototype={getNumDistinctRoomsInCombination:function(b){var a=0;if(!this.property){return -1}if(b){for(var c in this.property.rooms){if((typeof this.property.rooms[c].avail=="undefined")||this.property.rooms[c].avail==""){continue}if(this.property.rooms[c].avail<=this.generalInfo.room_scarcity_threshold){a++}}}else{for(var c in this.property.rooms){a++}}return a},getScarcityData:function(){var a=new Array();var b=true;if(!this.property){return -1}for(var c in this.property.rooms){if((typeof this.property.rooms[c].avail=="undefined")||this.property.rooms[c].avail==""){continue}if(this.property.rooms[c].avail<=this.generalInfo.room_scarcity_threshold){b=false;a.push(this.property.rooms[c].avail)}}return b?-1:a.join(",")},isExternalSystem:function(){return this.generalInfo.ext_sys_code!=""},initGeneralInfo:function(a){if(typeof(a.user_country_code)=="undefined"){a.user_country_code=null}this.generalInfo=new GeneralInfo(a.hotel_id,a.seo_hotel_name,a.hotel_city_geo_id,a.lg,a.ext_sys_code,a.extended_data_required,a.view_fee,a.currency_code,a.preset_currency_code,a.country_cur,a.user_country_code,a.avail_loading_mlg,a.add_tripadvisor_reviews,a.ref,a.hide_reviews_section,a.room_scarcity_threshold,a.room_cancel_hours);this.imageGalleryUtil=new ImageGalleryUtil(a.ig_prev,a.ig_next,a.ig_init);if(this.generalInfo.extended_data_required){this.extendedDataRequired=true}if(a.hotel_city_name&&a.hotel_city_url){this.SiteSearchFormConfig.defaultCity=a.hotel_city_name;this.SiteSearchFormConfig.defaultGeoUrl=a.hotel_city_url}if(typeof(a.other_hotel_prices)!="undefined"){this.otherHotelPrices=a.other_hotel_prices}},initServicesVersion:function(a){this.servicesVersion=a},initPageStatus:function(b,a){this.pageStatus=new PageStatus(b,a)},initHotelDescriptionHeights:function(b,a){this.hotelDescriptionHeights=new HotelDescriptionHeights(b,a)},isExtendedDataRequired:function(){return this.extendedDataRequired},initProperty:function(D){if(typeof(D.error)!="undefined"){return 0}if(typeof(D.warn)!="undefined"){this.property=new Property(D.property.id,D.property.active,D.property.avail_policy,D.property.type_singular,D.property.type_plural,D.property.hotel_geo_id,D.property.country_geo_id,null,null,null,null,D.property.display_currency,D.property.vat_excluded,null,null,null,D.property.ext_sys);this.info=new Info(null,null,null,null,null,null,null,null,null,null,D.info.cc_op,null);return 2}if(typeof(D.property.discount.friend_code)!="undefined"&&D.property.discount.friend_code!=null){var C=new FriendCodeDiscount(D.property.discount.friend_code.code,D.property.discount.friend_code.percentage_discount,D.property.discount.friend_code.name,D.property.discount.friend_code.surname)}else{var C=null}var l=new Discount(D.property.discount.active,D.property.discount.is_visible,D.property.discount.label,D.property.discount.id,C);var H=new Object();for(var F in D.property.rooms){var K=D.property.rooms[F];var E=K.id;var y=K.occupancy;var j=K.disp_ib;var c=K.disp_or;var n=K.name;var q=K.custom_name;var m=null;var k=K.avail;var b=F;var A=new Array();for(var v in K.room_rate){var o=K.room_rate[v];var f=new RoomRate(o.code,o.price,o.discounted_price,o.charge,o.promo_description,o.booking_condition,o.deal,o.refundable,o.perfectly_formed,o.standard_room_name,o.price_per_night);A.push(f)}var B=new Room(E,y,j,c,n,q,m,A,k);H[b]=B}var d=new Array();for(var u in D.property.combinations){var w=D.property.combinations[u];var N=w.combination_rate;var G=Array();var O=0;for(var a in w.rooms){var Q=w.rooms[a];var e=new CombinationRoom(Q.roomId,Q.disp,Q.room_id_extended);G.push(e);O+=parseInt(Q.disp,10)}var z=null,g=null,s=null;if(typeof(N.total_price_no_promo)!="undefined"&&N.total_price<N.total_price_no_promo){z=N.total_price_no_promo;g=N[HotelConstants.avgStrikeThroughPriceField];s=(z-N.total_price);if(s!=Math.round(s)){s=s.toFixed(2)}}var h=false;var L=0;if(w.value_add){for(var M=0;M<w.rooms.length;M++){var x=w.rooms[M]["room_id_extended"];if(w.value_add[x]){L+=this.countValuesAdds(w.value_add[x])}h=H[x].roomRates[0]["promoDescription"]?true:h}}var t=N[HotelConstants.avgPriceField];var J=N.total_price;if(this.useRefDiscount){J=N.discounted_price;z=N.total_price;t=Math.ceil(N.combination_price/D.property.nights/O);g=Math.ceil(N.total_price/D.property.nights/O);s=Math.ceil(N.total_price)-Math.ceil(N.discounted_price)}var I=new CombinationRate(N.code,N.r_prices,N.r_charges,N.r_stp,N.r_tax_amounts,N.r_fee_amounts,N.room_rate_promo_list,J,N.total_tax_amount,N.total_fee_amount,N.discounted_price,N.combination_price,t,N.tot_charge,N.charge_type,N.rooms_payment_type,z,g,s,N.has_deals,N.deals_description,N.deals_typology,w.amenities,w.description,w.value_add,L,h,N.ext_code,N.rate_group);var P=new Combination(w.is_disp_ib,w.r_disp,w.r_ids,G,I,w.unique_rate_id,w.cancellation_policy,w.use_ext_room_ids,w.r_ids_extended);d.push(P)}d.sort(this.compareAvailabilityCombinations);this.property=new Property(D.property.id,D.property.active,D.property.avail_policy,D.property.type_singular,D.property.type_plural,D.property.hotel_geo_id,D.property.country_geo_id,H,d,D.property.currency,D.property.currency_symbol,D.property.display_currency,D.property.vat_excluded,D.property.nights,D.property.min_price,l,D.property.ext_sys);if(typeof(D.property.property_details)!="undefined"){this.propertyDetails=new PropertyDetails(D.property.property_details.cancellation_policy,D.property.property_details.check_in_instruction,D.property.property_details.accepted_credit_cards)}if(typeof(D.property.ext_sys_type)!="undefined"){this.extSysType=D.property.ext_sys_type}this.info=new Info(D.info.httpsServer,D.info.persons,D.info.rooms,D.info.lg,D.info.checkin.date.value,D.info.checkin.date.translate,D.info.checkout.date.value,D.info.checkout.date.translate,D.info.ref,D.info.ta_op,D.info.cc_op,D.info.demoreservation);if(this.searchQueryObj){this.min_combination_price=this.property.combinations[this.getIndexMinCombinationRate()]["combinationRate"].totalPrice}return 1},getMinCombinationRate:function(){var a=parseFloat(this.property.combinations[0].combinationRate.totalPrice);for(var b=1;b<this.property.combinations.length;b++){if(parseFloat(this.property.combinations[b].combinationRate.totalPrice)<a){a=parseFloat(this.property.combinations[b].combinationRate.totalPrice)}}return a},getIndexMinCombinationRate:function(){var b=0;var a=this.getMinCombinationRate();for(var c=1;c<this.property.combinations.length;c++){if(this.property.combinations[c].combinationRate.totalPrice<a){b=c}}return b},getConvertedTotalPrice:function(){return this.getNewRate(this.property.combinations[this.getIndexMinCombinationRate()]["combinationRate"],"totalPrice",this.displayCurrencyCode).price},countValuesAdds:function(a){if(a==null){return 0}var b=0;for(var c in a.bunch){b++}if(a.breakfast_included){b++}return b},compareAvailabilityCombinations:function(f,e){var d=f.combinationRate.totalPrice;var h=f.combinationRate.discountedPrice;if((h!=null)&&(h>0)){d=h}var c=e.combinationRate.totalPrice;var g=e.combinationRate.discountedPrice;if((g!=null)&&(g>0)){c=g}if(d==c){var k=f.combinationRate.valuesAddsNumber;var j=e.combinationRate.valuesAddsNumber;var b=f.combinationRate.hasPromoDescription;var a=e.combinationRate.hasPromoDescription;if((j&&!k)||(!j&&!k&&a)||((j&&k)&&((j>=k&&(!b||(b&&a)))||(j<k&&a&&!b)))){return 1}else{return -1}}return d-c},initMlg:function(a){this.mlg=new Object();for(currMlg in a){this.mlg[currMlg]=a[currMlg]}this.CurrencyNames.EUR=this.mlg.eur_name_pl;this.CurrencyNames.GBP=this.mlg.gbp_name_pl;this.CurrencyNames.USD=this.mlg.usd_name_pl},initParsedMlg:function(){this.parsedMlg=new Object();if(this.info!=null&&this.mlg!=null){var b=this.mlg;var c=this.info.rooms;var d=this.info.persons;var f="";var e="";var k=new Array();var a=new Array();var g="";if(c==1){f=b.rooms_sg}else{f=b.rooms_pl.replace("%rooms%",c)}if(d==1){e=b.guests_sg}else{e=b.guests_pl.replace("%guests%",d)}k=this.getDateObjectFromAvail(HotelConstants.availDateTypeFrom);a=this.getDateObjectFromAvail(HotelConstants.availDateTypeTo);g=b.from_to_date;g=g.replace("%from_month%",k.monthName);g=g.replace("%from_day%",k.day);g=g.replace("%from_year%",k.year);g=g.replace("%to_month%",a.monthName);g=g.replace("%to_day%",a.day);g=g.replace("%to_year%",a.year);this.parsedMlg.roomsLabel=f;this.parsedMlg.guestsLabel=e;this.parsedMlg.checkinCheckoutLabel=g;if(this.isExtendedDataRequired()){var h=this.CurrencyNames[this.availResultCurrency];if(typeof h=="undefined"){h=this.CurrencyNames.EUR}this.ESRBillingCurrencyLabel=b.mop_esr_currency.replace("%cur%",h)}var j;for(i in this.property.rooms){j=this.property.rooms[i].occupancy;if(typeof(this.parsedMlg["occupancyTitle"+j]=="undefined")){if(j==1){this.parsedMlg["occupancyTitle"+j]=b.occupancy_sg}else{this.parsedMlg["occupancyTitle"+j]=b.occupancy_pl.replace("%guests%",j)}}}}},initRoomGenericDetails:function(b){this.roomGenericDetails=new Array();for(var a in b){if(b[a]!="undefined"){this.roomGenericDetails[a]=b[a]}}},getBlockGroupBySection:function(){return this.blockGroupBySection},setBlockGroupBySection:function(a){this.blockGroupBySection=a;this.initMovedBlocks(this.blockGroupBySection.sections)},initMovedBlocks:function(f){this.movedBlocks=new Array();for(var d in f){for(var e in f.section){var b=f[d][e].blockId;var a=f[d][e].containerId;var c=$("#"+b).parent("#"+a);if(!c==a){this.movedBlocks.push(b)}}}this.movedBlocks.push("MapCallout");this.movedBlocks.push("other-hotels");this.movedBlocks.push(HotelConstants.reviewSummaryDivId);this.movedBlocks.push(HotelConstants.availabilitySearchBlockID)},getMovedBlocks:function(){return this.movedBlocks},addMovedBlocks:function(a){if($.inArray(a,this.movedBlocks)<0){this.movedBlocks.push(a)}},getBlocksToChange:function(j,b){var a=null;if(this.movedBlocks.length){a=this.movedBlocks}else{a=new Array()}var h=new Array();for(var f in this.getBlocksBySection(j)){var d=this.blockGroupBySection.sections[j][f];var c=d.blockId;if($.inArray(c,a)<0){continue}if(b=="movable"){var e=d.containerId;var g=$("#"+c).parent().attr("id");if(g!=e){h.push(c)}}else{if(this.getBlockBehaviour(c)=="fixed"){h.push(c)}}}return h},getBlocksBySection:function(a){var b=new Array();if(a){var c=this.getBlockGroupBySection();if(c.sections[a]){return c.sections[a]}}return b},getBlockInfo:function(a,c){var f=new Object();var e=null;var d=null;var b=null;var h=this.blockGroupBySection.sections[c];for(var g in h){b=false;f.behaviour=this.getBlockBehaviour(a);if(a==h[g].blockId){if(typeof(h[g].previousBrother)!="undefined"&&h[g].previousBrother!=null){f.previousBrother=h[g].previousBrother;b=true}else{f.previousBrother=e}f.containerId=h[g].containerId;if(h[g].containerId!=d&&f.behaviour=="movable"&&!b){f.position=1}else{f.position=-1}}e=h[g].blockId;d=h[g].containerId}return f},getBlockBehaviour:function(a){if($.inArray(a,this.blockGroupBySection["fixed-elements"])>=0){return"fixed"}else{if($.inArray(a,this.blockGroupBySection["movable-elements"])>=0){return"movable"}else{return"lazy"}}},setRoomDynamicDetails:function(b){this.roomsDetails=new Array();if(b&&b.property&&b.property.combinations){var f=0;this.availResultCurrency=b.property.currency;this.availResultCurrencyCode=b.property.currency_symbol;for(var d in b.property.combinations){var e=new Array();var g=b.property.combinations[d];this.roomsDetails[g.r_ids]=new Array();if(!f||g.combination_rate.price_for_room_night<f){f=g.combination_rate.price_for_room_night}for(var a in blockGroupBySection.room_details){var c=blockGroupBySection.room_details[a];if(g[c]){e[c]=g[c]}else{if(this.roomGenericDetails[c]){e[c]=this.roomGenericDetails[c]}else{if("on_request_disclaimer"==c){if(g.is_disp_ib==0){e[c]="."}}else{e[c]=""}}}this.roomsDetails[g.r_ids][c]=e[c]?e[c]:null}}this.lowest_price_4_room_4_night=f}},getRoomDetail:function(a,b){return this.roomsDetails[a][b]},getRoomDetails:function(a){return this.roomsDetails[a]},getDateObjectFromAvail:function(d){var b,f,c,e,a;if(HotelConstants.availDateTypeFrom==d){b=this.RoomSearchFormConfig.formDao.getStayParams().getCheckIn()}else{if(HotelConstants.availDateTypeTo==d){b=this.RoomSearchFormConfig.formDao.getStayParams().getCheckOut()}}if(b instanceof Date){f=b.getMonth();c=b.getDate();e=b.getFullYear();a=$(this.RoomSearchFormConfig.formDao.getCheckInCtrl()).datepicker("option","monthNames")[f]}return{day:c,monthName:a,year:e}},getTripAdvSrc:function(b){var a=HotelConstants.tripAdvReviewsUrl;a+="?scope="+b;a+="&htid="+this.generalInfo.hotel_id;a+="&lg="+this.generalInfo.lg;return a},initCurrencyDisplayList:function(a){this.currencyDisplayList=a},initConversionTable:function(a){this.conversionTable=new Object();for(i in a){this.conversionTable[a[i].code]=new Currency(a[i])}},getCurrencyConversion:function(b,e){var a=b;if(this.conversionTable!=null&&b.currency!=null&&b.currency!=e){if((typeof(this.conversionTable[e])=="undefined")||(typeof(this.conversionTable[e]["ask"])=="undefined")||(typeof(this.conversionTable[b.currency]["ask"])=="undefined")){return a}var d=this.conversionTable[e]["ask"]/this.conversionTable[b.currency]["ask"];var f=Math.round((d*(b.price))*Math.pow(10,1))/Math.pow(10,1);var c=e;if(typeof(this.conversionTable[e])!="undefined"){c=this.conversionTable[e]["symbol"]}a=new Rate(f,e,c)}return a},getNewRate:function(j,c,f){var b=null;if(c=="savedAmount"){var l=j.strikeThroughPrice;var e=j.totalPrice;var m=new Rate(l,this.property.currency,this.property.currencySymbol);var d=this.getCurrencyConversion(m,f);var a=new Rate(e,this.property.currency,this.property.currencySymbol);var h=this.getCurrencyConversion(a,f);b=new Rate(Math.ceil(d.price)-Math.ceil(h.price),d.currency,d.currencySymbol)}else{var k=j[c];if(k!=null){var g=new Rate(k,this.property.currency,this.property.currencySymbol);b=this.getCurrencyConversion(g,f)}}return b}};function Rate(c,a,b){this.price=c;this.currency=a;this.currencySymbol=b}function Property(a,c,h,o,l,n,b,e,k,j,g,m,f,t,d,q,s){this.id=a;this.active=c;this.availPolicy=h;this.typeSingular=o;this.typePlural=l;this.hotelGeoId=n;this.countryGeoId=b;this.rooms=e;this.combinations=k;this.currency=j;this.currencySymbol=g;this.displayCurrency=m;this.vatExcluded=f;this.nights=t;this.combinationMinPrice=d;this.discount=q;this.externalSystem=s}Property.prototype={isThereAreSomeValueAdds:function(){vAddsPresent=false;for(var a=0;a<this.combinations.length;a++){if(this.combinations[a].combinationRate.valuesAddsNumber>0){vAddsPresent=true;break}}return vAddsPresent}};function FriendCodeDiscount(c,b,a,d){this.code=c;this.percentageDiscount=b;this.name=a;this.surname=d}function Discount(d,a,c,e,b){this.active=d;this.isVisible=a;this.label=c;this.id=e;this.friendCodeDiscount=b}function RoomRate(a,g,d,h,b,j,e,l,c,k,f){this.code=a;this.price=g;this.discountedPrice=d;this.charge=h;this.promoDescription=b;this.bookingCondition=j;this.deal=e;this.refundable=l;this.perfectlyFormed=c;this.standard_room_name=k;this.pricePerNight=f}function CombinationRate(a,t,e,F,l,q,s,k,u,b,f,g,o,z,E,c,h,v,y,m,D,w,n,C,j,B,A,d,x){this.code=a;this.ext_code=d;this.rPrices=t;this.rCharges=e;this.rStp=F;this.totalPrice=k;this.totalTaxAmount=u;this.totalFeeAmount=b;this.rTaxAmounts=l;this.rFeeAmounts=q;this.roomRatePromoList=s;this.discountedPrice=f;this.combinationPrice=g;this.avgPrice=o;this.totCharge=z;this.chargeType=E;this.roomsPaymentType=c;this.strikeThroughPrice=h;this.avgStrikeThroughPrice=v;this.savedAmount=y;this.hasDeals=m;this.dealsDescription=D;this.dealsTypology=w;this.combAmenities=n;this.amenitiesDesc=C;this.valuesAdds=j;this.valuesAddsNumber=B;this.hasPromoDescription=A;this.dealGroupId=x}function CombinationRoom(b,a,c){this.roomId=b;this.disp=a;this.roomIdExtended=c}function Service(c,a,b){this.id=c;this.name=a;this.description=b}function Combination(j,b,d,g,f,c,a,e,h){this.isDispIb=j;this.rDisp=b;this.rIds=d;this.bUseExtRoomIds=e;this.combinationsRooms=g;this.combinationRate=f;this.uniqueRateId=c;this.cancellationPolicy=a;this.rIdsExtended=h!=null?h:d}Combination.prototype={isCombinationWithScarcity:function(){var d=jQuery.getContext();var b=d.model.generalInfo.room_scarcity_threshold;var a=this.getExtendedIdRoomsAsArray();for(var c=0;c<a.length;c++){if((typeof d.model.property.rooms[a[c]].avail=="undefined")||d.model.property.rooms[a[c]].avail==""){continue}if(d.model.property.rooms[a[c]].avail<=b){return true}}return false},getScarcityData:function(){var e=jQuery.getContext();var c=e.model.generalInfo.room_scarcity_threshold;var a=new Array();var b=this.getExtendedIdRoomsAsArray();for(var d=0;d<b.length;d++){if((typeof e.model.property.rooms[b[d]].avail=="undefined")||e.model.property.rooms[b[d]].avail==""){a.push(-1)}else{if(e.model.property.rooms[b[d]].avail<=c){a.push(e.model.property.rooms[b[d]].avail)}else{a.push(-1)}}}return a.join(",")},getIdRooms:function(){var b=[];for(var a=0;a<this.combinationsRooms.length;a++){b.push(this.combinationsRooms[a].roomId)}return b.join(",")},getExtendedIdRoomsAsArray:function(){var b=[];for(var a=0;a<this.combinationsRooms.length;a++){b.push(this.combinationsRooms[a].roomIdExtended)}return b}};function Room(c,a,e,f,b,h,d,j,g){this.id=c;this.occupancy=a;this.dispIb=e;this.dispOr=f;this.name=b;this.customName=h;this.servicesList=d;this.roomRates=j;this.avail=g}function ReservationDate(b,a){this.reservationDate=b;this.translatedDate=a}function Info(e,g,d,l,m,f,b,k,c,j,h,a){this.httpsServer=e;this.persons=g;this.rooms=d;this.lg=l;this.checkin=new ReservationDate(m,f);this.checkout=new ReservationDate(b,k);this.ref=c;this.ta_op=j;this.cc_op=h;this.demoreservation=a}function PriceElement(){this.defaultCurrency=null;this.defaultPrice=null;this.elementId=null}function PropertyDetails(b,a,c){this.cancellationPolicy=b;this.checkInInstruction=a;this.acceptedCreditCards=c}function GeneralInfo(q,k,e,t,o,j,g,a,n,c,m,b,d,f,s,l,h){this.hotel_id=q;this.seo_hotel_name=k;this.hotel_city_geo_id=e;this.lg=t;this.ext_sys_code=o;this.extended_data_required=j;this.view_fee=g;this.country_cur=c;this.currency_code=a;this.preset_currency_code=n;this.user_country_code=m;this.avail_loading_mlg=b;this.add_tripadvisor_reviews=d;this.ref=f;this.hide_reviews_section=s;this.room_scarcity_threshold=l;this.room_cancel_hours=h}GeneralInfo.prototype={getLabelCancellationPolicy:function(){var a=jQuery.getContext();if(this.room_cancel_hours<-24){var b=Math.abs(Math.floor(this.room_cancel_hours/24));return a.model.mlg.cp_free_hover_25.replace("%DAYS_BEFORE_CHECKIN%",b)}else{if(this.room_cancel_hours==-24){return a.model.mlg.cp_free_hover_24}else{if(this.room_cancel_hours==12){return a.model.mlg.cp_free_hover_12}else{if(this.room_cancel_hours==18){return a.model.mlg.cp_free_hover_18}else{return""}}}}},hasRoomCancellationHours:function(){return(typeof(this.room_cancel_hours)!="undefined")&&this.room_cancel_hours!=null}};function ImageGalleryUtil(c,b,a){this.init_photo_gallery=a;this.prev_label=c;this.next_label=b}function Currency(a){this.code=a.code;this.priority_display=a.priority_display;this.group_display=a.group_display;this.name=a.name;this.symbol=a.symbol;this.ask=a.ask}function PageStatus(b,a){this.selectedCurrency=b;this.selectedSectionId=a}function HotelDescriptionHeights(b,a){this.displayHeight=b;this.fullHeight=a}function View(){}View.prototype={initEffects:function(){var a=/MSIE (6|7)/i.test(navigator.userAgent)},changeSelectedCurrency:function(b,a){$(".CurrMenu >li > span > strong").text(b);$(".CurrMenu >li > ul > #"+a).toggleClass("CurrMenuSel");$(".CurrMenu >li > ul > #"+b).addClass("CurrMenuSel")},renderPropertyNoAvailabilityResult:function(){if($("#availability_rooms_list")){$("#availability_rooms_list").remove()}},renderPropertyAvailabilityResult:function(a){if(!a.isChangedCurrency){this.renderAvailabilitySearchForm(a)}this.renderRoomsList(a)},renderAvailabilitySearchForm:function(a){this.renderRoomAvailabilityResultTitle(a);this.hideRoomSearchForm();this.renderAvailabilitySearchSummaryDiv(a)},renderRoomAvailabilityResultTitle:function(a){var b=a.mlg;if(b!=null){$("#"+HotelConstants.availabilitySearchBlockID+" > h2").html(b.check_avail_title_dated)}$("#"+HotelConstants.availabilitySearchBlockID).addClass("dated")},renderRoomAvailabilityChangeDatesTitle:function(a){var b=a.mlg;if(b!=null){$("#"+HotelConstants.availabilitySearchBlockID+" > h2").html(b.change_dates_title)}$("#"+HotelConstants.availabilitySearchBlockID).addClass("dated")},renderRoomsList:function(d){var j=d.property;var u=j.combinations;var v=d.mlg;var b="";var t="";var g=j.nights;if(g>0){if(g==1){t=v.number_of_nights_sg}else{t=v.number_of_nights_pl.replace("%nights%",g)}}if(j.vatExcluded){b=v.tax_excluded}else{b=v.tax_included}var c=new Array();c.push('<div id="availability_rooms_list">');c.push('<table id="availroomlist_title">');c.push("<tr>");c.push('<td id="availroomlist_title_rooms"></td>');c.push('<td id="availroomlist_title_nights">'+d.mlg.th_services+"</td>");c.push('<td id="availroomlist_totprice">'+v.total_price_th+" "+t+"<span>"+b+"</span></td>");c.push("</tr>");c.push("</table>");for(var k=0;k<u.length;k++){var h=u[k];c.push(this.renderAvailabilityRoomCombinationStrip(h,d,k))}c.push("</div>");if($("#availability_rooms_list").length!=0){$("#availability_rooms_list").replaceWith(c.join(""))}else{$("#"+HotelConstants.availabilitySearchBlockID).append(c.join(""))}$(".room-not-refundable a").hover(function(){$(this).parent().children(".hdp-infopopup").css({display:"block"})},function(){$(this).parent().children(".hdp-infopopup").css({display:"none"})});if(d.generalInfo.hasRoomCancellationHours()){$(".room-free-cancellation a").hover(function(){$(this).parent().children(".hdp-infopopup").css({display:"block"})},function(){$(this).parent().children(".hdp-infopopup").css({display:"none"})})}for(var k=0;k<u.length;k++){$("#"+HotelConstants.bookFormIDPrefix+k).bind("submit",{combinationIndex:k},function(y){var x=jQuery.getContext();x.trackBookForm(y.data.combinationIndex);return true})}var m=d.availResultCurrencyCode;var e=d.lowest_price_4_room_4_night;if(d.displayCurrencyCode!=j.currency){var f=new Rate(d.lowest_price_4_room_4_night,j.currency,d.property.currencySymbol);var n=d.getCurrencyConversion(f,d.displayCurrencyCode);e=n.price;m=n.currencySymbol}var s=$("#"+HotelConstants.stripBookNowDivId),q=$("#avgPriceEl0"),w=$("#fromTo"),l=$("#currency-symbol");var o=s.find("span.hotelstrip-book-txt"),a=$("#bookNowPriceLbl");s.removeClass("undated");s.addClass("dated");if(l.length>0){l.html(m)}else{q.before('<span id="currency-symbol">'+m+"</span>")}if(ctrl.model.searchQueryObj){q.html(Math.ceil(ctrl.model.getConvertedTotalPrice()))}else{q.html(Math.ceil(e))}if(a.length>0){if(ctrl.model.searchQueryObj){a.html(d.mlg.total_price_th)}else{a.html(d.mlg.price_per_room_night_th)}}else{if(ctrl.model.searchQueryObj){q.after('<span id="bookNowPriceLbl">'+d.mlg.total_price_th+"</span>")}else{q.after('<span id="bookNowPriceLbl">'+d.mlg.price_per_room_night_th+"</span>")}a=$("#bookNowPriceLbl")}if(w.length>0){w.html(d.parsedMlg.checkinCheckoutLabel)}else{a.after('<span id="fromTo">'+d.parsedMlg.checkinCheckoutLabel+"</span>")}o.html(d.mlg.book_now)},getAvailabilityAmenitiesHTML:function(b){var c=new Array();var f=b.combinationsRooms;if(b.combinationRate.combAmenities){for(var e=0;e<f.length;e++){var d=f[e];var g=b.combinationRate.combAmenities[d.roomIdExtended];if(g){c.push('<div id="availroom_amenities" height:>');c.push("<ul>");for(var a=0;a<g.length;a++){c.push("<li>"+g[a].description+"</li>")}c.push("</ul>");c.push("</div>")}}}return c.join("")},renderAvailabilityRoomCombinationStrip:function(S,b,A){var I=b.property;var K=I.rooms;var c=new Array();var f=S.combinationsRooms;var J="";if(I.currencySymbol!=""){J=I.currencySymbol}else{J=I.currency}var M=J;var L="";var O=new Array();var V=new Array();var s=new Array();var n=(S.combinationRate.rStp!=null)?(S.combinationRate.rStp+"").split(","):null;var o;for(var h=0;h<f.length;h++){s[h]=new Array();var x=new Array();var z=f[h];L=K[z.roomIdExtended].roomRates[0].promoDescription;var j=b.parsedMlg["occupancyTitle"+K[z.roomIdExtended].occupancy];o=K[z.roomIdExtended].roomRates[0].pricePerNight;O.push(K[z.roomIdExtended].name);V.push(K[z.roomIdExtended].occupancy);var H='<b class="roomname">'+K[z.roomIdExtended].name+"</b>";if(K[z.roomIdExtended].customName){var w="";if(K[z.roomIdExtended].roomRates[0].bookingCondition){if(!b.isExternalSystem()){w=""}else{w='<span class="availroom-booking-condition"> '+K[z.roomIdExtended].roomRates[0].bookingCondition+"</span>"}}var T=w;roomNameText=K[z.roomIdExtended].customName;if(K[z.roomIdExtended].roomRates[0].deal){T='<span class="availroom-deal"> '+K[z.roomIdExtended].roomRates[0].deal+w+"</span>"}H='<b class="roomname">'+roomNameText+"</b>"+T}x.push("<div>");x.push('<span class="availroom_name_num">'+z.disp+"</span>");x.push('<div class="availroom_name_txt" title="'+j+'"><p>'+H+'</p><span class="availroom_name_occup_'+K[z.roomIdExtended].occupancy+'"></span></div>');if(S.combinationRate.valuesAdds){if(S.combinationRate.valuesAdds[z.roomIdExtended]){var C=S.combinationRate.valuesAdds[z.roomIdExtended]["breakfast_included"];if(C){x.push('<span class="availroom_name_breakfast">'+b.mlg.breakfast_included+"</span>")}}}x.push("</div>");var D=x.join("");s[h]["strRoomCombinationName"]=D;var B=(S.combinationRate.hasDeals?"deal_availroom_price_tot":"availroom_price_tot");var a=(S.combinationRate.hasDeals?"deal_availroom_price_night":"availroom_price_night");var y=new Array();y.avgPrice=S.combinationRate.avgPrice;y.totalPrice=S.combinationRate.totalPrice;y.totalSTPPrice=S.combinationRate.strikeThroughPrice;if(n!=null){y.priceStpPerNight=n[h]}y.pricePerNight=o;if(S.combinationRate.savedAmount){y.savedAmount=Math.ceil(S.combinationRate.savedAmount);y.avgStrikeThroughPrice=S.combinationRate.avgStrikeThroughPrice}if(b.displayCurrencyCode!=I.currency){y.total_price_no_promo=S.combinationRate.strikeThroughPrice;M=b.displayCurrencyCode;if((typeof(b.conversionTable[b.displayCurrencyCode])!="undefined")&&typeof(b.conversionTable[b.displayCurrencyCode]["symbol"]!="undefined")){M=b.conversionTable[b.displayCurrencyCode]["symbol"]}for(var q in y){var R=new Rate(y[q],I.currency,I.currencySymbol);var t=b.getCurrencyConversion(R,b.displayCurrencyCode);y[q]=t.price}if(S.combinationRate.savedAmount){y.savedAmount=Math.ceil(y.total_price_no_promo)-Math.ceil(y.totalPrice)}}var Q=/Chrome/i.test(navigator.userAgent);var m=new Array();if(S.combinationRate.savedAmount){m.push('<p class="strike_through">'+M+" "+Math.ceil(y.avgStrikeThroughPrice)+" </p>")}m.push('<p class="avg_price">'+M+" "+Math.ceil(y.avgPrice)+" "+b.mlg.room_night_price+"</p>");if(typeof(L)!="undefined"&&L){m.push('<span class="promodescription">'+L+"</span>")}s[h]["strCombinationPrice"]=m.join("");if((typeof K[z.roomIdExtended].avail!="undefined")&&K[z.roomIdExtended].avail!=""){if(K[z.roomIdExtended].avail<=b.generalInfo.room_scarcity_threshold){if(K[z.roomIdExtended].avail==1){s[h]["scarcity_message"]='<span class="scarcity-message">'+b.mlg.room_left_1+"</span>"}else{s[h]["scarcity_message"]='<span class="scarcity-message">'+b.mlg.room_left_n.replace("%room_left%",K[z.roomIdExtended].avail)+"</span>"}}else{s[h]["scarcity_message"]=""}}else{s[h]["scarcity_message"]=""}if(!b.isExternalSystem()){if(I.rooms[z.roomIdExtended].roomRates[0].standard_room_name){if(I.rooms[z.roomIdExtended].roomRates[0].refundable){if(b.generalInfo.hasRoomCancellationHours()){s[h]["strBookingConditions"]="<span class='room-free-cancellation'><a>"+b.mlg.cp_free_title+"</a>";s[h]["strBookingConditions"]+="<div class='hdp-infopopup' style='display: none'><p>"+b.generalInfo.getLabelCancellationPolicy()+"</p></div>";s[h]["strBookingConditions"]+="</span>"}else{s[h]["strBookingConditions"]="<span class='room-free-cancellation'>"+b.mlg.cp_free_title+"</span>"}}else{s[h]["strBookingConditions"]="<span class='room-not-refundable'><a>"+b.mlg.cp_notref_title+"</a>";s[h]["strBookingConditions"]+="<div class='hdp-infopopup' style='display: none'><p>"+b.mlg.cp_notref_hover+"</p></div>";s[h]["strBookingConditions"]+="</span>"}}else{s[h]["strBookingConditions"]=""}}else{s[h]["strBookingConditions"]=""}if(S.combinationRate.valuesAdds){var U=new Array();if(S.combinationRate.valuesAdds[z.roomIdExtended]){var u=S.combinationRate.valuesAdds[z.roomIdExtended]["bunch"];if(u){U.push('<ul id="availroom_value_adds">');for(var F in u){var l=u[F].category;U.push('<li class="'+HotelConstants.valueAddsCategories[l]["cssClass"]+'">'+u[F].description+"</li>")}U.push("</ul>")}}var E=U.join("");s[h]["strValueAdds"]=E}else{s[h]["strValueAdds"]=""}}var e=new Array();var N=S.combinationsRooms.length==2?' rowspan="2" ':"";e.push("<td "+N+' class="'+B+'">');var v="",d="";var k=Q?"deal_sticker_chrome":"deal_sticker";var P=S.combinationRate.dealsTypology!=null&&(S.combinationRate.dealsTypology<3);if(S.combinationRate.savedAmount&&!(b.useRefDiscount&&P)){v=b.mlg.stu_save.replace("%saved%","<span>"+M+" "+y.savedAmount+"</span>");d=S.combinationRate.hasDeals?k:"stp_only_sticker"}else{if(S.combinationRate.hasDeals){if(S.combinationRate.dealsDescription){v=S.combinationRate.dealsDescription}else{v=b.mlg.deals_special_price}d=k}}if(v){e.push('<div class="'+d+'"><p>'+v+"</p></div>")}e.push('<span class="availroom_price_tot_num">'+M+" "+Math.ceil(y.totalPrice)+" </span> ");e=e.concat(this.getBookingForm(S,b,A,O,V));e.push("</td>");c.push('<div id="strip_'+A+'" class="availroomlist_strip">');c.push('<table cellpadding="0" cellspacing="0" class="availroomlist_strip_info">');for(var G=0;G<s.length;G++){c.push("<tr>");c.push("<td class='availroom_name'>"+s[G]["strRoomCombinationName"]+s[G]["strCombinationPrice"]+s[G]["scarcity_message"]+"</td>");if(!b.isExternalSystem()){c.push("<td class='value-adds-col'>"+s[G]["strBookingConditions"]+s[G]["strValueAdds"]+"</td>")}else{c.push("<td class='value-adds-col'>"+s[G]["strValueAdds"]+"</td>")}if(G==0){c=c.concat(e)}if(G==s.length-1){c.push("</tr>")}}c.push("</table>");var g=c;g.push('<div class="availroomlist_strip_details">');g.push(this.renderAvailabilityRoomCombinationDetails(S,b));g.push(this.renderAvailabilityRoomCombinationSummary(S,b,A));g.push("</div>");g.push("</div>");return g.join("")},getBookingForm:function(h,d,l,s,C){var f=new Array();var B=d.mlg;var w=null;var y=null;if(d.propertyDetails){if(d.propertyDetails.checkInInstruction){w=d.propertyDetails.checkInInstruction}if(d.propertyDetails.acceptedCreditCards){y=d.propertyDetails.acceptedCreditCards}}var c=h.rIds;var o=h.rDisp;var e=h.combinationRate.rPrices;var t=h.combinationRate.totalTaxAmount;var j=h.combinationRate.totalFeeAmount;var u=h.combinationRate.rTaxAmounts;var G=h.combinationRate.rFeeAmounts;var a=d.property.vatExcluded;var A=h.combinationRate.rCharges;var m=h.combinationRate.ext_code;var q=h.combinationRate.roomRatePromoList;var z=h.combinationRate.totCharge;var E=h.combinationRate.chargeType;var b=h.combinationRate.roomsPaymentType;var D=h.cancellationPolicy;var I=h.uniqueRateId;var n=h.bUseExtRoomIds;var g=d.generalInfo.view_fee;var k=null;var F=null;var x=null;if(typeof(d.searchQueryObj.extraParams)!="undefined"){if(typeof(d.searchQueryObj.extraParams.ref)!="undefined"){k=d.searchQueryObj.extraParams.ref}if(typeof(d.searchQueryObj.extraParams.ta_op)!="undefined"){F=d.searchQueryObj.extraParams.ta_op}if(typeof(d.searchQueryObj.extraParams.cc_op)!="undefined"){x=d.searchQueryObj.extraParams.cc_op}}var v;if(h.isDispIb==1){v="disp_ib"}else{v="disp"}f.push('<form id="'+HotelConstants.bookFormIDPrefix+l+'" name="form_'+l+'" action="'+d.info.httpsServer+'/cgi/reservation/index.php" method="POST" >');f.push('<input type="hidden" name="booking_action"      value="step_1" />');f.push('<input type="hidden" name="booking_step"        value="1" />');f.push('<input type="hidden" name="save_booking_mode"   value="'+v+'" />');f.push('<input type="hidden" name="lg"                  value="'+d.generalInfo.lg+'" />');f.push('<input type="hidden" name="ref"                 value="'+(k?k:0)+'" />');f.push('<input type="hidden" name="ta_op"               value="'+(F?F:0)+'" />');f.push('<input type="hidden" name="cc_op"               value="'+(x?x:0)+'" />');var H=readCookie("cc_id");f.push('<input type="hidden" name="cc_id"               value="'+(H?H:0)+'" />');f.push('<input type="hidden" name="order"               value="" />');f.push('<input type="hidden" name="sort"                value="" />');f.push('<input type="hidden" name="type"                value="" />');f.push('<input type="hidden" name="hotel_id"            value="'+d.property.id+'" />');f.push('<input type="hidden" name="geo_id"              value="'+d.property.hotelGeoId+'" />');f.push('<input type="hidden" name="pval"                value="'+d.searchQueryObj.availParams.pval+'" />');f.push('<input type="hidden" name="rval"                value="'+d.searchQueryObj.availParams.rval+'" />');f.push('<input type="hidden" name="check_in"            value="'+d.info.checkin.reservationDate+'" />');f.push('<input type="hidden" name="check_out"           value="'+d.info.checkout.reservationDate+'" />');f.push('<input type="hidden" name="nights"              value="'+d.property.nights+'" />');f.push('<input type="hidden" name="r_ids"               value="'+c+'" />');f.push('<input type="hidden" name="r_disp"              value="'+o+'" />');f.push('<input type="hidden" name="r_prices"            value="'+e+'" />');f.push('<input type="hidden" name="r_fee_amounts"       value="'+G+'" />');f.push('<input type="hidden" name="total_fee_amount"    value="'+j+'" />');f.push('<input type="hidden" name="view_fee"            value="'+(g==true?"1":"0")+'" />');if(d.property.externalSystem){f.push('<input type="hidden" name="total_tax_amount" value="'+t+'" />');f.push('<input type="hidden" name="r_tax_amounts"    value="'+u+'" />');f.push('<input type="hidden" name="is_tax_excluded"  value="'+a+'" />');f.push('<input type="hidden" name="room_rate_promo_list"  value="'+q+'" />')}f.push('<input type="hidden" name="timestamp"           value="'+(Math.round((new Date().getTime())/1000))+'" />');f.push('<input type="hidden" name="currency_code"       value="'+d.property.currency+'" />');f.push('<input type="hidden" name="display_currency_code" value="'+d.displayCurrencyCode+'" />');f.push((d.info.demoreservation?'<input type="hidden" name="demoreservation" value="1" />':""));f.push((d.property.discount.id?'<input type="hidden" name="discount_id" value="'+d.property.discount.id+'" />':""));f.push('<input type="hidden" name="r_charges"           value="'+(A?A:"")+'" />');f.push('<input type="hidden" name="tot_charges"         value="'+(z?z:"")+'" />');f.push('<input type="hidden" name="charge_type"         value="'+(E?E:"")+'" />');f.push('<input type="hidden" name="rooms_payment_type"  value="'+(b?b:"")+'" />');f.push('<input type="hidden" name="cancellation_policy" value="'+(D?D:"")+'" />');f.push('<input type="hidden" name="unique_rate_id"      value="'+(I?I:"")+'" />');f.push('<input type="hidden" name="use_ext_room_ids"      value="'+(n==true?"1":"0")+'" />');f.push('<input type="hidden" name="r_names"      value="'+s.join(",")+'" />');f.push('<input type="hidden" name="r_rates_code"      value="'+m+'" />');f.push('<input type="hidden" name="r_occupancies"      value="'+C.join(",")+'" />');f.push('<input type="hidden" name="rooms_scarcity" value="'+h.getScarcityData()+'" />');f.push('<input type="hidden" name="check_in_instruction"  value="'+(w?w:"")+'" />');f.push('<input type="hidden" name="accepted_credit_cards" value="'+(y?y:"")+'" />');f.push('<input type="hidden" name="user_country_code" value="'+(d.generalInfo.user_country_code?d.generalInfo.user_country_code:"")+'" />');f.push('<input type="submit" class="strip_book_btn" value="'+B.book_btn+'" />');f.push("</form>");return f},renderAvailabilityRoomCombinationDetails:function(h,d){var b=new Array();var g="";var j="";var a=true;if(h.combinationRate.amenitiesDesc){j=h.combinationRate.amenitiesDesc[h.rIdsExtended];a=false}var c=this.getAvailabilityAmenitiesHTML(h);for(var e in d.getRoomDetails(h.rIds)){g=d.getRoomDetail(h.rIds,e);if("room_description"==e){if(j){g=j}if(g){b.push(this.getRoomDetailHTML(e,g))}}else{if("room_amenities"==e){g=c;if(g){b.push(this.getRoomDetailHTML(e,g))}}else{if(g){var f=true;if("check_in_instructions"==e){g="<h2>"+d.mlg.checkin_instructions_title+"</h2>"+g}else{if("cancellation_policy"==e){g="<h2>"+d.mlg.room_details_canc_policy+"</h2>"+g}else{if("on_request_disclaimer"==e){g='<h2 class="or_title">'+d.mlg.or_title+"</h2>"+d.mlg.or_content}else{if("room_facilities"==e&&!a){f=false}}}}if(f){b.push(this.getRoomDetailHTML(e,g))}}}}}return b.join("")},renderAvailabilityRoomCombinationSummary:function(k,f,j){var q=f.property;var s=q.rooms;var h=f.mlg;var a=f.parsedMlg;var d=new Array();var o="";var l="";var c="";if(q.currencySymbol!=""){l=q.currencySymbol}else{l=q.currency}var n=l;var m=new Array();m.totalPrice=k.combinationRate.totalPrice;if(f.displayCurrencyCode!=q.currency){n=f.displayCurrencyCode;if((typeof(f.conversionTable[f.displayCurrencyCode])!="undefined")&&typeof(f.conversionTable[f.displayCurrencyCode]["symbol"]!="undefined")){n=f.conversionTable[f.displayCurrencyCode]["symbol"]}for(var e in m){var g=new Rate(m[e],q.currency,q.currencySymbol);var b=f.getCurrencyConversion(g,f.displayCurrencyCode);m[e]=b.price}}o=a.guestsLabel+" "+a.roomsLabel;c=a.checkinCheckoutLabel;d.push('<table class="stripdetail_summary">');d.push("<tr>");d.push('<td class="stripdetailsummary_info">');d.push("<p>"+c+"</p>");d.push("<p>"+o+"</p>");d.push("</td>");d.push('<td class="stripdetailsummary_totprice">');d.push("<p>"+h.total_price+"<strong>"+n+" "+Math.ceil(m.totalPrice)+"</strong></p>");d.push("</td>");d.push('<td class="stripdetailsummary_button">');d.push('<input name="proceed_book_btn_'+j+'" id="'+j+'" type="button" value="'+h.proceed_booking_btn+'" />');d.push("</td>");d.push("</tr>");d.push("</table>");return d.join("")},renderHtmlCurrenciesSelection:function(k,j){var d=[];var h=0;$(".CurrMenu >li>span>strong").html(j);d[h++]='<ul class="CurrMenum">';var f="";var a="";for(var g in k){f="";var b=k[g].name;var c=k[g].code;var e=k[g].symbol;a="<small> "+c+" </small><p>"+b+" ";if(j==c){f="CurrMenuSel"}if(k[g].group_display==1){a=a+"("+e+")";f=f+" CurrMenuEvid"}a=a+"</p>";d[h++]='<li id="'+c+'"class="'+f+'" > '+a+" </li>"}d[h++]="</ul>";$(".CurrMenu>li").append((d.join("")))},showAvailLoadingDiv:function(a,b){if(b){this.renderOnLoadAvailLoadingDiv(a)}else{if($("#"+HotelConstants.availLoadiadingDivId).length==0){this.renderAvailLoadingDiv(a)}$("#"+HotelConstants.availLoadiadingDivId).css("display","block");this.scrollToAvailLoadingDiv(false)}},scrollToAvailLoadingDiv:function(b){var a=$(window).height()/2;var d=a/2;var c=$("#"+HotelConstants.availLoadingDivContainerID);var e=c.offset().top;var g=this.findPosRelativeToViewport(c).top;var f=e-d;if(b||g>a){$("html, body").animate({scrollTop:f},1000)}},renderAvailLoadingDiv:function(a){if($("#"+HotelConstants.availLoadingDivContainerID).length){var b='<div id="'+HotelConstants.availLoadiadingDivId+'" class="'+HotelConstants.noRoomsInfoClassName+'">';b+="<div><ul>";b+='<li><img alt="" src="/img/icone/srp_loader.gif"></li>';if(a.mlg!=null){b+="<li>"+a.mlg.loading+"</li>"}else{b+="<li>"+a.generalInfo.avail_loading_mlg.checking_availability+"</li>"}b+="</ul>";b+="</div>";b+="<span></span>";b+="</div>";$("#"+HotelConstants.availLoadingDivContainerID).prepend(b)}},renderOnLoadAvailLoadingDiv:function(c){var g=c.generalInfo.avail_loading_mlg;var f=c.getDateObjectFromAvail(HotelConstants.availDateTypeFrom);var e=c.getDateObjectFromAvail(HotelConstants.availDateTypeTo);var b=g.from_to;b=b.replace("%from_month%",f.monthName);b=b.replace("%from_day%",f.day);b=b.replace("%from_year%",f.year);b=b.replace("%to_month%",e.monthName);b=b.replace("%to_day%",e.day);b=b.replace("%to_year%",e.year);var d='<div id="'+HotelConstants.onLoadAvailLoadingDivContainerID+'">';d+='<div id="CheckAvailabilityFeedback">';d+='<div id="CheckingAvailability">';d+='<img alt="" src="/img/icone/srp_loader.gif">'+g.checking_availability;d+="</div>";d+='<div id="CheckingDates">';d+=b;d+="</div>";d+="</div>";d+="<span></span>";d+="</div>";var a=$("body");a.append(d);a.addClass("NoScroll")},renderAvailabilitySearchSummaryDiv:function(a){var c=a.parsedMlg;if($("#"+HotelConstants.roomAvailabilityFormDivID).length){var b='<div id="'+HotelConstants.availabilitySearchSummaryDivID+'">';b+="<p><span>"+c.checkinCheckoutLabel+"</span>";b+=" ";b+="<span>"+c.guestsLabel+" "+c.roomsLabel+"</span>";b+=" ";b+='<a id="modify_button" href="#">'+a.mlg.change_dates+"</a></p>";b+="</div>";$("#"+HotelConstants.roomAvailabilityFormDivID).after(b);$("#"+HotelConstants.availabilitySearchSummaryDivID+" p").click(function(d){d.preventDefault();ctrl.enableRoomSearchForm()})}},removeAvailabilitySearchSummaryDiv:function(){$("#"+HotelConstants.availabilitySearchSummaryDivID).remove()},hideRoomSearchForm:function(){if($("#"+HotelConstants.roomAvailabilityFormDivID).length){$("#"+HotelConstants.roomAvailabilityFormDivID).hide()}},showRoomSearchForm:function(a){if($("#"+HotelConstants.roomAvailabilityFormDivID).length){$("#"+HotelConstants.roomAvailabilityFormDivID).show();if(a.isIE7){$(a.RoomSearchFormConfig.formDao.getPersonsCtrl()).css("display","block");$(a.RoomSearchFormConfig.formDao.getPersonsCtrl()).css("display","");$(a.RoomSearchFormConfig.formDao.getRoomsCtrl()).css("display","block");$(a.RoomSearchFormConfig.formDao.getRoomsCtrl()).css("display","")}}},hideAvailLoadingDiv:function(a){var b=$("#"+HotelConstants.availLoadiadingDivId);if(b.length){b.css("display","none");if(a){b.removeClass(HotelConstants.noRoomsInfoClassName)}}else{$("#"+HotelConstants.onLoadAvailLoadingDivContainerID).remove();$("body").removeClass("NoScroll")}},renderTabSelection:function(a){$("#"+HotelConstants.tabsBarId+" li a").each(function(){var b=$(this).attr("href").replace(/#/g,"");if(b==a){$(this).addClass("selected")}else{$(this).removeClass("selected")}})},renderSelectedSection:function(a){$("#"+a.getSelectedSection()).show()},turnSection:function(h,s,g,l){if("off"==h){$("#"+s).hide()}else{var b=g.getBlocksToChange(s,"movable");for(var f in b){var c=b[f];var q=g.getBlockInfo(c,s);if(q.position==1){try{$("#"+c).prependTo("#"+q.containerId);g.addMovedBlocks(c)}catch(k){}}else{try{var m=$("#"+q.previousBrother);if(m.length){$("#"+c).insertAfter(m)}else{var n=this.selectPreviousBrother(g,s,c);if(n==null){$("#"+c).prependTo("#"+q.containerId)}else{$("#"+c).insertAfter("#"+n)}}g.addMovedBlocks(c)}catch(k){}}if("fixed"==q.behaviour){$("#"+c).show()}}var j=g.getBlocksToChange(s,"fixed");var a=g.getBlockGroupBySection()["fixed-elements"];for(var d in a){var o=a[d];if($.inArray(o,j)<0){$("#"+o).hide()}}$("#"+s).trigger("sectionSelected").fadeIn(HotelConstants.effectVelocity,function(){if(l==null||l.source!="tab"){$("html, body").animate({scrollTop:0},HotelConstants.scrollVelocity)}});for(d in j){$("#"+j[d]).fadeIn(HotelConstants.effectVelocity)}}return false},selectPreviousBrother:function(d,e,b){var a=null;var g=(d.getBlockGroupBySection().sections)[e];for(var c in g){var f=g[c];if(f.blockId==b){break}if($("#"+f.blockId).length){a=f.blockId}}return a},composePageLayout:function(b){this.hideRoomGenericDetails();var c=b.getSelectedSection();var d=(b.getBlockGroupBySection().sections)[c];for(var a in d){var e=d[a];$("#"+e.blockId).show()}},hideRoomGenericDetails:function(){$("#room_details").hide()},getRoomDetailHTML:function(a,b){return"<div class='"+a+"'>"+b+"</div>"},getDetailHTML:function(b,a){return"<h2>"+b+"</h2>"+a},hideMap:function(){$("#"+HotelConstants.propertyMapDivId).hide()},getPageScroll:function(){var b,a;if(self.pageYOffset){a=self.pageYOffset;b=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop;b=document.documentElement.scrollLeft}else{if(document.body){a=document.body.scrollTop;b=document.body.scrollLeft}}}return{xScroll:b,yScroll:a}},findPosRelativeToViewport:function(c){var b=$(c).offset();var a=this.getPageScroll();return{top:b.top-a.yScroll,left:b.left-a.xScroll}},initHotelDescription:function(a){var b=$("#"+HotelConstants.hotelDescriptionBodyDivId);if(b.length>0&&a.mlg!=null){var d=a.hotelDescriptionHeights;if(d&&d.fullHeight>d.displayHeight){var c=$('<div id="'+HotelConstants.readFullDescriptionDivId+'"><p>'+a.mlg.read_more+"</p></div>");b.after(c);c.find("p").click(function(g){var f=jQuery.getContext();f.toggleHotelDescription()})}}},initLocation:function(){$("#skip_to_directions a").click(function(){$("html, body").animate({scrollTop:$($(this).attr("href")).offset().top},HotelConstants.scrollVelocity);return false});var a=$("#"+HotelConstants.sectionsIDs.location+" #main_location .skip-to-availability");if(a.length>0){a.find("a").click(function(b){jQuery.getContext().view.scrollToAvailLoadingDiv(false);return false});a.insertAfter("#"+HotelConstants.sectionsIDs.location+" #main_location h2")}},initReviews:function(c){$("#how-we-collect-link a").hover(function(){$("#how-we-collect-abstract").css({display:"block"})},function(){$("#how-we-collect-abstract").css({display:"none"})});var b=$("#"+HotelConstants.sectionsIDs.reviews+" .skip-to-availability");b.find("a").click(function(f){jQuery.getContext().view.scrollToAvailLoadingDiv(false);return false});var e=$("#skip-to-availability-summary");e.click(function(f){jQuery.getContext().view.scrollToAvailLoadingDiv(false);return false});var d=$('<div class="skip-to-availability-container"></div>');b.clone(true).appendTo(d);d.clone(true).appendTo(".reviews-list-strip");var a=$(".review-lang-box select");if(a.length>0){a.change(function(g){if(g.target.value!=""){var f=$("#lbli-"+g.target.value+" a");if(f.length>0){f.click()}}})}},renderTripAdvReviews:function(a){var c=$("#"+HotelConstants.reviewListDivId);if(c.length>0){var b='<iframe name="tripAdvRev" frameborder="0" marginheight="0" marginwidth="0"';if(a.noTripAdvReviews){b+=' style="height:100px;"'}b+=' src="'+a.getTripAdvSrc(HotelConstants.tripAdvUrlReviewListScope)+'">';b+="</iframe>";c.html(b)}},updateAvgPrice:function(a){$("#currency-symbol").html(a.currencySymbol);$("#avgPriceEl0").html(Math.ceil(a.price))},updateOtherHotelPrice:function(b,c){var a=$("#"+HotelConstants.otherHotelDivIDPrefix+b);if(a.length>0){a.find(HotelConstants.otherHotelCurrencySelector).html(c.currencySymbol);a.find(HotelConstants.otherHotelPriceSelector).html(Math.ceil(c.price))}},updatePriceElement:function(e,b,d,a,c){$(e).each(function(){var h=null;switch(d){case"combinationRate":var g=$(this).parents("."+HotelConstants.availroomlist_strip_class).attr("id").match(/[0-9]+/);h=b.property.combinations[g][d];break;default:h=null;break}if(h!=null){var f=b.getNewRate(h,a,c);if(f!=null){$(this).html(f.currencySymbol+" "+Math.ceil(f.price))}}})},updateHiddenFieldOnChangeCurrency:function(a){$("input[name='display_currency_code']").attr("value",a)},toggleHotelDescription:function(a){var b=$("#"+HotelConstants.readFullDescriptionDivId+" p");var e=$("#"+HotelConstants.hotelDescriptionDivId);if(b.length>0&&e.length>0){if(e.hasClass(HotelConstants.hotelFullDescrClass)){var d=$("#"+HotelConstants.stripBookNowDivId);if(d.length>0&&d.offset().top<$(window).scrollTop()){var c=d.offset().top-10;$(window).scrollTop(c)}b.html(a.mlg.read_more);e.removeClass(HotelConstants.hotelFullDescrClass)}else{e.addClass(HotelConstants.hotelFullDescrClass);b.html(a.mlg.close)}}},getHotelDescriptionHeights:function(){var a=$("#"+HotelConstants.hotelDescriptionBodyDivId);var b=null;b=new Object();if(a.length>0){b.displayHeight=a.height();b.fullHeight=a.get(0).scrollHeight}else{b.displayHeight=0;b.fullHeight=0}return b},renderHowToBookSection:function(c){var d="";if(c.propertyDetails.acceptedCreditCards.length){var f=c.propertyDetails.acceptedCreditCards.split(",");for(var e in f){d+='<span id="circuit-'+f[e].toLowerCase()+'">'+f[e]+"</span>"}var b=" "+c.ESRBillingCurrencyLabel;if($("#billing-currency").length){$("#billing-currency").html(b);$("#credit-card-list").html(c.mlg.accepted_cards+" "+c.propertyDetails.acceptedCreditCards);$("#credit-card-circuits").html(d)}else{$('<span id="billing-currency">'+b+"</span>").appendTo("#pay-by-credit-card");var a='<p id="credit-card-list">'+c.mlg.accepted_cards+" "+c.propertyDetails.acceptedCreditCards+'</p><div id="credit-card-circuits">'+d+"</div>";$(a).appendTo("#payment_method")}}}};function CookieManager(){}CookieManager.prototype={getCookieValue:function(b,e,c){var d="";if(b.length>0){var a=this.getCookieArrayByString(b,c);if(typeof(a[e])!="undefined"){d=a[e]}}return d},getTrimValue:function(a){return(a.replace(/^[ ]+/,"").replace(/[ ]+$/,""))},getCookieArrayByString:function(d,f){var c=d.split(f);var a=new Array();for(var b in c){var e=c[b].split("=");a[this.getTrimValue(e[0])]=e[1]}return a},getCookieStringByArray:function(a,d){var c="";for(var b in a){if(c==""){c+=b+"="+a[b]}else{c+=d+b+"="+a[b]}}return c},updateCookie:function(h,g,d,f){if(g!=""){var b="";this.deleteCookie(h);var a=this.getCookieArrayByString(g,f);for(var e in d){a[e]=d[e]}var c=this.getCookieStringByArray(a,f);if(c.length==0){b=";expires=Thu, 01-Jan-70 00:00:01 GMT"}document.cookie=h+"="+encodeURIComponent(c)+";path=/;domain=.venere.com"+b}else{this.createCookie(h,d,f)}},createCookie:function(d,a,c){var b=this.getCookieStringByArray(a,c);if(b.length==0){return}document.cookie=d+"="+encodeURIComponent(b)+";path=/;domain=.venere.com"},deleteCookie:function(a){document.cookie=a+"=;path=/;domain=.venere.com;expires=Thu, 01-Jan-70 00:00:01 GMT"},unsetCookieValue:function(g,d,e){var f=this.getCookieValue(document.cookie,g,";");if(f!=""){var b="";this.deleteCookie(g);var a=this.getCookieArrayByString(decodeURIComponent(f),e);delete a[d];var c=this.getCookieStringByArray(a,e);if(c.length==0){b=";expires=Thu, 01-Jan-70 00:00:01 GMT"}document.cookie=g+"="+encodeURIComponent(c)+";path=/;domain=.venere.com"+b}}};function SiteMVTManager(a){if(typeof a=="function"){this.getRef=a}else{this.getRef=function(){return{ref:null,ref_type:null}}}this.initialize_mvt()}SiteMVTManager.prototype={initialize_mvt:function(){this.excluded_ref_types=[1,4,8];this.TEST_SRP_PROXIMITY_ID="13";this.TEST_HDP_MHCC="14";this.TEST_FORCE_DATES_ID="15";this.TEST_IDS=[this.TEST_SRP_PROXIMITY_ID,this.TEST_HDP_MHCC,this.TEST_FORCE_DATES_ID];this.slot_by_mvt_id_mapping=new Array();this.slot_by_mvt_id_mapping[this.TEST_SRP_PROXIMITY_ID]=2;this.slot_by_mvt_id_mapping[this.TEST_HDP_MHCC]=3;this.slot_by_mvt_id_mapping[this.TEST_FORCE_DATES_ID]=4;this.mvt_values=null;this.proximity_on_srp=false;this.use_McLeod=false;this.hdp_mhcc=false;this.force_dates=false;this.mvt_values=new Array();for(var b in this.TEST_IDS){var a=this.TEST_IDS[b];var c=this.get_slot_by_mvt_id(parseInt(a,10));if(c>0&&v_abs.length>c){this.mvt_values[a]=v_abs.charAt(c)}}switch(this.mvt_values[this.TEST_SRP_PROXIMITY_ID]){case"C":this.use_McLeod=true;break;case"B":this.use_McLeod=true;this.proximity_on_srp=true;break}switch(this.mvt_values[this.TEST_HDP_MHCC]){case"B":this.hdp_mhcc=true;break}switch(this.mvt_values[this.TEST_FORCE_DATES_ID]){case"B":this.force_dates=true;break}},get_slot_by_mvt_id:function(a){return this.slot_by_mvt_id_mapping[a]},is_under_test:function(a){return((typeof this.mvt_values[a]!="undefined")&&this.mvt_values[a]!=""&&this.mvt_values[a]!="O"&&this.mvt_values[a]!="Q")},is_proximity_on_srp:function(){return this.proximity_on_srp},is_use_mc_leod:function(){return this.use_McLeod},is_hdp_mhcc:function(){return this.hdp_mhcc},is_force_dates:function(){return this.force_dates}};function Controller(){var refCallback=function(){return{ref:eval("generalInfo.ref"),ref_type:eval("generalInfo.ref_type")}};hdpMVTManager=new SiteMVTManager(refCallback);this.model=new Model();this.view=new View();this.cookieManager=new CookieManager();this.service_manager=new ServiceManager();this.mlgCalls=0;this.maxMlgCalls=2;this.availCalls=0;this.maxAvailCalls=1;this.tripAdvSumCheck=0;this.maxTripAdvSumCheck=2;this.acceptAvailabilityEvents=true;this.performAvalabilitySearchOnLoad=false;this.pendingAvailabilityResult=false;this.loadManager=null;this.googleMap=null;this.googleMapOptions=null;this.firstLoading=false;this.trackTabChanges=false;this.trackFirstTabChange=true;this.tracker=null}Controller.prototype={init:function(){var b=this;$.extend({getContext:function(){return b}});this.setRoomDetails();InitSWConfig();InitHSWConfig();if(typeof(SWConfig)!="undefined"){SWConfig.tracking_fun=this.trackSiteSearch;this.model.SiteSearchFormConfig=SWConfig}if(typeof(HSWConfig)!="undefined"){this.model.RoomSearchFormConfig=HSWConfig;if(HSWConfig.formDao.getCheckIn() instanceof Date){this.performAvalabilitySearchOnLoad=true}}var a=this.setLandingSection();this.initGeneralInfo(generalInfo);this.initServicesVersion(servicesVersion);this.model.initPageStatus(generalInfo.currency_code,a);this.initHotelDescriptionHeights();this.initMlg();this.model.initCurrencyDisplayList(currencyDisplayList);this.model.displayCurrencyCode=this.model.generalInfo.currency_code;this.model.oldDisplayCurrencyCode=this.model.displayCurrencyCode;this.model.lowestPriceWoAvail=generalInfo.lowest_price;this.getCurrencyDisplay();this.loadManager=new LoadManager();this.loadManager.loadWidget(HotelConstants.widgets.photogallery);this.loadManager.loadWidget(HotelConstants.widgets.gmap);this.loadManager.loadWidget(HotelConstants.widgets.reviews);this.firstLoading=true;if(this.performAvalabilitySearchOnLoad){window.disableInternalRequestTracking=true;if(!this.model.RoomSearchFormConfig.submitController.doSubmitSW()){this.performAvalabilitySearchOnLoad=false}window.disableInternalRequestTracking=false}this.view.initEffects();this.initTabs();this.switchToSection(this.model.pageStatus.selectedSectionId);this.initMapCallout();this.initPropertyHeader();this.initLocation();$("body").bind("click",function(c){b.clickEvents(c)});this.initLanguageBar()},pageInitialized:function(){this.trackTabChanges=true;if(this.trackFirstTabChange){this.pushTabChangeTrack(this.model.pageStatus.selectedSectionId)}},initLanguageBar:function(){$(".LangMenu1").click(function(b){var a=$(b.target).closest("a");if(a.is(".LangMenu1")){b.preventDefault()}});$(".LangMenum ul li a").click(function(a){return jQuery.getContext().changeLanguage(a)})},initGoogleMap:function(){if(typeof(google)=="undefined"||google==null||typeof(window.hlat)=="undefined"||typeof(window.hlon)=="undefined"){this.view.hideMap();return false}if(!this.model.widgets.isLoadedGmap){var e=new google.maps.LatLng(window.hlat.replace(",","."),window.hlon.replace(",","."));var c={zoom:14,center:e,scrollwheel:false,mapTypeId:google.maps.MapTypeId.ROADMAP};var d=new google.maps.Map(document.getElementById(HotelConstants.propertyMapDivId),c);var b={map:d,position:e,icon:HotelConstants.propertyMapIcon};var a=new google.maps.Marker(b);this.googleMap=d;this.googleMapOptions=c;this.googleMapInitialized=true;this.model.widgets.isLoadedGmap=true}},initTripAdvReviews:function(){if(this.model.generalInfo.add_tripadvisor_reviews&&!this.model.widgets.isLoadedReviews){this.model.widgets.isLoadedReviews=true;this.view.renderTripAdvReviews(this.model)}},setTripAdvSumReadyFun:function(){if(typeof(frames[HotelConstants.tripAdvSumIFrameName])!="undefined"&&frames[HotelConstants.tripAdvSumIFrameName].document){$(frames[HotelConstants.tripAdvSumIFrameName].document).ready(function(a){ctrl.callbackTripAdvSumReady(a)})}},callbackTripAdvSumReady:function(c){var b=jQuery.getContext();var a=false;b.tripAdvSumCheck++;if(typeof(frames[HotelConstants.tripAdvSumIFrameName])!="undefined"){var d=$(frames[HotelConstants.tripAdvSumIFrameName].document.body);if(d.length){try{var g=d.find("#CDSSKY");if(g.length==0){g=d.find("#CDSWIDERR");if(g.length==0){g=d.find("#no-review")}if(g.length>0){b.setTripAdvNoReviews()}else{a=true}}}catch(f){}}else{a=true}}else{a=true}if(a&&b.tripAdvSumCheck<b.maxTripAdvSumCheck){setTimeout(b.callbackTripAdvSumReady,1000)}},setTripAdvNoReviews:function(){this.model.noTripAdvReviews=true;var a=$("#"+HotelConstants.reviewSummaryDivId);a.find("a").remove();if(this.model.widgets.isLoadedReviews){this.view.renderTripAdvReviews(this.model)}},clickEvents:function(b){var a=jQuery.getContext();if($(b.target).closest("#currency > li > ul").length!=0){if($(b.target).is("small")||$(b.target).is("p")){a.changeCurrencyOnClick($(b.target).parent())}else{a.changeCurrencyOnClick($(b.target))}$(b.target).closest("ul").css("visibility","hidden")}},initPropertyHeader:function(){var a=jQuery.getContext();$("#h1_info #property-address").click(function(b){$("#"+HotelConstants.tabIDs.locationTab).click()});$("span.self-class-tip").css({display:"none"}).appendTo("#self-class");$("#self-class").hover(function(){$("span.self-class-tip").css({display:"block"})},function(){$("span.self-class-tip").css({display:"none"})});$("#"+HotelConstants.stripBookNowDivId).click(function(b){a.trackStripBookNow();a.view.scrollToAvailLoadingDiv(true)})},initHotelDescriptionHeights:function(){var a=this.view.getHotelDescriptionHeights();this.model.initHotelDescriptionHeights(a.displayHeight,a.fullHeight)},initHotelDescription:function(){this.view.initHotelDescription(this.model)},initLocation:function(){return this.view.initLocation()},initReviews:function(){this.view.initReviews(this.model)},toggleHotelDescription:function(){this.view.toggleHotelDescription(this.model)},getCurrencyDisplay:function(){var b="lg="+this.model.generalInfo.lg,a=[];if(this.model.generalInfo.currency_code&&(!this.model.currencyDisplayList||!this.model.currencyDisplayList[this.model.generalInfo.currency_code])){a.push(this.model.generalInfo.currency_code)}if(this.model.generalInfo.country_cur&&(!this.model.currencyDisplayList||!this.model.currencyDisplayList[this.model.generalInfo.country_cur])&&(!this.model.generalInfo.currency_code||this.model.generalInfo.currency_code!=this.model.generalInfo.country_cur)){a.push(this.model.generalInfo.country_cur)}var e=this.cookieManager.getCookieValue(document.cookie,HotelConstants.cookieUserPrefName,";");var d=this.cookieManager.getCookieValue(decodeURIComponent(e),"cur",HotelConstants.cookieUserPrefSeparator);var c="";if(d!=""){c=d}else{if(this.model.generalInfo.preset_currency_code!=""){c=this.model.generalInfo.preset_currency_code}}if(c!=""){if(!this.model.generalInfo.currency_code||this.model.generalInfo.currency_code!=c){this.model.oldDisplayCurrencyCode=this.model.displayCurrencyCode;this.model.displayCurrencyCode=c;if((!this.model.generalInfo.country_cur||this.model.generalInfo.country_cur!=c)&&(!this.model.currencyDisplayList||!this.model.currencyDisplayList[c])){a.push(c)}}}if(a.length>0){b+="&extra_cur="+a.join(",")}$.ajax({type:"GET",url:HotelConstants.currenciesService,data:b,dataType:"json",success:this.callbackCurrenciesInfo,timeout:HotelConstants.ajaxCallDefaultTimeout,error:this.callBackAbortError})},changeCurrencyOnClick:function(d){var b=jQuery.getContext();var a=$(d).attr("id");var g=b.model.displayCurrencyCode;if(g!=a){if((b.model.conversionTable[a]==null||typeof(b.model.conversionTable[a])=="undefined")||(b.model.conversionTable[g]==null||typeof(b.model.conversionTable[g])=="undefined")){return}b.model.oldDisplayCurrencyCode=b.model.displayCurrencyCode;b.model.displayCurrencyCode=b.model.conversionTable[a].code;b.view.changeSelectedCurrency(a,g);var f=decodeURIComponent(b.cookieManager.getCookieValue(document.cookie,HotelConstants.cookieUserPrefName,";"));var c=new Object();c.cur=b.model.displayCurrencyCode;b.cookieManager.updateCookie(HotelConstants.cookieUserPrefName,f,c,"|");if(b.model.isExtendedDataRequired()&&b.model.searchQueryObj!=null){b.model.isChangedCurrency=true;b.getSearchAvailabilities(b.model.searchQueryObj)}else{if(b.model.searchQueryObj==null){if(b.model.lowestPriceWoAvail){b.updateAvgPriceOnChangeCurrency(b.model.lowestPriceWoAvail,b.model.displayCurrencyCode)}}else{b.updateAvgPriceOnChangeCurrency(b.model.lowest_price_4_room_4_night,b.model.displayCurrencyCode);b.updatePricesOnChangeCurrency(b.model.displayCurrencyCode);b.view.updateHiddenFieldOnChangeCurrency(b.model.displayCurrencyCode)}}b.updateOtherHotelPricesOnChangeCurrency(b.model.displayCurrencyCode)}},callbackCurrenciesInfo:function(b){var a=jQuery.getContext();a.model.initConversionTable(b);a.view.renderHtmlCurrenciesSelection(a.model.conversionTable,a.model.displayCurrencyCode);$("#currency").mouseover(function(){$(this).find("ul").css("visibility","visible")});$("#currency").mouseout(function(){$(this).find("ul").css("visibility","hidden")});if(a.model.displayCurrencyCode!=a.model.oldDisplayCurrencyCode){if(a.model.lowestPriceWoAvail){a.updateAvgPriceOnChangeCurrency(a.model.lowestPriceWoAvail,a.model.displayCurrencyCode)}a.updateOtherHotelPricesOnChangeCurrency(a.model.displayCurrencyCode)}},callBackAbortError:function(a,c,b){a.abort()},handleImgError:function(a){if(typeof(a)!="undefined"&&a){currentSrc=$(a).attr("src");if(currentSrc!=HotelConstants.brokenThumbURL){$(a).attr("src",HotelConstants.brokenThumbURL)}}},setRoomDetails:function(){var a=new Object();for(var c in blockGroupBySection.room_details){var b=blockGroupBySection.room_details[c];if($("#"+b).length){var d=$("#"+b).clone();if(b==HotelConstants.roomDetailsCancPolicyDivId||b==HotelConstants.roomDescriptionDivClass){d.contents().filter("h2").remove()}try{a[b]=d.html()}catch(f){a[b]=""}}else{a[b]=""}}this.model.setBlockGroupBySection(blockGroupBySection);this.model.initRoomGenericDetails(a)},initPhotoGallery:function(){var b=$("#thumbs ul.thumbs").find("li");if(!b||!b.length){return}if(this.model.imageGalleryUtil.init_photo_gallery){var c="<small>&#9668;</small><span>"+this.model.imageGalleryUtil.prev_label+"</span>";var a="<span>"+this.model.imageGalleryUtil.next_label+"</span><small>&#9658;</small>";this.gallery=$("#thumbs").galleriffic({delay:7000,numThumbs:15,preloadAhead:15,imageViewerDelay:200,enableTopPager:false,enableBottomPager:true,maxPagesToShow:7,imageContainerSel:"#slideshow",controlsContainerSel:"",captionContainerSel:"",loadingContainerSel:"#loading",renderSSControls:false,renderNavControls:false,playLinkText:"Play",pauseLinkText:"Pause",prevLinkText:"Previous",nextLinkText:"Next",nextPageLinkText:a,prevPageLinkText:c,enableHistory:false,enableKeyboardNavigation:false,autoStart:true,syncTransitions:true,defaultTransitionDuration:1000,onSlideChange:undefined,onTransitionOut:undefined,onTransitionIn:undefined,onPageTransitionOut:undefined,onPageTransitionIn:undefined,onImageAdded:undefined,onImageRemoved:undefined,maxImageWidth:350,maxImageHeight:500,imageViewerHMargin:4,brokenThumbURL:HotelConstants.brokenImageURL,brokenImageURL:HotelConstants.brokenImageURL,imageViewerNoImageWidth:HotelConstants.imageViewerNoImageWidth})}ctrl.model.widgets.isLoadedPhotogallery=true},initMlg:function(){this.mlgCalls++;var a=new Object();a.lg=this.model.generalInfo.lg;this.service_manager.callService(HotelConstants.mlg,a,this.mlgHandler)},initGeneralInfo:function(a){this.model.initGeneralInfo(a)},initServicesVersion:function(a){this.model.initServicesVersion(a)},getFeedbacks:function(){var a=new Object();a.htid=this.model.generalInfo.hotel_id;a.lg=this.model.generalInfo.lg;this.service_manager.callService(HotelConstants.feedbackService,a,null)},getPing:function(){var a=new Object();a.htid=this.model.generalInfo.hotel_id;a.lg=this.model.generalInfo.lg;this.service_manager.callService(HotelConstants.ping,a,null)},mlgHandler:function(c,a){var b=jQuery.getContext();if(a!=null){if(b.mlgCalls<b.maxMlgCalls){b.initMlg()}else{b.handleNoAvailability();return}}else{b.model.initMlg(c);if(b.pendingAvailabilityResult){b.renderAvailabilityResult()}b.initHotelDescription()}},availabilityHandler:function(f,c){var e=jQuery.getContext();var b=false;if(c!=null){var d=c[0];if(c.length==1){if(d.code==HotelConstants.noAvailabilityDiagnosticCode){e.handleNoAvailability();return}else{if(d.code==HotelConstants.invalidParametersDiagnosticCode||d.code==HotelConstants.propertyNotActiveDiagnosticCode){}else{if(e.availCalls<e.maxAvailCalls){b=true}}}}else{if(e.availCalls<e.maxAvailCalls){b=true}}e.acceptAvailabilityEvents=true}else{e.model.setRoomDynamicDetails(f);var h=f.property;if(!e.model.isExtendedDataRequired()&&typeof(h.discount)!="undefined"&&h.discount.active&&(h.discount.id==1||h.discount.id==4)&&h.discount.is_visible){e.model.useRefDiscount=true}else{e.model.useRefDiscount=false}var a=e.model.initProperty(f);var g=new Object();g.checkin=f.info.checkin.date.value;g.checkout=f.info.checkout.date.value;g.persons=f.info.persons;g.rooms=f.info.rooms;g.roomCount=e.model.getNumDistinctRoomsInCombination(false);g.scarcity=e.model.getNumDistinctRoomsInCombination(true);g.scarcityData=e.model.getScarcityData();window.search_result_dto=g;if(typeof(window.track_avail_hotel_search)!="undefined"){window.track_avail_hotel_search()}e.pushAvailTrack();if(e.model.mlg!=null){e.renderAvailabilityResult()}else{e.pendingAvailabilityResult=true}}if(b){e.getSearchAvailabilities(e.model.searchQueryObj)}else{e.availCalls=0;if(c!=null){e.handleAvailabilityError()}}},renderAvailabilityResult:function(){this.model.initParsedMlg();if(this.model.isExtendedDataRequired()){this.view.renderHowToBookSection(this.model);this.model.EsrProperyCardsDisplayed=true}this.view.hideAvailLoadingDiv(true);this.acceptAvailabilityEvents=true;this.view.renderPropertyAvailabilityResult(this.model);this.initAccordion();this.pendingAvailabilityResult=false;this.performAvalabilitySearchOnLoad=false;this.model.isChangedCurrency=false},handleAvailabilityError:function(){this.handleNoAvailability()},handleNoAvailability:function(){this.setNoAvailCookie();this.redirectToCityPage(this.model.searchQueryObj)},redirectToCityPage:function(b){var e="";var d="";this.model.widgets.isLoadedPhotogallery&&this.gallery.isSlideshowRunning&&this.gallery.pause();if(b!=null){for(var a in b.availParams){e+=d+a+"="+b.availParams[a];d="&"}for(a in b.extraParams){e+=d+a+"="+b.extraParams[a];d="&"}}var c=this.model.SiteSearchFormConfig.defaultGeoUrl;if(e.length>0){if(c.indexOf("?")!=-1){c+=d+e}else{c+="?"+e}}window.location.assign(c)},pushAvailTrack:function(){var a=jQuery.getContext();var b="avail";var c={};c.type="avail";c.result="yes";if(a.model.searchQueryObj==null){return}c.htid=a.model.searchQueryObj.baseParams.htid;c.sd=a.model.searchQueryObj.availParams.sd;c.sm=a.model.searchQueryObj.availParams.sm;c.sy=a.model.searchQueryObj.availParams.sy;c.ed=a.model.searchQueryObj.availParams.ed;c.em=a.model.searchQueryObj.availParams.em;c.ey=a.model.searchQueryObj.availParams.ey;c.pval=a.model.searchQueryObj.availParams.pval;c.rval=a.model.searchQueryObj.availParams.rval;c.rooms=a.model.getNumDistinctRoomsInCombination(false);c.scarc=a.model.getNumDistinctRoomsInCombination(true)+"";c.scarc_set=a.model.getScarcityData();if(a.tracker==null){a.tracker=new Tracker();a.tracker.init()}a.tracker.push(b,c)},pushCitySearchTrack:function(c){var a=jQuery.getContext();var b="hotel_form";var d={};d.event=b;d.htid=c.htid;if(typeof(c.sd)!="undefined"){d.sd=c.sd;d.sm=c.sm;d.sy=c.sy;d.ed=c.ed;d.em=c.em;d.ey=c.ey;d.pval=c.pval;d.rval=c.rval}if(c.geoid!=null){d.geoid=c.geoid}d.searchname=c.city;if(a.tracker==null){a.tracker=new Tracker();a.tracker.init()}a.tracker.push(b,d)},pushTabChangeTrack:function(d){var b=jQuery.getContext();var a={};a[HotelConstants.sectionsIDs.overview]="description";a[HotelConstants.sectionsIDs.location]="location";a[HotelConstants.sectionsIDs.reviews]="reviews";if(typeof(a[d])=="undefined"){return}var f=a[d];var c="tab_change";var e={};e.event=c;e.htid=b.model.generalInfo.hotel_id;e.lg=b.model.generalInfo.lg;e.tab=f;if(b.model.searchQueryObj!=null){e.sd=b.model.searchQueryObj.availParams.sd;e.sm=b.model.searchQueryObj.availParams.sm;e.sy=b.model.searchQueryObj.availParams.sy;e.ed=b.model.searchQueryObj.availParams.ed;e.em=b.model.searchQueryObj.availParams.em;e.ey=b.model.searchQueryObj.availParams.ey;e.pval=b.model.searchQueryObj.availParams.pval;e.rval=b.model.searchQueryObj.availParams.rval}if(b.tracker==null){b.tracker=new Tracker();b.tracker.init()}b.tracker.push(c,e)},pushBookFormTrack:function(e){var b=jQuery.getContext();var d="clkLinkProperty";var f={};f.event=d;f.deal=(e.dealId==null?-1:e.dealId);var a=(e.stpCurrency==null?"0":""+e.stpCurrency);var g=(e.savedAmountCurrency==null?"0":""+e.savedAmountCurrency);var c=(e.currencyRate==null?"0":""+e.currencyRate);f.stp=a+"-"+g+"-"+c;f.vadds=e.valuesAdds;f.roomId=e.roomIdList;f.htid=e.htid;f.scarc_clk=e.scarcity?"1":"0";f.scarc_clk_set=e.scarcityData;if(b.tracker==null){b.tracker=new Tracker();b.tracker.init()}b.tracker.push(d,f)},pushTopButtonTrack:function(e){var a=jQuery.getContext();var d="button";var f={};f.event=d;f.htid=e.htid;var c=(e.minPriceCurrency==null?"0":""+e.minPriceCurrency);var b=(e.currencyRate==null?"0":""+e.currencyRate);f.price=c+"-"+b;f.label=e.withDates?"pick_a_room":"book_now";if(a.tracker==null){a.tracker=new Tracker();a.tracker.init()}a.tracker.push(d,f)},initTabs:function(){var a=jQuery.getContext();$("#"+HotelConstants.tabsBarId+" li a").each(function(){$(this).click(function(b){var c=$(this).attr("href").replace(/#/g,"");a.switchToSection(c,{source:"tab"});a.historySave();return false})})},setLandingSection:function(){var a=HotelConstants.defaultSectionId;return a},switchAllSections:function(a,c){var b=jQuery.getContext();var e=b.model.getBlockGroupBySection().sections;for(var d in e){if(d==a){b.view.turnSection("on",d,b.model,c);if(d==HotelConstants.sectionsIDs.overview){ctrl.model.widgets.isLoadedPhotogallery&&!this.gallery.isSlideshowRunning&&this.gallery.play()}if(d==HotelConstants.sectionsIDs.location){ctrl.model.widgets.isLoadedGmap&&google.maps.event.trigger(ctrl.googleMap,"resize")}}else{b.view.turnSection("off",d,b.model,c);if(d==HotelConstants.sectionsIDs.overview){ctrl.model.widgets.isLoadedPhotogallery&&this.gallery.isSlideshowRunning&&this.gallery.pause()}}}},switchToSection:function(d,c){var b=jQuery.getContext();var a=HotelConstants.defaultSectionId;if(d!=""){a=d}if(b.model.pageStatus.selectedSectionId!=a||this.firstLoading==true){b.switchAllSections(a,c);b.view.renderTabSelection(a);b.model.pageStatus.selectedSectionId=a;if(b.trackTabChanges){b.pushTabChangeTrack(a)}if(typeof(window.track_tab_change)!="undefined"){window.track_tab_change(a)}if(this.firstLoading==true){this.firstLoading=false}}return false},initUserFeedbackPreview:function(){var a=jQuery.getContext();$("#avg_guest_review_title.exist-reviews").click(function(){a.switchToSection(HotelConstants.sectionsIDs.reviews);a.historySave();return false});$("#avg_guest_rating").click(function(){a.switchToSection(HotelConstants.sectionsIDs.reviews);a.historySave();return false});$("#"+HotelConstants.reviewSummaryDivId+" a").click(function(){a.switchToSection(HotelConstants.sectionsIDs.reviews);a.historySave();return false});$("#no-review-per-lg-get-back").click(function(){a.switchToSection(HotelConstants.sectionsIDs.overview);a.historySave();return false});$("#no-review-get-back").click(function(){a.switchToSection(HotelConstants.sectionsIDs.overview);a.historySave();return false})},initMapCallout:function(){var a=jQuery.getContext();$("#MapCallout a").each(function(){$(this).click(function(b){var c=$(this).attr("href").replace(/#/g,"");a.switchToSection(c);a.historySave();return false})})},getSearchAvailabilities:function(b){if(!this.acceptAvailabilityEvents){return}this.acceptAvailabilityEvents=false;this.model.searchQueryObj=b;this.availCalls++;this.view.showAvailLoadingDiv(this.model,this.performAvalabilitySearchOnLoad);var c=new Object();for(var a in b.availParams){c[a]=b.availParams[a]}for(var a in b.baseParams){c[a]=b.baseParams[a]}for(var a in b.extraParams){c[a]=b.extraParams[a]}if(this.model.isExtendedDataRequired()){if(this.model.displayCurrencyCode){c.currency_code=this.model.displayCurrencyCode}if(this.model.generalInfo.user_country_code){c.country_code=this.model.generalInfo.user_country_code}}this.syncSiteSearchForm();c.abp=v_abp;this.service_manager.callService(HotelConstants.availabilityService,c,this.availabilityHandler)},syncSiteSearchForm:function(){if(this.model.SiteSearchFormConfig&&this.model.RoomSearchFormConfig){this.model.SiteSearchFormConfig.formDao.setStayParams(this.model.RoomSearchFormConfig.formDao.getStayParams())}},slideRoomStrip:function(d){var c=$(this).closest("table");var b=c.next();var a=b.is(":hidden");var e=$(d.target);if(!e.hasClass("strip_book_btn")&&!e.parent().hasClass("stp_only_sticker")){if($(".availroomlist_strip_info").hasClass("room_selected")){$(".availroomlist_strip_info").removeClass("room_selected")}if($("div.availroomlist_strip_details:visible").length>0){$("div.availroomlist_strip_details:visible").slideUp(0,function(){if(a==true){c.addClass("room_selected");b.fadeIn(250);$("html, body").animate({scrollTop:c.offset().top-10},500)}})}else{c.addClass("room_selected");b.fadeIn(250);$("html, body").animate({scrollTop:c.offset().top-10},500)}}},submitForm:function(b){var c=$(b.target).attr("id");var a=HotelConstants.bookFormIDPrefix+c;$("#"+a).submit()},initAccordion:function(){$("div.availroomlist_strip_details").hide();$("table.availroomlist_strip_info").click(this.slideRoomStrip);$("input[name^='proceed_book_btn_']").click(this.submitForm)},encodeFragment:function(){var a=jQuery.getContext();return this.sectionIDToHash(a.model.pageStatus.selectedSectionId)},decodeFragment:function(g){var e=jQuery.getContext();var c=HotelConstants.sectionsIDs;var b="-1";for(var d=0;d<g.length;++d){var a=g[d];if(a==""){b=a}else{for(var h in c){var f=this.sectionIDToHash(c[h]);if(!(f instanceof Function)){if(a==f){if(a!=e.model.pageStatus.selectedSectionId){if(a!="reviews"||!e.model.generalInfo.hide_reviews_section){b=c[h]}break}}}}}}return b},hashToSectionID:function(a){return a+HotelConstants.sectionIDSuffix},sectionIDToHash:function(a){return a.replace(HotelConstants.sectionIDSuffix,"")},historySave:function(){var a=this.encodeFragment();jQuery.historyLoad(a);return false},historyCallBack:function(c){var b=jQuery.getContext();var a=b.decodeFragment(c.replace("#","").split(HotelConstants.mainSeparator));if(a!="-1"){b.switchToSection(a)}else{b.switchToSection(HotelConstants.defaultSectionId)}return false},enableRoomSearchForm:function(){this.view.removeAvailabilitySearchSummaryDiv();this.view.renderRoomAvailabilityChangeDatesTitle(this.model);this.view.showRoomSearchForm(this.model)},changeLanguage:function(d){var b=$(d.target).closest("a");var a=b.attr("href");if(typeof(a)!="undefined"&&a!=null){var c=this.encodeFragment();if(c&&c!=this.sectionIDToHash(HotelConstants.defaultSectionId)){c="#"+c}else{c=""}window.location=a+c;return false}return true},updateAvgPriceOnChangeCurrency:function(f,d){var e=this.model.generalInfo.currency_code;var b=e;if((e)&&(typeof(this.model.conversionTable[e])!="undefined")&&typeof(this.model.conversionTable[e]["symbol"]!="undefined")){b=this.model.conversionTable[e]["symbol"]}if(this.model.searchQueryObj){var a=new Rate(this.model.min_combination_price,e,b)}else{var a=new Rate(f,e,b)}var c=this.model.getCurrencyConversion(a,d);this.view.updateAvgPrice(c)},updateOtherHotelPricesOnChangeCurrency:function(e){if(typeof(this.model.otherHotelPrices)!="undefined"&&this.model.otherHotelPrices!=null){var f=this.model.generalInfo.currency_code;var b=f;if((f)&&(typeof(this.model.conversionTable[f])!="undefined")&&typeof(this.model.conversionTable[f]["symbol"]!="undefined")){b=this.model.conversionTable[f]["symbol"]}for(var c in this.model.otherHotelPrices){var a=new Rate(this.model.otherHotelPrices[c],f,b);var d=this.model.getCurrencyConversion(a,e);this.view.updateOtherHotelPrice(c,d)}}},updatePricesOnChangeCurrency:function(b){this.view.scrollToAvailLoadingDiv(false);for(var a in HotelConstants.changeCurrency.updatingDomElementsModelFieldsMap){var c=HotelConstants.changeCurrency.updatingDomElementsModelFieldsMap[a];this.view.updatePriceElement(c.selector,this.model,c.repository,c.repositoryField,b)}},setNoAvailCookie:function(){var b=this.cookieManager.getCookieValue(document.cookie,HotelConstants.cookieUserPrefName,";");var a=new Object();a[HotelConstants.cookieNoAvailPrefix+"city_geo_id"]=this.model.generalInfo.hotel_city_geo_id;a[HotelConstants.cookieNoAvailPrefix+"property_name"]=this.model.generalInfo.seo_hotel_name;a[HotelConstants.cookieNoAvailPrefix+"property_id"]=this.model.generalInfo.hotel_id;this.cookieManager.updateCookie(HotelConstants.cookieUserPrefName,decodeURIComponent(b),a,HotelConstants.cookieUserPrefSeparator)},trackSiteSearch:function(b){var a=jQuery.getContext();b.htid=a.model.generalInfo.hotel_id;if(b.cityChanged==false){b.geoid=a.model.generalInfo.hotel_city_geo_id}a.pushCitySearchTrack(b);if(typeof(window.track_hotel_city_search_widget)!="undefined"){window.track_hotel_city_search_widget(b)}},trackBookForm:function(s){var b=jQuery.getContext();var q=new Object(),m=b.model.property.combinations[s],h=b.model;q.htid=h.generalInfo.hotel_id;q.roomIdList=m.rIds;q.currencyRate=b.getTrackingCurrencyRate(h.displayCurrencyCode);q.stpEuro=null;q.stpCurrency=null;q.savedAmountEuro=null;q.savedAmountCurrency=null;q.dealId=null;q.valuesAdds=null;if(m.combinationRate.savedAmount>0){var k;if(h.property.currency==HotelConstants.eurCurrency){q.stpEuro=Math.ceil(m.combinationRate.avgStrikeThroughPrice);q.savedAmountEuro=q.stpEuro-Math.ceil(m.combinationRate.avgPrice)}else{k=h.getNewRate(m.combinationRate,"avgStrikeThroughPrice",HotelConstants.eurCurrency);q.stpEuro=Math.ceil(k.price);k=h.getNewRate(m.combinationRate,"avgPrice",HotelConstants.eurCurrency);q.savedAmountEuro=q.stpEuro-Math.ceil(k.price)}if(h.property.currency==h.displayCurrencyCode){q.stpCurrency=Math.ceil(m.combinationRate.avgStrikeThroughPrice);q.savedAmountCurrency=q.stpCurrency-Math.ceil(m.combinationRate.avgPrice)}else{k=h.getNewRate(m.combinationRate,"avgStrikeThroughPrice",h.displayCurrencyCode);q.stpCurrency=Math.ceil(k.price);k=h.getNewRate(m.combinationRate,"avgPrice",h.displayCurrencyCode);q.savedAmountCurrency=q.stpCurrency-Math.ceil(k.price)}}if(m.combinationRate.hasDeals){q.dealId=m.combinationRate.dealsTypology}var g=new Array();try{g=m.rIds.split(",")}catch(j){g.push(m.rIds)}q.valuesAdds="";if(m.combinationRate.valuesAdds){for(var d=0;d<g.length;d++){var n=g[d];var a=new Array();if(m.combinationRate.valuesAdds[n]){if(m.combinationRate.valuesAdds[n]["bunch"]){a=m.combinationRate.valuesAdds[n]["bunch"]}}var l=false;var c="";for(var o in a){c+=o+"-";l=true}q.valuesAdds+=((l)?c.substring(0,c.length-1)+",":"-1,")}}else{for(var f=0;f<g.length;f++){q.valuesAdds+="-1,"}}q.valuesAdds=q.valuesAdds.substring(0,q.valuesAdds.length-1);q.scarcity=m.isCombinationWithScarcity();q.scarcityData=m.getScarcityData();b.pushBookFormTrack(q);if(typeof(window.track_book_form)!="undefined"){window.track_book_form(q)}},trackStripBookNow:function(){var b=jQuery.getContext();var d=new Object(),a=b.model,c;d.htid=a.generalInfo.hotel_id;d.currencyRate=b.getTrackingCurrencyRate(a.displayCurrencyCode);d.minPriceCurrency=null;d.minPriceEuro=null;if(a.lowest_price_4_room_4_night!=null){c=new Rate(a.lowest_price_4_room_4_night,a.property.currency,a.property.currency);d.withDates=true}else{c=new Rate(a.lowestPriceWoAvail,a.generalInfo.currency_code,a.generalInfo.currency_code);d.withDates=false}d.minPriceEuro=Math.ceil(a.getCurrencyConversion(c,HotelConstants.eurCurrency).price);d.minPriceCurrency=Math.ceil(a.getCurrencyConversion(c,a.displayCurrencyCode).price);b.pushTopButtonTrack(d);if(typeof(window.track_top_button)!="undefined"){window.track_top_button(d)}},getTrackingCurrencyRate:function(a){if(a!=HotelConstants.eurCurrency&&this.model.conversionTable!=null&&typeof(this.model.conversionTable[a])!="undefined"&&typeof(this.model.conversionTable[a]["ask"])!="undefined"){return 1/this.model.conversionTable[a]["ask"]}return 1}};function LoadManager(){}LoadManager.prototype={loadWidget:function(a){switch(a){case HotelConstants.widgets.photogallery:this.initPhotogallery();break;case HotelConstants.widgets.gmap:this.loadGmap();break;case HotelConstants.widgets.reviews:this.loadReviews();break;default:break}},initPhotogallery:function(){$("#"+HotelConstants.sectionsIDs.overview).bind("sectionSelected",function(a){if(!ctrl.model.widgets.isLoadedPhotogallery){ctrl.initPhotoGallery()}})},loadGmap:function(){$("#"+HotelConstants.sectionsIDs.location).bind("sectionSelected",function(){if(!ctrl.model.widgets.isLoadedGmap){ctrl.initGoogleMap()}})},loadReviews:function(){if(ctrl.model.generalInfo.hide_reviews_section){return}var a=function(){};if(ctrl.model.generalInfo.add_tripadvisor_reviews&&!ctrl.model.widgets.isLoadedReviews){ctrl.setTripAdvSumReadyFun();a=function(){ctrl.initTripAdvReviews()}}$("#"+HotelConstants.sectionsIDs.reviews).bind("sectionSelected",a);ctrl.initUserFeedbackPreview();ctrl.initReviews()}};function ServiceManager(){}ServiceManager.prototype={callService:function(a,f,e){f.service=a;var c=jQuery.getContext();var b=this.setServiceVersion(HotelConstants.servicePath,a);var d={type:"GET",url:b,data:f,dataType:"json",success:function(g,h){c.service_manager.callbackServiceProxySuccess(e,g,h)},timeout:HotelConstants.ajaxCallDefaultTimeout,error:function(g,j,h){c.service_manager.callbackServiceProxyError(e,g,j,h)}};$.ajax(d)},setServiceVersion:function(b,d){var a=b;var c=jQuery.getContext();if((typeof c.model.servicesVersion[d]!="undefined")&&(c.model.servicesVersion[d].length>0)){a=a+"/"+c.model.servicesVersion[d]+"/"}return a},callbackServiceProxyError:function(e,d,g,f){var c=jQuery.getContext();d.abort();var a=new Array();var b=new Object();if(g=="timeout"){b.text="Service timeout"}else{if(g=="error"){b.text="Service error"}else{if(g=="notmodified"){b.text="Service error: not modified"}else{if(g=="parsererror"){b.text="Service response parse error"}}}}a[0]=b;c.service_manager.callbackServiceError(e,a)},callbackServiceProxySuccess:function(e,d,f){var a=d.result;var b=d.diagnostics;var c=jQuery.getContext();if(b.length>0){c.service_manager.callbackServiceError(e,b)}else{c.service_manager.callbackServiceSuccess(e,a)}},callbackServiceSuccess:function(b,a){if(b!=null){b(a,null)}},callbackServiceError:function(b,a){if(b!=null){b(null,a)}}};if(typeof ctrl=="undefined"){var ctrl=new Controller();$(document).ready(function(){ctrl.init();var a=HotelConstants.history_switch;if(window!=window.top){a=false}jQuery.historyInit(ctrl.historyCallBack,a);ctrl.pageInitialized()})}(function(b){var d={};var a=0;b.galleriffic={version:"2.0.1",normalizeHash:function(e){return e.replace(/^.*#/,"").replace(/\?.*$/,"")},getImage:function(e){if(!e){return undefined}e=b.galleriffic.normalizeHash(e);return d[e]},gotoImage:function(f){var g=b.galleriffic.getImage(f);if(!g){return false}var e=g.gallery;e.gotoImage(g);return true},removeImageByHash:function(g,f){var h=b.galleriffic.getImage(g);if(!h){return false}var e=h.gallery;if(f&&f!=e){return false}return e.removeImageByIndex(h.index)}};var c={delay:3000,numThumbs:20,preloadAhead:40,imageViewerDelay:500,enableTopPager:false,enableBottomPager:true,maxPagesToShow:7,imageContainerSel:"",captionContainerSel:"",controlsContainerSel:"",loadingContainerSel:"",renderSSControls:true,renderNavControls:true,playLinkText:"Play",pauseLinkText:"Pause",prevLinkText:"Previous",nextLinkText:"Next",nextPageLinkText:"Next &rsaquo;",prevPageLinkText:"&lsaquo; Prev",enableHistory:false,enableKeyboardNavigation:true,autoStart:false,syncTransitions:false,defaultTransitionDuration:1000,onSlideChange:undefined,onTransitionOut:undefined,onTransitionIn:undefined,onPageTransitionOut:undefined,onPageTransitionIn:undefined,onImageAdded:undefined,onImageRemoved:undefined,maxImageWidth:-1,maxImageHeight:-1,imageViewerHMargin:4,brokenThumbURL:"",brokenImageURL:"",imageViewerNoImageWidth:200};b.fn.galleriffic=function(h){b.extend(this,{version:b.galleriffic.version,isSlideshowRunning:false,slideshowTimeout:undefined,clickHandler:function(q,n,m){if(!this.enableHistory){var o=b.galleriffic.normalizeHash(b(n).attr("href"));if(o=="nextPage"){this.currentThumbsPage++}else{if(o=="prevPage"){this.currentThumbsPage--}else{b.galleriffic.gotoImage(o)}}if(m){this.syncThumbs()}q.preventDefault()}},mouseEnterHandler:function(m,n){this.lastMouseClientY=m.clientY;this.lastMouseY=m.pageY;this.lastMouseX=m.pageX;this.showImageViewer(n)},mouseOutHandler:function(m){this.hideImageViewer()},mouseMoveHandler:function(m){this.lastMouseClientY=m.clientY;this.lastMouseY=m.pageY;this.lastMouseX=m.pageX;this.setImageViewerPosition()},setImageViewerPosition:function(){var n=10;var u=8;var q=8;var o=this.lastMouseY;var s=this.lastMouseClientY;var m=this.imageViewer.height();var t;var v;if(s>(m+n+u)){t=o-(u+m)}else{t=o-s+n}v=this.lastMouseX+q;this.imageViewer.css({top:(t)+"px",left:(v)+"px"})},showImageViewer:function(o){this.imageViewer.find("div").remove();this.currentViewedImage=new Image();this.currentViewedImage.onload=f.imageLoaded;this.currentViewedImage.onerror=function(){f.handleImageError(this)};this.currentViewedImage.src=o.slideUrl;var m=o.caption.find("div.image-title").html();var n=o.caption.find("div.image-desc").html();this.imageViewer.append('<div id="big-image">&nbsp;<img src="'+this.currentViewedImage.src+'"/></div>');this.imageViewer.append('<div id="image-title">'+m+"</div>");this.imageViewer.append('<div id="image-description">'+n+"</div>");if(this.imageViewerShowTimeout){clearTimeout(this.imageViewerShowTimeout)}this.imageViewerShowTimeout=setTimeout(function(){f.imageViewerTimeoutExpired=true;if(f.imageViewerTimeoutExpired&&f.imageViewerLoaded){f.setImageViewerPosition();f.imageViewer.show()}},this.imageViewerDelay)},imageLoaded:function(){var n=f.maxImageWidth;var s=f.maxImageHeight;if(n>-1&&s>-1){var t=f.currentViewedImage.width;var q=f.currentViewedImage.height;if(t==0){f.currentViewedImage.width=f.imageViewerNoImageWidth}if(t>n||q>s){var u=t/q;var o;var m;o=n;m=(1/u)*n;if(m>s){m=s;o=u*s}b(f.currentViewedImage).css({width:o+"px",height:m+"px"})}}var w=f.imageViewer.find("div#image-description");var v=f.imageViewerHMargin;if(w.html()==null){w.hide()}else{w.show()}w.css({width:(f.currentViewedImage.width)+"px"});f.imageViewer.css({width:(f.currentViewedImage.width+(v*2))+"px"});if(t==0){f.imageViewer.find("div#big-image").remove()}f.imageViewerLoaded=true;if(f.imageViewerTimeoutExpired&&f.imageViewerLoaded){f.setImageViewerPosition();f.imageViewer.show()}},hideImageViewer:function(){if(this.imageViewerShowTimeout){clearTimeout(this.imageViewerShowTimeout)}f.imageViewerTimeoutExpired=false;f.imageViewerLoaded=false;this.imageViewer.hide()},appendImage:function(m){this.addImage(m,false,false);return this},insertImage:function(n,m){this.addImage(n,false,true,m);return this},addImage:function(n,u,y,v){var w=(typeof n==="string")?b(n):n;var o=w.find("a.thumb");var q=o.attr("href");var x=o.attr("title");var t=w.find(".caption").remove();var s=o.attr("name");a++;if(!s||d[""+s]){s=a}if(!y){v=this.data.length}var m={title:x,slideUrl:q,caption:t,hash:s,gallery:this,index:v};if(y){this.data.splice(v,0,m);this.updateIndices(v)}else{this.data.push(m)}var z=this;if(!u){this.updateThumbs(function(){var A=z.find("ul.thumbs");if(y){A.children(":eq("+v+")").before(w)}else{A.append(w)}if(z.onImageAdded){z.onImageAdded(m,w)}})}d[""+s]=m;o.attr("rel","history").attr("href","#"+s).removeAttr("name").click(function(A){A.preventDefault()});o.find("img").mouseenter(function(A){z.mouseEnterHandler(A,m)}).mouseout(function(A){z.mouseOutHandler(A)}).mousemove(function(A){z.mouseMoveHandler(A)}).error(function(A){if(this.src!=z.brokenThumbURL){this.src=z.brokenThumbURL}});return this},removeImageByIndex:function(m){if(m<0||m>=this.data.length){return false}var n=this.data[m];if(!n){return false}this.removeImage(n);return true},removeImageByHash:function(m){return b.galleriffic.removeImageByHash(m,this)},removeImage:function(n){var m=n.index;this.data.splice(m,1);delete d[""+n.hash];this.updateThumbs(function(){var o=f.find("ul.thumbs").children(":eq("+m+")").remove();if(f.onImageRemoved){f.onImageRemoved(n,o)}});this.updateIndices(m);return this},updateIndices:function(m){for(i=m;i<this.data.length;i++){this.data[i].index=i}return this},initializeThumbs:function(){this.data=[];var m=this;this.find("ul.thumbs > li").each(function(n){m.addImage(b(this),true,false)});return this},isPreloadComplete:false,preloadInit:function(){if(this.preloadAhead==0){return this}this.preloadStartIndex=this.currentImage.index;var m=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,m)},preloadRelocate:function(m){this.preloadStartIndex=m;return this},preloadRecursive:function(t,o){if(t!=this.preloadStartIndex){var m=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,m)}var n=this;var q=o-t;if(q<0){q=this.data.length-1-t+o}if(this.preloadAhead>=0&&q>this.preloadAhead){setTimeout(function(){n.preloadRecursive(t,o)},500);return this}var u=this.data[o];if(!u){return this}if(u.image){return this.preloadNext(t,o)}var s=new Image();s.onload=function(){u.image=this;n.preloadNext(t,o)};s.onerror=function(){n.handleImageError(this)};s.alt=u.title;s.src=u.slideUrl;return this},preloadNext:function(q,o){var m=this.getNextIndex(o);if(m==q){this.isPreloadComplete=true}else{var n=this;setTimeout(function(){n.preloadRecursive(q,m)},100)}return this},handleImageError:function(m){if(m.src!=f.brokenImageURL){m.src=f.brokenImageURL}else{m.onload()}},getNextIndex:function(n){var m=n+1;if(m>=this.data.length){m=0}return m},getPrevIndex:function(m){var n=m-1;if(n<0){n=this.data.length-1}return n},pause:function(){this.isSlideshowRunning=false;if(this.slideshowTimeout){clearTimeout(this.slideshowTimeout);this.slideshowTimeout=undefined}if(this.$controlsContainer){this.$controlsContainer.find("div.ss-controls a").removeClass().addClass("play").attr("title",this.playLinkText).attr("href","#play").html(this.playLinkText)}return this},play:function(){this.isSlideshowRunning=true;if(this.$controlsContainer){this.$controlsContainer.find("div.ss-controls a").removeClass().addClass("pause").attr("title",this.pauseLinkText).attr("href","#pause").html(this.pauseLinkText)}if(!this.slideshowTimeout){var m=this;this.slideshowTimeout=setTimeout(function(){m.ssAdvance()},this.delay)}return this},toggleSlideshow:function(){if(this.isSlideshowRunning){this.pause()}else{this.play()}return this},ssAdvance:function(){if(this.isSlideshowRunning){this.next(true)}return this},next:function(m,n){this.gotoIndex(this.getNextIndex(this.currentImage.index),m,n);return this},previous:function(m,n){this.gotoIndex(this.getPrevIndex(this.currentImage.index),m,n);return this},nextPage:function(n,t){var q=this.getCurrentPage();var o=this.getNumPages()-1;if(q<o){var s=q*this.numThumbs;var m=s+this.numThumbs;this.gotoIndex(m,n,t)}return this},previousPage:function(m,s){var o=this.getCurrentPage();if(o>0){var q=o*this.numThumbs;var n=q-this.numThumbs;this.gotoIndex(n,m,s)}return this},gotoIndex:function(n,m,o){if(!m){this.pause()}if(n<0){n=0}else{if(n>=this.data.length){n=this.data.length-1}}var q=this.data[n];if(!o&&this.enableHistory){b.historyLoad(String(q.hash))}else{this.gotoImage(q)}return this},gotoImage:function(n){var m=n.index;if(this.onSlideChange){this.onSlideChange(this.currentImage.index,m)}this.currentImage=n;this.preloadRelocate(m);this.refresh();return this},getDefaultTransitionDuration:function(m){if(m){return this.defaultTransitionDuration}return this.defaultTransitionDuration/2},refresh:function(){var m=this.currentImage;if(!m){return this}var s=m.index;if(this.$controlsContainer){this.$controlsContainer.find("div.nav-controls a.prev").attr("href","#"+this.data[this.getPrevIndex(s)].hash).end().find("div.nav-controls a.next").attr("href","#"+this.data[this.getNextIndex(s)].hash)}var v=this.$imageContainer.find("span.current").addClass("previous").removeClass("current");var u=0;if(this.$captionContainer){u=this.$captionContainer.find("span.current").addClass("previous").removeClass("current")}var q=this.syncTransitions&&m.image;var n=true;var w=this;var t=function(){n=false;v.remove();if(u){u.remove()}if(!q){if(m.image&&m.hash==w.data[w.currentImage.index].hash){w.buildImage(m,q)}else{if(w.$loadingContainer){w.$loadingContainer.show()}}}};if(v.length==0){t()}else{if(this.onTransitionOut){this.onTransitionOut(v,u,q,t)}else{v.fadeTo(this.getDefaultTransitionDuration(q),0,t);if(u){u.fadeTo(this.getDefaultTransitionDuration(q),0)}}}if(q){this.buildImage(m,q)}if(!m.image){var o=new Image();o.onload=function(){m.image=this;if(!n&&m.hash==w.data[w.currentImage.index].hash){w.buildImage(m,q)}};o.onerror=function(){w.handleImageError(this)};o.alt=m.title;o.src=m.slideUrl}this.relocatePreload=true;return this},buildImage:function(t,q){var o=this;var m=this.getNextIndex(t.index);var n=this.$imageContainer.append('<span class="image-wrapper current"><a class="advance-link" rel="history" href="#'+this.data[m].hash+'" title="'+t.title+'">&nbsp;</a></span>').find("span.current").css("opacity","0");n.find("a").empty().append(t.image).click(function(u){o.clickHandler(u,this,false)});var s=0;if(this.$captionContainer){s=this.$captionContainer.append('<span class="image-caption current"></span>').find("span.current").css("opacity","0").append(t.caption)}if(this.$loadingContainer){this.$loadingContainer.hide()}if(this.onTransitionIn){this.onTransitionIn(n,s,q)}else{n.fadeTo(this.getDefaultTransitionDuration(q),1);if(s){s.fadeTo(this.getDefaultTransitionDuration(q),1)}}if(this.isSlideshowRunning){if(this.slideshowTimeout){clearTimeout(this.slideshowTimeout)}this.slideshowTimeout=setTimeout(function(){o.ssAdvance()},this.delay)}return this},getCurrentPage:function(){return this.currentThumbsPage},syncThumbs:function(){var n=this.getCurrentPage();if(n!=this.displayedPage){this.updateThumbs()}var m=this.find("ul.thumbs").children();m.filter(".selected").removeClass("selected");m.eq(this.currentImage.index).addClass("selected");return this},updateThumbs:function(m){var n=this;var o=function(){if(m){m()}n.rebuildThumbs();if(n.onPageTransitionIn){n.onPageTransitionIn()}else{n.show()}};if(this.onPageTransitionOut){this.onPageTransitionOut(o)}else{this.hide();o()}return this},rebuildThumbs:function(){var o=this.data.length>this.numThumbs;if(this.enableTopPager){var m=this.find("div.top");if(m.length==0){m=this.prepend('<div class="top pagination"></div>').find("div.top")}else{m.empty()}if(o){this.buildPager(m)}}if(this.enableBottomPager){var s=this.find("div.bottom");if(s.length==0){s=this.append('<div class="bottom pagination"></div>').find("div.bottom")}else{s.empty()}if(o){this.buildPager(s)}}var t=this.getCurrentPage();var u=t*this.numThumbs;var n=u+this.numThumbs-1;if(n>=this.data.length){n=this.data.length-1}var q=this.find("ul.thumbs");q.find("li").each(function(v){var w=b(this);if(v>=u&&v<=n){w.show()}else{w.hide()}});this.displayedPage=t;q.removeClass("noscript");return this},getNumPages:function(){return Math.ceil(this.data.length/this.numThumbs)},buildPager:function(o){var x=this;var n=this.getNumPages();var s=this.getCurrentPage();var v=s*this.numThumbs;var m=this.maxPagesToShow-1;var t=s-Math.floor((this.maxPagesToShow-1)/2)+1;if(t>0){var w=n-t;if(w<m){t=t-(m-w)}}if(t<0){t=0}if(s>0){var q=v-this.numThumbs;o.append('<div class="prev-thumbs-page"><a rel="history" href="#prevPage">'+this.prevPageLinkText+"</a></div>")}var u=v+this.numThumbs;if(u<this.data.length){o.append('<div class="next-thumbs-page"><a rel="history" href="#nextPage">'+this.nextPageLinkText+"</a></div>")}o.find("a").click(function(y){x.clickHandler(y,this,true)});return this},buildPageLink:function(o,t,q){var n=t+1;var s=this.getCurrentPage();if(t==s){o.append('<span class="current">'+n+"</span>")}else{if(t<q){var m=t*this.numThumbs;o.append('<a rel="history" href="#page'+(t+1)+'" title="'+n+'">'+n+"</a>")}}return this}});b.extend(this,c,h);if(this.enableHistory&&!b.historyInit){this.enableHistory=false}if(this.imageContainerSel){this.$imageContainer=b(this.imageContainerSel)}if(this.captionContainerSel){this.$captionContainer=b(this.captionContainerSel)}if(this.loadingContainerSel){this.$loadingContainer=b(this.loadingContainerSel)}this.initializeThumbs();if(this.maxPagesToShow<3){this.maxPagesToShow=3}this.displayedPage=-1;this.currentImage=this.data[0];this.imageViewer=null;this.imageViewerShowTimeout=null;this.currentViewedImage=null;this.currentThumbsPage=0;this.imageViewerTimeoutExpired=false;this.imageViewerLoaded=false;this.lastMouseY=-1;this.lastMouseX=-1;this.lastMouseClientY=-1;var f=this;if(this.$loadingContainer){this.$loadingContainer.hide()}if(this.controlsContainerSel){this.$controlsContainer=b(this.controlsContainerSel).empty();if(this.renderSSControls){if(this.autoStart){this.$controlsContainer.append('<div class="ss-controls"><a href="#pause" class="pause" title="'+this.pauseLinkText+'">'+this.pauseLinkText+"</a></div>")}else{this.$controlsContainer.append('<div class="ss-controls"><a href="#play" class="play" title="'+this.playLinkText+'">'+this.playLinkText+"</a></div>")}this.$controlsContainer.find("div.ss-controls a").click(function(m){f.toggleSlideshow();m.preventDefault();return false})}if(this.renderNavControls){this.$controlsContainer.append('<div class="nav-controls"><a class="prev" rel="history" title="'+this.prevLinkText+'">'+this.prevLinkText+'</a><a class="next" rel="history" title="'+this.nextLinkText+'">'+this.nextLinkText+"</a></div>").find("div.nav-controls a").click(function(m){f.clickHandler(m,this,false)})}}var g=!this.enableHistory||!location.hash;if(this.enableHistory&&location.hash){var k=b.galleriffic.normalizeHash(location.hash);var l=d[k];if(!l){g=true}}if(g){this.syncThumbs();this.find("ul.thumbs").children().find("a").removeAttr("title").find("img").attr("alt","");var e=this.getNextIndex(this.currentImage.index);var j=this.$imageContainer.find("img");this.$imageContainer.find("span").remove();this.$imageContainer.append('<span class="image-wrapper current"><a class="advance-link" rel="history" href="#'+this.data[e].hash+'">&nbsp;</a></span>');this.$imageContainer.find("a").empty().append(j).click(function(m){f.clickHandler(m,this,false)})}if(this.enableKeyboardNavigation){b(document).keydown(function(n){var m=n.charCode?n.charCode:n.keyCode?n.keyCode:0;switch(m){case 32:f.next();n.preventDefault();break;case 33:f.previousPage();n.preventDefault();break;case 34:f.nextPage();n.preventDefault();break;case 35:f.gotoIndex(f.data.length-1);n.preventDefault();break;case 36:f.gotoIndex(0);n.preventDefault();break;case 37:f.previous();n.preventDefault();break;case 39:f.next();n.preventDefault();break}})}this.imageViewer=b("body").append('<div class="image-viewer">&nbsp;</div>').find("div.image-viewer").css("display","none");if(this.autoStart){this.play()}setTimeout(function(){f.preloadInit()},1000);return this}})(jQuery);jQuery.extend({historyCurrentHash:undefined,historyCallback:undefined,historyIframeSrc:undefined,historyStart:undefined,historyNeedIframe:jQuery.browser.msie&&(jQuery.browser.version<8||document.documentMode<8),historyInit:function(e,d){jQuery.historyStart=true;if(window==window.top&&d){jQuery.historyCallback=e;var c=location.hash.replace(/\?.*$/,"");jQuery.historyCurrentHash=c;if(jQuery.historyNeedIframe){if(jQuery.historyCurrentHash==""){jQuery.historyCurrentHash="#"}jQuery("body").prepend('<iframe id="jQuery_history" style="display: none;" src="javascript:false;"></iframe>');var a=jQuery("#jQuery_history")[0];var b=a.contentWindow.document;b.open();b.close();b.location.hash=c}if(c){jQuery.historyCallback(c.replace(/^#/,""))}setInterval(jQuery.historyCheck,100)}else{jQuery.historyStart=false}},historyAddHistory:function(a){jQuery.historyBackStack.push(a);jQuery.historyForwardStack.length=0;this.isFirst=true},historyCheck:function(){var c="";if(jQuery.historyNeedIframe){var a=jQuery("#jQuery_history")[0];var b=a.contentDocument||a.contentWindow.document;c=b.location.hash.replace(/\?.*$/,"");if(c!=jQuery.historyCurrentHash){location.hash=c;jQuery.historyCurrentHash=c;jQuery.historyCallback(c.replace(/^#/,""))}}else{c=location.hash.replace(/\?.*$/,"");if(c!=jQuery.historyCurrentHash){jQuery.historyCurrentHash=c;jQuery.historyCallback(c.replace(/^#/,""))}}},historyLoad:function(c){if(!jQuery.historyStart){return}var d;c=decodeURIComponent(c.replace(/\?.*$/,""));d="#"+c;location.hash=d;jQuery.historyCurrentHash=d;if(jQuery.historyNeedIframe){var a=jQuery("#jQuery_history")[0];var b=a.contentWindow.document;b.open();b.close();b.location.hash=d;jQuery.lastHistoryLength=history.length}}});var TrackingConstants={tracking:{state:true,group:{stat:{state:true,url:"/esi/ajax-stats/hotel/stat.html"},events:{state:true,url:"/esi/ajax-stats/hotel/event.html"},hotelCRMstat:{state:true,url:"/cgi/statistics/hotel_template_CRM_stat.php"}},event:{avail:{state:true,group:"stat"},hotelCRM:{state:true,group:"hotelCRMstat"},hotel_form:{state:true,group:"events"},tab_change:{state:true,group:"events"},clkLinkProperty:{state:true,group:"events"},button:{state:true,group:"events"}}}};function Tracker(){}Tracker.prototype={init:function(a){this.isTrackingOn=true},disable:function(){this.isTrackingOn=false},enable:function(){this.isTrackingOn=true},push:function(c,e){if(!this.isTrackingOn||!TrackingConstants.tracking.state||!TrackingConstants.tracking.event[c]||!TrackingConstants.tracking.event[c]["state"]||!TrackingConstants.tracking.group[TrackingConstants.tracking.event[c]["group"]]["state"]){return}var d=TrackingConstants.tracking.event[c]["group"];var a=TrackingConstants.tracking.group[d]["url"];for(var b in e){a=this.addParamToUrl(a,b,e[b])}this.send(a)},send:function(b){if(typeof(venere_ajax_call)!="undefined"){venere_ajax_call(b,"GET",null,function(){})}else{var a={success:function(){},failure:function(){}};YAHOO.util.Connect.asyncRequest("GET",b,a)}},addParamToUrl:function(a,b,c){if((!b)||(!c)||(!a)){return a}var d=a;pos=d.indexOf("?");if(pos==-1){d+="?"}else{if(pos!=(d.length-1)){d+="&"}}d+=b+"="+escape(c);return d}};
