// Simulates hovering of an element without CSS
function hoverIE(aElement, aColor)
{
    aElement.style.backgroundColor = aColor;
}

// Highlight Nav Links
function mainNavOver(aTd) { hoverIE(this, '#2F8FCF'); }
function mainNavOut(aTd) { hoverIE(this, '#0F6FAF'); }

// Changes background color of a table row with optional border
// Border if used will apply proper styles to the correct cells below
function highlightRowForIE(aTableRow, aColor, aBorderColor)
{
    aTableRow.style.backgroundColor = aColor;
    
    // Find cell borders and light it up like a box
    if (aBorderColor)
    {
        var border = '1px solid '+aBorderColor;
        
        var num_cols = aTableRow.cells.length;
        var last_col = num_cols - 1;
        
        // Create top and bottom borders for each cell
        for (i = 0; i < num_cols; i++)
        {
            // Clear out any wrongly colored inside borders first
            aTableRow.cells[i].style.border = '1px solid '+aColor;
            
            aTableRow.cells[i].style.borderTop = border;
            aTableRow.cells[i].style.borderBottom = border;
        }
        
        // Create left and right borders
        aTableRow.cells[0].style.borderLeft = border;
        aTableRow.cells[last_col].style.borderRight = border;
    }
}

/**
 *  Temporarily highlights the border of an object
 *  @param Object object -- object to highlight
 *  @param String color -- color to make the border
 *  @param int time -- milliseconds to keep border
 */
function tempBorder(object, color, time)
{
    object.style.border = '1px solid '+color;
    
    window.setTimeout(
        function()
        {
            object.style.border = '1px solid #8F8F8F';
        },
        time);
}