var Resources = new Array();
var Trainings = new Array();

function writeBox1(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, sLink2, sHref2, iHorzSpacer, iCount)
{	//if the browser is Netscape 4.x then use layers
	//else use the dom and div tags
	if(NS4)
	{	writeBox1NS4(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, sLink2, sHref2, iHorzSpacer, iCount);
	}
	else
	{	writeBox1DOM(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, sLink2, sHref2, iCount);
	}
}

function writeBox1A(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, sLink2, sHref2, iHorzSpacer, iCount)
{	//if the browser is Netscape 4.x then use layers
	//else use the dom and div tags
	if(NS4)
	{	writeBox1NS4(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, sLink2, sHref2, iHorzSpacer, iCount);
	}
	else
	{	writeBox1DOM(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, sLink2, sHref2, iCount);
	}
}

function writeBox4(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, iHorzSpacer, iCount)
{	//if the browser is Netscape 4.x then use layers
	//else use the dom and div tags
	if(NS4)
	{	writeBox4NS4(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, iHorzSpacer, iCount);
	}
	else
	{	writeBox4DOM(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, iCount);
	}
}

//================================================================================
//writes box type 1 for NS4 using layers

//files required: 
//		images/spacer.gif
//		css/base.css
//		../common/swap.js
//		script/page_init.js

//arguments:
//		iWidth = 		integer, width of box table
//		iHeight = 		integer, hieght of box table
//		bgColor = 		string, starting background color of box
//		bgColorHL = 	string, rollover background color of box
//		sHeader = 		string, header text
//		sBody = 		string, body text
//		sLink = 		string, link text
//		sHref = 		string, href link
//================================================================================
function writeBox1NS4(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, iHorzSpacer, iCount)
{	document.write("<ilayer height='" + iHeight + "' width='" + iWidth + "'>");
	document.write("<layer height='" + iHeight + "' width='" + iWidth + "' bgcolor='" + bgColor + "' onmouseover='chgTDBg(this, \"" + bgColorHL + "\");' onmouseout='chgTDBg(this, \"" + bgColor + "\");' onclick=\"window.location='" + sHref + "'\">");
	
	if (iCount <= 18)
	{	var iSubHead = 4;
	}
	else
	{	var iSubHead = 1;
	}
	
	document.write("<span class='box1header'>" + sHeader + "</span><br>");
	document.write("<span class='box1text'><img src='images/spacer.gif' alt='' width='1' height='" + iSubHead + "' border='0'></span><br>");
	document.write("<span class='box1text'>" + sBody + "</span><br>");
	document.write("<span class='box1text'><img src='images/spacer.gif' alt='' width='1' height='" + iHorzSpacer + "' border='0'></span><br>");
	document.write("<span class='box1link'><a href='" + sHref + "' class='box1link'>" + sLink + "</a></span><br>");
	
	document.write("</layer>");
	document.write("</ilayer>");
}

//================================================================================
//writes box type 1 for browser supporting the DOM
//**USE FOR SALES IDEAS

//files required: 
//		images/spacer.gif
//		css/base.css
//		../common/swap.js
//		script/page_init.js

//arguments:
//		iWidth = 		integer, width of box table
//		iHeight = 		integer, hieght of box table
//		bgColor = 		string, starting background color of box
//		bgColorHL = 	string, rollover background color of box
//		sHeader = 		string, header text
//		sBody = 		string, body text
//		sLink = 		string, link text
//		sHref = 		string, href link
//================================================================================
function writeBox1DOM(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, iCount)
{	document.write("<div class='box1wrapper' onmouseover='chgTDBg(this, \"" + bgColorHL + "\");' onmouseout='chgTDBg(this, \"" + bgColor + "\");' onclick=\"window.location='" + sHref + "'\">");
	
	document.write("<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr><td class='box1header'>" + sHeader + "</td></tr>");
	
	if (iCount <= 16)
	{	var iSubHead = 25;
	}
	else
	{	var iSubHead = 8;
	}
	
	document.write("<tr><td><img src='images/spacer.gif' alt='' width='1' height='5'" +iSubHead + " ' border='0'></td></tr>");
	document.write("<tr><td align='left'><a href='" + sHref + "' class='box1link'>" + sLink + "</a></td></tr>");
	document.write("<tr><td class='box1text'>" + sBody + "</td></tr>");
	document.write("<tr><td height='100%'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td></tr>");

	document.write("</table>");
	
	document.write("</div>");
}

