// javascript document

function writeEmail(tla,dom,nam) {
document.write("<a href='mailto:"+nam+"@"+dom+"."+tla+"'>"+nam+"@"+dom+"."+tla+"</a>");
}


function switchVal(e,o) {
// e is the element  - o is the orginal value
if (document.getElementById(e.name).value==o) document.getElementById(e.name).value="";
}
function checkVal(e,o) {
// e is the element  - o is the orginal value
if (document.getElementById(e.name).value=="") document.getElementById(e.name).value=o;
}

function checkForm(f) {
	required_fields=Array("First_Name","Last_Name","Email","Phone"); // put in all the form elements that are required here
	display_name=Array("Your First Name","Your Last Name","Your Email Address","Your Phone Number"); // how it will present the empty field to the user
	counter=0;
	why="";
	while (required_fields[counter]) {
		why+=(f[required_fields[counter]].value=="")?(" - "+display_name[counter]+"\n"):"";
		counter++;
	}
	if (why=="") {
		return true;
	} else {
		alert("The following fields were empty. \n"+why+"They are required to submit.");
		return false;
	}
}


function moveToPage(v){
location.href=v;
} 