/**
 ******************************************************************************
 *
 * Confidential Property of Documentum, Inc.
 * (c) Copyright Documentum, Inc. 2001.
 * All Rights reserved.
 * May not be used without prior written agreement
 * signed by a Documentum corporate officer.
 *
 ******************************************************************************
 *
 * Project        WDK
 * File           help.js
 * Description    Help javascript
 * Created on     8th January 2002
 * Tab width      3
 *
 ******************************************************************************
 *
 * PVCS Maintained Data
 *
 * Revision       $$
 * Modified on    $$
 *
 * Log at EOF
 * 
 ******************************************************************************
 */


if (typeof(g_isInitialised) == "undefined")
{
   var g_isInitialised = true;
   var g_helpURL = null; // the help URL

   if (typeof getTopLevelWnd() != "undefined" && getTopLevelWnd() == this)
   {
      // register help events handlers
      registerClientEventHandler(null, "InvokeHelp", onInvokeHelp);
      registerClientEventHandler(null, "SetHelpURL", onSetHelpURL);
   }
}


/** 
 * called to set the help url
 *
 * @param helpURL Help URL
*/
function onSetHelpURL(helpURL)
{
   g_helpURL = helpURL;
}
         
/** 
 * called to invoke the help 
 */
function onInvokeHelp()
{
   if (g_helpURL != null)
   {
      window.open(g_helpURL);
   }
}

/**
* called when a user clicks on a help button
*/
function onClickHelp()
{
   fireClientEvent("InvokeHelp");
}


// end
