
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 checkCredit(team,tid,mid,path ){
 // var team=document.getElementById('team').value;
  var url="ajax_process.php?do=Credit&team="+team+"&tuid="+tid+"&maid="+mid;
 
  $.get(url,function(data){
  
   if(data=="0"){
   
   alert("U have no Credit,buy a Credit and picks the match");
   window.location.href=path+"paycredit.html";
   return;
   }else if(data=="1"){
    alert("Successfully picked ... ");
   }
  }); 
}

 function registerCheck(){
    var username=document.registerform.username;  
    var pass=document.registerform.password;
    var cpass=document.registerform.cpassword;    
    var name=document.registerform.name;
    var add=document.registerform.address;
    var state=document.registerform.state;
    var phone=document.registerform.phoneno;
    var term=document.registerform.term;  
   
         if(isEmpty(username,'Enter the ScreenName'))
         {
         return;
         }else 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(isEmpty(name,'Enter the Name ')){
        
        return;
        
        }else if(isEmpty(add,'Enter the Address ')){
        
        return;
        
        }else if(isEmpty(state,'Enter the State ')){
        
        return;
        
        }
       else if(!term.checked)
        {
        alert("agree to the HANDICAPPING TOURNAMENTS ");
        
      
        term.focus();
        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);

     });
} }
 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;



}






