function makeNews(a,b){
	this.copy = a;
	this.copy2 = b;
	this.write = writeNews;
}

function writeNews(){
	var str = '';
	str += this.copy + '<br><br>';
	str += '- <strong>' + this.copy2 + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="testimonials.htm">View All</a></strong>';
	return str;
}

var newsArray = new Array();
newsArray[0] = new makeNews("It was a pleasure working with David during the process of buying our first home. He was very professional, always available for our questions and concerns, and, overall, did a great job for us! We would highly recommend David's services to anyone.","Alex & Kristi, Ellicott City, MD").write();

newsArray[1] = new makeNews("Thank you for your past outstanding assistance in selling my house in Silver Spring, MD.  You were a great help and often went above and beyond the call of duty to carry the sale through to completion.","Linda, Silver Spring, MD").write();

newsArray[2] = new makeNews("Thank you so much for your hard work in finding us the right home for our needs. Relocating from Texas is not easy and your standard of service, commitment to finding us the right home and ethics was key to our success.","Dan Frank, Highland, MD").write();

newsArray[3] = new makeNews("Right from day one of my search for property via the internet to the closing date, Michael McKenna and his team have been fantastic. They never got tired through out my period of searching and they ensured I got one of the best properties in my chosen location.","Idris & Family, Pikesville, MD").write();

var nIndex = 0;
var timerID = null;
function rotateNews(){
	var len = newsArray.length;
	if(nIndex >= len)
		nIndex = 0;
	document.getElementById('stories').innerHTML = newsArray[nIndex];
	nIndex++;
	timerID = setTimeout('rotateNews()',10000);
}
function pauseNews() {
	if (timerID != null) {
		clearTimeout(timerID);
		timerID = null;
	}
}

function playNews() {
	if (timerID == null) {
		timerID = setTimeout('rotateNews()', 1000);
	}
}

