Hi guys, want to know why is this happening, basically i have this javascript code function that will focus on a next specified object.

Code:
function nextFocus(e,object) {
    var key = window.event ? e.keyCode : e.which;
        
    if (key == 13) {
        document.getElementById(object).focus();
    }
    
    return true;
}
In IE and other browser works really well but not in FireFox and the bad things is that after executing the function in FireFox my other script stops functioning also.
Please give me some insight about this matter.
Thank in advance.