/*
 * fattorelli 1.0 - mootools 1.2
 * By Mario Zambon (http://www.urbangap.com)
 * Copyright (c) 2008 cody urbangap
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/

function fattorelli() {

	// Funione transizioni
	function fx(el, tmp, type, transition) {el.set(type, {duration: tmp, transition: transition})}	

	// Effetti menù Principale
	var mn = $$('.mn a')
	mn.removeProperty('title')
	mn.each(function(item, index){
		var i = index
		if (i==mnActive) {
			item.addClass('active')
			item.addEvent('click', $lambda(false))
		} else {
			fx(item, 220, 'tween', Fx.Transitions.linear)
			item.addEvents({
				'mouseover': 	function(){ this.tween('opacity', 0.1) },
				'mouseleave': 	function(){ this.tween('opacity', 1) }
			})
		}
	})
	
	var loghi = $$('.loghiTh a')
	fx(loghi, 350, 'morph', Fx.Transitions.linear)
	loghi.addEvents({
		'mouseover': 	function(){ this.morph('.loghiOver')  },
		'mouseleave': 	function(){ this.morph('.loghiOut') }
	})
	

}

window.addEvent('domready', fattorelli)

