OK ho risolto da solo... grazie cmq...
ora però manca una cosuccia e credo mi potreste dare una mano...
vorrei mettere una funzione a tempo che ritardi la chiusura del sottomenu quando perde il focus...
(e fin qui lo saprei anche fare...)
in realtà però non so come dirgli "aspetta 5 secondi per chiudere, mentre aspetti sti 5 secondi, se il focus ritorna sul menu o sul sottomenu non chiudere più !!! "
Posto qui il codice della pagina e spero in un vostr aiut !!!
codice:
<html>
<head>
<meta http-equiv="Content-Language" content="it">
<LINK href="../Include/CStyle.css" rel="stylesheet" type="text/css">
<title>TITOLO</title>
</head>
<body bgColor="#FFFFFF" topMargin="0" leftMargin="0">
<script language="javascript">
// DEFINISCO I COLORI DELLE CELLE
coloreCellaBase = "#D2D3D5"
coloreCellaOver = "#8AA7B8"
// FUNZIONE PER LA CHIUSURA DEL MENU
function closeAll(){
document.getElementById('MENU_1').style.backgroundColor= coloreCellaBase
document.getElementById('SUBMENU_1').style.display="none"
document.getElementById('MENU_2').style.backgroundColor= coloreCellaBase
document.getElementById('SUBMENU_2').style.display="none"
document.getElementById('MENU_3').style.backgroundColor= coloreCellaBase
document.getElementById('SUBMENU_3').style.display="none"
document.getElementById('MENU_4').style.backgroundColor= coloreCellaBase
document.getElementById('SUBMENU_4').style.display="none"
}
// FUNZIONE PER L'APERTURA DEL MENU E DEL SUO SOTTOMENU
function menuOver(menu, subMenu){
closeAll()
document.getElementById(menu).style.backgroundColor="#8AA7B8"
document.getElementById(subMenu).style.display="block"
}
// FUNZIONE DI CONTROLLO PER VERIFICARE SE CHIUDERE IL MENU E IL SUO SOTTOMENU
function submenuOut(e){
if(!e) e = window.event;
sorgente = (e.target) ? e.target : e.srcElement;
mw3 = (e.relatedTarget && e.target) ? 1 : 0;
daElemento = (mw3) ? ((e.type=="mouseover") ? e.relatedTarget :e.target) : e.fromElement;
aElemento = (mw3) ? ((e.type=="mouseout") ? e.relatedTarget :e.target) : e.toElement;
if((((aElemento)? con_id(aElemento).id : "proprietà non definita"))=="elemento senza ID"){
//setTimeout('closeAll()', 1000)
closeAll()
}
}
// FUNZIONE PER RECUPERARE SE IL FOCUS NON E' PIU' SUL MENU
function con_id(ogg){
while(ogg && !ogg.id)
ogg = (ogg.parentNode) ? ogg.parentNode : ogg.parentElement;
if(!ogg) {ogg=new Object(); ogg.id="elemento senza ID"}
return(ogg)
}
</script>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0">
<tr id="INTESTAZIONE" onmouseout="submenuOut(event)">
<td>
<table cellpadding="0" cellspacing="0" border="0" bgcolor='#D2D3D5' height="12">
<tr>
<td><table cellpadding="0" cellspacing="0" border="0" id ="MENU_1" onMouseOver="menuOver('MENU_1', 'SUBMENU_1')">
<tr>
<td width="5" align="left"></td>
<td width="58" align="left">
<a href="javascript:void(0)" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #005E96; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic';this.style.color='#FFFFFF'"
onMouseOut="this.style.fontStyle='normal';this.style.color='#005E96'">
AZIENDA</a></td>
<td width="5" align="left"></td>
</tr>
</table></td>
<td width="20" align="left"></td>
<td><table cellpadding="0" cellspacing="0" border="0" id ="MENU_2" onMouseOver="menuOver('MENU_2', 'SUBMENU_2')">
<tr>
<td width="5" align="left"></td>
<td id ="MENU_2" width="52">
<a href="javascript:void(0)" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #005E96; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic';this.style.color='#FFFFFF'"
onMouseOut="this.style.fontStyle='normal';this.style.color='#005E96'">
SERVIZI</a></td>
<td width="5" align="left"></td>
</tr>
</table></td>
<td width="20" align="left"></td>
<td><table cellpadding="0" cellspacing="0" border="0" id ="MENU_3" onMouseOver="menuOver('MENU_3', 'SUBMENU_3')">
<tr>
<td width="5" align="left"></td>
<td width="50" align="left">
<a href="javascript:void(0)" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #005E96; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic';this.style.color='#FFFFFF'"
onMouseOut="this.style.fontStyle='normal';this.style.color='#005E96'">
CLIENTI</a></td>
<td width="5" align="left"></td>
</tr>
</table></td>
<td width="20" align="left"></td>
<td><table cellpadding="0" cellspacing="0" border="0" id ="MENU_4" onMouseOver="menuOver('MENU_4', 'SUBMENU_4')">
<tr>
<td width="5" align="left"></td>
<td width="100" align="left">
<a href="javascript:void(0)" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #005E96; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic';this.style.color='#FFFFFF'"
onMouseOut="this.style.fontStyle='normal';this.style.color='#005E96'">
AMMINISTRAZIONE</a></td>
<td width="5" align="left"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr id="SUBMENU_1" style='display : none' onmouseout="submenuOut(event)">
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="12" width="5" bgcolor="#8AA7B8" align="left"></td>
<td height="12" bgcolor="#8AA7B8" valign="middle" align="left" width="75">
<a href="../azienda/missione.asp" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
MISSIONE
</a>
</td>
<td height="12" bgcolor="#8AA7B8" align="left" width="58">
<a href="../azienda/offerta.asp" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
OFFERTA
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr id="SUBMENU_2" style='display : none' onmouseout="submenuOut(event)">
<td>
<table cellpadding="0" cellspacing="0" border="0" >
<tr>
<td height="12" width="88" align="left"></td>
<td height="12" width="5" bgcolor="#8AA7B8" align="left"></td>
<td height="12" bgcolor="#8AA7B8" align="left" width="100" >
<a href="../Servizi/commerciale.asp" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
COMMERCIALE
</a>
</td>
<td height="12" bgcolor="#8AA7B8" align="left" width="90">
<a href="../Servizi/omeopatia.asp" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
RICERCA
</a>
</td>
<td height="12" bgcolor="#8AA7B8" align="left" width="90">
<a href="../Servizi/marketing.asp" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
MARKETING
</a>
</td>
<td height="12" bgcolor="#8AA7B8" align="left" width="80">
<a href="../Servizi/supporto.asp" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
SUPPORTO
</a>
</td>
<td height="12" bgcolor="#8AA7B8" align="left" width="90">
<a href="../Servizi/informatici.asp" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
INFORMATICA
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr id="SUBMENU_3" style='display : none' onmouseout="submenuOut(event)">
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="12" width="170" align="left"></td>
<td height="12" width="5" bgcolor="#8AA7B8" align="left"></td>
<td height="12" bgcolor="#8AA7B8" align="left" width="100">
<a href="../Aggiornamenti/index.asp" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
PRODOTTI
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr id="SUBMENU_4" style='display : none' onmouseout="submenuOut(event)">
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="250" align="left"></td>
<td width="5" bgcolor="#8AA7B8" align="left"></td>
<td bgcolor="#8AA7B8" align="left" width="95">
<a href="#" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
CLIENTI
</a>
</td>
<td bgcolor="#8AA7B8" align="left" width="80">
<a href="#" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
GRUPPI
</a>
</td>
<td bgcolor="#8AA7B8" align="left" width="120">
<a href="#" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
ASSOCIAZIONI
</a>
</td>
<td bgcolor="#8AA7B8" align="left" width="100">
<a href="#" STYLE="font-family : verdana; font-weight:bold; font-size: 10px; color: #FFFFFF; text-decoration: none;"
onMouseOver="this.style.fontStyle='italic'"
onMouseOut="this.style.fontStyle='normal'">
PRODOTTI
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>