var xmlHttp

function getBooking(klub,sport,hold,id,dagnr,y,m,action,tid,bane)
{ 
	hintID = "booking_" + id;

	xmlHttp=bGetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}

	var url="main/readBooking.php";
	url=url+"?klub="+klub;
	url=url+"&sport="+sport;
	url=url+"&hold="+hold;
	url=url+"&booking_id="+id;
	url=url+"&dagnr="+dagnr;
	url=url+"&y="+y;
	url=url+"&m="+m;
	url=url+"&action="+action;
	url=url+"&tid="+tid;
	url=url+"&bane="+bane;
	url=url+"&sid="+Math.random();

	xmlHttp.onreadystatechange=BookingstateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function BookingstateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
		document.getElementById(hintID).innerHTML=xmlHttp.responseText;
	} 
}

function bGetXmlHttpObject()
{
	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;
}
