function onLivehelpStatus(id)
{
  var doc = navigator.appName.indexOf('Microsoft') !=-1 ? document.frames[id].document : document.getElementById(id).contentDocument;

  var status = doc.getElementById('status').innerHTML;

  var statusDisplay = document.getElementById('livehelp_status_display');

  var stat = [];
  stat[0] = '<span class="livehelp offline">OFFLINE</span>';
  stat[1] = '<span class="livehelp offline">OFFLINE</span>';
  stat[2] = '<span class="livehelp online" onclick="launch_livehelp_window()">ONLINE</span>';
  stat[3] = '<span class="livehelp busy">BESETZT</span>';

  if(statusDisplay)
  {
    statusDisplay.innerHTML = stat[status];
  }

}

function launch_livehelp_window()
{

 var embedder = document.getElementById('livehelpLauncherEmbed');
 if(embedder)
 {
   var link = embedder.getElementsByTagName('a')[0];
   if(link)
   {
    link.onclick();
   }
 }
}
