// JavaScript Document
var xmlHttp;
var hsetname = "new";

function g(o) {return document.getElementById(o);}

function show(obj) {
	g(obj).style.display = 'block';
}
function hide(obj) {
	g(obj).style.display = 'none';
}

function getHandsets(networktype,hsetname)
{ 
document.getElementById("showhandsets").innerHTML = '<img src="/mobile/networks/images/progressbar.gif" alt="Please Wait..." />';

for (var i=0; i < document.blackspot.ServiceType.length; i++) {
	  		   if (document.blackspot.ServiceType[i].checked)
			{
			  serviceType = document.blackspot.ServiceType[i].value;
			  }
	   }


xmlHttp = GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="lhandsets.cfm";
url=url+"?t="+networktype;
url=url+"&h="+hsetname;

url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);


}


function stateChanged() 
{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	if(xmlHttp.status==200){

	texthandsets = xmlHttp.responseText;

	document.getElementById("showhandsets").innerHTML = texthandsets;

	if(document.getElementById("Name").selectedIndex != 0)
	{
		//document.getElementById("Name").selectedIndex = 0;
	}else{
	document.getElementById("Name").selectedIndex = 0;
	}

		}
	}
}



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 showHandsets(networktype,hsetname) {
	
	if(networktype != ""){
		
			getHandsets(networktype,hsetname);
		
	}else{
		document.write("Please Select a Network Type");
	}
	
		
}

function showHideBlock(panel1, panel2) {
	
	show(panel1);
	hide(panel2);
	
	
	if(panel1 == 'bigservice') {

	//	document.blackspot.Name.value = "";
		document.getElementById("Model").selectedIndex = 0;
		}
	else {
		
	}
}
