function validateZip(theForm){
	var key=theForm.zip.value;
	if (key.length<3) {
		alert("Please enter a 5 digit zipcode or a city name.");
		return(false);
	}
	if (isNaN(parseInt(key)))  {
		theForm.city.value="1";
		return(true);
	} 
	if (key.length!=5) {
		alert("Please enter a 5 digit zipcode or a city name.");
		theForm.zip.focus();
		return(false);
	}
	return(true);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function pviiClassNew(obj, new_style) {
    obj.className = new_style;
}
function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function pviiW3Cbg(obj, pviiColor) { //v1.1 by Project VII
if (!(navigator.appName=="Netscape")&&(parseInt(navigator.appVersion)==4)) {
	obj.style.backgroundColor=pviiColor
	} 
}

function P7_autoLayers() {
 var g,b,k,f,args=P7_autoLayers.arguments;
 if(!document.p7setc) {p7c=new Array();document.p7setc=true;}
 for(k=0; k<p7c.length; k++) {
  if((g=MM_findObj(p7c[k]))!=null) {
   b=(document.layers)?g:g.style;b.visibility="hidden";}}
 for(k=0; k<args.length; k++) {
  if((g=MM_findObj(args[k])) != null) {
   b=(document.layers)?g:g.style;b.visibility="visible";f=false;
   for(j=0;j<p7c.length;j++) {
    if(args[k]==p7c[j]) {f=true;}}
  if(!f) {p7c[p7c.length++]=args[k];}}}
}

function pviiClassNew(obj, new_style) { //v2.3 by PVII
  obj.className=new_style;
}

function validate(theForm) {
  if (theForm.name.value == "") {
    alert("Please enter a value for the \"Name\" field.");
    theForm.name.focus();
    return (false);
  }
  if (theForm.address.value == "") {
    alert("Please enter a value for the \"Address\" field.");
    theForm.address.focus();
    return (false);
  }
  if (theForm.myCity.value == "") {
    alert("Please enter a value for the \"City\" field.");
    theForm.myCity.focus();
    return (false);
  }
  if (theForm.state.value == "") {
    alert("Please enter a value for the \"State\" field.");
    theForm.state.focus();
    return (false);
  }
  if (theForm.zipcode.value == "") {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.zipcode.focus();
    return (false);
  }
	if (theForm.phone.value == "") {
    alert("Please enter a value for the \"Phone\" field.");
    theForm.phone.focus();
    return (false);
  }
  return (true);
}

function validateSearch(theForm){
	var key=theForm.zip.value;
	if (key.length<3) {
		alert("Please enter a 5 digit zipcode or a city name.");
		return(false);
	}
	if (isNaN(parseInt(key)))  {
		theForm.city.value="1";
		return(true);
	} 
	if (key.length!=5) {
		alert("Please enter a 5 digit zipcode or a city name.");
		theForm.zip.focus();
		return(false);
	}
	return(true);
}