
chk=0;
function validEmail(eAddr) 
{ 
   var goodAddr = false;
   var ndxAt = ndxDot = 0;

   ndxAt  = eAddr.indexOf("@");
   ndxDot = eAddr.indexOf(".");

   if ( (ndxDot < 0) || (ndxAt < 0) )
      alert("Invalid Email address. !");  
   else if ( eAddr.length <= (ndxDot + 2) )
      alert("There must be three characters after the 'dot'.\n\nThe format is 'you@dom.suf'. !");
   else
      goodAddr = true;
   return (goodAddr);                       
} 
//////////////////////////////////////

function validatelogin()
{
	if(document.login.txtlogin.value=="")	
		{
		alert("plz Enter your Name...........");
		document.login.txtlogin.focus();
		return false;
		}
	if(document.login.txtpass.value=="")
		{
		alert("plz enter ur password..........");
		document.login.txtpass.focus();
		return false;
		}
		return true;
	}
	//////////////////////////
	
	function  validateform()
	{
		if(document.signupform.username.value=="")
		{
			alert("User Name Should not be Empaty");
			document.signupform.username.focus();
			return false;
			}
		if(document.signupform.txtemail.value=="")
		{
			alert("Plz Enter Your Email Address......");
			document.signupform.txtemail.focus();
			return false;			
			}
			
			 if(document.signupform.txtemail.value != "")
  {
			var eAddr = document.signupform.txtemail.value;
			var goddAdr = validEmail(eAddr);
			if(goddAdr == false)
	{
		document.signupform.txtemail.focus();
		document.signupform.txtemail.select();
		return false;
	}
  }  
			
		if(document.signupform.password.value == "")
		{
			 alert("Password can't be empty");
			 document.signupform.password.focus();
			 return false;
	 }
	 
	 if(document.signupform.password2.value =="")
	 {
			 alert("Retype Password can't be empty");
			 document.signupform.password2.focus();
			 return false;
	 }
	 
		 if(document.signupform.password.value != document.signupform.password2.value)
		 {
				 alert("Passwords values not matching,\n\r Please enter again");
				 return false;
		 }
		 if(document.signupform.password.value.length < 6 )
		 {
			 alert("Password can't be less than 6 characters");
			 return false;
		 }
	  
	 
	return true;
	}
/////////////////////////////

function validateadminlogin()

	{
		if(document.frmlogin.txtusername.value=="")
			{
			alert("Plz Enter your Login Name");
			document.frmlogin.txtusername.focus();
			return false;
			}
			if(document.frmlogin.txtpass.value=="")
			{
			alert("Plz Enter your Password");
			document.frmlogin.txtpass.focus();
			return false;
			}
			
			
	}
////////////////////////
function validatecategorform()

	{
		if(document.frmcategory.txtcaname.value=="")
			{
			alert("Plz Enter Category Name................");
			document.frmcategory.txtcaname.focus();
			return false;
			}
			if(document.frmcategory.cmdstatus.value=="")
			{
			alert("Plz Select one");
			document.frmcategory.cmdstatus.focus();
			return false;
			}			
	}
	///////////////////////////
	function articleform()

	{
		if(document.frmarticle.txtarticaltitle.value=="")
			{
			alert("Plz Type Article Nmae................");
			document.frmarticle.txtarticaltitle.focus();
			return false;
			}
			if(document.frmarticle.txtarticledesc.value=="")
			{
			alert("Plz Type Description..........");
			document.frmarticle.txtarticledesc.focus();
			return false;
			}
			}
	///////////////////////////////////////////
	function faqsform()

	{
		if(document.frmfaqs.txtquestion.value=="")
			{
			alert("Plz Type Question................");
			document.frmfaqs.txtquestion.focus();
			return false;
			}
			if(document.frmfaqs.txtanswer.value=="")
			{
			alert("Plz Type Answer..........");
			document.frmfaqs.txtanswer.focus();
			return false;
			}
			}
	//////////////////////////////////////////////////
	function contactform()

	{
		if(document.formcontact.txtname.value=="")
			{
			alert("Plz Type Name...............");
			document.formcontact.txtname.focus();
			return false;
			}
			
			if(document.formcontact.txtemail.value=="")
		{
			alert("Plz Enter Your Email Address......");
			document.formcontact.txtemail.focus();
			return false;			
			}
			
			 if(document.formcontact.txtemail.value != "")
  {
			var eAddr = document.formcontact.txtemail.value;
			var goddAdr = validEmail(eAddr);
			if(goddAdr == false)
	{
		document.formcontact.txtemail.focus();
		document.formcontact.txtemail.select();
		return false;
	}
  }
  
			if(document.formcontact.txtcomments.value=="")
			{
			alert("Plz Type Comments..........");
			document.formcontact.txtcomments.focus();
			return false;
			}
			}
////////////////////////////////////////////////////////////////////////////////
function domainform()

	{
		if(document.frmdomain.cmdcname.value=="")
			{
			alert("Plz Select Category................");
			document.frmdomain.cmdcname.focus();
			return false;
			}
			if(document.frmdomain.txtdname.value=="")
			{
			alert("Plz Type Domain Name..........");
			document.frmdomain.txtdname.focus();
			return false;
			}
			/*if(document.frmdomain.txtprice.value=="")
			{
			alert("Plz Type Domain Price..........");
			document.frmdomain.txtprice.focus();
			return false;
			}*/
			
			if(document.frmdomain.cmdstatus.value=="")
			{
			alert("Plz Select One..........");
			document.frmdomain.cmdstatus.focus();
			return false;
			}
			
	}
	//////////////////////////////////////////validatepriceform////////////////////////
	
	function validatepriceform()

	{
		if(document.frmprice.txtname.value=="")
			{
			alert("Plz Type Your Name................");
			document.frmprice.txtname.focus();
			return false;
			}
			
			if(document.frmprice.txtemail.value=="")
		{
			alert("Plz Enter Your Email Address......");
			document.frmprice.txtemail.focus();
			return false;			
			}
			
			 if(document.frmprice.txtemail.value != "")
  {
			var eAddr = document.frmprice.txtemail.value;
			var goddAdr = validEmail(eAddr);
			if(goddAdr == false)
	{
		document.frmprice.txtemail.focus();
		document.frmprice.txtemail.select();
		return false;
	}
  }
			
			
			
			}