function delBlogItem(sorid, delid, serverurl)
{
  function reportSuccess()
  {
     $(sorid).remove();
     var db = $('bej_szam').innerHTML;  
     $('bej_szam').innerHTML = db-1;
  } 
   
  function reportError(e)
  {
     //alert('hiba');  
  }
    
    var pars = "id=" + delid + "&funcid=delBlogItem&" + Math.random();
    var myAjax = new Ajax.Request(
                  serverurl + '/functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars, 
                      onSuccess: reportSuccess 
                      //onFailure: this.reportError(e)
                    }); 
  
}

function delBlogComment(commentid, delid, serverurl)
{
  function reportSuccess()
  {
     $(commentid).remove();
  }  
  var pars = "commentid=" + commentid + "&funcid=delBlogComment&" + Math.random();
  var myAjax = new Ajax.Request(
                  serverurl + '/functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars, 
                      onSuccess: reportSuccess 
                      //onFailure: this.reportError(e)
                    });                                    
                                                          
}

function activDeactiv(commentid, activeid)
{
   var oThis = this;
   this.commentid = commentid;
   this.activeid = activeid;
   
   Event.observe(activeid, 'click', function(e){oThis.checkItem(e)});
}

activDeactiv.prototype = {
  
  checkItem: function(e) {
    var id = this.commentid.substring(8);
    var pars = "commentid=" + this.commentid + "&funcid=actDeactBlogIComment&" + Math.random();
    var myAjax = new Ajax.Updater('act_'+id,
                  '../../../functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars 
                    });                                    
  }                                                        
}

function activDeactiv2(commentid, activeid, serverurl,message)
{
    var id = commentid.substring(8);
    //var div = 'response_'+id;
    var div = 'resp';
    hint_show(div);
    $(div).innerHTML = '<div><img src="'+serverurl+'/themes/default/images/loading.gif" height="30"/></div>'; 
    position_layer('resp');
    
    function hinth()
    {
      $(div).innerHTML = "";
      hint_hide(div);
    }
    function reportSuccess()
    {
      $(div).innerHTML = message;
      setTimeout(hinth, 2500); 
    }
    
    
    var pars = "commentid=" + commentid + "&funcid=actDeactBlogIComment&" + Math.random();
    var myAjax = new Ajax.Updater('act_'+id,
                  serverurl + '/functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars,
                      onSuccess: reportSuccess 
                    });                                    
                                                         
}

function editBlogComment(id, activeid, serverurl)
{
          
    function explode(b, s)
    {
       return s.split(b);
    }

   
   function fillForm(originalRequest)
   {
      var str = originalRequest.responseText;
      s = explode('[#]', str); 
      $('name').value = s[1];
      $('email').value = s[2];
      $('tartalom').value = s[3];
      $('cenzura').value = 1;
      $('cid').value = s[0];
    }

  
     
   
   var pars = "commentid=" + id + "&funcid=getCommentDatas&" + Math.random();
   var myAjax = new Ajax.Request(
                  serverurl+'/functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars, 
                      onSuccess: fillForm 
                      //onFailure: this.reportError(e)
                    }); 
                                                                       
}

function editKeywordItem(id, serverurl)
{
    function explode(b, sa)
    {
       return sa.split(b);
    }
          
   
   function fillForm(originalRequest)
   {
      var str = originalRequest.responseText;
      
      var list = eval('(' + str + ')');
      for (var i=0; i < list.length; i++) {
          
        var aktlang = list[i].lang;
        var field = "keyword_"+aktlang;
        if($(field)) $(field).value = list[i].keyword;
      }    
      $('cid').value = id;
    }

  
     
   
   var pars = "commentid=" + id + "&funcid=getKeywordDatas&" + Math.random();
   var myAjax = new Ajax.Request(
                  serverurl + '/functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars, 
                      onSuccess: fillForm 
                      //onFailure: this.reportError(e)
                    }); 
  
}


function delKeywordItem(sorid, delid, serverurl, message)
{
  var div = 'resp';
  hint_show(div);
  $(div).innerHTML = '<div><img src="'+serverurl+'/themes/default/images/loading.gif" height="30"/></div>'; 
  position_layer('resp');
    
  function hinth()
  {
     $(div).innerHTML = "";
     hint_hide(div);
  }
  
  function reportSuccess()
  {
     $(sorid).remove();
     $(div).innerHTML = message;
     setTimeout(hinth, 2500); 
  }  
  
  function reportError()
  {
     //alert('hiba');  
  }
    
    var pars = "id=" + delid + "&funcid=delKeywordItem&" + Math.random();
    var myAjax = new Ajax.Request(
                  serverurl + '/functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars, 
                      onSuccess: reportSuccess 
                      //onFailure: this.reportError(e)
                    });  
                        
}

function sendBlogInMail(nev1, nev2, email1, email2, blogurl, serverurl)
{
  function hinth()
  {
    hint_hide('kuldform');
  }
  function reportSuccess()
  {
    $('uzi').innerHTML = 'Sikeresen elküldve<br /><br />';
    setTimeout(hinth, 2500);
  }
  $('uzi').innerHTML = '<img src="'+serverurl+'/themes/default/images/loading.gif" height="30"/>';
  var pars = "&funcid=sendBlogInMail&blogurl="+blogurl+"&nev1="+nev1+"&nev2="+nev2+"&email1="+email1+"&email2="+email2+"&" + Math.random();;
  var myAjax = new Ajax.Request(
                  serverurl + '/functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars, 
                      onSuccess: reportSuccess 
                      //onFailure: this.reportError(e)
                    });  
  
}

function sendErtesito(serverurl, blogurl, kulcsszo)
{
  //var div = 'uzi_' + kulcsszo;
  var div2 = 'resp';
  hint_show(div2); 
  $(div2).innerHTML = '<div><img src="'+serverurl+'/themes/default/images/loading.gif" height="30"/></div>'; 
  position_layer('resp');
  
  function hinth()
  {
     $(div2).innerHTML = "";
     hint_hide(div2);
  }
  
  function reportSuccess(originalRequest)
  {
    $(div2).innerHTML = originalRequest.responseText;
    setTimeout(hinth, 2500);                         
  }
  
  /*$(div).innerHTML = '<div align="center"><img src="'+serverurl+'/themes/default/images/loading.gif" height="30"/></div>';*/
  var pars = "&funcid=sendErtesito&blogurl=" + blogurl + "&kulcsszo=" + kulcsszo + "&" + Math.random();
  var myAjax = new Ajax.Request(
                  serverurl + '/functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars, 
                      onSuccess: reportSuccess 
                      //onFailure: this.reportError(e)
                    });  
}

function getVaros(field, serverurl)
{
  function reportSuccess(originalRequest)
  {
    $(field).value = originalRequest.responseText;
  }
  var irszam = $('irszam').value;
  var pars = "&funcid=getVarosByIrszam&irszam=" + irszam + "&" + Math.random();
  var myAjax = new Ajax.Request(
                  serverurl + '/functions/ajaxfunc.php', 
                    { 
                      method: 'get', 
                      parameters: pars, 
                      onSuccess: reportSuccess 
                      //onFailure: this.reportError(e)
                    });  
}
