﻿
$(function() {

    $("div.srvy-indiv-unsuball input[type=checkbox]").click(function() {
        // when you check the "Unsubscribe All" checkbox, we want to uncheck all the other
        // group checkboxes and also disable them. When you uncheck it, we'll re-enable
        // the other checkboxes.
        var chkbx = this;
        $(this).parents("div.question-part").find("div.srvy-indiv-group input[type=checkbox]").each(function() {
            if (chkbx.checked) {
                this.checked = false;
                this.disabled = true;
            } else {
                this.disabled = false;
            }
        });
    });

    // replace any <a class="srvy-media"> tags with the actual media
    $.fn.media.mapFormat("mp3", "winmedia");
    $("a.srvy-media").media();
    $("div.srvy-media div").hide();

});
