function selfLoad()
{
  var newAddr="";
  var myURL=self.location.href; // http://www.trainair.co.uk/section/page.htm
  var mySecAddr=myURL.substring(0,myURL.lastIndexOf("/")); // http://www.trainair.co.uk/section
  var myBaseAddr=mySecAddr.substring(0,mySecAddr.lastIndexOf("/")); // http://www.trainair.co.uk
  var myFileName=myURL.substring(myURL.lastIndexOf("/")+1); // page.htm
  var mySection=mySecAddr.substring(mySecAddr.lastIndexOf("/")+1); // section

  if (location==parent.location)
  { //full screen
    if (mySection.indexOf(".")==-1)
    { //page is not common (ie not located in root)
      var newAddr=myBaseAddr+"/index.html?"+mySection+"/"+myFileName; // http://www.trainair.co.uk/index.html?page.htm;
    }
    else
    {  //page is common (ie located in root)
       var newAddr=myBaseAddr+"/"+mySection+"/index.html?"+myFileName; // http://www.trainair.co.uk/index.html?page.htm;
    }
  }
  else
  { //replace banner and buttons if currently in wrong section (unless common page)
    if (parent.banner_frame.location.href!=mySecAddr+"/banner.htm")
    { //wrong banner
      if (mySection.indexOf(".")==-1)
      { //page is not common (ie not located in root)
        parent.banner_frame.location.replace(mySecAddr+"/banner.htm");
        parent.buttons_frame.location.replace(mySecAddr+"/buttons.htm");
      }
      else
      { //page is common (ie located in root)
        if (parent.banner_frame.location.href.indexOf("border")!=-1)
        { //no banner
          parent.banner_frame.location.replace(mySecAddr+"/home/banner.htm");
          parent.buttons_frame.location.replace(mySecAddr+"/home/buttons.htm");
        }
      }
    }
  }
  return newAddr;
}