+
+function setAtEnd(obj) {
+ pos = obj.value.length;
+
+ if(obj.createTextRange) {
+ var range = obj.createTextRange();
+ range.move("character", pos);
+ range.select();
+ } else if(obj.selectionStart) {
+ obj.focus();
+ obj.setSelectionRange(pos, pos);
+ }
+}