     ///////////////////////\\\\\\\\\\\\\\\\\\\\\\\
    //         PII Javascript Programming         \\
   //                 Main Module                  \\
  // by Kevin Stanek of Stanek Software Development \\
 //                   18 Oct 2001                    \\
////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\

// determine the computer platform
var platMac = (navigator.appVersion.indexOf("Mac") != -1);
var platWin = (navigator.appVersion.indexOf("Win") != -1);

// determine the browser in use
var browNet = (navigator.appName.indexOf("Netscape") != -1);
var browMic = (navigator.appName.indexOf("Microsoft") != -1);
if (browMic)
{
	var browVer = parseFloat(navigator.appVersion.split(";")[1].split(" ")[2]);
}
else
{
	var browVer = parseFloat(navigator.appVersion);
}

// find our path
var rootDir = top.location.href.toString().toLowerCase();
rootDir = rootDir.substring(0, rootDir.lastIndexOf("/"));
if (top.location.href.toLowerCase().indexOf("/pieces/") != -1)
{
	rootDir = rootDir.substring(0, rootDir.lastIndexOf("/") + 1);
}
else
{
	rootDir = rootDir + "/";
}

// set up constants
var tab = "\t";
var rtn = "\n";
var tempPg = "";
if (browNet)
{
	tempPg = ' src="' + rootDir + 'pieces/empty_wh.htm"';
}

// set up location variables
var prevPg = "",   currPg = "",  nextPg = "";
var currModule = "", currTopic = "", currSub = "", currAnchor = "";
var shortList;

// set up global flags
var rsrcWinCalc    = "aaa";
var rsrcWinCalcBig = "bbb";
var rsrcWinDown    = "ccc";
var rsrcWinHelp    = "ddd";
var rsrcWinNoTBar  = "eee";
var rsrcWinNumChk  = "fff";
var rsrcWinTBar    = "ggg";
var rsrcWinZoom    = "hhh";

var gLinkDesc = "";
var popWin = null;
var helpPg = "";
var topicLevel = 1;
var findTopicLevel = topicLevel;
var findChr;

// support for Back button
var goingBack = false;
var histIndx = -1;
var histList = new Array();

// set up self-test / tutorial variables
var quesNum   = 0;
var quesData  = "";
var gRsrcType = ""

// -----------------------------------------------
// Checker
// -----------------------------------------------
function Checker(chkType)
{
	gRsrcType = chkType;
	CheckerExtract(chkType);
	if (chkType == "nc")
	{
		rowDef = "30,30,*,30,*,30,30";
	}
	else
	{
		rowDef = "30,30,*,30,*,30,20";
	}
	doc = OpenWin(chkType, "").document;
	doc.open();
	doc.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">');
	doc.writeln('<html>');
	doc.writeln('  <head>');
	doc.writeln('    <title>');
	doc.writeln('      Personal Investing');
	doc.writeln('    </title>');
	doc.writeln('  </head>');
	doc.writeln('  <frameset rows="' + rowDef + '" border=0 frameborder=0 framespacing=0 onResize="top.opener.top.code.ResizeRsrcWin(self);">');
	doc.writeln('    <frame src="' + rootDir + 'pieces/ban_' + chkType + '.htm" name="data" marginheight=0 marginwidth=0 topmargin=5 leftmargin=0 bottommargin=0 rightmargin=0 scrolling="no">');
	doc.writeln('    <frame name="quesTitl"' + tempPg + ' marginheight=05 marginwidth=05 topmargin=05 leftmargin=05 bottommargin=05 rightmargin=05 scrolling="no">');
	doc.writeln('    <frame name="ques"' + tempPg + ' marginheight=10 marginwidth=10 topmargin=10 leftmargin=10 bottommargin=10 rightmargin=10>');
	doc.writeln('    <frame name="answTitl"' + tempPg + ' marginheight=05 marginwidth=05 topmargin=05 leftmargin=05 bottommargin=05 rightmargin=05 scrolling="no">');
	doc.writeln('    <frame name="answ"' + tempPg + ' marginheight=10 marginwidth=10 topmargin=10 leftmargin=10 bottommargin=10 rightmargin=10>');
	doc.writeln('    <frameset cols="90,*,90" border=0 frameborder=0 framespacing=0>');
	doc.writeln('      <frame src="' + rootDir + 'pieces/empty_bk.htm" name="qnav1" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 scrolling="no">');
	doc.writeln('      <frame src="' + rootDir + 'pieces/empty_bk.htm" name="qnav2" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 scrolling="no">');
	doc.writeln('      <frame src="' + rootDir + 'pieces/empty_bk.htm" name="qnav3" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 scrolling="no">');
	doc.writeln('    </frameset>');
	doc.writeln('    <frame src="' + rootDir + 'pieces/empty_bk.htm" name="copy" marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 scrolling="no">');
	doc.writeln('  </frameset>');
	doc.writeln('</html>');
	doc.close();
	CheckerShow(1, true);
}

// -----------------------------------------------
// CheckerAnswer
// -----------------------------------------------
function CheckerAnswer()
{
	if (RsrcWin(gRsrcType).answTitl.document.images[0].src.indexOf("prnt_ans") != -1)
	{
		RsrcWin(gRsrcType).answ.print();
	}
	else
	{
		var ID = quesData[quesNum-1].split(tab)[2];
		RsrcWin(gRsrcType).answ.location.replace(rootDir + "module" + ID.substr(0,2) + "/" + gRsrcType + ID + "a.htm");
		if ((platMac && browMic) || (platWin && browMic && browVer < 5))
		{
			RsrcWin(gRsrcType).answTitl.document.images[0].src = rootDir + "pieces/gr/answer.gif";
		}
		else
		{
			RsrcWin(gRsrcType).answTitl.document.images[0].src = rootDir + "pieces/gr/prnt_ans.gif";
		}
	}
}

// -----------------------------------------------
// CheckerExtract
// -----------------------------------------------
function CheckerExtract(chkType)
{
	quesData = new Array();
	for (res = 0; res < shortList.length; res++)
	{
		if (shortList[res].split(tab)[1] == chkType)
		{
			quesData[quesData.length] = shortList[res];
		}
	}
}

// -----------------------------------------------
// CheckerNext
// -----------------------------------------------
function CheckerNext()
{
	CheckerShow(quesNum + 1, false);
}

// -----------------------------------------------
// CheckerPrev
// -----------------------------------------------
function CheckerPrev()
{
	CheckerShow(quesNum - 1, false);
}

