function reframe(){
var rootpath = "";
var rootfile = "index.html"; //name of the frameset page
var frame = "hauptbereich"; //name of the frame to load document into
page = new String(self.document.location);
var pos = page.indexOf("/") + 1; // lastIndexOf
var file = page.substr(pos);
var pos2 = file.indexOf("/") + 1; // lastIndexOf
var file2 = file.substr(pos2);
var pos3 = file2.indexOf("/") + 1; // lastIndexOf
var file3 = file2.substr(pos3);


Ergebnis = file3.match(/\//g);
if (Ergebnis)
  {
  // alert("pfad enthält [" + Ergebnis.length + "] slashes.");
  for (var i = 0; i < Ergebnis.length; ++i)
    {
    rootpath += "../";
    }
  }

if(window.name != frame){
var s = rootpath + rootfile + "?/" + file3;
/*
var msg = "self.document.location:\n[" + page + "]\nnew location:\n[" + s + "]";
alert(msg);
*/

top.location.replace(s);
}
return;
}
reframe();
