All pastes #476507 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-08 03:52 UTC
rendered paste body
rowHoverHandler = function ()
{
    var woink = document.getElementsByTagName ("tr");
    for (var j = 0; j < woink.length; j++)
    {
        woink[j].onmouseover = function ()
        {
            this.className += ' hover';
        }
        woink[j].onmouseout = function ()
        {
            this.className = this.className.replace(' hover', '');
        }
    }
}

rowClickRedirect = function ()
{
    var woink = document.getElementsByTagName ("tr");
    for (var j = 0; j < woink.length; j++)
    {
        woink[j].onclick = function ()
        {
            if (!this.className.match('highlight'))
            {
                this.className += ' highlight';
                window.location = 'http://google.com';
            }
        }
    }
}


if (window.attachEvent)
{
    window.attachEvent('onload', rowHoverHandler);
    window.attachEvent('onload', rowClickRedirect);
}
else
{
    window.addEventListener('load', rowClickRedirect, false);
}