function checkcompanylogin(frm)

{
	var cond=true;
	if(frm.compemail.value.length==0)
	{
		alert(" Enter Email Address ");
		if(cond==true){
			frm.compemail.focus();
		}
		cond=false;
		return false;

	}
	if(!checkMail(frm.compemail.value)){
		alert("Email must contain an email address.\n");
		if(cond==true){
			frm.compemail.value="";
			frm.compemail.focus();
		}
		cond=false;
		return false;
	}

	if(frm.comppass.value.length==0)
	{
		alert("Enter password");
		if(cond==true){
			frm.comppass.focus();
		}
		cond=false;
		return false;
	}

	if(cond=true)
	{
		frm.hidactionlogin.value="valid";
		return true;	
	}
}
function checkMail(email){

var x = email;

var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

if (filter.test(x)){

	return true;

	}

	else {

	  return false;

	}

}