// -----------------------------------------------
// CheckerShow
// -----------------------------------------------
function CheckerShow(qNum, forceNext)
{
	oldQuesNum = quesNum;
	quesNum = qNum;
	var ID = quesData[quesNum-1].split(tab)[2];
	RsrcWin(gRsrcType).ques.location.replace(rootDir + "module" + ID.substr(0,2) + "/" + gRsrcType + ID + "q.htm");
	doc = RsrcWin(gRsrcType).quesTitl.document;
	doc.open();
	doc.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
	doc.writeln('<html>');
	doc.writeln('  <head>');
	doc.writeln(     ConStyle());
	doc.writeln('  </head>');
	doc.writeln('  <body>');
	doc.writeln('    <p class="tx" align="center">');
	doc.writeln('      <img alt="" src="' + rootDir + 'pieces/gr/question.gif" border=0>');
	doc.writeln('    </p>');
	doc.writeln('  </body>');
	doc.writeln('</html>');
	doc.close();
	doc = RsrcWin(gRsrcType).answTitl.document;
	doc.open();
	doc.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
	doc.writeln('<html>');
	doc.writeln('  <head>');
	doc.writeln(     ConStyle());
	doc.writeln('  </head>');
	doc.writeln('  <body>');
	doc.writeln('    <p class="tx" align="center">');
	doc.writeln('      <a href="javascript:top.opener.top.code.CheckerAnswer();"><img alt="" src="' + rootDir + 'pieces/gr/show_ans.gif" border=0></a>');
	doc.writeln('    </p>');
	doc.writeln('  </body>');
	doc.writeln('</html>');
	doc.close();
	doc = RsrcWin(gRsrcType).answ.document;
	doc.open();
	doc.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
	doc.writeln('<html>');
	doc.writeln('  <head>');
	doc.writeln(     ConStyle());
	doc.writeln('  </head>');
	doc.writeln('  <body>');
	doc.writeln('    <p class="tx">');
	doc.writeln('      &nbsp;');
	doc.writeln('    </p>');
	doc.writeln('  </body>');
	doc.writeln('</html>');
	doc.close();
	UpdateQuestionNavigation(oldQuesNum, forceNext)
	UpdateQuestionLocation();
	doc = RsrcWin(gRsrcType).copy.document;
	doc.open();
	doc.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
	doc.writeln('<html>');
	doc.writeln('  <head>');
	doc.writeln(     ConStyle());
	doc.writeln('  </head>');
	doc.writeln('  <body class="coInv">');
	doc.writeln('    <table border="0" height="100%" width="100%" cellspacing="0" bgcolor="#000000"><tr><td align="center" valign="bottom">');
	doc.writeln('      <p class="coInv">');
	doc.writeln('        Copyright &copy;2002. South-Western, a division of Thomson Learning. All Rights Reserved.');
	doc.writeln('      </p>');
	doc.writeln('    </td></tr></table>');
	doc.writeln('  </body>');
	doc.writeln('</html>');
	doc.close();
}

// -----------------------------------------------
// ConStyle
// -----------------------------------------------
function ConStyle()
{
	var style = 
	'    <style type = "text/css">' + rtn +
	'      body, p, a {' + rtn +
	'        color:            #000000;' + rtn +
	'        background-color: #FFFFFF;' + rtn +
	'        font-family:      Verdana,Arial,Helvetica;' + rtn +
	'      }' + rtn +
	'      a {' + rtn +
	'        color: #000099;' + rtn +
	'      }' + rtn +
	'      p {' + rtn +
	'        padding: 0pt;' + rtn +
	'        border:  0pt;' + rtn +
	'      }' + rtn +
	'      em.fiEmpty, em.fiCorrect, em.fiIncorrect {' + rtn +
	'        font-style:       normal;' + rtn +
	'        text-decoration:  underline;' + rtn +
	'        white-space:      nowrap;' + rtn +
	'      }' + rtn +
	'      em.fiCorrect {' + rtn +
	'        color:            #006600;' + rtn +
	'      }' + rtn +
	'      em.fiIncorrect {' + rtn +
	'        color:            #CC0000;' + rtn +
	'      }' + rtn +
	'      p.co {' + rtn +
	'        color:            #666666;' + rtn +
	'        text-align:       center;' + rtn +
	'      }' + rtn +
	'      body.coInv, p.coInv {' + rtn +
	'        color:            #999999;' + rtn +
	'        background-color: #000000;' + rtn +
	'        text-align:       center;' + rtn +
	'      }' + rtn;
	if (navigator.appVersion.indexOf("Mac") != -1)
	{
		style = style +
		'      body, p {' + rtn +
		'        font-size:  13pt;' + rtn +
		'      }' + rtn +
		'      em.fiEmpty, em.fiCorrect, em.fiIncorrect {' + rtn +
		'        font-family:     Courier,"Courier New";' + rtn +
		'      }' + rtn +
		'      p.co, p.coInv {font-family: Geneva; font-size: 9pt;}' + rtn;
	}
	else if (navigator.appVersion.indexOf("Win") != -1)
	{
		style = style +
		'      body, p {' + rtn +
		'        font-size:  10pt;' + rtn +
		'      }' + rtn +
		'      em.fiEmpty, em.fiCorrect, em.fiIncorrect {' + rtn +
		'        font-family:     "Courier New",Courier;' + rtn +
		'      }' + rtn;
		if (navigator.appName.indexOf("Netscape") != -1)
		{
			style = style +
			'      p.co, p.coInv		{font-family: Arial; font-size:  8pt;}' + rtn;
		}
		else
		{
			style = style +
			'      p.co, p.coInv		{font-family: Arial; font-size:  7pt;}' + rtn;
		}
	}
	style = style + '    </style>';
	return style;
}

// -----------------------------------------------
// DelayedPop
// -----------------------------------------------
function DelayedPop(win)
{
	if (typeof popWin != "undefined")
	{
		if (!popWin.closed)
		{
			popWin.focus();
		}
	}
}

// -----------------------------------------------
// FindTopicLevel
// -----------------------------------------------
function FindTopicLevel(lvl)
{
	findTopicLevel = lvl;
	if (findChr == "*")
	{
		RsrcWin("PR").main.location.replace(rootDir + "pieces/indx_all.htm");
	}
	else if (findChr != "")
	{
		RsrcWin("PR").main.location.replace(rootDir + "pieces/indx_" + findChr + ".htm");
	}
}

// -----------------------------------------------
// GlossTerm
// -----------------------------------------------
function GlossTerm(term)
{
	RsrcWin("PR").main.location = rootDir + "gl/" + term + ".htm";
}

