﻿// JScript File

function  blankCheck(control,message)
{
    if (control.value=='')
    {
        alert('Please Enter The '+message);
        control.focus();
        return false;
    }
}



   function ValidateMailToUsN(txtName,SelectInt,txtEmail, txtCity,txtCountry,txtZip, txtTel)
  {
 //debugger; //chkMaleFemale
 
 
   

//for(var i=0; i<CountryA.length; i++) 


 
//  
//  var myC=new Boolean(false);  
//   //debugger;
// for(i=0; i<CountryA.length; i++)
// { 
//  if(txtCountry.value==CountryA[i])
//     {
//      myC=true;
//     
//     }
// }
// if(myC==false)
// {
//  alert("txtCountry Can Not Be Match.");
//  txtCountry.style.borderColor='red';
//    txtCountry.style.borderWidth='2px';
//    return false;
// }
// else
//{
//    txtCountry.style.borderColor='#68c417';
//    txtCountry.style.borderWidth='1px';
//}
  
 
 var myBoolean=new Boolean(true);  

//




//Name 
myBoolean=blankCheck(txtName,'Name');    
if(myBoolean==false)
{   
  //  txtName.style.borderColor='red';
  //  txtName.style.borderWidth='2px';
    return false;
} 
else
{
  //  txtName.style.borderColor='#68c417';
   // txtName.style.borderWidth='1px';
}


 myBoolean=CheckCH(txtName);  
if(myBoolean==false)
{   
  //  txtName.style.borderColor='red';
   // txtName.style.borderWidth='2px';
    return false;
} 
else
{
  //  txtName.style.borderColor='#68c417';
  //  txtName.style.borderWidth='1px';
}


//txtEmail
myBoolean=blankCheck(txtEmail,'Email');    
if(myBoolean==false)
{   
   // txtEmail.style.borderColor='red';
   // txtEmail.style.borderWidth='2px';
    return false;
} 
else
{
   // txtEmail.style.borderColor='#68c417';
   // txtEmail.style.borderWidth='1px';
} 


//Email
var  status=validateEmails(txtEmail);
if (status=="1")
{
  //  txtEmail.style.borderColor='red';
   // txtEmail.style.borderWidth='2px';
    return false;
} 
else
{
  //  txtEmail.style.borderColor='#68c417';
   // txtEmail.style.borderWidth='1px';
}
 

//var chkOpt=document.getElementsByName(chkMaleFemale);

//myBoolean=checkBoxSelection(chkOpt,'Gender');    
//if(myBoolean==false)
//{   
//    return false;
//}    
  
 


//City
myBoolean=blankCheck(txtCity,'City');    
if(myBoolean==false)
{   
   // txtCity.style.borderColor='red';
   // txtCity.style.borderWidth='2px';
    return false;
} 
else
{
  //  txtCity.style.borderColor='#68c417';
   // txtCity.style.borderWidth='1px';
}
 

//Country
myBoolean=blankCheck(txtCountry,'Country');    
if(myBoolean==false)
{   
   // txtCountry.style.borderColor='red';
  //  txtCountry.style.borderWidth='2px';
    return false;
} 
else
{
   // txtCountry.style.borderColor='#68c417';
  //  txtCountry.style.borderWidth='1px';
}


 myBoolean=CheckCH(txtCountry);  
if(myBoolean==false)
{   
  //  txtCountry.style.borderColor='red';
   // txtCountry.style.borderWidth='2px';
    return false;
} 
else
{
   // txtCountry.style.borderColor='#68c417';
  //  txtCountry.style.borderWidth='1px';
}





myBoolean=CountryCheck(txtCountry,'Country');    
if(myBoolean==false)
{   
    //txtCountry.style.borderColor='red';
   // txtCountry.style.borderWidth='2px';
    return false;
} 
else
{
   // txtCountry.style.borderColor='#68c417';
  //  txtCountry.style.borderWidth='1px';
}



//Zip
myBoolean=blankCheck(txtZip,'Pin Code');
if(myBoolean==false)
{   
   // txtZip.style.borderColor='red';
  //  txtZip.style.borderWidth='2px';
    return false;
} 
else
{
   // txtZip.style.borderColor='#68c417';
   // txtZip.style.borderWidth='1px';
}
 
myBoolean=integerCheck(txtZip,'Zip Code');   
if(myBoolean==false)
{   
   // txtZip.style.borderColor='red';
  //  txtZip.style.borderWidth='2px';
    return false;
}
else
{
   // txtZip.style.borderColor='#68c417';
   // txtZip.style.borderWidth='1px';
}

    if(txtZip.value.length!=6)
    {
    alert('Please Enter Six Digit PinCode.');
    txtZip.focus();
   //  txtZip.style.borderColor='red';
  //  txtZip.style.borderWidth='2px';
    return false;
    
    }


//Phone
if (txtTel.value=='Phone')
{
txtTel.value='';
} 

myBoolean=blankCheck(txtTel,'Phone');    
if(myBoolean==false)
{   
   // txtTel.style.borderColor='red';
  //  txtTel.style.borderWidth='2px';
    return false;
} 
else
{
  //  txtTel.style.borderColor='#68c417';
  //  txtTel.style.borderWidth='1px';
} 
myBoolean=integerCheck(txtTel,'Phone'); 
 
if(myBoolean==false)
{   
  //  txtTel.style.borderColor='red';
  //  txtTel.style.borderWidth='2px';
    return false;
} 
else
{
   // txtTel.style.borderColor='#68c417';
  //  txtTel.style.borderWidth='1px';
} 

if (txtTel.value.length<5)
{
    alert("Phone Number Can Not Be Less Than 5 Digits.");
  //  txtTel.style.borderColor='red';
  //  txtTel.style.borderWidth='2px';
    return false;
} 
else
{
  //  txtTel.style.borderColor='#68c417';
  //  txtTel.style.borderWidth='1px';
} 
 


 var chosenoption=SelectInt.options[SelectInt.selectedIndex]  
 if (chosenoption.value=="- Please Select -")
 {
 alert('Please Select Interest In');
 SelectInt.focus();
   return false;
 
 }
  

  
 


   document.forms[0].action="MailToUsThanks.aspx";

}