// Box1 with two links
function writeBox1ADOM(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, sLink2, sHref2, iCount)
{	document.write("<div class='box1wrapper' onmouseover='chgTDBg(this, \"" + bgColorHL + "\");' onmouseout='chgTDBg(this, \"" + bgColor + "\");' onclick=\"window.location='" + sHref + "'\">");
	
	document.write("<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr><td class='box1header'>" + sHeader + "</td></tr>");
	
	if (iCount <= 16)
	{	var iSubHead = 25;
	}
	else
	{	var iSubHead = 8;
	}
	
	document.write("<tr><td><img src='images/spacer.gif' alt='' width='1' height='5'" +iSubHead + " ' border='0'></td></tr>");
	document.write("<tr><td align='left'><a href='" + sHref + "' class='box1link'>" + sLink + "</a></td></tr>");
	document.write("<tr><td align='left'><a href='" + sHref2 + "' class='box1link'>" + sLink2 + "</a></td></tr>");
	document.write("<tr><td class='box1text'>" + sBody + "</td></tr>");
	document.write("<tr><td height='100%'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td></tr>");

	document.write("</table>");
	
	document.write("</div>");
}

//================================================================================
//writes box type 4 for NS4 using layers

//files required: 
//		images/spacer.gif
//		css/base.css
//		../common/swap.js
//		script/page_init.js

//arguments:
//		iWidth = 		integer, width of box table
//		iHeight = 		integer, hieght of box table
//		bgColor = 		string, starting background color of box
//		bgColorHL = 	string, rollover background color of box
//		sHeader = 		string, header text
//		sBody = 		string, body text
//		sLink = 		string, link text
//		sHref = 		string, href link
//================================================================================
function writeBox4NS4(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, iHorzSpacer, iCount)
{	document.write("<ilayer height='" + iHeight + "' width='" + iWidth + "'>");
	document.write("<layer height='" + iHeight + "' width='" + iWidth + "' bgcolor='" + bgColor + "' onmouseover='chgTDBg(this, \"" + bgColorHL + "\");' onmouseout='chgTDBg(this, \"" + bgColor + "\");' onclick=\"window.location='" + sHref + "'\">");
	
	if (iCount <= 18)
	{	var iSubHead = 4;
	}
	else
	{	var iSubHead = 1;
	}
	
	document.write("<span class='box4header'>" + sHeader + "</span><br>");
	document.write("<span class='box4text'><img src='images/spacer.gif' alt='' width='1' height='" + iSubHead + "' border='0'></span><br>");
	document.write("<span class='box4text'>" + sBody + "</span><br>");
	document.write("<span class='box4text'><img src='images/spacer.gif' alt='' width='1' height='" + iHorzSpacer + "' border='0'></span><br>");
	document.write("<span class='box4link'><a href='" + sHref + "' class='box4link'>" + sLink + "</a></span><br>");
	
	document.write("</layer>");
	document.write("</ilayer>");
}

//================================================================================
//writes box type 4 for browser supporting the DOM
//**USE FOR RELATED PRODUCTS

//files required: 
//		images/spacer.gif
//		css/base.css
//		../common/swap.js
//		script/page_init.js

//arguments:
//		iWidth = 		integer, width of box table
//		iHeight = 		integer, hieght of box table
//		bgColor = 		string, starting background color of box
//		bgColorHL = 	string, rollover background color of box
//		sHeader = 		string, header text
//		sBody = 		string, body text
//		sLink = 		string, link text
//		sHref = 		string, href link
//================================================================================
function writeBox4DOM(iWidth, iHeight, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, iCount)
{	document.write("<div class='box4wrapper' onmouseover='chgTDBg(this, \"" + bgColorHL + "\");' onmouseout='chgTDBg(this, \"" + bgColor + "\");' onclick=\"window.location='" + sHref + "'\">");
	
	document.write("<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr><td class='box4header'>" + sHeader + "</td></tr>");
	
	if (iCount <= 16)
	{	var iSubHead = 25;
	}
	else
	{	var iSubHead = 8;
	}
	
	document.write("<tr><td><img src='images/spacer.gif' alt='' width='1' height='5'" +iSubHead + " ' border='0'></td></tr>");
	document.write("<tr><td align='left'><a href='" + sHref + "' class='box4link'>" + sLink + "</a></td></tr>");
	document.write("<tr><td class='box4text'>" + sBody + "</td></tr>");
	document.write("<tr><td height='100%'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td></tr>");

	document.write("</table>");
	
	document.write("</div>");
}