// -----------------------------------------------
// HistListPull
// -----------------------------------------------
function HistListPull()
{
	if (histIndx > 0)
	{
		histIndx = histIndx - 1;
		Jump(histList[histIndx].split(tab)[0]);
		TopicLevel(histList[histIndx].split(tab)[1]);
	}
}

// -----------------------------------------------
// HistListPush
// -----------------------------------------------
function HistListPush(pg)
{
	histIndx = histIndx + 1;
	histList[histIndx] = pg + tab + topicLevel;
}

// -----------------------------------------------
// InitPage
// -----------------------------------------------
function InitPage()
{
	if (typeof top.cData.pages == "undefined")
	{
		setTimeout("InitPage()",500);
	}
	else
	{
		if (currPg == "")
		{
			pgFilter = currModule;
		}
		else
		{
			pgFilter = currPg.substring(0,6);
		}
		shortList = new Array();
		for (res = 0; res < top.cData.rsrcs.length; res++)
		{
			temp = top.cData.rsrcs[res].split(tab);
			temp2 = temp[0].split(",");
			added = false;
			for (x = 0; (x < temp2.length) && !added; x++)
			{
				if (temp2[x] == pgFilter)
				{
					shortList[shortList.length] = top.cData.rsrcs[res];
					added = true;
				}
			}
		}
	}
}

// -----------------------------------------------
// InitProd
// -----------------------------------------------
function InitProd()
{
	Jump("welcome");
	URLReplace(top.mod_nav, rootDir + "pieces/menuinst.htm");
}

// -----------------------------------------------
// Jump
// -----------------------------------------------
function Jump(textpage, anchor)
{
	if (textpage == "welcome")
	{
		module     = "";
		currTopic  = "";
		currSub    = "";
		currPg     = "";
	}
	else if (textpage < 100)
	{
		module     = textpage + "";
		currTopic  = "";
		currSub    = "";
		currPg     = "";
	}
	else
	{
		module    = textpage.substring(0,2);
		currTopic = textpage.substring(2,4);
		currSub   = textpage.substring(4,6);
		currPg    = textpage;
	}
	if ((typeof anchor == "undefined") || (anchor == ""))
	{
		currAnchor = "";
	}
	else
	{
		currAnchor = "#" + anchor;
	}
	if (module != currModule)
	{
		currModule = module;
		if (currModule != "")
		{
			URLReplace(top.cData, rootDir + "module" + currModule + "/data_" + currModule + ".htm");
			// Jump2() call after data is loaded
		}
		else
		{
			Jump2();
		}
	}
	else
	{
		Jump2();
	}
	if (!goingBack)
	{
		HistListPush(textpage);
	}
	else
	{
		goingBack = false;
	}
}

// -----------------------------------------------
// Jump2
// -----------------------------------------------
function Jump2()
{
	if (currModule == "")
	{
		top.mod_ttl.loaded = false;
		URLReplace(top.main, rootDir + "pieces/welcome.htm");
		URLReplacePeriod(top.mod_nav, rootDir + "pieces/menuinst.htm");
		URLReplacePeriod(top.mod_lvl, rootDir + "pieces/empty_co.htm");
		URLReplacePeriod(top.mod_ttl, rootDir + "pieces/empty_co.htm");
		URLReplace(top.cData, rootDir + "pieces/empty_co.htm");
	}
	else if (currTopic == "")
	{
		URLReplace(top.main, rootDir + "module" + currModule + "/ab" + currModule + ".htm" + currAnchor);
		LoadTitles(0);
		SetAboutHilite(0);
	}
	else
	{
		URLReplace(top.main, rootDir + "module" + currModule + "/tx" + currPg + ".htm" + currAnchor);
		LoadTitles(1);
		SetAboutHilite(1);
	}
	PageChanged();
	WaitSetCheckedModule();
}

// -----------------------------------------------
// JumpFind
// -----------------------------------------------
function JumpFind(textpage, lvl)
{
	Jump(textpage);
	if ((lvl == "a") && (topicLevel == 2))
	{
		TopicLevel(1);
	}
	RsrcWin("FT").close();
}

// -----------------------------------------------
// LoadTitles
// -----------------------------------------------
function LoadTitles(aboutHilite)
{
	var doc;
	if ((typeof top.mod_ttl.loaded != "boolean") || (!top.mod_ttl.loaded))
	{
		if (browNet)
		{
			wd = top.mod_ttl.innerWidth;
			ht1 = Math.floor(top.mod_ttl.innerHeight / 2);
			ht2 = Math.ceil(top.mod_ttl.innerHeight / 2);
		}
		else
		{
			wd = 250;
			ht1 = 25;
			ht2 = 25;
		}

		doc = top.mod_ttl.document;
		doc.open();
		doc.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
		doc.writeln('<html>');
		doc.writeln('  <head>');
		doc.writeln(     NavStyle(""));
		doc.writeln('    <script language="JavaScript" type="text/javascript"><!--');
		doc.writeln('      var aboutGr = new Array();');
		doc.writeln('      var loaded = false;');
		doc.writeln('      aboutGr[0] = new Image(); aboutGr[0].src = "' + rootDir + 'pieces/gr/titl_ab1.gif";');
		doc.writeln('      aboutGr[1] = new Image(); aboutGr[1].src = "' + rootDir + 'pieces/gr/titl_ab2.gif";');
		doc.writeln('      function setHilite(h)');
		doc.writeln('      {');
		doc.writeln('        top.mod_ttl.document.images[0].src = top.mod_ttl.aboutGr[h].src;');
		doc.writeln('        loaded = true;');
		doc.writeln('      }');
		doc.writeln('    // --></script>');
		doc.writeln('  </head>');
		doc.writeln('  <body class="inv" onLoad="javascript:setHilite(' + aboutHilite + ');">');
		doc.writeln('    <table border=0 cellspacing=0 cellpadding=0 height="100%" width="100%">');
		doc.writeln('      <tr>');
		doc.writeln('        <td align="center" valign="bottom">');
		doc.writeln('          <a href="javaScript:top.code.WhatAbout()">');
		doc.writeln('            <img alt="" src="' + rootDir + 'pieces/gr/titl_ab1.gif" width=230 height=24 margin=0 padding=0 border=0><br></a>');
		doc.writeln('        </td>');
		doc.writeln('      </tr>');
		doc.writeln('    </table>');
		doc.writeln('  </body>');
		doc.writeln('</html>');
		doc.close();

		doc = top.mod_lvl.document;
		doc.open();
		doc.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
		doc.writeln('<html>');
		doc.writeln('  <head>');
		doc.writeln(     NavStyle(""));
		doc.writeln('  </head>');
		doc.writeln('  <body class="inv">');
		doc.writeln('    <table border=0 cellspacing=0 cellpadding=0 height="100%" width="100%">');
		doc.writeln('      <tr>');
		doc.writeln('        <td align="center" valign="bottom" colspan="3">');
		doc.writeln('          <img alt="" src="' + rootDir + 'pieces/gr/titl_chp.gif" width=230 height=24 margin=0 padding=0 border=0>');
		doc.writeln('        </td>');
		doc.writeln('      </tr>');
		doc.writeln('      <tr valign="bottom">');
		doc.writeln('        <td nowrap>');
		doc.writeln('          <a href="javascript:top.code.TopicLevel(1);"><img alt="" src="' + rootDir + 'pieces/gr/top_all1.gif" width=80  height=13 border=0></a>');
		doc.writeln('        </td>');
		doc.writeln('        <td>');
		doc.writeln('          <img alt="" src="' + rootDir + 'pieces/gr/top_spc.gif" width=10 height=13 border=0>');
		doc.writeln('        </td>');
		doc.writeln('        <td>');
		doc.writeln('          <a href="javascript:top.code.TopicLevel(2);"><img alt="" src="' + rootDir + 'pieces/gr/top_bas0.gif" width=132 height=13 border=0></a>');
		doc.writeln('        </td>');
		doc.writeln('      </tr>');
		doc.writeln('    </table>');
		doc.writeln('  </body>');
		doc.writeln('</html>');
		doc.close();
	}
}

