﻿function UI_Expose(cssDivClass, cssMaskClass, opacity)
{
    // execute your scripts when the DOM is ready. this is a good habit
    $(function() {

        if ($.browser.msie && $.browser.version <= 7) {
            // Ignore Expose for IE7
        }
        else {
            // 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,
                    onLoad: function(event) {
                        this.fit();
                    }

                }).load();
            });

            var api = $("div." + cssDivClass).expose({
                maskId: cssMaskClass,
                api: true,
                onLoad: function(event) {
                    this.fit();
                },
                opacity: opacity                
            }).load();
        }
    });
}

function CancelExpose(cssDivClass) 
{
    window.location = "/";
    	//$("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;
}
