/******************************************************************
 
Copyright © Global Knowledge Software LLC 2006.  All Rights Reserved.
 
This program is protected by U.S. and International Copyright and
Patent Laws.  Unauthorized duplication and/or distribution of this
program is strictly prohibited. Distribution and duplication of this
program are limited by license. If you do not currently have a valid
license from Global Knowledge for this program, any copying or
distribution of the program is unauthorized.  If you do have a current
license from Global Knowledge to utilize this program, your use is
strictly limited by the terms of that license.
 
Patent Pending.
 
******************************************************************/



var popupMenu=0;

function HelpMenu()
{
	this.Open=_AOpen;
	this.Close=_AClose;
	this.Refresh=_ARefresh;
	this.IsOnScreen=_AIsOnScreen;
	this.onScreen=false;
};

function _AOpen(left, top)
{
	if (!popupMenu)
	{
		popupMenu=createPopup();
	};
	aPopBody = popupMenu.document.body;
	popupMenu.document.body.style.borderStyle="solid";
	popupMenu.document.body.style.borderWidth="1px";
	popupMenu.document.body.style.borderColor="gray";
	popupMenu.document.body.style.backgroundColor="f7f7e7";
	popupMenu.document.body.style.marginTop="8px";
	popupMenu.document.body.style.marginBottom="8px";
	popupMenu.document.body.style.marginLeft="8px";
	popupMenu.document.body.style.marginRight="8px";

	popupMenu.document.body.aLink="0000FF";
	popupMenu.document.body.link="0000FF";
	popupMenu.document.body.vLink="0000FF";
	popupMenu.document.body.text="black";

	aPopBody.ondragstart = EventCancel ;
	aPopBody.oncontextmenu = EventCancel ;
//	popupMenu.show(left, top, width,height, object);
	this.onScreen=true;
};

function CorrectPopup()
{
	popupMenu.show(0,0,0,0);
	sp=popupMenu.document.all["actionspan"];
	hsp=sp.offsetHeight;
	wsp=sp.offsetWidth;
	obj = Get_Element("PrefLinkSep");
	objh = obj.offsetHeight;
	popupMenu.show(-(wsp-20),objh,wsp+20,hsp+20,obj);
	helpmenu.onScreen=true;
}

function _AClose()
{
	if(this.onScreen)
	{
		popupMenu.hide();
		this.onScreen=false;
	}
};

function OnActionSelection(v1,v2)
{
	popupMenu.hide();
	this.onScreen=false;
	if (v1=="Help")
	{
		tocban_help_help();
	};
	if (v1=="StartTutorial")
	{
		tocban_help_tutorial(v2);
	};
	if (v1=="CloseW")
	{
		tocban_help_close();
	};
};

function PopupToggle(div)
{
	if (popupMenu.document.all[div].style.display=="none")
		popupMenu.document.all[div].style.display="block";
	else
		popupMenu.document.all[div].style.display="none";
	CorrectPopup()
};

function _ARefresh(prefs,his,alt,next,tmenabled,dmenabled)
{
	if (!this.onScreen)
		return;
	var s="";
	var s="<div id='actionspan' style='font:8pt Arial;width:100' nowrap='true'>";

		s+="<li><a href='#' onclick='parent.OnActionSelection(\"Help\");return false;'>";
		s+=R_toc_help;
		s+="</a></li>";

		s+="<li><a href='#' onclick='parent.PopupToggle(\"tutdiv\")'>";
		s+=R_toc_tutorials;
		s+="</a></li>";
		s+="<div id='tutdiv' style='display:block'>";

			s+="<li style='list-style-type:circle;text-indent:18px'>";
			s+="<a href='#' onclick='parent.OnActionSelection(\"StartTutorial\",\"TOC\");return false;'>";
			s+=R_toc_tut_player;
			s+="</a></li>";

			s+="<li style='list-style-type:circle;text-indent:18px'>";
			s+="<a href='#' onclick='parent.OnActionSelection(\"StartTutorial\",\"S\");return false;'>";
			s+=R_toc_tut_seeit;
			s+="</a></li>";

			s+="<li style='list-style-type:circle;text-indent:18px'>";
			s+="<a href='#' onclick='parent.OnActionSelection(\"StartTutorial\",\"T\");return false;'>";
			s+=R_toc_tut_tryit;
			s+="</a></li>";

			s+="<li style='list-style-type:circle;text-indent:18px'>";
			s+="<a href='#' onclick='parent.OnActionSelection(\"StartTutorial\",\"K\");return false;'>";
			s+=R_toc_tut_knowit;
			s+="</a></li>";

			s+="<li style='list-style-type:circle;text-indent:18px'>";
			s+="<a href='#' onclick='parent.OnActionSelection(\"StartTutorial\",\"D\");return false;'>";
			s+=R_toc_tut_doit;
			s+="</a></li>";

		s+="</div>";

	s+="<br>";
	s+="<a href='#' onclick='parent.OnActionSelection(\"CloseW\");return false;'>";
	s+=R_gimenu_close;
	s+="</a>";
	s+="</div>"

	popupMenu.document.body.innerHTML=s;
//	obj=document.all('screen');
//	popupMenu.show(100,150,230,360,obj);
	CorrectPopup()
	this.onScreen=true;
};

function _AIsOnScreen()
{
	return this.onScreen;
};