var timedNaseptavac_C;
function timedNaseptavac(id_naseptavac,id_obsah,id_input) {
clearTimeout(timedNaseptavac_C);
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", 'https://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 xmlpolozky = httpRequest.responseXML.getElementsByTagName('xmlpolozky');
var polozky1 = httpRequest.responseXML.getElementsByTagName('polozka1');
var polozky2 = httpRequest.responseXML.getElementsByTagName('polozka2');
var polozky3 = httpRequest.responseXML.getElementsByTagName('polozka3');
document.getElementById(id_obsah).innerHTML = '';
if (xmlpolozky.length > 0)
{
if (polozky1.length > 0)
{
document.getElementById(id_obsah).innerHTML += 'Alba / produkty';
for (var i=0; i < polozky1.length; i++)
{
nazevpolozky=polozky1[i].firstChild.data;
//nazevpolozky = nazevpolozky.replace('###BOLDSTART###', '');
//nazevpolozky = nazevpolozky.replace('###BOLDEND###', '');
//nazevpolozky = nazevpolozky.replace('###BR###', '
');
document.getElementById(id_obsah).innerHTML += ''+(nazevpolozky)+'
'+polozky1[i].getAttribute('cesta')+'';
document.getElementById(id_obsah).innerHTML += '
';
}
}
if (polozky2.length > 0)
{
document.getElementById(id_obsah).innerHTML += 'Interpret / osobnost / autor';
for (var i=0; i < polozky2.length; i++)
{
nazevpolozky=polozky2[i].firstChild.data;
//nazevpolozky = nazevpolozky.replace('###BOLDSTART###', '');
//nazevpolozky = nazevpolozky.replace('###BOLDEND###', '');
//nazevpolozky = nazevpolozky.replace('###BR###', '
');
document.getElementById(id_obsah).innerHTML += ''+(nazevpolozky)+'';
document.getElementById(id_obsah).innerHTML += '';
}
}
if (polozky3.length > 0)
{
document.getElementById(id_obsah).innerHTML += 'Skladby';
for (var i=0; i < polozky3.length; i++)
{
nazevpolozky=polozky3[i].firstChild.data;
//nazevpolozky = nazevpolozky.replace('###BOLDSTART###', '');
//nazevpolozky = nazevpolozky.replace('###BOLDEND###', '');
//nazevpolozky = nazevpolozky.replace('###BR###', '
');
document.getElementById(id_obsah).innerHTML += ''+(nazevpolozky)+'';
document.getElementById(id_obsah).innerHTML += '';
}
}
$('img').error(function()
{
$(this).attr('src', 'https://www.bontonland.cz/layout/noimage.png');
});
if ((polozky1.length > 0) || (polozky2.length > 0) || (polozky3.length > 0))
{
document.getElementById(id_naseptavac).style.display = 'block';
}
else
{
document.getElementById(id_naseptavac).style.display = 'none';
}
} 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) {
data = data.replace('###BOLDSTART###', '');
data = data.replace('###BOLDEND###', '');
data = data.replace('###BR###', ': ');
text.value = data;
mistoZobrazeni.style.display = 'none';
document.getElementById('searchform').submit();
}
}
function getSlider(id) {
if (window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
} else {
httpRequest = new XMLHttpRequest();
}
httpRequest.open("GET", 'https://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
});
}