+ match = unlocked.innerHTML.substring(i,j);
+ pre = unlocked.innerHTML.substring(0,i);
+ post = unlocked.innerHTML.substring(j);
+ if (match == '\\to') {
+ unlocked.innerHTML = pre + "-> " + post;
+ unlocked.focus();
+ if (savedRange != null) {
+ if (window.getSelection)//non IE and there is already a selection
+ {
+ var s = window.getSelection();
+ if (s.rangeCount > 0)
+ s.removeAllRanges();
+ s.addRange(savedRange);
+ }
+ else
+ if (document.createRange)//non IE and no selection
+ {
+ window.getSelection().addRange(savedRange);
+ }
+ else
+ if (document.selection)//IE
+ {
+ savedRange.select();
+ }
+ }
+
+ return suppressdefault(e,true);
+ }
+ else return suppressdefault(e,false);