/* javascript by grafisoft.cz */ function JE_EMAIL(txt){var x = new RegExp('^[^@]+@([a-z,A-Z,0-9,_,-]+[.]{1})+[a-z,A-Z,0-9]{2,5}$'); if (x.exec(txt.toLowerCase())==null) return 0; else return 1;} function show(id) {if (document.getElementById(id).style.display=='none') document.getElementById(id).style.display='block'; else document.getElementById(id).style.display='none';} function showk(id,dir) {show('kategorie-'+id); if (document.getElementById('kimg'+id).src.indexOf('ts-r-plus.gif')>-1) document.getElementById('kimg'+id).src=dir+'/ts-r-minus.gif'; else document.getElementById('kimg'+id).src=dir+'/ts-r-plus.gif';} function scrollit() {document.getElementById('message').style.top=document.body.scrollTop + top + 'px';} function regnews() {if(JE_EMAIL(document.getElementById('enov').value)==0) {alert('pre registráciu noviniek musí byť e-mail zadaný v správnom formáte'); return false;} else {return true;}} function myParseFloat(str){str=''+str+''; var value=str.match('[-]{0,1}(?:[1-9]+[0-9]*[,.]{0,1}[0-9]*)|(?:0[,.][0-9]*)'); if(value!=null && value.length>0){value[0]=value[0].replace(',','.'); value=parseFloat(value[0])*1; return value;}else{return 0;}} // version = 2 var produktDetail={ data:{}, bind:{}, eventPodproduktChange:[], callPriceChange:[], imageArea:[], imageAreaVlastnost:[], skladADostupnost:[], kombinaceVlastnosti:null, selectedSvazanyParametrIndex:null, formatPrice:function(price){ var pocet=myParseFloat(this.data.pocetDesetinnychMist); if(pocet<0){ var orizni='1'; for(var i=0; i>pocet; i--){orizni+='0';} orizni=myParseFloat(orizni); return Math.round(price/orizni); }else{ return price.toFixed(pocet); } return price; }, setBind:function(data){ this.bind=data; if(this.bind.poradiKontroly==undefined || this.bind.poradiKontroly==null){ this.bind.poradiKontroly=['svazane']; // defaultne se kontroluji jenom svazane parametry } if(this.bind.pocetDesetinnychMist!==null && this.bind.pocetDesetinnychMist!==undefined){this.data.pocetDesetinnychMist=this.bind.pocetDesetinnychMist;} if(this.bind.nedostupnaKombinaceKod==null || this.bind.nedostupnaKombinaceKod==undefined) this.bind.nedostupnaKombinaceKod='-'; if(this.bind.nedostupnaSklad==null || this.bind.nedostupnaSklad==undefined) this.bind.nedostupnaSklad='-'; if(this.bind.nedostupnaDostupnost==null || this.bind.nedostupnaDostupnost==undefined) this.bind.nedostupnaDostupnost ='-'; if(this.bind.nedostupnaSkladADostupnost==null || this.bind.nedostupnaSkladADostupnost==undefined) this.bind.nedostupnaSkladADostupnost='-'; if(this.bind.vlasnostBezObrazkuMeniObrazekNaDefault==null) this.bind.vlasnostBezObrazkuMeniObrazekNaDefault=true; }, setData:function(data){ this.data=data; this.data.dph=(myParseFloat(this.data.dph)/100)+1; if(this.bind.pocetDesetinnychMist!=null && this.bind.pocetDesetinnychMist!=undefined){this.data.pocetDesetinnychMist=this.bind.pocetDesetinnychMist;} }, setImageArea:function(data){ this.imageArea[this.imageArea.length]=data; }, setImageAreaVlastnost:function(data){ this.imageAreaVlastnost[this.imageAreaVlastnost.length]=data; }, setKombinaceSkladADostupnost:function(data){ this.skladADostupnost[this.skladADostupnost.length]=data; }, changeParametrImage:function(){ for(var i=0; i0)?{"cenaBez":cenaVybranehoPodproduktuBez,"cenaS":cenaVybranehoPodproduktuBez*this.data.dph,ID:vybranyPodprodukt.id,key:vybranyPodprodukt.key}:null), "kombinaceVlastnosti":((this.data.volitelnyParametr.length>0)?{"cenaBez":kombinaceVlastnostiCenaBez,"cenaS":kombinaceVlastnostiCenaBez*this.data.dph}:null) }; for(var i=0; i0){ for(var i=0; i/g,'>'); escapedName=escapedName.replace(/0){ try{document.getElementById(this.bind.kosikNode).style.display='none';}catch(e){} try{ var errorHTML='Upozoroněnie
    '+error.join('')+'
