var displaymode=0;
var StyleSheetPath, _BasePath, _adminPath;
function setStyleSheetPath(path){
    StyleSheetPath=path;
}
function setBasePath(basepath,adminpath) {
    _BasePath=basepath;
    _adminPath=adminpath;
}
function jumpto(inputurl)
{
    if (document.getElementById&&displaymode==0)
    document.getElementById("main_right").src=inputurl
    else if (document.all&&displaymode==0)
    document.all.external.src=inputurl;
    else{
        if (!window.win2||win2.closed)
        win2=window.open(inputurl);
        else{
        }
    }
}
function ShowMain(FileName_Left,FileName_Right)
{
    if(FileName_Left != "")
    {
        var checkLeftUrl = CheckCurrentLeftUrl(FileName_Left);
        if(checkLeftUrl=="false")
        {
            document.getElementById("left").src = FileName_Left + GetUrlParm(FileName_Left);
        }
    }
    if(FileName_Right != "")
    {
        document.getElementById("main_right").src = FileName_Right + GetUrlParm(FileName_Right);
    }
}
function CheckCurrentLeftUrl(leftUrl)
{
    var src = document.getElementById("left").src;
    var regex = /\s*[\?&]{1,1}t=[0-9]{1,}$/;
    var currentLeftUrl = src.replace(regex,'');
    if(currentLeftUrl.lastIndexOf(leftUrl) >= 0)
    {
        if(currentLeftUrl.lastIndexOf(leftUrl) == (currentLeftUrl.length-leftUrl.length))
        {
            return "true";
        }
    }
    return "false";
}
function GetUrlParm(url)
{
    var urlparm = "?";
    if(url.indexOf('?')>=0)
    {
        urlparm = "&";
    }
    urlparm = urlparm + "t=" + GetRandomNum();
    return urlparm;
}
function ShowOperatingList(FileName_Left,FileName_Right)
{
    if(FileName_Left != "")
    {
        var checkLeftUrl = CheckCurrentLeftUrl(FileName_Left);
        if(checkLeftUrl=="false")
        {
            document.getElementById("left").src = FileName_Left + GetUrlParm(FileName_Left);
        }
    }
    if(FileName_Right != "")
    {
        document.getElementById("main_right").src = FileName_Right + GetUrlParm(FileName_Right);
    }
}
function GetRandomNum()
{
    var Range = 1000;
    var Rand = Math.random();
    return (Math.round(Rand * Range));
}
function switchSysBar()
{
    var obj = document.getElementById("switchPoint");
    if (obj.alt == "关闭左栏")
    {
        obj.alt = "打开左栏";
        obj.src = "AdminDefaultTheme/Images/butOpen.gif";
        document.getElementById("frmTitle").style.display="none";
        var width,height;
        width=document.body.clientWidth-12;
        height=document.body.clientHeight-70;
        document.getElementById("main_right").style.height=height;
        document.getElementById("main_right").style.width=width;
    }
    else
    {
        obj.alt = "关闭左栏";
        obj.src = "AdminDefaultTheme/Images/butClose.gif";
        document.getElementById("frmTitle").style.display="";
        onload();
    }
}
var tID = "ChannelMenu_MenuMyDeskTop";
function ShowHideLayer(ID)
{
    if(ID != tID)
    {
        if (tID != "")
        {
            document.getElementById(tID).style.display="none";
            document.getElementById("A"+tID).style.backgroundImage = "url(AdminDefaultTheme/Images/digital_left.gif)";
            document.getElementById("Span"+tID).style.backgroundImage = "url(AdminDefaultTheme/Images/digital_side.gif)";
            document.getElementById("Span"+tID).className = "digitaltext";
        }
        document.getElementById(ID).style.display = "";
        document.getElementById("A"+ID).style.backgroundImage ="url(AdminDefaultTheme/Images/seg_left.gif)";
        document.getElementById("Span"+ID).style.backgroundImage = "url(AdminDefaultTheme/Images/seg_side.gif)";
        document.getElementById("Span"+ID).className = "segtext";
        tID=ID;
    }
}