var xmlHttp;

function setapplication(str)
{ 
	xmlHttp=GetXmlHttpObject();
	var url="";
	if (xmlHttp==null)
 	{
		 alert ("Browser does not support HTTP Request");
		 return;
 	}
	switch (str)
  	{
		case 1: { url="includes/applicationpart1.php"; break }
		case 2: { url="includes/applicationpart2.php"; break }
		case 3: { url="includes/applicationpart3.php"; break }
		case 4: { url="includes/applicationpart4.php"; break }
		case 5: { url="includes/applicationpart5.php"; break }
		case 6: { url="includes/applicationpart6.php"; break }
		case 7: { url="includes/applicationpart7.php"; break }
		case 8: { url="includes/applicationpart8.php"; break }
		case 9: { url="includes/applicationpart9.php"; break }
	}
	
	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")
 { 
 	document.getElementById("ajaxcountry").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;
}