//
//		Main.js
//
//
//*****************************************************************
//*****************************************************************
//
//		Table of Contents
//
//*****************************************************************
//*****************************************************************

/*
0046	Variables.
0160	Browser Functions.

/**/

//*****************************************************************
//*****************************************************************
//
//		Global Variables 
//
//*****************************************************************
//*****************************************************************

//d are commented out debug code used during the creation of the function.
//c are commented out code left in to remind myself that I did think of this option.
//h are Helpful comments.
//x are comments that May be deleted.


// Footer code starts around line 2250.

//	I use sReturn as the return string rather than s in case I need to find/replace the variable.

// turn off the debug statements embedded throughout the code if debug has not been defined.
if (typeof(debug) == 'undefined') var debug = false; 

var DMAX = 5;						// Used to minimize debug outputs in iterative environments.
var dnum = 0;						// See isToken() for example use.
var iDEBUGLEVEL = 0;
// Change 20 to: -1=always, 0=none, 1=main functions, 2=2nd level functions, etc.
(iDEBUGLEVEL > 20) ? dwbl('main.js.a') : '';

bLocalDisk = (location.href.substr(0,4)=="file");

//c	var iDirDepth;							// should be declaired in each HTML file.
var AMPERSAND = '&';
var sBBLChar = '.';							// Bottom Blank Line Character.
var sBLN = "<br />";						// Blank Line in HTML format.
var sBROKENLINKTEXT = 'x';					// Character to disseminate Broken Link.
var sBSL = '\\', BSL = sBSL;				// Backslash.
var sCOMMA = ", ";							// Comma as a separator.
var sCONTENTERRORTEXT = 'Report Error';
var sCURRENTYEAR = new Date().getFullYear();
var sCOPYRIGHT = "Copyright: MrRRIŠ, 1994-"+sCURRENTYEAR;
var sNOH = -99;
//c	var folderDepth = 1;					// Global variable set in each HTML file.
var sEMAILADDR = 'ri12@SalesTime.com';
var sEMPTY = '', EMPTY = sEMPTY;			// Empty string.
var sHR = '<hr />';							// Horizontal Rule (line).
var sDEFAULT = -99;							// value to keep Default value.
var NOMINAL = -99;							// value to not change the norm.
var iNUMBOTTOMBLANKLINES = 25;				// Number of blank lines output at the end of web pages.
var sNBSP = '&nbsp;', NBSP = sNBSP;				// non-breaking space.
var sNEWWINDOWLINKTEXT = 'w';				// Character to disseminate New Window.
var SEP = " : ", sep = SEP, sSEP = SEP;		// Separator for output.
var sPB = "<p>", sPE = "</p>";				// Paragraph Begin and End.
var sSITENAME = "salestime";				// Site name for searches (see sFooterLeft)
var sSpacer = ' | ';						// Used in headers for spacing between links.
var sOtherLinksBegin = "< ";				// Used in headers for start of Other Links.
var sOtherLinksEnd = " >";					// Used in headers for End of Other Links.
var bUNVALIDATEDPAGE = false;
var bVALIDATEDPAGE = true;
var undefined;								// in case javascript doesn't support the undifined property.
var WACK = '\/';							// Forward slash.
var sWACK = WACK;
var W = sWACK;
var iFFFFFF = 16777215;						// Decimal equivalent of FFFFFF.

//	Local directory.
var sMYDOC = "file:///C:/Documents%20and%20Settings/Randall%20Ijams/My%20Documents/";
var sMYDOC = "file:///D:/Randall/Documents/";
var sF = "Financial/";
var sFC = "Financial/Cellular/html/";
var sFCR = "Financial/CreditReports/";
var sFWMH = "Financial/WaMu/Checking%203801631256/html/";
var sMYPIC = "My%20Pictures/";
var sSDST = "_StickData/_SalesTime/";
var sRoot = "_SalesTime.php";

var sTB = '<table>';
var sTE = '</table>';

var sTHB = '<th>';
var sTHE = '</th>';
var sTRB = '<tr>';	// Table Row Begining.
var TRB =sTRB;
var sTRE = '</tr>';	// Table Row Ending.
var TRE = sTRE;
var sTDB = '<td>';	// Table Date (column/cell) Begining.
var TDB = sTDB;
var sTDE = '</td>';	// Table Date (column/cell) Ending.
var TDE = sTDE;

var sULB = '<ul>';			// Unordered List Begining.
var ULB = sULB;				// Unordered List Begining.
var sULE = '<'+WACK+'ul>';	// Unordered List Ending.
var ULE = sULE;				// Unordered List Ending.
var sOLB = '<ol>';			// Ordered List Begining.
var OLB = sOLB;				// Ordered List Begining.
var sOLE = '<'+WACK+'ol>';	// Ordered List Ending.
var OLE = sOLE;				// Ordered List Ending.
var sLIB = '<li>';			// List Item Begining.
var LIB = sLIB;				// List Item Begining.
var sLIE = '<'+WACK+'li>';	// List Item Ending.
var LIE = sLIE;				// List Item Ending.
var sDIVB = '<div>';			// div Ending.
var sDIVE = '<'+WACK+'div>';	// div Ending.

var msSecond = 1000;				//			1,000ms = 1000 milliseconds in a second
var msMinute = msSecond * 60;		//         60,000ms =   60 seconds in a minute
var msHour   = msMinute * 60;		//      3,600,000ms =   60 minutes in an hour
var msDay	 = msHour   * 24;		//     86,400,000ms =   24 hours in a day
var msWeek	 = msDay    * 7;		//    604,800,000ms =    7 days in a week
var msYear	 = msDay    * 365.25;	// 31,557,600,000ms =  365 1/4 days in a year

var msPerSecond = 1000;					//			1,000ms = 1000 milliseconds in a second
var msPerMinute = msPerSecond *  60;	//         60,000ms =   60 seconds in a minute
var msPerHour   = msPerMinute *  60;	//      3,600,000ms =   60 minutes in an hour
var msPerDay	= msPerHour   *  24;	//     86,400,000ms =   24 hours in a day
var msPerWeek	= msPerDay    *   7;	//    604,800,000ms =    7 days in a week
var msPerYear	= msPerDay    * 365.25;	// 31,557,600,000ms =  365 1/4 days in a year
var msPerMonth  = msPerYear / 12;		// Average.

var secondsPerMinute = 60;							//				   60 seconds in a minute
var secondsPerHour   = secondsPerMinute *  60;		//      3,600s =   60 minutes in an hour
var secondsPerDay	 = secondsPerHour   *  24;		//     86,400s =   24 hours in a day
var secondsPerWeek	 = secondsPerDay    *   7;		//    604,800s =    7 days in a week
var secondsPerYear 	 = secondsPerDay    * 365.25;	// 31,557,600s =  365 1/4 days in a year
var secondsPerMonth  = secondsPerYear / 12;			// Average.

var sWindowDefaultStatus = '';


//		(iDEBUGLEVEL > -1) ? (dwbl('aaa')) : '';

var	origWinWidth = 0, origWinHeight = 0;	// Allow restore to original window size.

var lastRandomNum = 0;		// used in the randomNum() function to avoid back to back duplicate numbers

	var sPRTASKS = '';
	sPRTASKS += sHR;
	sPRTASKS += sAName("priority");
	sPRTASKS += '<div align="center" style="border: 1px solid black; width: 90%; text-align:left;">';	//sPB;
	sPRTASKS += "All tasks are listed in priority-order with top task as highest priority.  I allocate my time as follows:";
	sPRTASKS += sULB;
	sPRTASKS += sLIB+"75% to top priority task(s) (30 hours per week)"+sLIE;
	sPRTASKS += sLIB+"10% to smaller tasks (so a 10-minute priority-2 task is not delayed 3 weeks) (4 hours per week)"+sLIE;
	sPRTASKS += sLIB+"10% meetings (4 hours per week)"+sLIE;
	sPRTASKS += sLIB+" 5% Phone and Emails (2 hours per week)"+sLIE;
	sPRTASKS += sULE;
	sPRTASKS += sDIVE;


// navigator.javaEnabled();
// navigator.cookieEnabled;
// document.referrer

/******************************************

function sRound (number, iDecimalPlaces)		192

******************************************/



//-------------------------------
//
//
//	Do not display errors to the general public.
function stopError() {
  return true;
}

//	Comment out the below line while creating and debugging code.
//	window.onerror = stopError;	//ccc



//-------------------------------
//
//
function AAA333()
{
}	// end AAA333().

//*****************************************************************
//*****************************************************************
//
//		Math Functions
//
//*****************************************************************
//*****************************************************************



function sRound (number, iDecimalPlaces) {
  number = number - 0; // force number
  if (iDecimalPlaces == null) iDecimalPlaces = 2;
  var iTens = Math.pow(10, iDecimalPlaces);
  number += Math.pow(10, - (iDecimalPlaces + 1)); // round first
  number = Math.round(number * iTens) / iTens;
  number += Math.pow(10, - (iDecimalPlaces + 1)); // and again
  number += ''; // force string
  return iDecimalPlaces == 0 ? number.substring(0, number.indexOf('.')) :
      number.substring(0, number.indexOf('.') + iDecimalPlaces + 1);
}



function sImageDimensions(sImageSource) {
	var oImage;
	oImage = new Image();
	oImage.src = sImageSource;
	return oImage.width + 'w x ' + oImage.height + 'h';
} // sImageDimensions().



//*****************************************************************
//*****************************************************************
//
//		Browser Functions
//
//*****************************************************************
//*****************************************************************


function wStatusOver(sStatus)
{
//	sWindowDefaultStatus = window.defaultStatus;		// Save original value.
//	window.defaultStatus = sStatus;						// set new value.
	window.status = sStatus;
}

function wStatusOut()
{
//	window.defaultStatus = sWindowDefaultStatus;		// Restore original value.
	window.status = window.defaultStatus;
}



//-------------------------------
//
//
function bFourthGenerationBrowser()
{
//	Old method for checking browsers.
//c	var bName = navigator.appName;
//c	var bVer = parseInt(navigator.appVersion);
//c	var NS4 = (bName == "Netscape" && bVer >= 4);
//c	var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);

//	New method for checking browsers.
	var NS4 = (document.layers) ? 1 : 0;
	var IE4 = (document.all) ? 1 : 0;
	var bFGB = (NS4 || IE4);
	return (bFGB);
}


//-------------------------------
//
//
function bBrowserIE()
{
	var sBrowserName = navigator.appName;
	var bIE = (sBrowserName == "Microsoft Internet Explorer");

	return (bIE);
}

//-------------------------------
//
//
//
//
//
//
function checkBrowser()			// Last revision: 2004.10.05 by Randall Ijams.
{
	var bName=navigator.appName; 
	var bVer=parseInt(navigator.appVersion);
	var newNSVer = 6;					// main version defining newer Netscape browser.
	var newIEVer = 4;					// main version defining newer IE browser.
	var newerBrowser;
	var version = '';
	
	debug ? alert(bName +SEP+ bVer) : '';

	newerBrowser = 					(bName=="Netscape")						&& (bVer>=newNSVer);
	newerBrowser = newerBrowser || 	(bName=="Microsoft Internet Explorer")	&& (bVer>=newIEVer);

	if (newerBrowser) 
	  version="n3"; 
	else 
	  version="n2"; 

	if (!newerBrowser)
	{
		msg = 'You have an older browser.  Some web pages may not appear correctly.';
		window.alert(msg);
	}

} // end checkBrowser()

//-------------------------------
//
//
function goback(iBack)
{
	if (isNothing(iBack)) iBack = 1;
    history.go(-iBack);
}

//*****************************************************************
//*****************************************************************
//
//		Window Functions (for every page)
//
//*****************************************************************
//*****************************************************************


//-------------------------------
//
//	Use meta to redirect.
//
function redirectpage(sURL, iSeconds)
{
	debug ? alert('redirectpage('+sURL+sSEP+iSeconds+')') : '';
	
} // end redirectpage()



//-------------------------------
//
//
//
//
function fullScreen()		// Last revision: 2004.10.05 by Randall Ijams.
{
	debug ? alert('fullScreen()') : '';

//	Need to check for different browsers.
//	Need to find out where the start bar is (bottom, left, top, right)

	var winLeft, winTop, screenWidth, screenHeight, winWidth, winHeight, msg, w, h;

	screenWidth  = screen.Width;
	screenHeight = screen.Height;
	winWidth     = screen.availWidth;
	origWinWidth = winWidth;
	winHeight    = screen.availHeight;
	origWinWidth = winHeight;
//	var avLeft   = parseInt(screen.availLeft);	// IE not implemented.
//	var avTop    = parseInt(screen.availTop);

	
	msg  = "swidth = "    + screenWidth;
	msg += ", sheight = " + screenHeight;
	msg += ", wwidth = "  + winWidth;
	msg += ", wheight = " + winHeight;
//	msg += ", left = "    + avLeft;
//	msg += ", top = "     + avTop;
	
//d	window.alert(msg);

	w = winWidth - 40;
	h = winHeight - 40;
	winLeft = screenWidth  - winWidth + 20;	// assume start bar on left.
	winTop  = screenHeight - winHeight;		// assume start bar on top.
	winTop  = 20;							// assume start bar on bottom.

	self.moveTo(winLeft, winTop);
	self.resizeTo(w, h);
	
} // end fullScreen().





//-------------------------------
//
//
//
function openWin(url, winName, winOptions)
{
	debug ? alert('openWin(' + url + SEP + winName + SEP + winOptions + ')') : '';

	var Win;

	if (winName == undefined)
	{
		winName = '_blank';
	}

	if (winOptions == undefined)
	{
		winOptions  =   'toolbar=yes';
		winOptions += ', menubar=yes';
		winOptions += ', location=yes';
		winOptions += ', scrollbars=yes';
		winOptions += ', resizable=yes';
		winOptions += ', width=700';
		winOptions += ', height=500';
	}

	url = "http://" + url;

//d	alert(url + ", " + winName + ", " + winOptions);

	Win = window.open(url, winName, winOptions);

	Win.focus();
	
} // end openWin().





//-------------------------------
//
//
//
//
function openPopUp(HTMLFileName, winTitle, popupwidth, popuphight, scrollbars)		// Last revision: 2004.10.05 by Randall Ijams.
{
	debug ? alert('openPopUp(' + HTMLFileName +SEP+ winTitle +SEP+ popupwidth + SEP + popuphight + SEP + scrollbars + SEP + ')') : '';
//d	alert('openPopUp(' + HTMLFileName +SEP+ winTitle +SEP+ popupwidth + SEP + popuphight + SEP + scrollbars + SEP + ')');

	var screenhight,b,ut,ul;

	ul=100;
	ut=100;

//	Netscape issue.
//	screenhight=screen.height;
//	screenwidth=screen.width;
//	ul=(screenwidth/2)-(popupwidth/2);
//	ut=(screenhight/2)-(popuphight/2);
//	
//	if(popupwidth > screenwidth)
//	{
//		ul=1;
//		ut=1;
//	}
//
//	if(popuphight > screenheight)
//	{
//		ul=1;
//		ut=1;
//	}

	return tmpopupwidthin = window.open(
		HTMLFileName,
		winTitle, 						// doesn't work?
		"toolbar=no, location=no, resizable=no, status=no, menubar=no, "+
		'scrollbars=' + scrollbars	+ ', ' + 
		'width='	+ popupwidth	+ ', ' +
		'height='	+ popuphight	+ ', ' +
		'left='		+ ul			+ ', ' +
		'top='		+ ut
		); 

}// end pop().


//-------------------------------
//
function openPopUpThanks(HTMLFileName)
{
//d	alert('openPopUpThanks :'+HTMLFileName+SEP);
	var thanksWin;

//	thanksWin = window.open(HTMLFileName,"thanks",		// old version.
//							"toolbar=no, menubar=no, location=no, scrollbars=no, resizable=no, width=400, height=150");

	thanksWin = openPopUp(HTMLFileName,"Thanks", 400, 150, 'no');

	thanksWin.focus();
}

//-------------------------------
//
//
function shakewindow(delta)
{
	debug ? alert('shakewindow('+delta+')') : '';
	
	for (i=0; i<100; i++)
	{
		switch (i%4)
		{
			case 0:
				self.moveBy(delta, 0);
				break;
			case 1:
				self.moveBy(0, delta);
				break;
			case 2:
				self.moveBy(-delta, 0);
				break;
			case 3:
				self.moveBy(0, -delta);
				break;
			default:
				window.alert('Error: shakewindow() switch out of bounds!');
		}
		
	}
} // end shakewindow()

//*****************************************************************
//*****************************************************************
//
//		General Global Functions (for every page)
//
//*****************************************************************
//*****************************************************************

//=== Start of library code from http://javascript.crockford.com/remedial.html. ===//

function typeOf(value) {
    var s = typeof value;
    if (s === 'object') {
        if (value) {
            if (typeof value.length === 'number' &&
                    !(value.propertyIsEnumerable('length')) &&
                    typeof value.splice === 'function') {
                s = 'array';
            }
        } else {
            s = 'null';
        }
    }
    return s;
} // typeOf().


function sTypeOf(o) {
	switch (o) {
	case null:
		return 'null';
	default:
		return typeOf(o);
	} // switch().
}

function bIsNothing(obj, bMaxLeeway) {
	var b=false, i, t, v, sTemp='', sDebug='';
	if ((bMaxLeeway === undefined)||(bMaxLeeway == '')) { 
		bMaxLeeway=false;
	} // if().	// else { alert('TRUE'); }
	t = typeOf(obj);
	sDebug += t;
	switch (t) {
	case 'null':
		b=true;
		sDebug += 'switch:NULLSTRING:'+obj;
		break;
	case 'undefined':
		b=true;
		sDebug += 'switch:UNDEFINEDSTRING:'+obj;
		break;
	case 'object':	// what about var bTemp = new Boolean(); // object that evaluates to false.
		b = true;
		for (var i in obj) { 
			if (obj.hasOwnProperty(i)) {
				b=false; 
				break; 
			} // if().  break exist for only.
		} // for().
		sDebug += 'switch:OBJECT:'+obj;
//		sDebug += obj.constructor.isPrototypeOf(Boolean).toString();
//		sDebug += ')';
		break;
	case 'string':
		b = (obj.length == 0);
		sDebug += 'switch:STRING:'+obj+':'+obj.length;
		break;
	case 'number':
//c		b=false;
		if (bMaxLeeway) { b=(obj==0); }
		sDebug += 'switch:NUMBER:'+obj;
		break;
	case 'boolean':
//c		b=false;
		if (bMaxLeeway) { b=!obj; }
		sDebug += 'switch:BOOLEAN:'+obj;
		break;
	case 'array':
		b = (obj.length == 0);
		sDebug += 'switch:ARRAY:'+obj+':'+obj.length;
		break;
	case 'function':
//c		b=false;
		sDebug += 'switch:FUNCTION:'+obj;
		break;
	default:	 // Arrays, ...
		b = (obj.length == 0);
		alert('DEFAULT:'+typeOf(obj));
		sDebug += 'switch:DEFAULT:'+obj+':'+obj.length;
		break;
	} // switch().
/**/
//d	alert('bIsNothing:'+sDebug+'='+b+'.');
	return b;
} // bIsNothing().



