var param_data2=[];function changeFilter(select,filtered){var value=select.options[select.selectedIndex].value;var location=document.location+"";location=location.split("/");location.pop();if(filtered){location.pop();} var filters=value.split("-");var none=true;for(var i in filters){var f_val=parseInt(filters[i]);if(f_val>0){none=false;break;}} if(!none){location.push(value);} document.location=location.join("/")+"/";} function initParams(){var select=document.getElementById('param_0');if(select!=null){var s=new CustomSelect(select,145);} var js_data=document.getElementById('param_data');if(js_data!=null){param_data2=eval("("+js_data.firstChild.data+")");changeParam();} var btn=document.getElementById('add_button');if(btn!=null){btn=new CustomButton(btn);}} function changeParam(){var i=0;var select=document.getElementById('param_'+i);var id="000";var ids=null;while(select!=null){var key=select.name;var value=select.options[select.selectedIndex].value;if(ids==null){ids=[];for(var x in param_data[key][value]["id"]){ids[x]=param_data[key][value]["id"][x];}}else{value=newOptions(select,value,ids);ids=filterIdArray(ids,key,value);} i++;select=document.getElementById('param_'+i);} if(ids!=null&&ids.length>0){id=ids.pop();} if(typeof(param_data2[id])!="undefined"){var param=param_data2[id];var pr1=document.getElementById('price1');if(param[1]>0){pr1.style.visibility="";setRowValue(pr1,param[0]+" Kč");}else{pr1.style.visibility="hidden";} var pr2=document.getElementById('price2');if(param[1]>0){pr2.style.visibility="";setRowValue(pr2,param[1]+" %");}else{pr2.style.visibility="hidden";} var pr3=document.getElementById('price3');setRowValue(pr3,param[2]+" Kč");loadImage(param[3]);} var p_id=document.getElementById('param_id');if(p_id!=null){p_id.value=id;}} function filterIdArray(ids,key,value){var tmp=[];for(var i2 in ids){for(var i3 in param_data[key][value]["id"]){if(param_data[key][value]["id"][i3]==ids[i2]){tmp.push(ids[i2]);}}} return tmp;} function newOptions(select,original_value,ids){var index=0;select.options.length=0;var values=param_data[select.name];for(var key in values){var value=values[key];var added=false;for(var i in ids){for(var i2 in value["id"]){if(!added&&value["id"][i2]==ids[i]){if(original_value==key){index=select.options.length;} select.options[select.options.length]=new Option(value["nazev"],key);added=true;break;}} if(added){break;}}} select.selectedIndex=index;var nodes=select.parentNode.childNodes;for(var i=0;i0){document.getElementById("cart_sum").firstChild.data="za "+formatNumber(Math.round(data["sum"]))+" Kč";}else{document.getElementById("cart_sum").innerHTML=" ";} win.firstChild.data="Zboží bylo vloženo do košíku";setTimeout("closeMessageWin();",2000);reloadPageContent();} function loadImage(img){var nodes=getImageNodes();var orig_src=nodes[2].src.replace(document.location.protocol+"//"+document.location.host,"");var href="/_img/zbozi/"+img["id"]+"-full.jpg";var src="/_img/zbozi/"+img["id"]+".jpg";if(orig_src!=src){nodes[0].style.display="none";nodes[1].style.display="block";nodes[0].title=img["alt"];nodes[0].href=href;var new_img=new Image();new_img.alt=img["alt"];new_img.onload=function(){setImage(this);};new_img.src=src;} var images=document.getElementById('images');if(images!=null){for(var i=0;i=max_scroll){clearInterval(scroll_interval);scroll_interval=null;value=max_scroll;} scroller.scrollLeft=value;}