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 addEvent(elm, evType, fn, useCapture) {if (elm.addEventListener) {elm.addEventListener(evType, fn, useCapture); return true;} else if (elm.attachEvent) {var r = elm.attachEvent('on'+evType, fn); return r;} else {alert('Došlo k chybě při práci s event');}} function regnews() {if(JE_EMAIL(document.getElementById('enov').value)==0) {alert('To register news your e-mail must be in correct format'); 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:null, bind:null, eventPodproduktChange:[], callPriceChange:[], imageArea:[], imageAreaVlastnost:[], skladADostupnost:[], kombinaceVlastnosti:null, selectedSvazanyParametrIndex:null, 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.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; }, 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='Mistake
    '+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){} } } } } function openPrettyPhoto() { var images = []; var titles = []; $('a[rel^=\'prettyPhoto\']').each( function() { images.push($(this).attr('href')); titles.push($(this).attr('title')); } ); $.prettyPhoto.open(images, titles); } var aukceClass=function(instanceName,targetDate,targetTime,dateString,timeString,intervalInMS){ this.instanceName=instanceName; this.targetDate=(targetDate)?targetDate:null; this.targetTime=(targetTime)?targetTime:null; this.myDate=dateString.split('.'); this.myTime=timeString.split(':'); this.intervalInMS=(intervalInMS)?intervalInMS:500; this.end=new Date(this.myDate[2],this.myDate[1]-1,this.myDate[0],this.myTime[0],this.myTime[1],this.myTime[2],0); window.setInterval(this.instanceName+'.redrawOdpocet();',intervalInMS); return this; } aukceClass.prototype.redrawOdpocet=function(){ var now=new Date(); var rozdilMS=this.end-now; var rDny=Math.floor(rozdilMS/86400000); rozdilMS%=86400000; var rHod=Math.floor(rozdilMS/3600000); rozdilMS%=3600000; var rMin=Math.floor(rozdilMS/60000); rozdilMS%=60000; var rSec=Math.floor(rozdilMS/1000); rozdilMS%=1000; if(this.targetDate!=null) this.targetDate.innerHTML=rDny; if(this.targetTime!=null) this.targetTime.innerHTML=rHod+':'+rMin+':'+rSec; } var Zalozky = function(id) { var tab = {}; var z = document.getElementById(id).childNodes; var open; var i; var self = this; var name; for (i = 0; i < z.length; i++) { if (z[i].childNodes[0] && z[i].childNodes[0].childNodes[0] && z[i].childNodes[0].childNodes[0].getAttribute('rel') !== undefined) { name = z[i].childNodes[0].childNodes[0].getAttribute('rel'); tab[name] = { link: z[i], card: document.getElementById(name) }; addEvent(z[i].childNodes[0].childNodes[0], 'click', function(event) { var target = (event.srcElement) ? event.srcElement : event.target; self.prepni(target.getAttribute('rel')); event.returnValue = false; if (event.preventDefault) { event.preventDefault(); } }); tab[name].card.style.display = 'none'; } } this.prepni = function(name) { open.card.style.display = 'none'; open.link.className = 'zalozka bg1 bg-zalozka L'; tab[name].card.style.display = 'block'; tab[name].link.className = 'zalozka bg1 bg-zalozka L selected'; open = tab[name]; } var search = /#([a-z]+)/.exec(location.href); if (search !== null && search[1] != undefined) { open = tab[search[1]]; self.prepni(search[1]); } else { open = tab[name]; self.prepni(name); } return this; }; function pes_check(form) { var err = []; if (!(JE_EMAIL(form.haf_mail.value))) { err.push('Enter your e-mail'); } if (!(form.haf_cena3.checked || form.haf_cena.checked)) { err.push('Choose at least one way of guarding'); } if (form.haf_cena.checked && isNaN(parseInt(form.haf_cena2sdph.value))) { err.push('as a price you have to enter the number'); } if (err.length) { alert(err.join('\n')); return false; } return true; } function viceinfo_check(form) { var err = []; if (!(JE_EMAIL(form.infoobratem.value)) && form.infoobratem3.value == '') { err.push('the e-mail or phone is entered in correct format'); } if (form.infoobratem2.value == '') { err.push('the field with question contains at least basic description of your problem or the requested information'); } if (form.infoobratemcaptcha.value == '') { err.push('was transcribed by the code shown'); } if (err.length) { err.unshift('For obtaining more information is necessary that:'); alert(err.join('\n - ')); return false; } return true; } $(function(){ $('*[id^=rozbalDiskusi]') .bind('click',function(ev){ var id=ev.target.id.split('_')[1]; $('#diskuseHidden_'+id).get(0).value=''; /*nove pridany radek*/ $('#radekTlacitek_'+id+' ,#diskuseformular_'+id).toggle(500,function(){ $('#diskuseformular_'+id).appendTo('#diskuseOriginalPosition_'+id); }); }); $('*[id^=odpovedetNaDiskusi]') .bind('click',function(ev){ ev.preventDefault(); var id=ev.target.id.split('_'); $('#radekTlacitek_'+id[1]).show(500); $('#diskuseformular_'+id[1]).hide(500,function(){ $('#diskuseformular_'+id[1]).appendTo('#prispevekDiskuse_'+id[1]+'_'+id[2]); $('#diskuseHidden_'+id[1]).get(0).value=id[2]; $('#radekTlacitek_'+id[1]).hide(500); $('#diskuseformular_'+id[1]).show(500); }); }); }); function diskuse_send(form) { var err = []; if (form.diskname.value == '') { err.push('you must enter you name'); } if (!(JE_EMAIL(form.diskmail.value))) { err.push('you must enter your e-mail address in correct format '); } if (form.disktext.value == '') { err.push('you must add your opinion'); } if (form.diskusecaptcha.value == '') { err.push('Copy the code from the image'); } if (err.length) { err.unshift('if you wish to add your opinion to a discussion it is necessary to fulfil all following conditions :'); alert(err.join('\n - ')); return false; } return true; }