var banners = new Array();
banners[banners.length] = new mybanner("/img/banner/al-per-i-giovani_ok.gif","/info/perigiovani/",false);
banners[banners.length] = new mybanner("/img/banner/alghero2011_documentazione.gif","http://www.almalaurea.it/universita/profilo/",false);

banners[banners.length] = new mybanner("/img/banner/bologna2011_documentazione.gif","/universita/occupazione/occupazione09/",false);
//banners[banners.length] = new mybanner("/img/banner/cosenza2010-documentazione.gif","/universita/occupazione/occupazione08/",false);
//banners[banners.length] = new mybanner("/img/banner/news1_300x60.gif","/info/almanews/index.shtml?CMP=001&BAN=1_300&SITE=uni",false);
//banners[banners.length] = new mybanner("/img/banner/convegno_ad_05_300x60.gif","http://www.almadiploma.it/info/convegni/bologna2005/",false);
banners[banners.length] = new mybanner("/img/banner/orientamento_banner.gif","http://orientamento.almalaurea.it/info/servizi/orientamento/",false);
banners[banners.length] = new mybanner("/img/banner/banner_libreria.gif","/universita/volumi/",false);
//banners[banners.length] = new mybanner("/img/banner/biblioteca_almalaurea300x60.gif","/universita/volumi/",false);
//banners[banners.length] = new mybanner("/img/banner/libro_lavorare_300x60.gif","/universita/volumi/lavorare/?CMP=01&SITE=univ&BAN=300",false);
//banners[banners.length] = new mybanner("/img/banner/banner_profilo2007.gif","/universita/profilo/?CMP=01&SITE=uni&BAN=300",false);
//banners[banners.length] = new mybanner("/img/banner/libro_mulino_300x60.gif","/universita/volumi/transizione/",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/news1_120x90.gif","/info/almanews/index.shtml?CMP=001&BAN=1_120&SITE=uni",false);


var time = new Date();

var contatore=(time.getTime())%(banners.length);
var bcount2 = (time.getTime())%(buttons.length);;
var contpiccolo=0

function getImage() {
	contatore++;
	if (contatore >= banners.length) contatore=0;
	if (isNaN(contatore))contatore=0;
	if (document.area) {
		document.area.src= banners[contatore].img;
		document.area.alt = banners[contatore].url + banners[contatore].delay;
	}	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.url = url;
	this.popup = popup;
}
function gobanner() {
  if (banners.length == 0) return void(0);
	if (contatore < 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;
}

if ((banners.length > 0) || (buttons.length > 0)) {
	getImage();
	setInterval('getImage()', 19000);
}

