// JavaScript Document
menu = new Array();
var homepage = document.getElementsByClassName('item108');											  
var notizie = document.getElementsByClassName('item1');
var rubriche = document.getElementsByClassName('item55');
var annunci = document.getElementsByClassName('item56');
var commercio = document.getElementsByClassName('item57');
var forum = document.getElementsByClassName('item58');
var ilmagazine = document.getElementsByClassName('item59');
var ragazza = document.getElementsByClassName('item99');
var ditutto = document.getElementsByClassName('item113');

menu[0] = homepage[0];
menu[1] = notizie[0];
menu[2] = rubriche[0];
menu[3] = annunci[0];
menu[4] = commercio[0];
menu[5] = forum[0];
menu[6] = ilmagazine[0];
menu[7] = ragazza[0];
menu[8] = ditutto[0];



/*******  ELEMENTI CON SOTTOMENU  ****/
Event.observe(menu[1], 'mouseover', function(){
											   var sottomenu = document.getElementsByClassName('barra-sottomenu');
											   appare(1);
											   
											}); 

Event.observe(menu[2], 'mouseover', function(){
											   var sottomenu = document.getElementsByClassName('barra-sottomenu');
											    appare(2);
											   
											}); 

Event.observe(menu[8], 'mouseover', function(){
											   var sottomenu = document.getElementsByClassName('barra-sottomenu');
											   appare(8);
											   
											}); 

/**************   ELEMENTI SENZA SOTTOMENU *************/

Event.observe(menu[0], 'mouseover', function(){
											   var sottomenu = document.getElementsByClassName('barra-sottomenu');
											   scompare(menu[0]);
											   
											}); 
Event.observe(menu[3], 'mouseover', function(){
											   var sottomenu = document.getElementsByClassName('barra-sottomenu');
											   scompare(menu[3]);
											   
											}); 
Event.observe(menu[4], 'mouseover', function(){
											   var sottomenu = document.getElementsByClassName('barra-sottomenu');
											   scompare(menu[4]);
											   
											}); 
Event.observe(menu[5], 'mouseover', function(){
											   var sottomenu = document.getElementsByClassName('barra-sottomenu');
											   scompare(menu[5]);
											   
											}); 
Event.observe(menu[6], 'mouseover', function(){
											   var sottomenu = document.getElementsByClassName('barra-sottomenu');
											   scompare(menu[6]);
											   
											}); 
Event.observe(menu[7], 'mouseover', function(){
											   var sottomenu = document.getElementsByClassName('barra-sottomenu');
											   scompare(menu[7]);
											   
											}); 


function appare(elem)
{
	 var sottomenu = document.getElementsByClassName('barra-sottomenu');
	 if(!sottomenu[0].visible()) sottomenu[0].appear({ duration: 0.5}) // Effect.SlideDown(sottomenu[0], { duration: 1.5 });
	
	if(elem == 1){
		if($('rubriche').visible())$('rubriche').fade({ duration: 0.5}); 
		if($('ditutto').visible())$('ditutto').fade({ duration: 0.5}); 
		$('notizie').appear({ duration: 0.5});
	 }
	 if(elem == 2){
		if($('notizie').visible())$('notizie').fade({ duration: 0.5}); 
		if($('ditutto').visible())$('ditutto').fade({ duration: 0.5}); 
		$('rubriche').appear({ duration: 0.5});
	 }
	 if(elem == 8){
		if($('rubriche').visible())$('rubriche').fade({ duration: 0.5}); 
		if($('notizie').visible())$('notizie').fade({ duration: 0.5}); 
		$('ditutto').appear({ duration: 0.5});
	 }
	 
}
function scompare(elem)
{
	 var sottomenu = document.getElementsByClassName('barra-sottomenu');
	 
	if(sottomenu[0].visible()) sottomenu[0].style.display="none"; //Effect.SlideUp(sottomenu[0], { duration: 0.5});	
}



