
var baseURL = 'http://www.rainbodesign.com/pub/reframe/';            // base URL for directory where framed pages reside
var qString = location.search.substring(1, location.search.length);  // Get Query String w/o the '?'
var params = new Array;

// Default frame pages
var wFrame0 = "reframe_menu.html";
var wFrame1 = "reframe_main.html";
var wFrame2 = "reframe_top.html";

var framePage = baseURL + "reframe.html";

 function reframeCheck(checkPage, theFrame) {
if (top.location.href.indexOf(framePage) == -1) {
  top.location.href = framePage + "?page=" + checkPage + "&frameNo=" + theFrame;
  } // endif

} // end reframeCheck()

 function reloadCheck() {

  if (qString.length > 0) {             // is there a Query String on this URL?
   params = qString.split('&');         // Yes!  Split it into command/value pairs
     tmp = new Array;                   // Create an array to easily hold command/values below
     doReframe = 0;                     // Clear reframing yes/no flag
    for (i=0; i<params.length; i++) {
     tmp = params[i].split('=');        // split each command/value pair in Query String
      if (tmp[0] == 'page') {           // Does command = 'page'?
        doReframe = 1;                  // Yes! Set doReframe flag to True
        page = tmp[1];                  // Get the page URL fragment
      }
      if (tmp[0] == 'frameNo') {        // Does command = 'frameNo'?
        doReframe = 1;                  // Yes! Set doReframe flag here, too!
        frameNo = tmp[1];               // Get the frame #
      }
    } // end for i
   if (doReframe == 1) {                // Need reframing?
     window["wFrame" + frameNo] = page; // Yes! Set requested reframe source
     } // endif doReframe
  } // endif qString.length

 } // end reloadCheck()


