var floatAds_MinMax=0;
function $ById(id) {
    return document.getElementById(id);
}
function scrollBanner(timer, moveNumber) {
    function move(o) {
        var st = document.body.scrollTop;
        var window_Height=o.offsetHeight;
        if(document.body.clientHeight)
        {
            window_Height=document.body.clientHeight;
        }
        else
        {
            window_Height=document.body.offsetHeight;
        }
        if((window_Height - o.offsetHeight)>=0)
        {
            st=st + window_Height - o.offsetHeight;
        }
        else
        {
            st=st + o.t;
        }
        var window_Width=o.offsetWidth;
        if(document.body.clientWidth)
        {
            window_Width=document.body.clientWidth;
        }
        else
        {
            window_Width=document.body.offsetWidth;
        }
        var sl = document.body.scrollLeft + (o.c == 0 ? o.a : window_Width - o.a - o.offsetWidth);
        var tc = st - o.offsetTop, lc = sl - o.offsetLeft;
        with (o.style) {
            top = o.offsetTop + (tc != 0 ? tc / Math.abs(tc) : 0) * Math.min(Math.abs(tc), moveNumber) + "px";
            left = o.offsetLeft + (lc != 0 ? lc / Math.abs(lc) : 0) * Math.min(Math.abs(lc), moveNumber) + "px";
        }
        if (o.person) {
            with (o.person.style) {
                top = o.offsetTop + "px";
                left = o.offsetLeft + o.offsetWidth - o.person.offsetWidth + "px";
            }
        }
    }
    var hidden = function() {
        var o = this.parent;
        if(floatAds_MinMax==0)
        {
            o.className="minAds";
            this.src="/images/barresume.jpg";
            floatAds_MinMax=1;
        }
        else
        {
            o.className="nomralAds";
            this.src="/images/boxmin.jpg";
            floatAds_MinMax=0;
        }
    }
    this.add = function (to, t, a, c, lo) {
        var div, exec = function () {
            move(to);
        };
        to.person = lo;
        to.t = t;
        to.a = a;
        to.c = c;
        with (to.style) {
            position = "absolute";
            display = "block";
            var windowHeight=to.offsetHeight;
            if(document.body.clientHeight)
            {
                windowHeight=document.body.clientHeight;
            }
            else
            {
                windowHeight=document.body.offsetHeight;
            }
            if((windowHeight - to.offsetHeight)>=0)
            {
                top = windowHeight - to.offsetHeight;
            }
            else
            {
                top= document.body.scrollTop + t;
            }
            var windowWidth=to.offsetWidth;
            if(document.body.clientWidth)
            {
                windowWidth=document.body.clientWidth;
            }
            else
            {
                windowWidth=document.body.offsetWidth;
            }
            left = document.body.scrollLeft + (c == 0 ? a : windowWidth - a - to.offsetWidth);
        }
        if (typeof lo != "undefined") {
            with (lo.style) {
                display = "block";
            }
            lo.onmousedown = hidden;
            lo.parent = to;
        }
        exec();
        to.interval = window.setInterval(exec, timer);
    };
}