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;
}

function setupXmlHttp(url)
{
	xmlHttp=GetXmlHttpObject();
	url = url.replace(location.protocol+"//"+location.host+"/",'');
	url = location.protocol+"//"+location.host+"/"+url;
	return url;
}


function sendXmlHttp(url)
{
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

//url is the url called for the dynamic html
//id is the id in which the html will be placed
function getHTML(url)
{
	url = setupXmlHttp(url);
	setXmlOnReady(url, onHTMLResponse);
	sendXmlHttp(url);
}

function setXmlOnReady(url, onResponse)
{
	xmlHttp.onreadystatechange=function()
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
			onHTMLResponse(xmlHttp.responseText);
		} 
	};
}

//url is the url called for the dynamic html
//id is the id in which the html will be placed
function send_screen(url)
{
	url = setupXmlHttp(url+"screen/"+screen.width+"/"+screen.height);
	sendXmlHttp(url);
	return false;
}

function send_mobscreen(url)
{
	url = setupXmlHttp(url+"screen/"+screen.height+"/"+screen.height);
	sendXmlHttp(url);
	return false;
}