'; document.getElementById(this.bind.errorNode).innerHTML=errorHTML; document.getElementById(this.bind.errorNode).style.display='block'; }catch(e){} }else{ try{document.getElementById(this.bind.errorNode).style.display='none';}catch(e){} try{document.getElementById(this.bind.kosikNode).style.display='block';}catch(e){} } } this.handleEvent('podproduktChange'); } } function zaokrouhleniEshopu(num){ var rad=1; for(var i=0; i'; } } } // produkt3 polystyren ------------------------------------------------------------------- var product3={ data:null, cenaVlastnosti:0, delka:0, pocetKusu:1, cenaZaKus:0, cenaCelkem:0, setData:function(data){ this.data=data; }, changeVlastnost:function(data){ this.cenaVlastnosti=0; var vlastnost=data.split('_'); for(var v=0; v'; } } } // produkt4 parapet ------------------------------------------------------------------- var product4={ data:null, cenaVlastnosti:0, delka:0, pocetKusu:1, cenaZaKus:0, cenaCelkem:0, setData:function(data){ this.data=data; if(this.data.cenaSDPH=='') this.data.cenaSDPH=0; else this.data.cenaSDPH=myParseFloat(this.data.cenaSDPH); if(this.data.maxdelka=='') this.data.maxdelka=0; else this.data.maxdelka=myParseFloat(this.data.maxdelka); if(this.data.cenakrytky=='') this.data.cenakrytky=0; else this.data.cenakrytky=myParseFloat(this.data.cenakrytky); }, changeVlastnost:function(data){ this.cenaVlastnosti=0; var vlastnost=data.split('_'); for(var v=0; vthis.data.maxdelka || this.delka<=0) error[error.length]='
  • Zle zadaný rozmer parametra
  • '; if(error.length==0){ this.cenaZaKus=zaokrouhleniEshopu(((this.data.cenaSDPH*1+this.cenaVlastnosti*1)*(this.delka*1))+(this.data.cenakrytky*1)); this.cenaCelkem=zaokrouhleniEshopu(this.cenaZaKus*this.pocetKusu); document.getElementById('product4button').style.display='block'; document.getElementById('product4chyby').style.display='none'; document.getElementById('id_produkt4cenaZaKus').innerHTML=this.cenaZaKus; document.getElementById('id_produkt4cenaCelkem').innerHTML=this.cenaCelkem; }else{ document.getElementById('id_produkt4cenaZaKus').innerHTML='-'; document.getElementById('id_produkt4cenaCelkem').innerHTML='-'; document.getElementById('product4button').style.display='none'; document.getElementById('product4chyby').style.display='block'; document.getElementById('product4chybyHTML').innerHTML='

    Vaša objednávka obsahuje chybné údaje:

      '+error.join('')+'
    '; //alert(error); } } } // produkt5 polykarbonat ------------------------------------------------------------------- var product5={ data:null, sirka:0, delka:0, rozmer:0, pocetKusu:1, cenaZaKus:0, cenaCelkem:0, setData:function(data){ this.data=data; if(this.data.cenaZaMetrSDPH=='') this.data.cenaZaMetrSDPH=0; else this.data.cenaZaMetrSDPH=myParseFloat(this.data.cenaZaMetrSDPH); if(this.data.maxSirka=='') this.data.maxSirka=0; else this.data.maxSirka=myParseFloat(this.data.maxSirka); if(this.data.maxDelka=='') this.data.maxDelka=0; else this.data.maxDelka=myParseFloat(this.data.maxDelka); }, changeSirka:function(obj){ this.sirka=myParseFloat(obj.value); this.redraw(); }, changeDelka:function(obj){ this.delka=myParseFloat(obj.value); this.redraw(); }, changePocetKusu:function(obj){ this.pocetKusu=myParseFloat(obj.value); this.redraw(); }, init:function(){ this.sirka=this.data.maxSirka; this.delka=this.data.maxDelka; this.rozmer=this.sirka*this.delka; this.redraw(); }, redraw:function(){ var error=new Array(); this.rozmer=this.sirka*this.delka; if(this.sirka>this.data.maxSirka || this.sirka<=0) error[error.length]='
  • Prekročili ste maximálnu šírku
  • '; if(this.delka>this.data.maxDelka || this.delka<=0) error[error.length]='
  • Prekročili ste maximálnu dĺžku
  • '; if(error.length==0){ this.cenaZaKus=zaokrouhleniEshopu((this.sirka*1)*(this.delka*1)*(this.data.cenaZaMetrSDPH*1)); this.cenaCelkem=zaokrouhleniEshopu(this.cenaZaKus*this.pocetKusu); document.getElementById('product5button').style.display='block'; document.getElementById('product5chyby').style.display='none'; document.getElementById('id_produkt5cenaZaKus').innerHTML=this.cenaZaKus; document.getElementById('id_produkt5cenaCelkem').innerHTML=this.cenaCelkem; }else{ document.getElementById('id_produkt5cenaZaKus').innerHTML='-'; document.getElementById('id_produkt5cenaCelkem').innerHTML='-'; document.getElementById('product5button').style.display='none'; document.getElementById('product5chyby').style.display='block'; document.getElementById('product5chybyHTML').innerHTML='

    Vaša objednávka obsahuje chybné údaje:

      '+error.join('')+'
    '; } } } var detailZalozky = new Array(); function detailZalozkyOpenZalozka(id) { for(var i=0; i0) {for (i=0; i0) for (i=0; i0) { for (i=0; i