@@ -0,0 +1,27 @@
1+(function (w, d) {
2+ 'use strict';
3+ function addListener(el, type, fn) {
4+ if (el.addEventListener) {
5+ el.addEventListener(type, fn, false);
6+ } else {
7+ el.attachEvent('on' + type, fn);
8+ }
9+ }
10+
11+ function placeCursorAtEnd() {
12+ if (this.setSelectionRange) {
13+ var len = this.value.length * 2;
14+ this.setSelectionRange(len, len);
15+ }
16+ }
17+
18+ addListener(w, 'load', function () {
19+ var qinput = d.getElementById('q');
20+ if (qinput !== null) {
21+ addListener(qinput, 'focus', placeCursorAtEnd);
22+ qinput.focus();
23+ }
24+ });
25+
26+})(window, document);
27+