limit = 300;
$(function(){
    $('.clista').click(function(e){
	if(!$(e.target).attr('href')){
	    window.location=$(this).find('a').eq(0).attr('href');
	    return false;
	}
    });
  $('textarea[name="leiras"], body.ir textarea, body.kartyaigenylo textarea').each(function(){
   $(this).parent().append('<br><input class="bevitel" value="' + Math.max(0,limit-$(this).val().length) + '" />');
   
   $(this).keyup(function(){
    $(this).parent().find('input').val(Math.max(0, limit - this.value.length));
//    if(this.value.length > limit)    this.value= this.value.substr(0,limit);    
    }).keydown(function(e){
     return e.keyCode == 8
         || e.keyCode == 46
         || this.value.length <= limit;
    });
  });
  if(!$.browser.msie||parseInt($.browser.version)>=8)
    $('.gorgeto').jScrollPane({scrollbarWidth: 8});
 
    $('#folista table tr').click(function(){
     if($(this).find('a').length)
      window.location = $(this).find('a').eq(0).attr('href');
     else
      window.location = $(this).prev().find('a').eq(0).attr('href');      
     return false; 
    });
    
    window.setInterval(function(){
     var ido = (new Date()).toLocaleString()
     $('#ido').text(ido.substring(0,ido.length-0));
    }, 1000);
    
    $('#fizetett').load('/fizetett.php');
    
/*    
 $('body.felhasznalok form input, body.felhasznalok form textarea, body.felhasznalok form select').change(function(){
   window.onbeforeunload = function(e){
     if(!e && window.event)
       e = window.event;
     else
       e = {};
     
     return e.returnValue = "Biztos elhagyod az oldalt?";
   };
 });
 
 $('body.felhasznalok form').bind('submit', function(){
   window.onbeforeunload = function(){};
   
   return(true);
 });
    */                               
});


