// scroller width
var swidth = 200;

// scroller height
var sheight = 200;

// background color
var sbcolor = 'white';

// scroller's speed
var sspeed = 1;

// routine timeout (ms)
var stimeout = 50; 

// sizeup multiplier
ssizeup = 0;
ssizeup_multiplier = sheight / 2;
ssizeup_image_multiplier = 30;


var msg = '';

var divid = 'ticker';

// Your messages go below:
var constructNews = function(data) {
	html = '';
	html = html + '<ul>';
	for (var i = 0; i < data.length; i++) {
        	var itemvalue = data[i];

		html = html + '<li>';
			if ((itemvalue.url != null) && (itemvalue.url != 'http://'))
				html = html + '<a target="_blanknews" href="' + itemvalue.url + '" title="' + itemvalue.title + '">';
        	if (itemvalue.iconUrl > '') {
        		html = html + '<img src="' + itemvalue.iconUrl + '" border="0" style="padding-right: 3px; height: 50px" /><br />';
			ssizeup += ssizeup_image_multiplier;
        	}
        	html = html + itemvalue.title;
			if ((itemvalue.url != null) && (itemvalue.url != 'http://'))
        		html = html + '</a>';
		html = html + '</li>';

        	html = html + '<li>';
        	html = html + itemvalue.synopsis;
		html = html + '</li>';
		html = html + '<li><br /></li>';

		ssizeup += ssizeup_multiplier;
	}
	html = html + '</ul>';
	startNews(html);
}
// End of your messages

// Begin the ticker code
var resumesspeed = sspeed;
function startNews(html) {
	msg = html;
	
	if (document.all)
		iemarquee(ticker);
	else if (document.getElementById)
		ns6marquee(document.getElementById(divid));
}

function iemarquee(whichdiv) {
	iediv = eval(whichdiv);
	sheight += 50;
	iediv.style.pixelTop = sheight;
	iediv.innerHTML = msg;
	sizeup = iediv.offsetHeight/2;
	ieslide();
}

function ieslide() {
	if (iediv.style.pixelTop >= ssizeup * (-1)) {
		iediv.style.pixelTop -= sspeed;
		setTimeout("ieslide()", stimeout);
	} else {
		iediv.style.pixelTop = sheight;
		ieslide();
	}
}

function ns6marquee(whichdiv) {
	ns6div = eval(whichdiv);
	sheight += 50;
	ns6div.style.top = sheight + "px";
	ns6div.innerHTML = msg;
	sizeup = ns6div.offsetHeight/2;
	ns6slide();
}

function ns6slide() {
	if (parseInt(ns6div.style.top) >= ssizeup * (-1)) {
		theTop = parseInt(ns6div.style.top) - sspeed;
		ns6div.style.top = theTop + "px";
		setTimeout("ns6slide()", stimeout);
	} else {
		ns6div.style.top = sheight + "px";
		ns6slide();
	}
}