function validate(){
 if(document.form1.name.value==''){
     alert("Please Enter Your  Name");
	 document.form1.name.focus();
	 return false;
  }
 else if(!(CheckAlphabet(document.form1.name.value)))
	 {
	   alert ("Please Enter a Valid Full Name  (eg.  A-Z,a-z).");
	   document.form1.name.focus();
	   return false;
	  }
if(document.form1.email.value==''){
     alert("Please Enter Your Email Address");
	 document.form1.email.focus();
	 return false;
  }
}

function CheckAlphabet(character) {

var valid = 1

character=character.toUpperCase();



var GoodChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ. "

var GoodChars1 = " "

var i = 0

if (character=="") {

// Return false if number is empty

valid = 0

}

for (i =0; i <= character.length -1; i++) {

if (GoodChars.indexOf(character.charAt(i)) == -1) {

// Note: Remove the comments from the following line to see this

// for loop in action.

// alert(character.charAt(i) + " is no good.")

valid = 0

} // End if statement



} // End for loop

return valid

}



function IsValid( oField )

{

  if (oField.name=='email')

    {

        re = /^(([a-z\._\-0-9])+\@([a-z\._\-0-9])+\.([a-z])+)?$/i;

        $sMsg = "E-Mail is invalid.\E-Mail should be in user@domain.com format."

    }

 

 if (oField.name=='pcode2')

    {

        re = /^((([0-9]))*)*$/i;

        $sMsg = " Postcode entered is invalid.\Postcode entered should contain only numericals."

    }

	

	

	if (oField.name=='mobile1')

    {

        re = /^((([0-9]))*)*$/i;

        $sMsg = "Mobile No. entered is invalid.\Mobile entered should contain only numericals."

    }

 

 

   if ( !re.test(oField.value) )

    {

        alert( $sMsg );

        oField.value = '';

        oField.focus();

        return false;

    }

}



function CheckDigits(TheNumber) {

var valid = 1

var GoodChars = "0123456789-+() "

var i = 0

if (TheNumber=="") {

// Return false if number is empty

valid = 0

}

for (i =0; i <= TheNumber.length -1; i++) {

if (GoodChars.indexOf(TheNumber.charAt(i)) == -1) {

// Note: Remove the comments from the following line to see this

// for loop in action.

// alert(TheNumber.charAt(i) + " is no good.")

valid = 0

} // End if statement

} // End for loop

return valid

}