
/**  Simple Form Validation (the email script will validate the data properly)  **/


function EnterFormTextBox(frmItem) {
	try {
		switch(frmItem.name) {
			case "contactName":
				if(frmItem.value == "enter your name (optional)") {
					frmItem.value = "";	
				}
				break;
			
			case "contactPhone":
				if(frmItem.value == "enter your telephone (optional)") {
					frmItem.value = "";	
				}
				break;		
			
			case "fromemail":
				if(frmItem.value == "enter your email address (required)") {
					frmItem.value = "";	
				}
				break;		
			
			case "comments":
				if(frmItem.value == "enter your message here") {
					frmItem.value = "";	
				}
				break;		
		}
		
	}catch(e) {
		// ignore errors
	}
}


function ValidateForm(frm) {
	try {
		EnterFormTextBox(frm.contactName);
		EnterFormTextBox(frm.contactPhone);
		EnterFormTextBox(frm.fromemail);
		EnterFormTextBox(frm.comments);
		
		if(frm.fromemail.value == "") {
			alert("You have not entered an email address!");
		}
		
	}catch(e) {
	}
}


