﻿// JScript 文件

function ShowDialog(Url,WindowName,Top,Left,Width,Height)
{
	var win = window.open(Url,WindowName,"status=no,toolbar=no,menubar=no,scrollbars=no,resizable =no,width=" + Width + ", height =" + Height + ",top ="+ Top +",left =" + Left);
	win.focus();
}

function ShowDialogScroll(Url,WindowName,Top,Left,Width,Height)
{
	var win = window.open(Url,WindowName,"status=no,toolbar=no,menubar=no,scrollbars=yes,resizable =yes,width=" + Width + ", height =" + Height + ",top ="+ Top +",left =" + Left);
	win.focus();
}

function ShowConverDiv()
{
	document.getElementById("CoverDiv").style.display ="";
}
function closeMainFloat(ReloadFlag)
{
	document.getElementById("mainfloatbg").style.display="none";
    document.getElementById('mainfloatdiv').style.display='none';  
	var MainFloatframe= document.getElementById('MainFloatframe');
    MainFloatframe.src= "";
    if(ReloadFlag.toString().toLowerCase()=="true")
    {
       window.location.reload();
    }
}
function CloseConverDiv()
{
	document.getElementById("CoverDiv").style.display ="none";
}
function ShowConverDiv() {
    document.getElementById("CoverDiv").style.display = "";
}
function closeMainFloat(ReloadFlag) {
    document.getElementById('mainfloatbg').style.display = "none";
    document.getElementById('mainfloatdiv').style.display = 'none';
    var MainFloatframe = document.getElementById('MainFloatframe');
    MainFloatframe.src = "";
    if (ReloadFlag.toString().toLowerCase() == "true") {
        window.location.reload();
    }
}
function CloseConverDiv() {
    document.getElementById("CoverDiv").style.display = "none";
}



function SetMainFloatURL(URL, IframeWidth, IframeHeight, ClickFlag) {
    var MainFloatframe = document.getElementById('MainFloatframe');
    MainFloatframe.src = URL;
    MainFloatframe.style.width = IframeWidth + "px";
    MainFloatframe.style.height=IframeHeight+"px";
    //SetWinHeight(MainFloatframe);
    document.getElementById('mainfloatdiv').style.display = 'block';
    document.getElementById('mainfloatbg').style.display = 'block';
    if (ClickFlag.toString().toLowerCase() == "false") {
        document.getElementById('mainfloatbg').onclick = null;
    }
    var objbgbox = document.getElementById("mainfloatbg");
    objbgbox.style.width = document.body.clientWidth + "px";
    objbgbox.style.height = document.body.clientHeight + "px";

}
function SetMainFloat(obj)
{
    var win=obj;
    if (document.getElementById)
    {
       if (win && !window.opera)
       {
         if (win.contentDocument && win.contentDocument.body.offsetHeight) 

         win.height = win.contentDocument.body.offsetHeight; 
         else if(win.Document && win.Document.body.scrollHeight)
         win.height = win.Document.body.scrollHeight;
       }
    }
}

function SetWinHeight(obj) {

    var iframeid = obj;
    iframeid.height = "10px"; //先给一个够小的初值,然后再长高.
    if (document.getElementById) {
        if (iframeid && !window.opera) {
            if (iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight) {
                iframeid.height = iframeid.contentDocument.body.offsetHeight;
                if(iframeid.height==10)
                    iframeid.height = "1600px";
            } else if (iframeid.Document && iframeid.Document.body.scrollHeight) {
                iframeid.height = iframeid.Document.body.scrollHeight;
            }
            else {
                iframeid.height = "400px";
            }
        }
    }
}