// -----------------------------------------------
// ModuleSelected
// -----------------------------------------------
function ModuleSelected(module)
{
	if (module > 0)
	{
		if (module < 10)
		{
			module = "0" + module;
		}
		Jump(module + "");
	}
}

// -----------------------------------------------
// NavStyle
// -----------------------------------------------
function NavStyle(bgIn)
{
	var bg = "", fg = "";
	if (bgIn != "")
	{
		bg = bgIn
	}
	else
	{
		bg = "#000000"
	}
	if (bg == "#FFFFFF")
	{
		fg = "#000000";
	}
	else
	{
		fg = "#FFFFFF";
	}
	var style = 
	'    <style type = "text/css">' + rtn +
	'      body {' + rtn +
	'        color:            ' + fg + ';' + rtn +
	'        background-color: ' + bg + ';' + rtn +
	'      }' + rtn +
	'      p {' + rtn +
	'        color:            ' + fg + ';' + rtn +
	'        background-color: ' + bg + ';' + rtn +
	'        margin:           0pt;' + rtn +
	'        margin-top:       2pt;' + rtn +
	'        padding:          0pt;' + rtn +
	'        border:           0pt;' + rtn +
	'      }' + rtn +
	'      a {' + rtn +
	'        color:            ' + fg + ';' + rtn +
	'        background-color: ' + bg + ';' + rtn +
	'        word-spacing:     normal;' + rtn +
	'        letter-spacing:   normal;' + rtn +
	'        text-decoration:  none;' + rtn +
	'        vertical-align:   baseline;' + rtn +
	'        text-align:       left;' + rtn +
	'        line-height:      normal;' + rtn +
	'        font-style:       normal;' + rtn +
	'        font-weight:      normal;' + rtn +
	'      }' + rtn;
	style = style + 
	'      p.cat {' + rtn +
	'        margin-top:       7pt;' + rtn +
	'        text-decoration:  underline;' + rtn +
	'        font-weight:      bold;' + rtn +
	'      }' + rtn;
	if (platMac)
	{
		style = style + 
		'      p, a {' + rtn +
		'        font-family:      Geneva;' + rtn +
		'        font-size:        10pt;' + rtn +
		'      }' + rtn;
	}
	else if (platWin)
	{
		style = style + 
		'      p, a {' + rtn +
		'        font-family:      "MS Sans Serif";' + rtn +
		'        font-size:         8pt;' + rtn +
		'      }' + rtn;
	}
	style = style + '    </style>';
	return style;
}

// -----------------------------------------------
// NumberCheck
// -----------------------------------------------
function NumberCheck()
{
	Checker("nc");
}

// -----------------------------------------------
// OpenPII
// -----------------------------------------------
function OpenPII()
{
	var opts = "toolbar=no,menubar=yes,"
	if (browNet)
	{
		opts = opts + "resizable=no,"
		if (platMac)
		{
			opts = opts + "screenX=0,screenY=0,innerHeight=470,innerWidth=788";
		}
		else
		{
			opts = opts + "screenX=0,screenY=0,innerHeight=470,innerWidth=788";
		}
	}
	else
	{
		opts = opts + "resizable=yes,"
		if (platMac)
		{
			if (navigator.appVersion.indexOf("MSIE 4.0") != -1)
			{
				opts = opts + "width=772,height=457";
			}
			else if (navigator.appVersion.indexOf("MSIE 4.5") != -1)
			{
				opts = opts + "width=772,height=456";
			}
			else
			{
				opts = opts + "width=772,height=454";
			}
		}
		else
		{
			opts = opts + "left=0,top=0,height=451,width=789";
		}
	}
	var PowerWin = window.open("pieces/main.htm", "PII", opts, false);
	if (!browMic || !(browVer < 5.0))
	{
		PowerWin.moveTo(0,0);
		PowerWin.focus();
	}
}

