// JavaScript Document
<!--//
	var min_width  = 933;
	var min_height = 646;
	var min_flash  = "9.0.115";
	var photogallery_div = "photogallery";
	var contents_div = "contents";
	
	function getViewportSize() { 
		var size = [0, 0]; 
		if (typeof window.innerWidth != "undefined") { 
			size = [window.innerWidth, window.innerHeight];
		} 
		else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) {
			size = [document.documentElement.clientWidth, document.documentElement.clientHeight]; 
		}
		else {
			size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight]; 
		}
		return size; 
	}

	function resize() {
		var el = document.getElementById("container");
		var size = getViewportSize(); 
		el.style.width = size[0] < min_width ? min_width+"px" : "100%";
		el.style.height = size[1] < min_height ? min_height+"px" : "100%";
	}
			
	function createFullBrowserFlash() {
		swfobject.createCSS("html", "height:100%;");
		swfobject.createCSS("body", "height:100%;");
		swfobject.createCSS("#container", "margin:0; width:100%; height:100%; min-width:"+min_width+"px; min-height:"+min_height+"px;");
		window.onresize = resize;
		window.onresize();
	}
			
	var flashvars = {};
	var size = getViewportSize();
	flashvars.larghezza = size[0];
	flashvars.altezza = size[1];
	
	var params = {};
	params.allowFullScreen = "true";
	params.scale = "noscale";
	params.allowScriptAccess = "always";
	params.wmode = "transparent";
	params.salign = "lt";
			
	var attributes = {};
				
	if(swfobject.hasFlashPlayerVersion(min_flash)){ 
		swfobject.embedSWF("background.swf", photogallery_div, "100%", "100%", min_flash, "expressInstall.swf", flashvars, params, attributes);
		if (swfobject.hasFlashPlayerVersion(min_flash)) {
			swfobject.addDomLoadEvent(createFullBrowserFlash);
		}
		swfobject.embedSWF("index.swf", contents_div, 933, 650, min_flash, "expressInstall.swf", flashvars, params, attributes);
	}
	


function popup_apri(url, target, parameters) {
	var finestra = document.getElementById(target);
	finestra.style.display = "block";
	completeAHAH.ahah(url, target, 5, "POST", parameters);
}

function popup_open(div_destinazione, pagina, percorso){
	document.getElementById("credits").style.display = "none";
	document.getElementById("privacy").style.display = "none";
	var div_daspostare = document.getElementById(div_destinazione);
	div_daspostare.style.display = "block";
	completeAHAH.ahah(pagina, div_destinazione, 5, "POST", "percorso="+percorso);
}

function popup_chiudi(target){
	var div_selezionato = document.getElementById(target);
	div_selezionato.style.display = "none";
}
//-->
