function validateForm(){
	if (validEmail()==true && checkPwd()==true && checkSecurityCode()==true){
		return true;
	}
	return false;
}

function checkPwd(){
	var userPass=document.LoginFrm.usrpword.value;
	if ((userPass==null)||(userPass=="")){
		alert("Please Enter your Password");
		document.LoginFrm.usrpword.focus();
		return false;
	}
	return true;
}

function checkSecurityCode(){
	var scode=document.LoginFrm.sec_code.value;
	if ((scode==null)||(scode=="")){
		alert("Please Enter Security Code");
		document.LoginFrm.sec_code.focus();
		return false;
	}
	return true;
}

function validEmail(){
	var email=document.LoginFrm.usr_email.value;
	if ((email==null)||(email=="")){
		alert("Please Enter your Email address");
		return false;
	}
	if ((email.length < 5)){
		alert("Email address should be more than 5 characters and Valid");
		return false;
	}
	
	if (emailValid(email)==true){
		return true;
	}
}

function emailValid(str){
	var at="@"
    var dot="."
    var lat=str.indexOf(at)
    var lstr=str.length-1
    var ldot=str.indexOf(dot)
  
	if (str.indexOf(at)==-1){
	   alert(invemlmsg);
	   return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		alert(invemlmsg);
		return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert(invemlmsg);
		return false;
	}

	if (str.indexOf(at,(lat+1))!=-1){
		alert(invemlmsg);
		return false;
	}

	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert(invemlmsg);
		return false;
	}

	if (str.indexOf(dot,(lat+2))==-1){
		alert(invemlmsg);
		return false;
	}
		
	if (str.indexOf(" ")!=-1){
		alert(invemlmsg);
		return false;
	}

 	return true;
}