//=================== DEFINITIONS ===================//
//--- Identify the User's Browser Name and Version
var BrowserIs_IE	= (navigator.userAgent.search('MSIE')		> -1) ? true : false;
var BrowserIs_FF	= (navigator.userAgent.search('Firefox')	> -1) ? true : false;
var BrowserIs_OP	= (navigator.userAgent.search('Opera')		> -1) ? true : false;
var BrowserIs_IE4	= (document.all) ? true : false;
var BrowserIs_IE5 = (document.getElementById &&  document.all) ? true : false;
var BrowserIs_NS6 = (document.getElementById && !document.all) ? true : false;

//--- Define the Email Links for the Site
var MailAddrMike	= "mmichal1" + "@" + "rochester" + ".rr." + "com";
var MailNameMike	= "Michael Michalko";
var MailAddrMaint = "Prime-Phoenix" + "@" + "rochester" + ".rr." + "com";
var MailNameMaint = "Prime-Phoenix";
var MailAddrWMstr = "Webmaster" + "@" + "creativethinking" + ".net";
var MailNameWMstr = "Webmaster";

//--- Define Information for Adding a Favorite/Bookmark to the user's browser
var BookmarkURL   = this.location;
var BookmarkName  = document.title;

//--- Define Date Information for copyright info, checking the "newness" of documents, and general use
var WkdayName		= new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var WkdayAbbr		= new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
var MonthName		= new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var MonthAbbr		= new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
var OrdinalSuffix	= new Array("th", "st", "nd", "rd");

var Today			= new Date();
var CurrMonthID	= Today.getMonth();
var CurrMonthNo	= (CurrMonthID < 10 ? "0" : "") + (CurrMonthID + 1);
var CurrMonthOrd	= GetOrdinal(CurrMonthID + 1);
var CurrMonthName	= MonthName[CurrMonthID];
var CurrMonthAbbr	= MonthAbbr[CurrMonthID];
var CurrDayID		= Today.getDate();
var CurrDayNo		= (CurrDayID < 10 ? "0" : "") + CurrDayID;
var CurrDayOrd		= GetOrdinal(CurrDayID);
var CurrWkdayID	= Today.getDay();
var CurrWkdayName	= WkdayName[CurrWkdayID];
var CurrWkdayAbbr	= WkdayAbbr[CurrWkdayID];
var CurrYearID		= Today.getFullYear();
var CurrYearNo		= "" + CurrYearID;
var CurrYearAbbr	= CurrYearNo.substr(2,2);
var CurrDate		= CurrMonthNo + "/" + CurrDayNo + "/" + CurrYearAbbr;

var DaysSincePublished	= 0;
var DaysInNewnessPeriod	= 30;

//--- Define the Titles and URLs  of the Current, Previous(if any), and Next(if any) pages
var PageThisURL		= "";		//--- URL of current page  (the page selected to be displayed)
var PageThisTitle		= "";		//--- Title of current page
var PagePrevURL		= "";		//--- URL of previous page in series ("None" when current page is first in series)
var PagePrevTitle		= "";		//--- Title of previous page in series ("None" when current page is first in series)
var PageNextURL		= "";		//--- URL of next page in series ("None" when current page is last in series)
var PageNextTitle		= "";		//--- Title of next page in series ("None" when current page is last in series)
var PageFilePrefix	= "";		//--- Item's filename prefix for identifying its section menu type
var NavURL		= new Array();	//--- Array of Item URLs for use in building the internal navigation controls
var NavTitle	= new Array();	//--- Array of Item Titles for use in building the internal navigation controls
var AutoClose_OrphanedPopups	= true;	//--- true = close popup when leaving the launching page, false = keep popup open
var NavBarNeedsPreparation		= true;	//--- Switch for determining whether the Item Nav Bar needs to be prepared

//--- Define the File for playing back Audio Interviews
var AudioInterviewDI09_File	= "images/AUDIO_KeldsenAtBizTechTalk_DI09.mp3";
var AudioInterviewDI14_File	= "images/AUDIO_NewhouseAtConqueringSuccess_DI14.mp3";

//--- Define the Files for the Fechner Color Illusion Exercise's "sub-items"
var FechnerRotate_File	= "DE03a_FechnerIllusionRotate.htm";
var FechnerLinear_File	= "DE03b_FechnerIllusionLinear.htm";

//--- Define the Parameter information used to validate/permit access to subpages
var ParmKeyWord	= "Entry";
var ParmKeyValue	= "Good";
var ParmKeySet		= ParmKeyWord + "=" + ParmKeyValue;
var ParmKey			= "?" + ParmKeyWord + "=";

//--- Define the Miscellaneous pieces used in/by the Submenus 
var BlueLine = '<img src="images/Pic_Icon_LineBlue_Plain.gif" width="100%" height="3" border="0";>';
var CatIcon  = '<span style="font:bold 7pt Verdana;color:black;background-color:yellow">*</span>';
var NewIcon  = '<span style="font:bold 7pt Verdana;color:black;background-color:yellow">&nbsp;NEW</span>&nbsp;';
var NewSpace = '<span style="font:bold 7pt Verdana;color:black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;';
var RevIcon  = '<span style="font:bold 7pt Verdana;color:red;">&#151;&#151;&#62;</span>&nbsp;';
var RevReqd  = "*";

//---------- Define Page Navigation Menu arrays
var PageURL		= new Array ();	//---	Actual Filename of the page (not the entire URL)
var PageQuote	= new Array ();	//---	Quote to be used in the "heading" of the page
var PageName	= new Array ();	//---	Title of the page (Normal Capitalization)
var PageTitle	= new Array ();	//---	UPPERCASE Title of the page (used in the page menus)
var x = 0;	
	 PageURL[x]		= "index.html";				// WP00_TableOfContents.htm";
	 PageName[x]	= "Keyword Workspace";	 		PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;Empty barrels make the most noise.&quot;";
