function makeNews(c,l,f,i){
	this.copy = c;
	this.link = l;
	this.write = writeNews;
}

function writeNews(){
	var str = '<a href="' + this.link + '">';
	str += this.copy + '<br><br>';
	return str;
}

function makeSale(c,l,f,i){
	this.copy = c;
	this.link = l;
	this.write = writeSale;
}

function writeSale(){
	var str = '<a href="' + this.link + '">';
	str += this.copy + '<br><br>';
	return str;
}

var newsArray = new Array();
newsArray[0] = new makeNews("<img src='/ad/oem_ad.png'><br><font color='#F67D0F'><div align='left'><b>Free Hosting</b>,</font><br><font color='#FFFFFF'>Purchase any developed site and receive your hosting free for the first month.</font><br><img src='/images/more.gif' border='0' vspace='5' hspace='15'></a></div><img src='/images/line.jpg' vspace='7' width='155'>",'/free_developed_hosting_promo.html').write();

newsArray[1] = new makeNews("<img src='/ad/mx_contact_ad.png'><font color='#F67D0F'><div align='left'><b>Free Domain</b>,</font><br><font color='#FFFFFF'>Purchase a 1 year reseller hosting package and receive your Domain free.</font><br><img src='/images/more.gif' border='0' vspace='5' hspace='15'></a></div><img src='/images/line.jpg' vspace='7' width='155'>",'/free_domain_reseller_promo.html').write();

newsArray[2] = new makeNews("<img src='/ad/adult_promo_ad.png'><font color='#F67D0F'><div align='left'><b>Free Adult Site</b>,</font><br><font color='#FFFFFF'>Purchase a one year adult hosting package and receive a free adult site.</font><br><img src='/images/more.gif' border='0' vspace='5' hspace='15'></a></div><img src='/images/line.jpg' vspace='7' width='155'>",'/free_adult.html').write();

var saleArray = new Array();
saleArray[0] = new makeSale("<img src='/ad/oem_ad.png'><br><font color='#F67D0F'><div align='left'><b>Free Hosting</b>,</font><br><font color='#FFFFFF'>Purchase any developed site and receive your hosting free for the first month.</font><br><img src='/images/more.gif' border='0' vspace='5' hspace='15'></a></div><img src='/images/line.jpg' vspace='7' width='155'>",'/free_developed_hosting_promo.html').write();

saleArray[1] = new makeSale("<img src='/ad/mx_contact_ad.png'><font color='#F67D0F'><div align='left'><b>Free Domain</b>,</font><br><font color='#FFFFFF'>Purchase a 1 year reseller hosting package and receive your Domain free.</font><br><img src='/images/more.gif' border='0' vspace='5' hspace='15'></a></div><img src='/images/line.jpg' vspace='7' width='155'>",'/free_domain_reseller_promo.html').write();

saleArray[2] = new makeSale("<img src='/ad/adult_promo_ad.png'><font color='#F67D0F'><div align='left'><b>Free Adult Site</b>,</font><br><font color='#FFFFFF'>Purchase a one year adult hosting package and receive a free adult site.</font><br><img src='/images/more.gif' border='0' vspace='5' hspace='15'></a></div><img src='/images/line.jpg' vspace='7' width='155'>",'/free_adult.html').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);
	}
}

var sIndex = 0;
var timerID = null;
function rotateSale(){
	var len = saleArray.length;
	if(sIndex >= len)
		sIndex = 0;
	document.getElementById('sales').innerHTML = saleArray[sIndex];
	sIndex++;
	timerID = setTimeout('rotateSale()',6000);
}
function pauseSale() {
	if (timerID != null) {
		clearTimeout(timerID);
		timerID = null;
	}
}

function playSale() {
	if (timerID == null) {
		timerID = setTimeout('rotateSale()', 1000);
	}
}
