/*
 * 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 marchio() {
	
	// Funione transizioni
	function fx(el, tmp, type) {el.set(type, {duration: tmp, transition: Fx.Transitions.linear})}	

	// Effetti menù Principale TOP
	var mn = $$('#mn-it a', '#mn-en a')
	mn.removeProperty('title')
	mn.each(function(item, index){
		var i = index
		if (i==mnActive) {
			//alert(item)
			item.addClass('active')
			item.addEvent('click', $lambda(false))
		} else {
			fx(item, 200, 'tween')
			item.addEvents({
				'mouseover': 	function(){ this.tween('opacity', 0.1) },
				'mouseleave': 	function(){ this.tween('opacity', 1) }
			})
		}
	})
	
	// Effetti menù lingue TOP
	var mnLang = $$('#mnLang a')
	mnLang.removeProperty('title')
	mnLang.each(function(item, index){
		fx(item, 200, 'tween')
		item.addEvents({
			'mouseover': 	function(){ this.tween('opacity', 0.1) },
			'mouseleave': 	function(){ this.tween('opacity', 1) }
		})
		if (mnLangActive=='it') {
			mnLang[1].addClass('active')
			mnLang[1].addEvent('click', $lambda(false))
		} else {
			mnLang[0].addClass('active')
			mnLang[0].addEvent('click', $lambda(false))
		}
	})
	
	// Effetti menù principale e menù lingue FOOT
	/*var mnFoot = $$('#foot a')
	var mnLang = $$('#foot .lang a')
	mnFoot.removeProperty('title')
	mnFoot.each(function(item, index){
		fx(item, 250, 'morph')
		item.addEvents({
			'mouseover': 	function(){ this.morph('.mnFootIn') },
			'mouseleave': 	function(){ this.morph('.mnFootOut') }
		})
		if (index==mnActive) {
			item.addClass('active')
			item.addEvent('click', $lambda(false))
		}
	})
	if (mnLangActive=='it') {
		mnLang[1].addClass('active')
		mnLang[1].addEvent('click', $lambda(false))
	} 
	if (mnLangActive=='en') {
		mnLang[0].addClass('active')
		mnLang[0].addEvent('click', $lambda(false))
	}*/

	

	// Effetti MARCHI ed effetti ELEMENTI
	var mn = $$('#brands a', '#elementi li')
	//mn.removeProperty('title')
	mn.each(function(item, index){
		fx(item, 380, 'tween')
		item.addEvents({
			'mouseover': 	function(){ this.tween('opacity', 0.1) },
			'mouseleave': 	function(){ this.tween('opacity', 1) }
		})
	})
	
	// Effetti pulsanti form
	var form = $$('#log .bt')
	fx(form, 300, 'tween')
	form.set('opacity', 0.5)
	form.addEvents({
		'mouseover': 	function(){ this.tween('opacity', 1) },
		'mouseleave': 	function(){ this.tween('opacity', 0.5) }
	})
	

}
window.addEvent('domready', marchio)

