if(searx.autocompleter) { window.addEvent('domready', function() { new Autocompleter.Request.JSON('q', '/autocompleter', { postVar:'q', postData:{ 'format': 'json' }, ajaxOptions:{ timeout: 5 // Correct option? }, 'minLength': 4, 'selectMode': false, cache: true, delay: 300 }); }); } (function (w, d) { 'use strict'; function addListener(el, type, fn) { if (el.addEventListener) { el.addEventListener(type, fn, false); } else { el.attachEvent('on' + type, fn); } } function placeCursorAtEnd() { if (this.setSelectionRange) { var len = this.value.length * 2; this.setSelectionRange(len, len); } } addListener(w, 'load', function () { var qinput = d.getElementById('q'); if (qinput !== null && qinput.value === "") { addListener(qinput, 'focus', placeCursorAtEnd); qinput.focus(); } }); if (!!('ontouchstart' in window)) { document.getElementsByTagName("html")[0].className += " touch"; } })(window, document); var xmlHttp function GetXmlHttpObject(){ var xmlHttp = null; try { // Firefox, Opera 8.0+, Safari xmlHttp = new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e){ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } var timer; // Calculate the rating function load_more(query,page){ xmlHttp = GetXmlHttpObject(); clearTimeout(timer); if(xmlHttp == null){ alert ("Your browser does not support AJAX!"); return; } favicons[page] = []; xmlHttp.onreadystatechange = function(){ var loader = document.getElementById('load_more'); if (xmlHttp.readyState == 4){ //loader.style.display = 'none'; var res = xmlHttp.responseText; //loader.style.display = 'block'; //loader.innerHTML = '