function bIsSomething(obj) {
//d	alert('bIsSomething:('+obj+")");
	return !bIsNothing(obj);
} // bIsSomething().


//-------------------------------
//
// check to see if input is whitespace only or empty
function isEmpty(o) {
    var i, v;
    if (typeOf(o) == 'object') {
		alert('object');
        for (i in o) {
            v = o[i];
            if (v !== undefined && typeOf(v) !== 'function') {
                return false;
			} else {
				alert("undefined or function");
            } // if().
        } // for().
	} else {
		alert('not object');
    } // if().
    return true;
} // isEmpty().
/**		Alternate.
function isEmpty(val)
{
	var bReturn = false;

	if (isObject(val)) {
		bReturn = (val.match(/^s+$/) || val == "");
	} else if (isUndefined(val)) {
		bReturn = true;
	}
	return bReturn;
} // is Empty().
/**/



String.prototype.entityify = function () {
    return this.replace(/&/g, "&").replace(/</g,
        "&lt;").replace(/>/g, ">");
}; // entityify().

String.prototype.quote = function () {
    var c, i, l = this.length, o = '"';
    for (i = 0; i < l; i += 1) {
        c = this.charAt(i);
        if (c >= ' ') {
            if (c === '\\' || c === '"') {
                o += '\\';
            }
            o += c;
        } else {
            switch (c) {
            case '\b':
                o += '\\b';
                break;
            case '\f':
                o += '\\f';
                break;
            case '\n':
                o += '\\n';
                break;
            case '\r':
                o += '\\r';
                break;
            case '\t':
                o += '\\t';
                break;
            default:
                c = c.charCodeAt();
                o += '\\u00' + Math.floor(c / 16).toString(16) +
                    (c % 16).toString(16);
            } // switch().
        } // if().
    } // for().
    return o + '"';
}; // quote().

String.prototype.supplant = function (o) {
    return this.replace(/{([^{}]*)}/g,
        function (a, b) {
            var r = o[b];
            return typeof r === 'string' || typeof r === 'number' ? r : a;
        }
    );
}; // supplant().

String.prototype.trim = function () {
    return this.replace(/^\s+|\s+$/g, "");
}; // trim().


//=== End of library code from http://javascript.crockford.com/remedial.html. ===//

//=== Start of library code from JavaScript The Definitive Guide. ===//

// Return an array of the names of the enumerable properties of an object (oObj).
function aPropertyNamesGet (oObj) {
	var aNames = [];
	for (sName in oObj) { aNames.push(sName); }
	return aNames;
} // aPropertyNamesGet().



// Copy the properties of an object from one to another.
// If the other is not specified, create a new object.
function copyObjectProperties (oFrom, oTo) {
	var pProp;	// ???
	if (!oTo) { oTo = {}; }	// if no oTo specified then create an empty object.
	for (pProp in oFrom) { oto[pProp] = oFrom[pProp]; } // for().
	return oTo;
} // copyObjectProperties().



// Copy the properties of an object from one to another
// but only if not already defined in another.
// If the other is not specified, create a new object.
function copyObjectPropertiesUndefined (oFrom, oTo) {
	var pProp;	// ???
	if (!oTo) { oTo = {}; }	// if no oTo specified then create an empty object.
	for (pProp in oFrom) {
		if (!(pProp in oTo)) {
			oto[pProp] = oFrom[pProp];
		}
	} // for().
	return oTo;
} // copyObjectProperties().



// Build a new array of only those elements from the master array
// that return true using the passed function.
function aFilterArray (aMaster, bfPredicate) {
	var aReturn = [], element;
	var iLength = aMaster.length;	// Just in case the original length is changed.
	for (var iNdx = 0; iNdx < iLength; iNdx += 1) {
		element = aMaster[iNdx];
		if (bfPredicate(element)) { aReturn.push(element); }
	} // for().
	return aReturn;
} // aFilterArray().



// Build a new array of only those elements from the master array
// that return true using the passed function.
function aFunctionArray (aMaster, fPredicate) {
	var aReturn = [], element;
	var iLength = aMaster.length;	// Just in case the original length is changed.
	for (var iNdx = 0; iNdx < iLength; iNdx += 1) {
		element = aMaster[iNdx];
		aReturn[iNdx] = fPredicate(element);
	} // for().
	return aReturn;
} // aFunctionArray().



//=== End of library code from JavaScript The Definitive Guide. ===//


function sRepeat(sText, iNum) {
	var iNdx = 0, sReturn = '';
	for (; iNdx<iNum; iNdx++) {
		sReturn += sText;
	} // for().
	return sReturn;
} // sRepeat().



function sFileNameExtension(sFileName) {
	var iLocDot, sReturn='';
	// Find the . of .htm, .html, .php, etc. but only search the last 5 characters.
	iLocDot = sFileName.lastIndexOf('.', sFileName.length-6);
	if (iLocDot > 0) {
		sReturn = sFileName.substring(iLocDot+1);
	} // if (iLocDot).
	return sReturn;
} // sFileNameExtension().



function sFileNameOnly(sFileName) {
	var iLocDot;
	// Find the . of .htm, .html, .php, etc. but only search the last 5 characters.
	iLocDot = sFileName.lastIndexOf('.', sFileName.length-6);
	return sFileName.substring(0, iLocDot);	// Extract up to but not including the dot.
} // sFileNameExtension().



function copyImagesAltToTitle() {
	var iNdx, oImages;
	oImages = document.getElementsByTagName('img');
	for (iNdx = 0; iNdx < oImages.length; iNdx++)
	{	
		oImages[iNdx].title = oImages[iNdx].alt;
	}
} // copyImagesAltToTitle().



//-------------------------------
//
function bExists(oVar) {
	return (typeof oVar !== "undefined");
} // bExists().



//-------------------------------
//
function wait(iWaitMilliSeconds)
{
// www.sean.co.uk (modified)

var dStartDate = new Date();
var iElapsedMilliSeconds = 0;
var dCurrentDate = null;

do {
	dCurrentDate = new Date();
	iElapsedMilliSeconds = dCurrentDate-dStartDate;
} while(iElapsedMilliSeconds < iWaitMilliSeconds);

}	// end wait().


//-------------------------------
//
function aGetParameters()
{
var bParametersExist, iNdx, iNumParameters, sDocLoc = '', aCallLine='', sParameters="", aParameters="";

/**/
sParameters = window.location.search;	// this does NOT work if # is BEFORE the ? in the URL!
sParameters = sParameters.substring(1);
/**/

/*
sDocLoc = document.location.toString();
aCallLine = sDocLoc.split("?");				// [0]=url, [1]=parameters

//d	document.write("aCallLine="+aCallLine+"<br />");	//d

sParameters = aCallLine[1];
/**/

//d	alert("sParameters="+sParameters)

bParametersExist = (sParameters);

if (bParametersExist)	// if there was anything after the ?.
{
	aParameters = sParameters.split("&");  // now aParameters is an array of all parameters.

	iNumParameters = aParameters.length

	if (iNumParameters > 0)
	{
		for (var iNdx=0;iNdx<iNumParameters;iNdx++)
		{
			aParameters[iNdx] =  unescape(aParameters[iNdx]);
		}	// end for.
	}	// end if.

}	// end if.

return aParameters;
}	// end aGetParameters().

//-------------------------------
//
function expandDisplay(sDisplay)
{
	var idDisplay = document.getElementById(sDisplay)

	idDisplay.style.display="block";
	document.getElementById('ud'+sDisplay).innerHTML = ' (collapse)';
	document.getElementById('ud'+sDisplay).title = 'Collapse or hide list.';
	
}	// end expandDisplay().

//-------------------------------
//
function collapseDisplay(sDisplay)
{
	var idDisplay = document.getElementById(sDisplay)

	idDisplay.style.display="none";
	document.getElementById('ud'+sDisplay).innerHTML = ' (expand)';
	document.getElementById('ud'+sDisplay).title = 'Expand or show list.';
	
}	// end expandDisplay().

//-------------------------------
//
//	<li>Master <a href="javascript:toggleDisplay('hid');" title="Toggle (e.g. expand or collapse) list.">(toggle)</a></li>
//	<li>Master <a href="javascript:toggleDisplay('hid', 'udMaster');" id="udMaster">(expand)</a></li>
//
function toggleDisplay(sShowHide)	//, sUpDown)
{
	var idShowHide = document.getElementById(sShowHide)
	if (idShowHide.style.display=="none")			// me.style.display=="inline"
	{
		idShowHide.style.display="block";
		document.getElementById('ud'+sShowHide).innerHTML = ' (collapse)';
		document.getElementById('ud'+sShowHide).title = 'Collapse or hide list.';
/*		if (sUpDown)
		{
			document.getElementById(sUpDown).innerHTML = ' (collapse)';
//c			document.getElementById(sUpDown).innerHTML = ' ^ ';
			document.getElementById(sUpDown).title = 'Collapse or hide list.';
		} // end if (sUpDown).	/**/
	} // end if(idShowHide).
	else
	{
		idShowHide.style.display="none";
		document.getElementById('ud'+sShowHide).innerHTML = ' (expand)';
		document.getElementById('ud'+sShowHide).title = 'Expand or show list.';
/*		if (sUpDown) 
		{
			document.getElementById(sUpDown).innerHTML = ' (expand)';
//c			document.getElementById(sUpDown).innerHTML = ' v ';
			document.getElementById(sUpDown).title = 'Expand or show list.';
		} // end if(sUpDown).	/**/
	} // end else.
}

//-------------------------------
//
//
function load(url)
{
 location.href=url;
}

//-------------------------------
//
//
//
//
function sDiv(sText, sClass)
{
	(iDEBUGLEVEL > 10) ? (dwbl('sDiv().a: '+sText+SEP+sClass+SEP)) : '';

	var sReturn = '';

	sReturn += '<';
	sReturn += 'div';

	if (sClass)						// if there is a class then add to div tag.
	{
		sReturn += ' class="';
		sReturn += sClass;
		sReturn += '"';
	}
	sReturn += '>';					// add last character of the div tag.

	sReturn += sText;

	sReturn += '</div>';			// add end dif tag.

	return sReturn;					// return the div string created.

} // end sDiv().



/*----------------------------------
//
//	Input: two strings: TEXT and attributes.
//	Output: a string = '<th>TEXT</th>'
//
-----------------------------------*/
function sHtmlTags(sTag, sText, sAttributes) {
	return sHTMLTags(sTag, sText, sAttributes);
} // sHtmlTags().

function sHTMLTags(sTag, sText, sAttributes) {
	var sReturn  = "<";
	sReturn += sTag;
	if (sAttributes) {
		sReturn += ' '+sAttributes;
	}

	if (sText) {
		sReturn += '>';
		sReturn += sText;
		sReturn += '</';
		sReturn += sTag;
		sReturn += '>';
	} else {
		sReturn += ' />';	// self closing tag (i.e. <br />).
	} // if.
//	sReturn += scNEWLINE;	//php
	return sReturn;
}	// sHTMLTags().



//----------------------------------
//
//	Input: two strings: <attribute> and <value>
//	Output: a string = ' <attribute>="<value>"'
//	Description: Used for creating HTML attributes inside of tags.
//
function sHTMLAttribute(sAtt, sValue)
{
var sReturn  = ' ';		// place a space in front of the attribute ( ).
sReturn += sAtt;		// ( name).
sReturn += '="';		// ( name=").
sReturn += sValue;		// ( name="value).
sReturn += '"';			// ( name="value").

return sReturn;
}



function sHTMLSpan(sText, sClass)
{
	return sSpan(sText, sClass);
} // sHTMLSpan().



function sHTMLSpanClass(sText, sClass)
{
	return sSpan(sText, sClass);
} // sHTMLSpanClass().



function sHTMLSpanAttributes(sText, sAttributes)
{
	(iDEBUGLEVEL > 10) ? (dwbl('sHTMLSpanAttributes().a: '+sText+SEP+sAttributes+SEP)) : '';

	return sHTMLTags('span', sText, sAttributes);

return sSpan(sText, sClass);
} // sHTMLSpanAttributes().



//-------------------------------
//
//
//
//
function sSpan(sText, sClass)
{
	(iDEBUGLEVEL > 10) ? (dwbl('sSpan().a: '+sText+SEP+sClass+SEP)) : '';

	var sReturn = '';

	sReturn += '<';
	sReturn += 'span';

	if (sClass)						// if there is a class then add to div tag.
	{
		sReturn += ' class="';
		sReturn += sClass;
		sReturn += '"';
	}
	sReturn += '>';					// add last character of the div tag.

	sReturn += sText;

	sReturn += '</span>';			// add end dif tag.

	return sReturn;					// return the div string created.

} // end sSpan().

function sImg(sImageFullName) {
	return sHtmlImg(sImageFullName);
} // sImg().

//-------------------------------
//
//
function sHtmlImg(sImageFullName, sAttributes)
{
	var sReturn = '';

	sReturn += '<img src="';
	sReturn += sImageFullName;
	sReturn += '" ';
	if (sAttributes) { sReturn += sAttributes; }
	sReturn += ' />';

	return sReturn;

}	// end sHtmlImg().



function sHref(sHotText, sURL, sTarget, sTitle, sOther, sID) {
	return sHtmlHref(sHotText, sURL, sTarget, sTitle, sOther, sID);
} // sHref().

//-------------------------------
//-------------------------------//
//-------------------------------////	sHtmlHref returns a string in HTML for the href tag.
//
function sHtmlHref(sHotText, sURL, sTarget, sTitle, sOther, sID) {
	(iDEBUGLEVEL > 10) ? (dwbl('sHref().A: '+sHotText+SEP+sURL+SEP+sTarget+SEP+sTitle+SEP+sOther+SEP+sID+SEP)) : '';

	var sReturn='', sAttributes = '';

	sAttributes += sHTMLAttribute('href', sURL);	//href="';

	if (isSomething(sTitle))
	{
		sAttributes += sHTMLAttribute('title', sTitle);	//' title="'+sTitle+'"';
	}

	if (isSomething(sTarget))
	{
		sAttributes += sHTMLAttribute('target', sTarget);	//' target="'+sTarget+'"';
	}

	if (isSomething(sID))
	{
		sAttributes += sHTMLAttribute('id', sID);	//' id="'+sID+'"';
	}

	if (isSomething(sOther))
	{
		sAttributes += ' '+sOther;
	}

	sReturn += sHTMLTags('a', sHotText, sAttributes);

	return sReturn;

} // end sHtmlHref().


function sHrefEmail(sHotText, sEmailAddr, sSubject, sBody, sCC, sBCC, sOther) {
	return sEmail(sHotText, sEmailAddr, sSubject, sBody, sCC, sBCC, sOther);
} // sHrefEmail().

//-------------------------------
//
//	sHrefEmail returns a string in HTML for the href tag.
//	sSubject is required if sBody is to be used.
//
function sEmail(sHotText, sEmailAddr, sSubject, sBody, sCC, sBCC, sOther) {
	(iDEBUGLEVEL > 10) ? (dwbl('sHrefEmail().A: '+sHotText+SEP+sEmail+SEP+sSubject+SEP+sBody+SEP+sOther+SEP)) : '';

	var sReturn='';

	sReturn += '<a href="mailto:';	// start of href text.
	sReturn += sEmailAddr;
	if (isSomething(sSubject))
	{
		sReturn += '?subject='+sSubject;
	}
	if (isSomething(sCC))
	{
		sReturn += '&cc='+sCC;
	}
	if (isSomething(sBCC))
	{
		sReturn += '&bcc='+sBCC;
	}
	if (isSomething(sBody))
	{
		sReturn += '&body='+sBody+'"';
	}
	if (isSomething(sOther))		// any other special attributes like &attachment (if there is such an attribute).
	{
		sReturn += ' '+sOther;
	}
	sReturn += '"';					// end of href text.

	sReturn += ' title="Email address is '+sEmail+'"';

	sReturn += ' >';
	sReturn += sHotText;
	sReturn += '</a>';

	return sReturn;

} // end sEmail().







//-------------------------------
//-------------------------------//-------------------------------//-------------------------------//php
//	sSuperScript wraps the parameter with a span tag with a class of 'gls' which uses CSS to superscript.
//
function sSuperScript(sSSText)		// Last revision: 2006.03.30 by Randall Ijams.
{
	var sReturn = '';

	sReturn  = '<span class="ss">'
	sReturn += sSSText;
	sReturn += '</span>'

	return sReturn;

} // end sSuperScript().




//-------------------------------
//-------------------------------//-------------------------------//-------------------------------//
//-------------------------------//-------------------------------//-------------------------------////-------------------------------//-------------------------------////-------------------------------////	sHR outputs a horizonal rule.
//
//////// function sHR()		// Last revision: 
// {
// 	return '<hr />';
// 
// } // end sHR().

//-------------------------------
//
//	sLabel outputs the following...
//
//	-------------------- (an HR)
//	<a id="sText"></a>
//	<hX>sText</hX>
//
function sLabel(sText, sSize, bHR)
{
	var sReturn = '';

	if (isSomething(bHR) && bHR) sReturn += sHR;	// if passed and is true.

	sReturn += sAId(sText);		// <a name="sText" id="sText"></a>

	// NOMINAL means do not change the size of the font, just create an HTML <a> tag.
	if (sSize != NOMINAL)
	{
		if (isNothing(sSize)) sSize = '3';
		if (sSize < 0) sSize = '3';		// if sDEFAULT (-99) is passed, keep the default value.
	
		sReturn += '<h';
		sReturn += sSize;
		sReturn += '>';
		sReturn += sText;
		sReturn += '</h';
		sReturn += sSize;
		sReturn += '>';
	} else {
		sReturn += sText;
	} // if.
	

//d	alert (sReturn);

	return sReturn;

}	// sLabel().