x++;
	 PageURL[x]		= "WP01_Home.htm";
	 PageName[x]	= "Home Page";	 					PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;The artist is not a special person; every person is a special kind of artist.&quot;";
x++;
	 PageURL[x]		= "WP02_AboutMichaelMichalko.htm";
	 PageName[x] 	= "About Michael Michalko";	PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;There are people who transform the sun into a yellow spot<br>and others who transform a yellow spot into the sun.&quot;";
x++;
	 PageURL[x]		= "WP03_Techniques.htm";
	 PageName[x]	= "Techniques";	 				PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;The difference between the right idea and the almost right idea<br>is the difference between lightning and the lightning bug.&quot;";
x++;
	 PageURL[x]		= "WP04_Exercises.htm";
	 PageName[x]	= "Exercises";			 			PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;If you always think the way you've always thought,<BR>you'll always get what you've always gotten.&quot;";
x++;
	 PageURL[x]		= "WP05_Articles.htm";
	 PageName[x]	= "Articles";					 	PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;A grapefruit is a lemon that took a chance.&quot;";
x++;
	 PageURL[x]		= "WP06_Interviews.htm";
	 PageName[x]	= "Interviews";				 	PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;Creativity is the ability to look at the same information<BR>as everyone else and seeing something different.&quot;";
x++;
	 PageURL[x]		= "WP07_ThoughtExperiments.htm";
	 PageName[x]	= "Thought Experiments";	 	PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;We don't see things as they are, we see them as we are.&quot;";
x++;
	 PageURL[x]		= "WP08_CarpeDiem.htm";
	 PageName[x]	= "Carpe Diem";				 	PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;Every person dies, but not every person lives.&quot;";
x++;
	 PageURL[x]		= "WP09_FiveStarReviews.htm";
	 PageName[x]	= "Five Star Reviews";			PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;He can who thinks he can, and he can't who thinks he can't.&quot;";
x++;
	 PageURL[x]		= "WP10_ImagineeringLinks.htm";
	 PageName[x]	= "Imagineering Links";	 		PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;What the caterpillar calls the end of the world, God calls a butterfly.&quot;";
x++;
	 PageURL[x]		= "WP11_CreativityResources.htm";
	 PageName[x]	= "Creativity Resources";	 	PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;Our creativity is decided by what we choose to do as well as by what we refuse to do.&quot;";
x++;
	 PageURL[x]		= "WP12_ContactInformation.htm";
	 PageName[x]	= "Contact Information";	 	PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;There are only two ways to live your life.<br>One is as though nothing is a miracle.&nbsp; The other is as though everything is a miracle.&quot;";
x++;
	 PageURL[x]		= "WP13_BookPreviews.htm";
	 PageName[x]	= "Book Previews";				PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "BOOKS THAT WILL CHANGE THE WAY YOU THINK";
x++;
//	 PageURL[x]		= "WP15_DocumentDownload.htm";
	 PageName[x]	= "Document Download";		 	PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;--- ??? ---&quot;";
x++;
//	 PageURL[x]		= "WP16_DiscussionBoard.htm";
	 PageName[x]	= "Discussion Board";	 		PageTitle[x] = PageName[x].toUpperCase();
	 PageQuote[x]	= "&quot;--- ??? ---&quot;";

var SitePageCount = (PageURL.length - 1);	//--- Count of all page filenames, not including array subset 0.

