// Irmtraud online

function MailErr(s) // true bei falscher Mail-Adresse
{ var j=true, k, w='.-_%#!+~';
  if (s.indexOf('@')>0 && s.lastIndexOf('.')>2 && s.length>5)
  { j=false;
    for (i=0; i<s.length; i++)
    { k=s.charAt(i);
      if ((k<"@"||k>"Z")&&(k<"a"||k>"z")&&(k<"0"||k>"9")&& w.indexOf(k)<0)
      { j=true; break; }
    }
  } return j;
}

// Mail-Formular prüfen
function checkform()
{ m=document.f.Text.value;
  if (m.length<60 || m.lastIndexOf(" ")<40)
  { alert ('Kein sinnvoller Text.'); return false; }
  if (document.f.Fa.value=="")
  { alert ('Bitte geben Sie Ihren Namen ein.'); document.f.Fa.focus(); return false; }
  m=document.f.Mail.value;
  if (MailErr(m))
  { alert ('Mail-Adresse fehlt oder fehlerhaft.'); document.f.Mail.focus(); return false; }
  return true;
}

// Link auf eigene Seite markieren
function marklink()
{ var i,f;
  if (parent.frames.length<2) f=location.href; else f=parent.location.href;
  if (f.substring(f.length-1)=='/') f+="index.htm";
  for (i=0; i<document.links.length; i++)
  { lk=document.links[i];
    if (f==lk.href && document.links[i].name=='')
    { lk.style.color="#CC0000"; lk.style.textDecoration="none";
      lk.style.cursor="default"
} } }

// Vergrößertes Bild ein- oder ausblenden
var shown='';
function switchbox(b)
{ var e, i, x=document.getElementById('ovl'), y=document.getElementById('img');
  if(x)
  { if (b!='' && b!=shown)
    { y.innerHTML='<img src="'+b+'" alt="Aktuell">'; e="visible"; shown=b
      i=document.documentElement.clientHeight;
      if (i<580) i=2; else i=parseInt(i/2-240); x.style.bottom=i+"px";
      i=document.documentElement.clientWidth;
      if (i<780) i=2; else i=parseInt(i/2-380); x.style.right=i+"px";
    } else { e="hidden"; shown='' }
    x.style.visibility=e; return false
  } else return true
}