/*
	tableruler()
	written by Chris Heilmann for alistapart.
	enables a rollover of rows for each table with the classname "hlrows"
*/

window.onload=function(){tableruler();}


function tableruler()
{
	if (document.getElementById && document.createTextNode)
	{
		var tables=document.getElementsByTagName('table');
		for (var i=0;i<tables.length;i++)
		{
			if(tables[i].className=='price_table' || tables[i].className=='price_table_link')
			{
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0;j<trs.length;j++)
				{
					if(trs[j].parentNode.nodeName=='TBODY')
					{	var oldclass=trs[j].className;

						trs[j].onmouseover=function(){this.className='ruled';return false}
						if (oldclass=='sold'){
							trs[j].onmouseout=function(){this.className='sold'; return false}
						} else if (oldclass=='reserved'){
							trs[j].onmouseout=function(){this.className='reserved'; return false}
						} else if (oldclass=='topoff'){
							trs[j].onmouseout=function(){this.className='topoff'; return false}
						} else {
							trs[j].onmouseout=function(){this.className=''; return false}
						}
					}
				}
			}
		}
	}
}
