/* CORE AJAX  */
function vytvorXMLHttpRequest2(handler)
{
  //var xmlHttp=null
  if (window.XMLHttpRequest)
  {
    xmlHttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (error)
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  return xmlHttp;
}
/*  //END CORE AJAX */

function linkTo_UnCryptMailto(kryptovany_email)
{
  var xmlHttp = vytvorXMLHttpRequest2();

  xmlHttp.onreadystatechange = function ()
  {
    vrat_dekryprovany_email();
  };

  xmlHttp.open('GET','req/ajax-dekryptuj-email.php?str='+kryptovany_email,true);
  xmlHttp.send(null);
}
function vrat_dekryprovany_email()
{
  if (xmlHttp.readyState == 4)
  {
    if (xmlHttp.status == 200)
    {
      //alert('mailto:' + xmlHttp.responseText);
      //window.location = 'mailto:' + xmlHttp.responseText;
      location.href = 'mailto:' + xmlHttp.responseText;
      //self.location.href = 'mailto:' + xmlHttp.responseText;
      //window.open('mailto:' + xmlHttp.responseText); //works in OPERA
      //document.write('mailto:' + xmlHttp.responseText);
    }
    else
    {
      alert('UNCRIPTED ERROR 0x458');
    }
  }
}

function remove_text(me)
{
  me.value = '';
}