// -----------------------------------------------
// OpenWin
// -----------------------------------------------
function OpenWin(rsrcType, url)
{
	winHt   = 400;
	winTop  =   0;
	if (platMac)
	{
		halfWidth = 372;
	}
	else
	{
		halfWidth = 388;
	}
	if (rsrcType == "ca")
	{
		winLeft = 400;
		winWd   = halfWidth;
	}
	else if (rsrcType == "CA")
	{
		winLeft = 10;
		winWd   = 750;
	}
	else if (rsrcType == "nc")
	{
		winLeft =   0;
		winWd   = halfWidth;
	}
	else if (rsrcType == "LogOn")
	{
		winLeft =  65;
		winWd   = 640;
	}
	else 
	{
		winLeft =  35;
		winWd   = 700;
	}

	// form features with which to open the window
	var openFeatures = "";
	if (browNet)
	{
		openFeatures = openFeatures + "innerHeight=" + winHt;
		openFeatures = openFeatures + ",innerWidth=" + winWd;
		openFeatures = openFeatures + ",screenX=" + winLeft;
		openFeatures = openFeatures + ",screenY=" + winTop;
	}
	else
	{
		openFeatures = openFeatures + "height=" + winHt;
		openFeatures = openFeatures + ",width=" + winWd;
		openFeatures = openFeatures + ",left=" + winLeft;
		openFeatures = openFeatures + ",top=" + winTop;
	}
	openFeatures = openFeatures + ",scrollbars=yes,resizable=yes,menubar=no";

	// open the window
	if (rsrcType == "Help")
	{
		rsrcWinHelp = window.open(url, "PIIRsrcHelp", openFeatures + ",toolbar=yes", "");
		win = rsrcWinHelp;
	}
	else if (rsrcType == "Download")
	{
		rsrcWinDown = window.open(url, "PIIDownload", openFeatures + ",toolbar=yes", "");
		win = rsrcWinDown;
	}
	else if (rsrcType == "LogOn")
	{
		rsrcWinDown = window.open(url, "PIILogOn", openFeatures + ",toolbar=yes,status=yes", "");
		win = rsrcWinDown;
	}
	else if (rsrcType == "ca")
	{
		rsrcWinCalc = window.open(url, "PIIRsrcCalc", openFeatures + ",toolbar=no", "");
		win = rsrcWinCalc;
	}
	else if (rsrcType == "CA")
	{
		rsrcWinCalcBig = window.open(url, "PIIRsrcCalcBig", openFeatures + ",toolbar=no", "");
		win = rsrcWinCalcBig;
	}
	else if (rsrcType == "nc")
	{
		rsrcWinNumChk = window.open(url, "PIIRsrcNumChk", openFeatures + ",toolbar=no", "");
		win = rsrcWinNumChk;
	}
	else
	{
		if (rsrcType == "gr")
		{
			openFeatures = openFeatures + ",status=no";
			rsrcWinZoom = window.open(url, "PIIRsrcZoom", openFeatures + ",toolbar=no", "");
			win = rsrcWinZoom;
		}
		else
		{
			openFeatures = openFeatures + ",status=yes";
			if (ShowToolbar(rsrcType))
			{
				rsrcWinTBar = window.open(url, "PIIRsrcTBar", openFeatures + ",toolbar=yes", "");
				win = rsrcWinTBar;
			}
			else
			{
				rsrcWinNoTBar = window.open(url, "PIIRsrcNoTBar", openFeatures + ",toolbar=no", "");
				win = rsrcWinNoTBar;
			}
		}
	}

	// bring the window to the top
	win.focus();
	
	// in 1/2 second, raise the window under Windows
	if (platWin)
	{
		popWin = win;
		setTimeout("DelayedPop()",1500);
	}
	return win;
}

// -----------------------------------------------
// PageBack
// -----------------------------------------------
function PageBack()
{
	goingBack = true;
	HistListPull();
}

// -----------------------------------------------
// PageChanged
// -----------------------------------------------
function PageChanged()
{
	if ((currModule != "") && ((typeof top.cData.loaded != "boolean") || (!top.cData.loaded)))
	{
		setTimeout("PageChanged()",100);
	}
	else
	{
		UpdateModuleOutline();
		UpdatePageNav();
	}
}

// -----------------------------------------------
// PageNext
// -----------------------------------------------
function PageNext()
{
	if (nextPg != "")
	{
		Jump(nextPg);
	}
}

// -----------------------------------------------
// PagePrev
// -----------------------------------------------
function PagePrev()
{
	if (prevPg != "")
	{
		Jump(prevPg);
	}
}

// -----------------------------------------------
// PIICalculators
// -----------------------------------------------
function PIICalculators()
{
	OpenWin("ca", rootDir + "pieces/frm_calc.htm");
}

// -----------------------------------------------
// PIIDownload
// -----------------------------------------------
function PIIDownload(URL)
{
	OpenWin("Download", URL);
}

// -----------------------------------------------
// PIIFindTopic
// -----------------------------------------------
function PIIFindTopic()
{
	OpenWin("FindTopic", rootDir + "pieces/frm_find.htm");
}

// -----------------------------------------------
// PIIGlossary
// -----------------------------------------------
function PIIGlossary()
{
	OpenWin("Glossary", rootDir + "pieces/frm_glos.htm");
}

// -----------------------------------------------
// PIIHelp
// -----------------------------------------------
function PIIHelp(pg)
{
	helpPg = rootDir + "pieces/" + pg + ".htm";
	OpenWin("Help", rootDir + "pieces/frm_help.htm");
}

// -----------------------------------------------
// PIILink
// -----------------------------------------------
function PIILink(linkDesc)
{
	gLinkDesc = "";
	if (linkDesc.length > 2)
	{
		gLinkDesc = linkDesc;
	}
	if (linkDesc.substr(0,2).toLowerCase() == "ca")
	{
		// open the resource window and load up the calculator
		OpenWin(linkDesc.substr(0,2), rootDir + "pieces/load_ca.htm#" + linkDesc.substr(2));
	}
	else if (linkDesc.substr(0,2) == "gl")
	{
		// open the resource window and load up the glossary term
		OpenWin(linkDesc.substr(0,2), rootDir + "pieces/load_gl.htm#" + linkDesc.substr(2));
	}
	else
	{
		// open the resource window and load up the menu
		OpenWin(linkDesc.substr(0,2), rootDir + "pieces/load_" + linkDesc.substr(0,2) + ".htm");
	}
}

// -----------------------------------------------
// PIIPortfolio
// -----------------------------------------------
function PIIPortfolio()
{
	OpenWin("Portfolio", rootDir + "pieces/frm_por1.htm");
}

// -----------------------------------------------
// PIIPortfolioLogOn
// -----------------------------------------------
function PIIPortfolioLogOn()
{
	OpenWin("LogOn", rootDir + "pieces/frm_por3.htm");
}