//-------------------------------
//
//	sAId outputs .
//
function sAId(sName, sText)
{
	var sReturn = '';

//	if (bBrowserIE()) sReturn += sBLN;	// IE needs a <br /> to start on next line.

	sReturn += '<a';

	sReturn += ' name="' + sName + '"';
	sReturn += ' id="'   + sName + '"';

	sReturn += '>';			// <a name="sName" id="sName">
	if (isSomething(sText)) sReturn += sText;
	sReturn += '</a>';		// <a name="sName" id="sName">sText</a>

	return sReturn;

} // end sAId().


//-------------------------------
//
//	sAName outputs .
//
function sAName(sText, bLIEntry)
{
	var sReturn = '', sEQUALS = "======";

	sReturn += sAId(sText);

	if (bLIEntry)
	{
		sReturn += sBLN;		// Add a blank line before the separater.
		if (bBrowserIE()) sReturn += sBLN;
//c		sReturn += sLIB;		// Not needed even if embedded between <li>.
		sReturn += sHref(sEQUALS, "#", "", "Go to the top (Link=#).");
//c		sReturn += sEQUALS;
		sReturn += " ";
		sReturn += sText.toUpperCase();
		sReturn += "'s ";
//c		sReturn += sEQUALS;
		sReturn += sHref(sEQUALS, "#footer", "", "Go to the bottom (Link=#footer).");
		sReturn += sBLN;		// Need blank line here if there is nothing between calls (i.e. Q, X categories).
//c		sReturn += sLIE;
	}

	return sReturn;

} // end sAName().


//-------------------------------
//
//	sAName outputs one AName for each character in the sText string.
//
function sANames(sText, bLIEntry)
{
	var sReturn = '', sEQUALS = "======";
	var iNdx, sChar;

	for (iNdx=0; iNdx < sText.length; iNdx++)
	{
		sChar = sText.substr(iNdx, 1);

		sReturn += '<a';
	
		sReturn += ' name="' + sChar + '"';
		sReturn += ' id="'   + sChar + '"';
	
		sReturn += '></a>';
	
		if (bLIEntry)
		{
//c			sReturn += sLIB;		// Not needed even if embedded between <li>.
			sReturn += sHref(sEQUALS, "#", "", "Go to the top (Link=#).");
//c			sReturn += sEQUALS;
			sReturn += " ";
			sReturn += sChar.toUpperCase();
			sReturn += "'s ";
//c			sReturn += sEQUALS;
			sReturn += sHref(sEQUALS, "#footer", "", "Go to the bottom (Link=#footer).");
			sReturn += sBLN;		// Need blank line here if there is nothing between calls (i.e. Q, X categories).
//c			sReturn += sLIE;
		}

	} // end for (iNdx<sText.length).

	return sReturn;

} // end sANames().



//-------------------------------
//
//	sANameArr outputs one AName for each element in the arrText array.
//
function sANamesArr(arrText, bLIEntry)
{
	var sReturn = '', sEQUALS = "======";
	var iNdx, sString;

	for (iNdx=0; iNdx < arrText.length; iNdx++)
	{
		sString = arrText[iNdx].toLowerCase();

		sReturn += '<a';
	
//c		sReturn += ' name="' + sString + '"';
		sReturn += ' id="'   + sString + '"';

		sReturn += '></a>';

		if (bLIEntry)
		{
//c			sReturn += sLIB;		// Not needed even if embedded between <li>.
			sReturn += sHref(sEQUALS, "#", "", "Go to the top (Link=#).");
//c			sReturn += sEQUALS;
			sReturn += " ";
			sReturn += sString.toUpperCase();
			sReturn += "'s ";
//c			sReturn += sEQUALS;
			sReturn += sHref(sEQUALS, "#footer", "", "Go to the bottom (Link=#footer).");
			sReturn += sBLN;		// Need blank line here if there is nothing between calls (i.e. Q, X categories).
//c			sReturn += sLIE;
		}

	} // end for (iNdx<arrText.length).

	return sReturn;

} // end sANamesArr().







//-------------------------------
//php
//	sHrefSS (string Href superscript) returns a string with the href in superscript.  Used for a glossary link.
//	This is a newer version of linkG().
//
function sHrefSS(sHotText, sFullURLName)
{
	return sSuperScript(sHref(sHotText, sFullURLName));
}


//-------------------------------
//
//
function sHrefSSW(iUpFolders)
{
	return sHrefSS(sNEWWINDOWLINKTEXT, sUps(iUpFolders)+'Info/Glossary.html#newwindow');
}

//-------------------------------
//
//
function sHrefSSX(iUpFolders)
{
	return sHrefSS(sBROKENLINKTEXT, sUps(iUpFolders)+'Info/Glossary.html#brokenlink');
}





//-------------------------------
//
//	sGlossaryWord returns a string in HTML for the abbr tag.
//
function sGlossaryWord(sText)
{
	var sReturn;

	sReturn  = '<span class="glossary">';
	sReturn += sText;
	sReturn += '</span>';

	return sReturn;

} // end of sGlossaryWord().




//-------------------------------
//php
//	sAbbr returns a string in HTML for the abbr tag.
//
function sAbbr(sHotText, sTitle)
{
	var sReturn;

	sReturn  = '<abbr ';
	sReturn += 'title="';
	sReturn += sTitle;
	sReturn += '">';
	sReturn += sHotText;
	sReturn += '</abbr>';

	return sReturn;

} // end of sAbbr().




//-------------------------------
//
//	replaced with sEmailBrokenLink (better name, swapped parameters).
//
function emailBrokenLink(sFullBrokenURLLink, sHotText)
{
	return sEmailBrokenLink(sHotText, sFullBrokenURLLink)

} // end of emailBrokenLink().


//------------------------------
//
//	sStringSpaced returns a string with the %20 replaced with a regular space.
//
function sStringSpaced(sText)
{
	return(unescape(unescape(sText)));		// need double call for '&' to show?  
}

//------------------------------
//
//	sStringHardSpaced returns a string with spaces replaced with hard spaces.
//
function sStringHardSpaced(sText)
{
	return(sHardSpaces(sStringSpaced(sText)));
}

//-------------------------------
// Create a string with the specified number of hard spaces.
//
function sNBSPs(iNumber)
{
	var sReturn = '', iNdx;

	for (iNdx=0; iNdx<iNumber; iNdx++)
	{
		sReturn += sNBSP;
	}
	return sReturn;
	
} // end sNBSPs().


//-------------------------------
//php
//	emailBrokenLink returns a string with the HREF mailto.
//		sFullBrokenURLLink is the URL which does not work.
//		sHotText is the hot text which the user sees and clicks on.  This makes it easier to find and repair the link.
//
function sEmailBrokenLink(sHotText, sFullBrokenURLLink)
{
	debug ? alert('sEmailBrokenLink:' + sFullBrokenURLLink+sep+sHotText):'';
//d alert('emailBrokenLink:' + sFullBrokenURLLink+sep+sHotText);
	var sMail, sReturn='';

	sMail  = 'mailto:';
	sMail += sEMAILADDR;
	sMail += '?Subject=';
	sMail += 'Broken Link: Page= ';
	sMail += document.URL;
	sMail += '&body=';
	sMail += 'The link \'';
	sMail += escape(escape(sHotText));				// need double call for '&' to show.  encodeURIComponent()

//c	The next comment line will allow '&abc' to be displayed in the e-mail body using the sMail variable (watch carefully).  
//c	sMail += '%2526abc';
//c	'%25' becomes '%' after one interpolation leaving '%26abc'.
//c	'%26' becomes '&' after second interpolation leaving '&abc'.
//c Therefore, one must call the escape function twice to convert '&abc' into '%2526abc'.

	sMail += '\' to \'';
	sMail += escape(escape(sFullBrokenURLLink));		// need double call for '&' to show.  encodeURIComponent()
//d	alert(escape(escape(sFullBrokenURLLink)));
	sMail += '\' does not work.';

//	sReturn  = '<span class="gls">'
	sTemp = sAbbr(sBROKENLINKTEXT, "Select this letter to create an email so we can fix this broken link. Thank You.");
	sReturn += sHrefSS(sTemp, sMail);
//	sReturn += '</span>'

	return sReturn;

} // end of sEmailBrokenLink().




//-------------------------------
//
//	sEmailPageContentError returns a string with the HREF mailto.
//		sFullPCURLLink is the URL of the page with the content error.
//		sHotText is the hot text which the user sees and clicks on.  This makes it easier ...
//
function sEmailPageContentError()
{
	debug ? alert('sEmailPageContentError:' + sFullPCURLLink):''; //+sep+sHotText):'';
//d alert('emailBrokenLink:' + sFullBrokenURLLink+sep+sHotText);
	var sMail, sReturn='';

	sMail  = 'mailto:';
	sMail += sEMAILADDR;
	sMail += '?Subject=';
	sMail += 'Content Error: Page= ';
	sMail += document.URL;
	sMail += '&body=';

	sTemp  = "1) Select and copy the bad text, &#10;";
	sTemp += "2) Select this Link to create an email to us, &#10;";
	sTemp += "3) Paste the bad text in the body to inform us of our error(s), &#10;";
	sTemp += "4) Send the Email.  And Thank You.";
	sTemp = sAbbr(sCONTENTERRORTEXT, sTemp);

	sReturn += sHref(sTemp, sMail);

//	sReturn = sHrefEmail(sCONTENTERRORTEXT, sEMAILADDR, 'Content Error: Page= '+document.URL)
	return sReturn;

} // end of sEmailPageContentError().




//-------------------------------
//
function notDefined(aValue)
{
	var rtnVal;
	
	rtnVal  = isUndefined(aValue);
	rtnVal |= isNull(aValue);
	rtnVal |= (aValue == '');
	
	return rtnVal;
}

function defined(aValue)
{
	return !notDefined(aValue);
}

//-------------------------------
//
//	replace with sPadNumber().
//
function padNumber(number, pad)
{
	alert("padNumber needs to be changed to sPadNumber.");
	return sPadNumber(number, pad);
}

function sNumberPad(iNum, iPad) {
	return sPadNumber(iNum, iPad);
} // sNumberPad().

//-------------------------------
//PHP
//	sPadNumber returns a string with the passed number padded with zeros in front.
//
// Last revision: 2004.11.29 by Randall Ijams (rri@salestime.com).
function sPadNumber(iNum, iPad, sPadChar)	{
	debug ? alert('sPadNumber:' + iNum + sep + iPad):'';
	sPadChar = sPadChar || '0';
	var sNum = '' + iNum;		// Convert number to string.
	var iLength = sNum.length; // Must not use calculation within for.
	for (i=0; i < (iPad - iLength); i++) {	// Add the proper number of zeros.
		sNum = sPadChar + sNum;
//d		alert(sNum);
	} // for ().
	return sNum;
} // end of sPadNumber().



//-------------------------------
//
//
//
function sGetFileName(sFullURLName)		// Last revision: 2006.07.11 by Randall Ijams.
{
	(iDEBUGLEVEL > 55) ? dwbl('sGetFileName.A: '+sFullURLName) : '';

	return getFileName(sFullURLName);
}

