function hoverGrid(target,hovercolor,offcolor,excludedrows,excludedcolumns){target.find("td").hover(function(){setobjects($(this),hovercolor,excludedrows,excludedcolumns);},function(){setobjects($(this),offcolor,excludedrows,excludedcolumns);});
function setobjects(_obj,color,excluderow,excludecol){var thisrow;var rowtdcollection;  var tdcollection;var isexcluded;var rowcollection;var thisrowcollection;thisrow = _obj.parent("tr").not(".off");parenttable = _obj.closest("table");rowtdcollection = thisrow.children("td");index = rowtdcollection.index(_obj);isexcluded = $.inArray(index,excludecol);parenttable.find("tr").not(excluderow).each(function(){if(isexcluded == -1){$(this).children("td").eq(index).css( "background-color", color);}});thisrow.find("td").andSelf().css( "background-color", color); }}
