/*
This function selects all of the items from the E-News types
*/
var CHECK_ATTR_FUNC = false;

function select_all() {
    if ($("#check_all").attr("checked")) {
        $(".attribute_checkbox").attr({"checked":true});
    }
    else {
        $(".attribute_checkbox").attr({"checked":false});
    }
    
    if(CHECK_ATTR_FUNC) { check_attr(); }
}
//Here we setup the checkboxes to monitor all and not all selected statuses
$(document).ready(function() {
    //Loop through all of the checkboxes and setup the click actions
    $(".attribute_checkbox").click(function() {

        //Loop through the entire checkbox list to get status
        $(".attribute_checkbox").each(function() {
            //If any not checked deselect all
            if (!$(this).attr("checked")) {
                $("#check_all").attr({"checked":false});
                return false;
            }
            //If all selected select all
            else {
                $("#check_all").attr({"checked":true});
            }
        });

    });
});