var xmlHttp
var xmlHttp1
var newValue		
		function showUser(str)
		{ 
		//alert(str);
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
		var url="department.php"
		url=url+"?q="+str
		url=url+"&sid="+Math.random()
		xmlHttp.onreadystatechange=stateChanged 
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		}
		
		function stateChanged() 
		{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		 { 
		// alert(xmlHttp.responseText);
		 document.getElementById("xx").innerHTML=xmlHttp.responseText 
		 document.getElementById('cmbdept').value = "";
		 } 
		}
		
		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 showUser1(str,docname,place,dept)
		{ 
		//alert(docname);
		newValue=str;
		total();
		for(var gm=0;gm<tot;gm++)
		{
			if(newValue==gm)
			{
				document.getElementById("firstOne"+gm).style.display='block';
				document.getElementById("sub"+gm).style.display='none';
			}else{
				document.getElementById("firstOne"+gm).style.display='none';
				document.getElementById("sub"+gm).style.display='block';
			}
		}
		//alert(newValue);
		xmlHttp1=GetXmlHttpObject()
		if (xmlHttp1==null)
		 {
		 alert ("Browser does not support HTTP Request")
		 return
		 }
		var url="find_sub.php"
		url=url+"?doc_name="+docname+"&place="+place+"&dept="+dept;
		url=url+"&sid="+Math.random()
		xmlHttp1.onreadystatechange=stateChanged1 
		xmlHttp1.open("GET",url,true)
		xmlHttp1.send(null)
		}
		
		function stateChanged1() 
		{ 
		if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
		 { 
		 //alert("firstOne"+xmlHttp.responseText );
		 document.getElementById("firstOne"+newValue).innerHTML=xmlHttp1.responseText 
		// document.getElementById('cmbdept').value = "";
		 } 
		}
		
		function GetXmlHttpObject()
		{
		var xmlHttp1=null;
		try
		 {
		 // Firefox, Opera 8.0+, Safari
		 xmlHttp1=new XMLHttpRequest();
		 }
		catch (e)
		 {
		 //Internet Explorer
		 try
		  {
		  xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
		  }
		 catch (e)
		  {
		  xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		 }
		return xmlHttp1;
		}
		
