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

	myVerticalSlide.hide();
	
	var status = {
		'true': 'open',
		'false': 'close'
	};
	
	var step=0;
	
	//apri/chiudi alternatamente con un click
	$('v_slideout').addEvent('click', function(e){
		e.stop();
		
		$('vertical_slide').setStyle('display','block');
		
		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');
	});	
	
	//cambia flag lingua
	/*$$('div.flag a').addEvent('mouseover', function(e){
		e.stop();
		this.getParent().setProperty('class','flag_act');
	});
	
	$$('div.flag a').addEvent('mouseout', function(e){
		e.stop();
		this.getParent().setProperty('class','flag');
	});*/
	
});

//fai lampeggiare 'prenota'
/*window.addEvent('load', function(){
	
var prenota=$('prenota').getChildren();
function blink(element)
	{
	if(prenota.getStyle('color') == '#5685b1')
		{
		 prenota.setStyle('color', '#ff6600');
		 prenota.setStyle('font-weight','bold');
		 }
	else 
		{
		prenota.setStyle('color', '#5685b1');
		prenota.setStyle('font-weight','normal');
		}
	}
var blinker = blink.periodical(500, null, prenota); 
});*/