//-------------------------------
//
//
//
function getFileName(sFullURLName)		// Last revision: 2006.07.11 by Randall Ijams.
{
//d	dwbl('getFileName().A: '+sFullURLName+SEP);

	var iLastIndex, sFileName;

	sFileName = sFullURLName;						// Need to do this here in case iLastIndex is -1.
//d	dwbl('getFileName().B: '+sFileName+SEP);
	sFileName = sFileName.replace(/\//g, '\\');		// replace all forward slashes with backslashes.
//d	dwbl('getFileName().C: '+sFileName+SEP);
	iLastIndex = sFileName.indexOf('?');			// find ? if it exists.

//d	dwbl('getFileName().F: '+iLastIndex+SEP);
	if (iLastIndex > 0)								// If ? exists.
	{
		sFileName = sFullURLName.substr(0, iLastIndex);		// keep everything before the ?.
//d	dwbl('getFileName().I: '+sFileName+SEP+iLastIndex+SEP);
	}

	iLastIndex = sFileName.lastIndexOf('\\');			// Get location of last /.
	sFileName  = sFileName.substr(iLastIndex+1);		// Extract out the name only.
//d	dwbl('getFileName().Z: '+sFileName+SEP+iLastIndex+SEP);

	return sFileName;

} // end getFileName().

//-------------------------------
//
//
var sHEXDIGITSLIST="0123456789ABCDEF";
function sDec2Hex(iNum)
{
	var iHexDigit, iDigit, sHexDigits='';
	iDigit = iNum&15;								// Binary AND to get last digit.
	sHexDigits = sHEXDIGITSLIST.substr(iDigit,1);	// Get hex digit.
	while(iNum>15) 
	{
		iNum >>= 4;										// Binary shift.
		iDigit = iNum&15;								// Binary AND to get last digit.
//c		sHexDigits = iDigit.toString(16) + sHexDigits;	// Works. Hex digits are lower case.
		sHexDigits = sHEXDIGITSLIST.substr(iDigit,1)+sHexDigits;	// Get next hex digit and add to the front of the string.
	}
	return sHexDigits;
}	// sDec2Hex().	

//-------------------------------
//
//
function h2d(h) {return parseInt(h,16);}//
//
//

//-------------------------------
//
//
function sHex2Dec(sNum)
{
	return(iNmu);
}	// sDec2Hex().
//-------------------------------
//
//	Used for random color selector.  (not implemented).
//
function sDec2RGB(iNum)
{
	return iRandomNum(sHex2Decimal(iNum));
}	// sDec2Hex().

//-------------------------------
//
//
//	<input type="text" name="dec" onblur="hex.value=(this.value-0).toString(16)">(dec)
//	<input type="text" name="hex" onblur="dec.value=parseInt(this.value,16)">(hex)

//-------------------------------
//
//
function randomNum(max)
{
	return iRandomNum(max);
}

//-------------------------------
//
//
function iRandomNum(iMax)
{
	var randomN;
	
	do
	{
		randomN  = Math.random();		// get random number between 0 and <1.
		randomN *= iMax + 1;			// multiply by maximum number +1 to get a number between 0 and < max + 1.
		randomN  = Math.ceil(randomN);	// any fraction gets counted up to next integer between 1 and max + 1.
		randomN --;						// integer between 0 and max.
	} while (randomN == lastRandomNum);	// don't repeat same number back to back.

//	while(used[random]==1)
//	{
//	  randomN=Math.ceil(Math.random()*max);
//	}

	lastRandomNum = randomN;			// save this random number to compare next time this functions is called.
	
	return randomN;

} // end iRandomNum().



//-------------------------------
//
function cleanString(str, strRepChars, strRChar)
{
	var sFileName = document.URL;
	alert("Replace cleanString() with sCleanString() in file "+sFileName+".");
	return sCleanString(str, strRepChars, strRChar);
}



//-------------------------------
//
//	Will negate href strings.
//
function sHardString(sInput)
{
	return sCleanString(sInput, " ", sNBSP);
}

function sHardSpaces(sInput)
{
	return sHardString(sInput);
}

//-------------------------------
//
//		Clean up this code (use better variable names, remove extra code, etc.).
//
// Return the string void of any 'replacement' characters.
//	strRepChars is optional and if omitted "., -/\()" will be used as default.
//  strRChar is optional and if omitted "" will be used as default to remove the replacement characters.
//
function sCleanString(str, strRepChars, strRChar)
{
	var escChar = '\\', ndx, sChar, src, srcs, sTemp;
	var defaultChars = "., -\/\\()";

//c	src = strRChar;
//c	srcs = strRepChars;
	
//d	alert(src+"1"+srcs);

	// Set Default replace character if nothing was passed.
	src = isNothing(strRChar) ? "" : strRChar;

	// if parameters are reversed code here performs src=srcs.  Wierd?
//	alert(src.length+"2"+srcs.length);

	// Set Default replacement charactes if nothing was passed.
//c	sTemp=src;
	srcs = isNothing(strRepChars) ? defaultChars : strRepChars;
//c	src=sTemp;
	
//	alert(src.length+"3"+srcs.length);
/*			// DO NOT USE THIS UNTIL ISSUE ABOVE IS RESOLVED.
	// Check to see if parameters are reversed.
	if (src.length > srcs.length)	// If so, swap.
	{
		alert("switch");
		sTemp = src;
		src = srcs;
		srcs = sTemp;
	}
/**/

//d	alert(strRChar+":"+strRepChars)

//d	sTemp = isNothing(strRepChars) ? "": ", "+strRepChars;
//d	alert("main.js:cleanString("+str+sTemp+")");

//d	alert("main.js:cleanString("+strRepChars+")");

	for (ndx=0; ndx<srcs.length; ndx++)	// For each Replacement character
	{
		sChar = srcs.substr(ndx, 1);	// Get replacement character.
		// Build regular expression.  Escape all characters in case this one is a special character.
		rExp = new RegExp(escChar+sChar, 'gi');		
		str = str.replace(rExp, src);	// Replace the replacement char with nothing.
//d		alert("main.js:cleanString:ndx("+str+":"+sChar+":"+rExp+")");
	}

	return str;			// Return the string void of any replacement characters.

} // end sCleanString().


//-------------------------------
//
function isAlien(a)
{
   return isObject(a) && typeof a.constructor != 'function';
}

//-------------------------------
//
function isArray(a)
{
    return isObject(a) && a.constructor == Array;
}

//-------------------------------
//
function isBoolean(a)
{
    return typeof a == 'boolean';
}

//-------------------------------
//
function isFunction(a)
{
    return typeof a == 'function';
}

//-------------------------------
//
function isNull(a)
{
    return (a==null);
}

//-------------------------------
//
// check to see if input is number
function isNumber(val)
{
//d	alert('isNumber:');
	return !(isNaN(val));
//c return typeof a == 'number' && isFinite(a);
}
//-------------------------------
//
function isObject(a) {
    return (a && typeof a == 'object') || isFunction(a);
}

//-------------------------------
//
function isString(a) {
    return typeof(a)=='string';
}

//-------------------------------
//
function isUndefined(a) {
    return typeof a == 'undefined';
}

//-------------------------------
//
function isNothing(a) {
	var bNothing;
	bNothing = (typeof a == 'undefined');
	bNothing |= (a==null);
	bNothing |= (isString(a) && (a==''));
	return bNothing ? true : false;
}

//-------------------------------
//
function isSomething(a) {
	var bSomething;
	bSomething = (typeof a != 'undefined');
	bSomething = bSomething && (a!=null);
	bSomething = bSomething || (isString(a) && (a!=''));
	return bSomething ? true : false;
//	return !(isNothing(a));
}

//-------------------------------
//
function isStringCheck(s) {
	return ((s != undefined) && (s != ''))
}



//-------------------------------
//
function isWithinRange(val, min, max)
{
	return (val >= min && val <= max);
}

//-------------------------------
//
// check to see if form value is checked
function isChecked(obj)
{
	return (obj.checked);
}

//*****************************************************************
//*****************************************************************
//
//		Document Write Functions (for every page)
//
//*****************************************************************
//*****************************************************************



//-------------------------------
//
//
function sOLBegin(sListType, sStyleOther, sOptions)
{
	var sReturn = "<ol";

	if (isSomething(sOptions))
	{
		sReturn += " "+sOptions;		// This code is added before the style code.
	}

	sReturn += ' style="list-style-type: ';
	if (sListType=='a')
	{
		sReturn += 'lower-alpha';
	}
	else if (sListType == '1')
	{
		sReturn += 'decimal';
	}
	else if (sListType == 'c')
	{
		sReturn += 'circle';
	}
	else if (sListType == 'd')
	{
		sReturn += 'disc';
	}
	else if (sListType == '0')
	{
		sReturn += 'decimal-leading-zero';
	}
	else if (sListType == 's')
	{
		sReturn += 'square';
	}
	else
	{
		sReturn += 'decimal';	// sListType is nothing or illegal. DEFAULT!
	}

	if (isSomething(sStyleOther))
	{
		sReturn += "; "+sStyleOther;	// This code is addeded after the style code.
	}
	
	sReturn += ';">';

//d	alert (sReturn);

	return sReturn;
}	// end sOLBegin().



//-------------------------------
//
//	This function outputs HTML code to
//		1) Create a named location to jump to (e.g. a # location as in WebPage.html#name)
//		2) Create a Heading with the same name followed by a link to expand the list via a <div> tag
//		3) Create a <div> tag to hide or show a group of text
//		4) Starts a List
//
/*
	sTemp = sHref('(expand)', "javascript:toggleDisplay('entertainment');", "", "", "", "udentertainment");
	dwli(sLinkPlusHUDTCSW("Entertainment ", sUps(iDirDepth)+"entertainment/_entertainment.html", iDirDepth, "", sTemp));
	dw("<div id='entertainment'  style='display: none;'>");
	dw(ULB);
*/
//	20080220 Added sLink parameter in middle of parameter list.  May mess up old calls to dwExpandBegin that use last 2 parameters.
//
function dwExpandBegin(sName, sListType, sLink, sStyleOther, sOptions, sComments)
{
	var sTemp, sTemp2;

	dw(sAName("Label"+sName));
	sTemp = "javascript:toggleDisplay('"+sName+"');";
	sTemp = sHref('(expand)', sTemp, "", "", "", "ud"+sName);
	if (isSomething(sLink))
	{
		sTemp2 = sLinkPlusHUDTCSW(sName, sLink, iDirDepth)
	}
	else
	{
		sTemp2 = sName;
	}

	if (isSomething(sComments)) sTemp2 += sComments;

	dwli(sTemp2 + " " + sTemp);
	dw("<div id='"+sName+"'  style='display: none;'>");
	dw(sOLBegin(sListType, sStyleOther, sOptions));

}	// end dwExpandBegin().

//-------------------------------
//
//
function dwExpandEnd(sName)
{
	dw(sOLE);
	dw(sDIVE);	//c	+"  \/\/ "+sName+"().");	// Output a comment  of "// sName()."
//c	sTemp = "  \/\/ "+sName+"().";	// Output a comment  of "// sName()." DOESN'T WORK!!!!!
//c	sTemp = "  <!-- "+sName+"()."+ " -->";	// Output a comment  of "// sName()." WORKS, BUT WHY USE IT???
//c	dw(sTemp);
}	// end dwExpandEnd().

//-------------------------------
//
//
function dwCollapseBegin(sName, sListType, sStyleOther, sOptions)
{
	dw(sAName("Label"+sName));
	sTemp = "javascript:toggleDisplay('"+sName+"');";
	sTemp = sHref('(collapse)', sTemp, "", "", "", "ud"+sName);
	dwli(sName + " " + sTemp);
	dw("<div id='"+sName+"'  style='display: block;'>");
	dw(sOLBegin(sListType, sStyleOther, sOptions));
	
}	// end dwCollapseBegin().

//-------------------------------
//
//
function dwCollapseEnd(sName)
{
	dwExpandEnd(sName);
}	// end dwCollapseEnd().



function sLinksAlphabetUC()
{
	var sReturn='';

	sReturn += sOtherLinksBegin;

	// add spaced on either side to make it easier to select.
	sReturn += sHref(' A ', '#A');
	sReturn += sHref(' B ', '#B');
	sReturn += sHref(' C ', '#C');
	sReturn += sHref(' D ', '#D');
	sReturn += sHref(' E ', '#E');
	sReturn += sHref(' F ', '#F');
	sReturn += sHref(' G ', '#G');
	sReturn += sHref(' H ', '#H');
	sReturn += sHref(' I ', '#I');
	sReturn += sHref(' J ', '#J');
	sReturn += sHref(' K ', '#K');
	sReturn += sHref(' L ', '#L');
	sReturn += sHref(' M ', '#M');
	sReturn += sHref(' N ', '#N');
	sReturn += sHref(' O ', '#O');
	sReturn += sHref(' P ', '#P');
	sReturn += sHref(' Q ', '#Q');
	sReturn += sHref(' R ', '#R');
	sReturn += sHref(' S ', '#S');
	sReturn += sHref(' T ', '#T');
	sReturn += sHref(' U ', '#U');
	sReturn += sHref(' V ', '#V');
	sReturn += sHref(' W ', '#W');
	sReturn += sHref(' X ', '#X');
	sReturn += sHref(' Y ', '#Y');
	sReturn += sHref(' Z ', '#Z');

	sReturn += sOtherLinksEnd;

	return sReturn;

} // end sLinksAlphabetUC().




//-------------------------------
//php
//	sUps returns a string with x number of '../' concatenated together.
//		This is used for relitive referencing in href calls.
//
function sUps(iFolderDepth)			// Last revision: 2004.10.05 by Randall Ijams.
{
//d	debug ? alert('sUps('+iFolderDepth+')') : '';

	var sReturn = '';
	for (i=0; i<iFolderDepth; i++)
	{
		sReturn += '../';
	}
	return sReturn;
	
} // end sUps().

//-------------------------------
//
//	Original version.
//
function sRelPath2(iFolderDepth, sPath)
{
	return ( sUps(iFolderDepth) + sPath );
} // end sRelPath2().

//-------------------------------
//
//	sRelPath creates a relitive path based on the global variable folderDepth and the file location.
//	folderDepth (iDirDepth replacement) is a global variable.
//
function sRelPath(sPath)	//, iFolderDepth)
{
/*	var sTemp = "";
	sTemp += "sRelPath("+sPath+")";
	sTemp += ": iDirDepth="+iDirDepth;
	sTemp += ": iDirDepth="+iDirDepth; /*
	(iDEBUGLEVEL > 10) ? dwbl(sTemp) : '';
	if (iDirDepth)	// if HTML file is still using iDirDepth ...
	{
		dwbl(iDirDepth);
		iDirDepth = iDirDepth;	// then set folderDepth.
	}
/**/
	return ( sUps(iDirDepth) + sPath );
} // end sRelPath().


//-------------------------------
//
//	dUps returns a string with x number of '../' concatenated together.
//		This is used for relitive referencing in href calls.
//
//	This should be renamed to sUps.
//
function dUps(iFolderDepth)			// Last revision: 2004.10.05 by Randall Ijams.
{
	return sUps(iFolderDepth);
	
} // end dUps().






//-------------------------------
//
//	sLinkPlus2 returns a valid HTML href as a string with title attribute and superscript hints at the end.
//	Replaces sLinkPlus (added title parameter), msgLinkW (swapped parameters), and msgLink (swamped parameters).
//
//		sHotText is the text comprising the link.
//		sFullURLName is the web page address.
//		If the URL starts with HTTP:// then assume new window in _blank (unless otherwise stipulated with sWindowName).
//		If sWindowName is not blank then the value will be used to name the window
//		if wName (windowName) is not blank then a w will be added to the link to signify 
//		a new window will be opened.
//		If iDirDepth is not a number then just display a non-linked w for new window links.
//		sSuper is a string of characters to display superscript links.
/*
	<li><script type='text/javascript'	>
		dw(sLinkPlus("aaa", bbb, iDirDepth)); 
		</script></li>
*/
//	DO NOT use /Info/aaa.html (i.e. start with a slash) due to the issue on the local machine, 
//	the root web directory may not be at the root of your file system.
//
//	How do you handle HTTP with same???
//
function sLinkPlus3(sHotText, sFullURLName, iUps, sTitle, sComment, sSuper, sWindowName, sHrefOther)
{
//d	alert('sLinkPlus(' +sHotText+SEP+ sFullURLName+SEP+iUps+SEP+ sSuper+ SEP+sWindowName+')');

	(iDEBUGLEVEL > 10) ? dwbl('sLinkPlus3('+sHotText+sCOMMA+sFullURLName+sCOMMA+iUps+sCOMMA+sTitle+sCOMMA+sComment+sCOMMA+sSuper+sCOMMA+sWindowName+")") : '';	// 10

	var sReturn = '', sChar = '', bNewWindow = false, sTitlePlusLink='', sTarget='';
	var sTemp = '';	// Local variable?  See _ElPilar.html.

//	sReturn += '<a href="';
//	sReturn += sFullURLName;
//	sReturn += '"';

	bNewWindow  = (sFullURLName.slice(0,7) =="http://");
	bNewWindow |= (sFullURLName.slice(0,8) =="https://");
	bNewWindow |= (sFullURLName.slice(0,6) =="ftp://");
//");//");//");//c	bNewWindow |= (sFullURLName.slice(0,7) ===="file://");	//");//");//");// Don't display w x for files as they are probably local.

	if (isSomething(sWindowName))		//?	if (sWindowName == false)
	{
		if ((sWindowName != 'same') && (sWindowName != '_self'))	// if sWindowName is 'same' or '_self' then don't open new window.  Allows for x without w.
		{
			sTarget += sWindowName;
//			sReturn += ' target="'+sWindowName+'"';	
									'"';'"';'"';// assuming a window name is never reused!!!
			bNewWindow = true;		// if window is named, then new window, so display w.
		}
	}
	else if (bNewWindow)		// wName was nothing but URL started with http://.
	{
//		sReturn += ' target="_blank"';
		sTarget += '_blank';
	}

	if (isSomething(sTitle))	// Start of HREF title.
	{
		sTitlePlusLink += sTitle;
	}
	sTitlePlusLink += ' (Link=';
	sTitlePlusLink += sFullURLName;
	sTitlePlusLink += ')';
//	sReturn += '"';				// End of HREF title.

//	sReturn += '>';
//	sReturn += sHotText;
//	sReturn += '</a>';

	sReturn = sHref(sHotText, sFullURLName, sTarget, sTitlePlusLink, sHrefOther);

	if (bNewWindow)		// Opening a new window so show w.
	{
		// If iUps is not included with window name the w link will not work properly (can't find the folder).
		if (isNumber(iUps))
		{
			sReturn += ' ';
			sTemp = sAbbr(sNEWWINDOWLINKTEXT, "The hot text opens a new window.  This superscript link will take you to the glossary.");
			sReturn += sHrefSS(sTemp, dUps(iUps)+'Info/Glossary.html#newwindow');
		}
		else
		{
			iUps = 0;		// set to something incase sSuper has a value.
			sTemp = sAbbr(sNEWWINDOWLINKTEXT, "The hot text opens a new window.");
			sReturn += ' ' + sSuperScript(sTemp);
		}
		// Only include the broken link email option on external links
		// or even the header and footer links will have the x.
		sReturn += ' ' + sEmailBrokenLink(sHotText, sFullURLName)	// Add the x for broken link.
	}

	if (!isSomething(sSuper))			
	{
		sSuper = '';	// so not undefined.
	}

	do 
	{
		sChar = sSuper.slice(0,1);		// Get next character.
		sSuper = sSuper.slice(1);		// Remove char from original string.
//d		alert (sChar+":"+sSuper);

		switch (sChar)
		{
			case '':				//	'':// What is sChar if sSuper is blank???
//				sReturn += ' ';
				break;
			case '':
				sReturn += ' ';
				break;
			case 'b':
				sReturn += sHrefSS('blp', dUps(iUps)+'Info/Glossary.html#blp');
				break;
			case sNEWWINDOWLINKTEXT:	// w is automatic for new windows.
				if (isNumber(iUps))
				{
//c					sReturn += sHrefSS(sNEWWINDOWLINKTEXT, dUps(iUps)+'Info/Glossary.html#newwindow');
			sTemp = sAbbr(sNEWWINDOWLINKTEXT, "The hot text opens a new window.  This superscript link will take you to the glossary.");
			sReturn += sHrefSS(sTemp, dUps(iUps)+'Info/Glossary.html#newwindow');
				}
				else
				{
			sTemp = sAbbr(sNEWWINDOWLINKTEXT, "The hot text opens a new window.");
			sReturn += sSuperScript(sTemp);
//c					sReturn += sSuperScript(sNEWWINDOWLINKTEXT);
				}
				break;
			case 't':
				sReturn += sHrefSS('tfh', dUps(iUps)+'Info/Glossary.html#tfh');
				break;
			case 'x':
				if (!bNewWindow)	// don't output a second x if one already there.
				{
					sReturn += sEmailBrokenLink(sHotText, sFullURLName);	// Add the x for broken link.
				}
				break;
			default:
				sReturn += sSuperScript(sChar);
				break;
		}
	} while (sChar != '');

/** ?????
//	if ((sWindowName != undefined) && (iUps != undefined))
//	{
//d		alert ('iUps');
');//		sReturn += sHrefSS(sNEWWINDOWLINKTEXT, dUps(iUps)+'Info/Glossary.html#newwindow');
');//	}
/**/
	if (isSomething(sComment)) sReturn += sComment;

	return sReturn;
	
} // end sLinkPlus3().






//-------------------------------
//-------------------------------//-------------------------------//-------------------------------//
//-------------------------------//-------------------------------//-------------------------------////-------------------------------//-------------------------------////-------------------------------////
function sLinkPlusHUDTCSW(sHotText, sFullURLName, iFolderDepth, sTitle, sComment, sSuper, sWindowName, sHrefOther)
{
	return sLinkPlus3(sHotText, sFullURLName, iFolderDepth, sTitle, sComment, sSuper, sWindowName, sHrefOther);

} // end sLinkPlus().




//-------------------------------
//-------------------------------//-------------------------------//-------------------------------//
//-------------------------------//-------------------------------//-------------------------------////-------------------------------//-------------------------------////-------------------------------////
function sLinkPlus2(sHotText, sTitle, sFullURLName, iFolderDepth, sSuper, sWindowName)
{
	var sComment='';
	return sLinkPlus3(sHotText, sFullURLName, iFolderDepth, sTitle, sComment, sSuper, sWindowName);

} // end sLinkPlus().

//-------------------------------
//-------------------------------//-------------------------------//-------------------------------//
//-------------------------------//-------------------------------//-------------------------------////-------------------------------//-------------------------------////-------------------------------////	sLinkPlus returns a valid HTML href as a string with superscript hints at the end.
//	Replaces msgLinkW (swapped parameters), and msgLink (swamped parameters).
//
////////		sHotText is the text comprising the link.
//		sFullURLName is the web page address.
//		If the URL starts with HTTP:// then assume new window in _blank (unless otherwise stipulated with sWindowName).
//		If sWindowName is not blank then the value will be used to name the window
//		if wName (windowName) is not blank then a w will be added to the link to signify 
//		a new window will be opened.
//		If iDirDepth is not a number then just display a non-linked w for new window links.
//		sOther is a string of characters to display superscript links.
/*
	<li><script type='text/javascript'	>
		dw(sLinkPlus("aaa", bbb, iDirDepth)); 
		</script></li>
*/
//
//	How do you handle HTTP with same???
//
function sLinkPlus(sHotText, sFullURLName, iFolderDepth, sOther, sWindowName)
{
	return sLinkPlus2(sHotText, "", sFullURLName, iFolderDepth, sOther, sWindowName);

} // end sLinkPlus().

//-------------------------------
//
//	replaced with sLinkPlus
//
function msgLink(fullURLName, hotText, wName, iFolderDepth, sOther)	// Last revision: 2006.03.30 by Randall Ijams.
{
//d	alert('msgLink('+fullURLName+SEP+hotText+SEP+wName+SEP+iFolderDepth+S+sOther+')');

	return sLinkPlus(hotText, fullURLName, iFolderDepth, sOther, wName);

} // end msgLink().

//-------------------------------
//
//	dw() stands for Document.Write.
//
function dw(sText)	// Last revision: 2004.10.05 by Randall Ijams.
{
	document.write(sText);
} // dw().

//-------------------------------
//
//	dwP() stands for Document.Write HTML Paragraph.
//
function dwP(sText, sStyle)	// Last revision: 2008.05.09 by Randall Ijams.
{
	var sTemp = '';
	sTemp += '<p';				// <p

	if (!isEmpty(sStyle)) {
		sTemp += ' style="';	// <p style="
		sTemp += sStyle;		// <p style="color:red;
		sTemp += '"';			// <p style="color:red;"
	} // if.

	sTemp += '>';				// <p style="color:red;">
	sTemp += sText;				// <p style="color:red;">Hello World!
	sTemp += sPE;				// <p style="color:red;">Hello World!</p>

	document.write(sTemp);
} // dwP().

//-------------------------------
//
//	dwbl() stands for Document.Write with a <br />.
//
function dwbl(sText)	// Last revision: 2004.10.05 by Randall Ijams.
{
	document.write(sText, sBLN);
} // end dwbl().

//-------------------------------
//
//
//
function dwLink(fullURLName, hotText, wName, gName, ssWord)	// Last revision: 2004.10.05 by Randall Ijams.
{
//d	alert('dwLink('+fullURLName+SEP+hotText+SEP+wName+SEP+gName+SEP+ssWord+')');

	document.write(msgLink(fullURLName, hotText, wName, gName, ssWord));

} // end dwLink().

//-------------------------------
//
//
function dwLILink(fullURLName, hotText, wName, gName, ssWord)	// Last revision: 2004.10.05 by Randall Ijams.
{
//d	alert('dwLILink('+fullURLName+SEP+hotText+SEP+wName+SEP+gName+SEP+ssWord+')');

	document.write(LIB);
	dwLink(fullURLName, hotText, wName, gName, ssWord);
	document.write(LIE);
	
} // end dwLILink().

//==============================================
//
//	Author: Randall Ijams
//
//	Revised: 2004.12.07
//
//	Description:
//
//	Input(s): text
//
//	Output(s):
//
//-------------------------------
//
function sli(sText, sHTMLAttributes)
{
//d	alert('sli('+sText+')');

	var sReturn='';

	if (sHTMLAttributes) {
		sReturn += '<li';
		sReturn += sHTMLAttributes;
		sReturn += '>';
	} else {
		sReturn += LIB;
	} // if.
	sReturn += sText;
	sReturn += LIE;
//c	alert(sReturn);
	return (sReturn);

} // end sli().

//==============================================
//
//	Author: Randall Ijams
//
//	Revised: 2004.12.07
//
//	Description:
//
//	Input(s): text
//
//	Output(s):
//
//-------------------------------
//
function dwli(sText, sHTMLAttributes)
{
//d	alert('dwli('+sText+')');

	document.write(sli(sText, sHTMLAttributes));

} // end dwli().

//-------------------------------
//
function dwliAName(sText)
{
//d	alert('dwliAName('+sText+')');

	var sTemp='';

	sTemp = sAName(sText);
	dwli(sTemp+sText);

} // end dwliAName().

//==============================================
//
//	Author: Randall Ijams
//
//	Revised: 20080506
//
//	Description:
//
//	Input(s): text
//
//	Output(s):
//
//-------------------------------
//
function dwlicb(sText)
{
	var sDots = dUps(iDirDepth);
	var sCB = '<img alt="Check Box" src="'+sDots+'Images/Web/Check Box.gif" height="20" width="16" /> ';
//d	alert('dwli('+sText+')');

	dwli(sCB+sText);

} // end dwli().

//==============================================
//
//	Author: Randall Ijams
//
//	Revised: 2004.12.07
//
//	Description: No longer used.  Replaced with dw(OLB) and dw(OLE).
//
//	Input(s): backSlash = '/' or '' or undefined.
//
//	Output(s):
//
//-------------------------------
//
function dwol2(backSlash)
{
	alert('dwol('+backSlash+')');

//	if ((backSlash != ' ') || (backSlash = undefined)) backSlash = BSL;	// 
//	if ((backSlash == ' ')) backSlash = BSL;	// 
//	if ((backSlash != ' ')) backSlash = '';	// 

//	alert('<'+backSlash+'ol>');
	document.write('<'+backSlash+'ol>');

} // end dwol().


//-------------------------------
//
//	replaced with sHrefSS (better name).
//
function linkG(fullURLName, hotText)	// Last revision: 2004.12.06 by Randall Ijams.
{
	alert("linkG: replace with call to sHrefSS() in "+document.URL);
	return sHrefSS(hotText, fullURLName);

} // end linkG().

//-------------------------------
//
//
function dwLinkG(URLName, hotText, iFolderDepth)	// Last revision: 2004.10.05 by Randall Ijams.
{
//d	alert('dwLinkG('+URLName+SEP+hotText+SEP+dUps+SEP+')');

	document.write(sHrefSS(hotText, dUps(iFolderDepth)+URLName));
} // end dwLinkG().

//-------------------------------
//
//	"dwLinkW(" not found in entire site so no longer need.  Change name to dwLinkW-old.
//
function dwLinkW(URLName, hotText, iFolderDepth)	// Last revision: 2004.10.05 by Randall Ijams.
{
//d	alert('dwLinkW('+URLName+SEP+hotText+SEP+dUps+SEP+')');

	document.write(sHrefSSW(iFolderDepth));

} // end dwLinkW().








//-------------------------------
//
// NOT USED???
function dwBrokenLink(URLName, hotText, iFolderDepth)	// Last revision: 2004.10.05 by Randall Ijams.
{
//d	alert('dwBrokenLink('+URLName+SEP+hotText+SEP+dUps+SEP+')');

	var msg;

	msg  = '';
	msg += sHrefSS(sNEWWINDOWLINKTEXT, dUps(iFolderDepth)+'Info/Glossary.html#newwindow');

	document.write(msg);

} // end dwBrokenLink().



//-------------------------------
//
function msgMailTo(sAddr)
{
	var sReturn = '';

	sReturn += '<a href="mailto:';	// <a href="mailto:
	sReturn += sAddr;				// <a href="mailto:addr
	sReturn += '"';					// <a href="mailto:addr"
	sReturn += '>';					// <a href="mailto:addr">
	sReturn += sAddr;				// <a href="mailto:addr">addr
	sReturn += '</a>';				// <a href="mailto:addr">addr</a>

	return sReturn;

} // end of msgMailTo().



//-------------------------------
//
function dwtdMailTo(sPreText, sEmailAddr, sStyleCode)
{
	var sMsg = '';

//d	sMsg = sEmailAddr;
	sMsg = msgMailTo(sEmailAddr);
	
	dwtd(sPreText+sMsg, sStyleCode);
}	// end dwtdMailTo().



//-------------------------------
//
//
//	Name: Document URL (URL of web page).
//	Description: Return a string with the HTML formatting of the document's URL
//	including the abbr tag.
//
function sURL()
{
	var sReturn = '';	//, sDocURL = document.URL;


//c	var re = /%20/gi;
//c	sDocURL = sDocURL.replace(re, ' ');

	sReturn  = sAbbr('URL', 'Uniform Resource Locator (i.e. web page address)');
	sReturn += ':'+sNBSP;
//	sReturn += (document.URL);		//	sReturn = 'URL: ' + sDocURL;

	sReturn += sDocURL();

//c	sReturn += '.';
	
//d	dw(sReturn);

	return sReturn;

} // end sURL().

//-------------------------------
//
//
//	Name: Document URL (URL of web page).
//	Description: Return a string with the document's URL in normal human readable form.
//
//		document.URL has %20 in place of all spaces.
//
function sDocURL()
{
	return unescape(window.location);

} // end sDocURL().

//-------------------------------
//
//
//	Name: Document Write Blank Line URL of web page.
//
//
//
function dwblURL()
{
	dw(sBLN+sURL());
	
} // end dwblURL().

//*****************************************************************
//*****************************************************************
//
//		Glossary Functions (for glosaary pages)
//
//*****************************************************************
//*****************************************************************


//-------------------------------
//
function backTop(backDirs)	// Last revision: 2004.10.05 by Randall Ijams.
{
	var ps = "<p>";
	var pe = "</p>";
	var hr = "<hr />";
	var top = '<a href="#top">Top</a>';
	if (isNaN(backDirs))
	{
		backDirs = 1;
//		alert (backDirs);
	}

	var output = hr;
	output += ps;
	output += '(Please use "<a href="'
	

	for (i=0; i<backDirs; i++)	// travel up the directory tree backDirs number of times.

	{
		output += '../'
	}
	
	output += 'Info/Glossary.html#back">';
	output += '<span class="gl">Back</span></a>"';
	output += ' on your browser to return to the previous page)';
	output += pe;
	output += ps;
	output += top;
	output += pe;

	document.write(output);
}

//*****************************************************************
//*****************************************************************
//
//		Table Functions (for every page)
//
//*****************************************************************
//*****************************************************************


//-------------------------------
//
//
//
//
//
function sTableBegin(tFormat)
{
	return '<table '+tFormat+'>';
}

//-------------------------------
//
//
//
//
//
function sTableStart(tFormat)
{
	alert("sTableStart() call from "+document.URL);
	return sTableBegin(tFormat);
}

//-------------------------------
//
//
//
//
//
function dwTableStart(tFormat)
{
	alert("dwTableStart() call from "+document.URL);
	dw(sTableBegin(tFormat));
}

//-------------------------------
//
// replace call to this function with dw(sTE);
//
//function sTableEnd()
//{
//	return sTE;
//}	// end sTableEnd().

//-------------------------------
//
function dwTableEnd()
{
	alert("dwTableEnd() call from "+document.URL);
	dw(sTE);
}

//-------------------------------
//	Old function
function tableEnd()
{
	alert("tableEnd() call from "+document.URL);
	dwTableEnd;
}

//-------------------------------
//
function sTableCaption(sCaption)
{
	var sReturn = "";

	sReturn += '<caption>';
	sReturn += sCaption;
	sReturn += '</caption>';

	return sReturn;
}

//-------------------------------
//
function strtr(aTDData, sTRFormat, sTDFormat)
{
//d	if (dnum<DMAX) alert('strtr('+aTDData+SEP+sTRFormat+SEP+sTDFormat+')');
//d	dnum++;

	var ndx, str;

	var delim;
	var dArr = new Array();

	if (isString(aTDData))
	{
		delim 	= aTDData.substring(0,1);			// extract the delimiter
		if (delim == ':')
		{
			aTDData = aTDData.substring(1);			// remove the delimiter
//d			alert(delim+SEP+aTDData);
			dArr = aTDData.split(delim);			// Split the string into array elements using the delimiter.
		}
		else
		{
			dArr[0] = aTDData;						// ???
		}
		aTDData = dArr;								// Copy the newly created array into the original variable.
//d		alert('dwtr with string: '+aTDData);
	}

	sReturn  = '<tr';

	if (!isNothing(sTRFormat))
	{
		sReturn += ' ' + sTRFormat;
	}
	sReturn += '>';

	for (ndx = 0; ndx < aTDData.length; ndx ++)
	{
//d		alert(aTDData[ndx]);
		sReturn += sTD(aTDData[ndx], sTDFormat);
	}
	
	sReturn += TRE;
	
//d	alert(sReturn);

	return sReturn;
}

//-------------------------------
//
function dwtr(dataArr, trFormat, tdFormat)
{
//d	alert('dwtr('+dataArr+SEP+trFormat+SEP+tdFormat+')');

	dw(strtr(dataArr, trFormat, tdFormat));
}

//-------------------------------
//	old function.
function strth(sData, sTHFormat)
{
	return sTH(sData, sTHFormat)
}
//-------------------------------
//
function sTH(sData, sTHFormat)
{
//d	if (dnum<DMAX) alert('sTD('+sData+SEP+sTHFormat+')');

	var sReturn;

	sReturn  = '<th';

	if (!isNothing(sTHFormat))
	{
		sReturn += ' ' + sTHFormat;
	}

	sReturn += '>';
	sReturn += sData;
	sReturn += sTHE;

	return sReturn;
}

//-------------------------------
//
function dwth(data, thFormat)
{
	dw(strth(data, thFormat));
}

//-------------------------------
//
function sTD(sData, sTDFormat)
{
//d	if (dnum<DMAX) alert('sTD('+data+SEP+tdFormat+')');

	var sReturn;

	sReturn  = '<td';

	if (!isNothing(sTDFormat))
	{
		sReturn += ' ' + sTDFormat;
	}

	sReturn += '>';
	sReturn += sData;
	sReturn += sTDE;

	return sReturn;
}	// end sTD().

//-------------------------------
//
function dwtd(sData, sTDFormat)
{
	dw(sTD(sData, sTDFormat));
}

//*****************************************************************
//*****************************************************************
//
//		Header Functions (for every page)
//
//*****************************************************************
//*****************************************************************

//-------------------------------
//
//	Used by dwHeader().
//
function sLinksTop(iUpFolders)
{
	(iDEBUGLEVEL > 4) ? dwbl('sLinksTop('+iUpFolders+')') : '';

	var sReturn = '';

	sReturn += sOtherLinksBegin;	// Allow wrapping at the start?
	if (bLocalDisk)
	{
		sReturn += sLinkPlusHUDTCSW('Files', '.');
		sReturn += sSpacer;
	}
	sReturn += sLinkPlusHUDTCSW('Home', dUps(iUpFolders) + 'index.html');
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Disclaimer', dUps(iUpFolders) + 'Info/Disclaimer.html');
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Info', dUps(iUpFolders) + 'Info/_Info.html');
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Footer', '#footer');
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Referrer', document.referrer);	// Page that sent surfer here;
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Back', 'javascript:window.history.back();');
	sReturn += sSpacer;
	sReturn += sEmailPageContentError();
//	sReturn += sSpacer;
//	sReturn += msgLink('javascript:self.close();', 'Close');  // Only works if Javascript opens window.
	sReturn += sOtherLinksEnd;		// Allow wrapping at the end?

	return sReturn;

} // end sLinksTop().

//-------------------------------
//
//	Used by each web page until replaced by dwHeader().
//
function topLinks(ups)
{
	if (isNothing(ups)) alert('topLinks() missing ups on page '+sDocURL());	// on page '+sURL);

	dw(sLinksTop(ups));

} // end topLinks().

//-------------------------------
//
//	Used by dwHeader().
//
function sLinkBack(iUpFolders)
{
	(iDEBUGLEVEL > 4) ? dwbl('sLinkBack().A: '+iUpFolders+SEP) : '';

	var sReturn = '', sTemp="";

	sReturn += sBLN;
	sReturn += 'Please use ';
	sReturn += '"';

//c	sTemp = ' onmouseover="window.status=\'backitup\';"';	// try later ???
//	sReturn += ' onmouseover="window.status=';
//	sReturn += "'backitup';";
//	sReturn += '"';

	sTemp = "Return to the previous web page you were viewing.";
	sReturn += sHref(sGlossaryWord('Back'), sRelPath('Info/Glossary.html#back'), "", sTemp);

	sReturn += '"';
	sReturn += ' to return to the previous page.';

	return sReturn;

} // end sLinkBack()

//-------------------------------
//
//	Used by each web page until replaced by dwHeader().
//
function backGlossary(ups)			// Last revision: 2004.10.05 by Randall Ijams.
{
	dw(sLinkBack(ups));

} // end backGlossary()

//-------------------------------
//
//
//	Called by dwHeader().
//
function sHeader(iUpFolders, sOtherLinks)
{
	(iDEBUGLEVEL > 5) ? (dwbl('sHeader('+iUpFolders+SEP+sOtherLinks+SEP+")")) : ''; // level 5?

	var sReturn='', sDivText='', sLast;

//c	sReturn += '<a id="top" name="top"></a>';	// not needed as a reference to '#' will work.

//c	sReturn += sBLN;

	sDivText += document.title;
	if (bLocalDisk) sDivText += ' (Local)';
	sReturn += sDiv(sDivText, 'hdr');

	sDivText = '';
	if (isSomething(sOtherLinks))
	{
		sLast = sOtherLinks.substr(sOtherLinks.length-sBLN.length);	// sBLN = <br />.
		if (sLast!=sBLN)		// if sOtherLinks end with a new line then no need to add spaces before other links.
		{
			sOtherLinks += sNBSPs(4) + " ";	// Put spaces between link sets (>   <) and allow wrapping afterwords.
		}
		sDivText += sOtherLinks;
	}

	sDivText += sLinksTop(iUpFolders);
	sDivText += sLinkBack(iUpFolders);

	sReturn += sDiv(sDivText, 'hdrlinks');

	sReturn += sHR;

//c	sReturn += sBLN;

	return (sReturn);

} // end sHeader().

//-------------------------------
//
//
//
//
function dwHeader(iUpFolders, sOtherLinks)
{
	(iDEBUGLEVEL > 4) ? (dwbl('dwHeader('+iUpFolders+SEP+sOtherLinks+SEP+")")) : ''; // level 4?
//	if (isNothing(iUpFolders))
//	{
//		alert("iUpFolders is undefined in "+document.title+".");
//	}
	dw(sHeader(iUpFolders, sOtherLinks));
}	// end of dwHeader().

//*****************************************************************
//*****************************************************************
//
//		Footer Functions (for every page)
//
//*****************************************************************
//*****************************************************************

//-------------------------------
//
//	Used by dwFooter().
//
function sFooterLinks(iUpFolders)			// Last revision: 2004.12.01 by Randall Ijams.
{
	(iDEBUGLEVEL > 8) ? (dwbl(sBLN+'sFooterLinks().a: '+iUpFolders+SEP)) : '';

	var sReturn='';

//c	sReturn += sNBSPs(4);
	sReturn += sOtherLinksBegin;		// do not allow wrapping before the < in this string.
	if (bLocalDisk)
	{
		sReturn += sLinkPlusHUDTCSW('Files', '.');
		sReturn += sSpacer;
	}
	sReturn += sLinkPlusHUDTCSW('Home', dUps(iUpFolders) + 'index.html');
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Disclaimer', dUps(iUpFolders) + 'Info/Disclaimer.html');
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Info', dUps(iUpFolders) + 'Info/_Info.html');
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Top', '#');
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Back', 'javascript:window.history.back();');	// goback(1);
	sReturn += sSpacer;
	sReturn += sLinkPlusHUDTCSW('Referrer', document.referrer);	// Page that sent surfer here;
//	sReturn += sSpacer;
//	sReturn += sLinkPlusHUDTCSW('Close', 'javascript:self.close();');	// Only works if opened with javascript.
	sReturn += sSpacer;
	sReturn += sEmailPageContentError();
	sReturn += sOtherLinksEnd;		// do not allow wrapping after the >.

	sReturn += sBLN;
	sReturn += 'Today is ';
//C	sReturn += dateFormat(new Date(), 'dmdy=&=n=b=s=p=;at=&=n=b=s=p=;aphms=&=n=b=s=p=;ampm.');
	sReturn += dateFormat(new Date(), 'dmdy at aphms ampm.');

	return sReturn;

} // end sFooterLinks().

//-------------------------------
//
//	Used by dwFooter().
//
function sBottomLinks(iUpFolders, sOtherLinks)			// Last revision: 2004.12.01 by Randall Ijams.
{
	(iDEBUGLEVEL > 8) ? (dwbl(sBLN+'sBottomLinks().a: '+iUpFolders+SEP+sOtherLinks+SEP)) : '';

	var sReturn='';

	sReturn += sAbbr('Links', 'Other commonly used links.');
	sReturn += ":"+sNBSPs(3)+ " ";		// Allow wrapping after Links:.

	if (isSomething(sOtherLinks))
	{
//c		sReturn += sNBSPs(4);
		sReturn += sOtherLinks;
		sReturn += sNBSPs(3)+" ";
	}

	sReturn += sFooterLinks(iUpFolders);

	return sReturn;

} // end sBottomLinks().

//-------------------------------
//
//	Used by each web page until replaced by dwFooter().
//
function bottomLinks(ups, sOtherLinks)			// Last revision: 2004.12.01 by Randall Ijams.
{
	debug ? alert('bottomLinks('+ups+')') : '';

	if (isNothing(ups)) alert('bottomLinks() missing ups on page '+sDocURL());	// on page '+sURL);

	dw(sFooterLinks(ups, sOtherLinks));

} // end bottomLinks().



//-------------------------------
//
//	Used by each web page until replaced by dwFooter().
//
function footerLeft(sPageName, sPageParent)
{
	var iUps = 1;

	alert ("This page still uses the old code footerLeft.");

	switch (sPageParent.toLowerCase())
	{
		case 'top':
			iUps = 0;
			break;
		case 'home':
		case 'info':
		case 'ref':
		case 'other':
		case 'tests':
		case 'games':
		case 'PARENT':
		case 'parent':
		case 'pdc':
		case 'rri':
//			iUps = 1;
			break;
		case 'gifts':
		case 'training':
		case 'school':
		case 'progreports':
			iUps = 2;
			break;
		case 'classes':
			iUps = 3;
			break;
		default:
			iUps = -1;
			break;
	}

	dwFooterLeft(sPageName, sPageParent, iUps);

} // end footerLeft().



//-------------------------------
//
//	Used by each web page until replaced by dwFooter().
//
function dwFooterLeft(sPageName, sPageParent, iUps)			// Last revision: 2004.10.05 by Randall Ijams.
{
	dw(sFooterLeft(sPageName, sPageParent, iUps));
}



//-------------------------------
//
//	Used by sSitePath().
//
// 20090702 Created and used recursion to simplify coding.
//
function sBuildSitePath(sPageParent, iUps) {
	var bLast, iLocExt, iLocFirstWack, iLocLastWack, iLocUnderscore, iLocLastWack, sParentPages = '', sTopPageName = 'Root', sReturn='', sRootFileName = "_SalesTime.php";
	var bWack, sTemp;

	iLocLastWack = sPageParent.lastIndexOf(sWACK);	// Locate last wack (/). -1 if not found.
	if (sPageParent[sPageParent.length-1] == sWACK) {
		sPageParent = sPageParent.substring(0, sPageParent.length-1);
		iLocLastWack = sPageParent.lastIndexOf(sWACK);	// Locate last wack (/). -1 if not found.
		
	} // if().
	bWack = (iLocLastWack >= 0);				// If not found var get true.

//d	alert('sBuildSitePath(SWITCH):'+sPageParent+':'+iUps+':'+iLocLastWack+':'+bWack);	//d

	switch (sPageParent.toLowerCase())
	{
		case '':
//d			alert('sSitePath():'+sPageName+':'+sPageParent+':'+iUps);
			sParentPages  = sLinkPlus('MISSING', dUps(0) + 'index.html');
			break;
		case 'ads':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Ads', dUps(iUps-1) + '_Ads.html');
			break;
		case 'ce':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Computer Environments', dUps(iUps-1) + '_ce.html');
			break;
		case 'classes':
			sParentPages  = sBuildSitePath('School', iUps-2);
			sParentPages += sLinkPlus('Classes', dUps(iUps-3) + 'index.html');
//c			ups = 4;
			break;
		case 'db':
		case 'database':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Database', dUps(iUps-1) + '_Database.html');
			break;
		case 'drivingskills':		// Below Other/vehicle
			sParentPages  = sBuildSitePath('Vehicle', iUps-2);
			sParentPages += sLinkPlus('Driving Skills', dUps(iUps-3) + 'DrivingSkills.html');
			break;
		case 'elaine':
			sParentPages  = sBuildSitePath('ElaineMacKay', iUps-1);
			sParentPages += sLinkPlus('EM', dUps(iUps-2) + '_EM.html');
			break;
		case 'elainemackay':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Elaine MacKay', '_ElaineMackay.html');
			break;
		case 'entertainment':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Entertainment', dUps(iUps-1) + '_Entertainment.html');
			break;
		case 'games':
			sParentPages  = sBuildSitePath('Entertainment', iUps-1);
			sParentPages += sLinkPlus('Games', dUps(iUps) + 'games.html');	// 0
			ups = 1; 
			break;
		case 'gifts':
			sParentPages  = sBuildSitePath('Ijams', iUps-1);
			sParentPages += sLinkPlus('Gifts', dUps(iUps-2) + 'index.html');
//c			ups = 2;
			break;
		case 'home':
		case 'root':	//c To test other 'root' case.
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + sRootFileName);
			break;
		case 'homeinfo':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Home Info', dUps(iUps-1) + '_HomeInfo.html');
			break;
		case 'humor':
			sParentPages  = sBuildSitePath('Entertainment', iUps-1);
			sParentPages += sLinkPlus('Humor', dUps(iUps-2) + '_humor.html');
			break;
		case 'ijams':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Ijams', dUps(iUps-1) + '_Ijams.html');
			break;
		case 'ijamsrandall':
			sParentPages  = sBuildSitePath('Ijams', iUps-1);
			sParentPages += sLinkPlus('Randall Ijams', '_IjamsRandall.html');
			break;
		case 'info':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Info', dUps(iUps-1) + '_Info.html');
			break;
		case 'ipdc':
			sParentPages  = sBuildSitePath('Ijams', iUps-1);
			sParentPages += sLinkPlus('PDC', '_pdc.html');	// 0
//c			ups = 2;
			break;
		case 'other':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Other', dUps(iUps) + 'Other/_Other.html');
			break;
		case 'parent':
			sParentPages  = sLinkPlus('PARENT', dUps(0) + 'index.html');
			break;
		case 'pdc':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('PDC', '_pdc.html');	// 0
//c			ups = 2;
			break;
		case 'php':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('PHP', dUps(iUps-1)+'_php.html');
			break;
//		case 'phpup':
//			sParentPages  = sBuildSitePath('Home', iUps);
//			sParentPages += sLinkPlus('PHP', dUps(iUps-1) + '_php.html');
//			break;
		case 'progreports':
			sParentPages  = sBuildSitePath('RandallIjams', iUps-2);
			sParentPages += sLinkPlus('Progress Reports', dUps(0) + 'index.html');
//c			ups = 2;
			break;
		case 'public':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Public', dUps(iUps-1) + '_Public.html');
			break;
		case 'randallijams':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Randall Ijams', dUps(iUps-1) + '_RandallIjams.html');
			break;
		case 'real estate':
			sParentPages  = sBuildSitePath('RI', iUps-2);
			sParentPages += sLinkPlus('Real Estate', '_realestate.html');
//c			ups = 2;
			break;
		case 'ref':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('References', dUps(iUps-1) + '_Ref.html');
			break;
		case 'root':	// Code flow should never get here as 'root' case is by 'home' case.
			sReturn = sSitePath(sPageName, 'Home', iUps);
			bLast = false;	// Do NOT do anything else.
			break;
		case 'rki':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('RobertIjams', dUps(iUps) + 'RobertIjams/_RobertIjams.html');
			break;
		case 'rri':
		case 'ri':
			sParentPages  = sBuildSitePath('RandallIjams', iUps-1);
			sParentPages += sLinkPlus('RI', dUps(iUps) + 'RI/_RI.html');
			break;
		case 'ridvds':
			sParentPages  = sBuildSitePath('RandallIjams', iUps-2);
			sParentPages += sLinkPlus('DVDs', dUps(iUps) + 'RI/DVDsCreated/_DVDsCreated.html');
			break;
		case 'rif':
		case 'rifinancial':
		case 'financialri':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps) + 'RI/_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Financial', dUps(iUps) + 'RI/Financial/_Financial.html');
			break;
		case 'rifwm':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps-1) + '_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Financial', dUps(iUps-2) + '_Financial.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('WaMu', dUps(iUps) + 'RI/Financial/WaMu/_wamu.html');
			break;
		case 'rimedical':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps-1) + '_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Medical', dUps(iUps-2) + 'RI/Medical/_medical.html');
			break;
		case 'samplecode':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus(sHardString('Sample Code'), dUps(iUps-1) + '_SampleCode.html');
			break;
		case 'school':
			sParentPages  = sBuildSitePath('RandallIjams', iUps-2);
			sParentPages += sLinkPlus('School', dUps(iUps-1) + 'index.html');
