		window.addEvent('domready', function(){

            // S L I D E

			var mySlide = new Fx.Slide('dx', {mode: 'horizontalRight'});

			$('slidein').addEvent('click', function(e){
				e = new Event(e);
				mySlide.slideIn();
				e.stop();
                //$('restore').setStyle('display', 'none');
                //document.getElementById("restore").style.display='none';
                document.getElementById("restore").style.visibility='hidden';
                $('NewsVertical').setStyle('display', 'block');
			});

			$('slideout').addEvent('click', function(e){
				e = new Event(e);
				mySlide.slideOut();
				e.stop();
                //$('restore').setStyle('display', 'inline');
                //document.getElementById("restore").style.display='inline';
				document.getElementById("restore").style.visibility='visible';
                $('NewsVertical').setStyle('display', 'none');
			});

            // T I C K E R

			var Ticker = new Class({
				setOptions: function(options) {
					this.options = Object.extend({
						speed: 1000,
						delay: 5000,
						direction: 'vertical',
						onComplete: Class.empty,
						onStart: Class.empty
					}, options || {});
				},
				initialize: function(el,options){
					this.setOptions(options);
					this.el = $(el);
					this.items = this.el.getElements('li');
					var w = 0;
					var h = 0;
					if(this.options.direction.toLowerCase()=='horizontal') {
						h = this.el.getSize().size.y;
						this.items.each(function(li,index) {
							w += li.getSize().size.x;
						});
					} else {
						w = this.el.getSize().size.x;
						this.items.each(function(li,index) {
							h += li.getSize().size.y;
						});
					}
					this.el.setStyles({
						position: 'absolute',
						top: 0,
						left: 0,
						width: w,
						height: h
					});
					this.fx = new Fx.Styles(this.el,{duration:this.options.speed,onComplete:function() {
						var i = (this.current==0)?this.items.length:this.current;
						this.items[i-1].injectInside(this.el);
						this.el.setStyles({
							left:0,
							top:0
						});
					}.bind(this)});
					this.current = 0;
					this.next();
				},
				next: function() {
					this.current++;
					if (this.current >= this.items.length) this.current = 0;
					var pos = this.items[this.current];
					this.fx.start({
						top: -pos.offsetTop,
						left: -pos.offsetLeft
					});
					this.next.bind(this).delay(this.options.delay+this.options.speed);
				}
			});

			var vert = new Ticker('TickerVertical',{speed:1000,delay:2000,direction:'vertical'});

            // M E N U S X

			var stretchers = $$('div.accordion');
			var togglers = $$('h3.toggler');

			stretchers.setStyles({'height': '0', 'overflow': 'hidden'});

			//window.addEvent('load', function(){

			//initialization of togglers effects

			togglers.each(function(toggler, i){
				toggler.color = toggler.getStyle('background-color');
				toggler.$tmp.first = toggler.getFirst();
				toggler.$tmp.fx = new Fx.Style(toggler, 'background-color', {'wait': false, 'transition': Fx.Transitions.Quart.easeOut});
			});

			//the accordion

			var myAccordion = new Fx.Accordion(togglers, stretchers, {

				 'opacity': false,

				// 'start': false,

    	        // 'alwaysHide': true, // ## se decommento questa riga è possibile chiudere ed aprire un indice MA non è possibile gestire il #id

				// 'start': all-closed,

				'transition': Fx.Transitions.Quad.easeOut,

				onActive: function(toggler){
					toggler.$tmp.fx.start('#e6e6e6');
					toggler.$tmp.first.setStyle('color', '#000066');
					toggler.$tmp.first.setStyle('background', 'url(images/layout/sfondo_menu_active.gif) no-repeat right');
				},

				onBackground: function(toggler){
					toggler.$tmp.fx.stop();
            	    toggler.$tmp.first.setStyle('background', 'none');
                	//toggler.$tmp.first.setStyle('background', toggle.background);
					toggler.setStyle('background-color', toggler.color).$tmp.first.setStyle('color', '#8a9eac');
				}

			});

			//open the accordion section relative to the url

			//var found = null; // portata nel constructor per la gestione dinamica
			$$('h3.toggler a').each(function(link, i){
				if (window.location.hash.test(link.hash)) found = i;
			});
            myAccordion.display(found);



	  });  // close > window.addEvent('domready', function(){