// form validation
function validateForm(f){
//check company name
	if (f.company.value == ""){
		self.alert("Please enter a company name!");
		f.company.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.company.style.background = "yellow";
		}
		return false;
	}
//check user name
	if (f.name.value == ""){
		self.alert("Please enter your name!");
		f.name.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.name.style.background = "yellow";
		}
		return false;
	}
//check address
	if (document.forms[0].address.value == ""){
		self.alert("Please enter an address!");
		f.address.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.address.style.background = "yellow";
		}
		return false;
	}
//check city, state, zip
	if (f.cityStateZip.value == ""){
		self.alert("Please enter the city, state and zip code!");
		f.cityStateZip.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.cityStateZip.style.background = "yellow";
		}
		return false;
	}
//check phone
	if (f.phone.value == ""){
		self.alert("Please enter a phone number!");
		f.phone.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.phone.style.background = "yellow";
		}
		return false;
	}
//check e-mail
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(f.email.value))){
		self.alert("Invalid E-mail Address! Please re-enter.");
		f.email.focus();
		f.email.select();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.email.style.background = "yellow";
		}
		return false;
	}
//check product
	if (f.product.value == ""){
		self.alert("Please choose a product!");
		f.product.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.product.style.background = "yellow";
		}
		return false;
	}
// make sure that something is in "other" field if chosen from the drop down
	if (f.product.value == "otherRetail" && f.prodRetail.value == ""){
		self.alert("Please enter Other Retail Graphics!");
		f.prodRetail.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.prodRetail.style.background = "yellow";
		}
		return false;
	}
// make sure that something is in otherSize field if related chosen in drop down
	if (f.otherSize.value == ""){
		if(f.product.value == "otherRetail" || f.product.value == "window" || f.product.value == "magnetics"){
			self.alert("Please enter a size!");
			f.otherSize.focus();
			// if the browser is Netscape 6 or IE
			if(document.all || document.getElementByID){
			// change the color of text field
				f.otherSize.style.background = "yellow";
			}
			return false;
		}
		//return false;
	}
// make sure that something is in quantity field if related chosen in drop down
	if (f.quantity.value == ""){
		if(f.product.value == "otherRetail" || f.product.value == "window" || f.product.value == "magnetics"){
			self.alert("Please enter a quantity!");
			f.quantity.focus();
			// if the browser is Netscape 6 or IE
			if(document.all || document.getElementByID){
			// change the color of text field
				f.quantity.style.background = "yellow";
			}
			return false;
		}
		//return false;
	}
// make sure that the banner dimension field is filled out if banner chosen
	if (f.product.value == "banners" && f.banDim.value == ""){
		self.alert("Please enter banner dimensions!");
		f.banDim.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.banDim.style.background = "yellow";
		}
		return false;
	}
// make sure that the banner quantity field is filled out if banner chosen
	if (f.product.value == "banners" && f.banQuantity.value == ""){
		self.alert("Please enter banner quantity!");
		f.banQuantity.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.banQuantity.style.background = "yellow";
		}
		return false;
	}
// make sure that the year make model field is filled out if van chosen
	if (f.product.value == "van" && f.vanDesc.value == ""){
		self.alert("Please enter the year, make and model of your vehicle!");
		f.vanDesc.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.vanDesc.style.background = "yellow";
		}
		return false;
	}
}