var showOp = 0;

var buttonNormal = "Show Options";
var buttonExpand = "Hide Options";
function writeNav()
	{

	if(window.butNormal)
		{
		buttonNormal = butNormal;
		}
	if(window.butExpand)
		{
		buttonExpand = butExpand;
		}
	if(relatedTopic.length > 0)
		{
		document.write('<input type="button" id="opButton" onClick="showOptions()" value="' + buttonNormal + '">')
		
		if(thisPageIndex > 0)
			{
			document.write('<input type="button" onClick="doNextPrev(0)" name="<< Prev" value="<< Prev">')
			}
		if(thisPageIndex < (relatedTopic.length - 1))
			{
			document.write('<input type="button" onClick="doNextPrev(1)" name="Next >>" value="Next >>">')
			}
		
		document.write('<div style="font-family: Arial, Helvetica, sans-serif; font-size: 2" id="opList" style="display:none"> <table class="borderTable" >')
		
		document.write('<tr><td colspan="2"  bgcolor="#FFFFFF" nowrap><a href="' + relatedTopic[0].slice(relatedTopic[0].indexOf(";") + 1, relatedTopic[0].length) + '">' + relatedTopic[0].slice(0, relatedTopic[0].indexOf(";")) + '</a> </td></tr>')
		for(z=1;z<relatedTopic.length;z++)
			{
			if(relatedTopic[z])
				{
				document.write('<tr class="trLowLight"><td width="14" align="center" bgcolor="#FFFFFF">' + (z - 1) + '</td><td bgcolor="#FFFFFF" nowrap><a href="' + relatedTopic[z].slice(relatedTopic[z].indexOf(";") + 1, relatedTopic[z].length) + '">' + relatedTopic[z].slice(0, relatedTopic[z].indexOf(";")) + '</a></td></tr>')
				}
			}
		document.write("</table></div><br>");
		}
	}

function doNextPrev(which)
	{
	var i
	if (which == 1) 	i = thisPageIndex + 1;
	if (which == 0) 	i = thisPageIndex - 1;
	
	while(!relatedTopic[i])
		{
		if (which == 1) i++
		if (which == 0) i--
		}
	var nextId = relatedTopic[i].slice(relatedTopic[i].indexOf(";") + 1, relatedTopic[i].length)
	document.location.href = nextId;
	}
	
function showOptions()
	{
	var opObject = document.getElementById("opList")
	var opButObj = document.getElementById("opButton")
	if(showOp == 0)
		{
		opObject.style.display = "block";
		opButObj.value = buttonExpand;
		showOp = 1;
		}
	else
		{
		opObject.style.display = "none";
		opButObj.value = buttonNormal;
		showOp = 0;
		}
	}

/*function writeWebLink()
	{
	var path = String(location.pathname); 
	var truncPath = path.slice(path.length - 9, path.length) ; 
	document.write("<div><a href='http://www.ggy.com/htmlhelp/axis/" + truncPath + "' target='new'>Check the GGY Website for the latest version of this help topic</a><br><br>(Note that this will link to the version of the topic from the most recent release of AXIS and may refer to items/options not in your current version of AXIS).</div>");
	}
	*/


