// JavaScript Document
function onOver(el,cl){
	el=document.getElementById(el);		
	if(cl=='page'){
		el.style.backgroundColor='#99cc66';
	}else if(cl=='selectableSection'){
		el.style.textDecoration='underline';
	}
}

function onOut(el,c){
	el=document.getElementById(el);		
	if(c=='menuItem'){
		el.style.backgroundColor='white';
	}else if(c=='page'){
		el.style.backgroundColor='white';
	}
}

function show(selectedItem){
	 target=document.getElementById(selectedItem);
	 var disp=target.style.display;
	 if(disp=="none"){
		target.style.display="";
	 }else{
		target.style.display="none";
	 }
}

function cc(t){
		var el=document.getElementById(t);
		el.style.cursor="pointer";
		col=el.bgColor;
		s=t.substr(1);
		if(col=='#83b7de'){
			if(s%2==0){
				el.bgColor="#dddddd";
			}else{
				el.bgColor="white";
			}
		}else{
			el.bgColor='#83b7de';
		}
}
//Non funziona ancora!!!!!!!!!!!!!!!!!!!!!!
function trasparente(t){
	a=document.getElementById('menu').getElementsByTagName('div');
	for(i=0;i<a.length;i++){
		var ii=a[i].id;
		if(ii==null){
			continue;
		}else{
			if(ii.indexOf('menu')>=0){
				document.getElementById(ii).style.backgroundColor='';
			}
		}
	}
}

function visualizza(t){
	//Cambia il colore dello sfondo del div in cui entra
	document.getElementById(t).style.backgroundColor='#e3e8e3';
	//Cerca sottomenu aperti e li chiude
	a=document.getElementById('menu').getElementsByTagName('div');
	for(i=0;i<a.length;i++){
		var ii=a[i].id;
		if(ii==null){
			continue;
		}else{
			if(ii!=t&&ii.indexOf('menu')>=0){
				document.getElementById(ii).style.backgroundColor='';
			}
			if(ii.indexOf('sottomenu')>=0){
				var s=ii.substr(9);
				s='menu'+s;
				var d=a[i].style.display;
				if(d!='none'){
					a[i].style.display='none';
					document.getElementById(s).style.backgroundColor='';
					document.getElementById(s).style.backgroundImage='url(../images/drop_menu.gif)';
				}
			}
		}
	}
	
	var c=t.substr(4);
	c='sottomenu'+c;
	flag=0;
	for(i=0;i<a.length&&!flag;i++){
		ii=a[i].id;
		if(ii==c){
			flag=1
		}
	}
	if(flag){
		var el=document.getElementById(c);
		var s=el.style.display;
		if(s=='none'){
			el.style.display='';
			
		}else{
			el.style.display='none';
		}
		var el1=document.getElementById(t);
		var bg=el1.style.background;
		if(bg.indexOf('url(../images/selected_menu.gif)')<0){
			el1.style.backgroundImage='url(../images/selected_menu.gif)';
		}else{
			el1.style.backgroundImage='url(../images/drop_menu.gif)';
		}
	}
}


function extra(pag){
	newWindow = window.open(pag,'',"status,height=600,width=430");
	newWindow.focus( );
}

function sot(selectedItem){
	target=document.getElementById(selectedItem);
	target.style.color="#9999cc";
	target.style.cursor="pointer";
}

function rsot(selectedItem){
	target=document.getElementById(selectedItem);
	target.style.color="blue";
	target.style.textDecoration="none";
}

function apri(selectedItem,changeItem){
 target=document.getElementById(selectedItem);
 target1=document.getElementById(changeItem);
 var disp=target.style.display;
 if(disp=="none"){
	target.style.display="";
	target1.src="../images/selected_menu_new.gif";
 }else{
	target.style.display="none";
	target1.src="../images/drop_menu_new.gif";
 }
 }