// JavaScript Document

function randomBanner(){
	var openInNewWin = true;
	var banners = new Array();
	//banners[0] = new Banner("http://www.occhioalprezzo.it", "Occhio al prezzo", "http://confesercentimodena.it/confesercenti/graphic/banner_occhio.gif");
	banners[0] = new Banner("http://www.confesercentiweb.com", "Confesercenti web", "http://confesercentimodena.it/confesercenti/graphic/banner_confesercentiweb.jpg");
	banners[1] = new Banner("http://www.confesercentimodena.it/jsp/FranchisingPoint.jsp", "Franchising Point", "http://confesercentimodena.it/confesercenti/graphic/bannerPoint.jpg");
	//banners[2] = new Banner("http://www.gruppohera.it/camper", "Hera", "http://confesercentimodena.it/confesercenti/graphic/BannerCamperHera.jpg");
	//banners[3] = new Banner("http://www.campionariadimodena.it/", "Fiera di Modena", "http://confesercentimodena.it/confesercenti/graphic/banner_modenaFiera.jpg"); 
	//banners[2] = new Banner("http://www.confesercentimodena.it/jsp/GiovediGastronomico.jsp", "Giovedì Gastronomico", "http://confesercentimodena.it/confesercenti/graphic/bannerGiovediG.jpg"); 
	banners[2] = new Banner("http://www.confesercentimodena.it/jsp/wi-fipoint.jsp", "Wi-Fi Point", "http://confesercentimodena.it/confesercenti/graphic/banner-wifi.jpg"); 
	function Banner(url, description, image) {
		this.url = url;
		this.description = description;
		this.image = image;
		return this;
	}
	var bNum = Math.round(Math.random() * (banners.length - 1));
	
	
	document.write("<a href=\"" + banners[bNum].url + "\"");
	document.write(" target=\"_blank\"");
	document.write(">");
	document.write("<img style=\"float:left; padding-top:22px; padding-left:10px; \" src=\"" + banners[bNum].image + "\" border=\"0\" alt=\"" + banners[bNum].description + "\">");
	document.write("</a>");
	}
	
	
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


function randomImage(imgArr)
{
  var imgSrc, imgW, imgH, r;
  r = randomNumber(imgArr.length / 3);
  
  imgSrc = imgArr[r * 3];
  imgW = imgArr[(r * 3)+1];
  imgH = imgArr[(r * 3)+2];
  return imgSrc;
}
function randomNumber(limit){
  return Math.floor(Math.random()*limit);
}





