/*
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 */

function attachMouse()
{
	if(typeof(data)!='undefined')
	{
		if (data.rows.length>0)
		{
			for (c=1;c<data.rows[0].cells.length-2;c++)
			{
				if (typeof(data.rows[0].cells[c].firstChild)!="undefined")
					if (data.rows[0].cells[c].firstChild.tagName=="A")
					{
					data.rows[0].cells[c].firstChild.attachEvent ('onmouseover', HiliteSort);
					data.rows[0].cells[c].firstChild.attachEvent ('onmouseout', RestoreSort);
					}
				
			}
			for (r=1;r<data.rows.length-2;r++)
			{		
				data.rows[r].attachEvent ('onmouseover', Hilite);
				data.rows[r].attachEvent ('onmouseout', Restore);			
			}
		}
	}
}

function Hilite()
{	
	obj=event.srcElement
	while (obj.tagName!='TR')
		obj=obj.parentElement;
	obj.bgColor='#eeeeee';
}
function Restore()
{
	obj=event.srcElement
	while (obj.tagName!='TR')
		obj=obj.parentElement;
	obj.bgColor='';	
}
function HiliteSort()
{	
	obj=event.srcElement.parentElement;
	obj.orgColor=obj.style.backgroundColor;
	obj.style.backgroundColor="#B2C6CC";
}
function RestoreSort()
{	
	obj=event.srcElement.parentElement;	
	obj.style.backgroundColor=obj.orgColor
}