/*
	tableruler()
	written by Chris Heilmann for alistapart.
	enables a rollover of rows for each table with the classname "hlrows"
	extended by Andy Biggs - www.andybiggs.net, to expand and contract table rows when clicked.
	NOTE: REMOVE ALL WHITESPACE BETWEEN </tr> AND <tr> IN ORDER TO WORK IN GECKO/MOZ DOM - Ross 
*/

function tableruler()
{
	if (document.getElementById && document.createTextNode)
	{
		var tables=document.getElementsByTagName('table');
		for (var i=0;i<tables.length;i++)
		{
			if(tables[i].className=='ruler')
			{
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0;j<trs.length;j++)
				{
					if(trs[j].parentNode.nodeName=='TBODY')
					{
						if (trs[j].className=='greyRow'){
							trs[j].onmouseover=function(){
								this.className='highlightGrey';
								this.style.cursor = 'pointer';
								return false}
							trs[j].onmouseout=function(){
							if(this.nextSibling.className=='contract'){
								this.className='greyRow';
								}return false}
						}
						trs[j].onclick=function(){								
							if(this.nextSibling.className=='contract'){
								this.nextSibling.className='expand';
								this.id='expand';
							} else if (this.nextSibling.className=='expand'){
								this.nextSibling.className='contract';
								this.id='';
							}
						}
					}
				}
			}
		}
	}
}