function aprimenu(){
	document.getElementById("menu1").style.visibility='hidden';
	document.getElementById("menu2").style.visibility='visible';
}

function chiudimenu(){
	document.getElementById("menu1").style.visibility='visible';
	document.getElementById("menu2").style.visibility='hidden';
}



function resize(){ 

//distanza margine destro del menu in proporzione 
var menu_dx = 25;

//altezza schermo
var windowheight = window.screen.height; 
var windowwidth = window.screen.width; 

//altezza finestra client
var htmlheight = document.body.parentNode.clientHeight; 
var htmlwidth = document.body.parentNode.clientWidth; 

// setto oggetti
var frame = document.getElementById("flash_wide"); 
var frame2 = document.getElementById("cornice"); 
var menu = document.getElementById("menu1"); 
var menu2 = document.getElementById("menu2"); 
var logo = document.getElementById("logo"); 
var slogan = document.getElementById("slogan"); 
	
var larghezzacornice = parseInt(((htmlheight-document.getElementById("footer_content").offsetHeight)*16)/9);
var altezzacornice = parseInt((htmlwidth*9)/16);


frame.style.height = (htmlheight-document.getElementById("footer_content").offsetHeight) + "px"; 
frame.style.width = htmlwidth + "px";
	
if (htmlwidth>larghezzacornice)
{		
	//frame.style.height = (htmlheight-document.getElementById("footer_content").offsetHeight) + "px"; 
	//frame.style.width = larghezzacornice + "px";  	

	frame2.style.height = htmlheight - document.getElementById("footer_content").offsetHeight + "px"; 
	//frame2.style.width =  htmlwidth + "px";
		
	menu.style.right =   parseInt(larghezzacornice/menu_dx) + (parseInt(htmlwidth  - larghezzacornice)/2 ) + "px";
	menu2.style.right =   parseInt(larghezzacornice/menu_dx) + (parseInt(htmlwidth  - larghezzacornice)/2 ) + "px";
	
	// allineo logo e slogan
	//slogan.style.left = parseInt(larghezzacornice/menu_dx) + (parseInt(htmlwidth  - larghezzacornice)/2 ) - 20 + "px";
	//logo.style.right = parseInt(larghezzacornice/menu_dx) + (parseInt(htmlwidth  - larghezzacornice)/2 ) - 20 + "px";
		
}
else
{
	//frame.style.height = altezzacornice + "px"; 
	//frame.style.width = htmlwidth + "px";

	frame2.style.height = htmlheight - document.getElementById("footer_content").offsetHeight + "px"; 
	//frame2.style.width =  htmlwidth + "px";
				
	menu.style.right = parseInt(htmlwidth/menu_dx) + "px"; 
	menu2.style.right = parseInt(htmlwidth/menu_dx) + "px"; 
	
	// allineo logo e slogan
	//slogan.style.left = parseInt(htmlwidth/menu_dx) - 20 + "px";
	//logo.style.right = parseInt(htmlwidth/menu_dx) - 20 + "px";
		
		
}

// fix align center per ie 7
//frame.style.top  = parseInt(document.getElementById("cornice").offsetHeight-document.getElementById("flash_wide").offsetHeight)/2 + "px";

// allineo il menu (top)
//menu.style.top = frame.style.top ;
//menu2.style.top = frame.style.top ;


// log	
//var d = new Date();
//document.getElementById("footer_content").innerHTML = "<font color=blue>" + d.getTime()+ " - " + navigator.appVersion + "<br>dimensione client: h " + htmlheight+ " x w " + htmlwidth +  "<br>dimensione cornice: h " + frame2.style.height+ " x w " + frame2.style.width + "<br>dimensione frame: h " + frame.style.height + " x w " + frame.style.width + "</font>";		


} 

function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
