// JavaScript Document

function hnavbar(section, h2title, topactive, toptab, botactive, bottab)
{
	var i;
	
	document.write('<h2>' + h2title + '</h2>');
	
	document.write('<div id="ms-hnav"><h5> Site Navigation:</h5><ul>');
	
	for (i = 0; i < toptab.length; i++)
	{
		var listring = '<li><a id="ms-x" href="/SECTION-iTABNAME">eTABNAME</a></li>';
    var itab = toptab[i].i;
		
    if (topactive === toptab[i].i)
		{
			listring = listring.replace(/ms-x/, "ms-c");

       
      if (botactive)
      {
        itab = itab + '-' + botactive;
      }
                    
		}

		listring = listring.replace(/SECTION/g, section);
		listring = listring.replace(/iTABNAME/, toptab[i].i);
		listring = listring.replace(/eTABNAME/, toptab[i].e);
		
		document.write(listring);
	}
	
	document.write('</ul>');
	
	if (bottab)
	{
	  document.write('<div id="ms-hnav-l"><h5> Site Navigation:</h5><ul>');
	
	  for (i = 0; i < bottab.length; i++)
	  {
	  	var listring = '<li><a id="ms-x" href="/SECTION-iTABNAME">eTABNAME</a></li>';
		
	  	listring = listring.replace(/SECTION/g, section);
	  	listring = listring.replace(/iTABNAME/, topactive + '-' + bottab[i].i);
	  	listring = listring.replace(/eTABNAME/, bottab[i].e);
		
	  	if (botactive === bottab[i].i)
	  	{
  			listring = listring.replace(/ms-x/, "ms-c");
  		}
		
  		document.write(listring);
  	}
	
  	document.write('</ul></div>');
	}
	
	document.write('</div>');
}
	
