//pre-load images
var listImg = new Image();
listImg.src = 'images/testimonials/eg_tax.gif';
var treeImg = new Image();
treeImg.src = 'images/testimonials/cpa.gif';

function makeNews(c,l,s, f,i){
	this.copy = c;
	this.link = l;
	this.sign = s;
	this.follow = f;
	this.img = i;
	this.write = writeNews;
}

function writeNews(){
	var str = '';
	str += '<ul style="padding:10px 0px 5px 0px; margin:0px" class="testimonialcontent"><p>'+ this.copy ;
	str += '<img border="0" align="left" src="' + this.img.src + '">';
	str += '<br/>' + this.sign + '<br/>';
        str +=  '<small><a rel="nofollow" href="' + this.link + '" target="_blank">' + this.follow + '</a></small></p>  </ul>  ';
	return str;
}

var newsArray = new Array();
newsArray[0] = new makeNews("&quot;We have been using your services for several years, and I can&rsquo;t tell you what an asset USADATA has been to our firm.&quot;<BR/><BR/>&quot;I am happy to report that each year since we started working with USADATA we&rsquo;ve seen a continued increase in revenue. We have over 24 offices in Western New York, and your lists have helped us successfully satisfy several new locations, by enabling our continued growth.&quot; <br/>", 'http://www.egtax.com', '<small>Tiffany Fabian<br/>Corporate Development Director<br>EG Tax</small>' , 'www.egtax.com',listImg).write();

newsArray[1] = new makeNews("&quot;I have worked with USADATA in each of the past 3 years because they provide access to the targeted consumer and business demographic segments our business excels in.&quot;</p><p>&quot;They also make it easy for me. Leads are delivered in my preferred format which makes getting my mail campaign out the door faster.&quot;<br/>",'http://www.lihcc.com/index.php?option=com_sobi2&sobi2Task=sobi2Details&sobi2Id=159&Itemid=61', '<small>Edwin Vicente Jr<br/>CPA PC</small>', 'www.lihcc.com',treeImg).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()',6000);
}
function pauseNews() {
	if (timerID != null) {
		clearTimeout(timerID);
		timerID = null;
	}
}

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

