function GoToBooking(action,newWindow){ var url = "https://booking.scandlines.dk/index.html?lang=da"; var d = "20120209"; var nd = new Date(); var y = rpz(d.substr(0,4)); var m = rpz(d.substr(4,2))-1; var day = rpz(d.substr(6,2)); nd.setFullYear(y, m, day+1); var nextNight = "&day="+nd.getDate()+"&month="+(nd.getMonth()+1)+"&year="+nd.getFullYear()+"&hour=0&minute=1"; switch (action){ case "rp-natbillet": url+="&route_code=ROD-PUT"+nextNight if (newWindow) window.open(url); else spawnBookingPopup(url); //alert(url+"&route_code=ROD-PUT"+nextNight); break; default: alert("Unknown action '"+action+"'"); } } function rpz(s){ return parseInt((s.indexOf("0")==0) ? s.substr(1,1):s); } function spawnBookingPopup(bookingURL) { if ((getCountryCode()=='DK') || (getCountryCode()=='DK-PASS')) { if (window.name == "ScandlinesPopup") { window.open(bookingURL); } else { top.location.href = bookingURL; } return; } if (getCountryCode()=='DE') { spawnPopup(bookingURL,"ScandlinesBooking",450,480,1); return; } spawnPopup(bookingURL,"ScandlinesBooking",714,480,1); } function spawnRouteRedirPopup(routeID, routeCC, routeLang, routeDisplay) { var sTmp; if ((sTmp=getCountryCode())!='') routeCC=sTmp; if ((sTmp=getLanguage())!='') routeLang=sTmp; if (routeDisplay=='') routeDisplay='RoutePopup'; spawnRoutePopup('/eprise/Scandlines/Internet/_Common/Routes/RouteRedirector?Route_code='+routeID+'&CC='+routeCC+'&Lang='+routeLang+'&Display='+routeDisplay); } function spawnRoutePopup(routeURL) { if (routeURL.indexOf("CC=")>-1) { var CC = "" + routeURL.split("CC=")[1].split("&")[0]; if (CC == "" || CC == "DK-PASS" || CC == "COM" || CC == "DE") { spawnPopup(routeURL,"ScandlinesPopup",780,450,1); return; } } spawnPopup(routeURL,"ScandlinesPopup",501,450,1); } function spawnMMPopup(spawnURL) { spawnPopupFull(spawnURL,"",500,420,0,"auto","no"); } function spawnPopup(desktopURL,windowName,width,height,flag) { spawnPopupFull(desktopURL,windowName,width,height,flag,"yes","yes"); } function spawnPopupFull(desktopURL,windowName,width,height,flag,scrollbars,status) { var w = 480, h = 340, win; if (document.all || document.layers) { w = screen.availWidth; h = screen.availHeight; } if (windowName == "") { windowName = "_blank"; } var leftPos = (w-width)/2, topPos = (h-height)/2; var resizable = "no"; if (flag==1) { resizable = "yes"; } if (document.all) { win = window.open(desktopURL, windowName, "toolbar=no,location=no,status="+status+",menubar=no,scrollbars="+scrollbars+",width="+width+",height="+height+",resizable="+resizable+", top=" + topPos + ",left=" + leftPos ); } else { win = window.open(desktopURL, windowName, "toolbar=no,location=no,status="+status+",menubar=no,scrollbars="+scrollbars+",width="+width+",height="+height+",resizable="+resizable+",screenY=" + topPos + ",screenX=" + leftPos ); // + ",screenX="+leftpos+",screenY="+topPos ); } win.focus(); } function GoogleClickEvent(n) { var google_conversion_id = 1040665359; var google_conversion_label = "Nf2NCKH-kQEQj5ad8AM"; image = new Image(1,1); image.src = "http://www.googleadservices.com/pagead/conversion/"+google_conversion_id+"/?label="+google_conversion_label+"&script=0"; return; }