// noticias.js
(function($){$(function(){
$('.noticia').each(function(){
	var $t = $(this);
	var p = $t.position();
	var no = {top:p.top,left:p.left,width:$t.width(),height:$t.height()};
	var si = {top:5,left:5,width:770,height:340}
	$t.data('no', no).data('si', si);
});
$('.noticia-zoom').hover(
	function() {$(this).addClass('over');},
	function() {$(this).removeClass('over');}
).click(function(evt) {
	evt.preventDefault();
	var $t = $(this);
	$t.add($t.siblings()).toggleClass('invisible');
	(function(elm, z) {
		var spd = 1000;
		// siblings
		if (z) { $.fx.off = true; elm.siblings().hide(); $.fx.off = false; }
		// picture
		(z? $.fn.fadeIn: $.fn.fadeOut).call($('.noticia-imagen', elm), spd/2);
		// text
		$('.noticia-content', elm).animate({height: z ? 305: 70}, spd);
		$(elm).animate( elm.data(z?'si':'no'), spd, 'swing', function() {
			if (!z) { $.fx.off = true; elm.siblings().show(); $.fx.off = false; }	
		});
	})($t.parents('.noticia'), $t.is('.zoom'));
	return false;
});
});})(jQuery);

