function GetXmlHttpObject1()
  {  
  var xmlHttp;
  try
    {    
		// Firefox, Opera 8.0+, Safari    
		xmlHttp=new XMLHttpRequest();   
		 return xmlHttp;
	}
  catch (e)
    {    
		// Internet Explorer    
		try
      {   
	  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");  
	  return xmlHttp;
	  }
    catch (e)
      {      
	  try
        {        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");  
				return xmlHttp;
		}
      catch (e)
        {        alert("Your browser does not support AJAX!");       
				return false;       
		}      
	   }    
	}  
}


function Fillsim(spnId, ctlId, netid,mobid,tariff){
	//alert("ctlId");
    var xmlHttpobj;
	var url = wsUrl +"simupgrade.asp";
	url=url + "?ctlId="+ctlId;
    url=url + "&netid="+netid;
	url=url + "&mobid="+mobid;
	url=url + "&tariff="+tariff;
	//alert(url);
    url = url + "&rnd=" + Math.random();
	xmlHttpobj = GetXmlHttpObject1(); 
    xmlHttpobj.onreadystatechange = function(){StateChangedsim(xmlHttpobj, spnId)};
	xmlHttpobj.open("GET", url , true);
	xmlHttpobj.send(null);
}
function StateChangedsim(xmlHttpobj, spnId) { 
    if (xmlHttpobj.readyState == 4 || xmlHttpobj.readyState =="complete"){
		document.getElementById(spnId).innerHTML = xmlHttpobj.responseText;
		}else{// For Loading...		
	}
} 

function redirectSimhandset(id)
{
	//alert(id);
if (id!=0)
	{
		{
			window.location.href =wsUrl+"dealset.asp?id="+id;
		}
	}
}


function submitPhoneType(phonename)
{
	if(document.form4.phoneType.value=="Contract")
	{
		document.form4.action = "Phone_Deal.asp?Ph=" + phonename;
		document.form4.submit();
	}
	
	else if(document.form4.phoneType.value=="PayG")
	{
		document.form4.action = "Phone_Dealpayg.asp?Ph=" + phonename;
		document.form4.submit();
	}
	else if(document.form4.phoneType.value=="SimFree")
	{
		document.form4.action = "Phone_Dealsimfree.asp?Ph=" + phonename;
		document.form4.submit();
	}
	else if(document.form4.phoneType.value=="Clearance")
	{
		document.form4.action = "clearance-deals.asp?Ph=" + phonename;
		document.form4.submit();
	}
}

function submitUpgrade(val)
{ 

	document.frmsearch.action ="upgrade-phones.asp";
	document.getElementById("hidUpgrade").value =val;
	document.frmsearch.submit();

}

