function CreateTitleBar (IP_DocID, IP_Locn) 
	{
	var BarLocn		= IP_Locn.toUpperCase();
	var BarData		= "";
	var DocKey		= IP_DocID.substr(0,2).toUpperCase();
	var DocNo		= IP_DocID.substr(2,2) - 0;	//--- force it to be numeric
	var DocType		= "";
	var DocTitle	= "";
	var DocCloser	= "javascript:parent.window.focus();top.window.close();";
	switch (DocKey)
		{
		case "CD"	:
			DocType	= "Carpe Diem";
			DocTitle	= CD_Title[DocNo];
			break; 
		case "DA"	:
			DocType	= "Article";
			DocTitle	= ArtTitle[DocNo];
			break; 
		case "DE"	:
			DocType	= "Exercise";
			DocTitle	= ExeTitle[DocNo];
			break; 
		case "DI"	:
			DocType	= "Interview";
			DocTitle	= IntTitle[DocNo];
			break; 
		case "DT"	:
			DocType	= "Technique";
			DocTitle	= TecTitle[DocNo];
			break; 
		case "DX"	:
			DocType	= "Thought Experiment";
			DocTitle	= TX_Title[DocNo];
			break; 
		case "BP"	:
			DocType	= "Book Preview";
			DocTitle	= BP_Title[DocNo];
			break; 
		case "PP"	:
			DocType	= PP_Note[DocNo];
			DocTitle	= PP_Title[DocNo];
			DocCloser= "javascript:window.close();"		//"WP01_Home.htm";
			break; 
		default		:
			DocType	= "unknown";
			DocTitle	= "unknown";
			break;
		}
	if (DocTitle == "unknown") 
		alert("Unknown Title = " + DocTitle + "\n")
	else
	if ((BarLocn != "TOP") && (BarLocn != "BOTTOM"))
		alert("Error: Invalid Location =[" + IP_Locn + "]\nThe location must be 'top' or 'bottom'.")
	else
		{
		BarData  	=  '<div align="center" style="text-align:center;border-left:2px solid silver;border-' + BarLocn + ':2px solid silver;border-right:2px solid silver;">'
						+  '	<table width="100%" border="0" cellspacing="0" cellpadding="2">'
						+  '		<tr>'
						+  '			<td width="100" align="left" style="text-align:left;padding-left:10px;">'
						+  '				<div onclick="' + DocCloser + '" class="QwikCloseBtn">CLICK HERE<br>TO CLOSE</a>'
						+  '			</td>'
						+  '			<td width="100%" align="center" style="text-align:center;">';
		if (BarLocn == "TOP")
			BarData 	+= '				<b><font color="#000000" size="4" face="Times">' + DocType + '</font></b><br>';
		BarData  	+= '				<b><font color="#BB0000" size="3" face="Times">' + DocTitle + '</font></b>'
						+  '			</td>'
						+  '			<td width="100" align="right" style="text-align:right;padding-right:10px;">'
						+  '				<div onclick="' + DocCloser + '" class="QwikCloseBtn">CLICK HERE<br>TO CLOSE</a>'
						+  '			</td>'
						+  '		</tr>'
						+  '	</table>'
						+  '</div>';
		document.write(BarData);
		}
	}

