function ValidateData (oPrmForm)
{
	var continueToSubmit = true;

	if( continueToSubmit && document.forms[0]["firstname"].value.length == 0 )
	{
		continueToSubmit = false;
		alert('You must provide a value for First Name.');
		document.forms[0]["firstname"].focus();
	}

	if( continueToSubmit && document.forms[0]["lastname"].value.length == 0 )
	{
		continueToSubmit = false;
		alert('You must provide a value for Last Name.');
		document.forms[0]["lastname"].focus();
	}
	
	if( continueToSubmit && document.forms[0]["phone"].value.length == 0 )
	{
		continueToSubmit = false;
		alert('You must provide a value for Home Phone.');
		document.forms[0]["phone"].focus();
	}else if( continueToSubmit && !phoneIsValid(document.forms[0]["phone"])){
		continueToSubmit = false;
		alert('You must provide a valid Home Phone.');
		document.forms[0]["phone"].focus();
	}
	
	if( continueToSubmit && document.forms[0]["email"].value.length == 0 )
	{
		continueToSubmit = false;
		alert('You must provide a value for E-mail Address.');
		document.forms[0]["email"].focus();
	}else if( continueToSubmit && !checkEmail(document.forms[0]["email"].value)){
		continueToSubmit = false;
		alert('You must provide a valid E-mail Address.');
		document.forms[0]["email"].focus();
	}
	
	if( continueToSubmit && document.forms[0]["I'm interested in"].selectedIndex == 0 )
	{
		continueToSubmit = false;
		alert('You must provide a value for what program are you interested in?');
		document.forms[0]["I'm interested in"].focus();
	}

	return continueToSubmit;
}

function phoneIsValid(Obj) {
	var sPhone = Obj.value;
	var sPhoneTemp = sPhone;
	sPhone = '';
	var sNumbers = '1234567890';
	for (var i=0;i<sPhoneTemp.length;i++) {
	if (sNumbers.indexOf(sPhoneTemp.charAt(i)) > -1) {
	sPhone += sPhoneTemp.charAt(i);
	}
	}
	if (sPhone.charAt(0) == '1' || sPhone.charAt(0) == 1) {
	sPhone = sPhone.substring(1,(sPhone.length));
	}
	if (sPhone.length != 10) {
	return false;
	}
	else { 
	Obj.value = sPhone;
	}
	var sAreaCode = sPhone.substring(0,3);
	var sPrefix = sPhone.substring(3,6);
	var sNumber = sPhone.substring(6,10);
	ary7NotAllowed = new Array('1234567','4567890','0000000','1111111','2222222','3333333','4444444','5555555','6666666','7777777','8888888','9999999','3456789','4567890')
	ary3NotAllowed = new Array('000','911','555','012','123');
	for (var i=0;i<ary7NotAllowed.length;i++) {
	if (sPrefix.toString() + sNumber.toString() == ary7NotAllowed[i])  {
	return false;
	}
	}
	for (var i=0;i<ary3NotAllowed.length;i++) {
	if (sPrefix.toString() == ary3NotAllowed[i].toString()) {
	return false;
	}
	}
	return true;
}

function checkEmail(sEmail) {
	var AtSign = sEmail.indexOf('@');
	var Period = sEmail.lastIndexOf('.');
	if (AtSign > -1 && Period > -1 && AtSign < Period) {
			return true;
	}
	else {
			return false;
	}
}
