function initNewsTicker() {
	var newsScroller = document.getElementById("posts");

  	newsScroller.style.top = 0;

  	if (retrieveComputedStyle(newsScroller, "position") == "relative") {
    	var relativeHeight = newsScroller.offsetHeight;

    	newsScroller.style.position = "absolute";
    	newsScroller.calculatedHeight = newsScroller.offsetHeight;

    	if (relativeHeight > newsScroller.calculatedHeight) {
      		newsScroller.calculatedHeight = relativeHeight;
    	}

    	newsScroller.style.position = "relative";
  	} else {
    	newsScroller.calculatedHeight = newsScroller.clientHeight;
  	}

	document.getElementById("scroll").onmouseover = function() {
		clearTimeout(document.getElementById("posts").timeout);
	}
	
	document.getElementById("scroll").onmouseout = function() {
		moveNewsScroller();
	}

  	moveNewsScroller();

  	return true;
}

function moveNewsScroller() {
  	var increment = 2;
  	var newsScroller = document.getElementById("posts");
  	var currTop = parseInt(newsScroller.style.top);

  	if (currTop < newsScroller.calculatedHeight * -1) {
    	newsScroller.style.top = newsScroller.parentNode.offsetHeight + "px";
  	} else {
    	newsScroller.style.top = (parseInt(newsScroller.style.top) - increment) + "px";
  	}

  	newsScroller.timeout = setTimeout("moveNewsScroller()", 50);

  	return true;
}

function retrieveComputedStyle(element, styleProperty) {
	var computedStyle = null;

  	if (typeof element.currentStyle != "undefined") {
    	computedStyle = element.currentStyle;
  	} else {
    	computedStyle = document.defaultView.getComputedStyle(element, null);
  	}

  	return computedStyle[styleProperty];
}