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.form_firstname)

		{

			thestring = form.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.form_lastname)

		{

			thestring = form.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 Street Address 1

	if(form.form_address1)

		{

			thestring = form.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.form_city)

		{

			thestring = form.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.form_state)

		{

			thestring = form.form_state.options[form.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;

			}	

		} 	

		

 

		

		

 

     	// checks for Zip

	if(form.form_zip)

		{

			thestring = form.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.form_bphone)

		{

			thestring = form.form_bphone.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;

			}	

			

		}

 

	

   	 

		

		

	// check for valid email address 

	if (form.form_email)

             			{

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

             				{

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

             				error = 1;



             				}

             			}

		

		 	// checks for project type

	if(form.form_job_q1)

		{

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

			  

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

			{

			errString += "* Please enter a project type.\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)



// -->


