var scrollspeed		= "1"		// SET SCROLLER SPEED 1 = SLOWEST
var speedjump		= "50"		// ADJUST SCROLL JUMPING = RANGE 20 TO 40
var startdelay 		= "2" 		// START SCROLLING DELAY IN SECONDS
var nextdelay		= "0" 		// SECOND SCROLL DELAY IN SECONDS 0 = QUICKEST
var topspace		= "0px"		// TOP SPACING FIRST TIME SCROLLING
var frameheight		= "200px"	// IF YOU RESIZE THE WINDOW EDIT THIS HEIGHT TO MATCH
var dataobj, AreaHeight, animationTimeout;
 
function HeightData(){
    AreaHeight=dataobj.offsetHeight;
    if (AreaHeight==0){
        setTimeout("HeightData()",( startdelay * 1000 ));
    }
    else {
        ScrollNewsDiv();
    }
}
 
function NewsScrollStart(){
    dataobj = document.getElementById("news-div");
    dataobj.style.top = topspace;
    setTimeout("HeightData()",( startdelay * 1000 ));
}
 
function ScrollNewsDiv(){
    dataobj.style.top=(parseInt(dataobj.style.top)-(scrollspeed)) + "px";
    if (parseInt(dataobj.style.top)<AreaHeight*(-1)) {
        dataobj.style.top=frameheight
        animationTimeout = setTimeout("ScrollNewsDiv()",( nextdelay * 1000 ))
    }
    else {
        animationTimeout = setTimeout("ScrollNewsDiv()", speedjump)
    }
}

$(document).ready(function(){
    NewsScrollStart();
    $("#news-div").hover(
        function(){clearTimeout(animationTimeout)},
        function(){ScrollNewsDiv()}
    );
    
});