function validateMailToUs1(txtName,txtEmail, txtCity ,txtCountry, txtZip, txtTel,  SelectInt)
{
var myBoolean=new Boolean(true);

    if(txtName.value=="")
    {
        alert('Please Enter The Name.');
        txtName.focus();
        return false; 
    }   
        
    if(txtEmail.value=="")
    {
        alert('Please Enter The Email.');
        txtEmail.focus();
        return false; 
    } 
    
    if (txtEmail.value!="")
    {         

      var status=validateEmails(txtEmail);
        if (status=="1")
        {
            txtEmail.focus();
            return false; 
        }  
    } 
    
    

//City
myBoolean=blankCheck(txtCity,'City');    
if(myBoolean==false)
{   
   // txtCity.style.borderColor='red';
   // txtCity.style.borderWidth='2px';
    return false;
} 
else
{
  //  txtCity.style.borderColor='#68c417';
   // txtCity.style.borderWidth='1px';
}
  

//Country
myBoolean=blankCheck(txtCountry,'Country');    
if(myBoolean==false)
{   
   // txtCountry.style.borderColor='red';
  //  txtCountry.style.borderWidth='2px';
    return false;
} 
else
{
    txtCountry.style.borderColor='#68c417';
  //  txtCountry.style.borderWidth='1px';
}

  

myBoolean=CountryCheck(txtCountry,'Country');    
if(myBoolean==false)
{   
    //txtCountry.style.borderColor='red';
   // txtCountry.style.borderWidth='2px';
    return false;
} 
else
{
   // txtCountry.style.borderColor='#68c417';
  //  txtCountry.style.borderWidth='1px';
}


//Zip
myBoolean=blankCheck(txtZip,'Pin Code');
if(myBoolean==false)
{   
   // txtZip.style.borderColor='red';
  //  txtZip.style.borderWidth='2px';
    return false;
} 
else
{
   // txtZip.style.borderColor='#68c417';
   // txtZip.style.borderWidth='1px';
}
 
myBoolean=integerCheck(txtZip,'Zip Code');   
if(myBoolean==false)
{   
   // txtZip.style.borderColor='red';
  //  txtZip.style.borderWidth='2px';
    return false;
}
else
{
   // txtZip.style.borderColor='#68c417';
   // txtZip.style.borderWidth='1px';
}

    if(txtZip.value.length!=6)
    {
    alert('Please Enter Six Digit PinCode.');
    txtZip.focus();
   //  txtZip.style.borderColor='red';
  //  txtZip.style.borderWidth='2px';
    return false;
    
    }
    
    
//Phone
if (txtTel.value=='Phone')
{
txtTel.value='';
} 

myBoolean=blankCheck(txtTel,'Phone');    
if(myBoolean==false)
{   
   // txtTel.style.borderColor='red';
  //  txtTel.style.borderWidth='2px';
    return false;
} 
else
{
  //  txtTel.style.borderColor='#68c417';
  //  txtTel.style.borderWidth='1px';
} 
myBoolean=integerCheck(txtTel,'Phone'); 
 
if(myBoolean==false)
{   
  //  txtTel.style.borderColor='red';
  //  txtTel.style.borderWidth='2px';
    return false;
} 
else
{
   // txtTel.style.borderColor='#68c417';
  //  txtTel.style.borderWidth='1px';
} 

if (txtTel.value.length<5)
{
    alert("Phone Number Can Not Be Less Than 5 Digits.");
  //  txtTel.style.borderColor='red';
  //  txtTel.style.borderWidth='2px';
    return false;
} 
else
{
  //  txtTel.style.borderColor='#68c417';
  //  txtTel.style.borderWidth='1px';
} 
 

    
   
 var chosenoption=SelectInt.options[SelectInt.selectedIndex]  
 if (chosenoption.value=="- Please Select -")
 {
 alert('Please Select Interest In');
 SelectInt.focus();
   return false;
 
 }    


}


