//pre-load images
var listImg = new Image();
listImg.src = '';
var treeImg = new Image();
treeImg.src = '';
var formImg = new Image();
formImg.src = '';
var autoImg = new Image();
autoImg.src = '';

function makeNews(c,l,f,i){
	this.copy = c;
	this.link = l;
	this.follow = f;
	this.img = i;
	this.write = writeNews;
}

function writeNews(){
	var str = '';
	str += this.copy ;
        str +=  '<a href="' + this.link + '">' + this.follow + '</a>';
	return str;
}

var newsArray = new Array();
newsArray[0] = new makeNews("&quot;Thanks for all your help in setting up our new website. Your customer service has been excellent, and the online tools you provide have allowed us to keep our website up-to-date as sales continue to grow. In fact, we had our largest month in sales last month!&quot;<br /><span class=quot>Pennie McLean - <a href=http://www.justduckyoriginals.com/ target=new>Just Ducky Originals</a></span><br /><br /><div style=text-align:right;><a href=/testimonials.asp class=more>More of What Our Clients Have to Say >></a></div>",'','',listImg).write();

newsArray[1] = new makeNews("&quot;You are the best. Thanks for making this happen today within our time lines.  It's great to know we can count on you and Infomedia to meet our needs.&quot;<br><span class=quot>Jamie Warren - <a href=http://www.fortemg.com/ target=new>Fort&eacute; Marketing Group</a></span><br /><br /><div style=text-align:right;><a href=/testimonials.asp class=more>More of What Our Clients Have to Say >></a></div>",'','',treeImg).write();

newsArray[2] = new makeNews("&quot;I just want to tell you how very appreciative I am for your help with our website. I can always count on your quick response and friendly manner in my times of need. You have been so patient and helpful during this whole process, and it has really been a pleasure to have someone like you guiding me along.&quot;<br><span class=quot>Laura Lowe - Hoaglands of Greenwich</span> <br /><br /><div style=text-align:right;><a href=/testimonials.asp class=more>More of What Our Clients Have to Say >></a></div>",'','',autoImg).write();

newsArray[3] = new makeNews("&quot;Thanks...I appreciated your note and all the work you do for us.  You do a great job. It means a lot to know your web guys keeps you up to date!&quot; <br /><span class=quot>Barry Delozier - <a href=http://www.e-signaturehomes.com/ class=links>Signature Homes</a></span><br /><br /><div style=text-align:right;><a href=/testimonials.asp class=more>More of What Our Clients Have to Say >></a></div>",'','',formImg).write();

newsArray[4] = new makeNews("&quot;I want to thank each of your for the outstanding work you have done on our website. Working with you has been a pleasure and I am delighted with the results. You are true professionals!&quot;<br><span class=quot>Barrett Mosbacker - <a href=http://www.briarwoodchristianschool.org/ class=links>Briarwood Christian School</a></span><br /><br /><div style=text-align:right;><a href=/testimonials.asp class=more>More of What Our Clients Have to Say >></a></div>",'','',formImg).write();

newsArray[5] = new makeNews("&quot;What I love about the website that Infomedia developed of us is the administrative backend. Using Infomedia&#39;s Content Edits product, it is simple to make changes to our site. We can update our job listings frequently and add to our What&#39;s New section whenever we want. It&#39;s just so easy!&quot; <br><span class=quot>Lyvonnia Poppell - Principal - <a href=http://www.jacksonthornton.com/ class=links>Jackson Thornton</a></span><br /><br /><div style=text-align:right;><a href=/testimonials.asp class=more>More of What Our Clients Have to Say >></a></div>",'','',formImg).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()',8000);
}
function pauseNews() {
	if (timerID != null) {
		clearTimeout(timerID);
		timerID = null;
	}
}

function playNews() {
	if (timerID == null) {
		timerID = setTimeout('rotateNews()', 1000);
	}
}
