oldTableRulerFunc = window.onload;
window.onload = function() {
	if(typeof oldTableRulerFunc == 'function') {
		oldTableRulerFunc();
	}
	TableRuler();
}

function TableRuler()
{
	if (document.getElementById &&  document.createTextNode)
	{
		var tables=document.getElementsByTagName('table');
		for (var i=0;i<tables.length;i++)
		{
			if(CssClasses(tables[i]).exists('list'))
			{
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0;j<trs.length;j++)
				{
					if(trs[j].parentNode.nodeName=='TBODY' && trs[j].parentNode.nodeName!='TFOOT' && !CssClasses(trs[j]).exists('inline') && !CssClasses(trs[j]).exists('cell_selected'))
					{
						trs[j].onmouseover = function(){
							if (!this.marked) {
								this.style.backgroundColor='#fef5e7';
								
								if(this.id.indexOf('_addinfo') >= 0) {
									tr_parent_id = this.id.substr(0,this.id.indexOf('_addinfo'));
									tr_parent = document.getElementById(tr_parent_id);
									if(tr_parent != null) {
										tr_parent.style.backgroundColor='#fef5e7';
									}
								} else {
									tr_addinfo = document.getElementById(this.id+'_addinfo');
									if(tr_addinfo != null) {
										tr_addinfo.style.backgroundColor='#fef5e7';
									}
								}
							}
						}
						trs[j].onmouseout  = function(){
							if (!this.marked) {
								this.style.backgroundColor = '';
								
								if(this.id.indexOf('_addinfo') >= 0) {
									tr_parent_id = this.id.substr(0,this.id.indexOf('_addinfo'));
									tr_parent = document.getElementById(tr_parent_id);
									if(tr_parent != null) {
										tr_parent.style.backgroundColor='';
									}
								} else {
									tr_addinfo = document.getElementById(this.id+'_addinfo');
									if(tr_addinfo != null) {
										tr_addinfo.style.backgroundColor='';
									}
								}
							}
						}
					}
				}
			}
		}
	}
}