$(document).ready(function(){
  //logo click:
  $('#headerLogo').click(function(){
    var targetHref = $(this).find('a').attr('href');
    
    location.href = targetHref;
  });
  
  //nyelv módosítása:
  $('#changeLang li').find('a').click(function(){
    var id = $(this).attr('id');
    var lang_id = id.replace('lang_','');
    
    if (lang_id != clientSettings.currentLangId){
      //set lang_id:
      $.ajax({
        type: 'post',
        url: clientSettings.docRoot + 'ajax/reset_lang_id.php',
        data: 'target_lang_id='+encodeURIComponent(lang_id),
        cache: false,
        dataType: 'json',
        success:function(response){
          var status = response.status;
          if (status == 1){
            location.href = clientSettings.currentPage;
          }
        }
      });
    }
  });
});

// ----- függvények ----- //

function statistics(){
  $.ajax({
    type: 'get',
    url: clientSettings.docRoot + 'ajax/stats.php',
    cache: false,
    success: function(response){},
    error: function(ex,ey,ez){}
  });
}

