function showForm(id)
{
	var objBody = document.getElementsByTagName("body")[0];
		
	var arrayPageSize = getPageSize();
	var arrayPageScroll = getPageScroll();
	
	var ObjForm = document.createElement('div');
	ObjForm.setAttribute('id','overlay');
	ObjForm.style.position = 'absolute';
	ObjForm.style.top = '0';
	ObjForm.style.left = '0';
	ObjForm.style.zIndex = '90';
	ObjForm.style.width = '100%';

	// set height of Overlay to take up whole page and show
	ObjForm.style.height = (arrayPageSize[1] + 'px');
	//ObjForm.style.display = 'block';
	
	objBody.appendChild(ObjForm);	
	
	var lightboxTop = arrayPageScroll[1] + 100;
	
	// create keyboard message
	var objKeyboardMsg = document.createElement("div");
	objKeyboardMsg.setAttribute('id','keyboardMsg');
	objKeyboardMsg.style.height = (arrayPageSize[1] + 'px');
	objKeyboardMsg.style.position = 'absolute';
	objKeyboardMsg.style.top = '0';
	objKeyboardMsg.style.left = '0';
	objKeyboardMsg.style.zIndex = '100';
	objKeyboardMsg.style.width = '100%';
	
	MarginTopTable =  (lightboxTop < 0) ? "0px" : lightboxTop + "px";
	
	//objKeyboardMsg.innerHTML = '<img src="{$phppath}images/spin.gif" border="0" height="15" />';
	objBody.appendChild(objKeyboardMsg);
	
	//objKeyboardMsg.innerHTML = 'press <kbd>x</kbd> to close gffff';
	//objKeyboardMsg.innerHTML = '<br /><div style=padding-left: 11px; padding-right: 25px; text-align: justify;><strong>All rates are :</strong><ul style=margin-top: 0px; margin-left: 18px;><li>Rates above are exclusive of 21% tax and service and per room per night</li><li>High season surcharge<br /><table cellpadding=0 cellspacing=0 border=0 style=width: 100%;><tr><td>01 – 31 August 2008 </td><td>US$ 15.00/room/night</td></tr><tr><td>27 December 2008 – 05 January 2008</td><td>US$ 25.00/room/night</td></tr></table></li></ul></div>';
	
			
	//document.getElementById("overlay").innerHTML = '<img src="images/spin.gif" border="0" height="15" />';
	var xmlHttp;
	try
	{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			var elements = xmlHttp.responseText;
	
			objKeyboardMsg.innerHTML = '<div style="text-align: center; width: 100%;">'+elements+'</div>';
			//objBody.appendChild(objKeyboardMsg);
	
			//alert(elements);
		  //document.getElementById("Type").innerHTML = elements;
		  //document.getElementById('test').innerHTML = "<select name='type'><option value=''>1</option></select>";
		}
	}
		xmlHttp.open("GET","include/chat.php?id=" + id,true);
		xmlHttp.send(null);
	
	
	
}

function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}



//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;


		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function hideLightbox()
{
	// get objects
	ObjForm = document.getElementById('overlay');
	objKeyboardMsg = document.getElementById('keyboardMsg');

	// hide lightbox and overlay
	ObjForm.style.display = 'none';
	objKeyboardMsg.style.display = 'none';
	
	var objBody = document.getElementsByTagName("body")[0];
	
	objBody.removeChild(ObjForm);
	objBody.removeChild(objKeyboardMsg);
	
	// disable keypress listener
	document.onkeypress = '';
}