
function CheckEmailAddress(emailAddress){
	var email = document.getElementById(emailAddress).value;
	var filterEmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(!filterEmail.test(email)){
		alert('Email is not valid');
		document.getElementById(emailAddress).focus();
		return false;
	}
	return true;
}

/*
	setColor('busState');
	}
	else{
		setWhite('busState');
	}
*/
function CheckFormNewOne(){
	var bMissingFields = false;
	var strFields = "";
	
	var email = document.getElementById('email').value;
	var filterEmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if(!filterEmail.test(email)){
		bMissingFields = true
		strFields += "     Email is not valid\n";		
	}	
	/*
	if( trim1(document.getElementById('name').value) == '' ){
		bMissingFields = true;
		strFields += "     Name\n";
	}
	*/
	if( trim1(document.getElementById('company').value) == '' ){
		bMissingFields = true;
		strFields += "     Company\n";
	}
	/*
	if( trim1(document.getElementById('address').value) == '' ){
		bMissingFields = true;
		strFields += "     Address\n";
	}	
	if( trim1(document.getElementById('city').value) == ''  ){
		bMissingFields = true;
		strFields += "     City\n";
	}*/
	if( trim1(document.getElementById('frmStates').value) == ''  ){
		bMissingFields = true;
		strFields += "     State\n";
	}
	/*	
	if( trim1(document.getElementById('zip').value) == '' ){
		bMissingFields = true;
		strFields += "     Zip\n";
	}
	*/
	if( trim1(document.getElementById('email').value) == '' ){
		bMissingFields = true;
		strFields += "     Email address\n";
	}
	/*
	if( trim1(document.getElementById('phone').value) == '' ){
		bMissingFields = true;
		strFields += "     Phone number\n";
	}
	*/
	/*
	if( trim1(document.getElementById('message').value) <= 0 ){		
		bMissingFields = true;
		strFields += "     Message\n";
	}
	*/
	if( bMissingFields ) {
		//alert( "I'm sorry, but you must provide the following field(s) before continuing:\n" + strFields );
		alert( "You must complete the following items before you can submit this message\n" + strFields );
		return false;
	}
	return true;
}
function CheckForm()
{
	var bMissingFields = false;
	var strFields = "";
	
	var email = document.getElementById('email').value;
	var filterEmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if(!filterEmail.test(email)){
		bMissingFields = true
		strFields += "     Email is not valid\n";		
	}	
	
	if( trim1(document.getElementById('name').value) == '' ){
		bMissingFields = true;
		strFields += "     Name\n";
	}
	if( trim1(document.getElementById('company').value) == '' ){
		bMissingFields = true;
		strFields += "     Company\n";
	}
	if( trim1(document.getElementById('address').value) == '' ){
		bMissingFields = true;
		strFields += "     Address\n";
	}	
	if( trim1(document.getElementById('city').value) == ''  ){
		bMissingFields = true;
		strFields += "     City\n";
	}
	if( trim1(document.getElementById('frmStates').value) == ''  ){
		bMissingFields = true;
		strFields += "     State\n";
	}
		
	if( trim1(document.getElementById('zip').value) == '' ){
		bMissingFields = true;
		strFields += "     Zip\n";
	}
	
	if( trim1(document.getElementById('email').value) == '' ){
		bMissingFields = true;
		strFields += "     Email address\n";
	}
	
	if( trim1(document.getElementById('phone').value) == '' ){
		bMissingFields = true;
		strFields += "     Phone number\n";
	}
	/*
	if( trim1(document.getElementById('message').value) <= 0 ){		
		bMissingFields = true;
		strFields += "     Message\n";
	}
	*/
	if( bMissingFields ) {
		//alert( "I'm sorry, but you must provide the following field(s) before continuing:\n" + strFields );
		alert( "You must complete the following items before you can submit this message\n" + strFields );
		return false;
	}
	return true;
	
}
function setColorBox(objectID){
	document.getElementById(objectID).style.color  = '#000066';
}
function setWhiteBox(objectID){
	document.getElementById(objectID).style.color  = '#000000';
}

function trim1(str)
   {
     s = str.replace(/^(\s)*/, '');
     s = s.replace(/(\s)*$/, '');
     return s;
   }

