  function mailCheck(){
    var username=document.sendmailform.user_name;  
    var email=document.sendmailform.email;
    var subject=document.sendmailform.subject;    
    var msg=document.sendmailform.msg;
   
  
         if(isEmpty(username,'Enter Your Name'))
         {
         return;
         }else if(checkEmail(email,'Enter the Correct E-mail Id')){
         
         return;
         }
         else if(isEmpty(subject,'Enter the subject  ')){
        
        return;
        
        }else if(isEmpty(msg,'Enter the Message ')){
        
        return;
        
        }
       var code=document.getElementById("security_code").value;
       var url="ajax_process.php?do=checkuserexist&un="+code;
      
         $.get(url, function(data){
         
        if(data==0){
          
          alert("Sorry, you have provided an invalid security code");
          
          document.getElementById("security_code").value="";
          document.getElementById("security_code").focus();
          
        }
        else
        {
            document.sendmailform.submit();
        }
    });   
}
  function contactCheck(){
    var name=document.contactusform.user_name;
    var email=document.contactusform.email;
    var feedback=document.contactusform.feedback;
    
    if(isEmpty(name,'Enter the name')){
    
    return;
    }
    else if(checkEmail(email,'Enter the Correct E-mail Id')){
    
    
    return;
    }
    else if(isEmpty(feedback,'Enter the FeedBack ')){
    return;
    }
      var code=document.getElementById("security_code").value;
       var url="ajax_process.php?do=checkuserexist&un="+code;
         $.get(url, function(data){
        if(data==0){
          alert("Sorry, you have provided an invalid security code");
          document.getElementById("security_code").value="";
          document.getElementById("security_code").focus();
        }
        else
        {
            document.contactusform.submit();
        }
    });   
  
  }
  function tellFriendCheck(){
    var name=document.tellfriendform.name;
    var email=document.tellfriendform.email;
    var mobile=document.tellfriendform.mobile;
    var emails=document.tellfriendform.friend_email;
    var msg=document.tellfriendform.msg;
    
    if(isEmpty(name,'Enter the name')){
    
    return;
    }
    else if(checkEmail(email,'Enter the Correct E-mail Id')){
    return;
    }
    else if(isEmpty(msg,'Enter the message')){
    
    return;
    }
    
      var code=document.getElementById("security_code").value;
       var url="ajax_process.php?do=checkuserexist&un="+code;
         $.get(url, function(data){
        if(data==0){
          alert("Sorry, you have provided an invalid security code");
          document.getElementById("security_code").value="";
          document.getElementById("security_code").focus();
        }
        else
        {
            document.tellfriendform.submit();
        }
    });   
  
  }
 function registerCheck(){
    var username=document.complaintform.user_name;  
    var email=document.complaintform.email;
    var pname=document.complaintform.product_name;    
    var subject=document.complaintform.subject;
    var details=document.complaintform.details;
  
         if(isEmpty(username,'Enter Your Name'))
         {
         return;
         }else if(checkEmail(email,'Enter the Correct E-mail Id')){
         
         return;
         }
         else if(isEmpty(pname,'Enter the Company/product name ')){
        
        return;
        
        }else if(isEmpty(subject,'Enter the Subject ')){
        
        return;
        
        }
        else if(isEmpty(details,'Enter the Details ')){
        
        return;
        
        } 
        
       var code=document.getElementById("security_code").value;
       var url="ajax_process.php?do=checkuserexist&un="+code;
      
         $.get(url, function(data){
        if(data==0){
        
          alert("Sorry, you have provided an invalid security code");
          
          document.getElementById("security_code").value="";
          document.getElementById("security_code").focus();
          
        }
        else
        {
            document.complaintform.submit();
        }
    });   
}

function selectcategory(){

   var id=document.getElementById('category').value;

   if(id){

   var url="ajax_process.php?type=category&cid="+id;

  

    $.get(url,function(data){

    

     $("#cat").html(data);

     });
} }
 function validateFeedBackForm()
 {
var name=document.feedBackForm.name;

var email=document.feedBackForm.email;

var msg=document.feedBackForm.comments;
 if(isEmpty(name,"Your Name Please"))

 {

 return false;

 }

 else if(checkEmail(email,"InValid Email address"))

 {

 return false;

 }

 else if(isEmpty(msg,"No Feed Back Found"))

 {

 return false

 }

 return true;



}







