//Functions used for displaying the help


function NavigateBack(objHistory)
//Attempt to move back to the last page
{
	if(objHistory.length > 0)
		objHistory.go(-1);
}

function AddCopyright()
//Add the copyright message
{
	document.write ('<p class="Copyright">Copyright © 2010 LJ Create<\/p>');
}

function WriteHelpLegacyLaunchControlObject()
//Write out the HTML for displaying the legacy launch control
{
	document.write('<object classid="clsid:7298A7CB-2651-11D4-BF1C-0080C8DDC92B" width="49" height="41" id="Launcher1" CODEBASE="../../cabs/legacy/lgy_work.CAB#version=1,30,0,1">');
	document.write('<param name="CDRun" value="-1">');
	document.write('<param name="ApplicationExecutable" value>');
	document.write('<param name="ApplicationCommands" value>');
	document.write('<param name="HexTemplate" value>');
	document.write('<param name="UpdateASP" value>');
	document.write('</object>');
}

function WriteHelpLegacyWksSetupControlObject()
//Write out the HTML for displaying the legacy workstation setup control
{
	document.write('<object ID="LauncherSetup" classid="CLSID:7660DBB7-9F7B-4ED0-BC08-7A4503342436" CODEBASE="../../cabs/legacy/lj_html_iface.CAB#version=1,30,0,1">');
	document.write('</object>');
}

function WriteHelpLegacyHTMContentFunctionsObject()
//Write out the HTML for displaying the HTML Content Functions control
{
	document.write('<object ID="RunApp" classid="CLSID:0737D0B3-DE0A-42EF-9DEE-4E4766AD687F" CODEBASE="../../cabs/eContent/LJHTMLContentFunctions.CAB#version=1,0,0,7" width=6 height=2>');
	document.write('</object>');
}

function eContentSetupComplete()
//Setup the eContent Setup page to indicate whether the HTML Content functions control has been installed
{
	//Determine whether the eContent System Component has been installed
	var sShowInstallMsgID = (IsSystemComponentInstalled('RunApp')) ? 'InstallSuccessful' : 'InstallFailed';

	//Attempt to locate the install message on the page	
	var objInstallMessage = (document.all) ? document.all[sShowInstallMsgID] : document.getElementById(sShowInstallMsgID);

	//if found make the object visible
  	if(objInstallMessage)
    		objInstallMessage.style.display = 'block';	
}

function IsSystemComponentInstalled(sSysCompObjName)
//Return wether the passed system component object is installed and created
{
	//Default the component to not be available
	var SysComponentAvailable = false;
	var objTestLaunch = null;

	//if IE4 or greater
	if(IsBrowserIE4orGreater())
  	{
    		//Get the component object
		var objTestLaunch = document.all[sSysCompObjName];

    		//Return true if the component and the object exists
		if(objTestLaunch)
      			if(objTestLaunch.object != null)
        			SysComponentAvailable = true; 
  	}

  	//return whether the system component is available
  	return SysComponentAvailable;
}

function IsBrowserIE4orGreater()
//Return whether browser is IE4 or greater
{
	

	//Default to not being IE 4 or greater
	var BrowserIsIE4 = false;

  	//Return true if Internet Explorer and version is greater than 4
  	if (navigator.appName == 'Microsoft Internet Explorer')
    		if(parseFloat(navigator.appVersion) >= 4)
      			BrowserIsIE4 = true;

	//Return whether the browser is IE4 or greater
  	return BrowserIsIE4;
}