//c			ups = 3;
			break;
		case 'share':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Share', dUps(iUps-1) + '_share.html');
			break;
		case 'sold':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Ads', dUps(iUps-1) + '_Ads.html');
			break;
		case 'tests':
			sParentPages  = sBuildSitePath('Other', iUps-1);
			sParentPages += sLinkPlus('Tests', dUps(iUps-1) + 'testscripts.html');	// 0
//c			ups = 1;		// no longer needed???
			break;
		case 'tiempo':
			sParentPages  = sBuildSitePath('Westpark', iUps);
			sParentPages += sLinkPlus('Tiempo', '_Tiempo.html');
			break;
		case 'top':
			sParentPages  = '';
//c			ups=0;
			break;
		case 'training':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Training', dUps(iUps-1) + 'index.html');
//c			ups = 2;
			break;
		case 'vehicle':		// Below Other.
			sParentPages  = sBuildSitePath('Other', iUps-1);
			sParentPages += sLinkPlus('Vehicle', dUps(iUps-2) + '_Vehicle.html');
			break;
		case 'westpark':
			sParentPages  = sBuildSitePath('Home', iUps);
			sParentPages += sLinkPlus('Westpark', dUps(iUps-1) + '_Westpark.html');
			break;
		default:
			// Is Parent a file name or a directory (no extension) or a combination?
			// If file name only (iLoc<0 or bLast is true) then show same directory 
			//	  path as current file and insert this
			//    file name between the path and the current web page.
			// If directory (no extension) then assume up one level and _DIRNAME.html.
			// iLocLastWack has the value of the last wack in sPageParent.