//---------- Define Qwik Link Page Navigation Menu arrays
var QwikURL		= new Array ();	//---	Actual URL of the page to be displayed onClick
var QwikMsg		= new Array ();	//---	Message to be displayed onMouseOver for QwikURL
var QwikTitle	= new Array ();	//---	Title of the page to be shown in the page menus
	 QwikURL[0]		= "http://www.achieveradio.com/~intentional/";
	 QwikTitle[0]	= "Internet Radio Interview";
	 QwikMsg[0]		= "<p style='font-size:12px;'><b>On December 16th at 6:30 PM MST, Michael Michalko will be the featured<br>guest on Frank Smith's &quot;Brainstorming JAZZ!&quot; Internet radio show.<br><br>To listen to &quot;Brainstorming JAZZ!&quot; and Michael's interview with Frank, click<br>on the highlighted <font color='#C00000'>Internet Radio Interview</font> box and follow the instructions.</b><br><br><span style='font-size:10px;'>If you miss the Michael's interview on December 16th, you may listen to<br>an archived version that will be available a few days after the show's airing.</span></p>";

	 QwikURL[1]		= "http://www.achieveradio.com/~intentional/";
	 QwikTitle[1]	= "Internet Radio Interview";
	 QwikMsg[1]		= "<p style='font-size:12px;'><b>On December 16th at 6:30 PM MST, Michael Michalko was the featured<br>guest on Frank Smith's &quot;Brainstorming JAZZ!&quot; Internet radio show.<br><br>To listen to the archived version of Michael's interview, just click on the<br><font color='#C00000'>Internet Radio Interview</font> box and follow the instructions for archived shows.</b></p>";

	 QwikURL[2]		= "http://www.amcreativityassoc.org/2006Conf.htm";
	 QwikTitle[2]	= "Creativity At Work<br>American Creativity Association<br>International Conference 2006";
	 QwikMsg[2]		= "<p align='center'><img border='0' src='images/Pic_Logo_ACACAW2006.jpg' width='390' height='70'><br><font face='Verdana'><b><font color='#000000' size='4'>American Creativity Association<br>International Conference 2006</font><br><br><font color='#FF0000' size='3'>March 22 - 25, 2006</font><br><font size='2'>with Pre-Conference Institutes<br><font color='#FF0000'>March 20 - 21, 2006</font><br>at Hilton Austin Airport in Austin, TX</b><br><br><font size='1'>Click on the highlighted <font color='#A00000'><b>Creativity</font><font color='#404040'>@</font><font color='#A00000'>Work</b></font> box to learn more.</font></p>";

	 QwikURL[3]		= "http://www.thinkertoys.biz/index.html";
	 QwikTitle[3]	= "THINKERTOYS<br>Innovation Step By Step";
	 QwikMsg[3]		= "<p align='center'><font face='Verdana'><b><font color='#000000' size='4'>&quot;Thinkertoys&quot; programs offered in Far East Asia<br>by the <img border='0' src='images/Pic_Logo_LMI_Academy.gif' align='middle' height='40'> in Hong Kong.</b><br><br></font><font size='2'>To learn more, click on the highlighted <font color='#A00000'><b>Thinkertoys</b></font> logo under your cursor.</font></p>";

	 QwikURL[4]		= "http://www.amcreativityassoc.org/2007Conf-overview.html";
	 QwikTitle[4]	= "Creativity At Work<br>American Creativity Association<br>International Conference 2007";
	 QwikMsg[4]		= "<p align='center'><img border='0' src='images/Pic_Logo_ACACAW2006.jpg' width='390' height='70'><br><font face='Verdana'><b><font color='#000000' size='4'>American Creativity Association<br>International Conference 2007</font><br><br><font color='#FF0000' size='3'>March 21 - 23, 2007</font><br><font size='2'>with Pre- and Post-Conference Institutes<br><font color='#FF0000'>on March 20 and 24, 2007</font><br>at Hilton Austin Airport in Austin, TX</b><br><br><font size='1'>Click on the highlighted <font color='#A00000'><b>Creativity</font><font color='#404040'>@</font><font color='#A00000'>Work</b></font> box to learn more.</font></p>";

var SiteQwikCount = (QwikURL.length - 1);	//--- Count of all Qwik Link page filenames.

//==================== FUNCTIONS ====================//
//--- Check each Page Link to Determine whether it is current page ("inactive link") or not ("active link")
function SetupPageMenu ()
	{
	if (ThisPageIndex < 99)
		CheckStartPage ();
	var thisMenuList	= '<table class="SitePageMenu" cellpadding="0" cellspacing="1">';
	var LinkWidth		= ((BrowserIs_IE4 || BrowserIs_IE5) ? 'width:198px;' : 'width:194px;');
	var PageIndex 		= "";

	for (var MenuPageIndex = 1; MenuPageIndex <= SitePageCount; MenuPageIndex++)
		{
		PageIndex		= (MenuPageIndex < 10) ? "0" + MenuPageIndex : MenuPageIndex;
		if (MenuPageIndex != 13)
			var LinkStyle	= (MenuPageIndex == ThisPageIndex) ? "SitePageLinkDead" : "SitePageLinkLive"
		else
			var LinkStyle	= (MenuPageIndex == ThisPageIndex) ? "SitePageLinkDead_BP" : "SitePageLinkLive_BP";
		var LinkURL		= ((ThisPageIndex < 99) ? '' : '../') + PageURL[MenuPageIndex];
		var LinkCntrl	= (MenuPageIndex == ThisPageIndex) ? 'name="WP' + PageIndex + '"' : 'href="' + LinkURL + '"';
		thisMenuList += '<tr><td align="center" valign="middle">';
		thisMenuList += '<div id="DivWP' + PageIndex + '" class="' + LinkStyle + '">';
		thisMenuList += '<a ' + LinkCntrl + ' onmouseover="HideStatus(); return true;" ';
		thisMenuList += 'class="' + LinkStyle + '" style="margin:0px;padding:2px 0px;' + LinkWidth + '">' + PageTitle[MenuPageIndex] + '</a>';
		thisMenuList += '</div></td></tr>';
		}
	//--- Include Qwik Links, if any, on Home page only
/*	
	if (ThisPageIndex == 1)
		{
		for (QwikLinkIndex = 0; QwikLinkIndex <= SiteQwikCount; QwikLinkIndex++)
			{
			thisMenuList += '<tr><td align="center" valign="middle">';
			thisMenuList += '<div id="QwikLink' + QwikLinkIndex + '" style="">';
			thisMenuList += '<a href="' + QwikURL[QwikLinkIndex] + '" onmouseover="ShowQwikNote(' + QwikLinkIndex + '); return true;" onMouseOut="HideQwikNote();"';
			thisMenuList += 'class="SitePageLinkLive">' + QwikTitle[QwikLinkIndex] + '</a>';
			thisMenuList += '</div></td></tr>';
			}
		}
*/	//---
	thisMenuList += '</table>';
	document.write (thisMenuList);
	}

//--- Hide or Show the Promotional Note Display
function TurnPromoNoteDisplay (ToWhat)
	{
	HideStatus();
	document.getElementById("PromoNoteDisplay").style.display = (ToWhat == "On") ? "block" : "none";
	}

//--- Hide or Show the Link Information Display
function TurnLinkInfoDisplay (ToWhat)
	{
	HideStatus();
	document.getElementById("LinkInfoDisplay").style.display	= (ToWhat == "On") ? "block" : "none";
	}

//--- Toggle the button Up and Down
function ToggleButton (Which, ToWhat)
	{
	HideStatus();
	document.getElementById(Which).style.borderStyle = (ToWhat == "Up") ? "ridge" : "groove";
	}

