//used for updating the copyright information
myDate = new Date();
myYear = myDate.getFullYear();

function checkForm(myForm){
	var chkReturn = false;  //init var
	chkReturn = checkField(myForm.fromName);
	if(chkReturn==false){
		alert('Please enter your name');
		return false;
	}
	chkReturn = checkEither(myForm.phone,myForm.eMail);
	if(chkReturn == false){return false;}
	chkReturn = checkField(myForm.interestType);
	if(chkReturn==false){
		alert('Please select an interest');
		return false;
	}
	chkReturn = checkRadio(myForm.contactType);
	if(chkReturn==false){
		alert('Please select a contact method');
		return false;
	}
	return true;	
}

function checkRadio(thisElement){
	for (i=0;i<thisElement.length;i++) {
		if (thisElement[i].checked) {
			return true
		}
	}
	return false;
}

function checkEither (first,second){
	if(!(checkField(first)) && !(checkField(second))){
		alert('Required: ' + first.name + ' or ' + second.name +'\n Please enter one or the other');
		first.focus();
		return false;
	}else{
		return true;
	}
}
function checkField(thisElement)
{
	if(thisElement.value == "")
	{
		//alert(thisElement.name + " is a required field.");
		thisElement.focus();
		return false;
	}else{
		return true;
	}

}

