function articleCheck(){
    var cat=document.articleform.category;
    var titles=document.articleform.title;      
    var category=document.articleform.category;
    var summ=document.articleform.summary; 
  // var summ=document.getElementById('summary').value;
   // alert(category.value);
  //  alert(summ);
    var body=document.articleform.articalbody;
    var autherbio=document.articleform.autherbio;
    var key=document.articleform.keyword;
          if(isEmpty(cat,'Select the Category'))
          {
          return;
          }
          else if(isEmpty(titles,'Title is empty'))
          {
          return;
          }
          else if(isEmpty(summ,'Artical summary is Empty'))
          {
          
          return;
          } else if(isEmpty(body,'Artical Body is Empty ')){
          
          return;
          }
          else if(isEmpty(autherbio,'Auther Bio is Empty ')){
          
          return;
          } 
          else if(isEmpty(key,'KeyWord is empty!..'))
          {
          
          return;
          }
          else{
          document.articleform.submit();
          }
}
function checkUserExist(){
 var uname=document.getElementById("username").value;
 
 
 var url="ajax_process.php?do=checkuserexist&un="+uname;
 
    $.get(url, function(data){
        if(data=="exist"){
          alert("Username Already Exist");
          document.getElementById("username").value="";
          document.getElementById("username").focus();
          return;
        }
    });

}
function alternateAuthorDelete(){
 var authorid=document.getElementById("authorlist").value;
  var answer = confirm("Want to Delete Article ?")
	if (answer){
 var url="ajax_process.php?type=coauthorDel&authorid="+authorid;
  
     $.get(url,function(data){
     if(data=='1')
       window.location.href=path+"edit_authorname.php?msg=Successfully Deleted";
     else
       window.location.href=path+"edit_authorname.php?msg=Error in DB Connection";
  });
     
}}
function testimonialsCheck(){
    var name=document.testimoform.user_name;
    var email=document.testimoform.email;
    var testimo=document.testimoform.testimonials;
    
    if(isEmpty(name,'Enter the Your name')){
    
    return;
    }
    else if(checkEmail(email,'Enter the Correct E-mail Id')){
    
    
    return;
    }
    else if(isEmpty(testimo,'Enter the  Testimonials ')){
    return;
    }
      var code=document.getElementById("security_code").value;
       var url="ajax_process.php?do=checkcode&security="+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.testimoform.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=checkcode&security="+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 writingShopCheck(){
    var name=document.articleshopform.user_name;
    var email=document.articleshopform.email;
    var topic=document.articleshopform.topic;
    var size=document.articleshopform.size;
    var keyword=document.articleshopform.keyword;
  
    
    if(isEmpty(name,'Enter the name')){
    
    return;
    }
    else if(checkEmail(email,'Enter the Correct E-mail Id')){
    return;
    }
    else if(isEmpty(topic,'Enter the Topic ')){
    return;
    }
     else if(isEmpty(size,'Enter the Size ')){
    return;
    }
    else if(isEmpty(keyword,'Enter the keyword ')){
    return;
    }
      var code=document.getElementById("security_code").value;
       var url="ajax_process.php?do=checkcode&security="+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.articleshopform.submit();
        }
    });   
  
  }  
  
 function friendCheck(){
    var name=document.referform.user_name;
    var email=document.referform.email;
    var frdemail=document.referform.friend_email;
    var message=document.referform.message;
    
    if(isEmpty(name,'Enter the Your name')){
    
    return;
    }
    else if(checkEmail(email,'Enter the Correct E-mail Id')){
    return;
    }else if(isEmpty(frdemail,'Enter the Friends E-mail')){
    
    return;
    }
    else if(isEmpty(message,'Enter the Message ')){
    return;
    }
      var code=document.getElementById("security_code").value;
       var url="ajax_process.php?do=checkcode&security="+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.referform.submit();
        }
    });   
  
  }
  function reportCheck(){
    var name=document.reportform.user_name;
    var email=document.reportform.email;
    var message=document.reportform.message;
    
    if(isEmpty(name,'Enter the Your name')){
    
    return;
    }
    else if(checkEmail(email,'Enter the Correct E-mail Id')){
    return;
    }
    else if(isEmpty(message,'Enter the Message ')){
    return;
    }
      var code=document.getElementById("security_code").value;
       var url="ajax_process.php?do=checkcode&security="+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.reportform.submit();
        }
    });   
  
  }  
  function commentCheck(){
    var name=document.commentform.user_name;
    var email=document.commentform.email;
    var comment=document.commentform.comment;
  
    
    if(isEmpty(name,'Enter the UserName')){
    
    return;
    }
    else if(checkEmail(email,'Enter the Correct E-mail Id')){
    
    
    return;
    }
   
    else if(isEmpty(comment,'Enter the Comment ')){
    return;
    }
      var code=document.getElementById("security_code").value;
       var url="ajax_process.php?do=checkcode&security="+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.commentform.submit();
        }
    });   
  
  }

 function registerCheck(){
    var username=document.registerform.username;
    var email=document.registerform.email;
    var pass=document.registerform.password;
    var cpass=document.registerform.cpassword;
    var firstname=document.registerform.fname;
    var lastname=document.registerform.lname;
    var add1=document.registerform.address1;
    var add2=document.registerform.address2;
    var city=document.registerform.city;
    var state=document.registerform.state;
    var business=document.registerform.business;
            
        
        if(isEmpty(pass,'Enter the Password ')){
        
        return;
        
        }else if(isEmpty(cpass,'Enter the Confirm  Password')){
        
        return;
        
        }
          else if(document.registerform.password.value !=document.registerform.cpassword.value){
           alert('do not match password and confirm password');
           return;
        }else if(checkEmail(email,'Enter the Correct Email')){
          
          return;
        }
        else if(isEmpty(firstname,'Enter the FirstName ')){
        
        return;
        
        }else if(isEmpty(lastname,'Enter the LastName ')){
        
        return;
        
        }else if(isEmpty(city,'Enter the City ')){
        
        return;
        
        }else if(isEmpty(state,'Enter the State ')){
        
        return;
        }
         else{
          
          document.registerform.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);

     });
} }





