function checkfields() {
	var strname;
	var stremail;
	var strphone;
	var strddate;
	var strdtime;
	var strest;
	var strloc;
	var stratt;
	var error=false;
	var msg="";
	
	strname=window.document.contact.Your_Name.value;
	stremail=window.document.contact.Email_Address.value;
	strphone=window.document.contact.Phone_Number.value;
	strddate=window.document.contact.Date_of_Deposition_1.value;
	strdtime=window.document.contact.Time_of_Deposition_1.value;
	strest=window.document.contact.Estimated_Length_of_Deposition_1.value;
	strloc=window.document.contact.Location_of_Deposition.value;
	stratt=window.document.contact.Taking_Attorney.value;
	
	
	if (strname=="") {
		msg="Please provide your name\n"
		error=true;
	}
	
	if (strphone=="") {
		msg = msg +"Please provide your phone number\n";
		error=true;
	}
	
	if (strddate=="") {
		msg = msg +"Please provide the deposition date\n";
		error=true;
	}
	
	if (strdtime=="") {
		msg = msg +"Please provide the deposition time\n";
		error=true;
	}
	
	if (strest=="") {
		msg = msg +"Please provide the estimated length of the deposition\n";
		error=true;
	}
	
	if (strloc=="") {
		msg = msg +"Please provide the deposition location\n";
		error=true;
	}
	
	if (stratt=="") {
		msg = msg +"Please provide the taking attorney\n";
		error=true;
	}
	
	if ((document.contact.Expedited[0].checked==false)
		&& (document.contact.Expedited[1].checked==false)) {
			msg = msg +"Choose 'Yes' or 'No' under Expedited\n";
			error=true;
	}
	
	if ((document.contact.Real_Time[0].checked==false)
		&& (document.contact.Real_Time[1].checked==false)) {
			msg = msg +"Choose 'Yes' or 'No' under Real Time\n";
			error=true;
	}
	
	if ((document.contact.Video[0].checked==false)
		&& (document.contact.Video[1].checked==false)) {
			msg = msg +"Choose 'Yes' or 'No' under Video\n";
			error=true;
	}
	
	if (stremail=="") {
		msg = msg +"Please provide your email address\n";
		error=true;
	}
	
	else if(!EmailIsValid(stremail)){
		msg = msg + "Please enter in a valid email address\n";
		error=true;
	}
	
	if (error==true) {
			alert(msg);
			return false;
	}
	return true;
}

function EmailIsValid(checkThisEmail)
{
var myEMailIsValid = true;
var myAtSymbolAt = checkThisEmail.indexOf('@');
var myLastDotAt = checkThisEmail.lastIndexOf('.');
var mySpaceAt = checkThisEmail.indexOf(' ');
var myLength = checkThisEmail.length;


// at least one @ must be present and not before position 2
// @yellow.com : NOT valid
// x@yellow.com : VALID

if (myAtSymbolAt < 1 )
 {myEMailIsValid = false}


// at least one . (dot) afer the @ is required
// x@yellow : NOT valid
// x.y@yellow : NOT valid
// x@yellow.org : VALID

if (myLastDotAt < myAtSymbolAt)
 {myEMailIsValid = false}

// at least two characters [com, uk, fr, ...] must occur after the last . (dot)
// x.y@yellow. : NOT valid
// x.y@yellow.a : NOT valid
// x.y@yellow.ca : VALID

if (myLength - myLastDotAt <= 2)
 {myEMailIsValid = false}


// no empty space " " is permitted (one may trim the email)
// x.y@yell ow.com : NOT valid

if (mySpaceAt != -1)
 {myEMailIsValid = false}

return myEMailIsValid
}