// JavaScript Document

function resize_iframe() {
	//resize the iframe according to the size of the

	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
    	//Non-IE
	    myWidth = window.innerWidth;
    	myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    	//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    	//IE 4 compatible
	    myWidth = document.body.clientWidth;
    	myHeight = document.body.clientHeight;
	}
	//window.alert( 'Width = ' + myWidth );
	//window.alert( 'Height = ' + myHeight );
	
	//window (all these should be on the same line)
	//document.getElementById('CURR_IFRAME').style.height=parseInt(document.body.clientHeight-document.getElementById('CURR_IFRAME').offsetTop-8)+"px";
	document.getElementById('CURR_IFRAME').style.height=parseInt(myHeight)+"px";	
	
	//document.getElementById('CURR_IFRAME').style.width=parseInt(myWidth-document.getElementById('CURR_IFRAME').offsetLeft-250)+"px";	
	document.getElementById('CURR_IFRAME').style.width="530px";
}

/*	MENU
	cerca la lista [ul] con id="menu" e assegna alle sue voci [li]
	la funzione che	all'onmouseover ne imposta la classe CSS "over"
	(e che nei CSS determina la visibilità del sottomenu, cioè l'ul contenuto) */
	
inizializzaMenu = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("menu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() { this.className+=" over"; }
				node.onmouseout=function() { this.className=this.className.replace(" over", ""); }
			}
		 }
 	}
}

/* per evitare incompatibilità con altri js AGGIUNGO l'inizializzazione 
	ad altre eventuali funzioni presenti nell'onload della pagina */
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent(inizializzaMenu);