// -----------------------------------------------
// ProdRsrc_MenuFillIndx
// -----------------------------------------------
function ProdRsrc_MenuFillIndx(chr)
{
	var x = 0;
	var beg = -1;
	var end = -1;
	if (chr != "")
	{
		findChr = chr;
	}
	else
	{
		chr = findChr;
	}
	if (chr == "*")
	{
		beg = 0;
		end = RsrcWin("PR").data.rsrcs.length - 1;
	}
	else
	{
		while ((x < RsrcWin("PR").data.rsrcs.length)
			&& (RsrcWin("PR").data.rsrcs[x].substr(0,1).toLowerCase() < chr))
		{
			x++;
		}
		while ((x < RsrcWin("PR").data.rsrcs.length)
			&& (RsrcWin("PR").data.rsrcs[x].substr(0,1).toLowerCase() == chr))
		{
			if (beg == -1)
			{
				beg = x;
			}
			end = x;
			x++;
		}
	}
	doc = RsrcWin("PR").main.document;
	findFlag = (RsrcWin("PR").data.rsrcs[0].split(tab)[1].substr(0,2) == "tx");
	if (findFlag && (beg != -1) && (findTopicLevel == 2))
	{
		var basicOK = false;
		for (x = beg; (x <= end) && !basicOK; x++)
		{
			basicOK = (RsrcWin("PR").data.rsrcs[x].split(tab)[2] == "b")
		}
		if (!basicOK)
		{
			beg = -1;
		}
	}
	if (beg == -1)
	{
		doc.writeln('      <p>(no matches for "' + chr.toUpperCase() + '")</p>');
	}
	else
	{
		for (x = beg; x <= end; x++)
		{
			hrf = "";
			tmp = RsrcWin("PR").data.rsrcs[x].split(tab)[1];
			if (findFlag)
			{
				if ((findTopicLevel == 1) || RsrcWin("PR").data.rsrcs[x].split(tab)[2] == "b")
				{
					hrf = "javascript:top.opener.top.code.JumpFind('" + tmp.substr(2) + "', '"
						+ RsrcWin("PR").data.rsrcs[x].split(tab)[2] + "');";
				}
			}
			else if (tmp.substr(0,2) == "gl")
			{
				hrf = rootDir + "gl/" + tmp.substr(2) + ".htm";
			}
			else
			{
				hrf = rootDir + "module" + tmp.substr(2,2) + "/" + tmp + ".htm";
			}
			if (hrf != "")
			{
				doc.writeln('      <p><a href="' + hrf + '">' + RsrcWin("PR").data.rsrcs[x].split(tab)[0] + '</a> </p>');
			}
		}
	}
}

// -----------------------------------------------
// RealityCheck
// -----------------------------------------------
function RealityCheck()
{
	Checker("rc");
}

// -----------------------------------------------
// ResizeRsrcWin
// -----------------------------------------------
function ResizeRsrcWin(win)
{
	if (platMac && browNet)
	{
		for (f = 0; f < win.frames.length; f++)
		{
			win.frames[f].location.reload();
		}
	}
}

// -----------------------------------------------
// ResizeWin
// -----------------------------------------------
function ResizeWin()
{
	if (platMac && browNet)
	{
		var temp = top.main.location.href.toString();
		currPg = temp.substring(temp.length - 10, temp.length - 4);
		top.main.location.reload();
		UpdateModuleOutline();
		UpdatePageNav();
	}
}

// -----------------------------------------------
// RsrcWin
// -----------------------------------------------
function RsrcWin(rsrcType)
{
	if (rsrcType == "Help")
	{
		return rsrcWinHelp;
	}
	else if (rsrcType == "ca")
	{
		return rsrcWinCalc;
	}
	else if (rsrcType == "CA")
	{
		return rsrcWinCalcBig;
	}
	else if (rsrcType == "nc")
	{
		return rsrcWinNumChk;
	}
	else 
	{
		if (ShowToolbar(rsrcType))
		{
			return rsrcWinTBar;
		}
		else
		{
			return rsrcWinNoTBar;
		}
	}
}

// -----------------------------------------------
// SetAboutHilite
// -----------------------------------------------
function SetAboutHilite(aboutHilite)
{
	var doc;
	if ((typeof top.mod_ttl.loaded != "boolean") || (!top.mod_ttl.loaded))
	{
		setTimeout("SetAboutHilite(" + aboutHilite + ")", 500);
	}
	else
	{
		top.mod_ttl.setHilite(aboutHilite);
	}
}

// -----------------------------------------------
// SetFindTopicLevel
// -----------------------------------------------
function SetFindTopicLevel(win)
{
	findTopicLevel = topicLevel;
	if (findTopicLevel == 1)
	{
		win.document.forms[0].radioGroup[0].checked = true;
	}
	else
	{
		win.document.forms[0].radioGroup[1].checked = true;
	}
}

// -----------------------------------------------
// ShowToolbar
// -----------------------------------------------
function ShowToolbar(rsrcType)
{
	return ("gr,nc,rc,wc".indexOf(rsrcType) == -1);
}

// -----------------------------------------------
// TopicLevel
// -----------------------------------------------
function TopicLevel(lvl)
{
	if (lvl == 1)
	{
		if (topicLevel == 2)
		{
			top.mod_lvl.document.images[1].src = rootDir + "pieces/gr/top_all1.gif";
			top.mod_lvl.document.images[3].src = rootDir + "pieces/gr/top_bas0.gif";
			topicLevel = 1;
			UpdateModuleOutline();
			if (currPg != "")
			{
				UpdatePageNav();
			}
		}
	}
	else
	{
		if (topicLevel == 1)
		{
			top.mod_lvl.document.images[1].src = rootDir + "pieces/gr/top_all0.gif";
			top.mod_lvl.document.images[3].src = rootDir + "pieces/gr/top_bas1.gif";
			topicLevel = 2;
			if (currPg != "")
			{
				var pg = 0;
				while (top.cData.pages[pg].split(tab)[0] != currPg)
				{
					pg++;
				}
				if (top.cData.pages[pg].split(tab)[2] == "a")
				{
					while ((pg > -1) && 
						   ((top.cData.pages[pg].split(tab)[0] == "") ||
							(top.cData.pages[pg].split(tab)[0].substr(4,2) != "00") ||
							(top.cData.pages[pg].split(tab)[2] == "a")))
					{
						pg--;
					}
					if (pg > -1)
					{
						Jump(top.cData.pages[pg].split(tab)[0]);
					}
					else
					{
						Jump(currModule);
					}
				}
				else
				{
					UpdateModuleOutline();
					UpdatePageNav();
				}
			}
			else
			{
				UpdateModuleOutline();
			}
		}
	}
}

