//
function makeNews(c,l,f){
	this.copy = c;
	this.link = l;
	this.follow = f;
	this.write = writeNews;
}

function writeNews(){
	var str = '';
	str += '<a href="' + this.link + '"></a>';
	str += this.copy + '&nbsp;&nbsp';
        str +=  '<a href="' + this.link + '">' + this.follow + '</a>';
	return str;
}

var newsArray = new Array();
newsArray[0] = new makeNews("KASA Consulting has a range of new environmental and OHS monitoring 		  equipment available for rent...",'AboutUs/News.aspx','Read More').write();

newsArray[1] = new makeNews("KASA Consulting is continuing to provide internal HSE audit services 		  to BMA in Queensland follow...",'AboutUs/News.aspx','Read More').write();

newsArray[2] = new makeNews("KASA's Monitoring and Equipment group have successfully completed a 		  number of dust monitoring pr...",'AboutUs/News.aspx','Read More').write();

var nIndex = 0;
var timerID = null;
function rotateNews(){
	var len = newsArray.length;
	if(nIndex >= len)
		nIndex = 0;
		
	var stories = document.getElementById('stories');
	if (stories != null && stories != 'undefined') {
		stories.innerHTML = newsArray[nIndex];
		nIndex++;
		timerID = setTimeout('rotateNews()',6000);
	}
}
function pauseNews() {
	if (timerID != null) {
		clearTimeout(timerID);
		timerID = null;
	}
}

function playNews() {
	if (timerID == null) {
		timerID = setTimeout('rotateNews()', 1000);
	}
}

