var tc; var sc; var c=0 var t var lastobj; $(document).ready(function(){ $("#risultati").hide(); $("#tab-classifica").html("\"\""); $("#tab-risultati").html("\"\""); $("#tab-classifica").click(function () { $("#tab-classifica").html("\"\""); $("#tab-risultati").html("\"\""); $("#risultati").hide(); $("#classifica").fadeIn("slow"); return false; }); $("#tab-risultati").click(function () { $("#tab-risultati").html("\"\""); $("#tab-classifica").html("\"\""); $("#classifica").hide(); $("#risultati").fadeIn("slow"); return false; }); tc = function timedCount() { c=c+1; if (c == 6) { c=1; } shownews("news-"+c); t=setTimeout("tc()",5000); } sc = function stopCount() { clearTimeout(t); } $(function() { tc(); }); $(function() { $(".anyClass").jCarouselLite({ btnNext: ".next", btnPrev: ".prev", scroll: 3, visible: 4, auto: 3500, speed: 1500 }); }); $("#lista-news > li").hover( function () { sc(); $("#"+lastobj+" > a").removeClass("lian"); t=setTimeout("tc()",15000); var figlio = this.id; shownews(figlio); }); function shownews(objid) { $.ajax({ url: "ns.php", data: "name=" + objid + "", success: function(msg){ $("#"+lastobj+" > a").removeClass("lian"); lastobj = objid; $("#"+objid+" > a").addClass("lian"); $("#news").html(msg); } }); } });