//<script>
var weatherTrackingString = '/?par=pnv&site=www.pnv.net&promo=0'

//Shows standard pop-up windows
function openw(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=430,width=635,toolbar=yes,location=yes,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,top=150,left=0");
}

function openab(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=425,width=400,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,top=40,left=30");
}

function opensup(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=420,width=450,toolbar=no,location=yes,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,top=40,left=30");
	
}


function opensuper3(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=566,width=566,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,top=40,left=30");
	
}

function openchat(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=500,width=750,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,top=40,left=30");
	
}

function openrand(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=370,width=390,toolbar=no,location=yes,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,top=40,left=30");
	
}

function openfeed(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=440,width=390,toolbar=no,location=yes,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,top=40,left=30");
	
}

function openins(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=580,width=390,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no,top=40,left=150");
	
}

function openrigs(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=400,width=550,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,top=90,left=150");
	
}

function openrigs2(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=395,width=610,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,top=90,left=150");
	
}

function openpnp(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=473,width=566,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,top=150,left=230");
}

function openpnp03(goTo){
	windowVar=window.open(goTo,"extlinkwindow","height=560,width=586,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,top=15,left=230");
}

function openw2(address){
	var windowVar=window.open(address,"extlinkwindow");
	windowVar.focus();
}

 function remote(url){
      window.opener.location=url
}
      
      
function discovery() {
winView='titlebar=no,status=no,location=no,toolbar=no,resizable=no,directories=no,screenX=0,screenY=0,height=580,width=790,left=0,top=0,innerHeight=715,innerWidth=1013';
window.open('http://discovery.www.e-mach.com/servlet/com.metalroad.core.Launch' + uniquePath() + '?referrer=equipmentworld.com', 'discwin', winView).focus();
 }
 
function opent(address){
	var windowVar=window.open(address,"traffic","height=400,width=430,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,top=150,left=100");
	windowVar.focus();
}
function valQuickSearch(formObject){
var myInput	= formObject.SearchString;
var kw		= myInput.value;
if(!kw){
alert("Please enter a keyword"); 
warnInput(myInput); 
return false;
} else if (formObject.destination[1].checked == true){
		openw("http://search.aol.com/dirsearch.adp?query=" + kw);		
		return false;
	}
	else {
		return true; //There is input. Go ahead search PNV.
		}
}
//Form data valiation utility functions
function warnInput( inputField ){
inputField.focus(); inputField.select(); return;
}
function isDigit (c){ return ((c >= "0") && (c <= "9")) }
function isInteger(x){
	if (x.length == 0) return false;
	for (i = 0; i < x.length; i++)
    {
        // Check that current character is a digit.
        var c = x.charAt(i);
        if (!isDigit(c)) return false;
    }
    // All characters are digits.
    return true;
}
function isCurrency(s){
	if (s.length == 0) return false;
	for (i = 0; i < s.length; i++)
    {
        // Check that current character is a digit or a '.'
        var c = s.charAt(i);
        if (!isDigit(c) && c!='.') return false;
    }
    return true;	
}
function validRadio (radioButtonGroup){
	var c = radioButtonGroup.length;
	for (i=0; i < c; i++){ if(radioButtonGroup[i].checked) return true; }
	radioButtonGroup[0].focus();
	return false;
}
function radioVal (radioButtonGroup){ 
	var c = radioButtonGroup.length;
	for (i=0; i < c; i++){ if(radioButtonGroup[i].checked) return radioButtonGroup[i].value; }
	return null;
}
function validSelect (box){
	if (box.selectedIndex == "-1") return false;
	else
		if (box.options[box.selectedIndex].value == "-1"){
			box.focus(); return  false;
		}else return true;
}
function selectVal (box){ return box.options[box.selectedIndex].value }
function validateZip (obj) {
	//if (isInteger(obj.zip_code.value)) {
	if (obj.zip_code.value) {
		return true;
	} else {
		alert("Please enter a city or U.S. zip code!")
		warnInput(obj.zip_code);
		return false;
	}
}
// String Validation
function isUSZip(s){
if(isInteger(s) && s.length == 5) return true;
	else return false;
}
function isTime (s){
	if (s==null) return false;
	var colPos		= s.indexOf (":");
	if (colPos==0) return false;
	var myHour		= parseInt(s.substring(0, colPos))
	var myMinutus	= parseInt(s.substring( colPos+1, s.length ))
	if (( myHour >= 0 && myHour <= 12 )  && ( myMinutus >= 0 && myMinutus <= 59 )) return true;
		else return false;         
}
function isEmail (s){   
	if (!s) return false;
	// there must be >= 1 character before "@", so we
	// start looking at character position 1 
	// (i.e. second character)
	var i = 1;
	var sLength = s.length;
    // look for "@"
    while ((i < sLength) && (s.charAt(i) != "@")){ i++ }
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;
    // look for "."
    while ((i < sLength) && (s.charAt(i) != ".")){ i++ }
    // there must be at least one character after the "."
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}
function isURL(s){
	if (!s) return false;
	var s1 = s.toLowerCase()
	if( (s1.substring(0,7) != 'http://') && 
	    (s1.substring(0,6) != 'ftp://' ) && 
	    (s1.substring(0,7) != 'mailto:')  ) return false;
		else return true;
}
function isDate( dateIn ){
	var d1 = new Date (dateIn);
	var x  = d1.getMonth() + 1;
	var xMonth = ((x <= 9 ) ? ('0' + x) : x);
	var y  = d1.getDate();
	var yDate  = ((y <= 9 ) ? ('0' + y) : y);
	var z  = d1.getFullYear();
	var zYear  = z;
	var resultDate = xMonth + '/' + yDate + '/' + zYear;
	if (resultDate == dateIn) return true;
	else return false;
}
function containsSpases(s){ return  s.indexOf(' ') > -1; }
function setDate(formObject, sName){
	var t =	selectVal(eval("formObject.mMonth"  + sName)) + "/" +
	selectVal(eval("formObject.mDay"    + sName))   + "/" +
	selectVal(eval("formObject.mYear"   + sName));
	var myDateObectj = eval ("formObject." + sName)
	if (!isDate(t)) {alert(t + " is not a valid date!"); return false;}
		else {myDateObectj.value = t; return true;}
}
function validateUSPhone(frmObj, fldObj) {
var p1 = eval ( "frmObj." + fldObj.name + "_phone_part_1" );
if (!isInteger(p1.value) || p1.value.length != 3) {alert("Please enter area code!"); warnInput(p1); return false;}
var p2 = eval ( "frmObj." + fldObj.name + "_phone_part_2" );
if (!isInteger(p2.value) || p2.value.length != 3) {alert("Please enter first part of the number!"); warnInput(p2); return false;}
var p3 = eval ( "frmObj." + fldObj.name + "_phone_part_3" );
if (!isInteger(p3.value) || p3.value.length != 4) {alert("Please enter last part of the number!"); warnInput(p3); return false;}
return true;
}
function getPointType() {
	this.checked = true
	document.pointsForm.submit()
}

