
// Last updated:  10.9.08
 
self.focus();

function validateAll() {
	
	if(document.helpFrm.fname.value=='') {
		alert('* Enter your First Name *');
		document.helpFrm.fname.focus();
		return false;
	}
	if(document.helpFrm.lname.value=='') {
		alert('* Enter your Last Name *');
		document.helpFrm.lname.focus();
		return false;
	}

// Daytime Phone
	var d_p1 = document.helpFrm.d_area.value;
	var d_p2 = document.helpFrm.d_exchange.value;
	var d_p3 = document.helpFrm.d_number.value;
	var d_phonenumlength = d_p1.length + d_p2.length + d_p3.length;

	if(d_phonenumlength) {
		if(d_phonenumlength != 10) {
			alert('* Your Phone Number must have 10 digits *');
			document.helpFrm.d_area.focus();
			return false;
		}
    	for (var i=0;i < d_p1.length;i++) {
        	if ((d_p1.substring(i,i+1) < '0') || (d_p1.substring(i,i+1) > '9')) {
				alert('* Your Phone Number Area Code must only be digits *');
				document.helpFrm.d_area.focus();
				return false;        	
        	}
        }
    	for (var i=0;i < d_p2.length;i++) {
        	if ((d_p2.substring(i,i+1) < '0') || (d_p2.substring(i,i+1) > '9')) {
				alert('* Your Phone Number Exchange must only be digits *');
				document.helpFrm.d_exchange.focus();
				return false;        	
        	}
        }
     	for (var i=0;i < d_p3.length;i++) {
        	if ((d_p3.substring(i,i+1) < '0') || (d_p3.substring(i,i+1) > '9')) {
				alert('* Your Phone Number must only be digits *');
				document.helpFrm.d_number.focus();
				return false;        	
        	}
        }
	}
	else {
		alert('* Enter your Phone Number *');
		document.helpFrm.d_area.focus();
		return false;
	}


	if(document.helpFrm.email.value=='' || document.helpFrm.email1.value=='') {
		if(document.helpFrm.email.value=='' && document.helpFrm.email1.value=='') {
			alert('* Enter your Email Address *');
			document.helpFrm.email.focus();
			return false;
		}
		else {
			if(document.helpFrm.email.value=='') {
				alert('* Enter your Email into the 1st box *');
				document.helpFrm.email.focus();
				return false;
			}
			if(document.helpFrm.email1.value=='') {
				alert('* Enter your Email into the 2nd box *');
				document.helpFrm.email1.focus();
				return false;
			}			
		}

	}
	if((document.helpFrm.email1.value!='' && document.helpFrm.email.value!='') &&
	  (document.helpFrm.email1.value != document.helpFrm.email.value)) {
		alert('* Your Email entries do not match *\n* Please check both entries *');
		document.helpFrm.email1.focus();
		return false;
	}

	if(document.helpFrm.username.value=='') {
		alert('* Enter your Username *');
		document.helpFrm.username.focus();
		return false;
	}
	if(document.helpFrm.pwd.value=='') {
		alert('* Enter your Password *');
		document.helpFrm.pwd.focus();
		return false;
	}

	return true;
	
}
