function check() {
  if (parent.location.href == self.location.href) {
    var fullpath = window.location.href;
    var ind = fullpath.lastIndexOf("/")+1;
    if (ind > 0) {
      var loaddoc = fullpath.substring(ind);
      var loadpath = fullpath.substring(0,ind);
      if (loaddoc) window.location.replace(loadpath+"?"+loaddoc);
    }
  }
}

