var xmlHttp

function showUser(str)
{  
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
 	{
		alert ("Browser does not support HTTP Request")
	return
	}
	
	var country=document.rform1.country_id.value;  // Getting continent
	var buyer=document.rform1.buyer_id.value; // Getting Buyer
	var enrollment=0;
	var product=0;
	
	//alert(country);
	
	document.rform1.sub_tot_amount.value="00.00";
	document.rform1.currency1.value="";
	document.rform1.tot_amount.value="00.00";
	document.rform1.currency2.value="";
		
	if (buyer==1)
	{	 
		var enrollment=document.rform1.enrollment.value; // Getting enrollment
		// Getting Products
		for (counter = 0; counter < document.rform1.packages.length; counter++) 
		{
			// If a radio button has been selected it will return true
			// (If not it will return false)
			if (document.rform1.packages[counter].checked)
			{
			product = counter+1;
			}
		}
		//Define & send the parameters 
		var param=country + "," + buyer + "," + enrollment + "," + product;
		if(enrollment != 0)
		{			
			var url="ajax.php";
			url=url+"?q="+param;
			xmlHttp.onreadystatechange=stateChanged 
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)	
		}
	}
	else if(buyer==2) // Buyer category two
	{
		
		var param=country + "," + buyer;
				
			var url="ajax.php";
			url=url+"?q="+param;
			xmlHttp.onreadystatechange=stateChanged 
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)	
	}
	else if(buyer==3) // Buyer category three [Adult Student]
	{
		var param=country + "," + buyer;
			
			var url="ajax.php";
			url=url+"?q="+param;
			xmlHttp.onreadystatechange=stateChanged 
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)	
		
	}
	else if(buyer==5) // Buyer category three [Adult Student]
	{
		var param=country + "," + buyer;
			
			var url="ajax.php";
			url=url+"?q="+param;
			xmlHttp.onreadystatechange=stateChanged 
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)	
		
	}
	else if(buyer==4) // Buyer Category four [business]
	{
		var employment=document.rform1.employment.value; // Getting enrollment
		
		// Getting Products
		for (counter = 0; counter < document.rform1.packages.length; counter++) 
		{
			// If a radio button has been selected it will return true
			// (If not it will return false)
			if (document.rform1.packages[counter].checked)
			{
			product = counter+1;
			}
		}
		//Define & send the parameters 
		var param=country + "," + buyer + "," + employment + "," + product;
		if(employment != 0)
		{		
			var url="ajax.php";
			url=url+"?q="+param;
			xmlHttp.onreadystatechange=stateChanged 
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)	
		}
	}

	/* if(country != "" || buyer != "" || enrollment != "" || year1 != "" || product != "")
	{
	var url="ajax.php";
	url=url+"?q="+param;
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	}*/	
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{   
		document.getElementById("country_test").innerHTML=xmlHttp.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;
}