function validatecretaccount(opt1,opt2,opt3,opt4,txtName,chkMale,chkFemale,txtSecurityNo,txtNationality,txtAddress,txtDOB,cboState,cboDistrict,txtPinCode,txtFax,txtTelephone,txtMobile,txtEmail,txtComments)
{
//var myBoolean=new Boolean(true);


 if ((opt1.checked==false)&&(opt2.checked==false)&&(opt3.checked==false)&&(opt4.checked==false))
    {
        alert("Please Select The Membership");
        opt1.focus();
        return false;
    }
    

    if(txtName.value=="")
    {
        alert('Please Enter Your Name.');
        txtName.focus();
        return false; 
    }
    
    if ((chkMale.checked==false)&&(chkFemale.checked==false))
    {
        alert("Please Select The Gender");
        chkMale.focus();
        return false;
    }
        
    if (txtSecurityNo!=null)
    {
        if(txtSecurityNo.value=="")
        {
            alert('Please Enter Your Security No.');
            txtSecurityNo.focus();
            return false; 
        }        
    }
    
    if (txtNationality!=null)
    {
        if(txtNationality.value=="")
        {
            alert('Please Enter Your Nationality.');
            txtNationality.focus();
            return false; 
        }        
    }    
//    if(txtSecurityNo.value=="")
//    {
//        alert('Please Enter Your Security No.');
//        txtSecurityNo.focus();
//        return false; 
//    }
//    if(txtNationality.value=="")
//    {
//        alert('Please Enter The Nationality.');
//        txtNationality.focus();
//        return false; 
//    }
    
    if (txtAddress.value=="")
    {
        alert("Please Enter The Address");
        txtAddress.focus();
        return false;
    }   
//    if (txtDOB.value=="")                                 
//    {
//        alert('Please Enter The Date Of Birth.');
//        txtDOB.focus();
//        return false; 
//            
//    }  


     if (cboState.value=="")
    {
        alert("Please Select The State.");
        cboState.focus();
        return false;  
    }    
    
     if (cboDistrict.value=="")
    {
        alert("Please Select The District.");
        cboDistrict.focus();
        return false;  
    }    
        
    
    
//    if(txtState.value=="")
//    {
//        alert('Please Enter The State.');
//        txtState.focus();
//        return false; 
//    }
//    if(txtCity.value=="")
//    {
//        alert('Please Enter The City.');
//        txtCity.focus();
//        return false; 
//    }  
    if(txtPinCode.value=="")
    {
        alert('Please Enter The Pin Code.');
        txtPinCode.focus();
        return false; 
    }    
    
    //Pincode
     if (txtPinCode.value!="")
    {
 
        var digits="0123456789";
        var temp;
        for (var i=0;i<txtPinCode.value.length;i++)
            {
                temp=txtPinCode.value.substring(i,i+1);
                if (digits.indexOf(temp)==-1)
                {
                    alert("'"+temp+"'" +" character in Your PinCode seems incorrect. Please try again.");
                    txtPinCode.focus();
                    return false;
                }
            }   
        if (txtPinCode.value.length!=6)
        {
            alert("Please Enter Six Digit PinCode.");
            txtPinCode.focus();
            return false;
        }                    
    }         
    
    if(txtFax.value=="")
    {
        alert('Please Enter The Fax No.');
        txtFax.focus();
        return false; 
    }  
    if(txtTelephone.value=="")
    {
        alert('Please Enter The Telephone');
        txtTelephone.focus();
        return false; 
    }  
    //Pincode
     if (txtTelephone.value!="")
    {
        var digits="0123456789-";
        var temp;
        for (var i=0;i<txtTelephone.value.length;i++)
            {
                temp=txtTelephone.value.substring(i,i+1);
                if (digits.indexOf(temp)==-1)
                {
                    alert("'"+temp+"'" +" character in Your Telephone seems incorrect. Please try again.");
                    txtTelephone.focus();
                    return false;
                }
            }         
    }   
    
    
    if(txtTelephone.value.length<5 || txtTelephone.value.length>12)
    {
    alert('Telephone / Mobile No. can not be less then 5 or greater then 12 ');
    txtTelephone.focus();
    return false;
    }
            
    if(txtMobile.value=="")
    {
        alert('Please Enter The Mobile No.');
        txtMobile.focus();
        return false; 
    }   
    if(txtEmail.value=="")
    {
        alert('Please Enter The Email.');
        txtEmail.focus();
        return false; 
    }  
    if (txtEmail.value!="")
    { 
      
        
        //var emailid=txtmail.value;        
        //status=checkMailId(emailid);
      var status=validateEmails(txtEmail);
        if (status=="1")
        {
            txtEmail.focus();
            return false; 
        }  
    }   
//    if(txtComments.value=="")
//    {
//        alert('Please Enter The Comments.');
//        txtComments.focus();
//        return false; 
//    }                 
                  
return true;
}

