$(document).ready(function(){
 $('#tartalom a[href^=http://]:not([href^=http://pulzar.]):not([href^=http://www.pulzar.])').addClass('kulso');
 $('a.kulso').attr('target', '_blank');
 
 try{
  if($.browser.msie && $.browser.version <= 6)
   $('.pngfix').pngFix();
 }catch(e){}
 
 $('#menu a.disabled').click(function(){
  alert('Fejlesztés alatt!');
  
  return(false);
 });
 
 $('a[href^=mailto], .email').each(function(){
  $(this).html($(this).html().replace(/%20/g, ' ').replace(/ kukac |KUKAC/g, '@').replace(/ pont /g, '.'));
  
  if(typeof this.href != 'undefined')
   this.href = this.href.replace(/%20/g, ' ').replace(/ kukac |KUKAC/g, '@').replace(/ pont /g, '.');
 });
 
// $('input').attr('autocomplete', 'off');
 
 var muveletek_torol_cb = function(data, textStatus, errorThrown){
  if(typeof data == 'XMLHttpRequest')
   alert('Sikertelen törlés!\nEgyéb hiba: textStatus = ' + textStatus + ' errorThrown = ' + errorThrown);
  else{
   if(data.ok){
    alert('Törölve!');
    
    window.location = data.url;
   }else
    alert('Sikertelen törlés!');
  }
 };
 
 $('#muveletek .torol a').click(function(e){
  e.preventDefault();
  e.stopPropagation();
  
  if(!confirm('Biztos törlöd?'))
   return(false);
  
  $.ajax({
   dataType: 'json',
   url: $('head base[href]').attr('href')+'ajax/' + $(this).attr('href').replace(/^admin\//, ''),
   success: muveletek_torol_cb,
   error: muveletek_torol_cb
  });
  
  return(false);
 });
 
 $('small.azonosito').click(function(){
  var v = $(this).html();
  
  window.prompt('azonosito', v.substring(1, v.length - 1));
  
  return(false);
 });
});