/********************

_Page.html				// == Page/().  Single filename. bLast is true. Parent file is in same directory.
One						// == One/().  Single unknown directory.  bLast is true.  Parent file is in same directory but assume _One.html.
One/Page.html			// == One/Page/().  
One/Two/Three			// == One/Two/Three/()
One/Two/Three/Page.html	// == One/Two/Three/Page/()

??? php/Testing/Functions == Root/php/Testing/Functions/()

**********************/
/**
	asParents = sPageParent.split('/');
	for (iNdx=0; iNdx < asParents.length; iNdx++) {
		sTemp = sLinkPlus(
	} // for().

/**/




	if (bWack) {
		sEnding = sPageParent.substring(iLocLastWack+1);	// get the ending part.
		sBegining = sPageParent.substring(0, iLocLastWack);	// get the begining part.
//d		alert('sBuildSitePath:Default:bWack:AAA'+sBegining+":"+sEnding+":");	//d
		sTemp = sHtmlSitePathLinkDir(sEnding);	// dUps(1)+
//d		alert("sBuildSitePath:Default:bWack:If="+sTemp); //d
		sTemp = sBuildSitePath(sBegining, iUps) + sTemp;
		sParentPages = sTemp;
//d		alert('if');	//d
	} else {
		sParentPages = sHtmlSitePathLinkDir(dUps(1)+sPageParent);	// dUps(1)+
		alert("sBuildSitePath:default:bWack:Else="+sTemp); //d
//d		alert('else');	//d
	} // if().

//d	alert('DDD'+sParentPages);	//d


/**





			sExtension = sFileNameExtension(sPageParent);
			alert('sBuildSitePath:default:'+sExtension+':');
			if (bLast && sExtension) {	// Single file name = No wack and dot then sPageParent is a single file name.
				sTemp = sFileNameOnly(sPageParent);			// sTemp will be the displayed name so remove the extension.
				// Remove the underscore for the display if it exists.
				iLocUnderscore = sTemp.indexOf('_');
				if (iLocUnderscore === 0) sTemp = sTemp.substring(1);

				alert('sBuildSitePath:default:bLast:SingleFileName:sPageParent='+sTemp);	//d
				sParentPages = sLinkPlus(sTemp, sPageParent);	// sLinkPlus('NAME', 'URL');
			} else if (bLast) {	// Single Dir = if no wack and  no dot/extension then sPageParent is a single unrecognized directory.
				sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
				sParentPages += sWACK;
				sTemp = '_'+sPageParent+'.html';
				sParentPages = sLinkPlus(sPageParent, sTemp);
				alert("sBuildSitePath:default:bLast:SingleDir="+sParentPages);
			} else { // Wack found so parse into two separate calls to sBuildSitePath.
//c				iLocLastWack = sPageParent.lastIndexOf(sWACK);	// Calculated at the top of the function.
//c				if (iLocFirstWack ===0) iLocFirstWack = sPageParent.indexOf(sWACK, 1);
				sTemp = sPageParent.substring(iLocLastWack+1);	// get the Last dir.
				alert("sBuildSitePath:default:else="+iLocLastWack+":"+sTemp+":");	//d
//c				sTemp = sLinkPlus(sTemp, dUps(iUps)+'_'+sTemp+'.html');
				sTemp = sBuildSitePath(sTemp, iUps);
				sPageParentNew = sPageParent.substring(0, iLocLastWack);	// get the remander.
//d				alert("sBuildSitePath:default:else="+iLocFirstWack+":"+sTemp+":"+sPageParentNew);	//d
				sReturn = sTemp + sBuildSitePath(sPageParentNew, iUps - 1);
			} // if (bLast...).


/**/


			break;
	} // switch().
/**

	if (!bWack) {	// Is this not the last web page in the sParentPages URL?
		if (isSomething(sParentPages))	// Only output if there is something to output.
		{
			sReturn += sParentPages;
			sReturn += sWACK;
//d			alert('sBuildSitePath(ParentPages):'+sReturn);	//d
		} // if.
		else {
			alert('sBuildSitePath(bWack:sParentPages are empty) = '+sParentPages+':'+sReturn);
				
		} // else.
/**	} else {	// This condition occurs when we have a mixed known and unknown directory names.  We always parse each parameter down to a single name so by the time we get here it is always the last (or single) one.
		alert('sBuildSitePath(!bLast) = '+sParentPages+':'+sReturn);	/**
	} // if bLast.
/**/

		if (isSomething(sParentPages))	// Only output if there is something to output.
		{
			sReturn += sParentPages;
			sReturn += sWACK;
//d			alert('sBuildSitePath(ParentPages):'+sReturn);	//d
		} // if.

return sReturn;

} // sBuildSitePath().



function sTest(sPageParent, iUps) {
	var bLast, iLocExt, iLocFirstWack, iLocLastWack, iLocUnderscore, iLocLastWack, sParentPages = '', sTopPageName = 'Root', sReturn='', sRootFileName = "_SalesTime.php";
	var bWack, sTemp;


	iLocLastWack = sPageParent.lastIndexOf(sWACK);	// Locate last wack (/). -1 if not found.
	if (sPageParent[sPageParent.length-1] == sWACK) {
		sPageParent = sPageParent.substring(0, sPageParent.length-1);
		iLocLastWack = sPageParent.lastIndexOf(sWACK);	// Locate last wack (/). -1 if not found.
		
	} // if().
	bWack = (iLocLastWack >= 0);				// If not found var get true.

//d	alert('sTemp():'+sPageParent+':'+iUps+':'+iLocLastWack+':'+bWack);	//d

/********************

_Page.html				// == Page/().  Single filename. bLast is true. Parent file is in same directory.
One						// == One/().  Single unknown directory.  bLast is true.  Parent file is in same directory but assume _One.html.
One/Page.html			// == One/Page/().  
One/Two/Three			// == One/Two/Three/()
One/Two/Three/Page.html	// == One/Two/Three/Page/()

??? php/Testing/Functions == Root/php/Testing/Functions/()

**********************/
/**
	asParents = sPageParent.split('/');
	for (iNdx=0; iNdx < asParents.length; iNdx++) {
		sTemp = sLinkPlus(
	} // for().

/**/

	if (bWack) {
		sEnding = sPageParent.substring(iLocLastWack+1);	// get the ending part.
		sBegining = sPageParent.substring(0, iLocLastWack);	// get the begining part.
		alert('AAA'+sBegining+":"+sEnding+":");
//d		sTemp = sEnding + iUps + sWACK;	//d
		sExtension = sFileNameExtension(sEnding);
		if (sExtension) {
			iLocLastWack = sBegining.lastIndexOf(sWACK);		// Locate last wack (/). -1 if not found.
			sEnding = sBegining.substring(iLocLastWack+1);	// get the ending part.
			sBegining = sBegining.substring(0, iLocLastWack);	// get the begining part.
//d			alert('BBB'+sBegining+":"+sEnding+":");	//d
			sTemp = sEnding + iUps + sWACK+ sTemp;
//d			alert('CCC'+sTemp);	//d
		}
		sReturn = sTest(sBegining, iUps-1) + sTemp;
	} else {
		sReturn = sPageParent + iUps + sWACK;
	} // if().

//d	alert('DDD'+sReturn);	//d
	return sReturn;

} // sTest().



function sHtmlSitePathLinkFile(sName) {
	var sDisplay;
	// Create the href for the file.
	sDisplay = sFileNameOnly(sName);			// sTemp will be the displayed name so remove the extension.
	// Remove the underscore for the display if it exists.
	if (sDisplay.indexOf('_') === 0) sDisplay = sDisplay.substring(1);
	return sLinkPlus(sDisplay, sName);	// sLinkPlus('NAME', 'URL');
}



function sHtmlSitePathLinkDir(sName, sExt) {
	var sURL;
	if (typeof sExt == 'undefined' ) sExt = 'html';
	sURL = '_'+sName+'.'+sExt;
	return sLinkPlus(sName, sURL);
}



