 //============ Check For End Date is After Start Date ============= 
function valid_email(email)
{
		at_position = email.indexOf("@",1)
        if (at_position != -1)
		{
       		at_position = email.indexOf(".",1)
            if (at_position == -1)
            {
                      return false;
            }//if	
	   }//if
       else
       {
            	return false;
       } //else
		return true;
}//email check
function IsString(strString)
 {
   var strValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;


   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}

function IsNumeric1(strString)
{
	var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0)
   {
    return false;
   }
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}

//===================================================Validate Contact================================
function validate()
 {

   if(document.contactfrm.full_name.value=="")
    {
	  alert("Enter full Name");
	  document.contactfrm.full_name.focus();
	  document.contactfrm.full_name.select();
	  return false;
	}
	 if(IsNumeric1(document.contactfrm.full_name.value))
	{
	 alert("Enter Only character value");
	 document.contactfrm.full_name.select();
	document.contactfrm.full_name.focus();
	return false;
	}
	if(document.contactfrm.email.value=="")
    {
	  alert("Enter Email Address ");
	  document.contactfrm.email.focus();
	  document.contactfrm.email.select();
	  return false;
	}
	 if(!valid_email(document.contactfrm.email.value))
	{
		alert('Please Enter Valid Email ,Try again!');
		document.contactfrm.email.select();
		document.contactfrm.email.focus();
		return false;
	}	
	if(document.contactfrm.comment.value=='')
	{
	alert("Please  Enter  Comment ");
	document.contactfrm.comment.select();
	document.contactfrm.comment.focus();
		return false;
	}	
}

//==========================================Validate Member==========================================
function validate_member()
 {

    if(document.memberfrm.mid_id.value=="")
    {
	  alert("Enter Membership Id");
	  document.memberfrm.mid_id.focus();
	  document.memberfrm.mid_id.select();
	  return false;
	}
   else
   {
	var digit=document.memberfrm.mid_id.value;
		if(digit > 10)
		{
		  alert("Enter Valid Membership Id");
		  document.memberfrm.mid_id.focus();
		  document.memberfrm.mid_id.select();
		  return false;
		}
   }
   if(document.memberfrm.u_pass.value=="")
    {
	  alert("Enter Password");
	  document.memberfrm.u_pass.focus();
	  document.memberfrm.u_pass.select();
	  return false;
	}
   else
   {
	var digit=document.memberfrm.u_pass.value;
		if(digit > 6 || digit < 6)
		{
		  alert("Enter Valid Password");
		  document.memberfrm.u_pass.focus();
		  document.memberfrm.u_pass.select();
		  return false;
		}
   }
    if(document.memberfrm.re_pass.value=="")
    {
	  alert("Enter Password");
	  document.memberfrm.re_pass.focus();
	  document.memberfrm.re_pass.select();
	  return false;
	}
   else
   {
	var digit=document.memberfrm.re_pass.value;
		if(digit > 6 || digit < 6)
		{
		  alert("Enter six charecter Password");
		  document.memberfrm.re_pass.focus();
		  document.memberfrm.re_pass.select();
		  return false;
		}
   }
   var p1=document.memberfrm.u_pass.value;
   var p2=document.memberfrm.re_pass.value;
   if(p1!=p2)
   {
	 alert("please Enter Similar password");
	 document.memberfrm.re_pass.focus();
	 document.memberfrm.re_pass.select();
	 return false;
   }
   
   if(document.memberfrm.first_name.value=="")
    {
	  alert("Enter First Name");
	  document.memberfrm.first_name.focus();
	  document.memberfrm.first_name.select();
	  return false;
	}
	
	 if(IsNumeric1(document.memberfrm.first_name.value))
	{
	 alert("Enter Only character value");
	 document.memberfrm.first_name.select();
	document.memberfrm.first_name.focus();
	return false;
	}
	  if(document.memberfrm.last_name.value=="")
    {
	  alert("Enter Last Name");
	  document.memberfrm.last_name.focus();
	  document.memberfrm.last_name.select();
	  return false;
	}
	
	 if(IsNumeric1(document.memberfrm.last_name.value))
	{
	 alert("Enter Only character value");
	 document.memberfrm.last_name.select();
	document.memberfrm.last_name.focus();
	return false;
	}
	if(document.memberfrm.email.value=="")
    {
	  alert("Enter Email Address ");
	  document.memberfrm.email.focus();
	  document.memberfrm.email.select();
	  return false;
	}
	 if(!valid_email(document.memberfrm.email.value))
	{
		alert('Please Enter Valid Email ,Try again!');
		document.memberfrm.email.select();
		document.memberfrm.email.focus();
		return false;
	}	
	if(document.memberfrm.company.value=="")
	{
	alert("Please  Enter  Company Name ");
	document.memberfrm.company.select();
	document.memberfrm.company.focus();
		return false;
	}	
	if(document.memberfrm.job_title.value!="")
	{ 
		 if(IsNumeric1(document.memberfrm.job_title.value))
		 {
		alert("Please  Enter Valid Job Title ");
		document.memberfrm.job_title.select();
		document.memberfrm.job_title.focus();
			return false;
		}	
}
 }
