﻿function ValidateCheckbox(control, message) {
	var isOk = false;
	jQuery(document).ready(function($) {
		isOk = $.getChecked(control);
	});

	if (isOk == false) {
		alert(message);
		return false;
	}
	else {
		return true;
	}
}

(function ($) {
    $.setVisible = function (control, visible) {
        try {
            if (visible) {
                $('#' + control).attr("style", "display:'';");
            }
            else {
                $('#' + control).attr('style', 'display:none;');
            }
        } catch (err) {
            if (visible) {
                control.attr("style", "display:'';");
            }
            else {
                control.attr('style', 'display:none;');
            }
        }
    };

    $.getVisible = function (control) {
        var temp = $('#' + control).attr('style');
        if (temp == "display:none" || temp == "DISPLAY: none") {
            return false;
        }
        else {
            return true;
        }
    };

    $.getChecked = function (control) {
        var isChecked = $('#' + control).attr('checked');
        if (!isChecked) {
            return false;
        }
        else {
            return true;
        }
    };
})(jQuery);
