function searchCheck()
{
	findkeyword = document.list.findkeyword.value;
	
	if(findkeyword=="")
	{
			alert("Please Enter a Keyword. The Store Name Should not be Blank");
			document.list.findkeyword.focus();
			return false;
	}
	if(findkeyword=="Get coupons for 20000 stores...")
	{
			alert("Enter a Store Name");
			document.list.findkeyword.focus();
			return false;
	}
	return true;
		
}

// JavaScript Document
function IsEmailValid(str)
	{
	 //str=document.join_form.email.value;
	var retval=true;
	var AtSym=str.indexOf('@');				
	var Period=str.lastIndexOf('.');		
	var Space=str.indexOf(' ');				
	var Length=str.length-1;
	var index = str.indexOf('@');
    	var substr = str.substring(index+1);
    	var index2 = substr.indexOf('@');
	if ((AtSym<1)||(str.charAt(0)=='_')||(str.charAt(Length)=="_")||				//'@' can't be in first position
		(str.indexOf(".")<=AtSym+1)||
		(str.indexOf("_")==AtSym+1)||(str.charAt(AtSym-1)=="_")||
		(Period<=AtSym+1)||					//Must be atleast one valid char between '@' and '.'
		(Period==Length)||					//Must be atleast one valid char after '.'
		((Space>0) && (Space!=Length))||
		(index2 != -1))                       //No empty spaces permitted
		{
		       //alert("Enter proper mail ID");
			   //document.join_form.email.focus();
			   return false;
		}	   
			  return true;
	
}
function check1()
{
  if(document.forgotpass.fmail.value=="")
    {
         alert("Enter your Email Address");
        document.forgotpass.fmail.focus();
      return false;
     }
	 if(!IsEmailValid(document.forgotpass.fmail.value))
	{
		alert("Enter Proper Email Address ");
		document.forgotpass.fmail.focus();
		return false;
	}
return true;
}

function check()
{
	if(document.login.loginemail.value == "")
	{
		alert("Enter Your Email Address");
		document.login.loginemail.focus();
		return false;
	}
	
if(!IsEmailValid(document.login.loginemail.value))
	{
		alert("Enter Proper Email Address ");
		document.login.loginemail.focus();
		return false;
	}
if(document.login.loginpass.value == "")
	{
		alert("Enter Your Password ");
		document.login.loginpass.focus();
		return false;
	}
	
	
return true;
}
function check2()
{
	if(document.chpwd.oldpwd.value=="")
	{
		alert("Enter old password ");
		document.chpwd.oldpwd.focus();
		return false;
	}
	if(document.chpwd.newpwd.value=="")
	{
		alert("Enter New Password ");
		document.chpwd.newpwd.focus();
		return false;
	}
	 var len=document.chpwd.newpwd.value;
   
   
    if(len.length<=4)
        {
             alert("Password length should not be less than 5 characters");
              document.chpwd.newpwd.focus();
              return false;
        }
	if(document.chpwd.conpwd.value=="")
	{
		alert("Enter Confirm Password ");
		document.chpwd.conpwd.focus();
		return false;
	}
	if(document.chpwd.newpwd.value!=document.chpwd.conpwd.value)
    {
      alert("Confirm password does not match with password");
     document.chpwd.conpwd.focus();
     return false;
     }
	return true;
}
	


function namecheck()
{
	if(document.register.dname.value == "")
	{
		alert("Enter a Display Name ");
		document.register.dname.focus();
		return false;
	}
	if(document.register.fname.value == "")
	{
		alert("Enter Your First Name ");
		document.register.fname.focus();
		return false;
	}
if(document.register.lname.value == "")
	{
		alert("Enter Your Last Name ");
		document.register.lname.focus();
		return false;
	}
	if(!IsEmailValid(document.register.email.value))
	{
		alert("Enter Proper Email Id ");
		document.register.email.focus();
		return false;
	}
	if(document.register.pass1.value == "")
	{
		alert("Enter Your Password ");
		document.register.pass1.focus();
		return false;
	}
      var len=document.register.pass1.value;
   
   
    if(len.length<=4)
        {
             alert("Password length should not be less than 5 characters");
              document.register.pass1.focus();
              return false;
        }
	
	if(document.register.pass2.value == "")
	{
		alert("Enter Confirm Password ");
		document.register.pass2.focus();
		return false;
	}
     
     
   if(document.register.pass1.value!=document.register.pass2.value)
    {
      alert("Confirm password does not match with password");
     document.register.pass2.focus();
     return false;
     }
return true;
}
function contcheck()
{
	if(document.Form1.name.value == "")
	{
		alert("Enter Your Name ");
		document.Form1.name.focus();
		return false;
	}
	if(document.Form1.phone.value == "")
	{
		alert("Enter Your Phone Number ");
		document.Form1.phone.focus();
		return false;
	}
	if(!IsEmailValid(document.Form1.email.value))
	{
		alert("Enter Proper Email Id ");
		document.Form1.email.focus();
		return false;
	}
	if(document.Form1.subject.value == "")
	{
		alert("Enter Your Subject ");
		document.Form1.subject.focus();
		return false;
	}
	
	if(document.Form1.msg.value == "")
	{
		alert("Enter Your Message ");
		document.Form1.msg.focus();
		return false;
	}
return true;
}
function confirmuser()
{
	if(!IsEmailValid(document.cfrm.cemail.value))
	{
		alert("Enter Proper Email Id ");
		document.cfrm.cemail.focus();
		return false;
	}
		if(document.cfrm.password.value=="")
	{
		alert("Enter Password ");
		document.cfrm.password.focus();
		return false;
	}
	 var len=document.cfrm.password.value;
   
   
    if(len.length<=4)
        {
             alert("Password length should not be less than 5 characters");
              document.cfrm.password.focus();
              return false;
        }

	if(document.cfrm.ccode.value=="")
	{
		alert("Enter Confirmation code");
		document.cfrm.ccode.focus();
		return false;
	}
	return true;
}
	