﻿var index;
$().ready(function() {
    $(".scroller-controller .up").mouseover(function() {
        StartUp();
    });

    $(".scroller-controller .up,.scroller-controller .down").mouseout(function() {
        clearTimeout(index);
    });

    $(".scroller-controller .down").mouseover(function() {
        StartDown();
    });
});
function StartUp() {
    index = setTimeout(function() {
        var container = $(".scroller .container");
        var offset = parseInt(container.css("top"));
        offset = isNaN(offset) ? 0 : offset
        if (offset < 0) {
            offset++;
            container.css("top", offset + "px");
            StartUp();
        }
    }, 30);
}
function StartDown() {
    index = setTimeout(function() {
        var container = $(".scroller .container");
        var offset = parseInt(container.css("top"));
        var sheight = parseInt($(".scroller").css("height"));
        var cheight = parseInt($(".scroller .container").css("height"));
        sheight = isNaN(sheight) ? 0 : sheight;
        cheight = isNaN(cheight) ? 0 : cheight;
        offset = isNaN(offset) ? 0 : offset;
        //alert(Math.abs(offset) + " " + cheight + " " + sheight);
        //if (Math.abs(offset) < cheight - sheight) {
            offset--;
            container.css("top", offset + "px");
            StartDown();
        //}
    }, 30);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
    if (init == true) with (navigator) {
        if ((appName == "Netscape") && (parseInt(appVersion) == 4)) {
            document.MM_pgW = innerWidth; document.MM_pgH = innerHeight; onresize = MM_reloadPage;
        }
    }
    else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_openBrWindow(theURL, winName, features) { //v2.0
    window.open(theURL, winName, features);
}
