﻿function blink_new_watch() {
    is_new_watch_link_obj = document.getElementById("is_new_watch_link");

    is_new_watch_link_obj.style.visibility = (is_new_watch_link_obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}

var bottomBannerLeftPos = 0;
var bottomBannerImgWidth = 800;

function move_obj_to_bottom() {
    var offset = 0;
    var element = document.getElementById('bottom_banner_div');

    element.style.top = (document.documentElement.scrollTop + (document.documentElement.clientHeight - element.offsetHeight) + offset) + 'px';

    document.getElementById('bottom_banner_div').style.width = document.documentElement.clientWidth + "px";
}

function scroll_bottom_banner() {
    var bottomBannerImg = document.getElementById('bottom_banner_img');

    if (-bottomBannerLeftPos == bottomBannerImgWidth) {
        bottomBannerLeftPos = 0;
    }
    else {
        bottomBannerLeftPos--;
    }

    if (bottomBannerImg != null)
    bottomBannerImg.style.left = bottomBannerLeftPos + "px";
}

function getW() {
    var w;
    if (document.innerWidth) {
        w = document.innerWidth;
    } else if (document.documentElement.clientWidth) {
        w = document.documentElement.clientWidth;
    } else if (document.body) { w = document.body.clientWidth; }
    return w;
}


function getH() {
    var h;
    if (document.innerHeight) {
        h = document.innerHeight;
    } else if (document.documentElement.clientHeight) {
        h = document.documentElement.clientHeight;
    } else if (document.body) { h = document.body.clientHeight; }

    //alert();
    return h;
}

function move_banner_to_bottom() {
    var offset = 0; // set offset (likely equal to your css top)
    var element = document.getElementById('bottom_banner_div');

    element.style.top = (document.body.scrollTop + (getH() - element.offsetHeight) + offset) + 'px';
    element.style.width = getW();
    //    window.setInterval("move_banner_to_bottom()", 50);
    //alert(element.style.top);
}
