$.ajaxSetup ({
    // Disable caching of AJAX responses
    cache: false
});

$(document).ready(function(){ // cuando el documento se carga realiza lo de adentro


$("#ruleta img").click(function() {
    //alert(this.src);
    $(this).attr('src', 'images/reviews16/5-7b.jpg');
});

$("#commentreload span").click(function(){
    postLoad();
});

// Lupitad de más opciones
   $("a.encuestamas").click(function(){
  
    $("div.encuestaresultadoactual").toggle();
   
   });

// *****************************************************************************
// Favorito
    $("a.botonfavorito").click(function(){
    // seguir
    
    the_id = $(this).attr('id');
    //$("span#seguimiento"+the_id).fadeOut();
      $.ajax({
       type: "POST",
       data: "accion=favorito&id_noticia="+$(this).attr("id"),
       url: "include/ajax/favorito.php",
       success: function(msg)
       {
           if (msg == 1)
               {
                   $("img#fav"+the_id).attr('src', 'images/iconos/fav.png');
               }
               else
               {
                    $("img#fav"+the_id).attr('src', 'images/iconos/nofav.png');
               }
       }
      });

 });



if ($('div.listamenucomentario').click  == 0) {postLoad(); }

if ($('div.listamenucomentario').length  == 0) {postLoad(); }

 $("#abrirsugerencia").click(function () {
    $("#sugerencia").show("slow");
    });



// carga el resto del post
$("a.vermas").click(function(){

    the_id = $(this).attr('id');
     /*$('div#post'+the_id).fadeOut();*/
    var funcion = "post";

          $.post("include/ajax/menu-callfunction.php", { "funcion":funcion , "aa": the_id}, function(data){
             $('div#post'+the_id).html(data);
              //$('#bloqueads').html(data);

          });

}); 

});
function postLoad()
{
	  var funcion = "menu_comentarios";
          var funcionads = "bloqueads";
	  var imagencarga = '<div align="center"><img src="images/iconos/ajax-loader.gif"></div>'; // imagen del cargador
	  
	  $('#comentariosrecientes').html($(imagencarga)); // cargo la imagen
	  
	  $.post("include/ajax/menu-callfunction.php", { "funcion":funcion}, function(data){$('#comentariosrecientes').html(data);});
          
         /* $.post("include/ajax/menu-callfunction.php", { "funcion":funcionads}, function(data){
             $('#bloqueads').html(data);
              //$('#bloqueads').html(data);
          });*/


}




