var xmlHttpCollege;
var xmlHttpDept;

function showCollege(str)
{ 
	xmlHttpCollege=GetXmlHttpObject()
	xmlHttpDept=GetXmlHttpObject()
	if (xmlHttpCollege==null)
	 {
		 alert ("Browser does not support HTTP Request");
		 return;
	 }
	var url="pgs/getdetails.php";
	url=url+"?q="+str+"&typ=college";
	url=url+"&sid="+Math.random();
	
	//prompt("Here",url);
	
	xmlHttpCollege.onreadystatechange=stateChanged ;
	xmlHttpCollege.open("GET",url,true);
	xmlHttpCollege.send(null);
}

function showDept(str)
{ 
	xmlHttpCollege=GetXmlHttpObject()
	xmlHttpDept=GetXmlHttpObject()

	if (xmlHttpDept==null)
	 {
		 alert ("Browser does not support HTTP Request");
		 return;
	 }
	var url="pgs/getdetails.php";
	url=url+"?q="+str+"&typ=dept";
	url=url+"&sid="+Math.random();
	
//	prompt("Here",url);
	
	xmlHttpDept.onreadystatechange=stateChanged ;
	xmlHttpDept.open("GET",url,true);
	xmlHttpDept.send(null);
}


function stateChanged()
{ 
	if (xmlHttpCollege.readyState==4 || xmlHttpCollege.readyState=="complete")
		document.getElementById("divCollege").innerHTML=xmlHttpCollege.responseText ;

	if (xmlHttpDept.readyState==4 || xmlHttpDept.readyState=="complete")
			document.getElementById("divDept").innerHTML=xmlHttpDept.responseText ;

}


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;
}
