function $(id)
{
   return document.getElementById(id);
}

function htmlStr(text)
{
   if (text == null) return '';
   return text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
}

function postUriStr(text)
{
   if (text == null) return '';
   return encodeURIComponent(text);
}

function layerClose()
{
   $('layer').style.display = 'none';
   $('layer').innerHTML = '';
}

function tdod(url)
{
   if (window.navigator.userAgent.indexOf("MSIE ") > -1 && parseFloat(navigator.appVersion) >= 4)
   {
      var w = document.body.clientWidth;
   }
   else
   {
      var w = window.innerWidth;
   }
   
   $('layer').style.display = 'block';
   $('layer').style.top = '500px';
   $('layer').style.padding = '5px';
   $('layer').style.left = (Math.round(w/2) - 150)+'px';
   $('layer').innerHTML = '<a onclick="layerClose();" href="javascript:void(0);" title="Fenster schließen"><img border="0" src="'+url+'" /></a>';
}
