//funzione per aprire i link esterni in una nuova finestra
	function nuova_finestra(pagina) {
		window.open(pagina,'Galleria','scrollbars=yes,resizable=yes,status=yes,width=780,height=520,location=yes,toolbar=yes');
		}

//funzione per l'ingrandimento delle immagini in una pop up 		
function apri(url_foto,des_foto){
		addr="/include/fullsize.asp?"+url_foto+"&"+escape(des_foto)
		alt=350
		lar=500
		rszb=(document.layers)?1:0;
		props='height='+alt+',width='+lar+',top='+parseInt((screen.availHeight-alt)/2)+',left='+parseInt((screen.availWidth-lar)/2)+',scrollbars=0,resizable='+rszb+',toolbar=0,menubar=0,location=0,status=0';
		window.open(addr,'_blank',props);
	}

//funzione per aprire una finestra piccola e centrata
function apriPopupCentrata(nome, titolo, lar, alt, feat){
        var wdt = screen.width;
        var hgt = screen.height;
        var x = Math.round( (wdt / 2) - (lar / 2) );
        var y = Math.round( (hgt / 2) - (alt / 2) );
        window.open(nome, titolo, 'width=' + lar + ',height=' + alt + ',left=' + x + ',screenX=' + x + ',top=' + y + ',screenY=' + y + ',' + feat); 
}


//fa crescere progressivamente l'opacità di un immagine
function initImage() {
	imageId = 'bannerimage';
	if (image = document.getElementById(imageId)) {
	setOpacity(image, 0);
	image.style.visibility = "visible";
	fadeIn(imageId,0);
	}
}

function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			//opacity += 10;
			opacity += 7;
			//window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 60);
		}
	}
}
function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}


window.onload = function() {
	initImage();
}

//funzione per mostrare un campo INPUT alla selezione di una SELECT specifica
function mostra(sel){ 
  if(sel.selectedIndex!=0){ 
    var val=sel.options[sel.selectedIndex].value; 
    for(var x=4;x<5;x++){ 
      document.getElementById('tinput').style.display=(x==val)?'block':'none'; 
    } 
  } 
}
