var timerchat=0;
function abajo(arg) { $(arg).hide().fadeIn('slow'); }
function v(vid) {
   $.ajax({ type: "GET", url:  "index.php", data: "v="+vid, cache: true,   
   success: function(h) { $("#videom").html(h); abajo("#videom"); } });
   return false;
}
function au(ta,fa) {
   $.ajax({ type: "GET", url:  "index.php", data: "ta="+ta+"&fa="+fa, cache: true,
   success: function(h) { $("#aplayer").html(h); abajo("#aplayer"); } });
   return false;
}
function echat(t) {
   clearTimeout(timerchat);
   $.ajax({ type: 'POST', url: 'index.php', data: 'nick='+$("#me").val()+'&chat='+$("#etext").val(),cache:false,
      success: function(h) {
         $("#chat").html(h);
         if(t === true) { 
            $("#etext").val(''); 
            $("#etext").focus();
         }
         timerchat = setTimeout("echat()",23000);
      }
   });
   return false;
}
$(document).ready(function(){
   $("li.notaslist").click(function () {
      $.ajax({ type:"POST",url:"index.php",data:'p='+$(this).attr('id'),cache:true, 
      success: function(h) { 
         $("#xx").html(h);          
      } });
   });
   $("li.notaslist").hover(
      function () {
         $(this).css({'background-color':'#444'});
      }, 
      function () {
         if($(this).attr('id') !== $("#last").text()) {
            $(this).css({'background-color':'#333'});
         }
      }
   );   
   timerchat = setTimeout("echat()",1000);
});

