/**
 * Avatar - Typewriter
 */
	globalcontroltypewriter = 0;
	globalmesg = '';
	
    function sendToJSAvatar(mesg,stat,dontoverwrite)
    {
    if (mesg != '')
      {
          if (mesg == 'null') mesg = '';
         var stat = (typeof(stat) != 'undefined') ? stat : "info" ;
          stat = 'avatar_'+stat;
         var el = document.getElementById('avatar_body');
         //el.innerHTML = mesg;
         var l = mesg.length;
         var p = 0; 
         var ms = 30;
         if ((dontoverwrite) && (globalmesg == mesg)) return false; //mesg schon angezeigt ... nicht nochmal schreiben
         globalmesg = mesg;
         var localcontroltypewriter = ++globalcontroltypewriter; //nicht 2 typewriter gleichzeitig
         function typewriter()
         {     
             if ((globalcontroltypewriter == localcontroltypewriter) && (p++ < l)) {
               var padding = '<span style="visibility:hidden">' + mesg.substring(p, l+1) + '</span>';
               el.innerHTML = mesg.substring(0, p) + padding;
               setTimeout(typewriter, ms);
             }
         }
         el.parentNode.setAttribute('id', stat);
         setTimeout(typewriter, ms); 
      }
    }
    
    function setFlash(id, index, value)
        { //alert(index + ' ' + value);
          var obj = $(id);

          if (obj && typeof obj.SetVariable != "undefined")
          {
            //alert(obj.GetVariable(index));
            obj.SetVariable(index, value);
            //alert(obj.GetVariable(index));
          }
       }
       
function showhide(id)
{
  Effect.toggle(id, 'blind', { delay: 0.0, duration: 0.3 });
}

Event.observe(window, 'load', function()
{
  //Event.observe($('langSelector'), 'click', show_langSelector.bindAsEventListener());
});

    
