

var xmlHttp, xmlHttp1, xmlHttp2;
function select_projects()
{ 
 
xmlHttp = GetXmlHttpObject();
if (xmlHttp==null)
   { alert ("Browser does not support AJAX technology"); return; }

	npo = document.getElementById("state_id").value;
	if(npo=='')
	{
		alert("Please Select The Donor");
		return false;
	}
	//alert(npo);
	
	var url = "js/ajax/client_npo.php?state_id=" + npo;
	xmlHttp.onreadystatechange = stateChanged ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	document.getElementById("purchase_mma_select").style.display='none';
}




	function stateChanged() 
	{ 
	  if (xmlHttp.readyState == 1) /* show bussy for getting result from DB */ 
		 { 
        document.getElementById("sub").innerHTML = '&nbsp;<img src=images/progress-bar.gif border=0 /> Please wait while checking ....'; 
     	} 		
	else if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
	 document.getElementById("sub").innerHTML=xmlHttp.responseText ;
	// document.getElementById("track").focus();
	 } 
	}
	
	function select_donor()
{ 
xmlHttp1 = GetXmlHttpObject();
if (xmlHttp1==null)
   { alert ("Browser does not support AJAX technology"); return; }

	project = document.getElementById("project").value;
	if(project=='')
	{
		alert("Please Select The Project");
		return false;
	}
	
	
	var url = "ajax/client.php?project=" + project;
	xmlHttp1.onreadystatechange = stateChanged1 ;
	xmlHttp1.open("GET",url,true);
	xmlHttp1.send(null);
}




	function stateChanged1() 
	{ 
	  if (xmlHttp1.readyState == 1) /* show bussy for getting result from DB */ 
		 { 
        document.getElementById("Donor").innerHTML = '&nbsp;<img src=../images/purchase-mma-loader.gif border=0 /> Please wait while checking ....'; 
     	} 		
	else if (xmlHttp1.readyState==4 || xmlHttp.readyState=="complete")
	 { 
	 document.getElementById("Donor").innerHTML=xmlHttp1.responseText ;
	// document.getElementById("track").focus();
	 } 
	}
	
	





	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;
		}
