// JavaScript Document

//window.onload = rotate;

var xmlHttp

// start bookfor
function bookfor() {	

if (document.getElementById("g_type").value == "Twin Bed")
{
	document.getElementById("showguest").innerHTML = "<select name='g_guest' class='black12' id='g_guest' onchange='showroom_rate()' onblur='showroom_rate()'><option value='2'>2</option></select>";
}
else
{
	document.getElementById("showguest").innerHTML = "<select name='g_guest' class='black12' id='g_guest' onchange='showroom_rate()' onblur='showroom_rate()'><option value='1' selected='selected'>1</option><option value='2'>2</option> </select>";
}
showroom_rate();

}



// end

//start checkpayment code
function showroom_rate() {	

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="checkroom.asp";
	url=url+"?g_type="+document.getElementById("g_type").value+"&g_guest="+document.getElementById("g_guest").value;
	//url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=showcode;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function showcode() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("room_info").innerHTML=xmlHttp.responseText;
document.getElementById("add_guest").innerHTML="<div align='left' style='border:#D2961A solid 1px; border-top:none; padding: 3px 5px'></div> ";
//There will be an additional charges of B$25 for each guest
}
}
// end


function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
