﻿
/* VIVEK KUMAR */

window.onbeforeunload = closeit;
function closeit() {
    var closeEvent = false;
    if (event.clientY < 0)
        closeEvent = true;
    if ((closeEvent)) {
        window.open("logout.aspx", "_self");
        alert('You are Logged Out.Please Login Again.');

    }
}
document.onkeydown = function () {
    if (window.event && window.event.keyCode == 116) {
        window.open("logout.aspx", "_self");
        alert('You are Logged Out.Please Login Again.');
    }
}

$(document).ready(function () {

    $(".contentplace").height($(document).height() - 115);

});

$(document).ready(function () {
    $(".topMenuAction").click(function () {
        if ($("#openCloseIdentifier").is(":hidden")) {
            $("#slider").animate({
                marginTop: "-189px"
            }, 500);
            $("#topMenuImage").html('<img src="IMAGES/1.png" />');
            $("#openCloseIdentifier").show();
        } else {
            $("#slider").animate({
                marginTop: "0px"
            }, 500);
            $("#topMenuImage").html('<img src="IMAGES/2.png" />');
            $("#openCloseIdentifier").hide();
        }
    });
});


function TriggerPassChange() {
    $(document).ready(function () {
        $(".passA").trigger("click");
    });

}
$(document).ready(function () {
    $(".passA").fancybox({
        'padding': 5,
        'margin': 5,
        'width': 298,
        'height': 190,
        'showCloseButton': false,
        'centerOnScroll': true,
        'cyclic': true,
        'scrolling': 'no',
        'autoScale': true,
        'enableEscapeButton': true,
        'transitionIn': 'elastic',
        'transitionOut': 'fade',
        'titleShow': false,
        'modal': true,
        'type': 'iframe'
    });
});

$(document).ready(function () {
    $(".passV").fancybox({
        'padding': 5,
        'margin': 5,
        'width': 298,
        'height': 190,
        'showCloseButton': true,
        'centerOnScroll': true,
        'cyclic': true,
        'scrolling': 'no',
        'autoScale': true,
        'enableEscapeButton': true,
        'transitionIn': 'elastic',
        'transitionOut': 'fade',
        'titleShow': false,
        'modal': false,
        'type': 'iframe'
    });
});

$(document).ready(function () {
    $(".helpV").fancybox({
        'padding': 5,
        'margin': 5,
        'width': 520,
        'height': 400,
        'showCloseButton': true,
        'centerOnScroll': true,
        'cyclic': true,
        'scrolling': 'auto',
        'enableEscapeButton': true,
        'transitionIn': 'elastic',
        'transitionOut': 'fade',
        'titleShow': false,
        'modal': false,
        'type': 'iframe'
    });
});

$(document).ready(function () {
    jQuery(".passOverV").live('mouseenter', function () {
        jQuery(this).fancybox({
            'padding': 5,
            'margin': 5,
            'width': 298,
            'height': 190,
            'cyclic': true,
            'scrolling': 'no',
            'autoScale': false,
            'transitionIn': 'elastic',
            'transitionOut': 'fade',
            'titleShow': false,
            'type': 'iframe'
        }).trigger('click');
        return false;

    });
});


$(document).ready(function () {
    jQuery(".oldNewV").live('focus', function () {
        jQuery(this).fancybox({
            'padding': 5,
            'margin': 5,
            'width': 298,
            'height': 190,
            'showCloseButton': true,
            'centerOnScroll': true,
            'cyclic': true,
            'scrolling': 'no',
            'autoScale': true,
            'enableEscapeButton': true,
            'transitionIn': 'elastic',
            'transitionOut': 'fade',
            'titleShow': false,
            'modal': false,
            'type': 'iframe'
        }).trigger('click');
        return false;

    });
});

$(document).ready(function () {
    jQuery(".colV").live('focus', function () {
        jQuery(this).fancybox({
            'padding': 2,
            'margin': 2,
            'width': 770,
            'height': 498,
            'showCloseButton': true,
            'centerOnScroll': true,
            'cyclic': true,
            'scrolling': 'auto',
            'enableEscapeButton': true,
            'transitionIn': 'elastic',
            'transitionOut': 'fade',
            'titleShow': false,
            'modal': false,
            'type': 'iframe'
        }).trigger('click');
        return false;
    });
});


function TriggerClick_DeAllocate() {
    $(document).ready(function () {
        $(".colW").trigger("click");
    });
}

$(document).ready(function () {
    jQuery(".colW").fancybox({
        'padding': 2,
        'margin': 2,
        'width': 800,
        'height': 400,
        'showCloseButton': true,
        'centerOnScroll': true,
        'cyclic': true,
        'scrolling': 'auto',
        'enableEscapeButton': true,
        'transitionIn': 'elastic',
        'transitionOut': 'fade',
        'titleShow': false,
        'modal': false,
        'type': 'iframe',
        'onClosed': function () { $(".reload").trigger("click"); }
    });
});

function TriggerClick_DeAllocate_Exe() {
    $(document).ready(function () {
        $(".colW_Exe").trigger("click");
    });
}

$(document).ready(function () {
    jQuery(".colW_Exe").fancybox({
        'padding': 2,
        'margin': 2,
        'width': 800,
        'height': 400,
        'showCloseButton': true,
        'centerOnScroll': true,
        'cyclic': true,
        'scrolling': 'auto',
        'enableEscapeButton': true,
        'transitionIn': 'elastic',
        'transitionOut': 'fade',
        'titleShow': false,
        'modal': false,
        'type': 'iframe',
        'onClosed': function () { $(".reload_Exe").trigger("click"); }
    });
});

function TriggerClick() {
    $(document).ready(function () {
        $(".popPrint").trigger("click");
    });
}



$(document).ready(function () {
    jQuery(".popPrint").fancybox({
        'padding': 0,
        'margin': 0,
        'width': 786,
        'height': 514,
        'showCloseButton': true,
        'centerOnScroll': true,
        'cyclic': true,
        'scrolling': 'no',
        'autoScale': true,
        'enableEscapeButton': true,
        'transitionIn': 'elastic',
        'transitionOut': 'fade',
        'titleShow': false,
        'type': 'iframe'
    });
});



function MM_preloadImages() {
    var d = document; if (d.images) {
        if (!d.MM_p) d.MM_p = new Array();
        var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
            if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; }
    }
}
function MM_swapImgRestore() {
    var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
}
function MM_findObj(n, d) {
    var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
    if (!x && d.getElementById) x = d.getElementById(n); return x;
}

function MM_swapImage() {
    var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
        if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
}

