
$(document).ready(function(){

    // Slide open/close the element with #faqinfo id when the .faqlink is clicked
    $(".faqlink").click(function () {
          $("#faqinfo").fadeToggle(500);
    });


    $("#certified").attr("checked",false);
    $("#submit_club").attr("disabled","disabled");
    $("#club_number").change(enableSubmit);
    $("#certified").click(enableSubmit);

});

jQuery(function($) {
    $("#myFilter").bigoFilter("#club_number");
});

$("#club_number").change(enableSubmit);


//check the values of the dropdown and checkbox and enable/disable the button;
function enableSubmit() {

  //console.log($("select#club_number option:selected").val() > 0);
  
 if ($("select#club_number option:selected").val()== 9999){
      $("#cert_text").html("I will enter my affiliation in the field provided on the next page.");
  } else{
       $("#cert_text").html("I certify I am a member in good standing of the club selected above.");
  }

  if ($("select#club_number option:selected").val() > 0 && $("input:checkbox:checked").val() == "on"){
      $("#submit_club").removeAttr("disabled");
  } else{
      $("#submit_club").attr("disabled","disabled");
  }
  
 
}


jQuery.fn.fadeToggle = function(speed, easing, callback) {
   return this.animate({opacity: 'toggle'}, speed, easing, callback);

};

