var xmlHttp, xmlHttp1
function searchDeal()
{ 
	if(window.location.pathname != "/best-deals.asp")
	{
		//alert ("searchDeal");
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  }   
		var url="/includes/search.asp";
		url=url+"?sid="+Math.random();
		//alert (url);
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		}
		function stateChanged() 
		{ 
		if (xmlHttp.readyState==4)
		 {
		 document.getElementById("searchBox").innerHTML=xmlHttp.responseText;
		  }
	}
}


function topJump()
{ 
//alert ("topJump");
xmlHttp1=GetXmlHttpObject();
if (xmlHttp1==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }   
var url="/includes/mobile.asp";
url=url+"?sid="+Math.random();
//alert (url);
xmlHttp1.onreadystatechange=stateChanged1;
xmlHttp1.open("GET",url,true);
xmlHttp1.send(null);
}
function stateChanged1() 
{ 
if (xmlHttp1.readyState==4)
 {
 document.getElementById("topJump").innerHTML=xmlHttp1.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;
}

				  
function popUp(URL,PopWidth,PopHeight) {
day = new Date();
id = day.getTime();
var swidth, sheight
swidth = (screen.width - PopWidth)/2;
sheight = (screen.height - PopHeight)/2;
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+PopWidth+",height="+PopHeight+",left ="+swidth+",top="+ sheight +"');");
//eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+PopWidth+",height="+PopHeight+",left =240,top=90');");
}
document.onload = searchDeal(), topJump();

