/* generated Tue Feb 14 13:06:41 EST 2012 */

Profiler={isEnabled:function(){return true},init:function(){this._startTime=new Date();this.searchVertical=null;this.eventTimes={};this.eventApplySubtypes={};this.searchTypes={};return this},clearAll:function(){this.clearAllPoints();this.clearAllMetrics();return this.init()},markPoint:function(a){var b=this.getCurrentPoints();if(b==null){b={}}b[a]=new Date().getTime();this.saveCurrentPoints(b)},getPoint:function(a){var b=this.getCurrentPoints();if(b){return b[a]}return null},clearPoint:function(a){var b=this.getCurrentPoints();if(b){delete b[a];this.saveCurrentPoints(b)}},clearAllPoints:function(){this.saveCurrentPoints(null)},setMetric:function(b,a,d){var c=this.getCurrentMetrics();if(c==null){c={}}c[b+"__"+a]=d;this.saveCurrentMetrics(c)},clearMetric:function(b,a){var c=this.getCurrentMetrics();if(c){delete c[b+"__"+a];this.saveCurrentMetrics(c)}},getAllMetrics:function(){var a=this.getCurrentMetrics();return a},clearAllMetrics:function(){this.saveCurrentMetrics(null)},pushCurrentMetrics:function(c){var b=this.getCurrentMetrics();if(b!=null){this.clearAll();var a="/s/performanceMonitor";if(c){a+="/"+c}jq.post(a,b)}},markSearchStart:function(){this.clearAll();this.markPoint("s0000")},setSearchVertical:function(a){if(a=="flight"){this.searchVertical="fs"}else{if(a=="hotel"){this.searchVertical="hs"}else{if(a=="car"){this.searchVertical="cs"}else{this.searchVertical=null}}}},markSharedSearch:function(){this.searchTypes.s=true},markCachedSearch:function(){this.searchTypes.c=true},markFastSearch:function(){this.searchTypes.fast=true},markNormalSearch:function(){this.searchTypes.n=true},addEvent:function(a,c,b){if(c===undefined){c=new Date().getTime()}this.eventTimes[a]=c;if(b===undefined){this.eventApplySubtypes[a]=true}else{this.eventApplySubtypes[a]=b}},computeSearchMetrics:function(){var a=this.getPoint("s0000");if(!a||!this.searchVertical){return false}this.addEvent("ph",this._startTime);if(R9ResultsRendered){this.addEvent("rrr",R9ResultsRendered.getTime(),true)}if(R9InlineResultsRendered){this.addEvent("rr",R9InlineResultsRendered.getTime(),true)}else{if(R9ResultsRendered){this.addEvent("rr",R9ResultsRendered.getTime(),true)}}R9ResultsRendered=R9InlineResultsRendered=null;for(eventName in this.eventTimes){metricName=this.searchVertical+"_"+eventName;metricValue=this.eventTimes[eventName]-a;if(metricValue<0){if(window.R9Admin){alert(metricName+" was really fast: "+metricValue+" millis.")}return false}this.setMetric(metricName,"ms",metricValue);if(this.eventApplySubtypes[eventName]){if(jq.isEmptyObject(this.searchTypes)){this.markNormalSearch()}for(searchType in this.searchTypes){this.setMetric(searchType+"_"+metricName,"ms",metricValue)}}}if(__st){var b=new Date().getTime()-this._startTime.getTime();this.setMetric("rtp","ms",__st+b);this.setMetric(this.searchVertical+"_rtp","ms",__st+b)}return true},constants:{pointsCookieName:"profilerPoints",metricsCookieName:"profilerMetrics"},saveCurrentMetrics:function(a){this.saveCurrentValues(a,this.constants.metricsCookieName)},saveCurrentPoints:function(a){this.saveCurrentValues(a,this.constants.pointsCookieName)},getCurrentMetrics:function(){return this.getCurrentValues(this.constants.metricsCookieName)},getCurrentPoints:function(){return this.getCurrentValues(this.constants.pointsCookieName)},getCurrentValues:function(cookieName){var json=jq.cookie(cookieName);if(json!=null){var currentValues=eval(json);return currentValues}return null},saveCurrentValues:function(a,e){var d=null;if(a){d="({";var c=true;for(name in a){if(!c){d+=", "}var b=a[name];if(typeof(b)=="string"){d+='"'+name+'": "'+b+'"'}else{d+='"'+name+'": '+b}c=false}d+="})"}jq.cookie(e,d,{path:"/"})}}.init();function profilerSubmit(a){if(!Profiler.isEnabled()||!Streaming.done){return}if(a){window.setTimeout("profilerSubmit()",a);return}if(Profiler.computeSearchMetrics()){if(window.Streaming){Profiler.setMetric("spc","count",Streaming.pollCount)}if(window.Streaming){Streaming.dbg("PS SSST")}setSitesSearchedText();Profiler.pushCurrentMetrics(searchid);if(window.Streaming){Streaming.dbg("PS POST")}}else{if(window.Streaming){Streaming.dbg("PS NTD")}}}function setSitesSearchedText(){var c="";var a=Profiler.getAllMetrics();if(a){c+="<b>Profiler Metrics:</b><br/>";for(var d in a){c+=d+"="+a[d]+"<br/>"}}function b(){var e=jq("#kayak_pm_0001");if(e.length){e[0].innerHTML=c}return e.length}b()||jq("#fs_outer_sitessearched").one("lazyLoad",b);return true}
/*!
 * jQuery JavaScript Library v1.6.4
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Mon Sep 12 18:54:48 2011 -0400
 */
(function(ba,N){var at=ba.document,bt=ba.navigator,bk=ba.location;var b=(function(){var bE=function(b0,b1){return new bE.fn.init(b0,b1,bC)},bU=ba.jQuery,bG=ba.$,bC,bY=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,bM=/\S/,bI=/^\s+/,bD=/\s+$/,bH=/\d/,bz=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,bN=/^[\],:{}\s]*$/,bW=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,bP=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,bJ=/(?:^|:|,)(?:\s*\[)+/g,bx=/(webkit)[ \/]([\w.]+)/,bR=/(opera)(?:.*version)?[ \/]([\w.]+)/,bQ=/(msie) ([\w.]+)/,bS=/(mozilla)(?:.*? rv:([\w.]+))?/,bA=/-([a-z]|[0-9])/ig,bZ=/^-ms-/,bT=function(b0,b1){return(b1+"").toUpperCase()},bX=bt.userAgent,bV,bB,e,bL=Object.prototype.toString,bF=Object.prototype.hasOwnProperty,by=Array.prototype.push,bK=Array.prototype.slice,bO=String.prototype.trim,bu=Array.prototype.indexOf,bw={};bE.fn=bE.prototype={constructor:bE,init:function(b0,b4,b3){var b2,b5,b1,b6;if(!b0){return this}if(b0.nodeType){this.context=this[0]=b0;this.length=1;return this}if(b0==="body"&&!b4&&at.body){this.context=at;this[0]=at.body;this.selector=b0;this.length=1;return this}if(typeof b0==="string"){if(b0.charAt(0)==="<"&&b0.charAt(b0.length-1)===">"&&b0.length>=3){b2=[null,b0,null]}else{b2=bY.exec(b0)}if(b2&&(b2[1]||!b4)){if(b2[1]){b4=b4 instanceof bE?b4[0]:b4;b6=(b4?b4.ownerDocument||b4:at);b1=bz.exec(b0);if(b1){if(bE.isPlainObject(b4)){b0=[at.createElement(b1[1])];bE.fn.attr.call(b0,b4,true)}else{b0=[b6.createElement(b1[1])]}}else{b1=bE.buildFragment([b2[1]],[b6]);b0=(b1.cacheable?bE.clone(b1.fragment):b1.fragment).childNodes}return bE.merge(this,b0)}else{b5=at.getElementById(b2[2]);if(b5&&b5.parentNode){if(b5.id!==b2[2]){return b3.find(b0)}this.length=1;this[0]=b5}this.context=at;this.selector=b0;return this}}else{if(!b4||b4.jquery){return(b4||b3).find(b0)}else{return this.constructor(b4).find(b0)}}}else{if(bE.isFunction(b0)){return b3.ready(b0)}}if(b0.selector!==N){this.selector=b0.selector;this.context=b0.context}return bE.makeArray(b0,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return bK.call(this,0)},get:function(b0){return b0==null?this.toArray():(b0<0?this[this.length+b0]:this[b0])},pushStack:function(b1,b3,b0){var b2=this.constructor();if(bE.isArray(b1)){by.apply(b2,b1)}else{bE.merge(b2,b1)}b2.prevObject=this;b2.context=this.context;if(b3==="find"){b2.selector=this.selector+(this.selector?" ":"")+b0}else{if(b3){b2.selector=this.selector+"."+b3+"("+b0+")"}}return b2},each:function(b1,b0){return bE.each(this,b1,b0)},ready:function(b0){bE.bindReady();bB.done(b0);return this},eq:function(b0){return b0===-1?this.slice(b0):this.slice(b0,+b0+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(bK.apply(this,arguments),"slice",bK.call(arguments).join(","))},map:function(b0){return this.pushStack(bE.map(this,function(b2,b1){return b0.call(b2,b1,b2)}))},end:function(){return this.prevObject||this.constructor(null)},push:by,sort:[].sort,splice:[].splice};bE.fn.init.prototype=bE.fn;bE.extend=bE.fn.extend=function(){var b9,b2,b0,b1,b6,b7,b5=arguments[0]||{},b4=1,b3=arguments.length,b8=false;if(typeof b5==="boolean"){b8=b5;b5=arguments[1]||{};b4=2}if(typeof b5!=="object"&&!bE.isFunction(b5)){b5={}}if(b3===b4){b5=this;--b4}for(;b4<b3;b4++){if((b9=arguments[b4])!=null){for(b2 in b9){b0=b5[b2];b1=b9[b2];if(b5===b1){continue}if(b8&&b1&&(bE.isPlainObject(b1)||(b6=bE.isArray(b1)))){if(b6){b6=false;b7=b0&&bE.isArray(b0)?b0:[]}else{b7=b0&&bE.isPlainObject(b0)?b0:{}}b5[b2]=bE.extend(b8,b7,b1)}else{if(b1!==N){b5[b2]=b1}}}}}return b5};bE.extend({noConflict:function(b0){if(ba.$===bE){ba.$=bG}if(b0&&ba.jQuery===bE){ba.jQuery=bU}return bE},isReady:false,readyWait:1,holdReady:function(b0){if(b0){bE.readyWait++}else{bE.ready(true)}},ready:function(b0){if((b0===true&&!--bE.readyWait)||(b0!==true&&!bE.isReady)){if(!at.body){return setTimeout(bE.ready,1)}bE.isReady=true;if(b0!==true&&--bE.readyWait>0){return}bB.resolveWith(at,[bE]);if(bE.fn.trigger){bE(at).trigger("ready").unbind("ready")}}},bindReady:function(){if(bB){return}bB=bE._Deferred();if(at.readyState==="complete"){return setTimeout(bE.ready,1)}if(at.addEventListener){at.addEventListener("DOMContentLoaded",e,false);ba.addEventListener("load",bE.ready,false)}else{if(at.attachEvent){at.attachEvent("onreadystatechange",e);ba.attachEvent("onload",bE.ready);var b0=false;try{b0=ba.frameElement==null}catch(b1){}if(at.documentElement.doScroll&&b0){bv()}}}},isFunction:function(b0){return bE.type(b0)==="function"},isArray:Array.isArray||function(b0){return bE.type(b0)==="array"},isWindow:function(b0){return b0&&typeof b0==="object"&&"setInterval" in b0},isNaN:function(b0){return b0==null||!bH.test(b0)||isNaN(b0)},type:function(b0){return b0==null?String(b0):bw[bL.call(b0)]||"object"},isPlainObject:function(b2){if(!b2||bE.type(b2)!=="object"||b2.nodeType||bE.isWindow(b2)){return false}try{if(b2.constructor&&!bF.call(b2,"constructor")&&!bF.call(b2.constructor.prototype,"isPrototypeOf")){return false}}catch(b1){return false}var b0;for(b0 in b2){}return b0===N||bF.call(b2,b0)},isEmptyObject:function(b1){for(var b0 in b1){return false}return true},error:function(b0){throw b0},parseJSON:function(b0){if(typeof b0!=="string"||!b0){return null}b0=bE.trim(b0);if(ba.JSON&&ba.JSON.parse){return ba.JSON.parse(b0)}if(bN.test(b0.replace(bW,"@").replace(bP,"]").replace(bJ,""))){return(new Function("return "+b0))()}bE.error("Invalid JSON: "+b0)},parseXML:function(b2){var b0,b1;try{if(ba.DOMParser){b1=new DOMParser();b0=b1.parseFromString(b2,"text/xml")}else{b0=new ActiveXObject("Microsoft.XMLDOM");b0.async="false";b0.loadXML(b2)}}catch(b3){b0=N}if(!b0||!b0.documentElement||b0.getElementsByTagName("parsererror").length){bE.error("Invalid XML: "+b2)}return b0},noop:function(){},globalEval:function(b0){if(b0&&bM.test(b0)){(ba.execScript||function(b1){ba["eval"].call(ba,b1)})(b0)}},camelCase:function(b0){return b0.replace(bZ,"ms-").replace(bA,bT)},nodeName:function(b1,b0){return b1.nodeName&&b1.nodeName.toUpperCase()===b0.toUpperCase()},each:function(b3,b6,b2){var b1,b4=0,b5=b3.length,b0=b5===N||bE.isFunction(b3);if(b2){if(b0){for(b1 in b3){if(b6.apply(b3[b1],b2)===false){break}}}else{for(;b4<b5;){if(b6.apply(b3[b4++],b2)===false){break}}}}else{if(b0){for(b1 in b3){if(b6.call(b3[b1],b1,b3[b1])===false){break}}}else{for(;b4<b5;){if(b6.call(b3[b4],b4,b3[b4++])===false){break}}}}return b3},trim:bO?function(b0){return b0==null?"":bO.call(b0)}:function(b0){return b0==null?"":b0.toString().replace(bI,"").replace(bD,"")},makeArray:function(b3,b1){var b0=b1||[];if(b3!=null){var b2=bE.type(b3);if(b3.length==null||b2==="string"||b2==="function"||b2==="regexp"||bE.isWindow(b3)){by.call(b0,b3)}else{bE.merge(b0,b3)}}return b0},inArray:function(b2,b3){if(!b3){return -1}if(bu){return bu.call(b3,b2)}for(var b0=0,b1=b3.length;b0<b1;b0++){if(b3[b0]===b2){return b0}}return -1},merge:function(b4,b2){var b3=b4.length,b1=0;if(typeof b2.length==="number"){for(var b0=b2.length;b1<b0;b1++){b4[b3++]=b2[b1]}}else{while(b2[b1]!==N){b4[b3++]=b2[b1++]}}b4.length=b3;return b4},grep:function(b1,b6,b0){var b2=[],b5;b0=!!b0;for(var b3=0,b4=b1.length;b3<b4;b3++){b5=!!b6(b1[b3],b3);if(b0!==b5){b2.push(b1[b3])}}return b2},map:function(b0,b7,b8){var b5,b6,b4=[],b2=0,b1=b0.length,b3=b0 instanceof bE||b1!==N&&typeof b1==="number"&&((b1>0&&b0[0]&&b0[b1-1])||b1===0||bE.isArray(b0));if(b3){for(;b2<b1;b2++){b5=b7(b0[b2],b2,b8);if(b5!=null){b4[b4.length]=b5}}}else{for(b6 in b0){b5=b7(b0[b6],b6,b8);if(b5!=null){b4[b4.length]=b5}}}return b4.concat.apply([],b4)},guid:1,proxy:function(b4,b3){if(typeof b3==="string"){var b2=b4[b3];b3=b4;b4=b2}if(!bE.isFunction(b4)){return N}var b0=bK.call(arguments,2),b1=function(){return b4.apply(b3,b0.concat(bK.call(arguments)))};b1.guid=b4.guid=b4.guid||b1.guid||bE.guid++;return b1},access:function(b0,b8,b6,b2,b5,b7){var b1=b0.length;if(typeof b8==="object"){for(var b3 in b8){bE.access(b0,b3,b8[b3],b2,b5,b6)}return b0}if(b6!==N){b2=!b7&&b2&&bE.isFunction(b6);for(var b4=0;b4<b1;b4++){b5(b0[b4],b8,b2?b6.call(b0[b4],b4,b5(b0[b4],b8)):b6,b7)}return b0}return b1?b5(b0[0],b8):N},now:function(){return(new Date()).getTime()},uaMatch:function(b1){b1=b1.toLowerCase();var b0=bx.exec(b1)||bR.exec(b1)||bQ.exec(b1)||b1.indexOf("compatible")<0&&bS.exec(b1)||[];return{browser:b0[1]||"",version:b0[2]||"0"}},sub:function(){function b0(b3,b4){return new b0.fn.init(b3,b4)}bE.extend(true,b0,this);b0.superclass=this;b0.fn=b0.prototype=this();b0.fn.constructor=b0;b0.sub=this.sub;b0.fn.init=function b2(b3,b4){if(b4&&b4 instanceof bE&&!(b4 instanceof b0)){b4=b0(b4)}return bE.fn.init.call(this,b3,b4,b1)};b0.fn.init.prototype=b0.fn;var b1=b0(at);return b0},browser:{}});bE.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(b1,b0){bw["[object "+b0+"]"]=b0.toLowerCase()});bV=bE.uaMatch(bX);if(bV.browser){bE.browser[bV.browser]=true;bE.browser.version=bV.version}if(bE.browser.webkit){bE.browser.safari=true}if(bM.test("\xA0")){bI=/^[\s\xA0]+/;bD=/[\s\xA0]+$/}bC=bE(at);if(at.addEventListener){e=function(){at.removeEventListener("DOMContentLoaded",e,false);bE.ready()}}else{if(at.attachEvent){e=function(){if(at.readyState==="complete"){at.detachEvent("onreadystatechange",e);bE.ready()}}}}function bv(){if(bE.isReady){return}try{at.documentElement.doScroll("left")}catch(b0){setTimeout(bv,1);return}bE.ready()}return bE})();var a="done fail isResolved isRejected promise then always pipe".split(" "),aH=[].slice;b.extend({_Deferred:function(){var bw=[],bx,bu,bv,e={done:function(){if(!bv){var bz=arguments,bA,bD,bC,bB,by;if(bx){by=bx;bx=0}for(bA=0,bD=bz.length;bA<bD;bA++){bC=bz[bA];bB=b.type(bC);if(bB==="array"){e.done.apply(e,bC)}else{if(bB==="function"){bw.push(bC)}}}if(by){e.resolveWith(by[0],by[1])}}return this},resolveWith:function(bz,by){if(!bv&&!bx&&!bu){by=by||[];bu=1;try{while(bw[0]){bw.shift().apply(bz,by)}}finally{bx=[bz,by];bu=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return !!(bu||bx)},cancel:function(){bv=1;bw=[];return this}};return e},Deferred:function(bu){var e=b._Deferred(),bw=b._Deferred(),bv;b.extend(e,{then:function(by,bx){e.done(by).fail(bx);return this},always:function(){return e.done.apply(e,arguments).fail.apply(this,arguments)},fail:bw.done,rejectWith:bw.resolveWith,reject:bw.resolve,isRejected:bw.isResolved,pipe:function(by,bx){return b.Deferred(function(bz){b.each({done:[by,"resolve"],fail:[bx,"reject"]},function(bB,bE){var bA=bE[0],bD=bE[1],bC;if(b.isFunction(bA)){e[bB](function(){bC=bA.apply(this,arguments);if(bC&&b.isFunction(bC.promise)){bC.promise().then(bz.resolve,bz.reject)}else{bz[bD+"With"](this===e?bz:this,[bC])}})}else{e[bB](bz[bD])}})}).promise()},promise:function(by){if(by==null){if(bv){return bv}bv=by={}}var bx=a.length;while(bx--){by[a[bx]]=e[a[bx]]}return by}});e.done(bw.cancel).fail(e.cancel);delete e.cancel;if(bu){bu.call(e,e)}return e},when:function(bz){var bu=arguments,bv=0,by=bu.length,bx=by,e=by<=1&&bz&&b.isFunction(bz.promise)?bz:b.Deferred();function bw(bA){return function(bB){bu[bA]=arguments.length>1?aH.call(arguments,0):bB;if(!(--bx)){e.resolveWith(e,aH.call(bu,0))}}}if(by>1){for(;bv<by;bv++){if(bu[bv]&&b.isFunction(bu[bv].promise)){bu[bv].promise().then(bw(bv),e.reject)}else{--bx}}if(!bx){e.resolveWith(e,bu)}}else{if(e!==bz){e.resolveWith(e,by?[bz]:[])}}return e.promise()}});b.support=(function(){var bE=at.createElement("div"),bL=at.documentElement,bx,bM,bF,bv,bD,by,bB,bu,bC,bG,bA,bK,bI,bw,bz,bH,bN;bE.setAttribute("className","t");bE.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";bx=bE.getElementsByTagName("*");bM=bE.getElementsByTagName("a")[0];if(!bx||!bx.length||!bM){return{}}bF=at.createElement("select");bv=bF.appendChild(at.createElement("option"));bD=bE.getElementsByTagName("input")[0];bB={leadingWhitespace:(bE.firstChild.nodeType===3),tbody:!bE.getElementsByTagName("tbody").length,htmlSerialize:!!bE.getElementsByTagName("link").length,style:/top/.test(bM.getAttribute("style")),hrefNormalized:(bM.getAttribute("href")==="/a"),opacity:/^0.55$/.test(bM.style.opacity),cssFloat:!!bM.style.cssFloat,checkOn:(bD.value==="on"),optSelected:bv.selected,getSetAttribute:bE.className!=="t",submitBubbles:true,changeBubbles:true,focusinBubbles:false,deleteExpando:true,noCloneEvent:true,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableMarginRight:true};bD.checked=true;bB.noCloneChecked=bD.cloneNode(true).checked;bF.disabled=true;bB.optDisabled=!bv.disabled;try{delete bE.test}catch(bJ){bB.deleteExpando=false}if(!bE.addEventListener&&bE.attachEvent&&bE.fireEvent){bE.attachEvent("onclick",function(){bB.noCloneEvent=false});bE.cloneNode(true).fireEvent("onclick")}bD=at.createElement("input");bD.value="t";bD.setAttribute("type","radio");bB.radioValue=bD.value==="t";bD.setAttribute("checked","checked");bE.appendChild(bD);bu=at.createDocumentFragment();bu.appendChild(bE.firstChild);bB.checkClone=bu.cloneNode(true).cloneNode(true).lastChild.checked;bE.innerHTML="";bE.style.width=bE.style.paddingLeft="1px";bC=at.getElementsByTagName("body")[0];bA=at.createElement(bC?"div":"body");bK={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(bC){b.extend(bK,{position:"absolute",left:"-1000px",top:"-1000px"})}for(bH in bK){bA.style[bH]=bK[bH]}bA.appendChild(bE);bG=bC||bL;bG.insertBefore(bA,bG.firstChild);bB.appendChecked=bD.checked;bB.boxModel=bE.offsetWidth===2;if("zoom" in bE.style){bE.style.display="inline";bE.style.zoom=1;bB.inlineBlockNeedsLayout=(bE.offsetWidth===2);bE.style.display="";bE.innerHTML="<div style='width:4px;'></div>";bB.shrinkWrapBlocks=(bE.offsetWidth!==2)}bE.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";bI=bE.getElementsByTagName("td");bN=(bI[0].offsetHeight===0);bI[0].style.display="";bI[1].style.display="none";bB.reliableHiddenOffsets=bN&&(bI[0].offsetHeight===0);bE.innerHTML="";if(at.defaultView&&at.defaultView.getComputedStyle){by=at.createElement("div");by.style.width="0";by.style.marginRight="0";bE.appendChild(by);bB.reliableMarginRight=(parseInt((at.defaultView.getComputedStyle(by,null)||{marginRight:0}).marginRight,10)||0)===0}bA.innerHTML="";bG.removeChild(bA);if(bE.attachEvent){for(bH in {submit:1,change:1,focusin:1}){bz="on"+bH;bN=(bz in bE);if(!bN){bE.setAttribute(bz,"return;");bN=(typeof bE[bz]==="function")}bB[bH+"Bubbles"]=bN}}bA=bu=bF=bv=bC=by=bE=bD=null;return bB})();b.boxModel=b.support.boxModel;var aO=/^(?:\{.*\}|\[.*\])$/,ay=/([A-Z])/g;b.extend({cache:{},uuid:0,expando:"jQuery"+(b.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(e){e=e.nodeType?b.cache[e[b.expando]]:e[b.expando];return !!e&&!V(e)},data:function(bw,bu,by,bx){if(!b.acceptData(bw)){return}var bz,bB,bC=b.expando,bA=typeof bu==="string",bD=bw.nodeType,e=bD?b.cache:bw,bv=bD?bw[b.expando]:bw[b.expando]&&b.expando;if((!bv||(bx&&bv&&(e[bv]&&!e[bv][bC])))&&bA&&by===N){return}if(!bv){if(bD){bw[b.expando]=bv=++b.uuid}else{bv=b.expando}}if(!e[bv]){e[bv]={};if(!bD){e[bv].toJSON=b.noop}}if(typeof bu==="object"||typeof bu==="function"){if(bx){e[bv][bC]=b.extend(e[bv][bC],bu)}else{e[bv]=b.extend(e[bv],bu)}}bz=e[bv];if(bx){if(!bz[bC]){bz[bC]={}}bz=bz[bC]}if(by!==N){bz[b.camelCase(bu)]=by}if(bu==="events"&&!bz[bu]){return bz[bC]&&bz[bC].events}if(bA){bB=bz[bu];if(bB==null){bB=bz[b.camelCase(bu)]}}else{bB=bz}return bB},removeData:function(bx,bv,by){if(!b.acceptData(bx)){return}var bz,bA=b.expando,bB=bx.nodeType,bu=bB?b.cache:bx,bw=bB?bx[b.expando]:b.expando;if(!bu[bw]){return}if(bv){bz=by?bu[bw][bA]:bu[bw];if(bz){if(!bz[bv]){bv=b.camelCase(bv)}delete bz[bv];if(!V(bz)){return}}}if(by){delete bu[bw][bA];if(!V(bu[bw])){return}}var e=bu[bw][bA];if(b.support.deleteExpando||!bu.setInterval){delete bu[bw]}else{bu[bw]=null}if(e){bu[bw]={};if(!bB){bu[bw].toJSON=b.noop}bu[bw][bA]=e}else{if(bB){if(b.support.deleteExpando){delete bx[b.expando]}else{if(bx.removeAttribute){bx.removeAttribute(b.expando)}else{bx[b.expando]=null}}}}},_data:function(bu,e,bv){return b.data(bu,e,bv,true)},acceptData:function(bu){if(bu.nodeName){var e=b.noData[bu.nodeName.toLowerCase()];if(e){return !(e===true||bu.getAttribute("classid")!==e)}}return true}});b.fn.extend({data:function(bx,bz){var by=null;if(typeof bx==="undefined"){if(this.length){by=b.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,bv;for(var bw=0,bu=e.length;bw<bu;bw++){bv=e[bw].name;if(bv.indexOf("data-")===0){bv=b.camelCase(bv.substring(5));a4(this[0],bv,by[bv])}}}}return by}else{if(typeof bx==="object"){return this.each(function(){b.data(this,bx)})}}var bA=bx.split(".");bA[1]=bA[1]?"."+bA[1]:"";if(bz===N){by=this.triggerHandler("getData"+bA[1]+"!",[bA[0]]);if(by===N&&this.length){by=b.data(this[0],bx);by=a4(this[0],bx,by)}return by===N&&bA[1]?this.data(bA[0]):by}else{return this.each(function(){var bC=b(this),bB=[bA[0],bz];bC.triggerHandler("setData"+bA[1]+"!",bB);b.data(this,bx,bz);bC.triggerHandler("changeData"+bA[1]+"!",bB)})}},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function a4(bw,bv,bx){if(bx===N&&bw.nodeType===1){var bu="data-"+bv.replace(ay,"-$1").toLowerCase();bx=bw.getAttribute(bu);if(typeof bx==="string"){try{bx=bx==="true"?true:bx==="false"?false:bx==="null"?null:!b.isNaN(bx)?parseFloat(bx):aO.test(bx)?b.parseJSON(bx):bx}catch(by){}b.data(bw,bv,bx)}else{bx=N}}return bx}function V(bu){for(var e in bu){if(e!=="toJSON"){return false}}return true}function bg(bx,bw,bz){var bv=bw+"defer",bu=bw+"queue",e=bw+"mark",by=b.data(bx,bv,N,true);if(by&&(bz==="queue"||!b.data(bx,bu,N,true))&&(bz==="mark"||!b.data(bx,e,N,true))){setTimeout(function(){if(!b.data(bx,bu,N,true)&&!b.data(bx,e,N,true)){b.removeData(bx,bv,true);by.resolve()}},0)}}b.extend({_mark:function(bu,e){if(bu){e=(e||"fx")+"mark";b.data(bu,e,(b.data(bu,e,N,true)||0)+1,true)}},_unmark:function(bx,bw,bu){if(bx!==true){bu=bw;bw=bx;bx=false}if(bw){bu=bu||"fx";var e=bu+"mark",bv=bx?0:((b.data(bw,e,N,true)||1)-1);if(bv){b.data(bw,e,bv,true)}else{b.removeData(bw,e,true);bg(bw,bu,"mark")}}},queue:function(bu,e,bw){if(bu){e=(e||"fx")+"queue";var bv=b.data(bu,e,N,true);if(bw){if(!bv||b.isArray(bw)){bv=b.data(bu,e,b.makeArray(bw),true)}else{bv.push(bw)}}return bv||[]}},dequeue:function(bw,bv){bv=bv||"fx";var e=b.queue(bw,bv),bu=e.shift(),bx;if(bu==="inprogress"){bu=e.shift()}if(bu){if(bv==="fx"){e.unshift("inprogress")}bu.call(bw,function(){b.dequeue(bw,bv)})}if(!e.length){b.removeData(bw,bv+"queue",true);bg(bw,bv,"queue")}}});b.fn.extend({queue:function(e,bu){if(typeof e!=="string"){bu=e;e="fx"}if(bu===N){return b.queue(this[0],e)}return this.each(function(){var bv=b.queue(this,e,bu);if(e==="fx"&&bv[0]!=="inprogress"){b.dequeue(this,e)}})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(bu,e){bu=b.fx?b.fx.speeds[bu]||bu:bu;e=e||"fx";return this.queue(e,function(){var bv=this;setTimeout(function(){b.dequeue(bv,e)},bu)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(bC,bv){if(typeof bC!=="string"){bv=bC;bC=N}bC=bC||"fx";var e=b.Deferred(),bu=this,bx=bu.length,bA=1,by=bC+"defer",bz=bC+"queue",bB=bC+"mark",bw;function bD(){if(!(--bA)){e.resolveWith(bu,[bu])}}while(bx--){if((bw=b.data(bu[bx],by,N,true)||(b.data(bu[bx],bz,N,true)||b.data(bu[bx],bB,N,true))&&b.data(bu[bx],by,b._Deferred(),true))){bA++;bw.done(bD)}}bD();return e.promise()}});var aM=/[\n\t\r]/g,ae=/\s+/,aQ=/\r/g,g=/^(?:button|input)$/i,G=/^(?:button|input|object|select|textarea)$/i,n=/^a(?:rea)?$/i,am=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,bd,aX;b.fn.extend({attr:function(e,bu){return b.access(this,e,bu,true,b.attr)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,bu){return b.access(this,e,bu,true,b.prop)},removeProp:function(e){e=b.propFix[e]||e;return this.each(function(){try{this[e]=N;delete this[e]}catch(bu){}})},addClass:function(bx){var bz,bv,bu,bw,by,bA,e;if(b.isFunction(bx)){return this.each(function(bB){b(this).addClass(bx.call(this,bB,this.className))})}if(bx&&typeof bx==="string"){bz=bx.split(ae);for(bv=0,bu=this.length;bv<bu;bv++){bw=this[bv];if(bw.nodeType===1){if(!bw.className&&bz.length===1){bw.className=bx}else{by=" "+bw.className+" ";for(bA=0,e=bz.length;bA<e;bA++){if(!~by.indexOf(" "+bz[bA]+" ")){by+=bz[bA]+" "}}bw.className=b.trim(by)}}}}return this},removeClass:function(by){var bz,bv,bu,bx,bw,bA,e;if(b.isFunction(by)){return this.each(function(bB){b(this).removeClass(by.call(this,bB,this.className))})}if((by&&typeof by==="string")||by===N){bz=(by||"").split(ae);for(bv=0,bu=this.length;bv<bu;bv++){bx=this[bv];if(bx.nodeType===1&&bx.className){if(by){bw=(" "+bx.className+" ").replace(aM," ");for(bA=0,e=bz.length;bA<e;bA++){bw=bw.replace(" "+bz[bA]+" "," ")}bx.className=b.trim(bw)}else{bx.className=""}}}}return this},toggleClass:function(bw,bu){var bv=typeof bw,e=typeof bu==="boolean";if(b.isFunction(bw)){return this.each(function(bx){b(this).toggleClass(bw.call(this,bx,this.className,bu),bu)})}return this.each(function(){if(bv==="string"){var bz,by=0,bx=b(this),bA=bu,bB=bw.split(ae);while((bz=bB[by++])){bA=e?bA:!bx.hasClass(bz);bx[bA?"addClass":"removeClass"](bz)}}else{if(bv==="undefined"||bv==="boolean"){if(this.className){b._data(this,"__className__",this.className)}this.className=this.className||bw===false?"":b._data(this,"__className__")||""}}})},hasClass:function(e){var bw=" "+e+" ";for(var bv=0,bu=this.length;bv<bu;bv++){if(this[bv].nodeType===1&&(" "+this[bv].className+" ").replace(aM," ").indexOf(bw)>-1){return true}}return false},val:function(bw){var e,bu,bv=this[0];if(!arguments.length){if(bv){e=b.valHooks[bv.nodeName.toLowerCase()]||b.valHooks[bv.type];if(e&&"get" in e&&(bu=e.get(bv,"value"))!==N){return bu}bu=bv.value;return typeof bu==="string"?bu.replace(aQ,""):bu==null?"":bu}return N}var bx=b.isFunction(bw);return this.each(function(bz){var by=b(this),bA;if(this.nodeType!==1){return}if(bx){bA=bw.call(this,bz,by.val())}else{bA=bw}if(bA==null){bA=""}else{if(typeof bA==="number"){bA+=""}else{if(b.isArray(bA)){bA=b.map(bA,function(bB){return bB==null?"":bB+""})}}}e=b.valHooks[this.nodeName.toLowerCase()]||b.valHooks[this.type];if(!e||!("set" in e)||e.set(this,bA,"value")===N){this.value=bA}})}});b.extend({valHooks:{option:{get:function(e){var bu=e.attributes.value;return !bu||bu.specified?e.value:e.text}},select:{get:function(e){var bz,bx=e.selectedIndex,bA=[],bB=e.options,bw=e.type==="select-one";if(bx<0){return null}for(var bu=bw?bx:0,by=bw?bx+1:bB.length;bu<by;bu++){var bv=bB[bu];if(bv.selected&&(b.support.optDisabled?!bv.disabled:bv.getAttribute("disabled")===null)&&(!bv.parentNode.disabled||!b.nodeName(bv.parentNode,"optgroup"))){bz=b(bv).val();if(bw){return bz}bA.push(bz)}}if(bw&&!bA.length&&bB.length){return b(bB[bx]).val()}return bA},set:function(bu,bv){var e=b.makeArray(bv);b(bu).find("option").each(function(){this.selected=b.inArray(b(this).val(),e)>=0});if(!e.length){bu.selectedIndex=-1}return e}}},attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attrFix:{tabindex:"tabIndex"},attr:function(bz,bw,bA,by){var bu=bz.nodeType;if(!bz||bu===3||bu===8||bu===2){return N}if(by&&bw in b.attrFn){return b(bz)[bw](bA)}if(!("getAttribute" in bz)){return b.prop(bz,bw,bA)}var bv,e,bx=bu!==1||!b.isXMLDoc(bz);if(bx){bw=b.attrFix[bw]||bw;e=b.attrHooks[bw];if(!e){if(am.test(bw)){e=aX}else{if(bd){e=bd}}}}if(bA!==N){if(bA===null){b.removeAttr(bz,bw);return N}else{if(e&&"set" in e&&bx&&(bv=e.set(bz,bA,bw))!==N){return bv}else{bz.setAttribute(bw,""+bA);return bA}}}else{if(e&&"get" in e&&bx&&(bv=e.get(bz,bw))!==null){return bv}else{bv=bz.getAttribute(bw);return bv===null?N:bv}}},removeAttr:function(bu,e){var bv;if(bu.nodeType===1){e=b.attrFix[e]||e;b.attr(bu,e,"");bu.removeAttribute(e);if(am.test(e)&&(bv=b.propFix[e]||e) in bu){bu[bv]=false}}},attrHooks:{type:{set:function(e,bu){if(g.test(e.nodeName)&&e.parentNode){b.error("type property can't be changed")}else{if(!b.support.radioValue&&bu==="radio"&&b.nodeName(e,"input")){var bv=e.value;e.setAttribute("type",bu);if(bv){e.value=bv}return bu}}}},value:{get:function(bu,e){if(bd&&b.nodeName(bu,"button")){return bd.get(bu,e)}return e in bu?bu.value:null},set:function(bu,bv,e){if(bd&&b.nodeName(bu,"button")){return bd.set(bu,bv,e)}bu.value=bv}}},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(by,bw,bz){var bu=by.nodeType;if(!by||bu===3||bu===8||bu===2){return N}var bv,e,bx=bu!==1||!b.isXMLDoc(by);if(bx){bw=b.propFix[bw]||bw;e=b.propHooks[bw]}if(bz!==N){if(e&&"set" in e&&(bv=e.set(by,bz,bw))!==N){return bv}else{return(by[bw]=bz)}}else{if(e&&"get" in e&&(bv=e.get(by,bw))!==null){return bv}else{return by[bw]}}},propHooks:{tabIndex:{get:function(bu){var e=bu.getAttributeNode("tabindex");return e&&e.specified?parseInt(e.value,10):G.test(bu.nodeName)||n.test(bu.nodeName)&&bu.href?0:N}}}});b.attrHooks.tabIndex=b.propHooks.tabIndex;aX={get:function(bu,e){var bv;return b.prop(bu,e)===true||(bv=bu.getAttributeNode(e))&&bv.nodeValue!==false?e.toLowerCase():N},set:function(bu,bw,e){var bv;if(bw===false){b.removeAttr(bu,e)}else{bv=b.propFix[e]||e;if(bv in bu){bu[bv]=true}bu.setAttribute(e,e.toLowerCase())}return e}};if(!b.support.getSetAttribute){bd=b.valHooks.button={get:function(bv,bu){var e;e=bv.getAttributeNode(bu);return e&&e.nodeValue!==""?e.nodeValue:N},set:function(bv,bw,bu){var e=bv.getAttributeNode(bu);if(!e){e=at.createAttribute(bu);bv.setAttributeNode(e)}return(e.nodeValue=bw+"")}};b.each(["width","height"],function(bu,e){b.attrHooks[e]=b.extend(b.attrHooks[e],{set:function(bv,bw){if(bw===""){bv.setAttribute(e,"auto");return bw}}})})}if(!b.support.hrefNormalized){b.each(["href","src","width","height"],function(bu,e){b.attrHooks[e]=b.extend(b.attrHooks[e],{get:function(bw){var bv=bw.getAttribute(e,2);return bv===null?N:bv}})})}if(!b.support.style){b.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||N},set:function(e,bu){return(e.style.cssText=""+bu)}}}if(!b.support.optSelected){b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(bu){var e=bu.parentNode;if(e){e.selectedIndex;if(e.parentNode){e.parentNode.selectedIndex}}return null}})}if(!b.support.checkOn){b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}})}b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,bu){if(b.isArray(bu)){return(e.checked=b.inArray(b(e).val(),bu)>=0)}}})});var aZ=/\.(.*)$/,bc=/^(?:textarea|input|select)$/i,Q=/\./g,bh=/ /g,aE=/[^\w\s.|`]/g,J=function(e){return e.replace(aE,"\\$&")};b.event={add:function(bw,bA,bF,by){if(bw.nodeType===3||bw.nodeType===8){return}if(bF===false){bF=bj}else{if(!bF){return}}var bu,bE;if(bF.handler){bu=bF;bF=bu.handler}if(!bF.guid){bF.guid=b.guid++}var bB=b._data(bw);if(!bB){return}var bG=bB.events,bz=bB.handle;if(!bG){bB.events=bG={}}if(!bz){bB.handle=bz=function(bH){return typeof b!=="undefined"&&(!bH||b.event.triggered!==bH.type)?b.event.handle.apply(bz.elem,arguments):N}}bz.elem=bw;bA=bA.split(" ");var bD,bx=0,e;while((bD=bA[bx++])){bE=bu?b.extend({},bu):{handler:bF,data:by};if(bD.indexOf(".")>-1){e=bD.split(".");bD=e.shift();bE.namespace=e.slice(0).sort().join(".")}else{e=[];bE.namespace=""}bE.type=bD;if(!bE.guid){bE.guid=bF.guid}var bv=bG[bD],bC=b.event.special[bD]||{};if(!bv){bv=bG[bD]=[];if(!bC.setup||bC.setup.call(bw,by,e,bz)===false){if(bw.addEventListener){bw.addEventListener(bD,bz,false)}else{if(bw.attachEvent){bw.attachEvent("on"+bD,bz)}}}}if(bC.add){bC.add.call(bw,bE);if(!bE.handler.guid){bE.handler.guid=bF.guid}}bv.push(bE);b.event.global[bD]=true}bw=null},global:{},remove:function(bI,bD,bv,bz){if(bI.nodeType===3||bI.nodeType===8){return}if(bv===false){bv=bj}var bL,by,bA,bF,bG=0,bw,bB,bE,bx,bC,e,bK,bH=b.hasData(bI)&&b._data(bI),bu=bH&&bH.events;if(!bH||!bu){return}if(bD&&bD.type){bv=bD.handler;bD=bD.type}if(!bD||typeof bD==="string"&&bD.charAt(0)==="."){bD=bD||"";for(by in bu){b.event.remove(bI,by+bD)}return}bD=bD.split(" ");while((by=bD[bG++])){bK=by;e=null;bw=by.indexOf(".")<0;bB=[];if(!bw){bB=by.split(".");by=bB.shift();bE=new RegExp("(^|\\.)"+b.map(bB.slice(0).sort(),J).join("\\.(?:.*\\.)?")+"(\\.|$)")}bC=bu[by];if(!bC){continue}if(!bv){for(bF=0;bF<bC.length;bF++){e=bC[bF];if(bw||bE.test(e.namespace)){b.event.remove(bI,bK,e.handler,bF);bC.splice(bF--,1)}}continue}bx=b.event.special[by]||{};for(bF=bz||0;bF<bC.length;bF++){e=bC[bF];if(bv.guid===e.guid){if(bw||bE.test(e.namespace)){if(bz==null){bC.splice(bF--,1)}if(bx.remove){bx.remove.call(bI,e)}}if(bz!=null){break}}}if(bC.length===0||bz!=null&&bC.length===1){if(!bx.teardown||bx.teardown.call(bI,bB)===false){b.removeEvent(bI,by,bH.handle)}bL=null;delete bu[by]}}if(b.isEmptyObject(bu)){var bJ=bH.handle;if(bJ){bJ.elem=null}delete bH.events;delete bH.handle;if(b.isEmptyObject(bH)){b.removeData(bI,N,true)}}},customEvent:{getData:true,setData:true,changeData:true},trigger:function(e,bA,by,bF){var bD=e.type||e,bv=[],bu;if(bD.indexOf("!")>=0){bD=bD.slice(0,-1);bu=true}if(bD.indexOf(".")>=0){bv=bD.split(".");bD=bv.shift();bv.sort()}if((!by||b.event.customEvent[bD])&&!b.event.global[bD]){return}e=typeof e==="object"?e[b.expando]?e:new b.Event(bD,e):new b.Event(bD);e.type=bD;e.exclusive=bu;e.namespace=bv.join(".");e.namespace_re=new RegExp("(^|\\.)"+bv.join("\\.(?:.*\\.)?")+"(\\.|$)");if(bF||!by){e.preventDefault();e.stopPropagation()}if(!by){b.each(b.cache,function(){var bH=b.expando,bG=this[bH];if(bG&&bG.events&&bG.events[bD]){b.event.trigger(e,bA,bG.handle.elem)}});return}if(by.nodeType===3||by.nodeType===8){return}e.result=N;e.target=by;bA=bA!=null?b.makeArray(bA):[];bA.unshift(e);var bE=by,bw=bD.indexOf(":")<0?"on"+bD:"";do{var bB=b._data(bE,"handle");e.currentTarget=bE;if(bB){bB.apply(bE,bA)}if(bw&&b.acceptData(bE)&&bE[bw]&&bE[bw].apply(bE,bA)===false){e.result=false;e.preventDefault()}bE=bE.parentNode||bE.ownerDocument||bE===e.target.ownerDocument&&ba}while(bE&&!e.isPropagationStopped());if(!e.isDefaultPrevented()){var bx,bC=b.event.special[bD]||{};if((!bC._default||bC._default.call(by.ownerDocument,e)===false)&&!(bD==="click"&&b.nodeName(by,"a"))&&b.acceptData(by)){try{if(bw&&by[bD]){bx=by[bw];if(bx){by[bw]=null}b.event.triggered=bD;by[bD]()}}catch(bz){}if(bx){by[bw]=bx}b.event.triggered=N}}return e.result},handle:function(bA){bA=b.event.fix(bA||ba.event);var bu=((b._data(this,"events")||{})[bA.type]||[]).slice(0),bz=!bA.exclusive&&!bA.namespace,bx=Array.prototype.slice.call(arguments,0);bx[0]=bA;bA.currentTarget=this;for(var bw=0,e=bu.length;bw<e;bw++){var by=bu[bw];if(bz||bA.namespace_re.test(by.namespace)){bA.handler=by.handler;bA.data=by.data;bA.handleObj=by;var bv=by.handler.apply(this,bx);if(bv!==N){bA.result=bv;if(bv===false){bA.preventDefault();bA.stopPropagation()}}if(bA.isImmediatePropagationStopped()){break}}}return bA.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(bx){if(bx[b.expando]){return bx}var bu=bx;bx=b.Event(bu);for(var bv=this.props.length,bz;bv;){bz=this.props[--bv];bx[bz]=bu[bz]}if(!bx.target){bx.target=bx.srcElement||at}if(bx.target.nodeType===3){bx.target=bx.target.parentNode}if(!bx.relatedTarget&&bx.fromElement){bx.relatedTarget=bx.fromElement===bx.target?bx.toElement:bx.fromElement}if(bx.pageX==null&&bx.clientX!=null){var bw=bx.target.ownerDocument||at,by=bw.documentElement,e=bw.body;bx.pageX=bx.clientX+(by&&by.scrollLeft||e&&e.scrollLeft||0)-(by&&by.clientLeft||e&&e.clientLeft||0);bx.pageY=bx.clientY+(by&&by.scrollTop||e&&e.scrollTop||0)-(by&&by.clientTop||e&&e.clientTop||0)}if(bx.which==null&&(bx.charCode!=null||bx.keyCode!=null)){bx.which=bx.charCode!=null?bx.charCode:bx.keyCode}if(!bx.metaKey&&bx.ctrlKey){bx.metaKey=bx.ctrlKey}if(!bx.which&&bx.button!==N){bx.which=(bx.button&1?1:(bx.button&2?3:(bx.button&4?2:0)))}return bx},guid:100000000,proxy:b.proxy,special:{ready:{setup:b.bindReady,teardown:b.noop},live:{add:function(e){b.event.add(this,r(e.origType,e.selector),b.extend({},e,{handler:aj,guid:e.handler.guid}))},remove:function(e){b.event.remove(this,r(e.origType,e.selector),e)}},beforeunload:{setup:function(bv,bu,e){if(b.isWindow(this)){this.onbeforeunload=e}},teardown:function(bu,e){if(this.onbeforeunload===e){this.onbeforeunload=null}}}}};b.removeEvent=at.removeEventListener?function(bu,e,bv){if(bu.removeEventListener){bu.removeEventListener(e,bv,false)}}:function(bu,e,bv){if(bu.detachEvent){bu.detachEvent("on"+e,bv)}};b.Event=function(bu,e){if(!this.preventDefault){return new b.Event(bu,e)}if(bu&&bu.type){this.originalEvent=bu;this.type=bu.type;this.isDefaultPrevented=(bu.defaultPrevented||bu.returnValue===false||bu.getPreventDefault&&bu.getPreventDefault())?j:bj}else{this.type=bu}if(e){b.extend(this,e)}this.timeStamp=b.now();this[b.expando]=true};function bj(){return false}function j(){return true}b.Event.prototype={preventDefault:function(){this.isDefaultPrevented=j;var bu=this.originalEvent;if(!bu){return}if(bu.preventDefault){bu.preventDefault()}else{bu.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=j;var bu=this.originalEvent;if(!bu){return}if(bu.stopPropagation){bu.stopPropagation()}bu.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=j;this.stopPropagation()},isDefaultPrevented:bj,isPropagationStopped:bj,isImmediatePropagationStopped:bj};var ad=function(bv){var bw=bv.relatedTarget,e=false,bu=bv.type;bv.type=bv.data;if(bw!==this){if(bw){e=b.contains(this,bw)}if(!e){b.event.handle.apply(this,arguments);bv.type=bu}}},aU=function(e){e.type=e.data;b.event.handle.apply(this,arguments)};b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(bu,e){b.event.special[bu]={setup:function(bv){b.event.add(this,e,bv&&bv.selector?aU:ad,bu)},teardown:function(bv){b.event.remove(this,e,bv&&bv.selector?aU:ad)}}});if(!b.support.submitBubbles){b.event.special.submit={setup:function(bu,e){if(!b.nodeName(this,"form")){b.event.add(this,"click.specialSubmit",function(bx){var bw=bx.target,bv=b.nodeName(bw,"input")||b.nodeName(bw,"button")?bw.type:"";if((bv==="submit"||bv==="image")&&b(bw).closest("form").length){aW("submit",this,arguments)}});b.event.add(this,"keypress.specialSubmit",function(bx){var bw=bx.target,bv=b.nodeName(bw,"input")||b.nodeName(bw,"button")?bw.type:"";if((bv==="text"||bv==="password")&&b(bw).closest("form").length&&bx.keyCode===13){aW("submit",this,arguments)}})}else{return false}},teardown:function(e){b.event.remove(this,".specialSubmit")}}}if(!b.support.changeBubbles){var bm,m=function(bu){var e=b.nodeName(bu,"input")?bu.type:"",bv=bu.value;if(e==="radio"||e==="checkbox"){bv=bu.checked}else{if(e==="select-multiple"){bv=bu.selectedIndex>-1?b.map(bu.options,function(bw){return bw.selected}).join("-"):""}else{if(b.nodeName(bu,"select")){bv=bu.selectedIndex}}}return bv},ab=function ab(bw){var bu=bw.target,bv,bx;if(!bc.test(bu.nodeName)||bu.readOnly){return}bv=b._data(bu,"_change_data");bx=m(bu);if(bw.type!=="focusout"||bu.type!=="radio"){b._data(bu,"_change_data",bx)}if(bv===N||bx===bv){return}if(bv!=null||bx){bw.type="change";bw.liveFired=N;b.event.trigger(bw,arguments[1],bu)}};b.event.special.change={filters:{focusout:ab,beforedeactivate:ab,click:function(bw){var bv=bw.target,bu=b.nodeName(bv,"input")?bv.type:"";if(bu==="radio"||bu==="checkbox"||b.nodeName(bv,"select")){ab.call(this,bw)}},keydown:function(bw){var bv=bw.target,bu=b.nodeName(bv,"input")?bv.type:"";if((bw.keyCode===13&&!b.nodeName(bv,"textarea"))||(bw.keyCode===32&&(bu==="checkbox"||bu==="radio"))||bu==="select-multiple"){ab.call(this,bw)}},beforeactivate:function(bv){var bu=bv.target;b._data(bu,"_change_data",m(bu))}},setup:function(bv,bu){if(this.type==="file"){return false}for(var e in bm){b.event.add(this,e+".specialChange",bm[e])}return bc.test(this.nodeName)},teardown:function(e){b.event.remove(this,".specialChange");return bc.test(this.nodeName)}};bm=b.event.special.change.filters;bm.focus=bm.beforeactivate}function aW(bu,bw,e){var bv=b.extend({},e[0]);bv.type=bu;bv.originalEvent={};bv.liveFired=N;b.event.handle.call(bw,bv);if(bv.isDefaultPrevented()){e[0].preventDefault()}}if(!b.support.focusinBubbles){b.each({focus:"focusin",blur:"focusout"},function(bw,e){var bu=0;b.event.special[e]={setup:function(){if(bu++===0){at.addEventListener(bw,bv,true)}},teardown:function(){if(--bu===0){at.removeEventListener(bw,bv,true)}}};function bv(bx){var by=b.event.fix(bx);by.type=e;by.originalEvent={};b.event.trigger(by,null,by.target);if(by.isDefaultPrevented()){bx.preventDefault()}}})}b.each(["bind","one"],function(bu,e){b.fn[e]=function(bA,bB,bz){var by;if(typeof bA==="object"){for(var bx in bA){this[e](bx,bB,bA[bx],bz)}return this}if(arguments.length===2||bB===false){bz=bB;bB=N}if(e==="one"){by=function(bC){b(this).unbind(bC,by);return bz.apply(this,arguments)};by.guid=bz.guid||b.guid++}else{by=bz}if(bA==="unload"&&e!=="one"){this.one(bA,bB,bz)}else{for(var bw=0,bv=this.length;bw<bv;bw++){b.event.add(this[bw],bA,by,bB)}}return this}});b.fn.extend({unbind:function(bx,bw){if(typeof bx==="object"&&!bx.preventDefault){for(var bv in bx){this.unbind(bv,bx[bv])}}else{for(var bu=0,e=this.length;bu<e;bu++){b.event.remove(this[bu],bx,bw)}}return this},delegate:function(e,bu,bw,bv){return this.live(bu,bw,bv,e)},undelegate:function(e,bu,bv){if(arguments.length===0){return this.unbind("live")}else{return this.die(bu,null,bv,e)}},trigger:function(e,bu){return this.each(function(){b.event.trigger(e,bu,this)})},triggerHandler:function(e,bu){if(this[0]){return b.event.trigger(e,bu,this[0],true)}},toggle:function(bw){var bu=arguments,e=bw.guid||b.guid++,bv=0,bx=function(by){var bz=(b.data(this,"lastToggle"+bw.guid)||0)%bv;b.data(this,"lastToggle"+bw.guid,bz+1);by.preventDefault();return bu[bz].apply(this,arguments)||false};bx.guid=e;while(bv<bu.length){bu[bv++].guid=e}return this.click(bx)},hover:function(e,bu){return this.mouseenter(e).mouseleave(bu||e)}});var aS={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};b.each(["live","die"],function(bu,e){b.fn[e]=function(bE,bB,bG,bx){var bF,bC=0,bD,bw,bI,bz=bx||this.selector,bv=bx?this:b(this.context);if(typeof bE==="object"&&!bE.preventDefault){for(var bH in bE){bv[e](bH,bB,bE[bH],bz)}return this}if(e==="die"&&!bE&&bx&&bx.charAt(0)==="."){bv.unbind(bx);return this}if(bB===false||b.isFunction(bB)){bG=bB||bj;bB=N}bE=(bE||"").split(" ");while((bF=bE[bC++])!=null){bD=aZ.exec(bF);bw="";if(bD){bw=bD[0];bF=bF.replace(aZ,"")}if(bF==="hover"){bE.push("mouseenter"+bw,"mouseleave"+bw);continue}bI=bF;if(aS[bF]){bE.push(aS[bF]+bw);bF=bF+bw}else{bF=(aS[bF]||bF)+bw}if(e==="live"){for(var bA=0,by=bv.length;bA<by;bA++){b.event.add(bv[bA],"live."+r(bF,bz),{data:bB,selector:bz,handler:bG,origType:bF,origHandler:bG,preType:bI})}}else{bv.unbind("live."+r(bF,bz),bG)}}return this}});function aj(bE){var bB,bw,bK,by,e,bG,bD,bF,bC,bJ,bA,bz,bI,bH=[],bx=[],bu=b._data(this,"events");if(bE.liveFired===this||!bu||!bu.live||bE.target.disabled||bE.button&&bE.type==="click"){return}if(bE.namespace){bz=new RegExp("(^|\\.)"+bE.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")}bE.liveFired=this;var bv=bu.live.slice(0);for(bD=0;bD<bv.length;bD++){e=bv[bD];if(e.origType.replace(aZ,"")===bE.type){bx.push(e.selector)}else{bv.splice(bD--,1)}}by=b(bE.target).closest(bx,bE.currentTarget);for(bF=0,bC=by.length;bF<bC;bF++){bA=by[bF];for(bD=0;bD<bv.length;bD++){e=bv[bD];if(bA.selector===e.selector&&(!bz||bz.test(e.namespace))&&!bA.elem.disabled){bG=bA.elem;bK=null;if(e.preType==="mouseenter"||e.preType==="mouseleave"){bE.type=e.preType;bK=b(bE.relatedTarget).closest(e.selector)[0];if(bK&&b.contains(bG,bK)){bK=bG}}if(!bK||bK!==bG){bH.push({elem:bG,handleObj:e,level:bA.level})}}}}for(bF=0,bC=bH.length;bF<bC;bF++){by=bH[bF];if(bw&&by.level>bw){break}bE.currentTarget=by.elem;bE.data=by.handleObj.data;bE.handleObj=by.handleObj;bI=by.handleObj.origHandler.apply(by.elem,arguments);if(bI===false||bE.isPropagationStopped()){bw=by.level;if(bI===false){bB=false}if(bE.isImmediatePropagationStopped()){break}}}return bB}function r(bu,e){return(bu&&bu!=="*"?bu+".":"")+e.replace(Q,"`").replace(bh,"&")}b.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(bu,e){b.fn[e]=function(bw,bv){if(bv==null){bv=bw;bw=null}return arguments.length>0?this.bind(e,bw,bv):this.trigger(e)};if(b.attrFn){b.attrFn[e]=true}});
/*!
 * Sizzle CSS Selector Engine
 *  Copyright 2011, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var bE=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,bF=0,bI=Object.prototype.toString,bz=false,by=true,bG=/\\/g,bM=/\W/;[0,0].sort(function(){by=false;return 0});var bw=function(bR,e,bU,bV){bU=bU||[];e=e||at;var bX=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!bR||typeof bR!=="string"){return bU}var bO,bZ,b2,bN,bY,b1,b0,bT,bQ=true,bP=bw.isXML(e),bS=[],bW=bR;do{bE.exec("");bO=bE.exec(bW);if(bO){bW=bO[3];bS.push(bO[1]);if(bO[2]){bN=bO[3];break}}}while(bO);if(bS.length>1&&bA.exec(bR)){if(bS.length===2&&bB.relative[bS[0]]){bZ=bJ(bS[0]+bS[1],e)}else{bZ=bB.relative[bS[0]]?[e]:bw(bS.shift(),e);while(bS.length){bR=bS.shift();if(bB.relative[bR]){bR+=bS.shift()}bZ=bJ(bR,bZ)}}}else{if(!bV&&bS.length>1&&e.nodeType===9&&!bP&&bB.match.ID.test(bS[0])&&!bB.match.ID.test(bS[bS.length-1])){bY=bw.find(bS.shift(),e,bP);e=bY.expr?bw.filter(bY.expr,bY.set)[0]:bY.set[0]}if(e){bY=bV?{expr:bS.pop(),set:bC(bV)}:bw.find(bS.pop(),bS.length===1&&(bS[0]==="~"||bS[0]==="+")&&e.parentNode?e.parentNode:e,bP);bZ=bY.expr?bw.filter(bY.expr,bY.set):bY.set;if(bS.length>0){b2=bC(bZ)}else{bQ=false}while(bS.length){b1=bS.pop();b0=b1;if(!bB.relative[b1]){b1=""}else{b0=bS.pop()}if(b0==null){b0=e}bB.relative[b1](b2,b0,bP)}}else{b2=bS=[]}}if(!b2){b2=bZ}if(!b2){bw.error(b1||bR)}if(bI.call(b2)==="[object Array]"){if(!bQ){bU.push.apply(bU,b2)}else{if(e&&e.nodeType===1){for(bT=0;b2[bT]!=null;bT++){if(b2[bT]&&(b2[bT]===true||b2[bT].nodeType===1&&bw.contains(e,b2[bT]))){bU.push(bZ[bT])}}}else{for(bT=0;b2[bT]!=null;bT++){if(b2[bT]&&b2[bT].nodeType===1){bU.push(bZ[bT])}}}}}else{bC(b2,bU)}if(bN){bw(bN,bX,bU,bV);bw.uniqueSort(bU)}return bU};bw.uniqueSort=function(bN){if(bH){bz=by;bN.sort(bH);if(bz){for(var e=1;e<bN.length;e++){if(bN[e]===bN[e-1]){bN.splice(e--,1)}}}}return bN};bw.matches=function(e,bN){return bw(e,null,null,bN)};bw.matchesSelector=function(e,bN){return bw(bN,null,null,[e]).length>0};bw.find=function(bT,e,bU){var bS;if(!bT){return[]}for(var bP=0,bO=bB.order.length;bP<bO;bP++){var bQ,bR=bB.order[bP];if((bQ=bB.leftMatch[bR].exec(bT))){var bN=bQ[1];bQ.splice(1,1);if(bN.substr(bN.length-1)!=="\\"){bQ[1]=(bQ[1]||"").replace(bG,"");bS=bB.find[bR](bQ,e,bU);if(bS!=null){bT=bT.replace(bB.match[bR],"");break}}}}if(!bS){bS=typeof e.getElementsByTagName!=="undefined"?e.getElementsByTagName("*"):[]}return{set:bS,expr:bT}};bw.filter=function(bX,bW,b0,bQ){var bS,e,bO=bX,b2=[],bU=bW,bT=bW&&bW[0]&&bw.isXML(bW[0]);while(bX&&bW.length){for(var bV in bB.filter){if((bS=bB.leftMatch[bV].exec(bX))!=null&&bS[2]){var b1,bZ,bN=bB.filter[bV],bP=bS[1];e=false;bS.splice(1,1);if(bP.substr(bP.length-1)==="\\"){continue}if(bU===b2){b2=[]}if(bB.preFilter[bV]){bS=bB.preFilter[bV](bS,bU,b0,b2,bQ,bT);if(!bS){e=b1=true}else{if(bS===true){continue}}}if(bS){for(var bR=0;(bZ=bU[bR])!=null;bR++){if(bZ){b1=bN(bZ,bS,bR,bU);var bY=bQ^!!b1;if(b0&&b1!=null){if(bY){e=true}else{bU[bR]=false}}else{if(bY){b2.push(bZ);e=true}}}}}if(b1!==N){if(!b0){bU=b2}bX=bX.replace(bB.match[bV],"");if(!e){return[]}break}}}if(bX===bO){if(e==null){bw.error(bX)}else{break}}bO=bX}return bU};bw.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var bB=bw.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(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(bS,bN){var bP=typeof bN==="string",bR=bP&&!bM.test(bN),bT=bP&&!bR;if(bR){bN=bN.toLowerCase()}for(var bO=0,e=bS.length,bQ;bO<e;bO++){if((bQ=bS[bO])){while((bQ=bQ.previousSibling)&&bQ.nodeType!==1){}bS[bO]=bT||bQ&&bQ.nodeName.toLowerCase()===bN?bQ||false:bQ===bN}}if(bT){bw.filter(bN,bS,true)}},">":function(bS,bN){var bR,bQ=typeof bN==="string",bO=0,e=bS.length;if(bQ&&!bM.test(bN)){bN=bN.toLowerCase();for(;bO<e;bO++){bR=bS[bO];if(bR){var bP=bR.parentNode;bS[bO]=bP.nodeName.toLowerCase()===bN?bP:false}}}else{for(;bO<e;bO++){bR=bS[bO];if(bR){bS[bO]=bQ?bR.parentNode:bR.parentNode===bN}}if(bQ){bw.filter(bN,bS,true)}}},"":function(bP,bN,bR){var bQ,bO=bF++,e=bK;if(typeof bN==="string"&&!bM.test(bN)){bN=bN.toLowerCase();bQ=bN;e=bu}e("parentNode",bN,bO,bP,bQ,bR)},"~":function(bP,bN,bR){var bQ,bO=bF++,e=bK;if(typeof bN==="string"&&!bM.test(bN)){bN=bN.toLowerCase();bQ=bN;e=bu}e("previousSibling",bN,bO,bP,bQ,bR)}},find:{ID:function(bN,bO,bP){if(typeof bO.getElementById!=="undefined"&&!bP){var e=bO.getElementById(bN[1]);return e&&e.parentNode?[e]:[]}},NAME:function(bO,bR){if(typeof bR.getElementsByName!=="undefined"){var bN=[],bQ=bR.getElementsByName(bO[1]);for(var bP=0,e=bQ.length;bP<e;bP++){if(bQ[bP].getAttribute("name")===bO[1]){bN.push(bQ[bP])}}return bN.length===0?null:bN}},TAG:function(e,bN){if(typeof bN.getElementsByTagName!=="undefined"){return bN.getElementsByTagName(e[1])}}},preFilter:{CLASS:function(bP,bN,bO,e,bS,bT){bP=" "+bP[1].replace(bG,"")+" ";if(bT){return bP}for(var bQ=0,bR;(bR=bN[bQ])!=null;bQ++){if(bR){if(bS^(bR.className&&(" "+bR.className+" ").replace(/[\t\n\r]/g," ").indexOf(bP)>=0)){if(!bO){e.push(bR)}}else{if(bO){bN[bQ]=false}}}}return false},ID:function(e){return e[1].replace(bG,"")},TAG:function(bN,e){return bN[1].replace(bG,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){bw.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var bN=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(bN[1]+(bN[2]||1))-0;e[3]=bN[3]-0}else{if(e[2]){bw.error(e[0])}}e[0]=bF++;return e},ATTR:function(bQ,bN,bO,e,bR,bS){var bP=bQ[1]=bQ[1].replace(bG,"");if(!bS&&bB.attrMap[bP]){bQ[1]=bB.attrMap[bP]}bQ[4]=(bQ[4]||bQ[5]||"").replace(bG,"");if(bQ[2]==="~="){bQ[4]=" "+bQ[4]+" "}return bQ},PSEUDO:function(bQ,bN,bO,e,bR){if(bQ[1]==="not"){if((bE.exec(bQ[3])||"").length>1||/^\w/.test(bQ[3])){bQ[3]=bw(bQ[3],null,null,bN)}else{var bP=bw.filter(bQ[3],bN,bO,true^bR);if(!bO){e.push.apply(e,bP)}return false}}else{if(bB.match.POS.test(bQ[0])||bB.match.CHILD.test(bQ[0])){return true}}return bQ},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(bO,bN,e){return !!bw(e[3],bO).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(bO){var e=bO.getAttribute("type"),bN=bO.type;return bO.nodeName.toLowerCase()==="input"&&"text"===bN&&(e===bN||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(bN){var e=bN.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===bN.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(bN){var e=bN.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===bN.type},button:function(bN){var e=bN.nodeName.toLowerCase();return e==="input"&&"button"===bN.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(bN,e){return e===0},last:function(bO,bN,e,bP){return bN===bP.length-1},even:function(bN,e){return e%2===0},odd:function(bN,e){return e%2===1},lt:function(bO,bN,e){return bN<e[3]-0},gt:function(bO,bN,e){return bN>e[3]-0},nth:function(bO,bN,e){return e[3]-0===bN},eq:function(bO,bN,e){return e[3]-0===bN}},filter:{PSEUDO:function(bO,bT,bS,bU){var e=bT[1],bN=bB.filters[e];if(bN){return bN(bO,bS,bT,bU)}else{if(e==="contains"){return(bO.textContent||bO.innerText||bw.getText([bO])||"").indexOf(bT[3])>=0}else{if(e==="not"){var bP=bT[3];for(var bR=0,bQ=bP.length;bR<bQ;bR++){if(bP[bR]===bO){return false}}return true}else{bw.error(e)}}}},CHILD:function(e,bP){var bS=bP[1],bN=e;switch(bS){case"only":case"first":while((bN=bN.previousSibling)){if(bN.nodeType===1){return false}}if(bS==="first"){return true}bN=e;case"last":while((bN=bN.nextSibling)){if(bN.nodeType===1){return false}}return true;case"nth":var bO=bP[2],bV=bP[3];if(bO===1&&bV===0){return true}var bR=bP[0],bU=e.parentNode;if(bU&&(bU.sizcache!==bR||!e.nodeIndex)){var bQ=0;for(bN=bU.firstChild;bN;bN=bN.nextSibling){if(bN.nodeType===1){bN.nodeIndex=++bQ}}bU.sizcache=bR}var bT=e.nodeIndex-bV;if(bO===0){return bT===0}else{return(bT%bO===0&&bT/bO>=0)}}},ID:function(bN,e){return bN.nodeType===1&&bN.getAttribute("id")===e},TAG:function(bN,e){return(e==="*"&&bN.nodeType===1)||bN.nodeName.toLowerCase()===e},CLASS:function(bN,e){return(" "+(bN.className||bN.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(bR,bP){var bO=bP[1],e=bB.attrHandle[bO]?bB.attrHandle[bO](bR):bR[bO]!=null?bR[bO]:bR.getAttribute(bO),bS=e+"",bQ=bP[2],bN=bP[4];return e==null?bQ==="!=":bQ==="="?bS===bN:bQ==="*="?bS.indexOf(bN)>=0:bQ==="~="?(" "+bS+" ").indexOf(bN)>=0:!bN?bS&&e!==false:bQ==="!="?bS!==bN:bQ==="^="?bS.indexOf(bN)===0:bQ==="$="?bS.substr(bS.length-bN.length)===bN:bQ==="|="?bS===bN||bS.substr(0,bN.length+1)===bN+"-":false},POS:function(bQ,bN,bO,bR){var e=bN[2],bP=bB.setFilters[e];if(bP){return bP(bQ,bO,bN,bR)}}}};var bA=bB.match.POS,bv=function(bN,e){return"\\"+(e-0+1)};for(var bx in bB.match){bB.match[bx]=new RegExp(bB.match[bx].source+(/(?![^\[]*\])(?![^\(]*\))/.source));bB.leftMatch[bx]=new RegExp(/(^(?:.|\r|\n)*?)/.source+bB.match[bx].source.replace(/\\(\d+)/g,bv))}var bC=function(bN,e){bN=Array.prototype.slice.call(bN,0);if(e){e.push.apply(e,bN);return e}return bN};try{Array.prototype.slice.call(at.documentElement.childNodes,0)[0].nodeType}catch(bL){bC=function(bQ,bP){var bO=0,bN=bP||[];if(bI.call(bQ)==="[object Array]"){Array.prototype.push.apply(bN,bQ)}else{if(typeof bQ.length==="number"){for(var e=bQ.length;bO<e;bO++){bN.push(bQ[bO])}}else{for(;bQ[bO];bO++){bN.push(bQ[bO])}}}return bN}}var bH,bD;if(at.documentElement.compareDocumentPosition){bH=function(bN,e){if(bN===e){bz=true;return 0}if(!bN.compareDocumentPosition||!e.compareDocumentPosition){return bN.compareDocumentPosition?-1:1}return bN.compareDocumentPosition(e)&4?-1:1}}else{bH=function(bU,bT){if(bU===bT){bz=true;return 0}else{if(bU.sourceIndex&&bT.sourceIndex){return bU.sourceIndex-bT.sourceIndex}}var bR,bN,bO=[],e=[],bQ=bU.parentNode,bS=bT.parentNode,bV=bQ;if(bQ===bS){return bD(bU,bT)}else{if(!bQ){return -1}else{if(!bS){return 1}}}while(bV){bO.unshift(bV);bV=bV.parentNode}bV=bS;while(bV){e.unshift(bV);bV=bV.parentNode}bR=bO.length;bN=e.length;for(var bP=0;bP<bR&&bP<bN;bP++){if(bO[bP]!==e[bP]){return bD(bO[bP],e[bP])}}return bP===bR?bD(bU,e[bP],-1):bD(bO[bP],bT,1)};bD=function(bN,e,bO){if(bN===e){return bO}var bP=bN.nextSibling;while(bP){if(bP===e){return -1}bP=bP.nextSibling}return 1}}bw.getText=function(e){var bN="",bP;for(var bO=0;e[bO];bO++){bP=e[bO];if(bP.nodeType===3||bP.nodeType===4){bN+=bP.nodeValue}else{if(bP.nodeType!==8){bN+=bw.getText(bP.childNodes)}}}return bN};(function(){var bN=at.createElement("div"),bO="script"+(new Date()).getTime(),e=at.documentElement;bN.innerHTML="<a name='"+bO+"'/>";e.insertBefore(bN,e.firstChild);if(at.getElementById(bO)){bB.find.ID=function(bQ,bR,bS){if(typeof bR.getElementById!=="undefined"&&!bS){var bP=bR.getElementById(bQ[1]);return bP?bP.id===bQ[1]||typeof bP.getAttributeNode!=="undefined"&&bP.getAttributeNode("id").nodeValue===bQ[1]?[bP]:N:[]}};bB.filter.ID=function(bR,bP){var bQ=typeof bR.getAttributeNode!=="undefined"&&bR.getAttributeNode("id");return bR.nodeType===1&&bQ&&bQ.nodeValue===bP}}e.removeChild(bN);e=bN=null})();(function(){var e=at.createElement("div");e.appendChild(at.createComment(""));if(e.getElementsByTagName("*").length>0){bB.find.TAG=function(bN,bR){var bQ=bR.getElementsByTagName(bN[1]);if(bN[1]==="*"){var bP=[];for(var bO=0;bQ[bO];bO++){if(bQ[bO].nodeType===1){bP.push(bQ[bO])}}bQ=bP}return bQ}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){bB.attrHandle.href=function(bN){return bN.getAttribute("href",2)}}e=null})();if(at.querySelectorAll){(function(){var e=bw,bP=at.createElement("div"),bO="__sizzle__";bP.innerHTML="<p class='TEST'></p>";if(bP.querySelectorAll&&bP.querySelectorAll(".TEST").length===0){return}bw=function(b0,bR,bV,bZ){bR=bR||at;if(!bZ&&!bw.isXML(bR)){var bY=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b0);if(bY&&(bR.nodeType===1||bR.nodeType===9)){if(bY[1]){return bC(bR.getElementsByTagName(b0),bV)}else{if(bY[2]&&bB.find.CLASS&&bR.getElementsByClassName){return bC(bR.getElementsByClassName(bY[2]),bV)}}}if(bR.nodeType===9){if(b0==="body"&&bR.body){return bC([bR.body],bV)}else{if(bY&&bY[3]){var bU=bR.getElementById(bY[3]);if(bU&&bU.parentNode){if(bU.id===bY[3]){return bC([bU],bV)}}else{return bC([],bV)}}}try{return bC(bR.querySelectorAll(b0),bV)}catch(bW){}}else{if(bR.nodeType===1&&bR.nodeName.toLowerCase()!=="object"){var bS=bR,bT=bR.getAttribute("id"),bQ=bT||bO,b2=bR.parentNode,b1=/^\s*[+~]/.test(b0);if(!bT){bR.setAttribute("id",bQ)}else{bQ=bQ.replace(/'/g,"\\$&")}if(b1&&b2){bR=bR.parentNode}try{if(!b1||b2){return bC(bR.querySelectorAll("[id='"+bQ+"'] "+b0),bV)}}catch(bX){}finally{if(!bT){bS.removeAttribute("id")}}}}}return e(b0,bR,bV,bZ)};for(var bN in e){bw[bN]=e[bN]}bP=null})()}(function(){var e=at.documentElement,bO=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(bO){var bQ=!bO.call(at.createElement("div"),"div"),bN=false;try{bO.call(at.documentElement,"[test!='']:sizzle")}catch(bP){bN=true}bw.matchesSelector=function(bS,bU){bU=bU.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!bw.isXML(bS)){try{if(bN||!bB.match.PSEUDO.test(bU)&&!/!=/.test(bU)){var bR=bO.call(bS,bU);if(bR||!bQ||bS.document&&bS.document.nodeType!==11){return bR}}}catch(bT){}}return bw(bU,null,null,[bS]).length>0}}})();(function(){var e=at.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}bB.order.splice(1,0,"CLASS");bB.find.CLASS=function(bN,bO,bP){if(typeof bO.getElementsByClassName!=="undefined"&&!bP){return bO.getElementsByClassName(bN[1])}};e=null})();function bu(bN,bS,bR,bV,bT,bU){for(var bP=0,bO=bV.length;bP<bO;bP++){var e=bV[bP];if(e){var bQ=false;e=e[bN];while(e){if(e.sizcache===bR){bQ=bV[e.sizset];break}if(e.nodeType===1&&!bU){e.sizcache=bR;e.sizset=bP}if(e.nodeName.toLowerCase()===bS){bQ=e;break}e=e[bN]}bV[bP]=bQ}}}function bK(bN,bS,bR,bV,bT,bU){for(var bP=0,bO=bV.length;bP<bO;bP++){var e=bV[bP];if(e){var bQ=false;e=e[bN];while(e){if(e.sizcache===bR){bQ=bV[e.sizset];break}if(e.nodeType===1){if(!bU){e.sizcache=bR;e.sizset=bP}if(typeof bS!=="string"){if(e===bS){bQ=true;break}}else{if(bw.filter(bS,[e]).length>0){bQ=e;break}}}e=e[bN]}bV[bP]=bQ}}}if(at.documentElement.contains){bw.contains=function(bN,e){return bN!==e&&(bN.contains?bN.contains(e):true)}}else{if(at.documentElement.compareDocumentPosition){bw.contains=function(bN,e){return !!(bN.compareDocumentPosition(e)&16)}}else{bw.contains=function(){return false}}}bw.isXML=function(e){var bN=(e?e.ownerDocument||e:0).documentElement;return bN?bN.nodeName!=="HTML":false};var bJ=function(e,bT){var bR,bP=[],bQ="",bO=bT.nodeType?[bT]:bT;while((bR=bB.match.PSEUDO.exec(e))){bQ+=bR[0];e=e.replace(bB.match.PSEUDO,"")}e=bB.relative[e]?e+"*":e;for(var bS=0,bN=bO.length;bS<bN;bS++){bw(e,bO[bS],bP)}return bw.filter(bQ,bP)};b.find=bw;b.expr=bw.selectors;b.expr[":"]=b.expr.filters;b.unique=bw.uniqueSort;b.text=bw.getText;b.isXMLDoc=bw.isXML;b.contains=bw.contains})();var aa=/Until$/,ao=/^(?:parents|prevUntil|prevAll)/,a8=/,/,bp=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,K=b.expr.match.POS,aw={children:true,contents:true,next:true,prev:true};b.fn.extend({find:function(e){var bv=this,bx,bu;if(typeof e!=="string"){return b(e).filter(function(){for(bx=0,bu=bv.length;bx<bu;bx++){if(b.contains(bv[bx],this)){return true}}})}var bw=this.pushStack("","find",e),bz,bA,by;for(bx=0,bu=this.length;bx<bu;bx++){bz=bw.length;b.find(e,this[bx],bw);if(bx>0){for(bA=bz;bA<bw.length;bA++){for(by=0;by<bz;by++){if(bw[by]===bw[bA]){bw.splice(bA--,1);break}}}}}return bw},has:function(bu){var e=b(bu);return this.filter(function(){for(var bw=0,bv=e.length;bw<bv;bw++){if(b.contains(this,e[bw])){return true}}})},not:function(e){return this.pushStack(aD(this,e,false),"not",e)},filter:function(e){return this.pushStack(aD(this,e,true),"filter",e)},is:function(e){return !!e&&(typeof e==="string"?b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(bD,bu){var bA=[],bx,bv,bC=this[0];if(b.isArray(bD)){var bz,bw,by={},e=1;if(bC&&bD.length){for(bx=0,bv=bD.length;bx<bv;bx++){bw=bD[bx];if(!by[bw]){by[bw]=K.test(bw)?b(bw,bu||this.context):bw}}while(bC&&bC.ownerDocument&&bC!==bu){for(bw in by){bz=by[bw];if(bz.jquery?bz.index(bC)>-1:b(bC).is(bz)){bA.push({selector:bw,elem:bC,level:e})}}bC=bC.parentNode;e++}}return bA}var bB=K.test(bD)||typeof bD!=="string"?b(bD,bu||this.context):0;for(bx=0,bv=this.length;bx<bv;bx++){bC=this[bx];while(bC){if(bB?bB.index(bC)>-1:b.find.matchesSelector(bC,bD)){bA.push(bC);break}else{bC=bC.parentNode;if(!bC||!bC.ownerDocument||bC===bu||bC.nodeType===11){break}}}}bA=bA.length>1?b.unique(bA):bA;return this.pushStack(bA,"closest",bD)},index:function(e){if(!e){return(this[0]&&this[0].parentNode)?this.prevAll().length:-1}if(typeof e==="string"){return b.inArray(this[0],b(e))}return b.inArray(e.jquery?e[0]:e,this)},add:function(e,bu){var bw=typeof e==="string"?b(e,bu):b.makeArray(e&&e.nodeType?[e]:e),bv=b.merge(this.get(),bw);return this.pushStack(F(bw[0])||F(bv[0])?bv:b.unique(bv))},andSelf:function(){return this.add(this.prevObject)}});function F(e){return !e||!e.parentNode||e.parentNode.nodeType===11}b.each({parent:function(bu){var e=bu.parentNode;return e&&e.nodeType!==11?e:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(bu,e,bv){return b.dir(bu,"parentNode",bv)},next:function(e){return b.nth(e,2,"nextSibling")},prev:function(e){return b.nth(e,2,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(bu,e,bv){return b.dir(bu,"nextSibling",bv)},prevUntil:function(bu,e,bv){return b.dir(bu,"previousSibling",bv)},siblings:function(e){return b.sibling(e.parentNode.firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.makeArray(e.childNodes)}},function(e,bu){b.fn[e]=function(by,bv){var bx=b.map(this,bu,by),bw=S.call(arguments);if(!aa.test(e)){bv=by}if(bv&&typeof bv==="string"){bx=b.filter(bv,bx)}bx=this.length>1&&!aw[e]?b.unique(bx):bx;if((this.length>1||a8.test(bv))&&ao.test(e)){bx=bx.reverse()}return this.pushStack(bx,e,bw.join(","))}});b.extend({filter:function(bv,e,bu){if(bu){bv=":not("+bv+")"}return e.length===1?b.find.matchesSelector(e[0],bv)?[e[0]]:[]:b.find.matches(bv,e)},dir:function(bv,bu,bx){var e=[],bw=bv[bu];while(bw&&bw.nodeType!==9&&(bx===N||bw.nodeType!==1||!b(bw).is(bx))){if(bw.nodeType===1){e.push(bw)}bw=bw[bu]}return e},nth:function(bx,e,bv,bw){e=e||1;var bu=0;for(;bx;bx=bx[bv]){if(bx.nodeType===1&&++bu===e){break}}return bx},sibling:function(bv,bu){var e=[];for(;bv;bv=bv.nextSibling){if(bv.nodeType===1&&bv!==bu){e.push(bv)}}return e}});function aD(bw,bv,e){bv=bv||0;if(b.isFunction(bv)){return b.grep(bw,function(by,bx){var bz=!!bv.call(by,bx,by);return bz===e})}else{if(bv.nodeType){return b.grep(bw,function(by,bx){return(by===bv)===e})}else{if(typeof bv==="string"){var bu=b.grep(bw,function(bx){return bx.nodeType===1});if(bp.test(bv)){return b.filter(bv,bu,!e)}else{bv=b.filter(bv,bu)}}}}return b.grep(bw,function(by,bx){return(b.inArray(by,bv)>=0)===e})}var af=/ jQuery\d+="(?:\d+|null)"/g,ap=/^\s+/,U=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/<([\w:]+)/,z=/<tbody/i,X=/<|&#?\w+;/,R=/<(?:script|object|embed|option|style)/i,p=/checked\s*(?:[^=]|=\s*.checked.)/i,bl=/\/(java|ecma)script/i,aL=/^\s*<!(?:\[CDATA\[|\-\-)/,av={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,"",""]};av.optgroup=av.option;av.tbody=av.tfoot=av.colgroup=av.caption=av.thead;av.th=av.td;if(!b.support.htmlSerialize){av._default=[1,"div<div>","</div>"]}b.fn.extend({text:function(e){if(b.isFunction(e)){return this.each(function(bv){var bu=b(this);bu.text(e.call(this,bv,bu.text()))})}if(typeof e!=="object"&&e!==N){return this.empty().append((this[0]&&this[0].ownerDocument||at).createTextNode(e))}return b.text(this)},wrapAll:function(e){if(b.isFunction(e)){return this.each(function(bv){b(this).wrapAll(e.call(this,bv))})}if(this[0]){var bu=b(e,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){bu.insertBefore(this[0])}bu.map(function(){var bv=this;while(bv.firstChild&&bv.firstChild.nodeType===1){bv=bv.firstChild}return bv}).append(this)}return this},wrapInner:function(e){if(b.isFunction(e)){return this.each(function(bu){b(this).wrapInner(e.call(this,bu))})}return this.each(function(){var bu=b(this),bv=bu.contents();if(bv.length){bv.wrapAll(e)}else{bu.append(e)}})},wrap:function(e){return this.each(function(){b(this).wrapAll(e)})},unwrap:function(){return this.parent().each(function(){if(!b.nodeName(this,"body")){b(this).replaceWith(this.childNodes)}}).end()},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType===1){this.insertBefore(e,this.firstChild)}})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bu){this.parentNode.insertBefore(bu,this)})}else{if(arguments.length){var e=b(arguments[0]);e.push.apply(e,this.toArray());return this.pushStack(e,"before",arguments)}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(bu){this.parentNode.insertBefore(bu,this.nextSibling)})}else{if(arguments.length){var e=this.pushStack(this,"after",arguments);e.push.apply(e,b(arguments[0]).toArray());return e}}},remove:function(e,bw){for(var bu=0,bv;(bv=this[bu])!=null;bu++){if(!e||b.filter(e,[bv]).length){if(!bw&&bv.nodeType===1){b.cleanData(bv.getElementsByTagName("*"));b.cleanData([bv])}if(bv.parentNode){bv.parentNode.removeChild(bv)}}}return this},empty:function(){for(var e=0,bu;(bu=this[e])!=null;e++){if(bu.nodeType===1){b.cleanData(bu.getElementsByTagName("*"))}while(bu.firstChild){bu.removeChild(bu.firstChild)}}return this},clone:function(bu,e){bu=bu==null?false:bu;e=e==null?bu:e;return this.map(function(){return b.clone(this,bu,e)})},html:function(bw){if(bw===N){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(af,""):null}else{if(typeof bw==="string"&&!R.test(bw)&&(b.support.leadingWhitespace||!ap.test(bw))&&!av[(d.exec(bw)||["",""])[1].toLowerCase()]){bw=bw.replace(U,"<$1></$2>");try{for(var bv=0,bu=this.length;bv<bu;bv++){if(this[bv].nodeType===1){b.cleanData(this[bv].getElementsByTagName("*"));this[bv].innerHTML=bw}}}catch(bx){this.empty().append(bw)}}else{if(b.isFunction(bw)){this.each(function(by){var e=b(this);e.html(bw.call(this,by,e.html()))})}else{this.empty().append(bw)}}}return this},replaceWith:function(e){if(this[0]&&this[0].parentNode){if(b.isFunction(e)){return this.each(function(bw){var bv=b(this),bu=bv.html();bv.replaceWith(e.call(this,bw,bu))})}if(typeof e!=="string"){e=b(e).detach()}return this.each(function(){var bv=this.nextSibling,bu=this.parentNode;b(this).remove();if(bv){b(bv).before(e)}else{b(bu).append(e)}})}else{return this.length?this.pushStack(b(b.isFunction(e)?e():e),"replaceWith",e):this}},detach:function(e){return this.remove(e,true)},domManip:function(bA,bE,bD){var bw,bx,bz,bC,bB=bA[0],bu=[];if(!b.support.checkClone&&arguments.length===3&&typeof bB==="string"&&p.test(bB)){return this.each(function(){b(this).domManip(bA,bE,bD,true)})}if(b.isFunction(bB)){return this.each(function(bG){var bF=b(this);bA[0]=bB.call(this,bG,bE?bF.html():N);bF.domManip(bA,bE,bD)})}if(this[0]){bC=bB&&bB.parentNode;if(b.support.parentNode&&bC&&bC.nodeType===11&&bC.childNodes.length===this.length){bw={fragment:bC}}else{bw=b.buildFragment(bA,this,bu)}bz=bw.fragment;if(bz.childNodes.length===1){bx=bz=bz.firstChild}else{bx=bz.firstChild}if(bx){bE=bE&&b.nodeName(bx,"tr");for(var bv=0,e=this.length,by=e-1;bv<e;bv++){bD.call(bE?a9(this[bv],bx):this[bv],bw.cacheable||(e>1&&bv<by)?b.clone(bz,true,true):bz)}}if(bu.length){b.each(bu,bo)}}return this}});function a9(e,bu){return b.nodeName(e,"table")?(e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody"))):e}function w(e,bA){if(bA.nodeType!==1||!b.hasData(e)){return}var bz=b.expando,bw=b.data(e),bx=b.data(bA,bw);if((bw=bw[bz])){var bB=bw.events;bx=bx[bz]=b.extend({},bw);if(bB){delete bx.handle;bx.events={};for(var by in bB){for(var bv=0,bu=bB[by].length;bv<bu;bv++){b.event.add(bA,by+(bB[by][bv].namespace?".":"")+bB[by][bv].namespace,bB[by][bv],bB[by][bv].data)}}}}}function ag(bu,e){var bv;if(e.nodeType!==1){return}if(e.clearAttributes){e.clearAttributes()}if(e.mergeAttributes){e.mergeAttributes(bu)}bv=e.nodeName.toLowerCase();if(bv==="object"){e.outerHTML=bu.outerHTML}else{if(bv==="input"&&(bu.type==="checkbox"||bu.type==="radio")){if(bu.checked){e.defaultChecked=e.checked=bu.checked}if(e.value!==bu.value){e.value=bu.value}}else{if(bv==="option"){e.selected=bu.defaultSelected}else{if(bv==="input"||bv==="textarea"){e.defaultValue=bu.defaultValue}}}}e.removeAttribute(b.expando)}b.buildFragment=function(by,bw,bu){var bx,e,bv,bz;if(bw&&bw[0]){bz=bw[0].ownerDocument||bw[0]}if(!bz.createDocumentFragment){bz=at}if(by.length===1&&typeof by[0]==="string"&&by[0].length<512&&bz===at&&by[0].charAt(0)==="<"&&!R.test(by[0])&&(b.support.checkClone||!p.test(by[0]))){e=true;bv=b.fragments[by[0]];if(bv&&bv!==1){bx=bv}}if(!bx){bx=bz.createDocumentFragment();b.clean(by,bz,bx,bu)}if(e){b.fragments[by[0]]=bv?bx:1}return{fragment:bx,cacheable:e}};b.fragments={};b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,bu){b.fn[e]=function(bv){var by=[],bB=b(bv),bA=this.length===1&&this[0].parentNode;if(bA&&bA.nodeType===11&&bA.childNodes.length===1&&bB.length===1){bB[bu](this[0]);return this}else{for(var bz=0,bw=bB.length;bz<bw;bz++){var bx=(bz>0?this.clone(true):this).get();b(bB[bz])[bu](bx);by=by.concat(bx)}return this.pushStack(by,e,bB.selector)}}});function be(e){if("getElementsByTagName" in e){return e.getElementsByTagName("*")}else{if("querySelectorAll" in e){return e.querySelectorAll("*")}else{return[]}}}function ax(e){if(e.type==="checkbox"||e.type==="radio"){e.defaultChecked=e.checked}}function H(e){if(b.nodeName(e,"input")){ax(e)}else{if("getElementsByTagName" in e){b.grep(e.getElementsByTagName("input"),ax)}}}b.extend({clone:function(bx,bz,bv){var by=bx.cloneNode(true),e,bu,bw;if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(bx.nodeType===1||bx.nodeType===11)&&!b.isXMLDoc(bx)){ag(bx,by);e=be(bx);bu=be(by);for(bw=0;e[bw];++bw){if(bu[bw]){ag(e[bw],bu[bw])}}}if(bz){w(bx,by);if(bv){e=be(bx);bu=be(by);for(bw=0;e[bw];++bw){w(e[bw],bu[bw])}}}e=bu=null;return by},clean:function(bv,bx,bG,bz){var bE;bx=bx||at;if(typeof bx.createElement==="undefined"){bx=bx.ownerDocument||bx[0]&&bx[0].ownerDocument||at}var bH=[],bA;for(var bD=0,by;(by=bv[bD])!=null;bD++){if(typeof by==="number"){by+=""}if(!by){continue}if(typeof by==="string"){if(!X.test(by)){by=bx.createTextNode(by)}else{by=by.replace(U,"<$1></$2>");var bJ=(d.exec(by)||["",""])[1].toLowerCase(),bw=av[bJ]||av._default,bC=bw[0],bu=bx.createElement("div");bu.innerHTML=bw[1]+by+bw[2];while(bC--){bu=bu.lastChild}if(!b.support.tbody){var e=z.test(by),bB=bJ==="table"&&!e?bu.firstChild&&bu.firstChild.childNodes:bw[1]==="<table>"&&!e?bu.childNodes:[];for(bA=bB.length-1;bA>=0;--bA){if(b.nodeName(bB[bA],"tbody")&&!bB[bA].childNodes.length){bB[bA].parentNode.removeChild(bB[bA])}}}if(!b.support.leadingWhitespace&&ap.test(by)){bu.insertBefore(bx.createTextNode(ap.exec(by)[0]),bu.firstChild)}by=bu.childNodes}}var bF;if(!b.support.appendChecked){if(by[0]&&typeof(bF=by.length)==="number"){for(bA=0;bA<bF;bA++){H(by[bA])}}else{H(by)}}if(by.nodeType){bH.push(by)}else{bH=b.merge(bH,by)}}if(bG){bE=function(bK){return !bK.type||bl.test(bK.type)};for(bD=0;bH[bD];bD++){if(bz&&b.nodeName(bH[bD],"script")&&(!bH[bD].type||bH[bD].type.toLowerCase()==="text/javascript")){bz.push(bH[bD].parentNode?bH[bD].parentNode.removeChild(bH[bD]):bH[bD])}else{if(bH[bD].nodeType===1){var bI=b.grep(bH[bD].getElementsByTagName("script"),bE);bH.splice.apply(bH,[bD+1,0].concat(bI))}bG.appendChild(bH[bD])}}}return bH},cleanData:function(bu){var bx,bv,e=b.cache,bC=b.expando,bA=b.event.special,bz=b.support.deleteExpando;for(var by=0,bw;(bw=bu[by])!=null;by++){if(bw.nodeName&&b.noData[bw.nodeName.toLowerCase()]){continue}bv=bw[b.expando];if(bv){bx=e[bv]&&e[bv][bC];if(bx&&bx.events){for(var bB in bx.events){if(bA[bB]){b.event.remove(bw,bB)}else{b.removeEvent(bw,bB,bx.handle)}}if(bx.handle){bx.handle.elem=null}}if(bz){delete bw[b.expando]}else{if(bw.removeAttribute){bw.removeAttribute(b.expando)}}delete e[bv]}}}});function bo(e,bu){if(bu.src){b.ajax({url:bu.src,async:false,dataType:"script"})}else{b.globalEval((bu.text||bu.textContent||bu.innerHTML||"").replace(aL,"/*$0*/"))}if(bu.parentNode){bu.parentNode.removeChild(bu)}}var ai=/alpha\([^)]*\)/i,ar=/opacity=([^)]*)/,C=/([A-Z]|^ms)/g,bb=/^-?\d+(?:px)?$/i,bn=/^-?\d/,L=/^([\-+])=([\-+.\de]+)/,a6={position:"absolute",visibility:"hidden",display:"block"},al=["Left","Right"],a1=["Top","Bottom"],Y,aG,aV;b.fn.css=function(e,bu){if(arguments.length===2&&bu===N){return this}return b.access(this,e,bu,true,function(bw,bv,bx){return bx!==N?b.style(bw,bv,bx):b.css(bw,bv)})};b.extend({cssHooks:{opacity:{get:function(bv,bu){if(bu){var e=Y(bv,"opacity","opacity");return e===""?"1":e}else{return bv.style.opacity}}}},cssNumber:{fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(bw,bv,bC,bx){if(!bw||bw.nodeType===3||bw.nodeType===8||!bw.style){return}var bA,bB,by=b.camelCase(bv),bu=bw.style,bD=b.cssHooks[by];bv=b.cssProps[by]||by;if(bC!==N){bB=typeof bC;if(bB==="string"&&(bA=L.exec(bC))){bC=(+(bA[1]+1)*+bA[2])+parseFloat(b.css(bw,bv));bB="number"}if(bC==null||bB==="number"&&isNaN(bC)){return}if(bB==="number"&&!b.cssNumber[by]){bC+="px"}if(!bD||!("set" in bD)||(bC=bD.set(bw,bC))!==N){try{bu[bv]=bC}catch(bz){}}}else{if(bD&&"get" in bD&&(bA=bD.get(bw,false,bx))!==N){return bA}return bu[bv]}},css:function(bx,bw,bu){var bv,e;bw=b.camelCase(bw);e=b.cssHooks[bw];bw=b.cssProps[bw]||bw;if(bw==="cssFloat"){bw="float"}if(e&&"get" in e&&(bv=e.get(bx,true,bu))!==N){return bv}else{if(Y){return Y(bx,bw)}}},swap:function(bw,bv,bx){var e={};for(var bu in bv){e[bu]=bw.style[bu];bw.style[bu]=bv[bu]}bx.call(bw);for(bu in bv){bw.style[bu]=e[bu]}}});b.curCSS=b.css;b.each(["height","width"],function(bu,e){b.cssHooks[e]={get:function(bx,bw,bv){var by;if(bw){if(bx.offsetWidth!==0){return q(bx,e,bv)}else{b.swap(bx,a6,function(){by=q(bx,e,bv)})}return by}},set:function(bv,bw){if(bb.test(bw)){bw=parseFloat(bw);if(bw>=0){return bw+"px"}}else{return bw}}}});if(!b.support.opacity){b.cssHooks.opacity={get:function(bu,e){return ar.test((e&&bu.currentStyle?bu.currentStyle.filter:bu.style.filter)||"")?(parseFloat(RegExp.$1)/100)+"":e?"1":""},set:function(bx,by){var bw=bx.style,bu=bx.currentStyle,e=b.isNaN(by)?"":"alpha(opacity="+by*100+")",bv=bu&&bu.filter||bw.filter||"";bw.zoom=1;if(by>=1&&b.trim(bv.replace(ai,""))===""){bw.removeAttribute("filter");if(bu&&!bu.filter){return}}bw.filter=ai.test(bv)?bv.replace(ai,e):bv+" "+e}}}b(function(){if(!b.support.reliableMarginRight){b.cssHooks.marginRight={get:function(bv,bu){var e;b.swap(bv,{display:"inline-block"},function(){if(bu){e=Y(bv,"margin-right","marginRight")}else{e=bv.style.marginRight}});return e}}}});if(at.defaultView&&at.defaultView.getComputedStyle){aG=function(bx,bv){var bu,bw,e;bv=bv.replace(C,"-$1").toLowerCase();if(!(bw=bx.ownerDocument.defaultView)){return N}if((e=bw.getComputedStyle(bx,null))){bu=e.getPropertyValue(bv);if(bu===""&&!b.contains(bx.ownerDocument.documentElement,bx)){bu=b.style(bx,bv)}}return bu}}if(at.documentElement.currentStyle){aV=function(bx,bv){var by,bu=bx.currentStyle&&bx.currentStyle[bv],e=bx.runtimeStyle&&bx.runtimeStyle[bv],bw=bx.style;if(!bb.test(bu)&&bn.test(bu)){by=bw.left;if(e){bx.runtimeStyle.left=bx.currentStyle.left}bw.left=bv==="fontSize"?"1em":(bu||0);bu=bw.pixelLeft+"px";bw.left=by;if(e){bx.runtimeStyle.left=e}}return bu===""?"auto":bu}}Y=aG||aV;function q(bv,bu,e){var bx=bu==="width"?bv.offsetWidth:bv.offsetHeight,bw=bu==="width"?al:a1;if(bx>0){if(e!=="border"){b.each(bw,function(){if(!e){bx-=parseFloat(b.css(bv,"padding"+this))||0}if(e==="margin"){bx+=parseFloat(b.css(bv,e+this))||0}else{bx-=parseFloat(b.css(bv,"border"+this+"Width"))||0}})}return bx+"px"}bx=Y(bv,bu,bu);if(bx<0||bx==null){bx=bv.style[bu]||0}bx=parseFloat(bx)||0;if(e){b.each(bw,function(){bx+=parseFloat(b.css(bv,"padding"+this))||0;if(e!=="padding"){bx+=parseFloat(b.css(bv,"border"+this+"Width"))||0}if(e==="margin"){bx+=parseFloat(b.css(bv,e+this))||0}})}return bx+"px"}if(b.expr&&b.expr.filters){b.expr.filters.hidden=function(bv){var bu=bv.offsetWidth,e=bv.offsetHeight;return(bu===0&&e===0)||(!b.support.reliableHiddenOffsets&&(bv.style.display||b.css(bv,"display"))==="none")};b.expr.filters.visible=function(e){return !b.expr.filters.hidden(e)}}var l=/%20/g,an=/\[\]$/,bs=/\r?\n/g,bq=/#.*$/,aB=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,aY=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,aK=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,aN=/^(?:GET|HEAD)$/,c=/^\/\//,O=/\?/,a5=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,s=/^(?:select|textarea)/i,h=/\s+/,br=/([?&])_=[^&]*/,M=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,D=b.fn.load,Z={},u={},aC,v,aR=["*/"]+["*"];try{aC=bk.href}catch(au){aC=at.createElement("a");aC.href="";aC=aC.href}v=M.exec(aC.toLowerCase())||[];function f(e){return function(bx,bz){if(typeof bx!=="string"){bz=bx;bx="*"}if(b.isFunction(bz)){var bw=bx.toLowerCase().split(h),bv=0,by=bw.length,bu,bA,bB;for(;bv<by;bv++){bu=bw[bv];bB=/^\+/.test(bu);if(bB){bu=bu.substr(1)||"*"}bA=e[bu]=e[bu]||[];bA[bB?"unshift":"push"](bz)}}}}function aT(bu,bD,by,bC,bA,bw){bA=bA||bD.dataTypes[0];bw=bw||{};bw[bA]=true;var bz=bu[bA],bv=0,e=bz?bz.length:0,bx=(bu===Z),bB;for(;bv<e&&(bx||!bB);bv++){bB=bz[bv](bD,by,bC);if(typeof bB==="string"){if(!bx||bw[bB]){bB=N}else{bD.dataTypes.unshift(bB);bB=aT(bu,bD,by,bC,bB,bw)}}}if((bx||!bB)&&!bw["*"]){bB=aT(bu,bD,by,bC,"*",bw)}return bB}function ak(bv,bw){var bu,e,bx=b.ajaxSettings.flatOptions||{};for(bu in bw){if(bw[bu]!==N){(bx[bu]?bv:(e||(e={})))[bu]=bw[bu]}}if(e){b.extend(true,bv,e)}}b.fn.extend({load:function(bv,by,bz){if(typeof bv!=="string"&&D){return D.apply(this,arguments)}else{if(!this.length){return this}}var bx=bv.indexOf(" ");if(bx>=0){var e=bv.slice(bx,bv.length);bv=bv.slice(0,bx)}var bw="GET";if(by){if(b.isFunction(by)){bz=by;by=N}else{if(typeof by==="object"){by=b.param(by,b.ajaxSettings.traditional);bw="POST"}}}var bu=this;b.ajax({url:bv,type:bw,dataType:"html",data:by,complete:function(bB,bA,bC){bC=bB.responseText;if(bB.isResolved()){bB.done(function(bD){bC=bD});bu.html(e?b("<div>").append(bC.replace(a5,"")).find(e):bC)}if(bz){bu.each(bz,[bC,bA,bB])}}});return this},serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?b.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||s.test(this.nodeName)||aY.test(this.type))}).map(function(e,bu){var bv=b(this).val();return bv==null?null:b.isArray(bv)?b.map(bv,function(bx,bw){return{name:bu.name,value:bx.replace(bs,"\r\n")}}):{name:bu.name,value:bv.replace(bs,"\r\n")}}).get()}});b.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,bu){b.fn[bu]=function(bv){return this.bind(bu,bv)}});b.each(["get","post"],function(e,bu){b[bu]=function(bv,bx,by,bw){if(b.isFunction(bx)){bw=bw||by;by=bx;bx=N}return b.ajax({type:bu,url:bv,data:bx,success:by,dataType:bw})}});b.extend({getScript:function(e,bu){return b.get(e,N,bu,"script")},getJSON:function(e,bu,bv){return b.get(e,bu,bv,"json")},ajaxSetup:function(bu,e){if(e){ak(bu,b.ajaxSettings)}else{e=bu;bu=b.ajaxSettings}ak(bu,e);return bu},ajaxSettings:{url:aC,isLocal:aK.test(v[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":aR},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":ba.String,"text html":true,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{context:true,url:true}},ajaxPrefilter:f(Z),ajaxTransport:f(u),ajax:function(by,bw){if(typeof by==="object"){bw=by;by=N}bw=bw||{};var bC=b.ajaxSetup({},bw),bR=bC.context||bC,bF=bR!==bC&&(bR.nodeType||bR instanceof b)?b(bR):b.event,bQ=b.Deferred(),bM=b._Deferred(),bA=bC.statusCode||{},bB,bG={},bN={},bP,bx,bK,bD,bH,bz=0,bv,bJ,bI={readyState:0,setRequestHeader:function(bS,bT){if(!bz){var e=bS.toLowerCase();bS=bN[e]=bN[e]||bS;bG[bS]=bT}return this},getAllResponseHeaders:function(){return bz===2?bP:null},getResponseHeader:function(bS){var e;if(bz===2){if(!bx){bx={};while((e=aB.exec(bP))){bx[e[1].toLowerCase()]=e[2]}}e=bx[bS.toLowerCase()]}return e===N?null:e},overrideMimeType:function(e){if(!bz){bC.mimeType=e}return this},abort:function(e){e=e||"abort";if(bK){bK.abort(e)}bE(0,e);return this}};function bE(bY,bT,bZ,bV){if(bz===2){return}bz=2;if(bD){clearTimeout(bD)}bK=N;bP=bV||"";bI.readyState=bY>0?4:0;var bS,b3,b2,bW=bT,bX=bZ?bi(bC,bI,bZ):N,bU,b1;if(bY>=200&&bY<300||bY===304){if(bC.ifModified){if((bU=bI.getResponseHeader("Last-Modified"))){b.lastModified[bB]=bU}if((b1=bI.getResponseHeader("Etag"))){b.etag[bB]=b1}}if(bY===304){bW="notmodified";bS=true}else{try{b3=I(bC,bX);bW="success";bS=true}catch(b0){bW="parsererror";b2=b0}}}else{b2=bW;if(!bW||bY){bW="error";if(bY<0){bY=0}}}bI.status=bY;bI.statusText=""+(bT||bW);if(bS){bQ.resolveWith(bR,[b3,bW,bI])}else{bQ.rejectWith(bR,[bI,bW,b2])}bI.statusCode(bA);bA=N;if(bv){bF.trigger("ajax"+(bS?"Success":"Error"),[bI,bC,bS?b3:b2])}bM.resolveWith(bR,[bI,bW]);if(bv){bF.trigger("ajaxComplete",[bI,bC]);if(!(--b.active)){b.event.trigger("ajaxStop")}}}bQ.promise(bI);bI.success=bI.done;bI.error=bI.fail;bI.complete=bM.done;bI.statusCode=function(bS){if(bS){var e;if(bz<2){for(e in bS){bA[e]=[bA[e],bS[e]]}}else{e=bS[bI.status];bI.then(e,e)}}return this};bC.url=((by||bC.url)+"").replace(bq,"").replace(c,v[1]+"//");bC.dataTypes=b.trim(bC.dataType||"*").toLowerCase().split(h);if(bC.crossDomain==null){bH=M.exec(bC.url.toLowerCase());bC.crossDomain=!!(bH&&(bH[1]!=v[1]||bH[2]!=v[2]||(bH[3]||(bH[1]==="http:"?80:443))!=(v[3]||(v[1]==="http:"?80:443))))}if(bC.data&&bC.processData&&typeof bC.data!=="string"){bC.data=b.param(bC.data,bC.traditional)}aT(Z,bC,bw,bI);if(bz===2){return false}bv=bC.global;bC.type=bC.type.toUpperCase();bC.hasContent=!aN.test(bC.type);if(bv&&b.active++===0){b.event.trigger("ajaxStart")}if(!bC.hasContent){if(bC.data){bC.url+=(O.test(bC.url)?"&":"?")+bC.data;delete bC.data}bB=bC.url;if(bC.cache===false){var bu=b.now(),bO=bC.url.replace(br,"$1_="+bu);bC.url=bO+((bO===bC.url)?(O.test(bC.url)?"&":"?")+"_="+bu:"")}}if(bC.data&&bC.hasContent&&bC.contentType!==false||bw.contentType){bI.setRequestHeader("Content-Type",bC.contentType)}if(bC.ifModified){bB=bB||bC.url;if(b.lastModified[bB]){bI.setRequestHeader("If-Modified-Since",b.lastModified[bB])}if(b.etag[bB]){bI.setRequestHeader("If-None-Match",b.etag[bB])}}bI.setRequestHeader("Accept",bC.dataTypes[0]&&bC.accepts[bC.dataTypes[0]]?bC.accepts[bC.dataTypes[0]]+(bC.dataTypes[0]!=="*"?", "+aR+"; q=0.01":""):bC.accepts["*"]);for(bJ in bC.headers){bI.setRequestHeader(bJ,bC.headers[bJ])}if(bC.beforeSend&&(bC.beforeSend.call(bR,bI,bC)===false||bz===2)){bI.abort();return false}for(bJ in {success:1,error:1,complete:1}){bI[bJ](bC[bJ])}bK=aT(u,bC,bw,bI);if(!bK){bE(-1,"No Transport")}else{bI.readyState=1;if(bv){bF.trigger("ajaxSend",[bI,bC])}if(bC.async&&bC.timeout>0){bD=setTimeout(function(){bI.abort("timeout")},bC.timeout)}try{bz=1;bK.send(bG,bE)}catch(bL){if(bz<2){bE(-1,bL)}else{b.error(bL)}}}return bI},param:function(e,bv){var bu=[],bx=function(by,bz){bz=b.isFunction(bz)?bz():bz;bu[bu.length]=encodeURIComponent(by)+"="+encodeURIComponent(bz)};if(bv===N){bv=b.ajaxSettings.traditional}if(b.isArray(e)||(e.jquery&&!b.isPlainObject(e))){b.each(e,function(){bx(this.name,this.value)})}else{for(var bw in e){y(bw,e[bw],bv,bx)}}return bu.join("&").replace(l,"+")}});function y(bv,bx,bu,bw){if(b.isArray(bx)){b.each(bx,function(bz,by){if(bu||an.test(bv)){bw(bv,by)}else{y(bv+"["+(typeof by==="object"||b.isArray(by)?bz:"")+"]",by,bu,bw)}})}else{if(!bu&&bx!=null&&typeof bx==="object"){for(var e in bx){y(bv+"["+e+"]",bx[e],bu,bw)}}else{bw(bv,bx)}}}b.extend({active:0,lastModified:{},etag:{}});function bi(bC,bB,by){var bu=bC.contents,bA=bC.dataTypes,bv=bC.responseFields,bx,bz,bw,e;for(bz in bv){if(bz in by){bB[bv[bz]]=by[bz]}}while(bA[0]==="*"){bA.shift();if(bx===N){bx=bC.mimeType||bB.getResponseHeader("content-type")}}if(bx){for(bz in bu){if(bu[bz]&&bu[bz].test(bx)){bA.unshift(bz);break}}}if(bA[0] in by){bw=bA[0]}else{for(bz in by){if(!bA[0]||bC.converters[bz+" "+bA[0]]){bw=bz;break}if(!e){e=bz}}bw=bw||e}if(bw){if(bw!==bA[0]){bA.unshift(bw)}return by[bw]}}function I(bG,by){if(bG.dataFilter){by=bG.dataFilter(by,bG.dataType)}var bC=bG.dataTypes,bF={},bz,bD,bv=bC.length,bA,bB=bC[0],bw,bx,bE,bu,e;for(bz=1;bz<bv;bz++){if(bz===1){for(bD in bG.converters){if(typeof bD==="string"){bF[bD.toLowerCase()]=bG.converters[bD]}}}bw=bB;bB=bC[bz];if(bB==="*"){bB=bw}else{if(bw!=="*"&&bw!==bB){bx=bw+" "+bB;bE=bF[bx]||bF["* "+bB];if(!bE){e=N;for(bu in bF){bA=bu.split(" ");if(bA[0]===bw||bA[0]==="*"){e=bF[bA[1]+" "+bB];if(e){bu=bF[bu];if(bu===true){bE=e}else{if(e===true){bE=bu}}break}}}}if(!(bE||e)){b.error("No conversion from "+bx.replace(" "," to "))}if(bE!==true){by=bE?bE(by):e(bu(by))}}}}return by}var aA=b.now(),x=/(\=)\?(&|$)|\?\?/i;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return b.expando+"_"+(aA++)}});b.ajaxPrefilter("json jsonp",function(bC,bz,bB){var bw=bC.contentType==="application/x-www-form-urlencoded"&&(typeof bC.data==="string");if(bC.dataTypes[0]==="jsonp"||bC.jsonp!==false&&(x.test(bC.url)||bw&&x.test(bC.data))){var bA,bv=bC.jsonpCallback=b.isFunction(bC.jsonpCallback)?bC.jsonpCallback():bC.jsonpCallback,by=ba[bv],e=bC.url,bx=bC.data,bu="$1"+bv+"$2";if(bC.jsonp!==false){e=e.replace(x,bu);if(bC.url===e){if(bw){bx=bx.replace(x,bu)}if(bC.data===bx){e+=(/\?/.test(e)?"&":"?")+bC.jsonp+"="+bv}}}bC.url=e;bC.data=bx;ba[bv]=function(bD){bA=[bD]};bB.always(function(){ba[bv]=by;if(bA&&b.isFunction(by)){ba[bv](bA[0])}});bC.converters["script json"]=function(){if(!bA){b.error(bv+" was not called")}return bA[0]};bC.dataTypes[0]="json";return"script"}});b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){b.globalEval(e);return e}}});b.ajaxPrefilter("script",function(e){if(e.cache===N){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});b.ajaxTransport("script",function(bv){if(bv.crossDomain){var e,bu=at.head||at.getElementsByTagName("head")[0]||at.documentElement;return{send:function(bw,bx){e=at.createElement("script");e.async="async";if(bv.scriptCharset){e.charset=bv.scriptCharset}e.src=bv.url;e.onload=e.onreadystatechange=function(bz,by){if(by||!e.readyState||/loaded|complete/.test(e.readyState)){e.onload=e.onreadystatechange=null;if(bu&&e.parentNode){bu.removeChild(e)}e=N;if(!by){bx(200,"success")}}};bu.insertBefore(e,bu.firstChild)},abort:function(){if(e){e.onload(0,1)}}}}});var E=ba.ActiveXObject?function(){for(var e in P){P[e](0,1)}}:false,B=0,P;function aJ(){try{return new ba.XMLHttpRequest()}catch(bu){}}function ah(){try{return new ba.ActiveXObject("Microsoft.XMLHTTP")}catch(bu){}}b.ajaxSettings.xhr=ba.ActiveXObject?function(){return !this.isLocal&&aJ()||ah()}:aJ;(function(e){b.extend(b.support,{ajax:!!e,cors:!!e&&("withCredentials" in e)})})(b.ajaxSettings.xhr());if(b.support.ajax){b.ajaxTransport(function(e){if(!e.crossDomain||b.support.cors){var bu;return{send:function(bA,bv){var bz=e.xhr(),by,bx;if(e.username){bz.open(e.type,e.url,e.async,e.username,e.password)}else{bz.open(e.type,e.url,e.async)}if(e.xhrFields){for(bx in e.xhrFields){bz[bx]=e.xhrFields[bx]}}if(e.mimeType&&bz.overrideMimeType){bz.overrideMimeType(e.mimeType)}if(!e.crossDomain&&!bA["X-Requested-With"]){bA["X-Requested-With"]="XMLHttpRequest"}try{for(bx in bA){bz.setRequestHeader(bx,bA[bx])}}catch(bw){}bz.send((e.hasContent&&e.data)||null);bu=function(bJ,bD){var bE,bC,bB,bH,bG;try{if(bu&&(bD||bz.readyState===4)){bu=N;if(by){bz.onreadystatechange=b.noop;if(E){delete P[by]}}if(bD){if(bz.readyState!==4){bz.abort()}}else{bE=bz.status;bB=bz.getAllResponseHeaders();bH={};bG=bz.responseXML;if(bG&&bG.documentElement){bH.xml=bG}bH.text=bz.responseText;try{bC=bz.statusText}catch(bI){bC=""}if(!bE&&e.isLocal&&!e.crossDomain){bE=bH.text?200:404}else{if(bE===1223){bE=204}}}}}catch(bF){if(!bD){bv(-1,bF)}}if(bH){bv(bE,bC,bH,bB)}};if(!e.async||bz.readyState===4){bu()}else{by=++B;if(E){if(!P){P={};b(ba).unload(E)}P[by]=bu}bz.onreadystatechange=bu}},abort:function(){if(bu){bu(0,1)}}}}})}var T={},a7,o,az=/^(?:toggle|show|hide)$/,aP=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,a2,aF=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],a3;b.fn.extend({show:function(bw,bz,by){var bv,bx;if(bw||bw===0){return this.animate(a0("show",3),bw,bz,by)}else{for(var bu=0,e=this.length;bu<e;bu++){bv=this[bu];if(bv.style){bx=bv.style.display;if(!b._data(bv,"olddisplay")&&bx==="none"){bx=bv.style.display=""}if(bx===""&&b.css(bv,"display")==="none"){b._data(bv,"olddisplay",A(bv.nodeName))}}}for(bu=0;bu<e;bu++){bv=this[bu];if(bv.style){bx=bv.style.display;if(bx===""||bx==="none"){bv.style.display=b._data(bv,"olddisplay")||""}}}return this}},hide:function(bv,by,bx){if(bv||bv===0){return this.animate(a0("hide",3),bv,by,bx)}else{for(var bu=0,e=this.length;bu<e;bu++){if(this[bu].style){var bw=b.css(this[bu],"display");if(bw!=="none"&&!b._data(this[bu],"olddisplay")){b._data(this[bu],"olddisplay",bw)}}}for(bu=0;bu<e;bu++){if(this[bu].style){this[bu].style.display="none"}}return this}},_toggle:b.fn.toggle,toggle:function(bv,bu,bw){var e=typeof bv==="boolean";if(b.isFunction(bv)&&b.isFunction(bu)){this._toggle.apply(this,arguments)}else{if(bv==null||e){this.each(function(){var bx=e?bv:b(this).is(":hidden");b(this)[bx?"show":"hide"]()})}else{this.animate(a0("toggle",3),bv,bu,bw)}}return this},fadeTo:function(e,bw,bv,bu){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:bw},e,bv,bu)},animate:function(bx,bu,bw,bv){var e=b.speed(bu,bw,bv);if(b.isEmptyObject(bx)){return this.each(e.complete,[false])}bx=b.extend({},bx);return this[e.queue===false?"each":"queue"](function(){if(e.queue===false){b._mark(this)}var bB=b.extend({},e),bI=this.nodeType===1,bF=bI&&b(this).is(":hidden"),by,bC,bA,bH,bG,bE,bz,bD,bJ;bB.animatedProperties={};for(bA in bx){by=b.camelCase(bA);if(bA!==by){bx[by]=bx[bA];delete bx[bA]}bC=bx[by];if(b.isArray(bC)){bB.animatedProperties[by]=bC[1];bC=bx[by]=bC[0]}else{bB.animatedProperties[by]=bB.specialEasing&&bB.specialEasing[by]||bB.easing||"swing"}if(bC==="hide"&&bF||bC==="show"&&!bF){return bB.complete.call(this)}if(bI&&(by==="height"||by==="width")){bB.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(b.css(this,"display")==="inline"&&b.css(this,"float")==="none"){if(!b.support.inlineBlockNeedsLayout){this.style.display="inline-block"}else{bH=A(this.nodeName);if(bH==="inline"){this.style.display="inline-block"}else{this.style.display="inline";this.style.zoom=1}}}}}if(bB.overflow!=null){this.style.overflow="hidden"}for(bA in bx){bG=new b.fx(this,bB,bA);bC=bx[bA];if(az.test(bC)){bG[bC==="toggle"?bF?"show":"hide":bC]()}else{bE=aP.exec(bC);bz=bG.cur();if(bE){bD=parseFloat(bE[2]);bJ=bE[3]||(b.cssNumber[bA]?"":"px");if(bJ!=="px"){b.style(this,bA,(bD||1)+bJ);bz=((bD||1)/bG.cur())*bz;b.style(this,bA,bz+bJ)}if(bE[1]){bD=((bE[1]==="-="?-1:1)*bD)+bz}bG.custom(bz,bD,bJ)}else{bG.custom(bz,bC,"")}}}return true})},stop:function(bu,e){if(bu){this.queue([])}this.each(function(){var bw=b.timers,bv=bw.length;if(!e){b._unmark(true,this)}while(bv--){if(bw[bv].elem===this){if(e){bw[bv](true)}bw.splice(bv,1)}}});if(!e){this.dequeue()}return this}});function bf(){setTimeout(aq,0);return(a3=b.now())}function aq(){a3=N}function a0(bu,e){var bv={};b.each(aF.concat.apply([],aF.slice(0,e)),function(){bv[this]=bu});return bv}b.each({slideDown:a0("show",1),slideUp:a0("hide",1),slideToggle:a0("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,bu){b.fn[e]=function(bv,bx,bw){return this.animate(bu,bv,bx,bw)}});b.extend({speed:function(bv,bw,bu){var e=bv&&typeof bv==="object"?b.extend({},bv):{complete:bu||!bu&&bw||b.isFunction(bv)&&bv,duration:bv,easing:bu&&bw||bw&&!b.isFunction(bw)&&bw};e.duration=b.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in b.fx.speeds?b.fx.speeds[e.duration]:b.fx.speeds._default;e.old=e.complete;e.complete=function(bx){if(b.isFunction(e.old)){e.old.call(this)}if(e.queue!==false){b.dequeue(this)}else{if(bx!==false){b._unmark(this)}}};return e},easing:{linear:function(bv,bw,e,bu){return e+bu*bv},swing:function(bv,bw,e,bu){return((-Math.cos(bv*Math.PI)/2)+0.5)*bu+e}},timers:[],fx:function(bu,e,bv){this.options=e;this.elem=bu;this.prop=bv;e.orig=e.orig||{}}});b.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(b.fx.step[this.prop]||b.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 e,bu=b.css(this.elem,this.prop);return isNaN(e=parseFloat(bu))?!bu||bu==="auto"?0:bu:e},custom:function(by,bx,bw){var e=this,bv=b.fx;this.startTime=a3||bf();this.start=by;this.end=bx;this.unit=bw||this.unit||(b.cssNumber[this.prop]?"":"px");this.now=this.start;this.pos=this.state=0;function bu(bz){return e.step(bz)}bu.elem=this.elem;if(bu()&&b.timers.push(bu)&&!a2){a2=setInterval(bv.tick,bv.interval)}},show:function(){this.options.orig[this.prop]=b.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());b(this.elem).show()},hide:function(){this.options.orig[this.prop]=b.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(bx){var bw=a3||bf(),e=true,by=this.elem,bu=this.options,bv,bA;if(bx||bw>=bu.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();bu.animatedProperties[this.prop]=true;for(bv in bu.animatedProperties){if(bu.animatedProperties[bv]!==true){e=false}}if(e){if(bu.overflow!=null&&!b.support.shrinkWrapBlocks){b.each(["","X","Y"],function(bB,bC){by.style["overflow"+bC]=bu.overflow[bB]})}if(bu.hide){b(by).hide()}if(bu.hide||bu.show){for(var bz in bu.animatedProperties){b.style(by,bz,bu.orig[bz])}}bu.complete.call(by)}return false}else{if(bu.duration==Infinity){this.now=bw}else{bA=bw-this.startTime;this.state=bA/bu.duration;this.pos=b.easing[bu.animatedProperties[this.prop]](this.state,bA,0,1,bu.duration);this.now=this.start+((this.end-this.start)*this.pos)}this.update()}return true}};b.extend(b.fx,{tick:function(){for(var bu=b.timers,e=0;e<bu.length;++e){if(!bu[e]()){bu.splice(e--,1)}}if(!bu.length){b.fx.stop()}},interval:13,stop:function(){clearInterval(a2);a2=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){b.style(e.elem,"opacity",e.now)},_default:function(e){if(e.elem.style&&e.elem.style[e.prop]!=null){e.elem.style[e.prop]=(e.prop==="width"||e.prop==="height"?Math.max(0,e.now):e.now)+e.unit}else{e.elem[e.prop]=e.now}}}});if(b.expr&&b.expr.filters){b.expr.filters.animated=function(e){return b.grep(b.timers,function(bu){return e===bu.elem}).length}}function A(bw){if(!T[bw]){var e=at.body,bu=b("<"+bw+">").appendTo(e),bv=bu.css("display");bu.remove();if(bv==="none"||bv===""){if(!a7){a7=at.createElement("iframe");a7.frameBorder=a7.width=a7.height=0}e.appendChild(a7);if(!o||!a7.createElement){o=(a7.contentWindow||a7.contentDocument).document;o.write((at.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>");o.close()}bu=o.createElement(bw);o.body.appendChild(bu);bv=b.css(bu,"display");e.removeChild(a7)}T[bw]=bv}return T[bw]}var W=/^t(?:able|d|h)$/i,ac=/^(?:body|html)$/i;if("getBoundingClientRect" in at.documentElement){b.fn.offset=function(bH){var bx=this[0],bA;if(bH){return this.each(function(e){b.offset.setOffset(this,bH,e)})}if(!bx||!bx.ownerDocument){return null}if(bx===bx.ownerDocument.body){return b.offset.bodyOffset(bx)}try{bA=bx.getBoundingClientRect()}catch(bE){}var bG=bx.ownerDocument,bv=bG.documentElement;if(!bA||!b.contains(bv,bx)){return bA?{top:bA.top,left:bA.left}:{top:0,left:0}}var bB=bG.body,bC=aI(bG),bz=bv.clientTop||bB.clientTop||0,bD=bv.clientLeft||bB.clientLeft||0,bu=bC.pageYOffset||b.support.boxModel&&bv.scrollTop||bB.scrollTop,by=bC.pageXOffset||b.support.boxModel&&bv.scrollLeft||bB.scrollLeft,bF=bA.top+bu-bz,bw=bA.left+by-bD;return{top:bF,left:bw}}}else{b.fn.offset=function(bE){var by=this[0];if(bE){return this.each(function(bF){b.offset.setOffset(this,bE,bF)})}if(!by||!by.ownerDocument){return null}if(by===by.ownerDocument.body){return b.offset.bodyOffset(by)}b.offset.initialize();var bB,bv=by.offsetParent,bu=by,bD=by.ownerDocument,bw=bD.documentElement,bz=bD.body,bA=bD.defaultView,e=bA?bA.getComputedStyle(by,null):by.currentStyle,bC=by.offsetTop,bx=by.offsetLeft;while((by=by.parentNode)&&by!==bz&&by!==bw){if(b.offset.supportsFixedPosition&&e.position==="fixed"){break}bB=bA?bA.getComputedStyle(by,null):by.currentStyle;bC-=by.scrollTop;bx-=by.scrollLeft;if(by===bv){bC+=by.offsetTop;bx+=by.offsetLeft;if(b.offset.doesNotAddBorder&&!(b.offset.doesAddBorderForTableAndCells&&W.test(by.nodeName))){bC+=parseFloat(bB.borderTopWidth)||0;bx+=parseFloat(bB.borderLeftWidth)||0}bu=bv;bv=by.offsetParent}if(b.offset.subtractsBorderForOverflowNotVisible&&bB.overflow!=="visible"){bC+=parseFloat(bB.borderTopWidth)||0;bx+=parseFloat(bB.borderLeftWidth)||0}e=bB}if(e.position==="relative"||e.position==="static"){bC+=bz.offsetTop;bx+=bz.offsetLeft}if(b.offset.supportsFixedPosition&&e.position==="fixed"){bC+=Math.max(bw.scrollTop,bz.scrollTop);bx+=Math.max(bw.scrollLeft,bz.scrollLeft)}return{top:bC,left:bx}}}b.offset={initialize:function(){var e=at.body,bu=at.createElement("div"),bx,bz,by,bA,bv=parseFloat(b.css(e,"marginTop"))||0,bw="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";b.extend(bu.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});bu.innerHTML=bw;e.insertBefore(bu,e.firstChild);bx=bu.firstChild;bz=bx.firstChild;bA=bx.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(bz.offsetTop!==5);this.doesAddBorderForTableAndCells=(bA.offsetTop===5);bz.style.position="fixed";bz.style.top="20px";this.supportsFixedPosition=(bz.offsetTop===20||bz.offsetTop===15);bz.style.position=bz.style.top="";bx.style.overflow="hidden";bx.style.position="relative";this.subtractsBorderForOverflowNotVisible=(bz.offsetTop===-5);this.doesNotIncludeMarginInBodyOffset=(e.offsetTop!==bv);e.removeChild(bu);b.offset.initialize=b.noop},bodyOffset:function(e){var bv=e.offsetTop,bu=e.offsetLeft;b.offset.initialize();if(b.offset.doesNotIncludeMarginInBodyOffset){bv+=parseFloat(b.css(e,"marginTop"))||0;bu+=parseFloat(b.css(e,"marginLeft"))||0}return{top:bv,left:bu}},setOffset:function(bw,bF,bz){var bA=b.css(bw,"position");if(bA==="static"){bw.style.position="relative"}var by=b(bw),bu=by.offset(),e=b.css(bw,"top"),bD=b.css(bw,"left"),bE=(bA==="absolute"||bA==="fixed")&&b.inArray("auto",[e,bD])>-1,bC={},bB={},bv,bx;if(bE){bB=by.position();bv=bB.top;bx=bB.left}else{bv=parseFloat(e)||0;bx=parseFloat(bD)||0}if(b.isFunction(bF)){bF=bF.call(bw,bz,bu)}if(bF.top!=null){bC.top=(bF.top-bu.top)+bv}if(bF.left!=null){bC.left=(bF.left-bu.left)+bx}if("using" in bF){bF.using.call(bw,bC)}else{by.css(bC)}}};b.fn.extend({position:function(){if(!this[0]){return null}var bv=this[0],bu=this.offsetParent(),bw=this.offset(),e=ac.test(bu[0].nodeName)?{top:0,left:0}:bu.offset();bw.top-=parseFloat(b.css(bv,"marginTop"))||0;bw.left-=parseFloat(b.css(bv,"marginLeft"))||0;e.top+=parseFloat(b.css(bu[0],"borderTopWidth"))||0;e.left+=parseFloat(b.css(bu[0],"borderLeftWidth"))||0;return{top:bw.top-e.top,left:bw.left-e.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||at.body;while(e&&(!ac.test(e.nodeName)&&b.css(e,"position")==="static")){e=e.offsetParent}return e})}});b.each(["Left","Top"],function(bu,e){var bv="scroll"+e;b.fn[bv]=function(by){var bw,bx;if(by===N){bw=this[0];if(!bw){return null}bx=aI(bw);return bx?("pageXOffset" in bx)?bx[bu?"pageYOffset":"pageXOffset"]:b.support.boxModel&&bx.document.documentElement[bv]||bx.document.body[bv]:bw[bv]}return this.each(function(){bx=aI(this);if(bx){bx.scrollTo(!bu?by:b(bx).scrollLeft(),bu?by:b(bx).scrollTop())}else{this[bv]=by}})}});function aI(e){return b.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:false}b.each(["Height","Width"],function(bu,e){var bv=e.toLowerCase();b.fn["inner"+e]=function(){var bw=this[0];return bw&&bw.style?parseFloat(b.css(bw,bv,"padding")):null};b.fn["outer"+e]=function(bx){var bw=this[0];return bw&&bw.style?parseFloat(b.css(bw,bv,bx?"margin":"border")):null};b.fn[bv]=function(by){var bz=this[0];if(!bz){return by==null?null:this}if(b.isFunction(by)){return this.each(function(bD){var bC=b(this);bC[bv](by.call(this,bD,bC[bv]()))})}if(b.isWindow(bz)){var bA=bz.document.documentElement["client"+e],bw=bz.document.body;return bz.document.compatMode==="CSS1Compat"&&bA||bw&&bw["client"+e]||bA}else{if(bz.nodeType===9){return Math.max(bz.documentElement["client"+e],bz.body["scroll"+e],bz.documentElement["scroll"+e],bz.body["offset"+e],bz.documentElement["offset"+e])}else{if(by===N){var bB=b.css(bz,bv),bx=parseFloat(bB);return b.isNaN(bx)?bB:bx}else{return this.css(bv,typeof by==="string"?by:by+"px")}}}}});ba.jQuery=ba.$=b})(window);var jq=jQuery.noConflict(true);jq.cookie=function(b,j,n){if(typeof j!="undefined"){n=n||{};if(j===null){j="";n=jq.extend({},n);n.expires=-1}var e="";if(n.expires&&(typeof n.expires=="number"||n.expires.toUTCString)){var f;if(typeof n.expires=="number"){f=new Date();f.setTime(f.getTime()+(n.expires*24*60*60*1000))}else{f=n.expires}e="; expires="+f.toUTCString()}var m=n.path?"; path="+(n.path):"";var g=n.domain?"; domain="+(n.domain):"";var a=n.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,m,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var l=document.cookie.split(";");for(var h=0;h<l.length;h++){var c=jq.trim(l[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
/*!
 * jQuery UI 1.8.16
 *
 * 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(a,d){a.ui=a.ui||{};if(a.ui.version){return}a.extend(a.ui,{version:"1.8.16",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}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(e,f){return typeof e==="number"?this.each(function(){var g=this;setTimeout(function(){a(g).focus();if(f){f.call(g)}},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){e=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{e=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!e.length?a(document):e},zIndex:function(h){if(h!==d){return this.css("zIndex",h)}if(this.length){var f=a(this[0]),e,g;while(f.length&&f[0]!==document){e=f.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0){return g}}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(g,e){var f=e==="Width"?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),l={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function j(o,n,m,p){a.each(f,function(){n-=parseFloat(a.curCSS(o,"padding"+this,true))||0;if(m){n-=parseFloat(a.curCSS(o,"border"+this+"Width",true))||0}if(p){n-=parseFloat(a.curCSS(o,"margin"+this,true))||0}});return n}a.fn["inner"+e]=function(m){if(m===d){return l["inner"+e].call(this)}return this.each(function(){a(this).css(h,j(this,m)+"px")})};a.fn["outer"+e]=function(m,n){if(typeof m!=="number"){return l["outer"+e].call(this,m)}return this.each(function(){a(this).css(h,j(this,m,true,n)+"px")})}});function c(g,e){var l=g.nodeName.toLowerCase();if("area"===l){var j=g.parentNode,h=j.name,f;if(!g.href||!h||j.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(l)?!g.disabled:"a"==l?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.extend(a.expr[":"],{data:function(g,f,e){return !!a.data(g,e[3])},focusable:function(e){return c(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(g){var e=a.attr(g,"tabindex"),f=isNaN(e);return(f||e>=0)&&c(g,!f)}});a(function(){var e=document.body,f=e.appendChild(f=document.createElement("div"));a.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=f.offsetHeight===100;a.support.selectstart="onselectstart" in f;e.removeChild(f).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,j){var h=a.ui[f].prototype;for(var e in j){h.plugins[e]=h.plugins[e]||[];h.plugins[e].push([g,j[e]])}},call:function(e,g,f){var j=e.plugins[g];if(!j||!e.element[0].parentNode){return}for(var h=0;h<j.length;h++){if(e.options[j[h][0]]){j[h][1].apply(e.element,f)}}}},contains:function(f,e){return document.compareDocumentPosition?f.compareDocumentPosition(e)&16:f!==e&&f.contains(e)},hasScroll:function(h,f){if(a(h).css("overflow")==="hidden"){return false}var e=(f&&f==="left")?"scrollLeft":"scrollTop",g=false;if(h[e]>0){return true}h[e]=1;g=(h[e]>0);h[e]=0;return g},isOverAxis:function(f,e,g){return(f>e)&&(f<(e+g))},isOver:function(l,f,j,h,e,g){return a.ui.isOverAxis(l,j,e)&&a.ui.isOverAxis(f,h,g)}})})(jq);
/*!
 * jQuery UI Widget 1.8.16
 *
 * 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,d){if(b.cleanData){var c=b.cleanData;b.cleanData=function(f){for(var g=0,h;(h=f[g])!=null;g++){try{b(h).triggerHandler("remove")}catch(j){}}c(f)}}else{var a=b.fn.remove;b.fn.remove=function(e,f){return this.each(function(){if(!f){if(!e||b.filter(e,[this]).length){b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(g){}})}}return a.call(b(this),e,f)})}}b.widget=function(f,h,e){var g=f.split(".")[0],l;f=f.split(".")[1];l=g+"-"+f;if(!e){e=h;h=b.Widget}b.expr[":"][l]=function(m){return !!b.data(m,f)};b[g]=b[g]||{};b[g][f]=function(m,n){if(arguments.length){this._createWidget(m,n)}};var j=new h();j.options=b.extend(true,{},j.options);b[g][f].prototype=b.extend(true,j,{namespace:g,widgetName:f,widgetEventPrefix:b[g][f].prototype.widgetEventPrefix||f,widgetBaseClass:l},e);b.widget.bridge(f,b[g][f])};b.widget.bridge=function(f,e){b.fn[f]=function(j){var g=typeof j==="string",h=Array.prototype.slice.call(arguments,1),l=this;j=!g&&h.length?b.extend.apply(null,[true,j].concat(h)):j;if(g&&j.charAt(0)==="_"){return l}if(g){this.each(function(){var m=b.data(this,f),n=m&&b.isFunction(m[j])?m[j].apply(m,h):m;if(n!==m&&n!==d){l=n;return false}})}else{this.each(function(){var m=b.data(this,f);if(m){m.option(j||{})._init()}else{b.data(this,f,new e(j,this))}})}return l}};b.Widget=function(e,f){if(arguments.length){this._createWidget(e,f)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){b.data(g,this.widgetName,this);this.element=b(g);this.options=b.extend(true,{},this.options,this._getCreateOptions(),f);var e=this;this.element.bind("remove."+this.widgetName,function(){e.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(f,g){var e=f;if(arguments.length===0){return b.extend({},this.options)}if(typeof f==="string"){if(g===d){return this.options[f]}e={};e[f]=g}this._setOptions(e);return this},_setOptions:function(f){var e=this;b.each(f,function(g,h){e._setOption(g,h)});return this},_setOption:function(e,f){this.options[e]=f;if(e==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(f,g,h){var l=this.options[f];g=b.Event(g);g.type=(f===this.widgetEventPrefix?f:this.widgetEventPrefix+f).toLowerCase();h=h||{};if(g.originalEvent){for(var e=b.event.props.length,j;e;){j=b.event.props[--e];g[j]=g.originalEvent[j]}}this.element.trigger(g,h);return !(b.isFunction(l)&&l.call(this.element[0],g,h)===false||g.isDefaultPrevented())}}})(jq);
/*!
 * jQuery UI Mouse 1.8.16
 *
 * 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,c){var a=false;b(document).mouseup(function(d){a=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var d=this;this.element.bind("mousedown."+this.widgetName,function(e){return d._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(true===b.data(e.target,d.widgetName+".preventClickEvent")){b.removeData(e.target,d.widgetName+".preventClickEvent");e.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(f){if(a){return}(this._mouseStarted&&this._mouseUp(f));this._mouseDownEvent=f;var e=this,g=(f.which==1),d=(typeof this.options.cancel=="string"&&f.target.nodeName?b(f.target).closest(this.options.cancel).length:false);if(!g||d||!this._mouseCapture(f)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(f)&&this._mouseDelayMet(f)){this._mouseStarted=(this._mouseStart(f)!==false);if(!this._mouseStarted){f.preventDefault();return true}}if(true===b.data(f.target,this.widgetName+".preventClickEvent")){b.removeData(f.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(h){return e._mouseMove(h)};this._mouseUpDelegate=function(h){return e._mouseUp(h)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);f.preventDefault();a=true;return true},_mouseMove:function(d){if(b.browser.msie&&!(document.documentMode>=9)&&!d.button){return this._mouseUp(d)}if(this._mouseStarted){this._mouseDrag(d);return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,d)!==false);(this._mouseStarted?this._mouseDrag(d):this._mouseUp(d))}return !this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(d.target==this._mouseDownEvent.target){b.data(d.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return(Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance)},_mouseDelayMet:function(d){return this.mouseDelayMet},_mouseStart:function(d){},_mouseDrag:function(d){},_mouseStop:function(d){},_mouseCapture:function(d){return true}})})(jq);(function(f,g){f.ui=f.ui||{};var d=/left|center|right/,e=/top|center|bottom/,a="center",b=f.fn.position,c=f.fn.offset;f.fn.position=function(j){if(!j||!j.of){return b.apply(this,arguments)}j=f.extend({},j);var o=f(j.of),n=o[0],q=(j.collision||"flip").split(" "),p=j.offset?j.offset.split(" "):[0,0],m,h,l;if(n.nodeType===9){m=o.width();h=o.height();l={top:0,left:0}}else{if(n.setTimeout){m=o.width();h=o.height();l={top:o.scrollTop(),left:o.scrollLeft()}}else{if(n.preventDefault){j.at="left top";m=h=0;l={top:j.of.pageY,left:j.of.pageX}}else{m=o.outerWidth();h=o.outerHeight();l=o.offset()}}}f.each(["my","at"],function(){var r=(j[this]||"").split(" ");if(r.length===1){r=d.test(r[0])?r.concat([a]):e.test(r[0])?[a].concat(r):[a,a]}r[0]=d.test(r[0])?r[0]:a;r[1]=e.test(r[1])?r[1]:a;j[this]=r});if(q.length===1){q[1]=q[0]}p[0]=parseInt(p[0],10)||0;if(p.length===1){p[1]=p[0]}p[1]=parseInt(p[1],10)||0;if(j.at[0]==="right"){l.left+=m}else{if(j.at[0]===a){l.left+=m/2}}if(j.at[1]==="bottom"){l.top+=h}else{if(j.at[1]===a){l.top+=h/2}}l.left+=p[0];l.top+=p[1];return this.each(function(){var v=f(this),x=v.outerWidth(),u=v.outerHeight(),w=parseInt(f.curCSS(this,"marginLeft",true))||0,s=parseInt(f.curCSS(this,"marginTop",true))||0,z=x+w+(parseInt(f.curCSS(this,"marginRight",true))||0),A=u+s+(parseInt(f.curCSS(this,"marginBottom",true))||0),y=f.extend({},l),r;if(j.my[0]==="right"){y.left-=x}else{if(j.my[0]===a){y.left-=x/2}}if(j.my[1]==="bottom"){y.top-=u}else{if(j.my[1]===a){y.top-=u/2}}y.left=Math.round(y.left);y.top=Math.round(y.top);r={left:y.left-w,top:y.top-s};f.each(["left","top"],function(C,B){if(f.ui.position[q[C]]){f.ui.position[q[C]][B](y,{targetWidth:m,targetHeight:h,elemWidth:x,elemHeight:u,collisionPosition:r,collisionWidth:z,collisionHeight:A,offset:p,my:j.my,at:j.at})}});if(f.fn.bgiframe){v.bgiframe()}v.offset(f.extend(y,{using:j.using}))})};f.ui.position={fit:{left:function(h,j){var m=f(window),l=j.collisionPosition.left+j.collisionWidth-m.width()-m.scrollLeft();h.left=l>0?h.left-l:Math.max(h.left-j.collisionPosition.left,h.left)},top:function(h,j){var m=f(window),l=j.collisionPosition.top+j.collisionHeight-m.height()-m.scrollTop();h.top=l>0?h.top-l:Math.max(h.top-j.collisionPosition.top,h.top)}},flip:{left:function(j,m){if(m.at[0]===a){return}var o=f(window),n=m.collisionPosition.left+m.collisionWidth-o.width()-o.scrollLeft(),h=m.my[0]==="left"?-m.elemWidth:m.my[0]==="right"?m.elemWidth:0,l=m.at[0]==="left"?m.targetWidth:-m.targetWidth,p=-2*m.offset[0];j.left+=m.collisionPosition.left<0?h+l+p:n>0?h+l+p:0},top:function(j,m){if(m.at[1]===a){return}var o=f(window),n=m.collisionPosition.top+m.collisionHeight-o.height()-o.scrollTop(),h=m.my[1]==="top"?-m.elemHeight:m.my[1]==="bottom"?m.elemHeight:0,l=m.at[1]==="top"?m.targetHeight:-m.targetHeight,p=-2*m.offset[1];j.top+=m.collisionPosition.top<0?h+l+p:n>0?h+l+p:0}}};if(!f.offset.setOffset){f.offset.setOffset=function(n,j){if(/static/.test(f.curCSS(n,"position"))){n.style.position="relative"}var m=f(n),p=m.offset(),h=parseInt(f.curCSS(n,"top",true),10)||0,o=parseInt(f.curCSS(n,"left",true),10)||0,l={top:(j.top-p.top)+h,left:(j.left-p.left)+o};if("using" in j){j.using.call(n,l)}else{m.css(l)}};f.fn.offset=function(h){var j=this[0];if(!j||!j.ownerDocument){return null}if(h){return this.each(function(){f.offset.setOffset(this,h)})}return c.call(this)}}}(jq));(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(c){var d=this.options;if(this.helper||d.disabled||a(c.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(c);if(!this.handle){return false}if(d.iframeFix){a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})}return true},_mouseStart:function(c){var d=this.options;this.helper=this._createHelper(c);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(c);this.originalPageX=c.pageX;this.originalPageY=c.pageY;(d.cursorAt&&this._adjustOffsetFromHelper(d.cursorAt));if(d.containment){this._setContainment()}if(this._trigger("start",c)===false){this._clear();return false}this._cacheHelperProportions();if(a.ui.ddmanager&&!d.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,c)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(c,true);if(a.ui.ddmanager){a.ui.ddmanager.dragStart(this,c)}return true},_mouseDrag:function(c,e){this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");if(!e){var d=this._uiHash();if(this._trigger("drag",c,d)===false){this._mouseUp({});return false}this.position=d.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,c)}return false},_mouseStop:function(d){var e=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){e=a.ui.ddmanager.drop(this,d)}if(this.dropped){e=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return false}if((this.options.revert=="invalid"&&!e)||(this.options.revert=="valid"&&e)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,e))){var c=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(c._trigger("stop",d)!==false){c._clear()}})}else{if(this._trigger("stop",d)!==false){this._clear()}}return false},_mouseUp:function(c){if(this.options.iframeFix===true){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}if(a.ui.ddmanager){a.ui.ddmanager.dragStop(this,c)}return a.ui.mouse.prototype._mouseUp.call(this,c)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(c){var d=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==c.target){d=true}});return d},_createHelper:function(d){var e=this.options;var c=a.isFunction(e.helper)?a(e.helper.apply(this.element[0],[d])):(e.helper=="clone"?this.element.clone().removeAttr("id"):this.element);if(!c.parents("body").length){c.appendTo((e.appendTo=="parent"?this.element[0].parentNode:e.appendTo))}if(c[0]!=this.element[0]&&!(/(fixed|absolute)/).test(c.css("position"))){c.css("position","absolute")}return c},_adjustOffsetFromHelper:function(c){if(typeof c=="string"){c=c.split(" ")}if(a.isArray(c)){c={left:+c[0],top:+c[1]||0}}if("left" in c){this.offset.click.left=c.left+this.margins.left}if("right" in c){this.offset.click.left=this.helperProportions.width-c.right+this.margins.left}if("top" in c){this.offset.click.top=c.top+this.margins.top}if("bottom" in c){this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){c={top:0,left:0}}return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.element.position();return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var g=this.options;if(g.containment=="parent"){g.containment=this.helper[0].parentNode}if(g.containment=="document"||g.containment=="window"){this.containment=[g.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,g.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(g.containment=="document"?0:a(window).scrollLeft())+a(g.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(g.containment=="document"?0:a(window).scrollTop())+(a(g.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(g.containment)&&g.containment.constructor!=Array){var h=a(g.containment);var e=h[0];if(!e){return}var f=h.offset();var d=(a(e).css("overflow")!="hidden");this.containment=[(parseInt(a(e).css("borderLeftWidth"),10)||0)+(parseInt(a(e).css("paddingLeft"),10)||0),(parseInt(a(e).css("borderTopWidth"),10)||0)+(parseInt(a(e).css("paddingTop"),10)||0),(d?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(a(e).css("borderLeftWidth"),10)||0)-(parseInt(a(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(d?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(a(e).css("borderTopWidth"),10)||0)-(parseInt(a(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=h}else{if(g.containment.constructor==Array){this.containment=g.containment}}},_convertPositionTo:function(g,j){if(!j){j=this.position}var e=g=="absolute"?1:-1;var f=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=(/(html|body)/i).test(c[0].tagName);return{top:(j.top+this.offset.relative.top*e+this.offset.parent.top*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(h?0:c.scrollTop()))*e)),left:(j.left+this.offset.relative.left*e+this.offset.parent.left*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:c.scrollLeft())*e))}},_generatePosition:function(d){var e=this.options,n=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,j=(/(html|body)/i).test(n[0].tagName);var h=d.pageX;var g=d.pageY;if(this.originalPosition){var c;if(this.containment){if(this.relative_container){var m=this.relative_container.offset();c=[this.containment[0]+m.left,this.containment[1]+m.top,this.containment[2]+m.left,this.containment[3]+m.top]}else{c=this.containment}if(d.pageX-this.offset.click.left<c[0]){h=c[0]+this.offset.click.left}if(d.pageY-this.offset.click.top<c[1]){g=c[1]+this.offset.click.top}if(d.pageX-this.offset.click.left>c[2]){h=c[2]+this.offset.click.left}if(d.pageY-this.offset.click.top>c[3]){g=c[3]+this.offset.click.top}}if(e.grid){var l=e.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/e.grid[1])*e.grid[1]:this.originalPageY;g=c?(!(l-this.offset.click.top<c[1]||l-this.offset.click.top>c[3])?l:(!(l-this.offset.click.top<c[1])?l-e.grid[1]:l+e.grid[1])):l;var f=e.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/e.grid[0])*e.grid[0]:this.originalPageX;h=c?(!(f-this.offset.click.left<c[0]||f-this.offset.click.left>c[2])?f:(!(f-this.offset.click.left<c[0])?f-e.grid[0]:f+e.grid[0])):f}}return{top:(g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(j?0:n.scrollTop())))),left:(h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():j?0:n.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(c,d,e){e=e||this._uiHash();a.ui.plugin.call(this,c,[d,e]);if(c=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.Widget.prototype._trigger.call(this,c,d,e)},plugins:{},_uiHash:function(c){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.16"});a.ui.plugin.add("draggable","connectToSortable",{start:function(d,f){var e=a(this).data("draggable"),g=e.options,c=a.extend({},f,{item:e.element});e.sortables=[];a(g.connectToSortable).each(function(){var h=a.data(this,"sortable");if(h&&!h.options.disabled){e.sortables.push({instance:h,shouldRevert:h.options.revert});h.refreshPositions();h._trigger("activate",d,c)}})},stop:function(d,f){var e=a(this).data("draggable"),c=a.extend({},f,{item:e.element});a.each(e.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;e.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(d);this.instance.options.helper=this.instance.options._helper;if(e.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",d,c)}})},drag:function(d,g){var f=a(this).data("draggable"),c=this;var e=function(l){var r=this.offset.click.top,q=this.offset.click.left;var h=this.positionAbs.top,n=this.positionAbs.left;var m=l.height,p=l.width;var s=l.top,j=l.left;return a.ui.isOver(h+r,n+q,s,j,m,p)};a.each(f.sortables,function(h){this.instance.positionAbs=f.positionAbs;this.instance.helperProportions=f.helperProportions;this.instance.offset.click=f.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(c).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return g.helper[0]};d.target=this.instance.currentItem[0];this.instance._mouseCapture(d,true);this.instance._mouseStart(d,true,true);this.instance.offset.click.top=f.offset.click.top;this.instance.offset.click.left=f.offset.click.left;this.instance.offset.parent.left-=f.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=f.offset.parent.top-this.instance.offset.parent.top;f._trigger("toSortable",d);f.dropped=this.instance.element;f.currentItem=f.element;this.instance.fromOutside=f}if(this.instance.currentItem){this.instance._mouseDrag(d)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",d,this.instance._uiHash(this.instance));this.instance._mouseStop(d,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}f._trigger("fromSortable",d);f.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(d,e){var c=a("body"),f=a(this).data("draggable").options;if(c.css("cursor")){f._cursor=c.css("cursor")}c.css("cursor",f.cursor)},stop:function(c,d){var e=a(this).data("draggable").options;if(e._cursor){a("body").css("cursor",e._cursor)}}});a.ui.plugin.add("draggable","opacity",{start:function(d,e){var c=a(e.helper),f=a(this).data("draggable").options;if(c.css("opacity")){f._opacity=c.css("opacity")}c.css("opacity",f.opacity)},stop:function(c,d){var e=a(this).data("draggable").options;if(e._opacity){a(d.helper).css("opacity",e._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(d,e){var c=a(this).data("draggable");if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){c.overflowOffset=c.scrollParent.offset()}},drag:function(e,f){var d=a(this).data("draggable"),g=d.options,c=false;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!g.axis||g.axis!="x"){if((d.overflowOffset.top+d.scrollParent[0].offsetHeight)-e.pageY<g.scrollSensitivity){d.scrollParent[0].scrollTop=c=d.scrollParent[0].scrollTop+g.scrollSpeed}else{if(e.pageY-d.overflowOffset.top<g.scrollSensitivity){d.scrollParent[0].scrollTop=c=d.scrollParent[0].scrollTop-g.scrollSpeed}}}if(!g.axis||g.axis!="y"){if((d.overflowOffset.left+d.scrollParent[0].offsetWidth)-e.pageX<g.scrollSensitivity){d.scrollParent[0].scrollLeft=c=d.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(e.pageX-d.overflowOffset.left<g.scrollSensitivity){d.scrollParent[0].scrollLeft=c=d.scrollParent[0].scrollLeft-g.scrollSpeed}}}}else{if(!g.axis||g.axis!="x"){if(e.pageY-a(document).scrollTop()<g.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(e.pageY-a(document).scrollTop())<g.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}}if(!g.axis||g.axis!="y"){if(e.pageX-a(document).scrollLeft()<g.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(e.pageX-a(document).scrollLeft())<g.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}}if(c!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(d,e)}}});a.ui.plugin.add("draggable","snap",{start:function(d,e){var c=a(this).data("draggable"),f=c.options;c.snapElements=[];a(f.snap.constructor!=String?(f.snap.items||":data(draggable)"):f.snap).each(function(){var h=a(this);var g=h.offset();if(this!=c.element[0]){c.snapElements.push({item:this,width:h.outerWidth(),height:h.outerHeight(),top:g.top,left:g.left})}})},drag:function(v,q){var g=a(this).data("draggable"),s=g.options;var z=s.snapTolerance;var y=q.offset.left,x=y+g.helperProportions.width,f=q.offset.top,e=f+g.helperProportions.height;for(var w=g.snapElements.length-1;w>=0;w--){var u=g.snapElements[w].left,p=u+g.snapElements[w].width,n=g.snapElements[w].top,B=n+g.snapElements[w].height;if(!((u-z<y&&y<p+z&&n-z<f&&f<B+z)||(u-z<y&&y<p+z&&n-z<e&&e<B+z)||(u-z<x&&x<p+z&&n-z<f&&f<B+z)||(u-z<x&&x<p+z&&n-z<e&&e<B+z))){if(g.snapElements[w].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,v,a.extend(g._uiHash(),{snapItem:g.snapElements[w].item})))}g.snapElements[w].snapping=false;continue}if(s.snapMode!="inner"){var c=Math.abs(n-e)<=z;var A=Math.abs(B-f)<=z;var j=Math.abs(u-x)<=z;var m=Math.abs(p-y)<=z;if(c){q.position.top=g._convertPositionTo("relative",{top:n-g.helperProportions.height,left:0}).top-g.margins.top}if(A){q.position.top=g._convertPositionTo("relative",{top:B,left:0}).top-g.margins.top}if(j){q.position.left=g._convertPositionTo("relative",{top:0,left:u-g.helperProportions.width}).left-g.margins.left}if(m){q.position.left=g._convertPositionTo("relative",{top:0,left:p}).left-g.margins.left}}var h=(c||A||j||m);if(s.snapMode!="outer"){var c=Math.abs(n-f)<=z;var A=Math.abs(B-e)<=z;var j=Math.abs(u-y)<=z;var m=Math.abs(p-x)<=z;if(c){q.position.top=g._convertPositionTo("relative",{top:n,left:0}).top-g.margins.top}if(A){q.position.top=g._convertPositionTo("relative",{top:B-g.helperProportions.height,left:0}).top-g.margins.top}if(j){q.position.left=g._convertPositionTo("relative",{top:0,left:u}).left-g.margins.left}if(m){q.position.left=g._convertPositionTo("relative",{top:0,left:p-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[w].snapping&&(c||A||j||m||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,v,a.extend(g._uiHash(),{snapItem:g.snapElements[w].item})))}g.snapElements[w].snapping=(c||A||j||m||h)}}});a.ui.plugin.add("draggable","stack",{start:function(d,e){var g=a(this).data("draggable").options;var f=a.makeArray(a(g.stack)).sort(function(j,h){return(parseInt(a(j).css("zIndex"),10)||0)-(parseInt(a(h).css("zIndex"),10)||0)});if(!f.length){return}var c=parseInt(f[0].style.zIndex)||0;a(f).each(function(h){this.style.zIndex=c+h});this[0].style.zIndex=c+f.length}});a.ui.plugin.add("draggable","zIndex",{start:function(d,e){var c=a(e.helper),f=a(this).data("draggable").options;if(c.css("zIndex")){f._zIndex=c.css("zIndex")}c.css("zIndex",f.zIndex)},stop:function(c,d){var e=a(this).data("draggable").options;if(e._zIndex){a(d.helper).css("zIndex",e._zIndex)}}})})(jq);(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var d=this.options,c=d.accept;this.isover=0;this.isout=1;this.accept=a.isFunction(c)?c:function(e){return e.is(c)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[d.scope]=a.ui.ddmanager.droppables[d.scope]||[];a.ui.ddmanager.droppables[d.scope].push(this);(d.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var c=a.ui.ddmanager.droppables[this.options.scope];for(var d=0;d<c.length;d++){if(c[d]==this){c.splice(d,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(c,d){if(c=="accept"){this.accept=a.isFunction(d)?d:function(e){return e.is(d)}}a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(d){var c=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(c&&this._trigger("activate",d,this.ui(c)))},_deactivate:function(d){var c=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(c&&this._trigger("deactivate",d,this.ui(c)))},_over:function(d){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0]){return}if(this.accept.call(this.element[0],(c.currentItem||c.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",d,this.ui(c))}},_out:function(d){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0]){return}if(this.accept.call(this.element[0],(c.currentItem||c.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",d,this.ui(c))}},_drop:function(d,e){var c=e||a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0]){return false}var f=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=a.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],(c.currentItem||c.element))&&a.ui.intersect(c,a.extend(g,{offset:g.element.offset()}),g.options.tolerance)){f=true;return false}});if(f){return false}if(this.accept.call(this.element[0],(c.currentItem||c.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",d,this.ui(c));return this.element}return false},ui:function(d){return{draggable:(d.currentItem||d.element),helper:d.helper,position:d.position,offset:d.positionAbs}}});a.extend(a.ui.droppable,{version:"1.8.16"});a.ui.intersect=function(u,m,q){if(!m.offset){return false}var e=(u.positionAbs||u.position.absolute).left,d=e+u.helperProportions.width,p=(u.positionAbs||u.position.absolute).top,o=p+u.helperProportions.height;var g=m.offset.left,c=g+m.proportions.width,s=m.offset.top,n=s+m.proportions.height;switch(q){case"fit":return(g<=e&&d<=c&&s<=p&&o<=n);break;case"intersect":return(g<e+(u.helperProportions.width/2)&&d-(u.helperProportions.width/2)<c&&s<p+(u.helperProportions.height/2)&&o-(u.helperProportions.height/2)<n);break;case"pointer":var h=((u.positionAbs||u.position.absolute).left+(u.clickOffset||u.offset.click).left),j=((u.positionAbs||u.position.absolute).top+(u.clickOffset||u.offset.click).top),f=a.ui.isOver(j,h,s,g,m.proportions.height,m.proportions.width);return f;break;case"touch":return((p>=s&&p<=n)||(o>=s&&o<=n)||(p<s&&o>n))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(f,h){var c=a.ui.ddmanager.droppables[f.options.scope]||[];var g=h?h.type:null;var l=(f.currentItem||f.element).find(":data(droppable)").andSelf();droppablesLoop:for(var e=0;e<c.length;e++){if(c[e].options.disabled||(f&&!c[e].accept.call(c[e].element[0],(f.currentItem||f.element)))){continue}for(var d=0;d<l.length;d++){if(l[d]==c[e].element[0]){c[e].proportions.height=0;continue droppablesLoop}}c[e].visible=c[e].element.css("display")!="none";if(!c[e].visible){continue}if(g=="mousedown"){c[e]._activate.call(c[e],h)}c[e].offset=c[e].element.offset();c[e].proportions={width:c[e].element[0].offsetWidth,height:c[e].element[0].offsetHeight}}},drop:function(c,d){var e=false;a.each(a.ui.ddmanager.droppables[c.options.scope]||[],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(c,this,this.options.tolerance)){e=e||this._drop.call(this,d)}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(c.currentItem||c.element))){this.isout=1;this.isover=0;this._deactivate.call(this,d)}});return e},dragStart:function(c,d){c.element.parents(":not(body,html)").bind("scroll.droppable",function(){if(!c.options.refreshPositions){a.ui.ddmanager.prepareOffsets(c,d)}})},drag:function(c,d){if(c.options.refreshPositions){a.ui.ddmanager.prepareOffsets(c,d)}a.each(a.ui.ddmanager.droppables[c.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var f=a.ui.intersect(c,this,this.options.tolerance);var h=!f&&this.isover==1?"isout":(f&&this.isover==0?"isover":null);if(!h){return}var g;if(this.options.greedy){var e=this.element.parents(":data(droppable):eq(0)");if(e.length){g=a.data(e[0],"droppable");g.greedyChild=(h=="isover"?1:0)}}if(g&&h=="isover"){g.isover=0;g.isout=1;g._out.call(g,d)}this[h]=1;this[h=="isout"?"isover":"isout"]=0;this[h=="isover"?"_over":"_out"].call(this,d);if(g&&h=="isout"){g.isout=0;g.isover=1;g._over.call(g,d)}})},dragStop:function(c,d){c.element.parents(":not(body,html)").unbind("scroll.droppable");if(!c.options.refreshPositions){a.ui.ddmanager.prepareOffsets(c,d)}}}})(jq);(function(c,d){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var f=this,l=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(l.aspectRatio),aspectRatio:l.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:l.helper||l.ghost||l.animate?l.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=l.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var m=this.handles.split(",");this.handles={};for(var g=0;g<m.length;g++){var j=c.trim(m[g]),e="ui-resizable-"+j;var h=c('<div class="ui-resizable-handle '+e+'"></div>');if(/sw|se|ne|nw/.test(j)){h.css({zIndex:++l.zIndex})}if("se"==j){h.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[j]=".ui-resizable-"+j;this.element.append(h)}}this._renderAxis=function(r){r=r||this.element;for(var o in this.handles){if(this.handles[o].constructor==String){this.handles[o]=c(this.handles[o],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var p=c(this.handles[o],this.element),q=0;q=/sw|ne|nw|se|n|s/.test(o)?p.outerHeight():p.outerWidth();var n=["padding",/ne|nw|n/.test(o)?"Top":/se|sw|s/.test(o)?"Bottom":/^e$/.test(o)?"Right":"Left"].join("");r.css(n,q);this._proportionallyResize()}if(!c(this.handles[o]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!f.resizing){if(this.className){var n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}f.axis=n&&n[1]?n[1]:"se"}});if(l.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){if(l.disabled){return}c(this).removeClass("ui-resizable-autohide");f._handles.show()},function(){if(l.disabled){return}if(!f.resizing){c(this).addClass("ui-resizable-autohide");f._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(g){c(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(f){var g=false;for(var e in this.handles){if(c(this.handles[e])[0]==f.target){g=true}}return !this.options.disabled&&g},_mouseStart:function(g){var l=this.options,f=this.element.position(),e=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(e.is(".ui-draggable")||(/absolute/).test(e.css("position"))){e.css({position:"absolute",top:f.top,left:f.left})}if(c.browser.opera&&(/relative/).test(e.css("position"))){e.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var m=b(this.helper.css("left")),h=b(this.helper.css("top"));if(l.containment){m+=c(l.containment).scrollLeft()||0;h+=c(l.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:m,top:h};this.size=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalSize=this._helper?{width:e.outerWidth(),height:e.outerHeight()}:{width:e.width(),height:e.height()};this.originalPosition={left:m,top:h};this.sizeDiff={width:e.outerWidth()-e.width(),height:e.outerHeight()-e.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=(typeof l.aspectRatio=="number")?l.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var j=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",j=="auto"?this.axis+"-resize":j);e.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(e){var h=this.helper,g=this.options,p={},s=this,l=this.originalMousePosition,q=this.axis;var u=(e.pageX-l.left)||0,r=(e.pageY-l.top)||0;var j=this._change[q];if(!j){return false}var n=j.apply(this,[e,u,r]),m=c.browser.msie&&c.browser.version<7,f=this.sizeDiff;this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey){n=this._updateRatio(n,e)}n=this._respectSize(n,e);this._propagate("resize",e);h.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(n);this._trigger("resize",e,this.ui());return false},_mouseStop:function(h){this.resizing=false;var j=this.options,p=this;if(this._helper){var g=this._proportionallyResizeElements,e=g.length&&(/textarea/i).test(g[0].nodeName),f=e&&c.ui.hasScroll(g[0],"left")?0:p.sizeDiff.height,m=e?0:p.sizeDiff.width;var q={width:(p.helper.width()-m),height:(p.helper.height()-f)},l=(parseInt(p.element.css("left"),10)+(p.position.left-p.originalPosition.left))||null,n=(parseInt(p.element.css("top"),10)+(p.position.top-p.originalPosition.top))||null;if(!j.animate){this.element.css(c.extend(q,{top:n,left:l}))}p.helper.height(p.size.height);p.helper.width(p.size.width);if(this._helper&&!j.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",h);if(this._helper){this.helper.remove()}return false},_updateVirtualBoundaries:function(g){var l=this.options,j,h,f,m,e;e={minWidth:a(l.minWidth)?l.minWidth:0,maxWidth:a(l.maxWidth)?l.maxWidth:Infinity,minHeight:a(l.minHeight)?l.minHeight:0,maxHeight:a(l.maxHeight)?l.maxHeight:Infinity};if(this._aspectRatio||g){j=e.minHeight*this.aspectRatio;f=e.minWidth/this.aspectRatio;h=e.maxHeight*this.aspectRatio;m=e.maxWidth/this.aspectRatio;if(j>e.minWidth){e.minWidth=j}if(f>e.minHeight){e.minHeight=f}if(h<e.maxWidth){e.maxWidth=h}if(m<e.maxHeight){e.maxHeight=m}}this._vBoundaries=e},_updateCache:function(e){var f=this.options;this.offset=this.helper.offset();if(a(e.left)){this.position.left=e.left}if(a(e.top)){this.position.top=e.top}if(a(e.height)){this.size.height=e.height}if(a(e.width)){this.size.width=e.width}},_updateRatio:function(h,g){var j=this.options,l=this.position,f=this.size,e=this.axis;if(a(h.height)){h.width=(h.height*this.aspectRatio)}else{if(a(h.width)){h.height=(h.width/this.aspectRatio)}}if(e=="sw"){h.left=l.left+(f.width-h.width);h.top=null}if(e=="nw"){h.top=l.top+(f.height-h.height);h.left=l.left+(f.width-h.width)}return h},_respectSize:function(n,g){var l=this.helper,j=this._vBoundaries,u=this._aspectRatio||g.shiftKey,s=this.axis,w=a(n.width)&&j.maxWidth&&(j.maxWidth<n.width),p=a(n.height)&&j.maxHeight&&(j.maxHeight<n.height),h=a(n.width)&&j.minWidth&&(j.minWidth>n.width),v=a(n.height)&&j.minHeight&&(j.minHeight>n.height);if(h){n.width=j.minWidth}if(v){n.height=j.minHeight}if(w){n.width=j.maxWidth}if(p){n.height=j.maxHeight}var f=this.originalPosition.left+this.originalSize.width,r=this.position.top+this.size.height;var m=/sw|nw|w/.test(s),e=/nw|ne|n/.test(s);if(h&&m){n.left=f-j.minWidth}if(w&&m){n.left=f-j.maxWidth}if(v&&e){n.top=r-j.minHeight}if(p&&e){n.top=r-j.maxHeight}var q=!n.width&&!n.height;if(q&&!n.left&&n.top){n.top=null}else{if(q&&!n.top&&n.left){n.left=null}}return n},_proportionallyResize:function(){var l=this.options;if(!this._proportionallyResizeElements.length){return}var g=this.helper||this.element;for(var f=0;f<this._proportionallyResizeElements.length;f++){var h=this._proportionallyResizeElements[f];if(!this.borderDif){var e=[h.css("borderTopWidth"),h.css("borderRightWidth"),h.css("borderBottomWidth"),h.css("borderLeftWidth")],j=[h.css("paddingTop"),h.css("paddingRight"),h.css("paddingBottom"),h.css("paddingLeft")];this.borderDif=c.map(e,function(m,o){var n=parseInt(m,10)||0,p=parseInt(j[o],10)||0;return n+p})}if(c.browser.msie&&!(!(c(g).is(":hidden")||c(g).parents(":hidden").length))){continue}h.css({height:(g.height()-this.borderDif[0]-this.borderDif[2])||0,width:(g.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var f=this.element,j=this.options;this.elementOffset=f.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var e=c.browser.msie&&c.browser.version<7,g=(e?1:0),h=(e?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+h,height:this.element.outerHeight()+h,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++j.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(g,f,e){return{width:this.originalSize.width+f}},w:function(h,f,e){var l=this.options,g=this.originalSize,j=this.originalPosition;return{left:j.left+f,width:g.width-f}},n:function(h,f,e){var l=this.options,g=this.originalSize,j=this.originalPosition;return{top:j.top+e,height:g.height-e}},s:function(g,f,e){return{height:this.originalSize.height+e}},se:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},sw:function(g,f,e){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f,e]))},ne:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,e]))},nw:function(g,f,e){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,e]))}},_propagate:function(f,e){c.ui.plugin.call(this,f,[e,this.ui()]);(f!="resize"&&this._trigger(f,e,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.16"});c.ui.plugin.add("resizable","alsoResize",{start:function(f,g){var e=c(this).data("resizable"),j=e.options;var h=function(l){c(l).each(function(){var m=c(this);m.data("resizable-alsoresize",{width:parseInt(m.width(),10),height:parseInt(m.height(),10),left:parseInt(m.css("left"),10),top:parseInt(m.css("top"),10),position:m.css("position")})})};if(typeof(j.alsoResize)=="object"&&!j.alsoResize.parentNode){if(j.alsoResize.length){j.alsoResize=j.alsoResize[0];h(j.alsoResize)}else{c.each(j.alsoResize,function(l){h(l)})}}else{h(j.alsoResize)}},resize:function(g,j){var f=c(this).data("resizable"),l=f.options,h=f.originalSize,n=f.originalPosition;var m={height:(f.size.height-h.height)||0,width:(f.size.width-h.width)||0,top:(f.position.top-n.top)||0,left:(f.position.left-n.left)||0},e=function(o,p){c(o).each(function(){var s=c(this),u=c(this).data("resizable-alsoresize"),r={},q=p&&p.length?p:s.parents(j.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(q,function(v,x){var w=(u[x]||0)+(m[x]||0);if(w&&w>=0){r[x]=w||null}});if(c.browser.opera&&/relative/.test(s.css("position"))){f._revertToRelativePosition=true;s.css({position:"absolute",top:"auto",left:"auto"})}s.css(r)})};if(typeof(l.alsoResize)=="object"&&!l.alsoResize.nodeType){c.each(l.alsoResize,function(o,p){e(o,p)})}else{e(l.alsoResize)}},stop:function(g,h){var f=c(this).data("resizable"),j=f.options;var e=function(l){c(l).each(function(){var m=c(this);m.css({position:m.data("resizable-alsoresize").position})})};if(f._revertToRelativePosition){f._revertToRelativePosition=false;if(typeof(j.alsoResize)=="object"&&!j.alsoResize.nodeType){c.each(j.alsoResize,function(l){e(l)})}else{e(j.alsoResize)}}c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(j,q){var r=c(this).data("resizable"),l=r.options;var h=r._proportionallyResizeElements,e=h.length&&(/textarea/i).test(h[0].nodeName),f=e&&c.ui.hasScroll(h[0],"left")?0:r.sizeDiff.height,n=e?0:r.sizeDiff.width;var g={width:(r.size.width-n),height:(r.size.height-f)},m=(parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left))||null,p=(parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top))||null;r.element.animate(c.extend(g,p&&m?{top:p,left:m}:{}),{duration:l.animateDuration,easing:l.animateEasing,step:function(){var o={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};if(h&&h.length){c(h[0]).css({width:o.width,height:o.height})}r._updateCache(o);r._propagate("resize",j)}})}});c.ui.plugin.add("resizable","containment",{start:function(f,u){var w=c(this).data("resizable"),l=w.options,n=w.element;var g=l.containment,m=(g instanceof c)?g.get(0):(/parent/.test(g))?n.parent().get(0):g;if(!m){return}w.containerElement=c(m);if(/document/.test(g)||g==document){w.containerOffset={left:0,top:0};w.containerPosition={left:0,top:0};w.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var r=c(m),j=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){j[p]=b(r.css("padding"+o))});w.containerOffset=r.offset();w.containerPosition=r.position();w.containerSize={height:(r.innerHeight()-j[3]),width:(r.innerWidth()-j[1])};var s=w.containerOffset,e=w.containerSize.height,q=w.containerSize.width,h=(c.ui.hasScroll(m,"left")?m.scrollWidth:q),v=(c.ui.hasScroll(m)?m.scrollHeight:e);w.parentData={element:m,left:s.left,top:s.top,width:h,height:v}}},resize:function(g,s){var w=c(this).data("resizable"),j=w.options,f=w.containerSize,r=w.containerOffset,p=w.size,q=w.position,u=w._aspectRatio||g.shiftKey,e={top:0,left:0},h=w.containerElement;if(h[0]!=document&&(/static/).test(h.css("position"))){e=r}if(q.left<(w._helper?r.left:0)){w.size.width=w.size.width+(w._helper?(w.position.left-r.left):(w.position.left-e.left));if(u){w.size.height=w.size.width/j.aspectRatio}w.position.left=j.helper?r.left:0}if(q.top<(w._helper?r.top:0)){w.size.height=w.size.height+(w._helper?(w.position.top-r.top):w.position.top);if(u){w.size.width=w.size.height*j.aspectRatio}w.position.top=w._helper?r.top:0}w.offset.left=w.parentData.left+w.position.left;w.offset.top=w.parentData.top+w.position.top;var n=Math.abs((w._helper?w.offset.left-e.left:(w.offset.left-e.left))+w.sizeDiff.width),v=Math.abs((w._helper?w.offset.top-e.top:(w.offset.top-r.top))+w.sizeDiff.height);var m=w.containerElement.get(0)==w.element.parent().get(0),l=/relative|absolute/.test(w.containerElement.css("position"));if(m&&l){n-=w.parentData.left}if(n+w.size.width>=w.parentData.width){w.size.width=w.parentData.width-n;if(u){w.size.height=w.size.width/w.aspectRatio}}if(v+w.size.height>=w.parentData.height){w.size.height=w.parentData.height-v;if(u){w.size.width=w.size.height*w.aspectRatio}}},stop:function(f,q){var s=c(this).data("resizable"),g=s.options,n=s.position,p=s.containerOffset,e=s.containerPosition,j=s.containerElement;var l=c(s.helper),u=l.offset(),r=l.outerWidth()-s.sizeDiff.width,m=l.outerHeight()-s.sizeDiff.height;if(s._helper&&!g.animate&&(/relative/).test(j.css("position"))){c(this).css({left:u.left-e.left-p.left,width:r,height:m})}if(s._helper&&!g.animate&&(/static/).test(j.css("position"))){c(this).css({left:u.left-e.left-p.left,width:r,height:m})}}});c.ui.plugin.add("resizable","ghost",{start:function(g,h){var e=c(this).data("resizable"),j=e.options,f=e.size;e.ghost=e.originalElement.clone();e.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof j.ghost=="string"?j.ghost:"");e.ghost.appendTo(e.helper)},resize:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost){e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})}},stop:function(f,g){var e=c(this).data("resizable"),h=e.options;if(e.ghost&&e.helper){e.helper.get(0).removeChild(e.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(e,p){var r=c(this).data("resizable"),h=r.options,m=r.size,j=r.originalSize,l=r.originalPosition,q=r.axis,n=h._aspectRatio||e.shiftKey;h.grid=typeof h.grid=="number"?[h.grid,h.grid]:h.grid;var g=Math.round((m.width-j.width)/(h.grid[0]||1))*(h.grid[0]||1),f=Math.round((m.height-j.height)/(h.grid[1]||1))*(h.grid[1]||1);if(/^(se|s|e)$/.test(q)){r.size.width=j.width+g;r.size.height=j.height+f}else{if(/^(ne)$/.test(q)){r.size.width=j.width+g;r.size.height=j.height+f;r.position.top=l.top-f}else{if(/^(sw)$/.test(q)){r.size.width=j.width+g;r.size.height=j.height+f;r.position.left=l.left-g}else{r.size.width=j.width+g;r.size.height=j.height+f;r.position.top=l.top-f;r.position.left=l.left-g}}}}});var b=function(e){return parseInt(e,10)||0};var a=function(e){return !isNaN(parseInt(e,10))}})(jq);(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var d;this.refresh=function(){d=a(c.options.filter,c.element[0]);d.each(function(){var e=a(this);var f=e.offset();a.data(this,"selectable-item",{element:this,$element:e,left:f.left,top:f.top,right:f.left+e.outerWidth(),bottom:f.top+e.outerHeight(),startselected:false,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})};this.refresh();this.selectees=d.addClass("ui-selectee");this._mouseInit();this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(e){var c=this;this.opos=[e.pageX,e.pageY];if(this.options.disabled){return}var d=this.options;this.selectees=a(d.filter,this.element[0]);this._trigger("start",e);a(d.appendTo).append(this.helper);this.helper.css({left:e.clientX,top:e.clientY,width:0,height:0});if(d.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var f=a.data(this,"selectable-item");f.startselected=true;if(!e.metaKey){f.$element.removeClass("ui-selected");f.selected=false;f.$element.addClass("ui-unselecting");f.unselecting=true;c._trigger("unselecting",e,{unselecting:f.element})}});a(e.target).parents().andSelf().each(function(){var g=a.data(this,"selectable-item");if(g){var f=!e.metaKey||!g.$element.hasClass("ui-selected");g.$element.removeClass(f?"ui-unselecting":"ui-selected").addClass(f?"ui-selecting":"ui-unselecting");g.unselecting=!f;g.selecting=f;g.selected=f;if(f){c._trigger("selecting",e,{selecting:g.element})}else{c._trigger("unselecting",e,{unselecting:g.element})}return false}})},_mouseDrag:function(l){var d=this;this.dragged=true;if(this.options.disabled){return}var f=this.options;var e=this.opos[0],j=this.opos[1],c=l.pageX,h=l.pageY;if(e>c){var g=c;c=e;e=g}if(j>h){var g=h;h=j;j=g}this.helper.css({left:e,top:j,width:c-e,height:h-j});this.selectees.each(function(){var m=a.data(this,"selectable-item");if(!m||m.element==d.element[0]){return}var n=false;if(f.tolerance=="touch"){n=(!(m.left>c||m.right<e||m.top>h||m.bottom<j))}else{if(f.tolerance=="fit"){n=(m.left>e&&m.right<c&&m.top>j&&m.bottom<h)}}if(n){if(m.selected){m.$element.removeClass("ui-selected");m.selected=false}if(m.unselecting){m.$element.removeClass("ui-unselecting");m.unselecting=false}if(!m.selecting){m.$element.addClass("ui-selecting");m.selecting=true;d._trigger("selecting",l,{selecting:m.element})}}else{if(m.selecting){if(l.metaKey&&m.startselected){m.$element.removeClass("ui-selecting");m.selecting=false;m.$element.addClass("ui-selected");m.selected=true}else{m.$element.removeClass("ui-selecting");m.selecting=false;if(m.startselected){m.$element.addClass("ui-unselecting");m.unselecting=true}d._trigger("unselecting",l,{unselecting:m.element})}}if(m.selected){if(!l.metaKey&&!m.startselected){m.$element.removeClass("ui-selected");m.selected=false;m.$element.addClass("ui-unselecting");m.unselecting=true;d._trigger("unselecting",l,{unselecting:m.element})}}}});return false},_mouseStop:function(e){var c=this;this.dragged=false;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var f=a.data(this,"selectable-item");f.$element.removeClass("ui-unselecting");f.unselecting=false;f.startselected=false;c._trigger("unselected",e,{unselected:f.element})});a(".ui-selecting",this.element[0]).each(function(){var f=a.data(this,"selectable-item");f.$element.removeClass("ui-selecting").addClass("ui-selected");f.selecting=false;f.selected=true;f.startselected=true;c._trigger("selected",e,{selected:f.element})});this._trigger("stop",e);this.helper.remove();return false}});a.extend(a.ui.selectable,{version:"1.8.16"})})(jq);(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000},_create:function(){var c=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?c.axis==="x"||(/left|right/).test(this.items[0].item.css("float"))||(/inline|table-cell/).test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var c=this.items.length-1;c>=0;c--){this.items[c].item.removeData("sortable-item")}return this},_setOption:function(c,d){if(c==="disabled"){this.options[c]=d;this.widget()[d?"addClass":"removeClass"]("ui-sortable-disabled")}else{a.Widget.prototype._setOption.apply(this,arguments)}},_mouseCapture:function(f,g){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(f);var e=null,d=this,c=a(f.target).parents().each(function(){if(a.data(this,"sortable-item")==d){e=a(this);return false}});if(a.data(f.target,"sortable-item")==d){e=a(f.target)}if(!e){return false}if(this.options.handle&&!g){var h=false;a(this.options.handle,e).find("*").andSelf().each(function(){if(this==f.target){h=true}});if(!h){return false}}this.currentItem=e;this._removeCurrentsFromItems();return true},_mouseStart:function(f,g,c){var h=this.options,d=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(f);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:f.pageX-this.offset.left,top:f.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(f);this.originalPageX=f.pageX;this.originalPageY=f.pageY;(h.cursorAt&&this._adjustOffsetFromHelper(h.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(h.containment){this._setContainment()}if(h.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",h.cursor)}if(h.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",h.opacity)}if(h.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",h.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",f,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!c){for(var e=this.containers.length-1;e>=0;e--){this.containers[e]._trigger("activate",f,d._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!h.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(f);return true},_mouseDrag:function(g){this.position=this._generatePosition(g);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var h=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-g.pageY<h.scrollSensitivity){this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+h.scrollSpeed}else{if(g.pageY-this.overflowOffset.top<h.scrollSensitivity){this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-h.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-g.pageX<h.scrollSensitivity){this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+h.scrollSpeed}else{if(g.pageX-this.overflowOffset.left<h.scrollSensitivity){this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-h.scrollSpeed}}}else{if(g.pageY-a(document).scrollTop()<h.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()-h.scrollSpeed)}else{if(a(window).height()-(g.pageY-a(document).scrollTop())<h.scrollSensitivity){c=a(document).scrollTop(a(document).scrollTop()+h.scrollSpeed)}}if(g.pageX-a(document).scrollLeft()<h.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()-h.scrollSpeed)}else{if(a(window).width()-(g.pageX-a(document).scrollLeft())<h.scrollSensitivity){c=a(document).scrollLeft(a(document).scrollLeft()+h.scrollSpeed)}}}if(c!==false&&a.ui.ddmanager&&!h.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,g)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],d=f.item[0],j=this._intersectsWithPointer(f);if(!j){continue}if(d!=this.currentItem[0]&&this.placeholder[j==1?"next":"prev"]()[0]!=d&&!a.ui.contains(this.placeholder[0],d)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],d):true)){this.direction=j==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f)){this._rearrange(g,f)}else{break}this._trigger("change",g,this._uiHash());break}}this._contactContainers(g);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,g)}this._trigger("sort",g,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(d,e){if(!d){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,d)}if(this.options.revert){var c=this;var f=c.placeholder.offset();c.reverting=true;a(this.helper).animate({left:f.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:f.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(d)})}else{this._clear(d,e)}return false},cancel:function(){var c=this;if(this.dragging){this._mouseUp({target:null});if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("deactivate",null,c._uiHash(this));if(this.containers[d].containerCache.over){this.containers[d]._trigger("out",null,c._uiHash(this));this.containers[d].containerCache.over=0}}}if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(e){var c=this._getItemsAsjQuery(e&&e.connected);var d=[];e=e||{};a(c).each(function(){var f=(a(e.item||this).attr(e.attribute||"id")||"").match(e.expression||(/(.+)[-=_](.+)/));if(f){d.push((e.key||f[1]+"[]")+"="+(e.key&&e.expression?f[1]:f[2]))}});if(!d.length&&e.key){d.push(e.key+"=")}return d.join("&")},toArray:function(e){var c=this._getItemsAsjQuery(e&&e.connected);var d=[];e=e||{};c.each(function(){d.push(a(e.item||this).attr(e.attribute||"id")||"")});return d},_intersectsWith:function(o){var e=this.positionAbs.left,d=e+this.helperProportions.width,n=this.positionAbs.top,m=n+this.helperProportions.height;var f=o.left,c=f+o.width,p=o.top,j=p+o.height;var q=this.offset.click.top,h=this.offset.click.left;var g=(n+q)>p&&(n+q)<j&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>o[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&p<n+(this.helperProportions.height/2)&&m-(this.helperProportions.height/2)<j)}},_intersectsWithPointer:function(e){var f=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),h=f&&d,c=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!h){return false}return this.floating?(((g&&g=="right")||c=="down")?2:1):(c&&(c=="down"?2:1))},_intersectsWithSides:function(f){var d=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,f.top+(f.height/2),f.height),e=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,f.left+(f.width/2),f.width),c=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(this.floating&&g){return((g=="right"&&e)||(g=="left"&&!e))}else{return c&&((c=="down"&&d)||(c=="up"&&!d))}},_getDragVerticalDirection:function(){var c=this.positionAbs.top-this.lastPositionAbs.top;return c!=0&&(c>0?"down":"up")},_getDragHorizontalDirection:function(){var c=this.positionAbs.left-this.lastPositionAbs.left;return c!=0&&(c>0?"right":"left")},refresh:function(c){this._refreshItems(c);this.refreshPositions();return this},_connectWith:function(){var c=this.options;return c.connectWith.constructor==String?[c.connectWith]:c.connectWith},_getItemsAsjQuery:function(c){var n=this;var h=[];var f=[];var l=this._connectWith();if(l&&c){for(var e=l.length-1;e>=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element):a(g.options.items,g.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),g])}}}}f.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var e=f.length-1;e>=0;e--){f[e][0].each(function(){h.push(this)})}return a(h)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data(sortable-item)");for(var d=0;d<this.items.length;d++){for(var c=0;c<e.length;c++){if(e[c]==this.items[d].item[0]){this.items.splice(d,1)}}}},_refreshItems:function(c){this.items=[];this.containers=[this];var l=this.items;var r=this;var g=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],c,{item:this.currentItem}):a(this.options.items,this.element),this]];var n=this._connectWith();if(n){for(var f=n.length-1;f>=0;f--){var o=a(n[f]);for(var e=o.length-1;e>=0;e--){var h=a.data(o[e],"sortable");if(h&&h!=this&&!h.options.disabled){g.push([a.isFunction(h.options.items)?h.options.items.call(h.element[0],c,{item:this.currentItem}):a(h.options.items,h.element),h]);this.containers.push(h)}}}}for(var f=g.length-1;f>=0;f--){var m=g[f][1];var d=g[f][0];for(var e=0,p=d.length;e<p;e++){var q=a(d[e]);q.data("sortable-item",m);l.push({item:q,instance:m,width:0,height:0,left:0,top:0})}}},refreshPositions:function(c){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var e=this.items.length-1;e>=0;e--){var f=this.items[e];if(f.instance!=this.currentContainer&&this.currentContainer&&f.item[0]!=this.currentItem[0]){continue}var d=this.options.toleranceElement?a(this.options.toleranceElement,f.item):f.item;if(!c){f.width=d.outerWidth();f.height=d.outerHeight()}var g=d.offset();f.left=g.left;f.top=g.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var e=this.containers.length-1;e>=0;e--){var g=this.containers[e].element.offset();this.containers[e].containerCache.left=g.left;this.containers[e].containerCache.top=g.top;this.containers[e].containerCache.width=this.containers[e].element.outerWidth();this.containers[e].containerCache.height=this.containers[e].element.outerHeight()}}return this},_createPlaceholder:function(e){var c=e||this,f=c.options;if(!f.placeholder||f.placeholder.constructor==String){var d=f.placeholder;f.placeholder={element:function(){var g=a(document.createElement(c.currentItem[0].nodeName)).addClass(d||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!d){g.style.visibility="hidden"}return g},update:function(g,h){if(d&&!f.forcePlaceholderSize){return}if(!h.height()){h.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10))}if(!h.width()){h.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}}c.placeholder=a(f.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);f.placeholder.update(c,c.placeholder)},_contactContainers:function(c){var e=null,m=null;for(var g=this.containers.length-1;g>=0;g--){if(a.ui.contains(this.currentItem[0],this.containers[g].element[0])){continue}if(this._intersectsWith(this.containers[g].containerCache)){if(e&&a.ui.contains(this.containers[g].element[0],e.element[0])){continue}e=this.containers[g];m=g}else{if(this.containers[g].containerCache.over){this.containers[g]._trigger("out",c,this._uiHash(this));this.containers[g].containerCache.over=0}}}if(!e){return}if(this.containers.length===1){this.containers[m]._trigger("over",c,this._uiHash(this));this.containers[m].containerCache.over=1}else{if(this.currentContainer!=this.containers[m]){var l=10000;var h=null;var d=this.positionAbs[this.containers[m].floating?"left":"top"];for(var f=this.items.length-1;f>=0;f--){if(!a.ui.contains(this.containers[m].element[0],this.items[f].item[0])){continue}var n=this.items[f][this.containers[m].floating?"left":"top"];if(Math.abs(n-d)<l){l=Math.abs(n-d);h=this.items[f]}}if(!h&&!this.options.dropOnEmpty){return}this.currentContainer=this.containers[m];h?this._rearrange(c,h,null,true):this._rearrange(c,null,this.containers[m].element,true);this._trigger("change",c,this._uiHash());this.containers[m]._trigger("change",c,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[m]._trigger("over",c,this._uiHash(this));this.containers[m].containerCache.over=1}}},_createHelper:function(d){var e=this.options;var c=a.isFunction(e.helper)?a(e.helper.apply(this.element[0],[d,this.currentItem])):(e.helper=="clone"?this.currentItem.clone():this.currentItem);if(!c.parents("body").length){a(e.appendTo!="parent"?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(c[0])}if(c[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(c[0].style.width==""||e.forceHelperSize){c.width(this.currentItem.width())}if(c[0].style.height==""||e.forceHelperSize){c.height(this.currentItem.height())}return c},_adjustOffsetFromHelper:function(c){if(typeof c=="string"){c=c.split(" ")}if(a.isArray(c)){c={left:+c[0],top:+c[1]||0}}if("left" in c){this.offset.click.left=c.left+this.margins.left}if("right" in c){this.offset.click.left=this.helperProportions.width-c.right+this.margins.left}if("top" in c){this.offset.click.top=c.top+this.margins.top}if("bottom" in c){this.offset.click.top=this.helperProportions.height-c.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){c.left+=this.scrollParent.scrollLeft();c.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){c={top:0,left:0}}return{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var c=this.currentItem.position();return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:c.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var f=this.options;if(f.containment=="parent"){f.containment=this.helper[0].parentNode}if(f.containment=="document"||f.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(f.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(f.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(f.containment)){var d=a(f.containment)[0];var e=a(f.containment).offset();var c=(a(d).css("overflow")!="hidden");this.containment=[e.left+(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0)-this.margins.top,e.left+(c?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(c?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(g,j){if(!j){j=this.position}var e=g=="absolute"?1:-1;var f=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,h=(/(html|body)/i).test(c[0].tagName);return{top:(j.top+this.offset.relative.top*e+this.offset.parent.top*e-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(h?0:c.scrollTop()))*e)),left:(j.left+this.offset.relative.left*e+this.offset.parent.left*e-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():h?0:c.scrollLeft())*e))}},_generatePosition:function(f){var j=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,l=(/(html|body)/i).test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var e=f.pageX;var d=f.pageY;if(this.originalPosition){if(this.containment){if(f.pageX-this.offset.click.left<this.containment[0]){e=this.containment[0]+this.offset.click.left}if(f.pageY-this.offset.click.top<this.containment[1]){d=this.containment[1]+this.offset.click.top}if(f.pageX-this.offset.click.left>this.containment[2]){e=this.containment[2]+this.offset.click.left}if(f.pageY-this.offset.click.top>this.containment[3]){d=this.containment[3]+this.offset.click.top}}if(j.grid){var h=this.originalPageY+Math.round((d-this.originalPageY)/j.grid[1])*j.grid[1];d=this.containment?(!(h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3])?h:(!(h-this.offset.click.top<this.containment[1])?h-j.grid[1]:h+j.grid[1])):h;var g=this.originalPageX+Math.round((e-this.originalPageX)/j.grid[0])*j.grid[0];e=this.containment?(!(g-this.offset.click.left<this.containment[0]||g-this.offset.click.left>this.containment[2])?g:(!(g-this.offset.click.left<this.containment[0])?g-j.grid[0]:g+j.grid[0])):g}}return{top:(d-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(l?0:c.scrollTop())))),left:(e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():l?0:c.scrollLeft())))}},_rearrange:function(h,g,d,f){d?d[0].appendChild(this.placeholder[0]):g.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?g.item[0]:g.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var e=this,c=this.counter;window.setTimeout(function(){if(c==e.counter){e.refreshPositions(!f)}},0)},_clear:function(e,f){this.reverting=false;var g=[],c=this;if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var d in this._storedCSS){if(this._storedCSS[d]=="auto"||this._storedCSS[d]=="static"){this._storedCSS[d]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!f){g.push(function(h){this._trigger("receive",h,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!f){g.push(function(h){this._trigger("update",h,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!f){g.push(function(h){this._trigger("remove",h,this._uiHash())})}for(var d=this.containers.length-1;d>=0;d--){if(a.ui.contains(this.containers[d].element[0],this.currentItem[0])&&!f){g.push((function(h){return function(j){h._trigger("receive",j,this._uiHash(this))}}).call(this,this.containers[d]));g.push((function(h){return function(j){h._trigger("update",j,this._uiHash(this))}}).call(this,this.containers[d]))}}}for(var d=this.containers.length-1;d>=0;d--){if(!f){g.push((function(h){return function(j){h._trigger("deactivate",j,this._uiHash(this))}}).call(this,this.containers[d]))}if(this.containers[d].containerCache.over){g.push((function(h){return function(j){h._trigger("out",j,this._uiHash(this))}}).call(this,this.containers[d]));this.containers[d].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!f){this._trigger("beforeStop",e,this._uiHash());for(var d=0;d<g.length;d++){g[d].call(this,e)}this._trigger("stop",e,this._uiHash())}return false}if(!f){this._trigger("beforeStop",e,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!f){for(var d=0;d<g.length;d++){g[d].call(this,e)}this._trigger("stop",e,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(d){var c=d||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:d?d.element:null}}});a.extend(a.ui.sortable,{version:"1.8.16"})})(jq);(function(a,b){var c=0;a.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 d=this,f=this.element[0].ownerDocument,e;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(g){if(d.options.disabled||d.element.propAttr("readOnly")){return}e=false;var h=a.ui.keyCode;switch(g.keyCode){case h.PAGE_UP:d._move("previousPage",g);break;case h.PAGE_DOWN:d._move("nextPage",g);break;case h.UP:d._move("previous",g);g.preventDefault();break;case h.DOWN:d._move("next",g);g.preventDefault();break;case h.ENTER:case h.NUMPAD_ENTER:if(d.menu.active){e=true;g.preventDefault()}case h.TAB:if(!d.menu.active){return}d.menu.select(g);break;case h.ESCAPE:d.element.val(d.term);d.close(g);break;default:clearTimeout(d.searching);d.searching=setTimeout(function(){if(d.term!=d.element.val()){d.selectedItem=null;d.search(null,g)}},d.options.delay);break}}).bind("keypress.autocomplete",function(g){if(e){e=false;g.preventDefault()}}).bind("focus.autocomplete",function(){if(d.options.disabled){return}d.selectedItem=null;d.previous=d.element.val()}).bind("blur.autocomplete",function(g){if(d.options.disabled){return}clearTimeout(d.searching);d.closing=setTimeout(function(){d.close(g);d._change(g)},150)});this._initSource();this.response=function(){return d._response.apply(d,arguments)};this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",f)[0]).mousedown(function(g){var h=d.menu.element[0];if(!a(g.target).closest(".ui-menu-item").length){setTimeout(function(){a(document).one("mousedown",function(j){if(j.target!==d.element[0]&&j.target!==h&&!a.ui.contains(h,j.target)){d.close()}})},1)}setTimeout(function(){clearTimeout(d.closing)},13)}).menu({focus:function(h,j){var g=j.item.data("item.autocomplete");if(false!==d._trigger("focus",h,{item:g})){if(/^key/.test(h.originalEvent.type)){d.element.val(g.value)}}},selected:function(j,l){var h=l.item.data("item.autocomplete"),g=d.previous;if(d.element[0]!==f.activeElement){d.element.focus();d.previous=g;setTimeout(function(){d.previous=g;d.selectedItem=h},1)}if(false!==d._trigger("select",j,{item:h})){d.element.val(h.value)}d.term=d.element.val();d.close(j);d.selectedItem=h},blur:function(g,h){if(d.menu.element.is(":visible")&&(d.element.val()!==d.term)){d.element.val(d.term)}}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(a.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();a.Widget.prototype.destroy.call(this)},_setOption:function(d,e){a.Widget.prototype._setOption.apply(this,arguments);if(d==="source"){this._initSource()}if(d==="appendTo"){this.menu.element.appendTo(a(e||"body",this.element[0].ownerDocument)[0])}if(d==="disabled"&&e&&this.xhr){this.xhr.abort()}},_initSource:function(){var d=this,f,e;if(a.isArray(this.options.source)){f=this.options.source;this.source=function(h,g){g(a.ui.autocomplete.filter(f,h.term))}}else{if(typeof this.options.source==="string"){e=this.options.source;this.source=function(h,g){if(d.xhr){d.xhr.abort()}d.xhr=a.ajax({url:e,data:h,dataType:"json",autocompleteRequest:++c,success:function(l,j){if(this.autocompleteRequest===c){g(l)}},error:function(){if(this.autocompleteRequest===c){g([])}}})}}else{this.source=this.options.source}}},search:function(e,d){e=e!=null?e:this.element.val();this.term=this.element.val();if(e.length<this.options.minLength){return this.close(d)}clearTimeout(this.closing);if(this._trigger("search",d)===false){return}return this._search(e)},_search:function(d){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:d},this.response)},_response:function(d){if(!this.options.disabled&&d&&d.length){d=this._normalize(d);this._suggest(d);this._trigger("open")}else{this.close()}this.pending--;if(!this.pending){this.element.removeClass("ui-autocomplete-loading")}},close:function(d){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",d)}},_change:function(d){if(this.previous!==this.element.val()){this._trigger("change",d,{item:this.selectedItem})}},_normalize:function(d){if(d.length&&d[0].label&&d[0].value){return d}return a.map(d,function(e){if(typeof e==="string"){return{label:e,value:e}}return a.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(d){var e=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(e,d);this.menu.deactivate();this.menu.refresh();e.show();this._resizeMenu();e.position(a.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next(new a.Event("mouseover"))}},_resizeMenu:function(){var d=this.menu.element;d.outerWidth(Math.max(d.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(f,e){var d=this;a.each(e,function(g,h){d._renderItem(f,h)})},_renderItem:function(d,e){return a("<li></li>").data("item.autocomplete",e).append(a("<a></a>").text(e.label)).appendTo(d)},_move:function(e,d){if(!this.menu.element.is(":visible")){this.search(null,d);return}if(this.menu.first()&&/^previous/.test(e)||this.menu.last()&&/^next/.test(e)){this.element.val(this.term);this.menu.deactivate();return}this.menu[e](d)},widget:function(){return this.menu.element}});a.extend(a.ui.autocomplete,{escapeRegex:function(d){return d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(f,d){var e=new RegExp(a.ui.autocomplete.escapeRegex(d),"i");return a.grep(f,function(g){return e.test(g.label||g.value||g)})}})}(jq));(function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length){return}c.preventDefault();b.select(c)});this.refresh()},refresh:function(){var c=this;var b=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");b.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(d){c.activate(d,a(this).parent())}).mouseleave(function(){c.deactivate()})},activate:function(e,d){this.deactivate();if(this.hasScroll()){var f=d.offset().top-this.element.offset().top,b=this.element.scrollTop(),c=this.element.height();if(f<0){this.element.scrollTop(b+f)}else{if(f>=c){this.element.scrollTop(b+f-c+d.height())}}}this.active=d.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:d})},deactivate:function(){if(!this.active){return}this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null},next:function(b){this.move("next",".ui-menu-item:first",b)},previous:function(b){this.move("prev",".ui-menu-item:last",b)},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,d,c){if(!this.active){this.activate(c,this.element.children(d));return}var b=this.active[e+"All"](".ui-menu-item").eq(0);if(b.length){this.activate(c,b)}else{this.activate(c,this.element.children(d))}},nextPage:function(d){if(this.hasScroll()){if(!this.active||this.last()){this.activate(d,this.element.children(".ui-menu-item:first"));return}var e=this.active.offset().top,c=this.element.height(),b=this.element.children(".ui-menu-item").filter(function(){var f=a(this).offset().top-e-c+a(this).height();return f<10&&f>-10});if(!b.length){b=this.element.children(".ui-menu-item:last")}this.activate(d,b)}else{this.activate(d,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))}},previousPage:function(c){if(this.hasScroll()){if(!this.active||this.first()){this.activate(c,this.element.children(".ui-menu-item:last"));return}var d=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var e=a(this).offset().top-d+b-a(this).height();return e<10&&e>-10});if(!result.length){result=this.element.children(".ui-menu-item:first")}this.activate(c,result)}else{this.activate(c,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))}},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(b){this._trigger("selected",b,{item:this.active})}})}(jq));(function(f,b){var m,e,a,h,j="ui-button ui-widget ui-state-default ui-corner-all",c="ui-state-hover ui-state-active ",g="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",l=function(){var n=f(this).find(":ui-button");setTimeout(function(){n.button("refresh")},1)},d=function(o){var n=o.name,p=o.form,q=f([]);if(n){if(p){q=f(p).find("[name='"+n+"']")}else{q=f("[name='"+n+"']",o.ownerDocument).filter(function(){return !this.form})}}return q};f.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!=="boolean"){this.options.disabled=this.element.propAttr("disabled")}this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var n=this,p=this.options,q=this.type==="checkbox"||this.type==="radio",r="ui-state-hover"+(!q?" ui-state-active":""),o="ui-state-focus";if(p.label===null){p.label=this.buttonElement.html()}if(this.element.is(":disabled")){p.disabled=true}this.buttonElement.addClass(j).attr("role","button").bind("mouseenter.button",function(){if(p.disabled){return}f(this).addClass("ui-state-hover");if(this===m){f(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){if(p.disabled){return}f(this).removeClass(r)}).bind("click.button",function(s){if(p.disabled){s.preventDefault();s.stopImmediatePropagation()}});this.element.bind("focus.button",function(){n.buttonElement.addClass(o)}).bind("blur.button",function(){n.buttonElement.removeClass(o)});if(q){this.element.bind("change.button",function(){if(h){return}n.refresh()});this.buttonElement.bind("mousedown.button",function(s){if(p.disabled){return}h=false;e=s.pageX;a=s.pageY}).bind("mouseup.button",function(s){if(p.disabled){return}if(e!==s.pageX||a!==s.pageY){h=true}})}if(this.type==="checkbox"){this.buttonElement.bind("click.button",function(){if(p.disabled||h){return false}f(this).toggleClass("ui-state-active");n.buttonElement.attr("aria-pressed",n.element[0].checked)})}else{if(this.type==="radio"){this.buttonElement.bind("click.button",function(){if(p.disabled||h){return false}f(this).addClass("ui-state-active");n.buttonElement.attr("aria-pressed","true");var s=n.element[0];d(s).not(s).map(function(){return f(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")})}else{this.buttonElement.bind("mousedown.button",function(){if(p.disabled){return false}f(this).addClass("ui-state-active");m=this;f(document).one("mouseup",function(){m=null})}).bind("mouseup.button",function(){if(p.disabled){return false}f(this).removeClass("ui-state-active")}).bind("keydown.button",function(s){if(p.disabled){return false}if(s.keyCode==f.ui.keyCode.SPACE||s.keyCode==f.ui.keyCode.ENTER){f(this).addClass("ui-state-active")}}).bind("keyup.button",function(){f(this).removeClass("ui-state-active")});if(this.buttonElement.is("a")){this.buttonElement.keyup(function(s){if(s.keyCode===f.ui.keyCode.SPACE){f(this).click()}})}}}this._setOption("disabled",p.disabled);this._resetButton()},_determineButtonType:function(){if(this.element.is(":checkbox")){this.type="checkbox"}else{if(this.element.is(":radio")){this.type="radio"}else{if(this.element.is("input")){this.type="input"}else{this.type="button"}}}if(this.type==="checkbox"||this.type==="radio"){var n=this.element.parents().filter(":last"),p="label[for='"+this.element.attr("id")+"']";this.buttonElement=n.find(p);if(!this.buttonElement.length){n=n.length?n.siblings():this.element.siblings();this.buttonElement=n.filter(p);if(!this.buttonElement.length){this.buttonElement=n.find(p)}}this.element.addClass("ui-helper-hidden-accessible");var o=this.element.is(":checked");if(o){this.buttonElement.addClass("ui-state-active")}this.buttonElement.attr("aria-pressed",o)}else{this.buttonElement=this.element}},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass(j+" "+c+" "+g).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());if(!this.hasTitle){this.buttonElement.removeAttr("title")}f.Widget.prototype.destroy.call(this)},_setOption:function(n,o){f.Widget.prototype._setOption.apply(this,arguments);if(n==="disabled"){if(o){this.element.propAttr("disabled",true)}else{this.element.propAttr("disabled",false)}return}this._resetButton()},refresh:function(){var n=this.element.is(":disabled");if(n!==this.options.disabled){this._setOption("disabled",n)}if(this.type==="radio"){d(this.element[0]).each(function(){if(f(this).is(":checked")){f(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true")}else{f(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}})}else{if(this.type==="checkbox"){if(this.element.is(":checked")){this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true")}else{this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")}}}},_resetButton:function(){if(this.type==="input"){if(this.options.label){this.element.val(this.options.label)}return}var r=this.buttonElement.removeClass(g),p=f("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(r.empty()).text(),o=this.options.icons,n=o.primary&&o.secondary,q=[];if(o.primary||o.secondary){if(this.options.text){q.push("ui-button-text-icon"+(n?"s":(o.primary?"-primary":"-secondary")))}if(o.primary){r.prepend("<span class='ui-button-icon-primary ui-icon "+o.primary+"'></span>")}if(o.secondary){r.append("<span class='ui-button-icon-secondary ui-icon "+o.secondary+"'></span>")}if(!this.options.text){q.push(n?"ui-button-icons-only":"ui-button-icon-only");if(!this.hasTitle){r.attr("title",p)}}}else{q.push("ui-button-text-only")}r.addClass(q.join(" "))}});f.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset");this.element.removeClass("buttonset-hidefirst")},_init:function(){this.refresh()},_setOption:function(n,o){if(n==="disabled"){this.buttons.button("option",n,o)}f.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var n=this.element.css("direction")==="ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return f(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(n?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(n?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return f(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");f.Widget.prototype.destroy.call(this)}})}(jq));(function(e,f){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",b={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},d={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},a=e.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};e.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(h){var g=e(this).css(h).offset().top;if(g<0){e(this).css("top",h.top-g)}}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string"){this.originalTitle=""}this.options.title=this.options.title||this.originalTitle;var q=this,r=q.options,o=r.title||"&#160;",h=e.ui.dialog.getTitleId(q.element),p=(q.uiDialog=e("<div></div>")).appendTo(document.body).hide().addClass(c+r.dialogClass).css({zIndex:r.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(s){if(r.closeOnEscape&&!s.isDefaultPrevented()&&s.keyCode&&s.keyCode===e.ui.keyCode.ESCAPE){q.close(s);s.preventDefault()}}).attr({role:"dialog","aria-labelledby":h}).mousedown(function(s){q.moveToTop(false,s)}),l=q.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(p),j=(q.uiDialogTitlebar=e("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(p),n=e('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){n.addClass("ui-state-hover")},function(){n.removeClass("ui-state-hover")}).focus(function(){n.addClass("ui-state-focus")}).blur(function(){n.removeClass("ui-state-focus")}).click(function(s){q.close(s);return false}).appendTo(j),m=(q.uiDialogTitlebarCloseText=e("<span></span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(n),g=e("<span></span>").addClass("ui-dialog-title").attr("id",h).html(o).prependTo(j);if(e.isFunction(r.beforeclose)&&!e.isFunction(r.beforeClose)){r.beforeClose=r.beforeclose}j.find("*").add(j).disableSelection();if(r.draggable&&e.fn.draggable){q._makeDraggable()}if(r.resizable&&e.fn.resizable){q._makeResizable()}q._createButtons(r.buttons);q._isOpen=false;if(e.fn.bgiframe){p.bgiframe()}},_init:function(){if(this.options.autoOpen){this.open()}},destroy:function(){var g=this;if(g.overlay){g.overlay.destroy()}g.uiDialog.hide();g.element.unbind("."+g.widgetName).removeData(g.widgetName).removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");g.uiDialog.remove();if(g.originalTitle){g.element.attr("title",g.originalTitle)}return g},widget:function(){return this.uiDialog},close:function(l){var g=this,j,h;if(false===g._trigger("beforeClose",l)){return}if(g.overlay){g.overlay.destroy()}g.uiDialog.unbind("keypress.ui-dialog");g._isOpen=false;if(g.options.hide){g.uiDialog.hide(g.options.hide,function(){g._trigger("close",l)})}else{g.uiDialog.hide();g._trigger("close",l)}e.ui.dialog.overlay.resize();if(g.options.modal){j=0;e(".ui-dialog").each(function(){if(this!==g.uiDialog[0]){h=e(this).css("z-index");if(!isNaN(h)){j=Math.max(j,h)}}});e.ui.dialog.maxZ=j}return g},isOpen:function(){return this._isOpen},moveToTop:function(m,l){var g=this,j=g.options,h;if((j.modal&&!m)||(!j.stack&&!j.modal)){return g._trigger("focus",l)}if(j.zIndex>e.ui.dialog.maxZ){e.ui.dialog.maxZ=j.zIndex}if(g.overlay){e.ui.dialog.maxZ+=1;g.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ)}h={scrollTop:g.element.scrollTop(),scrollLeft:g.element.scrollLeft()};e.ui.dialog.maxZ+=1;g.uiDialog.css("z-index",e.ui.dialog.maxZ);g.element.attr(h);g._trigger("focus",l);return g},open:function(){if(this._isOpen){return}var h=this,j=h.options,g=h.uiDialog;h.overlay=j.modal?new e.ui.dialog.overlay(h):null;h._size();h._position(j.position);g.show(j.show);h.moveToTop(true);if(j.modal){g.bind("keypress.ui-dialog",function(n){if(n.keyCode!==e.ui.keyCode.TAB){return}var m=e(":tabbable",this),o=m.filter(":first"),l=m.filter(":last");if(n.target===l[0]&&!n.shiftKey){o.focus(1);return false}else{if(n.target===o[0]&&n.shiftKey){l.focus(1);return false}}})}h._autoFocus();h._isOpen=true;h._trigger("open");return h},_autoFocus:function(){var g=this.element.find(":tabbable");if(!g.length){g=this.uiDialog.find(".ui-dialog-buttonpane");if(!g.length){g=this.uiDialog}}g.eq(0).focus()},_createButtons:function(l){var j=this,g=false,h=e("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),m=e("<div></div>").addClass("ui-dialog-buttonset").appendTo(h);j.uiDialog.find(".ui-dialog-buttonpane").remove();if(typeof l==="object"&&l!==null){e.each(l,function(){return !(g=true)})}if(g){e.each(l,function(n,p){p=e.isFunction(p)?{click:p,text:n}:p;var o=e('<button type="button"></button>').click(function(){p.click.apply(j.element[0],arguments)}).appendTo(m);e.each(p,function(q,r){if(q==="click"){return}if(q in a){o[q](r)}else{o.attr(q,r)}});if(e.fn.button){o.button()}});h.appendTo(j.uiDialog)}},_makeDraggable:function(){var g=this,l=g.options,m=e(document),j;function h(n){return{position:n.position,offset:n.offset}}g.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,o){j=l.height==="auto"?"auto":e(this).height();e(this).height(e(this).height()).addClass("ui-dialog-dragging");g._trigger("dragStart",n,h(o))},drag:function(n,o){g._trigger("drag",n,h(o))},stop:function(n,o){l.position=[o.position.left-m.scrollLeft(),o.position.top-m.scrollTop()];e(this).removeClass("ui-dialog-dragging").height(j);g._trigger("dragStop",n,h(o));e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){n=(n===f?this.options.resizable:n);var h=this,m=h.options,g=h.uiDialog.css("position"),l=(typeof n==="string"?n:"n,e,s,w,se,sw,ne,nw");function j(o){return{originalPosition:o.originalPosition,originalSize:o.originalSize,position:o.position,size:o.size}}h.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:h.element,maxWidth:m.maxWidth,maxHeight:m.maxHeight,minWidth:m.minWidth,minHeight:h._minHeight(),handles:l,start:function(o,p){e(this).addClass("ui-dialog-resizing");h._trigger("resizeStart",o,j(p))},resize:function(o,p){h._trigger("resize",o,j(p))},stop:function(o,p){e(this).removeClass("ui-dialog-resizing");m.height=e(this).height();m.width=e(this).width();h._trigger("resizeStop",o,j(p));e.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var g=this.options;if(g.height==="auto"){return g.minHeight}else{return Math.min(g.minHeight,g.height)}},_position:function(h){var j=[],l=[0,0],g;if(h){if(typeof h==="string"||(typeof h==="object"&&"0" in h)){j=h.split?h.split(" "):[h[0],h[1]];if(j.length===1){j[1]=j[0]}e.each(["left","top"],function(n,m){if(+j[n]===j[n]){l[n]=j[n];j[n]=m}});h={my:j.join(" "),at:j.join(" "),offset:l.join(" ")}}h=e.extend({},e.ui.dialog.prototype.options.position,h)}else{h=e.ui.dialog.prototype.options.position}g=this.uiDialog.is(":visible");if(!g){this.uiDialog.show()}this.uiDialog.css({top:0,left:0}).position(e.extend({of:window},h));if(!g){this.uiDialog.hide()}},_setOptions:function(l){var h=this,g={},j=false;e.each(l,function(m,n){h._setOption(m,n);if(m in b){j=true}if(m in d){g[m]=n}});if(j){this._size()}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option",g)}},_setOption:function(l,m){var h=this,g=h.uiDialog;switch(l){case"beforeclose":l="beforeClose";break;case"buttons":h._createButtons(m);break;case"closeText":h.uiDialogTitlebarCloseText.text(""+m);break;case"dialogClass":g.removeClass(h.options.dialogClass).addClass(c+m);break;case"disabled":if(m){g.addClass("ui-dialog-disabled")}else{g.removeClass("ui-dialog-disabled")}break;case"draggable":var j=g.is(":data(draggable)");if(j&&!m){g.draggable("destroy")}if(!j&&m){h._makeDraggable()}break;case"position":h._position(m);break;case"resizable":var n=g.is(":data(resizable)");if(n&&!m){g.resizable("destroy")}if(n&&typeof m==="string"){g.resizable("option","handles",m)}if(!n&&m!==false){h._makeResizable(m)}break;case"title":e(".ui-dialog-title",h.uiDialogTitlebar).html(""+(m||"&#160;"));break}e.Widget.prototype._setOption.apply(h,arguments)},_size:function(){var m=this.options,h,l,g=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(m.minWidth>m.width){m.width=m.minWidth}h=this.uiDialog.css({height:"auto",width:m.width}).height();l=Math.max(0,m.minHeight-h);if(m.height==="auto"){if(e.support.minHeight){this.element.css({minHeight:l,height:"auto"})}else{this.uiDialog.show();var j=this.element.css("height","auto").height();if(!g){this.uiDialog.hide()}this.element.height(Math.max(j,l))}}else{this.element.height(Math.max(m.height-h,0))}if(this.uiDialog.is(":data(resizable)")){this.uiDialog.resizable("option","minHeight",this._minHeight())}}});e.extend(e.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(g){var h=g.attr("id");if(!h){this.uuid+=1;h=this.uuid}return"ui-dialog-title-"+h},overlay:function(g){this.$el=e.ui.dialog.overlay.create(g)}});e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(g){return g+".dialog-overlay"}).join(" "),create:function(h){if(this.instances.length===0){setTimeout(function(){if(e.ui.dialog.overlay.instances.length){e(document).bind(e.ui.dialog.overlay.events,function(j){if(e(j.target).zIndex()<e.ui.dialog.overlay.maxZ){return false}})}},1);e(document).bind("keydown.dialog-overlay",function(j){if(h.options.closeOnEscape&&!j.isDefaultPrevented()&&j.keyCode&&j.keyCode===e.ui.keyCode.ESCAPE){h.close(j);j.preventDefault()}});e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize)}var g=(this.oldInstances.pop()||e("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});if(e.fn.bgiframe){g.bgiframe()}this.instances.push(g);return g},destroy:function(g){var h=e.inArray(g,this.instances);if(h!=-1){this.oldInstances.push(this.instances.splice(h,1)[0])}if(this.instances.length===0){e([document,window]).unbind(".dialog-overlay")}g.remove();var j=0;e.each(this.instances,function(){j=Math.max(j,this.css("z-index"))});this.maxZ=j},height:function(){var h,g;if(e.browser.msie&&e.browser.version<7){h=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);g=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(h<g){return e(window).height()+"px"}else{return h+"px"}}else{return e(document).height()+"px"}},width:function(){var g,h;if(e.browser.msie){g=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);h=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(g<h){return e(window).width()+"px"}else{return g+"px"}}else{return e(document).width()+"px"}},resize:function(){var g=e([]);e.each(e.ui.dialog.overlay.instances,function(){g=g.add(this)});g.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}});e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})}(jq));(function(b,c){var a=5;b.widget("ui.slider",b.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 e=this,l=this.options,j=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),h="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",d=(l.values&&l.values.length)||1,g=[];this._keySliding=false;this._mouseSliding=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"+(l.disabled?" ui-slider-disabled ui-disabled":""));this.range=b([]);if(l.range){if(l.range===true){if(!l.values){l.values=[this._valueMin(),this._valueMin()]}if(l.values.length&&l.values.length!==2){l.values=[l.values[0],l.values[0]]}}this.range=b("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+((l.range==="min"||l.range==="max")?" ui-slider-range-"+l.range:""))}for(var f=j.length;f<d;f+=1){g.push(h)}this.handles=j.add(b(g.join("")).appendTo(e.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(m){m.preventDefault()}).hover(function(){if(!l.disabled){b(this).addClass("ui-state-hover")}},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(!l.disabled){b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}else{b(this).blur()}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(m){b(this).data("index.ui-slider-handle",m);b(this).addClass("ui-slider-handle-"+m);b(this).attr("id",b(this).parent().attr("id")+"_"+m)});this.handles.keydown(function(r){var o=true,n=b(this).data("index.ui-slider-handle"),s,p,m,q;if(e.options.disabled){return}switch(r.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:o=false;if(!e._keySliding){e._keySliding=true;b(this).addClass("ui-state-active");s=e._start(r,n);if(s===false){return}}break}q=e.options.step;if(e.options.values&&e.options.values.length){p=m=e.values(n)}else{p=m=e.value()}switch(r.keyCode){case b.ui.keyCode.HOME:m=e._valueMin();break;case b.ui.keyCode.END:m=e._valueMax();break;case b.ui.keyCode.PAGE_UP:m=e._trimAlignValue(p+((e._valueMax()-e._valueMin())/a));break;case b.ui.keyCode.PAGE_DOWN:m=e._trimAlignValue(p-((e._valueMax()-e._valueMin())/a));break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(p===e._valueMax()){return}m=e._trimAlignValue(p+q);break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(p===e._valueMin()){return}m=e._trimAlignValue(p-q);break}e._slide(r,n,m);return o}).keyup(function(n){var m=b(this).data("index.ui-slider-handle");if(e._keySliding){e._keySliding=false;e._stop(n,m);e._change(n,m);b(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(f){var g=this.options,l,n,e,h,q,m,p,j,d;if(g.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();l={x:f.pageX,y:f.pageY};n=this._normValueFromMouse(l);e=this._valueMax()-this._valueMin()+1;q=this;this.handles.each(function(o){var r=Math.abs(n-q.values(o));if(e>r){e=r;h=b(this);m=o}});if(g.range===true&&this.values(1)===g.min){m+=1;h=b(this.handles[m])}p=this._start(f,m);if(p===false){return false}this._mouseSliding=true;q._handleIndex=m;h.addClass("ui-state-active").focus();j=h.offset();d=!b(f.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=d?{left:0,top:0}:{left:f.pageX-j.left-(h.width()/2),top:f.pageY-j.top-(h.height()/2)-(parseInt(h.css("borderTopWidth"),10)||0)-(parseInt(h.css("borderBottomWidth"),10)||0)+(parseInt(h.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(f,m,n)}this._animateOff=true;return true},_mouseStart:function(d){return true},_mouseDrag:function(f){var d={x:f.pageX,y:f.pageY},e=this._normValueFromMouse(d);this._slide(f,this._handleIndex,e);return false},_mouseStop:function(d){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(d,this._handleIndex);this._change(d,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal"},_normValueFromMouse:function(e){var d,h,g,f,j;if(this.orientation==="horizontal"){d=this.elementSize.width;h=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{d=this.elementSize.height;h=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}g=(h/d);if(g>1){g=1}if(g<0){g=0}if(this.orientation==="vertical"){g=1-g}f=this._valueMax()-this._valueMin();j=this._valueMin()+g*f;return this._trimAlignValue(j)},_start:function(f,e){var d={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(e);d.values=this.values()}return this._trigger("start",f,d)},_slide:function(h,g,f){var d,e,j;if(this.options.values&&this.options.values.length){d=this.values(g?0:1);if((this.options.values.length===2&&this.options.range===true)&&((g===0&&f>d)||(g===1&&f<d))){f=d}if(f!==this.values(g)){e=this.values();e[g]=f;j=this._trigger("slide",h,{handle:this.handles[g],value:f,values:e});d=this.values(g?0:1);if(j!==false){this.values(g,f,true)}}}else{if(f!==this.value()){j=this._trigger("slide",h,{handle:this.handles[g],value:f});if(j!==false){this.value(f)}}}},_stop:function(f,e){var d={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(e);d.values=this.values()}this._trigger("stop",f,d)},_change:function(f,e){if(!this._keySliding&&!this._mouseSliding){var d={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(e);d.values=this.values()}this._trigger("change",f,d)}},value:function(d){if(arguments.length){this.options.value=this._trimAlignValue(d);this._refreshValue();this._change(null,0);return}return this._value()},values:function(e,h){var g,d,f;if(arguments.length>1){this.options.values[e]=this._trimAlignValue(h);this._refreshValue();this._change(null,e);return}if(arguments.length){if(b.isArray(arguments[0])){g=this.options.values;d=arguments[0];for(f=0;f<g.length;f+=1){g[f]=this._trimAlignValue(d[f]);this._change(null,f)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(e)}else{return this.value()}}}else{return this._values()}},_setOption:function(e,f){var d,g=0;if(b.isArray(this.options.values)){g=this.options.values.length}b.Widget.prototype._setOption.apply(this,arguments);switch(e){case"disabled":if(f){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);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(d=0;d<g;d+=1){this._change(null,d)}this._animateOff=false;break}},_value:function(){var d=this.options.value;d=this._trimAlignValue(d);return d},_values:function(d){var g,f,e;if(arguments.length){g=this.options.values[d];g=this._trimAlignValue(g);return g}else{f=this.options.values.slice();for(e=0;e<f.length;e+=1){f[e]=this._trimAlignValue(f[e])}return f}},_trimAlignValue:function(g){if(g<=this._valueMin()){return this._valueMin()}if(g>=this._valueMax()){return this._valueMax()}var d=(this.options.step>0)?this.options.step:1,f=(g-this._valueMin())%d,e=g-f;if(Math.abs(f)*2>=d){e+=(f>0)?d:(-d)}return parseFloat(e.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var g=this.options.range,f=this.options,p=this,e=(!this._animateOff)?f.animate:false,h,d={},j,m,l,n;if(this.options.values&&this.options.values.length){this.handles.each(function(q,o){h=(p.values(q)-p._valueMin())/(p._valueMax()-p._valueMin())*100;d[p.orientation==="horizontal"?"left":"bottom"]=h+"%";b(this).stop(1,1)[e?"animate":"css"](d,f.animate);if(p.options.range===true){if(p.orientation==="horizontal"){if(q===0){p.range.stop(1,1)[e?"animate":"css"]({left:h+"%"},f.animate)}if(q===1){p.range[e?"animate":"css"]({width:(h-j)+"%"},{queue:false,duration:f.animate})}}else{if(q===0){p.range.stop(1,1)[e?"animate":"css"]({bottom:(h)+"%"},f.animate)}if(q===1){p.range[e?"animate":"css"]({height:(h-j)+"%"},{queue:false,duration:f.animate})}}}j=h})}else{m=this.value();l=this._valueMin();n=this._valueMax();h=(n!==l)?(m-l)/(n-l)*100:0;d[p.orientation==="horizontal"?"left":"bottom"]=h+"%";this.handle.stop(1,1)[e?"animate":"css"](d,f.animate);if(g==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[e?"animate":"css"]({width:h+"%"},f.animate)}if(g==="max"&&this.orientation==="horizontal"){this.range[e?"animate":"css"]({width:(100-h)+"%"},{queue:false,duration:f.animate})}if(g==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[e?"animate":"css"]({height:h+"%"},f.animate)}if(g==="max"&&this.orientation==="vertical"){this.range[e?"animate":"css"]({height:(100-h)+"%"},{queue:false,duration:f.animate})}}}});b.extend(b.ui.slider,{version:"1.8.16"})}(jq));(function(d,f){var c=0,b=0;function e(){return ++c}function a(){return ++b}d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(g,h){if(g=="selected"){if(this.options.collapsible&&h==this.options.selected){return}this.select(h)}else{this.options[g]=h;this._tabify()}},_tabId:function(g){return g.title&&g.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(g){return g.replace(/:/g,"\\:")},_cookie:function(){var g=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a());return d.cookie.apply(null,[g].concat(d.makeArray(arguments)))},_ui:function(h,g){return{tab:h,panel:g,index:this.anchors.index(h)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var g=d(this);g.html(g.data("label.tabs")).removeData("label.tabs")})},_tabify:function(v){var w=this,j=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(y,o){var x=d(o).attr("href");var z=x.split("#")[0],A;if(z&&(z===location.toString().split("#")[0]||(A=d("base")[0])&&z===A.href)){x=o.hash;o.href=x}if(h.test(x)){w.panels=w.panels.add(w.element.find(w._sanitizeSelector(x)))}else{if(x&&x!=="#"){d.data(o,"href.tabs",x);d.data(o,"load.tabs",x.replace(/#.*$/,""));var C=w._tabId(o);o.href="#"+C;var B=w.element.find("#"+C);if(!B.length){B=d(j.panelTemplate).attr("id",C).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(w.panels[y-1]||w.list);B.data("destroy.tabs",true)}w.panels=w.panels.add(B)}else{j.disabled.push(y)}}});if(v){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(j.selected===f){if(location.hash){this.anchors.each(function(x,o){if(o.hash==location.hash){j.selected=x;return false}})}if(typeof j.selected!=="number"&&j.cookie){j.selected=parseInt(w._cookie(),10)}if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}j.selected=j.selected||(this.lis.length?0:-1)}else{if(j.selected===null){j.selected=-1}}j.selected=((j.selected>=0&&this.anchors[j.selected])||j.selected<0)?j.selected:0;j.disabled=d.unique(j.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(x,o){return w.lis.index(x)}))).sort();if(d.inArray(j.selected,j.disabled)!=-1){j.disabled.splice(d.inArray(j.selected,j.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(j.selected>=0&&this.anchors.length){w.element.find(w._sanitizeSelector(w.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");w.element.queue("tabs",function(){w._trigger("show",null,w._ui(w.anchors[j.selected],w.element.find(w._sanitizeSelector(w.anchors[j.selected].hash))[0]))});this.load(j.selected)}d(window).bind("unload",function(){w.lis.add(w.anchors).unbind(".tabs");w.lis=w.anchors=w.panels=null})}else{j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(j.cookie){this._cookie(j.selected,j.cookie)}for(var n=0,u;(u=this.lis[n]);n++){d(u)[d.inArray(n,j.disabled)!=-1&&!d(u).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(j.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var m=function(x,o){if(o.is(":not(.ui-state-disabled)")){o.addClass("ui-state-"+x)}};var q=function(x,o){o.removeClass("ui-state-"+x)};this.lis.bind("mouseover.tabs",function(){m("hover",d(this))});this.lis.bind("mouseout.tabs",function(){q("hover",d(this))});this.anchors.bind("focus.tabs",function(){m("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){q("focus",d(this).closest("li"))})}var g,p;if(j.fx){if(d.isArray(j.fx)){g=j.fx[0];p=j.fx[1]}else{g=p=j.fx}}function l(o,x){o.css("display","");if(!d.support.opacity&&x.opacity){o[0].style.removeAttribute("filter")}}var r=p?function(o,x){d(o).closest("li").addClass("ui-tabs-selected ui-state-active");x.hide().removeClass("ui-tabs-hide").animate(p,p.duration||"normal",function(){l(x,p);w._trigger("show",null,w._ui(o,x[0]))})}:function(o,x){d(o).closest("li").addClass("ui-tabs-selected ui-state-active");x.removeClass("ui-tabs-hide");w._trigger("show",null,w._ui(o,x[0]))};var s=g?function(x,o){o.animate(g,g.duration||"normal",function(){w.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");l(o,g);w.element.dequeue("tabs")})}:function(x,o,y){w.lis.removeClass("ui-tabs-selected ui-state-active");o.addClass("ui-tabs-hide");w.element.dequeue("tabs")};this.anchors.bind(j.event+".tabs",function(){var x=this,z=d(x).closest("li"),o=w.panels.filter(":not(.ui-tabs-hide)"),y=w.element.find(w._sanitizeSelector(x.hash));if((z.hasClass("ui-tabs-selected")&&!j.collapsible)||z.hasClass("ui-state-disabled")||z.hasClass("ui-state-processing")||w.panels.filter(":animated").length||w._trigger("select",null,w._ui(this,y[0]))===false){this.blur();return false}j.selected=w.anchors.index(this);w.abort();if(j.collapsible){if(z.hasClass("ui-tabs-selected")){j.selected=-1;if(j.cookie){w._cookie(j.selected,j.cookie)}w.element.queue("tabs",function(){s(x,o)}).dequeue("tabs");this.blur();return false}else{if(!o.length){if(j.cookie){w._cookie(j.selected,j.cookie)}w.element.queue("tabs",function(){r(x,y)});w.load(w.anchors.index(this));this.blur();return false}}}if(j.cookie){w._cookie(j.selected,j.cookie)}if(y.length){if(o.length){w.element.queue("tabs",function(){s(x,o)})}w.element.queue("tabs",function(){r(x,y)});w.load(w.anchors.index(this))}else{throw new Error("jQuery UI Tabs: Mismatching fragment identifier.")}if(d.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(g){if(typeof g=="string"){g=this.anchors.index(this.anchors.filter("[href$="+g+"]"))}return g},destroy:function(){var g=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var h=d.data(this,"href.tabs");if(h){this.href=h}var j=d(this).unbind(".tabs");d.each(["href","load","cache"],function(l,m){j.removeData(m+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(d.data(this,"destroy.tabs")){d(this).remove()}else{d(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(g.cookie){this._cookie(null,g.cookie)}return this},add:function(l,j,h){if(h===f){h=this.anchors.length}var g=this,n=this.options,q=d(n.tabTemplate.replace(/#\{href\}/g,l).replace(/#\{label\}/g,j)),p=!l.indexOf("#")?l.replace("#",""):this._tabId(d("a",q)[0]);q.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var m=g.element.find("#"+p);if(!m.length){m=d(n.panelTemplate).attr("id",p).data("destroy.tabs",true)}m.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(h>=this.lis.length){q.appendTo(this.list);m.appendTo(this.list[0].parentNode)}else{q.insertBefore(this.lis[h]);m.insertBefore(this.panels[h])}n.disabled=d.map(n.disabled,function(r,o){return r>=h?++r:r});this._tabify();if(this.anchors.length==1){n.selected=0;q.addClass("ui-tabs-selected ui-state-active");m.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){g._trigger("show",null,g._ui(g.anchors[0],g.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[h],this.panels[h]));return this},remove:function(g){g=this._getIndex(g);var j=this.options,l=this.lis.eq(g).remove(),h=this.panels.eq(g).remove();if(l.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(g+(g+1<this.anchors.length?1:-1))}j.disabled=d.map(d.grep(j.disabled,function(o,m){return o!=g}),function(o,m){return o>=g?--o:o});this._tabify();this._trigger("remove",null,this._ui(l.find("a")[0],h[0]));return this},enable:function(g){g=this._getIndex(g);var h=this.options;if(d.inArray(g,h.disabled)==-1){return}this.lis.eq(g).removeClass("ui-state-disabled");h.disabled=d.grep(h.disabled,function(l,j){return l!=g});this._trigger("enable",null,this._ui(this.anchors[g],this.panels[g]));return this},disable:function(h){h=this._getIndex(h);var g=this,j=this.options;if(h!=j.selected){this.lis.eq(h).addClass("ui-state-disabled");j.disabled.push(h);j.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[h],this.panels[h]))}return this},select:function(g){g=this._getIndex(g);if(g==-1){if(this.options.collapsible&&this.options.selected!=-1){g=this.options.selected}else{return this}}this.anchors.eq(g).trigger(this.options.event+".tabs");return this},load:function(l){l=this._getIndex(l);var h=this,n=this.options,g=this.anchors.eq(l)[0],j=d.data(g,"load.tabs");this.abort();if(!j||this.element.queue("tabs").length!==0&&d.data(g,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(l).addClass("ui-state-processing");if(n.spinner){var m=d("span",g);m.data("label.tabs",m.html()).html(n.spinner)}this.xhr=d.ajax(d.extend({},n.ajaxOptions,{url:j,success:function(p,o){h.element.find(h._sanitizeSelector(g.hash)).html(p);h._cleanup();if(n.cache){d.data(g,"cache.tabs",true)}h._trigger("load",null,h._ui(h.anchors[l],h.panels[l]));try{n.ajaxOptions.success(p,o)}catch(q){}},error:function(q,o,p){h._cleanup();h._trigger("load",null,h._ui(h.anchors[l],h.panels[l]));try{n.ajaxOptions.error(q,o,l,g)}catch(p){}}}));h.element.dequeue("tabs");return this},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},url:function(h,g){this.anchors.eq(h).removeData("cache.tabs").data("load.tabs",g);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(j,m){var g=this,n=this.options;var h=g._rotate||(g._rotate=function(o){clearTimeout(g.rotation);g.rotation=setTimeout(function(){var p=n.selected;g.select(++p<g.anchors.length?p:0)},j);if(o){o.stopPropagation()}});var l=g._unrotate||(g._unrotate=!m?function(o){if(o.clientX){g.rotate(null)}}:function(o){t=n.selected;h()});if(j){this.element.bind("tabsshow",h);this.anchors.bind(n.event+".tabs",l);h()}else{clearTimeout(g.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(n.event+".tabs",l);delete this._rotate;delete this._unrotate}return this}})})(jq);(function($,undefined){$.extend($.ui,{datepicker:{version:"1.8.16"}});var PROP_NAME="datepicker";var dpuuid=new Date().getTime();var instActive;function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],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,disabled:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){if(this.debug){console.log.apply("",arguments)}},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){this.uuid+=1;target.id="dp"+this.uuid}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}this._attachments(input,inst);input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});this._autoSize(inst);$.data(target,PROP_NAME,inst);if(inst.settings.disabled){this._disableDatepicker(target)}},_attachments:function(input,inst){var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(inst.append){inst.append.remove()}if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}input.unbind("focus",this._showDatepicker);if(inst.trigger){inst.trigger.remove()}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==input[0]){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(input[0])}return false})}},_autoSize:function(inst){if(this._get(inst,"autoSize")&&!inst.inline){var date=new Date(2009,12-1,20);var dateFormat=this._get(inst,"dateFormat");if(dateFormat.match(/[DM]/)){var findMax=function(names){var max=0;var maxI=0;for(var i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i}}return maxI};date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?"monthNames":"monthNamesShort"))));date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?"dayNames":"dayNamesShort")))+20-date.getDay())}inst.input.attr("size",this._formatDate(inst,date).length)}},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst),true);this._updateDatepicker(inst);this._updateAlternate(inst);if(inst.settings.disabled){this._disableDatepicker(target)}inst.dpDiv.css("display","block")},_dialogDatepicker:function(input,date,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){this.uuid+=1;var id="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+id+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});date=(date&&date.constructor==Date?this._formatDate(inst,date):date);this._dialogInput.val(date);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=document.documentElement.clientWidth;var browserHeight=document.documentElement.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",(this._pos[0]+20)+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled");inline.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker()}var date=this._getDateDatepicker(target,true);var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");extendRemove(inst.settings,settings);if(minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){inst.settings.minDate=this._formatDate(inst,minDate)}if(maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){inst.settings.maxDate=this._formatDate(inst,maxDate)}this._attachments($(target),inst);this._autoSize(inst);this._setDate(inst,date);this._updateAlternate(inst);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date){var inst=this._getInst(target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst,noDefault)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:var sel=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}var onSelect=$.datepicker._get(inst,"onSelect");if(onSelect){var dateStr=$.datepicker._formatDate(inst);onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{$.datepicker._hideDatepicker()}return false;break;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||event.metaKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_doKeyUp:function(event){var inst=$.datepicker._getInst(event.target),val=inst.input.val();if(val!=inst.lastVal){try{var date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),(inst.input?inst.input.val():null),$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst);var blurEventType="blur.fromDatepickerKeyUp",onSelect=$.datepicker._get(inst,"onSelect");if(onSelect){inst.input.unbind(blurEventType).one(blurEventType,function(){onSelect.apply((inst.input?inst.input[0]:null),[val,inst])})}}}catch(event){$.datepicker.log(event)}}return true},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);if($.datepicker._curInst&&$.datepicker._curInst!=inst){if($.datepicker._datepickerShowing){$.datepicker._triggerOnClose($.datepicker._curInst)}$.datepicker._curInst.dpDiv.stop(true,true)}var beforeShow=$.datepicker._get(inst,"beforeShow");var beforeShowSettings=beforeShow?beforeShow.apply(input,[input,inst]):{};if(beforeShowSettings===false){return}extendRemove(inst.settings,beforeShowSettings);inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.dpDiv.empty();inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim");var duration=$.datepicker._get(inst,"duration");var postProcess=function(){var cover=inst.dpDiv.find("iframe.ui-datepicker-cover");if(!!cover.length){var borders=$.datepicker._getBorders(inst.dpDiv);cover.css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()})}};inst.dpDiv.zIndex($(input).zIndex()+1);$.datepicker._datepickerShowing=true;if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim||"show"]((showAnim?duration:null),postProcess)}if(!showAnim||!duration){postProcess()}if(inst.input.is(":visible")&&!inst.input.is(":disabled")){inst.input.focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var self=this;self.maxRows=4;var borders=$.datepicker._getBorders(inst.dpDiv);instActive=inst;inst.dpDiv.empty().append(this._generateHTML(inst));var cover=inst.dpDiv.find("iframe.ui-datepicker-cover");if(!!cover.length){cover.css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()})}inst.dpDiv.find("."+this._dayOverClass+" a").mouseover();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst==$.datepicker._curInst&&$.datepicker._datepickerShowing&&inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&inst.input[0]!=document.activeElement){inst.input.focus()}if(inst.yearshtml){var origyearshtml=inst.yearshtml;setTimeout(function(){if(origyearshtml===inst.yearshtml&&inst.yearshtml){inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml)}origyearshtml=inst.yearshtml=null},0)}},_getBorders:function(elem){var convert=function(value){return{thin:1,medium:2,thick:3}[value]||value};return[parseFloat(convert(elem.css("border-left-width"))),parseFloat(convert(elem.css("border-top-width")))]},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=document.documentElement.clientWidth+$(document).scrollLeft();var viewHeight=document.documentElement.clientHeight+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight):0);return offset},_findPos:function(obj){var inst=this._getInst(obj);var isRTL=this._get(inst,"isRTL");while(obj&&(obj.type=="hidden"||obj.nodeType!=1||$.expr.filters.hidden(obj))){obj=obj[isRTL?"previousSibling":"nextSibling"]}var position=$(obj).offset();return[position.left,position.top]},_triggerOnClose:function(inst){var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}},_hideDatepicker:function(input){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(this._datepickerShowing){var showAnim=this._get(inst,"showAnim");var duration=this._get(inst,"duration");var postProcess=function(){$.datepicker._tidyDialog(inst);this._curInst=null};if($.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide"))]((showAnim?duration:null),postProcess)}if(!showAnim){postProcess()}$.datepicker._triggerOnClose(inst);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if($target[0].id!=$.datepicker._mainDivId&&$target.parents("#"+$.datepicker._mainDivId).length==0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker()}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{this._hideDatepicker();this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input.focus()}this._lastInput=null}},_updateAlternate:function(inst){var self=this,altField=self._get(inst,"altField");if(altField){var dateStr=self.formatDate(self._get(inst,"altFormat")||self._get(inst,"dateFormat"),self._getDate(inst),self._getFormatConfig(inst));$(altField).each(function(){$(this)[$(this).is("input")?"val":"text"](dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));var time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){var isDoubled=lookAhead(match);var size=(match=="@"?14:(match=="!"?20:(match=="y"&&isDoubled?4:(match=="o"?3:2))));var digits=new RegExp("^\\d{1,"+size+"}");var num=value.substring(iValue).match(digits);if(!num){throw"Missing number at position "+iValue}iValue+=num[0].length;return parseInt(num[0],10)};var getName=function(match,shortNames,longNames){var names=$.map(lookAhead(match)?longNames:shortNames,function(v,k){return[[k,v]]}).sort(function(a,b){return -(a[1].length-b[1].length)});var index=-1;$.each(names,function(i,pair){var name=pair[1];if(value.substr(iValue,name.length).toLowerCase()==name.toLowerCase()){index=pair[0];iValue+=name.length;return false}});if(index!=-1){return index+1}else{throw"Unknown name at position "+iValue}};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"!":var date=new Date((getNumber("!")-this._ticksTo1970)/10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(iValue<value.length){throw new Error("Extra/unparsed characters found in date: "+value.substring(iValue))}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"!":output+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst,noDefault){if(inst.input.val()==inst.lastVal){return}var dateFormat=this._get(inst,"dateFormat");var dates=inst.lastVal=inst.input?inst.input.val():null;var date,defaultDate;date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);dates=(noDefault?"":dates)}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),new Date()))},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,$.datepicker._getFormatConfig(inst))}catch(e){}var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};var newDate=(date==null||date===""?defaultDate:(typeof date=="string"?offsetString(date):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):new Date(date.getTime()))));newDate=(newDate&&newDate.toString()=="Invalid Date"?defaultDate:newDate);if(newDate){newDate.setHours(0);newDate.setMinutes(0);newDate.setSeconds(0);newDate.setMilliseconds(0)}return this._daylightSavingAdjust(newDate)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,noChange){var clear=!date;var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;var newDate=this._restrictMinMax(inst,this._determineDate(inst,date,new Date()));inst.selectedDay=inst.currentDay=newDate.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear();if((origMonth!=inst.selectedMonth||origYear!=inst.selectedYear)&&!noChange){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var showWeek=this._get(inst,"showWeek");var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var selectOtherMonths=this._get(inst,"selectOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";this.maxRows=4;for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group';if(numMonths[1]>1){switch(col){case 0:calender+=" ui-datepicker-group-first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+=" ui-datepicker-group-last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle";cornerClass="";break}}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead=(showWeek?'<th class="ui-datepicker-week-col">'+this._get(inst,"weekHeader")+"</th>":"");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var curRows=Math.ceil((leadDays+daysInMonth)/7);var numRows=(isMultiMonth?this.maxRows>curRows?this.maxRows:curRows:curRows);this.maxRows=numRows;var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody=(!showWeek?"":'<td class="ui-datepicker-week-col">'+this._get(inst,"calculateWeek")(printDate)+"</td>");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()==currentDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+inst.id+"',"+printDate.getMonth()+","+printDate.getFullYear()+', this);return false;"')+">"+(otherMonth&&!showOtherMonths?"&#xa0;":(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()==currentDate.getTime()?" ui-state-active":"")+(otherMonth?" ui-priority-secondary":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span>"}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+inst.id+"', this, 'M');\" >";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+(secondary||!(changeMonth&&changeYear)?"&#xa0;":"")}if(!inst.yearshtml){inst.yearshtml="";if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var thisYear=new Date().getFullYear();var determineYear=function(value){var year=(value.match(/c[+-].*/)?drawYear+parseInt(value.substring(1),10):(value.match(/[+-].*/)?thisYear+parseInt(value,10):parseInt(value,10)));return(isNaN(year)?thisYear:year)};var year=determineYear(years[0]);var endYear=Math.max(year,determineYear(years[1]||""));year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);inst.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+inst.id+"', this, 'Y');\" >";for(;year<=endYear;year++){inst.yearshtml+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}inst.yearshtml+="</select>";html+=inst.yearshtml;inst.yearshtml=null}}html+=this._get(inst,"yearSuffix");if(showMonthAfterYear){html+=(secondary||!(changeMonth&&changeYear)?"&#xa0;":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");var newDate=(minDate&&date<minDate?minDate:date);newDate=(maxDate&&newDate>maxDate?maxDate:newDate);return newDate},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),null)},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month,32)).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var minDate=this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime()))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function bindHover(dpDiv){var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return dpDiv.bind("mouseout",function(event){var elem=$(event.target).closest(selector);if(!elem.length){return}elem.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(event){var elem=$(event.target).closest(selector);if($.datepicker._isDisabledDatepicker(instActive.inline?dpDiv.parent()[0]:instActive.input[0])||!elem.length){return}elem.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");elem.addClass("ui-state-hover");if(elem.hasClass("ui-datepicker-prev")){elem.addClass("ui-datepicker-prev-hover")}if(elem.hasClass("ui-datepicker-next")){elem.addClass("ui-datepicker-next-hover")}})}function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!this.length){return this}if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate"||options=="widget")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.8.16";window["DP_jQuery_"+dpuuid]=$})(jq);(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");this.valueDiv.remove();a.Widget.prototype.destroy.apply(this,arguments)},value:function(c){if(c===b){return this._value()}this._setOption("value",c);return this},_setOption:function(c,d){if(c==="value"){this.options.value=d;this._refreshValue();if(this._value()===this.options.max){this._trigger("complete")}}a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var c=this.options.value;if(typeof c!=="number"){c=0}return Math.min(this.options.max,Math.max(this.min,c))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var d=this.value();var c=this._percentage();if(this.oldValue!==d){this.oldValue=d;this._trigger("change")}this.valueDiv.toggle(d>this.min).toggleClass("ui-corner-right",d===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",d)}});a.extend(a.ui.progressbar,{version:"1.8.16"})})(jq);
/*!
 * jQuery UI Touch Punch 0.1.0
 *
 * Copyright 2010, Dave Furfero
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * Depends:
 *  jquery.ui.widget.js
 *  jquery.ui.mouse.js
 */
(function(c){c.support.touch=typeof Touch==="object";if(!c.support.touch){return}var f=c.ui.mouse.prototype,g=f._mouseInit,a=f._mouseDown,e=f._mouseUp,b={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"};function d(h){var j=h.originalEvent.changedTouches[0];return c.extend(h,{type:b[h.type],which:1,pageX:j.pageX,pageY:j.pageY,screenX:j.screenX,screenY:j.screenY,clientX:j.clientX,clientY:j.clientY})}f._mouseInit=function(){var h=this;h.element.bind("touchstart."+h.widgetName,function(j){return h._mouseDown(d(j))});g.call(h)};f._mouseDown=function(l){var h=this,j=a.call(h,l);h._touchMoveDelegate=function(m){return h._mouseMove(d(m))};h._touchEndDelegate=function(m){return h._mouseUp(d(m))};c(document).bind("touchmove."+h.widgetName,h._touchMoveDelegate).bind("touchend."+h.widgetName,h._touchEndDelegate);return j};f._mouseUp=function(j){var h=this;c(document).unbind("touchmove."+h.widgetName,h._touchMoveDelegate).unbind("touchend."+h.widgetName,h._touchEndDelegate);return e.call(h,j)}})(jq);(function(a){a.widget("ui.rangeSlider",a.extend({},a.ui.slider.prototype,{_create:function(){this.options.range=true;a.ui.slider.prototype._create.apply(this,arguments);this.element.addClass("ui-range-slider-holder")},destroy:function(){this.element.removeClass("ui-range-slider-holder");a.ui.slider.prototype.destroy.apply(this,arguments)}}))})(jq);(function(j){var h="ui-dialog-content",c="ui-dialog-no-title",l="ui-map-popover",m="ui-popover-arrow",f="ui-popover",q="ui-popover-left",p="ui-popover-right",d="ui-popover-top",b="ui-tooltip",g="ui-tooltip-popover",o=null,a="r9tt-";function n(){if(o!==null){clearInterval(o)}}function e(){o=setTimeout(jq.ui.r9popover.close,200)}j.widget("ui.r9dialog",j.ui.dialog,{options:{autoFocus:true,position:["center",100],modal:true,minHeight:50,resizable:false,width:"auto",showCloseX:true,title:null,hideTitle:false,isFixed:false},_autoFocus:function(){if(this.options.autoFocus){j.ui.dialog.prototype._autoFocus.call(this)}else{this.uiDialog.focus()}},_create:function(){j.ui.dialog.prototype._create.apply(this);this.uiDialog.wrapInner('<div class="ui-dialog-liner" />');if(this.options.isFixed){this.uiDialog.css("position","fixed");this._position(this.options.position)}if(this.options.hideTitle){this.uiDialog.addClass(c)}},open:function(){if(this._isOpen){return}j.ui.dialog.prototype.open.apply(this);if(!this.options.showCloseX){this.uiDialog.find(".ui-dialog-titlebar-close").hide()}else{jq(".ui-widget-overlay").click(function(){jq("."+h).r9dialog("close")})}return this}});j.widget("ui.r9popover",j.ui.r9dialog,{options:{at:"auto",draggable:false,position:"body",clazz:""},_create:function(){var r={right:p,top:d};this._destroyAll();var s=j.ui.dialog.overlay.oldInstances.length;if(s){j.ui.dialog.overlay.oldInstances[s-1].height(j(document).height())}j.ui.r9dialog.prototype._create.apply(this);this.uiDialog.addClass(f).addClass(r[this.options.at]||q);if(this.options.clazz!=""){this.uiDialog.addClass(this.options.clazz)}this.uiPopoverArrow=jq("<div/>",{"class":m}).insertAfter(this.element)},_destroyAll:function(){j.ui.r9popover.destroy()},_onOverlayClick:function(){jq("."+h).r9popover("close")},_position:function(r){isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show()}var s=jq.isArray(r);this.uiDialog.css({left:0,top:0}).position({my:((this.options.at=="right")?"right":"left")+" top",at:this._positionAt(),offset:this._positionOffset(),of:s?jq.Event("click",{pageX:r[0],pageY:r[1]}):jq(r||j.ui.r9popover.prototype.options.position),collision:this.options.at=="auto"?"flip":"none"});if(this.options.at=="auto"&&!s&&(jq(r||j.ui.r9popover.prototype.options.position).offset().left>this.uiDialog.offset().left)){this.uiDialog.removeClass(q).addClass(p)}if(!isVisible){this.uiDialog.hide()}},_positionAt:function(){var r=this.options.at;if(r=="top"){return"left bottom"}else{return((r=="right")?"left":"right")+" center"}},_positionOffset:function(){if(this.options.at=="top"){return"-"+(this.uiPopoverArrow.width()/2)+" "+this.uiPopoverArrow.height()}else{return this.uiPopoverArrow.width()+" -"+(this.uiPopoverArrow.height()/2+this.uiPopoverArrow.position().top)}},open:function(){if(this._isOpen){return}j.ui.dialog.prototype.open.apply(this);this.element.show();if(this.options.modal){jq(".ui-widget-overlay").addClass("ui-popover-overlay").click(this._onOverlayClick)}return this}});j.widget("ui.r9tooltip",{timer:null,_create:function(){var r=this;this.element.hover(function(){n();var s={modal:false,position:r.element,clazz:g,width:r.options.width,hideTitle:r.options.hideTitle};var u=jq("#"+a+r.options.ttid);var v=r.options.content;if(v.length==0&&r.options.textAttribute.length>0){v=r.element.attr(r.options.textAttribute).split("|")[1]}if(r.options.ttid.length>0&&u.size()>0){if(u.hasClass(f)){u.r9popover("open")}else{u.r9popover(s);u.show();u.parent().parent().hover(n,e)}}else{var w=r.options.title;if(w.length==0&&r.options.textAttribute.length>0){w=r.element.attr(r.options.textAttribute).split("|")[0]}var x={title:w,width:r.options.width};if(r.options.ttid.length>0){x.id=a+r.options.ttid}jq("<div/>",x).append(v).addClass(r.options.ttclass).appendTo("body").r9popover(s).parent().parent().hover(n,e)}},e)},options:{title:"",textAttribute:"",content:"",ttclass:"",ttid:"",width:"auto",hideTitle:false}});j.ui.r9popover.destroy=function(){j.ui.r9popover.get().r9popover("destroy")};j.ui.r9popover.get=function(){return j("."+f).find("."+h)};j.ui.r9tooltip.destroy=function(){j("."+g).find("."+h).r9popover("destroy")};j.ui.r9popover.close=function(){j.ui.r9popover.get().r9popover("close")};j.widget("ui.r9mapPopover",j.ui.r9popover,{options:{modal:false},_bindMapEvents:function(){var r=this.options.map;if(!r.PopoverClickListener_){r.PopoverClickListener_=GEvent.addListener(r,"click",function(s){if(!s){j.ui.r9mapPopover.destroy()}})}if(!r.PopoverInfoWindowListener_){r.PopoverInfoWindowListener_=GEvent.addListener(r,"infowindowopen",j.ui.r9mapPopover.destroy)}if(!r.PopoverZoomEndListener_){r.PopoverZoomEndListener_=GEvent.addListener(r,"zoomend",j.ui.r9mapPopover.destroy)}},_bindOnClick:function(){var r=this,s=r.uiDialog[0],u=j.ui.r9mapPopover.onClick_;GEvent.bindDom(s,"mousedown",r,u);GEvent.bindDom(s,"dblclick",r,u);GEvent.bindDom(s,"DOMMouseScroll",r,u)},_create:function(){j.ui.r9mapPopover.destroy();j.ui.r9dialog.prototype._create.apply(this);this.uiDialog.addClass(f+" "+l).addClass(this.options.at=="right"?p:q).appendTo(this.options.map.getPane(G_MAP_FLOAT_PANE));this.uiPopoverArrow=jq("<div/>",{"class":m}).insertAfter(this.element);this._bindOnClick();this._bindMapEvents()}});j.ui.r9mapPopover.destroy=function(){j("."+l).find("."+h).r9mapPopover("close").r9mapPopover("destroy")};j.ui.r9mapPopover.onClick_=function(r){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false}else{r.stopPropagation()}};j.widget("ui.r9LinkedInput",{options:{linkclass:"",linktooltip:"",selectOnOpen:false,click:j.noop,change:j.noop,autoSize:true},_create:function(){if(this.element.prop("tagName")=="SELECT"||this.element.prop("tagName")=="INPUT"){var r=this;var s=this.link=jq("<a id='"+this.element.attr("id")+"-link' title='"+this.options.linktooltip+"' class='actionlink linkFromInput "+((this.element.prop("tagName")=="SELECT")?"selectLinkFromInput ":"")+this.options.linkclass+"' href='javascript:void(0)'>"+jq("<div/>").text(this.getText()).html()+"</a>").insertAfter(this.element.hide());s.bind("click",function(u){if(r.options.autoSize){r.element.width(jq(this).outerWidth())}s.hide();r.element.show();if(r.options.selectOnOpen){r.element.select()}r.options.click()});this.element.bind("change blur",function(v){var u=true;if(r.options.change.call(this,v)){u=false}if(u){s.text(r.getText()).show();if(r.options.autoSize){r.element.width(s.width())}r.element.hide()}else{if(r.options.selectOnOpen){r.element.select()}}})}},getText:function(){if(this.element.prop("tagName")=="SELECT"){return this.element.children(":selected").text()}else{return this.element.val()}},_destroy:function(){this.link.remove();this.element.show()}})})(jq);jq.widget("ui.combobox",{options:{appendTo:"body",position:{my:"left top",at:"left bottom",collision:"none"}},_change:function(a){if(this.previous!==this.element.val()){this._trigger("change",a,{item:this.selectedItem})}},_create:function(){var c=this,f=c.element[0].ownerDocument,a=c.element.hide(),d=a.children(":selected"),e=d.text()?d.text():"",b=c.input=jq("<a class='ui-combobox' href='#'>"+e+"</a>").insertAfter(a).click(function(j){var h=c.menu.element.empty().zIndex(c.element.zIndex()+1);c._renderMenu(h);c.menu.deactivate();c.menu.refresh();c.menu.element.show().position(jq.extend({of:b},c.options.position));c._resizeMenu();setTimeout(function(){jq("body",f).one("click.combobox",function(){c.close(j);c._change(j)})},1);j.preventDefault()}).bind("blur.combobox",function(h){if(!c.options.disabled){c.closing=setTimeout(function(){c.close(h);c._change(h)},150)}}),g=c.menu=jq("<ul></ul>").addClass("ui-combobox").appendTo(jq(c.options.appendTo||"body",f)[0]).mousedown(function(h){var j=c.menu.element[0];if(!jq(h.target).closest(".ui-menu-item").length){setTimeout(function(){jq(document).one("mousedown",function(l){if(l.target!==c.element[0]&&l.target!==j&&!jq.ui.contains(j,l.target)){c.close()}})},1)}setTimeout(function(){clearTimeout(c.closing)},13)}).menu({focus:function(j,l){var h=l.item.data("item.combobox");if(false!==c._trigger("focus",j,{item:h})){if(/^key/.test(j.originalEvent.type)){c.element.val(h.value)}}},selected:function(l,m){var j=m.item.data("item.combobox"),h=c.previous;if(c.element[0]!==f.activeElement){c.element.focus();c.previous=h;setTimeout(function(){c.previous=h},1)}if(false!==c._trigger("select",l,{item:j})){b.text(j.label);c.element.val(j.value)}c.term=c.element.val();c.selectedItem=j;c.close(l);c._change(l)},blur:function(h,j){if(c.menu.element.is(":visible")&&(c.element.val()!==c.term)){c.element.val(c.term)}}}).zIndex(c.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");if(jq.fn.frame){g.element.bgiframe()}c.selectedItem={label:d.text(),value:d.val()}},_getItem:function(a){return{label:a.text(),value:a.val()}},_renderMenu:function(b){var a=this;a.element.children("option").each(function(){var c=a._getItem(jq(this));jq("<li"+((a.selectedItem&&c.value===a.selectedItem.value)?" class='ui-menu-item-selected'":"")+"><a>"+c.label+"</a></li>").data("item.combobox",c).appendTo(b)})},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},close:function(b){var a=this;jq("body",a.element[0].ownerDocument).unbind("click.combobox");clearTimeout(a.closing);if(a.menu.element.is(":visible")){a._trigger("close",b);a.menu.element.hide();a.menu.deactivate()}},value:function(c){var a=this,b=a.element.find("[value="+c+"]");if(b.length){a.selectedItem=a._getItem(b);a.element.val(c);a.input.text(a.selectedItem.label)}},destroy:function(){this.input.remove();this.menu.element.remove();this.element.show();jq.Widget.prototype.destroy.call(this)}});(function(a){a.fn.autogrow=function(b){b=a.extend({maxWidth:1000,minWidth:0,comfortZone:20},b);this.filter("input:text").each(function(){var d=a(this),f=parseInt(d.css("minWidth"))||b.minWidth||d.width(),g=parseInt(d.css("maxWidth"))||b.maxWidth,h="",e=a("<tester/>").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:d.css("fontSize"),fontFamily:d.css("fontFamily"),fontWeight:d.css("fontWeight"),letterSpacing:d.css("letterSpacing"),whiteSpace:"nowrap"}),c=function(){if(h===(h=d.val())){return}var o=h.replace(/&/g,"&amp;").replace(/\s/g,"&nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");e.html(o);var m=e.width()+b.comfortZone,n=(m>=f)?((m<=g)?m:g):f,l=d.width(),j=(n<l&&n>=f)||(n>l&&n<=g);if(j){d.width(n)}};e.insertAfter(d);d.css({"-webkit-transition-duration":"0.1s","-webkit-transition-timing-function":"ease-in-out","-webkit-transition-property":"width","-moz-transition-duration":"0.1s","-moz-transition-timing-function":"ease-in-out","-moz-transition-property":"width"});d.bind("keyup keydown blur update",c);c()});return this}})(jq);(function(){jq.fn.hintInputBox=function(a){var b={message:"",blurClass:"blur"};var a=jq.extend(b,a);return this.each(function(){var d=jq(this);var e=jq(this.form);var f=jq(window);function c(){if(d.val()===a.message&&d.hasClass(a.blurClass)){d.val("").removeClass(a.blurClass)}}d.blur(function(){if(this.value===""){d.addClass(a.blurClass).val(a.message)}}).focus(c).blur();e.submit(c);f.unload(c)})}})();(function(a){a.fn.tipTip=function(c){var g={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var e=a.extend(g,c);if(a("#tiptip_holder").length<=0){var b=a('<div id="tiptip_holder" style="max-width:'+e.maxWidth+';"></div>');var d=a('<div id="tiptip_content"></div>');var f=a('<div id="tiptip_arrow"></div>');a("body").append(b.html(d).prepend(f.html('<div id="tiptip_arrow_inner"></div>')))}else{var b=a("#tiptip_holder");var d=a("#tiptip_content");var f=a("#tiptip_arrow")}return this.each(function(){var j=a(this);if(e.content){var n=e.content}else{var n=j.attr(e.attribute)}if(n!=""){if(!e.content){j.removeAttr(e.attribute)}var h=false;if(e.activation=="hover"){j.hover(function(){m()},function(){if(!e.keepAlive){l()}});if(e.keepAlive){b.hover(function(){},function(){l()})}}else{if(e.activation=="focus"){j.focus(function(){m()}).blur(function(){l()})}else{if(e.activation=="click"){j.click(function(){m();return false}).hover(function(){},function(){if(!e.keepAlive){l()}});if(e.keepAlive){b.hover(function(){},function(){l()})}}}}function m(){e.enter.call(this);d.html(n);b.hide().removeAttr("class").css("margin","0");f.removeAttr("style");var B=parseInt(j.offset()["top"]);var r=parseInt(j.offset()["left"]);var y=parseInt(j.outerWidth());var D=parseInt(j.outerHeight());var A=b.outerWidth();var v=b.outerHeight();var z=Math.round((y-A)/2);var q=Math.round((D-v)/2);var p=Math.round(r+z);var o=Math.round(B+D+e.edgeOffset);var w="";var F="";var x=Math.round(A-12)/2;if(e.defaultPosition=="bottom"){w="_bottom"}else{if(e.defaultPosition=="top"){w="_top"}else{if(e.defaultPosition=="left"){w="_left"}else{if(e.defaultPosition=="right"){w="_right"}}}}var u=(z+r)<parseInt(a(window).scrollLeft());var s=(A+r)>parseInt(a(window).width());if((u&&z<0)||(w=="_right"&&!s)||(w=="_left"&&r<(A+e.edgeOffset+5))){w="_right";F=Math.round(v-13)/2;x=-12;p=Math.round(r+y+e.edgeOffset);o=Math.round(B+q)}else{if((s&&z<0)||(w=="_left"&&!u)){w="_left";F=Math.round(v-13)/2;x=Math.round(A);p=Math.round(r-(A+e.edgeOffset+5));o=Math.round(B+q)}}var C=(B+D+e.edgeOffset+v+8)>parseInt(a(window).height()+a(window).scrollTop());var E=((B+D)-(e.edgeOffset+v+8))<0;if(C||(w=="_bottom"&&C)||(w=="_top"&&!E)){if(w=="_top"||w=="_bottom"){w="_top"}else{w=w+"_top"}F=v;o=Math.round(B-(v+5+e.edgeOffset))}else{if(E|(w=="_top"&&E)||(w=="_bottom"&&!C)){if(w=="_top"||w=="_bottom"){w="_bottom"}else{w=w+"_bottom"}F=-12;o=Math.round(B+D+e.edgeOffset)}}if(w=="_right_top"||w=="_left_top"){o=o+5}else{if(w=="_right_bottom"||w=="_left_bottom"){o=o-5}}if(w=="_left_top"||w=="_left_bottom"){p=p+5}f.css({"margin-left":x+"px","margin-top":F+"px"});b.css({"margin-left":p+"px","margin-top":o+"px"}).attr("class","tip"+w);if(h){clearTimeout(h)}h=setTimeout(function(){b.stop(true,true).fadeIn(e.fadeIn)},e.delay)}function l(){e.exit.call(this);if(h){clearTimeout(h)}b.fadeOut(e.fadeOut)}}})}})(jq);
/*!
 * jQuery Text Overflow v0.7
 *
 * Licensed under the new BSD License.
 * Copyright 2009-2010, Bram Stein
 * All rights reserved.
 */
(function(c){function a(f,j){var h=0,e=[],g=function(l){var n=0,m;if(h>j){return}for(n=0;n<l.length;n+=1){if(l[n].nodeType===1){m=l[n].cloneNode(false);e[e.length-1].appendChild(m);e.push(m);g(l[n].childNodes);e.pop()}else{if(l[n].nodeType===3){if(h+l[n].length<j){e[e.length-1].appendChild(l[n].cloneNode(false))}else{m=l[n].cloneNode(false);m.textContent=c.trim(m.textContent.substring(0,j-h));e[e.length-1].appendChild(m)}h+=l[n].length}else{e.appendChild(l[n].cloneNode(false))}}}};e.push(f.cloneNode(false));g(f.childNodes);return c(e.pop().childNodes)}var b=document.documentElement.style;var d=("textOverflow" in b||"OTextOverflow" in b);if(c.support.textOverflow=d){c.fn.textOverflow=function(){return this}}else{c.fn.textOverflow=function(g,e){var f=g||"&#x2026;";return this.each(function(){var n=c(this),o=n.clone(),r=n.clone(),m=n.text(),h=n.width(),p=0,q=0,l=m.length,j=function(){if(h!==n.width()){n.replaceWith(r);n=r;r=n.clone();n.textOverflow(g,false);h=n.width()}};n.after(o.hide().css({position:"absolute",width:"auto",overflow:"visible","max-width":"inherit"}));if(o.width()>h){while(p<l){q=Math.floor(p+((l-p)/2));o.empty().append(a(r.get(0),q)).append(f);if(o.width()<h){p=q+1}else{l=q}}if(p<m.length){n.empty().append(a(r.get(0),p-1)).append(f)}}o.remove();if(e){setInterval(j,200)}})}}})(jq);(function(a){a.ellipsisTooltip=function(b){this.init(b||{});return this};a.extend(a.ellipsisTooltip,{checkIfPossible:function(){if(a.fn.textOverflow==undefined||a.fn.tipTip==undefined){return false}return true},prototype:{settings:{activation:"hover",keepAlive:false,maxWidth:"auto",edgeOffset:3,defaultPosition:"top",delay:0,fadeIn:200,fadeOut:200,attribute:"title",content:false,ellipseString:"&#x2026;",maxWidth:"auto"},init:function(b){this.settings=a.extend({},this.settings,b)},processNode:function(b){var b=a(b);var d=a.support.textOverflow?b.width():null;var c=b.text();if(a.support.textOverflow){if(this.getTextWidth(b)<d+1){return}}else{b.textOverflow(this.settings.ellipseString);if(!b.text().match(/âŠ$/)){return}}b.tipTip(a.extend(this.settings,{content:c}))},getTextWidth:function(c){var d=c.clone();d.css({width:"auto",display:"none"});d.appendTo(c.parent());var b=d.width();d.remove();return b}}});a.fn.ellipsisTooltip=function(b){if(a.ellipsisTooltip.checkIfPossible()){return this.each(function(){var c=new a.ellipsisTooltip(b);c.processNode(this)})}return this}})(jq);var R9={extend:function(c,g){var b=R9,e=c.split("."),a=e.length;for(var d=0;d<a;d++){var f=e[d];b[f]=b[f]||{};b=b[f]}for(k in g){b[k]=g[k]}}};jq.fn.disableButton=function(){return this.addClass("ui-state-disabled").prop("disabled",true)};jq.fn.enableButton=function(){return this.removeClass("ui-state-disabled").removeProp("disabled")};(function(){var a=new Date();a.setFullYear(a.getFullYear()+1);jq.datepicker.setDefaults({altFormat:"D, d. M yy",closeText:"Lukk",currentText:"Nåværende",dateFormat:"dd.mm.yy",dayNames:"søndag,mandag,tirsdag,onsdag,torsdag,fredag,lørdag".split(","),dayNamesMin:"s,m,t,o,t,f,l".split(","),dayNamesShort:"sø,ma,ti,on,to,fr,lø".split(","),firstDay:parseInt("2")-1,maxDate:a,minDate:new Date(),monthNames:"januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember".split(","),monthNamesShort:"jan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des".split(","),prevText:"Forrige",nextText:"Neste",showAnim:"",showMonthAfterYear:false})})();jq.r9datepicker={parseDate:function(a){return jq.datepicker.parseDate("mm/dd/yy",a)}};jq.fn.r9datepicker=function(f){var j=f.defaultDate,a="dd.mm.yy";if(j){this.val(jq.datepicker.formatDate(a,j));jq(f.altField).text(jq.datepicker.formatDate(f.altFormat||"D, d. M yy",j))}else{jq(f.altField).text(a)}var e=f.beforeShow;var c=f.onClose;var h=f.onSelect;var b=this;var g=function(d,n,l,m){jq(b).trigger(d,[m]);if(n){n(m,l)}};f.beforeShow=function(d,l){g("sbopen",e,d,l)};f.onClose=function(l,d){g("sbclose",c,l,d)};f.onSelect=function(l,d){g("sbset",h,l,d)};return this.attr({autocomplete:"off",autocapitalize:"off",autocorrect:"off"}).datepicker(f)};var R9=R9||{};R9.dp=(function(){function a(e,d){return(c(d)-c(e))/86400000}function b(e,f){var d=e[f];delete e[f];return d}function c(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())}return{doublePicker:function(u,r){var f=u.defaultDate,d=r.defaultDate,j=jq(u.altField),g=jq(r.altField),p=b(u,"onSelect")||jq.noop,n=b(r,"onSelect")||jq.noop,o=jq(b(u,"selector")),m=jq(b(r,"selector")),s=u.resetAfterDays||30,e=u.minRangeDays||0,l=u.numberOfMonths||2,h=r.numberOfMonths||2,q=u.pop2==undefined?true:u.pop2;o.r9datepicker(jq.extend({beforeShowDay:function(v){return[true,(v&&d&&v.getTime()==d.getTime())?"ui-datepicker-marked-day":""]},numberOfMonths:l,onSelect:function(y,x){f=o.datepicker("getDate");var w=d&&a(f,d);if(!d||w>s||w<e){m.datepicker("setDate",null).datepicker("option","defaultDate",f);g.text("dd.mm.yy")}p.call(this,y,x);if(q){if(m.is(":visible")&&m.css("visibility")!="hidden"){function v(){m.focus()}window.setTimeout(v,50)}}}},u));m.r9datepicker(jq.extend({beforeShowDay:function(v){return[true,(f&&v&&f.getTime()==v.getTime())?"ui-datepicker-marked-day":""]},numberOfMonths:h,onSelect:function(x,w){d=m.datepicker("getDate");var v=f&&a(f,d);if(!f||v<e){o.datepicker("setDate",null).datepicker("option","defaultDate",d);j.text("dd.mm.yy")}n.call(this,x,w)}},r))}}})();var R9=R9||{};R9.utils=function(){return{formToObject:function(c){var b={},a=jq(c).serializeArray();jq.each(a,function(){b[this.name]=this.value});return b},slugify:function(a){return a.replace(/[^A-Za-z0-9-_]/g,"")}}}();var R9=R9||{};R9.social=function(){var c=0,b=0,a=null;function e(g,f){c++;if(c>30){c=0;f()}else{jq.post("/s/toolbox",{action:"listat"},function(h){if(h.status=="OK"){c=0;g()}else{if(h.error=="user.rejected"){c=0;f()}else{setTimeout(function(){e(g,f)},1000)}}},"json")}}function d(g,h,f){a=window.open(g,"LinkedInAuth","width=470,height=420");setTimeout(function(){e(h,f)},1000)}return{_fbLogin:function(f){jq.get("/vs/fb/login/show?action=vs");f=jq.extend({error:jq.noop,perms:"email,user_hometown,user_location",success:jq.noop},f);FB.login(function(g){if(g.authResponse){jq.cookie("fbUserId",g.authResponse.userID,{path:"/"});jq.cookie("fbAuthToken",g.authResponse.accessToken,{path:"/"});jq.get("/vs/fb/login/accept?action=vs");f.success()}else{jq.cookie("fbUserId",null,{path:"/"});jq.cookie("fbAuthToken",null,{path:"/"});jq.get("/vs/fb/login/reject?action=vs");f.error()}},{scope:f.perms});return false},checkPermissions:function(f,g){FB.getLoginStatus(function(j){if(j.authResponse){var l=FB.Data.query("select uid, {0} from permissions where uid={1}",f,j.session.uid);try{l.wait(function(m){if(m.length>0){g(m[0])}else{g(null)}})}catch(h){g(null)}}else{g(null)}})},fbLink:function(g,f){FB.getLoginStatus(function(h){if(h.authResponse){FB.logout(function(){AjaxReg.ui.linkWarning(g,f)});return false}else{return R9.social._fbLogin({success:function(){AjaxReg.facebook.link(g)},perms:f||""})}})},fbLogin:function(f){var h;if(f){h=typeof f==="function"?f:f.success}function g(){AjaxReg.facebook.login(0,h,f.confcode)}f=jq.extend({error:jq.noop},f,{success:g});return R9.social._fbLogin(f)},shareToFacebook:function(){},shareToLinkedin:function(j,h){var j=j||"";var g={msg:j,action:"sendtoli"};h=jq.extend(g,h);b++;if(b>3){b=0;return false}var f=this;jq.post("/s/toolbox",h,function(l){if(l.status!="OK"&&l.error=="linkedin.noauth"){d(l.redirect,function(){f.shareToLinkedin(j,h)},function(){jq(document).trigger("r9.social.linkedinshare.failure",["linkedin.noauth"]);jq(document).trigger("r9.social.linkedinshare.complete")})}else{if(l.status=="OK"){jq(document).trigger("r9.social.linkedinshare.success")}else{jq(document).trigger("r9.social.linkedinshare.failure",[l.error])}jq(document).trigger("r9.social.linkedinshare.complete");b=0}},"json");return false}}}();function fbAsyncInit(){FB.init({oauth:true,appId:"163003079204",cookie:true,xfbml:true,status:true,channelUrl:location.protocol+"//"+location.hostname+"/k/run/fbauth/channel"});jq(document).trigger("r9.facebook.api.loaded");FB.Event.subscribe("edge.create",function(a,b){if(window.recordlike){recordlike(a)}});FB.getLoginStatus(function(a){if(a.status=="connected"){jq.cookie("fbUserId",a.authResponse.userID,{path:"/"});jq.cookie("fbAuthToken",a.authResponse.accessToken,{path:"/"})}else{jq.cookie("fbUserId",null,{path:"/"});jq.cookie("fbAuthToken",null,{path:"/"})}})}function load_facebook_api(){if(!document.getElementById("fb-root")){jq("<div/>",{id:"fb-root"}).appendTo("body")}jq.getScript(location.protocol+"//connect.facebook.net/nb_NO/all.js");jq("#fblink").click(function(){return R9.social.fbLink()});jq("#fbsignin").click(function(){return R9.social.fbLogin()})}function SetCookie(e,d,c,b){var a={path:"/",secure:false};if(c){a.expires=c}if(b){a.domain=b}jq.cookie(e,d,a)}function kmail(a){document.write('<a class="mlink" href="mailto:'+a+'&#64;kayak&#46;com">'+a+"&#64;kayak&#46;com</a>")}function kmail2(b,a){document.write('<a class="mlink" href="mailto:'+b+"&#64;"+a+'">'+b+"&#64;"+a+"</a>")}function validateEmail(a){if(a.length>0){var b=a.match("^(.+)@(.+)$");if(b!=null){if(b[1]!=null){if(b[1].match(/^\"?[\'\w-_\.\+]*\"?$/)==null){return false}}if(b[2]!=null){return b[2].match(/^[\w-\.]*\.[A-Za-z]{2,6}$/)!=null||b[2].match(/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/)!=null}}}return false}function roundTo(b,c,a){if(a==null){a=true}var d=Math.floor(b/c);if((b%c)>0){if(a){return((d+1)*c)}else{return(d*c)}}else{return b}}function getRadioValue(a){return jq(a).filter(":checked").val()||null}function showmessage(b,a){function c(e,d){jq("#messagebox").html(e);if(d&&d.length>0){jq("#messagebox").attr("title",d)}}if(jq("#messagebox").length==0){jq("body").append("<div title='Oppdaterer resultatene...' id='messagebox'></div>");c(b,a);jq("#messagebox").r9dialog({dialogClass:"messagebox",modal:false,showCloseX:false,closeOnEscape:false,position:["center",185]})}else{c(b,a);jq("#messagebox").r9dialog("open")}}function hidemessage(){if(jq("#messagebox").length>0){jq("#messagebox").r9dialog("close")}}function msie(a){return jq.browser.msie&&(!a||a>=jq.browser.version-0)&&jq.browser.version-0||0}function getFader(){var a=jq("#faderPane");if(!a.length){a=jq("<div id='faderPane' class='faderPane'></div>").appendTo("body")}return a}function toggleFaderPane(a,b){fader=getFader();if(a){fader.css("height",jq(window).height()).show();jq(window).resize(function(){fader.css("height",jq(window).height())})}else{fader.hide()}hideMeOnPopup(a);fader[0].onclick=(typeof b=="function")&&a?b:null}function htmlSafe(a){return a.replace(/\&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\"/g,"&quot;").replace(/\'/g,"&#39;")}function stripSpaces(a){return a.replace(/\s/g,"")}function displaysmartad(iframe,rank){try{var smtaddiv=jq(iframe).contents().find("body #smtdiv");var smtad=eval("smtad="+jq(smtaddiv).text());if(smtad.provider_code&&smtad.searchid){getsmartadcreative(rank,smtad.provider_code,smtad.searchid,smtad.click_tracking,smtad.sz,true,Streaming.done);if(!Streaming.done){pollsmartadcreative(rank,smtad.provider_code,smtad.searchid,smtad.click_tracking,smtad.sz)}}}catch(ignored){}}function getsmartadcreative(d,a,l,c,g,b,j){var h=document.getElementById("displayAd"+d);if(h){var m="/h/ads/smartad?provider_code="+a+"&searchid="+l+"&clicktracking="+c+"&sz="+g+"&rank="+d+"&logimpr="+b+"&strm="+j;if(navigator.appVersion.indexOf("MSIE")!=-1){var f=document.getElementById("displayAdSpanFrame"+d);f.innerHTML=f.innerHTML.replace(/src="[^"]*"/,'src="'+m+'"')}else{setIframeUrl(h,m)}}}function pollsmartadcreative(e,a,b,d,c){if(!Streaming.done){setTimeout("pollsmartadcreative("+e+",'"+a+"','"+b+"','"+d+"','"+c+"')",1000)}else{getsmartadcreative(e,a,b,d,c,false,true)}}function loadDisplayAds(){jq("iframe[id^=displayAd]").each(function(){var f=this.id.replace("displayAd","");var a=jq(this).attr("longdesc");if(this.contentWindow.location.href==a){return}var e=!jq(this).hasClass("nonds");var d=this;if(e){this.onload=function(){displayAdOnloadJS(d,f)}}if(e&&navigator.appVersion.indexOf("MSIE")!=-1){var c=this.parentNode;if(c){var b=c.innerHTML;var g=b.replace(/src="[^"]*"/,'src="'+a+'" onload="displayAdOnloadJS(jq(\'#displayAd'+f+"'),"+f+');"');c.innerHTML=g}}else{setIframeUrl(this,a)}if(typeof(document.bannerUrls)=="undefined"){document.bannerUrls={}}document.bannerUrls["displayAd"+f]=a})}function displayAdOnloadJS(c,d){var b=jq(c).contents().find("body #smtdiv");var a=jq(c).contents().find("body #cmp2div");if(b&&b.length==1){displaysmartad(c,d)}else{resizeIframeToContents(c)}}jq(loadDisplayAds);function resizeIframeToContents(b){var a=jq(b).contents().find("body"),d=jq(b).attr("id").replace("displayAd","displayAdHide");if(a){b.height=a.height();b.width=a.width()}var c=jq(b).contents().find("body img");if(c&&c.length==1&&c.attr("src")!=null&&c.attr("src").indexOf("/kayakadpixel.gif")>0){jq(b).attr({height:0,width:0}).css("margin",0);jq("#bannerad"+d.replace("displayAdHide","")).hide();jq("#"+d).hide()}else{jq("#"+d).css("visibility","visible")}}var bannerAdReloadTimer=null;function reloadBannerAds(){function c(d,l){var h=document.getElementById(d);if(h!=null){if(!h.src){if(window.Streaming){Streaming.dbg(d+" NAF")}return}var f=navigator.appVersion.indexOf("MSIE")!=-1?h.contentWindow.location.href:h.src;if(typeof(document.bannerUrls)!="undefined"){if(document.bannerUrls[d]!=null){f=document.bannerUrls[d]}}var g=(f.indexOf("&ad_ts=")<0?f+ +"&ad_ts="+(new Date()).getTime():f.substring(0,f.indexOf("&ad_ts")))+"&ad_ts="+(new Date()).getTime();if(navigator.appVersion.indexOf("MSIE")!=-1){var j=document.getElementById("displayAdSpanFrame"+l);j.innerHTML=j.innerHTML.replace(/src="[^"]*"/,'src="'+g+'"')}else{setIframeUrl(h,g)}}}function a(d){d=document.getElementById(d);return d&&d.style.display!="none"}function b(){bannerAdReloadTimer=null;if(a("bannerad1")){c("displayAd1","1")}if(a("bannerad2")){c("displayAd2","2")}if(a("bannerad3")){c("displayAd3","3")}if(a("bannerad4")){c("displayAd4","4")}}if(bannerAdReloadTimer){window.clearTimeout(bannerAdReloadTimer)}bannerAdReloadTimer=window.setTimeout(b,2500)}function loadTT(f,b){var a=f.match(/^\#ttip(.*)/);var c=a&&a[1];if(!c||jq(f).length){b();return}var e=function(){if(!jq(f).length){jq("<div id='ttip"+c+"'></div>").appendTo("body")}b()};var d={action:"ttip",t:c};if(R9.ttip&&R9.ttip[c]){if(R9.ttip[c].empty){return e()}jq.extend(d,R9.ttip[c].params)}return ssAJAX("/s/toolbox",d,e)}function showTT(d,f,c,a,b,e){loadTT("#ttip"+c,function(){if(f!=""){jq("#ttipText"+c).html(f)}if(c=="BL"){var g=jq("#ttip"+c);g.css({left:"-9999",visibility:"visible"}).show(function(){_showTT(d,f,c,a,b,e)})}else{_showTT(d,f,c,a,b,e)}})}function _showTT(h,m,f,n,d,b){if(d==null||!d){hideAllTT(false)}else{if(b!=null){parts=b.split(",");for(var e=0;e<parts.length;e++){hideTTType(parts[e])}}}var g=jq("#ttip"+f);obj=document.getElementById("ttip"+f);obj.style.display="block";var c=jq(h).offset();var o=c.top;var a=c.left;if(n!=null){o+=n.y;a+=n.x}if(f=="BL"){g.show(function(){jq(this).position({my:"left bottom",at:"left top",offset:"-30 5",of:jq(h)})});return}else{if(f=="TL"){o=o+h.offsetHeight-5;a=a+h.offsetWidth-50}else{if(f=="CL"){o=o+h.offsetHeight-30;a=a+h.offsetWidth+25}else{if(f=="CR"||f=="FSP"){o=o-(g.outerHeight()/2)+(h.offsetHeight/2);if(f=="CL"||f=="FL"||f=="FSP"){a=a+h.offsetWidth}else{a=a-g.outerWidth()}}else{if(f=="FL"){a=a+jq(h).outerWidth()+20;o=o+(jq(h).outerHeight()/2)-65}else{if(f=="DL"){a=a+jq(h).outerWidth();o=o+(jq(h).outerHeight()/2)-50;obj.style.zIndex="45"}else{if(f=="DR"){var l=a;var j=o;o=o+(jq(h).outerHeight()/2)-50;a=a-(jq(obj).outerWidth()+3);obj.style.zIndex="45"}else{if(f=="CT"||f=="CB"){o=o-0+h.offsetHeight;if((jq.browser.mozilla||jq.browser.safari)&&(f=="CL"||f=="FL")){o+=8}else{if(jq.browser.msie&&parseInt(jq.browser.version)==6){}}a=a-(obj.offsetWidth/2)}}}}}}}}jq(obj).css({top:o,left:a,visibility:"visible"})}function hideAllTT(a){if(navigator.appVersion.indexOf("MSIE 6.")!=-1){jq("select.hideOnTT").css("visibility","visible")}if(a==null){a=true}jq.each(["BL","TL","CL","CR","CB","CT","DL","DR","FL","FSP","DX","DXC","DT","DTC","DG","DGC","SHR","HP","SLT","SLB"],function(){hideTTType(this)});try{jq("#createShareDiv").r9popover("close")}catch(b){}if(typeof localTTHidden=="function"&&a){localTTHidden()}jq("div.hideableTT").hide()}function hideTTType(a){jq("#ttip"+a).hide()}function simpleurl(b){if(b==null){return b}var d=b.indexOf("http://")==0,a=b.indexOf("/",d?7:0),c=a>0?b.substring(d?7:0,a):b.substring(d?7:0);return c.indexOf("www.")==0?c.substring(4):c}function cleanUrl(a){if(a!=""&&a.indexOf("http")!=0){a="http://"+a.slice(0,1017)}return a}function isBadUrl(a){a=cleanUrl(a);return !(a.match(/^https?\:\/\/([A-Za-z0-9\-]*\.){1,}[A-Za-z0-9]{1,3}(\:[0-9]*)?[\/\?][^\s]*$/)||a.match(/^https?\:\/\/([A-Za-z0-9\-]*\.){1,}[A-Za-z0-9]{1,3}(\:[0-9]*)?$/)||a.match(/^https?\:\/\/([A-Za-z0-9\-]*\.){1,}(name|travel|museum|aero|mobi|info|jobs)(\:[0-9]*)?[\/\?][^\s]*$/)||a.match(/^https?\:\/\/([A-Za-z0-9\-]*\.){1,}(name|travel|museum|aero|mobi|info|jobs)(\:[0-9]*)?$/))}function replaceArgs(){str=arguments[0];for(var a=1;a<=arguments.length;a++){str=str.replace("{"+(a-1)+"}",arguments[a])}return str}var r9EventList=null;function pushRecordedEvents(){if(r9EventList&&r9EventList.length>0){var a={};jq.each(r9EventList,function(c){var d=(typeof this.value!="undefined")?this.value:"",b=(typeof this.units!="undefined")?this.units:"";a["event_"+c]=this.category+":"+this.subCategory+":"+this.name+":"+d+":"+b});jq.post("/s/sparkle?action=clientevents",a);r9EventList=[]}}function recordEvent(a,e,c,b,d){if(r9EventList==null){r9EventList=[];jq(window).unload(pushRecordedEvents)}jq.get("/vs/"+a+"/"+e+"/"+c+"/"+b+"/"+d+"?action=vs"+(typeof SearchID!="undefined"?"&searchid="+SearchID:""))}if(typeof String.prototype.localeCompare=="undefined"){String.prototype.localeCompare=function(a){if(this<a){return -1}if(this>a){return 1}return 0}}var R9_DisplayEds_JustHidden=false;function hideDisplayAds(a){R9_DisplayEds_JustHidden=true;AjaxAlert.disableDisplayAds();if(a==null||a){AjaxReg.regtype="displayad";AjaxReg.ui.register(function(){})}}function StringBuilder(a){this.strings=[""];this.append(a)}jq.extend(StringBuilder.prototype,{append:function(a){if(a){this.strings.push(a)}return this},clear:function(){this.strings.length=1}});StringBuilder.prototype.toString=function(){return this.strings.join("")};function kykButtonClicked(b,a){b=jq(b);b.find(".sideimg").each(function(){this.style.backgroundPosition=this.style.backgroundPosition.replace(/^0px/,"-90px").replace(/-60px/,"-90px").replace(/-30px/,"-90px")});b.find(".text").css({backgroundPosition:"0px -185px"});b.find(".up").hide();if(a!=null){b.find(".down").html(a)}b.find(".down").show();b.prop("disabled",true);b.find("div").prop("disabled",false);jq.each(["hover","mouseenter","mouseleave","click","mousedown","mouseup"],function(){b.unbind(this)});b.blur()}function bindKykButton(b){var a=b||"button.kykbtn";jq(a).hover(function(){jq(this).find(".sideimg").each(function(){this.style.backgroundPosition=this.style.backgroundPosition.replace(/^0px/,"-30px").replace(/^-60px/,"-30px")});jq(this).find(".text").css({backgroundPosition:"0px -111px"})},function(){jq(this).find(".sideimg").each(function(){this.style.backgroundPosition=this.style.backgroundPosition.replace(/-30px/,"0px").replace(/-60px/,"0px")});jq(this).find(".text").css({backgroundPosition:"0px -74px"})}).mousedown(function(){jq(this).find(".sideimg").each(function(){this.style.backgroundPosition=this.style.backgroundPosition.replace(/-30px/,"-60px")});jq(this).find(".text").css({backgroundPosition:"0px -148px"})});if(b==null){jq("button.kykbtnsingleclick").click(function(){jq(this).addClass("disabledKayakBtn");kykButtonClicked(this)})}}function showCountryList(a){if(document.getElementById("currentCountry")==null){jq("#countryList").load("/s/toolbox",{action:"countrylist",showCurr:a},function(){loadCCCpicker()})}}function rewriteRedirect(b,a){b=jq(b);b.attr("href","/out?url="+encodeURIComponent(b.attr("href"))+(a?"&h="+a:""));return true}jq(function(){bindKykButton()});function r9Float(a){return a-0}function hideMeOnPopup(a){jq("div.hideMeOnPopup").css({visibility:a==null||a?"hidden":"visible"})}function hideOnOutsideClick(a){jq("body").click(function(){jq("#"+a).hide().unbind("click");jq("body").unbind("click")});jq("#"+a).click(function(b){b.stopPropagation()})}function setToAnchor(m,e,b,j,n){var l=jq("#"+e).offset(),c=jq("#"+m).outerHeight(),a=jq("#"+m).outerWidth(),g=jq("#"+e).outerHeight(),d=jq("#"+e).outerWidth(),f=l.left,h=l.top;if(b=="left"){f=f-a}else{if(b=="right"){f+=d}}if(j!=0){h+=j}if(n!=0){f+=n}jq("#"+m).css({position:"absolute",left:f,top:h,zIndex:50})}function recordlike(a){jq.post("/s/toolbox","action=like&href="+escape(a));if(addAdt){addAdt("facebook.like")}}function gradientDialogCleanup(){function a(){jq(".dialog_top").hide().show()}a();window.setTimeout(a,2000)}function loadHashResults(a){var b=document.location.pathname;if(document.location.hash){if(b.indexOf("/",b.length-1)==-1){b+="/"}b+=document.location.hash.substring(1);loadResults(b,a)}else{document.location.reload()}}function evalScript(a){if(a.src){jq.ajax({url:a.src,async:false,dataType:"script"})}else{jq.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function loadResults(a,b,c){if(!window.samepageresults){document.location.href=a;return}jq.cookie("hashparams",null);if(document.location.hash&&document.location.hash.length>0){R9.ajaxHistory.ignoredChange(function(){document.location.hash=""})}jq.ajax({url:a,type:"GET",dataType:"html",complete:function(f,d){if(d==="success"){if(c){c()}jq("body")[0].innerHTML=f.responseText;Profiler.init();if(window.Filters){window.Filters=makeFilters(window.Filters.Generator)}jq.datepicker.initialized=false;window.samepagesuccess=false;jq("body script").each(function(){evalScript(this)});var e=a.match(/\/([^\/]*)\/([^\?]*)(\?.*)?/);if(e){var g;if(document.location.pathname.indexOf(e[1])==1){g=e[2]}else{g=e[1]+"/"+e[2]}if(!b){R9.ajaxHistory.ignoredChange(function(){if(window.samepagesuccess){document.location.hash=g}})}else{document.location.hash=g}}jq(document.body).css("cursor","default");R9.ui.initHeader();if(window.R9Admin&&window.samepagesuccess){setTimeout(function(){validateScripts(f.responseText)},5000)}R9.ajaxHistory.initialize(function(){loadHashResults(true)})}}})}function validateScripts(c){var b=jq("<div/>");if(c){b[0].innerHTML=c}try{validateJS(c&&b||null)}catch(a){alert("Hey, Admin!\nThis is not good: "+a)}}function deepExtend(b,a){if(!b){return a}jq.each(a,function(d,c){b[d]=deepExtend(b[d],c)});return b}function enableAddAdt(a,b){jq.get("/vs/"+a+"/"+b+"?action=vs"+(typeof SearchID!="undefined"?"&searchid="+SearchID:""))}function setIframeUrl(b,a){b.contentWindow.location.replace(a)}var emailDealSaveSuccess_clientSuccess=null,emailDealSaveSuccess_clientError=null,AjaxReg=(function(){var r=null;function e(z,A,y){alert(A)}function d(){return jq("#ajaxinner button")}function a(){b();m();jq("#showAlertRegLink").attr("href","javascript:showAlertSection()");jq("#emailAlertsPopupAfterClick").hide();jq("#hiddenCarsPopupAfterClick").show();AjaxReg.alreadyRegistered=true}function f(){b();m();AjaxReg.alreadyRegistered=false}function v(){location.reload(true)}function g(){jq("#ajaxinner").r9dialog("destroy").remove()}function o(){d().button("disable")}function j(){d().button("enable")}function b(){g();return false}function c(y){jq.ajax({url:y,dataType:"script",async:false,cache:false})}function p(){jq("tr.error").hide();jq("#ajaxmessage").addClass("hidden")}function x(y){return function(){if(s()){p();u("/k/run/fbauth/loginAndLinkExisting",jq("#ajaxinner form").serialize(),function(z){if(z.status==0){if(y){a();y()}else{v()}}else{l(z.message)}})}return false}}function m(){jq("#header").load("/k/headerajax?"+new Date().getTime(),R9.ui.initHeader)}function w(y){y=y||{};if(typeof y==="function"){y={success:y}}return y}function u(z,B,D){try{if(!r){if(typeof easyXDM=="undefined"){c("/v428/js/alien/easyXDM.min.js")}if(!jq.isPlainObject(window.JSON)){c("/v428/js/mweb/json2.js")}var A="/k/run/auth/xdm/",y=A+"name";r=new easyXDM.Rpc({local:y,remote:AjaxReg.remoteHost+A+"remoteMethods",remoteHelper:AjaxReg.remoteHost+y,swf:AjaxReg.remoteHost+"/images/v428165/swf/easyxdm.swf"},{remote:{postJSON:{}}})}r.postJSON(z,B,D,e)}catch(C){l('En ukjent feil har oppstått. Hvis den fortsetter, vennligst <a href="/feedback/form">send tilbakemelding</a>.');try{if(jq.isPlainObject(window.JSON)){jq.post("/k/run/auth/error",{e:JSON.stringify(C)})}}catch(E){}}}function h(y,z,A){g();jq.ajax({url:"/k/run/auth/display/"+y,data:z,dataType:"html",success:A||n,error:e,cache:false})}function l(y){var B=jq("#ajaxerror");if(B.length){jq("#ajaxerror").find("div").html(y).end().show()}else{var z=jq("#ajaxmessage").parents(".ui-dialog").width();var A=(z)?(z-50):500;jq("#ajaxmessage").html(y).css("width",A+"px").removeClass("hidden")}jq("#ajaxreason").hide();j()}function n(A,y){var B=jq(A),z={close:y,title:B.attr("title")};B.attr("title","").r9dialog(z).find("form").submit(o);d().button()}function q(){var y=jq("#fbLoginPopover").r9popover({modal:false,position:this,width:363}).find("a").blur().end();jq("body").one("click",function(){y.r9popover("close")});return false}function s(){p();var y=document.ajaxlogreg;jq(y).find(".highlight").removeClass("highlight");if(!validateEmail(y.username.value)){l("Angi en gyldig e-postadresse.");jq(y.username).addClass("highlight").focus();j();return false}if(y.passwd.value.length==0){l("Angi et passord");jq(y.passwd).addClass("highlight").focus();j();return false}return true}return{regtype:"default",defaultAirportCode:"",alreadyRegistered:false,confcode:"",usernamedefault:"",searchid:"",facebook:{link:function(y){p();jq.ajax({type:"POST",url:"/k/run/fbauth/link",dataType:"json",success:function(z){if(z.status==0){R9.globals.formtoken=z.formToken;if(y){b();m();AjaxReg.alreadyRegistered=true;y()}else{v()}}else{if(z.status==1){FB.logout();h("linkConflict")}else{if(z.status==-1){l(z.message)}}}},error:e})},login:function(y,A,z){p();jq.ajax({type:"POST",url:"/k/run/fbauth/login",data:{confcode:z||"",confirm:y||0},dataType:"json",success:function(B){if(B.status==0){R9.globals.formtoken=B.formToken;if(A){a();A()}else{v()}}else{if(B.status==1){if(B.message=="l"){h("link",null,function(C){C=jq(C);C.find("#ajaxlinkwelcome a").click(function(){b();FB.logout()});n(C);jq("#ajaxlinkfields").submit(x(A))})}else{h("fbWelcome",null,function(C){n(C);jq("#ajaxfbwelcome a").first().click(function(){jq("#ajaxfbwelcomefields").slideDown();jq("#ajaxfbwelcome a:first").slideUp();return false}).end().last().click(function(){AjaxReg.facebook.login(1,A,z);return false});jq("#ajaxfbwelcomefields").submit(x(A))})}}else{if(B.status==-1){l(B.message)}}}},error:e})},unlink:function(y){p();jq.ajax({type:"POST",url:"/k/run/fbauth/unlink",dataType:"json",success:function(z){if(z.status==0){R9.globals.formtoken=z.formToken;if(y){a();AjaxReg.alreadyRegistered=true;y()}else{v()}}else{l(z.message)}},error:e})}},ui:{linkWarning:function(z,y){h("linkWarning",null,function(A){n(A);d().click(function(){o();return R9.social.fbLink(z,y)})})},login:function(y){y=w(y);h("login",jq.extend({cc:AjaxReg.confcode,regtype:AjaxReg.regtype,srch:AjaxReg.searchid,un:AjaxReg.usernamedefault},y.data),function(z){n(z,y.error);jq("#ajaxfblogin > a").click(q);jq("#ajaxfblogin span:first").click(function(){return R9.social.fbLogin({confcode:AjaxReg.confcode,success:y.success})});jq("#ajaxtoggle a").click(function(){AjaxReg.ui.register(y);return false});var A=jq("#ajaxloginfields");A.submit(function(){if(s()){p();u("/k/run/auth/login",jq(this).serialize(),function(B){if(B.status==0){R9.globals.formtoken=B.formToken;if(y.success){AjaxReg.alreadyRegistered=true;y.success();a()}else{v()}}else{l(B.message)}})}return false});jq("input",A).focus(j);if(jq("input[name=username]",A).val()){jq("input[name=passwd]",A).focus()}})},register:function(y){y=w(y);h("reg",jq.extend({regtype:AjaxReg.regtype,dac:AjaxReg.defaultAirportCode,cc:AjaxReg.confcode,un:AjaxReg.usernamedefault,srch:AjaxReg.searchid},y.data),function(z){n(z,y.error);jq("#ajaxfblogin > a").click(q);jq("#ajaxfblogin span:first").click(function(){return R9.social.fbLogin({confcode:AjaxReg.confcode,success:y.success})});jq("#ajaxregisterfields").submit(function(){if(!validateEmail(this.username.value)){alert("Angi en gyldig e-postadresse.");this.username.focus();j();return false}if(this.airport.value.length==0){alert("Angi din flyplass.");this.airport.focus();j();return false}if(this.passwd.value.length==0){alert("Angi et passord");this.passwd.focus();j();return false}p();u("/k/run/auth/register",jq(this).serialize(),function(A){if(A.status==0){R9.globals.formtoken=A.formToken;if(y.success){AjaxReg.alreadyRegistered=true;y.success();a()}else{v()}}else{l(A.message)}});return false});jq("#ajaxregisterfields input").focus(j);jq("#ajaxregisterfields input[name=airport]").smartbox({callback:function(A){jq("#ajaxregisterfields input[name=airportcode]").val(A.id)},minWidth:175});jq("#ajaxtoggle a").click(function(){AjaxReg.ui.login(y);return false})})},logout:function(y){p();jq.ajax({type:"POST",url:"/k/run/fbauth/logout",dataType:"json",success:function(z){if(z.status==0){R9.globals.formtoken=z.formToken;f();if(y){y()}else{v()}}else{l(z.message)}},error:e})}}}})(),AjaxAlert={_ajaxError:function(b,c,a){alert(c)},_doPost:function(a,b){jq("tr.error").hide();jq.ajax({type:"POST",url:a,data:b,dataType:"script",error:this._ajaxError})},_getDriveByData:function(){return jq("#ajaxalert").serialize()},showEmailAlertError:function(a){jq("#alerterrorrow").show();jq("#alertsuccessrow").hide();jq("#ajaxalerterror").html(a)},showDuplicateEmailAlertError:function(a,b){if(typeof showPriceAlertSaved=="function"){showPriceAlertSaved(a,b)}},emailAlertSaveSuccess:function(a){if(typeof showPriceAlertSaved=="function"){showPriceAlertSaved(a)}},saveEmailAlert:function(){this._doPost("/k/alertajax","action=save&"+jq("#ajaxalert").serialize())},saveHotelAlert:function(){this._doPost("/alerts/hrp/save",jq("#hotelalert").serialize())},hotelAlertSaveSuccess:function(a){if(typeof showAlertSaved=="function"){showAlertSaved(a)}},showHotelAlertError:function(a){if(typeof showAlertError=="function"){showAlertError(a)}},showDriveByAlertDialog:function(a,b){if(!b){b="driveby"}jq.ajax({type:"POST",url:"/s/toolbox",data:{action:"driveby",searchid:a,alertsrc:b},dataType:"html",success:function(c){jq(c).r9dialog({close:function(){toggleFaderPane(false)},width:371})},error:this._ajaxError,cache:false})},saveAlertAjaxReg:function(d,a,b){var f=this._getDriveByData();if(AjaxReg.alreadyRegistered){AjaxAlert.saveDriveByEmailAlert(f)}else{var c=jq("#ajaxalert"),e=c.find("input:hidden[name=alertsrc]").val();AjaxReg.regtype=e;AjaxReg.searchid=d;if(a){AjaxReg.usernamedefault=a}AjaxReg.ui[b?"login":"register"]({success:function(){AjaxAlert.saveDriveByEmailAlert(f)},data:{alertsrc:e,hid:c.find("input:hidden[name=hid]").val()}})}},saveDriveByEmailAlert:function(a){this._doPost("/k/alertajax","action=save&"+(a||jq("#ajaxalert").serialize()))},saveChangeHomeAirportError:function(a){jq("tr.successrow").hide();jq("#ajaxairporterror").html(a);jq("#dealerrorrow").show();jq("tr.buttonrow").show();jq("tr.inputrow").show()},saveChangeHomeAirportSuccess:function(){saveChangeHomeAirport_clientSuccess()},saveChangeHomeAirport:function(){this._doPost("/k/savehomeairportajax","action=save&"+jq("#ajaxchangehome").serialize())},disableDisplayAds:function(){jq.ajax({type:"GET",url:"/s/sparkle",data:"action=hidedisplayads&"+jq("#ajaxalert").serialize(),dataType:"text",success:function(){jq("#displayAd1, #displayAd2, #displayAd3, #displayAd4, .hidedisplayad").hide("slow",function(){if(window.R9&&R9.RP&&R9.RP.FloatingAd){R9.RP.FloatingAd.refresh()}})},error:this._ajaxError,cache:false})}};function formatDate(f){if(f.length<6){return false}if(f.length>10){return false}if(f.indexOf("/")>=0){var e=f.split("/");if(e.length!=3){return false}if(e[0].length==0||e[1].length==0||e[2].length==0){return false}var a=parseInt(e[1],10);var d=parseInt(e[0],10);var c=parseInt(e[2],10)}else{if(f.indexOf("-")>=0){var e=f.split("-");if(e.length!=3){return false}if(e[0].length==0||e[1].length==0||e[2].length==0){return false}var a=parseInt(e[2],10);var d=parseInt(e[1],10);var c=parseInt(e[0],10)}else{if(f.indexOf(".")>=0){var e=f.split(".");if(e.length!=3){return false}if(e[0].length==0||e[1].length==0||e[2].length==0){return false}var a=parseInt(e[0],10);var d=parseInt(e[1],10);var c=parseInt(e[2],10)}else{return false}}}if(c<100){if(c<30){c+=2000}else{c+=1900}}if(!isValidDate(c,d,a)){return false}var b="";if(d<10){b+="0"}b+=d+"/";if(a<10){b+="0"}b+=a+"/";b+=c;return b}function isValidDate(c,d,a){if(c>=1970){var b=new Date(c,d-1,a);if(a!=b.getDate()){return false}if(d!=(b.getMonth()+1)){return false}if(c!=b.getFullYear()){return false}}else{if((a<1)||(a>31)){return false}if((d<1)||(d>12)){return false}if((c<1000)||(c>3000)){return false}}if(a>28){if(getNumberOfDays(c,d)<a){return false}}return true}function getNumberOfDays(a,b){switch(b){case 2:if(isLeapYear(a)){return 29}return 28;break;case 1:case 3:case 5:case 7:case 8:case 10:case 12:return 31;break;default:return 30}}function isLeapYear(a){return(((a%4==0)&&(a%100!=0))||(a%400==0))}function validDate(b){if(b.value.length==0){return true}if(!formatDate(b.value)){alert("Please enter a valid date. (MM/DD/YYYY format)");b.focus();b.select();return false}var a=formatDate(b.value);if(isNaN(Date.parse(a))){alert("Please enter a valid date. (MM/DD/YYYY format)");b.focus();b.select();return false}b.value=a;return true}function parseDate(d){var f=d.split("/");var e=parseInt(zeroUnpad(f[0]));var a=parseInt(zeroUnpad(f[1]));var c=parseInt(zeroUnpad(f[2]));var b=new Date(c,e-1,a);return b}function zeroPad(a){if(a.length==1){return"0"+a}return a}function zeroUnpad(a){a=""+a;if(a.match(/^0/)){return a.substring(1)}return a}function addDays(c,e){c.setDate(c.getDate()+e);var d=c.getMonth()+1;var a=c.getDate();var b=c.getYear();if(b<1900){b+=1900}return zeroPad(d)+"/"+zeroPad(a)+"/"+b}function countDays(c,a){c.setUTCMilliseconds(0);c.setUTCSeconds(0);c.setUTCMinutes(0);c.setUTCHours(12);a.setUTCMilliseconds(0);a.setUTCSeconds(0);a.setUTCMinutes(0);a.setUTCHours(13);var b=a.getTime()-c.getTime();return Math.floor(b/(1000*60*60*24))}function existsInArray(c,a){for(var b=0;b<c.length;b++){if(c[b]==a){return true}}return false}Date.prototype.formatDate=function(input,time){var switches=["a","A","B","d","D","F","g","G","h","H","i","j","l","L","m","M","n","O","r","s","t","T","U","w","y","Y","z"];var daysLong=["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"];var daysShort=["sø","ma","ti","on","to","fr","lø"];var monthsShort=["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"];var monthsLong=["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"];function a(){return self.getHours()>11?"pm":"am"}function A(){return self.getHours()>11?"PM":"AM"}function B(){var off=(self.getTimezoneOffset()+60)*60;var theSeconds=(self.getHours()*3600)+(self.getMinutes()*60)+self.getSeconds()+off;var beat=Math.floor(theSeconds/86.4);if(beat>1000){beat-=1000}if(beat<0){beat+=1000}if((""+beat).length==1){beat="00"+beat}if((""+beat).length==2){beat="0"+beat}return beat}function d(){return new String(self.getDate()).length==1?"0"+self.getDate():self.getDate()}function D(){return daysShort[self.getDay()]}function F(){return monthsLong[self.getMonth()]}function g(){return self.getHours()>12?self.getHours()-12:self.getHours()}function G(){return self.getHours()}function h(){if(self.getHours()>12){var s=new String(self.getHours()-12);return s.length==1?"0"+(self.getHours()-12):self.getHours()-12}else{var s=new String(self.getHours());return s.length==1?"0"+self.getHours():self.getHours()}}function H(){return new String(self.getHours()).length==1?"0"+self.getHours():self.getHours()}function i(){return new String(self.getMinutes()).length==1?"0"+self.getMinutes():self.getMinutes()}function j(){return self.getDate()}function l(){return daysLong[self.getDay()]}function L(){var y_=Y();if((y_%4==0&&y_%100!=0)||(y_%4==0&&y_%100==0&&y_%400==0)){return 1}else{return 0}}function m(){return self.getMonth()<9?"0"+(self.getMonth()+1):self.getMonth()+1}function M(){return monthsShort[self.getMonth()]}function n(){return self.getMonth()+1}function O(){var os=Math.abs(self.getTimezoneOffset());var h=""+Math.floor(os/60);var m=""+(os%60);h.length==1?h="0"+h:1;m.length==1?m="0"+m:1;return self.getTimezoneOffset()<0?"+"+h+m:"-"+h+m}function r(){var r;r=D()+", "+j()+" "+M()+" "+Y()+" "+H()+":"+i()+":"+s()+" "+O();return r}function s(){return new String(self.getSeconds()).length==1?"0"+self.getSeconds():self.getSeconds()}function t(){var daysinmonths=[null,31,28,31,30,31,30,31,31,30,31,30,31];if(L()==1&&n()==2){return 29}return daysinmonths[n()]}function T(){return G()+":"+i()}function U(){return Math.round(self.getTime()/1000)}function W(){var beforeNY=364+L()-z();var afterNY=z();var weekday=w()!=0?w()-1:6;if(beforeNY<=2&&weekday<=2-beforeNY){return 1}var ny=new Date("January 1 "+Y()+" 00:00:00");var nyDay=ny.getDay()!=0?ny.getDay()-1:6;if((afterNY<=2)&&(nyDay>=4)&&(afterNY>=(6-nyDay))){var prevNY=new Date("December 31 "+(Y()-1)+" 00:00:00");return prevNY.formatDate("W")}if(nyDay<=3){return 1+Math.floor((z()+nyDay)/7)}else{return 1+Math.floor((z()-(7-nyDay))/7)}}function w(){return self.getDay()}function Y(){if(self.getFullYear){var newDate=new Date("January 1 2001 00:00:00 +0000");var x=newDate.getFullYear();if(x==2001){return self.getFullYear()}}var x=self.getYear();var y=x%100;y+=(y<38)?2000:1900;return y}function y(){var y=Y()+"";return y.substring(y.length-2,y.length)}function z(){var t=new Date("January 1 "+Y()+" 00:00:00");var diff=self.getTime()-t.getTime();return Math.floor(diff/1000/60/60/24)}var self=this;if(time){var prevTime=self.getTime();self.setTime(time)}var ia=input.split("");var ij=0;while(ia[ij]){if(ia[ij]=="\\"){ia.splice(ij,1)}else{if(existsInArray(switches,ia[ij])){ia[ij]=eval(ia[ij]+"()")}}ij++}if(prevTime){self.setTime(prevTime)}return ia.join("")};Date.prototype.formatUTCDate=function(input,time){var switches=["a","A","B","d","D","F","g","G","h","H","i","j","l","L","m","M","n","O","r","s","t","T","U","w","y","Y","z"];var daysLong=["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"];var daysShort=["sø","ma","ti","on","to","fr","lø"];var monthsShort=["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"];var monthsLong=["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"];function a(){return self.getUTCHours()>11?"pm":"am"}function A(){return self.getUTCHours()>11?"PM":"AM"}function B(){var off=(self.getTimezoneOffset()+60)*60;var theSeconds=(self.getHours()*3600)+(self.getMinutes()*60)+self.getSeconds()+off;var beat=Math.floor(theSeconds/86.4);if(beat>1000){beat-=1000}if(beat<0){beat+=1000}if((""+beat).length==1){beat="00"+beat}if((""+beat).length==2){beat="0"+beat}return beat}function d(){return new String(self.getDate()).length==1?"0"+self.getDate():self.getUTCDate()}function D(){return daysShort[self.getUTCDay()]}function F(){return monthsLong[self.getUTCMonth()]}function g(){return self.getUTCHours()>12?self.getUTCHours()-12:self.getUTCHours()}function G(){return self.getUTCHours()}function h(){if(self.getUTCHours()>12){var s=new String(self.getUTCHours()-12);return s.length==1?"0"+(self.getUTCHours()-12):self.getUTCHours()-12}else{var s=new String(self.getUTCHours());return s.length==1?"0"+self.getUTCHours():self.getUTCHours()}}function H(){return new String(self.getUTCHours()).length==1?"0"+self.getUTCHours():self.getUTCHours()}function i(){return new String(self.getUTCMinutes()).length==1?"0"+self.getUTCMinutes():self.getUTCMinutes()}function j(){return self.getUTCDate()}function l(){return daysLong[self.getUTCDay()]}function L(){var y_=Y();if((y_%4==0&&y_%100!=0)||(y_%4==0&&y_%100==0&&y_%400==0)){return 1}else{return 0}}function m(){return self.getUTCMonth()<9?"0"+(self.getUTCMonth()+1):self.getUTCMonth()+1}function M(){return monthsShort[self.getUTCMonth()]}function n(){return self.getUTCMonth()+1}function O(){var os=Math.abs(self.getTimezoneOffset());var h=""+Math.floor(os/60);var m=""+(os%60);h.length==1?h="0"+h:1;m.length==1?m="0"+m:1;return self.getTimezoneOffset()<0?"+"+h+m:"-"+h+m}function r(){var r;r=D()+", "+j()+" "+M()+" "+Y()+" "+H()+":"+i()+":"+s()+" "+O();return r}function s(){return new String(self.getUTCSeconds()).length==1?"0"+self.getUTCSeconds():self.getUTCSeconds()}function t(){var daysinmonths=[null,31,28,31,30,31,30,31,31,30,31,30,31];if(L()==1&&n()==2){return 29}return daysinmonths[n()]}function T(){return G()+":"+i()}function U(){return Math.round(self.getTime()/1000)}function w(){return self.getUTCDay()}function Y(){if(self.getUTCFullYear){var newDate=new Date("January 1 2001 00:00:00 +0000");var x=newDate.getUTCFullYear();if(x==2001){return self.getUTCFullYear()}}var x=self.getUTCYear();var y=x%100;y+=(y<38)?2000:1900;return y}function y(){var y=Y()+"";return y.substring(y.length-2,y.length)}function z(){var t=new Date("January 1 "+Y()+" 00:00:00");var diff=self.getTime()-t.getTime();return Math.floor(diff/1000/60/60/24)}var self=this;if(time){var prevTime=self.getTime();self.setTime(time)}var ia=input.split("");var ij=0;while(ia[ij]){if(ia[ij]=="\\"){ia.splice(ij,1)}else{if(existsInArray(switches,ia[ij])){ia[ij]=eval(ia[ij]+"()")}}ij++}if(prevTime){self.setTime(prevTime)}return ia.join("")};function getShortTime(d,c){if(c==null||isFlexDate){c=false}var a=d.getUTCHours();var b=d.getUTCMinutes();if(b<10){b="0"+b}if(c){return d.formatUTCDate("D T")}else{return d.formatUTCDate("T")}}function getShortDate(a){return a.formatUTCDate("j M")}(function(){var d=27,l=9,a=18,n=38,j=40,c=37,g=39,e=13,m=16,f="smartboxOptions",b,h={air:1,car:2,hotel:3,any:4,crc:5,crcg:6,deal:7,crcga:8,hotelname:11,brandname:15};function o(){if(b){try{b.abort()}catch(p){}}}jq.fn.smartbox=function(u,r,q){if(!u||jq.isPlainObject(u)){u=jq.extend({},jq.fn.smartbox.defaults,u);var x,w;function p(){return jq(x).find("ul li")}function y(v){var z=p();retIndex=z.index(v);return retIndex==-1?0:retIndex}function s(){x.style.display=w.style.display="none"}this.each(function(){var J=jq(this),G=0,L,D,P,Q,A=0,I=false,z=false;function C(){if(x){x.style.display="none";x.innerHTML=""}if(w){w.style.display="none"}I=true;J.trigger("sbclose")}function H(){return J.data(f)}function E(){D=y(this);B(D);C()}function F(){D=-1;N(-1)}function O(){D=y(this);N(D)}function N(S){var T=H().itemHighlightClass;var U=p();U.removeClass(T);if(S>=0){jq(U[S]).addClass(T);D=S}}function B(U){var X=H();if(U<0){L="";J.data(X.dataKey,"");if(X.callbackWithNull){X.callback.call(J[0],null)}}else{if(Q>0){var W=p();var V=W[U],T=V.id.split("-"),Y="";if(T.length>1){Y=T[1]}J.data(X.dataKey,Y).val(jq(V).text());var S=jq.extend({id:Y,str:V.innerHTML,type:T[0]},jq(V).data());if(S.type=="isl"&&T.length>1){codes=T[1].split("/");S.str=codes[0]}if(T.length>2){S.hc=T[2]}if(T.length>3){if(S.type==="hotel"){S.hid=T[3]}else{if(S.type==="rest"){S.rtid=T[3]}else{S.lmid=T[3]}}}X.callback.call(J[0],S)}}J.trigger("sbset",[U])}function M(){var X=H(),U=x.style,W=w.style;U.display="inline";if(!window.opera){W.display="inline"}var V=Math.min(X.maxWidth,Math.max(X.minWidth,x.offsetWidth));U.width=W.width=V+"px";var T=J.offset(),S=T.left;if(X.position==="right"){S+=J.width()-V-2}U.left=S+"px";U.top=(T.top+J.outerHeight())+"px";W.height=x.offsetHeight+"px";W.top=U.top;W.left=U.left}function R(){var V=H(),U=J.val().toUpperCase(),S="";if(V.recentList!=null&&V.recentList.length>0){for(var T=0;T<V.recentList.length;T++){if(U.length==0||V.recentList[T].display.toUpperCase().indexOf(U)>=0){if(S.length==0){S="<li class='separator'><b>Nylige s\u00F8k:</b></li>"}S+="<li id='"+V.recentList[T].code+"' class='"+V.recentList[T].className+"'>"+V.recentList[T].display+"</li>"}}}if(jq.trim(S).length==0){return null}return S}function v(){J.trigger("sbopen");var U=H(),T=J.val();if(L.length>0&&L==T){return}if(T.length>=U.minChars){L=T;var S=jq.extend({f:"h",lc:U.localeLanguage,lc_cc:U.localeCountry,s:h[U.searchType]||U.searchType,where:L},U.getSmartData!=null?U.getSmartData():U.smartData);if(U.countryCode){S.cc=U.countryCode}b=jq.post(U.smartUrl,S,K,"text")}else{K(null)}}function K(V){var W=H();var T=R();if(T==null&&V==null){return}var S=(V==null)?1:0;V=(V||"<ul>");if(T!=null&&V.length>0&&V.indexOf("</ul>")>0){V=V.substr(0,V.indexOf("</ul>"))}V+=(T||"")+"</ul>";x.innerHTML=V;if(W.maxResults){jq(x).find("ul li").slice(W.maxResults).remove()}var U=p();Q=U.length;if(Q>0){U.mousedown(E).mouseout(F).mouseover(O);x.style.width="auto";M()}else{s()}D=(W.forceSelection||(W.forceSingle&&Q==1)?S:-1);P=D;N(D)}jq(this).attr({autocomplete:"off",autocapitalize:"off",autocorrect:"off"}).blur(function(){var S=H();if(!J.data(S.dataKey)){if(((D>=0&&S.forceSelection&&!S.noForceOnBlur)||(S.forceSingle&&Q==1))){B(0)}else{if(S.promptText){J.css("color",S.promptColor).val(S.promptText);z=true}}}o();C();I=false}).data(f,u).click(function(){var S=H();if(S.recentList!=null&&S.recentList.length>0){o();v()}}).focus(function(){var V=H();if(z){J.css("color","").val("");z=false}var T=V.targetId;x=document.getElementById(T)||jq("<div/>",{id:T,css:{display:"none",position:"absolute",width:"auto",zIndex:5001}}).appendTo("body")[0];x.className=V.targetClass||(V.searchType+"smartboxResults");var U=V.targetBGId;w=document.getElementById(U)||jq("<iframe/>",{id:U,css:{display:"none",position:"absolute",zIndex:5000},frameborder:0,scrolling:"no"}).appendTo("body")[0];L="";D=P=-1;I=false;if(J.size()&&J.val().length>0&&V.searchOnFocus){v()}else{if(V.getInitData){var S=V.getInitData.call();if(S){K(S)}}}}).keydown(function(T){var S=document.all?T.keyCode:T.which;G=S;A=new Date().getTime();switch(S){case c:case n:D=Math.max(D-1,0);N(D);break;case g:case j:D=Math.min(D+1,Q-1);N(D);break;case e:if(Q>0){B(D);C()}break;case d:C();break;case l:if(D>=0&&D<Q){B(D)}break;case a:case m:break;default:D=-1;B(-1);setTimeout(function(){if(G!=e){if(J.size()&&J.val().length>0){o();v()}else{B(-1);C()}}},1);break}}).keypress(function(){var S=!I;I=false;return S?true:G!=e})})}else{if(u==="option"){this.data(f)[r]=q}}return this};jq.fn.smartbox.defaults={callback:jq.noop,callbackWithNull:false,countryCode:null,dataKey:"smartbox",forceSelection:true,forceSingle:false,itemHighlightClass:"smartboxItemHi",localeCountry:"NO",localeLanguage:"no",maxResults:null,maxWidth:1000,minChars:1,minWidth:50,position:"left",promptColor:"#666",promptText:null,recentList:null,searchType:"air",smartData:{},smartUrl:"/m/smarty",targetClass:null,targetId:"smartbox",targetBGId:"smartboxBG"}})();var R9=R9||{};R9.ui=(function(){var a=false;var b=null;return{initHeader:function(){jq("#headermenudropdown a:last").click(function(){var c=jq(this).attr("href");if(!FB){jq(document).bind("r9.facebook.api.loaded",d)}else{d()}function d(){if(FB&&FB.getAuthResponse()){FB.logout(function(){window.location.href=c})}else{window.location.href=c}}return false});jq("#proflinksmenu").click(function(){var c=jq(this).offset();isHidden=!jq("#headermenudropdown").is(":visible");jq("#headermenudropdown").css({left:c.left,top:c.top+jq(this).height()+3}).show();hideMeOnPopup(isHidden);if(isHidden){window.setTimeout(function(){jq("body").one("click",function(){jq("#headermenudropdown").hide();hideMeOnPopup(false)})},1)}});jq("#sidestep_header #headermenu").mouseenter(function(){var c=jq(this).offset();jq("#headermenudropdown").css({left:c.left,top:c.top+jq(this).height()+1}).show()});jq("#sidestep_header #headermenudropdown").mouseleave(function(){jq(this).hide()})},initMapsAPI:function(d){b=d;var c=document.createElement("script");c.src="http://maps.google.com/maps/api/js?sensor=false&callback=R9.ui.initMapsAPIComplete";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)},initMapsAPIComplete:function(c){a=true;b(c)},isMapsAPIInitialized:function(){return a},doAfterMapsAPIInitialized:function(c){if(!a){this.initMapsAPI(c)}else{c()}}}})();jq(R9.ui.initHeader);var bound=false;function hoverDisclaimer(b,c,a,e){if(jq("#ttipDXC").is(":visible")){return}if(jq("#ttipDTC").is(":visible")){return}if(jq("#ttipDGC").is(":visible")){return}if(!bound){jq("a.disclaim, span.disclaim, span.closeareadis").click(function(f){f.stopPropagation()});bound=true}var d=new Object();if(a==null){a=20}if(e==null){e=-20}d.x=a;d.y=e;if(c){hideTTType("DX");hideTTType("DT");hideTTType("DG");showTT(b,"","DXC",d,true)}else{showTT(b,"","DX",d,true)}}function hideDisclaimerClicked(a){if(a==null){a=true}if(a){hideAllTT(false)}else{hideTTType("DXC");hideTTType("DTC");hideTTType("DGC")}}function hideDisclaimer(a){if(jq("#ttipDXC").is(":visible")){return}if(jq("#ttipDTC").is(":visible")){return}if(jq("#ttipDGC").is(":visible")){return}if(a==null){a=true}if(a){hideAllTT(false)}else{hideTTType("DX");hideTTType("DT");hideTTType("DG")}}function hoverTotalDisclaimer(b,c,a,e){if(jq("#ttipDXC").is(":visible")){return}if(jq("#ttipDTC").is(":visible")){return}if(jq("#ttipDGC").is(":visible")){return}if(!bound){jq("a.disclaim").bind("click",function(f){cancelEvents(f)});jq("span.disclaim").bind("click",function(f){cancelEvents(f)});jq("span.closeareadis").bind("click",function(f){cancelEvents(f)});bound=true}var d=new Object();if(a==null){a=20}if(e==null){e=-20}d.x=a;d.y=e;if(c){hideTTType("DX");hideTTType("DT");hideTTType("DG");showTT(b,"","DTC",d,true)}else{showTT(b,"","DT",d,true)}}function hoverGrandTotalDisclaimer(b,c,a,e){if(jq("#ttipDXC").is(":visible")){return}if(jq("#ttipDTC").is(":visible")){return}if(jq("#ttipDGC").is(":visible")){return}if(!bound){jq("a.disclaim").bind("click",function(f){cancelEvents(f)});jq("span.disclaim").bind("click",function(f){cancelEvents(f)});jq("span.closeareadis").bind("click",function(f){cancelEvents(f)});bound=true}var d=new Object();if(a==null){a=20}if(e==null){e=-20}d.x=a;d.y=e;if(c){hideTTType("DX");hideTTType("DT");hideTTType("DG");showTT(b,"","DGC",d,true)}else{showTT(b,"","DG",d,true)}}function XXX_emailDealSaveSuccess_clientSuccess(){alert("You are now subscribed to our deals email newsletter.");document.getElementById("dealemail").value="";document.getElementById("homeairport").value="";document.getElementById("homeairporthint").value=""}function XXX_emailDealSaveSuccess_clientError(a){alert(""+a)}function sampleNewsletter(){document.location.href="/h/newsletter/livedemo/deals?username="+encodeURIComponent(document.getElementById("dealemail").value)+"&homeairport="+encodeURIComponent(document.getElementById("homeairporthint").value)}function setDealsEmail(a){if(!validateEmail(document.getElementById("dealemail").value)){alert("Please enter a valid email address.")}else{saveEmailDeal(a)}}function showEmailDealError(a){XXX_emailDealSaveSuccess_clientError(a)}function emailDealSaveSuccess(){XXX_emailDealSaveSuccess_clientSuccess()}function saveEmailDeal(a){var b="action=save&src="+(a||"")+"&email="+encodeURIComponent(document.getElementById("dealemail").value)+"&homeairport="+encodeURIComponent(document.getElementById("homeairporthint").value);jq.ajax({type:"POST",url:"/k/dealajax",data:b,dataType:"script",success:function(c){},error:function(d,e,c){if(typeof this.callbackfail=="function"){this.callbackfail(d,e,c)}else{alert(e)}},cache:false})}jq(function(){jq("#homeairport").smartbox({callback:function(a){jq("#homeairporthint").val(a.id)},minWidth:175,timeout:0})});function generateFlightsUrl(c,m,d,a,l,j){var b="";if(m!=null&&j!="weekend"){b=generateLegParams(c,-1,m,j);if("openflex"==j){d=new Date(m.getTime());d.setDate(d.getDate()+30)}if(d!=null){var n=dateToString(d);b=b+"/"+n;b+=getTimeOption(c.return_time.value);if(j!="openflex"){b+=getFlexOption(c.return_date_flex.value)}else{var g=c.lengthofstay.value.replace("-","to");b+="-flexible-calendar-"+g}}if(c.prefer_nonstop!=undefined&&(c.prefer_nonstop.checked||c.prefer_nonstop.value=="Y")){b+="/nonstop"}}else{if(a){for(var f=0;f<l;f++){if(c["origin"+f]==null||c["origin"+f].value==""){break}if(f>0){b+="/"}b+=generateLegParams(c,f,a[f],"exact")}}else{b=generateOaD(c,"");b+="/weekend";var o=generateWeekendDays(c);var e=c.weekend_depart_date.value;if(e!="WEEKEND"){b+="/"+e.substr(0,4)+"-"+e.substr(4);if(o!=""){b+="-"+o}}else{if(o!=""){b+="/"+o}}}}var h=c.travelers.value;if(h>1){b+="/"+h+"adults"}b+=getCabinClass(c.cabin.value);return"/flights/"+b}function generateLegParams(b,l,g,f){var h="";if(l>-1){h=l+""}var c="depart_time"+h;var j="flex"+h;var a=generateOaD(b,h);var e=dateToString(g);a=a+"/"+e;a+=getTimeOption(b[c].value);var d;if(l==-1&&f!="openflex"){a+=getFlexOption(b.depart_date_flex.value)}else{if(f=="openflex"){a+="-flexible-calendar-0"}}return a}function generateOaD(c,n){var o="origin"+n;var j="destination"+n;var p="origincode"+n;var f="destcode"+n;var m="nearbyO"+n;var b="nearbyD"+n;var e=new RegExp("(([A-Z]{3}))","g");var d=c[p].value.substr(0,3);if(d==""||d.indexOf("C-")==0){d=c[o].value+"";d=d.replace(/ /g,"");if(d.indexOf("(")!=-1){var h=e.exec(d);if(h!=null){d=h[0]}}}var l=c[f].value.substr(0,3);if(l==""||l.indexOf("C-")==0){l=c[j].value+"";l=l.replace(/ /g,"");if(l.indexOf("(")!=-1){e.compile(e);var g=e.exec(l);if(g!=null){l=g[0]}}}var a=d;if(c[m]&&c[m].checked){a+=",nearby"}a+="-"+l;if(c[b]&&c[b].checked){a+=",nearby"}return a}function dateToString(c){var d=c.getMonth()+1;if(d<10){d="0"+d}var a=c.getDate();if(a<10){a="0"+a}var b=c.getFullYear()+"-"+d+"-"+a;return b}function getTimeOption(a){if(a=="a"){return""}else{if(a=="r"){return"-early-morning"}else{if(a=="m"){return"-morning"}else{if(a=="n"){return"-afternoon"}else{if(a=="e"){return"-evening"}else{if(a=="l"){return"-night"}else{return"-"+a+"h"}}}}}}}function getCabinClass(a){if(a=="p"){return"/premium"}else{if(a=="b"){return"/business"}else{if(a=="f"){return"/first"}}}return""}function generateWeekendDays(c){var b=c.weekend_depart.value;var a=c.weekend_return.value;var d="";if(b!="FRIDAY_ANYTIME"||a!="SUNDAY_ANYTIME"){d=generateWeekendDay(b)+"-"+generateWeekendDay(a)}return d}function generateWeekendDay(a){if(a=="THURSDAY_ANYTIME"){return"Thu"}else{if(a=="THURSDAY_AM"){return"Thu-AM"}else{if(a=="THURSDAY_PM"){return"Thu-PM"}else{if(a=="FRIDAY_ANYTIME"){return"Fri"}else{if(a=="FRIDAY_AM"){return"Fri-AM"}else{if(a=="FRIDAY_PM"){return"Fri-PM"}else{if(a=="SATURDAY_ANYTIME"){return"Sat"}else{if(a=="SATURDAY_AM"){return"Sat-AM"}else{if(a=="SUNDAY_ANYTIME"){return"Sun"}else{if(a=="SUNDAY_AM"){return"Sun-AM"}else{if(a=="SUNDAY_PM"){return"Sun-PM"}else{if(a=="MONDAY_ANYTIME"){return"Mon"}else{if(a=="MONDAY_AM"){return"Mon-AM"}else{if(a=="MONDAY_PM"){return"Mon-PM"}}}}}}}}}}}}}}return""}function getFlexOption(a){if(a=="plusminusthree"){return"-flexible"}else{if(a=="plusminustwo"){return"-flexible-2days"}else{if(a=="plusminusone"){return"-flexible-1day"}else{if(a=="plusone"){return"-flexible-1day-after"}else{if(a=="minusone"){return"-flexible-1day-before"}}}}}return""}function generateVacationsUrl(c,u,n){var a="";var o="origin";var w="destination";var p="origincode";var x="destcode";var f=new RegExp("(([A-Z]{3}))","g");var l=c[p].value.substr(0,3);if(l==""){l=c[o].value+"";l=l.replace(/ /g,"");if(l.indexOf("(")!=-1){var g=f.exec(l);if(g!=null){l=g[0]}}}var v=c[x].value.substr(0,3);if(v==""){v=c[w].value+"";v=v.replace(/ /g,"");if(v.indexOf("(")!=-1){f.compile(f);var y=f.exec(v);if(y!=null){v=y[0]}}}a=l+"-"+v;var r=dateToString(u);a=a+"/"+r;var e=dateToString(n);a=a+"/"+e;var q=c.kids.value;var b=c.adults.value;if(b!=2||q>0){a+="/"+b+"adult";if(b>1){a+="s"}}if(q>0){var d=0;var j=0;var h="";for(var s=1;s<=q;s++){var m=c["childAge"+s].value;if(m<2){j++}else{d++;if(d>1){h+=","}h+=m}}if(d>0){a+="/"+d+"child";if(d>1){a+="ren"}a+="-age"+h}if(j>0){a+="/"+j+"infant";if(j>1){a+="s"}}}return"/vacations/"+a}function dateToString(c){var d=c.getMonth()+1;if(d<10){d="0"+d}var a=c.getDate();if(a<10){a="0"+a}var b=c.getFullYear()+"-"+d+"-"+a;return b}function generateCruisesUrl(f){var h="";if(f.dep_date.value!=""){var d=f.dep_date.value.substr(0,4);var g=f.dep_date.value.substr(4,2);h=d+"-"+g}var a=f.destination;if(a.value!="ALL"){h+="/"+generateDestOrLineString(a.options[a.selectedIndex].text)}var c=f.cruiseline;if(typeof c.value!="undefined"&&c.value!=""){h+="/"+generateDestOrLineString(c.options[c.selectedIndex].text)}var e=f.length;if(e.value!="ALL"){h+="/"+generateLength(e)}if(f.senior!=undefined&&f.senior.checked){h+="/senior"}var b=f.region_code.value;if(b!=""){h+="/state-"+b}return"/cruises/"+h}function generateDestOrLineString(b){var a=b+"";return a.replace(/\//g,"-").replace(/\s-\s/g,"-").replace(/\s/g,"-")}function generateLength(a){return a.options[a.selectedIndex].text.replace(" ","").replace("+","-").toLowerCase()}var removeAccentedChars=(function(){var a=/[öäüÖÄÜáàâéèêúùûóòôÁÀÂÉÈÊÚÙÛÓÒÔßæçØøðÇÐÌÍÎÏìíîïÑñŠšŸÿýŽžŒ]/g;var b={"ä":"a","ö":"o","ü":"u","Ä":"A","Ö":"O","Ü":"U","á":"a","à":"a","â":"a","é":"e","è":"e","ê":"e","ú":"u","ù":"u","û":"u","ó":"o","ò":"o","ô":"o","Á":"A","À":"A","Â":"A","É":"E","È":"E","Ê":"E","Ú":"U","Ù":"U","Û":"U","Ó":"O","Ò":"O","Ô":"O","ß":"s","æ":"o","ç":"c","Ø":"O","ø":"o","ð":"e","Ç":"C","Ð":"D","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Š":"S","š":"s","Ÿ":"Y","ÿ":"y","ý":"y","Ž":"Z","ž":"z","Œ":"O"};return function(c){return(c.replace(a,function(d){return b[d]}))}})();function encodeLocation(b){var a=b+"";return removeAccentedChars(a.replace(/, /g,",").replace(/ - /g,",").replace(/ /g,"-")).replace(/[^A-Za-z0-9_\-,.]/g,"")}function generateHotelsUrl(b,m,c){var g=b.othercity.value;var l="-c";var h=b.address!=undefined?b.address.value:"";if(h!=""){g=h;if(h.indexOf(b.location.value)==-1){g+=","+b.location.value}l="-a"}var a=encodeLocation(g);var e=b.citycode.value;if(e!=""){a+=l+e}if(b.hid!=undefined&&b.hid.value!=""&&b.hid.value!=null){a+="-h"+b.hid.value}else{if(b.lmid!=undefined&&b.lmid.value!=""&&b.lmid.value!=null){a+="-l"+b.lmid.value}}if(m!=null){a+="/"+dateToString(m)+"/"+dateToString(c)}var d=b.rooms.value;var f=b.guests1!=undefined?b.guests1.value:b.guests.value;if(d>1&&b.guests2!=undefined){f=b.guests2.value}if(f>1){a+="/"+f+"guests"}var d=b.rooms.value;if(d>1){a+="/"+d+"rooms"}var j=b.address_nickname!=undefined?b.address_nickname.value:"";if(j!=""&&j!=h){a+="/at-"+encodeLocation(j)}return"/hotels/"+a}function generateCarsUrl(e,d,b){var a=e.citycode1.value;var f=null;var g=e.oneway.value==undefined?e.oneway[1].checked:e.oneway.value=="y";if(a.indexOf("/")==3){f=a.substring(0,3)+"-a"+a.substring(4)}if(f==null){f=encodeLocation(e.location.value)+"-c"+a}if(g){f+="/";var h=e.citycode2.value;var c=null;if(h.indexOf("/")==3){c=h.substring(0,3)+"-a"+h.substring(4)}if(c!=null){f+=c}else{f+=encodeLocation(e.location2.value)+"-c"+h}}f+="/"+generateDateTime(e,"pickup",d);f+="/"+generateDateTime(e,"dropoff",b);return"/cars/"+f}function generateDateTime(c,e,b){var d=dateToString(b);var a=c[e+"_hour"].value;if(a!=12){d+="-"+a+"h"}return d}function dateToString(c){var d=c.getMonth()+1;if(d<10){d="0"+d}var a=c.getDate();if(a<10){a="0"+a}var b=c.getFullYear()+"-"+d+"-"+a;return b}function generateSearchUrl(d,m,h){var v=d.usecleanurl==undefined?false:d.usecleanurl.value=="true";if(!v){return null}var c=null;var s="";if(d.tab.value=="flights"){var j=null;var u=null;var p=null;var e=6;var b=(d.dtFlexCat!=null)?((m)?jq(d.dtFlexCat).val():jq(d.dtFlexCat).filter(":checked").val()):null;if((m&&b!="weekend")||(!m&&(d.oneway[0].checked||d.oneway[1].checked))){u=jq(d.depart_date).datepicker("getDate");var l=true;if(d.oneway[0]==undefined){l=d.oneway.value=="n"}else{l=d.oneway[0].checked}if(l){p=jq(d.return_date).datepicker("getDate")}}else{if(d.oneway.length>2&&d.oneway[2].checked){j=new Array();for(var r=0;r<e;r++){j[r]=jq(d["depart_date"+r]).datepicker("getDate")}}}c=generateFlightsUrl(d,u,p,j,e,b);s="F"}else{if(d.tab.value=="hotels"){c=generateHotelsUrl(d,jq(d.checkin_date).datepicker("getDate"),jq(d.checkout_date).datepicker("getDate"));s="H"}else{if(d.tab.value=="cars"){c=generateCarsUrl(d,jq(d.pickup_date).datepicker("getDate"),jq(d.dropoff_date).datepicker("getDate"));s="C"}else{if(d.tab.value=="vacations"){c=generateVacationsUrl(d,jq(d.depart_date).datepicker("getDate"),jq(d.return_date).datepicker("getDate"));s="V"}else{if(d.tab.value=="cruises"){c=generateCruisesUrl(d);s="R"}}}}}if(c!=null){var n=c.indexOf("s/")+2;var q=c.substring(0,n-1);var f=encodeURIComponent(c.substring(n));var g="hiddenParams"+f;var a="";if(d.comparetosite!=undefined){var o=new Array();jq(d.comparetosite).each(function(){if(this.checked){o.push(this.value)}});a+="&comparetosite="+o.join(",")}if(d.comparetokayak!=undefined){var o=new Array();jq(d.comparetokayak).each(function(){if(this.checked){o.push(this.value)}});a+="&comparetokayak="+o.join(",")}a+=addHiddenParam(d,"src");a+=addHiddenParam(d,"c2s");a+=addHiddenParam(d,"po");a+=addHiddenParam(d,"personality");a+=addHiddenParam(d,"originsid");a+=addHiddenParam(d,"provider");a+=addHiddenParam(d,"r9secret");a+=addHiddenParam(d,"r9debug");a+=addHiddenParam(d,"searchType");a+=addHiddenParam(d,"recent");a+=addHiddenParam(d,"instasearch_id");a+=addHiddenParam(d,"fid");if(d.primetehkila&&d.primetehkila.checked){a+=addHiddenParam(d,"primetehkila")}document.cookie=g+"="+encodeURIComponent(a)+"; path=/";if(h){document.cookie=s+f+"=; expires=Fri, 01 Jan 1970 00:00:00 UTC; path=/"}}return c}function addHiddenParam(a,b){if(a[b]==undefined){return""}return"&"+b+"="+a[b].value}function setupSearchParams(a){document.cookie="formParams="+encodeURIComponent(a)+"; path=/";return true}function hideCCCpicker(){var a=jq("#countryList, #headermenudropdown, #morecurrencies");if(a.length){a.css("display","none");hideMeOnPopup(false)}}function loadCCCpicker(){var a=jq("#countrypickerlink"),c=a.offset(),b=jq("#countryList");jq("#countryList").css({left:c.left+a.width()-b.width(),top:c.top+a.height()+1});hideMeOnPopup(true);b.show();jq(document.body).one("click",function(f){var d=f.pageX,j=f.pageY,g=jq("#countryList"),h=g.offset();if(d<h.left||d>(h.left+g.width())||j<h.top||j>(h.top+g.height())){hideCCCpicker()}});jq("#countryList, #countrypickerlink, #headermenudropdown, #morecurrencies").click(function(d){d.stopPropagation()})}function saveCurrency(b,a){jq.ajax({type:"POST",url:"/k/ident/session/currency",data:{currency:b,posted:true,save:a},dataType:"text",success:function(){location.reload()},cache:false})}var who;var ESC=27;var TAB=9;var ALT=18;var UP=38;var DOWN=40;var LEFT=37;var RIGHT=39;var ENTER=13;var SHIFT=16;var lastKey=0;function keyDown(c){var b=document.all?window.event.keyCode:c.which;var a=String.fromCharCode(b).toLowerCase();lastKey=b;if(who!=null){who(b,a)}}function keysInit(a){document.onkeydown=keyDown;who=a;if(document.layers){document.captureEvents(Event.KEYPRESS)}}function noEnter(){return lastKey!=ENTER}var _toolong,_lastsent,_timeout,_itemCount,_idletimer,_cursel,_target;var _prevsel;var _inputcode=null,_searchtype;var _targetBG;var _input=null;var _numChoices;var sbHttp=null;var _stop;var _chars=1;var _sboxminwidth;var _clientsbcb;var _sbcountrycode;var _kayakSmartUrl="/m/smarty?";var _forceSelection=true;var _forceSingle=false;var _sbextraargs="";function cancelSmartBox(){keysInit(null);if((_forceSelection||(_forceSingle&&_itemCount==1))&&_inputcode!=null&&_inputcode.value!=null&&_inputcode.value.length<1){_setValue(0)}abortSmartBox();closeSmartBox();_input=null;_stop=false}function abortSmartBox(){if(sbHttp!=null){if(sbHttp.inprogress){sbHttp.cancelRequest()}}}function closeSmartBox(){if(_target!=null){_target.style.display="none";_target.innerHTML=""}if(_targetBG!=null){_targetBG.style.display="none"}_stop=true}function initSmartBox(j,o,g,n,f,m,a,c,b,d){_inputcode=_input=null;if(c!=null){_forceSelection=c}else{_forceSelection=true}if(d!=null){_forceSingle=d}else{_forceSingle=false}if(a){_kayakSmartUrl=a}else{_kayakSmartUrl="/m/smarty?"}if(b){_sbextraargs=b}else{_sbextraargs=""}cancelSmartBox();var l=document.getElementsByTagName("body")[0];_target=document.getElementById("smartbox");if(!_target){_target=document.createElement("div");_target.id="smartbox";_target.style.zIndex=5001;_target.style.position="absolute";_target.style.display="none";_target.style.width="auto";l.appendChild(_target)}_target.className=g+"smartboxResults";_targetBG=document.getElementById("smartboxBG");if(!_targetBG){_targetBG=document.createElement("iframe");_targetBG.id="smartboxBG";_targetBG.style.zIndex=5000;_targetBG.setAttribute("scrolling","no");_targetBG.setAttribute("frameborder","0");_targetBG.style.position="absolute";_targetBG.style.display="none";l.appendChild(_targetBG)}try{j.setAttribute("autocomplete","off");j.setAttribute("autocapitalize","off");j.setAttribute("autocorrect","off")}catch(e){}if(isNaN(parseInt(f))){_sboxminwidth=-1}else{_sboxminwidth=parseInt(f)}keysInit(keypressed);_input=j;_inputcode=o;_searchtype=g;_lastsent="";_timeout=n;_clientsbcb=m;var h=jq(j).offset();_target.style.top=(h.top+j.offsetHeight+1)+"px";_target.style.left=h.left+"px";if(_idletimer){clearTimeout(_idletimer);_idletimer=""}_toolong=false;_lastsent="";_cursel=-1;_prevsel=-1;_stop=false}function _runSearch(a){if(_lastsent==_input.value||_input.value.length<_chars){return}window.status="searching...";_lastsent=_input.value;var b="where="+encodeURIComponent(_lastsent);b+="&lc=no&lc_cc=NO";if(_searchtype=="air"){b+="&s=1"}else{if(_searchtype=="car"){b+="&s=2"}else{if(_searchtype=="hotel"){b+="&s=3"}else{if(_searchtype=="any"){b+="&s=4"}else{if(_searchtype=="crc"){b+="&s=5"}else{if(_searchtype=="crcg"){b+="&s=6"}else{if(_searchtype=="deal"){b+="&s=7"}else{if(_searchtype=="crcga"){b+="&s=8"}else{if(_searchtype=="hotelname"){b+="&s=11"}else{b+="&s="+_searchtype}}}}}}}}}if(_sbcountrycode!=null&&_sbcountrycode.length>0){b+="&cc="+_sbcountrycode}b+="&f=h";b+=_sbextraargs;jq.post(_kayakSmartUrl,b,function(e){window.status="";if(_input==a){_target.innerHTML=e;var d=_getSmartboxList();if(d&&d.childNodes){_itemCount=d.childNodes.length}else{_itemCount=0}if(_itemCount>0){for(var c=0;c<d.childNodes.length;c++){li=d.childNodes[c];li.onmousedown=_sbMouseDown;li.onmouseover=_sbMouseOver;li.onmouseout=_sbMouseOut}_target.style.width="auto";_showChoices()}else{_hideChoices()}_cursel=(_forceSelection||(_forceSingle&&_itemCount==1)?0:-1);_prevsel=_cursel;selChoice(_cursel)}},"text")}function setSbCountryCode(a){_sbcountrycode=a}function clearSbCountryCode(){_sbcountrycode=null}function getSbIndex(e){var f=_getSmartboxList();var c=0;if(f&&f.childNodes){for(var b=0;b<f.childNodes.length;b++){var d=f.childNodes[b];if(e==d){c=b;break}var g=false;for(var a=0;a<d.childNodes.length;a++){if(e==d.childNodes[a]){c=b;g=true;break}}if(g){break}}}return c}function _sbMouseOut(a){var b=a?a.target:this;_cursel=-1;selChoice(-1)}function _sbMouseDown(a){var b=a?a.target:this;_cursel=getSbIndex(b);_setValue(_cursel);closeSmartBox()}function _sbMouseOver(a){var b=a?a.target:this;_cursel=getSbIndex(b);selChoice(_cursel)}function _showChoices(){_target.style.display="inline";if(_sbShowBGIframe()){_targetBG.style.display="inline"}if(_sboxminwidth>_target.offsetWidth){_targetBG.style.width=_sboxminwidth+"px";_target.style.width=_sboxminwidth+"px"}else{_targetBG.style.width=_target.offsetWidth+"px";_target.style.width=_target.offsetWidth+"px"}_targetBG.style.height=_target.offsetHeight+"px";_targetBG.style.top=_target.style.top;_targetBG.style.left=_target.style.left}function _hideChoices(){_target.style.display="none";_targetBG.style.display="none"}function _getSmartboxList(){var b;if(_target.childNodes){for(var a=0;a<_target.childNodes.length;a++){var c=_target.childNodes[a];if(c.nodeName=="UL"){b=c;break}}}return b}function _setValue(c){if(c<0){_lastsent="";try{var j=(_inputcode.value!="");_inputcode.value="";if(j){_clientsbcb(null)}}catch(g){}}else{if(_itemCount>0){var h=_getSmartboxList();if(h==null||h.childNodes==null){return}var d=h.childNodes[c];var f=d.id.split("-");var a;if(f.length>1){a=f[1]}_inputcode.value=a;if(d.innerText!=undefined){_input.value=d.innerText}else{_input.value=d.textContent}try{if(typeof _clientsbcb=="function"){var l=new Object();l.str=d.innerHTML;l.type=f[0];l.id=a;l.inputField=_input;l.inputCodeField=_inputcode;if(f.length>2){l.hc=f[2]}if(f.length>3){if(l.type=="hotel"){l.hid=f[3]}else{l.lmid=f[3]}}_clientsbcb(l)}}catch(b){}}}}function selChoice(a){var c=_getSmartboxList();if(c&&c.childNodes&&c.childNodes.length>0){if(_prevsel>=0){var b=c.childNodes[_prevsel];if(b.className){b.className=b.className.replace(/ *smartboxItemHi/,"")}else{b.className=""}}if(a>=0){if(c.childNodes.length>0){var d=c.childNodes[a];d.className=d.className+" smartboxItemHi"}_prevsel=a}}}var _pressed=0;function keypressed(a,b){clearTimeout(_idletimer);_pressed=new Date().getTime();switch(a){case LEFT:case UP:_cursel=_cursel-1;if(_cursel<0){_cursel=0}selChoice(_cursel);break;case RIGHT:case DOWN:_cursel++;if(_cursel>=_itemCount){_cursel=_itemCount-1}selChoice(_cursel);break;case ENTER:if(_itemCount>0){_setValue(_cursel);closeSmartBox()}break;case ESC:closeSmartBox();break;case TAB:if(_cursel>=0&&_cursel<_itemCount){_setValue(_cursel)}case ALT:case SHIFT:break;default:_setValue(-1);_idletimer=self.setTimeout("idle()",_timeout)}}function sbNoEnter(){var a=(_stop==null||_stop!=true);_stop=false;return(a?true:noEnter())}function idle(a){if(noEnter()){_input.focus();var b=new Date().getTime();if(b-_pressed>_timeout){clearTimeout(_idletimer);_typer(_input)}else{clearTimeout(_idletimer);_idletimer=self.setTimeout("idle()",_timeout)}}}function _typer(a){if((_input!=null)&&_input.value.length>0){abortSmartBox();_runSearch(a)}else{_setValue(-1);closeSmartBox()}}function _sbShowBGIframe(){return(window.opera)?false:true}var R9=R9||{};var _isIE=navigator.appName.indexOf("Microsoft")>-1;var _isSafari=navigator.userAgent.indexOf("Safari")>-1;var _updatingResultsMessage=null;var _currentPageNum=1;var _numrows;var cancelAfterclick=false;var usePopoverPagingTooltip=false;if(typeof window.Streaming=="undefined"){window.Streaming={done:true}}function showPagingTooltip(){if(!window.R9Skin&&jq.cookie("pgmsgshown")!="y"&&!window.FILTER_CLICKED&&!(window.currentview=="map")){if(usePopoverPagingTooltip===true){jq('<div><div class="pagingToolTip popover"><span>Bruk filtrene til venstre for \u00E5 innskrenke resultatene.</span></div></div>').r9popover({position:"#topOfFilter",title:"Finn resultatene raskere…",width:350});jq(".ui-dialog-titlebar").before("<div class='pagingToolTipIcon'></div>")}else{var a={x:-6,y:70};showTT(document.getElementById("topOfFilter"),"<div class='pagingToolTip'><span class=\"hideTTX\" onclick=\"hideTTType('CT')\"></span><div><b>F\u00E5 resultater raskere</b></div><div>Ved \u00E5 angi filteralternativer til venstre innskrenkes resultatene til kun noen f\u00E5.</div></div>","CL",a);jq("body").one("click",function(){hideAllTT()})}jq.cookie("pgmsgshown","y");addAdt("showpgtooltip")}}function setPage(d){var b=d;function c(){scrollTo(0,0);if(b==2){showPagingTooltip()}addAdt("page/"+b);updateDisplayA_ds(b);try{FB.XFBML.parse()}catch(e){}}if(window.ssUserAction){return ssUserAction("PG"+b,c,{pn:b-1})}function a(){if(!isNaN(b)&&b>=1&&b!=_currentPageNum){_currentPageNum=b;updateTable("paging");pgNums();c();hidemessage()}}waitForResults(a)}function getFilteredCount(){if(!_filtered){return R9FltrdCount}if(window._ALLRESULTSLOADED||!window.R9FltrdCount){return _filtered.length}return R9FltrdCount>0?R9FltrdCount:_filtered.length}function clearPages(){_currentPageNum=1}function getUpdateMessage(b){var a="";if(_updatingResultsMessage!=null&&_updatingResultsMessage.length>0){a+=_updatingResultsMessage}else{if(b!=null&&b.length>0){a+=b}else{a+="Oppdaterer resultatene..."}}return a}function jumpToTopOfFilters(){try{document.getElementById("topOfFilter").scrollIntoView()}catch(a){}}function noop(){}function refilter(b,d,f){showmessage(getUpdateMessage("Bruker filtervalgene dine\u00A0..."));hideAllTT();var g=new Date();function c(){_updatingResultsMessage=null;updateDisplayA_ds("filter");addAdt("filtertime&"+(new Date().getTime()-g.getTime()))}if(window.ssUserAction){return ssUserAction("FLT",c)}var e=b||jq.noop;function a(){g=new Date();clearPages();var h=parseInt(document.resultsPaging.rowsper.value);if(d==null||d){setTop(0)}e();computeFiltered();if(h>_numrows){fNumRows(h)}if(_lastsort==null){updateTable(f)}else{if(_lastdirection!=null){_lastdirection=!_lastdirection}sortresults(_lastsort,true)}setTimeout(hidemessage,250);setTimeout(function(){try{FB.XFBML.parse()}catch(j){}},1000);c();if(typeof resetResultCount=="function"){resetResultCount()}}waitForResults(a)}function sortresults(a){var e=new Date();showmessage(getUpdateMessage("Sorterer resultatene..."));if(window.ssUserAction){var b=a.match(/(\w+)_([ab])$/);if(b){a=b[1];_lastdirection=b[2]=="a"}else{if(_currentsortid==a){_lastdirection=!_lastdirection}else{_lastdirection=true}}_currentsortid=a;return ssUserAction("SRT"+a,function(){updateDisplayA_ds("sort")})}var c=a;function d(){var m=new Date();clearPages();setTop(0);c();var j=new Date();var l=1000-(j.getTime()-e.getTime());setTimeout(hidemessage,((l>0)?l:1));_updatingResultsMessage=null;var h=new Date();addAdt("sorttime&"+(h.getTime()-m.getTime()));updateTable("sorting");updateDisplayA_ds("sort");var f=new Date();var g=new Date()}waitForResults(d)}function humanizeBookit(d,a){var c=null;if(d&&typeof(d)!="string"){c=jq(d);d=c.attr(a||"href")}if(!d||d.match(/&sc=/)){return d}var b=d.match(/code=(.*)&/);if(b){b=b[1].split(".")}if(!b||b.length<=6){return d}var e=(Math.abs(parseInt(b[0]))+Math.abs(parseInt(b[5])))%13242+1;d=d+"&sc="+e;if(c){c.attr(a||"href",d)}return d}var lastclickid=null;var lastclickmsg="";function itemClicked(b,m,g,f,l,e,j){humanizeBookit(e,j);f=f||"popup/resultclick";l=jq.extend({},l);if(b&&getResultID){l.resultid=getResultID(b)}if(g){l.pcode=g}if(typeof toggleShowAfterClickSection=="function"){toggleShowAfterClickSection(true,b,g)}if(window.hidePriceSelections&&!cancelAfterclick){hidePriceSelections()}if(window.ViewState){ViewState.update("clicked",b)}else{_r[b]._vs=1;if(lastclickid!=null){_r[lastclickid]._vs=2}}var h=(document.getElementById("popupAfterBooking")!=null);if(!h){var c=document.getElementById("msg"+b);var a=document.getElementById("resultmessage"+b);if(c){c.style.display=_isIE?"block":"table-row"}if(a){a.innerHTML=m}try{showprices(b,true)}catch(d){}}else{if(!cancelAfterclick){openbooking(null,m,g,b)}}if(lastclickid!=null){if(document.getElementById("msg"+lastclickid)!=null){document.getElementById("msg"+lastclickid).style.display="none"}if(document.getElementById("tbd"+lastclickid)!=null){document.getElementById("tbd"+lastclickid).style.backgroundColor="#eeeeee"}}jq("#tbd"+b).css("background-color","#eee");lastclickmsg=m;lastclickid=b;addAdt(f,l);return true}function openbooking(h,e,g,a){var b=(h!=null)?h:"popupAfterBooking";var d=window.getResultID?getResultID(a):_r[a]._id;var c=document.getElementById(b);if(c!=null&&"FR"!=g){function f(){closebooking(b)}toggleFaderPane(true,f);jq("#"+b).show().css({top:jq(window).scrollTop()+150,left:(jq(window).width()-jq("#"+b).width())/2});if(e!=null){jq("#popupbookmessage").html(e);e="<span class='closearea'><a class='actionlink' href='javascript: closebooking()'>lukk</a> <img onclick='closebooking()' src='/images/v42826/close-x-white.gif' border='0' width='11' height='11' /></span>"+e;jq("#popupAfterBooking > tbody > tr > td.title").html(e).children("span.fnf").css("display","none")}jq("#fnflink > a").attr("href","javascript: flightnotfound("+a+", '"+g+"')");if(typeof searchid!="undefined"){jq("#addtotripslink").attr("href","javascript: addAdt('afterclick/addtotrips');addResultToTrip('"+searchid+"', '"+d+"', 'addFlightToTrip"+a+"')");jq("#fbsharelink").attr("href","javascript:shareResultOnFacebook(searchid, rid, pcode);")}}}function closebooking(c){toggleFaderPane(false);var a=(c!=null)?c:"popupAfterBooking";var b=document.getElementById(a);if(b!=null){b.style.display="none"}}function hideSearchBox(){toggleFaderPane(false);jq("#doc3Outer").unbind("click",hideSearchBox);jq("#popupSearch").hide()}var _lastEmailAttemptID=null;function emailResult(a,b){return emailresult(window.getResultID&&getResultID(a)||_r[a],SearchID,a,b)}function emailresult(d,g,f,a){var h=585;var b=550;var e=0;var c="?resultid="+d+"&searchid="+g;if(a){c+="&bookingid="+a}var j=window.open("/s/emailresult"+c,"emailresult","scrollbars,height="+(h+e)+",width="+b+",menubar=no,toolbar=no,resizable");if(j!=null){if(f>0){_lastEmailAttemptID=f}j.focus()}}function emailsuccess(){if(_lastEmailAttemptID!=null){try{itemClicked(_lastEmailAttemptID,"Resultatinformasjon sendt via e-post og lagret i din s\u00F8kelogg.");_lastEmailAttemptID=null}catch(a){}}}var pinnedResultList=new Array();var displayPinnedItems=true;var justPinned=-1;function getPinnedIDList(){var b=new Array();for(var a=0;a<pinnedResultList.length;a++){b.push(_r[pinnedResultList[a].id]._pid);if(_r[pinnedResultList[a].id]._pid!=_r[pinnedResultList[a].id]._id){b.push(_r[pinnedResultList[a].id]._id)}}return b.join(",")}function storePinned(a){jq.post("/s/sparkle",a)}function addPinned(b){if(window.hideAllTT){hideAllTT()}if(window.ssUserAction){ssUserAction("PIN: "+b,{pin:b+1});return}PinnedItems[_r[b]._id]=1;pinnedResultList.push({id:b});justPinned=b;updateTable("pin_"+_r[b]._id);justPinned=-1;try{document.getElementById("startsearchover").scrollIntoView(true)}catch(c){}var a=getPinSaveFields(b);a+="&add=Y&action=pinneditem";storePinned(a)}function removePinned(b){if(window.hideAllTT){hideAllTT()}if(window.ssUserAction){var d=b==null?"-all":-b-1;ssUserAction("UNPIN: "+d,{pin:d});return}for(var c=0;c<pinnedResultList.length;c++){if(pinnedResultList[c].id==b){pinnedResultList.splice(c,1)}}delete PinnedItems[_r[b]._id];if(window.onlyShowFavorites&&pinnedResultList.length==0){onlyShowFavorites(false)}else{updateTable("unpin_"+_r[b]._id)}var a=getPinSaveFields(b);a+="&add=N&action=pinneditem";storePinned(a)}function getLeftOfResultsCell(a,b){if(typeof a=="undefined"){a="ccc"}if(typeof b=="undefined"){b="fff"}return"<td class='repeaty' style='background-image:url(/images/corners/"+a+"-l.gif)'></td>"}function getRightOfResultsCell(a,b){if(typeof a=="undefined"){a="ccc"}if(typeof b=="undefined"){b="fff"}return"<td class='repeaty' style='background-image:url(/images/corners/"+a+"-r.gif); background-position: right'></td>"}function localTTHidden(){toggleFaderPane(false,null)}function showFareChartTip(b){var c=document.getElementById("no_chart_data_helptext");var a=document.getElementById(b);if(c!=null&&a!=null){jq(a).html(c.innerHTML)}}function mkCurrency(a){return _LEFT_CURSYMBOL+a+_RIGHT_CURSYMBOL}function chkCompareToGroups(d){var a=[],l={};for(var c=0;c<d.length;c++){if(d[c].group==null||d[c].group.length==0){d[c].groupOK=true}else{var f=d[c].group.substr(0,d[c].group.indexOf("-")),g=parseInt(d[c].group.slice(d[c].group.indexOf("-")+1)),e=c;if(l[f]==null){for(var b=c+1;b<d.length;b++){var m=d[b].group.substr(0,d[b].group.indexOf("-"));if(m==f){var h=parseInt(d[b].group.slice(d[b].group.indexOf("-")+1));if(h<g){d[e].groupOK=false;if(d[e].input!=null){d[e].input.checked=false}e=b;g=h}else{d[b].groupOK=false;if(d[b].input!=null){d[b].input.checked=false}}}}}}}for(var c=0;c<d.length;c++){if(d[c].groupOK=true){a.push(d[c])}}return a}function compareToKayak(){var e=document.comparesites;var f=true;var a=new Array();if(typeof e.comparetosite!="undefined"){if(typeof e.comparetosite.length=="undefined"){if(e.comparetosite.checked){a.push({code:e.comparetosite.value,url:e[e.comparetosite.value+"_url"].value})}}else{var g=e.comparetosite;for(var d=0;d<g.length;d++){if(g[d].checked){a.push({code:g[d].value,url:e[g[d].value+"_url"].value,group:g[d].className})}}}var c=new R9.utils.windowopener({searchType:R9.globals.vertical,tileWindows:true});a=chkCompareToGroups(a);for(var b=0;b<a.length;b++){f=(f&&c.open(b,a[b].code,a[b].url,a.length))}}if(!f){document.getElementById("innerTableTTTL").style.width="800px";popupBlockerMsg(null);window.focus()}}function popupBlockerMsg(){toggleFaderPane(true,null);loadDialog("popupWarning","popupblockertooltipdiv",function(){showTT(document.getElementById("popupTTIPPos"),document.getElementById("popupWarning").innerHTML,"TL");jq("#tooltipdivimageholder").empty().append("<img align='left' style='margin-right: 8px' src='/images/a-pop-up-ani.gif'>");window.focus()})}function popupContinue(){toggleFaderPane(false,null);hideAllTT()}function isNumeric(c){var b=""+c;if(b.length==0){return false}else{if(b.length==1&&(b.charAt(0)=="."||b.charAt(0)==","||(b.charAt(0)=="-"))){return false}}for(var a=0;a<b.length;a++){if((b.charAt(a)>="0"&&b.charAt(a)<="9")||b.charAt(a)=="."||b.charAt(a)==","||(b.charAt(a)=="-"&&a==0)){}else{return false}}return true}function getLeaveBehindFilterCell(b,c,a){return["<a href='javascript:"+c+';addAdt("leavebehind/'+(a||b.replace("'","\\'"))+"\");'>","<span>"+b+"</span>","</a>"].join("")}function getLeaveBehindFilterLink(b,a){return['<a id="freset_',a||sectionName.replace("'","\\'"),'" ',"onclick='javascript:",b,';addAdt("leavebehind/',a||sectionName.replace("'","\\'"),"\");cancelPropagation(event);'>","tilbakestill","</a>"].join("")}function updateLeaveBehindFilterReasons(){var a=getLeaveBehindFilterReasons();if(a){jq("#leaveBehindFilters").html(a);jq("#checklets").show()}var b=getFilteredOutReasons().reasons;jq("#filterdiv .sectionSubHeader").each(function(){var e=false;if(b){for(var c=0;c<b.length&&!e;c++){var f=b[c];if(!f.heading||!f.sectionname){continue}if(this.id=="fs_outer_"+f.sectionname||this.id=="fs_outersub_"+f.sectionname){var d=jq(this).find(".freset");if(d&&d.html().length==0){d.html(getLeaveBehindFilterLink(f.action,f.name))}jq(this).addClass("filtered");e=true}}}if(!e&&jq(this).hasClass("filtered")){jq(this).removeClass("filtered").find(".freset").html("")}})}function getLeaveBehindFilterReasons(){var e=[];var a={};var b=false;var d=getFilteredOutReasons().reasons;for(var c=0;c<d.length;c++){var f=d[c];if(f.heading==null||f.heading==""){continue}if(a[f.heading]==null){if(!b){e[e.length]="<span class='title'>Filtre:</span>";b=true}e[e.length]=getLeaveBehindFilterCell(f.heading,f.action,f.name)+" ";a[f.heading]=true}}if(b){return e.join("")}return null}function get_slider_range(b){var a=jq(b);return a.length&&[a.slider("option","min"),a.slider("option","max")]||null}function inrange(b,a){return b>=a[0]&&b<=a[1]}function ui_select(a){return a&&document.resultUI&&document.resultUI[a]||null}function ui_check(b,a){jq(ui_select(b)).prop("checked",a?true:false)}function ui_checked(a,c){var b=jq(ui_select(a));var d=0;b.each(function(f,e){if(e.checked){c[e.value]=e.value;d++}});return d==b.length}function monthDayYear(a){if(!a){a=new Date()}return(a.getMonth()-0+1)+"/"+a.getDate()+"/"+a.getFullYear()}function populateAdSpace(a,b){jq.get("/h/ads/results?searchid="+a+"&pagenum="+_currentPageNum,function(c){var j=jq("<div/>").html(c);var m=j.find("#sideads");var q=j.find("#topads");var f=j.find("#bottomads");var h=j.find("#bottomads_opt_header_tr1");var g=j.find("#bottomads_opt_header_tr2");var o=j.find("#bottomads_text_ads_td");var n=j.find("#bottomads_separator_td");var p=j.find("#topbannerads");if(b){jq("#topBannerAdContainer").html(p)}if(q.children().length>0){jq("#topAdContainer").html(q).show();validateResultTopAdHeight()}else{jq("#topAdContainer").hide()}if(b){jq("#nrAds").html(m)}else{jq("#nrAdsAjax").html(m)}if(b){jq("#bottomAdContainer").html(f)}else{if(h.length>0){jq("#bottomads_ads_tr").before(h);jq("#bottomads_opt_header_tr1").after(g)}if(o.length>0){jq("#bottomads_display_ad_td").before(o);jq("#bottomads_text_ads_td").after(n)}}if(b&&typeof(document.bannerUrls)!="undefined"){for(id in document.bannerUrls){if(navigator.appVersion.indexOf("MSIE")!=-1){var d=id.slice(id.length-1);var e=document.getElementById("displayAdSpanFrame"+d).innerHTML;var l=e.replace(/src="[^"]*"/,'src="'+document.bannerUrls[id]+'"');document.getElementById("displayAdSpanFrame"+d).innerHTML=l}else{jq("#"+id).attr("src",document.bannerUrls[id])}}}loadDisplayAds()});if(window.CMP2RESULTSPAGE){pollinlinecmp2(a)}if(window.CROSSSALEDISPLAYAD&&window.crossSaleSetContent){populateCrossSaleAds(a)}}function validateResultTopAdHeight(){if(window.R9Admin&&window.R9TopAdsHeight){var a=jq("#topAdContainer").height();if(a>window.R9TopAdsHeight){alert("Hey, Admin!\nThis is not good: Top ads container '#topAdContainer' is pushing result content after loading. Check it's height!\nCurrent height difference from expected: "+(a-window.R9TopAdsHeight)+"px!")}}}function pollinlinecmp2(a){if(!Streaming.done){window.setTimeout("pollinlinecmp2('"+a+"')",1000)}else{cmp2setcontentinline()}}function cmp2setcontentinline(){var a=jq("#cmp2contentinline").html();if(a){jq(".cmp2inlinecontainer").html(a).show();jq(".cmp2inline").show();cmp2bottombarsetup(a);jq(".cmp2providerbutton").hover(function(){jq(this).addClass("hovering")},function(){jq(this).removeClass("hovering")})}}function cmp2bottombarsetup(b){jq("#cmp2BottomContent").html(b);a();jq("#cmp2BottomBar").show();function a(){var c=jq("#listbody").offset().left-8;jq("#cmp2BottomBar").css("left",c+"px")}jq(window).resize(function(){a()})}function cmp2setcontent(a){jq.ajax({type:"POST",url:"/h/ads/getcmp2",data:{searchid:a,alternatetemplate:"cmp2resultspage.vtl"},dataType:"html",success:function(c){jq("#cmp2container").html(c);var e=jq("#cmp2contentrightrail").html();if(e){jq("#cmp2rightrailcontainer").html(e).show();jq("#cmp2contentrightrail").remove()}jq("#cmp2topright").show();var b=jq("#cmp2contentbottom").html();if(b){jq("#cmp2bottomcontainer").html(b).show();jq("#cmp2contentbottom").remove();jq("#cmp2bottom").show()}var d=jq("#cmp2contentsearchcompleted").html();if(d){jq("#searchcompletedcontainer").html(d)}pollinlinecmp2(a)},error:function(b,d,c){if(window.R9Admin){alert("There was an error fetching the list of sites to compare prices to. Please refresh and try again.")}}})}function populateCrossSaleAds(a){crossSaleSetContent(a);if(!populateCrossSaleAds.handler){populateCrossSaleAds.handler=function(){crossSaleSetContent(a)};jq(window).bind("updateDisplayDone.crosssale",populateCrossSaleAds.handler);jq("form[name='inlinesearchagain']").submit(function(){jq(window).unbind("updateDisplayDone.crosssale",populateCrossSaleAds.handler);window.IS_CROSSSALE_REQUESTED=window.IS_CROSSSALE_IMPRESSED=false;populateCrossSaleAds.handler=null})}}function flippyDone(){jq("#flippyiframecontainer").hide(750);if(window.R9PBar){R9PBar._stopTimer()}}function shareResultOnFacebook(b,c,a){FB.login(function(e){if(e.session&&e.perms&&e.perms.indexOf("publish_stream")>-1){var d=d||"";jq.post("/h/socmed/facebookShareResult",{searchid:b,resultid:c,pc:a,prod:d},"json")}},{perms:"publish_stream"})}var R9PBar=null;function setupPBar(a){var b=window.R9_PBartimer&&jq("#progressDiv")||[];if(!b.length){return}R9PBar=new R9_PBartimer(b,(a?(a-0):60000)+5000)}var adt=new Array();function initAdt(d,b){if(!window.LogUserEvents){return false}try{adt.push(d);adt.push(SearchID);adt.push("load="+new Date().getTime());adt.push("rc="+_r.length);adt.push("fc="+_filtered.length);if(extraArgs){for(var c in extraArgs){adt.push(extraArgs[c])}}adt.push("resultmessage="+RANDOM_UPSELL_CODE)}catch(a){}}function addAdt(c,b){if(window.LogVSEvents&&c.indexOf("filtertime")<0&&c.indexOf("sorttime")<0){b=jq.extend({},b,{action:"vs"});if(window.SearchID){b.searchid=SearchID}jq.get("/vs/"+window.SearchType+"/"+c,b)}if(!window.LogUserEvents){return}try{adt.push('f="'+c+":"+new Date().getTime()+'"');if(adt.length>=20){sendAdt();initAdt()}}catch(a){}}function sendAdt(){if(!window.LogUserEvents){return}jq.post("/s/sparkle?action=filterstats&ts="+new Date().getTime()+(typeof SearchID!="undefined"?"&searchid="+SearchID:""),"log="+escape(adt.join(" ")));adt=new Array()}function allresultsloaded(){_ALLRESULTSLOADED=true;var a=document.getElementById("filtered_count");if(a){a.innerHTML=_filtered.length}Streaming.dbg("ALR=true")}function uistatsunload(){adt.push("unload="+new Date().getTime());sendAdt()}function flippyLoaded(){jq("#flippyblocker").hide()}function updateDisplayA_ds(a){if(window.NoAds||R9_DisplayEds_JustHidden||!window.SearchID||window.local_displayEdOKToUpdate&&!local_displayEdOKToUpdate()){return}addAdt("bannerreload");reloadBannerAds()}function waitForResults(d){var a=d;var b=0;function c(){if(_ALLRESULTSLOADED){d();jq(".slidedown").slideDown("slow");return}else{if(window.SearchType=="hotel"&&b==0){addAdt("impatienthoteluser")}}b++;if(b>=40){alert("Beklager, det oppstod en feil da resultatene dine skulle oppdateres. Vennligst gi oss beskjed dersom problemet skulle vedvare.")}else{if(b<=10){window.setTimeout(c,250)}else{window.setTimeout(c,1000)}}}window.setTimeout(c,1)}function research(){addAdt("startsearchover");var a="/"+SearchType+"s?uselast=true&"+(window.extraSearchParam&&extraSearchParam()||"");window.location.replace(a)}function doHide(){if(typeof hidePriceSelections=="function"){hidePriceSelections()}}function initSmartbox(j,c,d,a){var b=0;if(typeof d=="function"){var e=d;d=a;a=e}var g={callbackWithNull:true,minWidth:180,searchType:window.SearchType,timeout:window.smartyTypedelay};if(d){jq.extend(g,d)}var h=g.callback;jq.each(c,function(f,m){var l=jq(jq.isArray(m)&&m[0]||m);if(l.length){g.callback=function(n){if(jq.isArray(m)){jq(m[1]).val(n?n.id:"")}if(h){h.apply(this,n)}if(a){a.call(this,n,m)}};jq(l).smartbox(g).blur(function(){compare2chk(gradientDialogCleanup)});b++}});jq(window).unbind("lazyLoad."+j);if(c.length>b){jq(window).bind("lazyLoad."+j,function(){initSmartbox(j,c,d,a)})}return b}function modifySearch(a,b){if(typeof hidePriceSelections=="function"){hidePriceSelections()}compare2origin="rslt";if(!a){return research()}loadPopupSearch(function(){if(b){b()}initCalendar();if(typeof compare2chk=="function"){compare2initializing=false;compare2chk(gradientDialogCleanup);jq("#compareToRow").show().css("visibility","visible")}if(typeof useSearch=="function"){useSearch()}var e=document.searchagain;if(e){jq("div.inlineStartSearchOver :input").each(function(g){var f=jq(this);if(f.val()!=f.attr("defaultValue")||f.attr("type")=="hidden"){if(f.attr("type")=="checkbox"&&jq(e[this.name]).attr("type")=="checkbox"){jq(e[this.name]).prop("checked",f.prop("checked"))}else{jq(e[this.name]).val(f.val())}}})}var d=jq(this),c=jq("#modifysearchtd");if(c.is(":visible")){d.r9popover({position:c})}else{d.r9dialog({draggable:false})}})}function secondPhaseShow(){Streaming.showAllResults()}function clearTwoPhaseMessage(){Streaming.stopTwoPhase()}function expiredSearchAgain(a,c){jq(document.body).css("cursor","wait");if(window.Filters){Filters.saveState("expired")}var b;if(a){b=document.location.href;if(c){b+="&nocache=1";document.location.replace(b)}else{document.location.reload()}}else{var b=SearchURL;if(c){b+="&nocache=1"}document.location.replace(b)}}function getResultID(a){return _r[a]._id}function setsortorder(b,a){_currentsortid=b;_lastsortid=b;_lastdirection=a}var sharectl=null;function showShareSavedSection(f,a,b,e,c,d){showShareSection(f,a,b,e,c,d,"sharesaved")}function showShareSection(resultID,hid,name,price,triptype,likeurl,action){var data="action="+(action||"share")+"&searchid="+SearchID+"&resultid="+getResultID(resultID)+"&hid="+hid;hotelalertresid=resultID;hotelalerthid=hid;hotelalertname=name;if(resultID>-1){jq.ajax({type:"POST",url:"/s/toolbox",data:data+"&includecode=true",dataType:"xml",success:function(xmlobj){var xml=jq(xmlobj),code=xml.find("code").text();if(code&&code.length){eval(code);sharectl=new shareController()}jq("body").append(xml.find("html").text());sharectl.newShare(document.getElementById("sharelink"+resultID),hid,name,resultID,price,triptype,likeurl)},error:function(request,textStatus,error){alert(textStatus+" "+error.toString())},cache:false})}}function setLookbackCookie(c,b){var a="/s/lookback/"+c+"&resolve=true&resultid="+b;jq.ajax({type:"POST",url:a,dataType:"html",success:function(e){try{var j=jq("iframe.lookbackUrl").attr("contentWindow");var h=jq(j).attr("document");var g=jq(h).attr("body");jq(g).html(e);var f=h.forms.book;jq(f).submit()}catch(d){}},cache:false})}function bookLinksExpired(b){if(window.getXsellImpressionParams){var a=getXsellImpressionParams();b=b+a}jq.ajax({type:"POST",url:"/s/toolbox",data:b,dataType:"html",success:function(d){try{toggleFaderPane(true);var e=jq("#bookLinksExpiredDiv");if(!e.length){e=jq("<div id='bookLinksExpiredDiv'></div>").appendTo("body")}if(jq.browser.msie){e.css("position","absolute")}e.html(d);jq("td.tellmemore").append(jq("#expiredXSell").html());e.show();addAdt("booklinkexpired/shown")}catch(c){}},error:function(d,e,c){alert(e)},cache:false})}function showPriceAlertSaved(alertid,error){var mydata={action:"farealertsaved",searchid:SearchID,alertid:alertid};var savedalert;jq.ajax({type:"POST",url:"/s/toolbox",data:mydata,dataType:"xml",success:function(xmlobj){try{jq("#alertUpsellContent").r9popover("destroy").remove();var xml=jq(xmlobj);var code=xml.find("code").text();var html=xml.find("html").text();if(code!=null&&code.length>0){eval(code)}jq("#showalertlinkrow").hide();jq("#showalertsavedlinkrow").show();showTT(jq("#showalertsavedlinkrow"),"","DL",{x:35,y:-15});if(typeof(savedalert)!="undefined"&&typeof(savedalert.savedalertid)!="undefined"){jq("#editalertlink").attr("href","/alerts?action=prepop&alertid="+savedalert.savedalertid)}else{jq("#editalertlink").attr("href","/alerts")}jq("#ttipDL").html(html);jq("#bootypopcontent").html(html);if(alertid=="-2"&&(typeof(error)!="undefined")){AjaxAlert.showEmailAlertError(error)}else{jq("#alerterrorrow").hide();jq("#alertsuccessrow").show()}}catch(ignored){}},error:function(request,textStatus,error){alert(textStatus)},cache:false})}function displayPrice(b,a){var c=(b*1)+0.5;return(a?_LEFT_CURSYMBOL:"")+parseInt(c)+(a?_RIGHT_CURSYMBOL:"")}function showLowest(a){Filters.undoAll(a,"show_lowestprice");addAdt("leavebehind/all")}function validateJS(d){if(!d){d=jq(document)}var c=d.find("#scripts");var b=[];var a=[];if(!c.length){throw"#scripts div not found."}d.find("script").each(function(){var e=this.id&&"#"+this.id||this.src||this.text&&("'"+this.text.substr(1,35).replace("\n"," ")+"...'")||this;if(this.parentNode!=c[0]){throw"All scripts must be in #scripts div, but\n"+e+" is in "+identify(this.parentNode)}if(this.src){b.push(this.src)}else{if(!this.id){throw"All inline script tags must have ids, but\n "+e+" does not"}else{a.push(this.id)}}});if(a.length>1){throw (a.length-1)+" extraneous inline tags found: "+a.join(", ")}if(b.length>(SearchType=="car"&&10||6)){throw"Too many ("+b.length+") included scripts. Should be merged: "+b.join("\n")}}function completeInitialLoad(a){if(window.productstartup){window.productstartup()}Streaming.dbg("I="+R9RsltCount+"; T="+Streaming.lastPoll);if(window.R9Admin&&!window.R9Skin&&(!window.samepageresults||a)){Streaming.dbg("CHKS<");validateScripts();Streaming.dbg("CHKS>")}jq(window).trigger("initialLoad")}function attachMatrixHover(){var a=jq("#filterviewmatrix");if(!a.length){return}jq("#filterviewmatrix").delegate("td.pricecell","hover",function(){if(jq(this).html().match("\\d")){jq(this).toggleClass("hoverCell")}}).delegate("td.airlinecell","hover",function(){jq("#filterviewmatrix td."+jq(this).attr("id")).toggleClass("hoverCol")}).delegate("td.stopslabel","hover",function(){jq("#filterviewmatrix td."+jq(this).attr("id")).toggleClass("hoverRow")})}function identify(b){var c="";b=jq(b);while(1){if(!b[0]||b[0].tagName=="HTML"){break}if(b[0].id){c="#"+b[0].id+" "+c;break}var a=b[0].className.replace("s+",".");c=b[0].tagName+(a?"."+a:"");b=b.parent()}return c}R9.ajaxHistory={lastHash:"",callback:null,initialize:function(a){this.lastHash=window.location.hash;this.callback=a;setTimeout(R9.ajaxHistory.checkHash,300)},ignoredChange:function(a){var b=this.callback;this.callback=false;try{a.call();this.lastHash=window.location.hash}finally{this.callback=b}},checkHash:function(){var a=window.location.hash;var b=this.lastHash;if(a!=b&&b!=undefined){this.lastHash=a;if(this.callback){this.callback.call(this)}}setTimeout(R9.ajaxHistory.checkHash,300)}};function destroyPopupSearch(){var a=jq("#popupSearch"),b=a.data();if(b.r9popover){a.r9popover("destroy")}else{if(b.r9dialog){a.r9dialog("destroy")}}return a}function loadPopupSearch(a){loadSection(jq("#popupSearchLazy"),function(){a.apply(destroyPopupSearch())},{action:"searchpopup"})}function loadDialog(c,b,a){if(jq("#"+c).length){a()}else{ssAJAX("/s/toolbox",{action:"tpl",t:b},a)}}function loadSection(b,a,d){if(typeof a=="string"){var c=d;d={action:a};a=c}if(b.is(".lazy")){ssUserAction("LZLD",function(){if(a){a.apply(b,arguments)}b.removeClass("lazy");jq(window).trigger("lazyLoad",[b,d]);jq(b).trigger("lazyLoad",d)},d)}else{if(typeof a=="function"){a.apply(b)}}}function toggleMatrix(b){var a=jq("#filterviewmatrix");if(!b){b=a.is(":visible")&&"list"||"matrix"}var c=b!="matrix";window.currentview=b;if(!c){loadSection(a,"matrix")}hideAllTT();jq(".selectedtab").addClass("unselectedtab");jq(".selectedtab").removeClass("selectedtab");jq("#content_div").show();jq("#pagingTableBottom").show();a[c?"hide":"show"]();jq("#toolboxitemshowmatrix")[c?"show":"hide"]();jq("#toolboxitemhidematrix")[c?"hide":"show"]();addAdt("chgview/"+b)}function showMoreReasons(a){jq(".reviewreasons").hide();var c=jq("#firstreview_"+a).html();var d="hotel.freetextreview.show."+c;if(c!=null&&c!=""){var b=jq("#revdetail_"+c).html();if(b!=null&&b.length<10){detailReviewClicked(a,c,d)}}jq("#reviewreasons_"+a).r9dialog({width:780,position:["center",100]}).show()}function cancelPropagation(a){if(!a){a=window.event}a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}}function bindSelectTextOnFocus(){jq("input.selectTextOnFocus").one("focus",function(){this.select()})}function closeFilterInfo(){jq("#popupFilterInfo").hide()}function showAndHideFilterPopup(){var a=jq("#filterdiv"),b=a.offset();b.left+=a.width()+30;b.top=b.top-(jq("#popupFilterInfo").height()/2)+(a.height()/2+10);jq("#popupFilterInfo").offset(b);jq("#popupFilterInfo").delay(2000).show().delay(10000).fadeOut("slow")}function attachInlineMultibook(){jq("#listbody").delegate(".resultInlineMulti .allInlineItems","click",function(event){event.stopPropagation();jq(this).parents(".resultInlineMulti").toggleClass("opened")});jq("#listbody").delegate(".resultInlineMulti .item, .deals .flowness","click",function(event){event.stopPropagation();jq(this).find("a.dealsinresult").each(function(i){if(this.rel.indexOf("javascript")==0){eval(this.rel)}else{window.open(this.rel,this.target.replace(":",""))}jq(this).addClass("visited");addAdt("results/inline/click")})})}function popupsearchsubmit(){addAdt("toolbox/changesearch/searchagain");Profiler.markSearchStart();comparewindows(document.searchagain);jq("#getratesbutton").prop("disabled",true);var a=generateSearchUrl(document.searchagain);if(a!=null){window.clearTimeout(window.R9.bookLinksExpiredTimeout);loadResults(a,undefined,destroyPopupSearch);return false}return true}function setAllCmp2(a){jq("#compareToCheckboxes input:checkbox:visible").prop("checked",a);setCmp2Count();jq.get("/vs/cmpallclk."+_getStartTab()+"?action=vs"+(typeof SearchID!="undefined"?"&searchid="+SearchID:""))}function _getStartTab(){if(window.SearchType&&!window.StartTab){StartTab=SearchType+"s"}return StartTab}function _getSearchForm(){return document[_getStartTab()]||document.searchagain}function startsWith(b,a){return b.match("^"+a)==a}function isEnoughInfoForCmp2(){if(!window.CMP2REQUIREDEST){return true}var a=_getSearchForm();return window.StartTab=="cruises"||a&&jq(a.origin).attr("value")&&!startsWith(jq(a.origincode).attr("value"),"C-")&&jq(a.destination).attr("value")&&!startsWith(jq(a.destcode).attr("value"),"C-")||a&&jq(a.othercity).attr("value")||a&&jq(a.location).attr("value")}function getCmp2Args(){if(window.flynow){return""}var b=_getStartTab();var c=_getSearchForm();var a="ptype="+b;if(b=="flights"||b=="vacations"){a+="&depart_date="+c.depart_date.value;a+="&return_date="+c.return_date.value;a+="&origin="+c.origin.value;a+="&origincode="+c.origincode.value;a+="&destination="+c.destination.value;a+="&destcode="+c.destcode.value;if(b=="flights"){a+="&cabin="+c.cabin.value;a+="&oneway="+((c.oneway[1].checked)?"true":"false");if(c.student){a+="&student="+c.student.value}}}else{if(b=="hotels"){var a="ptype=hotels";a+="&checkin_date="+c.checkin_date.value;a+="&checkout_date="+c.checkout_date.value;a+="&location="+c.othercity.value;a+="&citycode="+c.citycode.value;a+="&lmid="+c.lmid.value}else{if(b=="cars"){var a="ptype=cars";a+="&pickup_date="+c.pickup_date.value;a+="&dropoff_date="+c.dropoff_date.value;a+="&location1="+c.location.value;a+="&citycode1="+c.citycode1.value;a+="&location2="+c.location2.value;a+="&citycode2="+c.citycode2.value;a+="&oneway="+((c.oneway[1].checked)?"true":"false")}else{if(b=="cruises"){var a="ptype=cruises";a+="&destination="+c.destination.value}else{return""}}}}if(compare2origin!=null){a+="&qryorigin="+compare2origin}return a}var skipCompare=false;var compare2initializing=true;var compare2origin=null;function compare2chk(c){if(compare2initializing){return}if(skipCompare){return}if(!isEnoughInfoForCmp2()){jq("#compareToSpacer").hide();jq("table.compareToWrapper").hide();gradientDialogCleanup();return}if(window.flynow){return}var b=_getSearchForm();if(!b){return}var a=null;if(typeof c=="function"){a=c}if(typeof b.comparetosite!=="undefined"){jq("#compareToSpacer").show();jq("table.compareToWrapper").show();jq.getScript("/s/cmp2chk?"+getCmp2Args(),a)}else{if(typeof a=="function"){a()}}}function allcmp2set(a){try{var c=document.getElementById("compareToRow");if(a){if(c.style.display=="none"){c.style.display=""}}else{c.style.display="none"}}catch(b){}}function cmp2set(a,d){if(d!=null&&d.indexOf("KAYAK")==0){return}try{var c=document.getElementById("site"+d);var e=document.getElementById("cb"+d);if(a){jq("#compareToRow").show();if(c.style.display=="none"){c.style.display="";e.checked=e.defaultChecked;e.value=d;initCmp2CTR();cmp2CTR.recordCheck(d,e.defaultChecked);cmp2CTR.recordVisible(d,true)}}else{e.checked=false;c.style.display="none";initCmp2CTR();cmp2CTR.recordCheck(d,false);cmp2CTR.recordVisible(d,false)}}catch(b){}}function cmp2swap(d,c){cmp2set(true,d);try{var b=document.getElementById("cb"+d);b.value=c}catch(a){}}function cmp2precheck(d,b){try{var c=document.getElementById("cb"+b);c.checked=d}catch(a){}}function setCmp2Count(){var a=_getStartTab();if(jq("#compareToCheckboxes").children("span:visible").size()==0){jq("#compareToRow").css("visibility","hidden")}else{jq("#compareToRow").css("visibility","visible")}}function checkStudentCabin(a){if(a.value=="e"){toggleStudent(true)}else{toggleStudent(false)}}function toggleStudent(a){if(a){student("0")}else{document.getElementById("student").value="0";jq("#student_link").hide();jq("#non_student_link").hide()}}function student(a){document.getElementById("student").value=a;if(a=="1"){jq("#student_link").hide();jq("#non_student_link").show();jq("#compareALL").hide()}else{jq("#non_student_link").hide();jq("#student_link").show();jq("#compareALL").show()}compare2chk()}function addCheckedCompareTos(c,a){var d=0;if(typeof c.comparetokayak!="undefined"){var e=c.comparetokayak;for(var b=0;b<e.length;b++){if(e[b].checked){if(CMP2_HIDDEN){e[b].checked=false}else{if(e[b].value!=null&&e[b].value!=""){a.push({code:e[b].value,group:e[b].className,input:e[b]})}}}}}if(typeof c.comparetosite!="undefined"){if(typeof c.comparetosite.length=="undefined"){if(c.comparetosite.checked){if(CMP2_HIDDEN){c.comparetosite.checked=false}else{a.push({code:c.comparetosite.value,group:c.comparetosite.className,input:c.comparetosite})}}}else{var e=c.comparetosite;for(var b=0;b<e.length;b++){if(e[b].checked){if(CMP2_HIDDEN||!jq(e[b]).is(":visible")){e[b].checked=false}else{if(e[b].value!=null&&e[b].value!=""){a.push({code:e[b].value,group:e[b].className,input:e[b]})}}}}}}}function comparewindows(d){var a=new Array();if(typeof d.comparetosite=="undefined"){return true}addCheckedCompareTos(d,a);var c=new R9.utils.windowopener({searchType:R9.globals.vertical,tileWindows:true});for(var b=0;b<a.length;b++){if(a[b].code!=null&&a[b].code!=""){if(!c.open(b,a[b].code,a.length)){return false}}}return true}function uncheckcomparetos(c){if(c.comparetosite==null){return}if(typeof c.comparetosite.length=="undefined"){c.comparetosite.checked=false;return}initCmp2CTR();cmp2CTR.startUpdate();var d=c.comparetosite;for(var a=0;a<d.length;a++){d[a].checked=false;var b=d[a].value;cmp2CTR.recordCheck(b,false);cmp2CTR.recordVisible(b,false)}cmp2CTR.endUpdate()}function compareExpediaDom(a){jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:"EXPEDIA_DFDCMP2",metavalue:a},success:function(b){compareExpediaInt(a)}})}function compareExpediaInt(a){jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:"EXPEDIA_IFDCMP2",metavalue:a}})}function compareChecked(c){var b="false";if(c.checked){b="true"}var a=c.value;initCmp2CTR();cmp2CTR.recordCheck(a,c.checked);if(a.indexOf("EXPEDIA_DFDCMP2")>=0||a.indexOf("EXPEDIA_IFDCMP2")>=0){window.setTimeout("compareExpediaDom('"+b+"')",500);a="EXPEDIA_FDCMP2"}jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:a,metavalue:b}});setCmp2Count()}var CMP2_HIDDEN=false;function compareToClosed(){CMP2_HIDDEN=true;jq("#compareToRow").hide();jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:"hidefdcmp",metavalue:"true"}})}function compareCheckedKayak(a){var b=document.getElementById("cbKAYAK_FDHCMP2");if(b){saveMeta(b,compareCheckedKayak3)}}function compareCheckedKayak3(){var a=document.getElementById("cbKAYAK2_FDCCMP2");if(a){saveMeta(a,null)}}function saveMeta(b,c){var a="false";if(b.checked){a="true"}if(c==null){jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:b.value,metavalue:a}})}else{jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:b.value,metavalue:a},success:c})}}function showMoreCMP2(){var b=jq("#moresiteslink").offset();var a=jq("#addmorecmp2").detach();a.appendTo("body").css({top:b.top-0+15,left:b.left}).show();window.setTimeout(bindhideCMP2,100)}function bindhideCMP2(){jq(document).bind("click",hideMoreCMP2)}function hideMoreCMP2(){jq("#addmorecmp2").hide();jq(document).unbind("click",hideMoreCMP2)}function cmp2am(a,c){if(c!=null&&c.indexOf("KAYAK")==0){return}try{var d=document.getElementById("am"+c);if(a){if(d.style.display=="none"){d.style.display=""}}else{d.style.display="none"}}catch(b){}}function addcomparetolist(a){cmp2set(true,a);jq("#cb"+a).prop("checked",true);savedisplay(a,true);compareChecked(document.getElementById("cb"+a));jq("#am"+a).hide();checkmoresites()}function checkmoresites(){var a=true;jq("#addmorecmp2 span").each(function(){a=jq(this).css("display")=="none";if(!a){return false}});if(a){jq("#moresites").hide()}else{jq("#moresites").show()}}function cmp2ForceSingleLine(){var b=9999;jq("#compareToCheckboxes").children("span.cmp2item:visible").each(function(d){var c=Math.round(jq(this).offset().top);if(c<b){b=c}});var a=0;jq("#compareToCheckboxes").children("span.cmp2item:visible").each(function(d){var c=Math.round(jq(this).offset().top);if(Math.round(c)-b>5){jq(this).hide();a++}})}function savedisplay(b,a){jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:b+"_disp",metavalue:a}})}function Cmp2CTR(d){this.recordVisible=function(j,h){b(j,4,(h)?"1":"0")};this.recordCheck=function(j,h){b(j,5,(h)?"1":"0")};this.recordTerm=function(h,j){b(h,3,j)};this.startUpdate=function(){f=false};this.endUpdate=function(){e();f=true};var g=d;var c=null;var a=6;var f=true;function b(o,m,p){try{if(c==null){if(g==null){return}c=new Object();var l=g.value.split(";");for(var j in l){var h=l[j].split("|");c[h[0]]=h}}if(3<=m&&m<a){var n=c[o];if(n!=null&&n.length==a&&n[m]!=p){n[m]=p;if(f){e()}}}}catch(q){}}function e(){try{if(c==null){return}if(g==null){return}var j="";for(var h in c){if(j.length>0){j+=";"}j+=c[h].join("|")}g.value=j}catch(l){}}}var cmp2CTR;function initCmp2CTR(){if(typeof(cmp2CTR)=="undefined"){try{cmp2CTR=new Cmp2CTR(document.forms[0].c2s)}catch(a){cmp2CTR=null}}}function inlineSearchResubmit(a){try{addAdt("inlinesearch/searchagain");showmessage("Starter nytt s\u00F8k...");jq("body").css("cursor","wait");Profiler.markSearchStart();var c=generateSearchUrl(a,true);if(c!=null){window.clearTimeout(window.R9.bookLinksExpiredTimeout);loadResults(c);return false}}catch(b){if(window.R9Admin){alert("Exception "+b+" in inlineSearchResubmit(). Abort");return false}}return true}function setDisplayTabs(c){for(var a=0;a<c.length;a++){var b=jq("#cmp2TabFD"+a);if(b.length==0){break}b.text(c[a])}if(c.length==0){jq("#compareToRow").hide()}else{if(jq("#tabbedCmpFDContent:visible").length==0){jq("#compareToRow").show();jq("#tabbedCmpFDContent").slideDown(800)}}}R9.extend("utils",{windowopener:function(b){if(top!=self){try{if(top.document.location.toString()){this._top=top}}catch(a){}}jq.extend(this.options,b)}});R9.extend("utils.windowopener.prototype",{_top:self,options:{searchType:"",popUnder:true,tileWindows:false,heightRule:false,minWidth:0,minHeight:0,screenWidth:1024,screenHeight:768},open:function(c,e,d,b){var b=this._getUrl(b,e);if(!b){return true}var a=this._getWindow(b,this._getWindowName(e),c,d);if(!a){return false}this._handleInitialWindowFocus(a);this._preparePopUpWindow(a);a.init(a);return true},_getWindow:function(c,e,b,d){try{return this._top.window.open(c,e,"toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,top="+this._getWindowTop()+",left="+this._getWindowLeft(b,d)+",width="+this._getWindowWidth(b,d)+",height="+this._getWindowHeight())}catch(a){return false}},_getWindowWidth:function(a,c){if(this.options.tileWindows){return Math.min(this.options.screenWidth,Math.floor(this._getScreenWidth()/c-10))}var b=0;if(typeof(this._top.window.innerWidth)=="number"){b=this._top.window.innerWidth}if(this._top.document.documentElement&&this._top.document.documentElement.clientWidth){b=this._top.document.documentElement.clientWidth}if(this.options.minWidth){return this.options.minWidth>b?this.options.minWidth:b}return b},_getWindowHeight:function(){if(this.options.heightRule){return Math.round(this._getScreenHeight()*0.6)}if(this.options.tileWindows){return this._getScreenHeight()}var a=0;if(typeof(this._top.window.innerHeight)=="number"){a=this._top.window.innerHeight}if(this._top.document.documentElement&&this._top.document.documentElement.clientHeight){a=this._top.document.documentElement.clientHeight}if(this.options.minHeight){return this.options.minHeight>a?this.options.minHeight:a}return a},_getWindowTop:function(){if(this.options.heightRule){return Math.round(this._getScreenHeight()*0.4)}if(this.options.tileWindows){return 0}if(this._top.window.screenTop!=undefined){return this._top.window.screenTop}return this._top.window.screenY},_getWindowLeft:function(a,b){if(this.options.tileWindows){return Math.floor(this._getWindowWidth(a,b)*a+10*a)}if(this._top.window.screenLeft!=undefined){return this._top.window.screenLeft}return this._top.window.screenX},_getWindowName:function(a){if(a.indexOf("_")>0){return a.substring(0,a.indexOf("_"))}return a},_getUrl:function(a,b){if(a!=null){return a}if(this.options.searchType){return"/s/compareresults/startingsearch?type="+this.options.searchType+"&p="+b}return""},_handleInitialWindowFocus:function(a){if(!this.options.popUnder){return}a.blur();if(navigator.userAgent.toLowerCase().indexOf("applewebkit")>-1){this._top.window.blur();this._top.window.focus()}},_preparePopUpWindow:function(a){jq.extend(a,{init:function(b){this._doMozillaMagic();try{b.opener.window.focus()}catch(c){}},_doMozillaMagic:function(){if(typeof window.mozPaintCount=="undefined"){return}var b=this.window.open("about:blank");b.close()}})},_getScreenWidth:function(){if(window.screen.availWidth){return window.screen.availWidth}return window.screen.availWidth},_getScreenHeight:function(){if(window.screen.availHeight){return window.screen.availHeight}return this.options.screenHeight}});function toggleCheckbox(b){var a=jq("#"+b).prop("checked");jq("#"+b).prop("checked",!a)}function makeFrameHtml(a){return'<iframe src="'+a+'" width="470" height="430" style="border: 1px solid #bbbbbb;"></iframe>'}function fbReturnFromAuth(){location.href=location.href}function shareAfterLogin(a){if(a.authResponse){fbSend()}}function fbSend(){jq.ajax({type:"POST",url:"/s/run/toolbox/sendtofb",data:jq("#facebook_msg").serialize(),success:function(a){closefb()}})}function fbShare(){FB.login(shareAfterLogin,{scope:"publish_stream"});return false}function afterCheckPerms(b){if(!b){FB.login(afterLogin,{scope:"publish_stream"})}else{try{if(b.publish_stream==1){fbSend()}else{FB.login(afterLogin,{scope:"publish_stream"})}}catch(a){FB.login(afterLogin,{scope:"publish_stream"})}}}function fbConnect(){FB.login(afterLogin,{scope:"publish_stream"});return false}var lastanchor="";var lastorientation="";function fbOptions(b,a){lastanchor=b;lastorientation=a;setToAnchor("popupFacebookOptions",b,a,-37,0);jq("#popupFacebookOptions").show();hideOnOutsideClick("popupFacebookOptions")}function closefb(){jq("#facebook_msg").hide();jq("#facebook_posted").show();if(window.gradientDialogCleanup){gradientDialogCleanup()}}function showWallPost(){jq("#fb-wallpost-button").css("background-position","0 0");jq("#fb-send-button").css("background-position","-109px -26px");jq(".fb-to-field").css("display","none");jq(".message-label").css("display","none");jq("#fbShareSendButton").css("display","none");jq("#fbSharePostButton").css("display","");jq(".fb-faux-post-msg").css("display","block");jq(".send-message").css("display","none");jq("#fb-state").attr("state","post")}function showSend(){jq("#fb-wallpost-button").css("background-position","0 -26px");jq("#fb-send-button").css("background-position","-109px 0");jq(".fb-to-field").css("display","block");jq(".message-label").css("display","block");jq("#fbShareSendButton").css("display","");jq("#fbSharePostButton").css("display","none");jq(".fb-faux-post-msg").css("display","none");jq(".send-message").css("display","block");jq("#fb-state").attr("state","send")}function fbSendMessage(){FB.ui({method:"send",display:"popup",name:jq(".sharename").text(),show_error:true,link:window.location.href},function(a){if(a&&a.request_ids){closefb()}})}function fbSendMessageLater(){FB.ui({method:"send",display:"popup",name:jq(".sharename").text(),picture:jq(".fb-faux-post-pic > img").attr("src"),description:jq(".fb-faux-post-desc").text(),show_error:true,link:jq("#sharing_fb_link").val()},function(a){if(a&&a.request_ids){closefb()}})}jq(document).bind("r9.social.linkedinshare.success",function(){jq("#linkedin_msg").hide();jq("#linkedin_posted").show()});function liConnect(){R9.social.shareToLinkedin(jq("#limessage").val(),R9.utils.formToObject("#linkedin_msg form"))}function twitterShare(){var d="https://twitter.com/share";var e=jq("#tweet").val();e=escape(e);var c=window.location.pathname;c=escape(c);d+="?text="+e;d+="&url=null"+c;var a="Tweet!";var b="width=600,height=400";window.open(d,a,b)}function limitTwitterChars(){var a=jq("#tweet").val().length;if(a>140){jq("#tweet").val(jq("#tweet").val().substring(0,140))}}function submitforemail(d){var c=d?document.getElementById(d):document.emailform;if(!validateEmail(c.from.value)){try{c.from.focus()}catch(b){}alert("Angi en gyldig e-postadresse i \u201DFra\u201D-feltet");return false}var a=c.tolist.value.split(",");if(c.tolist.value.length==0||a.length==0||!validateEmail(a[0])){try{c.tolist.focus()}catch(b){}alert("Angi en gyldig e-postadresse i \u201DTil-feltet");return false}if(c.subject.value.length==0){try{c.subject.focus()}catch(b){}alert("Please enter a subject for the email");return false}return true}function shareemail(j,a){var a=a||"";if(submitforemail((a?"shareemailform"+a:null))){var b=a?jq("#shareemailform"+a):jq("form[name=emailform]");var d=true;var g=b[0].tolist.value;var l=g.split(",").length;var c=R9.globals.tripsaliases;var f=c.split(",");var h=false;var e=0;for(e=0;e<f.length;e++){if(g.indexOf(f[e])!=-1){h=true;break}}if(h){if(l<=1){l=0}if(typeof j!="undefined"&&j==true){d=false;showTripsAjaxReg("#sendemail")}else{addResultToTrip(b[0].searchid.value,b[0].resultid.value,"tripadded"+a);jq("#tripadded"+a).show()}}if(d&&l>0){sharetheemail(b,a)}else{if(d){jq("#emailform"+a).hide();jq("#emailsent"+a).show()}}}}function sharetheemail(c,d){var b=c.serialize();var a="/s/emailresult";jq.ajax({type:"POST",url:a,data:b,success:function(e){jq("#emailform"+d).hide();jq("#emailsent"+d).show();jq("#emailsentmessage"+d).show();if(window.gradientDialogCleanup){gradientDialogCleanup()}},error:function(f,g,e){alert(g)},cache:false})}function closeAllDialogs(){jq(".ui-dialog-content").r9dialog("close");jq(".ui-dialog-content").r9popover("close")}function showTripsAjaxRegAfterClick(a){jq("body").unbind("click.hidepricesel");if(!AjaxReg.alreadyRegistered){showTripsAjaxReg(a)}else{openSaveToMyTripsDialogAfterClick(searchId,resultId,showPrice,providerCode)}}function showTripsAjaxReg(e,d,a,b,c){if(!AjaxReg.alreadyRegistered){AjaxReg.regtype="trips";AjaxReg.searchid="";AjaxReg.ui.register(function(){openSaveToMyTripsDialog(d,a,b,c)})}else{openSaveToMyTripsDialog(d,a,b,c)}}function openSaveToMyTripsDialogAfterClick(d,a,b,c){jq("body").unbind("click.hidepricesel").bind("click.hidepricesel",hidePriceSelections);openSaveToMyTripsDialog(d,a,b,c)}function openSaveToMyTripsDialog(d,a,b,c){if(!checkTripsTos()){showTripsTosBubble(d,a,b,c);return}jq.ajax({type:"POST",url:"/s/run/saveToMyTrips/chooseTrip",data:{searchId:d},dataType:"json",success:function(f){if(f.success){var e=jq(f.html);e.r9dialog({width:510}).find("#saveToMyTripsTabs").tabs();e.r9dialog("option","close",function(){e.r9dialog("destroy");e.remove()});jq("a").blur();jq("#saveToMyTripsResultId").val(a);jq("#saveToMyTripsShowPrice").val(b);jq("#saveToMyTripsProviderCode").val(c)}else{alert(f.error)}},error:function(){alert("En uventet feil oppsto. Vennligst pr\u00F8v igjen.")},cache:false})}function showSaveToMyTripsControls(b,a){hideSaveToMyTripsControls();jq("#"+b).addClass("selectedTrip");jq("#saveToMyTripsTripId").val(b);jq("#saveToMyTripsTripName").html(a);jq("#saveToMyTripsControls").show()}function hideSaveToMyTripsControls(){jq(".saveToMyTripsTrip").removeClass("selectedTrip");jq("#saveToMyTripsTripId").val("");jq("#saveToMyTripsTripName").html("");jq("#saveToMyTripsControls").hide();jq("#saveToMyTripsDuplicate").hide()}function saveToMyTrips(){jq.ajax({type:"POST",url:"/s/run/saveToMyTrips/save",data:{searchId:jq("#saveToMyTripsSearchId").val(),resultId:jq("#saveToMyTripsResultId").val(),showPrice:jq("#saveToMyTripsShowPrice").val(),providerCode:jq("#saveToMyTripsProviderCode").val(),encodedTripId:jq("#saveToMyTripsTripId").val()},dataType:"json",success:function(a){if(a.success){jq("#saveToMyTrips").html(a.html)}else{if(a.duplicate){hideSaveToMyTripsControls();jq("#saveToMyTripsDuplicate").html(a.error).show()}else{alert(a.error)}}},error:function(){alert("En uventet feil oppsto. Vennligst pr\u00F8v igjen.")},cache:false})}function saveToNewTrip(){jq("#saveToMyTripsTripId").val("");saveToMyTrips()}function checkTripsTos(){var a=false;jq.ajax({type:"POST",url:"/k/run/tripsTos/check",async:false,dataType:"json",success:function(b){if(b.success){a=b.ok}else{alert(b.error)}},error:function(){alert("En uventet feil oppsto. Vennligst pr\u00F8v igjen.")},cache:false});return a}function showTripsTosBubble(d,a,b,c){jq.ajax({type:"POST",url:"/k/run/tripsTos/showTosBubble",data:{searchId:d,resultId:a,showPrice:b,providerCode:c},dataType:"html",success:function(f){var e=jq(f);e.r9dialog({width:440});e.r9dialog("option","close",function(){e.r9dialog("destroy");e.remove()});jq("a").blur()},error:function(f,g,e){alert(f.statusText)},cache:false})}function sendTripsTosResponse(e,d,a,b,c){if(e){jq.ajax({type:"POST",url:"/k/run/tripsTos/accept",dataType:"json",success:function(f){if(f.success){closeAllDialogs();openSaveToMyTripsDialog(d,a,b,c)}else{alert(f.error)}},error:function(){alert("En uventet feil oppsto. Vennligst pr\u00F8v igjen.")},cache:false})}else{jq.ajax({type:"POST",url:"/k/run/tripsTos/showTosRejected",dataType:"html",success:function(f){jq("#tosBubble").html(f)},error:function(g,h,f){alert(g.statusText)},cache:false})}}function inlinelearnmore(a,b){var c="provider="+b;jq.ajax({type:"POST",url:"/s/run/toolbox/learnmoreinline",data:c,dataType:"html",success:function(e){try{showTT(document.getElementById(a),e,"BL")}catch(d){}},error:function(e,f,d){alert(f)},cache:false})}function stopPropagation(a){if(!a){var a=window.event}if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}}function stopPropagationAndDefault(a){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}stopPropagation(a)}function fireTimer(b){var c=b;function a(){if(c.inprogress){c._abortRequest(c)}}c._timeoutID=window.setTimeout(a,c.timeoutMS)}function R9HTTPXml(){}R9HTTPXml.prototype={uservars:null,url:null,postbuffer:null,xmlhttp:null,inprogress:false,thecallback:null,timeoutMS:-1,_timeoutID:null,cancelled:false,init:function(c,b,a){this.url=c;this.uservars=a;this.postbuffer=b;if(window.XMLHttpRequest){this.xmlhttp=new XMLHttpRequest()}else{if(window.ActiveXObject){this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")}else{window.alert("Sorry your browser is not compatible with this functionality")}}},setTimeout:function(a){this.timeoutMS=a},asyncGET:function(a){if(this.inprogress){throw new Error("Call in progress")}var b=this;if(a==null){a=b}this.thecallback=a;var c=null;if(this.postbuffer==null){this.xmlhttp.open("GET",this.url,true)}else{this.xmlhttp.open("POST",this.url,true);this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");c=this.postbuffer}this.xmlhttp.onreadystatechange=function(){b.stateChangeCallback(b)};this.inprogress=true;this.cancelled=false;this.xmlhttp.send(c);if(this.timeoutMS>0){fireTimer(this)}},stateChangeCallback:function(b){switch(b.xmlhttp.readyState){case 1:try{if(!b.cancelled){b.thecallback.onInit()}}catch(c){}break;case 2:try{if(b.xmlhttp.status!=200&&b.xmlhttp.status!=0){if(!b.cancelled){window.status="error";b.thecallback.onError(b.xmlhttp.status,b.xmlhttp.statusText,b)}b.xmlhttp.abort();b.inprogress=false}}catch(c){}break;case 3:var a;try{try{a=b.xmlhttp.getResponseHeader("Content-Length")}catch(c){a=NaN}if(!b.cancelled){window.status="ping";b.thecallback.onProgress(b.xmlhttp.responseText,a)}}catch(c){}break;case 4:try{if(b._timeoutID){window.clearTimeout(b._timeoutID);b._timeoutID=null}if(b.inprogress){b.inprogress=false;if(!b.cancelled){window.status="done";b.thecallback.onLoad(b)}}}catch(c){}finally{b.inprogress=false}break}},cancelRequest:function(){var a=this;this.cancelled=true;if(this._timeoutID){window.clearTimeout(this._timeoutID);this._timeoutID=null}a._abortRequest(a)},_abortRequest:function(b){if(b.xmlhttp!=null){try{b.xmlhttp.abort();if(b.inprogress){window.status="abort";b.thecallback.onError("timeout","Your request has timed out.",b)}}catch(a){}b.cancelled=true;b.inprogress=false}},getText:function(){return this.xmlhttp.responseText},getXML:function(){return this.xmlhttp.responseXML},getTags:function(a){try{return this.xmlhttp.responseXML.getElementsByTagName(a)}catch(b){return null}},getOperaText:function(d,g,b){try{var a=d.getElementsByTagName(g)[b];if(a){var h="",c=0,f;while(f=a.childNodes[c]){h+=f.nodeValue;c++}return h}else{return""}}catch(j){opera.postError("exception: "+j)}},getOpera:function(b,c,a){return"foo"},getTagText:function(c,d,b){var a=c.getElementsByTagName(d)[b];if(a){if(a.childNodes.length>1){return a.childNodes[1].nodeValue}else{if(a.childNodes.length==1){return a.firstChild.nodeValue}}}else{return""}},onProgress:function(b,a){},onError:function(b,a,d){},onLoad:function(a){},onInit:function(a){}};var R9CalDayOfWeek=["ma","ti","on","to","fr","lø","sø"];var R9CalDaysInMonth=[31,0,31,30,31,30,31,31,30,31,30,31];var R9CalMonthNames=["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"];var R9CalMonthRecords=[];function R9Cal_getDaysInMonth(a,b){if(a==2){return(b%4==0)?29:28}return R9CalDaysInMonth[a-1]}function R9Cal(){this.dayOffset=0;this.lastDay=0;this.monthShown=-100;this.totalMonths=0;this.monthsDomID;this.firstYear=0;this.lastYear=0;this.firstMonthAllowed=0;this.lastMonthAllowed=0;this.thisYear=0;this.thisMonth=0;this.thisDay=0;this.allowPast=false;this.monthWidth=0;this.highlighted={year:0,month:0,day:0};this.marked={year:0,month:0,day:0};return true}SCOPE=(function(){function c(){var f=document.createElement("p");return(f.innerText!=undefined)}var b;if(c()){b=function(f,g){f.innerText=g}}else{b=function(f,g){f.textContent=g}}function a(f,j,g){var h=document.createElement(f);if(j){b(h,j)}if(g){h.className=g}return h}function e(h,f,l,g){var j=document.createElement(f);if(l){b(j,l)}if(g){j.className=g}h.appendChild(j);return j}function d(f,g){f.appendChild(g)}R9Cal.prototype.isOldDate=function(h,f,g){if(g<this.thisYear){return true}if(g==this.thisYear){if(h<this.thisMonth){return true}if(h==this.thisMonth){return f<this.thisDay}}return false};R9Cal.prototype.drawMonth=function(o,s){var l=s.firstOffset;for(var f=0;f<6;++f){var j=f==5?"week lastWeek":"week";if(jq.browser.mozilla){j+=" firefoxWeek"}else{if(jq.browser.msie&&jq.browser.version.substr(0,1)=="8"){j+=" ie8Week"}}var h=a("div",null,j);for(var n=0;n<7;++n){var m,g,q;if(l<=0){m=s.lastMonEnd+l;q="prevMon"}else{if(l>s.thisMonEnd){m=l-s.thisMonEnd;q="nextMon"}else{m=l;q=null}}if(!this.allowPast&&this.isOldDate(s.month,m,s.year)){q="oldDate"}e(h,"p",m,q);++l}d(o,h)}};R9Cal.prototype.setupMonth=function(o,l,f,n,j,m,p){var h={firstOffset:l,lastMonEnd:f,thisMonEnd:n,month:j,year:m,isValid:p,isDrawn:false};R9CalMonthRecords.push(h);var g=l+6*7;this.dayOffset=(g-n-1)%7-6;this.lastDay=n};R9Cal.prototype.makeDowHeader=function(){var f=a("div",null,"dayHeader");jq.each(R9CalDayOfWeek,function(){d(f,a("p",this.charAt(0)))});return f};R9Cal.prototype.drawControls=function(j,g){var f=document.createElement("div");f.className="calControls";if(g){f.className+=" singleMonthCalControls"}var l=document.createElement("a");l.id="gotoPrev";l.href="#";jq(l).html("&laquo;");var h=document.createElement("a");h.id="gotoNext";h.href="#";jq(h).html("&raquo;");var m=document.createElement("a");m.id="closeCal";m.href="#";jq(m).html("&times;");f.appendChild(l);f.appendChild(m);f.appendChild(h);j.appendChild(f)};R9Cal.prototype.drawMonths=function(n,j,z,w,m,B){if(z==null){z=false}if(B==null){B=false}var u=new Date();this.thisYear=u.getFullYear();this.thisMonth=u.getMonth()+1;this.thisDay=u.getDate();this.firstYear=w;this.lastYear=m;this.totalMonths=(m-w+1)*12;this.monthShown=-100;this.allowPast=B;if(B==null||!B){this.firstMonthAllowed=this.getMonthNum(this.thisMonth,this.thisYear);this.lastMonthAllowed=this.firstMonthAllowed+12}else{this.firstMonthAllowed=this.getMonthNum(this.thisMonth,this.firstYear);this.lastMonthAllowed=this.firstMonthAllowed+36;this.totalMonths=36}this.monthsDomID=j.id;this.drawControls(n,z);var q=this.makeDowHeader();var s=a("div",null);s.id=j.id;s.className="months";var l=true;var C=0;for(var o=w;o<=m;++o){for(var x=0;x<12;++x){var p=a("div",null,"month");var v=(x+1)+"/"+o;var r=R9CalMonthNames[x]+" "+o;p.id=v;var h=R9CalDaysInMonth[x];if(x==1){h=(o%4==0)?29:28}var y=e(p,"div",null,"calhead");e(y,"p",r,"monthHeader");d(y,jq(q).clone().get(0));var f=C>=this.firstMonthAllowed&&C<=this.lastMonthAllowed;if(l){var A=new Date();A.setFullYear(o,0,1);var g=1-A.getDay();g+=2-1;this.setupMonth(p,g,31,h,x+1,o,f);l=false}else{this.setupMonth(p,this.dayOffset,this.lastDay,h,x+1,o,f)}d(s,p);++C}}n.replaceChild(s,j)};R9Cal.prototype.isIgnoredDate=function(f){return jq(f).is(".nextMon,.prevMon,.oldDate")};R9Cal.prototype.getDate=function(j){var l=jq(j);if(l.is("p")&&!this.isIgnoredDate(j)){var g=l.parent();if(g.is(".week")){var h=g.parent();if(h.is(".month")){var f=h.attr("id").split("/");return{day:l.text(),month:f[0],year:f[1]}}}}return null};R9Cal.prototype.getMonthNum=function(g,f){if(f>=this.firstYear&&f<=this.lastYear){return(f-this.firstYear)*12+g-1}return -1};R9Cal.prototype.gotoMonth=function(g,f){this.gotoMonthNum(this.getMonthNum(g,f),false)};R9Cal.prototype.withDateElement=function(n,g,l,j){var o=this.getMonthNum(n,l);if(o>=0&&g>=1){var h=jq("div.month","#"+this.monthsDomID).eq(o);var f=this;var m=h.find("p").filter(function(){return jq(this).text()==g&&!f.isIgnoredDate(this)});j(m)}};R9Cal.prototype.highlightDate=function(j,f,l,g,h){this.withDateElement(j.month,j.day,j.year,function(m){m.removeClass(f)});this.withDateElement(l,g,h,function(m){m.addClass(f)});j.month=l;j.day=g;j.year=h};R9Cal.prototype.showNextMonth=function(){if(this.monthShown<this.lastMonthAllowed){this.gotoMonthNum(this.monthShown+1,true)}};R9Cal.prototype.showPreviousMonth=function(){if(this.monthShown>this.firstMonthAllowed){this.gotoMonthNum(this.monthShown-1,true)}};R9Cal.prototype.drawOnDemand=function(h){var f=R9CalMonthRecords[h];if(!f.isDrawn){var g=jq("div.month","#"+this.monthsDomID).eq(h).get(0);this.drawMonth(g,f);f.isDrawn=true}};R9Cal.prototype.gotoMonthNum=function(h,f){if(h>=this.firstMonthAllowed&&h<=this.lastMonthAllowed){if(!f&&this.monthShown==h-1){h=this.monthShown}if(h==this.lastMonthAllowed){--h}if(h!=this.monthShown){this.monthShown=h;this.drawOnDemand(h);this.drawOnDemand(h+1);if(!this.monthWidth){var g=jq("div.month","#"+this.monthsDomID).get(0);this.monthWidth=g.offsetWidth}jq("#"+this.monthsDomID).css("left",(-(this.monthWidth)*h)+"px")}}}})();var R9DatePickerNowShowing=null;function R9DatePicker(c,d,b,a){this.popup=c;this.dayID=b;this.dowID=a;this.calID=c.frameid;this.iconID=d;this.onDateChanged=function(g,e,f){if(typeof this.onChangeCB=="function"){this.onChangeCB(this)}};this.intervalID=-1;this.day=0;this.month=0;this.year=0;this.calendarFocused=false;this.domFocused=false;this.focusTimeout=-1;this.onChangeCB=null}R9DatePicker.prototype.withCal=function(a){var b=window.frames[this.calID];if(b&&b.cal){a(b.cal)}};R9DatePicker.prototype.frameDoc=function(){return window.frames[this.calID].document};R9DatePicker.prototype.setCalendarFocused=function(a){this.calendarFocused=a;if(a){this.domFocused=false}};R9DatePicker.prototype.setDayOfMonthFocused=function(a){this.domFocused=a;if(a){this.calendarFocused=false}};R9DatePicker.prototype.scheduleFocusCheck=function(){var a=this;var b=function(){if(R9DatePickerNowShowing==a.dayID&&!a.domFocused&&!a.calendarFocused){a.updateFromControls();if(a.isVisible()){a.toggle(jq("#"+a.iconID).get(0))}}};this.focusTimeout=window.setTimeout(b,250)};function R9DatePicker_zeroPad(a){return a<10?"0"+a:a}R9DatePicker.prototype.setEvents=function(){var a=this;var b=window.frames[this.calID];var c=b.cal;b.onDatePicked=function(d){a.popup.hide(false,function(){a.setDate(d.month,d.day,d.year);a.onDateChanged(d.month,d.day,d.year)})};b.onNextMonth=function(){c.showNextMonth()};b.onPrevMonth=function(){c.showPreviousMonth()};b.onCloseCal=function(){a.popup.hide()};b.onCalendarFocus=function(){a.setCalendarFocused(true)}};R9DatePicker.prototype.humanReadable=function(c,a,b){return R9DatePicker_zeroPad(a)+"."+R9DatePicker_zeroPad(c)+"."+b};R9DatePicker.prototype.parseHumanReadable=function(c){var h;var e;h=2;e=1;var d=/\s*(\d+)[^0-9](\d+)([^0-9](\d+))?\s*/.exec(c);var b=null;if(d){var f=d[4]?parseInt(d[4],10):-1;b={month:parseInt(d[h],10),day:parseInt(d[e],10),year:f}}else{return null}if(b.year<0){var a=new Date();b.year=(b.month<(a.getMonth()+1))?a.getFullYear()+1:a.getFullYear()}if(b.year<21){b.year+=2000}if(b.year<2000||b.year>2020||b.month<1||b.month>12||b.day<1||b.day>31){return null}var j=R9Cal_getDaysInMonth(b.month,b.year);if(b.day>j){return null}var g=true;this.withCal(function(m){var l=m.getMonthNum(b.month,b.year);g=l>=m.firstMonthAllowed&&l<=m.lastMonthAllowed});if(!g){return null}return b};R9DatePicker.prototype.setInputField=function(c,a,b){jq("#"+this.dayID).val((a&&a>0)?this.humanReadable(c,a,b):"")};R9DatePicker.prototype.setDate=function(c,a,b){a=typeof(a)=="string"?(a.length==0?-1:parseInt(a,10)):a;c=typeof(c)=="string"?parseInt(c,10):c;b=typeof(b)=="string"?parseInt(b,10):b;this.setInputField(c,a,b);this.month=c;this.day=a||-1;this.year=b;this.dateHasChanged()};R9DatePicker.prototype.setFromCanonical=function(b){var a=b.split("/");this.setDate(a[0],a[1],a[2])};R9DatePicker.prototype.setMonthYearFromCanonical=function(b){var a=b.split("/");this.setDate(a[0],null,a[2])};R9DatePicker.prototype.clearDay=function(){this.setDate(this.month,null,this.year)};R9DatePicker.prototype.updateFromControls=function(){this.sync();this.setInputField(this.month,this.day,this.year);this.onDateChanged(this.month,this.day,this.year)};R9DatePicker.prototype.sync=function(g,b){var f=this.day,d=this.month,e=this.year;var a=jq("#"+this.dayID).val();var c=this.parseHumanReadable(a);if(c){this.month=c.month;this.day=c.day;this.year=c.year}else{this.day=-1}if(f!=this.day||e!=this.year||d!=this.month||g){this.dateHasChanged()}};R9DatePicker.prototype.dateHasChanged=function(){var b=this;this.withCal(function(g){g.gotoMonth(b.month,b.year);g.highlightDate(g.highlighted,"highlighted",b.month,b.day,b.year)});var e=this.valueAsDate();if(e){var c=(e.getDay()-(2-1));if(c<0){c+=7}var f=R9CalDayOfWeek[c];var d=R9CalMonthNames[this.month-1];var a;a=f+", "+this.day+" "+d+" "+this.year;jq("#"+this.dowID).text(a)}else{jq("#"+this.dowID).text("dd.mm.åååå")}};R9DatePicker.prototype.fields=function(){this.sync(false,true);return this};R9DatePicker.prototype.valueAsDate=function(a){var c=this.fields();if(c.day>0||a){var b=new Date();b.setDate(1);b.setFullYear(c.year);b.setMonth(c.month-1);b.setDate(c.day>0?c.day:a);return b}return null};R9DatePicker.prototype.markDate=function(a){this.withCal(function(b){b.highlightDate(b.marked,"marked",a.month,a.day,a.year)})};R9DatePicker.prototype.clearMarkedDate=function(){this.withCal(function(a){a.highlightDate(a.marked,"marked",0,0,0)})};R9DatePicker.prototype.toggle=function(a){if(!this.popup.isVisible()){this.setEvents();R9DatePickerNowShowing=this.dayID}else{this.clearInterval();if(this.focusTimeout!=-1){window.clearTimeout(this.focusTimeout);this.focusTimeout=-1}this.calendarFocused=false;this.domFocused=false}this.sync(true);this.popup.controllingIcon=this.iconID;this.popup.controllingInput=this.dayID;this.popup.toggle(a)};R9DatePicker.prototype.setInterval=function(){var a=this;this.intervalID=window.setInterval(function(){a.sync(false,true)},750)};R9DatePicker.prototype.clearInterval=function(){if(this.intervalID!=-1){window.clearInterval(this.intervalID);this.intervalID=-1}};R9DatePicker.prototype.isVisible=function(a){return this.popup.isVisible()};var whenFrameLoadedHook=function(){};function onCalendarLoaded(b,a){whenFrameLoadedHook()}R9CalPopup=function(h,c,b){this.posCache={};this.controllingIcon=null;this.controllingInput=null;this.isHiding=false;var a=document.createElement("div");a.className="r9calContainer";if(c){a.className+=" singleMonthCalContainer"}a.style.visibility="hidden";this.container=a;var d="no.NO";var e="/h/nvtl/califrame.vtl?lc="+d+"&singleMonth="+c+"&allowPast="+((b)?"true":false);var g='<iframe src="'+e+'" class="calIframe" frameborder="0" scrolling="no" name="'+h+'" id="'+h+'">';jq(a).html(g);this.positionFunc=function(j){j.l-=80;j.t+=10};this.frameid=h;var f=document.createElement("div");f.className="r9calShadow";this.shadow=f;a.appendChild(f)};function truePos(c){var a=0;var b=0;while(c&&c!=document.body){a+=c.offsetLeft;b+=c.offsetTop;c=c.offsetParent}return{l:a,t:b}}R9CalPopup.prototype.toggle=function(e){var g=jq(this.container);var d=(g.css("visibility")=="visible");if(d){var b=jq(e);if(b.is(".calicon")){var a="#"+this.controllingIcon;if(!b.is(a)&&!b.parent().is(a)){this.hide(true)}else{if(this.hideOnNextClick){this.hide(false);this.hideOnNextClick=false}else{this.hideOnNextClick=true}}}else{var f=e.id;if(f==this.controllingInput){return true}else{if(b.is(".calendar_dom")){this.hide(true);return true}else{this.hide(false)}}}}else{this.show(e)}return false};R9CalPopup.prototype.isVisible=function(a){return(jq(this.container).css("visibility")!="hidden")};R9CalPopup.prototype.show=function(c){var e=c.id;var d=this.posCache[e];if(!d||true){d=truePos(c);d.t+=c.offsetHeight;d.target=c;this.positionFunc(d);if(e){this.posCache[e]={l:d.l,t:d.t}}}hideMeOnPopup(true);var b=this.container.style;b.left=d.l+"px";b.top=d.t+"px";b.visibility="visible";var a=this;jq(document.body).mousedown(function(f){var g=a.toggle(f.target);if(!g){f.preventDefault();return false}return g})};R9CalPopup.prototype.hide=function(b,d){if(this.isHiding){return}var e=jq(this.container);if(b||!jq.browser.firefox){this.container.style.visibility="hidden";if(d){d()}}else{this.isHiding=true;var a=this;e.hide(160,function(){e.css("visibility","hidden");e.show();if(d){d()}a.isHiding=false})}hideMeOnPopup(false);jq(document.body).unbind("mousedown")};function initDatePicker(a,c){var b=new R9DatePicker(a,c.icon_id,c.input_id,c.dow_id);jq("#"+c.icon_id).click(function(d){b.setCalendarFocused(true);b.toggle(d.target);return true});jq("#"+c.input_id).blur(function(d){b.clearInterval();b.setDayOfMonthFocused(false);b.scheduleFocusCheck();return true}).focus(function(d){b.setDayOfMonthFocused(true);b.setInterval();if(!b.isVisible()){b.toggle(jq("#"+c.icon_id).get(0))}return true});if(c.initial_date&&c.initial_date.length>0){b.setFromCanonical(c.initial_date)}else{b.clearDay()}if(c.chg_callback_func&&typeof c.chg_callback_func=="function"){b.onChangeCB=c.chg_callback_func}return b}function setCalendarLoadedHook(a){if(a){whenFrameLoadedHook=a}}function R9DoubleDatePicker(a,e,d,c){setCalendarLoadedHook(d);if(c==null){c=false}this.pop=new R9CalPopup(a.calid,a.singleMonth,c);var f=initDatePicker(this.pop,a);var b=initDatePicker(this.pop,e);if(a.initial_date&&a.initial_date.length>0&&((!e.initial_date)||e.initial_date.length==0)){b.setMonthYearFromCanonical(a.initial_date)}if(e.initial_date&&e.initial_date>0&&((!a.initial_date)||a.initial_date.length==0)){f.setMonthYearFromCanonical(e.initial_date)}this.firstDate=this.departDate=this.checkinDate=this.pickupDate=f;this.secondDate=this.returnDate=this.checkoutDate=this.dropoffDate=b;f.onDateChanged=function(g,l,n){var j=f.valueAsDate();var h=b.valueAsDate(1);if(j&&h&&j>h){b.setDate(g,null,n)}b.markDate(f.fields());if(typeof f.onChangeCB=="function"){f.onChangeCB(this)}};b.onDateChanged=function(g,l,n){var j=f.valueAsDate(1);var h=b.valueAsDate();if(j&&h&&j>h){f.setDate(g,null,n);b.clearMarkedDate()}if(typeof b.onChangeCB=="function"){b.onChangeCB(this)}};if(document.getElementById(a.calid)==null){document.body.appendChild(this.pop.container)}else{this.pop.container=document.getElementById(a.calid).parentNode}}(function(){var a=new Date();a.setFullYear(a.getFullYear()+1);jq.datepicker.setDefaults({altFormat:"D, d. M yy",closeText:"Lukk",currentText:"Nåværende",dateFormat:"dd.mm.yy",dayNames:"søndag,mandag,tirsdag,onsdag,torsdag,fredag,lørdag".split(","),dayNamesMin:"s,m,t,o,t,f,l".split(","),dayNamesShort:"sø,ma,ti,on,to,fr,lø".split(","),firstDay:parseInt("2")-1,maxDate:a,minDate:new Date(),monthNames:"januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember".split(","),monthNamesShort:"jan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des".split(","),prevText:"Forrige",nextText:"Neste",showAnim:"",showMonthAfterYear:false})})();jq.r9datepicker={parseDate:function(a){return jq.datepicker.parseDate("mm/dd/yy",a)}};jq.fn.r9datepicker=function(f){var j=f.defaultDate,a="dd.mm.yy";if(j){this.val(jq.datepicker.formatDate(a,j));jq(f.altField).text(jq.datepicker.formatDate(f.altFormat||"D, d. M yy",j))}else{jq(f.altField).text(a)}var e=f.beforeShow;var c=f.onClose;var h=f.onSelect;var b=this;var g=function(d,n,l,m){jq(b).trigger(d,[m]);if(n){n(m,l)}};f.beforeShow=function(d,l){g("sbopen",e,d,l)};f.onClose=function(l,d){g("sbclose",c,l,d)};f.onSelect=function(l,d){g("sbset",h,l,d)};return this.attr({autocomplete:"off",autocapitalize:"off",autocorrect:"off"}).datepicker(f)};var R9=R9||{};R9.dp=(function(){function a(e,d){return(c(d)-c(e))/86400000}function b(e,f){var d=e[f];delete e[f];return d}function c(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())}return{doublePicker:function(u,r){var f=u.defaultDate,d=r.defaultDate,j=jq(u.altField),g=jq(r.altField),p=b(u,"onSelect")||jq.noop,n=b(r,"onSelect")||jq.noop,o=jq(b(u,"selector")),m=jq(b(r,"selector")),s=u.resetAfterDays||30,e=u.minRangeDays||0,l=u.numberOfMonths||2,h=r.numberOfMonths||2,q=u.pop2==undefined?true:u.pop2;o.r9datepicker(jq.extend({beforeShowDay:function(v){return[true,(v&&d&&v.getTime()==d.getTime())?"ui-datepicker-marked-day":""]},numberOfMonths:l,onSelect:function(y,x){f=o.datepicker("getDate");var w=d&&a(f,d);if(!d||w>s||w<e){m.datepicker("setDate",null).datepicker("option","defaultDate",f);g.text("dd.mm.yy")}p.call(this,y,x);if(q){if(m.is(":visible")&&m.css("visibility")!="hidden"){function v(){m.focus()}window.setTimeout(v,50)}}}},u));m.r9datepicker(jq.extend({beforeShowDay:function(v){return[true,(f&&v&&f.getTime()==v.getTime())?"ui-datepicker-marked-day":""]},numberOfMonths:h,onSelect:function(x,w){d=m.datepicker("getDate");var v=f&&a(f,d);if(!f||v<e){o.datepicker("setDate",null).datepicker("option","defaultDate",d);j.text("dd.mm.yy")}n.call(this,x,w)}},r))}}})();if(typeof R9==="undefined"){R9=new Object()}R9.form={_getFormType:function(a){if(typeof a.tab!=="undefined"){return a.tab.value}else{return"unknown"}},_getUseCompareTo:function(a){if(typeof a.doCompareTo!=="undefined"){if(a.doCompareTo.value===true||a.doCompareTo.value==="true"){return true}}return false},_checkFormPopulated:function(a){if(typeof a=="undefined"||typeof a.value=="undefined"||a.value.length==0){return false}return true},_setDisabledImage:function(a){jq(a).attr("src","/images/v42872/button/redesign/a-search-button-fd-disabled.no..png").prop("disabled",true)},_dateFormat:"dd.mm.yy",_grabDate:function(b,a){if(typeof b!=="undefined"){return jq.datepicker.parseDate(R9.form._dateFormat,b)}else{if(typeof a!=="undefined"){return jq.datepicker.parseDate(R9.form._dateFormat,a)}else{return null}}},_submit:function(d,a){if(a(d)===false){return false}jq(d).find(".searchbutton").unbind("mouseup").unbind("mousedown");window.setTimeout("R9.form._setDisabledImage('.searchbtn input')",1);Profiler.markSearchStart();if(R9.form._getUseCompareTo(d)===true){R9.CompareTo.launch(d)}var e=generateSearchUrl(d);var c=jq(d).attr("action");var b=null;if(R9.form._useInServlet(d)){if(e!=null){b=R9.form._getInServletLink(d,e)}else{b=R9.form._getInServletLink(d,c+"?"+jq(d).serialize())}}else{if(e!=null){b=e}else{b=null}}if(b!=null){if(jq(d).attr("target")=="_blank"){window.open(b)}else{document.location.href=b}return false}return true},_useInServlet:function(a){if(typeof a.useInLink!="undefined"&&a.useInLink.value=="true"){return true}return false},_getInServletLink:function(b,a){return R9.form._getInServletLinkPrefix(b)+encodeURI(a)},_getInServletLinkPrefix:function(b){var a="";var c="";if(typeof b.ai!="undefined"&&typeof b.ai.value!="undefined"){a=b.ai.value}if(typeof b.p!="undefined"&&typeof b.p.value!="undefined"){c=b.p.value}return"/in?a="+encodeURI(a)+"&p="+encodeURI(c)+"&url="},_compareToCallback:function(b){var a=jq(this).closest("form").get(0);R9.form._smartboxPopulate(a,this,b);R9.CompareTo.smartboxCallback(a)},_smartboxCallback:function(b){var a=jq(this).closest("form").get(0);R9.form._smartboxPopulate(a,this,b)},_smartboxPopulate:function(c,a,d){var b=R9.form._getFormType(c);if(b==="flights"){if(jq(a).is("input[name=origin]")){c.origincode.value=d.id}else{if(jq(a).is("input[name=destination]")){c.destcode.value=d.id}}}else{if(b==="hotels"){c.citycode.value=d.id;if(typeof c.hid!="undefined"){c.hid.value=d.hid||""}if(typeof c.lmid!="undefined"){c.lmid.value=d.lmid||""}}else{if(b==="cars"){if(jq(a).is("input[name=location]")){c.citycode1.value=d.id}else{if(jq(a).is("input[name=location2]")){c.citycode2.value=d.id}}}else{if(b==="vacations"){if(jq(a).is("input[name=origin]")){c.origincode.value=d.id}else{if(jq(a).is("input[name=destination]")){c.destcode.value=d.id}}}}}}}};R9.form.flight={_oneWayToggle:function(a){var b=a.target;var c=jq(b).closest("form");if(b.value==="y"){jq(c).find(".roundTripSection").hide()}else{if(b.value==="n"){jq(c).find(".roundTripSection").show()}else{if(b.value==="m"){document.location.href="/flights?mc=y"}}}R9.form.flight._updateFlexOptions(c)},_updateFlexOptions:function(a){if(jq(a).find("input[name=dtFlexCat]:checked").val()=="weekend"){R9.form.flight._clickFlexOption(a,"exact")}},_clickFlexOption:function(b,a){jq(b).find("input[name=dtFlexCat]").each(function(){if(jq(this).val()==a){jq(this).click()}})},_flexDateClick:function(a){var b=a.target;var c=jq(b).closest("form");c.find(".flexDateLink").hide();c.find(".flexDateType").show();R9.form.flight._clickFlexOption(c,"plusminusthree");return false},_flexTypeToggle:function(b){var c=b.target;var d=jq(c).closest("form");var a=".flexAwarePlusminusthree";if(c.value==="exact"){a=".flexAwareExact"}else{if(c.value==="weekend"){a=".flexAwareWeekend"}}R9.form.flight._showCorrectFlexType(d,a);return true},_showCorrectFlexType:function(b,a){b.find(".flexAware").hide();b.find(a).show()},_setFlexValues:function(b,a){jq(b).find("select[name=depart_date_flex] option[value="+a+"]").prop("selected",true);jq(b).find("select[name=return_date_flex] option[value="+a+"]").prop("selected",true)},_hasFlexDates:function(a){if(typeof a.depart_date_flex!=="undefined"){return true}else{return false}},_getSharedFlightSwitchParams:function(a){var b="";b+="origin="+a.origin.value;b+="&origincode="+a.origincode.value;b+="&destination="+a.destination.value;b+="&destinationcode="+a.destcode.value;if(typeof a.nearbyO!=="undefined"&&typeof a.nearbyD!=="undefined"){b+="&nearbyO="+((document.flights.nearbyO.checked)?"y":"n");b+="&nearbyD="+((document.flights.nearbyD.checked)?"y":"n")}return b},_cabinChange:function(a){var b=a.target},_flexDatesChange:function(a){var b=a.target;R9.form.flight._toggleFlexSection(b)},_toggleFlexSection:function(a){if(jq(a).is(":checked")){jq(a).closest("form").find(".flexdateinputs").show()}else{jq(a).closest("form").find(".flexdateinputs").hide()}},_check:function(b){var a="";if(R9.form._checkFormPopulated(b.origin)===false){a="Angi en \u201DFra\u201D-flyplass."}else{if(R9.form._checkFormPopulated(b.destination)===false){a="Angi en \u201DTil\u201D-flyplass."}else{if(R9.form._checkFormPopulated(b.depart_date)===false){a="Vennligst angi avreisedato"}else{if(R9.form._checkFormPopulated(b.return_date)===false&&jq(b).find("input:radio[name=oneway]:checked").val()==="n"){a="Vennligst angi returdato."}else{if(b.origincode.value===b.destcode.value){a='Angi ulike "fra"- og "til"-flyplasser.'}}}}}if(a.length>0){alert(a);return false}else{return true}},_submit:function(a){var b=a.target;if(R9.form.flight._hasFlexDates(b)){if(jq(b).find("input[name=dtFlexCat]:checked").val()!=="plusminusthree"){R9.form.flight._setFlexValues(b,"exact")}}return R9.form._submit(b,R9.form.flight._check)},init:function(d,c,b,a){if(R9.form._getUseCompareTo(d)===true){jq(d.origin).smartbox({callback:R9.form._compareToCallback,searchType:"air"});jq(d.destination).smartbox({callback:R9.form._compareToCallback,searchType:"air"});R9.CompareTo.init(d)}else{jq(d.origin).smartbox({callback:R9.form._smartboxCallback,searchType:"air"});jq(d.destination).smartbox({callback:R9.form._smartboxCallback,searchType:"air"})}var f=jq(d).find("input[name=depart_date]");var e=jq(d).find("input[name=return_date]");c=R9.form._grabDate(c,f.val());b=R9.form._grabDate(b,e.val());if(typeof a=="undefined"){a=2}R9.dp.doublePicker({selector:f,altField:jq(d).find(".depart_date_label"),defaultDate:c,numberOfMonths:a},{selector:e,altField:jq(d).find(".return_date_label"),defaultDate:b,numberOfMonths:a});jq(d.oneway).click(R9.form.flight._oneWayToggle);if(typeof d.cabin!=="undefined"){jq(d.cabin).click(R9.form.flight._cabinChange)}if(R9.form.flight._hasFlexDates(d)){jq(d).find(".flexDateLink").click(R9.form.flight._flexDateClick);jq(d.dtFlexCat).click(R9.form.flight._flexTypeToggle);R9.form.flight._setFlexValues(d,"plusminusthree")}jq(d).submit(R9.form.flight._submit).attr("method","post")}};R9.form.hotel={_emptyGuestList:function(a){while(a.options.length){a.options[0]=null}},_fillGuestList:function(a,b,f,g,j){var d=a.find("[name=guestsOptionPostfixSingular]").val();var e=a.find("[name=guestsOptionPostfixPlural]").val();if(typeof d=="undefined"){d=""}if(typeof e=="undefined"){e=""}var h;for(i=f;i<=g;i++){var c;if(i==1){c=new Option(i+" "+d,i)}else{c=new Option(i+" "+e,i)}h=b.length;b.options[h]=c;if(j==i){b.selectedIndex=h}}if(b.length>0&&b.selectedIndex<0){b.selectedIndex=0}},_updateRoomsGuests:function(b){var c=b.target;var d=jq(c).closest("form");var e=d.find("select[name=guests]");R9.form.hotel._emptyGuestList(e.get(0));var a=jq(c).val();if(a=="1"){R9.form.hotel._fillGuestList(d,e.get(0),1,4,0)}else{if(a=="2"){R9.form.hotel._fillGuestList(d,e.get(0),1,8,0)}}},_clearDates:function(a){var b=a.target;var c=jq(b).closest("form");jq(c).find("input[name=checkin_date]").val("");jq(c).find("input[name=checkout_date]").val("");jq(c).find(".checkin_date_label").html("dd.mm.åååå");jq(c).find(".checkout_date_label").html("dd.mm.åååå")},_check:function(b){var a="";if(R9.form._checkFormPopulated(b.othercity)===false){a="Vennligst angi en by."}else{if(R9.form._checkFormPopulated(b.checkin_date)===false){a="Vennligst angi en gyldig innsjekkingsdato."}else{if(R9.form._checkFormPopulated(b.checkout_date)===false){a="Vennligst angi en gyldig utsjekkingsdato."}}}if(a.length>0){alert(a);return false}else{return true}},_submit:function(a){var b=a.target;return R9.form._submit(b,R9.form.hotel._check)},init:function(e,c,d,a){if(R9.form._getUseCompareTo(e)===true){jq(e.othercity).smartbox({callback:R9.form._compareToCallback,searchType:"hotel"});R9.CompareTo.init(e)}else{jq(e.othercity).smartbox({callback:R9.form._smartboxCallback,searchType:"hotel",smartUrl:"/f/smarty"})}var f=jq(e).find("input[name=checkin_date]");var b=jq(e).find("input[name=checkout_date]");c=R9.form._grabDate(c,f.val());d=R9.form._grabDate(d,b.val());if(typeof a=="undefined"){a=2}R9.dp.doublePicker({selector:f,altField:jq(e).find(".checkin_date_label"),defaultDate:c,numberOfMonths:a},{selector:b,altField:jq(e).find(".checkout_date_label"),defaultDate:d,numberOfMonths:a});jq(e.rooms).change(R9.form.hotel._updateRoomsGuests).change();jq(".clearDates").click(R9.form.hotel._clearDates);jq(e).submit(R9.form.hotel._submit).attr("method","post")}};R9.form.car={_oneWayToggle:function(a){var b=a.target;var c=jq(b).closest("form");if(b.value==="y"){jq(c).find(".roundTripSection").hide();jq(c).find(".oneWaySection").show()}else{if(b.value==="n"){jq(c).find(".roundTripSection").show();jq(c).find(".oneWaySection").hide()}}},_check:function(b){var a="";if(R9.form._checkFormPopulated(b.citycode1)===false&&R9.form._checkFormPopulated(b.location)===false){a="Vennligst velg sted for avhenting."}else{if(R9.form._checkFormPopulated(b.pickup_date)===false){a="Vennligst angi en dato for avhenting."}else{if(R9.form._checkFormPopulated(b.dropoff_date)===false){a="Vennligst angi dato for avlevering."}}}if(a.length>0){alert(a);return false}else{return true}},_submit:function(a){var b=a.target;return R9.form._submit(b,R9.form.car._check)},init:function(f,e,c,b){if(R9.form._getUseCompareTo(f)===true){jq(f.location).smartbox({callback:R9.form._compareToCallback,searchType:"car"});if(typeof f.location2!=="undefined"){jq(f.location2).smartbox({callback:R9.form._compareToCallback,searchType:"car"})}R9.CompareTo.init(f)}else{jq(f.location).smartbox({callback:R9.form._smartboxCallback,searchType:"car"});if(typeof f.location2!=="undefined"){jq(f.location2).smartbox({callback:R9.form._smartboxCallback,searchType:"car"})}}var d=jq(f).find("input[name=pickup_date]");var a=jq(f).find("input[name=dropoff_date]");e=R9.form._grabDate(e,d.val());c=R9.form._grabDate(c,a.val());if(typeof b=="undefined"){b=2}R9.dp.doublePicker({selector:d,altField:jq(f).find(".pickup_date_label"),defaultDate:e,numberOfMonths:b},{selector:a,altField:jq(f).find(".dropoff_date_label"),defaultDate:c,numberOfMonths:b});if(typeof f.oneway!=="undefined"){jq(f.oneway).click(R9.form.car._oneWayToggle)}jq(f).submit(R9.form.car._submit).attr("method","post")}};R9.form.vacation={_displayChildAges:function(a){var d=a.target;var b=parseInt(jq(d).val());var e=jq(d).closest("form");if(b<1){e.find(".childAgeTitle").hide()}else{e.find(".childAgeTitle").show()}var c=0;for(c=1;c<4;c++){if(c<=b){e.find(".childAge"+c).show()}else{e.find(".childAge"+c).hide()}}},_check:function(b){var a="";if(R9.form._checkFormPopulated(b.origin)===false){a="Angi en \u201DFra\u201D-flyplass."}else{if(R9.form._checkFormPopulated(b.destination)===false){a="Angi en \u201DTil\u201D-flyplass."}else{if(R9.form._checkFormPopulated(b.depart_date)===false){a="Vennligst angi avreisedato"}else{if(R9.form._checkFormPopulated(b.return_date)===false){a="Vennligst angi returdato."}}}}if(a.length>0){alert(a);return false}else{return true}},_submit:function(a){var b=a.target;return R9.form._submit(b,R9.form.vacation._check)},init:function(c,b,a){if(R9.form._getUseCompareTo(c)===true){jq(c.origin).smartbox({callback:R9.form._compareToCallback,searchType:"air"});jq(c.destination).smartbox({callback:R9.form._compareToCallback,searchType:"air"});R9.CompareTo.init(c)}else{jq(c.origin).smartbox({callback:R9.form._smartboxCallback,searchType:"air"});jq(c.destination).smartbox({callback:R9.form._smartboxCallback,searchType:"air"})}var e=jq(c).find("input[name=depart_date]");var d=jq(c).find("input[name=return_date]");b=R9.form._grabDate(b,e.val());a=R9.form._grabDate(a,d.val());R9.dp.doublePicker({selector:e,altField:jq(c).find(".depart_date_label"),defaultDate:b},{selector:d,altField:jq(c).find(".return_date_label"),defaultDate:a});jq(c.kids).change(R9.form.vacation._displayChildAges).change();jq(c).submit(R9.form.vacation._submit).attr("method","post")}};function jqtoggle(a){jq(a).toggle()}var R9CalDayOfWeek=["ma","ti","on","to","fr","lø","sø"];function hideSearchBox(){toggleFaderPane(false);jq("#popupSearch,table.popupsearch").hide()}function repaintTableStripes(){jq("table.striped tr:visible:odd").filter("tr:not(.notstriped)").addClass("odd");jq("table.striped tr:visible:even").removeClass("odd")}function showcalendarhelp(){var b="/trips/calendarhelp";var c=window.open(b,"calhelp","height=500,width=515,resizable,scrollbars");try{c.focus()}catch(a){}}if(typeof R9==="undefined"){R9=new Object()}R9.seo={_defaultFormIdCounter:1,getAjaxHotelForm:function(b,d,a){var c="simpleHotelSearchForm"+R9.seo._defaultFormIdCounter;R9.seo._defaultFormIdCounter++;jq.post("/ajaxform/simplehotelform",{formId:c,hid:a},function(e){jq("<div title='"+d+"' class='hotelsearchwidget'>"+e+"</div>").r9popover({position:b,width:"500px"});R9.form.hotel.init(jq("#"+c).get(0))},"html")},getAjaxFlightForm:function(e,g,a,c,d,b){var f="simpleFlightSearchForm"+R9.seo._defaultFormIdCounter;R9.seo._defaultFormIdCounter++;jq.post("/ajaxform/simpleflightform",{formId:f,originCode:a,destinationCode:c,departDate:d,returnDate:b},function(h){jq("<div title='"+g+"' class='flightsearchwidget'>"+h+"</div>").r9popover({position:e,width:"500px"});R9.form.flight.init(jq("#"+f).get(0))},"html")}};R9.seo.directFlights={showSection:function(a){jq(".flightlistcontent").hide();jq(a).show()}};

;var jsck_widgets_no_no="v428";
/* et=41, mt=2595, c=p2, i=sparkle010, v=R114, cc=2, r=none */

