/*
 * 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 ecowave() {
	$$('#tool div', '#pag .contLeft .news img').setStyle('behavior', 'url(iepngfix/iepngfix.htc)')
	
	
	// Funione transizioni	
	var tran = Fx.Transitions.linear
	function fx(el, tmp, type, tran) {el.set(type, {duration: tmp, transition: tran})}	

	// Effetti menu Principale	
	var mn = $$('#pag .mn a', '#pag .news .bt a', '#pag .stampa a', '#pag .info 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(mn, 180, 'tween', tran)
			item.addEvents({
				'mouseover': 	function(){ this.tween('opacity', 0.001)},
				'mouseleave': 	function(){ this.tween('opacity', 1) }
			})
		}
	})
	
	//target blank
	var lnk = $$('a.blank')
	//var txt = ''
	
	lnk.addEvent('click', $lambda(false))
	lnk.each(function(item, index){
		//var title = item.getProperty('title')
		//item.setProperty('title', title+' '+txt)
		item.addEvent('click', function(event){
			window.open(this)
		})
	})
	
	
    // Effetti rollover
    var div = $$('.download')
    //div.set('opacity', 0.5)
    fx(div, 280, 'tween', tran)
   
    div.addEvents({
        'mouseover': function(){
            //this.tween('opacity', 1)
        },
        'mouseleave': function(){
           //this.tween('opacity', 0.5)
        },
        'click': function(){
			var tagA = this.getElement('a')
			var lnk = tagA.getProperty('href')
			window.location=lnk
		}

    })
	
}
window.addEvent('domready', ecowave)
