responce = ""



function isValidEmail(value)

{

	var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";

	var regex = new RegExp(emailReg);

	return regex.test(value);					

}





function isNumAlpha(c)

{



		

		if ( (c >= "0" && c <= "9") ||

		     (c >= "A" && c <= "Z") ||

         	     (c >= "a" && c <= "z") )

         	     	return true;

		



	return false;

}





function validateForm(form) {



	

	var error = 0;

	var ablank = 0;

	var characters = 0;

	var charOver = 0;

	var thestring = "";

	var errString = "The following error conditions must be corrected to submit this form:\n\n";

	var oneChecked = 0;

	var a = 200;

	var x = 0;

	var z = 0;

	var hasAreaCode = 0;





	// this loop will step through each form element and apply the proper validation rule.

	//  the index value a will determine which field is currently being validated.

	// the message will be built, adding each new violation, in errString.

	

	// to customize for other forms change the values for a to the appropriate fields.

	// also check the pulldown validation for proper blank settings.

	

	hasAreaCode = 0;

			



     

  

  

		

		

	// checks for first name

	if(form.FirstName)

		{

			thestring = form.FirstName.value;

   

			for (x = 0; x < thestring.length; x++)

			{

			  

			if  ( thestring.charAt(x) != " ")

			{

			break;

			}

			}

			 

			if ( x == thestring.length )    // if it got to end of string and string was blank

			{

			errString += "* Please enter your First Name.\n\n";

   			error = 1;

			}	

		}

	

	// checks for last name

	if(form.LastName)

		{

			thestring = form.LastName.value;

   

			for (x = 0; x < thestring.length; x++)

			{

			  

			if  ( thestring.charAt(x) != " ")

			{

			break;

			}

			}

			 

			if ( x == thestring.length )    // if it got to end of string and string was blank

			{

			errString += "* Please enter your Last Name.\n\n";

   			error = 1;

			}	

		}

	

	
// checks for cmpany

	if(form.company)

		{

			thestring = form.company.value;

   

			for (x = 0; x < thestring.length; x++)

			{

			  

			if  ( thestring.charAt(x) != " ")

			{

			break;

			}

			}

			 

			if ( x == thestring.length )    // if it got to end of string and string was blank

			{

			errString += "* Please enter your Company.\n\n";

   			error = 1;

			}	

		}

	

  	// checks for Street Address 1

	if(form.address1)

		{

			thestring = form.address1.value;

   

			for (x = 0; x < thestring.length; x++)

			{

			  

			if  ( thestring.charAt(x) != " ")

			{

			break;

			}

			}

			 

			if ( x == thestring.length )    // if it got to end of string and string was blank

			{

			errString += "* Please enter your Street Address.\n\n";

   			error = 1;

			}	

		}

 

   	// checks for City

	if(form.city)

		{

			thestring = form.city.value;

   

			for (x = 0; x < thestring.length; x++)

			{

			  

			if  ( thestring.charAt(x) != " ")

			{

			break;

			}

			}

			 

			if ( x == thestring.length )    // if it got to end of string and string was blank

			{

			errString += "* Please enter your City.\n\n";

   			error = 1;

			}	

		}

 

    	// checks for State

	if(form.state)

		{

			thestring = form.state.options[form.state.selectedIndex].value;

			  

			if ( thestring == "null" )    // if it got to end of string and string was blank

			{

			errString += "* Please enter which State are you applying for.\n\n";

   			error = 1;

			}	

		} 	

		

 if(form.delivery_yr)

		{

			thestring = form.delivery_yr.options[form.delivery_yr.selectedIndex].value;

			  

			if ( thestring == "null" )    // if it got to end of string and string was blank

			{

			errString += "* Please enter a Delivery Year.\n\n";

   			error = 1;

			}	

		} 	

		if(form.contact)

		{

			thestring = form.contact.options[form.contact.selectedIndex].value;

			  

			if ( thestring == "null" )    // if it got to end of string and string was blank

			{

			errString += "* Please enter a Contact Info.\n\n";

   			error = 1;

			}	

		} 	

		

 

     	// checks for Zip

	if(form.zip)

		{

			thestring = form.zip.value;

   

			for (x = 0; x < thestring.length; x++)

			{

			  

			if  ( thestring.charAt(x) != " ")

			{

			break;

			}

			}

			 

			if ( x == thestring.length ||  thestring.length < 5 )    // if it got to end of string and string was blank

			{

			errString += "* Please enter your Zip/Postal code.\n\n";

   			error = 1;

			}	

			

		}

		

    	 

 

      	// checks for Phone #

	if(form.phone)

		{

			thestring = form.phone.value;

   

			for (x = 0; x < thestring.length; x++)

			{

			  

			if  ( thestring.charAt(x) != " ")

			{

			break;

			}

			}

			 

			if ( x == thestring.length ||  thestring.length < 10 )    // if it got to end of string and string was blank

			{

			errString += "* Please enter your Phone Number with area code.\n\n";

   			error = 1;

			}	

			

		}

 

	

   	 

	 
		// checks for dmonth

	if(form.delivery_mo)

		{

			thestring = form.delivery_mo.value;

   

			for (x = 0; x < thestring.length; x++)

			{

			  

			if  ( thestring.charAt(x) != " ")

			{

			break;

			}

			}

			 

			if ( x == thestring.length ||  thestring.length < 10 )    // if it got to end of string and string was blank

			{

			errString += "* Please enter a Delivery Month.\n\n";

   			error = 1;

			}	

			

		}

 

	

		// checks for dmonth

	if(form.delivery_day)

		{

			thestring = form.delivery_day.value;

   

			for (x = 0; x < thestring.length; x++)

			{

			  

			if  ( thestring.charAt(x) != " ")

			{

			break;

			}

			}

			 

			if ( x == thestring.length ||  thestring.length < 10 )    // if it got to end of string and string was blank

			{

			errString += "* Please enter a Delivery Day.\n\n";

   			error = 1;

			}	

			

		}

   	 


		

	// check for valid email address 

	if (form.EmailAddress)

             			{

             			if ( isValidEmail(form.EmailAddress.value) == false)

             				{

             				errString += '* Email address must be in someone@somwhere.com format.\n\n';

             				error = 1;



             				}

             			}

		

		 	// checks for project type

	if(form.years)

		{

			thestring = form.years.options[form.years.selectedIndex].value;

			  

			if ( thestring == "null" )    // if it got to end of string and string was blank

			{

			errString += "* Please enter # of years in business.\n\n";

   			error = 1;

			}	

		} 	

		
		 	 

		

	// check for missing blank fields





	if ( error == 1)

		{

		alert(errString);

		return false;

		}

			

	return true;		



}

   	//  end of validation code



function submitform(form)

	{

	var error = 0;

	var ablank = 0;

	var characters = 0;

	var charOver = 0;

	var thestring = "";

	var errString = "The following error conditions must be corrected to submit this form:\n\n";

	var oneChecked = 0;

	var a = 200;

	var x = 0;

	var z = 0;

	var hasAreaCode = 0;



	if (validateForm(form))

		{

		form.submit();

		}

	}



var isIE3 = (navigator.appVersion.indexOf('MSIE 3') != -1)



// -->

