/*var hInputValues = $H({
	sword: 'Cerca'
});*///Ora viene generato in Typo3 con un valore diverso in base alla lingua dell'utente

document.observe("dom:loaded" , function() {
	var level1Links = $$('#navcontainer li .level1');
	//alert(level1Links);
	
	level1Links.each(function(element) {
		element.observe('click', function(event){
			new menuAccordion(element);
		});
	});
});

/*Event.observe(window, 'load' , function() {	

});*/

var menuAccordion = function(element) {	
	hideElements = $$('#navcontainer li ul.active');
	hideElements.each (function(activeElement){
		new Effect.BlindUp(activeElement, { duration:0.7 } );
		activeElement.removeClassName('active')
	});
	
	showElement = element.next('ul.subnavlist');
	if (!showElement.visible()) {
		new Effect.BlindDown(showElement, { duration:0.7 } );
		showElement.addClassName('active')
	}
}

var toTop = function() {
	new Effect.ScrollTo($('wrapper'));
}

/*var myrules = {
	'#sword' : function(el){
		el.onblur = function(){	blurTextboxes( this, hInputValues.get('sword') ); },
		el.onfocus = function(){ focusTextboxes( this, hInputValues.get('sword') ); }
	},
	'#littlesearch_submit' : function(el){
		el.onclick = function() {
			//alert($F('sword'));
			//alert(hInputValues.get('sword'));
			if($F('sword') == hInputValues.get('sword')) {
				$('sword').value = '';
			}
			//alert($F('sword'));
		}
	},
	'#itinerary-gallery' : function(el){
		el.onclick = function() { new Effect.ScrollTo($('flickr_gallery'), { offset: -15 }); return false; }
	},
	'#partenze_next' : function(el){
		el.onclick = function() { moveMenuPartenze('up'); }
	},
	'#partenze_prev' : function(el){
		el.onclick = function() { moveMenuPartenze('down'); }
	}
};
	
Behaviour.register(myrules);*/