  $j = jQuery.noConflict();

	$j(document).ready(function(){
  	$j(".trigger img[title], .lastcomments a").tooltip({
  	position: "top center",
  	offset: [-1, 2],
  	effect: 'fade',
  	delay: 30,
  	tip:'#tooltip'});

	$j('#mainmenu a')
		.css( {backgroundPosition: "-30px 45px"} )
		.mouseover(function(){
			$j(this).stop().animate({backgroundPosition:"(-30px 300px)"}, {duration:500})
		})
		.mouseout(function(){
			$j(this).stop().animate({backgroundPosition:"(-30px 45px)"}, {duration:500})
	})
	
	$j('.columnsfooter ul li, .mostcomment ul li').mouseover(function(){
      //On mouseenter
			$j(this).stop().animate({ 'backgroundColor':'#fff280 ' }, "fast"); //Reveal color image
			//$(this).stop().animate({'opacity':1}, 'fast'); //set opacity to 1
			//on mouseleave
    }).mouseout(function(){
      $j(this).stop().animate({ 'backgroundColor':'#FFE400' }, "slow"); //set back initial background-position for grayscale image 
			//$(this).stop().animate({'opacity':0.5}, 'fast'); //set back initial opacity
  });  
  $j('#sidebar ul li').mouseover(function(){
      //On mouseenter
			$j(this).stop().animate({ 'backgroundColor':'#333333 ' }, "fast"); //Reveal color image
			//$(this).stop().animate({'opacity':1}, 'fast'); //set opacity to 1
			//on mouseleave
    }).mouseout(function(){
      $j(this).stop().animate({ 'backgroundColor':'#000000' }, "slow"); //set back initial background-position for grayscale image 
			//$(this).stop().animate({'opacity':0.5}, 'fast'); //set back initial opacity
  });
	
  //sostituisce la dichiarazione di opacity nel css
  //se c'e' nella pagina questo elemento
  if ( $j('.banner .caption').length > 0 ) {
    $j('.banner .caption').css('opacity',0.8);  
  }  
  //se c'e' nella pagina questo elemento
  if ( $j('.sociable-hovers').length > 0 ){ 
    $j('.sociable-hovers').css('opacity',0.4);      
    $j('.sociable-hovers').hover(function() {
		  //mouse over
  		$j(this).stop().animate({ 'opacity':1 }, "fast");
  	},
  	function() {
  		//mouse out
      $j(this).stop().animate({ 'opacity':0.4 }, "fast");
  	});
  }
  


	//zoom percentage, 1.2 =120%
	var zoom = 1.1;
	moveh = ($j('.banner').width()-($j('.banner').width() * zoom))/2;
	movev = ($j('.banner').height()-($j('.banner').height() * zoom))/2;
	//move the image in pixel
	var move = -12;
	//On mouse over those thumbnail
	$j('.banner').hover(function() {
		//Set the width and height according to the zoom percentage
		width = $j('.banner').width() * zoom;
		height = $j('.banner').height() * zoom;
		//Move and zoom the image
		$j(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':movev, 'left':moveh}, {duration:200});
		//Display the caption
		$j(this).find('div.caption').stop(false,true).fadeIn(200);
	},
	function() {
		//Reset the image
		$j(this).find('img').stop(false,true).animate({'width':$j('.banner').width(), 'height':$j('.banner').height(), 'top':'0', 'left':'0'}, {duration:100});	
		//Hide the caption
		$j(this).find('div.caption').stop(false,true).fadeOut(200);
	});
});