//--- Load and Show the Qwik Note's contents
function ShowQwikNote (NoteNo)
	{
	HideStatus();
	if (NoteNo)
		document.getElementById("QwikNoteDisplay").innerHTML	= QwikMsg[NoteNo];
	document.getElementById("QwikNoteDisplay").style.display	= "block";
	}
	
//--- Hide and Clear the Qwik Note's contents
function HideQwikNote ()
	{
	document.getElementById("QwikNoteDisplay").style.display	= "none";
//	document.getElementById("QwikNoteDisplay").innerHTML		= "";
	}

//--- Determine whether the page was accessed from within the site, and if not, force visitor to the start page.
function CheckStartPage ()
	{
	var WarningMsg		= "Please enter via the Creative Thinking home page.\n\n     Click on the [   OK   ] button below to enter.\n\n      Thank you ... I'll be waiting for you inside.\n     (Please wipe your feet before you come in.)";
	var PrevPageOK		= (document.referrer.indexOf(PageURL[3]) == -1) ? false : true;
	var RefByPage		= document.referrer;
	var NoRefByPage	= (RefByPage == "") ? true : false;
	var ValidDomain	= document.domain;	//"www.creativethinking.net";	//	document.domain
	var FromFrames		= (parent.frames.length > 0) ? true : false;
	var CurrentPage	= unescape(location.href.substring(location.href.lastIndexOf("/") + 1, location.href.length));
	var StartupPage 	= (CurrentPage == PageURL[0])  ? true : 	//--- index.html
							  (CurrentPage == PageURL[1])  ? true : 	//--- WP01_Home.htm
							  (CurrentPage == PageURL[12]) ? true : 	//--- WP12_ContactInformation.htm
							  false;
	var EntryAllowed = (((NoRefByPage) && (StartupPage)) || (RefByPage.indexOf(ValidDomain) != -1));

/*
	alert("StartPages: "		+PageURL[0]+"  &  "+PageURL[1]
	  	 + "\nEntryPage:  "	+ CurrentPage
	  	 + "\n\nPrevPageOK:  "	+ PrevPageOK
		 + "\n\nTesting?   "	+ Testing
		 + "\nStartup?   " 	+ StartupPage
		 + "\nFromFrames?  " + FromFrames +"  (" + parent.frames.length + " frames)"
		 + "\nReferral?  " 	+ ((NoRefByPage)? false : true) +"   "+RefByPage
		 + "\n\n(NoRefByPage && StartupPage) = "+((NoRefByPage)&&(StartupPage))
		 + "\n\n(RefByPage.indexOf("+ValidDomain+") != -1) = "+ (RefByPage.indexOf(ValidDomain) != -1)
		 + "\n\n\n"+ ((EntryAllowed)?"Welcome":"Sorry!"));
*/
	if (!EntryAllowed)
		{
		if (parent.frames.length > 0)
			{
			if (!StartupPage)
				alert(WarningMsg);
			parent.location.href = PageURL[0];  //--- 0 = index.html
			}
		else
			{
			alert(WarningMsg);
			this.location = PageURL[0];  			//--- 0 = index.html
			}
		}
	}

//--- Check the requested page's parameters to validate/permit entry
function CheckEntryPermission ()
	{
	var WarningMsg	= "Please enter via the Creative Thinking home page,\nand access this document via its Document Library.\n\n     Click on the [   OK   ] button below to enter.\n\n      Thank you ... I'll be waiting for you inside.\n     (Please wipe your feet before you come in.)";
	var ParamURL	= window.location.search;
	var ParamSetup	= ParmKey + ParmKeyValue;				//--- "?Entry=Good"		("?Entry=" + "Good")
	var ParamBegin	= ParamURL.indexOf(ParmKeyWord,0);	//--- find "Entry"
	var ParamEnd	= (ParamBegin == -1) ?  0 : ParamBegin + ParmKeySet.length;
	var ParamValue	= (ParamBegin == -1) ? "" : ParamURL.substr(ParamBegin + ParmKeyWord.length + 1, ParmKeyValue.length);
	var ParamIsOK	= (ParamURL == ParamSetup) ? true : false; 

/*	alert("StartPages: "			+ PageURL[0] + "  &  " + PageURL[1]
	  	 + "\nEntryPage:  "		+ unescape(location.href)
		 + "\n\nParamURL:  "		+ ParamURL
		 + "\nParamBegin:  " 	+ ParamBegin
		 + "\nParamEnd:  " 		+ ParamEnd
		 + "\nParamValue:  " 	+ ParamValue
		 + "\n\nParamIsOK:  " 	+ ParamIsOK
		 + "\n\n\n"+ ((ParamIsOK)?"Welcome":"Sorry!"));
*/ 
	if (!ParamIsOK)
		{
		alert(WarningMsg);
		if (parent.frames.length > 0)
			parent.location.href = PageURL[0]		//--- 0 = index.html, 1 = WP01_Home.htm
		else
			this.location = PageURL[0];				//--- 0 = index.html, 1 = WP01_Home.htm
		}
	}

//--- Build Email Link
function BuildEmailLink (LinkAddr, LinkTitle, LinkWords, LinkStyle)
	{
	var UseTitle = (LinkTitle != "") ? LinkTitle : ("Click to contact " + ((LinkAddr == MailAddrMike) ? MailNameMike : MailNameMaint) + ".");
	var UseStyle = (LinkStyle != "") ? LinkStyle : (LinkAddr == MailAddrMike) ? "" : " style='text-decoration:none;color:#0000A0;'";
	var UseWords = (LinkWords != "") ? LinkWords : ((LinkAddr == MailAddrMike) ? MailAddrMike : MailNameMaint);
	document.write('<a href="' + 'mai' + 'lto:' + LinkAddr + '?' 
					 + 'Sub' + 'ject=' + 'Creative Thinking web site' 
					 + '" title="' + UseTitle + '"' + UseStyle + '>' + UseWords + '</a>');
	}

