Does anyone know anything about selecting text in an editable iframe? The following code kind of works in FireFox (it's a little buggy), but doesn't work at all in anything else.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
<head>
    <title>ADVANCED EDITOR TEST PAGE</title>
    <script type="text/javascript">
        function framego(){
            document.getElementById("frame").contentDocument.designMode = "On";
            document.getElementById("frame").contentWindow.document.body.innerHTML = "TEST [here] ING";
        }
        function selectArea(){
        	o=document.getElementById('frame');
            
        	if(o.contentWindow.getSelection) sel = o.contentWindow.getSelection(); //FF
            else sel = o.contentDocument.selection.createRange(); //IE

        	range2=sel.getRangeAt(0);

        	var range = document.createRange();
        	range.setStart(sel.anchorNode,5);
        	range.setEnd(sel.anchorNode,11);

        	//remove the old range and add the newly created range
        	sel.removeRange(range2);
        	sel.addRange(range);
            
            o.focus();
        }
    </script>
</head>
<body onload="framego()">
    <iframe id="frame"></iframe>
    <button onclick="selectArea()">TEST</button>
</body>
    </html>
It's supposed to select the word "Here" in the iframe.

A million thanks to anyone who can point me in the right direction on this one. :-)