var tySearchWidget_default = { uri : 'http://www.xxl-kuechen.de/tycon/modules/search/handlers/suggest.requesthandler.php', post : '', callback : null, default_callback : null, config : { content : [], db : [], navigation : [], loader_id : '', output_id : '', result_src : '', resultclass : '', activeresultclass : '' }, configure : function(type, data) { if (typeof this.config[type] != 'string') { this.config[type].push(data); } else { this.config[type] = data; } }, createPost : function() { for (var type in this.config) { if (typeof this.config[type] != 'string') { for (var i=0; i < this.config[type].length; i++) { this.post += '&'+type+'['+i+']'+'='+this.config[type][i]; } } else { this.post += '&'+type+'='+this.config[type]; } } this.post += '&PHPSESSID=miuk849at3hkjrfknc53l4gnae90ttlh'; }, run : function(value) { if (this.post=='') this.createPost(value); this.sendRequest('search='+value + this.post); }, sendRequest : function(post) { var xmlobj = false; try { xmlobj = new ActiveXObject( "Msxml2.XMLHTTP" ); } catch (e) { try { xmlobj = new ActiveXObject( "Microsoft.XMLHTTP" ); } catch (oc) { xmlobj = null; } } if(!xmlobj && typeof XMLHttpRequest != "undefined") xmlobj = new XMLHttpRequest(); if(xmlobj){ try { if (this.callback!==null && (typeof this.callback['onload'] == 'function' || typeof this.callback['onload'] == 'object')) { this.callback['onload'](this.config['loader_id']); } else { this.default_callback['onload']; } } catch (e) {} xmlobj.open("POST", this.uri, true); xmlobj.setRequestHeader("Method", "POST " + this.uri + " HTTP/1.1"); xmlobj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlobj.onreadystatechange = function() { if (xmlobj.readyState != 4) return; xajaxrequestrunning = false; try { eval(xmlobj.responseText); } catch (e) { } try { if (tySearchWidget_default.callback!=null && (typeof tySearchWidget_default.callback['oncomplete'] == 'function' || typeof tySearchWidget_default.callback['oncomplete'] == 'object')) { tySearchWidget_default.callback['oncomplete'](tySearchWidget_default.config['loader_id']); } else { tySearchWidget_default.default_callback['oncomplete']; } } catch (e) {} } xmlobj.send( post ); } return xmlobj; }, onLoadStart : function() { if (tySearchWidget_default.config['loader_id']!=null) { var elem = document.getElementById(tySearchWidget_default.config['loader_id']); if (elem) elem.style.display = ''; } }, onLoadComplete : function() { if (tySearchWidget_default.config['loader_id']!=null) { var elem = document.getElementById(tySearchWidget_default.config['loader_id']); if (elem) elem.style.display = 'none'; } } } tySearchWidget_default.default_callback = { 'onload': tySearchWidget_default.onLoadStart, 'oncomplete': tySearchWidget_default.onLoadComplete };