//--- Create Link for Sending Email to Ask About Content 
function BuildContentLink (LinkTitle, LinkWords, LinkStyle)
	{
	var UseTitle = (LinkTitle == "") ? ('Click to contact ' + MailNameMike + '.') : ('Contact ' + MailNameMike + ' about web site content');
	var UseStyle = (LinkStyle == "") ? 'style="font-size:12px;color:#0000A0;text-decoration:none;"' : '';
	var UseWords = (LinkWords == "") ? MailNameMike : 'HERE';
	document.write('<a ' + UseStyle + ' title="' + UseTitle + '" onmouseover="HideStatus(); return true;"'
					 + 'href="' + 'mai' + 'lto:' + MailAddrMike + '?Sub' + 'ject=' + 'Content of Creative Thinking web site">' + UseWords + '</a>');
	}

//--- Create Link for Sending Email to Report a Problem 
function BuildWMstrLink (LinkWords, LinkStyle)
	{
	var UseStyle = (LinkStyle == "") ? 'style="color:#CE0000;"' : '';
	var UseWords = (LinkWords == "") ? 'Report a Problem'			: 'HERE';
	document.write('<a ' + UseStyle + ' title="Report a problem encountered" onmouseover="HideStatus(); return true;"'
					 + 'href="' + 'mai' + 'lto:' + MailAddrWMstr + '?Sub' + 'ject=' + 'Problem encountered on Creative Thinking web site">' + UseWords + '</a>');
	}

//--- Create Link for Submitting a Personal Book Review 
function BuildBookReviewLink (LinkWords, LinkStyle)
	{
	var UseStyle = (LinkStyle == "") ? 'style="color:#A00000;font-size:10pt;"' : '';
	var UseWords = (LinkWords == "") ? 'Book Review' 				: 'HERE';
	document.write('<a ' + UseStyle + ' title="Write and Submit Your Review." onmouseover="HideStatus(); return true;"'
					 + 'href="' + 'mai' + 'lto:' + MailAddrWMstr + '?Sub' + 'ject=' + 'Review of Thinkertoys/Cracking Creativity">' + UseWords + '</a>');
	}

//--- Create Link for Sending Email to Request a Reciprocal Link 
function BuildRequestLink (LinkWords, LinkStyle)
	{
	var UseStyle = (LinkStyle == "") ? 'style="color:#CE0000;"' : '';
	var UseWords = (LinkWords == "") ? 'Link Request' 				: 'HERE';
	document.write('<a ' + UseStyle + ' title="Request Reciprocal Links (Link Exchange)" onmouseover="HideStatus(); return true;"'
					 + 'href="' + 'mai' + 'lto:' + MailAddrWMstr + '?Sub' + 'ject=' + 'Request for Reciprocal Link (Link Exchange) with Creative Thinking web site">' + UseWords + '</a>');
	}

//--- Create Link for Sending Email to Devel/Maint group 
function BuildMaintLink (LinkTitle, LinkWords, LinkStyle)
	{
	var UseTitle = (LinkTitle == "") ? ('Click to contact ' + MailNameMaint + '.') : 'Submit question/comment about Design/Devel/Maint';
	var UseStyle = (LinkStyle == "") ? 'style="font-size:12px;color:#0000A0;text-decoration:none;"' : '';
	var UseWords = (LinkWords == "") ? MailNameMaint : 'HERE';
	document.write('<a ' + UseStyle + ' title="' + UseTitle + '" onmouseover="HideStatus(); return true;"'
					 + 'href="' + 'mai' + 'lto:' + MailAddrMaint + '?Sub' + 'ject=' + 'Design/Devel/Maint of Creative Thinking website">' + UseWords + '</a>');
	}

