var xmlHttp

function xDeals(s1,s2)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }   
sLoad();
var phone = document.dfform.phone.value;
var url="../includes/xdeals.asp";
url=url+"?id="+phone + "&"+s2+"="+s1;
url=url+"&sid="+Math.random();
//alert (url);
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function sLoad()
{
document.getElementById("xdeals").innerHTML = "<table class='dealtable1' sellspacing='1'><tr><td colspan='8' class='nav'>.....Searching Please Wait.....</td></tr><tr><td colspan='8' height='200'></td></tr></table>";
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
 { 
  document.getElementById("xdeals").innerHTML=xmlHttp.responseText;
 }
}

function myDeals(s2) { 
	var newIndex = eval("document.dfform."+s2+".selectedIndex;"); 
//	if ( newIndex == 0 ) { 
//		alert( "Please select a " + s2 + "!" ); 
//	} else { 
//alert (newIndex);
		var p = eval("document.dfform." + s2 + ".options[" + newIndex + "].value;");
//		alert(p);
	
document.dfform.text.selectedIndex=0;
document.dfform.incentive.selectedIndex=0; 
document.dfform.network.selectedIndex=0; 
document.dfform.contract.selectedIndex=0; 
document.dfform.minutes.selectedIndex=0; 
document.dfform.tariff.selectedIndex=0; 
eval("document.dfform." + s2 + ".selectedIndex=" + newIndex); 
xDeals(p,s2);
//} 

}

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;
}