function renderLeftNav(directory,page,optionalRoot)
{
	document.write('<td valign="top">'
		+ '<table border="0" cellpadding="0" cellspacing="0" width="186" height="1">'
		+ '<tr>'
		+ '<td width="100%">'
		+ '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="1">'
		+ '<tr>'
		+ '<td width="1"><img width="15" height="25" src="' + root + 'images/spacer.gif"/>'
		+ '<td width="100%"><span class="directoryTitle">' + directory + '</span></td>'
		+ '</tr>'
		+ '</table>'
		+ '</td>'
		+ '<tr>'
		+ '<td width="100%" bgcolor="#E8E5E0" valign="top">'
		+ '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="1" style="border-top:#A97945 1px solid;border-right:#A97945 1px solid;">'
		+ getNavItems(directory,page,optionalRoot)
		+ '</table>'
		+ '</td>'
		+ '</tr>'
		+ '<tr>'
		+ '<td width="100%"><img width="186" height="205" src="' + root + 'images/sub_nav/IDSR.jpg"/></td>'
		+ '</tr>'
		+ '</table>'
		+ '</td>');
}

function getNavItems(directory,page,optionalRoot)
{
	var navstr = "";
	var useThisArray = null;
	
	if (!optionalRoot) optionalRoot = "";
	
	if (directory == "Valuations" && page == "Valuations")
	{
		useThisArray = valuationAr;
	}
	else if (directory == "Tax Information" && page == "Tax Information")
	{
		useThisArray = taxInfoAr;
	}
	else if (directory == "News & Articles" && page == "Current News")
	{
		useThisArray = navar2;
	}
	else if (page == "Archives")
	{
		useThisArray = navar3;
	}
	else if (directory == "Education Centre")
	{
		useThisArray = navar4;
	}
	else if (directory == "About Quadravest")
	{
		useThisArray = navar5;
	}
	else
	{
		useThisArray = navar;
	}
	for (var x = 0; x < useThisArray.length; x++)
	{
		if (page == useThisArray[x])
		{
			navstr += '<tr>';
			navstr += '<td width="1"><img width="15" height="25" src="' + root + 'images/spacer.gif"/></td>';
			navstr += '<td width="100%">';
			navstr += '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="1">';
			navstr += '<tr>';
			navstr += '<td width="1"><img width="6" height="6" src="' + root + 'images/sub_nav/arrow.gif"/></td>';
			navstr += '<td width="1"><img width="5" height="1" src="' + root + 'images/spacer.gif"/></td>';
			if (useThisArray[x].toString().toLowerCase() == "trading")
			{
				switch (directory) {
					case "Income Financial":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[0] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Income Financial Plus":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[1] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "American Income":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[2] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Ameristar RSP":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[3] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "FSI Streams":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[4] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "CGI Streams":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[5] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Streams III":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[6] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Financial 15":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[7] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Financial 15 Split II":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[8] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "US Financial 15 Split":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[9] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Dividend 15":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[10] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Dividend 15 Split II":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[11] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Split Yield":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[12] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Canadian Life Split":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[13] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Prime Rate Plus Corp":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[14] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Prime Dividend":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[15] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Commerce Split":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[16] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "M-Split":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[17] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "TDbSplit":
						navstr += '<td width="100%"><a class="blackbold" href="' + navTradingar[18] + '">' + useThisArray[x] + '</a></td>';
						break;
					default:
						break;
				}				
			}
			else
			{
				if (page.toString().toLowerCase() == "trading")
				{
					if (directory.toString().toLowerCase() == "streams iii")
					{
						if (useThisArray[x].toString().toLowerCase() == "valuations")
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "tax information")
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/streams III/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
					}
					else if (directory.toString().toLowerCase() == "financial 15 split ii")
					{
						if (useThisArray[x].toString().toLowerCase() == "valuations")
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "tax information")
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/financial 15 split II/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
					}
					
					else if (directory.toString().toLowerCase() == "dividend 15 split ii")
					{
						if (useThisArray[x].toString().toLowerCase() == "valuations")
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "tax information")
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/dividend 15 split II/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
					}
					else
					{
						if (useThisArray[x].toString().toLowerCase() == "valuations")
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "tax information")
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "q & a")
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/qanda.htm">' + useThisArray[x] + '</a></td>';
						}
						else
						{
							navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + directory.toString().toLowerCase() + '/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
					}
				}
				else
				{
					if (useThisArray[x].toString().toLowerCase() == "valuations")
					{
						navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
					}
					else if (useThisArray[x].toString().toLowerCase() == "tax information")
					{
						navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
					}
					
					else if (useThisArray[x].toString().toLowerCase() == "q & a")
					{
						navstr += '<td width="100%"><a class="blackbold" href="http://www.quadravest.com/qanda.htm">' + useThisArray[x] + '</a></td>';
					}
					else
					{
						navstr += '<td width="100%"><a class="blackbold" href="' + optionalRoot + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
					}
				}
			}
			navstr += '<tr>';
			navstr += '</table>';
			navstr += '</td>';
			navstr += '<td width="1"><img width="15" height="25" src="' + root + 'images/spacer.gif"/></td>';
			navstr += '</tr>';
			navstr += '<tr><td width="1"><img width="15" height="1" src="' + root + 'images/spacer.gif"/></td><td width="100%" bgcolor="#FFFFFF"><img width="100%" height="1" src="' + root + 'images/spacer.gif"/></td><td width="1"><img width="15" height="1" src="' + root + 'images/spacer.gif"/></td></tr>';
		}
		else
		{
			navstr += '<tr>';
			navstr += '<td width="1"><img width="15" height="25" src="' + root + 'images/spacer.gif"/></td>';
			navstr += '<td width="100%">';
			navstr += '<table border="0" cellpadding="0" cellspacing="0" width="100%" height="1">';
			navstr += '<tr>';
			navstr += '<td width="1"><img width="6" height="6" src="' + root + 'images/spacer.gif"/></td>';
			navstr += '<td width="1"><img width="5" height="1" src="' + root + 'images/spacer.gif"/></td>';
			if (useThisArray[x].toString().toLowerCase() == "trading")
			{
				switch (directory) {
					case "Income Financial":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[0] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Income Financial Plus":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[1] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "American Income":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[2] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Ameristar RSP":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[3] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "FSI Streams":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[4] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "CGI Streams":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[5] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Streams III":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[6] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Financial 15":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[7] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Financial 15 Split II":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[8] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "US Financial 15 Split":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[9] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Dividend 15":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[10] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Dividend 15 Split II":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[11] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Split Yield":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[12] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Canadian Life Split":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[13] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Prime Rate Plus Corp":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[14] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Prime Dividend":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[15] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "Commerce Split":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[16] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "M-Split":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[17] + '">' + useThisArray[x] + '</a></td>';
						break;
					case "TDbSplit":
						navstr += '<td width="100%"><a class="black" href="' + navTradingar[18] + '">' + useThisArray[x] + '</a></td>';
						break;
					default:
						break;
				}				
			}
			else
			{
				if (page.toString().toLowerCase() == "trading")
				{
					if (directory.toString().toLowerCase() == "streams iii")
					{
						if (useThisArray[x].toString().toLowerCase() == "valuations")
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "tax information")
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/streams III/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
					}
					else if (directory.toString().toLowerCase() == "financial 15 split ii")
					{
						if (useThisArray[x].toString().toLowerCase() == "valuations")
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "tax information")
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/financial 15 split II/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
					}
					else if (directory.toString().toLowerCase() == "dividend 15 split ii")
					{
						if (useThisArray[x].toString().toLowerCase() == "valuations")
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "tax information")
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/dividend 15 split II/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
					}

					else
					{
						if (useThisArray[x].toString().toLowerCase() == "valuations")
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "tax information")
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
						else if (useThisArray[x].toString().toLowerCase() == "q & a")
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/qanda.htm">' + useThisArray[x] + '</a></td>';
						}
						else
						{
							navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + directory.toString().toLowerCase() + '/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
						}
					}
				}
				else
				{
					if (useThisArray[x].toString().toLowerCase() == "valuations")
					{
						navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
					}
					else if (useThisArray[x].toString().toLowerCase() == "tax information")
					{
						navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/' + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
					}
					
					else if (useThisArray[x].toString().toLowerCase() == "q & a")
					{
						navstr += '<td width="100%"><a class="black" href="http://www.quadravest.com/qanda.htm">' + useThisArray[x] + '</a></td>';
					}
					else
					{
						navstr += '<td width="100%"><a class="black" href="' + optionalRoot + useThisArray[x].toString().toLowerCase() + '.htm">' + useThisArray[x] + '</a></td>';
					}
				}
			}
			navstr += '<tr>';
			navstr += '</table>';
			navstr += '</td>';
			navstr += '<td width="1"><img width="15" height="25" src="' + root + 'images/spacer.gif"/></td>';
			navstr += '</tr>';
			navstr += '<tr><td width="1"><img width="15" height="1" src="' + root + 'images/spacer.gif"/></td><td width="100%" bgcolor="#FFFFFF"><img width="100%" height="1" src="' + root + 'images/spacer.gif"/></td><td width="1"><img width="15" height="1" src="' + root + 'images/spacer.gif"/></td></tr>';
		}		
	}
	return navstr;
}