// form validation for furniture graphics
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;
	}
/** products section */
//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.otheRetDim.value == ""){
		if(f.product.value == "otherRetail" || f.product.value == "window" || f.product.value == "magnetics"){
			self.alert("Please enter a size!");
			f.otheRetDim.focus();
			// if the browser is Netscape 6 or IE
			if(document.all || document.getElementByID){
			// change the color of text field
				f.otheRetDim.style.background = "yellow";
			}
			return false;
		}
		//return false;
	}
// make sure that something is in quantity field if related chosen in drop down
	if (f.otherRetNum.value == ""){
		if(f.product.value == "otherRetail"){
			self.alert("Please enter a quantity!");
			f.otherRetNum.focus();
			// if the browser is Netscape 6 or IE
			if(document.all || document.getElementByID){
			// change the color of text field
				f.otherRetNum.style.background = "yellow";
			}
			return false;
		}
		//return false;
	}
// make sure that the banner quantity field is filled out if banner chosen
	if (f.product.value == "banners" && f.bannerNum.value == ""){
		self.alert("Please enter banner quantity!");
		f.bannerNum.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.bannerNum.style.background = "yellow";
		}
		return false;
	}
// make sure that the banner dimension field is filled out if banner chosen
	if (f.product.value == "banners" && f.bannerDim.value == ""){
		self.alert("Please enter banner dimensions!");
		f.bannerDim.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.bannerDim.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;
	}
// make sure that the year make model field is filled out if box truck chosen
	if (f.product.value == "boxTruck" && f.boxDesc.value == ""){
		self.alert("Please enter the year, make and model of your vehicle!");
		f.boxDesc.focus();
		// if the browser is Netscape 6 or IE
		if(document.all || document.getElementByID){
			// change the color of text field
			f.boxDesc.style.background = "yellow";
		}
		return false;
	}
}