
var bannerFrameSizeW = 478;
var bannerFrameSizeH = 300;


function startPageBanners(rel_base_path) 
{
//    document.write("<div id='divBannerFrame' style='position:absolute;margin-left:150px;margin-top:100px;width:480px; height:250px;z-index:100000'>");  
//    document.write('<iframe id="bannerFrame" width="' + bannerFrameSizeW + '" height="' + bannerFrameSizeH + '" noresize="noresize" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" src=');  
//    document.write(rel_base_path + "banners.htm ></iframe>");
//    document.write("</div>");   
}


function changeImage() 
{
    var verify = document.getElementById("verify");
    if (!verify) 
        return;
	verify.value = '0';
    var formlogin = document.getElementById("formlogin");
    if (!formlogin) 
        return;
	formlogin.submit();
}

/////////////////// center page
/////// H
function OffWindowH(win)
{
    var OffWindowH=0;

    win.scrollTo(10000000,0);

    if(typeof win.pageXOffset!='undefined')
        OffWindowH=win.pageXOffset;
    else if(win.document.compatMode && win.document.compatMode != 'BackCompat')
        OffWindowH=win.document.documentElement.scrollTop;
    else if(win.document.body && typeof(win.document.body.scrollTop)!='undefined')
        OffWindowH=win.document.body.scrollTop;
    win.scrollTo(0,0);

    return OffWindowH;
}

function WindowHeight(win)
{
    var WindowHeight = 0;
    if( typeof( win.innerHeight ) == 'number' ) 
        WindowHeight = win.innerHeight;
    else if (win.document.documentElement &&  win.document.documentElement.clientHeight)
        WindowHeight = win.document.documentElement.clientHeight;
    else if(win.document.body && win.document.body.clientHeight)
        WindowHeight = win.document.body.clientHeight;

    return WindowHeight;
}

/////// W
function OffWindowW(win)
{
    var OffWindowW=0;

    win.scrollTo(0,10000000);

    if(typeof win.pageXOffset!='undefined')
        OffWindowW=win.pageXOffset;
    else if(win.document.compatMode && win.document.compatMode != 'BackCompat')
        OffWindowW=win.document.documentElement.scrollLeft;
    else if(win.document.body && typeof(win.document.body.scrollLeft)!='undefined')
        OffWindowW=win.document.body.scrollLeft;
    win.scrollTo(0,0);

    return OffWindowW;
}


function WindowWidth(win)
{
    var WindowWidth = 0;
    if( typeof( win.innerWidth ) == 'number' ) 
        WindowWidth = win.innerWidth;
    else if (win.document.documentElement &&  win.document.documentElement.clientWidth)
        WindowWidth = win.document.documentElement.clientWidth;
    else if(win.document.body && win.document.body.clientWidth)
        WindowWidth = win.document.body.clientWidth;

    return WindowWidth;
}


function pWeight(win)
{
    var pWeight = OffWindowW(win) + WindowWidth(win);
    return pWeight;
}
 

function centerArea()
{
    var Element = document.getElementById("maindiv");
    if(Element)
    {
        var ww = (pWeight(self) - 760);
        if (ww > 0)
            Element.style.marginLeft = (ww / 2 ) +'px';
        else
            Element.style.marginLeft = '0px';
            
        if ((typeof(self.location.hash) == "string") &&
            self.location.hash.length) 
        {
            var hash = self.location.hash;
            if (hash.charAt(0) != '#') 
            {
                hash = '#' + self.location.hash;
            }
            self.location = hash;
        }
    }
}

///////////////////////////////////////////


function composeAddr(name)
{
    var first = '&#00064';
    var second = '&#0111;&#117;&#0116;&#115;' + 
                    '&#0111;&#102;&#0116;' + '.' + 
                    '&#0110;&#101;&#0116;';
    return name + first + second;
}

function drawMLink(text,name)
{
    document.write(text + "<a href=" + "mail" + "to:" + 
        composeAddr(name) + ">" + composeAddr(name) + "</a>");
}

