﻿function UI_Expose(cssDivClass, cssMaskClass)
{
    // execute your scripts when the DOM is ready. this is a good habit
    $(function() {

        // expose the form when it's clicked or cursor is focused
        $("div." + cssDivClass).bind("click keydown", function() {

            $(this).expose({

                // custom mask settings with CSS
                maskId: cssMaskClass,

                // when exposing is done, change form's background color
                //  onLoad: function() {
                //    this.getExposed().css({ backgroundColor: '#ffffff' });
                //},

                // when "unexposed", return to original background color
                onClose: function() {
                    this.getExposed().css({ backgroundColor: null });
                },

                api: true

            }).load();
        });
    });
}

function CancelExpose(cssDivClass) 
{
    
    $("div." + cssDivClass).expose().close();

}

function RemoveExpose(cssDivClass) {
    $(function() {
        $("div." + cssDivClass).unbind("click keydown");
    });
}

function CancelForm() 
{
    document.location.href = '/';
}

function LaunchModalPopUp(url, width, height, strWindow) 
{
    var width = width;
    var height = height;
    var left = (screen.width - width) / 2;
    var top = ((screen.height - height) / 2)-40;
    var params = 'width=' + width + ', height=' + height;
    params += ', top=' + top + ', left=' + left;
    params += ', directories=no';
    params += ', location=no';
    params += ', menubar=no';
    params += ', resizable=no';
    params += ', scrollbars=no';
    params += ', status=no';
    params += ', toolbar=no';
    newwin = window.open(url, strWindow, params);
    if (newwin.focus) { newwin.focus() }
}



function ToggleExpColDiv(elementID) 
{
    if ($("#dv"+elementID).is(":visible"))
    {
        $("#dv" + elementID).hide();
        $("#img" + elementID).attr("src", "/App_Themes/Graphics/Icons/Application_Get.png");
    }
    else 
    {
        $("#dv" + elementID).show();
        $("#img" + elementID).attr("src", "/App_Themes/Graphics/Icons/Application_Put.png");
    }

}


function MailLink(strEmail) {
    location.href = "mailto:" + strEmail;
}