CHECK_ATTR_FUNC = true;

// Check attributes...
function check_attr() {
	// Set default checked status
	var CHECKED = false;
	
	 //Loop through the entire checkbox list to get status
    $(".attribute_checkbox").each(function() {
        //If a checkbox is checked, 
        if($(this).attr("checked")) { CHECKED = true; }
    })
    
    // If nothing is checked, show the unsubscribe popup
    if(!CHECKED) { $("#try_unsubscribe").fadeIn("fast"); }
    
    // if something is checked, hide the unsubscribe popup
    else { $("#try_unsubscribe").fadeOut("fast"); }
}

//Here we setup the checkboxes to monitor all and not all selected statuses
$(document).ready(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});
        }
    });
    
    // Check to see if at least one attribute is checked
    check_attr();
});