
function close_malert()
{
  _v('malert_aussen');
  _v('malert_innen');
  _('malert_inhalt').innerHTML='';
  _('malert_headline').innerHTML='';
}
function malert_close(){return close_malert();}


function open_malert(text,options)
{
  if(text==undefined)text="";
  w=0;
  h=0;
  url=options;
  headline="";

  if(typeof(options)=="object")
  {
    url="";
    if(options.url)url=options.url;
    if(options.w)w=options.w;
    if(options.h)h=options.h;
    if(options.headline)headline=options.headline;
  }

  if(w>0)_('malert_innen').style.width=w+"px";
  if(text!="")_('malert_inhalt').innerHTML=text;
  if(headline!="")_('malert_headline').innerHTML=headline;

  if(url!="" && url!==undefined)
  {
    ajax('malert_inhalt',url,options);
  }

  _z('malert_x');
  _z('malert_aussen');
  _z('malert_innen');
}
function malert(text,options){return open_malert(text,options);}
function malert_open(text,options){return open_malert(text,options);}


// Malert schließen bei ESC-Taste:
document.onkeyup = function(event) {
  if(event.keyCode==27)
  {
    close_malert();
    //return false;
  }
}