//start multibox script

var offerCount = 5;
var offerTimer = null;

  function move_in(img_name,img_src) {
    if(document[img_name]){
      document[img_name].src=img_src;
    }
  }

  function move_out(img_name,img_src) {
    if(document[img_name]){
      document[img_name].src=img_src;
    }
  }
 

  function getElemRefs(id) {
    var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
    if (el) el.css = (el.style)? el.style: el;
    return el;
  }
  
  
  function showLayer(id) {
    var lyr = getElemRefs(id);
    if (lyr && lyr.css) {
      lyr.css.display = "";
      lyr.css.visibility = "visible";
    }
  }

  function hideLayer(id) {
    var lyr = getElemRefs(id);
    if (lyr && lyr.css) {
      lyr.css.display = "none";
      lyr.css.visibility = "hidden";
    }
  }
  
  function showOffer(offerID, killTimer, multibox) {
    hideAllOffers(multibox);
    hideAllOfferButtons(multibox);
    move_in('num'+offerID+'_'+multibox,'/content/homepage/images/'+multibox+'_num'+offerID+'_on.gif');

    showLayer('lyr'+offerID+'_'+multibox);
    
    if (killTimer) {
      if(offerTimer) clearTimeout(offerTimer);
    } 
  }
  
  function hideAllOffers(multibox) {
    for (i = 1; i <= offerCount; i++) {
      hideLayer('lyr'+i+'_'+multibox);
    } 
  }
  
  function hideAllOfferButtons(multibox) {
    for (i = 1; i <= offerCount; i++) {
      move_out('num'+i+'_'+multibox,'/content/homepage/images/'+multibox+'_num'+ i +'_off.gif');    
    }   
  } 
  
  function offerSwitcher(currentOffer,totalOffer) {
    if (currentOffer < totalOffer)
      currentOffer++;
    else
      currentOffer = 1;
      
    showOffer(currentOffer, totalOffer);
      
    if(offerTimer) clearTimeout(offerTimer);
    offerTimer = setTimeout("offerSwitcher("+ currentOffer + "," + totalOffer + ")", 5000); 
  }
