
(function () {eval(JELLY.local) // START Closure
		   
var gameLinks = Q('#content a[href$=game/index.html]');
if (gameLinks) {
	gameLinks.each(function (item) {
		item.onclick = function () {
			return !window.open('game/index.html', null, 
				'scrollbars=no,menubar=no,width=662,height=465,location=no,resizeable=no');
		};
	});
}


/*------------------------------------------------------------------------------------------- News Scroller ---*/
var ticker = Q('#news-scroller-inner');
if (ticker) { 
	function newsScroller() {

		// Create clone and remove all whitespace to stop the line wrapping
		ticker.style.visibility = 'hidden';
		ticker.innerHTML = ticker.innerHTML.normalize();
		var clone = ticker.cloneNode(true);
		clone.style.position = 'absolute';
		while (/(<[^>]*)\s([^>]*>)/.test(clone.innerHTML)) {
			clone.innerHTML = clone.innerHTML.replace(/(<[^>]*)\s([^>]*>)/g, '$1*$2');
		}
		clone.innerHTML = clone.innerHTML.replace(/\s/g, '&nbsp;').replace(/\*/g, ' '); 

		// Measure the clone then discard it
		document.body.appendChild(clone);
		var offset = clone.offsetWidth;
		clone.parentNode.removeChild(clone);

		ticker.style.width = offset + 'px';
		var scroller_viewport = Q('#news-scroller'),
			interval_speed = 20,
			move_by = 1,
			current_margin = 0,
			viewport_width = scroller_viewport.offsetWidth,
			trigger_value = offset * -1,
			timer;
			 
		ticker.style.visibility = 'visible';
		guid = 0;
	
		var moveIt = function () {
			if (current_margin < trigger_value) {
				ticker.style.marginLeft = viewport_width + 'px';
				current_margin = viewport_width;
			}
			current_margin -= move_by;
			ticker.style.marginLeft = current_margin + 'px';
			timer = setTimeout(moveIt, 20);
		};
		moveIt();
		/*
		var links = ticker.getElementsByTagName('a');
		for (var i=0; links.length > i; i++) {
			links[i].onmouseover = function () {
				clearInterval(timer);
			};
			links[i].onmouseout = moveIt;
		}*/
	}
	newsScroller();
}








})(); // END Closure