﻿
//admin onpage popup object
//**********************************************
var admin={
    holderId:"admin",
    Show:function ()
    {
        var hol=$(this.holderId);
        var w=$W(this.holderId);
        var h=$H(this.holderId);
        
        if(hol)
        {
            var x=(document.documentElement.clientWidth-w)/2;
            var y=((document.documentElement.clientHeight-h)/2);

            hol.style.zIndex = 2;
            hol.style.position = "absolute";
            hol.style.left=x + "px";
            hol.style.top=y + "px";
            
            this.AddShadow(this.holderId)
        }
    },
    Hide:function ()
    {
        //var hol=$(this.holderId);
            
        //this.RemoveShadow(this.holderId)
    },
    AddShadow:function(id)
    {
        var holderShadowId=id + "_shadow";
        var holderShadowCenterId=id + "_shadow_center";
        var s=$(holderShadowId);
        if(s)
        {
            
        }
        else
        {
            var sHtml=''
                + '<table id="' + holderShadowId + '" class="shadow" cellpadding="0" cellspacing="0" border="0">'
                + '<tr><td class="TL">&nbsp;</td><td class="TM">&nbsp;</td><td class="TR">&nbsp;</td></tr>'
                + '<tr><td class="CL">&nbsp;</td><td class="CM" id="' + holderShadowCenterId + '">&nbsp;</td><td class="CR">&nbsp;</td></tr>'
                + '<tr><td class="BL">&nbsp;</td><td class="BM">&nbsp;</td><td class="BR">&nbsp;</td></tr>'
                + '</table>';
               
            var hol = document.createElement("span");
            //hol.innerHTML = sHtml;
            
            
            document.body.appendChild(hol);
            hol.innerHTML = sHtml;
            
            
            //return;
            s=$(holderShadowId);
            
        }
        
        var center=$(holderShadowCenterId);
        var host=$(id);
        if(host && s && center)
        {
        
            s.style.left=host.offsetLeft-10 + "px";
            s.style.top=host.offsetTop-9 + "px";
            
            s.style.width=host.offsetWidth + 26 + "px";
            s.style.height=host.offsetHeight + 26 + "px";
            
            center.style.height=host.offsetHeight - 25+ "px";
            
            
        }
    },
    RemoveShadow:function(id)
    {
        var holderShadowId=id + "_shadow";
        var s=$(holderShadowId);
        if(s)
        {
            document.removeChild(s);
        }
    },
    PromptDelete:function(msg)
    {
        return confirm(msg);
    }
}
//**********************************************

