
function reg(){

var first=document.form1.first.value;
var last=document.form1.last.value;
var email=document.form1.email.value;
var password1=document.form1.password1.value;
var password2=document.form1.password2.value;




first=first.replace(/^[\s]+/g,"");
last=last.replace(/^[\s]+/g,"");
email=email.replace(/^[\s]+/g,"");
password1=password1.replace(/^[\s]+/g,"");
password2=password2.replace(/^[\s]+/g,"");



if(first == "" || last=="" || email=="" || password1=="" || password2==""){

alert("You missed one of the required fields.");
return false;

}else{

if(password1 == password2){

if (document.form1.terms.checked){


if(password1.length >=6 && password1.length <= 15){

return true;

}else{
alert("Password must have atleast 6 to 15 characters.");
return false;

}
}else{
alert("Please read  our 'Term and conditions' before going further. If you accept then please check the checkbox below and click on 'Register' button.");
return false;

}

}else{

alert("Password does not match. Please try again.");

return false;

}
}




}


function login(){

var email=document.form1.email.value;
var password=document.form1.password.value;

email=email.replace(/^[\s]+/g,"");
password=password.replace(/^[\s]+/g,"");


if(password=="" || email==""){

alert("You missed one of the required fields.");
return false;

}else{

return true;

}




}