//================================================================================
//writes box type 3 (border, bgcolor change)

//files required: 
//		images/spacer.gif
//		css/base.css
//		../common/swap.js
//		script/page_init.js

//arguments:
//		iWidth = 		integer, width of box table
//		iHeight = 		integer, hieght of box table
//		borderColor = 	string, box border color
//		bgColor = 		string, starting background color of box
//		bgColorHL = 	string, rollover background color of box
//		sHeader = 		string, header text
//		sBody = 		string, body text
//		sLink = 		string, link text
//		sHref = 		string, href link
//================================================================================
//function writeBox3(sID, iWidth, iHeight, borderColor, bgColor, bgColorHL, sImageUp, sImageOver, sHref)
//{	document.write("<table border='0' cellpadding='0' cellspacing='0'>");
	//borders
	//document.write("<tr>");
	//document.write("<td width='1' bgcolor='" + borderColor + "' rowspan='3'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	//document.write("<td width='" + (iWidth - 2) + "' bgcolor='" + borderColor + "'><img src='images/spacer.gif' alt='' width='"+ (iWidth - 2) + "' height='1' border='0'></td>");
	//document.write("<td width='1' rowspan='3' bgcolor='" + borderColor + "'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	//document.write("</tr>");
	
	//display
	//document.write("<tr>");
	//document.write("<td>");
	//document.write("<a href='" + sHref + "' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"" + sImageOver + "\",1); ' onmouseout='MM_swapImgRestore();'><img name='" + sID + "' src='" + sImageUp + "' alt='' width='152' height='152' border='0'></a>")
	//document.write("</td>");
	//document.write("</tr>");
	
	//bottom border
	//document.write("<tr>");
	//document.write("<td width='" + iWidth + "' colspan='3' bgcolor='" + borderColor + "'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	//document.write("</tr>");
	//document.write("</table>");
//}

//function writeBox3(iWidth, iHeight, borderColor, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, horzSpacer, iCount)
//{	document.write("<div class='box3wrapper' onmouseover='chgTDBg(this, \"" + bgColorHL + "\");' onmouseout='chgTDBg(this, \"" + bgColor + "\");' onclick=\"window.location='" + sHref + "'\">");
	
	//document.write("<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>");
	//document.write("<tr><td class='box3header'>" + sHeader + "</td></tr>");
	
	//if (iCount <= 16)
	//{	var iSubHead = 25;
	//}
	//else
	//{	var iSubHead = 8;
	//}
	//borders
	//document.write("<tr>");
	//document.write("<td width='1' bgcolor='" + borderColor + "' rowspan='6'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	//document.write("<td width='" + (iWidth - 2) + "' bgcolor='" + borderColor + "'><img src='images/spacer.gif' alt='' width='"+ (iWidth - 2) + "' height='1' border='0'></td>");
	//document.write("<td width='1' rowspan='6' bgcolor='" + borderColor + "'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	//document.write("</tr>");
	
	//display
	//document.write("<tr><td><img src='images/spacer.gif' alt='' width='1' height='5'" +iSubHead + " ' border='0'></td></tr>");
	//document.write("<tr><td align='left'><a href='" + sHref + "' class='box3link'>" + sLink + "</a></td></tr>");
	//document.write("<tr><td class='box3text'>" + sBody + "</td></tr>");
	//document.write("<tr><td height='100%'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td></tr>");

	
	//bottom border
	//document.write("<tr>");
	//document.write("<td width='" + iWidth + "' colspan='4' bgcolor='" + borderColor + "'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	//document.write("</tr>");
	//document.write("</table>");
//}