//--- Insert Notice of New Documents (located beneath Page menu on Home Page)
function InsertNewNotice ()
	{
	var InfoLine = '<div class="InfoLine">';
	var LineBeg		= "<a href='";
	var LineMid		= "' title='Click to view' style='color:#BB0000;text-decoration:none;' onmouseover='HideStatus(); return true;'>";
	var LineEnd		= "</a>";
	if ((TecNewDocCount + ExeNewDocCount + ArtNewDocCount + IntNewDocCount 
	  + TX_NewDocCount + CD_NewDocCount + All_NewRevCount + LnkNewCount + BP_NewDocCount) > 0)
		{
		//------ Techniques
		if (TecNewDocCount > 0)
			InfoLine += LineBeg + PageURL[3] + LineMid + NewIcon + "Techniques" + LineEnd;
		InfoLine += (InfoLine.substr(InfoLine.length - 4, 4) == LineEnd) ? "<br>" : "";
		//------ Exercises
		if (ExeNewDocCount > 0)
			InfoLine += LineBeg + PageURL[4] + LineMid + NewIcon + "Exercises" + LineEnd;
		InfoLine += (InfoLine.substr(InfoLine.length - 4, 4) == LineEnd) ? "<br>" : "";
		//------ Articles
		if (ArtNewDocCount > 0)
			InfoLine += LineBeg + PageURL[5] + LineMid + NewIcon + "Articles" + LineEnd;
		InfoLine += (InfoLine.substr(InfoLine.length - 4, 4) == LineEnd) ? "<br>" : "";
		//------ Interviews
		if (IntNewDocCount > 0)
			InfoLine += LineBeg + PageURL[6] + LineMid + NewIcon + "Interviews" + LineEnd;
		InfoLine += (InfoLine.substr(InfoLine.length - 4, 4) == LineEnd) ? "<br>" : "";
		//------ Thought Experiments
		if (TX_NewDocCount > 0)
			InfoLine += LineBeg + PageURL[7] + LineMid + NewIcon + "Thought Experiments" + LineEnd;
		InfoLine += (InfoLine.substr(InfoLine.length - 4, 4) == LineEnd) ? "<br>" : "";
		//------ Carpe Diem
		if (CD_NewDocCount > 0)
			InfoLine += LineBeg + PageURL[8] + LineMid + NewIcon + "Carpe Diem Material" + LineEnd;
		InfoLine += (InfoLine.substr(InfoLine.length - 4, 4) == LineEnd) ? "<br>" : "";
		//------ All Reviews (Thinkertoys & Cracking Creativity)
		if (All_NewRevCount > 0)
			InfoLine += LineBeg + PageURL[9] + LineMid + NewIcon + "Five Star Reviews" + LineEnd;
		InfoLine += (InfoLine.substr(InfoLine.length - 4, 4) == LineEnd) ? "<br>" : "";
		//------ Imagineering Links
		if (LnkNewCount > 0)
			InfoLine += LineBeg + PageURL[10] + LineMid + NewIcon + "Imagineering Links" + LineEnd;
		InfoLine += (InfoLine.substr(InfoLine.length - 4, 4) == LineEnd) ? "<br>" : "";
		//------ Book Previews (Thinkertoys & Cracking Creativity)
		if (BP_NewDocCount > 0)
			InfoLine += LineBeg + PageURL[13] + LineMid + NewIcon + "Book Previews" + LineEnd;
		InfoLine += (InfoLine.substr(InfoLine.length - 4, 4) == LineEnd) ? "<br>" : "";
		if (InfoLine.substr(InfoLine.length - 4, 4) == "<br>")
			InfoLine = InfoLine.substr(0, InfoLine.length - 4);
		InfoLine += '</div>';
		document.write (InfoLine);
		}
	}

//--- Check whether a date is still within the 30 day "newness" period
function StillNew(PublishDate)
	{
	DaysSincePublished = (Math.round((Date.parse(CurrDate) - Date.parse(PublishDate)) / (24 * 60 * 60 * 1000)) * 1);
	return (DaysSincePublished > DaysInNewnessPeriod) ? false : true;
	}

//--- Add a Favorite/Bookmark to Browser
function AddBookmark (TheObj, The)
	{
	this.blur();
	if (BrowserIs_IE)				//--- Internet Explorer
		window.external.AddFavorite(BookmarkURL, BookmarkTitle);
	else if (BrowserIs_FF) 		//--- Firefox
		window.sidebar.addPanel(BookmarkTitle, BookmarkURL, "");
	else								//--- All other browswers
		DoNuffin();
	return false;
	}

//--- Create Link for Adding a Favorite/Bookmark to Browser
function CreateBookmarkLink ()
	{
	var BookmarkNote	= "";
	var BookmarkText	= "";
	if (BrowserIs_IE)				//--- Internet Explorer
		{
		BookmarkNote = "Click to add this page to your IE Favorites!";
		BookmarkText = "Click to add to your IE Favorites.";
		}
	else if (BrowserIs_FF) 		//--- Firefox
		{
		BookmarkNote = "Click to add this page to your Firefox Bookmarks!";
		BookmarkText = "Click to add to Firefox Bookmarks.";
		}
	else if (BrowserIs_OP)		//--- Opera
		{
		BookmarkNote = "Press [Ctrl-D] to add this page to your Opera Bookmarks!";
		BookmarkText = "Press [Ctrl-D] to bookmark this pg.";
		}
	else								//--- All other browswers
		{
		BookmarkNote = "Press [Ctrl-D] to add this page to your Favorites/Bookmarks!'";
		BookmarkText = "Press [Ctrl-D] to bookmark this pg.";
		} 
	document.write('<div class="Bookmark" title="' + BookmarkNote + '" '
					 + 'onclick="javascript:AddBookmark();" '
					 + 'onmouseover="this.className=\'Bookmark_Over\';" '
					 + 'onmouseout="this.className=\'Bookmark\';" '
					 + '>' + BookmarkText + '</div>');
	}

//--- Show or Hide an object depending on its current display state
function ShowHide (DivID)
	{
	var Gizmo = (document.getElementById(DivID).style.display == "none") ? "block" : "none";
	document.getElementById(DivID).style.display = Gizmo;
	}

//--- Display a publication's "Purchase at Amazon. com" message on the status line
function ShowBuyMe (ThePublication)
	{
	var TheMsg = "Purchase " + ThePublication + " at Amazon.com";
	ShowStatus(TheMsg);
	}

//--- Display a message on the current page's status line
function ShowStatus (TheMessage)
	{
	self.status = TheMessage;
	}

//--- Hide the (Display a blank) status line message for the current page
function HideStatus ()
	{
	self.status = " ";
	}

//--- This is a dummy function that does nothing and prevents an error
function DoNuffin ()
	{
	status = " ";
	}

//--- When users try to directly access a library document, redirect them to the startup page 
function PerformChecks()
	{
	CheckEntryPermission();
	}

