// Variables
var NumberOfPhones = 2;

function sendZip(obj) {
	url = "http://coverage.sprintpcs.com/IMPACT.jsp?mapzip=" + obj + "&covType=sprint&returnURL=http://nextelonline.nextel.com/NASApp/onlinestore/en/Action/DisplayPhones?audience=INDIVIDUAL" + obj;
	window.open(url,"new");
}

function prm(myDesiredValue) {
	var url, tokens, myUrlVar, aux;
	var _tokenSeparator, _varSeparator, _equal;	
		
	_tokenSeparator = "?";
	_varSeparator = "&";
	_equal = "=";
	
	var url = document.URL;
	var tokens = url.split(_tokenSeparator);
	if (tokens.length > 1) {
		var myUrlVar = tokens[1].split(_varSeparator);
	
		i=0;	
		while (i < myUrlVar.length) {
			aux = myUrlVar[i];
			aux = aux.split(_equal);
			if (myDesiredValue == aux[0]) return aux[0] + "=" + aux[1];
			i++;
		}
	}
}

function mPop(url) {
	var _w = 800; 
	var _h = 700; 
	PopWindow(url, _w, _h);
}

function mPop1(url) {
	var _w = 1124; 
	var _h = 768; 
	PopWindow(url, _w, _h);
}

function mPop2(url) {
	var _w = screen.width - 10; 
	var _h = screen.height - 30; 
	PopWindow(url, _w, _h);
}

function mPopCustom(url, width, height) {
	var _w = width; 
	var _h = height; 
	PopWindow(url, _w, _h);
}

function PopWindow(strURL, width, height) {                      
	launchCenter(strURL, '_blank', width, height, 'scrollbars=yes,toolbar=yes,location=yes,menubar=yes,resizable=yes');
}

function launchCenter(url, name, width, height, winstyle) {
	var str = "height=" + height + ",innerHeight=" + height;
	str += ",width=" + width + ",innerWidth=" + width;  
	if (window.screen) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;
		var xc = (aw - width) / 2;
		var yc = (ah - height) / 2;
		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;  
	}
	return window.open(url, name, str + "," + winstyle);
}
 
// This function toggles the legal disclaimers for the different phones. Change the NumberOfPhones variable at the top according to the page you're working on

function switchLegal(ID) {
	//alert(ID);
	var NumberOfPhones = 6;
	for(i=0; i<NumberOfPhones; i++) document.getElementById("disclaimer" + i).style.display = "none";
	document.getElementById("disclaimer" + ID).style.display = "block";
}

