var banners = new Array();

banners[banners.length] = new mybanner("/img/almanews/almalaurea_labirinto.gif","http://www.almalaurea.it/cgi-bin/lau/postlaurea/index?LANG=it",false);

banners[banners.length] = new mybanner("/img/almanews/almalaurea_matite.gif","/aziende/",false);
banners[banners.length] = new mybanner("/img/almanews/orientamento_banner.gif","http://orientamento.almalaurea.it/info/servizi/orientamento/",false);
banners[banners.length] = new mybanner("/img/almanews/miojob_banner_hp.gif","/lau/cercaofferta",false);
banners[banners.length] = new mybanner("/img/banner/banner_libreria.gif","/universita/volumi/",false);
//banners[banners.length] = new //mybanner("/img/cp/european_res_300x60.gif","/lau/cercaofferta/cp/european_researchers_main.shtml",false);
//banners[banners.length] = new mybanner("/img/cp/esprit_300x60.gif","/lau/cercaofferta/cp/esprit.shtml",false);
//banners[banners.length] = new mybanner("/img/banner/ats_300x60.gif","http://accenturetechnologysolutions.it",true);
//banners[banners.length] = new mybanner("/img/almanews/pannello_almalaurea.gif","/aziende/cerca/",false);
var buttons = new Array();
//buttons[buttons.length] = new //mybanner("/img/cp/european_res_120x60.gif","/lau/cercaofferta/cp/european_researchers_main.shtml",false);
//buttons[buttons.length] = new mybanner("/img/banner/ats_120x90.gif","http://accenturetechnologysolutions.it",true);
//buttons[buttons.length] = new mybanner("/img/banner/convegno_bo_0703_120x90.gif","/info/convegni/bologna2007/",false);
//buttons[buttons.length] = new mybanner("/img/cp/esprit_120x90.gif","/lau/cercaofferta/cp/esprit.shtml",false);
//buttons[buttons.length] = new mybanner("/img/banner/convegno_ad_05_120x90.gif","http://www.almadiploma.it/info/convegni/bologna2005/",false);



var time = new Date();

var contatore=(time.getTime())%(banners.length);
var bcount2 = (time.getTime())%(buttons.length);;
var contpiccolo=0

function getImage() {
	if (banners.length > 0) {
		contatore++;
		if (contatore >= banners.length) contatore=0;
		if (isNaN(contatore))contatore=0;
		if (document.area) document.area.src= banners[contatore].img;
		else if (document.getElementById) document.getElementById("area").src= banners[contatore].img;
	}

	if (buttons.length > 0) {
		bcount2++;
		if (bcount2 >= buttons.length) bcount2=0;
		if (isNaN(bcount2)) bcount2=0;
		if (document.sponsorship) document.sponsorship.src = buttons[bcount2].img;
		else if (document.getElementById) document.getElementById("sponsorship").src= buttons[bcount2].img;
	}
}

function mybanner(img,url,popup) {
	this.img = img;
	this.imgPreload = new Image();
	this.imgPreload.src = this.img;
	this.url = url;
	this.popup = popup;
}

function gobanner() {
	if (banners.length == 0) return void(0);
	if (banners[contatore].popup)
		window.open(banners[contatore].url,'','resizable=yes,toolbar=yes,menubar=yes,scrollbars=yes,location=yes,status=yes');
	else
		document.location.href = banners[contatore].url;
}

function gobutton() {
	if (buttons.length == 0) return void(0);
	if (buttons[bcount2].popup)
		window.open(buttons[bcount2].url,'','resizable=yes,toolbar=yes,menubar=yes,scrollbars=yes,location=yes,status=yes');
	else
		document.location.href = buttons[bcount2].url;
}


getImage();
setInterval('getImage()', 9000);

