


function handleAccessErrors(err, url, lineNo) {
  url = self.location.href; // self.location.href;
  if (path.indexOf('../../') == 0) {
         // relative url from language or below
         top.location.href = path.substring(6) + 'index_frameset.html?content=' + url;
  } else {
         tmp =  window.location.pathname.substring(path.length);
         dirs = tmp.split('/');
         tmp = path + dirs[0] + '/' + dirs[1] + '/index_frameset.html?content=' + url;
         top.location.href = tmp;
  }
  return true;
}

function getFramesetUrl(contentUrl) {
     if (path.indexOf('../../') == 0) {
         // relative url, simply cut ../../ to point to language dir
         return path.substring(6) + 'index_frameset.html?content=' + contentUrl;

     } else {
         tmp = window.location.pathname.substring(path.length);
         dirs = tmp.split('/');
         return path + dirs[0] + '/' + dirs[1] + '/index_frameset.html?content=' + contentUrl;
     }
}

function reloadInFrameset() {
     top.location.href = getFramesetUrl(self.location.href);
}
// //////////////////////
// Check whether we the file is loaded in a frameset. If not, reload
// within our frameset

function checkForFrameset() {

  onerror = handleAccessErrors;

  if (top.location.href == self.location.href) {
      reloadInFrameset();

     return false;
  } else {
     onerror = function (err, url, lineNo) {
               return false;
     };
     return true;
  }
}
