function ValidateField(objField, blnRequired, blnNum, strFieldName)
{

var blnHold = true;
var strValue = objField.value;
if (blnRequired && strValue.length == 0)
	{
	blnHold = false;
	alert(strFieldName + " was left blank.\nThis field is required for registration");
	objField.focus();
	}
if (blnHold && blnNum == 1 && strValue.length > 0)
	{
//Regular Expression
phoneNum='^[(]{0,1}[0-9]{3}[ ]{0,1}[)+-.]{0,1}[ ]{0,1}[0-9]{3}[ ]{0,1}[+-.]{0,1}[ ]{0,1}[0-9]{4}$';
  myReg=new RegExp(phoneNum);

	if(!myReg.test(strValue))
		{
		blnHold = false;
		alert(strFieldName + " must be numeric,\n Eg.\n (333) 333 - 3333\n 333+333+3333\n 333.333.3333");
		objField.focus();
		}
	}
if (blnHold && blnNum == 2 && strValue.length > 0)
	{
//Regular Expression,,, this is the E Mail
emails='^[-a-zA-Z0-9_+.]{1,40}[@]{1}[a-zA-Z0-9]{2,40}[.]{0,1}[a-zA-Z0-9]{0,40}[.]{1}[a-zA-Z]{2,4}$';
  myReg=new RegExp(emails);

	if(!myReg.test(strValue))
		{
		blnHold = false;
		alert(strFieldName + " must be as\n Ex: john@doe.com");
		objField.focus();
		}
	}
return blnHold;
}


function ValidateForm()
{
var blnHold = true;
blnHold = ValidateField(document.getElementById("fname"), true, 0, "Your First Name");
if (blnHold)
	{
	blnHold = ValidateField(document.getElementById("lname"), true, 0, "Your Last Name");
	}
if (blnHold)
	{
	blnHold = ValidateField(document.getElementById("email"), true, 2, "E-mail");
	}
return blnHold;
}