﻿function GoWBE(arrivalId,departureId, selectBrandWarning, language){
var brand1=document.getElementById("QB_ky");
var brand2=document.getElementById("QB_ca");
var brand3=document.getElementById("QB_pc");
var brand4=document.getElementById("QB_kp");
var selectedbrand=brand1.checked?brand1.value:(brand2.checked?brand2.value:(brand3.checked?brand3.value:(brand4.checked?brand4.value:null)));
if(!selectedbrand){window.alert(selectBrandWarning);return;}


var fw=document.getElementById("QB_wifi");
var fp=document.getElementById("QB_bar");

var adults=document.getElementById("QB_Adults");
var children=document.getElementById("QB_Children");
var rooms=document.getElementById("QB_roomsCount");
var country=document.getElementById("QB_country");

document.location.href="http://webbooking.louvre-hotels.fr/book/switch.aspx?l=" + language +
	"&s="+selectedbrand+
	"&city="+encodeURIComponent(document.getElementById("QB_city").value)+
	"&country="+encodeURIComponent((country.options[country.selectedIndex].text))+
	"&doarrival="+encodeURIComponent(document.getElementById(arrivalId).value)+
	"&dodepart="+encodeURIComponent(document.getElementById(departureId).value)+
		"&a="+(adults.selectedIndex+1)+
	"&k="+(children.selectedIndex)+
    (fw && fw.checked?"&fw=1":"")+
    (fp && fp.checked?"&fp=1":"")+
		"&rn="+(rooms.selectedIndex+1);
}
