// ShowHelp.js
// Functions to dicplay help
//////////////////////////////////////

// not implemented,
// it should show a separate window for help
// sPage - ASP file name without extension
// sItem - Item(control) on the page.
//         Empty string for help for the whole page
function ShowHelp(sPage, sItem) {
  var url;
  var options;
  var winHelp;

  url = "Help/ShowHelp.asp?page=" + sPage + "&item=" + sItem;
  options = "location=no,menubar=no,status=no,toolbar=no,resizable=yes,scrollbars=yes";
	winHelp = window.open (url, "ShowHelp", options);
  winHelp.focus();
}

// event handler for both onhelp and oncontextmenu
function doOnHelp(sPage, sItem) {
	if (sPage != "") {
    ShowHelp(sPage, sItem);
	}
  event.returnValue = false;
  event.cancelBubble = true;
}

var sHelpTopic, sHelpChapter;

function setupHelp(topic, chapter) {
  sHelpTopic = topic;
  sHelpChapter = chapter;
	if (document.all) {  // For IE only
	  document.onhelp = doDocumentHelp;
	  document.oncontextmenu = doDocumentHelp;
	}
}

function doDocumentHelp() {
	if (sHelpTopic != "") {
    ShowHelp(sHelpTopic, sHelpChapter);
	}
  event.returnValue = false;
  event.cancelBubble = true;
}