function sHtmlSitePathLink(sName) {
	var sReturn;
	//d alert('sHtmlSitePathLink():'+sName);
	if (sFileNameExtension(sName)) {
		sReturn = sHtmlSitePathLinkFile(sName);
	} else {	// No extension.
		switch (sName.toLowerCase())	// Added 2011.11.23 by RI.
		{
			case 'home':
			case 'root':
				sReturn = sLinkPlus('Home', dUps(1) + sRoot);
				//d alert('sHtmlSitePathLink(): '+sReturn);
				break;
			default:
				sReturn = sHtmlSitePathLinkDir(sName);
				break;
		} // eo.switch.sName
	} // if().
	return sReturn;
}



function bFileExt(sFileName) {
	var bExt;
	bExt = sFileNameExtension(sFileName) ? true : false;
//d	alert('bFileExt:'+bExt);	//d
	return bExt;
} // bFileExt().


function sHtmlSitePath(sPageParent, iUps) {
	var bLast, iLocExt, iLocFirstWack, iLocLastWack, iLocUnderscore, iLocLastWack, sParentPages = '', sTopPageName = 'Root', sReturn='', sRootFileName = "_SalesTime.php";
	var bWack, sTemp;

	iLocLastWack = sPageParent.lastIndexOf(sWACK);	// Locate last wack (/). -1 if not found.
	//d alert('sHtmlSitePath: ' + sPageParent + ":" + iUps + ":"+iLocLastWack);
	//Remove ending wack if found.
	if (sPageParent[sPageParent.length-1] == sWACK) {
		sPageParent = sPageParent.substring(0, sPageParent.length-1);
		iLocLastWack = sPageParent.lastIndexOf(sWACK);	// Locate last wack (/). -1 if not found.
	} // if().
	bWack = (iLocLastWack >= 0);				// If wack found var is true.

	if (bWack) {
		sEnding = sPageParent.substring(iLocLastWack+1);	// get the ending part.
		sBegining = sPageParent.substring(0, iLocLastWack);	// get the begining part.
		sTemp = sHtmlSitePathLink(sEnding) + sWACK;
//d		alert('sHtmlSitePath:AAA'+sBegining+":"+sEnding+":"+sTemp+":");	//d
		if (bFileExt(sEnding)) {
			iLocLastWack = sBegining.lastIndexOf(sWACK);		// Locate last wack (/). -1 if not found.
			sEnding = sBegining.substring(iLocLastWack+1);		// get the ending part.
			sBegining = sBegining.substring(0, iLocLastWack);	// get the begining part.
//d			alert('sHtmlSitePath:BBB'+sBegining+":"+sEnding+":");	//d

			sTemp = sHtmlSitePathLinkDir(sEnding) + sWACK+ sTemp;
//d			alert('sHtmlSitePath:CCC'+sTemp);	//d
		}
		sReturn = sHtmlBuildSitePath(sBegining, iUps) + sTemp;

	} else {	// No wack.
		sReturn = sHtmlSitePathLink(sPageParent) + sWACK;
	} // if().

//d	alert('sHtmlSitePath:DDD'+sReturn);	//d
	return sReturn;
} // sHtmlSitePath().






function sHtmlBuildSitePath(sFile, iUps) {
	return sBuildSitePath(sFile, iUps);
}











function sBuildSitePath2(sPageParent, iUps) {	// sHtmlSitePathDirs
	var bWack, sEnding, sBegining, sExtension, sTemp, sReturn='';

	var bLast, iLocExt, iLocFirstWack, iLocLastWack, iLocUnderscore, iLocLastWack, sParentPages = '', sTopPageName = 'Root', sRootFileName = "_SalesTime.php";



	iLocLastWack = sPageParent.lastIndexOf(sWACK);	// Locate last wack (/). -1 if not found.
	if (sPageParent[sPageParent.length-1] == sWACK) {	// Remove trailing wack is exists.
		sPageParent = sPageParent.substring(0, sPageParent.length-1);	// Eliminate last character.
		iLocLastWack = sPageParent.lastIndexOf(sWACK);	// Locate new last wack (/). -1 if not found.
	} // if().

	bWack = (iLocLastWack >= 0);				// If not found var get true.

//d	alert('sBuildSitePath(SWITCH):'+sPageParent+':'+iUps+':'+iLocLastWack+':'+bWack);	//d

	if (bWack) {
		sEnding = sPageParent.substring(iLocLastWack+1);	// get the ending part.
		sBegining = sPageParent.substring(0, iLocLastWack);	// get the begining part.
//d		alert('AAA'+sBegining+":"+sEnding+":");	//d
		sExtension = sFileNameExtension(sEnding);
		if (sExtension) {
			// Create the href for the file.
			sTemp = sFileNameOnly(sEnding);			// sTemp will be the displayed name so remove the extension.
			// Remove the underscore for the display if it exists.
			iLocUnderscore = sTemp.indexOf('_');
			if (iLocUnderscore === 0) sTemp = sTemp.substring(1);

//d			alert('sBuildSitePath:default:bWack:Extension:sPageParent='+sTemp);	//d
			sParentPages = sLinkPlus(sTemp, sEnding);	// sLinkPlus('NAME', 'URL');
alert('Extension:'+sParentPages);	//d

			// Create the href for the last directory.
			iLocLastWack = sBegining.lastIndexOf(sWACK);		// Locate last wack (/). -1 if not found.
			sEnding = sBegining.substring(iLocLastWack+1);	// get the ending part.
			sBegining = sBegining.substring(0, iLocLastWack);	// get the begining part.


			sTemp = '_'+sEnding+'.html';
			sTemp = sLinkPlus(sEnding, sTemp);
			alert("sBuildSitePath:default:bWack:SingleDir="+sTemp);	//d







//d			alert('BBB'+sBegining+":"+sEnding+":");	//d
			sTemp = sBuildSitePath(sBegining, iUps) + sTemp + sWACK + sParentPages;
//d			alert('CCC'+sTemp);	//d
		} else {
			sTemp = '_'+sEnding+'.html';
			sTemp = sLinkPlus(sEnding, sTemp);	// dUps(1)+
//d			alert("sBuildSitePath:default:bWack:else="+sTemp); //d
			sTemp = sBuildSitePath(sBegining, iUps) + sTemp;
		} // if().
		sParentPages = sTemp;
//d		alert('if');	//d
	} else {	// No wack.
		sParentPages = sPageParent + iUps;
//d		alert('else');	//d
	} // if().

	return sReturn;
} // sHtmlSitePathDirs().





/*------------------------------------------------------

	Used by sFooter().

20090702 Created sBuildSitePath() using recursion.
20090326 Added bLast functionality for use with grouped parents.
20041005 Randall Ijams.
-------------------------------------------------------/**/
function sSitePath(sPageName, sPageParent, iUps) {
	(iDEBUGLEVEL > 8) ? (dwbl(sBLN+'sSitePath().a: '+sPageName+SEP+sPageParent+SEP+iUps+SEP)) : '';

	var sParentPages, sSPLabel, sReturn;

	if (isNothing(iUps))
	{
		alert ('sSitePath().B: Missing iUps\/iDirDepth parameter.');
		footerLeft(sPageName, sPageParent);				// ???
		return sReturn;									// abort this call - return blank string.
	}

	sParentPages = sHtmlSitePath(sPageParent, iUps);	// sBuildSitePath()
//d	alert('sSitePath(sBuildSitePath) = '+sParentPages);	//d

	sSPLabel  = sGlossaryWord('Site Path');	// Format text to show it is in our glossary.
	sSPLabel  = sAbbr(sSPLabel, 'List of parent web pages (i.e. site hierarchy for this page).');
	// iUps is -1 when the parent page is unknown.  We don't know how deep we are in the dir structure.
	if (iUps > -1) sSPLabel = sHref(sSPLabel, dUps(iUps) + 'Info/Glossary.html#sitepath');  // Create link if we know how deep we are in the directory structure.
	sSPLabel += ':'+sNBSP;
//d	alert('sSitePath(Label):'+sSPLabel);	//d

	sReturn = sSPLabel+sParentPages+sPageName;
	
	return sReturn;

} // end sSitePath().



/*------------------------------------------------------

	Used by sFooter().

20090326 Added bLast functionality for use with grouped parents.

-------------------------------------------------------/**/
function sSitePathOriginal(sPageName, sPageParent, iUps)		// Last revision: 2004.10.05 by Randall Ijams.
{
	(iDEBUGLEVEL > 8) ? (dwbl(sBLN+'sSitePath().a: '+sPageName+SEP+sPageParent+SEP+iUps+SEP)) : '';

	var bLast, iLoc, iLoc2, iLocLastWack, sParentPages = '', sSPLabel, sSP, sTopPageName = 'Root', ups=1, sReturn='';

	iLocLastWack = sPageParent.lastIndexOf(WACK);	// Locate last wack (/).
//d	alert ('sSitePath(iLocLastWack) = '+iLocLastWack);	//d
	bLast = (iLocLastWack < 0);		// If not found var get true.

	if (isNothing(iUps))
	{
		alert ('sSitePath().B: Missing iUps\/iDirDepth parameter.');
		footerLeft(sPageName, sPageParent);				// ???
		return sReturn;									// abort this call - return blank string.
	}

	alert('DDD sSitePath(switch):'+sPageName+':'+sPageParent+':'+iUps+':'+bLast);	//d

	switch (sPageParent.toLowerCase())
	{
		case '':
//d			alert('sSitePath():'+sPageName+':'+sPageParent+':'+iUps);
			sParentPages  = sLinkPlus('MISSING', dUps(0) + 'index.html');
			break;
		case 'ads':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Ads', dUps(iUps-1) + '_Ads.html');
			break;
		case 'ce':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Computer Environments', dUps(iUps-1) + '_ce.html');
			break;
		case 'db':
		case 'database':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Database', dUps(iUps-1) + '_Database.html');
			break;
		case 'drivingskills':		// Below Other/vehicle
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Other', dUps(iUps-1) + '_Other.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Vehicle', dUps(iUps-2) + '_Vehicle.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Driving Skills', dUps(iUps-3) + 'DrivingSkills.html');
			break;
		case 'elaine':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('EM', dUps(iUps) + '_EM.html');
			break;
		case 'elainemackay':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Elaine MacKay', '_ElaineMackay.html');
			break;
		case 'entertainment':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Entertainment', dUps(iUps-1) + '_Entertainment.html');
			break;
		case 'games':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');	// 1
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Games', dUps(iUps-1) + 'games.html');	// 0
			ups = 1; 
			break;
		case 'home':
		case 'root':	//c To test other 'root' case.
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			break;
		case 'homeinfo':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Home Info', dUps(iUps-1) + '_HomeInfo.html');
			break;
		case 'humor':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Entertainment', dUps(iUps-1) + '_Entertainment.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Humor', dUps(iUps-2) + '_humor.html');
			break;
		case 'ijams':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Ijams', dUps(iUps-1) + '_Ijams.html');
			break;
		case 'ijamsrandall':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Ijams', dUps(iUps-1) + '_Ijams.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Randall Ijams', '_IjamsRandall.html');
			break;
		case 'info':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Info', dUps(iUps-1) + '_Info.html');
			break;
		case 'ipdc':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');	// 1.  2 if nested under Other.
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Ijams', dUps(iUps-1) + '_Ijams.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('PDC', '_pdc.html');	// 0
			ups = 2;
			break;
		case 'other':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Other', dUps(iUps-1) + '_Other.html');
			break;
		case 'parent':
			sParentPages  = sLinkPlus('PARENT', dUps(0) + 'index.html');
			break;
		case 'php':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('PHP', '_php.html');
			break;
		case 'phpup':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('PHP', dUps(iUps-1) + '_php.html');
			break;
		case 'public':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Public', dUps(iUps-1) + '_Public.html');
//d			alert('sSitePath(Public):'+sParentPages);
			break;
		case 'randall':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Randall Ijams', dUps(iUps-1) + '_RandallIjams.html');
			break;
		case 'ref':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('References', dUps(iUps-1) + '_Ref.html');
			break;
		case 'root':	// Code flow should never get here as 'root' case is by 'home' case.
			sReturn = sSitePath(sPageName, 'Home', iUps);
			bLast = false;	// Do NOT do anything else.
			break;
		case 'samplecode':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus(sHardString('Sample Code'), dUps(iUps-1) + '_SampleCode.html');
			break;
		case 'sold':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Ads', dUps(iUps-1) + '_Ads.html');
			break;
		case 'tests':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');		// 1
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Other', dUps(iUps-1) + '_Other.html');	// 0
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Tests', dUps(iUps-1) + 'testscripts.html');	// 0
			ups = 1;		// no longer needed???
			break;
		case 'top':
			sParentPages  = '';
			ups=0;
			break;
		case 'vehicle':		// Below Other.
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Other', dUps(iUps-1) + '_Other.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Vehicle', dUps(iUps-2) + '_Vehicle.html');
			break;
		case 'pdc':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');	// 1.  2 if nested under Other.
			sParentPages += sWACK;
			sParentPages += sLinkPlus('PDC', '_pdc.html');	// 0
			ups = 2;
			break;
		case 'gifts':
			sParentPages  = sLinkPlus(sTopPageName, dUps(2) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Ijams', dUps(1) + '_Ijams.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Gifts', dUps(0) + 'index.html');
			ups = 2;
			break;
		case 'training':
			sParentPages  = sLinkPlus(sTopPageName, dUps(2) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Training', dUps(1) + 'index.html');
			ups = 2;
			break;
		case 'school':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps-1) + 'RI/_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('School', dUps(iUps-1) + 'index.html');
			ups = 3;
			break;
		case 'classes':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps-1) + '_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('School', dUps(iUps-2) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Classes', dUps(iUps-3) + 'index.html');
			ups = 4;
			break;
		case 'rki':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RobertIjams', dUps(iUps) + 'RobertIjams/_RobertIjams.html');
			break;
		case 'rri':
		case 'ri':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps) + 'RI/_RI.html');
			break;
		case 'ridvds':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps) + 'RI/_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('DVDs', dUps(iUps) + 'RI/DVDsCreated/_DVDsCreated.html');
			break;
		case 'rif':
		case 'rifinancial':
		case 'financialri':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps) + 'RI/_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Financial', dUps(iUps) + 'RI/Financial/_Financial.html');
			break;
		case 'rifwm':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps-1) + '_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Financial', dUps(iUps-2) + '_Financial.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('WaMu', dUps(iUps) + 'RI/Financial/WaMu/_wamu.html');
			break;
		case 'rimedical':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps-1) + '_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Medical', dUps(iUps-2) + 'RI/Medical/_medical.html');
			break;
		case 'share':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Share', dUps(iUps-1) + '_share.html');
			break;
		case 'progreports':
			sParentPages  = sLinkPlus(sTopPageName, dUps(2) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(1) + '_RI.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Progress Reports', dUps(0) + 'index.html');
			ups = 2;
			break;
		case 'real estate':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('RI', dUps(iUps-1) + '_RI.html');

			sParentPages += sWACK;
			sParentPages += sLinkPlus('Real Estate', '_realestate.html');
			ups = 2;
			break;
		case 'westpark':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Westpark', dUps(iUps-1) + '_Westpark.html');
			break;
		case 'tiempo':
			sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Westpark', dUps(iUps-1) + '_Westpark.html');
			sParentPages += sWACK;
			sParentPages += sLinkPlus('Tiempo', '_Tiempo.html');
			break;
		default:
			// Is Parent a file name or a directory (no extension) or a combination?
			// If file name only (iLoc<0)then show same directory path as current file and insert this
			//    file name between the path and the current web page.
			// If directory (no extension) then assume up one level and _DIRNAME.html.
			// iLocLastWack has the value of the last wack in sPageParent.
			var iLocLastDot;
			iLocLastDot = sPageParent.lastIndexOf('.');				// Find the . of .htm, .html, .php, etc.

			

			alert('CCC sSitePath:default = '+sPageName+':'+sPageParent+':'+iUps+':'+iLocLastWack+':'+iLocLastDot+':'+bLast);
			if (bLast && (iLocLastDot<0)) {	// Single Dir = if no wack and  no dot then sPageParent is a single uncoded directory.
				sParentPages  = sLinkPlus(sTopPageName, dUps(iUps) + 'index.html');	// Assume this directory is just below the root.
				sParentPages += sWACK;
				sTemp = '_'+sPageParent+'.html';
				sParentPages += sLinkPlus(sPageParent, sTemp);
			} else if (bLast) {	// Single file name = No wack and dot then sPageParent is a single file name.
				sTemp = sPageParent;	// This will be the display value.
				// Remove the underscore for the display if it exists.
				iLocUnderscore = sTemp.indexOf('_');
				if (iLocUnderscore === 0) sTemp = sTemp.substring(1);
//d				alert('sSitePath:default:bLast:sPageParent = '+sTemp);	//d
				sParentPages = sLinkPlus(sTemp, sPageParent);	// sLinkPlus('NAME', 'URL');



/*			} elseif (iLocLastDot<0) { // Wack was found with filename.
				sTemp = sPageParent.substring(iLocLastWack+1);	// Get the last parent breadcrumb.
//c				sPageName = sLinkPlus(sTemp, dUps(iUps-1)+'_'+sTemp+'.html') + WACK + sPageName;	// prepend on PageName.
				sPageName = sLinkPlus(sTemp, dUps(iUps-1)+'_'+sTemp+'.html') + WACK + sPageName;	// prepend on PageName.
				sTemp = sPageParent.substring(0, iLocLastWack);		// Get first parent breadcrumbs.
				sReturn = sSitePath(sPageName, sTemp, iUps+1);	// Process the rest of the string. /**/


			} else { // Wack found.	// and dirs only.
				iLocFirstWack = sPageParent.indexOf(sWACK);
				if (iLocFirstWack ===0) iLocFirstWack = sPageParent.indexOf(sWACK, 1);
				sTemp = sPageParent.substring(0, iLocFirstWack);	// get the first dir.
				sTemp = sLinkPlus(sTemp, dUps(iUps)+'_'+sTemp+'.html');
				sPageParentNew = sPageParent.substring(iLocFirstWack+1);	// get the remander.
				alert("BBB sSitePath:default:else = "+iLocFirstWack+":"+sTemp+":"+sPageParentNew);
				sReturn = sTemp + sWACK + sSitePath(sPageName, sPageParentNew, iUps - 1);
			} // if (bLast...).

