//pre-load images
var listImg2 = new Image();
listImg2.src = 'watch.gif';
var treeImg2 = new Image();
treeImg2.src = 'dhtml.gif';
var formImg2 = new Image();
formImg2.src = 'form.gif';
var autoImg2 = new Image();
autoImg2.src = 'web.gif';

function makeNews2(c,l,f,i){
	this.copy2 = c;
	this.link2 = l;
	this.follow2 = f;
	this.img2 = i;
	this.write2 = writeNews2;
}

function writeNews2(){
	var str = '';
//	str += '<a href="' + this.link + '">';
	str += '<a href="ingegneri.php" class="rossonospazio">' + this.copy2 + '</a><br><br>';
	str += '<a href="ingegneri.php" class="testonospazio">' +this.follow2 + '</a><br>';

	//str += '<img border="0" src="' + this.img.src + '"></a><br>';
	//str += this.copy + '<br>';
    //    str +=  '<a href="' + this.link + '">' + this.follow + '</a>';
	return str;
}

//var newsArray = new Array();
//newsArray[0] = new makeNews("Move Items Between Lists With JavaScript",'http://www.devx.com/GetHelpOn/10MinuteSolution/16372','Read More',listImg).write();

//newsArray[1] = new makeNews("Build an XML-Based Tree Control With JavaScript",'http://www.devx.com/getHelpOn/Article/11874','More Info',treeImg).write();

//newsArray[2] = new makeNews("Automate Your Form Validation",'http://www.devx.com/gethelpon/10MinuteSolution/16474','Full Story',autoImg).write();

//newsArray[3] = new makeNews("Create Fast, Smooth Multi-Page Forms With JavaScript",'http://www.devx.com/webdev/Article/10483','More Info',formImg).write();

var nIndex2 = 0;
var timerID2 = null;
function rotateNews2(){
	var len = newsArray2.length;
	if(nIndex2 >= len)
		nIndex2 = 0;
	document.getElementById('stories2').innerHTML = newsArray2[nIndex2];
	nIndex2++;
	timerID2 = setTimeout('rotateNews2()',6000);
}
function pauseNews2() {
	if (timerID2!= null) {
		clearTimeout(timerID2);
		timerID2 = null;
	}
}

function playNews2() {
	if (timerID2 == null) {
		timerID2 = setTimeout('rotateNews2()', 1000);
	}
}