function writeBox3(iWidth, iHeight, borderColor, bgColor, bgColorHL, sHeader, sBody, sLink, sHref, iCount)
{	document.write("<div class='box3wrapper' onmouseover='chgTDBg(this, \"" + bgColorHL + "\");' onmouseout='chgTDBg(this, \"" + bgColor + "\");' onclick=\"window.location='" + sHref + "'\">");
	
	document.write("<table width='154' height='154' border='0' cellpadding='0' cellspacing='0'>");
	
	//top border
	document.write("<tr>");
	document.write("<td width='1' bgcolor='" + borderColor + "' rowspan='9'><img src='images/spacer.gif' hspace='0' vspace='0' alt='' width='1' height='1' border='0'></td>");
	document.write("<td width='" + (iWidth - 2) + "' bgcolor='" + borderColor + "'><img src='images/spacer.gif' hspace='0' vspace='0' alt='' width='"+ (iWidth - 2) + "' height='1' border='0'></td>");
	document.write("<td width='1' rowspan='9' bgcolor='" + borderColor + "'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	document.write("</tr>");
	document.write("<tr><td><table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr><td width='2' rowspan='5'><img src='images/spacer.gif' alt='' width='2' height='100%' border='0'></td><td class='box3header'>" + sHeader + "</td></tr>");
	
	if (iCount <= 16)
	{	var iSubHead = 25;
	}
	else
	{	var iSubHead = 8;
	}
	
	document.write("<tr><td><img src='images/spacer.gif' alt='' width='1' height='5'" +iSubHead + " ' border='0'></td></tr>");
	document.write("<tr><td align='left'><a href='" + sHref + "' class='box3link'>" + sLink + "</a></td></tr>");
	document.write("<tr><td class='box3text'>" + sBody + "</td></tr>");
	document.write("<tr><td height='100%'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td></tr>");
	document.write("</table></td></tr>");
	
	//bottom border
	document.write("<tr>");
	document.write("<td width='" + iWidth + "' colspan='4' bgcolor='" + borderColor + "'><img src='images/spacer.gif' hspace='0' vspace='0' alt='' width='1' height='1' border='0'></td>");
	document.write("</tr>");
	document.write("</table>");
	
	document.write("</div>");
}



//training constructor
function Training(sId, sType, sHref, sLink, sSummary)
{	this.id = sId;
	this.type = sType;
	this.href = sHref;
	this.linkText = sLink;
	this.summaryText = sSummary;
}

function addTraining(sId, sType, sHref, sLink, sSummary)
{	var oTra = new Training(sId, sType, sHref, sLink, sSummary);
	
	if (Trainings.length < 1)
	{ 	var i = 0;
	}
	else
	{	var i = Trainings.length;
	}
	
	Trainings[i] = oTra;
}

//================================================================================
//writes the training to the page

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//================================================================================
function writeTrainings(iWidth)
{	writeTrainingHeader(iWidth);
	writeTrainingSpacer(iWidth, 10);
	
	for (var i = 0; i <= (Training.length - 1); i++)
	{	writeTrainingItem(Trainings[i].id, Trainings[i].type, Trainings[i].href, Trainings[i].linkText, Trainings[i].summaryText);
		
		//if the loop is on the last item  then
		//get out, we do not need the seperator
		if (i == (Trainings.length - 1))
		{	break;
		}
		else
		{	writeTrainingSeparator(iWidth, 33);
		}
	}
	
	writeTrainingSpacer(iWidth, 25);
	writeTrainingFooter(iWidth);
}

//================================================================================
//writes the main table structure and header of the training section

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//		sHeader = 	string, header text
//================================================================================
function writeTrainingHeader(iWidth)
{	document.write("<table border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr>");
	document.write("<td width='" + iWidth + "' class='resourceoutline' colspan='3'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	document.write("</tr>");
	
	writeTrainingSpacer(iWidth, 5);
	
	document.write("<tr>");
	document.write("<td width='1' class='resourceoutline'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
	document.write("<td align='left' valign='top'><img src='images/header_training.gif' alt='Training' width='82' height='10' border='0'></td>");
	document.write("</tr>");
}

//================================================================================
//writes the main table structure and header of the training section

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//================================================================================
function writeTrainingFooter(iWidth)
{	document.write("<tr>");
	document.write("<td class='resourceoutline' colspan='3'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	document.write("</tr>");
	document.write("</table>");
}

//================================================================================
//writes a sinlge row to the training table, which represents a dashed 
//separator row

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//		iDashes = 	integer, number of dashes required to fill row
//================================================================================
function writeTrainingSeparator(iWidth, iDashes)
{	document.write("<tr>");
	document.write("<td width='1' class='resourceoutline'><img src='images/spacer.gif' alt='' width='1' height='20' border='0'></td>");
	document.write("<td width='" + (iWidth - 1) + "' colspan='2'>");
	document.write("<span class='resourceseparator'>");
	
	for (var i = 1; i <= iDashes; i++)
	{	document.write("-");
	}
	
	document.write("</span>");
	document.write("</td>");
	document.write("</tr>");
}

//================================================================================
//write a sinlge row to the training table, which
//contains a training item.  Each item represents a link
//to a PDF document.

//files required: 
//		images/spacer.gif
//		images/pdf.gif
//		images/pdf_green.gif
//		css/base.css
//		..common/swap.js

//arguments:
//		sID = 		string, id of the pdf images to swap.  each item must have
//					a unique id.
//		sHref =		string, href tag value
//		sLink = 	string, link  text
//		sSummary = 	string, summary text for item
//================================================================================
function writeTrainingItem(sID, sType, sHref, sLink, sSummary)
{	document.write("<tr>");
	document.write("<td width='1' class='resourceoutline'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
	document.write("<td align='left' valign='top'>");
	document.write("<table border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr>")
	
	if (sType == "pdf")
	{	document.write("<td width='16' align='left' valign='top'><a href='" + sHref + "' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/pdf_green.gif\",1);'><img name='" + sID + "' src='images/pdf.gif' alt='Download' width='16' height='16' border='0'></a></td>");					
		document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
		document.write("<td align='left' valign='top'><a href='" + sHref + "' class='link' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/pdf_green.gif\",1);'>" + sLink + "</a><br><span class='resourcesummary'>" + sSummary + "</span></td>");
	}
	else if (sType == "www")
	{	document.write("<td width='16' align='center' valign='top'><a href='" + sHref + "' onclick='return ExitAlert();' target='_blank' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/www_green.gif\",1);'><img name='" + sID + "' src='images/www.gif' alt='Go to web site' width='16' height='16' border='0'></a></td>");					
		document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
		document.write("<td align='left' valign='top'><a href='" + sHref + "' onclick='return ExitAlert();' target='_blank' class='link' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/www_green.gif\",1);'>" + sLink + "</a><br><span class='resourcesummary'>" + sSummary + "</span></td>");
	}
	
	document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</td>");
	document.write("</tr>");
}


//================================================================================
//writes a sinlge row to the training table, which
//represents a horizontal spacer row
//to a PDF document.

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//		iHeight = 	integer, height of row
//================================================================================
function writeTrainingSpacer(iWidth, iHeight)
{	document.write("<tr>");
	document.write("<td width='1' class='resourceoutline'><img src='images/spacer.gif' alt='' width='1' height='" + iHeight + "' border='0'></td>");
	document.write("<td width='" + (iWidth - 1) + "' colspan='2'><img src='images/spacer.gif' alt='' width='1' height='" + iHeight + "' border='0'></td>");
	document.write("</tr>");
}


//resource constructor
function Resource(sId, sType, sHref, sLink, sSummary)
{	this.id = sId;
	this.type = sType;
	this.href = sHref;
	this.linkText = sLink;
	this.summaryText = sSummary;
}

function addResource(sId, sType, sHref, sLink, sSummary)
{	var oRes = new Resource(sId, sType, sHref, sLink, sSummary);
	
	if (Resources.length < 1)
	{ 	var i = 0;
	}
	else
	{	var i = Resources.length;
	}
	
	Resources[i] = oRes;
}

//================================================================================
//writes the resources to the page

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//================================================================================
function writeResources(iWidth)
{	writeResourceHeader(iWidth);
	writeResourceSpacer(iWidth, 10);
	
	for (var i = 0; i <= (Resources.length - 1); i++)
	{	writeResourceItem(Resources[i].id, Resources[i].type, Resources[i].href, Resources[i].linkText, Resources[i].summaryText);
		
		//if the loop is on the last item  then
		//get out, we do not need the seperator
		if (i == (Resources.length - 1))
		{	break;
		}
		else
		{	writeResourceSeparator(iWidth, 33);
		}
	}
	
	writeResourceSpacer(iWidth, 25);
	writeResourceFooter(iWidth);
}

//================================================================================
//writes the main table structure and header of the resouces section

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//		sHeader = 	string, header text
//================================================================================
function writeResourceHeader(iWidth)
{	document.write("<table border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr>");
	document.write("<td width='" + iWidth + "' class='resourceoutline' colspan='3'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	document.write("</tr>");
	
	writeResourceSpacer(iWidth, 5);
	
	document.write("<tr>");
	document.write("<td width='1' class='resourceoutline'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
	document.write("<td align='left' valign='top'><img src='images/header_resources.gif' alt='Resources' width='100' height='10' border='0'></td>");
	document.write("</tr>");
}

//================================================================================
//writes the main table structure and header of the resouces section

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//================================================================================
function writeResourceFooter(iWidth)
{	document.write("<tr>");
	document.write("<td class='resourceoutline' colspan='3'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	document.write("</tr>");
	document.write("</table>");
}

//================================================================================
//writes a sinlge row to the resources table, which represents a dashed 
//seperator row

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//		iDashes = 	integer, number of dashes required to fill row
//================================================================================
function writeResourceSeparator(iWidth, iDashes)
{	document.write("<tr>");
	document.write("<td width='1' class='resourceoutline'><img src='images/spacer.gif' alt='' width='1' height='20' border='0'></td>");
	document.write("<td width='" + (iWidth - 1) + "' colspan='2'>");
	document.write("<span class='resourceseparator'>");
	
	for (var i = 1; i <= iDashes; i++)
	{	document.write("-");
	}
	
	document.write("</span>");
	document.write("</td>");
	document.write("</tr>");
}

//================================================================================
//write a sinlge row to the resources table, which
//contains a resource item.  Each item represents a link
//to a PDF document.

//files required: 
//		images/spacer.gif
//		images/pdf.gif
//		images/pdf_green.gif
//		css/base.css
//		..common/swap.js

//arguments:
//		sID = 		string, id of the pdf images to swap.  each item must have
//					a unique id.
//		sHref =		string, href tag value
//		sLink = 	string, link  text
//		sSummary = 	string, summary text for item
//================================================================================
function writeResourceItem(sID, sType, sHref, sLink, sSummary)
{	document.write("<tr>");
	document.write("<td width='1' class='resourceoutline'><img src='images/spacer.gif' alt='' width='1' height='1' border='0'></td>");
	document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
	document.write("<td align='left' valign='top'>");
	document.write("<table border='0' cellpadding='0' cellspacing='0'>");
	document.write("<tr>")
	
	if (sType == "pdf")
	{	document.write("<td width='16' align='left' valign='top'><a href='" + sHref + "' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/pdf_green.gif\",1);'><img name='" + sID + "' src='images/pdf.gif' alt='Download' width='16' height='16' border='0'></a></td>");					
		document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
		document.write("<td align='left' valign='top'><a href='" + sHref + "' class='link' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/pdf_green.gif\",1);'>" + sLink + "</a><br><span class='resourcesummary'>" + sSummary + "</span></td>");
	}
	if (sType == "xls")
	{	document.write("<td width='16' align='left' valign='top'><a href='" + sHref + "' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/excel_green.gif\",1);'><img name='" + sID + "' src='images/excel.gif' alt='Download' width='16' height='16' border='0'></a></td>");					
		document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
		document.write("<td align='left' valign='top'><a href='" + sHref + "' class='link' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/excel_green.gif\",1);'>" + sLink + "</a><br><span class='resourcesummary'>" + sSummary + "</span></td>");
	}
	else if (sType == "www")
	{	document.write("<td width='16' align='center' valign='top'><a href='" + sHref + "' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/www_green.gif\",1);'><img name='" + sID + "' src='images/www.gif' alt='Go to web site' width='16' height='16' border='0'></a></td>");					
		document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
		document.write("<td align='left' valign='top'><a href='" + sHref + "' class='link' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/www_green.gif\",1);'>" + sLink + "</a><br><span class='resourcesummary'>" + sSummary + "</span></td>");
	}
	
	else if (sType == "html")
	{	document.write("<td width='16' align='center' valign='top'><a href='" + sHref + "' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/spacer.gif\",1);'><img name='" + sID + "' src='images/spacer.gif' alt='' width='16' height='16' border='0'></a></td>");					
		document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
		document.write("<td align='left' valign='top'><a href='" + sHref + "' class='link' onmouseout='MM_swapImgRestore();' onmouseover='MM_swapImage(\"" + sID + "\",\"\",\"images/spacer.gif\",1);'>" + sLink + "</a><br><span class='resourcesummary'>" + sSummary + "</span></td>");
	}
	
	document.write("<td width='5' align='left' valign='top'><img src='images/spacer.gif' alt='' width='5' height='1' border='0'></td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</td>");
	document.write("</tr>");
}


//================================================================================
//writes a sinlge row to the resources table, which
//represents a horizontal spacer row
//to a PDF document.

//files required: 
//		images/spacer.gif
//		css/base.css

//arguments:
//		iWidth = 	integer, width of image (required to make NS work)
//		iHeight = 	integer, height of row
//================================================================================
function writeResourceSpacer(iWidth, iHeight)
{	document.write("<tr>");
	document.write("<td width='1' class='resourceoutline'><img src='images/spacer.gif' alt='' width='1' height='" + iHeight + "' border='0'></td>");
	document.write("<td width='" + (iWidth - 1) + "' colspan='2'><img src='images/spacer.gif' alt='' width='1' height='" + iHeight + "' border='0'></td>");
	document.write("</tr>");
}