/*
			if (bLast) {	// If this is the last web page in the URL string (iLocLastWack<0 or ==-1 e.g. wack not found).




				iLocLastWack = sPageParent.indexOf('.htm');				// Find the . of .htm or .html.
				iLocLastWack = iLocLastWack || sPageParent.indexOf('.php');		// If not .htm then find the . of .php.
				sTemp = sPageParent.substring(0, iLocLastWack);			// Get just the name.
				iLocTemp = sPageParent.indexOf('_');	// Remove the underscore for the display.
				if (iLocTemp === 0) sTemp = sPageParent.substring(1);
//d				alert('sSitePath:default:bLast:sPageParent = '+sTemp);	//d
				sParentPages += sLinkPlus(sTemp, dUps(iUps)+sPageParent);	// sLinkPlus('NAME', 'URL');
			} else {
				sTemp = sPageParent.substring(iLocLastWack+1);	// Get the last parent breadcrumb.
				iLocTemp = sPageParent.indexOf('_');	// Remove the underscore for the display.
				if (iLocTemp === 0) sTemp = sPageParent.substring(1);
//c				sPageName = sLinkPlus(sTemp, dUps(iUps-1)+'_'+sTemp+'.html') + WACK + sPageName;	// prepend on PageName.
				sPageName = sLinkPlus(sTemp, dUps(iUps-1)+'_'+sTemp+'.html') + WACK + sPageName;	// prepend on PageName.
				sTemp = sPageParent.substring(0, iLocLastWack);		// Get first parent breadcrumbs.
				sReturn = sSitePath(sPageName, sTemp, iUps+1);	// Process the rest of the string.
			} // if bLast.
/**/
			break;
	}


	if (bLast) {	// Is this the last web page in the URL?
		sSPLabel  = sGlossaryWord('Site Path');
		sSPLabel  = sAbbr(sSPLabel, 'List of parent web pages (i.e. site hierarchy for this page).');
		// iUps is -1 when the parent page is unknown.  We don't know how deep we are in the dir structure.
		if (iUps > -1) sSPLabel = sHref(sSPLabel, dUps(iUps) + 'Info/Glossary.html#sitepath');
		sSPLabel += ':'+sNBSP;
		alert('sSitePath(Label):'+sSPLabel);	//d
		sReturn = sSPLabel;

		if (isSomething(sParentPages))	// Only output if there is something to output.
		{
			sReturn += sParentPages;
			sReturn += sWACK;
			alert('sSitePath(ParentPages):'+sParentPages+sWACK);
		}

		sReturn += sPageName;
//d		alert('sSitePath(PageName):'+sPageName);
	
	} // if bLast.

	return sReturn;

} // end sSitePath().



function sRemotePageURL()
{
	sReturn = 'http://www.';
	return sReturn;
}

//-------------------------------
//
//	Used by sFooterLeft().
//
//	Returns a sting with the Site Path above the URL.  If the file is local, '(local)' will be displayed
//	in place of the 'file:///C:...' text up to the site name.  The '(local)' will also be a link to the 
//	same page on the remote site.
//
function sSamePageOnRemote()			// Last revision: 2007.05.10 by Randall Ijams.
{
	(iDEBUGLEVEL > 10) ? (dwbl(sBLN+'sSamePageOnRemote().a: '+'sPageName+SEP+sPageParent+SEP+iUps+SEP')) : '';	// 10

	var sTemp="", sLocalPath, iLocFile, iLocST, iLocMD, sStart, sEnd;
	var sParentPages, sSPLabel, sSP, ups=1, sReturn='';

//c	<abbr title="Uniform Resource Locator (e.g. web page address)">URL</abbr>: file:///D:/Randall/Documents/_StickData/_SalesTime/ri/_ri.html
//c	0123456789112345678921234567893123456789412345678951234567896123456789712345678981234567899123456789012345678911234567892123456789312345678941

	sTemp = sURL();		

	if (bLocalDisk)		//	iLocFile > 0)		// if URL is a local file (below My Documents).
	{
		sUEsMYDOC = unescape(sMYDOC);
		iLocFile = sTemp.indexOf(sUEsMYDOC);

		sStart = sTemp.substr(0, iLocFile);		// Get everything up to file:... 
												// (all the CODE for the text URL:)(e.g. <abbr...).

//x		iLocST = iLocFile;
//c		iLen = sSITENAME.length;
//c		sEnd = sTemp.substr(iLocST+sSITENAME.length);			// Get everything after SalesTime inclusive.
		sEnd = sTemp.substr(iLocFile+sUEsMYDOC.length-1);		// Get everything after My Documents inclusive.
//d		alert(sTemp+SEP+iLocFile+SEP+iLocST+SEP+sStart+SEP+sEnd+SEP);

		iLocST = sEnd.toLowerCase().indexOf(sSITENAME);		// Find salestime.
		if (iLocST > 0)										// If this file is within the local site.
		{
//d			dwbl("sEnd="+sEnd+"; iLocST="+iLocST);
			sEnd = sEnd.substr(iLocST+sSITENAME.length);
			sTemp = sHref("(local)", "http://www.SalesTime.com"+sEnd, "_blank", "Go to the same page on the remote server.");
			sTemp += " ";
			sTemp += sSITENAME;
		}
		else												// If this file is not within the local site.
		{
			sTemp = "(Local) My Documents";
		}

//c		sTemp = sSpan("(local)"+sNBSP, "red");		// Replaced with link to remote server.
//c		sTemp = sHref("(local)", "http://www.SalesTime.com"+sEnd, "_blank", "Go to the same page on the remote server.");
//d		alert(sTemp);
		sReturn += sStart + sTemp + sEnd;
	}
	else	// Remote file.
	{
		sReturn += sTemp;
	}

	return sReturn;

} // end sSamePageOnRemote().


//-------------------------------
//
//	Used by dwFooter().
//
//	Returns a sting with the Site Path above the URL.  If the file is local, '(local)' will be displayed
//	in place of the 'file:///C:...' text up to the site name.  The '(local)' will also be a link to the 
//	same page on the remote site.
//
function sFooterLeft(sPageName, sPageParent, iUps)			// Last revision: 2004.10.05 by Randall Ijams.
{
	(iDEBUGLEVEL > 10) ? (dwbl(sBLN+'sFooterLeft().a: '+sPageName+SEP+sPageParent+SEP+iUps+SEP)) : '';	// 10

	var sTemp="", sLocalPath, iLocFile, iLocST, iLocMD, sStart, sEnd;
	var sParentPages, sSPLabel, sSP, ups=1, sReturn='';

	if (isNothing(iUps))
	{
		alert ('sFooterLeft().B: Missing iUps\/iDirDepth parameter.');
		footerLeft(sPageName, sPageParent);
		return sReturn;									// abort this call - return blank string.
	}

	sReturn += sSitePath(sPageName, sPageParent, iUps);
	sReturn += sBLN;

	sReturn += sSamePageOnRemote();

	return sReturn;

} // end sFooterLeft().


//-------------------------------
//
//	Used by dwFooter().
//
function sFooterRight(iUpFolders)			// Last revision: 2004.10.05 by Randall Ijams.
{
	debug ? alert('footerRight('+iUpFolders+')') : '';
//d	alert('footerRight('+iUpFolders+')');

	var sReturn = '';

	sReturn  = sAbbr('Revised', "Date and time this web page was last changed.");
	sReturn += ':'+sNBSP;
	sReturn += dateFormat(document.lastModified, 'dmdy=&=n=b=s=p=;at=&=n=b=s=p=;aphms=&=n=b=s=p=;ampm.');

	sReturn += sBLN;

	sReturn += sLinkPlus(sCOPYRIGHT, sRelPath('Info/Copyright.html'));
//c	dwbl(sReturn);

//c	dwLink(dUps(iUpFolders) + 'Info/copyright.html', sCOPYRIGHT);

	return sReturn;

} // end sFooterRight().


//-------------------------------
//
//	Used by each web page until replaced by dwFooter().
//
function footerRight(ups)			// Last revision: 2004.10.05 by Randall Ijams.
{
	debug ? alert('footerRight('+ups+')') : '';
//d	alert('footerRight('+ups+')');

	dw(sFooterRight(ups));

} // end footerRight().




/*
//-------------------------------
//
//	footerValid outputs to a web page the W3C valid graphic as a link to validate the current web page.
//		ups = number of directories below the home directory (to locate the images directory),
//		sURLtoCheck = the address of the current web page.
//
//	20080404 Changed from specifying file name via sURLtoCheck variable to use '/referer'.
//
//	Used by dwFooter().
//
/**/

function sValidatedPage(ups)
{
	debug ? alert('sValidatedPage('+ups+')') : '';

	var sImg, sLink, sReturn='';
//c1	var sURLtoCheck=document.URL;	//	document.URL == window.location.

//d	alert('footerValid('+ups+SEP+sURLtoCheck+')');

	sImg = dUps(ups) + 'Images/Logos/valid-xhtml10.jpg';
//d	alert(sImg);
	sImg = "<img src=" + sImg + " alt='Valid XHTML 1.0!' height='31' width='88' border='0' />";

	sLink = 'http://validator.w3.org';
//c1	if (isSomething(sURLtoCheck))
	{
		sLink += '/check/referer';
//c1	sLink += '/check?uri='+sURLtoCheck;
	}

	sReturn += sHref(sBLN+sImg, sLink, '_blank');

	return sReturn;

} // end sValidatedPage().


//-------------------------------
//
//	footerValid outputs to a web page the W3C valid graphic as a link to validate the current web page.
//		ups = number of directories below the home directory (to locate the images directory),
//		sURLtoCheck = the address of the current web page.
//
//	Used by each web page until replaced by dwFooter().
//
function footerValid(ups)
{
	debug ? alert('footerValid('+ups+')') : '';

	dw(sValidatedPage(ups));

} // end footerValid().


//-------------------------------
//
//	Used by each web page until replaced by dwFooter().
//
function bottomBlankLines()
{
	alert("Change bottomBlankLines() to dw(sBottomBlankLines()) in "+document.URL);
	document.write(sBottomBlankLines());

} // end of bottomBlankLines().

//-------------------------------
//
//
//		The extra blank lines at the end of a web page allow 
//	an anchor near the bottom of the web page to be 
//	displayed at the top of the browser when referenced.
//
//	Used by dwFooter().
//
function sBottomBlankLines()
{
	(iDEBUGLEVEL > 10) ? (dwbl('sBottomBlankLines().a: '+SEP)) : '';

	var sReturn = '';

	sReturn += '<p style="margin: 1pt; padding: 1pt;">&nbsp;  </p>';			// First blank line centering may be affected so no character displayed.
	sReturn += '<p style="margin: 1pt; padding: 1pt;">&nbsp;  </p>';			// First blank line centering may be affected so no character displayed.

for (i=0; i<iNUMBOTTOMBLANKLINES-8; i++)
	{
		sReturn += '<p style="text-align: center; margin: 1pt; padding: 1pt;"> '+sBBLChar+' </p>';
	}

	sReturn += "<p style='text-align: center; margin: 1pt; padding: 1pt;'>";
	sReturn += sHardString("The above blank lines allow text to display at the <b>top of your browser</b>");
	sReturn += sBLN;
	sReturn += sHardString(" when branching to the <b>bottom of the web page content</b>");
	sReturn += sBLN;
	sReturn += sHardString(" (An example is the ");
	sReturn += sHref("Footer", "#footer");
	sReturn += sHardString(" link located at the top of the page).");
	sReturn += sBLN;
	sReturn += sBLN;
	sReturn += sHardString("The extra lines also force the appearance");
	sReturn += sBLN;
	sReturn += sHardString(" of the elevator bar on all pages");
	sReturn += sBLN;
	sReturn += sHardString(" which prevents horizontal shifting between pages");
	sReturn += sBLN;
	sReturn += sHardString("  due to its arrival and departure.");
	sReturn += "</p>";

	return (sReturn);

} // end of sBottomBlankLines().

//-------------------------------
//
//
//
//
function dwFooter(sPageName, sParentName, iUpFolders, sOtherLinks, bValidatedPage, bCounter)
{
	(iDEBUGLEVEL > 10) ? (dwbl(sBLN+'dwFooter().a: '+sPageName+SEP+sParentName+SEP+iUpFolders+SEP+sOtherLinks+SEP+bValidatedPage+SEP)) : '';

	dw(sFooter(sPageName, sParentName, iUpFolders, sOtherLinks, bValidatedPage, bCounter));
}	// end of dwFooter().

//-------------------------------
//
//
//
//
function sFooter(sPageName, sParentName, iUpFolders, sOtherLinks, bValidatedPage, bCounter)
{
	(iDEBUGLEVEL > 8) ? (dwbl(sBLN+'sFooter().a: '+sPageName+SEP+sParentName+SEP+iUpFolders+SEP+sOtherLinks+SEP+bValidatedPage+SEP)) : '';	// 8

	var sReturn="", sDivText='';

//	sReturn += sBLN;

	sReturn += sAName("footer");

	sReturn += sHR;

	sDivText = sBottomLinks(iUpFolders, sOtherLinks);

	sReturn += sDiv(sDivText, 'ftrc');			// output bottom links centered.

	sDivText = sFooterLeft(sPageName, sParentName, iUpFolders);
	sReturn += sDiv(sDivText, 'ftrl');			// output left footer.

	sDivText = sFooterRight(iUpFolders);
	sReturn += sDiv(sDivText, 'ftrr');			// output right footer.

	if (bValidatedPage)
	{
		sDivText = sValidatedPage(iUpFolders);
		sReturn += sDiv(sDivText, 'ftrc');			// output validated page image.
	}

	if (bCounter)
	{
		sTemp  = '<center>';
		sTemp += '<img';
		sTemp += ' src="/cgi-sys/counter/hit.pl?user=salestime&amp;id=SalesTime"';
		sTemp += ' alt="SalesTime Counter"';
		sTemp += ' />';
		sTemp += '</center>';
		sReturn += sDiv(sTemp, 'ftrc');
	}

	sReturn += sBottomBlankLines();

	return (sReturn);

} // end dwFooter().


//*****************************************************************
//*****************************************************************
//
//		Message Functions (for every page)
//
//*****************************************************************
//*****************************************************************

//
//
//
function msgprep(msg)		// Last revision: 2004.10.05 by Randall Ijams.
{
	debug ? alert('msgprep('+msg+')') : '';
	var spaces = '';
	var msglength = msg.length;
	for (i=0;i<msglength;i++)		// create a string of spaces the same length as the original msg.
	{
		spaces += ' ';
	}

	msg = spaces + msg;				// pad msg with spaces in the front.
	window.status = msg;			// set status bar to msg.

	startScrollmsg();					// start the scrolling.
}

//
//
//
function pausemsg()		// Last revision: 2004.10.05 by Randall Ijams.
{
	clearInterval(msgName);			// stop the scrolling.
}

//
//
//
function startScrollmsg()		// Last revision: 2004.10.05 by Randall Ijams.
{
	msgName = setInterval("scrollmsg(3)", 300);	// start the scrolling.
}

//
//
//
function scrollmsg(num)		// Last revision: 2004.10.05 by Randall Ijams.
{
	msg = window.status
	msg = msg.substring(num, msg.length) + msg.substring(0,num);  // Scroll left.
	window.status = msg;
}

//*****************************************************************
//*****************************************************************
//
//		Token Functions
//
//*****************************************************************
//*****************************************************************

// Last revision: 2004.12.11 by Randall Ijams (rri@salestime.com).
// validTokensArr = array of valid tokens.
// pToken   = possible token.

function isTokenPart(validTokensArr, pToken)
{
	var tl = pToken.length;						// Get the size (number of characters in the possible token.

	pToken = String(pToken);
	pToken = pToken.toLowerCase();				// Compare strings in lower case.

	for (i=0; i<validTokensArr.length; i++)		// For each token in the array...
	{
		// compare all the characters of the possible token to
		//    the same number of characters of each valid token.
		vToken = validTokensArr[i];				// Get full token.
		vToken = vToken.slice(0, tl);			// Keep only the first same number of characters as pToken.
		vToken = vToken.toLowerCase();			// Compare strings in lower case.
		
		if (pToken == vToken)	
		{
			return true;						// We found a match, no need to look further.
		} // end if.
		
	} // end for i.
	
	return false;								// the pToken did not match the start of any valid token.

} // end isTokenPart().



// Last revision: 2004.12.14 by Randall Ijams (rri@salestime.com).
// validTokensArr = array of valid tokens.
// pToken   = string containing possible token.

function isToken(validTokensArr, pToken)
{
	var debug = true;			// Overwrite global variable.

//d	if (dnum<DMAX) alert('isToken('+validTokensArr+', '+pToken+');');		//c	debug ? (if (dnum<DMAX) alert('isToken('+validTokensArr+', '+pToken+');')) : '';	// doesn't work!
//d	dnum++;

	var ndx, vToken;

	pToken = String(pToken);							// Make sure it is a string.
//d	if (dnum<DMAX) alert('isToken.b: '+pToken+SEP);
	pToken = pToken.toLowerCase();						// Compare in lower case.

//d	if (dnum<DMAX) alert('isToken.c: '+pToken+SEP+validTokensArr.length+SEP);

	for (ndx=0; ndx<validTokensArr.length; ndx++)		// For each token in the array...
	{
		vToken = '' + validTokensArr[ndx];
		vToken = vToken.toLowerCase();

//d		if (dnum<DMAX) alert('isToken.e: Compare: '+pToken+SEP+vToken+SEP);

		if (vToken == pToken)		// Compare string with string.
		{
//d			if (dnum<DMAX) alert('isToken.g: Match.'));
			return true;			// true    //9999999999999999					// We found a match, no need to look further.
		} // end if.
	
	} // end for ndx.

//d	alert('isToken.z: *** No match. ***');
	return false;			// false			//9999999999999999				// the pToken did not match any valid token.
//d	return true;
	
} // end isToken().


/*
<script language="JavaScript"><!--
document.write('<pre>');
document.write('<br />0.5005 (3):'+round(0.5005,3))
document.write('<br />0.50051(3):'+round(0.50051,3))
document.write('<br />0.5009 (3):'+round(0.5009,3))
document.write('<br />0.50091(3):'+round(0.50091,3))
document.write('<br />0.59   (2):'+round(0.59,2))
document.write('<br />0.591  (2):'+round(0.591,2))
document.write('<br />0.59   (1):'+round(0.59,1))
document.write('<br />0.591  (1):'+round(0.591,1))
document.write('<br />2.9    (0):'+round(2.9, 0));
document.write('<br />2      (5):'+round(2, 5));
document.write('<br />2.1245 (3):'+round(2.1245, 3));
//--></script>
*/



//d	alert('main.js: end');
