function echeck(str) {
	    var at="@"
		var dot="."
		var lat=str.indexOf(at)
        var lstr=str.length
        var ldot=str.indexOf(dot)
       if (str.indexOf(at)==-1){
       alert("Invalid email address")
       return false
	}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Invalid email address")
		   return false
		}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid email address")
		    return false
		}
if (str.indexOf(at,(lat+1))!=-1){
alert("Invalid email address")
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Invalid email address")
return false
 }
if (str.indexOf(dot,(lat+2))==-1){
 alert("Invalid email address")
return false
 }
 if (str.indexOf(" ")!=-1){
alert("Invalid email address")
   return false
  }
 return true;					
}



function regis()

{
	if ((document.registration.fname.value==null)||(document.registration.fname.value=="")){
		alert("Please Enter Your Name");
		document.registration.fname.focus();
		return false;
	}
	if ((document.registration.lname.value==null)||(document.registration.lname.value=="")){
		alert("Please Enter Last Name");
		document.registration.lname.focus();
		return false;
	}
	 if ((document.registration.email.value==null)||(document.registration.email.value=="")){
		alert("Please enter your email address");
		document.registration.email.focus();
		return false;
	}
	if (echeck(document.registration.email.value)==false){
		document.registration.email.value="" ;
		document.registration.email.focus();
		return false;
	}
	if ((document.registration.username.value==null)||(document.registration.username.value=="")){
		alert("Please Enter  username");
		document.registration.username.focus();
		return false;
	}
	if ((document.registration.pwd.value==null)||(document.registration.pwd.value=="")){
		alert("Please Enter Password");
		document.registration.pwd.focus();
		return false;
		}
	if (!(document.registration.checkbox1.checked )){
		alert("Please Check the Box");
		return false;
	}		
 else
		return true;	
}


function comme()
{
	
 if ((document.comment.name.value==null)||(document.comment.name.value=="")){
		alert("Please Enter Your Name");
		document.comment.name.focus();
		return false;
	}

 	 if ((document.comment.emailid.value==null)||(document.comment.emailid.value=="")){
		alert("Please enter your email address");
		document.comment.emailid.focus();
		return false;
	}
	if (echeck(document.comment.emailid.value)==false){
		document.comment.emailid.value="" ;
		document.comment.emailid.focus();
		return false;
	}
	
	if ((document.comment.country.value==null)||(document.comment.country.value=="")){
		alert("Please Enter Your Country");
		document.comment.country.focus();
		return false;
	}
	
	if ((document.comment.comments.value==null)||(document.comment.comments.value=="")){
		alert("Please Enter Your comments Here");
		document.comment.comments.focus();
		return false;
	}
	else
		return true;	
}
	
function chek_up()
{

	if(document.photo.category.selectedIndex==0)
    {
    alert("Please select an category.");
    document.photo.category.focus();
    return false;
    }
	
	if ((document.photo.caption1.value==null)||(document.photo.caption1.value=="")){
	alert("Please Enter Fighter-1 Name");
	document.photo.caption1.focus();
	return false;
	}
	
	if ((document.photo.caption2.value==null)||(document.photo.caption2.value=="")){
	alert("Please Enter Fighter-2 Name");
	document.photo.caption2.focus();
	return false;
	}
	

	if (!(document.photo.checkbox1.checked )){
		alert("Please Check the Box");
		return false;
	}
	else
	{  
		document.photo.submit();
	}
}

function forgott()
{
	 if ((document.forgot.emailid.value==null)||(document.forgot.emailid.value=="")){
	alert("Please enter your email address");
	document.forgot.emailid.focus();
	return false;
	}
	if (echeck(document.forgot.emailid.value)==false){
		document.forgot.emailid.value="" ;
		document.forgot.emailid.focus();
		return false;
	}
	
	else
		return true;
	
}

function logfrm()
{
	if ((document.loginfrm.username.value==null)||(document.loginfrm.username.value=="")){
	alert("Please Enter Username");
	document.loginfrm.username.focus();
	return false;
		
	}
	
	if ((document.loginfrm.password.value==null)||(document.loginfrm.password.value=="")){
	alert("Please Enter password");
	document.loginfrm.password.focus();
	return false;
		
	}
		
	else
		return true;
	
	}
	
function abu()
{
if ((document.repot.email.value==null)||(document.repot.email.value=="")){
	alert("Please Enter Email Address");
	document.repot.email.focus();
	return false;
	}
if (echeck(document.repot.email.value)==false){
		document.repot.email.value="" ;
		document.repot.email.focus();
		return false;
	}
if ((document.repot.notes.value==null)||(document.repot.notes.value=="")){
	alert("Please Enter Some Notes Here");
	document.repot.notes.focus();
	return false;
	}	
	else
		return true;
	
}

function adminchek()
{

if ((document.adminfrm.adminname.value==null)||(document.adminfrm.adminname.value=="")){
	alert("Please Enter Administrator Name");
	document.adminfrm.adminname.focus();
	return false;
	}	
	
if ((document.adminfrm.username.value==null)||(document.adminfrm.username.value=="")){
	alert("Please Enter User Name");
	document.adminfrm.username.focus();
	return false;
	}		
	
if ((document.adminfrm.password.value==null)||(document.adminfrm.password.value=="")){
	alert("Please Enter Password");
	document.adminfrm.password.focus();
	return false;
	}		
	
if ((document.adminfrm.email.value==null)||(document.adminfrm.email.value=="")){
	alert("Please Enter Email Address");
	document.adminfrm.email.focus();
	return false;
	}	
	
if (echeck(document.adminfrm.email.value)==false){
		document.adminfrm.email.value="" ;
		document.adminfrm.email.focus();
		return false;
	}
else
		return true;	
	
}
	
function sech()
{
	if ((document.serchfrm.sechitem.value==null)||(document.serchfrm.sechitem.value=="")){
	alert("Please Enter Search field");
	document.serchfrm.sechitem.focus();
	return false;
	}	
else
		return true;		
}