
var xmlHttp;

var postString = "";

function GetXmlHttpObject()
{ 
	var objXMLHttp=null;
	
	if (window.XMLHttpRequest)
	{		
		objXMLHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{	
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}	
	
	return objXMLHttp;
}
 
 var postUrl = "templates/test123.php";
 
function callAjax(str,p)
{	

	//var fa = document.getElementById('fas').value;

	var pos = str;

	try
	{
		xmlHttp=GetXmlHttpObject();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			alert("AJAX will not support in this browser");
		}
	}
	
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");	
	}
	//alert("ft="+ft+"&fb="+fb+"&co="+co+"&sl="+sl+"&cu="+cu+"&fa="+fa+"&po="+po+"&wco="+wco+"&wcu="+wcu+"&pg=1");
	postString = 'position=' + pos;
	
	document.getElementById('statsDiv').innerHTML = "<img src='images/ajax-loader.gif'>";
	
	document.getElementById('title1').innerHTML = "2008 Top 10 Players of Category/"+str;
	
	xmlHttp.onreadystatechange=checkStatus;
	
	xmlHttp.open('post', postUrl, true);	

	xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8'); 	
	
	xmlHttp.setRequestHeader('Content-length', postString.length);
	
	xmlHttp.setRequestHeader('Connection', 'close');
		
	xmlHttp.send(postString);
	
	return false;
}

function callAjax1(str,p)
{	

	//alert(firstSRC);
	
	var pos = str;

	try
	{
		xmlHttp=GetXmlHttpObject();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			alert("AJAX will not support in this browser");
		}
	}
	
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");	
	}
	//alert("ft="+ft+"&fb="+fb+"&co="+co+"&sl="+sl+"&cu="+cu+"&fa="+fa+"&po="+po+"&wco="+wco+"&wcu="+wcu+"&pg=1");
	postString = 'position=' + pos+'&pitch=' + p;
	
	document.getElementById('statsDiv1').innerHTML = "<img src='images/ajax-loader.gif'>";
	document.getElementById('title1').innerHTML = "2008 Top 10 Players of Category/"+str;
	xmlHttp.onreadystatechange=checkStatus1;
	
	xmlHttp.open('post', postUrl, true);	

	xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8'); 	
	
	xmlHttp.setRequestHeader('Content-length', postString.length);
	
	xmlHttp.setRequestHeader('Connection', 'close');
		
	xmlHttp.send(postString);
	
	return false;
}


function checkStatus() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{

		var response = xmlHttp.responseText;
		
		//alert(response);
			
			document.getElementById('statsDiv').innerHTML = response;
		
		
		
	} 
} 


function checkStatus1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{

		document.getElementById('statsDiv1').innerHTML = "<img src='images/ajax-loader.gif'>";
		var response = xmlHttp.responseText;
		
		//alert(response);
			
			document.getElementById('statsDiv1').innerHTML = response;
		
		
		
	} 
} 

