(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);

function ValidateCheckbox(control, message) {
	var isOk = false;
	jQuery(document).ready(function($) {
		isOk = $.getChecked(control);
	});

	if (isOk == false) {
		alert(message);
		return false;
	}
	else {
		return true;
	}

	return true;
}
function openPopup(url, height, width) {
    var _height = 'height=' + height;
    var _width = 'width=' + width;
    var newwindow = window.open(url, 'name', _height + ',' + _width);
    if (window.focus) { newwindow.focus() }
    return false;
}
function disableButtonOnLoading(buttonId, loadingPlace) {
   // document.getElementById(buttonId).disabled = true; 
    $('#' + buttonId).css('display', 'none');
    $('#result_search_domain').css('display', 'none');
    $('#' + loadingPlace).html("<img src='/App_Themes/Portal/Global/images/fb_loader_small.gif' alt='' width='16' height='11' /> Processing...");
    $('#' + loadingPlace).show();
}
