/*----------------------------Suggest Code-------------------------*/ /* This is the JavaScript file for the osCommerce AJAX Search Suggest You may use this code in your own projects as long as this copyright is left in place. All code is provided AS-IS. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For the rest of this code visit http://www.osCommerce-SSL.com For a complete detailed tutorial on how this code works visit: http://www.dynamicajax.com/fr/AJAX_Suggest_Tutorial-271_290_312.html For more AJAX code and tutorials visit http://www.DynamicAJAX.com Copyright 2006 Ryan Smith / 345 Technical / 345 Group. */ //jQUERY pro zmizeni divu naseptavace /*jQuery(document).ready(function() { // Fade out the suggestions box when not active jQuery("#txtSearch").blur(function(){ jQuery('#top-naseptavac').slideUp("fast"); }); });*/ //Gets the browser specific XmlHttpRequest Object function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your Browser Sucks!\nIt's about time to upgrade don't you think?"); } } //Our XmlHttpRequest object to get the auto suggest var searchReq = getXmlHttpRequestObject(); function HideSearch(prvek){ if (prvek.value == '') prvek.value = 'Vyhledávání'; setTimeout(function(){HideUni('top-naseptavac');}, 100); } function pause(millis){ var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < millis) } //Called from keyup on the search textbox. //Starts the AJAX request. function searchSuggest() { //jQuery('#top-naseptavac').slideDown("fast"); ShowUni('top-naseptavac'); //doplneni jinak nevalidniho autocomplete off var inputPrvek = document.getElementById('txtSearch'); if(inputPrvek){ inputPrvek.autocomplete = "off"; } if (searchReq.readyState == 4 || searchReq.readyState == 0) { var str = escape(document.getElementById('txtSearch').value); searchReq.open("GET", '/ajax/ajax_naseptavac.php?keyword=' + str, true); searchReq.onreadystatechange = handleSearchSuggest; searchReq.send(null); } } //Called when the AJAX response is returned. function handleSearchSuggest() { if (searchReq.readyState == 4) { var ss = document.getElementById('top-naseptavac') ss.innerHTML = ''; var str = searchReq.responseText.split("\n"); /* //Knobli deleted for(i=0; i < str.length - 1; i++) { //Build our element string. This is cleaner using the DOM, but //IE doesn't support dynamically added attributes. var suggest = '