  // REROUTE_NON_FRAMED_CONTENT_PAGES.JS
  //
  // If the content page is shown without being in the frameset, and frames are supported,
  // then find out what the name and path of the current page is and reroute this page to
  // the web site starting page.  Also add on to the URL a querystring with the current path
  // and page name.  Plus add an initial starting path prefix before the starting page name IF
  // it is in a subdirectory.
  // I.E.:  self.location.replace("/index.html?contentpageurl=promos/promopage.htm");
  // or:  self.location.replace("index.html?contentpageurl=contact.htm");

  // *** NOTE: This code does NOT check for a minimum required width before doing the rerouting. This particular
  // site should reroute to the framed version regardless, as long as it is supported by the browser. ***

  // If the web site starting page has code to handle the passed querystring variable then it is handled there.
  // Otherwise it will just go to that web site starting page.

  // This page reroute ONLY occurs if the page is live and ONLINE.

  theWebSiteStartPage = "index.html";  // INCLUDE THE STARTING PATH TO THE ENTRY PAGE (WITHOUT THE "/" PREFIX) IF THE
  // STARTING PAGE IS IN A SUBDIRECTORY.  I.E. "nis/index.html" or "index.html".
  try
    {
     // If any of the code in this section is not supported it will throw an error and the "Catch" section will execute
     // instead (doing nothing - no page rerouting is done).
     if ((self == top) && (self.location) && (location.pathname) && (location.protocol) && (document.getElementById(frames) != "undefined"))
       {
         // First, get the content pages path and page name from the URL.
         thePathAndPageURL = location.pathname;
         if (thePathAndPageURL > "")
           {
             // Eliminate any STARTING "\" or "/" characters as we want a RELATIVE URL path.
             // "\" is utf-8 character code 92.
             if (thePathAndPageURL.substring(0,1) == String.fromCharCode(92))
               {
                 thePathAndPageURL = thePathAndPageURL.substring(1, thePathAndPageURL.length);
               };
             if (thePathAndPageURL.substring(0,1) == "/")
               {
                 thePathAndPageURL = thePathAndPageURL.substring(1, thePathAndPageURL.length);
               };
             // Now build the replacement URL string and go to that URL.
             if (thePathAndPageURL > "")
               {
                 theWebSiteStartingPathPrefix = "";
			  // If the page is NOT in the main directory, add a starting "/" path before the starting page string.
			  if (thePathAndPageURL.indexOf("/") > 1)
			    {
                     theWebSiteStartingPathPrefix="/";
                    };
                 thePathAndPageURL = theWebSiteStartingPathPrefix + theWebSiteStartPage + "?contentpageurl=" + thePathAndPageURL;
                 // Now go ahead and redirect the page UNLESS it is being tested on a local computer.
			  if (location.protocol == "http:")
                   {
                     self.location.replace(thePathAndPageURL);
                   };
               };
           };
       };
    // *** There must NOT be a semi colon after the bracket below ***
    }
  catch(err)
    {
      // Error catching routing if the browser has problems (security settings, lack of browser support for the code
      // techniques used, etc) with any of the code contained in the "TRY" section.
      //
      // Simply Do Nothing. No page rerouting is done.
    };
