jQuery(document).ready(function($){
	
	$('body').html('<div id="loader"></div>'+$('body').html())
	
	// efx menu
	var mn = $('#tool li a')
	mn.each(function(){
		if(!$(this).hasClass('active')){
			$(this).hover(
				function(){
					$(this).stop().animate({'color':'#ffffff'},400)
				},
				function(){
					$(this).stop().animate({'color':'#010000'},400)
				}
			)
		}
	})
	
	$('#page.home .opacity a,#elenco-news a').each(function(){
		$(this).hover(function(){
			$(this).stop().animate({'color':'#dc0033'})
		},function(){
			$(this).stop().animate({'color':'#ffffff'})
		})
	})

	/*
	$('#creative a').each(function(){
		$(this).hover(function(){
			$(this).stop().animate({'color':'#dc0033'})
		},function(){
			$(this).stop().animate({'color':'#646161'})
		})
	})
	*/
	$('#bt-cliente').hide()
	$('#viewer.home_lavori .scroll a').each(function(){
		//var deactive = $(this).find('img').attr('src')
		//var active = $(this).attr('rel')
		if(!$(this).hasClass('selected')) { 
			$(this).hover(function(){
				$('#bt-cliente').show()
				x = $(this).offset();
				x = x.left
				v = $('#viewer .scroll').offset()
				v = v.left
				of_left = x - v + 40 
				//$(this).find('img').attr('src',active)
				$('#bt-cliente').html($(this).find('img').attr('alt')).stop().animate({'left':of_left+'px'},200)
			},function(){
				//$(this).find('img').attr('src',deactive)
				$('#bt-cliente').hide()
			})
		}
	})

})
jQuery(window).load(function(){
	$('#loader').fadeOut()
})
