//pre-load images
var DenImg = new Image();
DenImg.src = 'images/testimonials/barragan.gif';
var treeImg = new Image();
treeImg.src = 'images/testimonials/brooklin.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 0px 0px; margin:0px" class="testimonialcontent"><p style="padding-top:6px;margin:0px;">'+ 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;Working with a mailing list helped us find new patients we couldn't have accessed as easily or quickly.   Purchasing targeted mailing lists should be a part of every dental marketing campaign. We are completely satisfied with the results.&quot;<br/>", 'http://www.bostondentalcenter.com', '<small>Narguess Riahi - Office Manager<br>Brookline Dental Center</small>' , 'www.bostondentalcenter.com',treeImg).write();

newsArray[1] = new makeNews("&quot;USADATA has been an important tool in the way we reach goals. The information provided by them was fast and secure. Every time I had a question it was answered with the best customer service in a short period of time motivating me to keep working with them. It's been 5 years working with them expanding my business to new markets. Thanks USADATA for your services! &quot;<br/>",'http://www.wedson.com/dr-barragan', '<small>Dr. Carlos Barragan - Owner <br/>Elizabeth Dental Center</small>', 'www.wedson.com/dr-barragan',DenImg).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()', 10000);
	}
}

