﻿window.addEvent('domready', function() {
	var myVerticalSlide = new Fx.Slide('vertical_slide');
	var mySlideout = $('v_slideout');
	var tasto = mySlideout.getParent();

	$('vertical_slide').setStyle('display','block');
	tasto.setProperty('class','tasto_2_open');
	
	var step=1;
	
	//apri/chiudi alternatamente con un click
	$('v_slideout').addEvent('click', function(e){
		e.stop();
		
		if(step==1)
			{
			tasto.setProperty('class','tasto_2');
			myVerticalSlide.slideOut();
			step=0;
			}
		else if(step==0)
			{
			tasto.setProperty('class','tasto_2_open');
			myVerticalSlide.slideIn();
			step=1;
			}
	});
	
	//cambia tasto
	$$('div.tasto_mar a').addEvent('mouseover', function(e){
		e.stop();
		this.getParent().setProperty('class','tasto_mar_act');
	});
	
	$$('div.tasto_mar a').addEvent('mouseout', function(e){
		e.stop();
		this.getParent().setProperty('class','tasto_mar');
	});
	
	$$('div.tasto a').addEvent('mouseover', function(e){
		e.stop();
		this.getParent().setProperty('class','tasto_act');
	});
	
	$$('div.tasto a').addEvent('mouseout', function(e){
		e.stop();
		this.getParent().setProperty('class','tasto');
	});	
	

});

