function PopUpShow(url)
{
        var scroll = "no";
        var top=0, left=0;
        var width = "430";
        var height = "300";
        if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
        if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
        if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
        width = Math.min(width, screen.width-10);
        height = Math.min(height, screen.height-28);
        window.open(url+"?p=y","_parent ","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);

}

/// Float DIV
function GetPosTopLeft(div)
{
        var arPos = jsAjaxUtil.GetWindowSize();
        if(arPos.scrollTop > document.body.scrollTop)
              var top = parseInt(arPos.scrollTop + document.body.clientHeight/2 - div.offsetHeight/2);
        else
              var top = parseInt(document.body.scrollTop + document.body.clientHeight/2 - div.offsetHeight/2);
        if(arPos.scrollLeft > document.body.scrollLeft)
              var left = parseInt(arPos.scrollLeft + document.body.clientWidth/2 - div.offsetWidth/2);
        else
              var left = parseInt(document.body.scrollLeft + document.body.clientWidth/2 - div.offsetWidth/2);
        return {"left" : left, "top" : top};
}
function showFD(url)
{
        if(document.getElementById("alx_float_div"))
                return;

        CHttpRequest.Action = function(result)
        {
                CloseWaitWindow();
                var div = document.body.appendChild(document.createElement("DIV"));
                div.id = "alx_float_div";
                div.className = "alx-float-div";
                div.style.position = 'absolute';
                div.innerHTML = result;

                var arPos = GetPosTopLeft(div);
                jsFloatDiv.Show(div, arPos.left, arPos.top);
                jsUtils.addEvent(document, "keypress", OnKeyPressFD);
        }
        ShowWaitWindow();
        CHttpRequest.Send(url);
}
function GetMessageFDIE(s_ie, conf_ie)
{
        if(conf_ie) conf_ie = 'Y';
        showFD('/bitrix/templates/.default/fd/fd_message.php?MESSAGE='+s_ie +'&CONF='+conf_ie);
}
function GetMessageFD(s, conf)
{

        if (window.attachEvent) // IE
        {
                if(typeof GetMessageFDIE == "function")
                {
                        GetMessageFDIE(s, conf);
                }
                else
                {
                        window.attachEvent("onload", function () {
                                //alert(s);
                                function GetMessageFDIE(s_ie, conf_ie)
                                {
                                        if(conf_ie) conf_ie = 'Y';
                                        showFD('/bitrix/templates/.default/fd/fd_message.php?MESSAGE='+s_ie +'&CONF='+conf_ie);
                                }
                                GetMessageFDIE(s, conf);
                        });
                }
        }
        else if (window.addEventListener) // Gecko / W3C
        {
                if(typeof GetMessageFDIE == "function")
                {
                        GetMessageFDIE(s, conf);
                }
                else
                {
                        window.addEventListener("load", function () {
                                //alert(s);
                                function GetMessageFDIE(s_ie, conf_ie)
                                {
                                        if(conf_ie) conf_ie = 'Y';
                                        showFD('/bitrix/templates/.default/fd/fd_message.php?MESSAGE='+s_ie +'&CONF='+conf_ie);
                                }
                                GetMessageFDIE(s, conf);
                        }, false);
                }
                //window.addEventListener('load', init_MAP_y03f1eaviH, false);
        }
        else
        {

                if(conf) conf = 'Y';
                showFD('/bitrix/templates/.default/fd/fd_message.php?MESSAGE='+s +'&CONF='+conf);
        }
}



function closeFD()
{
        jsUtils.removeEvent(document, "keypress", OnKeyPressFD);
        var div = document.getElementById("alx_float_div");
        jsFloatDiv.Close(div);
        div.parentNode.removeChild(div);
}

function OnKeyPressFD(e)
{
        if(!e) e = window.event
        if(!e) return;
        if(e.keyCode == 27)
                closeFD();
}


