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) {
	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();
}