var timedNaseptavac_C; function timedNaseptavac(id_naseptavac,id_obsah,id_input) { timedNaseptavac_C = setTimeout("naseptavac('"+id_naseptavac+"','"+id_obsah+"','"+id_input+"');",500); } function addslashes(str) { str = str.split("'").join("\\'"); return str; } function naseptavac(id_naseptavac,id_obsah,id_input) { if (window.ActiveXObject) { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } else { httpRequest = new XMLHttpRequest(); } text = document.getElementById(id_input).value; httpRequest.open("GET", 'http://www.bontonland.cz/ajax/naseptavac.php?text='+text, true); httpRequest.onreadystatechange= function () { if (httpRequest.readyState == 4) { if (httpRequest.status == 200) { var mistoZobrazeni = document.getElementById(id_obsah); var polozky = httpRequest.responseXML.getElementsByTagName('polozka'); document.getElementById(id_obsah).innerHTML = ''; if (polozky.length > 0) { for (var i=0; i < polozky.length; i++) { document.getElementById(id_obsah).innerHTML += ''+polozky[i].getAttribute('skladem')+''+(polozky[i].firstChild.data)+''; } document.getElementById(id_naseptavac).style.display = 'block'; } else { document.getElementById(id_naseptavac).style.display = 'none'; } } } }; httpRequest.send(null); } function insertData(nas,inp,data) { var text = document.getElementById(inp); var mistoZobrazeni = document.getElementById(nas); if (text) { text.value = data; mistoZobrazeni.style.display = 'none'; form1s.submit(); } } function getSlider(id) { if (window.ActiveXObject) { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } else { httpRequest = new XMLHttpRequest(); } httpRequest.open("GET", 'http://www.bontonland.cz/ajax/get_slider.php?id='+id, true); httpRequest.onreadystatechange= function () { if (httpRequest.readyState == 4) { if (httpRequest.status == 200) { init_slider(httpRequest.responseText); } } }; httpRequest.send(null); } function init_slider(text) { var a1 = new Array(); a1 = text.split("\n"); function mycarousel_initCallback(carousel) { jQuery('.slider-control a').bind('click', function() { carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text())); return false; }); carousel.remove(1); carousel.clip.hover(function() { carousel.stopAuto(); }, function() { carousel.startAuto(); }); carousel.scroll(1); }; function itemLoadCallbackFunction(carousel, state) { for (var i = carousel.first; i <= carousel.last; i++) { // Check if the item already exists if (!carousel.has(i)) { // Add the item carousel.add(i, a1[i-1]); } } }; function itemChangeFce(carousel, state) { for (var i = carousel.first; i <= carousel.last; i++) { // Check if the item already exists if (!carousel.has(i)) { // Add the item carousel.add(i, a1[i-1]); } } }; function highlight(carousel, obejctli,liindex,listate){ jQuery('.slider-control a:nth-child('+ liindex +')').attr("class","selected"); }; function removehighlight(carousel, obejctli,liindex,listate){ jQuery('.slider-control a:nth-child('+ liindex +')').removeAttr("class","selected"); }; jQuery("#M_slider").jcarousel({ scroll: 1, start:1, offset:1, auto: 6, wrap: 'last', initCallback: mycarousel_initCallback, itemLoadCallback: {onBeforeAnimation: itemLoadCallbackFunction}, itemVisibleInCallback: highlight, itemVisibleOutCallback: removehighlight, buttonNextHTML: null, size: slider_size, buttonPrevHTML: null }); }