﻿

window.addEvent('load', function() {
    var wh = getWindowHeight();
    var ww = getWindowWidth(); document.getElementById('Table').style.height = wh + "px";
    var verticalmenu = new BySlideMenu('verticalmenu', { vertical: true, compressSize: 30, defaultIndex: _DEFINDEX });
    
    initFlash(ww);
    initSlade(ww, wh, _HEIGHT-25);
    initSlade1(ww, wh, _HEIGHT-25);
    document.getElementById('Anonce').style.height = wh + 'px';
    if (!_CURRENTID) document.getElementById('Anonce').style.width = '210px'; setTimeout('mov = setInterval(AnonceClose, 20)', 1000);
    
});


window.onresize = function() {
    var wh = getWindowHeight();
    var ww = getWindowWidth();
    initFlash(ww);
    initSlade(ww, wh, _HEIGHT-25);
document.getElementById('Anonce').style.height = wh + 'px';
  
}

function initFlash(ww) {
    try {
        var fl = document.getElementById('F_main');
        if (fl == null) {
            var fls = document.getElementsByTagName('embed');
            for (var i = 0; i < fls.length; i++) { if (fls[i].getAttribute('name') == 'F_main') { fl = fls[i]; break; } }
        }
        var nw = ww/2 - 270;
        if (nw < 359) {
            var k = parseInt(fl.height) / parseInt(fl.width);
            fl.width = nw + 'px'; fl.height = parseInt(fl.width) * k + 'px';
        }
    } catch (e) { }
}

var mov = null;
function rightPanelGo() {
    var p = parseInt(document.getElementById('Anonce').style.width);
    if (p == 20) mov = setInterval(AnonceOpen, 20);
    if (p == 210) mov = setInterval(AnonceClose, 20);
    //p.style.width = '210px'
}
function AnonceOpen() {
    var w = parseInt(document.getElementById("Anonce").style.width);
    if (w < 210)
        document.getElementById("Anonce").style.width = (w + 10) + "px";
    else clearInterval(mov);
}
function AnonceClose() {
    var w = parseInt(document.getElementById("Anonce").style.width);
    if (w > 20)
        document.getElementById("Anonce").style.width = (w - 10) + "px";
    else clearInterval(mov);
}

function GetHeight(_obj) {
    var h;
    if (_obj!=null&&_obj.style) {
        h = _obj.offsetHeight || _obj.style.pixelHeight;
    }
    return h;
}
function getWindowWidth() {
    var _out;
    if (self.innerHeight) {
        _out = self.innerWidth;
    }
    else if (document.documentElement && document.documentElement.clientHeight) {
        _out = document.documentElement.clientWidth;
    }
    else if (document.body) {
        _out = document.body.clientWidth;
    }
    return _out;
}
function getWindowHeight() {
    var _out;
    if (self.innerHeight) {
        _out = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) {
        _out = document.documentElement.clientHeight;
    }
    else if (document.body) {
        _out = document.body.clientHeight;
    }
    return _out;
}
