Menu_Home = Class.create();
Menu_Home.prototype = {
	
	/*Costruttore*/
	initialize: function(idMenu){
		this.idMenu = idMenu;
		this.defaultBgColor = $(this.idMenu).down('div').style.backgroundColor;
		this.activeBgColor = '#dedede';
		this.menuEffect = null;
	},
	
	/*Animazione up*/
	show: function(){
		if(this.menuEffect != null){
			this.menuEffect.cancel();
		}
		
		$(this.idMenu).down('div').style.backgroundColor = this.activeBgColor;
		$(this.idMenu).parentNode.style.zIndex = '999998';
		
		this.menuEffect = new Effect.Morph(this.idMenu, {
			style: {
				marginTop: '0px'
			},
			duration: 1.5
		})
	},
	
	/*Elimina eventuali animazioni attive e nasconde il menu*/
	hide: function(){
		if(this.menuEffect != null){
			this.menuEffect.cancel();
		}
		
		$(this.idMenu).down('div').style.backgroundColor = this.defaultBgColor;
		$(this.idMenu).parentNode.style.zIndex = '';
		
		$(this.idMenu).style.marginTop = $(this.idMenu).getHeight() - $(this.idMenu).down('div').getHeight() + 'px';
		
	}
	
};

Menu_Marchi = Class.create();
Menu_Marchi.prototype = {
	
	/*Costruttore*/
	initialize: function(idMenu, srcImage){
		this.idMenu = idMenu;
		this.menuEffect = null;
		this.originalMainvoice = null;
		this.image = null;
		if(srcImage){
			this.image = new Image();
			this.image.src = srcImage;
		}
	},
	
	/*Animazione up*/
	show: function(){
		if(this.menuEffect != null){
			this.menuEffect.cancel();
		}
		
		$('otmenuMarchiWrapper').style.zIndex = '999998';
		$(this.idMenu).parentNode.style.zIndex = '999998';
		
		if(this.image != null){
			this.rolloverImage();
		}
		
		this.menuEffect = new Effect.Morph(this.idMenu, {
			style: {
				marginTop:  "0px"
			},
			duration: 1.5
		})
	},
	
	/*Elimina eventuali animazioni attive e nasconde il menu*/
	hide: function(){
		if(this.menuEffect != null){
			this.menuEffect.cancel();
		}
		
		$('otmenuMarchiWrapper').style.zIndex = '';
		$(this.idMenu).parentNode.style.zIndex = '';
		
		if(this.image != null){
			this.rolloverText();
		}
		
		$(this.idMenu).style.marginTop = $(this.idMenu).getHeight() + 'px';
		
	},
	
	rolloverImage: function(){
		if($(this.idMenu).parentNode.parentNode.down('a').down('img') == undefined){
			var mainVoiceElement = $(this.idMenu).parentNode.parentNode.down('a');
			this.originalMainvoice = mainVoiceElement.innerHTML.strip();
			mainVoiceElement.innerHTML = '';
			mainVoiceElement.appendChild(this.image);
		}
	},
	
	rolloverText: function(){
		if(this.originalMainvoice != null){
			var mainVoiceElement = $(this.idMenu).parentNode.parentNode.down('a');
			/*this.originalMainvoice = mainVoiceElement.innerHTML.strip();*/
			mainVoiceElement.innerHTML = this.originalMainvoice;
			/*mainVoiceElement.appendChild(this.image);*/
		}
	}
	
}

Menu_Garden = Class.create();
Menu_Garden.prototype = {
	
	/*Costruttore*/
	initialize: function(idMenu){
		this.idMenu = idMenu;
		this.menuEffect = null;
	},
	
	show: function(){
		if(this.menuEffect != null){
			this.menuEffect.cancel();
		}
		
		$('otmenuBottom').style.zIndex = '999998';
		
		this.menuEffect = new Effect.Morph($(this.idMenu).down('div'), {
			style: {
				marginTop:  "0px"
			},
			duration: 1.5
		})
	},
	
	hide: function(){
		if(this.menuEffect != null){
			this.menuEffect.cancel();
		}
		
		$('otmenuBottom').style.zIndex = '';
		
		$(this.idMenu).down('div').style.marginTop = $(this.idMenu).getHeight() + 'px';
	}
}