//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=800,height=620,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+"&amp;"+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();

}


function toggle(id,action) {
	if (document.getElementById)
			{
			var	theitem = document.getElementById(id);
			
			if (action == 'maximised') {
				theitem.style.display = 'block';				
				}
			else {
				theitem.style.display = 'none';				
				}				

			document.getElementById(id +'-control').className = action;
			 
			}
}


function maximise(id) {
	if (document.getElementById)
			{
			var	theitem = document.getElementById(id);
		
			theitem.style.display = 'block';
			document.getElementById(id +'-control').className = 'maximised'; 
			}
}


/*

Image fade code by Clagnut:
http://clagnut.com/sandbox/imagefades/

*/

document.write("<style type='text/css'>#bannerimage {background: #A5CD2C; visibility:hidden;}</style>");








