function changeImages() {
	d = document;
	if (d.images) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (d.layers) {img = findElement(changeImages.arguments[i],0);}
			else {img = d.images[changeImages.arguments[i]];}
			if (img) {img.src = changeImages.arguments[i+1];}
		}
	}
}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function validateOnSubmit() {
    var elem;
    var errs=0;
    if (!validateEmail  (document.forms.demo.email, 'inf_email', true)) errs += 1; 
	if(document.forms.demo.email.value == "" || document.forms.demo.email.value == "Enter email")
	{alert('Please Enter a Mail Id');}
    else if (errs>=1){
	alert('Email address is invalid. Please try again.');
    }else{
	alert('Thank you for subscribing to the SatelliteSales.com Special Offer Alerts newsletter. You will shortly begin receiving the latest Dish Network deals and information.');
    }
    return (errs==0);
  };
 function popUpsize(url) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=475,height=385,left=300,top=200');
} 
			
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		over_topnav = newImage(/*URL*/'../topnavimgs/home_on.gif');
		over_topnav2 = newImage(/*URL*/'../topnavimgs/specials_on.gif');
		over_topnav3 = newImage(/*URL*/'../topnavimgs/channels_on.gif');
		over_topnav4 = newImage(/*URL*/'../topnavimgs/cost_on.gif');
		over_topnav5 = newImage(/*URL*/'../topnavimgs/lineup_on.gif');
		over_topnav6 = newImage(/*URL*/'../topnavimgs/local_on.gif');
		over_topnav7 = newImage(/*URL*/'../topnavimgs/equipment_on.gif');
		over_faqs_off = newImage(/*URL*/'../topnavimgs/faqs_on.gif');
		preloadFlag = true;
	}
}
 function validZip(zip)
  {
   len=zip.length
   digits="0123456789";
    if (len <=0 || zip == "Enter Zipcode" )
	{
		alert('Please Enter a Zip code');
		return false;
	}
   if(len != 5 && len != 10)
    {alert("Zip code is not the correct length. Please enter a 5-digit zip code.")
	   return false;
	}

   for(i=0; i<5; i++)
   {if (digits.indexOf(zip.charAt(i))<0)
    {alert("Zip code contains invalid characters. All digits must be numeric")
    return false;}
      }
 
  }