jQuery(function ($) {
	$.fn.opacity = function(_value) { 
			return $(this).css('opacity',_value);
		};
		$('.wrapper .titulo-h').opacity(0);
		$('.thumb-big-wrap .a-hover').opacity(0);
		$('.ppost .post-content').opacity(0);
	//move the image in pixel
	var move = -15;	
	//zoom percentage, 1.2 =120%
	var zoom = 1.2;
	//On mouse over those thumbnail
	$('.wrapper').hover(function() {	
		//Set the width and height according to the zoom percentage
		width = $('.wrapper').width() * zoom;
		height = $('.wrapper').height() * zoom;
		
		//Move and zoom the image
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:500});
		
		//Display the caption
		$(this).find('.titulo-h').animate({'opacity':'.9'},{queue:false,duration:500});
	},
	function() {
		//Reset the image
		$(this).find('img').stop(false,true).animate({'width':$('.wrapper').width(), 'height':$('.wrapper').height(), 'top':'0', 'left':'0'}, {duration:500});	

		//Hide the caption
		$(this).find('.titulo-h').animate({'opacity':'0'},{queue:false,duration:500});
	});
	
	//aqui empieza el otro zoom

	$('.thumb-big-wrap').hover(function() {	
		//Set the width and height according to the zoom percentage
		width = $('.thumb-big-wrap').width() * zoom;
		height = $('.thumb-big-wrap').height() * zoom;
		
		//Move and zoom the image
		$(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:500});
		
		//Display the caption
		$(this).find('.a-hover').animate({'opacity':'.9'},{queue:false,duration:500});
	},
	function() {
		//Reset the image
		$(this).find('img').stop(false,true).animate({'width':$('.thumb-big-wrap').width(), 'height':$('.thumb-big-wrap').height(), 'top':'0', 'left':'0'}, {duration:500});	

		//Hide the caption
		$(this).find('.a-hover').animate({'opacity':'0'},{queue:false,duration:500});
	});
/*@menu*/

	$("ul#menu-general li").prepend("<span></span>"); //Throws an empty span tag right before the a tag

	$("ul#menu-general li").each(function() { //For each list item...
		var linkText = $(this).find("a").html(); //Find the text inside of the <a> tag
		$(this).find("span").show().html(linkText); //Add the text in the <span> tag
	}); 

	$("ul#menu-general li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({
			marginTop: "-30px" //Find the <span> tag and move it up 40 pixels
		}, 200);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0"  //Move the <span> back to its original state (0px)
		}, 200);
	});	
	$('.ppost').hover(function() {	
		$(this).find('.post-content').animate({'opacity':'.9'},{queue:false,duration:500});
	},
	function() {
		$(this).find('.post-content').animate({'opacity':'0'},{queue:false,duration:500});
	});
	
$("#relacionados a img[title]").tooltip({

   // tweak the position
   offset: [40, 2],

   // use the "slide" effect
   effect: 'slide'

// add dynamic plugin with optional configuration for bottom edge
}).dynamic({ bottom: { direction: 'down', bounce: true } });
$("#tabs-noticias ul").idTabs({start:0,change:true}); 
});