// JavaScript Document


function getCourse(cID){
	document.getElementById("box").style.cursor = "wait";
	bookHttp=GetXmlHttpObject()
	if (bookHttp==null){
	  alert ("Your browser does not support AJAX!");
	  return;
	} 
	var url="includes/training/booking.inc.php?cid=" + cID;
	url=url+"&sid="+Math.random();
	bookHttp.onreadystatechange=stateChangedBooking;
	bookHttp.open("GET",url,true);
	bookHttp.send(null)
}

function stateChangedBooking() 
{ 
	if (bookHttp.readyState==4)
	{ 
	//document.getElementById("graph_1year").style.background-image = "url(../includes/user/stats/images/graph_1year.jpg)";
	document.getElementById("booking_container").innerHTML=bookHttp.responseText;
	document.getElementById("box").style.cursor = "default";

	}
	else{
		document.getElementById("booking_container").innerHTML= "<center>Loading Booking Form</center>";
	}
}
	
function trainBooking(cID){
	var height = 127;
	
	var box = document.getElementById('box');
	box.style.border = '1px solid #000000';
	box.innerHTML = '<div id="booking_container" class="graphs"></div>';
	
	var booking_container = document.getElementById('booking_container');
	booking_container.style.visibility = 'visible';
	booking_container.style.display = 'block';
	
	setOpacity(booking_container,100);
	getCourse(cID);
	showOverlay(438,height);	
}