/*******************************

  NorthgateHelp.js, V4.17, 16-Sep-2010
  Copyright Northgate Information Solutions UK Limited, 2002-2010

 *******************************/

var helpVersion = "V4.17";

/*******************************

 Functions:
	initialise()		// Initialises variables and loads the first topic.
	onLinks(obj)		// Handler for topic onLoad event and navigation buttons.
	unloadHelpSystem()	// Event handler for help system unload.
	initNavTool()		// Event handler for navigation tool load.
	resizeNavTool()		// Event handler for navigation tool resize.
	mouseEvent(e)		// Handlers for data object events.
	
 *******************************/
 
//var debugWindow = window.open();

// Declare a variable to hold a reference to the HelpSystem object.
var helpSystem;

var qs = HelpSystem.parseQueryString(self.location.search);

// Get details of the browser and check whether it is supported.
DHTML.getBrowserDetails();

if (!qs.aub) {
	// If the browser is not supported...
	if (!DHTML.browserType)
		// Replace the frameset with an error page.
		location.replace("notallowed.htm");
	else if (DHTML.supportLevel != DHTML.FULLSUPPORT) {
		// Warn the user that this browser version is not fully supported.
		var srch = (self.location.search == ""
			? "?" : self.location.search + "&")
				+ "bname=" + DHTML.browserDetails.name
				+ "&bmin=" + DHTML.browserDetails.minSupportedVersion
		location.replace("nosupport.htm" + srch + self.location.hash);
	}
}

/* Initialise variables and load the first topic.
   The topic can be specified in three ways (in order of priority):

   1. The user can specify which topic to load by adding a
      question mark and the name of a help file to the URL
      of the help web. Note that this only works if a
      protocol is specified.

   2. A topicFile variable can be defined in the frameset file.

   3. If neither of these methods is used. The topic with the same name
      as the frameset will be loaded.

   The user can also specify a bookmarked location in the topic, by 
   adding a hash and the name of the required bookmark to the URL of 
   the help web. Note that this also only works if the help if a
   protocol is specified and the bookmark name does not contain
   any spaces.
*/
function initialise() {
	// Can this help system be loaded into a frame? If not...
	if (!self.loadIntoFrameset) {
		/* If the parent of this frame is not the top level window
		   and the document in the parent window is not part of the
	       help system... */
		if (parent != self && !parent.nisHelpWindow) {
			// Load the same URL into the top level window.
			top.location.replace(unescape(window.document.URL));
			return;
		}
	}

	helpSystem = new HelpSystem();
}


// Handler for topic onLoad event.
function onLinks(obj) {
	// Check that the help system has been initialised...
	if (helpSystem != null) {
//		if (!obj) {
			helpSystem.loadNavTool(obj);
		//}
	}
}


// Handler for navigation buttons.
function onNav(obj) {
	// Check that the help system has been initialised...
	if (!helpSystem.loading) {
		helpSystem.loadNavTool(obj);
	}
}


// Event handler for help system unload.
function unloadHelpSystem() {
	// Check that the help system has been initialised...
	if (helpSystem != null) {
		helpSystem.unloadHelpSystem();
	}
}

// Event handler for navigation tool load.
function initNavTool() {
	// Check that the help system has been initialised...
	if (helpSystem != null) {
		helpSystem.initNavTool();
		helpSystem.loading = false;
	}
}

// Event handler for navigation tool resize.
function resizeNavTool() {
	// Check that the help system has been initialised...
	if (helpSystem != null) {
		helpSystem.resizeNavTool();
	}
}

// Event handler for data object events.
function mouseEvent(e) {
	if (helpSystem != null) {
		return(helpSystem.mouseEvent(e));
	}
}

// Event handler for toggle display events.
function toggleDisplay(targetId, source, prompt) {
	if (helpSystem != null) {
		helpSystem.toggleDisplay(targetId, source, prompt);
	}
}

// Event handler for navigation events.
function navigationEvent(e) {
	if (helpSystem != null) {
		return(helpSystem.navigationEvent(e));
	}
}

// Search applet initialisation event handler.
function initialiseSearchApplet() {
	if (helpSystem != null) {
		helpSystem.initialiseSearchApplet();
	}
}

function setSearching() {
	if (helpSystem != null) {
		helpSystem.setSearching();
	}
}

