// Ensures the current document is displayed in the proper context (inside a valid frame structure).
// This function validates the current parent document against a list of valid parent documents.
// Valid parent documents are specified as a list of function arguments.
// If no valid parents are specified then nothing is done because there is nothing to check against.
// However if one or more valid parents are specified and the current parent is not
// one of them, then the first valid parent document is loaded into the top level of 
//  the browser to force a proper context for the current document.
//
function ValidateParentAgainst() {
  if (arguments.length < 1) return; //empty arguments array, nothing to check against
  if (window == top) top.location.href = arguments[0]; // current document does not have a parent, so load first valid parent document
  for (var idx = 0; idx < arguments.length; idx++) // iterate over list of valid parent documents
    if (self.parent.location.href.toString().indexOf(arguments[idx].toString()) != -1) return; // current parent document is valid, so do nothing
  top.location.href = arguments[0].toString(); // by power of elimination, the current parent document is not valid, so load first valid parent document
}