//--- Display copyright notice with embedded link
function DisplayCopyright_Link (LastModified)
	{
	document.write("<img src='../images/Pic_Icon_Spacer_1x1.gif' alt='' width='1' height='5' gallerying='no'><br>");
	document.write("<span class='Copyright'><font face='Verdana' size='1' color='#000000'>Copyright © 2003-" + CurrYearNo + ", <a style='color:#000000;text-decoration:none;'"
			+ "title='Click to contact " + MailNameMike + ".' onmouseover='HideStatus(); return true;'"
			+ "href='" + "mai" + "lto:" + MailAddrMike + "?Sub" + "ject=" + "Creative Thinking web site'>" 
			+ "<b>" + MailNameMike + "</b></a>, All Rights Reserved</span>");
	if (LastModified)
		document.write("<br>" + ShowUpdateDate(LastModified));
	}

//--- Display copyright notice
function DisplayCopyright (LastModified)
	{
	document.write("<img src='../images/Pic_Icon_Spacer_1x1.gif' alt='' width='1' height='5' gallerying='no'><br>");
	document.write("<span class='Copyright'><font face='Verdana' size='1' color='#000000'>Copyright © 2003-" + CurrYearNo + ", " + MailNameMike + ", All Rights Reserved</span>");
	if (LastModified)
		document.write("<br>" + ShowUpdateDate(LastModified));
	}
function DisplayCopyNote (LastModified)
	{
	document.write("<img src='../images/Pic_Icon_Spacer_1x1.gif' alt='' width='1' height='5' gallerying='no'><br>");
	document.write("<span class='CopyNote'><font face='Verdana' size='1' color='#000000'>Copyright © 2003-" + CurrYearNo + ", " + MailNameMike + ", All Rights Reserved</span>");
	if (LastModified)
		document.write("<br>" + ShowUpdateDate(LastModified));
	}

//--- Display the page's "last modified" date
function ShowUpdateDate (LastModified)
	{
	var LastMod		= new Date(LastModified);
	var TheWkday	= WkdayName[LastMod.getDay()];
	var TheMonth	= MonthName[LastMod.getMonth()];		//---	MonthAbbr[LastMod.getMonth()] + ".";
	var TheDayOrd	= GetOrdinal(LastMod.getDate());
	var TheYear		= LastMod.getFullYear();
	return "<span class='Copyright' style='border:none;'><font face='Verdana' size='1' color='#808080'>Updated on " + TheWkday + ", " + TheMonth + " " + TheDayOrd + " " + TheYear + ", by Prime-Phoenix</font></span>";
	}

//--- Display the number as an ordinal
function GetOrdinal (TheNumber)
	{
	var Wk_Num = ((TheNumber < 10) ? "0" : "") + TheNumber;
	var Wk_Idx = (((TheNumber > 3) && (TheNumber < 21)) || ((TheNumber > 23) && (TheNumber < 31))) ? 0 : Wk_Num.substring(1,2);
	return TheNumber + OrdinalSuffix[Wk_Idx];
	}

//--- Initialize the "Click To Close" button and keep it from scrolling with page
var PopupMarginsNeedSetting = true;
function CheckFloatingButton()
	{
	//--- Check for Setup ONLY once (during first iteration)
	if (PopupMarginsNeedSetting)
		{
		//--- Set the appropriate Left margin for Popup documents
		if (BrowserIs_IE4 || BrowserIs_IE5)
			document.styleSheets["SpecialStyles"].addRule(".DocBody","margin-left:14; margin-top:1; margin-right:1; margin-bottom:10; background-color:#FFFFF6; font:bold 12px Times; color:#0000A0; z-index:0;")
		else
			document.getElementById("SpecialStyles").sheet.insertRule(".DocBody { margin-left:1; margin-top:1; margin-right:1; margin-bottom:10; background-color:#FFFFF6; font:bold 12px Times; color:#0000A0; }", document.getElementById("SpecialStyles").sheet.cssRules.length);
		PopupMarginsNeedSetting = false;
		}
	if (BrowserIs_IE4 || BrowserIs_IE5)
		{
		document.getElementById('ButtonLeftFloat').style.display = "block";
		document.getElementById('ButtonLeftFloat').style.top = document.body.scrollTop + 100;
		document.getElementById('ButtonLeftFloat').innerHTML = "CLICK 2 CLOSE";
		setTimeout("CheckFloatingButton();",10);
		}
	}

