﻿function hideDom(objectToHide) {
    $(objectToHide).removeClass('visable notVisable').addClass('notVisable');
}

function showDom(objectToShow) {
    $(objectToShow).removeClass('visable notVisable').addClass('visable');
}

function skinButtons() {
    $('.skinableButton').button();
}

function showMessageBox(jquerySelectorToShowParam, titleParam, modalDialogParam, dialogWidthParam, closeButtonTitleParam) {
    var modalDialog = true;
    if (modalDialogParam != undefined) {
        modalDialog = modalDialogParam;
    }

    var title = 'Information';
    if (titleParam != undefined) {
        title = titleParam;
    }

    var classToShow = '.alert';
    if (jquerySelectorToShowParam != undefined) {
    	classToShow = jquerySelectorToShowParam;
    }

    var dialogWidth = 900;
    if (dialogWidthParam != undefined) {
        dialogWidth = dialogWidthParam;
    }

    var showMessage = false;
    var message = "";
    $(classToShow).each(function (i) {
        showMessage = true;
        message = message + $(this).html() + '<br />';
    });
    if (showMessage) {
        $('#messageBoxContainer').html(message);
        $('#messageBoxContainer').dialog({ modal: modalDialog, autoOpen: false, title: title, draggable: false, resizable: false, width: dialogWidth, buttons: { "Close": function () { $(this).dialog("close"); } } });
        $('#messageBoxContainer').dialog('open');
    }
}

