$(document).ready(function() 
{ 
	$('#preguntas li').click(function(){
		var id = $(this).attr("id").substr(2,4);
		$.ajax({
		  url: "respuestas.php",
		  cache: true,
		  data: "id="+id,
		  success: function(html){
			$("#respuesta").hide();
			$("#respuesta").html(html);
			$(".arriba").show();
			if(id=="19"){
				$("#respuesta").attr("style", "background:url(../images/bgAcidoUrico.gif) repeat-x top; ");
			}else{
				$("#respuesta").attr("style", "background:url(../images/bgPregunta.gif) repeat-x top; ");				
			}
		    $('html, body').animate({scrollTop: 780}, 400, "linear", function(){
				$("#respuesta").slideDown("normal");
			});
			
		  }
		});
	});

	$('#preguntas li:not(.none)').hover(function(){
		$(this).attr("style", "background:url(../images/bgFaq2.gif) repeat-y left; cursor:hand;");
	}, function(){
		$(this).attr("style", "background-image:none;");		
	});
	
	$(".arriba").click(function(){
		$(".arriba").hide();
		$("#respuesta").slideUp("slow",function(){
			 $('html, body').animate({scrollTop: 25}, 400);
			 return true;
		});
		return false;
	});
	
}); 


