pre   ='DM_';
w     = window;
d     = document;
DOM   = d.getElementById && typeof(document.getElementsByTagName('title')[0].innerHTML!='undefined');

function DOI(e)
{
  return document.getElementById(e);
}

function ata(ataObj,ataMod,ataReq)
{
  this.build();
  if(ataObj)
    { 
      this.ataMod   = ataMod;
      this.ataObj   =  ataObj;
      this.ataName  = pre + ataObj.id;
      this.ataReq   = '?show=' + ataReq;
      this.req      = ataReq;
      this.ataUri   = this.ataObj.href;
     }
}; 


ata.prototype.build = function ()
{
  this.R    = false;
  if(DOM)
  {
    if(this.R)this.R.abort();
      
    if(w.XMLHttpRequest) 
      {
        try 
    	    {
			  this.R = new XMLHttpRequest();
            } 
          catch(e) 
            {
			  this.R = false;
            }
          } 
    else if(w.ActiveXObject) 
      {
        try 
          {
            this.R = new ActiveXObject("Msxml2.XMLHTTP");
          } 
        catch(e) 
          {
            try 
              {
                this.R = new ActiveXObject("Microsoft.XMLHTTP");
              } 
            catch(e) 
              {
                this.R = false;
              }
          }
      }
  }
  
  
}; 


ata.prototype.ask = function (uri)
{ 
    
  this.R.open('GET', this.ataUri+this.ataReq+'&amp;'+new Date().getTime(), true);
  this.R.onreadystatechange=new Function("c",this.ataName+".hear();");
  this.R.send(null);
  
    
};


ata.prototype.hear= function()
{
  if(this.R.readyState==4 && this.R.status==200)
    {
      this.work();
    }
}

ata.prototype.work= function()
{
    
  if(this.R.responseText.search(/[\r\n]/)>-1 && this.R.responseText.search(/^\s*\<!--\[200\]--\>/)>-1)
    {
      eval('this.work_' + this.ataMod + '()');
    }
}

ata.prototype.work_replace1= function()
{
  this.ataObj.parentNode.className='ata_'+this.ataMod;
  this.ataObj.parentNode.innerHTML=this.R.responseText;
}

ata.prototype.work_msgbox= function()
{
  alert(unescape(this.R.responseText).replace(/^\s*\<!--\[200]--\>/,''));
}

ata.prototype.work_confirm= function()
{
  
  if(confirm(unescape(this.R.responseText).replace(/^\s*\<!--\[200]--\>/,'')+
      '\n\n_______________________________________________\n'+
      'Klicken Sie auf "Abbrechen, um dieses Fenster zu schliessen"\noder\n'+
      'Klicken Sie auf "OK", um diese Informationen in diesem Browserfenster anzuzeigen um sie ggf. Ausdrucken zu Können'
    ))
    {
      location.href=this.req;
    }
}



otroc = new ata();
function init_ata(obj,mod,req,ww,hh)
{
  
  if(!otroc.R)
    {
      winSize=(ww+hh)?'width='+ww+',height='+hh:'';
      pop=w.open('',obj.id,winSize+',scrollbars=yes,resizable=yes');
      pop.focus();
      alert(1);
      return true;
    }
    eval(pre + obj.id +'=new ata(obj,"' + mod + '","' + req + '");');
    eval(pre + obj.id +'.ask();');
  return false;    
   
}