// -----------------------------------------------
// UpdateModuleOutline
// -----------------------------------------------
function UpdateModuleOutline()
{
	if (currModule != "")
	{
		if (browNet)
		{
			var scrollX  = top.mod_nav.pageXOffset;
			var scrollY  = top.mod_nav.pageYOffset;
			var whereHilite = -1;
			var whereNext   = -1;
			for (im = 0; (im < top.mod_nav.document.images.length) && (whereHilite == -1); im++)
			{
				if (top.mod_nav.document.images[im].name == currPg)
				{
					whereHilite = top.mod_nav.document.images[im].y;
					if (im + 1 < top.mod_nav.document.images.length)
					{
						whereNext = top.mod_nav.document.images[im + 1].y;
					}
					else
					{
						whereNext = top.mod_nav.document.height;
						if (platWin)
						{
							whereNext += 4;
						}
					}
				}
			}
			if (whereHilite != -1)
			{
				if (whereNext > scrollY + top.mod_nav.innerHeight)
				{
					scrollY = whereNext - top.mod_nav.innerHeight;
					if (platWin)
					{
						scrollY -= 4;
					}
				}
				else if ((whereHilite < scrollY) && (whereHilite != -1))
				{
					scrollY = whereHilite;
				}
				if (scrollY < 0)
				{
					scrollY = 0;
				}
			}
		}
		var moduleOutline = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' + rtn
						  + '<html>' + rtn
						  + '  <head>' + rtn
						  + NavStyle("#FFFFFF") + rtn
						  + '  </head>' + rtn
						  + '  <body'
		if (browMic)
		{
			moduleOutline = moduleOutline + ' onload="top.code.UpdateModuleOutlineScroll();"'
		}
		moduleOutline = moduleOutline + '>' + rtn;
		if (top.cData.pages[0].split(tab)[0] == "")
		{
			moduleOutline = moduleOutline + '    <p><b>' + top.cData.pages[0].split(tab)[1] + '</b></p>' + rtn;
			pg = 1;
		}
		else
		{
			pg = 0;
		}
		moduleOutline = moduleOutline + '    <table border=0 cellspacing=0 cellpadding=0>' + rtn;

		for (; pg < top.cData.pages.length; pg++)
		{
			topicNum = top.cData.pages[pg].split(tab)[0];
			if (topicNum == "")
			{
				moduleOutline = moduleOutline + '</table><p><b>' 
											  + top.cData.pages[pg].split(tab)[1] 
											  + '</b></p><table border=0 cellspacing=0 cellpadding=0>' + rtn;
			}
			else
			{
				if ((topicLevel == 1) || top.cData.pages[pg].split(tab)[2] == "b")
				{
					moduleOutline = moduleOutline + '      <tr valign="top">';
					if (topicNum.substr(4,2) == '00')
					{
						moduleOutline = moduleOutline + '<td width=8>';
					}
					else
					{
						moduleOutline = moduleOutline + '<td width=8></td><td width=8>';
					}
					if (currPg == topicNum)
					{
						moduleOutline = moduleOutline + '<img alt="" name="' + topicNum + '" src="' + rootDir 
									+ 'pieces/gr/bull_ch2.gif" width=10 height=11 border=0></td>';
					}
					else
					{
						moduleOutline = moduleOutline + '<img alt="" name="' + topicNum + '" src="' + rootDir 
									+ 'pieces/gr/bull_ch1.gif" width=10 height=11 border=0></td>';
					}
					if (topicNum.substr(4,2) == '00')
					{
						moduleOutline = moduleOutline + '<td colspan="2"><p>';
					}
					else
					{
						moduleOutline = moduleOutline + '<td><p>';
					}
					moduleOutline = moduleOutline + '<a href="javascript:top.code.Jump(\'' + topicNum + '\')">';
					if (currPg == topicNum)
					{
						moduleOutline = moduleOutline + '<font color="#CC3333">';
					}
					moduleOutline = moduleOutline + top.cData.pages[pg].split(tab)[1];
					if (currPg == topicNum)
					{
						moduleOutline = moduleOutline + '</font>';
					}
					moduleOutline = moduleOutline + '</a> </p></td></tr>' + rtn;
				}
			}
		}
		moduleOutline = moduleOutline
					  + '    </table>' + rtn
					  + '  </body>' + rtn
					  + '</html>';

		top.mod_nav.document.open();
		top.mod_nav.document.writeln(moduleOutline);
		if (browNet)
		{
			if (whereHilite != -1)
			{
				top.mod_nav.scrollTo(scrollX, scrollY);
			}
		}
		top.mod_nav.document.close();
	}
}

// -----------------------------------------------
// UpdateModuleOutlineScroll
// -----------------------------------------------
function UpdateModuleOutlineScroll()
{
	if (browNet)
	{
		var whereHilite = -1;
		var whereNext   = -1;
		for (im = 0; (im < top.mod_nav.document.images.length) && (whereHilite == -1); im++)
		{
			if (top.mod_nav.document.images[im].name == currPg)
			{
				whereHilite = top.mod_nav.document.images[im].y;
				if (im + 1 < top.mod_nav.document.images.length)
				{
					whereNext = top.mod_nav.document.images[im + 1].y;
				}
				else
				{
					whereNext = top.mod_nav.document.height;
					if (platWin)
					{
						whereNext += 4;
					}
				}
			}
		}
		if (whereNext > top.mod_nav.innerHeight)
		{
			scrollY = whereNext - top.mod_nav.innerHeight;
			if (platWin)
			{
				scrollY -= 4;
			}
		}
		else
		{
			scrollY = 0;
		}
		top.mod_nav.scrollTo(0,scrollY);
	}
	else
	{
		for (lnk = 0; lnk < top.mod_nav.document.links.length; lnk++)
		{
			if (top.mod_nav.document.links[lnk].href.indexOf("Jump('" + currPg + "')") != -1)
			{
				top.mod_nav.document.links[lnk].scrollIntoView();
			}
		}
	}
}

// -----------------------------------------------
// UpdatePageNav
// -----------------------------------------------
function UpdatePageNav()
{
	prevPg = "";
	nextPg = "";
	if (currModule != "")
	{
		var pg = 0;
		if (currPg != "")
		{
			while (top.cData.pages[pg].split(tab)[0] != currPg)
			{
				pg++;
			}
			if (pg > 0)
			{
				prevPg = pg - 1;
				while ((prevPg > -1) && ((top.cData.pages[prevPg].split(tab)[0] == "")
					|| ((topicLevel == 2) && (top.cData.pages[prevPg].split(tab)[2] == "a"))))
				{
					prevPg--;
				}
				if (prevPg > -1)
				{
					prevPg = top.cData.pages[prevPg].split(tab)[0];
				}
				else
				{
					prevPg = ""
				}
			}
			if (pg < top.cData.pages.length - 1)
			{
				nextPg = pg + 1;
				while ((nextPg < top.cData.pages.length) && ((top.cData.pages[nextPg].split(tab)[0] == "")
					|| ((topicLevel == 2) && (top.cData.pages[nextPg].split(tab)[2] == "a"))))
				{
					nextPg++;
				}
				if (nextPg < top.cData.pages.length)
				{
					nextPg = top.cData.pages[nextPg].split(tab)[0];
				}
				else
				{
					nextPg = ""
				}
			}
		}
	}
	if ((nextPg == "") && (prevPg == ""))
	{
		if ((histIndx == -1) || ((histIndx == 0) && goingBack))
		{
			URLReplace(top.page_nav, rootDir + "pieces/dis_link.htm");
		}
		else
		{
			URLReplace(top.page_nav, rootDir + "pieces/nav_tx0.htm");
		}
	}
	else if (nextPg == "")
	{
		URLReplace(top.page_nav, rootDir + "pieces/nav_tx1.htm");
	}
	else if (prevPg == "")
	{
		URLReplace(top.page_nav, rootDir + "pieces/nav_tx2.htm");
	}
	else
	{
		URLReplace(top.page_nav, rootDir + "pieces/nav_tx3.htm");
	}
}

