jQuery code returns 'Object expected' error
<p>I have the following jQuery code. It is writing two event listeners like this ok? The following code throws an.error</p>

<pre><code>$(document).ready(function () {
    $('tr').hover(
        function () {
            $(this).css('background-color', '#FFFF99');
            $(this).contents('td').css({
                'border': '1px solid red', 
                'border-left': 'none', 
                'border-right': 'none' 
            });
            $(this).contents('td:first').css('border-left', '1px solid red');
            $(this).contents('td:last').css('border-right', '1px solid red');
        });

        $('#radioButtonImageSourceContainerId input:radio').click(function () {
            if ($(this).val() === 'fromFile') {
                addVisibility("from-file");
                removeVisibility("from-url");
            } 
            else if ($(this).val() === 'fromUrl') {
                removeVisibility("from-file");
                addVisibility("from-url");
            }
        })
    });
</code></pre>

<p>The other 2 functions are</p>

<pre><code>function addVisibility(elemId) {
    document.getElementById(elemId).style.display = "";
    if (document.getElementById(elemId).style.visibility == "hidden") {
        document.getElementById(elemId).style.visibility = "visible";
    }
}

function removeVisibility(elemId) {
    document.getElementById(elemId).style.display = "";
    if (document.getElementById(elemId).style.visibility == "visible") {
        document.getElementById(elemId).style.visibility = "hidden";
    }
}
</code></pre>
