/*	-------------------------------------------------------------
	Global Business Alliance | www.gballiance.org
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Description:	JavaScript File
	Filename:		gba.js
	Version:		0.1
	Date:			December 14, 2006
	-------------------------------------------------------------	*/
	
<!--

/*	-------------------------------------------------------------
	function showHide(which)
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Description:	Function toggles layer visibility. 
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -	*/

function showHide() {
	for (var i=0; i<showHide.arguments.length; i++) {
		var el = document.getElementById(showHide.arguments[i]);
		el.style.display = (el.style.display == "none") ? "block" : "none";
	}
}

function showForm() {
	for (var i=0; i<showForm.arguments.length; i++) {
		var el = document.getElementById(showForm.arguments[i]);
		el.style.display = (el.style.display == "none") ? "block" : "block";
	}
}

/*	-------------------------------------------------------------
	function validateForm(which)
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Description:	Function validates user input in form. 
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -	*/
	
function validateForm(which) {
var valid=true;
stateRXP = /\D{2}/;
zipRXP = /\d{5}(-\d{4})?/;
phoneRXP = /\d{3}-\d{3}-\d{4}/;
emailRXP = /\S+@\S+\.\S{2,4}/;
if(!which.firstname.value){
	firstNameLabel.style.color = "#FF0000";
	valid=false;
	}
	if(!which.lastname.value){
	lastNameLabel.style.color = "#FF0000";
	valid=false;
	}
	if(!which.address.value){
	addressLabel.style.color = "#FF0000";
	valid=false;
	}
	if(!which.city.value){
	cityLabel.style.color = "#FF0000";
	valid=false;
	}
	which.state.value = which.state.value.toUpperCase();
	if(!stateRXP.exec(which.state.value)){
	stateLabel.style.color = "#FF0000";
	valid=false;
	}
	if(!zipRXP.exec(which.zip.value)){
	zipLabel.style.color = "#FF0000";
	valid=false;
	}
	if(!phoneRXP.exec(which.phone.value)){
	phoneLabel.style.color = "#FF0000";
	valid=false;
	}
	if(!emailRXP.exec(which.email.value)){
	emailLabel.style.color = "#FF0000";
	valid=false;
	}
if(!valid) {
alert("Please check the highlighted fields.\nThey are either not completed,\nor have an incorrect value.");
return false;
}
else{
return true;
}
}
//-->