//---------- Open a Window for Requested Document
function OpenDocWindow (Document_ID) 
	{
	var Document_No		 = Document_ID.substr(2,2) - 0;	//--- force it to be numeric
	var DocumentPopup_URL = ((Document_ID.charAt(0) == "B") ? BP_URL[Document_No] 
	 							 : ((Document_ID.charAt(1) == "T") ? TecURL[Document_No] 
								 : ((Document_ID.charAt(1) == "E") ? ExeURL[Document_No] 
								 : ((Document_ID.charAt(1) == "A") ? ArtURL[Document_No] 
								 : ((Document_ID.charAt(1) == "I") ? IntURL[Document_No] 
								 : ((Document_ID.charAt(1) == "D") ? CD_URL[Document_No] 
								 : ((Document_ID.charAt(1) == "X") ? TX_URL[Document_No] 
								 : ((Document_ID.charAt(1) == "P") ? PP_URL[Document_No] 
								 : "unknown"))))))));
//	alert("URL = " + DocumentPopup_URL + "\n0 = " + Document_ID.substr(0,1) + "\n1 = " + Document_ID.substr(1,1) + "\n2 = " + Document_ID.substr(2,1) + "\n3 = " + Document_ID.substr(3,1) + "\n");
	if (DocumentPopup_URL == "unknown")
		return
	else
		DocumentPopup_URL += ParmKeyValue;
 
	var DocumentPopup_Width		= ((BrowserIs_IE4 || BrowserIs_IE5) ? screen.width  - 10 : screen.width);
	var DocumentPopup_Height	= ((BrowserIs_IE4 || BrowserIs_IE5) ? screen.height - 30 : screen.height);
	var DocumentPopup_Optns		= ((BrowserIs_IE4 || BrowserIs_IE5) ? "fullscreen=1," : "") + "scrollbars=1,resizable=1,width=" + DocumentPopup_Width + ",height=" + DocumentPopup_Height;
	var DocumentPopup_Window	= window.open(DocumentPopup_URL,"NewWindow",DocumentPopup_Optns);
	DocumentPopup_Window.focus();
	DocumentPopup_Window.moveTo(0,0);
	DocumentPopup_Window.resizeTo(DocumentPopup_Width, DocumentPopup_Height);
	if (AutoClose_OrphanedPopups)
		window.onunload = function(){DocumentPopup_Window.close();}
	}

