﻿//var loader = '';

var loader = "";
loader += '<div id="LOADER" style="display:none;position:absolute;z-index: 3000; background-color: #ffffff;border-left:#c0c0c0 1px solid;border-right:#c0c0c0 1px solid;border-top:#c0c0c0 1px solid;">';
loader += '    <iframe id="LOADER_MASK" name="LOADER_MASK" style="scrolling: no;position:absolute;z-index:-1;background-color:#FFFFFF;" marginwidth="0" marginheight="0" frameborder="0" src=""></iframe>';
loader += '    <div id="LOADER_CONTENT" style="font-size:10px;position:absolute;z-index:2;text-align:center;">';
loader += '        <img src="/App_Themes/Default/images/progress/ajax-loader-large-bw.gif">';
loader += '        <br>';
loader += '        <br>';
loader += '        Loading...';
loader += '    </div>';
loader += '</div>';
document.write(loader);

//function fit_loader() {
//    var loaderContent = document.getElementById("LOADER_CONTENT");
//    var loader = document.getElementById("LOADER");
//    var loaderMask = document.getElementById("LOADER_MASK");
//    if (window.dialogArguments==undefined) {
//        var windowWidth = document.documentElement.clientWidth;
//        var windowHeight = document.documentElement.clientHeight;
//    } else {
//        var windowWidth = parseInt(window.dialogWidth);
//        var windowHeight = parseInt(window.dialogHeight);
//    }
//    
//    if (windowWidth <= 0) { windowWidth = 1020 };
//    if (windowHeight <= 0) { windowHeight = 700; }
//    
//    var popupHeight = loaderContent.clientHeight;
//    var popupWidth = loaderContent.clientWidth;

//    loaderContent.style.position = "absolute";
//    loaderContent.style.top = parseInt(windowHeight/2-popupHeight/2) + "px";
//    loaderContent.style.left = parseInt(windowWidth/2-popupWidth/2) + "px";

//    loader.style.position = "absolute";
//    loader.style.top = "0px";
//    loader.style.left = "0px";
//    loader.style.width = windowWidth-2;
//    loader.style.height = windowHeight-1;

//    loaderMask.style.position = "absolute";
//    loaderMask.style.top = "0px";
//    loaderMask.style.left = "0px";
//    loaderMask.style.width = windowWidth-2;
//    loaderMask.style.height = windowHeight-1;

//}

//fit_loader();

//window.onresize = function() {
//    fit_loader();
//};

//document.onreadystatechange = function() {
//    if (document.readyState == 'complete') {
//        $("#LOADER").fadeOut("slow");
//    }
//};
