/* Common JS functions */

// Navigation JS - Required for IE6
sfHover = function() {
	// Navigation
	var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	
	// Find a Retailer
	var sfEls = document.getElementById("retailer").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


// Hide search value on focus
function hide_value(el)
{
	if(el.V) {
	if (el.value == el.V) {
	el.value = '';
	}
	} else {
	el.V = el.value;
	el.value = '';
	}
}

function popi(type, sel_val){
	
	loadXMLDoc();
	url = "../coverage_and_roaming_v4/phone.php?type="+type

	if (type == "model"){
		url += "&make="+sel_val;
	}

	if (xmlhttpObj!=null){
		xmlhttpObj.onreadystatechange=function(){
										if (xmlhttpObj.readyState == "Ready" || xmlhttpObj.readyState == "4"){
											document.getElementById(type+"_td").innerHTML = xmlhttpObj.responseText;
										}
										};
	
		xmlhttpObj.open("GET", url, true);
		xmlhttpObj.send(null);
	
	}else{
  		alert("Your browser does not support XMLHTTP.");
  	}
}
