var digits = "0123456789";
var phoneNumberDelimiters = "()- ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;

function isEmpty(str)
{
    strRE = new RegExp( );w
    strRE.compile( '^[\s ]*$', 'gi' );
    return strRE.test( str.value );
}
 
function notValidEmail(str)
{
    mailRE = new RegExp( );
    mailRE.compile( '^[\._a-z0-9-]+@[\.a-z0-9-]+[\.]{1}[a-z]{2,4}$', 'gi' );
    return (!mailRE.test( str.value ));
}
  
function checkForm(form)
{

	if(isEmpty(form.name)) {
		alert('Please fill in your First name'); 
		form.name.focus();
		return false; 
	}

	if(isEmpty(form.p_lname)) {
		alert('Please fill in your Last name'); 
		form.p_lname.focus();
		return false; 
	}
	
	if(notValidEmail(form.Email1)) {
		alert('Incorrect or missing Email address!');
		form.Email1.focus();
		return false; 
	}

	if(isEmpty(form.phone1)||isEmpty(form.phone2)||isEmpty(form.phone3)) {
		alert('Please fill in your Phone'); 
		form.phone1.focus();
		return false; 
	}
	
}

function  phoneMove( element, index ) {
    if ( element.value.length == 3 ) 
        element.form.elements['phone'+(index+1)].focus();
}