function Headline(title, intro) {
	this.title = title;
	this.intro = intro;
}

var headliners = new Array();
var headlink;
var st = 0, cntst, pos = 0, last = 60, txt = 0;

function startticker(headlines) {
		if (headlines == null) {
			headliners[0] = new Headline("Welcome", "Welcome to the home of Gateshead Private Landlords' Association");
			cntst = 0;
		} else {
			for (var i = 0, l = headlines.length, j = 0; i < l; i+=2, j++) {
					headliners[j] = new Headline(headlines[i], headlines[i+1]);
			}
		}
		cntst = headliners.length;
		headlink = window.setInterval(ticker, 120);
}

function ticker() {

	var div = $("newscontainer");

	if (txt == "" || txt == null) {
		st++;
		pos = 0;
		last = 60;
		if (st > cntst - 1)
			st = 0;
		txt = "                                        - " + headliners[st].title.toUpperCase() + 
					" -                                        " + headliners[st].intro + "...";
	}
	var len = txt.length;

	if (last > len)
		last = len;

	if (pos < len) {
		div.innerHTML = txt.substr(pos, last - pos) + " ";
	} else
		txt = "";
	pos++;
	last++;
}