//Ajax functions
//w3schools.com
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;
} 

function loadForm(x){
	
	document.getElementById("tab_1").bgColor = "#FF0000";
	document.getElementById("tab_2").bgColor = "#FF0000";
	document.getElementById("tab_3").bgColor = "#FF0000";
	document.getElementById("tab_4").bgColor = "#FF0000";
	
	if(x == 1)
		document.getElementById("tab_1").bgColor = "#C6C600";
	if(x == 2)
		document.getElementById("tab_2").bgColor = "#C6C600";
	if(x == 3)
		document.getElementById("tab_3").bgColor = "#C6C600";
	if(x == 4)
		document.getElementById("tab_4").bgColor = "#C6C600";
		
		
	document.getElementById("loadform_here").innerHTML="Loading selection...";
		
	xmlHttpx=GetXmlHttpObject()
	if (xmlHttpx==null){
  		alert ("Your browser does not support AJAX! \nThis page may not work properly.");
  		return;
  	} 

	
	var url="load_form.php";
	url=url+"?sid="+Math.random();
	url=url+"&x="+x;
	
	xmlHttpx.onreadystatechange=function() { 
		if (xmlHttpx.readyState==4){ 
			document.getElementById("loadform_here").innerHTML=xmlHttpx.responseText;
		}
	};
	xmlHttpx.open("GET",url,true);
	xmlHttpx.send(null);
	

}