// -----------------------------------------------
// UpdateQuestionLocation
// -----------------------------------------------
function UpdateQuestionLocation()
{
	switch (gRsrcType)
	{
		case "nc":
			object = "Number Check";
			break;
		case "rc":
			object = "Reality Check";
			break;
		case "wc":
			object = "Web Check";
			break;
	}
	if (platMac)
	{
		fontSize = 13;
	}
	else
	{
		fontSize = 10;
	}
	doc = RsrcWin(gRsrcType).qnav2.document;
	doc.open();
	doc.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
	doc.writeln('<html>');
	doc.writeln('  <head>');
	doc.writeln('    <style type = "text/css">');
	doc.writeln('      body, p {');
	doc.writeln('        color:            #FFFFFF;');
	doc.writeln('        background-color: #000000;');
	doc.writeln('        font-family:      Verdana,Arial,Helvetica;');
	doc.writeln('        font-size:        ' + fontSize + 'pt;');
	doc.writeln('        font-weight:      bold;');
	doc.writeln('      }');
	doc.writeln('    </style>');
	doc.writeln('  </head>');
	doc.writeln('  <body>');
	doc.writeln('    <table border="0" height="100%" width="100%" cellspacing="0"><tr><td align="center" valign="middle">');
	doc.writeln('      <p>' + object + ' ' + quesNum + ' of ' + quesData.length + '</p>');
	doc.writeln('    </td></tr></table>');
	doc.writeln('  </body>');
	doc.writeln('</html>');
	doc.close();
}

// -----------------------------------------------
// UpdateQuestionNavigation
// -----------------------------------------------
function UpdateQuestionNavigation(oldQuesNum, forceNext)
{
	qNav1 = RsrcWin(gRsrcType).qnav1;
	qNav3 = RsrcWin(gRsrcType).qnav3;
	switch (gRsrcType)
	{
		case "nc":
		case "rc":
		case "wc":
			prefix = "Checker";
			break;
	}
	if (quesData.length != 1)
	{
		var prevHTML = "";
		var nextHTML = "";
		if (quesNum == 1)
		{
			prevHTML = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' + rtn
					 + '<html>' + rtn
					 + '  <body bgcolor="#000000">' + rtn
					 + '    &nbsp;' + rtn
					 + '  </body>' + rtn
					 + '</html>';

		}
		else if ((quesNum == 2) && (oldQuesNum == 1))
		{
			prevHTML = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' + rtn
					 + '<html>' + rtn
					 + '  <body bgcolor="#000000">' + rtn
					 + '    <table border="0" height="100%" width="100%" cellspacing="0"><tr><td align="left" valign="middle">' + rtn
					 + '      <a href="javascript:top.opener.top.code.' + prefix + 'Prev()">' + rtn
					 + '        <img alt="" src="' + rootDir + 'pieces/gr/prev.gif" width=83 height=24 border=0></a>' + rtn
					 + '    </td></tr></table>' + rtn
					 + '  </body>' + rtn
					 + '</html>';

		}
		if (prevHTML != "")
		{
			qNav1.document.open();
			qNav1.document.writeln(prevHTML);
			qNav1.document.close();
		}
		if (quesNum == quesData.length)
		{
			nextHTML = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' + rtn
					 + '<html>' + rtn
					 + '  <body bgcolor="#000000">' + rtn
					 + '    &nbsp;' + rtn
					 + '  </body>' + rtn
					 + '</html>';
		}
		else if ((forceNext) || ((quesNum == quesData.length - 1) && (oldQuesNum == quesData.length)))
		{
			nextHTML = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' + rtn
					 + '<html>' + rtn
					 + '  <body bgcolor="#000000">' + rtn
					 + '    <table border="0" height="100%" width="100%" cellspacing="0"><tr><td align="right" valign="middle">' + rtn
					 + '      <a href="javascript:top.opener.top.code.' + prefix + 'Next()">' + rtn
					 + '        <img alt="" src="' + rootDir + 'pieces/gr/next.gif" width=54 height=24 border=0></a>' + rtn
					 + '    </td></tr></table>' + rtn
					 + '  </body>' + rtn
					 + '</html>';
		}
		if (nextHTML != "")
		{
			qNav3.document.open();
			qNav3.document.writeln(nextHTML);
			qNav3.document.close();
		}
	}
}

// -----------------------------------------------
// URLReplace
// -----------------------------------------------
function URLReplace(frame, newhref)
{
	if (newhref != frame.location.href)
	{
		URLReplacePeriod(frame, newhref);
	}
}

// -----------------------------------------------
// URLReplacePeriod
// -----------------------------------------------
function URLReplacePeriod(frame, newhref)
{
	if (frame == top.cData)
	{
		frame.loaded = false;
	}
	frame.location.replace(newhref);
}

// -----------------------------------------------
// WaitSetCheckedModule
// -----------------------------------------------
function WaitSetCheckedModule()
{
	if ((typeof top.banner.loaded != "boolean") || (!top.banner.loaded))
	{
		setTimeout("WaitSetCheckedModule()",100);
	}
	else
	{
		top.banner.SetCheckedModule(currModule);
	}
}

// -----------------------------------------------
// WebCheck
// -----------------------------------------------
function WebCheck()
{
	Checker("wc");
}

// -----------------------------------------------
// WhatAbout
// -----------------------------------------------
function WhatAbout()
{
	Jump(currModule);
}

// -----------------------------------------------
// ZoomGraphic
// -----------------------------------------------
function ZoomGraphic(grTag)
{
	var win = OpenWin("gr", rootDir + "module" + grTag.substr(2,2) + "/lg" + grTag + ".gif");
	var doc = win.document;
	doc.open();
	doc.writeln('<html>');
	doc.writeln('<head>');
	doc.writeln('</head>');
	doc.writeln('<body bgcolor=white>');
	doc.writeln('<img src="' + rootDir + 'module' + grTag.substr(2,2) + '/lg' + grTag + '.gif" alt="" border=0>');
	doc.writeln('</body>');
	doc.writeln('</html>');
	doc.close();
}


// -----------------------------------------------
// KJS - Debug output
// -----------------------------------------------
function KJS(msg)
{
	alert(msg);
}