function validateEmails(field, delimiter) {
 var delimiter = delimiter || ';';
 var filter  = /([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+>?$/; 
 var error = 0;

 // Create an array by splitting the field along the delimiter
 var aEmails = field.value.split(';');
 
 // For each of the emails
 for(index = 0; index < aEmails.length; index++) {
  // Trim spaces from the ends
  aEmails[index] = (aEmails[index].replace(/^\s+/,'')).replace(/\s+$/,'');
  // Check whether an email is present
  if(aEmails[index] != '' && aEmails[index].search(filter) == -1)
  {
   error = 1;
   alert('Your Email Id Is Not Valid');
   }
 }
 return error
 
 // Update the value of the field
 field.style.backgroundColor = (error == 1) ? 'FFFFCC' : 'FFFFFF';
}

    
function resetcretaccount(txtName,chkMale,chkFemale,txtSecurityNo,txtNationality,txtAddress,txtDOB,cboState,cboDistrict,txtPinCode,txtFax,txtTelephone,txtMobile,txtEmail,txtComments,opt1,opt2,opt3,opt4)
{

    if (confirm("Are You Sure You Want To Reset All the fields ?")==true)
    {
    
        txtName.value="";
        chkMale.checked=false;
        chkFemale.checked=false;
        
    if (txtSecurityNo!=null)
    {
        txtSecurityNo.value="";     
    }
    
    if (txtNationality!=null)
    {
        txtNationality.value="";     
    }         
        
//        txtSecurityNo.value="";
//        txtNationality.value="";
        txtAddress.value="";
//        txtDOB.value="";
//        txtState.value="";
//        txtCity.value="";


        cboState.selectedIndex= 0; 
        cboDistrict.selectedIndex= 0; 


        txtPinCode.value="";
//        txtFax.value="";
        txtTelephone.value="";
//        txtMobile.value="";
        txtEmail.value="";
        txtComments.value="";

    } 
                  

}



   
function resetcretaccountI(opt1,opt2,opt3,opt4,txtName,chkMale,chkFemale,txtAddress,cboState,cboDistrict,txtPinCode,txtTelephone,txtEmail,txtComments)
{

    if (confirm("Are You Sure You Want To Reset All the fields ?")==true)
    {
  //  chkopt.checked=false;
  opt1.checked=false;
  opt2.checked=false;
  opt3.checked=false;
  opt4.checked=false;
        txtName.value="";
       
        chkMale.checked=false;
        chkFemale.checked=false;
         
        txtAddress.value="";
 

cboState.value="";
cboDistrict.value="";
      //  cboState.selectedIndex= 0; 
       // cboDistrict.selectedIndex= 0; 


        txtPinCode.value="";
         txtTelephone.value="";
         
        txtEmail.value="";
         txtComments.value="";
         
     //  txtEmail.value="";
     //   txtComments.value="";

    } 
                  

}

function greenbtnmover(item)
{
    //alert('');
    if (item.disabled==false)
    {
        item.style.color='white';
        item.style.fontSize='13px'; 

    }

}
function greenbtnmout(item)
{

    if ((item.value!='Processing...')&&(item.value!='Searching...'))
    { 
        item.style.color='#0033CC';
        item.style.fontSize='12px'; 
    }

}   



function chkboxSelectionmlfml(chk1,chk2,chkidno) {



    switch (chkidno) {
        case 1:
            chk1.checked = true;
            chk2.checked = false;
            break;

        case 2:
            chk1.checked = false;
            chk2.checked = true;
            break;

    }

}






function resetcretaccount_Overseas(opt1,opt2,opt3,opt4,txtName,chkMale,chkFemale,txtSecurityNo,txtNationality,txtAddress,txtState,txtDistrict,txtPinCode,txtTelephone,txtEmail,txtComments)
{

    if (confirm("Are You Sure You Want To Reset All the fields ?")==true)
    {
      opt1.checked=false;
        opt2.checked=false;
        opt3.checked=false;
        opt4.checked=false;
        
        txtName.value="";
        chkMale.checked=false;
        chkFemale.checked=false;
        
      
        
  //  if (txtSecurityNo!=null)
   // {
        txtSecurityNo.value="";     
  //  }
    
  //  if (txtNationality!=null)
  //  {
        txtNationality.value="";     
   // }         
        
//        txtSecurityNo.value="";
//        txtNationality.value="";
        txtAddress.value="";
//        txtDOB.value="";
        txtState.value="";
      txtDistrict.value="";





        txtPinCode.value="";
                //        txtFax.value="";
       txtTelephone.value="";
                //        txtMobile.value="";
        txtEmail.value="";
  txtComments.value="";

    } 
                  

}


function resetQQ(chkopt,txtName,chkMale,chkFemale,txtSecurityNo,txtNationality,txtAddress,txtDOB,txtState,txtDistrict,txtPinCode,txtFax,txtTelephone,txtMobile,txtEmail,txtComments)
{

    if (confirm("Are You Sure You Want To Reset All the fields ?")==true)
    {
    
        txtName.value="";
        chkMale.checked=false;
        chkFemale.checked=false;
        
        opt1.checked=false;
        opt2.checked=false;
        opt3.checked=false;
        opt4.checked=false;
        
        
    if (txtSecurityNo!=null)
    {
        txtSecurityNo.value="";     
    }
    
    if (txtNationality!=null)
    {
        txtNationality.value="";     
    }         
        
//        txtSecurityNo.value="";
//        txtNationality.value="";
        txtAddress.value="";
//        txtDOB.value="";
        txtState.value="";
        txtDistrict.value="";





        txtPinCode.value="";
//        txtFax.value="";
        txtTelephone.value="";
//        txtMobile.value="";
        txtEmail.value="";
        txtComments.value="";

    } 
                  

}




function validatecretaccount_OverSeas(opt1,opt2,opt3,opt4,txtName,chkMale,chkFemale,txtSecurityNo,txtNationality,txtAddress,txtDOB,txtState,txtDistrict,txtPinCode,txtFax,txtTelephone,txtMobile,txtEmail,txtComments)
{
 if ((opt1.checked==false)&&(opt2.checked==false)&&(opt3.checked==false)&&(opt4.checked==false))
    {
        alert("Please Select The Membership");
        opt1.focus();
        return false;
    }
    
    if(txtName.value=="")
    {
        alert('Please Enter Your Name.');
        txtName.focus();
        return false; 
    }
    
    if ((chkMale.checked==false)&&(chkFemale.checked==false))
    {
        alert("Please Select The Gender");
        chkMale.focus();
        return false;
    }
        
    if (txtSecurityNo!=null)
    {
        if(txtSecurityNo.value=="")
        {
            alert('Please Enter Your Security No.');
            txtSecurityNo.focus();
            return false; 
        }        
    }
    
    if (txtNationality!=null)
    {
        if(txtNationality.value=="")
        {
            alert('Please Enter Your Nationality.');
            txtNationality.focus();
            return false; 
        }        
    }    
//    if(txtSecurityNo.value=="")
//    {
//        alert('Please Enter Your Security No.');
//        txtSecurityNo.focus();
//        return false; 
//    }
//    if(txtNationality.value=="")
//    {
//        alert('Please Enter The Nationality.');
//        txtNationality.focus();
//        return false; 
//    }
    
    if (txtAddress.value=="")
    {
        alert("Please Enter The Address");
        txtAddress.focus();
        return false;
    }   
//    if (txtDOB.value=="")                                 
//    {
//        alert('Please Enter The Date Of Birth.');
//        txtDOB.focus();
//        return false; 
//            
//    }  


    
    
    if(txtState.value=="")
    {
        alert('Please Enter The City.');
        txtState.focus();
        return false; 
    }
    if(txtDistrict.value=="")
    {
        alert('Please Enter The State.');
        txtDistrict.focus();
        return false; 
    }  
    if(txtPinCode.value=="")
    {
        alert('Please Enter The Pin Code.');
        txtPinCode.focus();
        return false; 
    }    
    
 if (txtPinCode.value.length!=6)
        {
            alert("Please Enter Six Digit PinCode.");
            txtPinCode.focus();
            return false;
        }  
    
    
    if(txtFax.value=="")
    {
        alert('Please Enter The Fax No.');
        txtFax.focus();
        return false; 
    }  
    if(txtTelephone.value=="")
    {
        alert('Please Enter The Telephone');
        txtTelephone.focus();
        return false; 
    }  
    
    //Pincode by Vibhor
//     if (txtTelephone.value!="")
//    {
//        var digits="0123456789-";
//        var temp;
//        for (var i=0;i<txtTelephone.value.length;i++)
//            {
//                temp=txtTelephone.value.substring(i,i+1);
//                if (digits.indexOf(temp)==-1)
//                {
//                    alert("'"+temp+"'" +" character in Your Telephone seems incorrect. Please try again.");
//                    txtTelephone.focus();
//                    return false;
//                }
//            }         
//    }     
        
    
    if(txtMobile.value=="")
    {
        alert('Please Enter The Mobile No.');
        txtMobile.focus();
        return false; 
    }   
    if(txtEmail.value=="")
    {
        alert('Please Enter The Email.');
        txtEmail.focus();
        return false; 
    }  
    if (txtEmail.value!="")
    { 
       
        //var emailid=txtmail.value;        
        //status=checkMailId(emailid);
       var status=validateEmails(txtEmail);
        if (status=="1")
        {
            txtEmail.focus();
            return false; 
        }  
    }   
//    if(txtComments.value=="")
//    {
//        alert('Please Enter The Comments.');
//        txtComments.focus();
//        return false; 
//    }                 
                  
return true;
}









function validateMailToUs(txtName,txtAddress,txtContactNo,txtEmail,txtComment)
{
var myBoolean=new Boolean(true);

    if(txtName.value=="")
    {
        alert('Please Enter The Name.');
        txtName.focus();
        return false; 
    }   
    
    
    if(txtAddress.value=="")
    {
        alert('Please Enter The Address.');
        txtAddress.focus();
        return false; 
    } 
    
    
    if(txtContactNo.value=="")
    {
        alert('Please Enter The ContactNo.');
        txtContactNo.focus();
        return false; 
    } 
    
    myBoolean=integerCheck(txtContactNo,'Contact No.');
   if(myBoolean==false)
   {
   return false;
   }
   if(txtContactNo.value.length<5 || txtContactNo.value.length>12)
   {
 alert('Contact No. can not be less then 5 or greater then 12 ');
   txtContactNo.focus();
   return false;
   }
    
     if (txtContactNo.value!="")
    {
        var digits="0123456789-";
        var temp;
        for (var i=0;i<txtContactNo.value.length;i++)
            {
                temp=txtContactNo.value.substring(i,i+1);
                if (digits.indexOf(temp)==-1)
                {
                    alert("'"+temp+"'" +" character in Your ContactNo seems incorrect. Please try again.");
                    txtContactNo.focus();
                    return false;
                }
            }         
    }     
            
            
    if(txtEmail.value=="")
    {
        alert('Please Enter The Email.');
        txtEmail.focus();
        return false; 
    } 
    
    if (txtEmail.value!="")
    {         

      var status=validateEmails(txtEmail);
        if (status=="1")
        {
            txtEmail.focus();
            return false; 
        }  
    }      
    if(txtComment.value=="")
    {
        alert('Please Enter The Message.');
        txtComment.focus();
        return false; 
    }     


}




function resetMailToUs(txtName,txtAddress,txtContactNo,txtEmail,txtComment)
{

    if (confirm("Are You Sure You Want To Reset All the fields ?")==true)
    {
    
        txtName.value="";
        txtAddress.value="";
        txtContactNo.value="";
        txtEmail.value="";
        txtComment.value="";                         
    } 
                  

}


function validateEnquiry(txtFirstName,txtLastName,txtAddress,txtContactNo,txtEmail,txtComment,txtPinCode)
{

    if(txtFirstName.value=="")
    {
        alert('Please Enter The First Name.');
        txtFirstName.focus();
        return false; 
    }   
    
    if(txtLastName.value=="")
    {
        alert('Please Enter The Last Name.');
        txtLastName.focus();
        return false; 
    }       
    
    if(txtAddress.value=="")
    {
        alert('Please Enter The Address.');
        txtAddress.focus();
        return false; 
    } 
    
    
    if(txtContactNo.value=="")
    {
        alert('Please Enter The ContactNo.');
        txtContactNo.focus();
        return false; 
    } 
    
    if(txtContactNo.value.length<5 || txtContactNo.value.length>12)
    {
    alert('Contact No. can not be less then 5 or greater then 12 ');
    txtContactNo.focus();
    return false;
    }
    
     if (txtContactNo.value!="")
    {
        var digits="0123456789-";
        var temp;
        for (var i=0;i<txtContactNo.value.length;i++)
            {
                temp=txtContactNo.value.substring(i,i+1);
                if (digits.indexOf(temp)==-1)
                {
                    alert("'"+temp+"'" +" character in Your ContactNo seems incorrect. Please try again.");
                    txtContactNo.focus();
                    return false;
                }
            }         
    }     
       
       
    if(txtPinCode.value=="")
    {
        alert('Please Enter The Pin Code.');
        txtPinCode.focus();
        return false; 
    }             
        
          if(txtPinCode.value.length!=6)
          {
           alert("Please Enter Six Digit PinCode.");
            txtPinCode.focus();
            return false;
          }
          
          
    if(txtEmail.value=="")
    {
        alert('Please Enter The Email.');
        txtEmail.focus();
        return false; 
    } 
    
    if (txtEmail.value!="")
    {         

      var status=validateEmails(txtEmail);
        if (status=="1")
        {
            txtEmail.focus();
            return false; 
        }  
    }      
    if(txtComment.value=="")
    {
        alert('Please Enter The Message.');
        txtComment.focus();
        return false; 
    }     
   
    
}


function resetEnquiry1(txtFirstName,txtLastName,txtAddress,txtContactNo,txtEmail,txtComment,txtPinCode)
{
 
    if (confirm("Are You Sure You Want To Reset All the fields ?")==true)
    {
 
        txtFirstName.value="";
        txtLastName.value="";
        txtAddress.value="";
        txtContactNo.value="";
        txtEmail.value="";
        txtComment.value=""; 
        txtPinCode.value="";                                 
    }
    else
    {
return false;
    }
     
}
//
function validateProgram(opt1,opt2,opt3,opt4,opt5,opt6,opt7,opt8,txtName,txtAddress,txtPhone,txtEmail,txtProgramme,txtQueries)
{
 //alert('hello');
 if(opt1.checked==false && opt2.checked==false && opt3.checked==false && opt4.checked==false && opt5.checked==false && opt6.checked==false && opt7.checked==false && opt8.checked==false)
 {
 alert('Please Select Programmes') ;
 return false;
 }
    if(txtName.value=="")
    {
        alert('Please Enter Your Name.');
        txtName.focus();
        return false; 
    }
    if(txtAddress.value=="")
    {
        alert('Please Enter Your Address.');
        txtAddress.focus();
        return false; 
    }
    
    if(txtPhone.value=="")
    {
        alert('Please Enter Your contact no.');
        txtPhone.focus();
        return false; 
    }
    if (txtPhone.value!="")
    {
        var digits="0123456789-";
        var temp;
        for (var i=0;i<txtPhone.value.length;i++)
            {
                temp=txtPhone.value.substring(i,i+1);
                if (digits.indexOf(temp)==-1)
                {
                    alert("'"+temp+"'" +" character in Your Telephone seems incorrect. Please try again.");
                    txtPhone.focus();
                    return false;
                }
            }         
    }     
    
    if(txtPhone.value.length<5 || txtPhone.value.length>12)
    {
    alert('Contact No. can not be less then 5 or greater then 12 ');
    txtPhone.focus();
    return false;
    }
    
     if(txtEmail.value=="")
    {
        alert('Please Enter Your Email.');
        txtEmail.focus();
        return false; 
    }
    if (txtEmail.value!="")
    { 
      
        
        //var emailid=txtmail.value;        
        //status=checkMailId(emailid);
       var status=validateEmails(txtEmail);
        if (status=="1")
        {
            txtEmail.focus();
            return false; 
        }  
    }   
    if(txtProgramme.value=="")
    {
        alert('Please Enter Place of Program.');
        txtProgramme.focus();
        return false; 
    }
    if(txtQueries.value=="")
    {
        alert('Please Enter your Queries.');
        txtQueries.focus();
        return false; 
    }
    var chkopt=document.getElementsByName(chkopt);

    myBoolean=checkBoxSelection(chkopt);    
    if(myBoolean==false)
    {   
        return false;
    }    
    

    }
    function  checkBoxSelection(chkopt,message)
    {

   var gnSelStatus=false;
   for (var i=0;i<chkopt.length;i++)
   {
        if (chkopt[i].checked==true)
        {
           chkopt=true;
           break; 
        }
        
   }
   if (chkopt==false)
   {
        chkopt[0].focus();
        alert('Please Select '+message);
        return false;
   }
}
function RESProgram(opt1,opt2,opt3,opt4,opt5,opt6,opt7,opt8,txtName,txtAddress,txtPhone,txtEmail,txtProgramme,txtQueries)
{
 opt1.checked=false;
 opt2.checked=false;
 opt3.checked=false;
 opt4.checked=false;
 opt5.checked=false;
 opt6.checked=false;
 opt7.checked=false;
 opt8.checked=false;
     txtName.value="";
      
     txtAddress.value="";
       txtPhone.value="";
       txtEmail.value="";
     txtProgramme.value="";
     txtQueries.value="";
     
return false;
    }
    function  checkBoxSelection(chkopt,message)
    {

   var gnSelStatus=false;
   for (var i=0;i<chkopt.length;i++)
   {
        if (chkopt[i].checked==true)
        {
           chkopt=true;
           break; 
        }
        
   }
   if (chkopt==false)
   {
        chkopt[0].focus();
        alert('Please Select '+message);
        return false;
   }
}
var testresults

function checkemail(){
 var str=document.validation.emailcheck.value
 var filter=/^.+@.+\..{2,3}$/

 if (filter.test(str))
    testresults=true
 else {
    alert("Please input a valid email address!")
    testresults=false
}
 return (testresults)
}






                  
                  




