// JavaScript Document
//
// validate the contact us form before submitting it
//
// set the paths to each image in each directory

var glbAlbumPath;
glbAlbumPath="../ALBUMS/";




function ValidateForm(frm) {
	// contactform
	// name and id must be the same for each input
	//validate for empty fileds and reurn to the empty field without submitting the form
	// only validate REQUIRED FIELDS
	
//	<input name="realname" 
//	input name="telephone"
//	<input name="address1" 
//	<input name="address2"
//	<input name="towncity"
//	<input name="countystate"
//	<input name="postzipcode" 
//	<input name="country" 
//	<input name="email" 
//	<textarea name="comments"   10 inputs
	

// check email address first !
 if (!frm.email.value)	{
		alert ("Please enter a value for the EMAIL field");
	 	frm.email.focus();
	  	frm.email.select();
		return false;
	
	 } else {
					if (frm.email.value.indexOf("@") > 0) // check for @ character 
					{				
					} else {
							alert ("Please enter a VALID Email address in the EMAIL field");
									frm.email.focus();
									frm.email.select();
						return false;
					}
	
	}

if (!frm.realname.value)	{
		alert ("Please enter a value for the NAME field");
	 	frm.realname.focus();
	  	frm.realname.select();
		return false;
	 }
	 
	 if (!frm.telephone.value)	{
		alert ("Please enter a value for the TELEPHONE field");
	 	frm.telephone.focus();
	  	frm.telephone.select();
		return false;
	 }
	 if (!frm.address1.value)	{
		alert ("Please enter a value for the ADDRESS 1 field");
	 	frm.address1.focus();
	  	frm.address1.select();
		return false;
	 }
	 
//	 if (!frm.address2.value)	{
//		alert ("Please enter a value for the ADDRESS 2 field");
//	 	frm.address2.focus();
//	  	frm.address2.select();
//		return false;
//	 }

	 if (!frm.towncity.value)	{
		alert ("Please enter a value for the TOWN / CITY field");
	 	frm.towncity.focus();
	  	frm.towncity.select();
		return false;
	 }
	 if (!frm.countystate.value)	{
		alert ("Please enter a value for the COUNTY / STATE field");
	 	frm.countystate.focus();
	  	frm.countystate.select();
		return false;
	 }
	 if (!frm.postzipcode.value)	{
		alert ("Please enter a value for the POST / ZIP CODE field");
	 	frm.postzipcode.focus();
	  	frm.postzipcode.select();
		return false;
	 }
	 if (!frm.country.value)	{
		alert ("Please enter a value for the COUNTRY field");
	 	frm.country.focus();
	  	frm.country.select();
		return false;
	 }
		
// <!-- validate lists here-->
if (!frm.listPortfolio.value)	{
		alert ("Please select a Portfolio");
	 	frm.listPortfolio.focus();
	//  	frm.listPortfolio.select();
		return false;
	 }

if (!frm.listImage.value)	{
		alert ("Please select an Image");
	 	frm.listImage.focus();
	  	frm.listImage.select();
		return false;
	 }
	 if (!frm.listSize.value)	{
		alert ("Please an Image Size");
	 	frm.listSize.focus();
	//  	frm.listSize.select();
		return false;
	 }
	  if (!frm.listFrame.value)	{
		alert ("Please select a Frame Type");
	 	frm.listFrame.focus();
	//  	frm.listFrame.select();
		return false;
	 }
//	if (!frm.comments.value)	{
//		alert ("Please enter a value for the COMMENTS field");
//	 	frm.comments.focus();
//	  	frm.comments.select();
//		return false;
//	 }
	
		 // submit=true calls the formmail script
return true;	
}
//========================================================================