//---------- Create and Display the menu of Available Documents
function DisplayAvailableDocuments (TheCategory) 
	{
	var SubHead	= '<ul style="list-style-type:none; width:100%; margin:0px; padding:0px; text-align:left; vertical-align:top;">';
	var SubList = '';
	var SubFoot = '</ul>';
	var SubMenu = '';
	var SubIdNo = '';
	var TheInfo	= '';
	//--- Operating Instructions
//	document.write('<div align="center"><br><div style="width:600px;font:11px Verdana;border:1px solid #000000;padding:5px;margin-bottom:20px;">' 
//					 + '<font color="#990000"><b>Note: </b></font>Some browsers have &#39;pop-up stoppers&#39; that prevent our documents from properly '
//					 + 'opening in a new window.&nbsp; If you have difficulty opening these documents, then either temporarily disable (or turn off) '
//					 + 'your browser&#39s &#39;pop-up stopper&#39; or hold down the [Ctrl] key when clicking to open a document.</div></div>');
	document.write('<div style="width:100%;align:center;border:1px solid #A0A0A0;margin-bottom:20px;background-color:#EAEAEA;">' 
					 + '<table width="100%" border="0" cellpadding="0" cellspacing="0" style="font:11px Verdana;color:#990000">');
	if (TheCategory == "Previews")
		{
		TheInfo	= '<tr><td width="160"><b>To view a preview...</b></td><td width="600"><b>Click on its title or description to select it and it will be displayed in a new window.</b></td></tr>'
					+ '<tr><td width="160"><b>To return to this page...</b></td><td width="600"><b>Close the selected preview&#39;s new window.</b></td></tr>';
		}
	else
		{
		TheInfo	= '<tr><td width="160"><b>To view a document...</b></td><td width="600"><b>Click on its title or description to select it and it will be displayed in a new window.</b></td></tr>'
					+ '<tr><td width="160"><b>To return to this page...</b></td><td width="600"><b>Close the selected document&#39;s new window.</b></td></tr>';
		}
	document.write(TheInfo + '</table></div>');
					 
	switch (TheCategory)
		{
		case	"Techniques"	:	//---------- Available Technique Documents
			SubList	= '<li id="DT00" class="DocMenuDtl" style="border:0px;font-size:12pt;font-weight:bold;color:#000080;cursor:default;">Library of Techniques:</li>';
			for (i = 1; i <= TecMenuCount; i++)
				{
				SubIdNo  = "DT" + (i < 10 ? "0" : "") + i;
				SubList += '<li id="' + SubIdNo + '" class="DocMenuDtl" onclick="OpenDocWindow(this.id);" '
							+ 'onmouseover="HiLite(this.id);" onmouseout="LoLite(this.id);"><script language="JavaScript">'
							+ 'DisplayDescription(TecTitle[' + i + '], TecNote[' + i + '], TecNewDocDate[' + i + ']);</script></li>';
				}
			SubMenu	= SubHead + SubList + SubFoot;
			document.write('<div id="TecDocMenu" style="display:block;vertical-align:top;">' + SubMenu + '</div>');
			break;

		case	"Exercises"		:	//---------- Available Exercise Documents
			SubList	= '<li id="DE00" class="DocMenuDtl" style="border:0px;font-size:12pt;font-weight:bold;color:#000080;cursor:default;">Library of Exercises:</li>';
			for (i = 1; i <= ExeMenuCount; i++)
				{
				SubIdNo  = "DE" + (i < 10 ? "0" : "") + i;
				SubList += '<li id="' + SubIdNo + '" class="DocMenuDtl" onclick="OpenDocWindow(this.id);" '
							+ 'onmouseover="HiLite(this.id);" onmouseout="LoLite(this.id);"><script language="JavaScript">'
							+ 'DisplayDescription(ExeTitle[' + i + '], ExeNote[' + i + '], ExeNewDocDate[' + i + ']);</script></li>';
				}
			SubMenu	= SubHead + SubList + SubFoot;
			document.write('<div id="ExeDocMenu" style="display:block;vertical-align:top;">' + SubMenu + '</div>');
			break;

		case	"Articles"		:	//---------- Available Article Documents
			SubList	= '<li id="DA00" class="DocMenuDtl" style="border:0px;font-size:12pt;font-weight:bold;color:#000080;cursor:default;">Library of Articles:</li>';
			for (i = 1; i <= ArtMenuCount; i++)
				{
				SubIdNo  = "DA" + (i < 10 ? "0" : "") + i;
				SubList += '<li id="' + SubIdNo + '" class="DocMenuDtl" onclick="OpenDocWindow(this.id);" '
							+ 'onmouseover="HiLite(this.id);" onmouseout="LoLite(this.id);"><script language="JavaScript">'
							+ 'DisplayDescription(ArtTitle[' + i + '], ArtNote[' + i + '], ArtNewDocDate[' + i + ']);</script></li>';
				}
			SubMenu	= SubHead + SubList + SubFoot;
			document.write('<div id="ArtDocMenu" style="display:block;vertical-align:top;">' + SubMenu + '</div>');
			break;

		case	"Interviews"	:	//---------- Available Interview Documents
			SubList	= '<li id="DI00" class="DocMenuDtl" style="border:0px;font-size:12pt;font-weight:bold;color:#000080;cursor:default;">Library of Interviews:</li>';
			for (i = 1; i <= IntMenuCount; i++)
				{
				SubIdNo  = "DI" + (i < 10 ? "0" : "") + i;
				SubList += '<li id="' + SubIdNo + '" class="DocMenuDtl" onclick="OpenDocWindow(this.id);" '
							+ 'onmouseover="HiLite(this.id);" onmouseout="LoLite(this.id);"><script language="JavaScript">'
							+ 'DisplayDescription(IntTitle[' + i + '], IntNote[' + i + '], IntNewDocDate[' + i + ']);</script></li>';
				}
			SubMenu	= SubHead + SubList + SubFoot;
			document.write('<div id="IntDocMenu" style="display:block;vertical-align:top;">' + SubMenu + '</div>');
			break;

		case	"Experiments"	:	//---------- Available Thought Experiment Documents
			SubList	= '<li id="TX00" class="DocMenuDtl" style="border:0px;font-size:12pt;font-weight:bold;color:#000080;cursor:default;">Library of Thought Experiments:</li>';
			for (i = 1; i <= TX_MenuCount; i++)
				{
				SubIdNo  = "TX" + (i < 10 ? "0" : "") + i;
				SubList += '<li id="' + SubIdNo + '" class="DocMenuDtl" onclick="OpenDocWindow(this.id);" '
							+ 'onmouseover="HiLite(this.id);" onmouseout="LoLite(this.id);"><script language="JavaScript">'
							+ 'DisplayDescription(TX_Title[' + i + '], TX_Note[' + i + '], TX_NewDocDate[' + i + ']);</script></li>';
				}
			SubMenu	= SubHead + SubList + SubFoot;
			document.write('<div id="TX_DocMenu" style="display:block;vertical-align:top;">' + SubMenu + '</div>');
			break;

		case	"Carpe Diem"	:	//---------- Available Carpe Diem Documents
			SubList	= '<li id="CD00" class="DocMenuDtl" style="border:0px;font-size:12pt;font-weight:bold;color:#000080;cursor:default;">Library of Carpe Diem Materials:</li>';
			for (i = 1; i <= CD_MenuCount; i++)
				{
				SubIdNo  = "CD" + (i < 10 ? "0" : "") + i;
				SubList += '<li id="' + SubIdNo + '" class="DocMenuDtl" onclick="OpenDocWindow(this.id);" '
							+ 'onmouseover="HiLite(this.id);" onmouseout="LoLite(this.id);"><script language="JavaScript">'
							+ 'DisplayDescription(CD_Title[' + i + '], CD_Note[' + i + '], CD_NewDocDate[' + i + ']);</script></li>';
				}
			SubMenu	= SubHead + SubList + SubFoot;
			document.write('<div id="CD_DocMenu" style="display:block;vertical-align:top;">' + SubMenu + '</div>');
			break;

		case	"Previews"		:	//---------- Available Book Preview Documents
			SubList	= '<li id="BP00" class="DocMenuDtl" style="border:0px;font-size:12pt;font-weight:bold;color:#000080;cursor:default;">Library of Book Previews:</li>';
			for (i = 1; i <= BP_MenuCount; i++)
				{
				SubIdNo  = "BP" + (i < 10 ? "0" : "") + i;
				SubList += '<li id="' + SubIdNo + '" class="DocMenuDtl" onclick="OpenDocWindow(this.id);" '
							+ 'onmouseover="HiLite(this.id);" onmouseout="LoLite(this.id);"><script language="JavaScript">'
							+ 'DisplayDescription(BP_Title[' + i + '], BP_Note[' + i + '], BP_NewDocDate[' + i + ']);</script>'
//							+ '<br>URL: ' + BP_URL[i]
							+ '</li>';
				}
			SubMenu	= SubHead + SubList + SubFoot;
			document.write('<div id="BP_DocMenu" style="display:block;vertical-align:top;">' + SubMenu + '</div>');
			break;

		default					:	//---------- Nothing Else is Available
			break;
		}
	}

//---------- Highlight the Menu Link / Document Description Link
function HiLite (MenuLink)
	{
	document.getElementById(MenuLink).style.backgroundColor = "#FFFFC0";
	}

//---------- Normalize the Menu Link / Document Description Link
function LoLite (MenuLink)
	{
	document.getElementById(MenuLink).style.backgroundColor = "#ffffff";
	}

//---------- Display the Document Description
function DisplayDescription (DocTitle, DocNote, DocDate)
	{
	document.write((DocNote.charAt(0) == RevReqd) ? RevIcon : "");
	document.write((StillNew(DocDate) ? NewIcon : "") + "<font color='#0000A0'>" + DocTitle + "... </font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#A00000'>");
	document.write(((DocNote.charAt(0) == RevReqd) ? DocNote.substr(1,DocNote.length - 1) : DocNote) + "</font>");
	}
