// JavaScript Document
// Created by Stefka Hristova
// shristova@lycos.com
// Zetools.com
// 2002


function imgOn(p,ext) {
  if(document.images[p]) {
	if (ext) {
	document.images[p].src = "images/" + p + "_on." + ext;
	}
	else {
	document.images[p].src = "images/" + p + "_on.gif";
	}
  }
}
function imgOff(p,ext) {
 if(document.images[p]) {
	if (ext) {
	document.images[p].src = "images/" + p +  "_off." + ext;
	}
	else {
	document.images[p].src = "images/" + p + "_off.gif"
	}
  }
}

function getURL() {
	var myurl = window.location.href;


	var mya = new Array;
	mya = myurl.split("/");
	var myparam = mya[3].replace (".html","");
	mysections = new Array;
	 if (myparam.indexOf('_') != -1) {
	 	mysections = myparam.split("_");
	 }
	 else {
	 	mysections[0] = myparam;
	 }


}

function navOn(p,n) {
 if(document.images[p+n]) {
	document.images[p+n].src = "images/arrow_white.gif";
  }
}
function navOff(p,n) {
	if (p+n != activeNav) {
		 if (document.images[p+n]) {
				document.images[p+n].src = "images/arrow_" + p + ".gif";
		 }
	}
}
var activeNav = "";
function setActiveNav(p,n) {
	activeNav = p+n;
	navOn(p,n);
}
function validateForm() {
eOne = "Check";
	var reqElements = ['owner_name','corporate_name','address','city','state','zip','number_restaurants','number_employees','number_uniforms','restaurants_convert'];


		for (i = 0; i < reqElements.length; i ++ ) {
			var elname = reqElements[i];

			if (navigator.appName.indexOf("Microsoft") != -1) {


				if (document.forms['services'].elements[elname].value == "") {

					document.all["f"+elname].style.color = "#FF0000";
					eOne += " " + elname;
				}
				else {
					document.all["f"+elname].style.color = "#000000";
				}
			}
			else {
				if (document.forms['services'].elements[elname].value == "") {
					eOne += " " + elname;
				}
			}
		}

	if (eOne == "Check") {
		document.forms[0].submit();
	}
	else if  (navigator.appName.indexOf("Netscape") != -1) {
		alert("A required field has not been filled out, please make sure that all fields marked with a * have been filled out.");
	}
	else {
		return
	}

}


