/**
 * 22 maggio 2007: Lop oggetto per banner in javascript; usato in Banner Gruppo Cic riviste
 * oggetto rappresentante un banner
 **/
function Banner(id){
	this.id = id;
	this.hrefs = new Array();
	this.srcs = new Array();
	this.titles = new Array();
	this.counter = 0;
}
//metodi
Banner.prototype.add = function(i,h,a){
	this.srcs[this.srcs.length] = i;
	this.hrefs[this.hrefs.length] = h;
	this.titles[this.titles.length] = a;
}//add
Banner.prototype.next = function(){
	this.counter++;
	if(this.counter >= this.srcs.length){
	    this.counter = 0;
	}
	img = document.getElementById("I"+this.id);
	img.src = this.srcs[this.counter];
	img.title = this.titles[this.counter];
	img.alt = this.titles[this.counter];

	link = document.getElementById("L"+this.id);
	link.href = this.hrefs[this.counter];
}//next
/** fine oggetto Banner **/

/** 
 * ruota tutti i banner presenti nella pagina
 * bLists è l'array dei banner
 **/
function bannerRotate(timing){
	for(b in bLists){
	    bLists[b].next();
	}
	window.setTimeout("bannerRotate("+timing+");",timing)
}//bannerRotate
