/* jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */
(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement){ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close()}d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1){for(h in a.converters){typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h])}}l=k,k=d[g];if(k==="*"){k=l}else{if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g){i in d&&(c[g[i]]=d[i])}while(f[0]==="*"){f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"))}if(h){for(i in e){if(e[i]&&e[i].test(h)){f.unshift(i);break}}}if(f[0] in d){j=f[0]}else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b)){f.each(b,function(b,e){c||bA.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)})}else{if(!c&&b!=null&&typeof b=="object"){for(var e in b){bY(a+"["+e+"]",b[e],c,d)}}else{d(a,b)}}}function bX(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c){c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d])}e&&f.extend(!0,a,e)}function bW(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bP,l;for(;i<j&&(k||!l);i++){l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bW(a,c,d,e,l,g)))}(k||!l)&&!g["*"]&&(l=bW(a,c,d,e,"*",g));return l}function bV(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bL),e=0,g=d.length,h,i,j;for(;e<g;e++){h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}}function by(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bt:bu;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null){d=a.style[b]||0}d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName" in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio"){a.defaultChecked=a.checked}}function bi(a){return"getElementsByTagName" in a?a.getElementsByTagName("*"):"querySelectorAll" in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object"){b.outerHTML=a.outerHTML}else{if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option"){b.selected=a.defaultSelected}else{if(c==="input"||c==="textarea"){b.defaultValue=a.defaultValue}}}else{a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)}}b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g){for(var i=0,j=g[h].length;i<j;i++){f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}}}function bf(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function V(a,b,c){b=b||0;if(f.isFunction(b)){return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c})}if(b.nodeType){return f.grep(a,function(a,d){return a===b===c})}if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(Q.test(b)){return f.filter(b,d,!c)}b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function U(a){return !a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++){g=s[i],g.origType.replace(w,"")===a.type?q.push(g.selector):s.splice(i--,1)}e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave"){a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h)}(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c){break}a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped()){break}}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return !0}function C(){return !1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a){if(b!=="toJSON"){return !1}}return !0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else{d=b}}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a){return this}if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2]){return f.find(a)}this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a)){return f.ready(a)}a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++){if((a=arguments[j])!=null){for(c in a){d=i[c],f=a[c];if(i===f){continue}l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}}}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body){return setTimeout(e.ready,1)}e.isReady=!0;if(a!==!0&&--e.readyWait>0){return}B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete"){return setTimeout(e.ready,1)}if(c.addEventListener){c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1)}else{if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1}try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf")){return !1}}catch(c){return !1}var d;for(d in a){}return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a){return !1}return !0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b){return null}b=e.trim(b);if(a.JSON&&a.JSON.parse){return a.JSON.parse(b)}if(o.test(b.replace(p,"@").replace(q,"]").replace(r,""))){return(new Function("return "+b))()}e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a){if(c.apply(a[f],d)===!1){break}}}else{for(;g<h;){if(c.apply(a[g++],d)===!1){break}}}}else{if(i){for(f in a){if(c.call(a[f],f,a[f])===!1){break}}}else{for(;g<h;){if(c.call(a[g],g,a[g++])===!1){break}}}}return a},trim:H?function(a){return a==null?"":H.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?F.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(!b){return -1}if(I){return I.call(b,a)}for(var c=0,d=b.length;c<d;c++){if(b[c]===a){return c}}return -1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number"){for(var f=c.length;e<f;e++){a[d++]=c[e]}}else{while(c[e]!==b){a[d++]=c[e++]}}a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++){e=!!b(a[f],f),c!==e&&d.push(a[f])}return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k){for(;i<j;i++){f=c(a[i],i,d),f!=null&&(h[h.length]=f)}}else{for(g in a){f=c(a[g],g,d),f!=null&&(h[h.length]=f)}}return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a)){return b}var f=G.call(arguments,2),g=function(){return a.apply(c,f.concat(G.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c){e.access(a,j,c[j],f,g,d)}return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++){g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h)}return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()}),A=e.uaMatch(z),A.browser&&(e.browser[A.browser]=!0,e.browser.version=A.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?C=function(){c.removeEventListener("DOMContentLoaded",C,!1),e.ready()}:c.attachEvent&&(C=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",C),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++){i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i)}k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0]){a.shift().apply(e,f)}}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return !!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g+"With"](this===b?d:this,[h])}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d){return d}d=a={}}var c=g.length;while(c--){a[g[c]]=b[g[c]]}return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++){b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e}e||g.resolveWith(g,b)}else{g!==a&&g.resolveWith(g,d?[a]:[])}return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e){return{}}g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p){o.style[t]=p[t]}o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom" in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent){for(t in {submit:1,change:1,focusin:1}){s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u}}o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return !!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b){return}m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function"){e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c)}g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c]){return g[i]&&g[i].events}j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i]){return}if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d)){return}}}if(c){delete h[i][e];if(!l(h[i])){return}}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b){return b!==!0&&a.getAttribute("classid")===b}}return !0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++){g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}}return d}if(typeof a=="object"){return this.each(function(){f.data(this,a)})}var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b){return f.queue(this[0],a)}return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--){if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0)){h++,l.done(m)}}m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u,v;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a)){return this.each(function(b){f(this).addClass(a.call(this,b,this.className))})}if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1){if(!e.className&&b.length===1){e.className=a}else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++){~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ")}e.className=f.trim(g)}}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a)){return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))})}if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className){if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++){h=h.replace(" "+c[i]+" "," ")}g.className=f.trim(h)}else{g.className=""}}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a)){return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)})}return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++]){i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}}else{if(c==="undefined"||c==="boolean"){this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""}}})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++){if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(n," ").indexOf(b)>-1){return !0}}return !1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get" in c&&(d=c.get(e,"value"))!==b){return d}d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h}}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return !b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0){return null}for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g){return b}d.push(b)}}if(g&&!d.length&&e.length){return f(e[c]).val()}return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2){return b}if(e&&c in f.attrFn){return f(a)[c](d)}if(!("getAttribute" in a)){return f.prop(a,c,d)}var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set" in i&&j&&(h=i.set(a,d,c))!==b){return h}a.setAttribute(c,""+d);return d}if(i&&"get" in i&&j&&(h=i.get(a,c))!==null){return h}h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b) in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode){f.error("type property can't be changed")}else{if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button")){return u.get(a,b)}return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button")){return u.set(a,b,c)}a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2){return b}var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set" in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get" in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b)){return a.checked=f.inArray(f(a).val(),b)>=0}}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1){d=C}else{if(!d){return}}var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i){return}var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1){a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t){return}c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t){f.event.remove(a,h+c)}return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p){continue}if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace)){f.event.remove(a,r,q.handler,j),p.splice(j--,1)}}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace)){e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q)}if(e!=null){break}}}if(p.length===0||e!=null&&p.length===1){(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e){c.preventDefault(),c.stopPropagation()}if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8){return}c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped()){break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando]){return a}var d=a;a=f.Event(d);for(var e=this.props.length,g;e;){g=this.props[--e],a[g]=d[g]}a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:100000000,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,M(a.origType,a.selector),f.extend({},a,{handler:L,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,M(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault){return new f.Event(a,b)}a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?D:C):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=D;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=D;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=D,this.stopPropagation()},isDefaultPrevented:C,isPropagationStopped:C,isImmediatePropagationStopped:C};var E=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},F=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?F:E,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?F:E)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form")){f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="submit"||c==="image")&&f(b).closest("form").length&&J("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")||f.nodeName(b,"button")?b.type:"";(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&J("submit",this,arguments)})}else{return !1}},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var G,H=function(a){var b=f.nodeName(a,"input")?a.type:"",c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e){return}if(e!=null||g){c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file"){return !1}for(var c in G){f.event.add(this,c+".specialChange",G[c])}return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a){this[c](h,d,a[h],e)}return this}if(arguments.length===2||d===!1){e=d,d=b}c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one"){this.one(a,d,e)}else{for(var i=0,j=this.length;i<j;i++){f.event.add(this[i],a,g,d)}}return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault){for(var c in a){this.unbind(c,a[c])}}else{for(var d=0,e=this.length;d<e;d++){f.event.remove(this[d],a,b)}}return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){return f.event.trigger(a,b,this[0],!0)}},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length){b[d++].guid=c}return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var K={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a){n[c](o,d,a[o],m)}return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d)){e=d||C,d=b}a=(a||"").split(" ");while((h=a[i++])!=null){j=w.exec(h),k="",j&&(k=j[0],h=h.replace(w,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,K[h]?(a.push(K[h]+k),h=h+k):h=(K[h]||h)+k;if(c==="live"){for(var p=0,q=n.length;p<q;p++){f.event.add(n[p],"live."+M(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l})}}else{n.unbind("live."+M(h,m),e)}}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else{if(k.filter(b,[i]).length>0){j=i;break}}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9){return[]}if(!b||typeof b!="string"){return f}var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b)){if(x.length===2&&l.relative[x[0]]){j=v(x[0]+x[1],d)}else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length){b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}}}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length){r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}}else{n=x=[]}}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]"){if(!u){f.push.apply(f,n)}else{if(d&&d.nodeType===1){for(t=0;n[t]!=null;t++){n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t])}}else{for(t=0;n[t]!=null;t++){n[t]&&n[t].nodeType===1&&f.push(j[t])}}}}else{p(n,f)}o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g){for(var b=1;b<a.length;b++){a[b]===a[b-1]&&a.splice(b--,1)}}}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a){return[]}for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter){if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\"){continue}j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f){g=o=!0}else{if(f===!0){continue}}}if(f){for(var s=0;(p=j[s])!=null;s++){if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}}}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g){return[]}break}}}if(a===h){if(g==null){k.error(a)}else{break}}h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.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|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++){if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++){c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b)}d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++){d[e].getAttribute("name")===a[1]&&c.push(d[e])}return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined"){return b.getElementsByTagName(a[1])}}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f){return a}for(var g=0,h;(h=b[g])!=null;g++){h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1))}return !1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else{a[2]&&k.error(a[0])}a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){b[3]=k(b[3],null,null,c)}else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return !1}}else{if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0])){return !0}}return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return !!a.firstChild},empty:function(a){return !a.firstChild},has:function(a,b,c){return !!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f){return f(a,c,b,d)}if(e==="contains"){return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0}if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++){if(g[h]===a){return !1}}return !0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling){if(d.nodeType===1){return !1}}if(c==="first"){return !0}d=a;case"last":while(d=d.nextSibling){if(d.nodeType===1){return !1}}return !0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0){return !0}var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling){d.nodeType===1&&(d.nodeIndex=++i)}h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f){return f(a,c,b,d)}}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match){l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n))}var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)}else{if(typeof a.length=="number"){for(var f=a.length;c<f;c++){d.push(a[c])}}else{for(;a[c];c++){d.push(a[c])}}}return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1}return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex){return a.sourceIndex-b.sourceIndex}var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i){return s(a,b)}if(!h){return -1}if(!i){return 1}while(j){e.unshift(j),j=j.parentNode}j=i;while(j){f.unshift(j),j=j.parentNode}c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++){if(e[k]!==f[k]){return s(e[k],f[k])}}return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b){return c}var d=a.nextSibling;while(d){if(d===b){return -1}d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++){c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes))}return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++){c[e].nodeType===1&&d.push(c[e])}c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return p(e.getElementsByTagName(b),f)}if(h[2]&&l.find.CLASS&&e.getElementsByClassName){return p(e.getElementsByClassName(h[2]),f)}}if(e.nodeType===9){if(b==="body"&&e.body){return p([e.body],f)}if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode){return p([],f)}if(i.id===h[3]){return p([i],f)}}try{return p(e.querySelectorAll(b),f)}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q){return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}}catch(s){}finally{n||m.removeAttribute("id")}}}}return a(b,e,f,g)};for(var e in a){k[e]=a[e]}b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a)){try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11){return f}}}catch(g){}}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return}l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])}},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return !1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a)){e+=c[0],a=a.replace(l.match.PSEUDO,"")}a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++){k(a,f[g],d)}return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var N=/Until$/,O=/^(?:parents|prevUntil|prevAll)/,P=/,/,Q=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,S=f.expr.match.POS,T={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string"){return f(a).filter(function(){for(c=0,d=b.length;c<d;c++){if(f.contains(b[c],this)){return !0}}})}var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0){for(h=g;h<e.length;h++){for(i=0;i<g;i++){if(e[i]===e[h]){e.splice(h--,1);break}}}}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++){if(f.contains(this,b[a])){return !0}}})},not:function(a){return this.pushStack(V(this,a,!1),"not",a)},filter:function(a){return this.pushStack(V(this,a,!0),"filter",a)},is:function(a){return !!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++){i=a[d],j[i]||(j[i]=S.test(i)?f(i,b||this.context):i)}while(g&&g.ownerDocument&&g!==b){for(i in j){h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k})}g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11){break}}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a){return this[0]&&this[0].parentNode?this.prevAll().length:-1}if(typeof a=="string"){return f.inArray(this[0],f(a))}return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d))){g.nodeType===1&&e.push(g),g=g[c]}return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c]){if(a.nodeType===1&&++e===b){break}}return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling){a.nodeType===1&&a!==b&&c.push(a)}return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|object|embed|option|style)/i,bb=/checked\s*(?:[^=]|=\s*.checked.)/i,bc=/\/(java|ecma)script/i,bd=/^\s*<!(?:\[CDATA\[|\-\-)/,be={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))})}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))}return f.text(this)},wrapAll:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapAll(a.call(this,b))})}if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1){a=a.firstChild}return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapInner(a.call(this,b))})}return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)})}if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)})}if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++){if(!a||f.filter(a,[d]).length){!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d)}}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild){b.removeChild(b.firstChild)}}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null}if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++){this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}}catch(e){this.empty().append(a)}}else{f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a)}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a)){return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))})}typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bb.test(j)){return this.each(function(){f(this).domManip(a,c,d,!0)})}if(f.isFunction(j)){return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)})}if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++){d.call(c?bf(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}}k.length&&f.each(k,bl)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!ba.test(a[0])&&(f.support.checkClone||!bb.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h){g[h]&&bh(e[h],g[h])}}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h){bg(e[h],g[h])}}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k){continue}if(typeof k=="string"){if(!_.test(k)){k=b.createTextNode(k)}else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--){o=o.lastChild}if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}}var r;if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;i<r;i++){bk(k[i])}}else{bk(k)}}k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return !a.type||bc.test(a.type)};for(j=0;h[j];j++){if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript")){e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j])}else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()]){continue}c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events){g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle)}b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bm=/alpha\([^)]*\)/i,bn=/opacity=([^)]*)/,bo=/([A-Z]|^ms)/g,bp=/^-?\d+(?:px)?$/i,bq=/^-?\d/,br=/^([\-+])=([\-+.\de]+)/,bs={position:"absolute",visibility:"hidden",display:"block"},bt=["Left","Right"],bu=["Top","Bottom"],bv,bw,bx;f.fn.css=function(a,c){if(arguments.length===2&&c===b){return this}return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bv(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get" in k&&(g=k.get(a,!1,e))!==b){return g}return j[c]}h=typeof d,h==="string"&&(g=br.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d)){return}h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set" in k)||(d=k.set(a,d))!==b){try{j[c]=d}catch(l){}}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get" in g&&(e=g.get(a,!0,d))!==b){return e}if(bv){return bv(a,c)}},swap:function(a,b,c){var d={};for(var e in b){d[e]=a.style[e],a.style[e]=b[e]}c.call(a);for(e in b){a.style[e]=d[e]}}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0){return by(a,b,d)}f.swap(a,bs,function(){e=by(a,b,d)});return e}},set:function(a,b){if(!bp.test(b)){return b}b=parseFloat(b);if(b>=0){return b+"px"}}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter){return}}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView)){return b}if(g=e.getComputedStyle(a,null)){d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c))}return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO){return bO.apply(this,arguments)}if(!this.length){return this}var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified")){f.lastModified[k]=y}if(z=v.getResponseHeader("Etag")){f.etag[k]=z}}if(a===304){w="notmodified",o=!0}else{try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}}else{u=w;if(!w||a){w="error",a<0&&(a=0)}}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n)){o[c[1].toLowerCase()]=c[2]}}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2){for(b in a){j[b]=[j[b],a[b]]}}else{b=a[v.status],v.then(b,b)}}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2){return !1}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers){v.setRequestHeader(u,d.headers[u])}if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return !1}for(u in {success:1,error:1,complete:1}){v[u](d[u])}p=bW(bQ,d,c,v);if(!p){w(-1,"No Transport")}else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a)){f.each(a,function(){e(this.name,this.value)})}else{for(var g in a){bY(g,a[g],c,e)}}return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState)){d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")}},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd){cd[a](0,1)}}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return !this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields){for(j in c.xhrFields){h[j]=c.xhrFields[j]}}c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e){h.setRequestHeader(j,e[j])}}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e){h.readyState!==4&&h.abort()}else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0){return this.animate(cq("show",3),a,b,c)}for(var g=0,h=this.length;g<h;g++){d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cr(d.nodeName)))}for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none"){d.style.display=f._data(d,"olddisplay")||""}}}return this},hide:function(a,b,c){if(a||a===0){return this.animate(cq("hide",3),a,b,c)}for(var d=0,e=this.length;d<e;d++){if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}}for(d=0;d<e;d++){this[d].style&&(this[d].style.display="none")}return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cq("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a)){return this.each(e.complete,[!1])}a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d){return b.complete.call(this)}c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cr(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a){k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""))}return !0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--){a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}}),b||this.dequeue();return this}}),f.each({slideDown:cq("show",1),slideUp:cq("hide",1),slideToggle:cq("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+0.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return d.step(a)}var d=this,e=f.fx;this.startTime=cn||co(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&f.timers.push(g)&&!cl&&(cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||co(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties){e.animatedProperties[g]!==!0&&(c=!1)}if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show){for(var i in e.animatedProperties){f.style(d,i,e.orig[i])}}e.complete.call(d)}return !1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return !0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b){a[b]()||a.splice(b--,1)}a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cs=/^t(?:able|d|h)$/i,ct=/^(?:body|html)$/i;"getBoundingClientRect" in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a){return this.each(function(b){f.offset.setOffset(this,a,b)})}if(!b||!b.ownerDocument){return null}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)}try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b)){return c?{top:c.top,left:c.left}:{top:0,left:0}}var h=e.body,i=cu(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a){return this.each(function(b){f.offset.setOffset(this,a,b)})}if(!b||!b.ownerDocument){return null}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)}f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed"){break}c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cs.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static"){l+=i.offsetTop,m+=i.offsetLeft}f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<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>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using" in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0]){return null}var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static"){a=a.offsetParent}return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e){return null}g=cu(e);return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e){return a==null?null:this}if(f.isFunction(a)){return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))})}if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c])}if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);(function(){var U=this,Q=U._,Y={},ab=Array.prototype,X=Object.prototype,ad=ab.slice,N=ab.unshift,L=X.toString,Z=X.hasOwnProperty,P=ab.forEach,O=ab.map,M=ab.reduce,K=ab.reduceRight,h=ab.filter,g=ab.every,e=ab.some,W=ab.indexOf,a=ab.lastIndexOf;X=Array.isArray;var H=Object.keys,V=Function.prototype.bind,ae=function(c){return new aa(c)};if(typeof module!=="undefined"&&module.exports){module.exports=ae;ae._=ae}else{U._=ae}ae.VERSION="1.1.5";var ac=ae.each=ae.forEach=function(i,c,l){if(i!=null){if(P&&i.forEach===P){i.forEach(c,l)}else{if(ae.isNumber(i.length)){for(var k=0,j=i.length;k<j;k++){if(c.call(l,i[k],k,i)===Y){break}}}else{for(k in i){if(Z.call(i,k)){if(c.call(l,i[k],k,i)===Y){break}}}}}}};ae.map=function(i,c,k){var j=[];if(i==null){return j}if(O&&i.map===O){return i.map(c,k)}ac(i,function(n,m,l){j[j.length]=c.call(k,n,m,l)});return j};ae.reduce=ae.foldl=ae.inject=function(i,c,l,k){var j=l!==void 0;if(i==null){i=[]}if(M&&i.reduce===M){if(k){c=ae.bind(c,k)}return j?i.reduce(c,l):i.reduce(c)}ac(i,function(o,n,m){if(!j&&n===0){l=o;j=true}else{l=c.call(k,l,o,n,m)}});if(!j){throw new TypeError("Reduce of empty array with no initial value")}return l};ae.reduceRight=ae.foldr=function(i,c,k,j){if(i==null){i=[]}if(K&&i.reduceRight===K){if(j){c=ae.bind(c,j)}return k!==void 0?i.reduceRight(c,k):i.reduceRight(c)}i=(ae.isArray(i)?i.slice():ae.toArray(i)).reverse();return ae.reduce(i,c,k,j)};ae.find=ae.detect=function(i,c,k){var j;T(i,function(n,m,l){if(c.call(k,n,m,l)){j=n;return true}});return j};ae.filter=ae.select=function(i,c,k){var j=[];if(i==null){return j}if(h&&i.filter===h){return i.filter(c,k)}ac(i,function(n,m,l){if(c.call(k,n,m,l)){j[j.length]=n}});return j};ae.reject=function(i,c,k){var j=[];if(i==null){return j}ac(i,function(n,m,l){c.call(k,n,m,l)||(j[j.length]=n)});return j};ae.every=ae.all=function(i,c,k){c=c||ae.identity;var j=true;if(i==null){return j}if(g&&i.every===g){return i.every(c,k)}ac(i,function(n,m,l){if(!(j=j&&c.call(k,n,m,l))){return Y}});return j};var T=ae.some=ae.any=function(i,c,k){c=c||ae.identity;var j=false;if(i==null){return j}if(e&&i.some===e){return i.some(c,k)}ac(i,function(n,m,l){if(j=c.call(k,n,m,l)){return Y}});return j};ae.include=ae.contains=function(i,c){var j=false;if(i==null){return j}if(W&&i.indexOf===W){return i.indexOf(c)!=-1}T(i,function(k){if(j=k===c){return true}});return j};ae.invoke=function(i,c){var j=ad.call(arguments,2);return ae.map(i,function(k){return(c?k[c]:k).apply(k,j)})};ae.pluck=function(i,c){return ae.map(i,function(j){return j[c]})};ae.max=function(i,c,k){if(!c&&ae.isArray(i)){return Math.max.apply(Math,i)}var j={computed:-Infinity};ac(i,function(n,m,l){m=c?c.call(k,n,m,l):n;m>=j.computed&&(j={value:n,computed:m})});return j.value};ae.min=function(i,c,k){if(!c&&ae.isArray(i)){return Math.min.apply(Math,i)}var j={computed:Infinity};ac(i,function(n,m,l){m=c?c.call(k,n,m,l):n;m<j.computed&&(j={value:n,computed:m})});return j.value};ae.sortBy=function(i,c,j){return ae.pluck(ae.map(i,function(m,l,k){return{value:m,criteria:c.call(j,m,l,k)}}).sort(function(n,m){var l=n.criteria,k=m.criteria;return l<k?-1:l>k?1:0}),"value")};ae.sortedIndex=function(i,c,m){m=m||ae.identity;for(var l=0,k=i.length;l<k;){var j=l+k>>1;m(i[j])<m(c)?l=j+1:k=j}return l};ae.toArray=function(c){if(!c){return[]}if(c.toArray){return c.toArray()}if(ae.isArray(c)){return c}if(ae.isArguments(c)){return ad.call(c)}return ae.values(c)};ae.size=function(c){return ae.toArray(c).length};ae.first=ae.head=function(i,c,j){return c!=null&&!j?ad.call(i,0,c):i[0]};ae.rest=ae.tail=function(i,c,j){return ad.call(i,c==null||j?1:c)};ae.last=function(c){return c[c.length-1]};ae.compact=function(c){return ae.filter(c,function(i){return !!i})};ae.flatten=function(c){return ae.reduce(c,function(i,j){if(ae.isArray(j)){return i.concat(ae.flatten(j))}i[i.length]=j;return i},[])};ae.without=function(i){var c=ad.call(arguments,1);return ae.filter(i,function(j){return !ae.include(c,j)})};ae.uniq=ae.unique=function(i,c){return ae.reduce(i,function(l,k,j){if(0==j||(c===true?ae.last(l)!=k:!ae.include(l,k))){l[l.length]=k}return l},[])};ae.intersect=function(i){var c=ad.call(arguments,1);return ae.filter(ae.uniq(i),function(j){return ae.every(c,function(k){return ae.indexOf(k,j)>=0})})};ae.zip=function(){for(var i=ad.call(arguments),c=ae.max(ae.pluck(i,"length")),k=Array(c),j=0;j<c;j++){k[j]=ae.pluck(i,""+j)}return k};ae.indexOf=function(i,c,k){if(i==null){return -1}var j;if(k){k=ae.sortedIndex(i,c);return i[k]===c?k:-1}if(W&&i.indexOf===W){return i.indexOf(c)}k=0;for(j=i.length;k<j;k++){if(i[k]===c){return k}}return -1};ae.lastIndexOf=function(i,c){if(i==null){return -1}if(a&&i.lastIndexOf===a){return i.lastIndexOf(c)}for(var j=i.length;j--;){if(i[j]===c){return j}}return -1};ae.range=function(i,c,m){if(arguments.length<=1){c=i||0;i=0}m=arguments[2]||1;for(var l=Math.max(Math.ceil((c-i)/m),0),k=0,j=Array(l);k<l;){j[k++]=i;i+=m}return j};ae.bind=function(i,c){if(V&&i.bind===V){return i.bind.apply(i,ad.call(arguments,1))}var j=ad.call(arguments,2);return function(){return i.apply(c,j.concat(ad.call(arguments)))}};ae.bindAll=function(i){var c=ad.call(arguments,1);if(c.length==0){c=ae.functions(i)}ac(c,function(j){i[j]=ae.bind(i[j],i)});return i};ae.memoize=function(i,c){var j={};c=c||ae.identity;return function(){var k=c.apply(this,arguments);return Z.call(j,k)?j[k]:j[k]=i.apply(this,arguments)}};ae.delay=function(i,c){var j=ad.call(arguments,2);return setTimeout(function(){return i.apply(i,j)},c)};ae.defer=function(c){return ae.delay.apply(ae,[c,1].concat(ad.call(arguments,1)))};var S=function(i,c,k){var j;return function(){var n=this,m=arguments,l=function(){j=null;i.apply(n,m)};k&&clearTimeout(j);if(k||!j){j=setTimeout(l,c)}}};ae.throttle=function(i,c){return S(i,c,false)};ae.debounce=function(i,c){return S(i,c,true)};ae.once=function(i){var c=false,j;return function(){if(c){return j}c=true;return j=i.apply(this,arguments)}};ae.wrap=function(i,c){return function(){var j=[i].concat(ad.call(arguments));return c.apply(this,j)}};ae.compose=function(){var c=ad.call(arguments);return function(){for(var i=ad.call(arguments),j=c.length-1;j>=0;j--){i=[c[j].apply(this,i)]}return i[0]}};ae.keys=H||function(i){if(i!==Object(i)){throw new TypeError("Invalid object")}var c=[],j;for(j in i){if(Z.call(i,j)){c[c.length]=j}}return c};ae.values=function(c){return ae.map(c,ae.identity)};ae.functions=ae.methods=function(c){return ae.filter(ae.keys(c),function(i){return ae.isFunction(c[i])}).sort()};ae.extend=function(c){ac(ad.call(arguments,1),function(i){for(var j in i){c[j]=i[j]}});return c};ae.defaults=function(c){ac(ad.call(arguments,1),function(i){for(var j in i){if(c[j]==null){c[j]=i[j]}}});return c};ae.clone=function(c){return ae.isArray(c)?c.slice():ae.extend({},c)};ae.tap=function(i,c){c(i);return i};ae.isEqual=function(i,c){if(i===c){return true}var l=typeof i;if(l!=typeof c){return false}if(i==c){return true}if(!i&&c||i&&!c){return false}if(i._chain){i=i._wrapped}if(c._chain){c=c._wrapped}if(i.isEqual){return i.isEqual(c)}if(ae.isDate(i)&&ae.isDate(c)){return i.getTime()===c.getTime()}if(ae.isNaN(i)&&ae.isNaN(c)){return false}if(ae.isRegExp(i)&&ae.isRegExp(c)){return i.source===c.source&&i.global===c.global&&i.ignoreCase===c.ignoreCase&&i.multiline===c.multiline}if(l!=="object"){return false}if(i.length&&i.length!==c.length){return false}l=ae.keys(i);var k=ae.keys(c);if(l.length!=k.length){return false}for(var j in i){if(!(j in c)||!ae.isEqual(i[j],c[j])){return false}}return true};ae.isEmpty=function(i){if(ae.isArray(i)||ae.isString(i)){return i.length===0}for(var c in i){if(Z.call(i,c)){return false}}return true};ae.isElement=function(c){return !!(c&&c.nodeType==1)};ae.isArray=X||function(c){return L.call(c)==="[object Array]"};ae.isArguments=function(c){return !!(c&&Z.call(c,"callee"))};ae.isFunction=function(c){return !!(c&&c.constructor&&c.call&&c.apply)};ae.isString=function(c){return !!(c===""||c&&c.charCodeAt&&c.substr)};ae.isNumber=function(c){return !!(c===0||c&&c.toExponential&&c.toFixed)};ae.isNaN=function(c){return c!==c};ae.isBoolean=function(c){return c===true||c===false};ae.isDate=function(c){return !!(c&&c.getTimezoneOffset&&c.setUTCFullYear)};ae.isRegExp=function(c){return !!(c&&c.test&&c.exec&&(c.ignoreCase||c.ignoreCase===false))};ae.isNull=function(c){return c===null};ae.isUndefined=function(c){return c===void 0};ae.noConflict=function(){U._=Q;return this};ae.identity=function(c){return c};ae.times=function(i,c,k){for(var j=0;j<i;j++){c.call(k,j)}};ae.mixin=function(c){ac(ae.functions(c),function(i){f(i,ae[i]=c[i])})};var b=0;ae.uniqueId=function(i){var c=b++;return i?i+c:c};ae.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g};ae.template=function(i,c){var j=ae.templateSettings;j="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+i.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(j.interpolate,function(l,k){return"',"+k.replace(/\\'/g,"'")+",'"}).replace(j.evaluate||null,function(l,k){return"');"+k.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');";j=new Function("obj",j);return c?j(c):j};var aa=function(c){this._wrapped=c};ae.prototype=aa.prototype;var R=function(i,c){return c?ae(i).chain():i},f=function(i,c){aa.prototype[i]=function(){var j=ad.call(arguments);N.call(j,this._wrapped);return R(c.apply(ae,j),this._chain)}};ae.mixin(ae);ac(["pop","push","reverse","shift","sort","splice","unshift"],function(i){var c=ab[i];aa.prototype[i]=function(){c.apply(this._wrapped,arguments);return R(this._wrapped,this._chain)}});ac(["concat","join","slice"],function(i){var c=ab[i];aa.prototype[i]=function(){return R(c.apply(this._wrapped,arguments),this._chain)}});aa.prototype.chain=function(){this._chain=true;return this};aa.prototype.value=function(){return this._wrapped}})();(function(c,b){function a(){this.$=c;this._=b;this.prev_$h=window.$h;this.dataAttributes={apiBaseUrl:{required:false,"default":"//localhost:3000",removeTrailingSlash:true},apiKey:{required:true},apiVersion:{required:true},baseUrl:{required:false,"default":"",removeTrailingSlash:true},kissmetricsUrl:{required:false},currency:{required:false,"default":"USD"},currencySymbol:{required:false,"default":"$"},distanceUnit:{required:false,"default":"miles"},dateFormat:{required:false,"default":"mm/dd/yy"},preventTrackingUntilInteraction:{required:false,"default":false}};this.googleMaps=false;this.scrollbarWidth=0;this.devMode=true;this.currency="USD";this.currencySymbol="$";this.distanceUnit="miles";this.dateFormat="mm/dd/yy";this.amenities=["INT","PETS","PKG","FIT","POOL","BUSIN","REST","CASIN","SPA","SCU","GOLF","SKI","MTG"];this.easing="easeInOutExpo";this.components={};this.baseComponent={};this.templates={};this.currentLocation=null;this.theme="default"}a.prototype.initialize=function(){var e=this;c(function(){e.loadMapScript();e.element=c("#copter-widget");c.each(e.dataAttributes,function(g,f){e[g]=(e.element.data(g)||null);if(f.required&&!e.element.data(g)){e.throwException("Missing data attribute on script element: "+g)}else{if(typeof(f["default"])!="undefined"&&!e.element.data(g)){e[g]=f["default"]}}if(f.removeTrailingSlash){e[g]=e.removeTrailingSlash(e[g])}});e.cache.purge();if(!e.preventTrackingUntilInteraction){e.UserAction.initializeKissmetrics()}if(!b.isEmpty(e.components)){e.initComponents()}e.State.initialize();e.scrollbarWidth=c.getScrollbarWidth();e.enableAPICheck()})};a.prototype.noConflict=function(){window.$h=this.prev_$h;return this};a.prototype.log=function(){if(this.devMode&&window.console&&typeof window.console.log=="function"){window.console.log.apply(this,arguments)}};a.prototype.set=function(f){var e=this;c.each(f,function(h,g){if(e[h]){e[h]=g}})};a.prototype.formatCurrency=function(e){if(!isNaN(e)){e=Math.round(e)}return this.currencySymbol+e};a.prototype.formatDate=function(f,e){if(!f){this.throwException("No date argument was provided to $h.dateFormat")}if(!e){e="yy-mm-dd"}return c.datepicker.formatDate($h.dateFormat,c.datepicker.parseDate(e,f))};a.prototype.formatDistance=function(e){var f=0.621371192;return((this.distanceUnit==="km")?e:(e*f)).toFixed(1)+" "+this.distanceUnit};a.prototype.convertToKm=function(f){var e=0.621371192;return((this.distanceUnit==="km")?f:(f/e)).toFixed(1)};a.prototype.convertToMiles=function(f){var e=0.621371192;return((this.distanceUnit==="miles")?f:(f*e)).toFixed(1)};a.prototype.initComponents=function(){var e=this;c(function(){c.each(e.components,function(f,g){c.each(e.baseComponent,function(i,h){g.prototype[i]=h});g.initialize()});$h.trigger("initialized")})};a.prototype.getTemplate=function(h,f){var e=this,g="";if(e.templates[h]){if(b.isString(e.templates[h])){e.templates[h]=b.template(e.templates[h])}g=e.templates[h](f)}else{$h.throwException("Unable to find template with path "+h)}return g};a.prototype.throwException=function(e){throw e};a.prototype.loadMapScript=function(){if(window.google&&window.google.maps){this.mapLoaded()}else{var e=document.createElement("script");e.type="text/javascript";e.src="//maps.googleapis.com/maps/api/js?sensor=false&callback=window.hotelicopter.mapLoaded";document.body.appendChild(e)}};a.prototype.mapLoaded=function(){this.googleMaps=true;this.trigger("googleMapsLoaded")};a.prototype.isDatedSearch=function(){var e=this.State.stay();if(e&&e.checkIn&&e.checkOut){return true}else{return false}};a.prototype.removeTrailingSlash=function(e){return(typeof(e)=="string")?e.replace(/\/$/,""):null};a.prototype.enableAPICheck=function(){var e=this,f={k17:false,k65:false,k80:false,k73:false};c(document).keyup(function(g){c.each(f,function(i,h){if(("k"+g.which)==i){f[i]=false}})}).keydown(function(i){var h=true,g='<tr><td colspan="2" style="font-weight:bold;background:#f0f0f0;padding:3px;"><%=heading%></tr>',j='<tr><td style="font-weight:bold;vertical-align:top;padding-right:10px;padding:3px;"><%=property%></td><td style="padding:3px;"><%=value%></td></tr>';c.each(f,function(m,l){if(("k"+i.which)==m){f[m]=true}if(f[m]==false){h=false}});if(h){e.request.api("hc",{success:function(k){var l='<table style="width:600px;margin:15px 0;">';l+=b.template(g,{heading:"API"});c.each(k,function(n,m){if(n!="hack"){l+=b.template(j,{property:n,value:m})}});l+=b.template(g,{heading:"SDK"});c.each(e.dataAttributes,function(m){l+=b.template(j,{property:m,value:e[m]})});l+="</table>";e.components.Lightbox.createInstance(l)}})}})};window.hotelicopter=window.$h=new a();window.hotelicopter.initialize();return(window.hotelicopter)})(jQuery.noConflict(true),_.noConflict());(function(a,c,b){a.request={maxUrlLength:2000,jsonp:function(g,f){var e=c.extend({url:g,callbackParameter:"callback",traditional:false,cache:false,pageCache:false},f);e.success=function(h){if(f.success){f.success(a.request.camelCaseObjectKeys(h))}};e.error=function(i,h){a.log("Request Error",i,h);if(f.error){f.error({msg:"An error has occurred requesting data from the hotelicopter API.",url:i.url})}};c.jsonp(e)},jsonpLongUrl:function(f,i){var e=this,h=f.match(RegExp(".{1,"+this.maxUrlLength+"}","g")),g=null;g=function(p,k,o,l,n){var j=!!((p.length-1)==k);var m=p[k]||"";e.api("longurl",{isLongUrl:false,data:{id:o,data:m,done:j},success:function(q){if(j==true){l(q)}else{g(p,(k+1),q.id,l,n)}},error:n})};g(h,0,"",i.success,i.error)},api:function(g,f){if(!f.data){f.data={}}f.data=c.extend(this.formatData(f.data),{api_key:a.apiKey,api_version:a.apiVersion});var e=this.createApiUrl(g,f.data);delete f.data;if(false===f.isLongUrl||e.length<this.maxUrlLength){delete f.isLongUrl;a.request.jsonp(e,f)}else{a.request.jsonpLongUrl(e,f)}},createApiUrl:function(f,e){if(!f.match(/^http/)){f=a.apiBaseUrl+"/"+f}return e?f+"?"+c.param(e):f},formatData:function(g){var e=this,f={};c.each(g,function(i,h){if(b.isArray(h)){h=h.join("|")}if(i=="fields"){h=e.underscoreFields(h)}f[e.underscore(i)]=h});return f},underscore:function(e){return e.replace(/([A-Z])/g,function(f){return"_"+f.toLowerCase()})},camelCase:function(e){var f=e.replace(/(?:^|[-_])(\w)/g,function(g,h){return h?h.toUpperCase():""});f=(this.isUpperCase(f))?f:(f.charAt(0).toLowerCase()+f.slice(1));return f},camelCaseObjectKeys:function(h){var g=this,f=h,i;if(typeof(h)=="object"&&h!=null){f=(b.isArray(h))?[]:{};for(var e in h){i=(b.isNumber(e))?e:g.camelCase(e);f[i]=(typeof(h[e])=="object"&&h[e]!=null)?g.camelCaseObjectKeys(h[e]):h[e]}}return f},underscoreFields:function(e){var g=this,f=[];if(!b.isArray(e)){e=e.replace(/,/g,"|").split("|")}c.each(e,function(h,j){f.push(g.underscore(j))});return f.join("|")},isUpperCase:function(e){return e===e.toUpperCase()}}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(a,b){a.globalEvent=b("<div/>");a.bind=function(c,e){a.globalEvent.bind(c,e)};a.bindToElement=function(e,c,f){b(e).bind(c,f)};a.trigger=function(){b.event.trigger.apply(b,arguments)};a.unbind=function(){a.globalEvent.unbind.apply(a.globalEvent,arguments)};a.unbindFromElement=function(e,c){b(e).unbind(c)};a.removeElement=function(c){b(c).remove()};b(function(){b(window).hashchange(function(){a.trigger("hashChangeFirst");a.trigger("hashChange")});b(window).resize(function(c){a.trigger("windowResize",c)});b(window).scroll(function(c){a.trigger("windowScroll",c)});b(document).click(function(c){a.trigger("documentClick",c)});b(document).keydown(function(c){a.trigger("documentKeyDown",c)})})})(hotelicopter,hotelicopter.$);(function(a,b){a.cache={data:{},add:function(c,e,f){c="copter::"+c;this.data[c]=b.toJSON(e)},get:function(c){c="copter::"+c;return(this.data[c])?b.evalJSON(this.data[c]):false},purge:function(){}}})(hotelicopter,hotelicopter.$);(function(a,b){a.baseComponent={getText:function(e){var f=(this.parent)?this.parent.placeholder:this.placeholder,c=f.data("label"+b.capitalize(e));if(c){return c}else{if(this.text[e]||this.text[e]===""){return this.text[e]}else{a.throwException('Text not found for key "'+e+'"');return""}}},getAllText:function(){var c=b.extend({},this.text),e;for(e in c){try{c[e]=this.getText(e)}catch(f){c[e]=""}}return c},isRendered:function(c){return(b.trim(b(c).html()).length>0)}}})(hotelicopter,hotelicopter.$);(function(jQuery){
/*
   * jQuery UI 1.8.11
   *
   * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
   * Dual licensed under the MIT or GPL Version 2 licenses.
   * http://jquery.org/license
   *
   * http://docs.jquery.com/UI
   */
(function(c,j){function k(a){return !c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?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):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"))||!a.length?c(document):a},zIndex:function(a){if(a!==j){return this.css("zIndex",a)}if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0){return b}}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l){g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0}if(m){g-=parseFloat(c.curCSS(f,"margin"+this,true))||0}});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j){return i["inner"+b].call(this)}return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number"){return i["outer"+b].call(this,f)}return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return !!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map"){return false}a=c("img[usemap=#"+d+"]")[0];return !!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart" in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode){for(var e=0;e<b.length;e++){a.options[b[e][0]]&&b[e][1].apply(a.element,d)}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden"){return false}b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0){return true}a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
/*
   * jQuery UI Widget 1.8.11
   *
   * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
   * Dual licensed under the MIT or GPL Version 2 licenses.
   * http://jquery.org/license
   *
   * http://docs.jquery.com/UI/Widget
   */
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++){b(d).triggerHandler("remove")}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c){if(!a||b.filter(a,[this]).length){b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")})}}return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return !!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_"){return h}e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0){return b.extend({},this.options)}if(typeof a==="string"){if(c===j){return this.options[a]}d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled"){this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return !(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
/*
   * jQuery UI Mouse 1.8.11
   *
   * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
   * Dual licensed under the MIT or GPL Version 2 licenses.
   * http://jquery.org/license
   *
   * http://docs.jquery.com/UI/Mouse
   *
   * Depends:
   *	jquery.ui.widget.js
   */
(function(b){b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,e=a.which==1,f=typeof this.options.cancel=="string"?b(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(d){return c._mouseMove(d)};this._mouseUpDelegate=function(d){return c._mouseUp(d)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(b.browser.msie&&!(document.documentMode>=9)&&!a.button){return this._mouseUp(a)}if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a)}return !this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of){return t.apply(this,arguments)}b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else{if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else{if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}}}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1){f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"]}f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1){g[1]=g[0]}e[0]=parseInt(e[0],10)||0;if(e.length===1){e[1]=e[0]}e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right"){j.left+=h}else{if(b.at[0]==="center"){j.left+=h/2}}if(b.at[1]==="bottom"){j.top+=k}else{if(b.at[1]==="center"){j.top+=k/2}}j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right"){i.left-=l}else{if(b.my[0]==="center"){i.left-=l/2}}if(b.my[1]==="bottom"){i.top-=m}else{if(b.my[1]==="center"){i.top-=m/2}}i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position"))){b.style.position="relative"}var d=c(b),g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using" in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument){return null}if(b){return this.each(function(){c.offset.setOffset(this,b)})}return u.call(this)}}})(jQuery);(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g=false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active){return}a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo"){this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0])}a==="disabled"&&b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else{if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else{this.source=this.options.source}}},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength){return this.close(b)}clearTimeout(this.closing);if(this._trigger("search",b)!==false){return this._search(a)}},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else{this.close()}this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value){return a}return d.map(a,function(b){if(typeof b==="string"){return{label:b,value:b}}return d.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this;d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible")){if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else{this.menu[a](b)}}else{this.search(null,b)}},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery);(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.attr("scrollTop"),c=this.element.height();if(b<0){this.element.attr("scrollTop",g+b)}else{b>=c&&this.element.attr("scrollTop",g+b-c+a.height())}}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else{this.activate(b,this.element.children(a))}},nextPage:function(e){if(this.hasScroll()){if(!this.active||this.last()){this.activate(e,this.element.children(".ui-menu-item:first"))}else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}}else{this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(e){if(this.hasScroll()){if(!this.active||this.first()){this.activate(e,this.element.children(".ui-menu-item:last"))}else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}}else{this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()<this.element.attr("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");a.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");this.range=d([]);if(a.range){if(a.range===true){this.range=d("<div></div>");if(!a.values){a.values=[this._valueMin(),this._valueMin()]}if(a.values.length&&a.values.length!==2){a.values=[a.values[0],a.values[0]]}}else{this.range=d("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(a.range==="min"||a.range==="max"){this.range.addClass("ui-slider-range-"+a.range)}this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");if(a.values&&a.values.length){for(;d(".ui-slider-handle",this.element).length<a.values.length;){d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle")}}this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled){d(this).blur()}else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!b.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e=false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");h=b._start(c,f);if(h===false){return}}break}i=b.options.step;h=b.options.values&&b.options.values.length?(g=b.values(f)):(g=b.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=b._valueMin();break;case d.ui.keyCode.END:g=b._valueMax();break;case d.ui.keyCode.PAGE_UP:g=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h===b._valueMax()){return}g=b._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===b._valueMin()){return}g=b._trimAlignValue(h-i);break}b._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,e);b._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(b){var a=this.options,c,e,f,h,g;if(a.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(a.range===true&&this.values(1)===a.min){g+=1;f=d(this.handles[g])}if(this._start(b,g)===false){return false}this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();a=f.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-f.width()/2,top:b.pageY-a.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var a=this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a;if(this.orientation==="horizontal"){a=this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1){a=1}if(a<0){a=0}if(this.orientation==="vertical"){a=1-a}b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var e;if(this.options.values&&this.options.values.length){e=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>e||a===1&&c<e)){c=e}if(c!==this.values(a)){e=this.values();e[a]=c;b=this._trigger("slide",b,{handle:this.handles[a],value:c,values:e});this.values(a?0:1);b!==false&&this.values(a,c,true)}}else{if(c!==this.value()){b=this._trigger("slide",b,{handle:this.handles[a],value:c});b!==false&&this.value(c)}}},_stop:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("stop",b,c)},_change:function(b,a){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(a);c.values=this.values()}this._trigger("change",b,c)}},value:function(b){if(arguments.length){this.options.value=this._trimAlignValue(b);this._refreshValue();this._change(null,0)}return this._value()},values:function(b,a){var c,e,f;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}if(arguments.length){if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f<c.length;f+=1){c[f]=this._trimAlignValue(e[f]);this._change(null,f)}this._refreshValue()}else{return this.options.values&&this.options.values.length?this._values(b):this.value()}}else{return this._values()}},_setOption:function(b,a){var c,e=0;if(d.isArray(this.options.values)){e=this.options.values.length}d.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":if(a){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(c=0;c<e;c+=1){this._change(null,c)}this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var a,c;if(arguments.length){a=this.options.values[b];return a=this._trimAlignValue(a)}else{a=this.options.values.slice();for(c=0;c<a.length;c+=1){a[c]=this._trimAlignValue(a[c])}return a}},_trimAlignValue:function(b){if(b<=this._valueMin()){return this._valueMin()}if(b>=this._valueMax()){return this._valueMax()}var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a){alignValue+=c>0?a:-a}return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,a=this.options,c=this,e=!this._animateOff?a.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length){this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,a.animate);if(c.options.range===true){if(c.orientation==="horizontal"){if(k===0){c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},a.animate)}if(k===1){c.range[e?"animate":"css"]({width:f-g+"%"},{queue:false,duration:a.animate})}}else{if(k===0){c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},a.animate)}if(k===1){c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:a.animate})}}}g=f})}else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,a.animate);if(b==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},a.animate)}if(b==="max"&&this.orientation==="horizontal"){this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:a.animate})}if(b==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},a.animate)}if(b==="max"&&this.orientation==="vertical"){this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:a.animate})}}}});d.extend(d.ui.slider,{version:"1.8.11"})})(jQuery);(function(d,A){function K(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=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"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}function F(a,b){d.extend(a,b);for(var c in b){if(b[c]==null||b[c]==A){a[c]=b[c]}}return a}d.extend(d.ui,{datepicker:{version:"1.8.11"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){F(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input"){this._connectDatepicker(a,i)}else{f&&this._inlineDatepicker(a,i)}},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both"){a.focus(this._showDatepicker)}if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++){if(f[g].length>h){h=f[g].length;i=g}}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}F(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos){this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else{if(e=="div"||e=="span"){b.removeClass(this.markerClassName).empty()}}}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(e=="div"||e=="span"){b.children("."+this._inlineClass).children().removeClass("ui-state-disabled")}}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(e=="div"||e=="span"){b.children("."+this._inlineClass).children().addClass("ui-state-disabled")}}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a){return false}for(var b=0;b<this._disabledInputs.length;b++){if(this._disabledInputs[b]==a){return true}}return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string"){return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null}var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");F(e.settings,f);if(i!==null&&f.dateFormat!==A&&f.minDate===A){e.settings.minDate=this._formatDate(e,i)}if(g!==null&&f.dateFormat!==A&&f.maxDate===A){e.settings.maxDate=this._formatDate(e,g)}this._attachments(d(a),e);this._autoSize(e);this._setDateDatepicker(a,h);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing){switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey){d.datepicker._clearDate(a.target)}c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey){d.datepicker._gotoToday(a.target)}c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,e?+1:-1,"D")}c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey){d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M")}break;case 38:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,-7,"D")}c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,e?-1:+1,"D")}c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey){d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M")}break;case 40:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,+7,"D")}c=a.ctrlKey||a.metaKey;break;default:c=false}}else{if(a.keyCode==36&&a.ctrlKey){d.datepicker._showDatepicker(this)}else{c=false}}if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==A?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal){try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input"){a=d("input",a.parentNode)[0]}if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");F(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog){a.value=""}if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return !e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.maxZIndex();d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f){h()}b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));){a=a[b?"previousSibling":"nextSibling"]}a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker"))){if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose")){a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c){c.apply(a.input?a.input[0]:null,[b,a])}else{a.input&&a.input.trigger("change")}if(a.inline){this._updateDatepicker(a)}else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/86400000)/7)+1},parseDate:function(a,b,c){if(a==null||b==null){throw"Invalid arguments"}b=typeof b=="object"?b.toString():b+"";if(b==""){return null}var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1<a.length&&a.charAt(z+1)==p)&&z++;return p},m=function(p){var v=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&v?4:p=="o"?3:2)+"}");p=b.substring(s).match(p);if(!p){throw"Missing number at position "+s}s+=p[0].length;return parseInt(p[0],10)},n=function(p,v,H){p=o(p)?H:v;for(v=0;v<p.length;v++){if(b.substr(s,p[v].length).toLowerCase()==p[v].toLowerCase()){s+=p[v].length;return v+1}}throw"Unknown name at position "+s},r=function(){if(b.charAt(s)!=a.charAt(z)){throw"Unexpected literal at position "+s}s++},s=0,z=0;z<a.length;z++){if(k){if(a.charAt(z)=="'"&&!o("'")){k=false}else{r()}}else{switch(a.charAt(z)){case"d":l=m("d");break;case"D":n("D",f,h);break;case"o":u=m("o");break;case"m":j=m("m");break;case"M":j=n("M",i,g);break;case"y":c=m("y");break;case"@":var w=new Date(m("@"));c=w.getFullYear();j=w.getMonth()+1;l=w.getDate();break;case"!":w=new Date((m("!")-this._ticksTo1970)/10000);c=w.getFullYear();j=w.getMonth()+1;l=w.getDate();break;case"'":if(o("'")){r()}else{k=true}break;default:r()}}}if(c==-1){c=(new Date).getFullYear()}else{if(c<100){c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100)}}if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e){break}j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l){throw"Invalid date"}return w},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",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*10000000,formatDate:function(a,b,c){if(!b){return""}var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o)){for(;m.length<n;){m="0"+m}}return m},j=function(o,m,n,r){return i(o)?r[m]:n[m]},l="",u=false;if(b){for(var k=0;k<a.length;k++){if(u){if(a.charAt(k)=="'"&&!i("'")){u=false}else{l+=a.charAt(k)}}else{switch(a.charAt(k)){case"d":l+=g("d",b.getDate(),2);break;case"D":l+=j("D",b.getDay(),e,f);break;case"o":l+=g("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/86400000,3);break;case"m":l+=g("m",b.getMonth()+1,2);break;case"M":l+=j("M",b.getMonth(),h,c);break;case"y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":l+=b.getTime();break;case"!":l+=b.getTime()*10000+this._ticksTo1970;break;case"'":if(i("'")){l+="'"}else{u=true}break;default:l+=a.charAt(k)}}}}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++){if(c){if(a.charAt(f)=="'"&&!e("'")){c=false}else{b+=a.charAt(f)}}else{switch(a.charAt(f)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":if(e("'")){b+="'"}else{c=true}break;default:b+=a.charAt(f)}}}return b},_get:function(a,b){return a.settings[b]!==A?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case"d":case"D":g+=parseInt(k[1],10);break;case"w":case"W":g+=parseInt(k[1],10)*7;break;case"m":case"M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case"y":case"Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a){return null}a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c){this._notifyChange(a)}this._adjustInstDate(a);if(a.input){a.input.val(e?"":this._formatDate(a))}},_getDate:function(a){return !a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+y+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,r)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",D=0;D<i[0];D++){for(var M="",E=0;E<i[1];E++){var N=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",x="";if(l){x+='<div class="ui-datepicker-group';if(i[1]>1){switch(E){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}}x+='">'}x+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&D==0?c?f:n:"")+(/all|right/.test(t)&&D==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,D>0||E>0,z,w)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var B=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var q=(t+h)%7;B+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+r[q]+'">'+s[q]+"</span></th>"}x+=B+"</tr></thead><tbody>";B=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth){a.selectedDay=Math.min(a.selectedDay,B)}t=(this._getFirstDayOfMonth(m,g)-h+7)%7;B=l?6:Math.ceil((t+B)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O<B;O++){x+="<tr>";var P=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(q)+"</td>";for(t=0;t<7;t++){var G=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],C=q.getMonth()!=g,J=C&&!H||!G[0]||k&&q<k||o&&q>o;P+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(C?" ui-datepicker-other-month":"")+(q.getTime()==N.getTime()&&g==a.selectedMonth&&a._keyEvent||L.getTime()==q.getTime()&&L.getTime()==N.getTime()?" "+this._dayOverClass:"")+(J?" "+this._unselectableClass+" ui-state-disabled":"")+(C&&!v?"":" "+G[1]+(q.getTime()==u.getTime()?" "+this._currentClass:"")+(q.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!C||v)&&G[2]?' title="'+G[2]+'"':"")+(J?"":' onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a.id+"',"+q.getMonth()+","+q.getFullYear()+', this);return false;"')+">"+(C&&!v?"&#xa0;":J?'<span class="ui-state-default">'+q.getDate()+"</span>":'<a class="ui-state-default'+(q.getTime()==b.getTime()?" ui-state-highlight":"")+(q.getTime()==u.getTime()?" ui-state-active":"")+(C?" ui-priority-secondary":"")+'" href="#">'+q.getDate()+"</a>")+"</td>";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=P+"</tr>"}g++;if(g>11){g=0;m++}x+="</tbody></table>"+(l?"</div>"+(i[0]>0&&E==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j){o+='<span class="ui-datepicker-month">'+i[b]+"</span>"}else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";for(var n=0;n<12;n++){if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth())){o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>"}}o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));a.yearshtml="";if(h||!l){k+='<span class="ui-datepicker-year">'+c+"</span>"}else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++){a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>"}a.yearshtml+="</select>";if(d.browser.mozilla){k+='<select class="ui-datepicker-year"><option value="'+c+'" selected="selected">'+c+"</option></select>"}else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u){k+=(h||!(j&&l)?"&#xa0;":"")+o}k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y"){this._notifyChange(a)}},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b){b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])}},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length){return this}if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget")){return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b))}if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b))}return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.11";window["DP_jQuery_"+y]=d})(jQuery);jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3){return c}if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c)){return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)]}if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c)){return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55]}if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c)){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c)){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}if(/rgba\(0, 0, 0, 0\)/.exec(c)){return o.transparent}return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body")){break}a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,a={},b,d;if(c&&c.length&&c[0]&&c[c[0]]){for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}}else{for(b in c){if(typeof c[b]==="string"){a[b]=c[b]}}}return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b))){delete c[a]}}return c}function u(c,a){var b={_:0},d;for(d in a){if(c[d]!=a[d]){b[d]=a[d]}}return b}function k(c,a,b,d){if(typeof c=="object"){d=a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c]){return true}if(typeof c==="string"&&!f.effects[c]){return true}return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.queue("fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else{e.attr("style",g)}d&&d.apply(this,arguments)});h=f.queue(this);l=h.splice(h.length-1,1)[0];h.splice(1,0,l);f.dequeue(this)})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.11",save:function(c,a){for(var b=0;b<a.length;b++){a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])}},restore:function(c,a){for(var b=0;b<a.length;b++){a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))}},setMode:function(c,a){if(a=="toggle"){a=c.is(":hidden")?"show":"hide"}return a},getBaseline:function(c,a){var b;switch(c[0]){case"top":b=0;break;case"middle":b=0.5;break;case"bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case"left":c=0;break;case"center":c=0.5;break;case"right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper")){return c.parent()}var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10))){a[e]="auto"}});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper")){return c.parent().replaceWith(c)}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0){d[g]=unit[0]*b+unit[1]}});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d){return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)})}return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c)){return this._show.apply(this,arguments)}else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c)){return this._hide.apply(this,arguments)}else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c)){return this.__toggle.apply(this,arguments)}else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0){b=[parseFloat(a),e]}});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return -d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1){return d/2*a*a+b}return -d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1){return d/2*a*a*a+b}return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return -d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1){return d/2*a*a*a*a+b}return -d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1){return d/2*a*a*a*a*a+b}return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return -d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return -d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0){return b}if(a==e){return b+d}if((a/=e/2)<1){return d/2*Math.pow(2,10*(a-1))+b}return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return -d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1){return -d/2*(Math.sqrt(1-a*a)-1)+b}return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0){return b}if((a/=e)==1){return b+d}g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else{c=g/(2*Math.PI)*Math.asin(d/h)}return -(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0){return b}if((a/=e)==1){return b+d}g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else{c=g/(2*Math.PI)*Math.asin(d/h)}return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0){return b}if((a/=e/2)==2){return b+d}g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else{c=g/(2*Math.PI)*Math.asin(d/h)}if(a<1){return -0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b}return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j){g=1.70158}return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j){g=1.70158}return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j){g=1.70158}if((a/=e/2)<1){return d/2*a*a*(((g*=1.525)+1)*a-g)+b}return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2){return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b}return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show"){a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e)}var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery)})(window.hotelicopter.$);(function(g){var f={common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:false,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:false},line:{spotColor:"#f80",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:undefined,normalRangeMax:undefined,normalRangeColor:"#ccc",drawNormalOnTop:false,chartRangeMin:undefined,chartRangeMax:undefined,chartRangeMinX:undefined,chartRangeMaxX:undefined},bar:{barColor:"#00f",negBarColor:"#f44",zeroColor:undefined,nullColor:undefined,zeroAxis:undefined,barWidth:4,barSpacing:1,chartRangeMax:undefined,chartRangeMin:undefined,chartRangeClip:false,colorMap:undefined},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{}},discrete:{lineHeight:"auto",thresholdColor:undefined,thresholdValue:0,chartRangeMax:undefined,chartRangeMin:undefined,chartRangeClip:false},bullet:{targetColor:"red",targetWidth:3,performanceColor:"blue",rangeColors:["#D3DAFE","#A8B6FF","#7F94FF"],base:undefined},pie:{sliceColors:["#f00","#0f0","#00f"]},box:{raw:false,boxLineColor:"black",boxFillColor:"#cdf",whiskerColor:"black",outlierLineColor:"#333",outlierFillColor:"white",medianColor:"red",showOutliers:true,outlierIQR:1.5,spotRadius:1.5,target:undefined,targetColor:"#4a2",chartRangeMax:undefined,chartRangeMin:undefined}};var j,b,c;g.fn.simpledraw=function(m,l,n){if(n&&this[0].VCanvas){return this[0].VCanvas}if(m===undefined){m=g(this).innerWidth()}if(l===undefined){l=g(this).innerHeight()}if(g.browser.hasCanvas){return new b(m,l,this)}else{if(g.browser.msie){return new c(m,l,this)}else{return false}}};var a=[];g.fn.sparkline=function(l,m){return this.each(function(){var n=new g.fn.sparkline.options(this,m);var o=function(){var q,s,p;if(l==="html"||l===undefined){var t=this.getAttribute(n.get("tagValuesAttribute"));if(t===undefined||t===null){t=g(this).html()}q=t.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")}else{q=l}s=n.get("width")=="auto"?q.length*n.get("defaultPixelsPerValue"):n.get("width");if(n.get("height")=="auto"){if(!n.get("composite")||!this.VCanvas){var r=document.createElement("span");r.innerHTML="a";g(this).html(r);p=g(r).innerHeight();g(r).remove()}}else{p=n.get("height")}g.fn.sparkline[n.get("type")].call(this,q,n,s,p)};if((g(this).html()&&g(this).is(":hidden"))||(g.fn.jquery<"1.3.0"&&g(this).parents().is(":hidden"))||!g(this).parents("body").length){a.push([this,o])}else{o.call(this)}})};g.fn.sparkline.defaults=f;g.sparkline_display_visible=function(){for(var l=a.length-1;l>=0;l--){var m=a[l][0];if(g(m).is(":visible")&&!g(m).parents().is(":hidden")){a[l][1].call(m);a.splice(l,1)}}};var h={};var e=function(m){switch(m){case"undefined":m=undefined;break;case"null":m=null;break;case"true":m=true;break;case"false":m=false;break;default:var l=parseFloat(m);if(m==l){m=l}}return m};g.fn.sparkline.options=function(l,q){var p;this.userOptions=q=q||{};this.tag=l;this.tagValCache={};var o=g.fn.sparkline.defaults;var n=o.common;this.tagOptionsPrefix=q.enableTagOptions&&(q.tagOptionsPrefix||n.tagOptionsPrefix);var m=this.getTagSetting("type");if(m===h){p=o[q.type||n.type]}else{p=o[m]}this.mergedOptions=g.extend({},n,p,q)};g.fn.sparkline.options.prototype.getTagSetting=function(n){var q,m,p=this.tagOptionsPrefix;if(p===false||p===undefined){return h}if(this.tagValCache.hasOwnProperty(n)){q=this.tagValCache.key}else{q=this.tag.getAttribute(p+n);if(q===undefined||q===null){q=h}else{if(q.substr(0,1)=="["){q=q.substr(1,q.length-2).split(",");for(m=q.length;m--;){q[m]=e(q[m].replace(/(^\s*)|(\s*$)/g,""))}}else{if(q.substr(0,1)=="{"){var o=q.substr(1,q.length-2).split(",");q={};for(m=o.length;m--;){var l=o[m].split(":",2);q[l[0].replace(/(^\s*)|(\s*$)/g,"")]=e(l[1].replace(/(^\s*)|(\s*$)/g,""))}}else{q=e(q)}}}this.tagValCache.key=q}return q};g.fn.sparkline.options.prototype.get=function(m){var l=this.getTagSetting(m);if(l!==h){return l}return this.mergedOptions[m]};g.fn.sparkline.line=function(Y,G,m,n){var v=[],u=[],F=[];for(var X=0;X<Y.length;X++){var I=Y[X];var r=typeof(Y[X])=="string";var R=typeof(Y[X])=="object"&&Y[X] instanceof Array;var z=r&&Y[X].split(":");if(r&&z.length==2){v.push(Number(z[0]));u.push(Number(z[1]));F.push(Number(z[1]))}else{if(R){v.push(I[0]);u.push(I[1]);F.push(I[1])}else{v.push(X);if(Y[X]===null||Y[X]=="null"){u.push(null)}else{u.push(Number(I));F.push(Number(I))}}}}if(G.get("xvalues")){v=G.get("xvalues")}var p=Math.max.apply(Math,F);var P=p;var D=Math.min.apply(Math,F);var L=D;var q=Math.max.apply(Math,v);var E=Math.min.apply(Math,v);var K=G.get("normalRangeMin");var o=G.get("normalRangeMax");if(K!==undefined){if(K<D){D=K}if(o>p){p=o}}if(G.get("chartRangeMin")!==undefined&&(G.get("chartRangeClip")||G.get("chartRangeMin")<D)){D=G.get("chartRangeMin")}if(G.get("chartRangeMax")!==undefined&&(G.get("chartRangeClip")||G.get("chartRangeMax")>p)){p=G.get("chartRangeMax")}if(G.get("chartRangeMinX")!==undefined&&(G.get("chartRangeClipX")||G.get("chartRangeMinX")<E)){E=G.get("chartRangeMinX")}if(G.get("chartRangeMaxX")!==undefined&&(G.get("chartRangeClipX")||G.get("chartRangeMaxX")>q)){q=G.get("chartRangeMaxX")}var A=q-E===0?1:q-E;var w=p-D===0?1:p-D;var C=u.length-1;if(C<1){this.innerHTML="";return}var l=g(this).simpledraw(m,n,G.get("composite"));if(l){var O=l.pixel_width;var T=l.pixel_height;var H=0;var t=0;var W=G.get("spotRadius");if(W&&(O<(W*4)||T<(W*4))){W=0}if(W){if(G.get("minSpotColor")||(G.get("spotColor")&&u[C]==D)){T-=Math.ceil(W)}if(G.get("maxSpotColor")||(G.get("spotColor")&&u[C]==p)){T-=Math.ceil(W);H+=Math.ceil(W)}if(G.get("minSpotColor")||G.get("maxSpotColor")&&(u[0]==D||u[0]==p)){t+=Math.ceil(W);O-=Math.ceil(W)}if(G.get("spotColor")||(G.get("minSpotColor")||G.get("maxSpotColor")&&(u[C]==D||u[C]==p))){O-=Math.ceil(W)}}T--;var J=function(){if(K!==undefined){var y=H+Math.round(T-(T*((o-D)/w)));var x=Math.round((T*(o-K))/w);l.drawRect(t,y,O,x,undefined,G.get("normalRangeColor"))}};if(!G.get("drawNormalOnTop")){J()}var U=[];var M=[U];var S,Q,V=u.length;for(X=0;X<V;X++){S=v[X];Q=u[X];if(Q===null){if(X){if(u[X-1]!==null){U=[];M.push(U)}}}else{if(Q<D){Q=D}if(Q>p){Q=p}if(!U.length){U.push([t+Math.round((S-E)*(O/A)),H+T])}U.push([t+Math.round((S-E)*(O/A)),H+Math.round(T-(T*((Q-D)/w)))])}}var N=[];var s=[];var B=M.length;for(X=0;X<B;X++){U=M[X];if(!U.length){continue}if(G.get("fillColor")){U.push([U[U.length-1][0],H+T-1]);s.push(U.slice(0));U.pop()}if(U.length>2){U[0]=[U[0][0],U[1][1]]}N.push(U)}B=s.length;for(X=0;X<B;X++){l.drawShape(s[X],undefined,G.get("fillColor"))}if(G.get("drawNormalOnTop")){J()}B=N.length;for(X=0;X<B;X++){l.drawShape(N[X],G.get("lineColor"),undefined,G.get("lineWidth"))}if(W&&G.get("spotColor")){l.drawCircle(t+Math.round(v[v.length-1]*(O/A)),H+Math.round(T-(T*((u[C]-D)/w))),W,undefined,G.get("spotColor"))}if(p!=L){if(W&&G.get("minSpotColor")){S=v[g.inArray(L,u)];l.drawCircle(t+Math.round((S-E)*(O/A)),H+Math.round(T-(T*((L-D)/w))),W,undefined,G.get("minSpotColor"))}if(W&&G.get("maxSpotColor")){S=v[g.inArray(P,u)];l.drawCircle(t+Math.round((S-E)*(O/A)),H+Math.round(T-(T*((P-D)/w))),W,undefined,G.get("maxSpotColor"))}}}else{this.innerHTML=""}};g.fn.sparkline.bar=function(l,n,w,u){w=(l.length*n.get("barWidth"))+((l.length-1)*n.get("barSpacing"));var o=[];for(var E=0,q=l.length;E<q;E++){if(l[E]=="null"||l[E]===null){l[E]=null}else{l[E]=Number(l[E]);o.push(Number(l[E]))}}var D=Math.max.apply(Math,o),z=Math.min.apply(Math,o);if(n.get("chartRangeMin")!==undefined&&(n.get("chartRangeClip")||n.get("chartRangeMin")<z)){z=n.get("chartRangeMin")}if(n.get("chartRangeMax")!==undefined&&(n.get("chartRangeClip")||n.get("chartRangeMax")>D)){D=n.get("chartRangeMax")}var C=n.get("zeroAxis");if(C===undefined){C=z<0}var t=D-z===0?1:D-z;var p,v;if(g.isArray(n.get("colorMap"))){p=n.get("colorMap");v=null}else{p=null;v=n.get("colorMap")}var F=g(this).simpledraw(w,u,n.get("composite"));if(F){var A,B=F.pixel_height,m=z<0&&C?B-Math.round(B*(Math.abs(z)/t))-1:B-1;for(E=l.length;E--;){var s=E*(n.get("barWidth")+n.get("barSpacing")),r,G=l[E];if(G===null){if(n.get("nullColor")){A=n.get("nullColor");G=(C&&z<0)?0:z;u=1;r=(C&&z<0)?m:B-u}else{continue}}else{if(G<z){G=z}if(G>D){G=D}A=(G<0)?n.get("negBarColor"):n.get("barColor");if(C&&z<0){u=Math.round(B*((Math.abs(G)/t)))+1;r=(G<0)?m:m-u}else{u=Math.round(B*((G-z)/t))+1;r=B-u}if(G===0&&n.get("zeroColor")!==undefined){A=n.get("zeroColor")}if(v&&v[G]){A=v[G]}else{if(p&&p.length>E){A=p[E]}}if(A===null){continue}}F.drawRect(s,r,n.get("barWidth")-1,u-1,A,A)}}else{this.innerHTML=""}};g.fn.sparkline.tristate=function(v,z,m,w){v=g.map(v,Number);m=(v.length*z.get("barWidth"))+((v.length-1)*z.get("barSpacing"));var q,u;if(g.isArray(z.get("colorMap"))){q=z.get("colorMap");u=null}else{q=null;u=z.get("colorMap")}var r=g(this).simpledraw(m,w,z.get("composite"));if(r){var l=r.pixel_height,p=Math.round(l/2);for(var o=v.length;o--;){var t=o*(z.get("barWidth")+z.get("barSpacing")),s,n;if(v[o]<0){s=p;w=p-1;n=z.get("negBarColor")}else{if(v[o]>0){s=0;w=p-1;n=z.get("posBarColor")}else{s=p-1;w=2;n=z.get("zeroBarColor")}}if(u&&u[v[o]]){n=u[v[o]]}else{if(q&&q.length>o){n=q[o]}}if(n===null){continue}r.drawRect(t,s,z.get("barWidth")-1,w-1,n,n)}}else{this.innerHTML=""}};g.fn.sparkline.discrete=function(z,B,m,A){z=g.map(z,Number);m=B.get("width")=="auto"?z.length*2:m;var o=Math.floor(m/z.length);var u=g(this).simpledraw(m,A,B.get("composite"));if(u){var l=u.pixel_height,y=B.get("lineHeight")=="auto"?Math.round(l*0.3):B.get("lineHeight"),t=l-y,q=Math.min.apply(Math,z),v=Math.max.apply(Math,z);if(B.get("chartRangeMin")!==undefined&&(B.get("chartRangeClip")||B.get("chartRangeMin")<q)){q=B.get("chartRangeMin")}if(B.get("chartRangeMax")!==undefined&&(B.get("chartRangeClip")||B.get("chartRangeMax")>v)){v=B.get("chartRangeMax")}var s=v-q;for(var r=z.length;r--;){var p=z[r];if(p<q){p=q}if(p>v){p=v}var w=(r*o),n=Math.round(t-t*((p-q)/s));u.drawLine(w,n,w,n+y,(B.get("thresholdColor")&&p<B.get("thresholdValue"))?B.get("thresholdColor"):B.get("lineColor"))}}else{this.innerHTML=""}};g.fn.sparkline.bullet=function(n,p,y,v){n=g.map(n,Number);y=p.get("width")=="auto"?"4.0em":y;var F=g(this).simpledraw(y,v,p.get("composite"));if(F&&n.length>1){var E=F.pixel_width-Math.ceil(p.get("targetWidth")/2),A=F.pixel_height,z=Math.min.apply(Math,n),B=Math.max.apply(Math,n);if(p.get("base")===undefined){z=z<0?z:0}else{z=p.get("base")}var t=B-z;for(var C=2,r=n.length;C<r;C++){var q=n[C],m=Math.round(E*((q-z)/t));F.drawRect(0,0,m-1,A-1,p.get("rangeColors")[C-2],p.get("rangeColors")[C-2])}var w=n[1],l=Math.round(E*((w-z)/t));F.drawRect(0,Math.round(A*0.3),l-1,Math.round(A*0.4)-1,p.get("performanceColor"),p.get("performanceColor"));var u=n[0],s=Math.round(E*((u-z)/t)-(p.get("targetWidth")/2)),o=Math.round(A*0.1),D=A-(o*2);F.drawRect(s,o,p.get("targetWidth")-1,D-1,p.get("targetColor"),p.get("targetColor"))}else{this.innerHTML=""}};g.fn.sparkline.pie=function(x,z,o,y){x=g.map(x,Number);o=z.get("width")=="auto"?y:o;var t=g(this).simpledraw(o,y,z.get("composite"));if(t&&x.length>1){var u=t.pixel_width,l=t.pixel_height,s=Math.floor(Math.min(u,l)/2),v=0,r=0,m=2*Math.PI;for(var q=x.length;q--;){v+=x[q]}if(z.get("offset")){r+=(2*Math.PI)*(z.get("offset")/360)}var w=x.length;for(q=0;q<w;q++){var n=r;var p=r;if(v>0){p=r+(m*(x[q]/v))}t.drawPieSlice(s,s,s,n,p,undefined,z.get("sliceColors")[q%z.get("sliceColors").length]);r=p}}};var i=function(m,n){if(n==2){var l=Math.floor(m.length/2);return m.length%2?m[l]:(m[l]+m[l+1])/2}else{var o=Math.floor(m.length/4);return m.length%2?(m[o*n]+m[o*n+1])/2:m[o*n]}};g.fn.sparkline.box=function(m,o,z,x){m=g.map(m,Number);z=o.get("width")=="auto"?"4.0em":z;var p=o.get("chartRangeMin")===undefined?Math.min.apply(Math,m):o.get("chartRangeMin"),y=o.get("chartRangeMax")===undefined?Math.max.apply(Math,m):o.get("chartRangeMax"),G=g(this).simpledraw(z,x,o.get("composite")),r=m.length,v,E,u,t,s,l,q;if(G&&m.length>1){var D=G.pixel_width,A=G.pixel_height;if(o.get("raw")){if(o.get("showOutliers")&&m.length>5){E=m[0];v=m[1];u=m[2];t=m[3];s=m[4];l=m[5];q=m[6]}else{v=m[0];u=m[1];t=m[2];s=m[3];l=m[4]}}else{m.sort(function(I,H){return I-H});u=i(m,1);t=i(m,2);s=i(m,3);var n=s-u;if(o.get("showOutliers")){v=undefined;l=undefined;for(var B=0;B<r;B++){if(v===undefined&&m[B]>u-(n*o.get("outlierIQR"))){v=m[B]}if(m[B]<s+(n*o.get("outlierIQR"))){l=m[B]}}E=m[0];q=m[r-1]}else{v=m[0];l=m[r-1]}}var F=D/(y-p+1),C=0;if(o.get("showOutliers")){C=Math.ceil(o.get("spotRadius"));D-=2*Math.ceil(o.get("spotRadius"));F=D/(y-p+1);if(E<v){G.drawCircle((E-p)*F+C,A/2,o.get("spotRadius"),o.get("outlierLineColor"),o.get("outlierFillColor"))}if(q>l){G.drawCircle((q-p)*F+C,A/2,o.get("spotRadius"),o.get("outlierLineColor"),o.get("outlierFillColor"))}}G.drawRect(Math.round((u-p)*F+C),Math.round(A*0.1),Math.round((s-u)*F),Math.round(A*0.8),o.get("boxLineColor"),o.get("boxFillColor"));G.drawLine(Math.round((v-p)*F+C),Math.round(A/2),Math.round((u-p)*F+C),Math.round(A/2),o.get("lineColor"));G.drawLine(Math.round((v-p)*F+C),Math.round(A/4),Math.round((v-p)*F+C),Math.round(A-A/4),o.get("whiskerColor"));G.drawLine(Math.round((l-p)*F+C),Math.round(A/2),Math.round((s-p)*F+C),Math.round(A/2),o.get("lineColor"));G.drawLine(Math.round((l-p)*F+C),Math.round(A/4),Math.round((l-p)*F+C),Math.round(A-A/4),o.get("whiskerColor"));G.drawLine(Math.round((t-p)*F+C),Math.round(A*0.1),Math.round((t-p)*F+C),Math.round(A*0.9),o.get("medianColor"));if(o.get("target")){var w=Math.ceil(o.get("spotRadius"));G.drawLine(Math.round((o.get("target")-p)*F+C),Math.round((A/2)-w),Math.round((o.get("target")-p)*F+C),Math.round((A/2)+w),o.get("targetColor"));G.drawLine(Math.round((o.get("target")-p)*F+C-w),Math.round(A/2),Math.round((o.get("target")-p)*F+C+w),Math.round(A/2),o.get("targetColor"))}}else{this.innerHTML=""}};if(g.browser.msie&&!document.namespaces.v){document.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML")}if(g.browser.hasCanvas===undefined){var k=document.createElement("canvas");g.browser.hasCanvas=k.getContext!==undefined}j=function(m,l,n){};j.prototype={init:function(m,l,n){this.width=m;this.height=l;this.target=n;if(n[0]){n=n[0]}n.VCanvas=this},drawShape:function(n,m,o,l){alert("drawShape not implemented")},drawLine:function(n,p,m,o,q,l){return this.drawShape([[n,p],[m,o]],q,l)},drawCircle:function(m,p,l,n,o){alert("drawCircle not implemented")},drawPieSlice:function(m,r,l,o,n,p,q){alert("drawPieSlice not implemented")},drawRect:function(m,q,n,l,o,p){alert("drawRect not implemented")},getElement:function(){return this.canvas},_insert:function(l,m){g(m).html(l)}};b=function(m,l,n){return this.init(m,l,n)};b.prototype=g.extend(new j(),{_super:j.prototype,init:function(m,l,n){this._super.init(m,l,n);this.canvas=document.createElement("canvas");if(n[0]){n=n[0]}n.VCanvas=this;g(this.canvas).css({display:"inline-block",width:m,height:l,verticalAlign:"top"});this._insert(this.canvas,n);this.pixel_height=g(this.canvas).height();this.pixel_width=g(this.canvas).width();this.canvas.width=this.pixel_width;this.canvas.height=this.pixel_height;g(this.canvas).css({width:this.pixel_width,height:this.pixel_height})},_getContext:function(n,o,l){var m=this.canvas.getContext("2d");if(n!==undefined){m.strokeStyle=n}m.lineWidth=l===undefined?1:l;if(o!==undefined){m.fillStyle=o}return m},drawShape:function(q,p,r,l){var n=this._getContext(p,r,l);n.beginPath();n.moveTo(q[0][0]+0.5,q[0][1]+0.5);for(var m=1,o=q.length;m<o;m++){n.lineTo(q[m][0]+0.5,q[m][1]+0.5)}if(p!==undefined){n.stroke()}if(r!==undefined){n.fill()}},drawCircle:function(m,q,l,o,p){var n=this._getContext(o,p);n.beginPath();n.arc(m,q,l,0,2*Math.PI,false);if(o!==undefined){n.stroke()}if(p!==undefined){n.fill()}},drawPieSlice:function(m,s,l,p,n,q,r){var o=this._getContext(q,r);o.beginPath();o.moveTo(m,s);o.arc(m,s,l,p,n,false);o.lineTo(m,s);o.closePath();if(q!==undefined){o.stroke()}if(r){o.fill()}},drawRect:function(m,q,n,l,o,p){return this.drawShape([[m,q],[m+n,q],[m+n,q+l],[m,q+l],[m,q]],o,p)}});c=function(m,l,n){return this.init(m,l,n)};c.prototype=g.extend(new j(),{_super:j.prototype,init:function(m,l,o){this._super.init(m,l,o);if(o[0]){o=o[0]}o.VCanvas=this;this.canvas=document.createElement("span");g(this.canvas).css({display:"inline-block",position:"relative",overflow:"hidden",width:m,height:l,margin:"0px",padding:"0px",verticalAlign:"top"});this._insert(this.canvas,o);this.pixel_height=g(this.canvas).height();this.pixel_width=g(this.canvas).width();this.canvas.width=this.pixel_width;this.canvas.height=this.pixel_height;var n='<v:group coordorigin="0 0" coordsize="'+this.pixel_width+" "+this.pixel_height+'" style="position:absolute;top:0;left:0;width:'+this.pixel_width+"px;height="+this.pixel_height+'px;"></v:group>';this.canvas.insertAdjacentHTML("beforeEnd",n);this.group=g(this.canvas).children()[0]},drawShape:function(w,r,l,o){var s=[];for(var n=0,m=w.length;n<m;n++){s[n]=""+(w[n][0])+","+(w[n][1])}var q=s.splice(0,1);o=o===undefined?1:o;var v=r===undefined?' stroked="false" ':' strokeWeight="'+o+'" strokeColor="'+r+'" ';var u=l===undefined?' filled="false"':' fillColor="'+l+'" filled="true" ';var p=s[0]==s[s.length-1]?"x ":"";var t='<v:shape coordorigin="0 0" coordsize="'+this.pixel_width+" "+this.pixel_height+'" '+v+u+' style="position:absolute;left:0px;top:0px;height:'+this.pixel_height+"px;width:"+this.pixel_width+'px;padding:0px;margin:0px;"  path="m '+q+" l "+s.join(", ")+" "+p+'e"> </v:shape>';this.group.insertAdjacentHTML("beforeEnd",t)},drawCircle:function(m,s,l,q,r){m-=l+1;s-=l+1;var p=q===undefined?' stroked="false" ':' strokeWeight="1" strokeColor="'+q+'" ';var o=r===undefined?' filled="false"':' fillColor="'+r+'" filled="true" ';var n="<v:oval "+p+o+' style="position:absolute;top:'+s+"px; left:"+m+"px; width:"+(l*2)+"px; height:"+(l*2)+'px"></v:oval>';this.group.insertAdjacentHTML("beforeEnd",n)},drawPieSlice:function(w,u,r,s,o,v,n){if(s==o){return}if((o-s)==(2*Math.PI)){s=0;o=(2*Math.PI)}var m=w+Math.round(Math.cos(s)*r);var l=u+Math.round(Math.sin(s)*r);var q=w+Math.round(Math.cos(o)*r);var p=u+Math.round(Math.sin(o)*r);if(m==q&&l==p&&(o-s)<Math.PI){return}var t=[w-r,u-r,w+r,u+r,m,l,q,p];var B=v===undefined?' stroked="false" ':' strokeWeight="1" strokeColor="'+v+'" ';var A=n===undefined?' filled="false"':' fillColor="'+n+'" filled="true" ';var z='<v:shape coordorigin="0 0" coordsize="'+this.pixel_width+" "+this.pixel_height+'" '+B+A+' style="position:absolute;left:0px;top:0px;height:'+this.pixel_height+"px;width:"+this.pixel_width+'px;padding:0px;margin:0px;"  path="m '+w+","+u+" wa "+t.join(", ")+' x e"> </v:shape>';this.group.insertAdjacentHTML("beforeEnd",z)},drawRect:function(m,q,n,l,o,p){return this.drawShape([[m,q],[m,q+l],[m+n,q+l],[m+n,q],[m,q]],o,p)}})})(hotelicopter.$);(function(a){a.maxZIndex=function(b){return Math.max(0,Math.max.apply(null,a.map(((b||"*")==="*")?a.makeArray(document.getElementsByTagName("*")):a(b),function(c){return parseFloat(a(c).css("z-index"))||null})))};a.fn.maxZIndex=function(b){if(this.length===0){return this}b=a.extend({increment:10},b);var e=a.maxZIndex(b.selector),c=b.increment;return this.each(function(){this.style.zIndex=(e+=c)})}})(window.hotelicopter.$);(function($){$.toJSON=function(o){if(typeof(JSON)=="object"&&JSON.stringify){return JSON.stringify(o)}var type=typeof(o);if(o===null){return"null"}if(type=="undefined"){return undefined}if(type=="number"||type=="boolean"){return o+""}if(type=="string"){return $.quoteString(o)}if(type=="object"){if(typeof o.toJSON=="function"){return $.toJSON(o.toJSON())}if(o.constructor===Date){var month=o.getUTCMonth()+1;if(month<10){month="0"+month}var day=o.getUTCDate();if(day<10){day="0"+day}var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10){hours="0"+hours}var minutes=o.getUTCMinutes();if(minutes<10){minutes="0"+minutes}var seconds=o.getUTCSeconds();if(seconds<10){seconds="0"+seconds}var milli=o.getUTCMilliseconds();if(milli<100){milli="0"+milli}if(milli<10){milli="0"+milli}return'"'+year+"-"+month+"-"+day+"T"+hours+":"+minutes+":"+seconds+"."+milli+'Z"'}if(o.constructor===Array){var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i])||"null")}return"["+ret.join(",")+"]"}var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number"){name='"'+k+'"'}else{if(type=="string"){name=$.quoteString(k)}else{continue}}if(typeof o[k]=="function"){continue}var val=$.toJSON(o[k]);pairs.push(name+":"+val)}return"{"+pairs.join(", ")+"}"}};$.evalJSON=function(src){if(typeof(JSON)=="object"&&JSON.parse){return JSON.parse(src)}return eval("("+src+")")};$.secureEvalJSON=function(src){if(typeof(JSON)=="object"&&JSON.parse){return JSON.parse(src)}var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,"@");filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(filtered)){return eval("("+src+")")}else{throw new SyntaxError("Error parsing JSON, source is not valid.")}};$.quoteString=function(string){if(string.match(_escapeable)){return'"'+string.replace(_escapeable,function(a){var c=_meta[a];if(typeof c==="string"){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+string+'"'};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}})(window.hotelicopter.$);(function(Z,ac){function aa(){}function I(a){ab=[a]}function R(a){Y.insertBefore(a,Y.firstChild)}function S(a,c,b){return a&&a.apply(c.context||c,b)}function T(a){return/\?/.test(a)?"&":"?"}var Q="async",J="charset",M="",N="error",K="_jqjsp",F="on",P=F+"click",O=F+N,ad=F+"load",V=F+"readystatechange",C="removeChild",X="<script/>",G="success",D="timeout",E=Z.browser,Y=Z("head")[0]||document.documentElement,H={},U=0,ab,W={callback:K,url:location.href};function L(b){b=Z.extend({},W,b);var e=b.complete,q=b.dataFilter,i=b.callbackParameter,c=b.callback,o=b.cache,l=b.pageCache,m=b.charset,a=b.url,j=b.data,f=b.timeout,g,k=0,n=aa;b.abort=function(){!k++&&n()};if(S(b.beforeSend,b,[b])===false||k){return b}a=a||M;j=j?((typeof j)=="string"?j:Z.param(j,b.traditional)):M;a+=j?(T(a)+j):M;i&&(a+=T(a)+encodeURIComponent(i)+"=?");!o&&!l&&(a+=T(a)+"_"+(new Date()).getTime()+"=");a=a.replace(/=\?(&|$)/,"="+c+"$1");function h(r){!k++&&ac(function(){n();l&&(H[a]={s:[r]});q&&(r=q.apply(b,[r]));S(b.success,b,[r,G]);S(e,b,[b,G])},0)}function p(r){!k++&&ac(function(){n();l&&r!=D&&(H[a]=r);S(b.error,b,[b,r]);S(e,b,[b,r])},0)}l&&(g=H[a])?(g.s?h(g.s[0]):p(g)):ac(function(t,u,s){if(!k){s=f>0&&ac(function(){p(D)},f);n=function(){s&&clearTimeout(s);t[V]=t[P]=t[ad]=t[O]=null;Y[C](t);u&&Y[C](u)};window[c]=I;t=Z(X)[0];t.id=K+U++;if(m){t[J]=m}function r(v){(t[P]||aa)();v=ab;ab=undefined;v?h(v[0]):p(N)}if(E.msie){t.event=P;t.htmlFor=t.id;t[V]=function(){/loaded|complete/.test(t.readyState)&&r()}}else{t[O]=t[ad]=r;E.opera?((u=Z(X)[0]).text="jQuery('#"+t.id+"')[0]."+O+"()"):t[Q]=Q}t.src=a;R(t);u&&R(u)}},0);return b}L.setup=function(a){Z.extend(W,a)};Z.jsonp=L})(window.hotelicopter.$,setTimeout);(function(a){a.chunk=function(f,h){for(var b,g=0,k=-1,e=f.length,j=[];g<e;g++){(b=g%h)?j[k][b]=f[g]:j[++k]=[f[g]]}return j}})(window.hotelicopter.$);(function(a){a.sortBy=function(c,b,e){b=(b)?-1:1;return function(g,f){g=g[c];f=f[c];if(typeof(e)!="undefined"){g=e(g);f=e(f)}if(g<f){return b*-1}if(g>f){return b*1}return 0}}})(window.hotelicopter.$);(function(a){a.colorChange=function(c,f,j){var h=function(l,k){var m="0";l=l+"";while(l.length<k){l=m+l}return l};c=c.replace(/^\s*|\s*$/,"");c=c.replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");var i=Math.round(f*256)*(j?-1:1),e=c.match(new RegExp("^rgba?\\(\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])(?:\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$","i")),g=!!e&&e[4]!=null?e[4]:null,b=!!e?[e[1],e[2],e[3]]:c.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,function(){return parseInt(arguments[1],16)+","+parseInt(arguments[2],16)+","+parseInt(arguments[3],16)}).split(/,/);return !!e?"rgb"+(g!==null?"a":"")+"("+Math[j?"max":"min"](parseInt(b[0],10)+i,j?0:255)+", "+Math[j?"max":"min"](parseInt(b[1],10)+i,j?0:255)+", "+Math[j?"max":"min"](parseInt(b[2],10)+i,j?0:255)+(g!==null?", "+g:"")+")":["#",h(Math[j?"max":"min"](parseInt(b[0],10)+i,j?0:255).toString(16),2),h(Math[j?"max":"min"](parseInt(b[1],10)+i,j?0:255).toString(16),2),h(Math[j?"max":"min"](parseInt(b[2],10)+i,j?0:255).toString(16),2)].join("")}})(window.hotelicopter.$);(function(a){a.clearSelection=function(){var b;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){b=window.getSelection();if(b&&b.removeAllRanges){b.removeAllRanges()}}}}})(window.hotelicopter.$);(function(a){a.toQueryParams=function(e,h){var g=e.substring(e.indexOf("?")+1).split("#")[0].split(h||"&"),k={},c,b,f,j;for(c=0;c<g.length;c++){j=g[c].split("=");b=decodeURIComponent(j[0]);f=(j[1])?decodeURIComponent(j[1]):undefined;if(k[b]){if(typeof k[b]=="string"){k[b]=[k[b]]}k[b].push(f)}else{k[b]=f}}return k}})(hotelicopter.$);(function(a){a.escapeHTML=function(b){b=b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");return b}})(hotelicopter.$);(function(a){a.truncate=function(c,e,b){e=e||30;b=(!b)?"...":b;c=(c.length>e)?a.trim(c.slice(0,e-b.length))+((b=="...")?"&hellip;":b):c;return c}})(hotelicopter.$);(function(a){a.hyphenBreak=function(b){return b.replace(/\-/g,"-&#8203;")}})(hotelicopter.$);(function(a){a.stripTags=function(b){return b.replace(/<\/?[^>]+>/gi,"")}})(hotelicopter.$);(function(a){a.startsWith=function(c,b){return b.indexOf(c)===0}})(hotelicopter.$);(function(a){a.unescapeHTML=function(b){a.stripTags(b.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">"));return b}})(hotelicopter.$);(function(a){a.capitalize=function(b){return b.charAt(0).toUpperCase()+b.substring(1).toLowerCase()}})(hotelicopter.$);(function(a){a.properCase=function(b){return b.replace(/\w\S*/g,function(c){return c.charAt(0).toUpperCase()+c.substr(1).toLowerCase()})}})(hotelicopter.$);(function(j,o,r){var q="hashchange",l=document,n,m=j.event.special,k=l.documentMode,p="on"+q in o&&(k===r||k>7);function s(a){a=a||location.href;return"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}j.fn[q]=function(a){return a?this.bind(q,a):this.trigger(q)};j.fn[q].delay=50;m[q]=j.extend(m[q],{setup:function(){if(p){return false}j(n.start)},teardown:function(){if(p){return false}j(n.stop)}});n=(function(){var e={},f,a=s(),c=function(i){return i},b=c,g=c;e.start=function(){f||h()};e.stop=function(){f&&clearTimeout(f);f=r};function h(){var i=s(),t=g(a);if(i!==a){b(a=i,t);j(o).trigger(q)}else{if(t!==a){location.href=location.href.replace(/#.*/,"")+t}}f=setTimeout(h,j.fn[q].delay)}j.browser.msie&&!p&&(function(){var t,i;e.start=function(){if(!t){i=j.fn[q].src;i=i&&i+s();t=j('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){i||b(s());h()}).attr("src",i||"javascript:0").insertAfter("body")[0].contentWindow;l.onpropertychange=function(){try{if(event.propertyName==="title"){t.document.title=l.title}}catch(u){}}}};e.stop=c;g=function(){return s(t.location.href)};b=function(w,z){var x=t.document,y=j.fn[q].domain;if(w!==z){x.title=l.title;x.open();y&&x.write('<script>document.domain="'+y+'"<\/script>');x.close();t.location.hash=w}}})();return e})()})(hotelicopter.$,this);(function(a){a.easing.jswing=a.easing.swing;a.extend(a.easing,{def:"easeOutQuad",swing:function(f,g,e,i,h){return a.easing[a.easing.def](f,g,e,i,h)},easeInQuad:function(f,g,e,i,h){return i*(g/=h)*g+e},easeOutQuad:function(f,g,e,i,h){return -i*(g/=h)*(g-2)+e},easeInOutQuad:function(f,g,e,i,h){if((g/=h/2)<1){return i/2*g*g+e}return -i/2*((--g)*(g-2)-1)+e},easeInCubic:function(f,g,e,i,h){return i*(g/=h)*g*g+e},easeOutCubic:function(f,g,e,i,h){return i*((g=g/h-1)*g*g+1)+e},easeInOutCubic:function(f,g,e,i,h){if((g/=h/2)<1){return i/2*g*g*g+e}return i/2*((g-=2)*g*g+2)+e},easeInQuart:function(f,g,e,i,h){return i*(g/=h)*g*g*g+e},easeOutQuart:function(f,g,e,i,h){return -i*((g=g/h-1)*g*g*g-1)+e},easeInOutQuart:function(f,g,e,i,h){if((g/=h/2)<1){return i/2*g*g*g*g+e}return -i/2*((g-=2)*g*g*g-2)+e},easeInQuint:function(f,g,e,i,h){return i*(g/=h)*g*g*g*g+e},easeOutQuint:function(f,g,e,i,h){return i*((g=g/h-1)*g*g*g*g+1)+e},easeInOutQuint:function(f,g,e,i,h){if((g/=h/2)<1){return i/2*g*g*g*g*g+e}return i/2*((g-=2)*g*g*g*g+2)+e},easeInSine:function(f,g,e,i,h){return -i*Math.cos(g/h*(Math.PI/2))+i+e},easeOutSine:function(f,g,e,i,h){return i*Math.sin(g/h*(Math.PI/2))+e},easeInOutSine:function(f,g,e,i,h){return -i/2*(Math.cos(Math.PI*g/h)-1)+e},easeInExpo:function(f,g,e,i,h){return(g==0)?e:i*Math.pow(2,10*(g/h-1))+e},easeOutExpo:function(f,g,e,i,h){return(g==h)?e+i:i*(-Math.pow(2,-10*g/h)+1)+e},easeInOutExpo:function(f,g,e,i,h){if(g==0){return e}if(g==h){return e+i}if((g/=h/2)<1){return i/2*Math.pow(2,10*(g-1))+e}return i/2*(-Math.pow(2,-10*--g)+2)+e},easeInCirc:function(f,g,e,i,h){return -i*(Math.sqrt(1-(g/=h)*g)-1)+e},easeOutCirc:function(f,g,e,i,h){return i*Math.sqrt(1-(g=g/h-1)*g)+e},easeInOutCirc:function(f,g,e,i,h){if((g/=h/2)<1){return -i/2*(Math.sqrt(1-g*g)-1)+e}return i/2*(Math.sqrt(1-(g-=2)*g)+1)+e},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(f,g,e,j,i,h){if(h==undefined){h=1.70158}return j*(g/=i)*g*((h+1)*g-h)+e},easeOutBack:function(f,g,e,j,i,h){if(h==undefined){h=1.70158}return j*((g=g/i-1)*g*((h+1)*g+h)+1)+e},easeInOutBack:function(f,g,e,j,i,h){if(h==undefined){h=1.70158}if((g/=i/2)<1){return j/2*(g*g*(((h*=(1.525))+1)*g-h))+e}return j/2*((g-=2)*g*(((h*=(1.525))+1)*g+h)+2)+e},easeInBounce:function(f,g,e,i,h){return i-a.easing.easeOutBounce(f,h-g,0,i,h)+e},easeOutBounce:function(f,g,e,i,h){if((g/=h)<(1/2.75)){return i*(7.5625*g*g)+e}else{if(g<(2/2.75)){return i*(7.5625*(g-=(1.5/2.75))*g+0.75)+e}else{if(g<(2.5/2.75)){return i*(7.5625*(g-=(2.25/2.75))*g+0.9375)+e}else{return i*(7.5625*(g-=(2.625/2.75))*g+0.984375)+e}}}},easeInOutBounce:function(f,g,e,i,h){if(g<h/2){return a.easing.easeInBounce(f,g*2,0,i,h)*0.5+e}return a.easing.easeOutBounce(f,g*2-h,0,i,h)*0.5+i*0.5+e}})})(window.hotelicopter.$);(function(a){a.fn.quicksand=function(f,b){var e={duration:750,easing:"swing",attribute:"data-id",adjustHeight:"auto",useScaling:true,enhancement:function(g){},selector:"> *",dx:0,dy:0};a.extend(e,b);if(a.browser.msie||(typeof(a.fn.scale)=="undefined")){e.useScaling=false}var c;if(typeof(arguments[1])=="function"){var c=arguments[1]}else{if(typeof(arguments[2]=="function")){var c=arguments[2]}}return this.each(function(u){var z;var x=[];var j=a(f).clone();var y=a(this);var h=a(this).css("height");var o;var k=false;var l=a(y).offset();var m=[];var w=a(this).find(e.selector);if(a.browser.msie&&a.browser.version.substr(0,1)<7){y.html("").append(j);return}var n=0;var r=function(){if(!n){n=1;$toDelete=y.find("> *");y.prepend(s.find("> *"));$toDelete.remove();if(k){y.css("height",o)}e.enhancement(y);if(typeof c=="function"){c.call(this)}}};var v=y.offsetParent();var t=v.offset();if(v.css("position")=="relative"){if(v.get(0).nodeName.toLowerCase()=="body"){}else{t.top+=(parseFloat(v.css("border-top-width"))||0);t.left+=(parseFloat(v.css("border-left-width"))||0)}}else{t.top-=(parseFloat(v.css("border-top-width"))||0);t.left-=(parseFloat(v.css("border-left-width"))||0);t.top-=(parseFloat(v.css("margin-top"))||0);t.left-=(parseFloat(v.css("margin-left"))||0)}if(isNaN(t.left)){t.left=0}if(isNaN(t.top)){t.top=0}t.left-=e.dx;t.top-=e.dy;y.css("height",a(this).height());w.each(function(A){m[A]=a(this).offset()});a(this).stop();var q=0;var p=0;w.each(function(A){a(this).stop();var B=a(this).get(0);if(B.style.position=="absolute"){q=-e.dx;p=-e.dy}else{q=e.dx;p=e.dy}B.style.position="absolute";B.style.margin="0";B.style.top=(m[A].top-parseFloat(B.style.marginTop)-t.top+p)+"px";B.style.left=(m[A].left-parseFloat(B.style.marginLeft)-t.left+q)+"px"});var s=a(y).clone();var g=s.get(0);g.innerHTML="";g.setAttribute("id","");g.style.height="auto";g.style.width=y.width()+"px";s.append(j);s.insertBefore(y);s.css("opacity",0);g.style.zIndex=-1;g.style.margin="0";g.style.position="absolute";g.style.top=l.top-t.top+"px";g.style.left=l.left-t.left+"px";if(e.adjustHeight==="dynamic"){y.animate({height:s.height()},e.duration,e.easing)}else{if(e.adjustHeight==="auto"){o=s.height();if(parseFloat(h)<parseFloat(o)){y.css("height",o)}else{k=true}}}w.each(function(A){var B=[];if(typeof(e.attribute)=="function"){z=e.attribute(a(this));j.each(function(){if(e.attribute(this)==z){B=a(this);return false}})}else{B=j.filter("["+e.attribute+"="+a(this).attr(e.attribute)+"]")}if(B.length){if(!e.useScaling){x.push({element:a(this),animation:{top:B.offset().top-t.top,left:B.offset().left-t.left,opacity:1}})}else{x.push({element:a(this),animation:{top:B.offset().top-t.top,left:B.offset().left-t.left,opacity:1,scale:"1.0"}})}}else{if(!e.useScaling){x.push({element:a(this),animation:{opacity:"0.0"}})}else{x.push({element:a(this),animation:{opacity:"0.0",scale:"0.0"}})}}});j.each(function(C){var B=[];var E=[];if(typeof(e.attribute)=="function"){z=e.attribute(a(this));w.each(function(){if(e.attribute(this)==z){B=a(this);return false}});j.each(function(){if(e.attribute(this)==z){E=a(this);return false}})}else{B=w.filter("["+e.attribute+"="+a(this).attr(e.attribute)+"]");E=j.filter("["+e.attribute+"="+a(this).attr(e.attribute)+"]")}var D;if(B.length===0){if(!e.useScaling){D={opacity:"1.0"}}else{D={opacity:"1.0",scale:"1.0"}}d=E.clone();var A=d.get(0);A.style.position="absolute";A.style.margin="0";A.style.top=E.offset().top-t.top+"px";A.style.left=E.offset().left-t.left+"px";d.css("opacity",0);if(e.useScaling){d.css("transform","scale(0.0)")}d.appendTo(y);x.push({element:a(d),animation:D})}});s.remove();e.enhancement(y);for(u=0;u<x.length;u++){x[u].element.animate(x[u].animation,e.duration,e.easing,r)}})}})(hotelicopter.$);(function(c){var a={direction:function(e){return(e<0?-1:1)},degrees:function(e){return(Math.floor(Math.abs(e)))%360},scale:function(e){return(1-(e%180)/90)*(e>=180?-1:1)}};c.fx.step.rotate3Di=function(e){direction=a.direction(e.now);degrees=a.degrees(e.now);scale=a.scale(degrees);if(e.options&&typeof e.options.sideChange!="undefined"){if(e.options.sideChange){var f=c(e.elem).data("rotate3Di.prevScale");if(scale*f<=0){e.options.sideChange.call(e.elem,(scale>0||f<0));c(e.elem).data("rotate3Di.prevScale",c(e.elem).data("rotate3Di.prevScale")*-1)}}scale=Math.abs(scale)}c(e.elem).data("rotate3Di.degrees",direction*degrees);c(e.elem).css("transform","skew(0deg, "+direction*degrees+"deg) scale("+scale+", 1)")};var b=c.fx.prototype.cur;c.fx.prototype.cur=function(){if(this.prop=="rotate3Di"){var f=c(this.elem).css("transform");if(f){var e=f.match(/, (-?[0-9]+)deg\)/);if(e&&e[1]){return parseInt(e[1])}else{return 0}}}return b.apply(this,arguments)};c.fn.rotate3Di=function(i,g,e){if(typeof g=="undefined"){g=0}if(typeof e=="object"){c.extend(e,{duration:g})}else{e={duration:g}}if(i=="toggle"){if(c(this).data("rotate3Di.flipped")){i="unflip"}else{i="flip"}}if(i=="flip"){c(this).data("rotate3Di.flipped",true);var f=-1;if(typeof e=="object"&&e.direction&&e.direction=="clockwise"){f=1}i=f*180}else{if(i=="unflip"){c(this).data("rotate3Di.flipped",false);i=0}}var h=c(this).data("rotate3Di.degrees")||0;c(this).data("rotate3Di.prevScale",a.scale(a.degrees(h)));c(this).animate({rotate3Di:i},e)}})(hotelicopter.$);(function(b){function e(g){var f=["transform","WebkitTransform","msTransform","MozTransform","OTransform"];var h;while(h=f.shift()){if(typeof g.style[h]!="undefined"){return h}}return"transform"}var c=null;var a=b.fn.css;b.fn.css=function(f,g){if(c===null){if(typeof b.cssProps!="undefined"){c=b.cssProps}else{if(typeof b.props!="undefined"){c=b.props}else{c={}}}}if(typeof c.transform=="undefined"&&(f=="transform"||(typeof f=="object"&&typeof f.transform!="undefined"))){c.transform=e(this.get(0))}if(c.transform!="transform"){if(f=="transform"){f=c.transform;if(typeof g=="undefined"&&b.style){return b.style(this.get(0),f)}}else{if(typeof f=="object"&&typeof f.transform!="undefined"){f[c.transform]=f.transform;delete f.transform}}}return a.apply(this,arguments)}})(hotelicopter.$);(function(a){a.cookie=function(c,l,o){if(typeof l!="undefined"){o=o||{};if(l===null){l="";o.expires=-1}var g="";if(o.expires&&(typeof o.expires=="number"||o.expires.toUTCString)){var h;if(typeof o.expires=="number"){h=new Date();h.setTime(h.getTime()+(o.expires*24*60*60*1000))}else{h=o.expires}g="; expires="+h.toUTCString()}var n=o.path?"; path="+(o.path):"";var j=o.domain?"; domain="+(o.domain):"";var b=o.secure?"; secure":"";document.cookie=[c,"=",encodeURIComponent(l),g,n,j,b].join("")}else{var f=null;if(document.cookie&&document.cookie!=""){var m=document.cookie.split(";");for(var k=0;k<m.length;k++){var e=a.trim(m[k]);if(e.substring(0,c.length+1)==(c+"=")){f=decodeURIComponent(e.substring(c.length+1));break}}}return f}}})(window.hotelicopter.$);
/* Copyright (c) 2008 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 */
(function(b){var a=0;b.getScrollbarWidth=function(){if(!a){if(b.browser.msie){var f=b('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1000,left:-1000}).appendTo("body"),e=b('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1000,left:-1000}).appendTo("body");a=f.width()-e.width();f.add(e).remove()}else{var c=b("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1000,left:-1000}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200});a=100-c.width();c.parent().remove()}}return a}})(window.hotelicopter.$);(function(c,e){var b=c.Autofill=function(g){var f=this;e.each(g,function(h,i){f[h]=i})},a=b.prototype;b.query=function(j,h){var f=this,g={data:e.extend({query:j},(h||{}))},i=["success","error"];g.success=function(k){k=new f(k);h.success(k);c.trigger("autofill",k)};g.error=function(k){if(h.error){h.error(k)}};e.each(i,function(k,l){delete g.data[l]});c.request.api("autofill",g)};a.getHotelPhoto=function(i,g,f){var h=null;e.each(i.primaryPhoto.sizes,function(k,j){if(j.width==g&&j.height==f){h=j.url;return false}});return h};a.getHotelAddress=function(k,i){var f="",g=["line1","line2","city","region","country"],j=["city","country"],h=[];if(k.address.country=="United States"||k.address.country=="Canada"){j=["city","region","country"]}h=(i)?j:g;e.each(h,function(m,l){var n=k.address[l];if(n&&n.length>0){if(f.length>0){f+=", "}f+=n}});return f}})(hotelicopter,hotelicopter.$);(function(c,f,e){var b=c.Location=function(h){var g=this;f.each(h,function(i,j){g[i]=j})},a=b.prototype;b.findByLocationId=function(g,h){if(!g){c.throwException("A locationId argument was not supplied.")}h.locationId=g;this._request(h)};b.findByLocationIdWithRadius=function(h,g,i){if(!g){c.throwException("A radius argument was not supplied.")}i.radius=c.convertToKm(g);this.findByLocationId(h,i)};b.findByLocationName=function(g,h){if(!g){c.throwException("A locationName argument was not supplied.")}if(e.isString(g)){h.locationName=g}else{if(!g.city&&!g.country){c.throwException("Either a city or country was not supplied.")}h.city=g.city;h.country=g.country;if(g.state){h.state=g.state}}this._request(h)};b.findByLocationNameWithRadius=function(h,g,i){if(!g){c.throwException("A radius argument was not supplied.")}i.radius=c.convertToKm(g);this.findByLocationName(h,i)};b.findByGeo=function(i,g,h){this.findByGeoWithMinHotels(i,g,20,h)};b.findByGeoWithRadius=function(j,h,g,i){if(!j){c.throwException("A latitude argument was not supplied.")}if(!h){c.throwException("A longitude argument was not supplied.")}if(!g){c.throwException("A radius argument was not supplied.")}i.lat=j;i.lng=h;i.radius=c.convertToKm(g);this._request(i)};b.findByGeoWithMinHotels=function(j,g,i,h){if(!j){c.throwException("A latitude argument was not supplied.")}if(!g){c.throwException("A longitude argument was not supplied.")}if(!i){c.throwException("A minHotels argument was not supplied.")}h.lat=j;h.lng=g;h.minHotels=i;this._request(h)};b._request=function(i){var g=this,h={data:f.extend({},i)},j=["success","error"];f.each(j,function(k,l){delete h.data[l]});h.success=function(l){var k=new g(l);c.currentLocation=k;if(i.success){i.success(k)}c.trigger("locationFound",k)};c.request.api("sets",h)};a.specifiedBrands=function(g,i){var h=[],j;if(!g){c.throwException('A "brandIds" array was not supplied.')}if(!i){c.throwException('A "count" argument was not supplied.')}f.each(this.brands,function(k,l){if(f.inArray(l.id,g)>=0){h.push(l)}});if(h.length<i){j=this._selectedBrandsGroups(i,"brands",true);f.each(j,function(k,l){if(f.inArray(l.id,g)<0){h.push(l)}if(h.length==i){return false}})}h.sort(f.sortBy("name",false,function(k){return k.toUpperCase()}));return h};a.selectedBrands=function(g){return this._selectedBrandsGroups(g,"brands")};a.selectedGroups=function(g){return this._selectedBrandsGroups(g,"groups")};a.getBrandById=function(h){var g=null;f.each(this.brands,function(j,k){if(h==k.id){g=k;return false}});return g};a._selectedBrandsGroups=function(i,h,j){var g=null;if(this[h]){g=[].concat(this[h]);if(!i){c.throwException('A "count" argument was not supplied.')}g.sort(f.sortBy("hotelCount",true));g=g.slice(0,i);if(!j){g.sort(f.sortBy("name",false,function(k){return k.toUpperCase()}))}}return g}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,f,e){var b=c.Hotel=function(h){var g=this;f.each(h,function(i,j){g[i]=j})},a=b.prototype;b.findByUdicode=function(h,g){if(!h){c.throwException("A udicode argument was not supplied.")}g.udicode=h;this._request(g)};b.findByHotelName=function(g,h){if(!g){c.throwException("A hotelName argument was not supplied.")}h.hotelName=g;this._request(h)};b.findByLocationId=function(g,h){if(!g){c.throwException("A locationId argument was not supplied.")}h.locationId=g;this._request(h)};b.findByLocationIdWithRadius=function(h,g,i){if(!g){c.throwException("A radius argument was not supplied.")}i.radius=c.convertToKm(g);this.findByLocationId(h,i)};b.findByLocationName=function(g,h){if(!g){c.throwException("A locationName argument was not supplied.")}if(e.isString(g)){h.locationName=g}else{if(!g.city&&!g.country){c.throwException("Either a city or country was not supplied.")}h.city=g.city;h.country=g.country;if(g.state){h.state=g.state}}this._request(h)};b.findByLocationNameWithRadius=function(h,g,i){if(!g){c.throwException("A radius argument was not supplied.")}i.radius=c.convertToKm(g);this.findByLocationName(h,i)};b.findByGeo=function(i,g,h){this.findByGeoWithMinHotels(i,g,20,h)};b.findByGeoWithRadius=function(j,h,g,i){if(!j){c.throwException("A latitude argument was not supplied.")}if(!h){c.throwException("A longitude argument was not supplied.")}if(!g){c.throwException("A radius argument was not supplied.")}i.lat=j;i.lng=h;i.radius=c.convertToKm(g);this._request(i)};b.findByGeoWithMinHotels=function(j,g,i,h){if(!j){c.throwException("A latitude argument was not supplied.")}if(!g){c.throwException("A longitude argument was not supplied.")}if(!i){c.throwException("A minHotels argument was not supplied.")}h.lat=j;h.lng=g;h.minHotels=i;this._request(h)};b._request=function(h){var g=this,i;if(h.stay&&h.stay.checkIn&&h.stay.checkOut){g._ratesRequest(h)}else{if(h.success){i=f.extend({},h);i.success=function(j){c.trigger("hotelsFound",{hotels:j,lastPoll:true});h.success(j)}}g._staticRequest(i)}};b._ratesRequest=function(h){var g=this,i=f.extend({},h);delete i.stay;delete i.onlySpecifiedAmenities;delete i.onlyPrimaryPhoto;delete i.fields;delete i.rateFields;if(h.rateFields){i.fields=h.rateFields}f.each(["success","update"],function(j,k){if(h[k]){i[k]=g._buildRatesCallback(k,h)}});c.Rate.find(h.stay,i)};b._buildRatesCallback=function(i,h){var g=this;return function(l,m,n){var k=f.extend({},h),j=[];if(l.length>0){f.each(l,function(o,q){var p=g._buildCacheKey(q.udicode,h.fields);if(!c.cache.get(p)){j.push(q.udicode)}});k.udicode=j;k.success=function(q){var o=[],p={};f.each(q,function(r,s){p[s.udicode]=s});f.each(l,function(r,u){var t=g._buildCacheKey(u.udicode,h.fields),s=(p[u.udicode]||new g(c.cache.get(t)));s.availableRates=u||null;o.push(s);c.cache.add(t,s,1440)});h[i](o,n);c.trigger("hotelsFound",{hotels:o,lastPoll:(n||false)})};if(j.length===0){k.success([])}else{g._staticRequest(k)}}else{if(n&&k.update){k.update([],n)}}}};b._staticRequest=function(h){var g=this,j={data:f.extend({},h)},i=["success","error","update"];f.each(i,function(k,l){delete j.data[l]});delete j.data.stay;delete j.data.rateFields;delete j.data.onlyLowest;delete j.data.searchKey;j.success=function(l){var k=[];f.each(l,function(m,n){k.push(new g(n))});if(h.success){h.success(k)}};j.error=function(k){if(h.error){h.error(k)}};c.request.api("sets/hotels",j)};b._buildCacheKey=function(h,g){return(g)?("h::"+h+"::"+g):("h::"+h)};b.getImageSizeWithDimensions=function(j,i,g){var h=null;if(j.sizes){f.each(j.sizes,function(k,l){if(l.width==i&&l.height==g){h=l;return false}})}return h};b.maxImageSize=function(i,g){var h;if(i.sizes){if(g){f.each(i.sizes,function(k,j){if(j.height<=g){h=j}});return h}else{h=i.sizes[i.sizes.length-1];return h}}else{return false}};b.maxSizeForImageCollection=function(h){var k=0,g=0;for(var l=0;l<h.length;l++){var j=h[l];k=((c.Hotel.maxImageSize(j).width||0)>k)?c.Hotel.maxImageSize(j).width:k;g=((c.Hotel.maxImageSize(j).height||0)>g)?c.Hotel.maxImageSize(j).height:g}if(k<250){k=250}if(g<250){g=250}return{width:k,height:g}};a.primaryPhoto=function(j,g){var h=this,i=null;f.each(h.photos,function(l,k){if(k.isPrimary){i=h.photoWithSpecifiedDimensions(k,j,g);return false}});return i};a.photoWithSpecifiedDimensions=function(h,j,g){var i=null;f.each(h.sizes,function(l,k){if(k.width==j&&k.height==g){i={id:h.id,caption:h.caption,width:j,height:g,url:k.url};return false}});return i};a.getAllPhotos=function(g){var h=this,i={data:{}};if(h.photos.length<=1){i.data.udicode=h.udicode;i.data.fields=["photos"];i.success=function(j){var k=j[0].photos;h.photos=k;g(k)};c.request.api("hotels",i)}else{g(h.photos)}};a.bookDirectAdvertiser=function(){var g=this,h;f.each(g.advertisers,function(i,j){if(j.isBookDirect){h=j;return false}});return h};a.advertiserLogo=function(i,j,h,g){if(j&&this.brand){return c.baseUrl+"/themes/"+c.theme+"/img/logos/brand/"+h+"x"+g+"/"+this.brand.id+".png"}else{return c.baseUrl+"/themes/"+c.theme+"/img/logos/advertiser/"+h+"x"+g+"/"+i+".png"}};a.advertiserName=function(h){var g=null,i=this.advertisers[h];if(i){g=(i.isBookDirect)?this.brand.name:i.name}return g}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,f,e){var b=c.Rate=function(h){var g=this;f.each(h,function(i,j){g[i]=j});this.partnerKeyRatesArray=null;this.keyRateObj=null;this.allRates=null},a=b.prototype;b.currentSearches={};b.findByUdicode=function(i,g,h){if(!h){h={}}h.udicode=(e.isArray(i))?i:[i];this.find(g,h)};b.polling=false;b.pollWait=[1000,3000,8000];b.find=function(g,j,i,m){var h=this,n={data:f.extend({},(j||{}))},k=["success","error","update"],l=j.searchKey||"__default__";if(!m||h.currentSearches[m]){b.polling=true;i=(i||0);if(i==0){m=new Date().getTime();h.cancelSearches(l);h.currentSearches[m]=l}if(g&&g.checkIn){g.checkIn=g.checkIn.replace(/\-/g,"");g.checkOut=g.checkOut.replace(/\-/g,"")}f.extend(n.data,g);f.each(k,function(o,p){delete n.data[p]});delete n.data.searchKey;n.success=function(o){var r=[],s={},q,t=(i==(h.pollWait.length)),p;f.each(o,function(u,w){var v=new h(w);r.push(v);s[w.udicode]=v});p=function(){c.trigger("ratesPolled",{hotelsWithRatesArray:r,hotelsWithRatesHash:s,lastPoll:t,stay:g,requestSettings:j,searchKey:l})};if(j.blocking&&j.success&&t){j.success(r,s);c.trigger("ratesFound",{hotelsWithRatesArray:r,hotelsWithRatesHash:s});h.cancelSearches(l);if(e.isEmpty(h.currentSearches)){b.polling=false}}else{if(!j.blocking){if(i==0&&j.success&&r.length>0){j.success(r,s,false,g,j);p()}if(i>0&&j.update&&(r.length>0||t)){if(t){h.cancelSearches(l);if(e.isEmpty(h.currentSearches)){b.polling=false}}j.update(r,s,t,g,j);p()}}}if(i<h.pollWait.length&&(j.update||j.blocking)){window.setTimeout(function(){q=i+1;h.find(g,j,q,m)},h.pollWait[i])}};n.error=function(o){if(j.error){j.error(o)}};n._method="POST";c.request.api("rates",n)}};b.cancelSearches=function(h){var g=this;f.each(this.currentSearches,function(k,j){var i=(h)?false:true;if(h&&j===h){i=true}if(i){delete g.currentSearches[k]}})};a.getKeyRate=function(){var g=this.keyRate;this.keyRateObj=this.keyRateObj||this.extractRate(g[0],g[1],g[2]);return this.keyRateObj};a.getKeyRatePerPartner=function(){var j=this.partnerKeyRates,h=[],g;if(!this.partnerKeyRatesArray){for(g=0;g<j.length;g++){h.push(this.extractRate(j[g][0],j[g][1],j[g][2]))}}else{h=this.partnerKeyRatesArray}return this.partnerKeyRatesArray=h};a.getAllRates=function(){var g=this,h=[];if(this.allRates){h=this.allRates}else{f.each(g.rates,function(i,j){f.each(j,function(k,l){f.each(l,function(m,n){n.advertiserCode=i;n.roomType=k;h.push(n)})})});h.sort(f.sortBy("avNightlyRateEx",false))}return this.allRates=h};a.extractRate=function(j,h,g){var i=this.rates[j][h][g];i.advertiserCode=j;i.roomType=h;return i}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(b,e,c){var a=b.Storage=function(){};a.lsSupported=(window.localStorage)?true:false;a.set=function(g,j,f){var h=new Date().getTime(),i;i={timestamp:h,data:j};if(f){i.expires=h+(f*1000*60*60*24)}if(this.lsSupported){try{localStorage[g]=e.toJSON(i)}catch(k){}}else{b.$.cookie(g,e.toJSON(i),{expires:f,path:"/"})}};a.get=function(f){var g=null;if(this.lsSupported){if(localStorage[f]){g=e.evalJSON(localStorage[f]).data}}else{if(e.cookie(f)){g=e.evalJSON(e.cookie(f)).data}}return g};a.clear=function(f){if(this.lsSupported){delete localStorage[f]}else{e.cookie(f,null)}};a.purge=function(){var f,h=new Date().getTime();for(var g=0;g<localStorage.length;g++){f=e.evalJSON(localStorage[localStorage.key(g)]);if(f.expires){if(h>=f.expires){delete localStorage[localStorage.key(g)]}}}};if(a.lsSupported){a.purge()}})(hotelicopter,hotelicopter.$,hotelicopter._);var _kmq=_kmq||[];(function(b,e,c){var a=b.UserAction=function(){};a.sessionId=null;a.actionCounter=0;a.record=function(g,h,f){if(b.kissmetricsUrl){if(b.preventTrackingUntilInteraction&&this.actionCounter===0){this.initializeKissmetrics()}h=this.buildData(h,f);window._kmq.push(["record",g,h])}};a.redirect=function(j,g,i,f){var h=function(){document.location.href=j};if(b.kissmetricsUrl){i=this.buildData(i,f);i.action_name=g;i._method="POST";b.request.api("events",{data:i,success:function(){h()},error:function(){h()}})}else{h()}};a.buildRedirectUrl=function(j,h,i,g){var f="";i=this.buildData(i,g,true,true);i.action_name=h;e.each(i,function(m,l){if(l&&l.toString().length>0){f+="&"+encodeURIComponent(m)+"="+encodeURIComponent(l)}});return j+f};a.buildData=function(i,f,g,j){var h=this.getImpressionId();if(!j){this.actionCounter++}if(!g){i.api_key=b.apiKey;i.api_version=b.apiVersion}i.visitor_id=this.getVisitorId();i.session_id=this.getSessionId();if(!j){i.action_counter=this.actionCounter}if(h){i.impression_id=h}if(f){i=e.extend(i,this.getState())}return i};a.initializeKissmetrics=function(g,f){if(b.kissmetricsUrl){this.identifyUser();g=g||"//i.kissmetrics.com/i.js";f=f||b.kissmetricsUrl;_kms=function(h){setTimeout(function(){var i=document.createElement("script");var j=document.getElementsByTagName("script")[0];i.type="text/javascript";i.async=true;i.src=h;j.parentNode.insertBefore(i,j)},1)};_kms(g);_kms(f)}};a.identifyUser=function(){window._kmq.push(["identify",this.getVisitorId()])};a.getVisitorId=function(){var f=e.cookie("copter");if(!f){f=this.uuid();e.cookie("copter",f,{expires:30})}return f};a.getSessionId=function(){var f=e.cookie("copter-session");if(!f){f=this.uuid();e.cookie("copter-session",f)}return f};a.uuid=function(){return("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(h){var g=Math.random()*16|0,f=h=="x"?g:(g&3|8);return f.toString(16)}))};a.getImpressionId=function(){var g=null,f=e.cookie("copter-impression-id");if(f){g=e.parseJSON(f)["impression_id"]}return g};a.getState=function(g){var h=b.State.get(),f={};e.each(h,function(j,i){var l=b.request.underscore(j);if(g){l="previous_"+l}f[l]=i});return f}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,e){var b=c.components.HotelCard=function(f){this.placeholder=e(f);this.cardType=(this.placeholder.data("cardType")||"gallery");this.hotel=null;this.isPolling=false;this.pollingComplete=false;this.transformSupport=null},a=b.prototype;b.cssClass="copter-hotelcard";b.initialize=function(){var f=this,h=document.createElement("div"),l=["Moz","Webkit","Khtml","O","ms"],j=h.style,k="transform";f.transformSupport=false;k=k.charAt(0).toUpperCase()+k.slice(1);for(var g=0;g<l.length;g++){if(typeof j[l[g]+k]=="string"){f.transformSupport=true}}e("."+f.cssClass).each(function(m,o){var n=e(o);if(n.is(":empty")){f.createInstance(n.get(0),n.data("udicode"))}})};b.createInstance=function(j,i,g){var f=this,h=e(j),k=null;g=(g||{});if(!h){c.throwException("Attempted to create a HotelCard component but no placeholder argument was supplied.")}if(!i){c.throwException("Attempted to create a HotelCard component but no hotel argument was supplied.")}g.hotel=i;e.each(g,function(m,l){h.data(m,l)});k=new f(j);h.addClass(f.cssClass);k.hotel=i;h.attr("data-udicode",k.getUdicode());k.transformSupport=this.transformSupport;if(typeof i=="string"){k.getHotelData()}else{k.render()}return k};a.getHotelData=function(){var f=this,h=function(i){f.hotel=i[0];f.placeholder.empty();f.render()},g={success:h,onlySpecifiedAmenities:c.amenities,onlyPrimaryPhoto:true,fields:["udicode","amenities","brand","group","propertyType","photoCount","photos","lat","lng","distance","name","historicalRates","stars","advertisers"]};c.Hotel.findByUdicode(f.placeholder.data("udicode"),g)};a.render=function(){var f=this,h=f.placeholder,g=45;h.html(c.getTemplate("hotel-card-"+f.cardType,{hotel:f.hotel,hotelNameUrl:(h.data("hotelNameUrl")||"#"),name:e.hyphenBreak(e.truncate(f.hotel.name,g)),labels:f.getAllText(),rate:c.formatCurrency((f.hotel.historicalRates)?(f.hotel.historicalRates.lowest):f.getText("unknown")),number:(h.data("number")||""),flip:(h.data("flip")||false),photoNavigation:(h.data("photoNavigation")||false),distance:(f.hotel.distance||null),location:this.shortLocation()}));if(f.hotel.name.length>g){h.find(".copter-name a").attr("title",e.escapeHTML(f.hotel.name))}h.data({instance:f});h.addClass("copter-"+f.cardType+"card");f.setSummaryDimensions();f.initPhoto();c.components.HotelRate.createInstance(h.find(".copter-hotelrate"),f.hotel,{excludeFromSearch:f.inHotelCards(),includeRoomDetails:h.data("includeRoomDetails"),directLink:true,includeBrandLogo:h.data("includeBrandLogo"),includeRateTotal:h.data("includeRateTotal"),includeFrom:h.data("includeFrom"),includeOfficialSite:h.data("includeOfficialSite"),bookButtonUrl:h.data("bookButtonUrl"),polled:h.data("polled")});f.assignEventHandlers();if(!!h.data("polled")||(!c.Rate.polling&&f.hotel.availableRates)){f.showLiveOnlyElements()}c.trigger("hotelCardRendered",h)};a.setSummaryDimensions=function(){if(this.cardType=="summary"){var l=this.placeholder,k=l.outerWidth(true)-l.width(),j=l.find(".copter-img").outerWidth(true),m=l.find(".copter-content-wrapper").outerWidth(true)-l.find(".copter-content-wrapper").width(),i=l.find(".copter-content-right").outerWidth(true),g=l.parent().width()-k,h=g-j-m,f=h-i;l.hide();l.width(l.parent().width()-k);l.find("div.copter-content").width(g);l.find("div.copter-content-wrapper").width(h);l.find("div.copter-content-wrapper .copter-content-left").width(f);l.show()}};a.shortLocation=function(){var f=(c.State.get("locationName")||null);if(f){f=f.split(",")[0];if(c.currentLocation&&c.currentLocation.locationId&&c.currentLocation.locationId.length>0){f=this.text.downtown+" "+f}}return f};a.photoDimensions=function(){var f={gallery:{width:200,height:150},summary:{width:100,height:75},map:{width:50,height:50}};return f[this.cardType]};a.initPhoto=function(){var g=this,h=g.placeholder,f=(g.hotel.primaryPhoto(g.photoDimensions().width,g.photoDimensions().height)||{});if(h.find(".copter-carousel img").length==0){var i=h.find(".copter-carousel");if(f.url){this.loadPhoto(i,(g.hotel.udicode+"_img_0"),f.url,f.caption)}}};a.loadPhoto=function(m,h,f,k,l){var n=this,i=this.placeholder.data("noLazyLoad"),g=e('<div class="copter-placeholder copter-img-el" />');m.find(".copter-clear").before(g);var j=e('<img class="copter-img-el" />');if(i){g.append(j);n.placeholder.find(".copter-wrapper").addClass("copter-loaded");j.attr({src:f,alt:k,id:h}).show();if(l){l()}}else{j.load(function(){g.append(j);n.placeholder.find(".copter-wrapper").addClass("copter-loaded");e(this).show();if(l){l()}}).attr({src:f,alt:k,id:h})}};a.assignEventHandlers=function(){var f=this.placeholder;this.assignSearchHandlers();this.assignPhotoEventHandlers();if(f.data("photoNavigation")){this.assignArrowEventHandlers()}this.assignHotelDetailsEventHandlers();this.assignHoverEventHandlers();if(f.data("flip")){this.assignFlipEventHandlers()}this.placeholder.dblclick(function(g){g.stopPropagation();e.clearSelection()})};a.assignSearchHandlers=function(){var f=this,g=this.placeholder;c.bindToElement(g,"searchStart",function(){g.find(".copter-live-only").hide();if(!f.inHotelCards()){f.getHotelData()}});c.bindToElement(g,"ratesPolled",function(h,i){if(!!g.data("polled")||(!c.Rate.polling&&f.hotel.availableRates)){f.showLiveOnlyElements()}})};a.assignPhotoEventHandlers=function(){var f=this,h=this.placeholder,g=h.find(".copter-img");h.find(".copter-img-el").hover(function(i){if(!g.hasClass("copter-imghover")){e(".copter-img").not(g).stop().removeAttr("style").removeClass("copter-imghover");e(".copter-imgprev, .copter-imgnext").not(h.find(".copter-imgprev, .copter-imgnext")).hide();g.stop().removeAttr("style").addClass("copter-imghover",500,c.easing)}},function(i){if(!(e(i.relatedTarget).is(".copter-img-el"))||!f.relatedTargetInSameCard(i)){g.stop().removeAttr("style").removeClass("copter-imghover")}});g.click(function(i){i.preventDefault();i.stopPropagation();if(h.data("imageUrl")){c.UserAction.redirect(h.data("imageUrl"),"i1_hotel_card_image_click",{udicode:f.hotel.udicode})}else{c.UserAction.record("hotel_card_image_click",{udicode:f.hotel.udicode});f.showHotelDetails("overview")}})};a.assignArrowEventHandlers=function(){var f=this,h=f.placeholder.find(".copter-imgprevwrapper, .copter-imgnextwrapper, .copter-imgprev, .copter-imgnext"),g=f.placeholder.find(".copter-carousel");h.hover(function(k){var j=e(k.target).is(".copter-imgprevwrapper, .copter-imgprev"),i=(j)?f.placeholder.find(".copter-imgprev"):f.placeholder.find(".copter-imgnext");if(!i.is(":visible")){if(!(j&&g.position().left==0)){i.stop().removeAttr("style").fadeIn(500,c.easing)}}},function(k){var j=e(k.target).is(".copter-imgprevwrapper, .copter-imgprev"),i=(j)?f.placeholder.find(".copter-imgprev"):f.placeholder.find(".copter-imgnext");i.hide()});h.click(function(k){var j=e(k.target).is(".copter-imgprevwrapper, .copter-imgprev"),i;k.stopPropagation();if(j){g.stop(true,true);if(g.position().left<0){g.animate({left:(g.position().left+f.placeholder.find("div.copter-img .copter-wrapper").width())+"px"},400,c.easing,function(){if(g.position().left===0){i=(j)?f.placeholder.find(".copter-imgprev"):f.placeholder.find(".copter-imgnext");i.hide()}})}}else{f.loadGalleryPhotos(f.placeholder)}})};a.assignFlipEventHandlers=function(){var f=this,g=f.placeholder;if(g.data("flip")){g.find(".copter-compare-link").click(function(m){var j=e(this),h,l,i;m.preventDefault();m.stopPropagation();c.UserAction.record("hotel_card_compare_rates_click",{udicode:f.hotel.udicode});if(f.cardType=="gallery"){if(g.find(".copter-flip-side").length==0){h=e(c.getTemplate("hotel-card-gallery-flip-side",{labels:f.getAllText(),hotel:f.hotel})).insertAfter(g.find(".copter-content"));f.renderRatrix(h);h.find(".copter-flip-name").click(function(n){n.preventDefault();f.showHotelDetails()});h.find(".copter-flip-link a").click(function(n){n.preventDefault();f.flipCard(true)})}f.flipCard(false)}else{i=e(c.getTemplate("hotel-card-ratrix-bubble",{labels:f.getAllText()}));var k=c.components.Bubble.createInstance(i,j,{position:"right",deleteContentsOnClose:true});i.find(".copter-cancel").click(function(n){n.preventDefault();k.close()});f.renderRatrix(i)}})}};a.flipCard=function(l){var g=this,k=g.placeholder,m=k.width(),i=250,h,f,j;if(g.transformSupport){h=function(n){if(n){k.find(".copter-front-side").show();k.find(".copter-flip-side").hide()}else{k.find(".copter-front-side").hide();k.find(".copter-flip-side").show()}};if(!l){k.find(".copter-content").stop().rotate3Di("flip",i,{sideChange:h,easing:c.easing})}else{k.find(".copter-content").stop().rotate3Di("unflip",i,{direction:"clockwise",sideChange:h,easing:c.easing})}}else{if(!l){f=function(){e(this).find(".copter-front-side").hide().css({marginLeft:"0px"});e(this).find(".copter-flip-side").css({marginLeft:"-"+Math.floor(m/2)+"px"}).show().animate({marginLeft:"0px"},i);e(this).animate({width:m+"px",opacity:"1",left:"0px"},i,function(){e(this).unwrap()})};k.wrap('<div style="width:'+m+'px; float:left; overflow:hidden;" />');k.animate({width:"0px",opacity:"0",left:"117px"},i,f);k.find(".copter-front-side").animate({marginLeft:"-"+Math.floor(m/2)+"px"},i)}else{j=function(){e(this).find(".copter-flip-side").hide().css({marginLeft:"0px"});e(this).find(".copter-front-side").css({marginLeft:"-"+Math.floor(m/2)+"px"}).show().animate({marginLeft:"0px"},i);e(this).animate({width:m+"px",opacity:"1",left:"0px"},i,function(){e(this).unwrap()})};k.wrap('<div style="width:'+m+'px; float:left; overflow:hidden;" />');k.animate({width:"0px",opacity:"0",left:Math.floor(m/2)+"px"},i,j);k.find(".copter-flip-side").animate({marginLeft:"-"+Math.floor(m/2)+"px"},i)}}};a.renderRatrix=function(f){var g=this.placeholder;c.components.Ratrix.createInstance(f.find(".copter-ratrix"),this.hotel,{maximum:4,initial:g.data("initialRatrix"),polled:g.data("polled")})};a.assignHotelDetailsEventHandlers=function(){var f=this,j=f.placeholder,g=j.find("a.copter-fulldetails"),i=j.find("a.copter-map-link"),h=j.find("a.copter-all-rooms-rates");g.click(function(k){k.preventDefault();k.stopPropagation();if(j.data("hotelNameUrl")){c.UserAction.redirect(j.data("hotelNameUrl"),"i1_hotel_card_name_click",{udicode:f.hotel.udicode})}else{c.UserAction.record("hotel_card_name_click",{udicode:f.hotel.udicode});f.showHotelDetails()}});i.click(function(k){k.preventDefault();c.UserAction.record("hotel_card_map_link_click",{udicode:f.hotel.udicode});f.showHotelDetails("map")});h.click(function(k){k.preventDefault();c.UserAction.record("hotel_card_all_rooms_rates_click",{udicode:f.hotel.udicode});f.showHotelDetails("rates")})};a.assignHoverEventHandlers=function(){this.placeholder.hover(function(f){c.trigger("hotelCardMouseOver",this)},function(f){c.trigger("hotelCardMouseOut",this)})};a.loadGalleryPhotos=function(){var g=this,h=g.placeholder.find("div.copter-img .copter-carousel"),f=g.placeholder.find("div.copter-img .copter-wrapper").width();h.stop(true,true);if(h.children("div.copter-placeholder").length>1){if((0-h.position().left)<(h.width()-f)){h.animate({left:(h.position().left-f)+"px"},400,c.easing)}else{h.animate({left:"0px"},600,c.easing)}}else{g.hotel.getAllPhotos(function(i){e.each(i,function(k,j){if(k>0){j=g.hotel.photoWithSpecifiedDimensions(j,200,150);if(j){h.width(h.width()+f);g.loadPhoto(h,g.hotel.udicode+"_img_"+k,j.url,j.caption,function(){if(k===1){h.animate({left:(h.position().left-f)+"px"},600,c.easing)}})}}})})}};a.showLiveOnlyElements=function(){var f=this.placeholder;if(c.isDatedSearch()){f.find(".copter-all-rooms-rates").show();if(this.hotel.availableRates&&this.hotel.availableRates.getKeyRatePerPartner().length>1){f.find(".copter-compare-rates").show()}}};a.relatedTargetInSameCard=function(f){return(e(f.relatedTarget).parents('.copter-hotelcard[data-udicode="'+this.placeholder.data("udicode")+'"]').length>0)};a.inHotelCards=function(){return(this.placeholder.parents(".copter-hotelcards").length>0)};a.showHotelDetails=function(f){c.State.set({hotel:this.hotel.udicode,hotelTab:(f||"overview")})};a.getUdicode=function(){return(typeof this.hotel=="string")?this.hotel:this.hotel.udicode}})(hotelicopter,hotelicopter.$);(function(c,e){var b=c.components.HotelCards=function(f){this.placeholder=e(f);this.ts=new Date().getTime();this.includeUnavailable=((this.placeholder.data("includeUnavailable")=="true")||false);this.hotelsPerRow=null;this.displayNum=null;this.hotels=[];this.hotelUdicodes={};this.polledHotels={};this.maxHotels=100;this.rows={gallery:{initial:6,more:4},summary:{initial:20,more:10},map:{initial:20,more:10}};this.sourceEl=null;this.destinationEl=null;this.scrollTop=null;this.renderCount=0;this.paginationCardHotelCount=6};var a=b.prototype;b.cssClass="copter-hotelcards";b.dataAttributes=["galleryRows","galleryMoreRows","summaryRows","summaryMoreRows","animate","initialRatrix"];b.initialize=function(){var f=this;e("."+f.cssClass).each(function(g,j){var h=e(j);if(h.is(":empty")){f.createInstance(h.get(0))}})};b.createInstance=function(i,g){var f=this,h=e(i),j=null;e("html").css("overflow-y","scroll");g=(g||{});if(!h){c.throwException("Attempted to create a HotelCards component but no placeholder argument was supplied.")}h.addClass(f.cssClass);e.each(g,function(m,l){h.data(m,l)});j=new f(i);j.assignGlobalEventHandlers();j.render();return j};a.isPolling=false;a.render=function(){var f=this.placeholder;f.data("instance",this);if(f.data("animate")){f.append(c.getTemplate("hotel-cards-quicksand",{ts:this.ts}))}this.sourceEl=(f.data("animate"))?e("#copter-quicksand-source-"+this.ts):f;this.destinationEl=(f.data("animate"))?e("#copter-quicksand-destination-"+this.ts):f;this.assignLightboxEventsHandler()};a.assignGlobalEventHandlers=function(){var f=this,g=f.placeholder;c.bindToElement(g,"stateChangedLocation",function(i,h){f.destinationEl.empty()});c.bindToElement(g,"stateChangedStay",function(i,h){f.polledHotels={}});c.bindToElement(g,"stateChangedLocationOrStay",function(j,i,h){f.displayNum=f.calcHotelsPerRow()*(g.data(c.State.get("cardType")+"rows")||f.rows[c.State.get("cardType")].initial);f.hotels=[];f.renderCount=0;f.getLocationData(function(){f.getHotelData(true)})});c.bindToElement(g,"stateChangedSearchExcludingLocationOrStay",function(l,i,h){var j=f.calcHotelsPerRow()*(g.data(c.State.get("cardType")+"rows")||f.rows[c.State.get("cardType")].initial),k;if(f.displayNum<j){f.displayNum=j}g.find(".copter-zero-results").remove();f.hotels=[];f.renderCount=0;k=f.displayNum%f.calcHotelsPerRow();if(k>0){f.displayNum+=k}f.getHotelData(false)});c.bindToElement(g,"stateChangedCardType",function(i,h){f.changeCardType()});c.bindToElement(g,"hotelPinMouseOver",function(i,h){if(c.State.get("cardType")=="map"&&f.destinationEl){f.destinationEl.children('.copter-hotelcard[data-udicode="'+h.udicode+'"]').addClass("copter-highlighted")}});c.bindToElement(g,"hotelPinMouseOut",function(i,h){if(c.State.get("cardType")=="map"&&f.destinationEl){f.destinationEl.children('.copter-hotelcard[data-udicode="'+h.udicode+'"]').removeClass("copter-highlighted")}})};a.getLocationData=function(f){var h=this,i={locationId:c.State.get("locationId"),lat:c.State.get("lat"),lng:c.State.get("lng"),minHotels:c.State.get("minHotels"),onlySpecifiedAmenities:c.amenities,fields:["locationId","name","lat","lng","hotelCount","aggregatedBestRates","hotelCountByRate","aggregatedStarRatings","hotelCountByStarRating","propertyTypes","amenities","brands","groups"]},g=function(){c.trigger("hotelCardsLocationFound",{id:(h.placeholder.attr("id")||null),filters:c.State.get()});if(f){f()}};e.each(i,function(l,j){if(!j){delete i[l]}});if(c.currentLocation&&((c.currentLocation.lat)?(c.currentLocation.lat==c.State.get("lat")&&c.currentLocation.lat==c.State.get("lng")):(c.currentLocation.locationId==c.State.get("locationId")))){g()}else{i.success=function(){g()};c.Location._request(i)}};a.getHotelData=function(g){var f=this,i=function(j,k){f.hotels=j;f.storeUdicodes(j);if(k){f.isPolling=false}f.renderCards(j,k)},h={success:function(j){if(g){f.destinationEl.empty()}i(j);if(c.isDatedSearch()&&g){f.getHotelData()}},limit:f.calcHotelRequestCount(),onlySpecifiedAmenities:c.amenities,onlyPrimaryPhoto:true,fields:["udicode","amenities","brand","group","propertyType","photoCount","photos","lat","lng","distance","name","historicalRates","stars","advertisers"]};e.extend(h,c.State.getRequestAttributes());if(c.isDatedSearch()){if(!g){h.stay=c.State.stay();h.update=i;h.rateFields=["avNightlyRateInc","avNightlyRateEx","avNightlyTaxesAndFees","roomDescription","bookingUrl","isDirect"];h.onlyLowest=true;h.searchKey="hotel-cards-"+f.ts}f.isPolling=true}c.Hotel._request(h)};a.storeUdicodes=function(f){var g=this;this.hotelUdicodes={};e.each(f,function(h,j){g.hotelUdicodes[j.udicode]=true})};a.renderCards=function(f,j){var g=this,h=g.placeholder,i=[];g.renderCount++;if(h.data("animate")){this.sourceEl.show();this.destinationEl.hide()}if(this.destinationEl.children(".copter-pagination").length>0){this.destinationEl.children(".copter-pagination").remove()}if(j&&(g.hotels.length-g.displayNum)<g.hotelsPerRow){g.displayNum=g.hotels.length}if(c.State.get("cardType")=="map"){h.empty()}e.each(f,function(k,l){if(j){g.polledHotels[l.udicode]=true;l.polled=true}g.renderCard(k,l);i.push(l);if(k==(g.displayNum-1)){return false}});e.each(h.find(".copter-hotelcard"),function(l,k){k=e(k);if(!g.hotelUdicodes[k.data("udicode")]){k.remove()}});if(this.destinationEl.children(".copter-clear").length==0){this.destinationEl.append(e('<div data-udicode="clear" class="copter-clear" />'))}if(!c.isDatedSearch()||j){g.paginationCard()}if(h.find(".copter-pagination").length>0){i.pop()}if(g.scrollTop){e(window).scrollTop(g.scrollTop);g.scrollTop=null;h.removeAttr("style")}if(h.data("animate")){e("#copter-quicksand-source-"+this.ts).quicksand(e("#copter-quicksand-destination-"+this.ts+" > div"),{attribute:"data-udicode",duration:750},function(){g.sourceEl.hide();g.destinationEl.show()})}h.find(".copter-hotelcard").removeClass("copter-first");h.find(".copter-hotelcard:first").addClass("copter-first");if((!c.isDatedSearch()||j)&&f.length===0){g.showZeroResults()}c.trigger("hotelCardsRendered",{id:(g.placeholder.attr("id")||null),hotels:i,complete:j})};a.renderCard=function(h,m){var g=this,l=this.placeholder,j=this.destinationEl.children('.copter-hotelcard[data-udicode="'+m.udicode+'"]'),k=(j.length===0),f=!!(this.polledHotels[m.udicode]);j=(k)?e("<div />"):j;if(h==0){this.destinationEl.prepend(j)}else{j.insertAfter(this.destinationEl.children(".copter-hotelcard:eq("+(h-1)+")"))}if(j.is(":empty")){c.components.HotelCard.createInstance(j,m,{cardType:c.State.get("cardType"),flip:true,noLazyLoad:true,number:(h+1),includeRoomDetails:true,includeBrandLogo:true,includeRateTotal:true,includeOfficialSite:(c.State.get("cardType")==="summary"),initialRatrix:l.data("initialRatrix"),polled:f})}else{j.data({polled:f,hotel:m})}g.removeSurplusCards()};a.assignLightboxEventsHandler=function(){c.bindToElement(this.placeholder,"lightboxClosed",function(g,f){if(f&&f.indexOf("copter-hoteldetails")>=0){c.State.set({hotel:null,hotelTab:null})}})};a.removeSurplusCards=function(){var f=this.destinationEl.children(".copter-hotelcard[data-udicode]:gt("+(this.displayNum-1)+")");e.each(f,function(h,g){e(g).remove()})};a.calcHotelRequestCount=function(){var g=this.hotelsPerRow,h=this.displayNum,f;f=((this.displayNum%g)===0)?0:g-(this.displayNum%g);f+=(g*(this.placeholder.data(c.State.get("cardType")+"MoreRows")||this.rows[c.State.get("cardType")].more));if(f<this.paginationCardHotelCount){f=this.paginationCardHotelCount}h+=f;if(h>this.maxHotels){h=this.maxHotels}return h};a.calcHotelsPerRow=function(){var i=this.placeholder,g=1,f,h,j;if(c.State.get("cardType")=="gallery"){f=i.width();h=e('<div class="copter-hotelcard copter-gallerycard" />').show();i.append(h);j=h.outerWidth(true);h.remove();if(j>0){g=Math.floor(f/j)}i.width(f)}return this.hotelsPerRow=g};a.changeCardType=function(){var f=this.placeholder,g=(c.isDatedSearch&&c.Rate.polling)?false:true;if(f.find(".copter-pagination").length>0){this.displayNum++}f.empty();f.css("height","");this.renderCards(this.hotels,g)};a.showZeroResults=function(){this.placeholder.append(c.getTemplate("hotel-cards-zero-results",{labels:this.getAllText()}))};a.paginationCard=function(){if(this.displayNum<this.hotels.length){this.displayNum--;this.destinationEl.children(".copter-hotelcard:last").remove();var f=e(c.getTemplate("hotel-cards-"+c.State.get("cardType")+"-pagination-card",{labels:this.getAllText()}));this.destinationEl.children(".copter-clear").before(f);this.paginationPreview(f);this.paginationHandler(f)}};a.paginationPreview=function(h){var g=this,f=g.hotels;var k="";for(var j=g.displayNum;j<g.displayNum+this.paginationCardHotelCount;j++){var l=f[j];if(l){k+=c.getTemplate("hotel-cards-"+c.State.get("cardType")+"-pagination-img",{url:(l.photos&&l.photos.length>0)?l.primaryPhoto(100,75).url:"",name:e.escapeHTML(l.name)})}}h.find(".copter-previewimages .copter-clear").before(k)};a.paginationHandler=function(g){var f=this;g.bind("click",function(h){h.preventDefault();c.UserAction.record("hotel_cards_view_more_hotels_click",{display_number_when_clicked:f.displayNum,view_type:c.State.get("cardType")});f.scrollTop=e(window).scrollTop();f.placeholder.css("height",(f.placeholder.height()+100)+"px");g.remove();f.displayNum=f.hotels.length;f.renderCards(f.hotels,true);f.getHotelData()})}})(hotelicopter,hotelicopter.$);(function(c,e){var b=c.components.HotelRate=function(f){this.placeholder=e(f);this.hotel=null;this.polled=false;this.ts=new Date().getTime();this.searchKey="hotel-rate-"+this.ts},a=b.prototype;b.cssClass="copter-hotelrate";b.initialize=function(){var f=this;e("."+f.cssClass).each(function(g,j){var h=e(j);if(h.is(":empty")){f.createInstance(h.get(0),h.data("hotel"))}})};b.createInstance=function(j,i,g){var f=this,h=e(j),k=null;g=(g||{});if(!h){c.throwException("Attempted to create a HotelRate component but no placeholder was supplied.")}if(!i||i.length==0){c.throwException("Attempted to create a HotelRate component but no hotel was supplied.")}g.hotel=i;h.addClass(f.cssClass);e.each(g,function(m,l){h.data(m,l)});k=new f(j);k.polled=!!(g.polled);k.hotel=i;if(typeof i=="string"){k.getHotelData()}else{k.render()}return k};a.render=function(){var f=this.placeholder;f.data({instance:this});if(c.isDatedSearch()&&typeof this.hotel=="object"&&!this.hotel.availableRates&&!f.data("excludeFromSearch")){this.getRates()}this.assignEventHandlers();this.renderRate()};a.renderRate=function(){if(c.isDatedSearch()){if(!this.polled||(c.Rate.polling&&!this.hotel.availableRates)){this.showSearchingRate()}else{this.showLiveRate()}}else{this.showDatelessRate()}};a.getHotelData=function(){var f=this,h=function(i){f.hotel=i[0];f.placeholder.empty();f.render()},g={success:h,onlySpecifiedAmenities:c.amenities,fields:["udicode","amenities","shortDescription","brand","group","propertyType","lat","lng","distance","name","historicalRates","stars","advertisers"]};c.Hotel.findByUdicode(this.getUdicode(),g)};a.getRates=function(){var f={success:function(g){},update:function(g,h){},fields:["avNightlyRateInc","avNightlyRateEx","avNightlyTaxesAndFees","roomDescription","bookingUrl","isDirect"],onlyLowest:true,searchKey:this.searchKey};this.polled=false;c.Rate.findByUdicode(this.getUdicode(),c.State.stay(),f)};a.handlePoll=function(g){var f=g.hotelsWithRatesHash[this.getUdicode()]||null;if(f){this.hotel.availableRates=f}if(!c.Rate.polling){this.polled=true}this.renderRate()};a.assignEventHandlers=function(){this.assignGlobalEventHandlers();this.placeholder.dblclick(function(f){f.stopPropagation();e.clearSelection()})};a.assignGlobalEventHandlers=function(){var f=this,g=this.placeholder;c.bindToElement(g,"stateChangedLocationOrStay",function(){if(c.isDatedSearch()){f.polled=false;f.renderRate();if(!g.data("excludeFromSearch")){f.getRates()}}});c.bindToElement(g,"ratesPolled",function(h,i){f.handlePoll(i)})};a.assignRateButtonEventHandlers=function(){var f=this,h=f.placeholder,g=!!(h.data("directLink"));h.find(".copter-room-details a").click(function(i){i.preventDefault();c.UserAction.record("hotel_rate_room_details_click",{udicode:h.data("hotel").udicode,advertiser_code:h.data("advertiserCode"),exclusive_rate:h.data("exclusiveRate"),inclusive_rate:h.data("inclusiveRate"),is_book_direct:h.data("isBookDirect")});f.showHotelDetails("rates")});h.find(".copter-book, .copter-rate-link").click(function(i){c.trigger("lead");if(!g){i.preventDefault()}});h.find(".copter-rate-link").click(function(i){if(h.data("bookButtonUrl")){i.preventDefault();i.stopPropagation();c.UserAction.redirect(h.data("bookButtonUrl"),"i1_hotel_rate_click",{udicode:f.hotel.udicode})}});h.find(".copter-book").click(function(k){var i,l=function(m){var n=c.components.Bubble.createInstance(m,h.find(".copter-book"),{position:"right",deleteContentsOnClose:true});m.find(".copter-cancel").click(function(o){o.preventDefault();n.close()})},j=f.hotel.availableRates.getKeyRate();if(c.isDatedSearch()){if(h.data("bookButtonUrl")){k.preventDefault();k.stopPropagation();c.UserAction.redirect(h.data("bookButtonUrl"),"i1_learn_more_click",{udicode:f.hotel.udicode,advertiser_code:j.advertiserCode,exclusive_rate:Math.round(j.avNightlyRateEx),inclusive_rate:Math.round(j.avNightlyRateInc),is_book_direct:!!(j.isDirect)})}else{if(!g){k.preventDefault();k.stopPropagation();i=e(c.getTemplate("hotel-rate-ratrix-bubble",{labels:f.getAllText()})).appendTo("body");c.components.Ratrix.createInstance(i.children(".copter-ratrix"),f.hotel);l(i)}}}else{k.preventDefault();k.stopPropagation();i=e(c.getTemplate("hotel-rate-check-rates-bubble",{labels:f.getAllText()})).appendTo("body");c.components.SearchForm.createInstance(i.children(".copter-searchform"),{location:false,twoMonth:true});l(i);c.UserAction.record("hotel_rate_check_rates_click",{udicode:f.hotel.udicode,lowest_historical_rate:f.hotel.historicalRates.lowest})}})};a.assignNoRateButtonEventHandlers=function(){var g=this,f=g.placeholder.find(".copter-norate, .copter-norate *");f.hover(function(i){var h=e(i.target);if(!h.is(".copter-rate-wrapper")){h=h.parents(".copter-rate-wrapper")}h.find(".copter-prompt").show();h.find(".copter-bestavg, .copter-bestavglabel").hide()},function(i){var h=e(i.target);if(!h.is(".copter-rate-wrapper")){h=h.parents(".copter-rate-wrapper")}h.find(".copter-prompt").hide();h.find(".copter-bestavg, .copter-bestavglabel").show()});f.click(function(h){h.stopPropagation();c.components.Bubble.createInstance(c.getTemplate("hotel-rate-unavailable-bubble",{labels:g.getAllText()}),g.placeholder.find(".copter-rate-wrapper"))})};a.showSearchingRate=function(){var h=this.placeholder,g=(this.hotel.availableRates)?this.hotel.availableRates.getKeyRate():null,f=(g)?Math.round(g.avNightlyRateEx):null;h.html(c.getTemplate("hotel-rate-checking",{labels:this.getAllText(),rate:f}))};a.showLiveRate=function(){var f=(this.hotel.availableRates)?this.hotel.availableRates.getKeyRate():null;if(f){this.showBestRate()}else{this.showUnavailableRate()}c.trigger("liveRateRendered",this.placeholder)};a.showBestRate=function(){var m=this,h=this.hotel.availableRates.getKeyRate(),f=m.placeholder,j=(h.avNightlyRateInc)?Math.round(h.avNightlyRateInc):"xxx",n=(h.avNightlyRateEx)?Math.round(h.avNightlyRateEx):"xxx",l=(h.roomDescription)?e.properCase(h.roomDescription):m.getText("unknownRoom"),g=h.bookingUrl,k=m.hotel.advertiserLogo(h.advertiserCode,h.isDirect,102,51),i;if(j!=f.data("inclusiveRate")||n!=f.data("exclusiveRate")||l!=f.data("roomDetails")||h.advertiserCode!=f.data("advertiserCode")){if(f.data("bookButtonUrl")){g=f.data("bookButtonUrl")}else{g=c.UserAction.buildRedirectUrl(g,"hotel_rate_book_click",{udicode:m.hotel.udicode,advertiser_code:f.data("advertiserCode"),exclusive_rate:f.data("exclusiveRate"),inclusive_rate:f.data("inclusiveRate"),is_book_direct:f.data("isBookDirect")})}i=c.getTemplate("hotel-rate-live",{labels:m.getAllText(),rateInc:j,rateEx:n,includeRoomDetails:(f.data("includeRoomDetails")||null),roomDetails:e.truncate(l,25),roomDetailsFull:e.escapeHTML(l),bookingUrl:e.escapeHTML(g),linkTarget:(f.data("bookButtonUrl"))?"_self":"_blank",advertiserLogo:k,includeBrandLogo:(f.data("includeBrandLogo")||null),includeRateTotal:(f.data("includeRateTotal")||null),includeFrom:(f.data("includeFrom")||null),includeOfficialSite:(f.data("includeOfficialSite")||null),isDirect:!!(h.isDirect)});f.empty().html(i);f.data({inclusiveRate:j,exclusiveRate:n,roomDetails:l,advertiserCode:h.advertiserCode,isBookDirect:!!(h.isDirect)});this.assignRateButtonEventHandlers()}};a.showUnavailableRate=function(){var f=this.placeholder;if(f.find(".copter-norate").length==0){f.html(c.getTemplate("hotel-rate-no-rate",{labels:this.getAllText()}))}};a.showDatelessRate=function(){var f=this.placeholder;if(f.find(".copter-dateless").length==0){f.html(c.getTemplate("hotel-rate-dateless",{labels:this.getAllText(),rate:(this.hotel.historicalRates)?(this.hotel.historicalRates.lowest):this.getText("unknown")}))}};a.inHotelCards=function(){return(this.placeholder.parents(".copter-hotelcards").length>0)};a.getUdicode=function(){return(typeof this.hotel=="string")?this.hotel:this.hotel.udicode};a.showHotelDetails=function(f){c.State.set({hotel:this.hotel.udicode,hotelTab:(f||"overview")})}})(hotelicopter,hotelicopter.$);(function(c,f,e){var b=c.components.SearchForm=function(g){this.placeholder=f(g);this.ts=new Date().getTime();this.location=null;this.autofillGoogle=true;this.autofillAirports=true;this.autofillHotels=false;this.autofillMinQueryChars=1;this.autofillMaxSlots=10;this.autofillCache={};this.autofillData=null;this.autofillLocationAverages=false;this.autofillKeyDelay=200;this.autofillHideStayControls=false;this.autofillMaxAirportSlots=3;this.autofillMaxHotelSlots=4;this.minHotels=8;this.recentSearchesMax=6;this.locationImages={"3tKWnYG6t04s0cU05g9krVMw":"amsterdam","0ofKcaG4X04s5cO05g9krVMw":"aspen","4J582SG4R04s5cO05g9krVMw":"atlanta","4TMlSiG4R04s5cO05g9krVMw":"austin","0Fbdr6G4S04s5cO05g9krVMw":"boston","0nN94iG4S04s5cO05g9krVMw":"charlottesville","0gyue0G4S04s5cO05g9krVMw":"chicago","1ntPe4G4S04s5cO05g9krVMw":"dubai","3I8xA8G4S04s5cO05g9krVMw":"lasvegas","19eTM8G4S04s5cO05g9krVMw":"london","0UQCLAG4S04s5cO05g9krVMw":"losangeles","40QLnUG6t04s0cU05g9krVMw":"mexicocity","40l3kuG4S04s5cO05g9krVMw":"miami","1z6pfcG4S04s5cO05g9krVMw":"newyork","4292iuG6t04s0cU05g9krVMw":"paris","0J7bpAG4T04s5cO05g9krVMw":"philadelphia","0EqikyG4T04s5cO05g9krVMw":"portland","06EjCaG6u04s0cU05g9krVMw":"riodejaneiro","43ClEmG6t04s0cU05g9krVMw":"rome","0zuhfsG4T04s5cO05g9krVMw":"sandiego","1JFPIOG4T04s5cO05g9krVMw":"sanfrancisco","1EMGS8G4T04s5cO05g9krVMw":"seattle","1wVak4G4T04s5cO05g9krVMw":"toronto","1TCqauG4S04s5cO05g9krVMw":"washington"}};var a=b.prototype;b.cssClass="copter-searchform";b.initialize=function(){var g=this;f("."+g.cssClass).each(function(h,k){var j=f(k);if(j.is(":empty")){g.createInstance(j.get(0))}})};b.createInstance=function(j,h){var g=this,i=f(j),k=null;h=(h||{});if(!i){c.throwException("Attempted to create a SearchForm component but no placeholder argument was supplied.")}i.addClass(g.cssClass);f.each(h,function(m,l){i.data(m,l)});k=new g(j);k.render();return k};a.addRecentSearch=function(i,h,k){var j=this,m=f.datepicker.formatDate(c.dateFormat,f.datepicker.parseDate("yy-mm-dd",h)),g=f.datepicker.formatDate(c.dateFormat,f.datepicker.parseDate("yy-mm-dd",k)),l=(c.Storage.get("recent_searches")||[]);if(c.Storage.get("recent_searches")){f.each(c.Storage.get("recent_searches"),function(o,n){if(i.locationName.toLowerCase()==n.location.locationName.toLowerCase()){l.splice(o,1)}})}if(l.length==j.recentSearchesMax){l.pop()}l.unshift({location:i,checkIn:m,checkOut:g});c.Storage.set("recent_searches",l,30)};a.clearRecentSearches=function(){c.Storage.clear("recent_searches");this.showOrHideRecentSearchesButton()};a.prepopulateForm=function(h){var g=c.Storage.get("recent_searches");this.selectLocationFromStorage(g[h].location);f("#copter-search-form-check-in-"+this.ts).val(g[h].checkIn);f("#copter-search-form-check-out-"+this.ts).val(g[h].checkOut)};a.render=function(){var h=this.placeholder,g={checkIn:(c.isDatedSearch())?c.State.get("checkIn"):(h.data("checkIn")||""),checkOut:(c.isDatedSearch())?c.State.get("checkOut"):(h.data("checkOut")||""),rooms:(c.isDatedSearch())?c.State.get("rooms"):(h.data("rooms")||"1"),guests:(c.isDatedSearch())?c.State.get("guests"):(h.data("guests")||"1")};h.data("instance",this);h.append(c.getTemplate("search-form-recentsearch-button",{labels:this.getAllText()}));this.showOrHideRecentSearchesButton();if(h.data("location")){this.disableSearch();h.append(c.getTemplate("search-form-location",{labels:this.getAllText(),ts:this.ts,locationFieldPlaceholder:(h.data("locationFieldPlaceholder")||"")}));this.initLocationAutofill()}h.append(c.getTemplate("search-form-stay",{labels:this.getAllText(),ts:this.ts,dateFieldPlaceholder:(h.data("dateFieldPlaceholder")||"")}));h.append('<div class="copter-clear"/>');if(!this.autofillHideStayControls){this.expandControls()}this.assignDatePickers();this.assignEventHandlers();this.setStay(g)};a.assignDatePickers=function(){var h=this,i=this.placeholder,g=(i.data("twoMonth"))?2:1;f("#copter-search-form-check-in-"+this.ts).datepicker({dateFormat:c.dateFormat,numberOfMonths:g,minDate:0,onSelect:function(o,n){var m=f(this),p=f("#copter-search-form-check-out-"+h.ts),k=m.datepicker("getDate"),l=p.datepicker("getDate"),j=new Date(k);if(!l||(l&&k>=l)){l=new Date(k);l.setDate(l.getDate()+1)}p.datepicker("setDate",l)}});f("#copter-search-form-check-out-"+this.ts).datepicker({dateFormat:c.dateFormat,numberOfMonths:g,minDate:1,onSelect:function(n,m){var o=f(this),l=f("#copter-search-form-check-in-"+h.ts),k=o.datepicker("getDate"),j=l.datepicker("getDate");if(!j||(j&&j>=k)){j=new Date(k);j.setDate(j.getDate()-1)}l.datepicker("setDate",j)}})};a.assignEventHandlers=function(){var g=this,h=this.placeholder;if(h.data("location")){c.bindToElement(h,"windowResize",function(){g.hideAutoComplete(false)});c.bindToElement(h,"documentClick",function(i){g.hideAutoComplete(true)})}f("#ui-datepicker-div").click(function(i){i.stopPropagation()});h.find(".copter-search-form-stay input").keydown(function(j){var i=f.ui.keyCode;if(j.keyCode!=i.TAB&&j.keyCode!=i.ENTER){j.preventDefault()}});f("#copter-search-form-numrooms-"+this.ts).change(function(m){var l=f(this).val(),n=l*4,k="";for(var j=l;j<=n;j++){k+='<option value="'+j+'">'+j+"</option>"}f("#copter-search-form-numguests-"+g.ts).html(k)});h.find(".copter-recentsearch-button").click(function(i){i.preventDefault();i.stopPropagation();if(!f(this).hasClass("copter-active-state")){g.handleRecentSearchClick(f(i.target));f(this).addClass("copter-active-state")}else{c.components.Bubble.closeAll()}});h.find(".copter-button").click(function(i){i.preventDefault();if(!f(this).hasClass("copter-disabled")){if(!!h.data("location")){if(g.location){g.search()}}else{g.search()}}});c.bindToElement(h,"stateChangedStay",function(j,i){g.setStay(f.extend({},i))});c.bindToElement(h,"hashChangeFirst",function(i){f("#ui-datepicker-div").hide()});c.bind("showSearch",function(){g.showOrHideRecentSearchesButton()});c.bindToElement(h,"allBubblesClosed",function(){h.find(".copter-recentsearch-button").removeClass("copter-active-state")})};a.handleRecentSearchClick=function(k){var h=this,n=h.placeholder,l,m,g,i,j=(c.Storage.get("recent_searches")||[]);l=f(c.getTemplate("search-form-recentsearch",{labels:this.getAllText()}));m=l.find(".copter-recentsearch-items");f.each(j,function(p,o){i=f.truncate(o.location.locationName,75).split(",");m.append(c.getTemplate("search-form-recentsearch-item",{partialName1:i[0],partialName2:", "+e.rest(i).join(),checkIn:o.checkIn,checkOut:o.checkOut}))});g=c.components.Bubble.createInstance(l,k,{position:"bottom",customCSS:"copter-recentsearch-bubble"});f(".copter-clear-recentsearch-list").click(function(o){o.preventDefault();h.clearRecentSearches();c.components.Bubble.closeAll()});f(".copter-recentsearch-item").click(function(o){o.preventDefault();h.prepopulateForm(f(this).index());c.components.Bubble.closeAll()})};a.setStay=function(g){if(g.checkIn&&g.checkIn.length>0){g.checkIn=f.datepicker.formatDate(c.dateFormat,f.datepicker.parseDate("yy-mm-dd",g.checkIn))}if(g.checkOut&&g.checkOut.length>0){g.checkOut=f.datepicker.formatDate(c.dateFormat,f.datepicker.parseDate("yy-mm-dd",g.checkOut))}if(!g.checkIn||g.checkIn.length==0){g.checkIn="mm/dd/yyyy"}if(!g.checkOut||g.checkOut.length==0){g.checkOut="mm/dd/yyyy"}f("#copter-search-form-check-in-"+this.ts).val(g.checkIn);f("#copter-search-form-check-out-"+this.ts).val(g.checkOut);f("#copter-search-form-numrooms-"+this.ts).val(g.rooms);f("#copter-search-form-numrooms-"+this.ts).change();f("#copter-search-form-numguests-"+this.ts).val(g.guests)};a.defaultDates=function(){var j=this.placeholder.data("defaultDateDays"),h=null,i,g;if(j){i=new Date();i.setTime(i.getTime()+(j*24*60*60*1000));g=new Date();g.setTime(g.getTime()+((j+1)*24*60*60*1000));h={checkIn:f.datepicker.formatDate("yy-mm-dd",i),checkOut:f.datepicker.formatDate("yy-mm-dd",g)}}return h};a.search=function(){var k=this,i=c.UserAction.getState(true),l=false,g=null,j=null,m=f("#copter-search-form-check-in-"+this.ts).val(),h=f("#copter-search-form-check-out-"+this.ts).val();if(m!=="mm/dd/yyyy"&&h!=="mm/dd/yyyy"){g={checkIn:f.datepicker.formatDate("yy-mm-dd",f.datepicker.parseDate(c.dateFormat,m)),checkOut:f.datepicker.formatDate("yy-mm-dd",f.datepicker.parseDate(c.dateFormat,h)),rooms:f("#copter-search-form-numrooms-"+this.ts).val(),guests:f("#copter-search-form-numguests-"+this.ts).val()};if(!this.placeholder.data("location")){l=true}}if(this.location){j=this.defaultDates();if(j&&!g){g={checkIn:j.checkIn,checkOut:j.checkOut,rooms:f("#copter-search-form-numrooms-"+this.ts).val(),guests:f("#copter-search-form-numguests-"+this.ts).val()}}l=true}if(l){c.trigger("searchStart");k.addRecentSearch(this.location,g.checkIn,g.checkOut);if(this.location){c.State.clearCurrentState();this.getLocationData(function(){c.State.set(f.extend({},k.location,g));window.setTimeout(function(){c.UserAction.record("location_search_start",i,true)},500)})}else{c.State.set(f.extend({},g));window.setTimeout(function(){c.UserAction.record("stay_changed",i,true)},500)}}};a.getLocationData=function(g){var i=this,j=["locationId","lat","lng","udicode","radius","minHotels"],k={onlySpecifiedAmenities:c.amenities,fields:["locationId","name","lat","lng","hotelCount","aggregatedBestRates","hotelCountByRate","aggregatedStarRatings","hotelCountByStarRating","propertyTypes","amenities","brands","groups"],success:function(){if(g){g()}}},h={};f.each(j,function(m,l){if(!!(i.location[l])){h[l]=i.location[l]}});k=f.extend(k,h);c.Location._request(k)};a.initLocationAutofill=function(){var g=this;this.autofillControlId="copter-autofill-"+g.ts;this.autofillControl=f("#"+this.autofillControlId);this.autofillWrapper=f("#copter-autofill-wrapper-"+g.ts);this.autofillDropdownId="copter-autofill-dropdown-"+g.ts;this.autofillControl.keyup(function(h){g.queryInit(h)});this.selectLocationFromState();this.assignAutofillEventHandlers()};a.assignAutofillEventHandlers=function(){var g=this,h=this.placeholder;this.preselect=f("#copter-autofill-preselect-"+this.ts);this.autofillControl.keydown(function(o){var j=f.ui.keyCode,n=g.autofillControl.val(),l=f.stripTags(g.preselect.html()),m,i;if(o.keyCode!=j.LEFT&&o.keyCode!=j.RIGHT&&o.keyCode!=j.HOME&&o.keyCode!=j.END&&o.keyCode!=j.PAGE_UP&&o.keyCode!=j.PAGE_DOWN){g.location=null;if(o.keyCode==j.DELETE||o.keyCode==j.BACKSPACE){g.preselect.empty()}if(g.preselect.children().first().is("span")&&o.keyCode>=32&&o.keyCode<127){if(String.fromCharCode(o.keyCode).toLowerCase()==String.fromCharCode(l.charCodeAt(n.length)).toLowerCase()){m=c.getTemplate("search-form-autofill-preselect",{hidden:l.substring(0,n.length),visible:l.substring(n.length,l.length)});g.preselect.html(m);l=f.stripTags(m);i=String.fromCharCode(l.charCodeAt(n.length));o.preventDefault();g.autofillControl.val(n+i)}else{g.preselect.html("");g.disableSearch()}}if(o.keyCode==j.TAB){o.preventDefault();if(g.autofillControl.val().length>0){g.selectLocation();if(g.location){if(!g.controlsExpanded()){g.expandControls()}f("#copter-search-form-check-in-"+g.ts).focus()}}}if(o.keyCode==j.ENTER){o.preventDefault();if(g.autofillControl.val().length>0){g.selectLocation();if(g.location){if(!g.autofillHideStayControls||g.controlsExpanded()){g.search()}else{g.expandControls()}}}}if(o.keyCode==j.DOWN){o.preventDefault();g.cursorMove("down")}if(o.keyCode==j.UP){o.preventDefault();g.cursorMove("up")}}});this.autofillControl.keyup(function(i){if(g.autofillControl.val().length==0){g.disableSearch();g.hideControls()}});this.autofillControl.click(function(i){i.stopPropagation()});this.autofillControl.focus(function(i){g.setPreselect("");g.query(g.autofillControl.val())});this.autofillControl.blur(function(i){if(g.autofillControl.val().length==0){g.setPreselect(h.data("locationFieldPlaceholder")||"")}if(!g.location){if(g.autofillControl.val().length>0){g.selectLocation()}if(!g.location){g.disableSearch()}}})};a.cursorMove=function(j){if(f("#"+this.autofillDropdownId).length>0){var h=this,i=f("#"+this.autofillDropdownId+" .copter-autofill-result-sel"),g;if(i.length>0){if(j=="down"){g=i.nextAll(".copter-autofill-result:first")}else{g=i.prevAll(".copter-autofill-result:first")}if(g.length==0){if(j=="down"){g=f("#"+this.autofillDropdownId+" .copter-autofill-result:first")}else{g=f("#"+this.autofillDropdownId+" .copter-autofill-result:last")}}h.unhiliteResult(i)}else{g=f("#"+this.autofillDropdownId+" .copter-autofill-result:first")}h.hiliteResult(g)}};a.hiliteResult=function(h){if(f(h).length>0){f(h).addClass("copter-autofill-result-sel");var g=f(f(h).children()[0]).data("locationName");if(f.startsWith(this.autofillControl.val().toLowerCase(),g.toLowerCase())){this.setPreselect(g)}else{this.preselect.empty()}}};a.unhiliteResult=function(g){f(g).removeClass("copter-autofill-result-sel")};a.queryInit=function(j){var h=this,g=f.ui.keyCode,i=h.autofillControl.val();if(((j.keyCode>=32&&j.keyCode<=126)||(j.keyCode==g.DELETE)||(j.keyCode==g.BACKSPACE))&&j.keyCode!=g.DOWN&&j.keyCode!=g.UP&&j.keyCode!=g.LEFT&&j.keyCode!=g.RIGHT){if(typeof h.keypressTimeout=="number"){window.clearTimeout(h.keypressTimeout)}h.slots=h.autofillMaxSlots;if(i.length>=h.autofillMinQueryChars){h.keypressTimeout=window.setTimeout(function(){h.query(i);h=null;i=null},h.autofillKeyDelay)}if(i.length==0){h.hideAutoComplete(false)}}};a.query=function(h){var g=this;if(h.length>0){g.slots=g.autofillMaxSlots;g.hotelUrl=null;g.locUrl=null;g.autofillData=null;if(g.autofillCache[h.toLowerCase()]){g.autofillData=g.autofillCache[h.toLowerCase()];g.parse()}else{g.queryRequest(h,function(){g.parse()})}}};a.queryRequest=function(i,g){var h=this;if(i.length>0){h.currentQuery=i;c.Autofill.query(i,{success:function(j){if(h.currentQuery==j.query){h.autofillData=j;if(h.autofillData&&(h.autofillData.query==h.autofillControl.val())){if((h.autofillData.locations.length)==0&&h.autofillGoogle&&c.googleMaps){var k=new google.maps.Geocoder();k.geocode({address:h.autofillControl.val()},function(l){if(h.autofillData&&(h.autofillData.query==h.autofillControl.val())){f.each(l,function(n,m){if(h.isGoogleLocationOK(m)){h.autofillData.locations.push({locationId:null,images:[],name:m.formatted_address,lat:m.geometry.location.lat(),lng:m.geometry.location.lng(),types:m.types,google:true})}});h.autofillCache[h.autofillControl.val().toLowerCase()]=h.autofillData;if(g){g()}}})}else{h.autofillCache[h.autofillControl.val().toLowerCase()]=h.autofillData;if(g){g()}}}}}})}};a.isGoogleLocationOK=function(g){var l=false,k=g.types,j=g.address_components,h=["street_address","route","intersection","administrative_area_level_3","locality","sublocality","neighborhood","premise","subpremise","postal_code","natural_feature","park","point_of_interest"],i=["hotel","motel"];f.each(k,function(m,n){if(f.inArray(n,h)>=0){l=true;return false}});f.each(i,function(n,m){if(g.formatted_address.toLowerCase().indexOf(m)>=0){l=false;return false}});if(j.length>0&&f.inArray(k,"establishment")>=0){f.each(this.autofillData.hotels,function(m,n){if(n.display_name.indexOf(j[0].short_name)>=0||n.display_name.indexOf(j[0].long_name)>=0){l=false;return false}})}return l};a.parse=function(){var h=this,k;if((this.autofillData.locations.length+this.autofillData.airports.length+this.autofillData.hotels.length)==0){this.hideAutoComplete(false)}else{var j=0,g=0;this.showAutoComplete();this.clearAutoComplete();if(this.autofillAirports){if(this.autofillData.airports.length>0){j=this.autofillMaxAirportSlots}}if(this.autofillHotels){if(this.autofillControl.val().length>2){g=this.autofillData.hotels.length;if(this.autofillData.hotels.length>=this.autofillMaxHotelSlots){g=this.autofillMaxHotelSlots}}}this.slots-=(j+g);k=f("#"+this.autofillDropdownId);if(this.autofillData.locations.length>0){this.setPreselect(this.autofillData.locations[0].name);k.append(c.getTemplate("search-form-autofill-heading",{heading:this.getText("places")}));f.each(this.autofillData.locations,function(l,m){h.renderAutofillLocation(m,l,h.autofillData.locations.length)})}if(this.autofillAirports){if(this.autofillData.airports.length>0){this.slots+=j;if(this.slots>0){if(this.slots<=this.autofillMaxSlots){this.setPreselect(this.autofillData.airports[0].name);k.append(c.getTemplate("search-form-autofill-heading",{heading:this.getText("airports")}));f.each(this.autofillData.airports,function(l,m){h.renderAutofillAirport(m)})}}}}if(this.autofillHotels){if(this.autofillData.hotels.length>0){this.slots+=g;if(this.slots>0){if(this.slots<=this.autofillMaxSlots){this.setPreselect(this.autofillData.hotels[0].name);k.append(c.getTemplate("search-form-autofill-heading",{heading:this.getText("hotels")}));f.each(this.autofillData.hotels,function(l,m){h.renderAutofillHotel(m,l)})}}}}k.children(":first").addClass("copter-first");k.children(":last").addClass("copter-last");k.append('<div class="copter-clear" />');this.cursorMove("down");var i=Math.round((k.position().top+k.height())-f(window).height());if(i>f(document).scrollTop()){f("html,body").animate({scrollTop:i+10},500)}else{if(k.position().top<f(document).scrollTop()){f("html,body").animate({scrollTop:i-10},500)}}}};a.setPreselect=function(i){var h=this.autofillControl.val(),g;if(f.startsWith(this.autofillControl.val().toLowerCase(),i.toLowerCase())){i=f.unescapeHTML(i);g=c.getTemplate("search-form-autofill-preselect",{hidden:i.substring(0,h.length),visible:i.substring(h.length,i.length)});this.preselect.html(g);this.autofillControl.val(i.substring(0,h.length))}};a.showAutoComplete=function(){if(f("#"+this.autofillDropdownId).length==0){var g=f(c.getTemplate("search-form-autofill-dropdown",{id:this.autofillDropdownId}));g.css({position:"absolute",left:Math.round(this.autofillWrapper.position().left)+"px",top:((Math.round(this.autofillWrapper.position().top)+Math.round(this.autofillWrapper.outerHeight()))-1)+"px",width:(Math.round(this.autofillWrapper.outerWidth())-2)+"px"});this.placeholder.append(g);g.parent().css("z-index","0").maxZIndex();g.maxZIndex();this.enableSearch();c.trigger("searchFormDropdownRendered",g)}};a.hideAutoComplete=function(g){var h=f("#"+this.autofillDropdownId);if(h.length>0){if(g){h.fadeOut(250,function(){f(this).remove()})}else{h.remove()}if(this.preselect){this.preselect.empty()}}};a.clearAutoComplete=function(){var g=f("#"+this.autofillDropdownId);if(g.length>0){g.children().remove()}};a.renderAutofillLocation=function(m,l){var j={A:{slots:1,name:f.truncate(m.name,45).split(",")},B:{slots:2,name:m.name.split(",")}},h=f(c.getTemplate("search-form-autofill-result",{id:"copter-locations-"+l})),g="A",k;if(this.slots>0){f("#"+this.autofillDropdownId).append(h);if(this.locationImages[m.locationId]){m.img=this.locationImages[m.locationId]+".jpg"}if(!this.placeholder.data("autofillPhotos")){m.img=null}if(l==0&&m.img!=null){g="B"}this.slots-=j[g].slots;k=j[g].name;h.append(c.getTemplate("search-form-autofill-location-"+g.toLowerCase(),{name:f.escapeHTML(m.name),namePartial1:k[0],namePartial2:((g=="A")?", ":"")+e.rest(k).join(),locationId:m.locationId,lat:m.lat,lng:m.lng,img:m.img,google:(m.google||false)}));this.setResultEventHandlers(h)}};a.renderAutofillAirport=function(j){var h=f.truncate(j.name,75),i=h.split(",");if(this.slots>0){var g=f(c.getTemplate("search-form-autofill-result",{id:"copter-airports-0"}));f("#"+this.autofillDropdownId).append(g);this.slots-=1;g.append(c.getTemplate("search-form-autofill-airport",{name:f.escapeHTML(j.name),namePartial1:i[0],namePartial2:((e.rest(i).length>0)?", ":"")+e.rest(i).join(),lat:j.lat,lng:j.lng}));this.setResultEventHandlers(g)}};a.renderAutofillHotel=function(n,l){var j={A:{slots:1,name:(f.truncate(n.name+", "+this.autofillData.getHotelAddress(n,true),65)).split(","),predictiveText:n.name+", "+this.autofillData.getHotelAddress(n,true),hasImage:false},B:{slots:2,name:(f.truncate(n.name,45)+", "+f.truncate(this.autofillData.getHotelAddress(n),65)).split(","),predictiveText:n.name+", "+this.autofillData.getHotelAddress(n,true),hasImage:true}},h=f(c.getTemplate("search-form-autofill-result",{id:"copter-hotels-"+l})),g="A",k,m;if(this.slots>0&&n.lat&&n.lng){f("#"+this.autofillDropdownId).append(h);n.image=null;if(l==0&&n.primaryPhoto&&this.autofillData.locations.length===0&&this.autofillData.airports.length===0){n.image=this.autofillData.getHotelPhoto(n,50,50);if(this.autofillData.locations.length>0&&this.locationImages[this.autofillData.locations[0].tid]){n.image=null}if(!this.placeholder.data("autofillPhotos")){n.image=null}if(n.image){g="B"}}this.slots-=j[g].slots;k=j[g].name;m=c.getTemplate(("search-form-autofill-hotel-"+g.toLowerCase()),{predictiveText:f.escapeHTML(j[g].predictiveText),namePartial1:k[0],namePartial2:((g=="A"&&e.rest(k).length>0)?", ":"")+e.rest(k).join(),img:n.image,stars:n.stars,rate:c.formatCurrency(n.historicalRates.lowest),lat:n.lat,lng:n.lng,udicode:n.udicode});if(!j[g].hasImage){f(m).find(".copter-autofill-image-b").remove()}h.append(m);this.setResultEventHandlers(h)}};a.setResultEventHandlers=function(g){var h=this;g.mouseenter(function(i){h.unhiliteResult(f("div.copter-autofill-result-sel:first"));h.hiliteResult(g)});g.click(function(i){h.selectLocation();h.expandControls()})};a.selectLocation=function(){var i=this,g=f("div.copter-autofill-result-sel:first"),k=["locationName","locationId","lat","lng","hotel"],j={text_typed:this.autofillControl.val()};if(g.length>0){var h=f(g.children()[0]);j.google_location=(h.data("google"))?true:false;this.autofillControl.val(h.data("locationName"));this.preselect.empty();this.hideAutoComplete(false);this.location={};f.each(k,function(m,l){if(h.data(l)){i.location[l]=h.data(l);j[c.request.underscore(l)]=h.data(l)}else{i.location[l]=null}});if(h.data("google")){this.location.cardType="map"}if(!this.location.locationId){this.location.minHotels=this.minHotels}i.enableSearch();c.UserAction.record("location_selected",j);c.trigger("locationSelected",this.location)}};a.selectLocationFromState=function(){if(c.currentLocation){var g=(c.currentLocation.name||c.State.get("locationName"));this.autofillControl.val(g);this.location={locationName:g,locationId:c.currentLocation.locationId,lat:c.currentLocation.lat,lng:c.currentLocation.lng,udicode:c.State.get("hotel")};this.cleanLocationData(c.currentLocation.locationId)}};a.selectLocationFromStorage=function(g){this.autofillControl.val(g.locationName);this.preselect.empty();this.location={locationName:g.locationName,locationId:g.locationId,lat:g.lat,lng:g.lng,udicode:g.hotel};this.cleanLocationData(g.locationId)};a.cleanLocationData=function(g){if(g){delete this.location.lat;delete this.location.lng}if(!this.location.locationId){this.location.minHotels=this.minHotels}this.enableSearch()};a.expandControls=function(){this.placeholder.find(".copter-search-form-stay .copter-form-fields").show()};a.controlsExpanded=function(){return(this.placeholder.find(".copter-search-form-stay .copter-form-fields:visible").length>0)};a.enableSearch=function(){this.placeholder.find(".copter-button").removeClass("copter-disabled")};a.disableSearch=function(){this.placeholder.find(".copter-button").addClass("copter-disabled")};a.showOrHideRecentSearchesButton=function(){var g=this.placeholder;if(c.Storage.get("recent_searches")&&g.data("showRecentSearchButton")){g.addClass("copter-has-recentsearches")}else{g.removeClass("copter-has-recentsearches")}};a.hideControls=function(){f("#dest-help").show();f("#sub-controls").hide();f("#search").animate({height:"176px"},250,c.easing)}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,f,e){var b=c.components.Filters=function(g){this.placeholder=f(g);this.ts=new Date().getTime();this.filters=null;this.defaultFilters=["rate","stars","amenity","property","brand","name","user"];this.sliderFilters=["rate","stars","user"];this.checkboxFilters=["amenity","brand","property"];this.optionalAmenities=["CASIN","SPA","SCU","GOLF","SKI","MTG"];this.selectedBrandsGroups={brand:{},group:{}};this.allBrandsGroups={brand:false,group:false};this.displayGroups=false;this.maxBrands=12};var a=b.prototype;b.cssClass="copter-filters";b.initialize=function(){var g=this;f("."+g.cssClass).each(function(h,k){var j=f(k);if(j.is(":empty")){g.createInstance(j.get(0))}})};b.createInstance=function(j,h){var g=this,i=f(j),k=null;h=(h||{});if(!h.maxLabelLength){h.maxLabelLength=22}if(!i){c.throwException("Attempted to create a Filters component but no placeholder argument was supplied.")}if(h.brands&&!f.isArray(h.brands)){h.brands=h.brands.split(",")}if(!h.filterType){h.filterType="lateral"}i.addClass(g.cssClass);f.each(h,function(m,l){i.data(m,l)});k=new g(j);k.assignPlaceholderEventHandlers();k.render();return k};a.render=function(){var g=this,h=this.placeholder;h.empty();h.data("instance",this);g.toggleLoadingState();if(h.data("sparklines")){h.addClass("copter-filters-sparklines")}if(h.data("filtersType")){h.addClass("copter-filters-"+h.data("filtersType"))}if(!h.data("filters")){h.data("filters",this.defaultFilters)}if(!f.isArray(h.data("filters"))){h.data("filters",h.data("filters").split(","))}this.displayGroups=!!(h.data("brandsGroupsDefault"))};a.toggleLoadingState=function(){var g=this.placeholder;if(c.currentLocation){g.removeClass("copter-loading")}else{g.addClass("copter-loading")}};a.assignPlaceholderEventHandlers=function(){var g=this,i=this.placeholder,h=function(){g.selectedBrandsGroups.brand={};g.selectedBrandsGroups.group={};g.filters=c.State.get();g.toggleLoadingState();g.redraw()};i.click(function(j){j.stopPropagation()});c.bindToElement(i,"hotelCardsLocationFound",function(j){h()});c.bindToElement(i,"stateChangedSearchExcludingLocationOrStay",function(j){h()});if(i.data("filtersType")=="popup"){c.bindToElement(i,"allBubblesClosed",function(j){i.find(".copter-filterheading").removeClass("copter-open")})}};a.redraw=function(){var h=this.placeholder,g=(h.is(":empty"));h.empty();this.renderFilterControls();this.renderSparklines();if(g){c.trigger("filtersRendered",h)}};a.renderFilterControls=function(){var g=this,h=g.placeholder;f.each(h.data("filters"),function(k,l){var j;h.append(c.getTemplate("filters-main",{filter:l,heading:g.getText(l+"Heading")}));j=g.renderFilterControl(l);if(h.data("filtersType")=="popup"){h.find(".copter-filter-"+l+" .copter-filterheading").append(c.getTemplate("filters-arrow"))}g.assignFilterControlHandlers(l,j);if(g.allBrandsGroups.brand){j.find(".copter-more-brands").click()}if(g.displayGroups){f("#copter-group-radio-"+g.ts).click();g.toggleBrandsGroups(j)}});h.append(f("<div/>").addClass("copter-clear"));h.find(".copter-filterheading:first").addClass("copter-first");h.find(".copter-filterheading:last").addClass("copter-last");if(h.data("filtersType")=="popup"){h.find(".copter-filter").css("width",(100/h.data("filters").length)+"%")}else{h.find(".copter-filtersummary, .copter-buttons").remove()}};a.renderFilterControl=function(h){var g=this.placeholder.find(".copter-filtercontrol-"+h).empty();if(h==="name"){this.renderHotelNameControl(g)}if(f.inArray(h,this.sliderFilters)>=0){this.renderSliderControl(h,g);this.renderSparkline(h)}if(f.inArray(h,this.checkboxFilters)>=0){this.renderCheckboxControl(h,g)}return g};a.assignFilterControlHandlers=function(h){var g=this,i=g.placeholder;if(i.data("filtersType")=="popup"){i.find(".copter-filter-"+h+" .copter-filterheading").click(function(p){var o=f(p.target),n,k,j,q,m,l;if(!o.is(".copter-filterheading")){o=o.parent(".copter-filterheading")}l=o.children(".copter-filterheading-label");p.stopPropagation();if(o.parent().children(".copter-bubble").length===0){m=function(){if(h==="brand"){g.selectedBrandsGroups.brand={};g.selectedBrandsGroups.group={}}};j=o.parent().next();n=g.renderFilterControl(h);k=c.components.Bubble.createInstance(j,l,{after:o,position:"bottom"});q=function(){i.css("z-index","");k.placeholder.parent(".copter-filter").css("z-index","");k.placeholder.css("z-index","");o.removeClass("copter-open");k.close()};c.bindToElement(j,"documentClick",function(){m();i.css("z-index","");k.placeholder.parent(".copter-filter").css("z-index","");k.placeholder.css("z-index","")});i.maxZIndex();k.placeholder.parent(".copter-filter").maxZIndex();k.placeholder.maxZIndex();o.addClass("copter-open");n.find(".copter-apply").click(function(r){r.preventDefault();g.applyFilter(h);q()});n.find(".copter-cancel").click(function(r){r.preventDefault();q();m()})}else{c.components.Bubble.closeAll();o.removeClass("copter-open")}});i.find(".copter-filter-"+h+" .copter-arrow-down").click(function(j){j.stopPropagation();g.removeFilter(h)})}};a.renderHotelNameControl=function(i){var h=(this.filters.hotelName||""),j,g;i.append(c.getTemplate("filters-name",{ts:this.ts,name:f.escapeHTML(h),labels:this.getAllText()}));i.find("input").keypress(function(l){var k=(l.keyCode?l.keyCode:l.which);if(k==13){i.find(".copter-apply").click()}});j=(h.length>0);g=(j)?h:this.getText("any");this.changeFilterHeadingState("name",j,g)};a.renderSliderControl=function(j,i){var g=this,l,k,h;i.show().append(c.getTemplate("filters-"+j,{labels:g.getAllText()}));l={rate:{min:c.currentLocation.aggregatedBestRates.lowest,max:c.currentLocation.aggregatedBestRates.highest+1,loText:c.currencySymbol+((g.filters.rateFrom&&(g.filters.rateFrom==c.currentLocation.aggregatedBestRates.lowest))?0:(g.filters.rateFrom||c.currentLocation.aggregatedBestRates.lowest)),hiText:c.currencySymbol+(g.filters.rateTo||c.currentLocation.aggregatedBestRates.highest)+((g.filters.rateTo&&(g.filters.rateTo==c.currentLocation.aggregatedBestRates.highest))?"+":""),lo:((g.filters.rateFrom&&(g.filters.rateFrom==c.currentLocation.aggregatedBestRates.lowest))?0:(g.filters.rateFrom||c.currentLocation.aggregatedBestRates.lowest)),hi:(g.filters.rateTo||c.currentLocation.aggregatedBestRates.highest+1),isSet:(g.filters.rateFrom||g.filters.rateTo)},stars:{min:0,max:5,loText:g.filters.starFrom,hiText:g.filters.starTo,lo:(g.filters.starFrom)?(g.filters.starFrom-1):0,hi:(g.filters.starTo)?g.filters.starTo:5,isSet:(g.filters.starFrom||g.filters.starTo)},user:{min:0,max:5,loText:g.filters.userFrom,hiText:g.filters.userTo,lo:(g.filters.userFrom)?(g.filters.userFrom-1):0,hi:(g.filters.userTo)?g.filters.userTo:5,isSet:(g.filters.userFrom||g.filters.userTo)}};i.children(".copter-control").slider({animate:false,range:true,step:1,min:l[j].min,max:l[j].max,values:[l[j].lo,l[j].hi],slide:function(p,o){var n=f(p.target).slider("option","min"),m=f(p.target).slider("option","max");if(j!="rate"&&o.values[0]==o.values[1]){return false}g.updateSliderState(j,o.values[0],o.values[1],n,m)},start:function(n,m){},stop:function(p,o){var n=f(p.target).slider("option","min"),m=f(p.target).slider("option","max");g.updateSliderState(j,o.values[0],o.values[1],n,m)},change:function(p,o){var n=f(p.target).slider("option","min"),m=f(p.target).slider("option","max");g.updateSliderState(j,o.values[0],o.values[1],n,m)}});k=i.find(".ui-slider-handle");k.css("margin-left",("-"+(k.outerWidth()/2)+"px"));g.updateSliderState(j,l[j].lo,l[j].hi,l[j].min,l[j].max);if(g.placeholder.data("filtersType")=="popup"){i.hide()}if(l[j].isSet&&(l[j].loText==l[j].hiText)){if(j=="stars"){h=l[j].hi+" "+((l[j].lo==1)?g.getText("star"):g.getText("star")+"s")}else{h=l[j].loText}}else{h=(l[j].isSet)?(l[j].loText+" "+g.getText("to")+" "+l[j].hiText):g.getText("any")}g.changeFilterHeadingState(j,l[j].isSet,h)};a.changeFilterHeadingState=function(i,h,g){var j=this.placeholder;if(h){j.children(".copter-filter-"+i).addClass("copter-applied")}else{j.children(".copter-filter-"+i).removeClass("copter-applied")}j.children(".copter-filter-"+i).children(".copter-filtersummary").html(g)};a.renderSparklines=function(){var g=this;if(this.placeholder.data("sparklines")){f.each(this.sliderFilters,function(h,j){g.renderSparkline(j)})}};a.renderSparkline=function(j){var i=this.placeholder,m={rate:"hotelCountByRate",stars:"hotelCountByStarRating",user:"hotelCountByUserRating"},l,k,g,r;if(i.data("sparklines")){var o=c.currentLocation[m[j]],q=i.find(".copter-filtercontrol-"+j),h=q.children(".copter-filtersparkline"),n={};if(o){l=i.find(".copter-filtercontrol-"+j+" .copter-filtersparkline").css("color");k=i.find(".copter-filtercontrol-"+j+" .copter-filtersparkline").css("outline-color");g=i.find(".copter-filtercontrol-"+j+" .copter-filtersparkline-unselected").css("color");r=i.find(".copter-filtercontrol-"+j+" .copter-filtersparkline-unselected").css("outline-color");if(l&&!k){k=(j=="rate")?f.colorChange(l,0.3):f.colorChange(l,0.1,true)}if(g&&!r){r=(j=="rate")?f.colorChange(g,0.5):f.colorChange(g,0.1,true)}n={rate:{options:{type:"line",chartRangeMin:0,width:h.width()+"px",height:h.height()+"px",spotColor:"",spotRadius:0,lineWidth:1,lineColor:l,fillColor:k},unselectedOptions:{lineColor:g,fillColor:r}},stars:{options:{type:"bar",chartRangeMin:0,barWidth:(h.width()/5)-1,height:h.height()+"px",colorMap:[l,k,l,k,l]},unselectedOptions:{colorMap:[g,r,g,r,g]}},user:{options:{type:"bar",chartRangeMin:0,barWidth:(h.width()/5)-1,height:h.height()+"px",colorMap:[l,k,l,k,l]},unselectedOptions:{colorMap:[g,r,g,r,g]}}};h.sparkline(o,n[j].options);q.children(".copter-filtersparkline-unselected").sparkline(o,f.extend({},n[j].options,n[j].unselectedOptions))}}};a.updateSliderState=function(o,n,i,s,u){var q=this,l,k,g,r,y,w,m=q.placeholder.find(".copter-filtercontrol-"+o),x=m.children(".copter-filtersparkline"),p=m.children(".copter-sliderlabel-left"),t=m.children(".copter-sliderlabel-right"),v=m.find(".ui-slider-handle"),j=(n-s)*(x.width()/(u-s)),h=(i-s)*(x.width()/(u-s));this.clipSparkline(o,x,j,h,i,n);if(o==="rate"){l=c.currencySymbol+n;k=c.currencySymbol+i;if(n===s){l=c.currencySymbol+"0"}if(i===u){k+="+"}p.html(l);t.html(k);g=0-(v.outerWidth()/2);r=(x.width()-t.outerWidth())+(v.outerWidth()/2);y=j-(p.outerWidth()/2);w=h-(t.outerWidth()/2);if(y<g){y=g}if(w>r){w=r}if((y+p.width())>=(w-20)){t.css("left","0");t.html(l+"&nbsp;"+q.getText("to")+"&nbsp;"+k);p.html("");w=(w-((w-y)/2))-(t.width()/3.5);r=(x.width()-t.outerWidth())+(v.outerWidth()/2);if(w<g){w=g}if(w>r){w=r}}p.css("left",Math.round(y)+"px");t.css("left",Math.round(w)+"px")}else{this.greyOutUnselectedNumbers(m,n,i,s,u)}};a.clipSparkline=function(g,n,l,k,h,j){var i,o,m=(n.width()-1);switch(g){case"rate":i=Math.round(k);o=Math.round(l);break;case"stars":i=Math.round(h*(m/5));o=Math.round(j*(m/5));break;case"user":i=Math.round(h*(m/5));o=Math.round(j*(m/5));break}n.css("clip","rect(0px,"+i+"px,"+n.height()+"px,"+o+"px)")};a.greyOutUnselectedNumbers=function(m,n,j,l,g){var h=m.children(".copter-nums");for(var k=l;k<=g;k++){if(k<n||k>=j){h.children().eq(k).addClass("copter-unselected")}else{h.children().eq(k).removeClass("copter-unselected")}}};a.renderCheckboxControl=function(k,i){var g=this,m=g.placeholder,j=(k==="brand")?"filters-brand":"filters-checkbox-list",h=(m.data(k+"Columns")||1),l;l=i.append(c.getTemplate(j,{ts:g.ts,filter:k,columns:h,labels:g.getAllText()}));if(m.data("noGroups")||!c.currentLocation.groups||c.currentLocation.groups.length===0){f(".copter-brand-group-toggle").remove()}k=k.charAt(0).toUpperCase()+k.slice(1);g["render"+k+"Checkboxes"](l);g["assign"+k+"EventHandlers"](l);if(h>1){g.divideIntoColumns(k.toLowerCase(),l,h)}if(h>1&&k.toLowerCase()==="brand"){g.divideIntoColumns("group",l,h)}};a.divideIntoColumns=function(j,l,h){var k=(j==="brand"||j==="group")?l.find(".copter-checkbox-"+j+" .copter-column-1 li"):l.find(".copter-column-1 li"),n=parseInt(k.length/h),i=(k.length%h),m=1,g=0;f.each(k,function(r,p){var o=(m<=i)?(n+1):n,q=(j==="brand"||j==="group")?l.find(".copter-checkbox-"+j+" .copter-column-"+m):l.find(".copter-column-"+m);if(m>1){f(p).appendTo(q)}g++;if(g==o){g=0;m++}})};a.renderAmenityCheckboxes=function(l){var g=this,m=l.find(".copter-column-1"),k=0,i,h,j;if(g.filters.amenities&&!f.isArray(g.filters.amenities)){g.filters.amenities=g.filters.amenities.split(",")}if(g.filters.amenities&&g.filters.amenities.length>0){l.find(".copter-checkbox-any input").removeAttr("checked")}f.each(c.currentLocation.amenities,function(p,o){var n=(f.inArray(o.id,g.optionalAmenities)>=0),q=(g.filters.amenities&&f.inArray(o.id,g.filters.amenities)>=0);if(!n||(n&&o.hotelCount>0)){g.renderCheckboxRow(m,("copter-amenity-"+o.id+"-"+g.ts),o.id,o.name,q)}if(q){k++;i=(k==1)?o.name:(k+" "+g.getText("selected"))}});j=(l.find(".copter-checkbox-any input:checked").length==0);h=(j)?i:g.getText("any");g.changeFilterHeadingState("amenity",j,h)};a.renderPropertyCheckboxes=function(l){var g=this,m=l.find(".copter-column-1"),k=0,i,h,j;if(g.filters.propertyTypes&&!f.isArray(g.filters.propertyTypes)){g.filters.propertyTypes=g.filters.propertyTypes.split(",")}if(g.filters.propertyTypes&&g.filters.propertyTypes.length>0){l.find(".copter-checkbox-any input").removeAttr("checked")}f.each(c.currentLocation.propertyTypes,function(o,n){var p=(g.filters.propertyTypes&&f.inArray(n.code,g.filters.propertyTypes)>=0);if(n.hotelCount>0){g.renderCheckboxRow(m,("copter-property-"+n.code+"-"+g.ts),n.code,n.name,p)}if(p){k++;i=(k==1)?n.name:(k+" "+g.getText("selected"))}});j=(l.find(".copter-checkbox-any input:checked").length==0);h=(j)?i:g.getText("any");g.changeFilterHeadingState("property",j,h)};a.renderBrandCheckboxes=function(l){var g=this,m=this.placeholder,k=0,i="",h,j;if(g.filters.brands&&!f.isArray(g.filters.brands)){g.filters.brands=g.filters.brands.split(",")}if(g.filters.brands&&g.filters.brands.length>0){l.find(".copter-checkbox-any input").removeAttr("checked");f.each(g.filters.brands,function(n,o){g.selectedBrandsGroups.brand[o]=true})}else{if(!e.isEmpty(g.selectedBrandsGroups.brand)||!e.isEmpty(g.selectedBrandsGroups.group)){l.find(".copter-checkbox-any input").removeAttr("checked")}}g.renderBrandGroupCheckboxes("brand",l,true);g.renderBrandGroupCheckboxes("group",l,true);if(g.filters.brands){f.each(g.filters.brands,function(n,p){var o=l.find('.copter-checkbox-brand input[value="'+p+'"]');g.handleBrandGroupOptionClick(l,o)})}g.renderBrandGroupCheckboxes("brand",l);g.renderBrandGroupCheckboxes("group",l);if(g.filters.brands){f.each(g.filters.brands,function(n,o){k++;i=(k==1)?c.currentLocation.getBrandById(o).name:(k+" "+g.getText("selected"))})}j=(k>0);h=(j)?i:g.getText("any");g.changeFilterHeadingState("brand",j,h)};a.renderBrandGroupCheckboxes=function(i,j,h){var g=this,k=this.placeholder,m=j.find(".copter-checkbox-"+i+" .copter-column-1"),l=(h)?c.currentLocation[i+"s"]:((i=="brand"&&f.isArray(k.data("brands")))?c.currentLocation.specifiedBrands(k.data("brands"),this.maxBrands):c.currentLocation._selectedBrandsGroups(this.maxBrands,(i+"s")));j.find(".copter-checkbox-"+i+" .copter-checkbox-options").empty();if(l&&l.length>0){f.each(l,function(o,r){var q=(g.selectedBrandsGroups[i][r.id]||false),p=(r.aggregatedBestRates)?c.formatCurrency(r.aggregatedBestRates.lowest):"",n=(h)?(k.data("maxLabelLength")-2):null;if(r.hotelCount>0){g.renderCheckboxRow(m,("copter-"+i+"-"+r.id+"-"+g.ts),r.id,r.name,q,p,n);if(r.groupId){f("#copter-"+i+"-"+r.id+"-"+g.ts).data("groupId",r.groupId)}}});if(c.currentLocation[i+"s"].length<=this.maxBrands){j.find(".copter-more-"+i+"s").remove()}}};a.renderCheckboxRow=function(i,g,n,m,o,l,h){var j=(o)?'class="copter-checked"':"",k=(h||this.placeholder.data("maxLabelLength")),p;o=(o)?'checked="checked"':"";p=f(c.getTemplate("filters-checkbox",{id:g,value:n,label:f.truncate(m,k),rate:(l||""),checked:o,classattr:j}));if(m.length>k){p.attr("title",m)}i.append(p)};a.assignAmenityEventHandlers=function(g){this.assignCheckboxEventHandlers(g)};a.assignPropertyEventHandlers=function(g){this.assignCheckboxEventHandlers(g)};a.assignCheckboxEventHandlers=function(i){var g=this,j=i.find(".copter-checkbox-options"),h=i.find(".copter-checkbox-any input");h.click(function(k){g.handleAnyClick(i,f(k.target));i.find(".copter-checkbox-options li").removeClass("copter-checked")});j.click(function(l){var k=f(l.target);if(k.is("input")){if(k.is(":checked")){h.removeAttr("checked");k.parent().addClass("copter-checked")}else{if(j.find("input:checked").length==0){h.attr("checked","checked")}k.parent().removeClass("copter-checked")}}})};a.assignBrandEventHandlers=function(h){var g=this;h.find(".copter-brand-group-toggle input").click(function(){g.toggleBrandsGroups(h)});h.find(".copter-more-less").click(function(i){i.preventDefault();g.expandCollapseBrandsGroups(h,f(i.target))});h.find(".copter-checkbox-any input").click(function(i){g.handleBrandGroupAnyClick(h,f(i.target));h.find(".copter-checkbox-options li").removeClass("copter-checked")});h.find(".copter-checkbox-options").click(function(i){if(f(i.target).is("input")){g.handleBrandGroupOptionClick(h,f(i.target))}})};a.toggleBrandsGroups=function(h){var g=h.find(".copter-brand-group-toggle input:checked").val();if(g==="brand"){this.displayGroups=false;h.find(".copter-checkbox-brand").show();h.find(".copter-checkbox-group").hide()}else{this.displayGroups=true;h.find(".copter-checkbox-brand").hide();h.find(".copter-checkbox-group").show();if(this.allBrandsGroups.group){h.find(".copter-more-groups").click()}}};a.expandCollapseBrandsGroups=function(i,h){var g=(h.hasClass("copter-more-brands")||h.hasClass("copter-less-brands"))?"brand":"group";if(h.hasClass("copter-more-"+g+"s")){this.expandBrandsGroups(i,g,h)}else{this.collapseBrandsGroups(i,g,h)}};a.expandBrandsGroups=function(l,j,k){var i=l.find(".copter-checkbox-"+j+" .copter-checkbox-columns").outerHeight(),g=(this.placeholder.data("brandColumns")||3);k.removeClass("copter-more-"+j+"s").addClass("copter-less-"+j+"s").html(this.getText("less"+f.capitalize(j)+"s"));l.find(".copter-checkbox-"+j+" .copter-checkbox-columns").wrap(f("<div/>").css("height",i+"px").addClass("copter-checkbox-columns-scroll"));this.allBrandsGroups[j]=true;this.renderBrandGroupCheckboxes(j,l,true);if(g>1){this.divideIntoColumns(j,l,g)}};a.collapseBrandsGroups=function(j,h,i){var g=(this.placeholder.data("brandColumns")||3);i.removeClass("copter-less-"+h+"s").addClass("copter-more-"+h+"s").html(this.getText("more"+f.capitalize(h)+"s"));j.find(".copter-checkbox-"+h+" .copter-checkbox-columns").unwrap();this.allBrandsGroups[h]=false;this.renderBrandGroupCheckboxes(h,j);if(g>1){this.divideIntoColumns(h,j,g)}};a.handleBrandGroupAnyClick=function(h,g){if(g.is(":checked")){this.selectedBrandsGroups.brand={};this.selectedBrandsGroups.group={}}this.handleAnyClick(h,g)};a.handleAnyClick=function(h,g){if(g.is(":checked")){h.find(".copter-checkbox-any input").attr("checked","checked");h.find(".copter-checkbox-options input").removeAttr("checked");this.selectedBrandsGroups.brand={};this.selectedBrandsGroups.group={};g.parent().removeClass("copter-checked")}else{g.attr("checked","checked");g.parent().addClass("copter-checked")}};a.handleBrandGroupOptionClick=function(m,l){var h=this,g=(l.attr("id").indexOf("copter-brand")===0),n=l.is(":checked"),k=m.find(".copter-checkbox-any input"),j,i;k.removeAttr("checked");if(g){i=l.data("groupId");if(n){this.selectedBrandsGroups.brand[l.val()]=true;l.parent().addClass("copter-checked")}else{delete this.selectedBrandsGroups.brand[l.val()];l.parent().removeClass("copter-checked");if(e.isEmpty(this.selectedBrandsGroups.brand)){k.attr("checked","checked")}}f("#copter-group-"+i+"-"+this.ts).removeAttr("checked").parent().removeClass("copter-checked");delete this.selectedBrandsGroups.group[i];if(i){j=true;f.each(c.currentLocation.brands,function(o,p){if(p.groupId&&p.groupId==i&&!h.selectedBrandsGroups.brand[p.id]){j=false}return j});if(j){f("#copter-group-"+i+"-"+this.ts).attr("checked","checked").parent().addClass("copter-checked");this.selectedBrandsGroups.group[i]=true}}}else{i=l.val();if(n){this.selectedBrandsGroups.group[i]=true;l.parent().addClass("copter-checked")}else{delete this.selectedBrandsGroups.group[i];l.parent().removeClass("copter-checked")}f.each(c.currentLocation.brands,function(o,q){var p=f("#copter-brand-"+q.id+"-"+h.ts);if(n&&q.groupId&&q.groupId==i){p.attr("checked","checked").parent().addClass("copter-checked");h.selectedBrandsGroups.brand[q.id]=true}if(!n&&q.groupId&&q.groupId==i){p.removeAttr("checked").parent().removeClass("copter-checked");delete h.selectedBrandsGroups.brand[q.id]}});if(e.isEmpty(h.selectedBrandsGroups.group)){m.find(".copter-checkbox-group .copter-checkbox-any input").attr("checked","checked")}if(e.isEmpty(h.selectedBrandsGroups.brand)){k.attr("checked","checked")}}};a.getFilterSettings=function(k){var h=this,i=this.placeholder.find(".copter-filtercontrol-"+k),g=function(){var l=[];i.find(".copter-checkbox-options li input:checked").each(function(m,n){l.push(f(n).val())});return l},j={rate:function(){return{rateFrom:i.find(".copter-control").slider("option","values")[0],rateTo:i.find(".copter-control").slider("option","values")[1]}},stars:function(){return{starFrom:(i.find(".copter-control").slider("option","values")[0]+1),starTo:i.find(".copter-control").slider("option","values")[1]}},user:function(){return{userFrom:(i.find(".copter-control").slider("option","values")[0]+1),userTo:i.find(".copter-control").slider("option","values")[1]}},amenity:function(){return{amenities:g()}},property:function(){return{propertyTypes:g()}},brand:function(){return{brands:function(){var l=[];f.each(h.selectedBrandsGroups.brand,function(n,m){l.push(n)});return l}()}},name:function(){return{hotelName:i.find("input").val()}}};return j[k]()};a.getAllFilterSettings=function(){var g=this,h={};f.each(this.placeholder.data("filters"),function(j,k){h=f.extend(h,g.getFilterSettings(k))});return h};a.applyFilter=function(i){var h=this.getFilterSettings(i),g=c.UserAction.getState(true),j=f.extend({filter_applied:i},g);c.State.set(h);window.setTimeout(function(){c.UserAction.record("apply_filter",j,true)},500)};a.removeFilter=function(h){var g={rate:function(){return{rateFrom:null,rateTo:null}},stars:function(){return{starFrom:null,starTo:null}},user:function(){return{userFrom:null,userTo:null}},amenity:function(){return{amenities:null}},property:function(){return{propertyTypes:null}},brand:function(){return{brands:null}},name:function(){return{hotelName:null}}};c.State.set(g[h]())}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,e){var b=c.components.Sort=function(f){this.placeholder=e(f);this.ts=new Date().getTime();this.filters=null;this.defaultSortOptions=["rank-desc","distance-asc","rate-asc","rate-desc","name-asc","name-desc","stars-asc","stars-desc"]};var a=b.prototype;b.cssClass="copter-sort";b.initialize=function(){var f=this;e("."+f.cssClass).each(function(g,j){var h=e(j);if(h.is(":empty")){f.createInstance(h.get(0),h.data("hotelCards"))}})};b.createInstance=function(j,g,h){var f=this,i=e(j),k=null;h=(h||{});if(!h.maxLabelLength){h.maxLabelLength=22}if(!i){c.throwException("Attempted to create a Sort component but no placeholder argument was supplied.")}if(!g){c.throwException("Attempted to create a Sort component but no hotelCards argument was supplied.")}h.hotelCards=g;if(h.sortOptions&&!e.isArray(h.sortOptions)){h.sortOptions=h.sortOptions.split(",")}i.addClass(f.cssClass);e.each(h,function(m,l){i.data(m,l)});k=new f(j);k.assignPlaceholderEventHandlers();k.render();return k};a.render=function(){var f=this,g=this.placeholder;g.empty();g.data("instance",this);if(!g.data("sortOptions")){g.data("sortOptions",this.defaultSortOptions)}};a.assignPlaceholderEventHandlers=function(){var f=this,h=this.placeholder,g=function(){f.filters=c.State.get();f.redraw()};h.click(function(i){i.stopPropagation()});c.bindToElement(h,"hotelCardsLocationFound",function(){g()});c.bindToElement(h,"stateChangedSearchExcludingLocationOrStay",function(){g()});c.bindToElement(h,"allBubblesClosed",function(i){h.find(".copter-sortheading").removeClass("copter-open")})};a.redraw=function(){this.placeholder.empty();this.renderSortControl()};a.renderSortControl=function(){var g=this,j=g.placeholder,i,h=(j.data("custom")&&j.data("custom")=="true"),f=(h)?"-custom":"";j.append(c.getTemplate(("sort-main"+f),{heading:g.getText("sort")}));i=j.children(".copter-sortcontrol");e.each(j.data("sortOptions"),function(l,m){var k=e(c.getTemplate(("sort-option"+f),{option:g.getText(m.replace("-","")),value:m}));if(m==(g.filters.sort+"-"+g.filters.sortDirection)){if(h){k.addClass("copter-selected")}else{k.attr("selected","selected")}}i.append(k)});g.assignSortControlHandlers();if(h){j.children(".copter-sortsummary").html(g.getText(g.filters.sort+g.filters.sortDirection))}c.trigger("sortRendered",j)};a.assignSortControlHandlers=function(){var f=this,h=f.placeholder,g=(h.data("custom")&&h.data("custom")=="true");if(g){h.find(".copter-sortheading").click(function(l){var k=e(l.target),i,m,j;if(!k.is(".copter-sortheading")){k=k.parent(".copter-sortheading")}j=k.children(".copter-sortheading-label");l.stopPropagation();if(k.parent().children(".copter-bubble").length===0){i=c.components.Bubble.createInstance(h.children(".copter-sortcontrol"),j,{after:k,position:"bottom"});k.addClass("copter-open");m=function(){k.removeClass("copter-open");i.close()};h.find(".copter-sort-option").click(function(n){n.preventDefault();f.applySort(e(n.target).data("option"));m()})}else{c.components.Bubble.closeAll();k.removeClass("copter-open")}})}else{h.find(".copter-sortcontrol").change(function(i){f.applySort(e(i.target).val())})}};a.getSort=function(f){return{sort:this.filters.sort,sortDirection:this.filters.sortDirection}};a.applySort=function(j){var h=this.placeholder,f=j.split("-")[0],g=j.split("-")[1],k=c.State.get("sort"),i=c.State.get("sortDirection");this.filters.sort=f;this.filters.sortDirection=g;if(h.data("instantApply")&&h.data("instantApply")=="true"){c.State.set({sort:f,sortDirection:g});c.UserAction.record("sort_changed",{sort:f,sort_direction:g,previous_sort:k,previous_sort_direction:i});c.trigger("sortChanged",{previousSort:k,previousSortDirection:i,sort:f,sortDirection:g})}else{this.redraw()}}})(hotelicopter,hotelicopter.$);(function(c,e){var b=c.components.View=function(f){this.placeholder=e(f);this.ts=new Date().getTime();this.cardType=null;this.defaultViewOptions=["gallery","summary","map"]};var a=b.prototype;b.cssClass="copter-view";b.initialize=function(){var f=this;e("."+f.cssClass).each(function(g,j){var h=e(j);if(h.is(":empty")){f.createInstance(h.get(0),h.data("hotelCards"))}})};b.createInstance=function(j,g,h){var f=this,i=e(j),k=null;h=(h||{});if(!h.maxLabelLength){h.maxLabelLength=22}if(!i){c.throwException("Attempted to create a View component but no placeholder argument was supplied.")}if(!g){c.throwException("Attempted to create a View component but no hotelCards argument was supplied.")}h.hotelCards=g;if(h.viewOptions&&!e.isArray(h.viewOptions)){h.viewOptions=h.viewOptions.split(",")}if(!h.controlType){h.controlType="links"}i.addClass(f.cssClass);e.each(h,function(m,l){i.data(m,l)});k=new f(j);k.assignPlaceholderEventHandlers();k.render();return k};a.render=function(){var f=this.placeholder;f.empty();f.data("instance",this);if(!f.data("viewOptions")){f.data("viewOptions",this.defaultViewOptions)}};a.assignPlaceholderEventHandlers=function(){var f=this,h=this.placeholder,g=function(){f.cardType=c.State.get("cardType");f.redraw()};h.click(function(i){i.stopPropagation()});c.bindToElement(h,"stateChangedCardType",function(){g()});c.bindToElement(h,"hotelCardsLocationFound",function(){g()});c.bindToElement(h,"stateChangedSearchExcludingLocationOrStay",function(){g()});c.bindToElement(h,"allBubblesClosed",function(i){h.find(".copter-viewheading").removeClass("copter-open")})};a.redraw=function(){this.placeholder.empty();this.renderViewControl()};a.renderViewControl=function(){var f=this,h=f.placeholder,i=h.data("controlType"),g;h.addClass("copter-view-"+i);h.append(c.getTemplate("view-"+i,{heading:f.getText("view")}));g=h.children(".copter-viewcontrol");e.each(h.data("viewOptions"),function(k,l){var j=e(c.getTemplate("view-option",{option:f.getText(l)}));j.data("option",l);if(l==(f.cardType)){j.addClass("copter-selected")}if(k==0){j.addClass("copter-first")}g.append(j)});g.append('<div class="copter-clear" />');f.assignViewControlHandlers();h.children(".copter-viewsummary").html(f.getText(f.cardType));c.trigger("viewRendered",h)};a.assignViewControlHandlers=function(){var f=this,g=f.placeholder;if(g.data("controlType")=="links"){g.find(".copter-view-option").click(function(h){h.preventDefault();f.applyView(e(h.target).data("option"))})}else{if(g.data("controlType")=="dropdown"){g.find(".copter-viewheading").click(function(k){var j=e(k.target),h,l,i;if(!j.is(".copter-viewheading")){j=j.parent(".copter-viewheading")}i=j.children(".copter-viewheading-label");k.stopPropagation();if(j.parent().children(".copter-bubble").length===0){h=c.components.Bubble.createInstance(g.children(".copter-viewcontrol"),i,{after:j,position:"bottom"});j.addClass("copter-open");l=function(){j.removeClass("copter-open");h.close()};g.find(".copter-view-option").click(function(m){m.preventDefault();f.applyView(e(m.target).data("option"));l()})}else{c.components.Bubble.closeAll();j.removeClass("copter-open")}})}}};a.applyView=function(f){var g={view:f,previous_view:c.State.get("cardType")},h={cardType:f};if(c.State.get("cardType")=="map"){h.radius=null}c.UserAction.record("view_change",g);c.State.set(h);c.trigger("viewChanged",g)}})(hotelicopter,hotelicopter.$);(function(c,f,e){var b=c.components.SearchResults=function(g){this.placeholder=f(g);this.ts=new Date().getTime();this.mapScrollTimeout=null;this.dateSliderVisible=false};var a=b.prototype;b.cssClass="copter-searchresults";b.initialize=function(){var g=this;f("."+g.cssClass).each(function(h,k){var j=f(k);if(j.is(":empty")){g.createInstance(j.get(0))}})};b.createInstance=function(j,h){var g=this,i=f(j),k=null;h=(h||{});if(!i){c.throwException("Attempted to create a SearchResults component but no placeholder argument was supplied.")}i.addClass(g.cssClass);f.each(h,function(m,l){i.data(m,l)});k=new g(j);k.assignGlobalEventHandlers();return k};a.assignGlobalEventHandlers=function(){var g=this,h=this.placeholder;c.bindToElement(h,"stateChangedLocation",function(i){if(h.is(":empty")){g.render()}else{g.renderHeading()}});c.bindToElement(h,"stateChangedSearch",function(i){g.renderHeading();if(c.State.get("cardType")!="map"){g.removeMap()}h.find(".copter-view-count .copter-checking").show().html(g.getText("searching"));h.find(".copter-view-count .copter-count").hide()});c.bindToElement(h,"hotelCardsLocationFound",function(j,i){g.renderHeading();if(c.State.get("cardType")=="map"){g.renderMap()}g.renderTotalCount()});c.bindToElement(h,"stateChangedCardType",function(j,i){if(i=="map"){g.renderMap()}else{g.removeMap()}});c.bindToElement(h,"windowScroll",function(j,i){if(h.is(":visible")&&c.State.get("cardType")=="map"){g.positionMap()}});c.bindToElement(h,"windowResize",function(j,i){if(h.is(":visible")&&c.State.get("cardType")=="map"){g.redrawMap()}});c.bindToElement(h,"hotelCardsRendered",function(j,i){if(h.children().length>0){var k=(c.isDatedSearch())?g.getText("checkingRates"):g.getText("searching");if(!c.isDatedSearch()||i.complete){h.find(".copter-view-count .copter-checking").hide();h.find(".copter-view-count .copter-count").show();g.renderDisplayCount(i.hotels.length)}else{h.find(".copter-view-count .copter-checking").show().html(k);h.find(".copter-view-count .copter-count").hide()}if(i.hotels.length===0){h.find(".copter-view-count .copter-count").hide();if(i.complete){if(h.find(".copter-map-update-results-wrapper input:checked").length==0){h.find(".copter-checking").html(g.getText("zeroHotelsFound"));g.removeMap()}else{h.find(".copter-zero-results").hide()}}}else{if(c.State.get("cardType")=="map"){g.renderMap()}}h.find(".copter-view-count .copter-view").css("visibility","visible")}})};a.render=function(){var h=this.placeholder,g="search-results-"+h.data("filtersType")+"-filters";h.data("instance",this);h.html(c.getTemplate(g,{labels:this.getAllText(),ts:this.ts}));this.renderHeading();this.renderFilters();this.renderSort();this.renderDateSlider();this.renderView();this.renderHotelCards();this.assignEventHandlers()};a.renderFilters=function(){var g=this.placeholder;c.components.Filters.createInstance(g.find(".copter-filters-primary"),{brands:g.data("filterBrands"),groups:g.data("filterGroups"),noGroups:false,sparklines:true,filtersType:g.data("filtersType"),filters:g.data("filtersPrimary"),maxLabelLength:g.data("filtersMaxLabelLength"),amenityColumns:g.data("filtersAmenityColumns"),propertyColumns:g.data("filtersPropertyColumns"),brandColumns:g.data("filtersBrandColumns"),brandsGroupsDefault:g.data("filtersBrandsGroupsDefault")});if(g.data("filtersSecondary")){c.components.Filters.createInstance(g.find(".copter-filters-secondary"),{brands:g.data("filterBrands"),groups:g.data("filterGroups"),noGroups:false,sparklines:true,filtersType:g.data("filtersType"),filters:g.data("filtersSecondary"),maxLabelLength:g.data("filtersMaxLabelLength"),amenityColumns:g.data("filtersAmenityColumns"),propertyColumns:g.data("filtersPropertyColumns"),brandColumns:g.data("filtersBrandColumns"),brandsGroupsDefault:g.data("filtersBrandsGroupsDefault")})}};a.renderSort=function(){c.components.Sort.createInstance(this.placeholder.find(".copter-sort"),("copter-hotelcards-"+this.ts),{sortOptions:["distance-asc","rate-asc","rate-desc","name-asc","name-desc","stars-asc","stars-desc"]})};a.renderDateSlider=function(){c.components.DateSlider.createInstance(this.placeholder.find(".copter-dateslider"),{checkIn:c.State.get("checkIn"),checkOut:c.State.get("checkOut")})};a.renderView=function(){c.components.View.createInstance(this.placeholder.find(".copter-view"),("copter-hotelcards-"+this.ts))};a.renderDisplayCount=function(g){this.placeholder.find(".copter-hotel-display-count").html(g)};a.renderTotalCount=function(){this.placeholder.find(".copter-hotel-total-count").html(c.currentLocation.hotelCount)};a.renderHotelCards=function(){var g=this,i=g.placeholder,h={};f.each(c.components.HotelCards.dataAttributes,function(l,j){var k=i.data(j);if(k){h[j]=k}});c.components.HotelCards.createInstance(i.find(".copter-hotelcards"),h)};a.renderMap=function(h){var k=this.placeholder,i="copter-map-"+this.ts,j=null,l,g;if(f("#"+i).length==0){j=f(c.getTemplate("search-results-map",{labels:this.getAllText(),id:i}));k.find(".copter-results-wrapper").append(j);c.components.Map.createInstance(j,{hotels:h,updateResults:true,renderHotelCards:true,locationMapPin:k.data("locationMapPin"),hotelMapPin:k.data("hotelMapPin"),numberedMapPins:k.data("numberedMapPins"),mapPinWidth:k.data("mapPinWidth"),mapPinHeight:k.data("mapPinHeight"),mapPinAnchorX:k.data("mapPinAnchorX"),mapPinAnchorY:k.data("mapPinAnchorY")});l=(k.find(".copter-map-update-results-wrapper").height()||0);g=parseInt((f("#"+i).css("padding-bottom")||0));f("#"+i).css({"padding-bottom":(g+l)+"px"});this.initMapSize(j);j.maxZIndex();f(".copter-lightbox").maxZIndex();f(".copter-bubble").maxZIndex()}return j};a.redrawMap=function(){var h=this,i=f("#copter-map-"+h.ts),g;window.setTimeout(function(){if(i.length>0&&i.data("instance")&&i.data("instance").hotels){g=i.data("instance").hotels;i.remove();i=h.renderMap(g);i.data("instance").renderMap();if(g){i.data("instance").renderMarkers(g)}h.positionMap()}},250)};a.initMapSize=function(k){var j=this.placeholder,h=j.find(".copter-hotelcards"),l,i,g;g=(parseInt(k.css("padding-top"))||0)+(parseInt(k.css("padding-bottom"))||0);l=parseInt(k.css("left")||0);i=(f(window).height()-(h.offset().top+g));k.css({top:"0",width:(h.width()-l)+"px",height:(i+f(window).scrollTop())+"px"});k.data({origHeight:i,origTop:k.position().top,origOffsetTop:k.offset().top,origPosition:k.css("position"),origParent:k.parent(),origLeft:k.position().left})};a.removeMap=function(){this.placeholder.find(".copter-map").remove()};a.positionMap=function(){var i=this,n=this.placeholder,m=n.find(".copter-map"),h=i.isSafari(),k,j,l,g;if(m.length>0){if(typeof i.mapScrollTimeout=="number"){window.clearTimeout(i.mapScrollTimeout)}k=n.find(".copter-hotelcards");j=(f(window).scrollTop()>(k.offset().top+k.height()-f(window).height()));if(f(window).scrollTop()>=m.data("origOffsetTop")){if((m.css("position")!="fixed")||((m.css("position")=="fixed")&&(m.height()<f(window).height()))||j){g=(parseInt(m.css("padding-top"))||0)+(parseInt(m.css("padding-bottom"))||0);if(j){l={position:(h)?"absolute":"fixed",top:(h)?(m.data("origTop")+"px"):"0",left:(h)?(m.data("origLeft")+"px"):(m.data("origLeft")+n.offset().left),height:(((k.offset().top+k.height())-(f(window).scrollTop()+g))+"px")}}else{l={position:(h)?"absolute":"fixed",top:(h)?(m.data("origTop")+"px"):"0",left:(h)?(m.data("origLeft")+"px"):(m.data("origLeft")+n.offset().left),height:((f(window).height()-g)+"px")}}m.stop().css(l);if(!h){m.appendTo(n)}if(m.data("instance")){m.data("instance").triggerResize()}}}else{m.stop().css({position:m.data("origPosition"),left:m.data("origLeft")+"px",top:m.data("origTop")+"px",height:(f(window).height())+"px"}).appendTo(m.data("origParent"));i.mapScrollTimeout=window.setTimeout(function(){m.css({height:((m.data("origHeight")+f(window).scrollTop())+"px")})},500)}}};a.isSafari=function(){var h=navigator.userAgent.toLowerCase(),g;g=(/safari/.test(h))?true:false;return(g&&!navigator.geolocation)?true:false};a.renderHeading=function(){var h=this,k=this.placeholder,j=(c.State.get("locationId"))?this.getText("hotelsIn"):this.getText("hotelsNear"),g=this.locationName(),l=".copter-heading .copter-heading-location, .copter-heading .copter-heading-check-in, .copter-heading .copter-heading-check-out, .copter-heading .copter-heading-rooms, .copter-heading .copter-heading-guests, .copter-heading .copter-button",m=(k.data("summaryDateFormat")||c.dateFormat),i;if(c.isDatedSearch()){i=c.getTemplate("search-results-heading-dated",{hotelsIn:j,location:f.truncate(g,50),checkIn:f.datepicker.formatDate(m,f.datepicker.parseDate("yy-mm-dd",c.State.get("checkIn"))),checkOut:f.datepicker.formatDate(m,f.datepicker.parseDate("yy-mm-dd",c.State.get("checkOut"))),rooms:c.State.get("rooms"),guests:c.State.get("guests"),labels:this.getAllText()})}else{i=c.getTemplate("search-results-heading-dateless",{hotelsIn:j,location:f.truncate(g,50),labels:this.getAllText()})}k.children(".copter-heading").empty().append(i);k.find(l).click(function(p){var o=f(document).height(),n;p.preventDefault();h.renderSearchForm();n=f(document).height();if(o!==n){h.redrawMap()}})};a.renderSearchForm=function(){var h=this.placeholder,g=c.getTemplate("search-results-heading-search-form",{hotelsIn:(c.State.get("locationId"))?this.getText("hotelsIn"):this.getText("hotelsNear")});h.children(".copter-heading").empty().append(g);c.components.SearchForm.createInstance(h.find(".copter-heading .copter-searchform"),{location:true,twoMonth:true,guests:2,dateFieldPlaceholder:h.data("dateFieldPlaceholder")})};a.assignEventHandlers=function(){var g=this,i=this.placeholder,h;i.find(".copter-filters-global-apply").click(function(l){var k={},j=c.UserAction.getState(true);l.preventDefault();f.each(i.find(".copter-filters"),function(m,n){f.extend(k,f(n).data("instance").getAllFilterSettings())});if(g.dateSliderVisible==true){h=i.find(".copter-dateslider").data("instance").getDates();if(h){f.extend(k,i.find(".copter-dateslider").data("instance").getDates())}}f.extend(k,i.find(".copter-sort").data("instance").getSort());c.State.set(k);window.setTimeout(function(){c.UserAction.record("apply_filters_and_sort",j,true)},500)});i.find(".copter-filters-more-less").click(function(l){var k=f(l.target),j=i.find(".copter-filters-secondary");l.preventDefault();if(k.hasClass("copter-filters-more")){j.show();k.removeClass("copter-filters-more").html(g.getText("lessFilters"));c.trigger("secondaryFiltersDisplayed",j)}else{j.hide();k.addClass("copter-filters-more").html(g.getText("moreFilters"));c.trigger("secondaryFiltersHidden",j)}g.redrawMap()});c.bind("dateSliderHidden",function(j){g.dateSliderVisible=false});c.bind("dateSliderDisplayed",function(j){g.dateSliderVisible=true})};a.locationName=function(){var g=c.State.get("locationName");if(!g){g=this.getText("unspecifiedLocation")}if(this.placeholder.data("locationName")){g=this.placeholder.data("locationName")}return g}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,f,e){var b=c.components.SearchEngine=function(g){this.placeholder=f(g);this.ts=new Date().getTime();this.isResults=false};var a=b.prototype;b.cssClass="copter-searchengine";b.initialize=function(){var g=this;f("."+g.cssClass).each(function(h,k){var j=f(k);if(j.is(":empty")){g.createInstance(j.get(0))}})};b.createInstance=function(j,h){var g=this,i=f(j),k=null;h=(h||{});if(!i){c.throwException("Attempted to create a SearchEngine component but no placeholder argument was supplied.")}i.addClass(g.cssClass);f.each(h,function(m,l){i.data(m,l)});k=new g(j);k.assignGlobalEventHandlers();k.render();return k};a.render=function(){var g=this.placeholder;g.data("instance",this);c.components.Bubble.closeAll();c.components.Lightbox.closeAll();g.html(c.getTemplate("search-engine-main",{labels:this.getAllText()}));this.renderSearchForm();this.renderSearchResults()};a.renderSearchForm=function(){var g=this.placeholder;c.components.SearchForm.createInstance(g.find(".copter-searchform"),{location:true,twoMonth:true,guests:2,defaultDateDays:g.data("defaultDateDays"),autofillPhotos:true,locationFieldPlaceholder:g.data("locationFieldPlaceholder"),dateFieldPlaceholder:g.data("dateFieldPlaceholder"),showRecentSearchButton:true});g.find(".copter-searchform .copter-button").html(this.getText("findHotels"))};a.renderSearchResults=function(){var g=this.placeholder;c.components.SearchResults.createInstance(g.find(".copter-searchresults"),{filtersType:"lateral",filtersPrimary:["rate","stars"],filtersSecondary:["amenity","brand"],filterBrands:["198","446","444","318","73","159"],filterGroups:["445","446","444","450","441","443"],filtersMaxLabelLength:17,filtersAmenityColumns:3,filtersBrandColumns:3,filtersPropertyColumns:3,filtersBrandsGroupsDefault:"group",animate:false,defaultSort:g.data("defaultSort"),defaultSortDirection:g.data("defaultSortDirection"),summaryDateFormat:g.data("summaryDateFormat"),locationMapPin:g.data("locationMapPin"),hotelMapPin:g.data("hotelMapPin"),numberedMapPins:g.data("numberedMapPins"),mapPinWidth:g.data("mapPinWidth"),mapPinHeight:g.data("mapPinHeight"),mapPinAnchorX:g.data("mapPinAnchorX"),mapPinAnchorY:g.data("mapPinAnchorY"),initialRatrix:g.data("initialRatrix")})};a.assignGlobalEventHandlers=function(){var g=this,h=this.placeholder;c.bindToElement(h,"searchStart",function(){g.showSearchResults()});c.bindToElement(h,"hashChangeFirst",function(){var i;if(g.isHash()){i=window.location.hash.replace(f("#copter-widget").data("urlHash"),"");if(i.length===0){g.isResults=false;g.showSearchForm()}else{if(!g.isResults){g.showSearchResults()}}}})};a.showSearchForm=function(){var g=this.placeholder;g.find(".copter-searchresults").empty().hide();g.find(".copter-main-search").show();c.trigger("showSearch")};a.showSearchResults=function(){var h=this.placeholder,g=h.find(".copter-searchresults");if(g.is(":hidden")){h.find(".copter-main-search").hide();g.show();c.trigger("showSearchResults")}};a.isHash=function(){var g=f("#copter-widget").data("urlHash");return(g==="#"||g==="#!")}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,f,e){var b=c.components.Bubble=function(g){this.placeholder=f(g);this.positions=["bottom","top","left","right"];this.offset=3};var a=b.prototype;b.initialize=function(){var g=this;c.bind("documentClick",function(){g.closeAll()});c.bind("searchStart",function(){b.closeAll()})};b.createInstance=function(i,l,j){var k,g,m,h=f("<div/>").attr("id","copter-bubble-bookmark").css("display","none");i=f(i);g=i.parent();if(i.length===0){c.throwException('Attempted to create a Bubble component but an invalid "contents" argument was supplied.')}if(!l){c.throwException("Attempted to create a Bubble component but no target argument was supplied.")}j=(j||{});j.contents=i;j.targetEl=l;j.container=g;j.target=this.buildTarget(l,j.after);this.closeAll();k=f(c.getTemplate("bubble-main")).hide();f.each(j,function(o,n){k.data(o,n)});if(i.parents().length>0){i.before(h)}if(j.after){f(j.after).after(k);if(g.css("position")!="absolute"&&g.css("position")!="relative"){g.css("position","relative")}}else{f("body").append(k)}k.children(".copter-contents").append(i.show());m=new this(k);m.render();return m};b.buildTarget=function(i,j){var h=(j)?"position":"offset",g;if(e.isNumber(i.left)&&e.isNumber(i.top)){if(!i.width&&!i.height){i=f.extend({width:1,height:1},i)}}else{g=f(i);i={left:g[h]().left,top:g[h]().top,width:g.outerWidth(true),height:g.outerHeight(true)}}return i};b.closeAll=function(){var g=f(".copter-bubble");if(g){g.each(function(j,h){f(h).data("instance").close()});c.trigger("allBubblesClosed")}};a.render=function(){var h=this,j=this.placeholder.css({top:"0",left:"0"}),i=j.data("width"),g=j.data("height");j.data("instance",this);if(i&&g){j.children(".copter-contents").css({width:i+"px",height:g+"px",overflow:"hidden"})}this.setPosition();j.maxZIndex();j.click(function(k){k.stopPropagation()});c.bindToElement(j,"windowResize",function(){j.data("target",b.buildTarget(j.data("targetEl"),j.data("after")));h.setPosition()});j.fadeIn("fast")};a.setPosition=function(){var g=this.getCoords();this.placeholder.css({left:g.left,top:g.top}).show()};a.getCoords=function(){var i=this,l=this.placeholder,k=l.children(".copter-arrow"),g=this.validatePosition(l.data("position")),m=(l.data("forcedPosition"))?[l.data("forcedPosition")]:[g].concat(i.positions,[g]),h=(l.data("customCSS"))?" "+l.data("customCSS"):"",j;f.each(m,function(p,r){var v=(r==="left"||r==="right")?["top","bottom","top"]:["left","right","left"],u,n,q,o,t,s;if(l.data("forcedPosition")){v.pop()}f.each(v,function(w,x){l.removeClass().addClass("copter-bubble copter-bubble-"+r+h);l.children(".copter-arrow").removeClass().addClass("copter-arrow copter-arrow-"+r+"-"+x);l.show();u=l.outerWidth(true);n=l.outerHeight(true);q=k.outerWidth(true);o=k.outerHeight(true);t=k.position().left;s=k.position().top;l.hide();j=i.getPositionCoords(r,u,n,q,o,t,s);if(j.fits){return false}});if(j.fits){return false}});return j};a.validatePosition=function(g){if(f.inArray(g,this.positions)<0){g="right"}return g};a.getPositionCoords=function(l,q,h,k,j,o,m){var g=this.placeholder,n=g.data("target"),r={},i=(g.data("after"))?n:{left:0,top:0};switch(l){case"top":r={left:n.left+(n.width/2)-o-(k/2),top:n.top-this.offset-h};break;case"bottom":r={left:n.left+(n.width/2)-o-(k/2),top:n.top+n.height+this.offset};break;case"left":r={left:n.left-this.offset-q,top:n.top+(n.height/2)-m-(j/2)};break;case"right":r={left:n.left+n.width+this.offset,top:n.top+(n.height/2)-m-(j/2)};break}r.fits=this.fits({left:r.left+i.left,top:r.top+i.top,relativeLeft:((n.relativeLeft)?((r.left-n.left)+n.relativeLeft):null),relativeTop:((n.relativeTop)?((r.top-n.top)+n.relativeTop):null)},q,h);return r};a.fits=function(l,j,g){var k=true,m=this.placeholder.data("fitsWithin"),i=f((m||window)),h;if(m){h={top:0,bottom:i.height(),left:0,right:i.width()}}else{h={top:i.scrollTop(),bottom:i.scrollTop()+i.height(),left:0,right:i.width()}}if(l.relativeLeft&&l.relativeTop){l.left=l.relativeLeft;l.top=l.relativeTop}if(l.left<h.left){k=false}if((l.left+j)>h.right){k=false}if((l.top)<h.top){k=false}if((l.top+g)>h.bottom){k=false}return k};a.close=function(){var g=this.placeholder;if(g.data("deleteContentsOnClose")){f("#copter-bubble-bookmark").remove()}else{f("#copter-bubble-bookmark").replaceWith(g.children(".copter-contents").children().hide())}g.remove()}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,e){var b=c.components.Lightbox=function(f){this.placeholder=e(f)};var a=b.prototype;b.cssClass="copter-lightbox";b.initialize=function(){c.bind("documentKeyDown",function(g,f){if(f.which==27&&e("."+b.cssClass).length>0){e("."+b.cssClass+":last").data("instance").close()}})};b.createInstance=function(f,g){var h,i;f=e(f);if(f.length===0){c.throwException('Attempted to create a Lightbox component but an invalid "contents" argument was supplied.')}g=(g||{});g.contents=f;h=e("<div/>").addClass(b.cssClass).hide();e.each(g,function(l,j){h.data(l,j)});i=new this(h);i.render();return i};b.closeAll=function(f){e("."+b.cssClass).each(function(g,h){var j=true;if(f&&e(h).find(f).length===0){j=false}if(j){e(h).data("instance").close()}});if(!f){c.trigger("allLightboxesClosed")}};a.render=function(){var f=this,j=this.placeholder,l=null,g=j.data("width"),i=e(window).scrollTop(),h=j.data("contents"),k;e("body").addClass("copter-lightbox-open");k=j.data("bottomCloseButton")||false;j.data("instance",this);j.maxZIndex();j.append(c.getTemplate("lightbox-main",{labels:{close:"Close"},showCloseButton:k}));e("body").append(j);if(!g){e("body").append(h.show());g=h.outerWidth(true)}j.find(".copter-contents").append(h);l=j.children(".copter-wrapper");l.css({width:g+"px"});l.click(function(m){m.stopPropagation();c.components.Bubble.closeAll()});j.click(function(m){m.stopPropagation();f.close()});j.find(".copter-close").click(function(m){m.preventDefault();f.close()});e("html").addClass("copter-lightboxmode").css({paddingRight:c.scrollbarWidth+"px"});e(window).scrollTop(i);j.fadeIn();c.trigger("lightboxOpened",j)};a.close=function(){var g=e(window).scrollTop(),f=this.placeholder.find(".copter-contents").children().attr("class");c.components.Bubble.closeAll();c.trigger("lightboxBeforeClose",f);this.placeholder.remove();e("body").removeClass("copter-lightbox-open");c.trigger("lightboxClosed",f);c.UserAction.record("lightbox_closed",{});if(e("."+b.cssClass).length===0){e("html").removeClass("copter-lightboxmode").css({paddingRight:"0px"});e(window).scrollTop(g)}}})(hotelicopter,hotelicopter.$);(function(c,f,e){var b=c.components.Ratrix=function(g){this.placeholder=f(g);this.ts=new Date().getTime();this.hotel=null;this.lowestRate=null;this.rates=null;this.allRates=false;this.showingRoomTypes=false;this.advertisersToDisplay={};this.allAdvertisers=null;this.userActionRates=[]},a=b.prototype;b.cssClass="copter-ratrix";b.initialize=function(){var g=this;f("."+g.cssClass).each(function(h,k){var j=f(k);if(j.is(":empty")){g.createInstance(j.get(0),j.data("udicode"))}})};b.createInstance=function(k,j,h){var g=this,i=f(k),l=null;h=(h||{});if(!i){c.throwException("Attempted to create a Ratrix component but no placeholder argument was supplied.")}if(!j){c.throwException("Attempted to create a Ratrix component but no hotel was supplied.")}if(typeof j=="string"&&j.length==0){c.throwException("Attempted to create a Ratrix component but no udicode was supplied.")}i.addClass(g.cssClass);l=new g(k);l.render();l.assignSearchEventHandlers();f.each(h,function(n,m){i.data(n,m)});if(typeof j=="object"){h.udicode=j.udicode;l.hotel=j;if(j.availableRates){l.rates=j.availableRates.getKeyRatePerPartner();if(c.Rate.polling&&!i.data("polled")){l.renderSpinner()}else{l.renderRates()}}else{l.getHotelRates()}}else{h.udicode=j;l.getHotelData(h.udicode)}return l};a.getHotelData=function(j,g){var h=this,i={success:function(k){h.hotel=k[0];h.getHotelRates()},fields:["advertisers","brand"]};h.renderSpinner();c.Hotel.findByUdicode(j,i)};a.getHotelRates=function(){var g=this,i=g.placeholder.data("roomTypes"),h={success:function(k,j){},update:function(k,j,l){if(l&&i){g.allRates=true}},onlyLowest:true};if(i){delete h.onlyLowest}g.renderSpinner();c.Rate.findByUdicode(g.placeholder.data("udicode"),c.State.stay(),h)};a.render=function(){var g=this,i=this.placeholder,j=g.getAllText(),h;h=f(c.getTemplate("ratrix-main",{checkIn:c.formatDate(c.State.get("checkIn")),checkOut:c.formatDate(c.State.get("checkOut")),rooms:c.State.get("rooms"),roomslabel:((c.State.get("rooms")>1)?j.pluralRoom:j.singleRoom),guests:c.State.get("guests"),guestslabel:((c.State.get("guests")>1)?j.pluralGuest:j.singleGuest),labels:j,includeDates:i.data("includeDates")}));i.html(h).data("instance",g);this.assignEventHandlers()};a.renderSpinner=function(){var h=this,g;g=f(c.getTemplate("ratrix-spinner",{labels:h.getAllText()}));h.placeholder.children(".copter-ratrix-table-wrapper").empty().html(g)};a.updateSpinner=function(){var g=this;if(g.rates&&g.rates.length>0){if(!g.lowestRate){g.lowestRate=g.rates[0]}for(var h=0;h<g.rates.length;h++){if(g.rates[h].avNightlyRateInc<g.lowestRate.avNightlyRateInc){g.lowestRate=g.rates[h]}}g.placeholder.find(".copter-ratrix-best-so-far").html("&nbsp;"+g.getText("bestSoFar")+"&nbsp;"+c.formatCurrency(g.lowestRate.avNightlyRateInc))}};a.renderRates=function(){var h=this,m=this.placeholder,g,l,j,k;if(this.rates){l=((m.data("initial")||m.data("maximum"))||this.rates.length);if(l>this.rates.length){l=this.rates.length}g=f(c.getTemplate("ratrix-rates",{labels:this.getAllText(),roomRates:m.data("roomTypes"),tableLayout:m.data("tableLayout"),ts:this.ts}));m.children(".copter-ratrix-table-wrapper").empty().html(g);for(j=0;j<l;j++){k=this.rates[j];if(!this.advertisersToDisplay[k.advertiserCode]){this.advertisersToDisplay[k.advertiserCode]=true}}this.renderRateRows(function(){if(m.data("initial")&&m.data("maximum")&&(m.data("initial")<m.data("maximum"))){h.renderDropdown()}});if(this.showingRoomTypes){this.showRoomTypes()}}};a.renderRateRows=function(j){var r=this,g=r.placeholder,o,m,h="",t,s="copter-button",q={},l,n,k;this.userActionRates=[];for(k=0;k<r.rates.length;k++){n=r.rates[k];if(r.advertisersToDisplay[n.advertiserCode]&&!q[n.advertiserCode]){q[n.advertiserCode]=true;t="";s="copter-button";if(n.isDirect){t+=" copter-bookdirect"}if(n.avNightlyRateInc==r.rates[0].avNightlyRateInc){t+=" copter-bestrate";s="copter-primary-button"}if(!n.roomDescription||(n.roomDescription&&n.roomDescription.length===0)){n.roomDescription=f.capitalize(n.roomType)}m=c.getTemplate("ratrix-row",{labels:r.getAllText(),cssClass:t,bookButtonClass:s,advName:r.hotel.advertisers[n.advertiserCode].name,advCode:n.advertiserCode,roomDescription:(g.data("fullDescription"))?n.roomDescription:f.capitalize(n.roomType),avgNightlyRateExFmt:c.formatCurrency(n.avNightlyRateEx),avgNightlyRateEx:Math.round(n.avNightlyRateEx),avgNightlyRateIncFmt:c.formatCurrency(n.avNightlyRateInc),avgNightlyRateInc:Math.round(n.avNightlyRateInc),bookingUrl:n.bookingUrl,logoUrl:(n.isDirect)?r.hotel.advertiserLogo(n.advertiserCode,n.isDirect,65,45):r.hotel.advertiserLogo(n.advertiserCode,n.isDirect,60,20),isBookDirect:n.isDirect,position:k,tableLayout:g.data("tableLayout")});h+=m;this.userActionRates.push({advertiser_code:n.advertiserCode,room_type:n.roomType,exclusive_rate:Math.round(n.avNightlyRateEx),inclusive_rate:Math.round(n.avNightlyRateInc),is_book_direct:n.isDirect})}}o=function(){g.find("a.copter-book").each(function(v){var u=f(this),w=u.attr("href"),p=u.parents(".copter-ratrix-row");u.attr("href",r.buildBookingUrl(w,p))});if(j){j()}};if(g.find(".copter-ratrix-table-rows").is(":empty")){g.find(".copter-ratrix-table-rows").html(h);r.assignRateTypeEventHandlers();o()}else{f("#copter-ratrix-table-rows-new-"+r.ts).html(h);f("#copter-ratrix-table-rows-"+r.ts).quicksand(f("#copter-ratrix-table-rows-new-"+r.ts+" > div"),{easing:c.easing,duration:250},function(){r.assignRateTypeEventHandlers();o()})}};a.buildBookingUrl=function(h,g){var i={displayed_rates:f.toJSON(this.userActionRates),udicode:this.hotel.udicode,advertiser_code:g.data("advCode"),exclusive_rate:g.data("rateExc"),inclusive_rate:g.data("rateInc"),is_book_direct:g.data("isBookDirect"),position:g.data("position")};return c.UserAction.buildRedirectUrl(h,"ratrix_book_button_click",i)};a.renderDropdown=function(){var g=this,j=this.placeholder,k=e.keys(this.advertisersToDisplay).length,i=(j.data("maximum"))?(k<j.data("maximum")):true,h=f(c.getTemplate("ratrix-dropdown",{ts:this.ts})),l=h.find(".copter-ratrix-dropdown");if(j.find(".copter-ratrix-dropdown-wrapper").length===0&&i&&(k<g.getAllAdvertiserCodes().length)){j.append(h.hide());l.html(this.getDropdownOptions());h.fadeIn(250);l.change(function(){var m=l.val();l.parent().remove();if(m.length>0){g.advertisersToDisplay[m]=true}g.renderRateRows(function(){g.renderDropdown()})})}};a.getDropdownOptions=function(){var g=this,h=c.getTemplate("ratrix-dropdown-option",{advertiserCode:"",advertiser:g.getText("compareRatesFrom"),cssClass:"copter-compare-from"}),i={};f.each(g.rates,function(j,k){if(!g.advertisersToDisplay[k.advertiserCode]&&!i[k.advertiserCode]){i[k.advertiserCode]=true;h+=c.getTemplate("ratrix-dropdown-option",{advertiserCode:k.advertiserCode,advertiser:g.hotel.advertiserName(k.advertiserCode),cssClass:"copter-advertiser"})}});return h};a.assignSearchEventHandlers=function(){var g=this,h=this.placeholder;c.bindToElement(h,"stateChangedLocationOrStay",function(){if(!h.data("polled")){g.renderSpinner()}});c.bindToElement(h,"ratesPolled",function(i,j){var k=j.hotelsWithRatesHash[h.data("udicode")];if(k){g.rates=k.rates}if(!c.Rate.polling||!!h.data("polled")){g.renderRates()}else{g.updateSpinner()}})};a.assignEventHandlers=function(){var g=this.placeholder;g.dblclick(function(h){h.stopPropagation();f.clearSelection()})};a.getAllAdvertiserCodes=function(){var g=this,h={};if(!g.allAdvertisers){g.allAdvertisers=[];f.each(g.rates,function(j,k){if(!h[k.advertiserCode]){g.allAdvertisers.push(k.advertiserCode)}h[k.advertiserCode]=true})}return g.allAdvertisers};a.assignRateTypeEventHandlers=function(){var g=this,h=this.placeholder,i=this.getAllText();h.find("a.copter-remove-link").click(function(k){var j=f(this).parent().data("advCode");k.preventDefault();h.find(".copter-ratrix-dropdown-wrapper").remove();delete g.advertisersToDisplay[j];g.renderRateRows(function(){g.renderDropdown()})});h.find(".copter-ratrix-view-choice").click(function(k){k.preventDefault();k.stopImmediatePropagation();var j=f(k.target);if(j.is(".copter-ratrix-show-rates a")){h.find(".copter-ratrix-show-room-types").html('<a href="#" class="copter-primary">'+i.showRoomTypes+"</a>");h.find(".copter-ratrix-show-rates").html(i.showRates);h.find(".copter-ratrix-room-types-container").hide();h.find(".copter-ratrix-rates-container").show()}else{if(j.is(".copter-ratrix-show-room-types a")){g.showingRoomTypes=true;g.showRoomTypes()}}});h.find(".copter-ratrix-room-types-container").click(function(l){var k=f(l.target);if(!k.is(".copter-btn a")){l.preventDefault();l.stopImmediatePropagation()}if(k.is(".all-room-rates a.all")){k.parent().prev().children().show();k.hide();k.next().show()}else{if(k.is(".all-room-rates a.best")){k.parent().prev().children("div:gt(2)").hide();k.hide();k.prev().show()}else{if(k.is(".copter-ratrix-room-type-toggle a.copter-hide")){k.parent().parent().next().hide();k.hide();k.next().show()}else{if(k.is(".copter-ratrix-room-type-toggle a.copter-show")){k.parent().parent().next().show();k.hide();k.prev().show()}else{if(k.is("a.copter-ratrix-book-button")){var j=k.attr("href");l.preventDefault()}}}}}})};a.showRoomTypes=function(){var g=this,i=g.placeholder,k=this.getAllText(),h=null,j=function(){g.allRates=true;h=f(c.getTemplate("ratrix-room-types",{labels:k,ratesByRoomType:g.ratesByRoomType(),hotel:g.hotel}));i.find(".copter-ratrix-show-rates").html('<a href="#" class="copter-primary">'+k.showRates+"</a>");i.find(".copter-ratrix-show-room-types").html(k.showRoomTypes);i.find(".copter-ratrix-rates-container").hide();i.find(".copter-ratrix-room-types-container").html(h).show()};if(g.rates&&g.allRates){j()}else{g.getHotelRates()}};a.ratesByRoomType=function(){var h=this,g={},k,j;if(h.rates){for(j=0;j<h.rates.length;j++){k=h.rates[j];if(!g[k.roomType]){g[k.roomType]=[]}if(h.hotel.advertisers[k.advertiserCode].isBookDirect){k.logoUrl=(h.hotel.brand.logo)?h.hotel.brand.logo.url:h.hotel.advertisers[k.advertiserCode].logo.url;k.isBookDirect=true}else{k.logoUrl=h.hotel.advertisers[k.advertiserCode].logo.url;k.isBookDirect=false}g[k.roomType].push(k)}}return g}})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,e){var b=c.components.HotelDetails=function(f){this.placeholder=e(f);this.hotel=null;this.availableRates=null;this.tabs=["overview","photos","map"];this.photoCarousel=null;this.ts=new Date().getTime();this.searchKey="hotel-details-"+this.ts},a=b.prototype;b.cssClass="copter-hoteldetails";b.initialize=function(){var f=this;e("."+f.cssClass).each(function(g,j){var h=e(j);if(h.is(":empty")){f.createInstance(h.get(0),h.data("udicode"))}})};b.createInstance=function(j,i,g){var f=this,h=e(j),k=null;g=(g||{});if(!h){c.throwException("Attempted to create a Hotel Details component but no placeholder argument was supplied.")}if(!i){c.throwException("Attempted to create a Hotel Details component but no hotel was supplied.")}if(typeof i=="string"&&i.length==0){c.throwException("Attempted to create a Hotel Details component but no hotel was supplied.")}h.addClass(f.cssClass);g.udicode=(i.udicode||i);e.each(g,function(m,l){h.data(m,l)});k=new f(j);k.getHotelData();if(typeof i=="object"&&i.availableRates){k.availableRates=i.availableRates}return k};a.getHotelData=function(){var f=this,g={success:function(h){f.hotel=h[0];if(f.availableRates){f.hotel.availableRates=f.availableRates}f.render();if(c.isDatedSearch()){f.getRates()}},fields:["udicode","address","distance","amenities","description","shortDescription","brand","group","propertyType","photoCount","photos","richMedia","lat","lng","rank","name","policies","historicalRates","stars","yearBuilt","yearRenovated","telephone","fax","twitter","facebook","url","advertisers"],udicode:f.placeholder.data("udicode")};if(c.State.getLocationAttributes()){e.each(c.State.getLocationAttributes(),function(i,h){if(h){g[i]=h}})}c.Hotel._request(g)};a.getRates=function(){var f=this,g={success:function(){},update:function(h,i,j){f.availableRates=f.hotel.availableRates=h[0];if(j){f.renderRoomRates()}},fields:["avNightlyRateInc","avNightlyRateEx","avNightlyTaxesAndFees","roomDescription","bookingUrl","isDirect"],searchKey:f.searchKey};c.Rate.findByUdicode(f.placeholder.data("udicode"),c.State.stay(),g)};a.render=function(){var f=this,l=this.placeholder,n=f.getAllText(),j,h,g=l.data("initialTab")||"overview",k=this.hotel.bookDirectAdvertiser(),m=(k)?f.hotel.advertiserLogo(k.code,k.isBookDirect,132,105):null;l.data("instance",f);if(e.inArray(g,f.tabs)==-1){g="overview"}if(!f.hotel.brand){f.hotel.brand={}}l.html(c.getTemplate("hotel-details-tabbed",{labels:n,tabs:this.tabs,hotel:this.hotel,hotelLogo:m,tripAdvisor:false}));for(h=0;h<this.tabs.length;h++){f.renderTabTemplates(this.tabs[h])}c.components.HotelRate.createInstance(l.find(".copter-hotelrate"),f.hotel,{includeRateTotal:true,includeBrandLogo:true,includeOfficialSite:true,directLink:true,polled:!!(l.data("polled"))});this.getBookingUrl();j=l.find(".copter-photocarousel");if(j.is(":empty")){this.photoCarousel=c.components.PhotoCarousel.createInstance(j,f.hotel,{imgPosition:0,notToExceedHeight:320})}l.find(".copter-room-rates").addClass("copter-room-rates-searching");f.switchTabView(g);f.assignEventHandlers()};a.renderTabTemplates=function(i){var f=this,l=f.placeholder,h={},g,m=f.getAllText(),k,j;switch(i){case"overview":k=encodeURIComponent(c.baseUrl+"/themes/"+c.theme+"/img/map/hotel-pin.png");h={labels:m,amenities:f.getHotelAmenities(),hotel:f.hotel,mapPinUrl:k,mapUrl:j,roomDescription:this.getRoomDescription(),location:f.shortLocation()};break;case"photos":break;case"map":break;case"reviews":break;case"rates":break}g=e(c.getTemplate("hotel-details-"+i,h));l.find(".copter-hoteldetails-"+i).html(g)};a.renderRatrix=function(f){c.components.Ratrix.createInstance(f.find(".copter-ratrix"),this.hotel,{maximum:4,initial:1,polled:!!(this.placeholder.data("polled"))})};a.renderRoomRates=function(){var g=this,i=this.placeholder,f=i.find(".copter-room-rates"),h="";f.empty();if(c.isDatedSearch()&&this.hotel.availableRates){f.removeClass("copter-room-rates-searching");e.each(this.hotel.availableRates.getAllRates(),function(k,l){var m=(l.avNightlyRateInc)?Math.round(l.avNightlyRateInc):"xxx",n=(l.avNightlyRateEx)?Math.round(l.avNightlyRateEx):"xxx",j=(l.roomDescription)?e.properCase(l.roomDescription):g.getText("unknownRoom");h+=c.getTemplate("hotel-details-room-rate",{labels:g.getAllText(),rateInc:m,rateEx:n,roomDescription:e.escapeHTML(j),bookingUrl:c.UserAction.buildRedirectUrl(e.escapeHTML(l.bookingUrl),"hotel_details_roomrate_book_click",{udicode:g.hotel.udicode,rateInc:m,rateEx:n,roomDescription:e.escapeHTML(j),listIndex:k}),linkTarget:"_blank"})});f.html(h)}};a.getHotelAmenities=function(){var h=this,k={},f=[],g;for(var j=0;j<h.hotel.amenities.length;j++){for(g in c.amenities){if(h.hotel.amenities[j].id===c.amenities[g]){f.push(h.hotel.amenities[j])}}}for(j=0;j<f.length;j++){if(!k[f[j].type]){k[f[j].type]=[]}k[f[j].type].push(f[j].name)}return k};a.changeTabState=function(f){c.State.set({hotelTab:f})};a.switchTabView=function(f){var h=this,l=h.placeholder,j,g=h.isSafari(),k=encodeURIComponent(c.baseUrl+"/themes/"+c.theme+"/img/map/hotel-pin.png"),i=l.find(".copter-hoteldetails-print").parent();c.components.Bubble.closeAll();f=f||"overview";l.find(".copter-hoteldetails-contentcontainer > div:visible").hide();l.find(".copter-hoteldetails-contentcontainer .copter-hoteldetails-"+f).show();if(f=="overview"){i.show()}else{i.hide()}l.find(".copter-active").removeClass("copter-active");l.find('.copter-hoteldetails-contentlinks a[data-tab-section="'+f+'"]').addClass("copter-active");if(f==="rates"){l.find(".copter-hoteldetails-header-rate").hide();l.find(".copter-hoteldetails-header-logos").show()}else{l.find(".copter-hoteldetails-header-rate").show();l.find(".copter-hoteldetails-header-logos").hide()}if(f==="map"){j=l.find(".copter-hoteldetails-contentcontainer > .copter-hoteldetails-map .copter-map").empty();if(g){j.append('<img src="//maps.googleapis.com/maps/api/staticmap?markers=icon:'+k+"|"+this.hotel.lat+","+this.hotel.lng+'&zoom=15&size=940x400&sensor=false" border="0" />')}else{c.components.Map.createInstance(j,{hotels:[this.hotel],noPinEvents:true,noLocationPin:true})}}};a.handleCarouselClick=function(g){var f=this,h=f.placeholder;this.photoCarousel.jumpToImage(g);f.changeTabState("photos")};a.handleOverviewCarousel=function(l){var i=this,k=i.placeholder,j,g=k.find(".copter-hoteldetails-imagecontainer"),f=g.position().left,h;j=(l.hasClass("copter-imgprevwrapper"))?"prev":"next";h=g.find(".copter-hoteldetails-carousel-image").eq(0).width()+1;if(j=="prev"){if(f<0){f=(f===-(g.width()-g.parent().width()))?f+(h-(g.parent().width()%h)):f+h;g.animate({left:f+"px"},500,c.easing)}}else{if((-((g.parent().width()-g.width())-f))>=h){f-=h}else{f=-(g.width()-g.parent().width())}g.animate({left:f+"px"},500,c.easing)}};a.assignEventHandlers=function(){var h=this,m=h.placeholder,l,j,f=m.find(".copter-hoteldetails-imagecontainer"),g,k,i;m.click(function(o){l=e(o.target);if(l.is(".copter-hoteldetails-contentlinks a")){o.stopPropagation();o.preventDefault();i=e(".copter-hoteldetails-contentlinks li a.copter-active").data("tab-section");h.changeTabState(l.data("tab-section"));c.UserAction.record("hotel_details_tab_click",{udicode:h.hotel.udicode,tab_clicked:l.data("tab-section"),previous_tab:i})}else{if(l.is(".copter-hoteldetails-email")){l.attr("href","mailto:?subject="+m.data("instance").text.subjectPrefix+" "+m.data("instance").hotel.address.city+"&body="+m.data("instance").text.bodyPartOne+" "+encodeURIComponent(m.data("instance").hotel.name)+" "+m.data("instance").text.bodyPartTwo+" "+m.data("instance").hotel.address.city+" "+m.data("instance").text.bodyPartThree+"%0D%0A%0D%0A"+encodeURIComponent(document.location)+"%0D%0A%0D%0A"+m.data("instance").text.bodyPartFour);c.UserAction.record("hotel_details_email_click",{udicode:h.hotel.udicode})}else{if(l.is(".copter-hoteldetails-print")){o.preventDefault();c.UserAction.record("hotel_details_print_click",{udicode:h.hotel.udicode});window.print()}else{if(l.is(".copter-hoteldetails-header .copter-tripadvisor a")){o.stopPropagation();o.preventDefault();h.changeTabState("reviews")}else{if(l.is(".copter-imgprevwrapper")||l.is(".copter-imgnextwrapper")){o.stopPropagation();o.preventDefault();if(!f.is(":animated")){h.handleOverviewCarousel(l)}c.UserAction.record("hotel_details_carousel_arrow_click",{udicode:h.hotel.udicode,direction:(l.is(".copter-imgprevwrapper"))?"previous":"next"})}else{if(l.is(".copter-desc-link")){o.preventDefault();h.expandCollapseDescription()}else{if(l.is(".copter-hoteldetails-map-img")||l.is(".copter-hoteldetails-map-link")){o.stopPropagation();o.preventDefault();h.changeTabState("map");c.UserAction.record("hotel_details_overview_map_click",{udicode:h.hotel.udicode})}else{if(l.is(".copter-hoteldetails-carousel-image img")){o.stopPropagation();o.preventDefault();k=l.parent().index()+1;h.handleCarouselClick(k);c.UserAction.record("hotel_details_carousel_image_click",{udicode:h.hotel.udicode,image_index:k})}else{if(l.is(".copter-hoteldetails .copter-compare a")){o.stopPropagation();o.preventDefault();g=e(c.getTemplate("hotel-details-ratrix-bubble",{labels:h.getAllText()}));var n=c.components.Bubble.createInstance(g,l,{position:"right",after:m.find(".copter-hoteldetails-header-rate"),deleteContentsOnClose:true});g.find(".copter-cancel").click(function(p){p.preventDefault();n.close()});h.renderRatrix(g)}}}}}}}}}});c.bindToElement(m,"searchStart",function(){m.find(".copter-hoteldetails-check-rates").remove();m.find(".booking-options-inner").append('<div class="copter-ratrix" data-udicode="'+h.hotel.udicode+'"></div>');j=e(m.find(".copter-ratrix"));if(j.is(":empty")){c.components.Ratrix.createInstance(j.get(0),j.data("udicode"),{roomTypes:true})}});c.bindToElement(m,"stateChangedHotelDetails",function(o,n){h.switchTabView(n.hotelTab)});c.bindToElement(m,"ratesPolled",function(n,o){m.find(".copter-hoteldetails-roomdescription .copter-room-desc").html(h.getRoomDescription());m.find("a.copter-book-link").attr("href",h.getBookingUrl())});c.bindToElement(this.placeholder,"lightboxBeforeClose",function(o,n){if(n&&n.indexOf("copter-hoteldetails")>=0){c.Rate.cancelSearches(h.searchKey)}})};a.expandCollapseDescription=function(){var l=this.placeholder,g,k,j,i,f,h;i=l.find(".copter-hoteldetails-compact-desc");j=l.find(".copter-hoteldetails-expanded-desc");k=l.find(".copter-desc-link");g=j.is(":visible");f=i.show().height();h=j.show().height();if(g){i.hide();k.html(this.getText("readMore"));j.animate({height:f+"px"},500,c.easing,function(){i.show();j.hide().css({overflow:"visible",height:h+"px"})})}else{i.hide();j.show().css({height:f+"px",overflow:"hidden"});j.animate({height:h+"px"},500,c.easing);k.html(this.getText("readLess"))}};a.openPhotoLightbox=function(g){var f=c.components.PhotoCarousel.createInstance(e("<div/>"),this.hotel,{imgPosition:g});c.components.Lightbox.createInstance(f.placeholder)};a.getRoomDescription=function(){var i=this.placeholder,g=this.getText("unknown"),h,f;if(typeof this.hotel=="object"&&this.hotel.availableRates){g=this.hotel.availableRates.getKeyRate().roomDescription}else{g=this.getText("loading");h=i.find(".copter-hotelrate").data(a).hotel;if(h){f=h.availableRates;g=(f&&f.keyRate)?f.getKeyRate().roomDescription:this.getText("loading")}}if(!g){g=this.getText("unknown")}return g};a.isSafari=function(){var g=navigator.userAgent.toLowerCase(),f;f=(/safari/.test(g))?true:false;return(f&&!navigator.geolocation)?true:false};a.getBookingUrl=function(){var j=this.placeholder,g="#",i,f,h;if(typeof this.hotel=="object"&&this.hotel.availableRates){g=this.hotel.availableRates.getKeyRate().bookingUrl}else{i=j.find(".copter-hotelrate").data(a).hotel;if(i){f=i.availableRates;g=(f&&f.keyRate)?f.getKeyRate().bookingUrl:"#"}}if(g!=="#"){h=this.hotel.availableRates.getKeyRate();g=c.UserAction.buildRedirectUrl(g,"hotel_details_learn_more_link_click",{udicode:this.hotel.udicode,advertiser_code:h.advertiserCode,exclusive_rate:Math.round(h.avNightlyRateEx),inclusive_rate:Math.round(h.avNightlyRateInc),is_book_direct:!!(h.isDirect)});j.find("a.copter-book-link").attr("href",g).css({visibility:"visible"}).html(this.getText("learnMoreAt")+" "+this.hotel.advertiserName(h.advertiserCode));this.showCompareLink()}return g};a.showCompareLink=function(){var f=this.placeholder;if(c.isDatedSearch()&&(!!(f.data("polled"))||(!c.Rate.polling))){if(this.hotel.availableRates&&this.hotel.availableRates.getKeyRatePerPartner().length>1){f.find(".copter-hoteldetails-header-rate > .copter-rate-compare").show()}}};a.shortLocation=function(){var f=(c.State.get("locationName")||null);if(f){f=f.split(",")[0];if(c.State.get("locationId")){f=this.getText("downtown")+" "+f}}return f}})(hotelicopter,hotelicopter.$);(function(c,e){var b=c.components.PhotoCarousel=function(f){this.placeholder=e(f);this.hotel=null;this.imgPosition=(this.placeholder.data("imgPosition")||0);this.shrinkTo=0},a=b.prototype;b.cssClass="copter-photocarousel";b.initialize=function(){var f=this;e("."+f.cssClass).each(function(g,j){var h=e(j);if(h.is(":empty")){f.createInstance(h.get(0),h.data("udicode"))}})};b.createInstance=function(j,i,g){var f=this,h=e(j),k=null;g=(g||{});if(!h){c.throwException("Attempted to create a Photo Carousel component but no placeholder argument was supplied.")}if(!i){c.throwException("Attempted to create a Photo Carousel component but no hotel was supplied.")}if(typeof i=="string"&&i.length==0){c.throwException("Attempted to create a Photo Carousel component but no udicode was supplied.")}h.addClass(f.cssClass);g.udicode=(i.udicode||i);e.each(g,function(m,l){h.data(m,l)});k=new f(j);if(typeof i=="string"){k.getHotelData()}else{k.hotel=i;k.render()}return k};a.getHotelData=function(){var f=this,g={success:function(h){f.hotel=h[0];f.render()},update:function(){}};c.Hotel.findByUdicode(f.placeholder.data("udicode"),g)};a.render=function(){var f=this,j=f.placeholder,i=c.Hotel.maxSizeForImageCollection(f.hotel.photos),h,g;h=e(c.getTemplate("photo-carousel-main",{hotel:f.hotel}));j.html(h);g=j.width();j.find(".copter-photocarousel-image").css({width:g+"px",height:(j.data("notToExceedHeight"))?j.data("notToExceedHeight")+"px":i.height+"px"});j.css({width:f.containerWidth+"px"});f.showImage();f.showThumbnails(g);c.bindToElement(j,"documentKeyDown",function(l,k){switch(k.which){case 37:f.prevImage();break;case 39:f.nextImage();break}})};a.showImage=function(){var m=this,g=m.placeholder,n=m.placeholder.find(".copter-photocarousel-image");var j=c.Hotel.maxImageSize(m.hotel.photos[m.imgPosition],g.data("notToExceedHeight"));var l=(m.shrinkTo>0)?parseInt(j.width*m.shrinkTo):j.width;var k=(m.shrinkTo>0)?parseInt(j.height*m.shrinkTo):j.height;var i=e("<img />");var h=c.baseUrl+"/themes/"+c.theme+"/img/noimage/200x150.jpg";var f=e("<div />");f.css({position:"absolute",left:((n.width()-l)/2)+"px",top:(0+((n.height()-k)/2))+"px",width:l+"px",height:k+"px",display:"none"});m.loadImage(i,j.url,l,k,(m.hotel.photos[m.imgPosition].caption||""),false,h,function(){f.append(i);n.empty().append(f);var o=parseInt(m.imgPosition)+1;n.append('<div class="copter-photocarousel-caption">'+(m.hotel.photos[m.imgPosition].caption||"")+'</div><div class="copter-photocarousel-count">Image '+o+" of "+m.hotel.photos.length+"</div>");f.fadeIn("slow",function(){var s=Math.round(f.outerWidth()/3);var r=f.height();var t=(r-46)/2;if(o>1){var q=e('<div class="copter-photocarousel-prev" />');q.css({"background-position":"20px "+t+"px",width:s+"px",height:r+"px",opacity:0});f.append(q)}if(o<m.hotel.photos.length){var p=e('<div class="copter-photocarousel-next" />');p.css({"background-position":(s-46-20)+"px "+t+"px",width:s+"px",height:r+"px",opacity:0});f.append(p)}m.imageEventHandlers()})});m.highlightThumbnail()};a.highlightThumbnail=function(){var i=this;var l=i.placeholder.find("div.copter-photocarousel-thumb").eq(i.imgPosition),f=i.placeholder.children(".copter-photocarousel-content").children(".copter-photocarousel-thumbnails"),k=f.children(".copter-photocarousel-thumbnails-container");f.find("img").removeClass("selected");l.find("img").addClass("selected");var j=f.width();var h=parseInt(k.css("margin-left"));var g=(((i.imgPosition==0)?-1:i.imgPosition)*70);if((g+h)>j-60){k.animate({"margin-left":"-"+((g+70-j))+"px"},"fast",c.easing,function(){i.thumbArrowEvents()})}};a.loadImage=function(i,n,f,j,k,m,g,l){i.load(function(){if(l){l()}}).error(function(){e(this).attr("src",g).show()}).attr({src:n,alt:k}).css({width:f+"px",height:j+"px"});if(m){i.attr({title:k.escapeHTML()})}};a.showThumbnails=function(i){var h=this,g=c.baseUrl+"/themes/"+c.theme+"/img/noimage/50x50.jpg",f=h.placeholder.find(".copter-photocarousel-thumbnails"),j=f.children(".copter-photocarousel-thumbnails-container");f.width(parseInt(i)-60);j.width(h.hotel.photos.length*70);if(j.width()<f.width()){j.css({"padding-left":((f.width()-j.width())/2)+"px"})}e.each(h.hotel.photos,function(m,o){var k=c.Hotel.getImageSizeWithDimensions(h.hotel.photos[m],50,50);var p=e('<div class="copter-photocarousel-thumb" id="thumb'+m+'" />');j.children(".copter-clear").before(p);var n="";n+=(m==h.imgPosition)?" selected ":"";n+=(m==0)?" first ":"";var l=(n.length==0)?e("<img />"):e('<img class="'+n+'" />');h.loadImage(l,k.url,50,50,(o.caption||""),false,g,function(){var q=j.children("#thumb"+m);q.append(l);l.click(function(){h.imgPosition=m;h.showImage()});q.fadeIn("fast")})});if(j.width()>f.width()){h.placeholder.children(".copter-photocarousel-content").append('<div class="copter-photocarousel-prev-thumb" /><div class="copter-photocarousel-next-thumb" />');h.thumbArrowEvents()}};a.thumbArrowEvents=function(){var h=this,g=h.placeholder.children(".copter-photocarousel-content").children(".copter-photocarousel-thumbnails"),l=g.children(".copter-photocarousel-thumbnails-container"),f=h.placeholder.find(".copter-photocarousel-prev-thumb"),j=h.placeholder.find(".copter-photocarousel-next-thumb");var k=parseInt(l.css("margin-left"));var i=(0-l.width())+g.width();f.unbind();j.unbind();if(k==0){h.placeholder.find(".copter-photocarousel-prev-thumb, .copter-photocarousel-prev-thumb-disabled").addClass("copter-photocarousel-prev-thumb-disabled");h.placeholder.find(".copter-photocarousel-prev-thumb-disabled").removeClass("copter-photocarousel-prev-thumb")}else{h.placeholder.find(".copter-photocarousel-prev-thumb, .copter-photocarousel-prev-thumb-disabled").addClass("copter-photocarousel-prev-thumb");h.placeholder.find(".copter-photocarousel-prev-thumb").removeClass("copter-photocarousel-prev-thumb-disabled");h.placeholder.find(".copter-photocarousel-prev-thumb").click(function(){var m=k+g.width();m=(m>0)?0:m;l.animate({"margin-left":m+"px"},"slow",c.easing,function(){h.thumbArrowEvents()})})}if(k==i){h.placeholder.find(".copter-photocarousel-next-thumb, .copter-photocarousel-next-thumb-disabled").addClass("copter-photocarousel-next-thumb-disabled");h.placeholder.find(".copter-photocarousel-next-thumb-disabled").removeClass("copter-photocarousel-next-thumb")}else{h.placeholder.find(".copter-photocarousel-next-thumb, .copter-photocarousel-next-thumb-disabled").addClass("copter-photocarousel-next-thumb");h.placeholder.find(".copter-photocarousel-next-thumb").removeClass("copter-photocarousel-next-thumb-disabled");h.placeholder.find(".copter-photocarousel-next-thumb").click(function(){var m=k-g.width();m=(m<i)?i:m;l.animate({"margin-left":m+"px"},"slow",c.easing,function(){h.thumbArrowEvents()})})}};a.imageEventHandlers=function(){var f=this,g=f.placeholder;g.find(".copter-photocarousel-next, .copter-photocarousel-prev").mouseover(function(h){e(this).css("opacity",1)});g.find(".copter-photocarousel-next, .copter-photocarousel-prev").mouseout(function(h){e(this).css("opacity",0)});g.find(".copter-photocarousel-next").click(function(h){f.nextImage()});g.find(".copter-photocarousel-prev").click(function(h){f.prevImage()})};a.jumpToImage=function(f){this.imgPosition=(f-1);if((this.imgPosition+1)<=this.hotel.photos.length){this.showImage()}};a.nextImage=function(){if((this.imgPosition+1)<this.hotel.photos.length){this.imgPosition++;this.showImage()}};a.prevImage=function(){if(this.imgPosition>0){this.imgPosition--;this.showImage()}}})(hotelicopter,hotelicopter.$);(function(c,e){var b=c.components.Map=function(f){this.placeholder=e(f);this.ts=new Date().getTime();this.map=null;this.bounds=null;this.hotels=null;this.hotelMarkers={};this.locationMarker=null;this.updateAsMapMoves=false;this.bringToFrontZIndex=null;this.selectedMarker=null;this.minZoom=10;this.initialZoom=15;this.currentGeocodeLookupId=0;this.currentSearch=null;this.searchBlocked=false};var a=b.prototype;b.cssClass="copter-map";b.initialize=function(){var f=this;e("."+f.cssClass).each(function(g,j){var h=e(j);if(h.is(":empty")){f.createInstance(h.get(0))}})};b.createInstance=function(i,g){var f=this,h=e(i),j=null;g=(g||{});if(!h){c.throwException("Attempted to create a Map component but no placeholder argument was supplied.")}h.addClass(f.cssClass);e.each(g,function(m,l){h.data(m,l)});j=new f(i);if(g.hotels){j.hotels=g.hotels}j.render();return j};a.render=function(){var f=this.placeholder;f.data("instance",this);f.html(c.getTemplate("map-main",{labels:this.getAllText(),ts:this.ts,updateResults:(f.data("updateResults")||false)}));this.assignEventHandlers();if(!this.map&&!f.data("renderHotelCards")){this.renderMap()}if(f.data("hotels")){this.renderMarkers(this.hotels)}};a.assignEventHandlers=function(){var f=this,g=f.placeholder;c.bindToElement(g,"stateChangedLocation",function(h){if(!f.map){f.renderMap()}});c.bindToElement(g,"hotelCardsRendered",function(j,i){var h;if(c.currentLocation&&g.data("renderHotelCards")){f.hotels=i.hotels;if(!f.map){f.renderMap()}if(i.complete){f.renderMarkers(f.hotels)}else{e.each(f.hotelMarkers,function(l,k){f.removeMarker(k.marker);delete f.hotelMarkers[l]});if(f.locationMarker){f.removeMarker(f.locationMarker)}if(!g.data("noLocationPin")){h=f.renderLocationMarker();if(f.map){f.map.panTo(h.position)}}}}});c.bindToElement(g,"hotelCardMouseOver",function(i,h){if(!f.selectedMarker){f.bringMarkerToFront(e(h).data("udicode"))}});c.bindToElement(g,"hotelCardMouseOut",function(i,h){if(!f.selectedMarker){f.setDefaultMarkerZIndex(e(h).data("udicode"))}});c.bindToElement(g,"googleMapsLoaded",function(h){if(f.placeholder.children(".copter-google-map")){f.renderMap();if(f.hotels){f.renderMarkers(f.hotels)}}});c.bindToElement(g,"allBubblesClosed",function(i){if(f.selectedMarker){var h=f.numberedMarkerImage(f.selectedMarker.number);f.selectedMarker.setIcon(h);if(f.selectedMarker.bubble){f.selectedMarker.bubble.setMap(null);f.selectedMarker.bubble=null}if(f.selectedMarker.selectedBubble){f.selectedMarker.selectedBubble.setMap(null);f.selectedMarker.selectedBubble=null}f.setDefaultMarkerZIndex(f.selectedMarker.hotel.udicode);if(f.selectedMarker.hotel){c.trigger("hotelPinMouseOut",f.selectedMarker.hotel)}f.selectedMarker=null}});g.find(".copter-map-update-results-wrapper input").click(function(h){var i=e(this).is(":checked");f.updateAsMapMoves=i;if(!i){f.search(f.map.getCenter())}c.UserAction.record("map_update_results_click",{is_checked:i,location_name:c.State.get().locationName,lat:c.currentLocation.lat,lng:c.currentLocation.lng,hotel_count:c.currentLocation.hotelCount})})};a.renderMap=function(){var g=this,i=this.placeholder,j=i.children(".copter-google-map");if(c.currentLocation&&c.googleMaps){j.empty();this.bounds=null;this.hotelMarkers={};var f=(g.hotels&&g.hotels.length==1&&i.data("noLocationPin"))?new google.maps.LatLng(g.hotels[0].lat,g.hotels[0].lng):new google.maps.LatLng(c.currentLocation.lat,c.currentLocation.lng),h={center:f,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:false,streetViewControl:false,scaleControl:true,zoom:this.initialZoom,minZoom:this.minZoom};this.map=new google.maps.Map(document.getElementById("copter-google-map-"+this.ts),h);google.maps.event.addListener(this.map,"dragend",function(){g.matchResultsToMap();c.UserAction.record("map_dragged",{zoom_level:g.map.getZoom()})});google.maps.event.addListener(this.map,"zoom_changed",function(){g.matchResultsToMap()})}};a.renderMarkers=function(h){var i=this,k=this.placeholder,g={},j=false,f;if(i.map){this.bounds=new google.maps.LatLngBounds();e.each(h,function(l,m){if(m.lat&&m.lng&&(m.lat!=0||m.lng!=0)){f=new google.maps.LatLng(m.lat,m.lng);if(!i.hotelMarkers[m.udicode]){i.renderHotelMarker((l+1),m,f);j=true}else{i.hotelMarkers[m.udicode].marker.hotel=m}g[m.udicode]=(l+1);i.bounds.extend(f)}});e.each(i.hotelMarkers,function(m,l){if(!g[m]||(g&&(g[m]!=l.number))){i.removeMarker(l.marker);delete i.hotelMarkers[m];j=true}});if(this.locationMarker){this.removeMarker(this.locationMarker)}if(!k.data("noLocationPin")){this.renderLocationMarker()}if(j&&!this.updateAsMapMoves&&k.data("renderHotelCards")){this.map.fitBounds(this.bounds)}this.bringToFrontZIndex=parseInt(e.maxZIndex())+10}};a.renderHotelMarker=function(k,m,f){var h=this,l=h.placeholder,i=(l.data("renderHotelCards"))?this.numberedMarkerImage(k):this.hotelMarkerImage(),j=(l.data("renderHotelCards"))?this.numberedMarkerImage(k,true):this.hotelMarkerImage(),g=new google.maps.Marker({position:f,map:this.map,icon:i});g.hotel=m;g.udicode=m.udicode;g.number=k;keyRates=g.hotel.availableRates;if(!l.data("noPinEvents")||l.data("noPinEvents")=="false"){google.maps.event.addListener(g,"mouseover",function(){if(!h.selectedMarker){g.setIcon(j);h.showHotelBubble(g,g.hotel,"hover");c.trigger("hotelPinMouseOver",g.hotel)}});google.maps.event.addListener(g,"mouseout",function(){if(!h.selectedMarker&&g.bubble){g.setIcon(i);g.bubble.setMap(null);g.bubble=null;h.setDefaultMarkerZIndex(m.udicode);c.trigger("hotelPinMouseOut",g.hotel)}});google.maps.event.addListener(g,"click",function(n){g.setIcon(j);h.showHotelBubble(g,g.hotel,"click");c.trigger("hotelPinClick",g.hotel);c.UserAction.record("map_marker_mouse_click",{udicode:g.hotel.udicode,pin_number:g.number,distance:g.hotel.distance,zoom_level:h.map.getZoom()})})}this.hotelMarkers[m.udicode]={marker:g,number:k}};a.renderLocationMarker=function(){if(c.googleMaps){var h=this,i=h.placeholder,f=new google.maps.LatLng(c.currentLocation.lat,c.currentLocation.lng),g=new google.maps.Marker({position:f,map:this.map,icon:this.geoMarkerImage(),draggable:((i.data("noPinEvents"))?false:true)});this.locationMarker=g;g.setZIndex(e.maxZIndex());if(this.bounds){this.bounds.extend(f)}if(!i.data("noPinEvents")||i.data("noPinEvents")=="false"){google.maps.event.addListener(g,"mouseover",function(){if(!g.noHover&&!h.selectedMarker){var j=new c.components.MapBubble(c.getTemplate("map-location-bubble",{locationName:c.State.get("locationName"),labels:h.getAllText()}),{map:h.map});j.bindTo("position",g,"position");g.bubble=j}});google.maps.event.addListener(g,"mouseout",function(){if(!g.noHover&&g.bubble){g.bubble.setMap(null);g.bubble=null}});google.maps.event.addListener(g,"dragstart",function(j){g.noHover=true;if(g.bubble){g.bubble.setMap(null);g.bubble=null}});google.maps.event.addListener(g,"dragend",function(j){g.noHover=false;h.search(j.latLng)})}return g}};a.getMarkerProperties=function(){var g=this.placeholder,f={locationMapPin:g.data("locationMapPin")||c.baseUrl+"/themes/"+c.theme+"/img/map/geo-pin.png",hotelMapPin:g.data("hotelMapPin")||c.baseUrl+"/themes/"+c.theme+"/img/map/hotel-pin.png",numberedMapPins:g.data("numberedMapPins")||c.baseUrl+"/themes/"+c.theme+"/img/map/numbers.png",mapPinWidth:g.data("mapPinWidth")||25,mapPinHeight:g.data("mapPinHeight")||33};f.mapPinAnchorX=g.data("mapPinAnchorX")||(f.mapPinWidth/2);f.mapPinAnchorY=g.data("mapPinAnchorY")||f.mapPinHeight;return f};a.numberedMarkerImage=function(i,h){var g=this.getMarkerProperties(),f=(h)?g.mapPinWidth:0;return new google.maps.MarkerImage(g.numberedMapPins,new google.maps.Size(g.mapPinWidth,g.mapPinHeight),new google.maps.Point(f,((g.mapPinHeight*i)-g.mapPinHeight)),new google.maps.Point(g.mapPinAnchorX,g.mapPinAnchorY))};a.hotelMarkerImage=function(){var f=this.getMarkerProperties();return new google.maps.MarkerImage(f.hotelMapPin,new google.maps.Size(f.mapPinWidth,f.mapPinHeight),new google.maps.Point(0,0),new google.maps.Point(f.mapPinAnchorX,f.mapPinAnchorY))};a.geoMarkerImage=function(){var f=this.getMarkerProperties();return new google.maps.MarkerImage(f.locationMapPin,new google.maps.Size(f.mapPinWidth,f.mapPinHeight),new google.maps.Point(0,0),new google.maps.Point(f.mapPinAnchorX,f.mapPinAnchorY))};a.bringMarkerToFront=function(h){if(this.hotelMarkers[h]){var f=this.hotelMarkers[h].marker,g=this.numberedMarkerImage(this.hotelMarkers[h].number,true);f.setZIndex(this.bringToFrontZIndex);f.setIcon(g)}};a.setDefaultMarkerZIndex=function(h){if(this.hotelMarkers[h]){var f=this.hotelMarkers[h].marker,g=this.numberedMarkerImage(this.hotelMarkers[h].number);f.setZIndex(null);f.setIcon(g)}};a.matchResultsToMap=function(){var f=this;if(f.updateAsMapMoves){if(f.currentSearch){window.clearTimeout(f.currentSearch)}f.currentSearch=window.setTimeout(function(){f.search(f.map.getCenter(),{radius:f.getRadius()})},3000)}};a.search=function(k,j){var i=this,f=(c.State.stay()||{}),h,g;if(!i.searchBlocked){if(!j){j={}}i.searchBlocked=true;i.reverseGeocodeLookUp(k,function(l,m){if(m==i.currentGeocodeLookupId){g={locationName:l,lat:k.lat(),lng:k.lng()};h=e.extend(g,f,j,{cardType:"map"});c.trigger("searchStart");c.State.clearCurrentState();c.State.set(h);i.map.panTo(k);i.searchBlocked=false}})}};a.triggerResize=function(){var f;if(c.googleMaps){f=(c.currentPosition)?new google.maps.LatLng(c.currentLocation.lat,c.currentLocation.lng):null;google.maps.event.trigger(this.map,"resize");if(f){this.map.panTo(f)}return this.placeholder}};a.removeMarker=function(f){f.setMap(null);e(f).remove()};a.reverseGeocodeLookUp=function(i,f){var j=new google.maps.Geocoder(),g=this.getText("yourLocation"),h=++this.currentGeocodeLookupId;j.geocode({latLng:i},function(l,k){if(k==google.maps.GeocoderStatus.OK){g=(l.length>1)?l[1]["formatted_address"]:l[0]["formatted_address"]}if(f){f(g,h)}})};a.distHaversine=function(g,f){var l=function(o){return o*Math.PI/180},h=6371,j=l(f.lat-g.lat),n=l(f.lng-g.lng),m=Math.sin(j/2)*Math.sin(j/2)+Math.cos(l(g.lat))*Math.cos(l(f.lat))*Math.sin(n/2)*Math.sin(n/2),k=2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m)),i=h*k;return i.toFixed(3)};a.getRadius=function(){var f=this.map.getCenter(),i=this.map.getBounds().getNorthEast(),h={lat:f.lat(),lng:f.lng()},g={lat:i.lat(),lng:i.lng()};return this.distHaversine(h,g)};a.showHotelBubble=function(i,g,f){var n=this,k=(f=="hover")?{width:50,height:50}:{width:200,height:150},h=25,l=e(c.getTemplate(("map-hotel-bubble-"+f),{labels:this.getAllText(),imageUrl:g.primaryPhoto(k.width,k.height).url,imageAlt:e.escapeHTML(g.name),name:e.truncate(g.name,h),stars:g.stars,starsLabel:(g.stars)?this.getText("starLabel"+g.stars):""})),m,j={directLink:true,polled:!!(g.polled),excludeFromSearch:true};if(f=="click"){l.find(".copter-img").click(function(o){n.showHotelDetails(g,"overview");c.UserAction.record("map_show_hotel_details",{udicode:g.udicode,hotel_tab:"overview",pin_number:i.number,distance:g.distance,zoom_level:n.map.getZoom()})});l.find("a.copter-name-link").click(function(o){o.preventDefault();n.showHotelDetails(g);c.UserAction.record("map_show_hotel_details",{udicode:g.udicode,hotel_tab:"overview",pin_number:i.number,distance:g.distance,zoom_level:n.map.getZoom()})});j=e.extend(j,{includeRoomDetails:true,includeBrandLogo:true,includeRateTotal:true})}c.components.HotelRate.createInstance(l.find(".copter-hotel-rate"),g,j);m=new c.components.MapBubble(l,{map:this.map,targetSize:i.getIcon().size});m.bindTo("position",i,"position");if(f=="hover"){i.bubble=m}else{window.setTimeout(function(){i.selectedBubble=m;n.selectedMarker=i},250)}n.bringMarkerToFront(g.udicode)};a.showHotelDetails=function(g,f){c.State.set({hotel:g.udicode,hotelTab:(f||"overview")})}})(hotelicopter,hotelicopter.$);(function(b,e,c){var a=b.components.MapBubble=function(g,f){this.setValues(f);this.div_=null;this.contents=g};a.initialize=function(){};b.bind("googleMapsLoaded",function(){var f=a.prototype=new google.maps.OverlayView();f.onAdd=function(){var g=this;this.listeners_=[google.maps.event.addListener(this,"position_changed",function(){g.draw()}),google.maps.event.addListener(this,"text_changed",function(){g.draw()})]};f.onRemove=function(){var h=0,g;e(this.div_).remove();this.setMap(null);for(h=0,g=this.listeners_.length;h<g;++h){google.maps.event.removeListener(this.listeners_[h])}};f.draw=function(){var h=this.getProjection(),g=h.fromLatLngToDivPixel(this.get("position")),j=h.fromLatLngToContainerPixel(this.get("position")),i=b.components.Bubble.createInstance(this.contents,{top:g.y-20,left:g.x,relativeTop:j.y-20,relativeLeft:j.x},{fitsWithin:this.map.getDiv()}).placeholder;i.css("display","block");this.div_=i.get(0);var k=this.getPanes().floatPane;k.appendChild(this.div_);e(this.div_).find(".content div:first").html(this.html);b.trigger("mapBubbleDrawn",this)}})})(hotelicopter,hotelicopter.$,hotelicopter._);(function(c,e){var b=c.components.DateSlider=function(f){this.placeholder=e(f);this.dateArray=[];this.numSlots=11;this.sliderControl=null};var a=b.prototype;b.cssClass="copter-dateslider";b.initialize=function(){var f=this;e("."+f.cssClass).each(function(g,j){var h=e(j);if(h.is(":empty")){f.createInstance(h.get(0))}})};b.createInstance=function(i,g){var f=this,h=e(i),j=null;g=(g||{});if(!h){c.throwException("Attempted to create a View component but no placeholder argument was supplied.")}h.addClass(f.cssClass);e.each(g,function(m,l){h.data(m,l)});j=new f(i);j.render();j.assignGlobalEventHandlers();c.trigger("dateSliderFirstRendered",h.get(0));return j};a.render=function(){var g=this.placeholder,f=this.getWidth();g.empty();this.dateArray=[];g.data("instance",this);if(g.data("checkIn")&&g.data("checkOut")){g.append(c.getTemplate("date-slider-main",{}));g.width(f);this.sliderControl=g.children(".copter-control").width(f);this.renderSlider();c.trigger("dateSliderRendered",g.get(0))}};a.assignGlobalEventHandlers=function(){var f=this,g=this.placeholder;c.bindToElement(g,"stateChangedStay",function(i,h){g.data("checkIn",h.checkIn);g.data("checkOut",h.checkOut);f.render()})};a.renderSlider=function(){var w=this,h=this.placeholder,j=e.datepicker.parseDate("yy-mm-dd",h.data("checkIn")),o=e.datepicker.parseDate("yy-mm-dd",h.data("checkOut")),u=this.dateDiff(j,o),m=parseInt((this.numSlots-u)/2),t=(((m*2)+u)<this.numSlots)?(m+1):m,f="",v=h.children(".copter-calendar"),g,s,r,k,l,n,q;g=new Date(j);g=new Date(g.setDate(g.getDate()-m));s=new Date(o);s=new Date(s.setDate(s.getDate()+t));q=g.getMonth();for(n=0;n<this.dateDiff(g,s);n++){r=new Date(g);r=new Date(r.setDate(r.getDate()+n));if(r.getMonth()!=q){this.addNewMonth(r)}this.addDay(r);if(r.getTime()==j.getTime()){k=this.dateArray.length-1}if(r.getTime()==o.getTime()){l=this.dateArray.length}q=r.getMonth()}if(this.dateArray.length>this.numSlots){this.dateArray.shift();k--;l--}if(!l){l=this.dateArray.length+1}e.each(this.dateArray,function(x,p){f+=p.html});v.append(f+'<div class="copter-clear"></div>');v.children(".copter-date-slot:first").addClass("copter-first");v.children(".copter-date-slot:last").addClass("copter-last");if(u>=(((j.getMonth()==o.getMonth())?this.numSlots:(this.numSlots-1)))){h.hide();c.trigger("dateSliderHidden",h.get(0))}else{h.show();c.trigger("dateSliderDisplayed",h.get(0))}w.sliderControl.slider({animate:false,range:true,step:1,min:0,max:this.numSlots,values:[k,l],slide:function(x,p){var i=(w.rangeContainsMonthSlot(p.values[0],p.values[1]))?2:1;if(p.values[1]<=(p.values[0]+i)){return false}w.highlightSelectedDates(p.values[0],p.values[1])},change:function(p,i){if(typeof w.dateArray[i.values[0]].date=="string"){w.sliderControl.slider("values",0,(i.values[0]+1));w.highlightSelectedDates((i.values[0]+1),i.values[1])}if(typeof w.dateArray[i.values[1]-1].date=="string"){w.sliderControl.slider("values",1,(i.values[1]-1));w.highlightSelectedDates(i.values[0],(i.values[1]-1))}}});this.highlightSelectedDates(k,l)};a.addDay=function(h,g){var f={date:h,html:c.getTemplate("date-slider-day",{date:h.getDate(),dayName:this.getText("day"+h.getDay())})};if(g){this.dateArray.unshift(f)}else{this.dateArray.push(f)}};a.addNewMonth=function(g){var f=this.getText("mon"+g.getMonth());this.dateArray.push({date:f,html:c.getTemplate("date-slider-month",{monthName:f})})};a.getWidth=function(){var h=this.placeholder,f=e(c.getTemplate("date-slider-day",{dayName:"Thu",date:"30"})),g;h.append(f);g=f.outerWidth(true);f.remove();return(g*this.numSlots)};a.dateDiff=function(g,f){return parseInt((f-g)/(1000*60*60*24))};a.highlightSelectedDates=function(k,h){var g=this.placeholder.children(".copter-calendar"),f,j;g.find(".copter-date-slot").removeClass("copter-selected");for(j=k;j<h;j++){f=e(g.find(".copter-date-slot")[j]);f.addClass("copter-selected")}};a.rangeContainsMonthSlot=function(h,f){var j=false,g;for(g=h;g<f;g++){if(typeof this.dateArray[g].date=="string"){j=true}}return j};a.getDates=function(){if(this.sliderControl){var g=this.sliderControl.slider("option","values"),h=e.datepicker.formatDate("yy-mm-dd",this.dateArray[g[0]].date),f=e.datepicker.formatDate("yy-mm-dd",this.dateArray[g[1]-1].date);return{checkIn:h,checkOut:f}}else{return null}}})(hotelicopter,hotelicopter.$);hotelicopter.components.HotelCard.prototype.text={checkRates:"Check Rates",avgRate:"Avg. Rate",ratesFrom:"From",inclusive:"",exclusive:"*",unavailable:"Booking Unavailable",viewAllRoomsRates:"View all rooms & rates",compareRates:"Compare Rates",close:"Close",cancelClose:"Cancel &amp; close",unknown:"Unknown",ratrixBookButton:"Book",flipCard:"Back",star:"Star",property:"Property",miles:"miles",km:"km",from:"from",downtown:"Downtown"};hotelicopter.components.HotelCards.prototype.text={nextUp:"Coming Up Next...",viewMore:"View More Hotels",moreWait:"Please wait...",zeroResultsLine1:"Sorry. We can't find any available hotels that match your search.",zeroResultsLine2:"Please adjust your filters or dates and try again."};hotelicopter.components.HotelRate.prototype.text={checkRates:"Check Rates",avgRate:"Avg. Rate",ratesFrom:"rates from",inclusive:"",exclusive:"*",rateFound:"Best So Far",unavailable:"Booking Unavailable",unavailableMessage:"This hotel is unavailable to book",callToBook:"Call To Book",viewRates:"View Rates",checkingRates:"Checking Availability&#8230;",checkRatesAvail:"Check Rates &amp; Availability",compareRates:"Compare Rates",close:"Close",cancelClose:"Cancel &amp; close",unknown:"Unknown",unknownRoom:"Unknown Room Type",plusTaxes:"+ taxes",incTaxes:"incl. taxes",andFees:"& fees",estimatedTotal:"estimated total",bookAt:"Book at",bookNow:"Book Now!",from:"From",officialSite:"Official Site"};hotelicopter.components.Filters.prototype.text={apply:"Apply",cancel:"Cancel and close",to:"to",from:"from",selected:"selected",rateHeading:"Price Range",starsHeading:"Star Rating",userHeading:"Minimum User Rating",amenityHeading:"Amenities",propertyHeading:"Property",brandHeading:"Brands/Groups",nameHeading:"Hotel Name",any:"Any",anyBrand:"Any Brand",anyGroup:"Any Group",brands:"Brands",groups:"Groups",moreBrands:"Show all brands",lessBrands:"Show selected brands",moreGroups:"Show all groups",lessGroups:"Show selected groups",enterName:"Enter a hotel name",star:"star",help:"?"};hotelicopter.components.Sort.prototype.text={sort:"Sort Hotels",rankasc:"Automagically",randomasc:"Automagically",nameasc:"by Hotel Name (A-Z)",rateasc:"by Price (Lowest First)",starsasc:"by Star Rating (Lowest First)",distanceasc:"by Distance (Nearest)",rankdesc:"Automagically",randomdesc:"Automagically",namedesc:"by Hotel Name (Z-A)",ratedesc:"by Price (Highest First)",starsdesc:"by Star Rating (Highest First)",distancedesc:"by Distance (Farthest)"};hotelicopter.components.View.prototype.text={view:"View",gallery:"In a grid",summary:"As a list",list:"As a list",carousel:"One hotel at a time",map:"On a map"};hotelicopter.components.SearchResults.prototype.text={hotelsIn:"Hotels in",hotelsNear:"Hotels near",enterDates:"Select Dates",newSearch:"Start Over",editSearch:"Change",unspecifiedLocation:"your chosen location",disclaimer:"* Starred prices may not include taxes and fees.",to:"to",room:"room",rooms:"rooms",guest:"guest",guests:"guests",applyFilters:"Apply Filter Changes",moreFilters:"Show more filters",lessFilters:"Show less filters",currentlyShowing:"Currently showing",of:"of",totalHotels:"total hotels",searching:"Searching...",checkingRates:"Checking Rates &amp; Availability...",zeroHotelsFound:"0 Hotels Found"};hotelicopter.components.SearchEngine.prototype.text={findHotels:"Find Hotels"};hotelicopter.components.SearchForm.prototype.text={checkIn:"Check-in",checkOut:"Check-out",rooms:"Rooms",guests:"Guests",search:"Search",places:"Places",airports:"Airports",hotels:"Hotels",searchPrompt:"Enter a city, address, ZIP, or airport code",recentSearch:"Recent Searches",clearRecentSearch:"Clear"};hotelicopter.components.Ratrix.prototype.text={editSearchLink:"Edit Search",singleRoom:"Room",pluralRoom:"Rooms",singleGuest:"Guest",pluralGuest:"Guests",roomType:"Room Type",rateExclusive:"Per Room Per Night",rateInclusive:"w/Taxes &amp; Fees",searching:"Searching for rates...",bestSoFar:"best so far",showRates:"Show Best Rates",showRoomTypes:"Show Room Types",from:"from",viewAll:"View All",viewBest:"View Best",only:"Only",rates:"Rates",hide:"Hide",show:"Show",bookNow:"Book Now",officialSite:"Official Site",compareRatesFrom:"Compare Rates From",plusTaxes:"+ taxes",incTaxes:"incl. taxes",andFees:"& fees",estimatedTotal:"estimated total"};hotelicopter.components.HotelDetails.prototype.text={visitWebsite:"Visit web site",descriptionHeader:"Hotel Description",bookingOptions:"Booking Options",from:"From",checkRates:"Check Rates",checkRatesAvail:"Check Rates & Availability",close:"Close",cancelClose:"Cancel & close",viewAll:"View all photos",print:"Print this page",email:"Email",readMore:"Read more",readLess:"Read less",learnMoreAt:"Learn more at",amenities:"Amenities",loading:"Loading...",unknown:"Unknown",compareRates:"Compare Rates",officialSite:"Official Site",star:"star",property:"property",disclaimer:"Unless otherwise noted, displayed rates represent the average per night for each room. Prices and availability are subject to change and prices are not guaranteed, so please verify hotel details before booking on the provider's web site.",overviewTab:"Overview",descriptionTab:"Description",photosTab:"Photo Gallery",reviewsTab:"Ratings & Reviews",ratesTab:"All Rooms & Rates",mapTab:"Map",plusTaxes:"+ taxes",incTaxes:"incl. taxes",andFees:"& fees",estimatedTotal:"estimated total",bookNow:"Book Now!",unknownRoom:"Unknown Room Type",miles:"miles",km:"km",from:"from",downtown:"Downtown",subjectPrefix:"Check out this great hotel I found in",bodyPartOne:"Take a look at the",bodyPartTwo:"in",bodyPartThree:"— I discovered it on Room Key. Just click on this link to take a look for yourself. ",bodyPartFour:"Be sure to check out Room Key (http://www.roomkey.com) for other great hotel options!%0D%0A%0D%0ARates and availability are subject to change at any time.  The sender of this email thought you may be interested in this information. Room Key does not supply or collect email addresses."};hotelicopter.components.Lightbox.prototype.text={close:"Close"};hotelicopter.components.Map.prototype.text={yourLocation:"Your Chosen Location",locationMarkerInstructions:"Drag this pin to update search results",hotelMarkerInstructions:"Click pin to view full hotel details",updateAsMapMoves:"Redo my search as I move the map",starLabel1:"A 1 star property",starLabel2:"A 2 star property",starLabel3:"A 3 star property",starLabel4:"A 4 star property",starLabel5:"A 5 star property"};hotelicopter.components.DateSlider.prototype.text={day0:"Sun",day1:"Mon",day2:"Tue",day3:"Wed",day4:"Thu",day5:"Fri",day6:"Sat",mon0:"Jan",mon1:"Feb",mon2:"Mar",mon3:"Apr",mon4:"May",mon5:"Jun",mon6:"Jul",mon7:"Aug",mon8:"Sep",mon9:"Oct",mon10:"Nov",mon11:"Dec"};(function(b,e,c){var a=b.State={current:{},previous:{},defaults:{cardType:"gallery",sort:"distance",sortDirection:"asc"}};a.filterAttributes=["rateFrom","rateTo","starFrom","starTo","userFrom","userTo","hotelName","amenities","propertyTypes","brands","sort","sortDirection"];a.locationAttributes=["locationId","lat","lng","radius","minHotels"];a.requestAttributes=a.locationAttributes.concat(a.filterAttributes);a.stayAttributes=["checkIn","checkOut","rooms","guests"];a.searchAttributes=a.requestAttributes.concat(a.stayAttributes);a.nonSearchAttributes=["locationName","cardType","hotel","hotelTab","partnerCode"];a.stateAttributes=a.searchAttributes.concat(a.nonSearchAttributes);a.arrayAttributes=["amenities","propertyTypes","brands"];a.hotelDetailsAttributes=["hotel","hotelTab"];a.initialize=function(){var f=this,g;e(function(){g=window.location.hash;f.assignHashChangeHandler();if(f.useHash()&&g&&g.length>0){e(window).hashchange()}})};a.get=function(h){var f=this,g;if(h){g=this.getAttribute(h)}else{g={};e.each(this.current,function(j,i){g[j]=f.getAttribute(j)});e.each(this.defaults,function(j,i){if(!g[j]){g[j]=f.getAttribute(j)}})}return g};a.getAttribute=function(h){var f=(this.current)?this.current[h]:null,g=(f||null);if(!g&&this.defaults[h]){g=this.defaults[h]}if(g&&e.inArray(h,this.arrayAttributes)>=0){g=g.split(",")}return g};a.set=function(f){var g=this.buildNewState(f);if(this.useHash()){this.setHash(g)}else{this.setCurrentState(g)}};a.buildNewState=function(g){var f=this,j=e.extend({},this.current),i=e.extend({},this.current),h=e.extend({},this.previous);e.each(g,function(m,l){if(l){if(m==="amenities"||m==="brands"||m==="propertyTypes"){if(!e.isArray(l)){l=l.split(",")}}else{l=l.toString()}if(e.inArray(m,a.stateAttributes)>=0){j[m]=l}}else{delete j[m]}});j=this.removeDefaultSettings(j);this.current=j;this.previous=i;if(this.attributesChanged(f.locationAttributes)){j=this.removeDefaultSettings(this.preFilter(j))}this.current=i;this.previous=h;return j};a.removeDefaultSettings=function(f){if(b.currentLocation){if(f.rateFrom&&f.rateFrom<=b.currentLocation.aggregatedBestRates.lowest){delete f.rateFrom}if(f.rateTo&&f.rateTo>=b.currentLocation.aggregatedBestRates.highest){delete f.rateTo}}if((f.starFrom&&parseInt(f.starFrom)===1)&&(f.starTo&&parseInt(f.starTo)===5)){delete f.starFrom;delete f.starTo}if((f.userFrom&&parseInt(f.userFrom)===1)&&(f.userTo&&parseInt(f.userTo)===10)){delete f.userFrom;delete f.userTo}return f};a.setCurrentState=function(f){this.previous=e.extend({},this.current);this.current=f;this.triggerStateChange()};a.clearCurrentState=function(){b.currentLocation=null;this.previous=e.extend({},this.current);this.current={}};a.triggerStateChange=function(){var f=this;if(this.attributesChanged(f.locationAttributes)){b.trigger("stateChangedLocation",f.getAttributes(f.locationAttributes))}if(this.attributesChanged(f.stayAttributes)){b.trigger("stateChangedStay",f.getAttributes(f.stayAttributes))}if(this.attributesChanged(f.locationAttributes)||this.attributesChanged(f.stayAttributes)){b.trigger("stateChangedLocationOrStay",e.extend(f.getAttributes(f.locationAttributes),f.getAttributes(f.stayAttributes)))}if(this.attributesChanged(f.searchAttributes)){b.trigger("stateChangedSearch",f.getAttributes(f.searchAttributes));if(!this.attributesChanged(f.locationAttributes)&&!this.attributesChanged(f.stayAttributes)){b.trigger("stateChangedSearchExcludingLocationOrStay",f.getAttributes(f.searchAttributes))}}else{if(this.attributeChanged("cardType")){b.trigger("stateChangedCardType",f.get("cardType"))}}if(this.attributesChanged(f.filterAttributes)){b.trigger("stateChangedFilter",f.getAttributes(f.filterAttributes))}if(this.attributeChanged("locationName")){b.trigger("stateChangedLocationName",f.get("locationName"))}if(this.attributesChanged(f.hotelDetailsAttributes)){f.openOrCloseHotelDetails();b.trigger("stateChangedHotelDetails",f.getAttributes(f.hotelDetailsAttributes))}};a.attributeChanged=function(h){var i=false,g=(this.current)?this.current[h]:null,f=(this.previous)?this.previous[h]:null;if(g!=f){i=true}return i};a.attributesChanged=function(g){var f=this,h=false;e.each(g,function(k,j){if(f.attributeChanged(j)){h=true}});return h};a.getAttributes=function(h){var g=this,i={},f;e.each(h,function(k,j){f=g.getAttribute(j);if(f){i[j]=f}});return((c.isEmpty(i))?null:i)};a.getRequestAttributes=function(){return this.getAttributes(this.requestAttributes)};a.getFilterAttributes=function(){return this.getAttributes(this.filterAttributes)};a.getLocationAttributes=function(){return this.getAttributes(this.locationAttributes)};a.areFiltersApplied=function(){var f=false;e.each(this.getFilterAttributes,function(g,h){if(h){f=true}});return f};a.stay=function(){return this.getAttributes(this.stayAttributes)};a.clear=function(){var f=e.extend({},this.current);e.each(f,function(h,g){f[h]=null});this.set(f)};a.useHash=function(){var f=e("#copter-widget").data("urlHash");return(f==="#"||f==="#!")};a.getHashParam=function(i){var g=this.hashToParams(),f=(g)?g[i]:null;return f};a.hashToParams=function(){var g=window.location.hash,f=e("#copter-widget").data("urlHash");if(g.length>0){g=g.replace(f,"");g=e.toQueryParams(g);return g}else{return null}};a.setHash=function(f){var g=this.buildHash(f);if(window.location.hash!==g){window.location.hash=g}};a.buildHash=function(h){var g=this,f=false,i=(e("#copter-widget").data("urlHash")||"");e.each(h,function(l,j){if(j&&j.toString().length>0&&g.defaults[l]!=j){if(f){i+="&"}i+=encodeURIComponent(l)+"="+encodeURIComponent(j);f=true}});return i};a.assignHashChangeHandler=function(){var f=this;if(this.useHash()){b.bind("hashChange",function(){var g=window.location.hash.replace(e("#copter-widget").data("urlHash"),"");if(g.length===0){f.clearCurrentState();f.openOrCloseHotelDetails()}else{f.setCurrentState(f.hashToParams())}})}};a.openOrCloseHotelDetails=function(){var l=b.State.get("hotel"),i=b.State.get("hotelTab"),g,h,j,f,k;if(l){if(e(".copter-lightbox .copter-hoteldetails").length===0){k=function(){h=e('.copter-hotelcard[data-udicode="'+l+'"]');if(h.length===0){j=l}else{j=h.data("instance").hotel;g=h.data("polled")}f=b.components.HotelDetails.createInstance(e("<div/>").css("min-height","580px"),j,{initialTab:i,polled:g});b.components.Lightbox.createInstance(f.placeholder);b.UserAction.record("hotel_details_lightbox_opened",{udicode:l})};k()}}else{b.components.Lightbox.closeAll(".copter-hoteldetails")}};a.preFilter=function(f){return f}})(hotelicopter,hotelicopter.$,hotelicopter._);window.hotelicopter.devMode=false;window.hotelicopter.templates={"hotel-rate-no-rate":'<div class="copter-norate copter-rate-wrapper"> <div class="copter-label"><%=labels.unavailable%></div> </div>',"hotel-rate-ratrix-bubble":'<div class="copter-ratrix-bubble"> <div class="copter-heading"> <div class="copter-left"><%=labels.compareRates%></div> <div class="copter-right"><a class="copter-cancel copter-primary" href="#"><%=labels.close%> <span class="copter-x">&#215;</span></a></div> <div class="copter-clear"></div> </div> <div class="copter-ratrix"></div> </div>',"hotel-rate-check-rates-bubble":'<div class="copter-check-rates-bubble"> <div class="copter-heading"> <div class="copter-left"><%=labels.checkRatesAvail%></div> <div class="copter-right"><a class="copter-cancel copter-primary" href="#"><%=labels.close%> <span class="copter-x">&#215;</span></a></div> <div class="copter-clear"></div> </div> <div class="copter-searchform"></div> <div class="copter-cancel-close"><a href="#" class="copter-cancel copter-primary"><%=labels.cancelClose%></a></div> </div>',"hotel-rate-dateless":'<div class="copter-dateless copter-rate-wrapper"> <div class="copter-historical-rate"> <span class="copter-label"><%=labels.ratesFrom%></span> <span class="copter-currency"><%=$h.currencySymbol%></span><span class="copter-rate"><%=rate%></span> <span class="copter-clear"></span> </div> <a class="copter-book" href="#"><span class="copter-label"><%=labels.checkRates%></span></a> <div class="copter-clear"></div> </div>',"hotel-rate-checking":'<div class="copter-rate-search copter-rate-wrapper"> <div class="copter-spinner"></div> <%if(rate) {%> <div class="copter-rate-found"> <span class="copter-label"><%=labels.rateFound%></span> <span class="copter-currency"><%=$h.currencySymbol%></span><span class="copter-rate"><%=rate%></span> <span class="copter-clear"></span> </div> <%}else{%> <div class="copter-checking"><%=labels.checkingRates%></div> <%}%> <div class="copter-clear"></div> </div>',"hotel-rate-live":'<div class="copter-liverate copter-rate-wrapper" > <%if(includeRoomDetails){%><div class="copter-room-details"><a href="#" class="copter-secondary" title="<%=roomDetailsFull%>"><%=roomDetails%>&nbsp;<span class="copter-chevrons">&gt;&gt;</span></a></div><%}%> <div class="copter-rate-breakdown"> <a class="copter-rate-link" href="<%=bookingUrl%>" target="<%=linkTarget%>"> <%if(includeFrom){%><span class="copter-from"><%=labels.from%></span><%}%> <span class="copter-currency"><%=$h.currencySymbol%></span><span class="copter-rate"><%=rateEx%></span> <span class="copter-label"> <span class="copter-taxes-label"><%=labels.plusTaxes%></span> <span class="copter-fees-label"><%=labels.andFees%></span></span> <span class="copter-clear"></span> </a> <%if(includeRateTotal){%> <div class="copter-total"> <span class="copter-currency"><%=$h.currencySymbol%></span><span class="copter-rate"><%=rateInc%></span> <span class="copter-label"><%=labels.estimatedTotal%></span> <span class="copter-clear"></span> </div> <%}%> </div> <a class="copter-book <%if(includeBrandLogo){%>copter-has-logo<%}%> <%if(includeOfficialSite){%>copter-has-official-site-label<%}%>" href="<%=bookingUrl%>" target="<%=linkTarget%>"> <span class="copter-label"><%if(includeBrandLogo){%><%=labels.bookAt%><%}else{%><%=labels.bookNow%><%}%></span> <%if(includeBrandLogo){%><span class="copter-logo" style="background-image:url(<%=advertiserLogo%>)"></span><%}%> <%if(isDirect && includeOfficialSite){%><span class="copter-official-site copter-clear"><%=labels.officialSite%></span><%}%> </a> <div class="copter-clear"></div> </div>',"hotel-rate-unavailable-bubble":'<div class="copter-unavailable-bubble"><%=labels.unavailableMessage%></div>',"search-engine-main":'<div class="copter-main-search"> <div class="copter-searchform"></div> </div> <div class="copter-searchresults"></div>',"lightbox-main":'<div class="copter-wrapper"> <div class="copter-contents"></div> <% if(showCloseButton) { %> <div class="copter-close-link copter-close-bottom"><a href="#" class="copter-primary copter-close"><%=labels.close%> <span class="copter-x">&#215;</span></a></div> <% } %> <div class="copter-close-link copter-close-top"><a href="#" class="copter-primary copter-close"><%=labels.close%> <span class="copter-x">&#215;</span></a></div> </div>',"search-form-recentsearch-button":'<a href="#" class="copter-recentsearch-button copter-primary"><%=labels.recentSearch%></a>',"search-form-autofill-hotel-b":'<div class="copter-autofill-hotel copter-autofill-hotel-b" data-location-name="<%=predictiveText%>" data-hotel="<%=udicode%>" data-lat="<%=lat%>" data-lng="<%=lng%>"> <div class="copter-autofill-image-b" style="background:url(<%=img%>)"></div> <div class="copter-autofill-address"> <div class="copter-autofill-name-1"><%=namePartial1%></div> <div class="copter-autofill-name-2"><%=namePartial2%></div> </div> <%if(hotel.stars){%><div class="copter-stars copter-<%=stars%>star"></div><%}%> <div class="copter-rate"><%=rate%></div> <div class="copter-clear"></div> </div>',"search-form-autofill-hotel-a":'<div class="copter-autofill-hotel copter-autofill-hotel-a" data-location-name="<%=predictiveText%>" data-hotel="<%=udicode%>" data-lat="<%=lat%>" data-lng="<%=lng%>"> <div class="copter-autofill-address"> <span class="copter-autofill-name-1"><%=namePartial1%></span><span class="copter-autofill-name-2"><%=namePartial2%></span> </div> <%if(hotel.stars){%><div class="copter-stars copter-<%=stars%>star"></div><%}%> <div class="copter-rate"><%=rate%></div> <div class="copter-clear"></div> </div>',"search-form-autofill-result":'<div id="<%=id%>" class="copter-autofill-result"></div>',"search-form-recentsearch":'<div class="copter-recentsearch"> <div class="copter-recentsearch-items"></div> <a href="#" class="copter-clear-recentsearch-list copter-primary"><%=labels.clearRecentSearch%></a> </div>',"search-form-location":'<div id="copter-autofill-wrapper-<%=ts%>" class="copter-autofill-wrapper"> <input type="text" id="copter-autofill-<%=ts%>" name="copter-autofill-<%=ts%>" autocomplete="off" tabindex="1" /> <div id="copter-autofill-preselect-<%=ts%>" class="copter-autofill-preselect"><%=locationFieldPlaceholder%></div> </div>',"search-form-autofill-heading":'<div class="copter-autofill-heading"><%=heading%></div>',"search-form-stay":'<div class="copter-search-form-stay"> <div class="copter-form-fields"> <div class="copter-form-field copter-form-field-check-in"> <label for="copter-search-form-check-in-<%=ts%>"><%=labels.checkIn%></label> <span><input type="text" name="copter-search-form-check-in-<%=ts%>" id="copter-search-form-check-in-<%=ts%>" placeholder="<%=dateFieldPlaceholder%>" /></span> </div> <div class="copter-form-field copter-form-field-check-out"> <label for="copter-search-form-check-out-<%=ts%>"><%=labels.checkOut%></label> <span><input type="text" name="copter-search-form-check-out-<%=ts%>" id="copter-search-form-check-out-<%=ts%>" placeholder="<%=dateFieldPlaceholder%>" /></span> </div> <div class="copter-form-field copter-form-field-rooms"> <label for="copter-search-form-numrooms-<%=ts%>"><%=labels.rooms%></label> <span> <select id="copter-search-form-numrooms-<%=ts%>" name="copter-search-form-numrooms-<%=ts%>"> <option selected="selected">1</option><option>2</option><option>3</option><option>4</option> </select> </span> </div> <div class="copter-form-field copter-form-field-guests"> <label for="copter-search-form-numguests-<%=ts%>"><%=labels.guests%></label> <span> <select id="copter-search-form-numguests-<%=ts%>" name="copter-search-form-numguests-<%=ts%>"> <option selected="selected">1</option><option>2</option><option>3</option><option>4</option> </select> </span> </div> <div class="copter-clear"></div> </div> <div class="copter-form-button"> <a class="copter-button" href="#"><span class="copter-button-label"><%=labels.search%></span></a> </div> <div class="copter-clear"></div> </div>',"search-form-autofill-dropdown":'<div id="<%=id%>" class="copter-autofill-dropdown"></div>',"search-form-autofill-preselect":'<span class="copter-hidden"><%=hidden%></span><%=visible%>',"search-form-autofill-airport":'<div class="copter-autofill-airport" data-location-name="<%=name%>" data-lat="<%=lat%>" data-lng="<%=lng%>"> <div class="copter-autofill-address"> <span class="copter-autofill-name-1"><%=namePartial1%></span><span class="copter-autofill-name-2"><%=namePartial2%></span> </div> <div class="copter-clear"></div> </div>',"search-form-recentsearch-item":'<a href="#" class="copter-recentsearch-item"><div class="copter-recentsearch-address"><span class="copter-autofill-name-1"><%=partialName1%></span><span class="copter-autofill-name-2"><%=partialName2%></span></div><span class="copter-recentsearch-date"><%=checkIn%> &ndash; <%=checkOut%></span><div class="copter-clear"></div></a>',"search-form-autofill-location-a":'<div class="copter-autofill-location-a" data-location-name="<%=name%>" data-location-id="<%=locationId%>" data-lat="<%=lat%>" data-lng="<%=lng%>" data-google="<%=google%>"> <div class="copter-autofill-address"> <span class="copter-autofill-name-1"><%=namePartial1%></span><span class="copter-autofill-name-2"><%=namePartial2%></span> </div> <div class="copter-clear"></div> </div>',"search-form-autofill-location-b":'<div class="copter-autofill-location-b" data-location-name="<%=name%>" data-location-id="<%=locationId%>" data-lat="<%=lat%>" data-lng="<%=lng%>" data-google="<%=google%>"> <div class="copter-autofill-image-b" style="background:url(//dmjtywvpor911.cloudfront.net/locations/50x50/<%=img%>)"></div> <div class="copter-autofill-address"> <div class="copter-autofill-name-1"><%=namePartial1%></div> <div class="copter-autofill-name-2"><%=namePartial2%></div> </div> <div class="copter-clear"></div> </div>',"hotel-cards-summary-pagination-img":'<div class="copter-previewimg"><img src="<%=url%>" alt="<%=name%>" title="<%=name%>" /></div>',"hotel-cards-map-pagination-card":'<div class="copter-mapmorecard copter-map-pagination copter-pagination" data-udicode="pagination"> <a href="#" class="copter-morehotels copter-primary"><%=labels.viewMore%></a> </div>',"hotel-cards-summary-pagination-card":'<div class="copter-summarymorecard copter-summary-pagination copter-pagination" data-udicode="pagination"> <a href="#" class="copter-morehotels copter-primary"><%=labels.viewMore%></a> </div>',"hotel-cards-zero-results":'<div class="copter-zero-results"> <div class="copter-line-1"><%=labels.zeroResultsLine1%></div> <div class="copter-line-2"><%=labels.zeroResultsLine2%></div> </div>',"hotel-cards-quicksand":'<div id="copter-quicksand-source-<%=ts%>"></div> <div id="copter-quicksand-destination-<%=ts%>" class="copter-hidden"></div>',"hotel-cards-gallery-pagination-img":'<div class="copter-previewimg"><img src="<%=url%>" alt="<%=name%>" title="<%=name%>" /></div>',"hotel-cards-gallery-pagination-card":'<div class="copter-gallery-pagination copter-pagination" data-udicode="pagination"> <div class="copter-content"></div> <div class="copter-preview"> <div class="copter-title"><%=labels.nextUp%></div> <div class="copter-previewimages"><div class="copter-clear" /></div> <div class="copter-link"><a href="#" class="copter-morehotels copter-primary"><%=labels.viewMore%></a></div> <div class="copter-spinner"><%=labels.moreWait%></div> </div> </div>',"hotel-cards-map-pagination-img":'<div class="copter-previewimg"><img src="<%=url%>" alt="<%=name%>" title="<%=name%>" /></div>',"search-results-lateral-filters":'<div class="copter-heading"></div> <div class="copter-new-search"><a href="#" class="copter-new-search-link copter-primary"><span class="copter-new-search-label"><%=labels.newSearch%></span></a></div> <div class="copter-initial-controls copter-relative"> <div class="copter-filters copter-filters-primary"></div> <div class="copter-sort"></div> <div class="copter-dateslider"></div> </div> <div class="copter-filters copter-filters-secondary"></div> <div class="copter-filter-buttons copter-relative"> <a href="#" class="copter-filters-global-apply copter-button"><span class="copter-action-label"><%=labels.applyFilters%></span></a> <a href="#" class="copter-filters-more-less copter-filters-more copter-primary"><span class="copter-action-label copter-filters-more"><%=labels.moreFilters%></span></a> </div> <div class="copter-view-count copter-relative"> <div class="copter-view"></div> <div class="copter-checking"><%=labels.searching%></div> <div class="copter-count"> <!-- <%=labels.currentlyShowing%> <span class="copter-hotel-display-count">0</span> <%=labels.of%> <span class="copter-hotel-total-count">0</span> <%=labels.totalHotels%> --> </div> </div> <div class="copter-results-wrapper copter-popup-filters"> <div id="copter-hotelcards-<%=ts%>" class="copter-hotelcards"></div> </div>',"search-results-map":'<div class="copter-map" id="<%=id%>"></div>',"search-results-heading-dated":'<span class="copter-heading-hotels-in"><%=hotelsIn%></span>&nbsp; <span class="copter-heading-location"><%=location%></span> &nbsp;&#8211;&nbsp; <span class="copter-heading-check-in"><%=checkIn%></span> <%=labels.to%> <span class="copter-heading-check-out"><%=checkOut%></span> &nbsp;&nbsp; <span class="copter-heading-rooms"><%=rooms%>&nbsp;<%if(rooms == 1){%><%=labels.room%><%}else{%><%=labels.rooms%><%}%></span> &nbsp;&nbsp; <span class="copter-heading-guests"><%=guests%>&nbsp;<%if(guests == 1){%><%=labels.guest%><%}else{%><%=labels.guests%><%}%></span> <a href="#" class="copter-button"><%=labels.editSearch%></a>',"search-results-stacked-filters":'<div class="copter-heading"></div> <div class="copter-filters-results-wrapper"> <div class="copter-filters copter-filters-primary"></div> <div class="copter-filters copter-filters-secondary"></div> <div class="copter-filter-buttons"></div> <div class="copter-results-wrapper"> <div class="copter-sort"></div> <div class="copter-view"></div> <div class="copter-clear"></div> <div id="copter-hotelcards-<%=ts%>" class="copter-hotelcards"></div> <div class="copter-disclaimer"><%=labels.disclaimer%></div> </div> </div> <div class="copter-clear"></div>',"search-results-popup-filters":'<div class="copter-heading"></div> <div class="copter-filters-results-wrapper"> <div class="copter-filters copter-filters-primary"></div> <div class="copter-filters copter-filters-secondary"></div> <div class="copter-sort"></div> <div class="copter-clear"></div> <div class="copter-view"></div> <div class="copter-results-wrapper copter-popup-filters"> <div id="copter-hotelcards-<%=ts%>" class="copter-hotelcards"></div> <div class="copter-disclaimer"><%=labels.disclaimer%></div> </div> </div> <div class="copter-clear"></div>',"search-results-heading-search-form":'<div class="copter-heading-search-form"> <div class="copter-heading-hotels-in copter-searchform-hotels-in"><%=hotelsIn%></div> <div class="copter-searchform"></div> <div class="copter-clear"></div> </div>',"search-results-heading-dateless":'<span class="copter-heading-hotels-in"><%=hotelsIn%></span>&nbsp; <span class="copter-heading-location"><%=location%></span> <a href="#" class="copter-button"><%=labels.enterDates%></a>',"date-slider-main":'<div class="copter-control"></div> <div class="copter-calendar"></div>',"date-slider-day":'<div class="copter-date-slot copter-day-slot"> <div class="copter-date"><%=date%></div> <div class="copter-day-name"><%=dayName%></div> </div>',"date-slider-month":'<div class="copter-date-slot copter-month-slot"> <div class="copter-month-name"><%=monthName%></div> </div>',"hotel-card-map":'<div class="copter-content"> <div class="copter-pin copter-pin-<%=number%>"><%=number%></div> <div class="copter-img copter-img-el"><div class="copter-wrapper copter-img-el"><div class="copter-carousel copter-img-el"><div class="copter-clear"></div></div></div></div> <div class="copter-content-wrapper"> <div class="copter-name"><a href="<%=hotelNameUrl%>" class="copter-fulldetails copter-secondary copter-bold"><%=name%></a></div> <%if(hotel.stars){%> <div class="copter-stars copter-<%=hotel.stars%>star"></div> <%}%> </div> <div class="copter-clear"></div> <div class="copter-hotelrate"></div> <%if(flip){%><div class="copter-compare-rates copter-live-only"><a href="#" class="copter-compare-link copter-primary"><%=labels.compareRates%></a></div><%}%> </div>',"hotel-card-gallery-flip-side":'<div class="copter-content copter-flip-side"> <div class="copter-flip-name-wrapper"><span class="copter-flip-name"><%=hotel.name%></span></div> <div class="copter-flip-link"><a href="#" class="copter-primary"><%=labels.flipCard%></a></div> <div class="copter-ratrix"></div> </div>',"hotel-card-gallery":'<div class="copter-content copter-front-side"> <div class="copter-content-wrapper"> <%if(photoNavigation){%> <div class="copter-imgprevwrapper copter-img-el"><div class="copter-imgprev copter-img-el"></div></div> <div class="copter-imgnextwrapper copter-img-el"><div class="copter-imgnext copter-img-el"></div></div> <%}%> <div class="copter-img copter-img-el"><div class="copter-wrapper copter-img-el"><div class="copter-carousel copter-img-el"><div class="copter-clear"></div></div></div></div> <div class="copter-name-stars"> <div class="copter-name"><a href="<%=hotelNameUrl%>" class="copter-fulldetails copter-secondary"><%=name%></a></div> <%if(hotel.stars){%><div class="copter-stars copter-<%=hotel.stars%>star"><span class="copter-star-number"><%=hotel.stars%>-<%=labels.star%></span> <%=labels.property%></div><%}%> </div> </div> <div class="copter-hotelrate"></div> <%if(flip){%><div class="copter-compare-rates copter-live-only"><a href="#" class="copter-compare-link copter-primary"><%=labels.compareRates%></a></div><%}%> </div>',"hotel-card-ratrix-bubble":'<div class="copter-ratrix-bubble copter-flip-side"> <div class="copter-heading"> <div class="copter-left"><%=labels.compareRates%></div> <div class="copter-right"><a class="copter-cancel copter-primary" href="#"><%=labels.close%> <span class="copter-x">&#215;</span></a></div> <div class="copter-clear"></div> </div> <div class="copter-ratrix"></div> </div>',"hotel-card-check-rates-bubble":'<div class="copter-check-rates-bubble"> <div class="copter-heading"> <div class="copter-left"><%=labels.checkRatesAvail%></div> <div class="copter-right"><a class="copter-cancel copter-primary" href="#"><%=labels.close%> <span class="copter-x">&#215;</span></a></div> <div class="copter-clear"></div> </div> <div class="copter-searchform"></div> <div class="copter-cancel-close"><a href="#" class="copter-cancel copter-primary"><%=labels.cancelClose%></a></div> </div>',"hotel-card-summary":'<div class="copter-content"> <div class="copter-col1 copter-left"><div class="copter-img copter-img-el"><div class="copter-wrapper copter-img-el"><div class="copter-carousel copter-img-el"><div class="copter-clear"></div></div></div></div></div> <div class="copter-col2 copter-left"> <div class="copter-name"><a href="<%=hotelNameUrl%>" class="copter-fulldetails copter-secondary"><%=name%></a></div> <%if(hotel.stars){%><div class="copter-stars copter-<%=hotel.stars%>star"></div><%}%> <%if(distance && location){%> <div class="copter-distance"> <%=$h.convertToMiles(distance)%> <%=labels[$h.distanceUnit]%> <%=labels.from%> <a href="#" class="copter-map-link copter-primary"><%=location%></a> </div> <%}%> </div> <div class="copter-col3 copter-left"> <!--<a href="#" class="copter-all-rooms-rates copter-live-only copter-primary"><%=labels.viewAllRoomsRates%></a>--> </div> <div class="copter-col4 copter-left"> <div class="copter-compare-rates copter-live-only"><a href="#" class="copter-compare-link copter-primary"><%=labels.compareRates%></a></div> </div> <div class="copter-hotelrate"></div> <div class="copter-clear"></div> </div>',"bubble-main":'<div class="copter-bubble"> <div class="copter-arrow"></div> <div class="copter-contents"></div> </div>',"map-location-bubble":'<div class="copter-map-location-bubble"> <div class="copter-map-location-bubble-heading"><%=locationName%></div> <div class="copter-map-location-bubble-instructions"><%=labels.locationMarkerInstructions%></div> </div>',"map-hotel-bubble-hover":'<div class="copter-map-hotel-bubble copter-map-hotel-bubble-hover"> <div class="copter-img copter-left" style="background-image:url(<%=imageUrl%>)"></div> <div class="copter-info copter-left"> <div class="copter-name"><%=name%></div> <%if(stars){%><div class="copter-stars copter-<%=stars%>star"><%=starsLabel%></div><%}%> <div class="copter-hotel-rate"></div> </div> <div class="copter-clear"></div> <div class="copter-instructions"><%=labels.hotelMarkerInstructions%></div> </div>',"map-main":'<% if(updateResults) { %><div class="copter-map-update-results-wrapper"><input type="checkbox" id="copter-map-update-results-<%=ts%>" /><label for="copter-map-update-results-<%=ts%>"><%=labels.updateAsMapMoves%></label></div><% } %> <div id="copter-google-map-<%=ts%>" class="copter-google-map"></div>',"map-hotel-bubble-click":'<div class="copter-map-hotel-bubble copter-map-hotel-bubble-click"> <div class="copter-img" style="background-image:url(<%=imageUrl%>)"></div> <div class="copter-info"> <div class="copter-name"><a href="#" class="copter-name-link copter-secondary"><%=name%></a></div> <%if(stars){%><div class="copter-stars copter-<%=stars%>star"><%=starsLabel%></div><%}%> <div class="copter-hotel-rate"></div> </div> <div class="copter-clear"></div> </div>',"sort-option-custom":'<div class="copter-sort-option" data-option="<%=value%>"><%=option%></div>',"sort-main":'<select class="copter-sortcontrol"></select>',"sort-option":'<option class="copter-sort-option" value="<%=value%>"><%=option%></option>',"sort-main-custom":'<div class="copter-sortheading"> <span class="copter-sortheading-label"><%=heading%></span> <div class="copter-arrow-down"></div> </div> <div class="copter-sortsummary"></div> <div class="copter-sortcontrol"></div>',"hotel-details-map":'<div class="copter-map"></div>',"hotel-details-room-rate":'<div class="copter-room"> <div class="copter-room-description copter-left"><%=roomDescription%></div> <div class="copter-room-rate-breakdown copter-left"> <div class="copter-rate-link"> <span class="copter-currency"><%=$h.currencySymbol%></span><span class="copter-rate"><%=rateEx%></span> <span class="copter-label"> <span class="copter-taxes-label"><%=labels.plusTaxes%></span> <span class="copter-fees-label"><%=labels.andFees%></span></span> <span class="copter-clear"></span> </div> <div class="copter-total"> <span class="copter-currency"><%=$h.currencySymbol%></span><span class="copter-rate"><%=rateInc%></span> <span class="copter-label"><%=labels.estimatedTotal%></span> <span class="copter-clear"></span> </div> </div> <div class="copter-room-rate-book copter-left"> <a class="copter-book" href="<%=bookingUrl%>" target="<%=linkTarget%>"> <span class="copter-label"><%=labels.bookNow%></span> </a> </div> <div class="copter-clear"></div> </div>',"hotel-details-ratrix-bubble":'<div class="copter-ratrix-bubble copter-flip-side"> <div class="copter-heading"> <div class="copter-left"><%=labels.compareRates%></div> <div class="copter-right"><a class="copter-cancel copter-primary" href="#"><%=labels.close%> <span class="copter-x">&#215;</span></a></div> <div class="copter-clear"></div> </div> <div class="copter-ratrix"></div> </div>',"hotel-details-check-rates-bubble":'<div class="copter-check-rates-bubble"> <div class="copter-heading"> <div class="copter-left"><%=labels.checkRatesAvail%></div> <div class="copter-right"><a class="copter-cancel copter-primary" href="#"><%=labels.close%> <span class="copter-x">&#215;</span></a></div> <div class="copter-clear"></div> </div> <div class="copter-searchform"></div> <div class="copter-cancel-close"><a href="#" class="copter-cancel copter-primary"><%=labels.cancelClose%></a></div> </div>',"hotel-details-tabbed":'<ul class="copter-hoteldetails-contentlinks"> <%for(var i = 0; i < tabs.length; i++){%> <li><a href="#" data-tab-section="<%=tabs[i]%>" class="copter-primary"><%=labels[tabs[i] + \'Tab\']%></a></li> <%}%> <div class="copter-clear"></div> </ul> <ul class="copter-hoteldetails-utilitylinks"> <li><a href="#" class="copter-hoteldetails-email"><%= labels.email %></a></li> <li><a href="#" class="copter-hoteldetails-print"><%= labels.print %></a></li> <div class="copter-clear"></div> </ul> <div class="copter-clear"></div> <div class="copter-hoteldetails-header"> <h1><%=hotel.name%></h1> <% if(hotel.stars){ %> <div class="copter-stars copter-<%=hotel.stars%>star"><strong><%=hotel.stars%> <%=labels.star%></strong> <%=labels.property%></div> <% } %> <p class="copter-address"> <%=hotel.address.line1%>, <%if(hotel.address.city && hotel.address.city.length > 0){%><%=hotel.address.city%>,<%}%> <%if(hotel.address.region && hotel.address.region.length > 0){%><%=hotel.address.region%>,<%}%> <%=hotel.address.countryName%> </p> <%if(tripAdvisor){%> <div class="copter-tripadvisor"> <p>97% <a href="#" class="copter-primary">122 reviews</a></p> </div> <%}%> </div> <div class="copter-hoteldetails-header-rate"> <div class="copter-hotelrate"></div> <div class="copter-rate-compare"> <div class="copter-compare"><a href="#" class="copter-primary"><%=labels.compareRates%></a></div> </div> </div> <div class="copter-hoteldetails-header-logos"> <%if(hotelLogo){%> <div class="copter-sales-logo copter-left"></div> <div class="copter-direct-logo copter-right" style="background-image:url(<%=hotelLogo%>)"></div> <div class="copter-clear"></div> <%}%> </div> <div class="copter-clear"></div> <div class="copter-hoteldetails-contentcontainer"> <div class="copter-hoteldetails-overview"></div> <div class="copter-hoteldetails-description"></div> <div class="copter-hoteldetails-photos"></div> <div class="copter-hoteldetails-map"></div> <div class="copter-hoteldetails-reviews"></div> <div class="copter-hoteldetails-rates"></div> </div>',"hotel-details-overview":'<% if(hotel.photos.length < 5) { %> <div class="copter-imagemap-column"> <% var img = hotel.photos[0].sizes[3]; %> <img src="<%=img.url %>" width="<%=img.width %>" height="<%=img.height %>"> <% if(hotel.lat && hotel.lng) {%> <div class="copter-hoteldetails-map-wrapper"> <img class="copter-hoteldetails-map-img" src="//maps.google.com/maps/api/staticmap?size=198x238&markers=icon:<%=mapPinUrl%>|<%=hotel.lat%>,<%=hotel.lng%>&sensor=false&zoom=14" /> <%if(hotel.distance && location){%> <div class="copter-distance"> <%=$h.convertToMiles(hotel.distance)%> <%=labels[$h.distanceUnit]%> <%=labels.from%> <a href="#" class="copter-hoteldetails-map-link copter-primary"><%=location%></a> </div> <%}%> </div> <%}%> </div> <div class="copter-hoteldetails-details copter-minimal-layout"> <% if(hotel.description) { %> <div class="copter-hoteldetails-desc"> <h2><%= labels.descriptionHeader %></h2> <p><%= hotel.description %></p> </div> <% } %> <div class="copter-hoteldetails-amenities"> <h2>Amenities</h2> <ul> <% $h.$.each(amenities, function(type, amens) { %> <% for(i=0;i<amens.length;i++) { %> <li><%= amens[i] %></li> <% } %> <% }); %> <div class="copter-clear"></div> </ul> </div> </div> <div class="copter-clear"></div> <% } else { %> <div class="copter-hoteldetails-images"> <div class="copter-hoteldetails-imagecontainer" style="width:<%= (hotel.photos.length * 201) %>px"> <% for(var i=0; i < hotel.photos.length; i++) { var img = hotel.photoWithSpecifiedDimensions(hotel.photos[i], 200, 150);%> <div class="copter-hoteldetails-carousel-image"><img src="<%=img.url %>" width="<%=img.width %>" height="<%=img.height %>"></div> <% } %> </div> <div class="copter-imgprevwrapper"> <div class="copter-imgprev"></div> </div> <div class="copter-imgnextwrapper"> <div class="copter-imgnext"></div> </div> </div> <div class="copter-hoteldetails-details"> <div class="copter-hoteldetails-desc"> <% if(hotel.shortDescription) { %> <h2><%= labels.descriptionHeader %></h2> <div class="copter-hoteldetails-compact-desc"><%=$h.$.truncate(hotel.description, 150)%></div> <div class="copter-hoteldetails-expanded-desc"><%=hotel.description%></div> <a href="#" target="_blank" class="copter-desc-link copter-primary"><%=labels.readMore%></a> <% } %> <div class="copter-hoteldetails-roomdescription"> <h2>Room Description</h2> <p class="copter-room-desc"><%=roomDescription%></p> <a href="#" target="_blank" class="copter-book-link copter-primary"><%=labels.learnMoreAt%></a> </div> </div> <div class="copter-hoteldetails-amenities"> <h2><%=labels.amenities%></h2> <ul> <% $h.$.each(amenities, function(type, amens) { %> <% for(i=0;i<amens.length;i++) { %> <li><%= amens[i] %></li> <% } %> <% }); %> <div class="copter-clear"></div> </ul> </div> </div> <%if(hotel.lat && hotel.lng) {%> <div class="copter-hoteldetails-map-wrapper copter-right"> <img class="copter-hoteldetails-map-img" src="//maps.google.com/maps/api/staticmap?size=310x190&markers=icon:<%=mapPinUrl%>|<%=hotel.lat%>,<%=hotel.lng%>&sensor=false&zoom=14" /> <%if(hotel.distance && location){%> <div class="copter-distance"> <%=$h.convertToMiles(hotel.distance)%> <%=labels[$h.distanceUnit]%> <%=labels.from%> <a href="#" class="copter-hoteldetails-map-link copter-primary"><%=location%></a> </div> <%}%> </div> <%}%> <div class="copter-clear"></div> <% } %>',"hotel-details-amenities":'<% $h.$.each(amenities, function(type, amens) { %> <h3><%= type %></h3> <ul> <% for(i=0;i<amens.length;i++) { %> <li><%= amens[i] %></li> <% } %> <div class="copter-clear"></div> </ul> <% }); %>',"hotel-details-linear":'<% if(hotel.bookDirectAdvertiser()){%> <div class="copter-hoteldetails-logo"> <img alt="<%=hotelLogoAlt%>" src="<%=hotelLogo%>"> </div> <% } %> <h1><%=hotel.name%></h1> <div class="copter-hoteldetails-location"> <%=hotel.address.line1%>,&nbsp;<%=hotel.address.city%>,&nbsp;<%=hotel.address.region%> </div> <% if(hotel.stars){ %> <div class="copter-hoteldetails-stars"> <div class="copter-stars copter-<%=hotel.stars%>star"></div> </div> <% } %> <% if(hotel.telephone){ %> <div class="copter-hoteldetails-tel copter-left"> <%=hotel.telephone%> </div> <% } %> <% if(hotel.url){ %> <div class="copter-hoteldetails-website copter-left <% if(hotel.telephone){ %>copter-separator<% } %>"> <a href="<%=hotel.url%>" class="copter-primary" target="_blank"><%=labels.visitWebsite%></a> </div> <% } %> <div class="copter-clear"></div> <div class="copter-hoteldetails-images"> <% var imageHTML=\'\'; %> <% if(hotel.photos.length > 0) { %> <% if(hotel.photos.length >= 3) { %> <!-- AT LEAST 3 PHOTOS --> <% var bigImage = $h.Hotel.getImageSizeWithDimensions(hotel.photos[0], 480, 320); %> <% if(bigImage) { %> <!-- BIG SIZE FOR PRIMARY PHOTO --> <div class="copter-hi-res"> <% for(i = 0; i < 3; i++){ %> <% var imgDimensions = (i == 0) ? {width:480,height:320} : {width:168,height:126}; %> <% var caption = (hotel.photos[i].caption || hotel.name); %> <% var img = $h.Hotel.getImageSizeWithDimensions(hotel.photos[i], imgDimensions.width, imgDimensions.height); %> <% imageHTML += \'<div class="copter-img copter-img\' + i + \'"><img src="\' + img.url + \'" alt="\' + caption + \'" /></div>\'; %> <% } %> <%= imageHTML %> <div class="copter-clear"></div> <div class="copter-view-photos"> <a href="#" class="copter-photos copter-primary"><%= labels.viewAll %>&nbsp;(<%= hotel.photoCount %>)</a> </div> </div> <% } else { %> <!-- SMALL SIZE FOR PRIMARY PHOTO --> <div class="copter-lo-res"> <% for(i = 0; i < 3; i++){ %> <% var caption = (hotel.photos[i].caption || hotel.name); %> <% var img = $h.Hotel.getImageSizeWithDimensions(hotel.photos[i], 168, 126); %> <% imageHTML += \'<div class="copter-img copter-img\' + i + \'"><img src="\' + img.url + \'" alt="\' + caption + \'" /></div>\'; %> <% } %> <%= imageHTML %> <div class="copter-clear"></div> <div class="copter-view-photos"> <a href="#" class="copter-photos copter-primary"><%= labels.viewAll %>&nbsp;(<%= hotel.photoCount %>)</a> </div> </div> <% } %> <% } else { %> <!-- 1 or 2 images --> <% imageHTML += \'<div class="copter-lo-res">\'; %> <% for(i = 0; i < hotel.photos.length; i++){ %> <% var caption = (hotel.photos[i].caption || hotel.name); %> <% var img = $h.Hotel.getImageSizeWithDimensions(hotel.photos[i], 168, 126); %> <% imageHTML += \'<div class="copter-img copter-img\' + i + \'"><img src="\' + img.url + \'" alt="\' + caption + \'" /></div>\'; %> <% } %> <% imageHTML += \'</div>\'; %> <% imageHTML += \'<div class="copter-clear"></div><div class="view">\'; %> <% imageHTML += \'<a href="#" class="copter-photos copter-primary">\' + labels.viewAll + \'&nbsp;(\'+hotel.photoCount + \')</a>\'; %> <%= imageHTML %> <% } %> <% } %> </div> <div class="copter-hoteldetails-booking-options"></div> <div class="copter-hoteldetails-desc"> <% if (mapUrl && mapUrl != \'\') { %> <img class="copter-hoteldetails-map" src="<%= mapUrl %>" /> <% } %> <h2><%= labels.descriptionHeader %></h2> <%= hotel.description %> </div> <div class="copter-hoteldetails-amenities"></div>',"hotel-details-photos":'<div class="copter-photocarousel"></div>',"hotel-details-booking-options":'<h2><%= labels.bookingOptions %></h2> <div class="booking-options-inner"> <% if($h.isDatedSearch()) { %> <div class="copter-ratrix" data-udicode="<%= hotel.udicode %>"></div> <% } else { %> <div class="copter-hoteldetails-check-rates"> <div class="copter-dateless"> <div class="copter-label copter-primary"><%= labels.checkRates %></div> <div class="copter-rate"> <div class="copter-ratelabel"><%= labels.from %></div> <div class="copter-rateamount"><%= $h.formatCurrency(hotel.historicalRates.lowest) %></div> </div> </div> </div> <% } %> </div> <div class="copter-hoteldetails-disclaimer"> <%= labels.disclaimer %> </div>',"hotel-details-rates":'<div class="copter-room-rates"></div>',"hotel-details-reviews":'<div class="copter-reviews-left"> <h2>TripAdvisor Popularity Index</h2> <p class="copter-popularityindex"><strong># <span class="">2</span> of 187</strong> hotels in Dallas</p> </div> <div class="copter-reviews-right"> <h2>What TripAdvisor reviewers say:</h2> <% for(var i=0; i < 3; i++){ %> <div class="copter-review"> <blockquote>&ldquo;The perfect place to stay&rdquo;</blockquote> <p class="copter-rating">97%</p><p class="copter-reviewdate">Oct 17th, 2011</p> <div class="copter-clear"></div> <p>Perfect place to Donec in massa quis enim consectetur pellentesque eu sit amet erat. Vivamus et mauris erat, vel consequat purus.</p> <a href="#" title="More on TripAdvisor" class="copter-primary">More on TripAdvisor</a> </div> <% } %> </div> <div class="copter-clear"></div>',"view-links":'<div class="copter-viewheading"><%=heading%>:</div> <div class="copter-viewcontrol"></div> <div class="copter-clear"></div>',"view-dropdown":'<div class="copter-viewheading"> <span class="copter-viewheading-label"><%=heading%></span> <div class="copter-arrow-down"></div> </div> <div class="copter-viewsummary"></div> <div class="copter-viewcontrol"></div>',"view-option":'<div class="copter-view-option"><%=option%></div>',"photo-carousel-main":'<div class="copter-photocarousel-content"> <h1><%= hotel.name %></h1> <div class="copter-photocarousel-image copter-medium-spinner"></div> <div class="copter-photocarousel-thumbnails"> <div class="copter-photocarousel-thumbnails-container"> <div class="copter-clear"></div> </div> </div> </div>',"ratrix-room-types":'<% $h.$.each(ratesByRoomType, function(roomType,rates) { %> <div class="copter-ratrix-room-type"> <div class="heading"> <div class="copter-left"> <%= $h.$.capitalize(roomType) %>&nbsp;-&nbsp;<%= labels.from %>&nbsp;<%= $h.formatCurrency(rates[0].avNightlyRateInc) %> </div> <div class="copter-ratrix-room-type-toggle copter-right"> <a class="copter-hide copter-primary" href="#"><%=labels.hide%> -</a> <a class="copter-show copter-primary" href="#" style="display:none;"><%=labels.hide%> +</a> </div> <div class="label-inc copter-right"> <%= labels.rateInclusive %> </div> <div class="label-exc copter-right"> <%= labels.rateExclusive %> </div> <div class="copter-clear"></div> </div> <div class="rates"> <div class="rows"> <% for(i=0;i<rates.length;i++) { %> <% var classes = "room-rate"; %> <% var styles = ((i > 2) ? "display:none;" : ""); %> <% if(rates[i].isBookDirect) { classes += " room-type-bookdirect"; } %> <div id="<%= \'room-rate-\' + roomType + \'-\' + i.toString() %>" class="<%= classes %>" style="<%= styles %>" data-adv-code="<%= rates[i].advertiserCode %>" data-rate-exc="<%=rates[i].avNightlyRateEx%>" data-rate-inc="<%=rates[i].avNightlyRateInc%>" data-is-book-direct="<%=rates[i].isBookDirect%>" data-position="<%=i%>"> <div class="copter-logo copter-left"> <img src="<%= rates[i].logoUrl %>"> </div> <div class="copter-room-desc copter-left"> <%= rates[i].roomDescription %> </div> <div class="copter-btn copter-right"> <a class="copter-ratrix-book-button copter-button" href="<%= rates[i].bookingUrl %>" target="_blank">Book Now</a> </div> <div class="copter-rate-inc copter-right"> <%= $h.formatCurrency(rates[i].avNightlyRateInc) %> </div> <div class="copter-rate-exc copter-right"> <%= $h.formatCurrency(rates[i].avNightlyRateEx) %> </div> <div class="copter-clear"></div> </div> <% } %> </div> <% if(rates.length > 3) { %> <div class="all-room-rates"> <a class="copter-primary all" href="#"><%= labels.viewAll %>&nbsp;<%= $h.$.capitalize(roomType)%>&nbsp;<%= labels.rates %>&nbsp;(<%= rates.length %>)&nbsp;+</a> <a class="copter-primary best" href="#" style="display:none;"><%= labels.viewBest %>&nbsp;<%= $h.$.capitalize(roomType)%>&nbsp;<%= labels.rates %>&nbsp;<%= labels.only %>&nbsp;-</a> </div> <% } %> </div> </div> <% }); %>',"ratrix-dropdown":'<div class="copter-ratrix-dropdown-wrapper"> <select id="copter-ratrix-dropdown-<%=ts%>" class="copter-ratrix-dropdown"></select> </div>',"ratrix-main":'<%if(includeDates){%> <div class="copter-ratrix-dates"> <span class="copter-check-in"><%=checkIn%></span> &mdash; <span class="copter-check-out"><%=checkOut%></span>&nbsp;&nbsp;&nbsp; <span class="copter-rooms"><%=rooms%>&nbsp;<%=roomslabel%></span>&nbsp;&nbsp; <span class="copter-guests"><%=guests%>&nbsp;<%=guestslabel%></span> </div> <%}%> <div class="copter-ratrix-table-wrapper"></div>',"ratrix-rates":'<% if(roomRates) { %> <div class="copter-ratrix-view-choice"> <div class="copter-ratrix-show-rates"> Show Rates </div> <div class="copter-ratrix-show-room-types"> <a class="copter-primary" href="#">Show Room Types</a> </div> </div> <% } %> <div class="copter-ratrix-rates-container"> <%if(tableLayout){%> <div class="copter-ratrix-header"> <div class="copter-partnerlogo copter-ratrix-cell">&nbsp;</div> <div class="copter-roomtype copter-ratrix-cell"><%=labels.roomType%></div> <div class="copter-rateexc copter-ratrix-cell"><%=labels.rateExclusive%></div> <div class="copter-rateinc copter-ratrix-cell"><%=labels.rateInclusive%></div> <div class="copter-ratrix-button copter-ratrix-cell">&nbsp;</div> <div class="copter-clear"></div> </div> <%}%> <div id="copter-ratrix-table-rows-<%=ts%>" class="copter-ratrix-table-rows"></div> <div id="copter-ratrix-table-rows-new-<%=ts%>" class="copter-ratrix-table-rows-new"></div> </div> <div class="copter-ratrix-room-types-container" style="display:none;"></div>',"ratrix-row":'<div class="<%=cssClass%> <% if(tableLayout){ %>copter-ratrix-tablerow<%}else{%>copter-ratrix-row<%}%>" data-id="<%=advCode%>" data-adv-code="<%=advCode%>" data-rate-exc="<%=avgNightlyRateEx%>" data-rate-inc="<%=avgNightlyRateInc%>" data-is-book-direct="<%=isBookDirect%>" data-position="<%=position%>"> <% if(tableLayout){ %> <div class="copter-partnerlogo copter-ratrix-cell"> <img class="copter-ratrix-partner-logo" alt="<%=advName%>" src="<%=logoUrl%>" /> </div> <div class="copter-roomtype copter-ratrix-cell"><div class="copter-ratrix-cell-inner"><%=roomDescription%></div></div> <div class="copter-rateexc copter-ratrix-cell"><div class="copter-ratrix-cell-inner"><%=avgNightlyRateExFmt%></div></div> <div class="copter-rateinc copter-ratrix-cell"><div class="copter-ratrix-cell-inner"><%=avgNightlyRateIncFmt%></div></div> <div class="copter-ratrix-button copter-ratrix-cell"> <a class="copter-book <%=bookButtonClass%>" href="<%=bookingUrl%>" target="_blank"><%=labels.bookNow%></a> <% if(isBookDirect){ %> <div class="copter-ratrix-official-site"><%=labels.officialSite%></div> <% } %> </div> <div class="copter-clear"></div> <%}else{%> <%if(position > 0){%><a class="copter-remove-link" href="#">&#215;</a><%}%> <div class="copter-row-wrapper"> <div class="copter-rate-breakdown"> <a class="copter-rate-link" href="<%=bookingUrl%>" target="_blank"> <span class="copter-currency"><%=$h.currencySymbol%></span><span class="copter-rate"><%=avgNightlyRateEx%></span> <span class="copter-label"> <span class="copter-taxes-label"><%=labels.plusTaxes%></span> <span class="copter-fees-label"><%=labels.andFees%></span></span> <span class="copter-clear"></span> </a> <div class="copter-total"> <span class="copter-currency"><%=$h.currencySymbol%></span><span class="copter-rate"><%=avgNightlyRateInc%></span> <span class="copter-label"><%=labels.estimatedTotal%></span> <span class="copter-clear"></span> </div> </div> <a class="copter-book" href="<%=bookingUrl%>" target="_blank"> <span class="copter-logo" style="background-image:url(<%=logoUrl%>)"><%=labels.bookNow%></span> </a> <div class="copter-clear"></div> </div> <%}%> </div>',"ratrix-dropdown-option":'<option value="<%=advertiserCode%>" class="<%=cssClass%>"><%=advertiser%></option>',"ratrix-spinner":'<div class="copter-ratrix-searching"> <div class="copter-spinner"></div> <div class="copter-ratrix-search-status"> <%=labels.searching%><span class="copter-ratrix-best-so-far"></span> </div> </div>',"filters-rate":'<div class="copter-filtersparkline"></div> <div class="copter-filtersparkline-unselected"></div> <div class="copter-sliderlabel copter-sliderlabel-left"></div> <div class="copter-sliderlabel copter-sliderlabel-right"></div> <div class="copter-control"></div> <div class="copter-buttons"> <a href="#" class="copter-apply copter-button"><%=labels.apply%></a> <a href="#" class="copter-cancel copter-primary"><%=labels.cancel%></a> </div>',"filters-checkbox":'<li <%=classattr%>> <input type="checkbox" id="<%=id%>" value="<%=value%>" <%=checked%> /> <label for="<%=id%>" class="copter-label-name"><%=label%></label> <label for="<%=id%>" class="copter-label-rate"><%=rate%></label> </li>',"filters-stars":'<div class="copter-filtersparkline"></div> <div class="copter-filtersparkline-unselected"></div> <div class="copter-control"></div> <div class="copter-nums"> <div class="copter-num">1</div> <div class="copter-num">2</div> <div class="copter-num">3</div> <div class="copter-num">4</div> <div class="copter-num">5</div> <div class="copter-clear"></div> </div> <div class="copter-buttons"> <a href="#" class="copter-apply copter-button"><%=labels.apply%></a> <a href="#" class="copter-cancel copter-primary"><%=labels.cancel%></a> </div>',"filters-name":'<div class="copter-hotel-name"> <input type="text" id="copter-hotel-name-<%=ts%>" name="copter-hotel-name-<%=ts%>" value="<%=name%>" placeholder="<%=labels.enterName%>" /> </div> <div class="copter-buttons"> <a href="#" class="copter-apply copter-button"><%=labels.apply%></a> <a href="#" class="copter-cancel copter-primary"><%=labels.cancel%></a> </div> <div class="copter-clear"></div>',"filters-brand":'<div class="copter-brand-group-toggle"> <input type="radio" id="copter-brand-radio-<%=ts%>" name="copter-brand-group-radio-<%=ts%>" value="brand" checked="checked" /> <label for="copter-brand-radio-<%=ts%>"><%=labels.brands%></label> <input type="radio" id="copter-group-radio-<%=ts%>" name="copter-brand-group-radio-<%=ts%>" value="group" /> <label for="copter-group-radio-<%=ts%>"><%=labels.groups%></label> </div> <div class="copter-checkbox-brand"> <div class="copter-checkbox-any"> <input type="checkbox" id="copter-brand-any-<%=ts%>" value="any" checked="checked" /> <label for="copter-brand-any-<%=ts%>" class="copter-label-name"><%=labels.anyBrand%></label> </div> <div class="copter-checkbox-columns"> <%for(var i = 0; i < columns; i++){%> <ul class="copter-checkbox-options copter-column-<%=(i + 1)%>"></ul> <%}%> <div class="copter-clear"></div> </div> <a href="#" class="copter-more-less copter-more-brands copter-primary"><%=labels.moreBrands%></a> </div> <div class="copter-checkbox-group"> <div class="copter-checkbox-any"> <input type="checkbox" id="copter-group-any-<%=ts%>" value="any" checked="checked" /> <label for="copter-group-any-<%=ts%>" class="copter-label-name"><%=labels.anyGroup%></label> </div> <div class="copter-checkbox-columns"> <%for(var i = 0; i < columns; i++){%> <ul class="copter-checkbox-options copter-column-<%=(i + 1)%>"></ul> <%}%> <div class="copter-clear"></div> </div> <a href="#" class="copter-more-less copter-more-groups copter-primary"><%=labels.moreGroups%></a> </div> <div class="copter-buttons"> <a href="#" class="copter-apply copter-button"><%=labels.apply%></a> <a href="#" class="copter-cancel copter-primary"><%=labels.cancel%></a> </div>',"filters-arrow":'<div class="copter-arrow-down"></div>',"filters-main":'<div class="copter-filter-wrapper copter-filter-wrapper-<%=filter%>"> <div class="copter-filter copter-filter-<%=filter%>"> <div class="copter-filterheading"><span class="copter-filterheading-label"><%=heading%></span></div> <div class="copter-filtersummary"></div> </div> <div class="copter-filtercontrol copter-filtercontrol-<%=filter%>"></div> </div>',"filters-checkbox-list":'<div class="copter-checkbox-any"> <input type="checkbox" id="copter-<%=filter%>-any-<%=ts%>" value="any" checked="checked" /> <label for="copter-<%=filter%>-any-<%=ts%>" class="copter-label-name"><%=labels.any%></label> </div> <div class="copter-checkbox-columns"> <%for(var i = 0; i < columns; i++){%> <ul class="copter-checkbox-options copter-column-<%=(i + 1)%>"></ul> <%}%> <div class="copter-clear"></div> </div> <div class="copter-buttons"> <a href="#" class="copter-apply copter-button"><%=labels.apply%></a> <a href="#" class="copter-cancel copter-primary"><%=labels.cancel%></a> </div>',"filters-user":'<div class="copter-filtersparkline"></div> <div class="copter-filtersparkline-unselected"></div> <div class="copter-control"></div> <div class="copter-nums"> <div class="copter-num">1</div> <div class="copter-num">2</div> <div class="copter-num">3</div> <div class="copter-num">4</div> <div class="copter-num">5</div> <div class="copter-clear"></div> </div> <div class="copter-buttons"> <a href="#" class="copter-apply copter-button"><%=labels.apply%></a> <a href="#" class="copter-cancel copter-primary"><%=labels.cancel%></a> </div>'};

