﻿//Enforced login
var enfocedBox;
function showBox(uid)
{
    var middleHeight = 180;

    var html= 
            "<div class='bg'>"
                +"<div class='top'></div>"
                +"<div class='middle' style='height:" + middleHeight + "px'></div>"
                +"<div class='bottom'></div>"
         +"</div>"
         +"<div class='content'>"
                +"<a class='btnClose' href='#' onclick='HideBox();'>"
                    +"<img src='/Images/spacer.gif' alt=''>"
                +"</a>"
                +"<div class='header'><strong>强制登录</strong></div>" 
                +"<div class='msg'>"
                    +"<iframe id='Iframe1' frameborder='0' height='160' width='360' allowtransparency='true' src='/EnforcedLoginWindow.aspx?uid=" + uid + "' ></iframe>"
                +"</div>"
         +"</div>" ; 
 
    if(enfocedBox == null)
    {
       
        var enforcedDiv = document.createElement("div");
        enforcedDiv.innerHTML = html;
        enforcedDiv.setAttribute("id","enforced");
        
        enfocedBox = new PopupMenu(enforcedDiv,0,0 ,400,0,false,false, null);
        enfocedBox.SetZIndex(100);
        enfocedBox.Show();
        ShowMiddle(enfocedBox.Div);
    }
    else if(enfocedBox != null && enfocedBox.Visible == false)
    {
        enfocedBox.Div.innerHTML = html;
        enfocedBox.Show();
        ShowMiddle(enfocedBox.Div);
        //function() {var dd = new YAHOO.util.DD("enforced");}
    }
}
function HideBox()
{
    if(enfocedBox != null)
    {
        enfocedBox.Hide();
    }
}

function enforcedLogin(uid)
{
    window.location = "/enforced_login?uid="+uid;
}