//alert (pneu);
function send_httprequest(obsluha, method, url, content) {
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (error) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
xmlhttp.onreadystatechange = function() { obsluha(xmlhttp); };
xmlhttp.open(method, url, true);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send(content);
return true;
}
function isRequestOk(xmlhttp) {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
return true;
} else {
return false;
}
}
function initMenu() {
$('#menu ul').hide();
/* $('#menu li a').removeAttr('href');
$('#menu li a').dblclick(
function() {
$(this).next().slideToggle();
}
);*/
}
post_reakce = function(id) {
$('#fp_parent').val(id);
if(id!=0) { $('#fp_subjekt').val("re: "+$('#li-'+id).html()); } else { $('#fp_subjekt').val(""); }
$('#diskuze_form').show();
$('#fp_jmeno').focus();
}
send_post = function(kod) {
var jmeno = $('#fp_jmeno').val();
var email = $('#fp_email').val();
var subjekt = $('#fp_subjekt').val();
var telo = $('#fp_telo').val();
var kod = $('#fp_kod').val();
var parent = $('#fp_parent').val();
$.ajax({
type: "POST",
url: "/scripts/ajax/ajax.zboziKoment.php",
cache: false,
data: "f_jmeno="+jmeno+"&f_email="+email+"&f_subjekt="+subjekt+"&f_telo="+telo+"&f_kod="+kod+"&f_parent="+parent,
dataType: "text",
beforeSend: function(){
// alert("Loading");
},
success: function(return_data){
var json_data = JSON.parse(return_data);
if (json_data.status==1) {
$('#fp_jmeno').val("");
$('#fp_email').val("");
$('#fp_subjekt').val("");
$('#fp_telo').val("");
$('#fp_parent').val("0");
$('#commentinfo').html("
Váš příspěvek byl vložen začne se zobrazovat po schválení administrátorem.
");
$('#diskuze_form').hide();
} else {
$('#commentinfo').html("Při vkládání příspěvku se vyskytla nečekaná chyba.
");
}
}
});
}
$('.diskuze_close').click(function(){ $('#diskuze_form').hide();});
$(document).ready(function(){
initMenu();
$(".megamenuHorizontal").dcMegaMenu({
rowItems: '3',
speed: 'fast',
effect: 'fade'
});
$("option [value!='']").css({"font-weight":"bold"});
$(window).hashchange( function(){
var hash = window.location.hash;
var pgnumber = hash.replace("#", "");
if (pgnumber=="") pgnumber=903;
pgnumber =parseInt(pgnumber);
if (pgnumber==0) pgnumber=1;
$.post("/scripts/ajax/ajax.nactiZbozi.php?page="+pgnumber,
function(data){
if (data != "") {
$("#items_container_body").html(data);
$("html, body").animate({scrollTop:$("#topmenu").position().top}, "fast");
}
});
$('.ajaxpaging').removeClass('paging_sel');
$('#go_to_page_'+pgnumber).addClass('paging_sel');
})
var aktualni_strana=1;
var hash = window.location.hash;
var pgnumber = hash.replace("#", "");
if (pgnumber=="") pgnumber=903;
pgnumber =parseInt(pgnumber);
if (pgnumber==0) pgnumber=1;
$('.ajaxpaging').removeClass('paging_sel');
$('#go_to_page_'+pgnumber).addClass('paging_sel');
$('.ajaxpaging').removeClass('paging_sel');
$('#go_to_page_'+pgnumber ).addClass('paging_sel');
$.post("/scripts/ajax/ajax.nactiZbozi.php?page="+pgnumber,
function(data){
if (data != "") {
$("#items_container_body").html(data);
}
});
$("#kosikblok").fancybox({
'hideOnContentClick': true,
'padding':0,
helpers: {
title: null
}
});
$('._blank').click(function() {
return !window.open(this.href);
});
var srovnaniOpen=0;
var basketOpen=0;
var lbOpen=0;
var basketChangeStatus=1;
var pocet_ke_srovnani =0;
$(".validate").validationEngine();
$("._fancy").fancybox({'titleShow' : true,'transitionIn' : 'elastic','transitionOut' : 'elastic'});
$(".btn-loginbox").click(function(){
if (lbOpen==0) {
$("#loginbox").animate({marginTop: "+=150px"}, 'slow');
lbOpen=1;
} else {
$("#loginbox").animate({marginTop: "-=150px"}, 'slow');
lbOpen=0;
}
});
$("#biname").mouseover(function(){
$("#kosik_nahled").fadeIn('fast');
if (basketChangeStatus==1) {nacti_ax_basket();basketChangeStatus=0;}
});
$("#biname").mouseout(function(){
$("#kosik_nahled").fadeOut('fast');
});
$('body').click(function(event){
if ( ! $(event.target).closest('#kosik_nahled').length ) {
$("#kosik_nahled").fadeOut('fast');
}
});
$(".ocb").click(function(){
$("#kosik_nahled").fadeOut('fast');
});
$("#jq2").scrollable({circular: false, mousewheel: true});
$("#jq1").scrollable({ circular: false, mousewheel: false });
$("#btn_srovnani").click(function(){
if (srovnaniOpen==0) {
nacti_ax_srovnavac();
$('#srovnavac_cointainer').css({height: 54}).animate({ height: '315' }, 'slow');
$('#btn_srovnani').html('Skrýt');
srovnaniOpen=1;
} else {
if (pocet_ke_srovnani>0) {
$('#srovnavac_cointainer').css({height: 315}).animate({ height: '54' }, 'slow');
$('#btn_srovnani').html('Zobrazit');
} else {
$('#srovnavac_cointainer').css({height: 315}).animate({ height: '0' }, 'slow');
}
srovnaniOpen=0;
}
});
nacti_ax_basket = function() {
$.ajax({
type: "POST",
url: "/scripts/ajax/ajax.getBasket.php",
cache: false,
//data: "kod="+kod+"&pocet="+pocet,
dataType: "text",
beforeSend: function(){
// alert("Loading");
},
success: function(return_data){
var json_data = JSON.parse(return_data);
var rows;
$("#ax_basket > tbody").empty();
$('#ax_basket > tbody').append('Název Počet ks Cena/ks ');
for (rows in json_data) {
if (rows!='system') {
var pocet = json_data[rows]['pocet'];
var cena = format_number('sk',json_data[rows]['cena']);
//var nazev = json_data[rows]['vyrobce']+" "+json_data[rows]['model'];
var nazev = json_data[rows]['nazev'];
$('#ax_basket > tbody').append(''+nazev+' '+pocet+'ks '+cena+' ');
}
}
var celkem_s_dani=json_data['system']['price_with_vat'];
var celkem_bez_dani=json_data['system']['price_no_vat'];
var pocet_polozek=json_data['system']['count_items'];
$('#ax_basket > tbody').append('Celkem '+pocet_polozek+'ks '+format_number('sk',celkem_s_dani)+' ');
}
});
}
srovnavac_remove = function(kod) {
$.ajax({
type: "POST",
url: "/scripts/ajax/ajax.removeSrovnavac.php",
cache: false,
data: "kod="+kod,
dataType: "text",
beforeSend: function(){
// alert("Loading");
},
success: function(return_data){
var json_data = JSON.parse(return_data);
var rows;
$("#sr_"+kod).remove();
if (json_data.status==1) {
$("#srovnavac_pocet").html(json_data.count_items+" ks");
pocet_ke_srovnani=json_data.count_items;
}
}
});
}
nacti_ax_srovnavac = function() {
$.ajax({
type: "POST",
url: "/scripts/ajax/ajax.getSrovnavac.php",
cache: false,
dataType: "text",
beforeSend: function(){
// alert("Loading");
},
success: function(return_data){
var json_data = JSON.parse(return_data);
var rows;
var itmp=1;
$("#srovnavac_items_holder").empty();
for (rows in json_data) {
if (rows!='system') {
var foto = json_data[rows]['foto'];
var cena = format_number('sk',json_data[rows]['cena']);
var kod = json_data[rows]['kod'];
var link = json_data[rows]['link'];
// var nazev = json_data[rows]['vyrobce']+" "+json_data[rows]['model'];
var nazev = json_data[rows]['nazev'];
foto_file = "/rimg/118x118/"+foto;
if (foto=="") foto_file = "/styl/nophoto2.png";
var sclass='srovnavac_items';
if (itmp==pocet_ke_srovnani) {sclass='srovnavac_items_last'; }
$('#srovnavac_items_holder').append(' ');
itmp++;
}
}
}
});
}
add_to_basket = function(kod,typ_ceny, info) {
input_id='#pocet_'+kod;
var pocet = $(input_id).val();
ofset = $(input_id).offset();
zhora = ofset.top;
zleva = ofset.left;
$.ajax({
type: "POST",
url: "/scripts/ajax/ajax.addToBasket.php",
cache: false,
data: "kod="+kod+"&pocet="+pocet+"&typ="+typ_ceny+"&info="+info,
dataType: "text",
beforeSend: function(){
// alert("Loading");
},
success: function(return_data){
var json_data = JSON.parse(return_data);
if (json_data.status==1) {
$("#basketinfo_ks").html(json_data.count_items);
$("#basketinfo_cena").html(format_number('sk',json_data.price_with_vat));
$("#kosik_info_ks").html(json_data.count_items);
$("#kosik_info_cena").html(format_number('sk',json_data.price_with_vat));
}
}
});
nacti_ax_basket();
basketChangeStatus=0;
zleva = ($(window).width()/2);
$('#kosik-info').removeClass("nodisp");
$('#kosik-info').offset({ top: zhora-100, left: zleva- 275 });
}
$("#fulltextsrch").autocomplete("/scripts/ajax/ajax.fulltext.php", {
width: 320,
max: 100,
highlight: false,
scroll: true,
scrollHeight: 300,
selectFirst:false,
width: 337,
left: -20,
formatItem: function(data, i, n, value) {
var json_data = JSON.parse(value);
return ""+json_data[0]['vyrobce']+" "+ json_data[0]['model'] +" "+json_data[0]['rozmer']+" ";
},
formatResult: function(data, value) {
var json_data = JSON.parse(value);
return json_data[0]['rozmer'] + " "+ json_data[0]['vyrobce']+" "+json_data[0]['model'];
//return json_data[0]['nazev'];
}
});
$('#fulltextsrch').focus(function(){if ($('#fulltextsrch').val()=='Hledej...') $('#fulltextsrch').val("");});
$('#fulltextsrch').blur(function(){if ($('#fulltextsrch').val()=='') $('#fulltextsrch').val("Hledej...");});
$('#zp_email').focus(function(){if ($('#zp_email').val()=='Váš@email') $('#zp_email').val("");});
$('#zp_email').blur(function(){if ($('#zp_email').val()=='') $('#zp_email').val("Váš@email");});
});
function number_format (number, decimals, dec_point, thousands_sep) {
decimals=0;
number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
var n = !isFinite(+number) ? 0 : +number,
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
s = '',
toFixedFix = function (n, prec) {
var k = Math.pow(10, prec); return '' + Math.round(n * k) / k;
};
// Fix for IE parseFloat(0.55).toFixed(0) = 0;
s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
}
if ((s[1] || '').length < prec) {
s[1] = s[1] || '';
s[1] += new Array(prec - s[1].length + 1).join('0'); }
return s.join(dec);
}
function format_number(country,number) {
return '€ '+ number;
}
set_sort = function (type) {
$('#f_sort_type').val(type);
$('#f_sort_set').submit();
}
posun_strankovani = function (pocet_stran,aktualni_strana,posun) {
$('.paging').addClass('nodisp');
for(i=1; i <= pocet_stran; i++) {
if((i-posun< aktualni_strana) && (i+posun>aktualni_strana)) {$('#go_to_page_'+i).removeClass('nodisp'); }
if((aktualni_strana-posun<1) && (i<=(posun*2)-1)) {$('#go_to_page_'+i).removeClass('nodisp'); }
if((i+(posun*2-1)>pocet_stran) && (aktualni_strana*1+posun*1)>pocet_stran) {$('#go_to_page_'+i).removeClass('nodisp'); }
if (aktualni_strana>posun && pocet_stran>(posun*2-1)) {$('#paging_first').removeClass('nodisp');$('#paging_first_txt').removeClass('nodisp'); } else {$('#paging_first').addClass('nodisp');$('#paging_first_txt').addClass('nodisp'); }
if (aktualni_strana<=pocet_stran-posun) {$('#paging_last').removeClass('nodisp'); $('#paging_last_txt').removeClass('nodisp'); } else {$('#paging_last').addClass('nodisp'); $('#paging_last_txt').addClass('nodisp'); }
}
return false;
}
$.fn.flyto = function(obj,callback) {
var $cloneImg = $(this).clone();
basketOffset = $(obj).offset();
var basketY = basketOffset.top,
basketX = basketOffset.left,
imgY = $(this).offset().top,
imgX = $(this).offset().left;
var gotoX = basketX - imgX;
gotoY = basketY - imgY,
newImageWidth = $(this).width() / 3,
newImageHeight = $(this).height() / 3;
$cloneImg.addClass('fly_elem')
.prependTo($(this).parent())
.animate({opacity: 0.4}, 100 )
.animate({opacity: 0.1, marginLeft: gotoX, marginTop: gotoY, width: newImageWidth, height: newImageHeight}, 800, function() {
$(this).remove();
});
if(callback)
setTimeout(callback, 800);
return $(this);
};
function __getDdlKey(e)
{
var code;
if (!e)
var e = window.event;
if (e.keyCode)
code = e.keyCode;
else
if (e.which)
code = e.which;
return code;
}
var lastValue = '';
function __searchDdlReset()
{
lastValue = '';
//window.status = 'Najít:';
}
function __searchDdlList(eventObj,slcObj)
{
if (navigator.userAgent.indexOf('MSIE') > -1 || navigator.userAgent.indexOf('Opera') > -1)
{
var lastKey = __getDdlKey(eventObj);
if (lastKey == 8 && lastValue.length > 1)
lastValue = lastValue.substring(0,lastValue.length-1);
else
lastValue += String.fromCharCode(lastKey);
//window.status = 'Najít: ' + lastValue;
for (i=0; i exits
if ((thePointerColor == '' && theMarkColor == '')
|| typeof(theRow.style) == 'undefined') {
return false;
}
// 2. Gets the current row and exits if the browser can't get it
if (typeof(document.getElementsByTagName) != 'undefined') {
theCells = theRow.getElementsByTagName('td');
}
else if (typeof(theRow.cells) != 'undefined') {
theCells = theRow.cells;
}
else {
return false;
}
// 3. Gets the current color...
var rowCellsCnt = theCells.length;
var domDetect = null;
var currentColor = null;
var newColor = null;
// 3.1 ... with DOM compatible browsers except Opera that does not return
// valid values with "getAttribute"
currentColor = theCells[0].style.backgroundColor;
//alert(currentColor);
//currentColor = theCells[0].getAttribute('bgcolor');
// 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
if (currentColor.indexOf("rgb") >= 0)
{
var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
currentColor.indexOf(')'));
var rgbValues = rgbStr.split(",");
currentColor = "#";
var hexChars = "0123456789ABCDEF";
for (var i = 0; i < 3; i++)
{
var v = rgbValues[i].valueOf();
currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
}
}
// 4. Defines the new color
// 4.1 Current color is the default one
if (currentColor == ''
|| currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
if (theAction == 'over' && thePointerColor != '') {
newColor = thePointerColor;
textColor = '#000000';
}
else if (theAction == 'click' && theMarkColor != '') {
newColor = theMarkColor;
textColor = '#ffffff';
marked_row[theRowNum] = true;
// Garvin: deactivated onclick marking of the checkbox because it's also executed
// when an action (like edit/delete) on a single item is performed. Then the checkbox
// would get deactived, even though we need it activated. Maybe there is a way
// to detect if the row was clicked, and not an item therein...
// document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
}
}
// 4.1.2 Current color is the pointer one
else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
&& (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
if (theAction == 'out') {
newColor = theDefaultColor;
textColor = '#000000';
}
else if (theAction == 'click' && theMarkColor != '') {
newColor = theMarkColor;
textColor = '#ffffff';
marked_row[theRowNum] = true;
// document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
}
}
// 4.1.3 Current color is the marker one
else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
if (theAction == 'click') {
newColor = (thePointerColor != '')
? thePointerColor
: theDefaultColor;
marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
? true
: null;
// document.getElementById('id_rows_to_delete' + theRowNum).checked = false;
}
} // end 4
// 5. Sets the new color...
if (newColor) {
//alert (textColor);
var c = null;
// 5.1 ... with DOM compatible browsers except Opera
if (domDetect) {
for (c = 0; c < rowCellsCnt; c++) {
theCells[c].setAttribute('bgcolor', newColor, 0);
//theCells[c].style.color=textColor;
} // end for
}
// 5.2 ... with other browsers
else {
for (c = 0; c < rowCellsCnt; c++) {
theCells[c].style.backgroundColor = newColor;
//theCells[c].style.textColor = textColor;
//theCells[c].style.color=textColor;
}
}
} // end 5
return true;
} // end of the 'setPointer()' function
function showThumbExt(img)
{
if (img!='') {
obj_pop = $('#thumbholder');
ico = " ";
//alert(ico);
obj_pop.innerHTML = ico;
obj_pop.offset.top = (getScrollY()+200)+"px";
obj_pop.offset.left = (((screen.width)/2))+"px";
obj_pop.show();
}
}
function hideIconExt()
{
obj_pop = $('#thumbholder');
//obj_pop.hide();
//document.onmousemove = null;
}
function getScrollY() {
/*
var scrOfY = 0;
if( typeof( window.pageYOffset ) == 'number' ) {
//Netscape compliant
scrOfY = window.pageYOffset;
} else if( document.body && (document.body.scrollTop ) ) {
//DOM compliant
scrOfY = document.body.scrollTop;
} else if( document.documentElement && (document.documentElement.scrollTop ) ) {
//IE6 standards compliant mode
scrOfY = document.documentElement.scrollTop;
}
return scrOfY ;
*/
}
$(".akceflag").mouseover(function() {
$(".akceflag").animate({ opacity: 0.1 });
});
$(".akceflag").mouseout(function() {
$(".akceflag").animate({ opacity: 1 });
});
confirm_it = function(kod, ks, end=0) {
var textace1= "Tovar, ktorý vkladáte do košíka, nie je skladom. Overte jeho dostupnosť a približný termín dodania telefonicky na +420 604 750 150 alebo e-mailom na info@rajpneu.sk pred jeho objednaním.";
var textace2= "Do košíka vkladáte väčšie množstvo tovaru, než máme na sklade. Overte jeho dostupnosť a približný termín dodania telefonicky na +420 604750150 alebo e-mailom na info@rajpneu.sk pred jeho objednaním. ";
pocetdokose = $('#pocet_'+kod).val();
if (pocetdokose>ks) textace_pis=textace2;
if (ks ==0 ) textace_pis=textace1;
if (ks>=pocetdokose) {
out = true;
} else {
if (end==0) {
out = confirm(textace_pis);
} else {
alert ("Do košíka nie je možné vložiť viac ks tovaru s ukončenou výrobou ako je na sklade. Vložte maximálne"+ks+"ks.");
out = false;
}
}
return out;
}
function resetSrch () {
var sirka = $('#f_sirka').val();
var profil = $('#f_profil').val();
var rafek = $('#f_rafek').val();
var kategorie = $('#f_kategorie').val();
var typ = $('#f_typ').val();
var vyrobce = $('#f_vyrobce').val();
var dezen = $('#f_dezen').val();
$('#rozmerProfiValue').val('');
document.cookie = "s=";
document.cookie = "p=";
document.cookie = "r=";
var request="reset=1";
$.ajax({
type: "POST",
url: "/scripts/ajax/ajax.ctgHpPneu.php",
cache: false,
data: request,
dataType: "xml",
beforeSend: function(){
// alert("Loading");
},
success: function(return_data){
var stateXml = return_data;
var sirkaXml = stateXml.getElementsByTagName("sirka");
var profilXml = stateXml.getElementsByTagName("profil");
var rafekXml = stateXml.getElementsByTagName("rafek");
var kategorieXml = stateXml.getElementsByTagName("kategorie");
var typXml = stateXml.getElementsByTagName("typ");
var vyrobceXml = stateXml.getElementsByTagName("vyrobce");
var dezenXml = stateXml.getElementsByTagName("dezen");
var sirka = $('#f_sirka').val();
var profil = $('#f_profil').val();
var rafek = $('#f_rafek').val();
var kategorie = $('#f_kategorie').val();
var typ = $('#f_typ').val();
var vyrobce = $('#f_vyrobce').val();
var dezen = $('#f_dezen').val();
fillSelect("sirka",sirkaXml,sirka,'-- VŠETKO --','');
fillSelect("profil",profilXml,profil,'-- VŠETKO --','');
fillSelect("rafek",rafekXml,rafek,'-- VŠETKO --','');
fillSelect("kategorie",kategorieXml,kategorie,'-- VŠETKO --','');
fillSelect("typ",typXml,typ,'-- VŠETKO --','');
fillSelect("vyrobce",vyrobceXml,vyrobce,'-- VŠETKO --','');
$("#f_dezen option").remove();
$("#f_dezen").append($('Zadej výrobca '));
$("#f_dezen").attr("disabled",true);
}
});
$('#f_sirka').val('');
$('#f_profil').val('');
$('#f_rafek').val('');
$('#f_kategorie').val('');
$('#f_typ').val('');
$('#f_vyrobce').val('');
$('#f_dezen').val('');
$('#f_li').val('');
$('#f_si').val('');
$('input[name*="f_min_skladem"]').val('0');
$('input[name*="f_akce"]').removeAttr('checked');
$('input[name*="f_nejzadanejsi"]').removeAttr('checked');
$('input[name*="f_dojezd"]').removeAttr('checked');
$('input[name*="f_xl"]').removeAttr('checked');
$('input[name*="f_nvo"]').removeAttr('checked');
$('input[name*="f_novinka"]').removeAttr('checked');
}
function renewPneuSrch () {
var sirka = $('#f_sirka').val();
var profil = $('#f_profil').val();
var rafek = $('#f_rafek').val();
var kategorie = $('#f_kategorie').val();
var typ = $('#f_typ').val();
var vyrobce = $('#f_vyrobce').val();
var dezen = $('#f_dezen').val();
//alert(sirka+" "+profil);
document.cookie = "s="+sirka;
document.cookie = "p="+profil;
document.cookie = "r="+rafek;
var request="sirka="+sirka+"&profil="+profil+"&rafek="+rafek+"&kategorie="+kategorie+"&typ="+typ+"&vyrobce="+vyrobce;
$.ajax({
type: "POST",
url: "/scripts/ajax/ajax.ctgHpPneu.php",
cache: false,
data: request,
dataType: "xml",
beforeSend: function(){
// alert("Loading");
},
success: function(return_data){
var stateXml = return_data;
var sirkaXml = stateXml.getElementsByTagName("sirka");
var profilXml = stateXml.getElementsByTagName("profil");
var rafekXml = stateXml.getElementsByTagName("rafek");
var kategorieXml = stateXml.getElementsByTagName("kategorie");
var typXml = stateXml.getElementsByTagName("typ");
var vyrobceXml = stateXml.getElementsByTagName("vyrobce");
var dezenXml = stateXml.getElementsByTagName("dezen");
var sirka = $('#f_sirka').val();
var profil = $('#f_profil').val();
var rafek = $('#f_rafek').val();
var kategorie = $('#f_kategorie').val();
var typ = $('#f_typ').val();
var vyrobce = $('#f_vyrobce').val();
var dezen = $('#f_dezen').val();
fillSelect("sirka",sirkaXml,sirka,'-- VŠETKO --','');
fillSelect("profil",profilXml,profil,'-- VŠETKO --','');
fillSelect("rafek",rafekXml,rafek,'-- VŠETKO --','');
fillSelect("kategorie",kategorieXml,kategorie,'-- VŠETKO --','');
fillSelect("typ",typXml,typ,'-- VŠETKO --','');
fillSelect("vyrobce",vyrobceXml,vyrobce,'-- VŠETKO --','');
if (dezenXml.length>0) {
fillSelect("dezen",dezenXml,dezen,'-- VŠETKO --','');
$("#f_dezen").disabled=false;
$("#f_dezen").removeAttr("disabled");
} else {
$("#f_dezen option").remove();
$("#f_dezen").append($('Zadej výrobca '));
$("#f_dezen").attr("disabled",true);
}
}
});
}
function renewPneuSrch2 () {
var kategorie = $('#f_kategorie').val();
var typ = $('#f_typ').val();
var vyrobce = $('#f_vyrobce').val();
var dezen = $('#f_dezen').val();
//alert(sirka+" "+profil);
var request="kategorie="+kategorie+"&typ="+typ+"&vyrobce="+vyrobce;
$.ajax({
type: "POST",
url: "/scripts/ajax/ajax.ctgHpPneu.php",
cache: false,
data: request,
dataType: "xml",
beforeSend: function(){
// alert("Loading");
},
success: function(return_data){
var stateXml = return_data;
var kategorieXml = stateXml.getElementsByTagName("kategorie");
var typXml = stateXml.getElementsByTagName("typ");
var vyrobceXml = stateXml.getElementsByTagName("vyrobce");
var dezenXml = stateXml.getElementsByTagName("dezen");
var kategorie = $('#f_kategorie').val();
var typ = $('#f_typ').val();
var vyrobce = $('#f_vyrobce').val();
var dezen = $('#f_dezen').val();
fillSelect("kategorie",kategorieXml,kategorie,'-- VŠETKO --','');
fillSelect("typ",typXml,typ,'-- VŠETKO --','');
fillSelect("vyrobce",vyrobceXml,vyrobce,'-- VŠETKO --','');
if (dezenXml.length>0) {
fillSelect("dezen",dezenXml,dezen,'-- VŠETKO --','');
$("#f_dezen").disabled=false;
$("#f_dezen").removeAttr("disabled");
} else {
$("#f_dezen option").remove();
$("#f_dezen").append($('Zadej výrobca '));
$("#f_dezen").attr("disabled",true);
}
}
});
}
renewPneuSrchWorker = function(xmlhttp) {
if (isRequestOk (xmlhttp)){
} else {
//alert ('pri hledani chyba');
}
}
function fillSelect(select,newData,selI,firstI,firstIValue) {
var objSdModel = $("#f_"+select);
objSdModel.children().remove();
if (firstI!='') {
objSdModel.append(''+firstI+' ') ;
}
for (i = 0; i'+newData[i].firstChild.data+'') ;
} else {
objSdModel.append(''+newData[i].firstChild.data+' ') ;
}
}
}
function hideIcon() {
obj_pop = $('#thumbholder');
obj_pop.hide();
}
function showThumb(img,dir)
{
obj_pop = $('#thumbholder');
//alert (getScrollY()+200);
y = getScrollY()+0;
x = (((screen.width)/2));
//alert (x);
ico = " ";
obj_pop.html(ico);
obj_pop.css('display', 'block');
obj_pop.css('top', y);
obj_pop.css('left', 320);
obj_pop.css('z-index', '99999999');
obj_pop.show();
}
function getScrollY() {
var scrOfY = 0;
if( typeof( window.pageYOffset ) == 'number' ) {
//Netscape compliant
scrOfY = window.pageYOffset;
} else if( document.body && (document.body.scrollTop ) ) {
//DOM compliant
scrOfY = document.body.scrollTop;
} else if( document.documentElement && (document.documentElement.scrollTop ) ) {
//IE6 standards compliant mode
scrOfY = document.documentElement.scrollTop;
}
return scrOfY ;
}