// generated Fri Nov 20 16:48:03 EST 2009

function autoSave(mnt,srch,res){var r9http=new R9HTTPXml();var s="/"+mnt+"/autosave.jsp?searchid="+srch+"&resultid="+res;r9http.init(s);r9http.asyncGET(null)}function r9escape(s){var ns=s.replace("+","%2b");return escape(ns)}function openHelpWindow(subject,topic){var args="height=400,width=700,location=no,menubar=no,resizable=yes,toolbar=yes,status=no,scrollbars=yes";var url="/help.html#"+topic;var newWin=window.open(url,"help",args);newWin.focus()}function openSmallerWindow(name,url,xOverride,yOverride){if(xOverride==null||xOverride<0){xOverride=600}if(yOverride==null||yOverride<0){yOverride=600}var args="height="+yOverride+",width="+xOverride+",location=no,menubar=no,resizable=yes,toolbar=no,status=no,scrollbars=yes";var newWin=window.open(url,name,args);newWin.focus();return(false)}function ReadCookie(cookieName){jQuery.cookie(cookieName)}function DeleteCookie(name){jQuery.cookie(name,null)}function SetCookie(cookieName,cookieValue,nDays,domain){var options={path:"/",secure:false};if(nDays!=null){options.expires=nDays}if(domain!=null){options.domain=domain}jQuery.cookie(cookieName,cookieValue,options)}function showdiv3(obref){showhidediv(obrev,"visible")}function hidediv3(obref){showhidediv(obrev,"hidden")}function showhidediv3(obref,state){if(document.all){eval("document.all."+obref+".style.visibility = state")}if(document.layers){document.layers[obref].visibility=state}if(document.getElementById&&!document.all){obj=document.getElementById(obref);obj.style.visibility=state}}function showhidediv(obref,state){if(document.getElementById){document.getElementById(obref).style.visibility=state}}function hidediv(obref){showhidediv(obref,"hidden")}function showdiv(obref){showhidediv(obref,"visible")}function r9_addbm(url,name){if(window.external){window.external.AddFavorite(url,name)}else{alert("Sorry, your browser will not do this automatically.  Try hitting Ctrl+D after you click 'OK'")}}function escapeForXML(str){var retString=escape(str);return retString.replace(/\+/g,"%2b")}function kmail(addr){document.write('<a class="mlink" href="mailto:'+addr+'&#64;kayak&#46;com">'+addr+"&#64;kayak&#46;com</a>")}function kmail2(addr,domain){document.write('<a class="mlink" href="mailto:'+addr+"&#64;"+domain+'">'+addr+"&#64;"+domain+"</a>")}function validateEmail(email){if(email.length<=0){return false}var splitted=email.match("^(.+)@(.+)$");if(splitted==null){return false}if(splitted[1]!=null){var regexp_user=/^\"?[\'\w-_\.\+]*\"?$/;if(splitted[1].match(regexp_user)==null){return false}}if(splitted[2]!=null){var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;if(splitted[2].match(regexp_domain)==null){var regexp_ip=/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;if(splitted[2].match(regexp_ip)==null){return false}}return true}return false}function roundTo(num,nearest,up){if(up==null){up=true}var base=Math.floor(num/nearest);if((num%nearest)>0){if(up){return((base+1)*nearest)}else{return(base*nearest)}}else{return num}}function isIE5dotX(){var version=0;if(navigator.appVersion.indexOf("MSIE")!=-1){temp=navigator.appVersion.split("MSIE");version=parseFloat(temp[1]);if(version>=5&&version<6){return true}}return false}function taLimit(taObj,maxlength){if(taObj.value.length==maxlength*1){if(event.returnValue){event.returnValue=false}else{if(event.preventDefault){event.preventDefault()}else{return false}}}}function taCount(taObj,visText,visCnt,maxlength){if(taObj.value.length>maxlength*1){taObj.value=taObj.value.substring(0,maxlength*1)}if(visText){visText.style.visibility="visible"}if(visCnt){visCnt.innerHTML=maxlength-taObj.value.length}}function sStat(text){try{window.status=text}catch(ignored){}return true}function cStat(text){window.status=""}function findPosX(obj){var curleft=0;if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent}}else{if(obj.x){curleft+=obj.x}}return curleft}function findPosY(obj){var curtop=0;if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent}}else{if(obj.y){curtop+=obj.y}}return curtop}function selectByValue(what,value){if(what==null||typeof what.length=="undefined"){return}for(var i=0;i<what.length;i++){if(what[i].value==value){what.selectedIndex=i;break}}}function selectByStartsWith(what,value){if(what==null||typeof what.length=="undefined"){return}for(var i=0;i<what.length;i++){if((what[i].value).indexOf(value)==0){what.selectedIndex=i;break}}}function getSelectByValue(what,value){for(var i=0;i<what.length;i++){if(what[i].value==value){return i}}return -1}function getRadioValue(what){for(var i=0;i<what.length;i++){if(what[i].checked){return what[i].value}}return null}function setRadioValue(what,value){for(var i=0;i<what.length;i++){if(what[i].value==value){what[i].checked;return true}}return false}function getScrollAmount(){var scrollAmount=document.body.scrollTop;if(typeof window.innerWidth!="undefined"){if(scrollAmount==0&&document.documentElement.scrollTop!="undefined"&&document.documentElement.scrollTop!=0){scrollAmount=document.documentElement.scrollTop}}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.scrollTop!="undefined"&&document.documentElement.scrollTop!=0){if(scrollAmount==0){scrollAmount=document.documentElement.scrollTop}}}return scrollAmount}function setScrollAmount(top,left){if(typeof(window.pageYOffset)=="number"){window.pageYOffset=top;window.pageXOffset=left}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){document.body.scrollTop=top;document.body.scrollLeft=left}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){document.documentElement.scrollTop=top;document.documentElement.scrollLeft=left}}}}function showmessage(text){var msgbox=document.getElementById("messagebox");if(msgbox!=null){msgbox.innerHTML=text;msgbox.style.left=Math.round((document.body.clientWidth-msgbox.offsetWidth)/2)+"px";var top=200;try{var browserWindowHeight;var scrollAmount=document.body.scrollTop;if(typeof window.innerWidth!="undefined"){browserWindowHeight=window.innerHeight;if(scrollAmount==0&&document.documentElement.scrollTop!="undefined"&&document.documentElement.scrollTop!=0){scrollAmount=document.documentElement.scrollTop}}else{if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientHeight!="undefined"&&document.documentElement.clientHeight!=0){browserWindowHeight=document.documentElement.clientHeight;if(scrollAmount==0){scrollAmount=document.documentElement.scrollTop}}else{browserWindowHeight=document.getElementsByTagName("body")[0].clientHeight}}top=Math.round(((browserWindowHeight-msgbox.offsetHeight)/3)+scrollAmount-0)}catch(ignored){}msgbox.style.top=top+"px";msgbox.style.visibility="visible"}}function hidemessage(){var msgbox=document.getElementById("messagebox");if(msgbox!=null){msgbox.innerHTML="";msgbox.style.visibility="hidden"}}function toggleFaderPane(show,clickevent){var theBody=jQuery("body");var faderPane=document.getElementById("faderPane");if(faderPane==null){theBody.append("<div id='faderPane'></div>");if(jQuery.browser.msie&&jQuery.browser.version.indexOf("6")==0){jQuery("#faderPane").append('<img height="2048" width="2048" src="/images/fake-alpha-999.gif"/>')}faderPane=document.getElementById("faderPane")}var height=theBody.height();var width=theBody.width();faderPane.style.height=height+"px";faderPane.style.width=width+"px";faderPane.style.display=(show)?"block":"none";if(typeof clickevent=="function"&&show){document.getElementById("faderPane").onclick=clickevent}else{document.getElementById("faderPane").onclick=null}}function htmlSafe(aString){aString=aString.replace(/\&/g,"&amp;");aString=aString.replace(/>/g,"&gt;");aString=aString.replace(/</g,"&lt;");aString=aString.replace(/\"/g,"&quot;");aString=aString.replace(/\'/g,"&#39;");return aString}function stripSpaces(aString){aString=aString.replace(/\s/g,"");return aString}function resizeIframeToContents(iframe){try{var frbody=jQuery(iframe).contents().find("body");var linkID=jQuery(iframe).attr("id");linkID=linkID.replace("displayAd","displayAdHide");if(frbody){iframe.height=frbody.height();iframe.width=frbody.width()}var alwaysHide=false;var frimg=jQuery(iframe).contents().find("body img");if(frimg&&frimg.length==1&&frimg.attr("src")!=null&&frimg.attr("src").indexOf("/kayakadpixel.gif")>0){alwaysHide=true}if(alwaysHide){iframe.height=0;iframe.width=0;try{jQuery(iframe).css("margin","0px")}catch(ignored){}try{var id=linkID;id=id.replace("displayAdHide","");jQuery("#bannerad"+id).hide();jQuery("#"+linkID).hide()}catch(ignored){}}else{jQuery("#"+linkID).css("visibility","visible")}}catch(ignored){}}function reloadBannerAds(){function setSrc(frmName,rank){var frm=document.getElementById(frmName);if(frm!=null){var ts=(new Date()).getTime();var newsrc="";var oldsrc="";if(navigator.appVersion.indexOf("MSIE")!=-1){oldsrc=frm.contentWindow.location.href}else{oldsrc=frm.src}if(frm.src.indexOf("&ad_ts=")<0){newsrc=oldsrc+"&ad_ts="+ts}else{newsrc=oldsrc.substring(0,oldsrc.indexOf("&ad_ts"))+"&ad_ts="+ts}if(navigator.appVersion.indexOf("MSIE")!=-1){var theHTML=document.getElementById("displayAdSpanFrame"+rank).innerHTML;var newHTML=theHTML.replace(/src="[^"]*"/,'src="'+newsrc+'"');document.getElementById("displayAdSpanFrame"+rank).innerHTML=newHTML}else{frm.src=newsrc}}}function adShowing(theDiv){if(theDiv==null){return false}if(document.getElementById(theDiv)==null){return false}if(document.getElementById(theDiv).style.display=="none"){return false}return true}if(adShowing("bannerad1")){setSrc("displayAd1","1")}if(adShowing("bannerad2")){setSrc("displayAd2","2")}if(adShowing("bannerad3")){setSrc("displayAd3","3")}if(adShowing("bannerad4")){setSrc("displayAd4","4")}}function showTT(parent,text,type,offsetOverride,doNotHide,customHide){if(doNotHide==null||!doNotHide){hideAllTT(false)}else{if(customHide!=null){parts=customHide.split(",");for(var i=0;i<parts.length;i++){hideTTType(parts[i])}}}if(navigator.appVersion.indexOf("MSIE")!=-1){jQuery("select.hideOnTT").css("visibility","hidden")}obj=document.getElementById("ttip"+type);if(text!=""){document.getElementById("ttipText"+type).innerHTML=text}obj.style.visibility="hidden";obj.style.display="block";var offset=jQuery(parent).offset();var newY=offset.top;var newX=offset.left;if(offsetOverride!=null){newY+=offsetOverride.y;newX+=offsetOverride.x}obj.style.zIndex="99";if(type=="BL"){newY=newY-obj.offsetHeight+5;newX=newX+parent.offsetWidth-50}else{if(type=="TL"){newY=newY+parent.offsetHeight-5;newX=newX+parent.offsetWidth-50}else{if(type=="CL"||type=="CR"||type=="FL"){newY=newY-(obj.offsetHeight/2)+(parent.offsetHeight/2);if(type=="CL"||type=="FL"){newX=newX+parent.offsetWidth}else{newX=newX-obj.offsetWidth}}else{if(type=="DL"){newX=newX+jQuery(parent).outerWidth();newY=newY+(jQuery(parent).outerHeight()/2)-50;obj.style.zIndex="45"}else{if(type=="DR"){var oldX=newX;var oldY=newY;newY=newY+(jQuery(parent).outerHeight()/2)-50;newX=newX-(jQuery(obj).outerWidth()+3);obj.style.zIndex="45"}else{if(type=="CT"||type=="CB"){newY=newY-0+parent.offsetHeight;if((jQuery.browser.mozilla||jQuery.browser.safari)&&(type=="CL"||type=="FL")){newY+=8}else{if(jQuery.browser.msie&&parseInt(jQuery.browser.version)==6){}}newX=newX-(obj.offsetWidth/2)}}}}}}obj.style.top=newY+"px";obj.style.left=newX+"px";obj.style.visibility="visible"}function hideAllTT(calllocal){if(navigator.appVersion.indexOf("MSIE")!=-1){jQuery("select.hideOnTT").css("visibility","visible")}if(calllocal==null){calllocal=true}stoptime();var types=new Array("BL","TL","CL","CR","CB","CT","DL","DR","FL");for(var i=0;i<types.length;i++){hideTTType(types[i])}if(typeof localTTHidden=="function"&&calllocal){localTTHidden()}}function hideTTType(type){var o=document.getElementById("ttip"+type);if(o!=null){o.style.display="none"}}var ttipTimerID=null;function starttime(x){if(ttipTimerID==null){var t=10000;if(x!=null){t=t*x}ttipTimerID=setTimeout("hideAllTT()",t)}}function stoptime(){if(ttipTimerID!=null){clearTimeout(ttipTimerID);ttipTimerID=null}}function simpleurl(fullurl){if(fullurl==null){return fullurl}var startsWithHttp=(fullurl.indexOf("http://")==0);var nextSlash=fullurl.indexOf("/",startsWithHttp?7:0);var host=null;if(nextSlash>0){host=fullurl.substring(startsWithHttp?7:0,nextSlash)}else{host=fullurl.substring(startsWithHttp?7:0)}if(host.indexOf("www.")==0){return host.substring(4)}return host}function hideTableRow(id){var theRow=document.getElementById(id);if(theRow==null){return}theRow.style.display="none"}function showTableRow(id){var theRow=document.getElementById(id);if(theRow==null){return}var _isIE=(((navigator.appName).indexOf("Microsoft")>-1)?true:false);if(_isIE){theRow.style.display="block"}else{theRow.style.display="table-row"}}function hideTbody(id){var theRows=document.getElementById(id);if(theRows==null){return}theRows.style.display="none"}function showTbody(id){var theRows=document.getElementById(id);if(theRows==null){return}var _isIE=(((navigator.appName).indexOf("Microsoft")>-1)?true:false);if(_isIE){theRows.style.display="block"}else{theRows.style.display="table-row-group"}}function cleanUrl(url){if(url!=""&&url.indexOf("http")!=0){if(url.length<=1017){url="http://"+url}else{url="http://"+url.substring(0,1017)}}return url}function isBadUrl(url){url=cleanUrl(url);if(url.match(/^https?\:\/\/([A-Za-z0-9\-]*\.){1,}[A-Za-z0-9]{1,3}(\:[0-9]*)?[\/\?][^\s]*$/)||url.match(/^https?\:\/\/([A-Za-z0-9\-]*\.){1,}[A-Za-z0-9]{1,3}(\:[0-9]*)?$/)||url.match(/^https?\:\/\/([A-Za-z0-9\-]*\.){1,}(name|travel|museum|aero|mobi|info|jobs)(\:[0-9]*)?[\/\?][^\s]*$/)||url.match(/^https?\:\/\/([A-Za-z0-9\-]*\.){1,}(name|travel|museum|aero|mobi|info|jobs)(\:[0-9]*)?$/)){return false}else{return true}}function animateHeight(elem,startHeight,endHeight,steps,intervals,powr){if(elem.heightChangeMemInt){window.clearInterval(elem.heightChangeMemInt)}var actStep=0;elem.heightChangeMemInt=window.setInterval(function(){elem.currentHeight=easeInOut(startHeight,endHeight,steps,actStep,powr);elem.style.height=elem.currentHeight+"px";actStep++;if(actStep>steps){window.clearInterval(elem.heightChangeMemInt)}},intervals)}function easeInOut(minValue,maxValue,totalSteps,actualStep,powr){var delta=maxValue-minValue;var stepp=minValue+(Math.pow(((1/totalSteps)*actualStep),powr)*delta);return Math.ceil(stepp)}function clearAnimation(elem){if(elem.heightChangeMemInt){window.clearInterval(elem.heightChangeMemInt)}}function replaceArgs(){str=arguments[0];for(var i=1;i<=arguments.length;i++){str=str.replace("{"+(i-1).toString()+"}",arguments[i])}return str}function correctPNG(){var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if((version>=5.5&&version<7)&&(document.body.filters)){for(var i=0;i<document.images.length;i++){var img=document.images[i];var imgName=img.src.toUpperCase();if(imgName.substring(imgName.length-3,imgName.length)=="PNG"){var imgID=(img.id)?"id='"+img.id+"' ":"";var imgClass=(img.className)?"class='"+img.className+"' ":"";var imgTitle=(img.title)?"title='"+img.title+"' ":"title='"+img.alt+"' ";var imgStyle="display:inline-block;"+img.style.cssText;if(img.align=="left"){imgStyle="float:left;"+imgStyle}if(img.align=="right"){imgStyle="float:right;"+imgStyle}if(img.parentElement.href){imgStyle="cursor:hand;"+imgStyle}var strNewHTML="<span "+imgID+imgClass+imgTitle+' style="width:'+img.width+"px; height:"+img.height+"px;"+imgStyle+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"', sizingMethod='scale');\"></span>";img.outerHTML=strNewHTML;i=i-1}}}}function isMLorE(e,handler){try{var reltg=e.relatedTarget?e.relatedTarget:e.type=="mouseout"?e.toElement:e.fromElement;while(reltg&&reltg!=handler){reltg=reltg.parentNode}return(reltg!=handler)}catch(ignored){}return false}function trim(str,len,ellip){if(str==null||str.length<=len){return str}if(len){if(ellip){return str.substr(0,len-1)+"&hellip;"}return str.substr(0,len)}else{return str.replace(/^\s*/,"").replace(/\s*$/,"")}}function trimSafe(str,len,ellip){if(str==null){return str}if(str.length<=len){return htmlSafe(str)}var tmp;var addEll=false;if(ellip){tmp=trim(str,len-1,false);if(tmp.length<str.length){addEll=true}}else{tmp=trim(str,len,false)}var tmp2=htmlSafe(tmp);if(addEll){return tmp2+"&hellip;"}return tmp2}var r9EventList=null;function pushRecordedEvents(){if(r9EventList.length>0){var data={};var i=0;jQuery.each(r9EventList,function(){var value=(typeof this.value!="undefined")?this.value:"";var units=(typeof this.units!="undefined")?this.units:"";data["event_"+i]=this.category+":"+this.subCategory+":"+this.name+":"+value+":"+units;++i});jQuery.post("/s/sparkle?action=clientevents",data);r9EventList=new Array()}}function recordEvent(cat,subcat,name,units,value){if(r9EventList==null){r9EventList=new Array();jQuery(window).unload(pushRecordedEvents)}jQuery.get("/vs/"+cat+"/"+subcat+"/"+name+"/"+units+"/"+value+"?action=vs")}function chkCompareToGroups(codeArray){var finalList=new Array();var groupsSeen=new Object();for(var i=0;i<codeArray.length;i++){if(codeArray[i].group==null||codeArray[i].group.length==0){codeArray[i].groupOK=true}else{var groupname=codeArray[i].group.substr(0,codeArray[i].group.indexOf("-"));var bestValue=parseInt(codeArray[i].group.slice(codeArray[i].group.indexOf("-")+1));var bestIndex=i;if(groupsSeen[groupname]==null){for(var j=i+1;j<codeArray.length;j++){var currentgroupname=codeArray[j].group.substr(0,codeArray[j].group.indexOf("-"));if(currentgroupname==groupname){var currentValue=parseInt(codeArray[j].group.slice(codeArray[j].group.indexOf("-")+1));if(currentValue<bestValue){codeArray[bestIndex].groupOK=false;if(codeArray[bestIndex].input!=null){codeArray[bestIndex].input.checked=false}bestIndex=j;bestValue=currentValue}else{codeArray[j].groupOK=false;if(codeArray[j].input!=null){codeArray[j].input.checked=false}}}}}}}for(var i=0;i<codeArray.length;i++){if(codeArray[i].groupOK=true){finalList.push(codeArray[i])}}return finalList}if(typeof String.prototype.localeCompare=="undefined"){String.prototype.localeCompare=function(sOther){if(this<sOther){return -1}else{if(this>sOther){return 1}else{return 0}}}}var R9_DisplayEds_JustHidden=false;function hideDisplayAds(isAnon){R9_DisplayEds_JustHidden=true;GetAjaxReg().disableDisplayAds();if(isAnon==null||isAnon){var ajaxReg=GetAjaxReg();ajaxReg.regtype="displayad";ajaxReg.showRegister()}}function hlitepagenum(tdref,hlite){tdref.style.backgroundColor=(hlite)?"#ffffcc":"white";tdref.style.cursor=(hlite)?"pointer":"default"}function StringBuilder(value){this.strings=new Array("");if(value!=null){this.append(value)}}StringBuilder.prototype.append=function(value){if(value){this.strings.push(value)}return this};StringBuilder.prototype.clear=function(){this.strings.length=1};StringBuilder.prototype.toString=function(){return this.strings.join("")};function kykButtonClicked(btn,overridehtml){jQuery(btn).children("table").children("tbody").children("tr").children("td.sideimg").each(function(i){var newPos=this.style.backgroundPosition.replace(/^0px/,"-90px").replace(/-60px/,"-90px").replace(/-30px/,"-90px");this.style.backgroundPosition=newPos});jQuery(btn).children("table").children("tbody").children("tr").children("td.text").each(function(i){this.style.backgroundPosition="0px -185px"});jQuery(btn).children("table").children("tbody").children("tr").children("td").children("div.up").hide();if(overridehtml!=null){jQuery(btn).children("table").children("tbody").children("tr").children("td").children("div.down").html(overridehtml)}jQuery(btn).children("table").children("tbody").children("tr").children("td").children("div.down").show();jQuery(btn).attr("disabled",true);jQuery(btn).children("table").children("tbody").children("tr").children("td").children("div").attr("disabled",false);jQuery(btn).unbind("hover").unbind("mouseenter").unbind("mouseleave").unbind("click").unbind("mousedown").unbind("mouseup");jQuery(btn).each(function(i){this.blur()})}function bindKykButton(buttonid){var elementid="";if(buttonid==null){elementid="button.kykbtn"}else{elementid=buttonid}jQuery(elementid).hover(function(){jQuery(this).children("table").children("tbody").children("tr").children("td.sideimg").each(function(i){var oldPos=this.style.backgroundPosition;var newPos=this.style.backgroundPosition.replace(/^0px/,"-30px").replace(/^-60px/,"-30px");this.style.backgroundPosition=newPos});jQuery(this).children("table").children("tbody").children("tr").children("td.text").each(function(i){this.style.backgroundPosition="0px -111px"})},function(){jQuery(this).children("table").children("tbody").children("tr").children("td.sideimg").each(function(i){var newPos=this.style.backgroundPosition.replace(/-30px/,"0px").replace(/-60px/,"0px");this.style.backgroundPosition=newPos});jQuery(this).children("table").children("tbody").children("tr").children("td.text").each(function(i){this.style.backgroundPosition="0px -74px"})});jQuery(elementid).bind("mousedown",function(e){jQuery(this).children("table").children("tbody").children("tr").children("td.sideimg").each(function(i){var newPos=this.style.backgroundPosition.replace(/-30px/,"-60px");this.style.backgroundPosition=newPos});jQuery(this).children("table").children("tbody").children("tr").children("td.text").each(function(i){this.style.backgroundPosition="0px -148px"})});if(buttonid==null){jQuery("button.kykbtnsingleclick").bind("click",function(e){jQuery(this).addClass("disabledKayakBtn");kykButtonClicked(this)})}jQuery(elementid).children("table").each(function(i){try{if(navigator.appVersion.indexOf("MSIE")!=-1){this.parentElement.style.width=this.offsetWidth+"px";this.parentElement.style.hight=this.offsetHeight+"px"}}catch(ignored){}})}function showCountryList(showCurrency){var popup=(document.getElementById("currentCountry")==null)?true:false;if(popup){var mydata="action=countrylist&showCurr="+showCurrency;jQuery.ajax({type:"POST",url:"/s/toolbox",data:mydata,dataType:"html",success:function(html){try{jQuery("#countryList").html(html);loadCCCpicker()}catch(ignored){}},error:function(request,textStatus,error){alert(textStatus)},cache:false})}}function rewriteRedirect(e,hash){if(hash){suffix="&h="+hash}else{suffix=""}e=jQuery(e);e.attr("href","/out?url="+encodeURI(e.attr("href"))+suffix);return true}if(typeof(jQuery)!=typeof(undefined)){jQuery(function(){bindKykButton()})}try{jq=jQuery.noConflict()}catch(ignored){}var _isIE=(((navigator.appName).indexOf("Microsoft")>-1)?true:false);var _isSafari=(((navigator.userAgent).indexOf("Safari")>-1)?true:false);var _isDebug=false;var _defaultUpdatingIcon='<img style="vertical-align: middle" src="/images/a-confirmation-circle.gif" width="18" height="20">&nbsp;&nbsp;';var _defaultUpdatingMessage="Updating results...";var _updatingResultsMessage=null;var messageBoxDelay=1000;var _currentPageNum=1;var _numrows;var isFlexDate=false;var secondPhaseInProgress=false;var secondPhaseDisplayMessage=null;var filterMatchCriteriaPrice=null;var filterMatchCriteriaUndo=null;function getStartingRow(){return((_currentPageNum-1)*_numrows)}function getEndingRow(){return Math.min(((_currentPageNum-1)*_numrows)+_numrows,_filtered.length)}function hidePagingTooltip(){jQuery("body").unbind("click",hidePagingTooltip);jQuery("#filtercorners").css("background-color","#eee");jQuery("div.fullFilterSection").css("background-color","#eee");hideAllTT()}function showOwedSections(){jquery(".slidedown").slideDown("slow")}function showPagingTooltip(){if(typeof showPagingTooltipEnabled!="function"){return}if(showPagingTooltipEnabled()){jQuery("#filtercorners").css("background-color","#dedede");jQuery("div.fullFilterSection").css("background-color","#dedede");var offsets={x:-50,y:0};showTT(document.getElementById("topOfFilter"),'<div class=\'pagingToolTip\'><div><b>Find results faster</b></div><div>Selecting filter options on the left will narrow results to just a few.</div><span style="float: right"><a target="_blank" href="http://www.youtube.com/kayak">Tell me more</a></span></div>',"BL",offsets);jQuery("body").bind("click",hidePagingTooltip);jQuery.cookie("pgmsgshown","y");addAdt("showpgtooltip")}}function setPage(pnum,skipHistory){var num=pnum;if((skipHistory==null||!skipHistory)&&num!=_currentPageNum&&typeof addHistory=="function"){addHistory()}if(typeof hotelTwoPhaseUpdateMessage=="function"&&hotelTwoPhaseUpdateMessage()){_updatingResultsMessage="Getting results for next page...";showmessage(getUpdateMessage())}function doPage(){if(!isNaN(num)&&num>=1&&num!=_currentPageNum){_currentPageNum=num;updateTable("paging");window.scrollTo(0,0);pgNums();addAdt("page."+num);updateDisplayA_ds(num);hidemessage();if(pnum==2){showPagingTooltip()}}}waitForResults(doPage)}var R9TotalResultCount=0;function getTopPageControlsAndResultCountObsolete(optionalText,maxPagesToShow){if(optionalText==null){optionalText=""}if(maxPagesToShow==null||maxPagesToShow==""){maxPagesToShow=4}var filteredCount=_filtered.length;var resultCount=Math.max(R9TotalResultCount,_r.length);var showAll="";var filterReasons=getFilteredOutReasons().reasons;if(filteredCount>resultCount){filteredCount=resultCount}if(filteredCount<resultCount&&filterReasons.length>0){showAll='<span class="parenthetical">(<a class="actionlink" href="javascript:showLowest(false)">show all</a>)</span>'}var html=new Array();html[html.length]="<div class='topofresultsctrls'>";html[html.length]='<span class="sectioncount"> <span id="filtered_count">'+_filtered.length+'</span> of <span id="result_count">'+resultCount+"</span> shown "+optionalText+showAll+"</span>";html[html.length]="<span class='sectionpaging'>";html[html.length]=getPageControls(null,maxPagesToShow);html[html.length]="</span></div>";return html.join("")}function showRemoveFiltersLink(){var filteredCount=_filtered.length;var resultCount=Math.max(R9TotalResultCount,_r.length);var showAll="";if(filteredCount>resultCount){filteredCount=resultCount}if(filteredCount<resultCount){return true}return false}function getTopPageControlsAndResultCount(optionalText,maxPagesToShow,searchtype,showMatrixControls,currentmatrixview){if(showMatrixControls==null){showMatrixControls=true}if(optionalText==null){optionalText=""}if(maxPagesToShow==null||maxPagesToShow==""){maxPagesToShow=4}var filteredCount=_filtered.length;var resultCount=Math.max(R9TotalResultCount,_r.length);var showAll="";var filterReasons=getFilteredOutReasons().reasons;if(filteredCount>resultCount){filteredCount=resultCount}if(filteredCount<resultCount&&filterReasons.length>0){showAll='<span class="parenthetical"><a class="actionlink" href="javascript:showLowest(false)">show all</a></span>'}var html=new Array();html[html.length]="<div class='topofresultsctrls'>";if(searchtype=="flight"){html[html.length]='<span class="sectioncount">'+replaceArgs('<span class="resultcountbold">{0}</span> of <span id="result_count" class="resultcountbold">{1} {2} shown</span>',_filtered.length,resultCount,optionalText)+" "+showAll;if(showAll!=""){html[html.length]=" | "}if(showMatrixControls){if(currentmatrixview==null||currentmatrixview!="matrix"){html[html.length]='<span id="toolboxitemshowmatrix"><a class="actionlink" href="javascript: doHide();chgView(\'matrix\')">show matrix</a></span>';html[html.length]='<span id="toolboxitemhidematrix" style="display:none"><a class="actionlink" href="javascript: doHide();chgView(\'list\')">hide matrix</a></span>'}else{html[html.length]='<span id="toolboxitemshowmatrix" style="display:none"><a class="actionlink" href="javascript: doHide();chgView(\'matrix\')">show matrix</a></span>';html[html.length]='<span id="toolboxitemhidematrix" ><a class="actionlink" href="javascript: doHide();chgView(\'list\')">hide matrix</a></span>'}}html[html.length]="</span>"}else{if(searchtype=="hotel"){var onlineprices="";if(use_unpricedfilter){if(showAll!=""){showAll+='<span id="unpriced_spacer" style="padding:0 6px 0 6px;color:#999;">|</span>'}if(show_unpriced){onlineprices='<span class="parenthetical"><a class="actionlink" href="javascript:showunpriced(true);refilter(noop);" id="unpriced_on" style="display:none;">show hotels without online availability</a>';onlineprices+='<a class="actionlink" href="javascript:showunpriced(false);refilter(noop)" id="unpriced_off" >hide hotels without online availability</a></span>'}else{onlineprices='<span class="parenthetical"><a class="actionlink" href="javascript:showunpriced(true);refilter(noop);" id="unpriced_on">show hotels without online availability</a>';onlineprices+='<a class="actionlink" href="javascript:showunpriced(false);refilter(noop)" id="unpriced_off" style="display:none;">hide hotels without online availability</a></span>'}}html[html.length]='<span class="sectioncount">'+replaceArgs('<span class="resultcountbold">{0}</span> of <span class="resultcountbold">{1} hotels shown</span>',_filtered.length,resultCount)+" "+optionalText+showAll+onlineprices+"</span>"}else{if(searchtype=="car"){html[html.length]='<span class="sectioncount">'+replaceArgs('<span class="resultcountbold">{0}</span> of <span class="resultcountbold">{1} car rentals shown</span>',_filtered.length,resultCount)+" "+optionalText+showAll+" ";if(showMatrixControls){if(currentmatrixview==null||currentmatrixview!="matrix"){html[html.length]='<span id="toolboxitemshowmatrix"><a class="actionlink" href="javascript: doHide();chgView(\'matrix\')">show matrix</a></span>';html[html.length]='<span id="toolboxitemhidematrix" style="display:none"><a class="actionlink" href="javascript: doHide();chgView(\'list\')">hide matrix</a></span>'}else{html[html.length]='<span id="toolboxitemshowmatrix" style="display:none"><a class="actionlink" href="javascript: doHide();chgView(\'matrix\')">show matrix</a></span>';html[html.length]='<span id="toolboxitemhidematrix"><a class="actionlink" href="javascript: doHide();chgView(\'list\')">hide matrix</a></span>'}}html[html.length]="</span>"}else{if(searchtype=="deal"){if(getDealPageType()=="A"){html[html.length]='<span class="sectioncount">'+replaceArgs('<span class="resultcountbold">{0} auctions found</span><span id="allAuctionHeaderLink"> (<a style="text-decoration: underline" href="javascript: NavListLinks(\'/dealssearch?auction=true&type=A&dest=\'+escape(\'All Auctions\'))">show all auctions</a>)</span>',_filtered.length,resultCount)+" "+optionalText+"</span>"}else{html[html.length]='<span class="sectioncount">'+replaceArgs('<span class="resultcountbold">{0} deals found</span>',_filtered.length,resultCount)+" "+optionalText+"</span>"}}else{html[html.length]='<span class="sectioncount"> <span id="filtered_count">'+_filtered.length+'</span> of <span id="result_count">'+resultCount+"</span> shown "+optionalText+showAll+"</span>"}}}}html[html.length]="<span class='sectionpaging'>";html[html.length]=getPageControls(null,maxPagesToShow);html[html.length]="</span></div>";return html.join("")}function getPageControls(tableclass,maxPagesToShow){if(maxPagesToShow==null){maxPagesToShow=5}var numpages=Math.ceil(_filtered.length/_numrows);if(numpages<2){return""}if(maxPagesToShow<0){return getMinimalPageControls(tableclass)}if(tableclass==null){tableclass="pagecontrols"}var pageControls="<table class='"+tableclass+"'><tr style='white-space:nowrap;'>";if(numpages>1){if(_currentPageNum==1){pageControls+="<td class='light' style='color:#999;white-space:nowrap;text-align:left;'><nobr>&laquo;&nbsp;Prev </nobr></td>"}else{pageControls+="<td style='white-space:nowrap;text-align:left;' ><nobr>&laquo;&nbsp;<a href=\"javascript:setPage("+(_currentPageNum-1)+');">Prev</a> </nobr></td>'}var i=Math.max((_currentPageNum-1),1);if(i>1){pageControls+="<td  onclick='setPage("+1+");' class='pageunsel'><a class='actionlink' href='javascript: setPage("+1+");'>"+1+"</a></td>";if(i>2){pageControls+="<td>&hellip;</td>"}}for(;i<=numpages&&maxPagesToShow>0;i++){if(i==_currentPageNum){pageControls+="<td class='current'>"+i+"</td>"}else{pageControls+="<td onclick='setPage("+i+");' class='pageunsel'><a class='actionlink' href='javascript: setPage("+i+");'>"+i+"</a></td>"}maxPagesToShow--}if(i<numpages){pageControls+="<td>&hellip;</td>";pageControls+="<td onclick='setPage("+numpages+");' class='pageunsel'><a class='actionlink' href='javascript: setPage("+numpages+");'>"+numpages+"</a></td>"}if(_currentPageNum==numpages){pageControls+="<td class='light' style='color:#999;white-space:nowrap;text-align:right;'><nobr>Next&nbsp;&raquo;</nobr></td>"}else{pageControls+="<td style='white-space:nowrap;text-align:right;'><a class='actionlink' href='javascript: setPage("+(_currentPageNum-0+1)+");'><nobr>Next</a>&nbsp;&raquo;</nobr></td>"}}pageControls+="</tr></table>";return pageControls}function getMinimalPageControls(tableclass){if(tableclass==null){tableclass="pagecontrolsminimal"}var pageControls="<table class='"+tableclass+"' border='0' cellpadding='0' cellspacing='0' style='padding:0;' ><tr style='white-space:nowrap;'>";var numpages=Math.ceil(_filtered.length/_numrows);if(numpages>0){if(_currentPageNum==1){pageControls+="<td class='light' style='color:#999;white-space:nowrap;text-align:left;'><nobr>&laquo;&nbsp;Prev</nobr></td>";pageControls+="<td class='light' style='color:#999;text-align:center;'> &ndash; </td>"}else{pageControls+="<td class='pageunsel' style='white-space:nowrap;text-align:left;' ><nobr>&laquo;&nbsp;<a href=\"javascript:setPage("+(_currentPageNum-1)+');">Prev</a> </nobr></td>';pageControls+="<td class='light' style='color:#999;text-align:center;'> &ndash; </td>"}if(_currentPageNum==numpages){pageControls+="<td class='light' style='color:#999;white-space:nowrap;text-align:right;'><nobr>Next&nbsp;&raquo;</nobr></td>"}else{pageControls+="<td class='pageunsel' style='white-space:nowrap;text-align:right;' ><nobr><a class='actionlink' href='javascript: setPage("+(_currentPageNum-0+1)+");'>Next</a>&nbsp;&raquo;</nobr></td>"}}pageControls+="</tr></table>";return pageControls}function getSeparatorLines(colspan,topcolor,bottomcolor){var separatorLines=new StringBuilder();separatorLines.append('<tr style="background-color:'+topcolor+';padding:0px;">');separatorLines.append('<td colspan="'+colspan+'" nowrap style="height:1px;background-color:'+topcolor+';padding:0px;" >');separatorLines.append("</td>");separatorLines.append("</tr>");separatorLines.append('<tr style="background-color:'+bottomcolor+';padding:0px;">');separatorLines.append('<td colspan="'+colspan+'" nowrap style="height:1px;background-color:'+bottomcolor+';padding:0px;" >');separatorLines.append("</td>");separatorLines.append("</tr>");return separatorLines.toString()}function clearPages(){_currentPageNum=1}function fNumRows(v){_numrows=(v>_filtered.length?_filtered.length:v);pgNums()}function sumbitEmail(field,btnfield){if(field.value.length==0||!validateEmail(field.value)){try{field.focus()}catch(ignored){}alert("Please enter a valid email address.");return false}try{btnfield.disabled=true}catch(ignored){}return true}function getUpdateMessage(defaultMsg){var msgToShow="";if(_updatingResultsMessage!=null&&_updatingResultsMessage.length>0){msgToShow+=_updatingResultsMessage}else{if(defaultMsg!=null&&defaultMsg.length>0){msgToShow+=defaultMsg}else{msgToShow+=_defaultUpdatingMessage}}return msgToShow}function resizeNumRows(v,cookiename){setTop(0);fNumRows(v);if(cookiename!=null&&cookiename.length>0){SetCookie(cookiename,v,365)}showmessage(getUpdateMessage());function resizeUpdate(){updateTable("resultsPerPage_"+v);hidemessage();_updatingResultsMessage=null;R9ResultsRendered=new Date()}window.setTimeout(resizeUpdate,1)}function jumpToTopOfFilters(){try{document.getElementById("filtercorners").scrollIntoView()}catch(ignored){}}function pgNums(){try{var currentNumPages=Math.floor(_filtered.length/_numrows)+((_filtered.length%_numrows>0)?1:0)}catch(ignored){}var useFilterMsg="";if(R9RsltCount==_filtered.length){useFilterMsg="<div class='useFiltersUpsell'>Too many pages? Use the <a href='javascript: jumpToTopOfFilters()'>filters</a> to instantly narrow down the list.</div>"}jq("#bottomPageControls").show();document.getElementById("bottomPageControls").innerHTML=getPageControls(null,4)+useFilterMsg;if(document.getElementById("showPhotosCB")!=null){jq("showPhotosCB").show();document.getElementById("showPhotosCB").innerHTML='<b>Show:</b>&nbsp;<input type="checkbox" id="showPhotos" onclick="togglePhotoDisplay(this.checked)" value="Y" '+((showPhotos)?'checked="checked"':"")+">photos"}}function setTop(i){document.getElementById("pagefirstrow").value=i;pgNums()}function computeFiltered(){_filtered=new Array();var k=0;var filterSmarts=new FilterFunctions();filterSmarts.setup();for(var j=0;j<_r.length;j++){var i=_r[j]._order;if(_r[i]._vs<0){continue}if(filterSmarts.includeRow(i)){_filtered[k++]=i}}if(document.getElementById("filtered_count")!=null){document.getElementById("filtered_count").innerHTML=_filtered.length}}function noop(){}function refilter(subfunc,resetPages,reason){showmessage(getUpdateMessage());addHistory();var func=subfunc;function doRefilter(){var start=new Date();clearPages();var nr=parseInt(document.resultsPaging.rowsper.value);if(resetPages==null||resetPages){setTop(0)}func();computeFiltered();if(nr>_numrows){fNumRows(nr)}if(_lastsort==null){updateTable(reason)}else{if(_lastdirection!=null){_lastdirection=!_lastdirection}sortresults(_lastsort,true)}window.setTimeout(hidemessage,250);_updatingResultsMessage=null;updateDisplayA_ds("filter");var end=new Date();addAdt("filtertime."+(end.getTime()-start.getTime()));if(typeof resetResultCount=="function"){resetResultCount()}}waitForResults(doRefilter)}function sortresults(sortfunc,skipHistory){var starttime=new Date();showmessage(getUpdateMessage("Sorting results..."));var func=sortfunc;function doSort(){var start=new Date();clearPages();setTop(0);func();var endtime=new Date();var extratime=messageBoxDelay-(endtime.getTime()-starttime.getTime());window.setTimeout(hidemessage,((extratime>0)?extratime:1));_updatingResultsMessage=null;var end=new Date();addAdt("sorttime."+(end.getTime()-start.getTime()));updateTable("sorting");updateDisplayA_ds("sort");var draw=new Date();if((skipHistory==null||!skipHistory)&&typeof addHistory=="function"){addHistory()}var afterHistory=new Date()}waitForResults(doSort)}var _maxprice=999999;function pricerange(){var i=document.resultUI.price_to.selectedIndex;_maxprice=document.resultUI.price_to[i].value}function openNewWindow(name,url,width,height){var args="title="+name+",width="+width+",height="+height+",location=no,menubar=no,resizable=yes,toolbar=no,status=no,scrollbars=yes";var newWin=window.open(url,"name",args);if(newWin==null){alert("Please make sure you are not blocking popups.")}else{newWin.focus()}}function openHotelDetail(url){openNewWindow("hoteldetail",url,650,600)}var _blankimg='&nbsp;<img src="/images/1x1_blank.gif" width="7" height="6" align="absmiddle" border="0">';var _sortup='&nbsp;<img src="/images/sort-up.gif" width="9" height="11" align="absmiddle"  border="0">';var _sortdown='&nbsp;<img src="/images/sort-down.gif" width="9" height="11" align="absmiddle"  border="0">';function sortImg(ascending){return(ascending?_sortup:_sortdown)}var _ps="results_price";var _ds="results_data";var _dsbk="results_book";var _dsm="results_dataMono";var _dsb="results_dataBold";function thdr(content,sort,width,align,span,style){var tag='<th class="results_headerNoSort'+((style)?" "+style:"")+'"';if(sort){tag='<th class="results_headerSort'+((style)?" "+style:"")+'"'}if(width){tag+=' width="'+width+'"'}if(align){tag+=' align="'+align+'"'}if(span){tag+=" colspan="+span}return tag+" nowrap>"+content+"</th>"}function tdata(content,style,width,align,span){var tag="<td";if(style){tag='<td class="'+style+'"'}if(width&&width!="-1"){tag+=' width="'+width+'"'}if(align){tag+=' align="'+align+'"'}if(span){tag+=" colspan="+span}return tag+">"+content+"</td>"}function nowrap(content,style,width,align,span){var tag="<td nowrap";if(style){tag+=' class="'+style+'"'}if(width){tag+=' width="'+width+'"'}if(align){tag+=' align="'+align+'"'}if(span){tag+=" colspan="+span}return tag+">"+content+"</td>"}function thead(content,span){if(span){return"<th colspan="+span+">"+content+"</th>"}else{return"<th>"+content+"</th>"}}function trow(stuff,classname){if(classname==null){return"<tr align='center'>"+stuff+"</tr>"}else{return"<tr align='center' class='"+classname+"'>"+stuff+"</tr>"}}function table(stuff,padding){var pad=0;if(padding){pad=padding}return"<table width='100%' border='0' cellpadding='"+pad+"' cellspacing='0'>"+stuff+"</table>"}function setHTML(document,id,content){if(id===null){id="headerspace"}try{document.getElementById(id).innerHTML=content}catch(e){window.status=exceptionMsg(e)}}function exceptionMsg(e){var smsg="Exception debug:"+(typeof e=="string")?e:((e.message)?e.message:"Unknown Error");return smsg}function beep(){}function displayDuration(duration){var mins=duration%60;if(mins<10){mins="0"+mins}var hrs=(duration-mins)/60;return replaceArgs("{0}h {1}m",hrs,mins)}function displayMoney(number,reround){return"$"+(reround=="no"?number:roundMoney(number))}function displayMoneyNoCurrency(number,reround){return(reround=="no"?number:roundMoney(number))}function roundMoney(number){return Math.floor(number+0.5)}var _showimg='<img src="/images/foldoutmenu_arrow_open.gif" width=15 height=14 align="absmiddle">';var _hideimg='<img src="/images/foldoutmenu_arrow.gif" width=15 height=14 align="absmiddle">';var hiddenDivs=new Array();function sethidden(id){hiddenDivs[id]=false}function toggleDiv(id){if(hiddenDivs[id]==false){return showDiv(id)}else{return hideDiv(id)}}function hideDiv(id){if(!_isIE){document.getElementById(id).style.height=2;document.getElementById(id).style.visibility="hidden"}else{document.getElementById(id).style.display="none"}setHTML(document,id+"arrow",_hideimg);return(hiddenDivs[id]=false)}function showDiv(id){if(!_isIE){document.getElementById(id).style.height="auto";document.getElementById(id).style.visibility="visible"}else{document.getElementById(id).style.display="inline"}setHTML(document,id+"arrow",_showimg);return(hiddenDivs[id]=true)}function getSelectByValue(what,value){for(var i=0;i<what.length;i++){if(what[i].value==value){return i}}return -1}function sizeForBrowser(){var rows=document.resultsPaging.rowsper.value;var width=screen.width;var height=screen.height;var j=document.resultsPaging.rowsper.selectedIndex;document.resultsPaging.rowsper[j].selected=false;j=0;if(width>=800&&height>=600){j++}if(width>1024&&height>768){j++}document.resultsPaging.rowsper[j].selected=true;rows=document.resultsPaging.rowsper.value;return rows}function showResultsMessage(htmlToSet){document.getElementById("resultmessage").innerHTML=htmlToSet}function hideResultsMessage(){document.getElementById("resultmessage").innerHTML=""}function dtl_cb(){this.onLoad=function(xmlobj){alert(xmlobj);if(xmlobj.xmlhttp.readyState==4){if(xmlobj.xmlhttp.status==200){if(xmlobj.getText().indexOf("bad")>=0){window.alert("Sorry, but your session has timed out. Please rerun your search if you wish to book.")}else{var dtlWin=window.open(xmlobj.uservars.dtlURL,"bookit");if(dtlWin){dtlWin.focus()}}}else{}}};this.onError=function(status,statusText){alert("Sorry, we could not retrieve details.  Please try again.  If this continues to happen, please try your search again or send feedback.")}}function dtl(sessionid,detailurl){var args=new Object();args.dtlURL=detailurl;var client=new R9HTTPXml();client.init(getProductVersionURI()+"/r9/affinity","action=session&anon=true&sid="+escape(sessionid),args);try{client.asyncGET(new dtl_cb())}catch(e){alert(e)}}function updateDisplayA_ds_cb(){this.onLoad=function(xmlobj){if(xmlobj.xmlhttp.readyState==4){if(xmlobj.xmlhttp.status==200){var results=xmlobj.getTags("results");if(results){try{var banner1=xmlobj.getTagText(results[0],"bannerad",0);var container1=document.getElementById("bannerad1");if(banner1&&container1){container1.innerHTML=banner1}var banner2=xmlobj.getTagText(results[0],"bannerad",1);var container2=document.getElementById("bannerad2");if(banner2&&container2){container2.innerHTML=banner2}var banner3=xmlobj.getTagText(results[0],"bannerad",2);var container3=document.getElementById("bannerad3");if(banner3&&container3){container3.innerHTML=banner3}}catch(e){alert(e)}}}}};this.onError=function(status,statusText){alert("Sorry, we could not retrieve details.  Please try again.  If this continues to happen, please try your search again or send feedback.")}}var lastclickid=null;var lastclickmsg="";function itemClicked(id,message,pcode){if(window.hidePriceSelections){hidePriceSelections()}_r[id]._vs=1;if(lastclickid!=null){_r[lastclickid]._vs=2}var newStyle=(document.getElementById("popupAfterBooking")!=null);if(!newStyle){if(_isIE){document.getElementById("msg"+id).style.display="block"}else{document.getElementById("msg"+id).style.display="table-row"}document.getElementById("resultmessage"+id).innerHTML=message;try{showprices(id,true)}catch(ignored){}}else{openbooking(null,message,pcode,id)}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"}}document.getElementById("tbd"+id).style.backgroundColor="#EEFFCC";lastclickmsg=message;lastclickid=id;addAdt("resultclick");return true}function openbooking(id,message,pcode,idx){var popupid=(id!=null)?id:"popupAfterBooking";var theDiv=document.getElementById(popupid);if(theDiv!=null){function closeBookingDialog(){closebooking(popupid)}toggleFaderPane(true,closeBookingDialog);theDiv.style.display="block";theDiv.style.top=(getScrollAmount()-0+150)+"px";if(message!=null){jq("#popupbookmessage").html(message);message="<span class='closearea'><a class='actionlink' href='javascript: closebooking()'>close</a> <img onclick='closebooking()' src='/images/close-x-white.gif' border='0' /></span>"+message;jq("#popupAfterBooking > tbody > tr > td.title").html(message).children("span.fnf").css("display","none")}jq("#fnflink > a").attr("href","javascript: flightnotfound("+idx+", '"+pcode+"')");if(typeof searchid!="undefined"){var tripslink="/s/addtotrip?searchid="+searchid+"&resultid="+_r[idx]._id+"&pcode="+pcode;jq("#addtotripslink").attr("href","javascript: addResultToTrip('"+tripslink+"')")}}}function closebooking(id){toggleFaderPane(false);var popupid=(id!=null)?id:"popupAfterBooking";var theDiv=document.getElementById(popupid);if(theDiv!=null){theDiv.style.display="none"}}function addResultToTrip(url){jq.getScript(url)}function hideSearchBox(){toggleFaderPane(false);document.getElementById("popupSearch").style.display="none"}function updateSearchFilter(cnt){var theDiv=document.getElementById("searchFilterTD");if(theDiv!=null){if(cnt==0){theDiv.className="noresults"}else{theDiv.className="results_box"}}}function hideMessageAboveResults(){jq("tr.results_message_tr").hide();jq("tr.results_message_tr_spacer").hide()}function showMessageAboveResults(html){try{jq("span.aboveresultmessagetext").html(html);jq("tr.results_message_tr").show();jq("tr.results_message_tr_spacer").show()}catch(ignored){}}var _lastEmailAttemptID=null;function emailresult(resultid,searchid,idx,bookingid){var height=585;var width=550;var titlebar=0;var params="?resultid="+resultid+"&searchid="+searchid;if(bookingid){params+="&bookingid="+bookingid}var winemail=window.open("/s/emailresult"+params,"emailresult","scrollbars,height="+(height+titlebar)+",width="+width+",menubar=no,toolbar=no,resizable");if(winemail!=null){if(idx>0){_lastEmailAttemptID=idx}winemail.focus()}}var _lastEmailAttemptID=null;function emailMessage(emailtype,subject,description,idx,addparams){var height=585;var width=550;var titlebar=0;var params="?emailtype="+escape(emailtype)+"&subject="+escape(subject)+"&message="+escape(description)+"&"+addparams;var winemail=window.open("/s/emailresult"+params,"emailresult","scrollbars,height="+(height+titlebar)+",width="+width+",menubar=no,toolbar=no,resizable");if(winemail!=null){if(idx!=null&&idx>0){_lastEmailAttemptID=idx}winemail.focus()}}function emailsuccess(){if(_lastEmailAttemptID!=null){try{itemClicked(_lastEmailAttemptID,"Result details emailed and saved to your search history.");_lastEmailAttemptID=null}catch(ignored){}}}function stripdotcom(str){var baseString=new String(str);while(baseString.length>6&&(baseString.length-baseString.lastIndexOf(".")<=4)){baseString=baseString.substring(0,baseString.indexOf("."))}if(baseString.toLowerCase()=="hotels"||baseString.toLowerCase()=="hotel"||baseString.toLowerCase()=="airfare"||baseString.toLowerCase()=="bedandbreakfast"||baseString.toLowerCase()=="booking"){return str}return baseString}var pinnedResultList=new Array();var displayPinnedItems=true;var _itemremove="<a class='padded' title='remove this result'  href=\"javascript:addAdt('remove');removeDisplay(";var justPinned=-1;function isPinned(idx){for(var i=0;i<pinnedResultList.length;i++){if(pinnedResultList[i].id==idx){return true}}return false}function getPinnedIDList(){var pinnedIDArray=new Array();for(var i=0;i<pinnedResultList.length;i++){pinnedIDArray.push(_r[pinnedResultList[i].id]._pid);if(_r[pinnedResultList[i].id]._pid!=_r[pinnedResultList[i].id]._id){pinnedIDArray.push(_r[pinnedResultList[i].id]._id)}}return pinnedIDArray.join(",")}function getPinnedItem(resultid){for(var i=0;i<pinnedResultList.length;i++){if(pinnedResultList[i].id==resultid){return pinnedResultList[i]}}return null}function storePinned(fieldlist){var client=new R9HTTPXml();if(!client.inprogress){client.init("/s/sparkle",fieldlist,null);try{client.asyncGET(null)}catch(ignored){}}}function addPinned(idx){pinnedResultList.push({id:idx});justPinned=idx;updateTable("pin_"+_r[idx]._id);justPinned=-1;try{document.getElementById("startsearchover").scrollIntoView(true)}catch(ignored){}var fields=getPinSaveFields(idx);fields+="&add=Y&action=pinneditem";storePinned(fields)}function removePinned(idx){for(var i=0;i<pinnedResultList.length;i++){if(pinnedResultList[i].id==idx){pinnedResultList.splice(i,1)}}if(document.getElementById("onlymapfavorites")!=null&&pinnedResultList.length==0){document.getElementById("onlymapfavorites").checked=false;onlyShowFavorites()}updateTable("unpin_"+_r[idx]._id);var fields=getPinSaveFields(idx);fields+="&add=N&action=pinneditem";storePinned(fields)}function removeDisplay(idx){_r[idx]._vs=-1;updateTable("remove_result")}function unpinAll(){while(pinnedResultList.length>0){var item=pinnedResultList.shift();var fields=getPinSaveFields(item.id);fields+="&add=N&action=pinneditem";storePinned(fields)}pinnedResultList=new Array();if(document.getElementById("onlymapfavorites")!=null){document.getElementById("onlymapfavorites").checked=false;onlyShowFavorites()}updateTable("unpin_all")}function togglePinned(doHide){displayPinnedItems=!displayPinnedItems;updateTable("display_pinned_"+displayPinnedItems)}function singleProvider(item){if(typeof document.resultUI.pvdflt!="undefined"){var singleprovider=getRadioValue(document.resultUI.pvdflt);if(singleprovider!=""){var pvdfound=false;for(var p=0;p<item._p.length;p++){if(item._p[p]._code==singleprovider){pvdfound=true;break}}if(!pvdfound){return false}}}return true}function togglesearchbox(forceclose){var row=document.getElementById("researchentry");var icon=document.getElementById("searchagainicon");if(row!=null&&icon!=null){if(row.style.display=="none"&&(forceclose==null)){if(typeof local_togglesearchbox=="function"){local_togglesearchbox()}showTableRow("researchentry");icon.src="/images/opencloseminus.gif"}else{hideTableRow("researchentry");icon.src="/images/opencloseplus.gif"}}}function setSortArrow(){if(_lastsortid!=null&&_lastsortid!=_currentsortid){setHTML(document,_lastsortid,"");jq("#hdr"+_lastsortid).removeClass("selected")}if(_currentsortid!=null){setHTML(document,_lastsortid=_currentsortid,sortImg(_lastdirection));jq("#hdr"+_lastsortid).addClass("selected")}}function setClickableSortArrow(clickHTML){if(_lastsortid!=null&&_lastsortid!=_currentsortid){setHTML(document,_lastsortid,"");jq("#hdr"+_lastsortid).removeClass("selected")}if(_currentsortid!=null){setHTML(document,_lastsortid=_currentsortid,clickHTML+sortImg(_lastdirection)+"</a>");jq("#hdr"+_lastsortid).addClass("selected")}}function getBorderColor(ispinned){return(ispinned&&!COLLABORATE.on)?"fc0":RESULT_BORDER_COLOR}function getTopOfResultsRow(colspan,colorcode,bgcolorcode,outerbgcolorcode){var sb=new StringBuilder();return getTopOfResultsRow_SB(sb,colspan,colorcode,bgcolorcode,outerbgcolorcode).toString()}function getTopOfResultsRow_SB(stringbuilder,colspan,colorcode,bgcolorcode,outerbgcolorcode){if(typeof colorcode=="undefined"){colorcode="ccc"}if(typeof bgcolorcode=="undefined"){bgcolorcode="fff"}if(typeof outerbgcolorcode=="undefined"){outerbgcolorcode="fff"}return stringbuilder.append("<tr class='bg").append(bgcolorcode).append("'><td class='bordercell'><img height='4' width='4' border='0' src='/images/corners/new/").append(outerbgcolorcode).append("-n-").append(colorcode).append("-tl.gif'></td><td class='bordercell' colspan='").append((colspan-2)).append("' style='background-image:url(/images/corners/new/n-").append(colorcode).append("-t.gif); background-repeat: repeat-x;'></td><td class='bordercell'><img border='0' height='4' width='4' src='/images/corners/new/").append(outerbgcolorcode).append("-n-").append(colorcode).append("-tr.gif'></td></tr>")}function getBottomOfResultsRow(colspan,colorcode,bgcolorcode,outerbgcolorcode){var sb=new StringBuilder();return getBottomOfResultsRow_SB(sb,colspan,colorcode,bgcolorcode,outerbgcolorcode).toString()}function getBottomOfResultsRow_SB(stringbuilder,colspan,colorcode,bgcolorcode,outerbgcolorcode){if(typeof colorcode=="undefined"){colorcode="ccc"}if(typeof bgcolorcode=="undefined"){bgcolorcode="fff"}if(typeof outerbgcolorcode=="undefined"){outerbgcolorcode="fff"}return stringbuilder.append("<tr class='bg").append(bgcolorcode).append("'><td class='bordercell'><img height='4' width='4' border='0' src='/images/corners/new/").append(outerbgcolorcode).append("-n-").append(colorcode).append("-bl.gif'></td><td class='bordercell' colspan='").append((colspan-2)).append("' style='background-image:url(/images/corners/new/n-").append(colorcode).append("-b.gif); background-repeat: repeat-x'></td><td class='bordercell'><img border='0' height='4' width='4' src='/images/corners/new/").append(outerbgcolorcode).append("-n-").append(colorcode).append("-br.gif'></td></tr>")}function getBottomOfResultsRowSquare(colspan,colorcode,bgcolorcode,outerbgcolorcode){var stringbuilder=new StringBuilder();if(typeof colorcode=="undefined"){colorcode="ccc"}if(typeof bgcolorcode=="undefined"){bgcolorcode="fff"}if(typeof outerbgcolorcode=="undefined"){outerbgcolorcode="fff"}return stringbuilder.append("<tr class='bg").append(bgcolorcode).append("'><td class='bordercell'><img height='4' width='4' border='0' src='/images/corners/new/").append(outerbgcolorcode).append("-n-").append(colorcode).append("-bls.gif'></td><td class='bordercell' colspan='").append((colspan-2)).append("' style='background-image:url(/images/corners/new/n-").append(colorcode).append("-b.gif); background-repeat: repeat-x'></td><td class='bordercell'><img border='0' height='4' width='4' src='/images/corners/new/").append(outerbgcolorcode).append("-n-").append(colorcode).append("-brs.gif'></td></tr>")}function getLeftOfResultsCell_SB(stringbuilder,colorcode,bgcolorcode){if(typeof colorcode=="undefined"){colorcode="ccc"}if(typeof bgcolorcode=="undefined"){bgcolorcode="fff"}return stringbuilder.append("<td class='repeaty' style='background-image:url(/images/corners/new/n-").append(colorcode).append("-l.gif)'></td>")}function getLeftOfResultsCell(colorcode,bgcolorcode){if(typeof colorcode=="undefined"){colorcode="ccc"}if(typeof bgcolorcode=="undefined"){bgcolorcode="fff"}return"<td class='repeaty' style='background-image:url(/images/corners/new/n-"+colorcode+"-l.gif)'></td>"}function getRightOfResultsCell_SB(stringbuilder,colorcode,bgcolorcode){if(typeof colorcode=="undefined"){colorcode="ccc"}if(typeof bgcolorcode=="undefined"){bgcolorcode="fff"}return stringbuilder.append("<td class='repeaty' style='background-image:url(/images/corners/new/n-").append(colorcode).append("-r.gif)'></td>")}function getRightOfResultsCell(colorcode,bgcolorcode){if(typeof colorcode=="undefined"){colorcode="ccc"}if(typeof bgcolorcode=="undefined"){bgcolorcode="fff"}return"<td class='repeaty' style='background-image:url(/images/corners/new/n-"+colorcode+"-r.gif)'></td>"}function filterSectionClick(sectionname,onlyopen,bgcolor){if(bgcolor==null){bgcolor="#eeeeee"}if(onlyopen==null){onlyopen=false}var contentelem=document.getElementById("fs_content_"+sectionname);if(contentelem==null){return}if(contentelem.style.display=="none"){jq("#fs_content_"+sectionname).slideDown();jq("#"+sectionname+"_fare").show();jq("#fs_outer_"+sectionname).css({"background-color":bgcolor});jq("#fs_arrow_"+sectionname).hide();jq("#fs_arrow_"+sectionname+"_open").show();jq("#fs_header_"+sectionname).addClass("filterSectionOpen")}else{if(!onlyopen){jq("#fs_content_"+sectionname).slideUp();jq("#"+sectionname+"_fare").hide();if(previousFilterTip==sectionname){clearToolTipColor(bgcolor);hideAllTT()}jq("#fs_arrow_"+sectionname+"_open").hide();jq("#fs_arrow_"+sectionname).show();jq("#fs_header_"+sectionname).removeClass("filterSectionOpen")}}}function filterSectionClickNeo(sectionname,onlyopen,bgcolor){if(bgcolor==null){bgcolor="#e4e4e4"}if(onlyopen==null){onlyopen=false}var contentelem=document.getElementById("fs_content_"+sectionname);var outerelem=document.getElementById("fs_outer_"+sectionname);var subtext=document.getElementById("fs_headertext_"+sectionname);var arrow=document.getElementById("fs_arrow_"+sectionname);if(contentelem==null){return}if(contentelem.style.display=="none"){contentelem.style.display="block";outerelem.style.backgroundColor=bgcolor;if(arrow!=null){arrow.src="/images/a-down-arrow.gif";arrow.style.display=""}}else{if(!onlyopen){contentelem.style.display="none";if(previousFilterTip==sectionname){clearToolTipColor(bgcolor);hideAllTT()}if(arrow!=null){arrow.src="/images/a-right-arrow.gif";arrow.style.display=""}}}}function setFilterSectionText(sectionname,newtext){var subtext=document.getElementById("fs_headertext_"+sectionname);if(subtext==null){return}subtext.innerHTML=newtext}function fsHeaderMOver(sectionname){var headerelem=document.getElementById("fs_outer_"+sectionname);var subtext=document.getElementById("fs_headertext_"+sectionname);if(headerelem==null){return}if(subtext.style.visibility=="hidden"){return}headerelem.style.backgroundColor="#ffffde"}function fsHeaderMOut(sectionname,color){if(color==null){color="#eee"}var headerelem=document.getElementById("fs_outer_"+sectionname);var subtext=document.getElementById("fs_headertext_"+sectionname);if(headerelem==null){return}if(subtext.style.visibility=="hidden"){return}headerelem.style.backgroundColor=color}function refreshResults(){window.location.reload()}var filterToolTips=null;var previousFilterTip=null;function localTTHidden(){clearToolTipColor();toggleFaderPane(false,null);jq("select").show()}function clearToolTipColor(bgcolor){if(bgcolor==null){bgcolor="#eeeeee"}if(previousFilterTip!=null){setFilterSectionColor([previousFilterTip],bgcolor)}}function setFilterSectionColor(sectionnameArray,color){return}function setFilterSectionColorObsolete(sectionnameArray,color){if(sectionnameArray!=null){for(var i=0;i<sectionnameArray.length;i++){try{var elem=document.getElementById("fs_outer_"+sectionnameArray[i]);elem.style.borderWidth="2px";elem.style.borderStyle="solid";elem.style.borderColor=color}catch(ignored){}}}}function showMainFilterToolTip(bgcolor){addAdt("luhy");showFilterToolTip(0,bgcolor)}function showFilterToolTip(idx,bgcolor){if(bgcolor==null){bgcolor="#eeeeee"}addAdt("ttip."+idx);if(filterToolTips==null){return}if(typeof idx=="undefined"){idx=0}var item=filterToolTips[idx];var outerelem;if(item.isfiltersection){outerelem=document.getElementById("fs_outer_"+item.sectionname)}else{outerelem=document.getElementById(item.sectionname)}if(outerelem==null){return}clearToolTipColor(bgcolor);if(item.isfiltersection&&typeof grow!="function"){previousFilterTip=item.sectionname;filterSectionClick(item.sectionname,true)}else{if(typeof grow=="function"){grow(outerelem)}}var maxtips=getFilterSectionTipCount();var priortip=getPriorFilterSectionTipIndex(idx);var _nexttip=getNextFilterSectionTipIndex(idx);var nexttip="<table class='filterTipsControls'><tr><td width='33%' align='left'><button "+((priortip<0)?"style='visibility: hidden'":"")+" onclick='showFilterToolTip("+(priortip)+")'>&laquo; Back</button></td><td width='33%' align='center'><a href='javascript: clearToolTipColor();hideAllTT()'><b>Close tips</b></a></td><td width='33%' align='right'><button "+((_nexttip>0)?"":"style='visibility: hidden'")+" onclick='showFilterToolTip("+_nexttip+")'>Next &raquo;</button></td></tr><tr><td>&nbsp;</td><td align='center'><div class='counter'>"+getFilterSectionTipIndex(idx)+" of "+maxtips+"</td><td></td></tr></table>";showTT(outerelem,document.getElementById(item.msgid).innerHTML+nexttip,item.position);if(item.isfiltersection&&item.sectionname!="flighttimes"){var sections=new Array();sections.push(item.sectionname);setFilterSectionColor(sections,"#ffffde")}try{if(typeof grow!="function"){if(item.position=="BL"){outerelem.scrollIntoView(false)}else{outerelem.scrollIntoView(true)}}}catch(ignored){}}function showFareChartTip(positionid){if(document.getElementById("no_chart_data_helptext")!=null&&document.getElementById(positionid)!=null){showTT(document.getElementById(positionid),document.getElementById("no_chart_data_helptext").innerHTML,"TL",null,true)}}function getFilterSectionTipIndex(idx){var result=0;for(var i=0;i<filterToolTips.length;i++){if(filterToolTips[i].isfiltersection&&i<=idx){result++}}return result}function getNextFilterSectionTipIndex(idx){var result=-1;for(var i=idx+1;i<filterToolTips.length;i++){if(filterToolTips[i].isfiltersection){result=i;break}}return result}function getPriorFilterSectionTipIndex(idx){var result=-1;for(var i=0;i<idx;i++){if(filterToolTips[i].isfiltersection){result=i}}return result}function getFilterSectionTipCount(){var result=0;for(var i=0;i<filterToolTips.length;i++){if(filterToolTips[i].isfiltersection){result++}}return result}function getFilterSectionsArray(){if(filterToolTips==null){return null}var returnArray=new Array();for(var i=0;i<filterToolTips.length;i++){if(filterToolTips[i].isfiltersection){returnArray.push(filterToolTips[i].sectionname)}}return returnArray}function showFilterUpsell(resultcount,productname){var msg=replaceArgs(RANDOM_UPSELL_MESSAGE,resultcount,'<a class="actionlink" href="javascript: showMainFilterToolTip()">',productname);window.setTimeout("_showFilterUpsell("+resultcount+",'"+productname+"')",100)}function _showFilterUpsell(resultcount,productname){var msg=replaceArgs(RANDOM_UPSELL_MESSAGE,resultcount,'<a class="actionlink" href="javascript: showMainFilterToolTip()">',productname);showMessageAboveResults(msg)}function updateInterimProviderList(){var src=document.getElementById("inlineProgressProviders");var dest=document.getElementById("displayProgressProviders");if(src!=null&&dest!=null){dest.innerHTML=src.innerHTML}}function getTopMessageRow(colspan,bordercolor,resultsbgcolor){if(resultsbgcolor==null){resultsbgcolor="fff"}return'<tr style="display: none" class="results_message_tr" align="left"><td id="aboveresultsmessagetd" style="padding-right:0px; padding-left:0px; background-color: #'+resultsbgcolor+';" colspan="'+colspan+'"><table class="roundedcorners" style="background-color: #ffffde" cellspacing="0" cellpadding="0">'+getTopOfResultsRow(1,bordercolor,null,resultsbgcolor)+"<tr>"+getLeftOfResultsCell(bordercolor)+'<td  width="100%"><span  class="aboveresultmessagetext">&nbsp;</span></td>'+getRightOfResultsCell(bordercolor)+"</tr>"+getBottomOfResultsRow(1,bordercolor,null,resultsbgcolor)+'</table></td></tr><tr style="display: none" class="results_message_tr_spacer" align="left"><td colspan="'+colspan+'" class="interimblankrow" style="padding: 0">&nbsp;</td></tr>'}function opacity(id,opacStart,opacEnd,millisec){var speed=Math.round(millisec/100);var timer=0;if(opacStart>opacEnd){for(i=opacStart;i>=opacEnd;i--){setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++}}else{if(opacStart<opacEnd){for(i=opacStart;i<=opacEnd;i++){setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++}}}}function changeOpac(opacity,id){var object=document.getElementById(id).style;object.opacity=(opacity/101);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.visibility="visible"}function mkCurrency(amt){return _LEFT_CURSYMBOL+amt+_RIGHT_CURSYMBOL}function compareToKayak(){var form=document.comparesites;var popupsOK=true;var codeArray=new Array();if(typeof form.comparetosite!="undefined"){if(typeof form.comparetosite.length=="undefined"){if(form.comparetosite.checked){codeArray.push({code:form.comparetosite.value,url:form[form.comparetosite.value+"_url"].value})}}else{var codeInputs=form.comparetosite;for(var i=0;i<codeInputs.length;i++){if(codeInputs[i].checked){codeArray.push({code:codeInputs[i].value,url:form[codeInputs[i].value+"_url"].value,group:codeInputs[i].className})}}}codeArray=chkCompareToGroups(codeArray);for(var j=0;j<codeArray.length;j++){popupsOK=(popupsOK&&singlewindow(j,codeArray[j].code,codeArray[j].url,codeArray.length))}window.focus()}if(!popupsOK){document.getElementById("innerTableTTTL").style.width="800px";popupBlockerMsg(null);window.focus()}}function singlewindow(num,code,url,total){var windowname=code;if(code.indexOf("_")>0){windowname=code.substring(0,code.indexOf("_"))}var sWidth=800;var sHeight=600;if(screen.availWidth){sWidth=screen.availWidth;sHeight=screen.availHeight}else{if(document.all){sWidth=window.screen.availWidth;sHeight=window.screen.availHeight}}var width=Math.min(800,Math.floor(sWidth/total-10));try{var args=replaceArgs("height={0},width={1},top={2},left={3},menubar=1,location=1,resizable=1,scrollbars=1,toolbar=1",sHeight,width,0,Math.floor(width*num+10*num));var mywin=window.open(url,windowname,args);mywin.focus()}catch(ignored){return false}return true}function popupBlockerMsg(form){try{jq("select").hide()}catch(ignored){}toggleFaderPane(true,null);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();try{jq("select").show()}catch(ignored){}}function makeResultsMessageArea(message,colspan,tbodyID,contentID,doDisplay,bgcolor,bordercolor,outerbgcolor){var innerRows=(colspan-2);var rowHTML=new Array();rowHTML[rowHTML.length]="<tbody id='"+tbodyID+"' style='background-color: "+bgcolor+"; "+(doDisplay?"":" display: none")+"'>"+getTopOfResultsRow(colspan,bordercolor,bgcolor,outerbgcolor);rowHTML[rowHTML.length]=getLeftOfResultsCell(bordercolor,outerbgcolor);rowHTML[rowHTML.length]="<td style='width:99%' id='"+contentID+"' colspan='"+innerRows+"'>"+message+"</td>";rowHTML[rowHTML.length]=getRightOfResultsCell(bordercolor,"fff");rowHTML[rowHTML.length]=getBottomOfResultsRow(colspan,bordercolor,bgcolor,outerbgcolor)+"</tbody>";rowHTML[rowHTML.length]='<tr id="'+tbodyID+'Spacer" style="'+(doDisplay?"":" display: none")+'"><td class="resultblankrow" colspan="'+colspan+'">&nbsp;</td></tr>';return rowHTML.join("")}function makeResultsMessageRow(message,colspan,contentID,bgcolor){var rowHTML=new Array();rowHTML[rowHTML.length]="<tr style='background-color:"+bgcolor+"'>";rowHTML[rowHTML.length]="<td style='width: 99%' id='"+contentID+"' colspan='"+colspan+"'>"+message+"</td>";rowHTML[rowHTML.length]="</tr>";return rowHTML.join("")}function makeTopOfResultsMessageArea(message,colspan,tbodyID,contentID,doDisplay,bgcolor,bordercolor,outerbgcolor){var innerSpan=(colspan-2);var rowHTML=new Array();rowHTML[rowHTML.length]="<tr class='topControls' id='"+tbodyID+"' style='"+(doDisplay?"":" display: none;")+"'>";rowHTML[rowHTML.length]=getLeftOfResultsCell(bordercolor,outerbgcolor);rowHTML[rowHTML.length]="<td id='"+contentID+"' colspan='"+innerSpan+"' >";rowHTML[rowHTML.length]="<div "+(doDisplay?"":"style='display:none' ")+">";rowHTML[rowHTML.length]=message;rowHTML[rowHTML.length]="</div>";rowHTML[rowHTML.length]="</td>";rowHTML[rowHTML.length]=getRightOfResultsCell(bordercolor,"fff");rowHTML[rowHTML.length]="</tr>";return rowHTML.join("")}function makeResultsMessageTableData(message,colspan,contentID,bgcolor){var rowHTML=new Array();rowHTML[rowHTML.length]="<td style='width: 99%' id='"+contentID+"' colspan='"+colspan+"'>"+message+"</td>";return rowHTML.join("")}function makeResultsMessageTableDataSlide(message,colspan,contentID,bgcolor){var rowHTML=new Array();rowHTML[rowHTML.length]="<td style='height:1px;' id='"+contentID+"' colspan='"+colspan+"'>";rowHTML[rowHTML.length]="<div style='display:none' class='slidedown' >";rowHTML[rowHTML.length]=message;rowHTML[rowHTML.length]="</div>";rowHTML[rowHTML.length]="</td>";return rowHTML.join("")}function priceExistsInShown(price){for(var i=0;i<_filtered.length;i++){if(isPinned(_filtered[i])){continue}if(_r[_filtered[i]]._p.length>0&&Math.round(_r[_filtered[i]]._p[0]._price)<=Math.round(price)){return true}}return false}function undoFilterMatchCriteria(){if(filterMatchCriteriaUndo!=null){eval(filterMatchCriteriaUndo);filterMatchCriteriaUndo=null}}function checkFilterPriceMatch(){if(filterMatchCriteriaPrice!=null){var displaying=priceExistsInShown(filterMatchCriteriaPrice);if(!displaying){undoFilterMatchCriteria();window.setTimeout('showMessageAboveResults("<span>'+getFiltersUndoneMessage(filterMatchCriteriaPrice)+'</span>")',3000);filterMatchCriteriaPrice=null;return false}}return true}function getCurrencyPriceLength(price,currencyChars){var priceStr=""+price;return(priceStr.length+currencyChars)}function getBookingPriceClass(price,currencyChars){var digits=getCurrencyPriceLength(price,currencyChars);if(digits>8){return"bookitlongestprice"}else{if(digits>5){return"bookitlongprice"}}return"bookitprice"}function isNumeric(vTestValue){var sField=""+vTestValue;if(sField.length==0){return false}else{if(sField.length==1&&(sField.charAt(0)=="."||sField.charAt(0)==","||(sField.charAt(0)=="-"))){return false}}for(var x=0;x<sField.length;x++){if((sField.charAt(x)>="0"&&sField.charAt(x)<="9")||sField.charAt(x)=="."||sField.charAt(x)==","||(sField.charAt(x)=="-"&&x==0)){}else{return false}}return true}function hideLinkCopy(){return toggleLinkCopy(false)}function toggleLinkCopy(show){if(show){toggleFaderPane(true,hideLinkCopy);var offset=jq("#linktopage").offset();var left=offset.left+jq("#linktopage").width()-jq("#linkcopyform").width();jq("#linkcopyform").css("left",left+"px");jq("#linkcopyform").show();jq("iframe").css("visibility","hidden");document.getElementById("linktosearch").value=document.getElementById("linktosearch").defaultValue;document.getElementById("linktosearch").select()}else{jq("iframe").css("visibility","visible");toggleFaderPane(false,null);jq("#linkcopyform").hide()}}function getLeaveBehindFilterCell(sectionName,undoJS){var _isIE=(((navigator.appVersion).indexOf("MSIE 6.")>-1)?true:false);var iconhtml=new Array();iconhtml[iconhtml.length]="<table cellspacing='0' cellpadding='0'  class='leaveBehindItem"+((_isIE)?" leaveBehindIE":"")+"'><tr>";iconhtml[iconhtml.length]="<td class='leftside'><img src='/images/1x1_blank.gif' width='5' /></td><td nowrap='nowrap' class='content'>";iconhtml[iconhtml.length]="<a href='javascript: "+undoJS+'; addAdt("leavebehind.'+sectionName+"\");'>"+sectionName+" <img border='0' src='/v287/images/close-x-77c.gif'/></a>";iconhtml[iconhtml.length]="</td><td class='rightside'><img src='/images/1x1_blank.gif' width='5' /></td></tr></table>";return iconhtml.join("")}function getLeaveBehindFilterReasons(){var content=new Array();var actionMap=new Object();var filterReasons=getFilteredOutReasons().reasons;for(var i=0;i<filterReasons.length;i++){var reason=filterReasons[i];if(actionMap[reason.heading]==null){if(i==0){content[content.length]="<table class='leaveBehind'><tr><td class='title' valign='top'>Filters Applied:</td><td valign='top'>"}content[content.length]=getLeaveBehindFilterCell(reason.heading,reason.action)+" ";actionMap[reason.heading]=true}}if(content.length>0){content[content.length]="</td></tr></table>";return content.join("")}return null}function collaborateStart(searchid){var mydata="action=shareresults&searchid="+searchid;jq.ajax({type:"POST",url:"/s/collabajax",data:mydata,dataType:"html",success:function(html){try{showTT(document.getElementById("shareresultstd"),"","DL");jq("#ttipDL").html(html)}catch(ignored){}},error:function(request,textStatus,error){alert(textStatus)},cache:false})}function setSliderToMinMax(selector,thumbCount){if(thumbCount==2){if(jQuery(selector).slider("values",0)!=jQuery(selector).slider("option","min")){jQuery(selector).slider("values",0,jQuery(selector).slider("option","min"))}if(jQuery(selector).slider("values",1)!=jQuery(selector).slider("option","max")){jQuery(selector).slider("values",1,jQuery(selector).slider("option","max"))}}if(thumbCount==1){if(jQuery(selector).slider("value")!=jQuery(selector).slider("option","max")){jQuery(selector).slider("value",jQuery(selector).slider("option","max"))}}}function captureState(){if(_ALLRESULTSLOADED){document.resultUI.lastfilteredlist.value=_filtered.join("|")}}function restoreStateFromObj(statevar){if(typeof statevar.flist!="undefined"){_filtered=document.resultUI.lastfilteredlist.value.split("|");if(document.resultUI.lastpagenum.value!=""){_currentPageNum=document.resultUI.lastpagenum.value}var newsortid="";if(typeof statevar.sortid!="undefined"){newsortid=statevar.sortid}updateTable();if(newsortid!=""){_currentsortid=newsortid;setSortArrow()}if(typeof restoreStateProduct=="function"){restoreStateProduct()}}}if(typeof jQuery.history!="undefined"){jQuery.history.callback=function(reinstate,cursor){if(typeof(reinstate)!="undefined"){restoreStateFromObj(reinstate)}}}function addHistory(){if(_ALLRESULTSLOADED&&typeof jQuery.history!="undefined"){var filterlist=_filtered.join("|");var state={type:"page",pagenum:_currentPageNum,sortdirection:_lastdirection,sortid:_lastsortid,flist:filterlist};jQuery.history(state)}}function fireTimer(obj){var myObj=obj;function timerFired(){if(myObj.inprogress){myObj._abortRequest(myObj)}}myObj._timeoutID=window.setTimeout(timerFired,myObj.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(url,postbuffer,args){this.url=url;this.uservars=args;this.postbuffer=postbuffer;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(timeInMillisec){this.timeoutMS=timeInMillisec},asyncGET:function(client){if(this.inprogress){throw"Call in progress"}var self=this;if(client==null){client=self}this.thecallback=client;var args=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");args=this.postbuffer}this.xmlhttp.onreadystatechange=function(){self.stateChangeCallback(self)};this.inprogress=true;this.cancelled=false;this.xmlhttp.send(args);if(this.timeoutMS>0){fireTimer(this)}},stateChangeCallback:function(client){switch(client.xmlhttp.readyState){case 1:try{if(!client.cancelled){client.thecallback.onInit()}}catch(e){}break;case 2:try{if(client.xmlhttp.status!=200&&client.xmlhttp.status!=0){if(!client.cancelled){window.status="error";client.thecallback.onError(client.xmlhttp.status,client.xmlhttp.statusText,client)}client.xmlhttp.abort();client.inprogress=false}}catch(e){}break;case 3:var contentLength;try{try{contentLength=client.xmlhttp.getResponseHeader("Content-Length")}catch(e){contentLength=NaN}if(!client.cancelled){window.status="ping";client.thecallback.onProgress(client.xmlhttp.responseText,contentLength)}}catch(e){}break;case 4:try{if(client._timeoutID){window.clearTimeout(client._timeoutID);client._timeoutID=null}if(client.inprogress){client.inprogress=false;if(!client.cancelled){window.status="done";client.thecallback.onLoad(client)}}}catch(e){}finally{client.inprogress=false}break}},cancelRequest:function(){var gizmo=this;this.cancelled=true;if(this._timeoutID){window.clearTimeout(this._timeoutID);this._timeoutID=null}gizmo._abortRequest(gizmo)},_abortRequest:function(gizmo){if(gizmo.xmlhttp!=null){try{gizmo.xmlhttp.abort();if(gizmo.inprogress){window.status="abort";gizmo.thecallback.onError("timeout","Your request has timed out.",gizmo)}}catch(e){}gizmo.cancelled=true;gizmo.inprogress=false}},getText:function(){return this.xmlhttp.responseText},getXML:function(){return this.xmlhttp.responseXML},getTags:function(tagname){try{return this.xmlhttp.responseXML.getElementsByTagName(tagname)}catch(e){return null}},getOperaText:function(parent,item,index){try{var result=parent.getElementsByTagName(item)[index];if(result){var returnText="",i=0,node;while(node=result.childNodes[i]){returnText+=node.nodeValue;i++}return returnText}else{return""}}catch(e){opera.postError("exception: "+e)}},getOpera:function(parent,item,index){return"foo"},getTagText:function(parent,item,index){var result=parent.getElementsByTagName(item)[index];if(result){if(result.childNodes.length>1){return result.childNodes[1].nodeValue}else{if(result.childNodes.length==1){return result.firstChild.nodeValue}}}else{return""}},onProgress:function(t,l){},onError:function(s,t,c){},onLoad:function(c){},onInit:function(c){}};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(e){var pK=document.all?window.event.keyCode:e.which;var pK2=String.fromCharCode(pK).toLowerCase();lastKey=pK;if(who!=null){who(pK,pK2)}}function keysInit(callback){document.onkeydown=keyDown;who=callback;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=3;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(where,wherecode,searchtype,timeout,minwidth,valuesetcb,smarturl,forcesel,extraargs,forcesingle){_inputcode=_input=null;if(forcesel!=null){_forceSelection=forcesel}else{_forceSelection=true}if(forcesingle!=null){_forceSingle=forcesingle}else{_forceSingle=false}if(smarturl){_kayakSmartUrl=smarturl}else{_kayakSmartUrl="/m/smarty?"}if(extraargs){_sbextraargs=extraargs}else{_sbextraargs=""}cancelSmartBox();var body=document.getElementsByTagName("body")[0];_target=document.getElementById("smartbox");if(!_target){_target=document.createElement("div");_target.id="smartbox";_target.style.zIndex=51;_target.style.position="absolute";_target.style.display="none";_target.style.width="auto";body.appendChild(_target)}_target.className=searchtype+"smartboxResults";_targetBG=document.getElementById("smartboxBG");if(!_targetBG){_targetBG=document.createElement("iframe");_targetBG.id="smartboxBG";_targetBG.style.zIndex=50;_targetBG.setAttribute("scrolling","no");_targetBG.setAttribute("frameborder","0");_targetBG.style.position="absolute";_targetBG.style.display="none";body.appendChild(_targetBG)}if(isNaN(parseInt(minwidth))){_sboxminwidth=-1}else{_sboxminwidth=parseInt(minwidth)}keysInit(keypressed);_input=where;_inputcode=wherecode;_searchtype=searchtype;_lastsent="";_timeout=timeout;_clientsbcb=valuesetcb;var x=findPosX(where);var y=findPosY(where)+where.offsetHeight+1;_target.style.top=y+"px";_target.style.left=x+"px";if(_idletimer){clearTimeout(_idletimer);_idletimer=""}_toolong=false;_lastsent="";_cursel=-1;_prevsel=-1;_stop=false}function _runSearch(input){if(sbHttp==null){sbHttp=new R9HTTPXml()}if(!sbHttp.inprogress){if(_lastsent==_input.value||_input.value.length<_chars){return}window.status="searching...";_lastsent=_input.value;var buffer="where="+encodeURIComponent(_lastsent);var sbHttp=new R9HTTPXml();buffer+="&lc=en&lc_cc=US";if(_searchtype=="air"){buffer+="&s=1"}else{if(_searchtype=="car"){buffer+="&s=2"}else{if(_searchtype=="hotel"){buffer+="&s=3"}else{if(_searchtype=="any"){buffer+="&s=4"}else{if(_searchtype=="crc"){buffer+="&s=5"}else{if(_searchtype=="crcg"){buffer+="&s=6"}else{if(_searchtype=="deal"){buffer+="&s=7"}else{if(_searchtype=="crcga"){buffer+="&s=8"}else{if(_searchtype=="hotelname"){buffer+="&s=11"}else{buffer+="&s="+_searchtype}}}}}}}}}if(_sbcountrycode!=null&&_sbcountrycode.length>0){buffer+="&cc="+_sbcountrycode}buffer+="&f=h";buffer+=_sbextraargs;sbHttp.init(_kayakSmartUrl,buffer);try{sbHttp.setTimeout(10000);sbHttp.asyncGET(new _Callback(input))}catch(e){alert(e)}}else{alert("busy")}}function setSbCountryCode(code){_sbcountrycode=code}function clearSbCountryCode(){_sbcountrycode=null}function getSbIndex(elem){var list=_getSmartboxList();var retIndex=0;if(list&&list.childNodes){for(var i=0;i<list.childNodes.length;i++){var item=list.childNodes[i];if(elem==item){retIndex=i;break}var itemChildMatch=false;for(var j=0;j<item.childNodes.length;j++){if(elem==item.childNodes[j]){retIndex=i;itemChildMatch=true;break}}if(itemChildMatch){break}}}return retIndex}function _sbMouseOut(event){var obj=event?event.target:this;_cursel=-1;selChoice(-1)}function _sbMouseDown(event){var obj=event?event.target:this;_cursel=getSbIndex(obj);_setValue(_cursel);closeSmartBox()}function _sbMouseOver(event){var obj=event?event.target:this;_cursel=getSbIndex(obj);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 ul;if(_target.childNodes){for(var i=0;i<_target.childNodes.length;i++){var node=_target.childNodes[i];if(node.nodeName=="UL"){ul=node;break}}}return ul}function _Callback(input){this.onError=function(status,statusText){};this.onLoad=function done(client){window.status="";if(!client.cancelled&&(_input==input)){_target.innerHTML=client.getText();var list=_getSmartboxList();if(list&&list.childNodes){_itemCount=list.childNodes.length}else{_itemCount=0}if(_itemCount>0){for(var i=0;i<list.childNodes.length;i++){li=list.childNodes[i];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)}}}function _setValue(newi){if(newi<0){_lastsent="";try{var codechg=(_inputcode.value!="");_inputcode.value="";if(codechg){_clientsbcb(null)}}catch(e){}}else{if(_itemCount>0){var list=_getSmartboxList();if(list==null||list.childNodes==null){return}var selected=list.childNodes[newi];var fields=selected.id.split("-");var id;if(fields.length>1){id=fields[1]}_inputcode.value=id;if(selected.innerText!=undefined){_input.value=selected.innerText}else{_input.value=selected.textContent}try{if(typeof _clientsbcb=="function"){var cbData=new Object();cbData.str=selected.innerHTML;cbData.type=fields[0];cbData.id=id;if(fields.length>2){cbData.hc=fields[2]}if(fields.length>3){if(cbData.type=="hotel"){cbData.hid=fields[3]}else{cbData.lmid=fields[3]}}_clientsbcb(cbData)}}catch(ignored){}}}}function selChoice(newi){var list=_getSmartboxList();if(list&&list.childNodes&&list.childNodes.length>0){if(_prevsel>=0){var prev=list.childNodes[_prevsel];if(prev.className){prev.className=prev.className.replace(/ *smartboxItemHi/,"")}else{prev.className=""}}if(newi>=0){if(list.childNodes.length>0){var cur=list.childNodes[newi];cur.className=cur.className+" smartboxItemHi"}_prevsel=newi}}}var _pressed=0;function keypressed(keycode,keyvalue){clearTimeout(_idletimer);_pressed=new Date().getTime();switch(keycode){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 v=(_stop==null||_stop!=true);_stop=false;return(v?true:noEnter())}function idle(input){if(noEnter()){_input.focus();var now=new Date().getTime();if(now-_pressed>_timeout){clearTimeout(_idletimer);_typer(_input)}else{clearTimeout(_idletimer);_idletimer=self.setTimeout("idle()",_timeout)}}}function _typer(input){if((_input!=null)&&_input.value.length>0){abortSmartBox();_runSearch(input)}else{_setValue(-1);closeSmartBox()}}function _sbShowBGIframe(){return(window.opera)?false:true}jq=jQuery.noConflict();var R9CalDayOfWeek=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var R9CalDaysInMonth=[31,0,31,30,31,30,31,31,30,31,30,31];var R9CalMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var R9CalMonthRecords=[];function R9Cal_getDaysInMonth(m,y){if(m==2){return(y%4==0)?29:28}return R9CalDaysInMonth[m-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 supportsInnerText(){var e=document.createElement("p");return(e.innerText!=undefined)}var settext;if(supportsInnerText()){settext=function(node,text){node.innerText=text}}else{settext=function(node,text){node.textContent=text}}function mknode(tag,text,className){var node=document.createElement(tag);if(text){settext(node,text)}if(className){node.className=className}return node}function child(parent,tag,text,className){var node=document.createElement(tag);if(text){settext(node,text)}if(className){node.className=className}parent.appendChild(node);return node}function app(parent,node){parent.appendChild(node)}R9Cal.prototype.isOldDate=function(month,day,year){if(year<this.thisYear){return true}if(year==this.thisYear){if(month<this.thisMonth){return true}if(month==this.thisMonth){return day<this.thisDay}}return false};R9Cal.prototype.drawMonth=function(parent,monthRecord){var offset=monthRecord.firstOffset;for(var r=0;r<6;++r){var classes=r==5?"week lastWeek":"week";if(jq.browser.mozilla){classes+=" firefoxWeek"}else{if(jq.browser.msie&&jq.browser.version.substr(0,1)=="8"){classes+=" ie8Week"}}var week=mknode("div",null,classes);for(var c=0;c<7;++c){var dom,p,cls;if(offset<=0){dom=monthRecord.lastMonEnd+offset;cls="prevMon"}else{if(offset>monthRecord.thisMonEnd){dom=offset-monthRecord.thisMonEnd;cls="nextMon"}else{dom=offset;cls=null}}if(!this.allowPast&&this.isOldDate(monthRecord.month,dom,monthRecord.year)){cls="oldDate"}child(week,"p",dom,cls);++offset}app(parent,week)}};R9Cal.prototype.setupMonth=function(parent,firstOffset,lastMonEnd,thisMonEnd,month,year,isValid){var record={firstOffset:firstOffset,lastMonEnd:lastMonEnd,thisMonEnd:thisMonEnd,month:month,year:year,isValid:isValid,isDrawn:false};R9CalMonthRecords.push(record);var offset=firstOffset+6*7;this.dayOffset=(offset-thisMonEnd-1)%7-6;this.lastDay=thisMonEnd};R9Cal.prototype.makeDowHeader=function(){var dow=mknode("div",null,"dayHeader");jq.each(R9CalDayOfWeek,function(){app(dow,mknode("p",this.charAt(0)))});return dow};R9Cal.prototype.drawControls=function(parent,singleMonth){var controls=document.createElement("div");controls.className="calControls";if(singleMonth){controls.className+=" singleMonthCalControls"}var left=document.createElement("a");left.id="gotoPrev";left.href="#";jq(left).html("&laquo;");var right=document.createElement("a");right.id="gotoNext";right.href="#";jq(right).html("&raquo;");var close=document.createElement("a");close.id="closeCal";close.href="#";jq(close).html("&times;");controls.appendChild(left);controls.appendChild(close);controls.appendChild(right);parent.appendChild(controls)};R9Cal.prototype.drawMonths=function(parent,placeholder,singleMonth,startYear,endYear,allowPast){if(singleMonth==null){singleMonth=false}if(allowPast==null){allowPast=false}var dt=new Date();this.thisYear=dt.getFullYear();this.thisMonth=dt.getMonth()+1;this.thisDay=dt.getDate();this.firstYear=startYear;this.lastYear=endYear;this.totalMonths=(endYear-startYear+1)*12;this.monthShown=-100;this.allowPast=allowPast;if(allowPast==null||!allowPast){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=placeholder.id;this.drawControls(parent,singleMonth);var dowHeader=this.makeDowHeader();var div=mknode("div",null);div.id=placeholder.id;div.className="months";var first=true;var monthNum=0;for(var year=startYear;year<=endYear;++year){for(var mon=0;mon<12;++mon){var container=mknode("div",null,"month");var dtid=(mon+1)+"/"+year;var dttxt=R9CalMonthNames[mon]+" "+year;container.id=dtid;var days=R9CalDaysInMonth[mon];if(mon==1){days=(year%4==0)?29:28}var header=child(container,"div",null,"calhead");child(header,"p",dttxt,"monthHeader");app(header,jq(dowHeader).clone().get(0));var inRange=monthNum>=this.firstMonthAllowed&&monthNum<=this.lastMonthAllowed;if(first){var d=new Date();d.setFullYear(year,0,1);var offset=1-d.getDay();offset+=1-1;this.setupMonth(container,offset,31,days,mon+1,year,inRange);first=false}else{this.setupMonth(container,this.dayOffset,this.lastDay,days,mon+1,year,inRange)}app(div,container);++monthNum}}parent.replaceChild(div,placeholder)};R9Cal.prototype.isIgnoredDate=function(elem){var e=jq(elem);return e.is(".nextMon")||e.is(".prevMon")||e.is(".oldDate")};R9Cal.prototype.getDate=function(elem){var e=jq(elem);if(e.is("p")&&!this.isIgnoredDate(elem)){var week=e.parent();if(week.is(".week")){var mon=week.parent();if(mon.is(".month")){var fields=mon.attr("id").split("/");return{day:jq(elem).text(),month:fields[0],year:fields[1]}}}}return null};R9Cal.prototype.getMonthNum=function(month,year){if(year>=this.firstYear&&year<=this.lastYear){return(year-this.firstYear)*12+month-1}return -1};R9Cal.prototype.gotoMonth=function(month,year){this.gotoMonthNum(this.getMonthNum(month,year),false)};R9Cal.prototype.withDateElement=function(month,day,year,fn){var off=this.getMonthNum(month,year);if(off>=0&&day>=1){var mon=jq("div.month","#"+this.monthsDomID).eq(off);var self=this;var p=mon.find("p").filter(function(){return jq(this).text()==day&&!self.isIgnoredDate(this)});fn(p)}};R9Cal.prototype.highlightDate=function(dt,cls,month,day,year){this.withDateElement(dt.month,dt.day,dt.year,function(elem){elem.removeClass(cls)});this.withDateElement(month,day,year,function(elem){elem.addClass(cls)});dt.month=month;dt.day=day;dt.year=year};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(n){var record=R9CalMonthRecords[n];if(!record.isDrawn){var mon=jq("div.month","#"+this.monthsDomID).eq(n).get(0);this.drawMonth(mon,record);record.isDrawn=true}};R9Cal.prototype.gotoMonthNum=function(n,alwaysMove){if(n>=this.firstMonthAllowed&&n<=this.lastMonthAllowed){if(!alwaysMove&&this.monthShown==n-1){n=this.monthShown}if(n==this.lastMonthAllowed){--n}if(n!=this.monthShown){this.monthShown=n;this.drawOnDemand(n);this.drawOnDemand(n+1);if(!this.monthWidth){var mon=jq("div.month","#"+this.monthsDomID).get(0);this.monthWidth=mon.offsetWidth}jq("#"+this.monthsDomID).css("left",(-(this.monthWidth)*n)+"px")}}}})();var R9DatePickerNowShowing=null;function R9DatePicker(popup,iconID,dayID,dowID){this.popup=popup;this.dayID=dayID;this.dowID=dowID;this.calID=popup.frameid;this.iconID=iconID;this.onDateChanged=function(mon,day,year){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(fn){var frame=window.frames[this.calID];if(frame&&frame.cal){fn(frame.cal)}};R9DatePicker.prototype.frameDoc=function(){return window.frames[this.calID].document};R9DatePicker.prototype.setCalendarFocused=function(f){this.calendarFocused=f;if(f){this.domFocused=false}};R9DatePicker.prototype.setDayOfMonthFocused=function(f){this.domFocused=f;if(f){this.calendarFocused=false}};R9DatePicker.prototype.scheduleFocusCheck=function(){var self=this;var doHide=function(){if(R9DatePickerNowShowing==self.dayID&&!self.domFocused&&!self.calendarFocused){self.updateFromControls();if(self.isVisible()){self.toggle(jq("#"+self.iconID).get(0))}}};this.focusTimeout=window.setTimeout(doHide,250)};function R9DatePicker_zeroPad(n){return n<10?"0"+n:n}R9DatePicker.prototype.setEvents=function(){var picker=this;var f=window.frames[this.calID];var cal=f.cal;f.onDatePicked=function(dt){picker.popup.hide(false,function(){picker.setDate(dt.month,dt.day,dt.year);picker.onDateChanged(dt.month,dt.day,dt.year)})};f.onNextMonth=function(){cal.showNextMonth()};f.onPrevMonth=function(){cal.showPreviousMonth()};f.onCloseCal=function(){picker.popup.hide()};f.onCalendarFocus=function(){picker.setCalendarFocused(true)}};R9DatePicker.prototype.humanReadable=function(month,day,year){return R9DatePicker_zeroPad(month)+"/"+R9DatePicker_zeroPad(day)+"/"+year};R9DatePicker.prototype.parseHumanReadable=function(txt){var monthIdx;var dayIdx;monthIdx=1;dayIdx=2;var match=/\s*(\d+)[^0-9](\d+)([^0-9](\d+))?\s*/.exec(txt);var dt=null;if(match){var year=match[4]?parseInt(match[4],10):-1;dt={month:parseInt(match[monthIdx],10),day:parseInt(match[dayIdx],10),year:year}}else{return null}if(dt.year<0){var now=new Date();dt.year=(dt.month<(now.getMonth()+1))?now.getFullYear()+1:now.getFullYear()}if(dt.year<21){dt.year+=2000}if(dt.year<2000||dt.year>2020||dt.month<1||dt.month>12||dt.day<1||dt.day>31){return null}var inMonth=R9Cal_getDaysInMonth(dt.month,dt.year);if(dt.day>inMonth){return null}var validMonth=true;this.withCal(function(cal){var monNum=cal.getMonthNum(dt.month,dt.year);validMonth=monNum>=cal.firstMonthAllowed&&monNum<=cal.lastMonthAllowed});if(!validMonth){return null}return dt};R9DatePicker.prototype.setInputField=function(month,day,year){jq("#"+this.dayID).val((day&&day>0)?this.humanReadable(month,day,year):"")};R9DatePicker.prototype.setDate=function(month,day,year){day=typeof(day)=="string"?(day.length==0?-1:parseInt(day,10)):day;month=typeof(month)=="string"?parseInt(month,10):month;year=typeof(year)=="string"?parseInt(year,10):year;this.setInputField(month,day,year);this.month=month;this.day=day||-1;this.year=year;this.dateHasChanged()};R9DatePicker.prototype.setFromCanonical=function(mmddyyyy){var fields=mmddyyyy.split("/");this.setDate(fields[0],fields[1],fields[2])};R9DatePicker.prototype.setMonthYearFromCanonical=function(mmddyyyy){var fields=mmddyyyy.split("/");this.setDate(fields[0],null,fields[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(forceRedisplay,ignoreHighDays){var oldday=this.day,oldmonth=this.month,oldyear=this.year;var txt=jq("#"+this.dayID).val();var mdy=this.parseHumanReadable(txt);if(mdy){this.month=mdy.month;this.day=mdy.day;this.year=mdy.year}else{this.day=-1}if(oldday!=this.day||oldyear!=this.year||oldmonth!=this.month||forceRedisplay){this.dateHasChanged()}};R9DatePicker.prototype.dateHasChanged=function(){var self=this;this.withCal(function(cal){cal.gotoMonth(self.month,self.year);cal.highlightDate(cal.highlighted,"highlighted",self.month,self.day,self.year)});var dt=this.valueAsDate();if(dt){var adjusted=(dt.getDay()-(1-1));if(adjusted<0){adjusted+=7}var dow=R9CalDayOfWeek[adjusted];var mon=R9CalMonthNames[this.month-1];var txt;txt=dow+", "+mon+" "+this.day+" "+this.year;jq("#"+this.dowID).text(txt)}else{jq("#"+this.dowID).text("mm/dd/yyyy")}};R9DatePicker.prototype.fields=function(){this.sync(false,true);return this};R9DatePicker.prototype.valueAsDate=function(defaultDay){var f=this.fields();if(f.day>0||defaultDay){var dt=new Date();dt.setDate(1);dt.setFullYear(f.year);dt.setMonth(f.month-1);dt.setDate(f.day>0?f.day:defaultDay);return dt}return null};R9DatePicker.prototype.markDate=function(fields){this.withCal(function(cal){cal.highlightDate(cal.marked,"marked",fields.month,fields.day,fields.year)})};R9DatePicker.prototype.clearMarkedDate=function(){this.withCal(function(cal){cal.highlightDate(cal.marked,"marked",0,0,0)})};R9DatePicker.prototype.toggle=function(target){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(target)};R9DatePicker.prototype.setInterval=function(){var self=this;this.intervalID=window.setInterval(function(){self.sync(false,true)},750)};R9DatePicker.prototype.clearInterval=function(){if(this.intervalID!=-1){window.clearInterval(this.intervalID);this.intervalID=-1}};R9DatePicker.prototype.isVisible=function(target){return this.popup.isVisible()};var whenFrameLoadedHook=function(){};function onCalendarLoaded(win,cal){whenFrameLoadedHook()}R9CalPopup=function(id,singleMonth,allowPast){this.posCache={};this.controllingIcon=null;this.controllingInput=null;this.isHiding=false;var container=document.createElement("div");container.className="r9calContainer";if(singleMonth){container.className+=" singleMonthCalContainer"}container.style.visibility="hidden";this.container=container;var lc="en.US";var src="/v287/h/nvtl/califrame.vtl?lc="+lc+"&singleMonth="+singleMonth+"&allowPast="+((allowPast)?"true":false);var frametext='<iframe src="'+src+'" class="calIframe" frameborder="0" scrolling="no" name="'+id+'" id="'+id+'">';jq(container).html(frametext);this.positionFunc=function(pos){pos.l-=80;pos.t+=10};this.frameid=id;var shadow=document.createElement("div");shadow.className="r9calShadow";this.shadow=shadow;container.appendChild(shadow)};function truePos(e){var l=0;var t=0;while(e&&e!=document.body){l+=e.offsetLeft;t+=e.offsetTop;e=e.offsetParent}return{l:l,t:t}}R9CalPopup.prototype.toggle=function(target){var c=jq(this.container);var hideit=(c.css("visibility")=="visible");if(hideit){var t=jq(target);if(t.is(".calicon")){var iconid="#"+this.controllingIcon;if(!t.is(iconid)&&!t.parent().is(iconid)){this.hide(true)}else{if(this.hideOnNextClick){this.hide(false);this.hideOnNextClick=false}else{this.hideOnNextClick=true}}}else{var id=target.id;if(id==this.controllingInput){return true}else{if(t.is(".calendar_dom")){this.hide(true);return true}else{this.hide(false)}}}}else{this.show(target)}return false};R9CalPopup.prototype.isVisible=function(target){return(jq(this.container).css("visibility")!="hidden")};R9CalPopup.prototype.show=function(target){var id=target.id;var pos=this.posCache[id];if(!pos||true){pos=truePos(target);pos.t+=target.offsetHeight;pos.target=target;this.positionFunc(pos);if(id){this.posCache[id]={l:pos.l,t:pos.t}}}var cs=this.container.style;cs.left=pos.l+"px";cs.top=pos.t+"px";cs.visibility="visible";var self=this;jq(document.body).mousedown(function(e){var prop=self.toggle(e.target);if(!prop){e.preventDefault();return false}return prop})};R9CalPopup.prototype.hide=function(fast,f){if(this.isHiding){return}var c=jq(this.container);if(fast||!jq.browser.firefox){this.container.style.visibility="hidden";if(f){f()}}else{this.isHiding=true;var self=this;c.hide(160,function(){c.css("visibility","hidden");c.show();if(f){f()}self.isHiding=false})}jq(document.body).unbind("mousedown")};function initDatePicker(pop,params){var picker=new R9DatePicker(pop,params.icon_id,params.input_id,params.dow_id);jq("#"+params.icon_id).click(function(e){picker.setCalendarFocused(true);picker.toggle(e.target);return true});jq("#"+params.input_id).blur(function(e){picker.clearInterval();picker.setDayOfMonthFocused(false);picker.scheduleFocusCheck();return true});jq("#"+params.input_id).focus(function(e){picker.setDayOfMonthFocused(true);picker.setInterval();if(!picker.isVisible()){picker.toggle(jq("#"+params.icon_id).get(0))}return true});if(params.initial_date&&params.initial_date.length>0){picker.setFromCanonical(params.initial_date)}else{picker.clearDay()}if(params.chg_callback_func&&typeof params.chg_callback_func=="function"){picker.onChangeCB=params.chg_callback_func}return picker}function setCalendarLoadedHook(hook){if(hook){whenFrameLoadedHook=hook}}function R9DoubleDatePicker(firstParams,secondParams,whenLoaded,allowPast){setCalendarLoadedHook(whenLoaded);if(allowPast==null){allowPast=false}var pop=new R9CalPopup(firstParams.calid,firstParams.singleMonth,allowPast);var first=initDatePicker(pop,firstParams);var second=initDatePicker(pop,secondParams);if(firstParams.initial_date&&firstParams.initial_date.length>0&&((!secondParams.initial_date)||secondParams.initial_date.length==0)){second.setMonthYearFromCanonical(firstParams.initial_date)}if(secondParams.initial_date&&secondParams.initial_date>0&&((!firstParams.initial_date)||firstParams.initial_date.length==0)){first.setMonthYearFromCanonical(secondParams.initial_date)}this.firstDate=this.departDate=this.checkinDate=this.pickupDate=first;this.secondDate=this.returnDate=this.checkoutDate=this.dropoffDate=second;first.onDateChanged=function(m,d,y){var dt1=first.valueAsDate();var dt2=second.valueAsDate(1);if(dt1&&dt2&&dt1>dt2){second.setDate(m,null,y)}second.markDate(first.fields());if(typeof first.onChangeCB=="function"){first.onChangeCB(this)}};second.onDateChanged=function(m,d,y){var dt1=first.valueAsDate(1);var dt2=second.valueAsDate();if(dt1&&dt2&&dt1>dt2){first.setDate(m,null,y);second.clearMarkedDate()}if(typeof second.onChangeCB=="function"){second.onChangeCB(this)}};if(document.getElementById(firstParams.calid)==null){document.body.appendChild(pop.container)}else{pop.container=document.getElementById(firstParams.calid).parentNode}}function jqtoggle(id){jq(id).toggle()}var R9CalDayOfWeek=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];

var jsck_widgets="v287";
// generation time: 98ms
