﻿function repAll(txt, replace, with_this) {
  return txt.replace(new RegExp(replace, 'g'),with_this);
}

function sendOpinion()
{
    /*
    %F6 - ö
    %FC - ü
    %F3 - ó
    %F5 - ő
    %FA - ú
    %E9 - é
    %E1 - á
    %FB - ű
    %ED - í
    */
 
    var body = $('#opinion').val();
    body = repAll(body,'ö',"%F6");
    body = repAll(body,'ü','%FC');
    body = repAll(body,'ó','%F3');
    body = repAll(body,'ő','%F5');
    body = repAll(body,'ú','%FA');
    body = repAll(body,'é','%E9');
    body = repAll(body,'á','%E1');
    body = repAll(body,'ű','%FB');
    body = repAll(body,'í','%ED');
    
    $('#opinionSendBtn').attr('href','mailto:office@ferfialso.hu?subject=L%E1togat%F3i v%E9lem%E9ny &body='+body);
    var t=setTimeout("clearContent()",1);
}

function clearContent()
{
    $('#opinion').val('');
}