//--- Load the internal Item Navigation Control array for the current document 
function LoadAndBuildItemNavBar (CntrlLocn)
	{
	var DocSeqNo   = 1;
	PageThisURL	   = unescape(location.href.substring(location.href.lastIndexOf("/") + 1, location.href.length));
	PageThisURL		= PageThisURL.replace("+", " ");
	PageFilePrefix = PageThisURL.substr(0,2);
	NavURL[0]      = "None";
	NavTitle[0]    = "None";
//alert ("PageFilePrefix="+PageFilePrefix+"\nTecURL[0]="+TecURL[0]+", ExeURL[0]="+ExeURL[0]+", ArtURL[0]="+ArtURL[0]+", IntURL[0]="+IntURL[0]+"\n");
	if (PageFilePrefix == TecURL[0])
		{
		for (i = 1; i <= TecMenuCount; i++)
			{
			NavURL[DocSeqNo]     = TecURL[i];
			NavTitle[DocSeqNo]   = TecTitle[i];
			DocSeqNo += 1;
			}
		}
	else if (PageFilePrefix == ExeURL[0])
		{
		for (i = 1; i <= ExeMenuCount; i++)
			{
			NavURL[DocSeqNo]     = ExeURL[i];
			NavTitle[DocSeqNo]   = ExeTitle[i];
			DocSeqNo += 1;
			}
		}
	else if (PageFilePrefix == ArtURL[0])
		{
		for (i = 1; i <= ArtMenuCount; i++)
			{
			NavURL[DocSeqNo]     = ArtURL[i];
			NavTitle[DocSeqNo]   = ArtTitle[i];
			DocSeqNo += 1;
			}
		}
	else if (PageFilePrefix == IntURL[0])
		{
		for (i = 1; i <= IntMenuCount; i++)
			{
			NavURL[DocSeqNo]     = IntURL[i];
			NavTitle[DocSeqNo]   = IntTitle[i];
			DocSeqNo += 1;
			}
		}
	NavURL[DocSeqNo]	 = "None";
	NavTitle[DocSeqNo] = "None";
	//--- Capture the URLs and Titles of the Current, Previous(if any), and Next(if any) pages
//alert ("PageThisURL="+PageThisURL+"\nNavURL[0]="+NavURL[0]+"\nNavURL[1]="+NavURL[1]+"\nNavURL[2]="+NavURL[2]+"\nNavURL[3]="+NavURL[3]+"\nNavURL[4]="+NavURL[4]+"\nNavURL[5]="+NavURL[5]+"\nNavURL[6]="+NavURL[6]+"\n");
	for (i = 0; i < NavURL.length; i++)
		{
		if (PageThisURL == (NavURL[i] + ParmKeyValue))
			{
			PageThisTitle   = NavTitle[i];
			PagePrevURL     = NavURL[i - 1]	+ ((NavURL[i - 1] == "None") ? "" : ParmKeyValue);
			PagePrevTitle   = NavTitle[i - 1];
			PageNextURL     = NavURL[i + 1]	+ ((NavURL[i + 1] == "None") ? "" : ParmKeyValue);
			PageNextTitle   = NavTitle[i + 1];
			break;
			}
		}
	BuildItemNavBar(CntrlLocn);
	}

function BuildItemNavBar (ControlLocation)
	{
	var WrapperBeg, WrapperEnd = "";
	var Row1, Row1Col1, Row1Col2, Row1Col3 = "";
	var Row2, Row2Col1, Row2Col2, Row2Col3 = "";
	var specPageType = ((PageThisURL.substr(1,1) == "A") ? "Article" : ((PageThisURL.substr(1,1) == "E") ? "Exercise" : ((PageThisURL.substr(1,1) == "I") ? "Interview" : ((PageThisURL.substr(1,1) == "T") ? "Technique" : "Unknown"))));
	var specPageLabel = '<font color="#BB0000" size="' + ((ControlLocation == "top") ? 4 : 3) + '" face="Times">Creative Thinking - ' + specPageType + '</font>';
	var specPageTitle = '<font color="#000000" size="' + ((ControlLocation == "top") ? 4 : 3) + '">' + PageThisTitle + '</font>';
	var specPageClose = '<a href="javascript:parent.window.focus();top.window.close();" onmouseover="status=' + '\' \'; return true;" style="font:bold 10px Verdana;color:#BB0000;text-decoration:none;">-->&nbsp;CLICK HERE TO CLOSE&nbsp;<--</a>';
	var specPagePrev	= '<a href="' + PagePrevURL + '" ' + ((PagePrevURL == "None") ? 'class="DocNavControlDead">'     : 'class="DocNavControlLive" onmouseover="status=' + '\' \'; return true;"><font face="Wingdings" size="4">E</font> ') + PagePrevTitle + '</a>';
	var specPageNext	= '<a href="' + PageNextURL + '" ' + ((PageNextURL == "None") ? 'class="DocNavControlDead"><br>' : 'class="DocNavControlLive" onmouseover="status=' + '\' \'; return true;">') + PageNextTitle + ' <font face="Wingdings" size="4">F</font></a>';
	WrapperBeg  = '<tr><td width="100%" class="DocNavControlBox"><table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFF6">';
	Row1Col1  = '<tr><td width="30%" align="left" valign="bottom">	<div align="left">'   + specPagePrev  + '</div></td>';
	Row1Col2  =     '<td width="40%" align="center">					<div align="center">' + specPageLabel + '</div></td>';
	Row1Col3  =     '<td width="30%" align="right" valign="bottom"><div align="right">'  + specPageNext  + '</div></td></tr>';
	Row1		 = Row1Col1 + Row1Col2 + Row1Col3;
	Row2Col1  = '<tr><td width="30%" align="left" valign="bottom"> <div align="left">'   + specPageClose + '</div></td>';
	Row2Col2  =     '<td width="40%" align="center">               <div align="center">' + specPageTitle + '</div></td>';
	Row2Col3  =     '<td width="30%" align="right" valign="bottom"><div align="right">'  + specPageClose + '</div></td></tr>';
	Row2		 = Row2Col1 + Row2Col2 + Row2Col3;
	WrapperEnd  = '</table></td></tr>';
	document.write (WrapperBeg + Row1 + Row2 + WrapperEnd);
	}

//--- Build the external link Popup 'Closer' Control in the specified location 
function BuildPopupCloser ()
	{
	var specPageClose = '<a href="javascript:parent.window.focus();top.window.close();" onmouseover="status=' + '\' \'; return true;" style="font:bold 10px Verdana;color:#BB0000;text-decoration:none;">-->&nbsp;CLICK HERE TO CLOSE&nbsp;<--</a>';
	document.write ('<tr><td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#FFFFF6">'
					  + '<tr><td width="25%" align="left" valign="middle">'  + specPageClose + '</td>'
					  + '<td width="50%" align="center"><b><font color="#BB0000" size="4" face="Times">Creative Thinking - Inspire Your Imagination</font></b></td>'
					  + '<td width="25%" align="right" valign="middle">' + specPageClose + '</td></tr></table></td></tr>');
	}
//--- 