
function setmyclass()
{
// set this variable to the classname:
            var myclass = "current";
            var hrefs = document.getElementsByTagName("a");
            for (i=0; hrefs.length; i++)
            {
                        if(hrefs[i] != null)

                        {
                                    if(hrefs[i].href==location.href)

                                    {
                                                if (hrefs[i].parentNode.tagName == "LI")

                                                {
                                                            hrefs[i].parentNode.className = myclass;
                                                }
                                    }           
                        } else {
                                    break;
                        }
            }
}

//function takes a table id and style name and styles the first and last rows of the table
function tableClass(firststyle, laststyle)
{
	tables = document.getElementsByTagName("table");
	if (tables.length > 0)
	{
		
		for (i=0;i<tables.length;i++)
		{
			trs = tables[i].getElementsByTagName("tr");
			
			for (j=0;j<trs.length;j++)
			{
				tds = trs[j].getElementsByTagName("th");
				if (tds.length == 0)
					tds = trs[j].getElementsByTagName("td");

				tds[0].className = firststyle;
				x = tds.length - 1;
				tds[x].className = laststyle;
			}
		}
	}
}
