$(function() {
	$("a#mariana").mouseover(function(){
		$(this).animate({left:0},{duration:700,queue:false});
	}).mouseleave(function () {
		$(this).animate({left:-351},{duration:700,queue:false});
	});
	
	
	
	$(".acerca").click(function () {
		$("#content_herramientas").animate({height:260},700);
		
		$("#categorias").hide();
		$("#feedburner_form").hide();
		
		$(this).fadeTo(200,0.0, function(){
			$(this).hide();
		});;
		$(".inicio").fadeTo(200,0.0, function(){
			$(this).hide();
		});
		
		$("#redes").fadeTo(200,0.0, function(){
			$(this).hide();
		});
		
		$(".categorias").fadeTo(200,0.0, function(){
			$(this).hide();
		});
		$("iframe").fadeTo(200,0.0, function(){
			$(this).hide();
		});
		
		$("#searchform").fadeTo(200,0.0, function(){
			$(this).hide();
		});
		$("#info").fadeTo(200,1.0, function(){
			$(this).show();
		});
		
		
	});
	
	$(".subir").click(function () {
		$("#content_herramientas").animate({height:47},700);
		$(".acerca").fadeTo(200,1.0, function(){
			$(this).show();
		});;
		$(".inicio").fadeTo(200,1.0, function(){
			$(this).show();
		});
		
		$(".categorias").fadeTo(200,1.0, function(){
			$(this).show();
		});
		
		$("#redes").fadeTo(200,1.0, function(){
			$(this).show();
		});
		
		$("iframe").fadeTo(200,1.0, function(){
			$(this).show();
		});
		
		$("#searchform").fadeTo(200,1.0, function(){
			$(this).show();
		});
		
		$("#info").fadeTo(200,0.0, function(){
			$(this).hide();
		});
	});
	
	$(".categorias").click(function () {
		$("#categorias").slideToggle("fast");
		$("#feedburner_form").hide();
		 return false;
	});
	
	$(".feedburner").click(function () {
		$("#feedburner_form").slideToggle("fast");
		$("#categorias").hide();
		 return false;
	});
	
	
	$('input#busqueda, input#text_feedburner').each(function(){
				   // tomamos el valor actual del input
				   var currentValue = $(this).val();
				   // en el focus() comparamos si es el mismo por defecto, y si es asi lo vaciamos
				   $(this).focus(function(){
					  if( $(this).val() == currentValue ) {
						 $(this).val('');
					  };
				   });
				   // en el blur, si el usuario dejo el value vacio, lo volvemos a restablecer
				   $(this).blur(function(){
					  if( $(this).val() == '' ) {
						 $(this).val(currentValue);
					  };
			   });
			  

		});
});

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;



