// JavaScript Document

/* Last Updated: 02/09/2008 */
/* Updated by: Ramkumar P */
/* Revisions: 1.0.1 */


var valid;
$('Customer').onsubmit = function(){ 
	valid = $(this.textfirstname).present() && $(this.textlastname).present() && $(this.textemail).present() && $(this.textcompany).present() && $(this.textphone).present() && $(this.textcomments).present() && $(this.textcity).present();
	
if (valid) {return true;} 
else 
{ 	
	alert('Please fill out all the fields.');
	return false;
}
}

$('Dealer').onsubmit = function(){ 
	valid =$(this.textDealerName).present() && $(this.textFirstName).present() && $(this.textLastName).present() && $(this.textEmail).present() && $(this.textPhone).present() && $(this.textcomments).present()&& $(this.textcity).present();
	
if (valid) {
 	return true;
} 
else 
{ 	
	alert('Please fill out all the fields.');
	return false;
}

}

$('Visitor').onsubmit = function(){ 
	valid = $(this.textFirstName).present() && $(this.textLastName).present() && $(this.textEmail).present() && $(this.textPhone).present() && $(this.textCity).present() && $(this.textComments).present();
	
if (valid) {
 	return true;
} 
else 
{ 	
	alert('Please fill out all the fields.');
	return false;
}
}

$('Employee').onsubmit = function(){ 
	valid = $(this.textFirstName).present() && $(this.textLastName).present() && $(this.textEmail).present() && $(this.textEmployeeID).present() && $(this.textCity).present() && $(this.textComments).present();
	
if (valid) {
 	return true;
} 
else 
{ 	
	alert('Please fill out all the fields.');
	return false;
}
}


