﻿// JScript File

/*
  initialiseIframe(url)
  
  Checks to see if there is a parameter being passed in the querystring
  defining the location of the content for the central iframe.
*/
function initialiseIframe(url)
{
  // Determine if we are on the home page or not.
  var sUrl = window.location.toString().toLowerCase();
  var bHome = sUrl.indexOf('content.asp')==-1?true:false;

  // We can only proceed if the iframe can be referenced:
  if ((window.frames['ContentFrame'])||(window.frames['ContentFrameHome']))
  {
    // Refer to the correct iframe depending upon whether or not we are on the home page:
    var theIframe = bHome?window.frames['ContentFrameHome']:window.frames['ContentFrame'];

    if (bHome||url=='')
    {
      theIframe.location = '/html/content/home_page.htm';
      return true;
    }
    else
    {
      theIframe.location = url;
      return true;
    }
  }
  else
  {
    // Can't reference the iframe so:
    return false;
  }
}

/*
  rebuildFrame()

  Ensures that the page calling this function is within an iframe.
*/
function rebuildFrame()
{
//  return true;
}