// JavaScript Document
function validateSignupForm(){
var why = "";
var show = false;
	if(document.userSignupForm.userName.value == ""){
		why+="Please enter a valid User Name\n"; 
		show = true;
		document.userSignupForm.userName.focus();
	}
	if(document.userSignupForm.password.value.length<6 ){
		why+="Please enter a valid Password minimum of 6\n";
		show = true;
		document.userSignupForm.password.focus();
	}
	if(document.userSignupForm.password.value !=  document.userSignupForm.confirmPassword.value){
		why+="Please Check the Password it should match with confirmpassword\n";
		show = true;
		document.userSignupForm.confirmPassword.focus();
	}
	if(isEmail(document.userSignupForm.email.value)==false){
		why+="Please enter valid Email \n";
		show = true;
		document.userSignupForm.email.focus();
	}
	if(document.userSignupForm.city.value == ""){
		why+="Please enter a City\n";
		show = true;
		document.userSignupForm.city.focus();
	}	
	if(show){
		alert(why);
		return false;
	}
}
function isEmail( strValue) {
  var objRegExp  = /^[a-z]\w*([.\-]\w+)*@[a-z]\w*([.\-]\w+)*\.[a-z]{2,3}$/i;
  return objRegExp.test(strValue);
} 
function nospaces(t){
if(t.value.match(/\s/g)){
alert('Sorry, you are not allowed to enter any spaces');
t.value=t.value.replace(/\s/g,'');
}
}

