document.write('<applet id="test" width="400" height="400" name="test applet" code="test.class" codebase="." mayscript>');
document.write('You need Java(tm) to view this presentation. <a href="http://www.java.com">Download Java</a></applet> ');
-window.getSelection().setPosition(document.getElementById("test"), 0);
+window.getSelection().collapse(document.getElementById("test"), 0);
</script>
</body>