// JavaScript Document
//this function will validate the contact form
function contactChk(frmObj)

{
//setup the empty vars for the alert message
var errorMsg = "";
var confirmMsg = "";
//setup the regular expresssion to check the validity of the e-mail address
reEmail = /^\w+([\.\-]?\w+)*\@\w+([\.\-]?\w+)*(\.\w{2,3})+$/
//check the sender_name input
if(frmObj.sender_name.value == ""){
	//there is no name in the sender box
	errorMsg += "-You have not entered a name.\n";
	}
//check the e-mail address using the regexp and then make sure they are both the same
if(frmObj.sender_email1.value == ""){
	//there is no e-mail address
	errorMsg += "-You need to enter a return e-mail address.\n";
}else if(!reEmail.test(frmObj.sender_email1.value)){
		//the e-mail is not valid
		errorMsg += "-You have not entered a valid e-mail address.\n";
		//blank the text box
		frmObj.sender_email1.value = "";
		frmObj.sender_email2.value = "";
}else{
	//check the two e-mail address' against each other
	if(frmObj.sender_email1.value != frmObj.sender_email2.value){
		//blank the second e-mail and add to errorMsg
		frmObj.sender_email2.value = "";
		errorMsg += "-Your e-mail address' do not match. Please re-type your e-mail.\n";
	}
}
//now check for a subject
if(frmObj.subject.value ==""){
	//there is no subject
	errorMsg += "-You need to enter a subject.\n";
}
//now check for a message
if(frmObj.message.value == ""){
	//no message wasn't entered
	errorMsg += "-You need to enter a message.\n";
}
//now check if there have been any errors and show them or return 'true' 
if(errorMsg){
	//there are errors
	alert(errorMsg);
	return false;
}else{
	//there are no errors
	return true;
}
	
		
}
function subMenu(layer_ref) { 
	/*
	if (state == 'block') { 
		state = 'none'; 
	} else { 
		state = 'block'; 
	} 
	*/
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		state = eval("document.all."+layer_ref+".style.display");
		if(state == "block"){
			state = "none";
		}else{
			state = "block";
		}
		eval( "document.all." + layer_ref + ".style.display = state"); 
	} 
	
	if (document.layers) { //IS NETSCAPE 4 or below 
		state = document.layers[layer_ref].display;
		if(state == "block"){
			state = "none";
		}else{
			state = "block";
		}
		document.layers[layer_ref].display = state; 
	} 
	
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(layer_ref); 
		state = hza.style.display; 
		if(state == "block"){
			state = "none";
		}else{
			state = "block";
		}
		hza.style.display = state;
	} 
}

function showIcon(layer_ref) { 

	/*
	if (state == 'block') { 
		state = 'none'; 
	} else { 
		state = 'block'; 
	} 
	*/
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		state = eval("document.all."+layer_ref+".style.display");
		if(state == "block"){
			state = "none";
		}else{
			state = "block";
		}
		eval( "document.all." + layer_ref + ".style.display = state"); 
	} 
	
	if (document.layers) { //IS NETSCAPE 4 or below 
		state = document.layers[layer_ref].display;
		if(state == "block"){
			state = "none";
		}else{
			state = "block";
		}
		document.layers[layer_ref].display = state; 
	} 
	
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(layer_ref); 
		state = hza.style.display; 
		if(state == "block"){
			state = "none";
		}else{
			state = "block";
		}
		hza.style.display = state;
	} 
}



