$(function() {

	// open external links in new windows
    $('a').each(function() {

        if(this.href == 'javascript:void(0);' || this.href == 'javascript: void(0);' || this.href == 'javascript:%20void(0);') 
            return;

        if($(this).attr('noBlank') == 'true')
            return;

        var a = new RegExp('/' + window.location.host + '/');
        if(!a.test(this.href)) {
            $(this).click(function(event) {
                event.preventDefault();
                event.stopPropagation();
                window.open(this.href, '_blank');
            });
        }
	});
	
	// Add icon for external links
	$('div#content a').filter(function() {
		return this.hostname && this.hostname !== location.hostname;
	}).after(' <img src="../img/link-remote.gif">');
	
	// Readerboard
	var marqueewidth = $('#marquee').width();
	$("#marquee").css("width", marqueewidth);
	setInterval("scroll()", 30);
		
});


function scroll() {
	var marqueewidth = $('#marquee').width();
	var newleft = parseInt($("#marquee").css("left")) - 2;
	if(newleft < (-1 * marqueewidth)) newleft = 627;
	$("#marquee").css("left", newleft + "px");
	
}
	

