var xmlHttp = createXmlHttpRequestObject();
function createXmlHttpRequestObject()
{
	var xmlHttp;
	if(window.ActiveXObject)
	{
		try
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp = false;
		}
	}
	else
	{
		try
		{
			xmlHttp = new XMLHttpRequest();
		}
		catch (e)
		{
			xmlHttp = false;
		}
	}
	if (!xmlHttp)
		alert("Error creating the XMLHttpRequest object.");
	else
		return xmlHttp;
}

function GetScreenSize()
{
	var ses=document.getElementById('id_ses');
	var is_cook=document.getElementById('id_is_cook');
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{
		var scr_width = screen.width;
		var scr_height = screen.height;
		var scr_depth = screen.colorDepth;
		xmlHttp.open("GET", "/modules/stat/stat_ajax.php?m=ajax&size="+scr_width+"x"+scr_height+"&color="+scr_depth+"&z="+Math.random()+"&ses="+ses.value+"&iscook="+is_cook.value, true);
		xmlHttp.onreadystatechange = handleServerResponseScreen;
		xmlHttp.send(null);
	}
	else
	setTimeout('GetScreenSize()', 1000);
}

function handleServerResponseScreen()
{
	if (xmlHttp.readyState == 4)
	{
		if (xmlHttp.status == 200)
		{
			xmlResponse = xmlHttp.responseXML;
			xmlDocumentElement = xmlResponse.documentElement;
			helloMessage = xmlDocumentElement.firstChild.data;
			if(helloMessage!='0')
			{
			//alert(helloMessage);
			}
			if(helloMessage=='0') 
			{

			}
		}
	else
	{
		alert("There was a problem accessing the server: " +xmlHttp.statusText);
	}
	}
}

function al()
{
	alert(123);
}

