
function validate(){
var digits="0123456789"
var temp
var emailID=document.form1.email_add
var invalid = " "; // Invalid character is a space
var minLength = 6; // Minimum length
var pw1 = document.form1.password.value;
var pw2 = document.form1.retype.value;

if (document.form1.category_new3.selectedIndex==""){
alert("Select Category!")
return false
}

if (document.form1.username.value=="") {
alert("Enter Username!")
return false
}
if (document.form1.username.value.indexOf(invalid) > -1) {
alert("Sorry, spaces in Username are not allowed.");
return false;
}
if (document.form1.username.value.length < minLength) {
alert('Your Username must be at least ' + minLength + ' characters long. Try again.');
return false;
}

if (document.form1.password.value=="") {
alert("Enter Password!")
return false
}
if (document.form1.password.value.indexOf(invalid) > -1) {
alert("Sorry, spaces in Password are not allowed.");
return false;
}
if (document.form1.password.value.length < minLength) {
alert('Your Password must be at least ' + minLength + ' characters long. Try again.');
return false;
}
if (document.form1.retype.value=="") {
alert("Enter Retype Password!")
return false
}
if (document.form1.retype.value.indexOf(invalid) > -1) {
alert("Sorry, spaces in Password are not allowed.");
return false;
}
if (document.form1.retype.value.length < minLength) {
alert('Your Password must be at least ' + minLength + ' characters long. Try again.');
return false;
}
if (pw1 != pw2) {
alert ("You did not enter the same new password twice. Please re-enter your password.");
return false;
}


if (document.form1.firstname2.value=="") {
alert("Enter Firstname!")
return false
}

if (document.form1.lastname2.value=="") {
alert("Enter Lastname!")
return false
}

if (document.form1.bmonth.selectedIndex==""){
alert("Select Birthmonth!")
return false
}
if (document.form1.bday.selectedIndex==""){
alert("Select Birthday!")
return false
}

if (document.form1.byear.selectedIndex==""){
alert("Select Birthyear!")
return false
}


if (document.form1.country.selectedIndex==""){
alert("Select Nationality!")
return false
}

if (document.form1.civil_status.selectedIndex==""){
alert("Select Civil Status!")
return false
}

if (document.form1.gender.selectedIndex==""){
alert("Select Gender!")
return false
}

if (document.form1.address.value=="") {
alert("Enter Address!")
return false
}

if (document.form1.address.value.length > 150)
{
alert("Please enter at most 150 characters in the address field.");
form1.address.focus();
return (false);
}

if (document.form1.zip_code.value=="") {
alert("Enter Zip Code!")
return false
}

if (document.form1.tel.value=="") {
alert("Enter Tel No.!")
return false
}

if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	
	
if (document.form1.company_address.value.length > 150)
{
alert("Please enter at most 150 characters in the company address field.");
form1.address.focus();
return (false);
}





}

