﻿function goBook(brand,language){
var wifiParameter, barParameter;

if(document.getElementById("QuickBooking_Wifi").checked)
	wifiParameter="&fw=1";
else
	wifiParameter="";
	/*
if(document.getElementById("QuickBooking_BestRate").checked)
	barParameter="&fp=1";
else
	barParameter="";
*/
var adults=document.getElementById("QuickBooking_Adults");
var children=document.getElementById("QuickBooking_Children");
var rooms=document.getElementById("QuickBooking_Rooms");
document.location.href="http://webbooking.louvre-hotels.fr/book/switch.aspx?s=LH&l=" + language +
	"&city=" + encodeURIComponent(document.getElementById("QuickBooking_City").value)+
	"&country="+document.getElementById("QuickBooking_Country").value+
	"&doarrival="+encodeURIComponent(document.getElementById("QuickBooking_CheckIn").value)+
	"&dodepart="+encodeURIComponent(document.getElementById("QuickBooking_CheckOut").value)+
	"&a="+(adults.selectedIndex+1)+
	"&k="+(children.selectedIndex)+
	wifiParameter + barParameter +
	"&rn="+(rooms.selectedIndex+1)+
	"&gtr=1";
}
function goBookIDF(brand,language){
var wifiParameter, barParameter;

if(document.getElementById("QuickBooking_Wifi").checked)
	wifiParameter="&fw=1";
else
	wifiParameter="";
	/*
if(document.getElementById("QuickBooking_BestRate").checked)
	barParameter="&fp=1";
else
	barParameter="";
*/
var adults=document.getElementById("QuickBooking_Adults");
var children=document.getElementById("QuickBooking_Children");
var rooms=document.getElementById("QuickBooking_Rooms");
document.location.href="http://webbooking.louvre-hotels.fr/book/switch.aspx?s=LH&l=" + language +
	"&city=" + encodeURIComponent(document.getElementById("QuickBooking_City").value)+
	"&country="+document.getElementById("QuickBooking_Country").value+
	"&doarrival="+encodeURIComponent(document.getElementById("QuickBooking_CheckIn").value)+
	"&dodepart="+encodeURIComponent(document.getElementById("QuickBooking_CheckOut").value)+
	"&a="+(adults.selectedIndex+1)+
	"&k="+(children.selectedIndex)+
	wifiParameter + barParameter +
	"&rn="+(rooms.selectedIndex+1)+
	"&gtr=1&WT.mc_id=lh1120";
}


function AddPopups()
{
	var links=document.getElementsByTagName("a");
	for (var li=0;li<links.length;li++)
	{
		if(links[li].href.indexOf("/popup/")>0 && links[li].target=="_blank")
		{
			links[li].href="javascript:window.open('"+links[li].href+"','popup','status=0, height=360, width=436, resizeable=0');void(null)";
			links[li].target="";
		}
	}
}

function goBookOffre(brand,language, rateCode, debOffre, finOffre){
var wifiParameter, barParameter;

if(document.getElementById("QuickBooking_Wifi").checked)
	wifiParameter="&fw=1";
else
	wifiParameter="";
	/*
if(document.getElementById("QuickBooking_BestRate").checked)
	barParameter="&fp=1";
else
	barParameter="";
*/
var adults=document.getElementById("QuickBooking_Adults");
var children=document.getElementById("QuickBooking_Children");
var rooms=document.getElementById("QuickBooking_Rooms");
document.location.href="http://webbooking.louvre-hotels.fr/book/switch.aspx?s="+ brand +
	"&l=" + language +
	"&city=" + encodeURIComponent(document.getElementById("QuickBooking_City").value)+
	"&country="+document.getElementById("QuickBooking_Country").value+
	"&doarrival="+encodeURIComponent(document.getElementById("QuickBooking_CheckIn").value)+
	"&dodepart="+encodeURIComponent(document.getElementById("QuickBooking_CheckOut").value)+
	"&a="+(adults.selectedIndex+1)+
	"&k="+(children.selectedIndex)+
	wifiParameter + barParameter +
	"&rn="+(rooms.selectedIndex+1)+
	"&rc="+rateCode+
	"&minf="+debOffre+
	"&maxf="+finOffre+
	"&gtr=1";
}
