var topurl = "http://www.playbacktheater-bremen.de/",
    toplocal = "index.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(id) {
  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.PlayContent)
      if (top.PlayContent.frflag)
        top.PlayContent.frflag = false;
    erflag = false;
    if (frflag)
      top.location.replace(topurl+"?"+url_frame);
    if (parent.PlayNavi)
      parent.PlayNavi.act_button(id);
  }
}



