function makeNews(c,l,f,i){
	this.copy = c;
	this.write = writeNews;
}

function writeNews(){
	var str = '';
	
	
	str += this.copy + '<br>';
     
	return str;
}

var newsArray = new Array();
newsArray[0] = new makeNews("<div class='newstext'><span class='newsheadline'>Boost your Graduate School Test Score</span>"+
               "<br  />Prepare for GRE, GMAT, LSAT, and MCAT tests via online courses.<a href='http://www.acadweb.wwu.edu/eesp/testprep/testprep.shtml' target='blank'><br  /><b>More >>></b></a>" + 
"<br  /> <a href='#' onmousedown='goback1()' class='newsgobacklinks'><< Previous </a> <a href='#' onmousedown='goforward()' class='newsgolinks'>Next >></a>  </div>").write();

newsArray[1] = new makeNews("<div class='newstext'><span class='newsheadline'>Advance Your Career as a Project Management Professional</span>"+
               "<br  />Ten-week program prepares you for international PMP and CAPM examinations. <a href='http://www.acadweb.wwu.edu/eesp/pmpcert/project_cert.shtml' target='blank'>...<b>More >>></b></a>" + 
"<br  /> <a href='#' onmousedown='goback3()' class='newsgobacklinks'><< Previous </a> <a href='#' onmousedown='goforward()' class='newsgolinks'>Next >></a>  </div>").write();

newsArray[2] = new makeNews("<div class='newstext'><span class='newsheadline'>Add a Web Design course to your skill-set</span>"+
               "<br  />Gain Web design and development experience and earn a certificate.<a href='http://www.acadweb.wwu.edu/eesp/webdesign.shtml' target='blank'><br  /><b>More >>></b></a>" + 
"<br  /> <a href='#' onmousedown='goback2()' class='newsgobacklinks'><< Previous </a> <a href='#' onmousedown='goforward()' class='newsgolinks'>Next >></a>  </div>").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 goforward(){
 clearTimeout(timerID)
var len = newsArray.length;
	if(nIndex >= len)
		nIndex = 0;
	document.getElementById('stories').innerHTML = newsArray[nIndex];
	nIndex++;
	timerID = setTimeout('goforward()',6000);
 	}

function goback1(){
    nIndex=2;
	document.getElementById('stories').innerHTML = newsArray[nIndex];
	
 	}


function goback2(){
nIndex=1;
    	document.getElementById('stories').innerHTML = newsArray[nIndex];
	}

function goback3(){
    nIndex=0;
	document.getElementById('stories').innerHTML = newsArray[nIndex];
	}
	
