/* generated Fri Feb 10 22:50:00 EST 2012 */

var R9=R9||{};var _isIE=navigator.appName.indexOf("Microsoft")>-1;var _isSafari=navigator.userAgent.indexOf("Safari")>-1;var _updatingResultsMessage=null;var _currentPageNum=1;var _numrows;var cancelAfterclick=false;var usePopoverPagingTooltip=false;if(typeof window.Streaming=="undefined"){window.Streaming={done:true}}function showPagingTooltip(){if(!window.R9Skin&&jq.cookie("pgmsgshown")!="y"&&!window.FILTER_CLICKED&&!(window.currentview=="map")){if(usePopoverPagingTooltip===true){jq('<div><div class="pagingToolTip popover"><span>Ved at bruge filterindstillingerne til venstre, kan du indsn\u00E6vre resultaterne til nogle enkelte.</span></div></div>').r9popover({position:"#topOfFilter",title:"Find resultater hurtigere...",width:350});jq(".ui-dialog-titlebar").before("<div class='pagingToolTipIcon'></div>")}else{var a={x:-6,y:70};showTT(document.getElementById("topOfFilter"),"<div class='pagingToolTip'><span class=\"hideTTX\" onclick=\"hideTTType('CT')\"></span><div><b>Find resultater hurtigere</b></div><div>Ved at bruge filterindstillingerne til venstre kan du indsn\u00E6vre resultaterne til nogle enkelte.</div></div>","CL",a);jq("body").one("click",function(){hideAllTT()})}jq.cookie("pgmsgshown","y");addAdt("showpgtooltip")}}function setPage(d){var b=d;function c(){scrollTo(0,0);if(b==2){showPagingTooltip()}addAdt("page/"+b);updateDisplayA_ds(b);try{FB.XFBML.parse()}catch(e){}}if(window.ssUserAction){return ssUserAction("PG"+b,c,{pn:b-1})}function a(){if(!isNaN(b)&&b>=1&&b!=_currentPageNum){_currentPageNum=b;updateTable("paging");pgNums();c();hidemessage()}}waitForResults(a)}function getFilteredCount(){if(!_filtered){return R9FltrdCount}if(window._ALLRESULTSLOADED||!window.R9FltrdCount){return _filtered.length}return R9FltrdCount>0?R9FltrdCount:_filtered.length}function clearPages(){_currentPageNum=1}function getUpdateMessage(b){var a="";if(_updatingResultsMessage!=null&&_updatingResultsMessage.length>0){a+=_updatingResultsMessage}else{if(b!=null&&b.length>0){a+=b}else{a+="Opdaterer resultater..."}}return a}function jumpToTopOfFilters(){try{document.getElementById("topOfFilter").scrollIntoView()}catch(a){}}function noop(){}function refilter(b,d,f){showmessage(getUpdateMessage("Anvender dine valg af filtre..."));hideAllTT();var g=new Date();function c(){_updatingResultsMessage=null;updateDisplayA_ds("filter");addAdt("filtertime&"+(new Date().getTime()-g.getTime()))}if(window.ssUserAction){return ssUserAction("FLT",c)}var e=b||jq.noop;function a(){g=new Date();clearPages();var h=parseInt(document.resultsPaging.rowsper.value);if(d==null||d){setTop(0)}e();computeFiltered();if(h>_numrows){fNumRows(h)}if(_lastsort==null){updateTable(f)}else{if(_lastdirection!=null){_lastdirection=!_lastdirection}sortresults(_lastsort,true)}setTimeout(hidemessage,250);setTimeout(function(){try{FB.XFBML.parse()}catch(i){}},1000);c();if(typeof resetResultCount=="function"){resetResultCount()}}waitForResults(a)}function sortresults(a){var e=new Date();showmessage(getUpdateMessage("Sorterer resultater..."));if(window.ssUserAction){var b=a.match(/(\w+)_([ab])$/);if(b){a=b[1];_lastdirection=b[2]=="a"}else{if(_currentsortid==a){_lastdirection=!_lastdirection}else{_lastdirection=true}}_currentsortid=a;return ssUserAction("SRT"+a,function(){updateDisplayA_ds("sort")})}var c=a;function d(){var k=new Date();clearPages();setTop(0);c();var i=new Date();var j=1000-(i.getTime()-e.getTime());setTimeout(hidemessage,((j>0)?j:1));_updatingResultsMessage=null;var h=new Date();addAdt("sorttime&"+(h.getTime()-k.getTime()));updateTable("sorting");updateDisplayA_ds("sort");var f=new Date();var g=new Date()}waitForResults(d)}function humanizeBookit(d,a){var c=null;if(d&&typeof(d)!="string"){c=jq(d);d=c.attr(a||"href")}if(!d||d.match(/&sc=/)){return d}var b=d.match(/code=(.*)&/);if(b){b=b[1].split(".")}if(!b||b.length<=6){return d}var e=(Math.abs(parseInt(b[0]))+Math.abs(parseInt(b[5])))%13242+1;d=d+"&sc="+e;if(c){c.attr(a||"href",d)}return d}var lastclickid=null;var lastclickmsg="";function itemClicked(b,k,g,f,j,e,i){humanizeBookit(e,i);f=f||"popup/resultclick";j=jq.extend({},j);if(b&&getResultID){j.resultid=getResultID(b)}if(g){j.pcode=g}if(typeof toggleShowAfterClickSection=="function"){toggleShowAfterClickSection(true,b,g)}if(window.hidePriceSelections&&!cancelAfterclick){hidePriceSelections()}if(window.ViewState){ViewState.update("clicked",b)}else{_r[b]._vs=1;if(lastclickid!=null){_r[lastclickid]._vs=2}}var h=(document.getElementById("popupAfterBooking")!=null);if(!h){var c=document.getElementById("msg"+b);var a=document.getElementById("resultmessage"+b);if(c){c.style.display=_isIE?"block":"table-row"}if(a){a.innerHTML=k}try{showprices(b,true)}catch(d){}}else{if(!cancelAfterclick){openbooking(null,k,g,b)}}if(lastclickid!=null){if(document.getElementById("msg"+lastclickid)!=null){document.getElementById("msg"+lastclickid).style.display="none"}if(document.getElementById("tbd"+lastclickid)!=null){document.getElementById("tbd"+lastclickid).style.backgroundColor="#eeeeee"}}jq("#tbd"+b).css("background-color","#eee");lastclickmsg=k;lastclickid=b;addAdt(f,j);return true}function openbooking(h,e,g,a){var b=(h!=null)?h:"popupAfterBooking";var d=window.getResultID?getResultID(a):_r[a]._id;var c=document.getElementById(b);if(c!=null&&"FR"!=g){function f(){closebooking(b)}toggleFaderPane(true,f);jq("#"+b).show().css({top:jq(window).scrollTop()+150,left:(jq(window).width()-jq("#"+b).width())/2});if(e!=null){jq("#popupbookmessage").html(e);e="<span class='closearea'><a class='actionlink' href='javascript: closebooking()'>luk</a> <img onclick='closebooking()' src='/images/v42826/close-x-white.gif' border='0' width='11' height='11' /></span>"+e;jq("#popupAfterBooking > tbody > tr > td.title").html(e).children("span.fnf").css("display","none")}jq("#fnflink > a").attr("href","javascript: flightnotfound("+a+", '"+g+"')");if(typeof searchid!="undefined"){jq("#addtotripslink").attr("href","javascript: addAdt('afterclick/addtotrips');addResultToTrip('"+searchid+"', '"+d+"', 'addFlightToTrip"+a+"')");jq("#fbsharelink").attr("href","javascript:shareResultOnFacebook(searchid, rid, pcode);")}}}function closebooking(c){toggleFaderPane(false);var a=(c!=null)?c:"popupAfterBooking";var b=document.getElementById(a);if(b!=null){b.style.display="none"}}function hideSearchBox(){toggleFaderPane(false);jq("#doc3Outer").unbind("click",hideSearchBox);jq("#popupSearch").hide()}var _lastEmailAttemptID=null;function emailResult(a,b){return emailresult(window.getResultID&&getResultID(a)||_r[a],SearchID,a,b)}function emailresult(d,g,f,a){var h=585;var b=550;var e=0;var c="?resultid="+d+"&searchid="+g;if(a){c+="&bookingid="+a}var i=window.open("/s/emailresult"+c,"emailresult","scrollbars,height="+(h+e)+",width="+b+",menubar=no,toolbar=no,resizable");if(i!=null){if(f>0){_lastEmailAttemptID=f}i.focus()}}function emailsuccess(){if(_lastEmailAttemptID!=null){try{itemClicked(_lastEmailAttemptID,"Resultaterne er blevet e-mailet til dig og gemt i din s\u00F8gehistorik.");_lastEmailAttemptID=null}catch(a){}}}var pinnedResultList=new Array();var displayPinnedItems=true;var justPinned=-1;function getPinnedIDList(){var b=new Array();for(var a=0;a<pinnedResultList.length;a++){b.push(_r[pinnedResultList[a].id]._pid);if(_r[pinnedResultList[a].id]._pid!=_r[pinnedResultList[a].id]._id){b.push(_r[pinnedResultList[a].id]._id)}}return b.join(",")}function storePinned(a){jq.post("/s/sparkle",a)}function addPinned(b){if(window.hideAllTT){hideAllTT()}if(window.ssUserAction){ssUserAction("PIN: "+b,{pin:b+1});return}PinnedItems[_r[b]._id]=1;pinnedResultList.push({id:b});justPinned=b;updateTable("pin_"+_r[b]._id);justPinned=-1;try{document.getElementById("startsearchover").scrollIntoView(true)}catch(c){}var a=getPinSaveFields(b);a+="&add=Y&action=pinneditem";storePinned(a)}function removePinned(b){if(window.hideAllTT){hideAllTT()}if(window.ssUserAction){var d=b==null?"-all":-b-1;ssUserAction("UNPIN: "+d,{pin:d});return}for(var c=0;c<pinnedResultList.length;c++){if(pinnedResultList[c].id==b){pinnedResultList.splice(c,1)}}delete PinnedItems[_r[b]._id];if(window.onlyShowFavorites&&pinnedResultList.length==0){onlyShowFavorites(false)}else{updateTable("unpin_"+_r[b]._id)}var a=getPinSaveFields(b);a+="&add=N&action=pinneditem";storePinned(a)}function getLeftOfResultsCell(a,b){if(typeof a=="undefined"){a="ccc"}if(typeof b=="undefined"){b="fff"}return"<td class='repeaty' style='background-image:url(/images/corners/"+a+"-l.gif)'></td>"}function getRightOfResultsCell(a,b){if(typeof a=="undefined"){a="ccc"}if(typeof b=="undefined"){b="fff"}return"<td class='repeaty' style='background-image:url(/images/corners/"+a+"-r.gif); background-position: right'></td>"}function localTTHidden(){toggleFaderPane(false,null)}function showFareChartTip(b){var c=document.getElementById("no_chart_data_helptext");var a=document.getElementById(b);if(c!=null&&a!=null){jq(a).html(c.innerHTML)}}function mkCurrency(a){return _LEFT_CURSYMBOL+a+_RIGHT_CURSYMBOL}function chkCompareToGroups(d){var a=[],k={};for(var c=0;c<d.length;c++){if(d[c].group==null||d[c].group.length==0){d[c].groupOK=true}else{var f=d[c].group.substr(0,d[c].group.indexOf("-")),g=parseInt(d[c].group.slice(d[c].group.indexOf("-")+1)),e=c;if(k[f]==null){for(var b=c+1;b<d.length;b++){var l=d[b].group.substr(0,d[b].group.indexOf("-"));if(l==f){var h=parseInt(d[b].group.slice(d[b].group.indexOf("-")+1));if(h<g){d[e].groupOK=false;if(d[e].input!=null){d[e].input.checked=false}e=b;g=h}else{d[b].groupOK=false;if(d[b].input!=null){d[b].input.checked=false}}}}}}}for(var c=0;c<d.length;c++){if(d[c].groupOK=true){a.push(d[c])}}return a}function compareToKayak(){var e=document.comparesites;var f=true;var a=new Array();if(typeof e.comparetosite!="undefined"){if(typeof e.comparetosite.length=="undefined"){if(e.comparetosite.checked){a.push({code:e.comparetosite.value,url:e[e.comparetosite.value+"_url"].value})}}else{var g=e.comparetosite;for(var d=0;d<g.length;d++){if(g[d].checked){a.push({code:g[d].value,url:e[g[d].value+"_url"].value,group:g[d].className})}}}var c=new R9.utils.windowopener({searchType:R9.globals.vertical,tileWindows:true});a=chkCompareToGroups(a);for(var b=0;b<a.length;b++){f=(f&&c.open(b,a[b].code,a[b].url,a.length))}}if(!f){document.getElementById("innerTableTTTL").style.width="800px";popupBlockerMsg(null);window.focus()}}function popupBlockerMsg(){toggleFaderPane(true,null);loadDialog("popupWarning","popupblockertooltipdiv",function(){showTT(document.getElementById("popupTTIPPos"),document.getElementById("popupWarning").innerHTML,"TL");jq("#tooltipdivimageholder").empty().append("<img align='left' style='margin-right: 8px' src='/images/a-pop-up-ani.gif'>");window.focus()})}function popupContinue(){toggleFaderPane(false,null);hideAllTT()}function isNumeric(c){var b=""+c;if(b.length==0){return false}else{if(b.length==1&&(b.charAt(0)=="."||b.charAt(0)==","||(b.charAt(0)=="-"))){return false}}for(var a=0;a<b.length;a++){if((b.charAt(a)>="0"&&b.charAt(a)<="9")||b.charAt(a)=="."||b.charAt(a)==","||(b.charAt(a)=="-"&&a==0)){}else{return false}}return true}function getLeaveBehindFilterCell(b,c,a){return["<a href='javascript:"+c+';addAdt("leavebehind/'+(a||b.replace("'","\\'"))+"\");'>","<span>"+b+"</span>","</a>"].join("")}function getLeaveBehindFilterLink(b,a){return['<a id="freset_',a||sectionName.replace("'","\\'"),'" ',"onclick='javascript:",b,';addAdt("leavebehind/',a||sectionName.replace("'","\\'"),"\");cancelPropagation(event);'>","nulstil","</a>"].join("")}function updateLeaveBehindFilterReasons(){var a=getLeaveBehindFilterReasons();if(a){jq("#leaveBehindFilters").html(a);jq("#checklets").show()}var b=getFilteredOutReasons().reasons;jq("#filterdiv .sectionSubHeader").each(function(){var e=false;if(b){for(var c=0;c<b.length&&!e;c++){var f=b[c];if(!f.heading||!f.sectionname){continue}if(this.id=="fs_outer_"+f.sectionname||this.id=="fs_outersub_"+f.sectionname){var d=jq(this).find(".freset");if(d&&d.html().length==0){d.html(getLeaveBehindFilterLink(f.action,f.name))}jq(this).addClass("filtered");e=true}}}if(!e&&jq(this).hasClass("filtered")){jq(this).removeClass("filtered").find(".freset").html("")}})}function getLeaveBehindFilterReasons(){var e=[];var a={};var b=false;var d=getFilteredOutReasons().reasons;for(var c=0;c<d.length;c++){var f=d[c];if(f.heading==null||f.heading==""){continue}if(a[f.heading]==null){if(!b){e[e.length]="<span class='title'>Filtre:</span>";b=true}e[e.length]=getLeaveBehindFilterCell(f.heading,f.action,f.name)+" ";a[f.heading]=true}}if(b){return e.join("")}return null}function get_slider_range(b){var a=jq(b);return a.length&&[a.slider("option","min"),a.slider("option","max")]||null}function inrange(b,a){return b>=a[0]&&b<=a[1]}function ui_select(a){return a&&document.resultUI&&document.resultUI[a]||null}function ui_check(b,a){jq(ui_select(b)).prop("checked",a?true:false)}function ui_checked(a,c){var b=jq(ui_select(a));var d=0;b.each(function(f,e){if(e.checked){c[e.value]=e.value;d++}});return d==b.length}function monthDayYear(a){if(!a){a=new Date()}return(a.getMonth()-0+1)+"/"+a.getDate()+"/"+a.getFullYear()}function populateAdSpace(a,b){jq.get("/h/ads/results?searchid="+a+"&pagenum="+_currentPageNum,function(c){var i=jq("<div/>").html(c);var k=i.find("#sideads");var o=i.find("#topads");var f=i.find("#bottomads");var h=i.find("#bottomads_opt_header_tr1");var g=i.find("#bottomads_opt_header_tr2");var m=i.find("#bottomads_text_ads_td");var l=i.find("#bottomads_separator_td");var n=i.find("#topbannerads");if(b){jq("#topBannerAdContainer").html(n)}if(o.children().length>0){jq("#topAdContainer").html(o).show();validateResultTopAdHeight()}else{jq("#topAdContainer").hide()}if(b){jq("#nrAds").html(k)}else{jq("#nrAdsAjax").html(k)}if(b){jq("#bottomAdContainer").html(f)}else{if(h.length>0){jq("#bottomads_ads_tr").before(h);jq("#bottomads_opt_header_tr1").after(g)}if(m.length>0){jq("#bottomads_display_ad_td").before(m);jq("#bottomads_text_ads_td").after(l)}}if(b&&typeof(document.bannerUrls)!="undefined"){for(id in document.bannerUrls){if(navigator.appVersion.indexOf("MSIE")!=-1){var d=id.slice(id.length-1);var e=document.getElementById("displayAdSpanFrame"+d).innerHTML;var j=e.replace(/src="[^"]*"/,'src="'+document.bannerUrls[id]+'"');document.getElementById("displayAdSpanFrame"+d).innerHTML=j}else{jq("#"+id).attr("src",document.bannerUrls[id])}}}loadDisplayAds()});if(window.CMP2RESULTSPAGE){pollinlinecmp2(a)}if(window.CROSSSALEDISPLAYAD&&window.crossSaleSetContent){populateCrossSaleAds(a)}}function validateResultTopAdHeight(){if(window.R9Admin&&window.R9TopAdsHeight){var a=jq("#topAdContainer").height();if(a>window.R9TopAdsHeight){alert("Hey, Admin!\nThis is not good: Top ads container '#topAdContainer' is pushing result content after loading. Check it's height!\nCurrent height difference from expected: "+(a-window.R9TopAdsHeight)+"px!")}}}function pollinlinecmp2(a){if(!Streaming.done){window.setTimeout("pollinlinecmp2('"+a+"')",1000)}else{cmp2setcontentinline()}}function cmp2setcontentinline(){var a=jq("#cmp2contentinline").html();if(a){jq(".cmp2inlinecontainer").html(a).show();jq(".cmp2inline").show();cmp2bottombarsetup(a);jq(".cmp2providerbutton").hover(function(){jq(this).addClass("hovering")},function(){jq(this).removeClass("hovering")})}}function cmp2bottombarsetup(b){jq("#cmp2BottomContent").html(b);a();jq("#cmp2BottomBar").show();function a(){var c=jq("#listbody").offset().left-8;jq("#cmp2BottomBar").css("left",c+"px")}jq(window).resize(function(){a()})}function cmp2setcontent(a){jq.ajax({type:"POST",url:"/h/ads/getcmp2",data:{searchid:a,alternatetemplate:"cmp2resultspage.vtl"},dataType:"html",success:function(c){jq("#cmp2container").html(c);var e=jq("#cmp2contentrightrail").html();if(e){jq("#cmp2rightrailcontainer").html(e).show();jq("#cmp2contentrightrail").remove()}jq("#cmp2topright").show();var b=jq("#cmp2contentbottom").html();if(b){jq("#cmp2bottomcontainer").html(b).show();jq("#cmp2contentbottom").remove();jq("#cmp2bottom").show()}var d=jq("#cmp2contentsearchcompleted").html();if(d){jq("#searchcompletedcontainer").html(d)}pollinlinecmp2(a)},error:function(b,d,c){if(window.R9Admin){alert("There was an error fetching the list of sites to compare prices to. Please refresh and try again.")}}})}function populateCrossSaleAds(a){crossSaleSetContent(a);if(!populateCrossSaleAds.handler){populateCrossSaleAds.handler=function(){crossSaleSetContent(a)};jq(window).bind("updateDisplayDone.crosssale",populateCrossSaleAds.handler);jq("form[name='inlinesearchagain']").submit(function(){jq(window).unbind("updateDisplayDone.crosssale",populateCrossSaleAds.handler);window.IS_CROSSSALE_REQUESTED=window.IS_CROSSSALE_IMPRESSED=false;populateCrossSaleAds.handler=null})}}function flippyDone(){jq("#flippyiframecontainer").hide(750);if(window.R9PBar){R9PBar._stopTimer()}}function shareResultOnFacebook(b,c,a){FB.login(function(e){if(e.session&&e.perms&&e.perms.indexOf("publish_stream")>-1){var d=d||"";jq.post("/h/socmed/facebookShareResult",{searchid:b,resultid:c,pc:a,prod:d},"json")}},{perms:"publish_stream"})}var R9PBar=null;function setupPBar(a){var b=window.R9_PBartimer&&jq("#progressDiv")||[];if(!b.length){return}R9PBar=new R9_PBartimer(b,(a?(a-0):60000)+5000)}var adt=new Array();function initAdt(d,b){if(!window.LogUserEvents){return false}try{adt.push(d);adt.push(SearchID);adt.push("load="+new Date().getTime());adt.push("rc="+_r.length);adt.push("fc="+_filtered.length);if(extraArgs){for(var c in extraArgs){adt.push(extraArgs[c])}}adt.push("resultmessage="+RANDOM_UPSELL_CODE)}catch(a){}}function addAdt(c,b){if(window.LogVSEvents&&c.indexOf("filtertime")<0&&c.indexOf("sorttime")<0){b=jq.extend({},b,{action:"vs"});if(window.SearchID){b.searchid=SearchID}jq.get("/vs/"+window.SearchType+"/"+c,b)}if(!window.LogUserEvents){return}try{adt.push('f="'+c+":"+new Date().getTime()+'"');if(adt.length>=20){sendAdt();initAdt()}}catch(a){}}function sendAdt(){if(!window.LogUserEvents){return}jq.post("/s/sparkle?action=filterstats&ts="+new Date().getTime()+(typeof SearchID!="undefined"?"&searchid="+SearchID:""),"log="+escape(adt.join(" ")));adt=new Array()}function allresultsloaded(){_ALLRESULTSLOADED=true;var a=document.getElementById("filtered_count");if(a){a.innerHTML=_filtered.length}Streaming.dbg("ALR=true")}function uistatsunload(){adt.push("unload="+new Date().getTime());sendAdt()}function flippyLoaded(){jq("#flippyblocker").hide()}function updateDisplayA_ds(a){if(window.NoAds||R9_DisplayEds_JustHidden||!window.SearchID||window.local_displayEdOKToUpdate&&!local_displayEdOKToUpdate()){return}addAdt("bannerreload");reloadBannerAds()}function waitForResults(d){var a=d;var b=0;function c(){if(_ALLRESULTSLOADED){d();jq(".slidedown").slideDown("slow");return}else{if(window.SearchType=="hotel"&&b==0){addAdt("impatienthoteluser")}}b++;if(b>=40){alert("Desv\u00E6rre. Der opstod en fejl under fors\u00F8get p\u00E5 at opdatere dine resultater. Giv os endelig besked hvis problemet forts\u00E6tter.")}else{if(b<=10){window.setTimeout(c,250)}else{window.setTimeout(c,1000)}}}window.setTimeout(c,1)}function research(){addAdt("startsearchover");var a="/"+SearchType+"s?uselast=true&"+(window.extraSearchParam&&extraSearchParam()||"");window.location.replace(a)}function doHide(){if(typeof hidePriceSelections=="function"){hidePriceSelections()}}function initSmartbox(i,c,d,a){var b=0;if(typeof d=="function"){var e=d;d=a;a=e}var g={callbackWithNull:true,minWidth:180,searchType:window.SearchType,timeout:window.smartyTypedelay};if(d){jq.extend(g,d)}var h=g.callback;jq.each(c,function(f,k){var j=jq(jq.isArray(k)&&k[0]||k);if(j.length){g.callback=function(l){if(jq.isArray(k)){jq(k[1]).val(l?l.id:"")}if(h){h.apply(this,l)}if(a){a.call(this,l,k)}};jq(j).smartbox(g).blur(function(){compare2chk(gradientDialogCleanup)});b++}});jq(window).unbind("lazyLoad."+i);if(c.length>b){jq(window).bind("lazyLoad."+i,function(){initSmartbox(i,c,d,a)})}return b}function modifySearch(a,b){if(typeof hidePriceSelections=="function"){hidePriceSelections()}compare2origin="rslt";if(!a){return research()}loadPopupSearch(function(){if(b){b()}initCalendar();if(typeof compare2chk=="function"){compare2initializing=false;compare2chk(gradientDialogCleanup);jq("#compareToRow").show().css("visibility","visible")}if(typeof useSearch=="function"){useSearch()}var e=document.searchagain;if(e){jq("div.inlineStartSearchOver :input").each(function(g){var f=jq(this);if(f.val()!=f.attr("defaultValue")||f.attr("type")=="hidden"){if(f.attr("type")=="checkbox"&&jq(e[this.name]).attr("type")=="checkbox"){jq(e[this.name]).prop("checked",f.prop("checked"))}else{jq(e[this.name]).val(f.val())}}})}var d=jq(this),c=jq("#modifysearchtd");if(c.is(":visible")){d.r9popover({position:c})}else{d.r9dialog({draggable:false})}})}function secondPhaseShow(){Streaming.showAllResults()}function clearTwoPhaseMessage(){Streaming.stopTwoPhase()}function expiredSearchAgain(a,c){jq(document.body).css("cursor","wait");if(window.Filters){Filters.saveState("expired")}var b;if(a){b=document.location.href;if(c){b+="&nocache=1";document.location.replace(b)}else{document.location.reload()}}else{var b=SearchURL;if(c){b+="&nocache=1"}document.location.replace(b)}}function getResultID(a){return _r[a]._id}function setsortorder(b,a){_currentsortid=b;_lastsortid=b;_lastdirection=a}var sharectl=null;function showShareSavedSection(f,a,b,e,c,d){showShareSection(f,a,b,e,c,d,"sharesaved")}function showShareSection(resultID,hid,name,price,triptype,likeurl,action){var data="action="+(action||"share")+"&searchid="+SearchID+"&resultid="+getResultID(resultID)+"&hid="+hid;hotelalertresid=resultID;hotelalerthid=hid;hotelalertname=name;if(resultID>-1){jq.ajax({type:"POST",url:"/s/toolbox",data:data+"&includecode=true",dataType:"xml",success:function(xmlobj){var xml=jq(xmlobj),code=xml.find("code").text();if(code&&code.length){eval(code);sharectl=new shareController()}jq("body").append(xml.find("html").text());sharectl.newShare(document.getElementById("sharelink"+resultID),hid,name,resultID,price,triptype,likeurl)},error:function(request,textStatus,error){alert(textStatus+" "+error.toString())},cache:false})}}function setLookbackCookie(c,b){var a="/s/lookback/"+c+"&resolve=true&resultid="+b;jq.ajax({type:"POST",url:a,dataType:"html",success:function(e){try{var i=jq("iframe.lookbackUrl").attr("contentWindow");var h=jq(i).attr("document");var g=jq(h).attr("body");jq(g).html(e);var f=h.forms.book;jq(f).submit()}catch(d){}},cache:false})}function bookLinksExpired(b){if(window.getXsellImpressionParams){var a=getXsellImpressionParams();b=b+a}jq.ajax({type:"POST",url:"/s/toolbox",data:b,dataType:"html",success:function(d){try{toggleFaderPane(true);var e=jq("#bookLinksExpiredDiv");if(!e.length){e=jq("<div id='bookLinksExpiredDiv'></div>").appendTo("body")}if(jq.browser.msie){e.css("position","absolute")}e.html(d);jq("td.tellmemore").append(jq("#expiredXSell").html());e.show();addAdt("booklinkexpired/shown")}catch(c){}},error:function(d,e,c){alert(e)},cache:false})}function showPriceAlertSaved(alertid,error){var mydata={action:"farealertsaved",searchid:SearchID,alertid:alertid};var savedalert;jq.ajax({type:"POST",url:"/s/toolbox",data:mydata,dataType:"xml",success:function(xmlobj){try{jq("#alertUpsellContent").r9popover("destroy").remove();var xml=jq(xmlobj);var code=xml.find("code").text();var html=xml.find("html").text();if(code!=null&&code.length>0){eval(code)}jq("#showalertlinkrow").hide();jq("#showalertsavedlinkrow").show();showTT(jq("#showalertsavedlinkrow"),"","DL",{x:35,y:-15});if(typeof(savedalert)!="undefined"&&typeof(savedalert.savedalertid)!="undefined"){jq("#editalertlink").attr("href","/alerts?action=prepop&alertid="+savedalert.savedalertid)}else{jq("#editalertlink").attr("href","/alerts")}jq("#ttipDL").html(html);jq("#bootypopcontent").html(html);if(alertid=="-2"&&(typeof(error)!="undefined")){AjaxAlert.showEmailAlertError(error)}else{jq("#alerterrorrow").hide();jq("#alertsuccessrow").show()}}catch(ignored){}},error:function(request,textStatus,error){alert(textStatus)},cache:false})}function displayPrice(b,a){var c=(b*1)+0.5;return(a?_LEFT_CURSYMBOL:"")+parseInt(c)+(a?_RIGHT_CURSYMBOL:"")}function showLowest(a){Filters.undoAll(a,"show_lowestprice");addAdt("leavebehind/all")}function validateJS(d){if(!d){d=jq(document)}var c=d.find("#scripts");var b=[];var a=[];if(!c.length){throw"#scripts div not found."}d.find("script").each(function(){var e=this.id&&"#"+this.id||this.src||this.text&&("'"+this.text.substr(1,35).replace("\n"," ")+"...'")||this;if(this.parentNode!=c[0]){throw"All scripts must be in #scripts div, but\n"+e+" is in "+identify(this.parentNode)}if(this.src){b.push(this.src)}else{if(!this.id){throw"All inline script tags must have ids, but\n "+e+" does not"}else{a.push(this.id)}}});if(a.length>1){throw (a.length-1)+" extraneous inline tags found: "+a.join(", ")}if(b.length>(SearchType=="car"&&10||6)){throw"Too many ("+b.length+") included scripts. Should be merged: "+b.join("\n")}}function completeInitialLoad(a){if(window.productstartup){window.productstartup()}Streaming.dbg("I="+R9RsltCount+"; T="+Streaming.lastPoll);if(window.R9Admin&&!window.R9Skin&&(!window.samepageresults||a)){Streaming.dbg("CHKS<");validateScripts();Streaming.dbg("CHKS>")}jq(window).trigger("initialLoad")}function attachMatrixHover(){var a=jq("#filterviewmatrix");if(!a.length){return}jq("#filterviewmatrix").delegate("td.pricecell","hover",function(){if(jq(this).html().match("\\d")){jq(this).toggleClass("hoverCell")}}).delegate("td.airlinecell","hover",function(){jq("#filterviewmatrix td."+jq(this).attr("id")).toggleClass("hoverCol")}).delegate("td.stopslabel","hover",function(){jq("#filterviewmatrix td."+jq(this).attr("id")).toggleClass("hoverRow")})}function identify(b){var c="";b=jq(b);while(1){if(!b[0]||b[0].tagName=="HTML"){break}if(b[0].id){c="#"+b[0].id+" "+c;break}var a=b[0].className.replace("s+",".");c=b[0].tagName+(a?"."+a:"");b=b.parent()}return c}R9.ajaxHistory={lastHash:"",callback:null,initialize:function(a){this.lastHash=window.location.hash;this.callback=a;setTimeout(R9.ajaxHistory.checkHash,300)},ignoredChange:function(a){var b=this.callback;this.callback=false;try{a.call();this.lastHash=window.location.hash}finally{this.callback=b}},checkHash:function(){var a=window.location.hash;var b=this.lastHash;if(a!=b&&b!=undefined){this.lastHash=a;if(this.callback){this.callback.call(this)}}setTimeout(R9.ajaxHistory.checkHash,300)}};function destroyPopupSearch(){var a=jq("#popupSearch"),b=a.data();if(b.r9popover){a.r9popover("destroy")}else{if(b.r9dialog){a.r9dialog("destroy")}}return a}function loadPopupSearch(a){loadSection(jq("#popupSearchLazy"),function(){a.apply(destroyPopupSearch())},{action:"searchpopup"})}function loadDialog(c,b,a){if(jq("#"+c).length){a()}else{ssAJAX("/s/toolbox",{action:"tpl",t:b},a)}}function loadSection(b,a,d){if(typeof a=="string"){var c=d;d={action:a};a=c}if(b.is(".lazy")){ssUserAction("LZLD",function(){if(a){a.apply(b,arguments)}b.removeClass("lazy");jq(window).trigger("lazyLoad",[b,d]);jq(b).trigger("lazyLoad",d)},d)}else{if(typeof a=="function"){a.apply(b)}}}function toggleMatrix(b){var a=jq("#filterviewmatrix");if(!b){b=a.is(":visible")&&"list"||"matrix"}var c=b!="matrix";window.currentview=b;if(!c){loadSection(a,"matrix")}hideAllTT();jq(".selectedtab").addClass("unselectedtab");jq(".selectedtab").removeClass("selectedtab");jq("#content_div").show();jq("#pagingTableBottom").show();a[c?"hide":"show"]();jq("#toolboxitemshowmatrix")[c?"show":"hide"]();jq("#toolboxitemhidematrix")[c?"hide":"show"]();addAdt("chgview/"+b)}function showMoreReasons(a){jq(".reviewreasons").hide();var c=jq("#firstreview_"+a).html();var d="hotel.freetextreview.show."+c;if(c!=null&&c!=""){var b=jq("#revdetail_"+c).html();if(b!=null&&b.length<10){detailReviewClicked(a,c,d)}}jq("#reviewreasons_"+a).r9dialog({width:780,position:["center",100]}).show()}function cancelPropagation(a){if(!a){a=window.event}a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}}function bindSelectTextOnFocus(){jq("input.selectTextOnFocus").one("focus",function(){this.select()})}function closeFilterInfo(){jq("#popupFilterInfo").hide()}function showAndHideFilterPopup(){var a=jq("#filterdiv"),b=a.offset();b.left+=a.width()+30;b.top=b.top-(jq("#popupFilterInfo").height()/2)+(a.height()/2+10);jq("#popupFilterInfo").offset(b);jq("#popupFilterInfo").delay(2000).show().delay(10000).fadeOut("slow")}function attachInlineMultibook(){jq("#listbody").delegate(".resultInlineMulti .allInlineItems","click",function(event){event.stopPropagation();jq(this).parents(".resultInlineMulti").toggleClass("opened")});jq("#listbody").delegate(".resultInlineMulti .item, .deals .flowness","click",function(event){event.stopPropagation();jq(this).find("a.dealsinresult").each(function(i){if(this.rel.indexOf("javascript")==0){eval(this.rel)}else{window.open(this.rel,this.target.replace(":",""))}jq(this).addClass("visited");addAdt("results/inline/click")})})}function popupsearchsubmit(){addAdt("toolbox/changesearch/searchagain");Profiler.markSearchStart();comparewindows(document.searchagain);jq("#getratesbutton").prop("disabled",true);var a=generateSearchUrl(document.searchagain);if(a!=null){window.clearTimeout(window.R9.bookLinksExpiredTimeout);loadResults(a,undefined,destroyPopupSearch);return false}return true}function setAllCmp2(a){jq("#compareToCheckboxes input:checkbox:visible").prop("checked",a);setCmp2Count();jq.get("/vs/cmpallclk."+_getStartTab()+"?action=vs"+(typeof SearchID!="undefined"?"&searchid="+SearchID:""))}function _getStartTab(){if(window.SearchType&&!window.StartTab){StartTab=SearchType+"s"}return StartTab}function _getSearchForm(){return document[_getStartTab()]||document.searchagain}function startsWith(b,a){return b.match("^"+a)==a}function isEnoughInfoForCmp2(){if(!window.CMP2REQUIREDEST){return true}var a=_getSearchForm();return window.StartTab=="cruises"||a&&jq(a.origin).attr("value")&&!startsWith(jq(a.origincode).attr("value"),"C-")&&jq(a.destination).attr("value")&&!startsWith(jq(a.destcode).attr("value"),"C-")||a&&jq(a.othercity).attr("value")||a&&jq(a.location).attr("value")}function getCmp2Args(){if(window.flynow){return""}var b=_getStartTab();var c=_getSearchForm();var a="ptype="+b;if(b=="flights"||b=="vacations"){a+="&depart_date="+c.depart_date.value;a+="&return_date="+c.return_date.value;a+="&origin="+c.origin.value;a+="&origincode="+c.origincode.value;a+="&destination="+c.destination.value;a+="&destcode="+c.destcode.value;if(b=="flights"){a+="&cabin="+c.cabin.value;a+="&oneway="+((c.oneway[1].checked)?"true":"false");if(c.student){a+="&student="+c.student.value}}}else{if(b=="hotels"){var a="ptype=hotels";a+="&checkin_date="+c.checkin_date.value;a+="&checkout_date="+c.checkout_date.value;a+="&location="+c.othercity.value;a+="&citycode="+c.citycode.value;a+="&lmid="+c.lmid.value}else{if(b=="cars"){var a="ptype=cars";a+="&pickup_date="+c.pickup_date.value;a+="&dropoff_date="+c.dropoff_date.value;a+="&location1="+c.location.value;a+="&citycode1="+c.citycode1.value;a+="&location2="+c.location2.value;a+="&citycode2="+c.citycode2.value;a+="&oneway="+((c.oneway[1].checked)?"true":"false")}else{if(b=="cruises"){var a="ptype=cruises";a+="&destination="+c.destination.value}else{return""}}}}if(compare2origin!=null){a+="&qryorigin="+compare2origin}return a}var skipCompare=false;var compare2initializing=true;var compare2origin=null;function compare2chk(c){if(compare2initializing){return}if(skipCompare){return}if(!isEnoughInfoForCmp2()){jq("#compareToSpacer").hide();jq("table.compareToWrapper").hide();gradientDialogCleanup();return}if(window.flynow){return}var b=_getSearchForm();if(!b){return}var a=null;if(typeof c=="function"){a=c}if(typeof b.comparetosite!=="undefined"){jq("#compareToSpacer").show();jq("table.compareToWrapper").show();jq.getScript("/s/cmp2chk?"+getCmp2Args(),a)}else{if(typeof a=="function"){a()}}}function allcmp2set(a){try{var c=document.getElementById("compareToRow");if(a){if(c.style.display=="none"){c.style.display=""}}else{c.style.display="none"}}catch(b){}}function cmp2set(a,d){if(d!=null&&d.indexOf("KAYAK")==0){return}try{var c=document.getElementById("site"+d);var e=document.getElementById("cb"+d);if(a){jq("#compareToRow").show();if(c.style.display=="none"){c.style.display="";e.checked=e.defaultChecked;e.value=d;initCmp2CTR();cmp2CTR.recordCheck(d,e.defaultChecked);cmp2CTR.recordVisible(d,true)}}else{e.checked=false;c.style.display="none";initCmp2CTR();cmp2CTR.recordCheck(d,false);cmp2CTR.recordVisible(d,false)}}catch(b){}}function cmp2swap(d,c){cmp2set(true,d);try{var b=document.getElementById("cb"+d);b.value=c}catch(a){}}function cmp2precheck(d,b){try{var c=document.getElementById("cb"+b);c.checked=d}catch(a){}}function setCmp2Count(){var a=_getStartTab();if(jq("#compareToCheckboxes").children("span:visible").size()==0){jq("#compareToRow").css("visibility","hidden")}else{jq("#compareToRow").css("visibility","visible")}}function checkStudentCabin(a){if(a.value=="e"){toggleStudent(true)}else{toggleStudent(false)}}function toggleStudent(a){if(a){student("0")}else{document.getElementById("student").value="0";jq("#student_link").hide();jq("#non_student_link").hide()}}function student(a){document.getElementById("student").value=a;if(a=="1"){jq("#student_link").hide();jq("#non_student_link").show();jq("#compareALL").hide()}else{jq("#non_student_link").hide();jq("#student_link").show();jq("#compareALL").show()}compare2chk()}function addCheckedCompareTos(c,a){var d=0;if(typeof c.comparetokayak!="undefined"){var e=c.comparetokayak;for(var b=0;b<e.length;b++){if(e[b].checked){if(CMP2_HIDDEN){e[b].checked=false}else{if(e[b].value!=null&&e[b].value!=""){a.push({code:e[b].value,group:e[b].className,input:e[b]})}}}}}if(typeof c.comparetosite!="undefined"){if(typeof c.comparetosite.length=="undefined"){if(c.comparetosite.checked){if(CMP2_HIDDEN){c.comparetosite.checked=false}else{a.push({code:c.comparetosite.value,group:c.comparetosite.className,input:c.comparetosite})}}}else{var e=c.comparetosite;for(var b=0;b<e.length;b++){if(e[b].checked){if(CMP2_HIDDEN||!jq(e[b]).is(":visible")){e[b].checked=false}else{if(e[b].value!=null&&e[b].value!=""){a.push({code:e[b].value,group:e[b].className,input:e[b]})}}}}}}}function comparewindows(d){var a=new Array();if(typeof d.comparetosite=="undefined"){return true}addCheckedCompareTos(d,a);var c=new R9.utils.windowopener({searchType:R9.globals.vertical,tileWindows:true});for(var b=0;b<a.length;b++){if(a[b].code!=null&&a[b].code!=""){if(!c.open(b,a[b].code,a.length)){return false}}}return true}function uncheckcomparetos(c){if(c.comparetosite==null){return}if(typeof c.comparetosite.length=="undefined"){c.comparetosite.checked=false;return}initCmp2CTR();cmp2CTR.startUpdate();var d=c.comparetosite;for(var a=0;a<d.length;a++){d[a].checked=false;var b=d[a].value;cmp2CTR.recordCheck(b,false);cmp2CTR.recordVisible(b,false)}cmp2CTR.endUpdate()}function compareExpediaDom(a){jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:"EXPEDIA_DFDCMP2",metavalue:a},success:function(b){compareExpediaInt(a)}})}function compareExpediaInt(a){jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:"EXPEDIA_IFDCMP2",metavalue:a}})}function compareChecked(c){var b="false";if(c.checked){b="true"}var a=c.value;initCmp2CTR();cmp2CTR.recordCheck(a,c.checked);if(a.indexOf("EXPEDIA_DFDCMP2")>=0||a.indexOf("EXPEDIA_IFDCMP2")>=0){window.setTimeout("compareExpediaDom('"+b+"')",500);a="EXPEDIA_FDCMP2"}jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:a,metavalue:b}});setCmp2Count()}var CMP2_HIDDEN=false;function compareToClosed(){CMP2_HIDDEN=true;jq("#compareToRow").hide();jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:"hidefdcmp",metavalue:"true"}})}function compareCheckedKayak(a){var b=document.getElementById("cbKAYAK_FDHCMP2");if(b){saveMeta(b,compareCheckedKayak3)}}function compareCheckedKayak3(){var a=document.getElementById("cbKAYAK2_FDCCMP2");if(a){saveMeta(a,null)}}function saveMeta(b,c){var a="false";if(b.checked){a="true"}if(c==null){jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:b.value,metavalue:a}})}else{jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:b.value,metavalue:a},success:c})}}function showMoreCMP2(){var b=jq("#moresiteslink").offset();var a=jq("#addmorecmp2").detach();a.appendTo("body").css({top:b.top-0+15,left:b.left}).show();window.setTimeout(bindhideCMP2,100)}function bindhideCMP2(){jq(document).bind("click",hideMoreCMP2)}function hideMoreCMP2(){jq("#addmorecmp2").hide();jq(document).unbind("click",hideMoreCMP2)}function cmp2am(a,c){if(c!=null&&c.indexOf("KAYAK")==0){return}try{var d=document.getElementById("am"+c);if(a){if(d.style.display=="none"){d.style.display=""}}else{d.style.display="none"}}catch(b){}}function addcomparetolist(a){cmp2set(true,a);jq("#cb"+a).prop("checked",true);savedisplay(a,true);compareChecked(document.getElementById("cb"+a));jq("#am"+a).hide();checkmoresites()}function checkmoresites(){var a=true;jq("#addmorecmp2 span").each(function(){a=jq(this).css("display")=="none";if(!a){return false}});if(a){jq("#moresites").hide()}else{jq("#moresites").show()}}function cmp2ForceSingleLine(){var b=9999;jq("#compareToCheckboxes").children("span.cmp2item:visible").each(function(d){var c=Math.round(jq(this).offset().top);if(c<b){b=c}});var a=0;jq("#compareToCheckboxes").children("span.cmp2item:visible").each(function(d){var c=Math.round(jq(this).offset().top);if(Math.round(c)-b>5){jq(this).hide();a++}})}function savedisplay(b,a){jq.ajax({type:"POST",url:"/k/cookie",data:{action:"setmeta",metacookie:b+"_disp",metavalue:a}})}function Cmp2CTR(d){this.recordVisible=function(i,h){b(i,4,(h)?"1":"0")};this.recordCheck=function(i,h){b(i,5,(h)?"1":"0")};this.recordTerm=function(h,i){b(h,3,i)};this.startUpdate=function(){f=false};this.endUpdate=function(){e();f=true};var g=d;var c=null;var a=6;var f=true;function b(m,k,n){try{if(c==null){if(g==null){return}c=new Object();var j=g.value.split(";");for(var i in j){var h=j[i].split("|");c[h[0]]=h}}if(3<=k&&k<a){var l=c[m];if(l!=null&&l.length==a&&l[k]!=n){l[k]=n;if(f){e()}}}}catch(o){}}function e(){try{if(c==null){return}if(g==null){return}var i="";for(var h in c){if(i.length>0){i+=";"}i+=c[h].join("|")}g.value=i}catch(j){}}}var cmp2CTR;function initCmp2CTR(){if(typeof(cmp2CTR)=="undefined"){try{cmp2CTR=new Cmp2CTR(document.forms[0].c2s)}catch(a){cmp2CTR=null}}}function inlineSearchResubmit(a){try{addAdt("inlinesearch/searchagain");showmessage("Starter ny s\u00F8gning...");jq("body").css("cursor","wait");Profiler.markSearchStart();var c=generateSearchUrl(a,true);if(c!=null){window.clearTimeout(window.R9.bookLinksExpiredTimeout);loadResults(c);return false}}catch(b){if(window.R9Admin){alert("Exception "+b+" in inlineSearchResubmit(). Abort");return false}}return true}function setDisplayTabs(c){for(var a=0;a<c.length;a++){var b=jq("#cmp2TabFD"+a);if(b.length==0){break}b.text(c[a])}if(c.length==0){jq("#compareToRow").hide()}else{if(jq("#tabbedCmpFDContent:visible").length==0){jq("#compareToRow").show();jq("#tabbedCmpFDContent").slideDown(800)}}}R9.extend("utils",{windowopener:function(b){if(top!=self){try{if(top.document.location.toString()){this._top=top}}catch(a){}}jq.extend(this.options,b)}});R9.extend("utils.windowopener.prototype",{_top:self,options:{searchType:"",popUnder:true,tileWindows:false,heightRule:false,minWidth:0,minHeight:0,screenWidth:1024,screenHeight:768},open:function(c,e,d,b){var b=this._getUrl(b,e);if(!b){return true}var a=this._getWindow(b,this._getWindowName(e),c,d);if(!a){return false}this._handleInitialWindowFocus(a);this._preparePopUpWindow(a);a.init(a);return true},_getWindow:function(c,e,b,d){try{return this._top.window.open(c,e,"toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,top="+this._getWindowTop()+",left="+this._getWindowLeft(b,d)+",width="+this._getWindowWidth(b,d)+",height="+this._getWindowHeight())}catch(a){return false}},_getWindowWidth:function(a,c){if(this.options.tileWindows){return Math.min(this.options.screenWidth,Math.floor(this._getScreenWidth()/c-10))}var b=0;if(typeof(this._top.window.innerWidth)=="number"){b=this._top.window.innerWidth}if(this._top.document.documentElement&&this._top.document.documentElement.clientWidth){b=this._top.document.documentElement.clientWidth}if(this.options.minWidth){return this.options.minWidth>b?this.options.minWidth:b}return b},_getWindowHeight:function(){if(this.options.heightRule){return Math.round(this._getScreenHeight()*0.6)}if(this.options.tileWindows){return this._getScreenHeight()}var a=0;if(typeof(this._top.window.innerHeight)=="number"){a=this._top.window.innerHeight}if(this._top.document.documentElement&&this._top.document.documentElement.clientHeight){a=this._top.document.documentElement.clientHeight}if(this.options.minHeight){return this.options.minHeight>a?this.options.minHeight:a}return a},_getWindowTop:function(){if(this.options.heightRule){return Math.round(this._getScreenHeight()*0.4)}if(this.options.tileWindows){return 0}if(this._top.window.screenTop!=undefined){return this._top.window.screenTop}return this._top.window.screenY},_getWindowLeft:function(a,b){if(this.options.tileWindows){return Math.floor(this._getWindowWidth(a,b)*a+10*a)}if(this._top.window.screenLeft!=undefined){return this._top.window.screenLeft}return this._top.window.screenX},_getWindowName:function(a){if(a.indexOf("_")>0){return a.substring(0,a.indexOf("_"))}return a},_getUrl:function(a,b){if(a!=null){return a}if(this.options.searchType){return"/s/compareresults/startingsearch?type="+this.options.searchType+"&p="+b}return""},_handleInitialWindowFocus:function(a){if(!this.options.popUnder){return}a.blur();if(navigator.userAgent.toLowerCase().indexOf("applewebkit")>-1){this._top.window.blur();this._top.window.focus()}},_preparePopUpWindow:function(a){jq.extend(a,{init:function(b){this._doMozillaMagic();try{b.opener.window.focus()}catch(c){}},_doMozillaMagic:function(){if(typeof window.mozPaintCount=="undefined"){return}var b=this.window.open("about:blank");b.close()}})},_getScreenWidth:function(){if(window.screen.availWidth){return window.screen.availWidth}return window.screen.availWidth},_getScreenHeight:function(){if(window.screen.availHeight){return window.screen.availHeight}return this.options.screenHeight}});function toggleCheckbox(b){var a=jq("#"+b).prop("checked");jq("#"+b).prop("checked",!a)}function makeFrameHtml(a){return'<iframe src="'+a+'" width="470" height="430" style="border: 1px solid #bbbbbb;"></iframe>'}function fbReturnFromAuth(){location.href=location.href}function shareAfterLogin(a){if(a.authResponse){fbSend()}}function fbSend(){jq.ajax({type:"POST",url:"/s/run/toolbox/sendtofb",data:jq("#facebook_msg").serialize(),success:function(a){closefb()}})}function fbShare(){FB.login(shareAfterLogin,{scope:"publish_stream"});return false}function afterCheckPerms(b){if(!b){FB.login(afterLogin,{scope:"publish_stream"})}else{try{if(b.publish_stream==1){fbSend()}else{FB.login(afterLogin,{scope:"publish_stream"})}}catch(a){FB.login(afterLogin,{scope:"publish_stream"})}}}function fbConnect(){FB.login(afterLogin,{scope:"publish_stream"});return false}var lastanchor="";var lastorientation="";function fbOptions(b,a){lastanchor=b;lastorientation=a;setToAnchor("popupFacebookOptions",b,a,-37,0);jq("#popupFacebookOptions").show();hideOnOutsideClick("popupFacebookOptions")}function closefb(){jq("#facebook_msg").hide();jq("#facebook_posted").show();if(window.gradientDialogCleanup){gradientDialogCleanup()}}function showWallPost(){jq("#fb-wallpost-button").css("background-position","0 0");jq("#fb-send-button").css("background-position","-109px -26px");jq(".fb-to-field").css("display","none");jq(".message-label").css("display","none");jq("#fbShareSendButton").css("display","none");jq("#fbSharePostButton").css("display","");jq(".fb-faux-post-msg").css("display","block");jq(".send-message").css("display","none");jq("#fb-state").attr("state","post")}function showSend(){jq("#fb-wallpost-button").css("background-position","0 -26px");jq("#fb-send-button").css("background-position","-109px 0");jq(".fb-to-field").css("display","block");jq(".message-label").css("display","block");jq("#fbShareSendButton").css("display","");jq("#fbSharePostButton").css("display","none");jq(".fb-faux-post-msg").css("display","none");jq(".send-message").css("display","block");jq("#fb-state").attr("state","send")}function fbSendMessage(){FB.ui({method:"send",display:"popup",name:jq(".sharename").text(),show_error:true,link:window.location.href},function(a){if(a&&a.request_ids){closefb()}})}function fbSendMessageLater(){FB.ui({method:"send",display:"popup",name:jq(".sharename").text(),picture:jq(".fb-faux-post-pic > img").attr("src"),description:jq(".fb-faux-post-desc").text(),show_error:true,link:jq("#sharing_fb_link").val()},function(a){if(a&&a.request_ids){closefb()}})}jq(document).bind("r9.social.linkedinshare.success",function(){jq("#linkedin_msg").hide();jq("#linkedin_posted").show()});function liConnect(){R9.social.shareToLinkedin(jq("#limessage").val(),R9.utils.formToObject("#linkedin_msg form"))}function twitterShare(){var d="https://twitter.com/share";var e=jq("#tweet").val();e=escape(e);var c=window.location.pathname;c=escape(c);d+="?text="+e;d+="&url=null"+c;var a="Tweet!";var b="width=600,height=400";window.open(d,a,b)}function limitTwitterChars(){var a=jq("#tweet").val().length;if(a>140){jq("#tweet").val(jq("#tweet").val().substring(0,140))}}function submitforemail(d){var c=d?document.getElementById(d):document.emailform;if(!validateEmail(c.from.value)){try{c.from.focus()}catch(b){}alert('Indtast venligst en gyldig e-mail-adresse i "Fra"-feltet');return false}var a=c.tolist.value.split(",");if(c.tolist.value.length==0||a.length==0||!validateEmail(a[0])){try{c.tolist.focus()}catch(b){}alert('Indtast venligst en gyldig e-mail-adresse i "Til"-feltet');return false}if(c.subject.value.length==0){try{c.subject.focus()}catch(b){}alert("Please enter a subject for the email");return false}return true}function shareemail(j,a){var a=a||"";if(submitforemail((a?"shareemailform"+a:null))){var b=a?jq("#shareemailform"+a):jq("form[name=emailform]");var d=true;var g=b[0].tolist.value;var k=g.split(",").length;var c=R9.globals.tripsaliases;var f=c.split(",");var h=false;var e=0;for(e=0;e<f.length;e++){if(g.indexOf(f[e])!=-1){h=true;break}}if(h){if(k<=1){k=0}if(typeof j!="undefined"&&j==true){d=false;showTripsAjaxReg("#sendemail")}else{addResultToTrip(b[0].searchid.value,b[0].resultid.value,"tripadded"+a);jq("#tripadded"+a).show()}}if(d&&k>0){sharetheemail(b,a)}else{if(d){jq("#emailform"+a).hide();jq("#emailsent"+a).show()}}}}function sharetheemail(c,d){var b=c.serialize();var a="/s/emailresult";jq.ajax({type:"POST",url:a,data:b,success:function(e){jq("#emailform"+d).hide();jq("#emailsent"+d).show();jq("#emailsentmessage"+d).show();if(window.gradientDialogCleanup){gradientDialogCleanup()}},error:function(f,g,e){alert(g)},cache:false})}function closeAllDialogs(){jq(".ui-dialog-content").r9dialog("close");jq(".ui-dialog-content").r9popover("close")}function showTripsAjaxRegAfterClick(a){jq("body").unbind("click.hidepricesel");if(!AjaxReg.alreadyRegistered){showTripsAjaxReg(a)}else{openSaveToMyTripsDialogAfterClick(searchId,resultId,showPrice,providerCode)}}function showTripsAjaxReg(e,d,a,b,c){if(!AjaxReg.alreadyRegistered){AjaxReg.regtype="trips";AjaxReg.searchid="";AjaxReg.ui.register(function(){openSaveToMyTripsDialog(d,a,b,c)})}else{openSaveToMyTripsDialog(d,a,b,c)}}function openSaveToMyTripsDialogAfterClick(d,a,b,c){jq("body").unbind("click.hidepricesel").bind("click.hidepricesel",hidePriceSelections);openSaveToMyTripsDialog(d,a,b,c)}function openSaveToMyTripsDialog(d,a,b,c){if(!checkTripsTos()){showTripsTosBubble(d,a,b,c);return}jq.ajax({type:"POST",url:"/s/run/saveToMyTrips/chooseTrip",data:{searchId:d},dataType:"json",success:function(f){if(f.success){var e=jq(f.html);e.r9dialog({width:510}).find("#saveToMyTripsTabs").tabs();e.r9dialog("option","close",function(){e.r9dialog("destroy");e.remove()});jq("a").blur();jq("#saveToMyTripsResultId").val(a);jq("#saveToMyTripsShowPrice").val(b);jq("#saveToMyTripsProviderCode").val(c)}else{alert(f.error)}},error:function(){alert("Der opstod en uforudset fejl. Pr\u00F8v venligst igen.")},cache:false})}function showSaveToMyTripsControls(b,a){hideSaveToMyTripsControls();jq("#"+b).addClass("selectedTrip");jq("#saveToMyTripsTripId").val(b);jq("#saveToMyTripsTripName").html(a);jq("#saveToMyTripsControls").show()}function hideSaveToMyTripsControls(){jq(".saveToMyTripsTrip").removeClass("selectedTrip");jq("#saveToMyTripsTripId").val("");jq("#saveToMyTripsTripName").html("");jq("#saveToMyTripsControls").hide();jq("#saveToMyTripsDuplicate").hide()}function saveToMyTrips(){jq.ajax({type:"POST",url:"/s/run/saveToMyTrips/save",data:{searchId:jq("#saveToMyTripsSearchId").val(),resultId:jq("#saveToMyTripsResultId").val(),showPrice:jq("#saveToMyTripsShowPrice").val(),providerCode:jq("#saveToMyTripsProviderCode").val(),encodedTripId:jq("#saveToMyTripsTripId").val()},dataType:"json",success:function(a){if(a.success){jq("#saveToMyTrips").html(a.html)}else{if(a.duplicate){hideSaveToMyTripsControls();jq("#saveToMyTripsDuplicate").html(a.error).show()}else{alert(a.error)}}},error:function(){alert("Der opstod en uforudset fejl. Pr\u00F8v venligst igen.")},cache:false})}function saveToNewTrip(){jq("#saveToMyTripsTripId").val("");saveToMyTrips()}function checkTripsTos(){var a=false;jq.ajax({type:"POST",url:"/k/run/tripsTos/check",async:false,dataType:"json",success:function(b){if(b.success){a=b.ok}else{alert(b.error)}},error:function(){alert("Der opstod en uforudset fejl. Pr\u00F8v venligst igen.")},cache:false});return a}function showTripsTosBubble(d,a,b,c){jq.ajax({type:"POST",url:"/k/run/tripsTos/showTosBubble",data:{searchId:d,resultId:a,showPrice:b,providerCode:c},dataType:"html",success:function(f){var e=jq(f);e.r9dialog({width:440});e.r9dialog("option","close",function(){e.r9dialog("destroy");e.remove()});jq("a").blur()},error:function(f,g,e){alert(f.statusText)},cache:false})}function sendTripsTosResponse(e,d,a,b,c){if(e){jq.ajax({type:"POST",url:"/k/run/tripsTos/accept",dataType:"json",success:function(f){if(f.success){closeAllDialogs();openSaveToMyTripsDialog(d,a,b,c)}else{alert(f.error)}},error:function(){alert("Der opstod en uforudset fejl. Pr\u00F8v venligst igen.")},cache:false})}else{jq.ajax({type:"POST",url:"/k/run/tripsTos/showTosRejected",dataType:"html",success:function(f){jq("#tosBubble").html(f)},error:function(g,h,f){alert(g.statusText)},cache:false})}}function inlinelearnmore(a,b){var c="provider="+b;jq.ajax({type:"POST",url:"/s/run/toolbox/learnmoreinline",data:c,dataType:"html",success:function(e){try{showTT(document.getElementById(a),e,"BL")}catch(d){}},error:function(e,f,d){alert(f)},cache:false})}function stopPropagation(a){if(!a){var a=window.event}if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}}function stopPropagationAndDefault(a){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}stopPropagation(a)};

;var jsck_sparkle_da_dk="v428";
/* et=6, mt=28, c=p4, i=sparkle012, v=R114, cc=4, r=none */

