function setFields(){
  jQuery('.contest_picker_list[change!=done]').change(function (e){

    var A9_CONTEST_ID = 17;
    jQuery(e.target).siblings('[id=contest_category_list_'+e.target.value+']').show().end().siblings('select[id!=contest_category_list_'+e.target.value+']').hide();

    if( e.target.value != '' )
    {
      if( (e.target.value == A9_CONTEST_ID) && !(slideshare_object.slideshow_edit) ){
        goForA9 = confirm("Choose \"Best Acrobat 9 Presentation\" only if you are uploading a Acrobat 9 PDF Portfolio, and you want it to be considered for the \"Best Acrobat 9 Presentation\" prize in the \"World's Best Presentation Contest\".\n\nIf the file is not an Acrobat 9 PDF, it will be removed from this prize consideration.")
        
        if( goForA9 == false ){
          jQuery(e.target).attr("selectedIndex", 0);
          jQuery(e.target).parents('form').find('select[name=private_type]').removeAttr("disabled");
          jQuery(e.target).siblings('[id=contest_category_list_'+e.target.value+']').show().end().siblings('select[id!=contest_category_list_'+e.target.value+']').hide();
        }
      }
      if( jQuery(e.target).parents('form').find('select[name=private_type]').val() != 'public' ){
        alert('Privacy must be set to \'Everyone\' before this presentation can enter a contest.');
        jQuery(e.target).attr("selectedIndex", 0);
        jQuery('select[id^=contest_category_list]').hide();
      }
      else{
        if( e.target.value != '' ){
          jQuery(e.target).parents('form').find('select[name=private_type]').attr("disabled", true);
        }
      }
    }
    else
    {
      jQuery(e.target).parents('form').find('select[name=private_type]').removeAttr("disabled");
    }
  }).change().attr('change','done');
}
(function($) {
  $(setFields);
})(jQuery);