// inizio funzione swap image case history
function swapCase (swapImg) {
if (document.getElementById) {
document.getElementById('swap').src = swapImg.title;
 } else {
  return true;
 }
}
// fine funzione swap image case history




// inizio funzione menu

gia_fatto=0;
function mmenu(mID) {
	
	try{
		mymenu = document.getElementById(mID);
		var display = mymenu.style.display;
		close_others(mID);
		mymenu.style.display = (display == "block") ? "none" : "block";
		menu_on_pro(mID);
		gia_fatto=1;
		
	}
	catch(e){
		self.status=e.message;	
	}
}

//window.onload = function() {
//	var uls = document.getElementsByTagName("ul");
//	for (i=0;i<uls.length;i++) {
//		if(uls[i].className=="submenu")uls[i].style.display = "none";
//	}
//}

function close_all() {
	var uls = document.getElementsByTagName("ul");
	for (i=0;i<uls.length;i++) {
		if(uls[i].className=="submenu")uls[i].style.display = "none";
	}
}

function close_others (mID) {
	var uls = document.getElementsByTagName("ul");
//	var uls = document.getElementById("mID").getElementsByTagName("ul");
	for (i=0;i<uls.length;i++) {
		if (! (mID.indexOf(uls[i].getAttribute("id"))>-1)){
			if(uls[i].className=="submenu")uls[i].style.display = "none";
		}
	}
}

function menu_on_pro (theid){
	
	lev=0;

	pos_und=theid.indexOf("_",0);
	
	while(pos_und != -1){
		pos_und=theid.indexOf("_",pos_und+1);
		lev++;
		
		if (pos_und==-1)break;
	}
	if (lev==2) {
		idmenu = theid.substr(3,theid.length);
		idmenu = idmenu.substr(0,idmenu.lastIndexOf("_"));
		item_menu_root=document.getElementById(idmenu);
		item_menu_root.getElementsByTagName("a")[0].className="on1";
//		item_menu_root.getElementsByTagName("a")[1].className="";
	}
	if(gia_fatto)return;
	submenuitem = document.getElementById(theid);
	submenuitem.getElementsByTagName("a")[0].className="on"+lev;
}

// fine funzione menu

function ShowAndHide(div,totdiv) {
//	alert(div + ' ' + totdiv);
	for (var i=1; i<=totdiv; i++) {
		if (document.getElementById('div_'+i)) {
			if (i==div) {
				document.getElementById('div_'+i).style.display='block';
			} else {
				document.getElementById('div_'+i).style.display='none';
			}
		}
	}
}

//mail nospam

function mail_nospam(a,b,c)
{
	ret = '<a href="mai' + 'lto:'
	ret = ret + a + b + c + '@' + 'web' + 'solute.' + 'it">' + a + b + c	+ '@' + 'web' + 'solute.' + 'it' + '</a>';
	document.write (ret);
	return ret;
}

function MostraMappa(act){
	var dis;
	if (act==0) {dis='none';} else {dis='block';}
	//alert(document.getElementById('sotto').style.display)
	//if (dis=='none') {correctPNG}	
	//document.getElementById('body').style.z-index=0;
	//document.getElementById('sotto').style.z-index=1;		
	document.getElementById('sotto').style.display=dis;	
	document.getElementById('sopra').style.display=dis;

}

function MostraMappa2(act){
	var dis;
	if (act==0) {dis='none';} else {dis='block';}
	//alert(document.getElementById('sotto').style.display)
	//document.getElementById('sotto').style.display=dis;	
	document.getElementById('sopra').style.display=dis;

}