Stack overflow because of JS -why?

I have a function which replaces one image with another originally meant for onmouseover function but i use also as a sort of PNG fix for IE. The idea is to have one pic loaded for FF and one for IE. The JS function looks like this:


var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function rollOver(ime, pot, over){
    if ((version >= 5.5) && (version < 7) && (document.body.filters) && (!over)) 
    {
        document[ime].src='images/menu/'+ime+'.jpg';
        //alert(document[ime].src);
    }else if((version >= 5.5) && (version < 7) && (document.body.filters) && (over)){
        document[ime].src='images/menu/'+ime+'_over.jpg';
    }
    else{
        document[ime].src = pot;    
    }
}

so that the function loads different images depending on the type of browser and if the mouse is over the image. That works fine. But if i use it in IMG tag like this:


 onload="rollOver('disko', 'images/menu/disko.png', false)"

it returns stackOverflow when i open the document. Why is that and how could i make it work?

Thanks in advance!