var topurl = "http://www.samba-bremen.de/",
    toplocal = "index.html",
    topengl   = "english.html";
    frflag = true,
    erflag = true,
    url_frame = "";

function CatchError(msg, url, lno) {
  if (erflag) {
    erflag = false;
    top.location.replace(topurl+"?"+url_frame);
    return true;
  }
  return false;
}

function checkframe() {
  window.focus();
  if (top.frames)
  {
    if (location.host == "")
      topurl   = toplocal;
    for (i=0;i<self.location.href.length;i++) {
      if (self.location.href.charAt(i) == '\/') {
        url_frame = "";
      } else {
        url_frame += self.location.href.charAt(i);
      }
    }
    window.onerror = CatchError;
    if (top.ContSamba)
      if (top.ContSamba.frflag)
        top.ContSamba.frflag = false;
    erflag = false;
    if (frflag)
      top.location.replace(topurl+"?"+url_frame);
  }
}

function checkenglish() {
  toplocal = topengl;
  topurl += topengl;
  checkframe();
}


