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 JE_TEL(txt){ txt=txt.replace(/ /g, '');var x = new RegExp('^(([+]420)|([+]421)|([+]48)){1}[0-9]{9}$'); if(x.test(txt)){ return 1; }else{ return 0; } } 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('pro registraci novinek musí být e-mail zadán ve správném formátu'); 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;}} function showkat(id, a) { show(id); var cn = a.className.split(' '); if (cn[0] == 'rootkategorie') { cn[1] = (cn[1] == 'open') ? 'close' : 'open'; a.className = cn.join(' '); } else { cn[1] = (cn[1] == 'plus') ? 'minus' : 'plus'; a.className = cn.join(' '); } } function pozadi(obj,obj2,akce) { var trida = 'inputDiv-'+akce; if (document.getElementById(obj2).value=='') document.getElementById(obj).className=trida; } function kniha_check() { var err = new Array(); if (JE_EMAIL(document.getElementById('id_stiz_mail').value)==0) err[err.length]='Zadejte prosím správný formát e-mailu' if (document.getElementById('id_stiz_text').value=='') err[err.length]='Vyplňte text se sdělením' if (err.length==0) document.getElementById('idknihaprani').submit(); else alert (err); } function vyhledavaniInput(active,obj,vyhledavam){ if(obj.value=='') { obj.value='např. 165/70 r13'; obj.style.color='#909090'; } if(active && obj.value=='např. 165/70 r13'){ obj.value=''; obj.style.color='#383838'; } } $(function(){ $('input[name="as_search"]').focus(function(){ var pos = $(this).offset(); $('.whisperer').css({'top':pos.top, 'left':pos.left}); }) }); var whisperer={ js:null, timeout:null, body:null, searchString:'', htmlString:'', root:'', data:new Array(), setVariables:function(root){ this.root=root; }, change:function(obj){ if(obj.value.length>2){ if(this.timeout!=null) {window.clearTimeout(this.timeout);} this.searchString=obj.value; this.timeout=window.setTimeout('whisperer.load();',1000); }else{ document.getElementById('id_whispererTarget').style.display='none'; } }, load:function(searchString){ this.js=document.createElement('script'); this.js.type='text/javascript'; this.js.src=this.root+'/whisperer.php?search='+this.searchString; if(this.body==null){ this.body=document.getElementsByTagName('body'); if(this.body.length==1) this.body=this.body[0]; } this.body.appendChild(this.js); }, setData:function(data){ this.htmlString=''; for(var i=0; i'+data[i].cenas+' '+data[i].mena+''+data[i].nazev+''; } this.redraw(); }, redraw:function(){ document.getElementById('id_whispererTarget').innerHTML=this.htmlString; document.getElementById('id_whispererTarget').style.display='block'; }, hide:function(){ window.setTimeout('document.getElementById(\'id_whispererTarget\').style.display=\'none\';',1000); }, show:function(){ if(this.htmlString.length!=0){ document.getElementById('id_whispererTarget').style.display='block'; } }, notFound:function(){ document.getElementById('id_whispererTarget').innerHTML='nenalezeno'; document.getElementById('id_whispererTarget').style.display='block'; } } var slideShowBanner={ selector: { main: '.slideshow-banner', effect: '.banner-anim', image: '.banner-image', title: '.banner-title', panel: '.panel', link: '.link', prev: '.prev', next: '.next' }, cssClass: { linkActive: 'link-active' }, option: { fadeDuration: 500, interval: 6000, disableWhenAnimated: true, pauseWhenHover: true }, f: function( e, c ){ var cfg=slideShowBanner; var image=e.find( cfg.selector.image ).hide(); if (image.length==1) { e.find( cfg.selector.panel ).hide(); } var title=e.find( cfg.selector.title ).hide(); var link=e.find( cfg.selector.link ); if (c===undefined) { var c=0; } var tOut; if (image.length != title.length && image.length != link.length) { return false; } // simple test var anim=[]; link.each( function( i ){ anim[i]=[ image.get(i), title.get(i) ]; $(this).click(function(){ Anim(i); }); }); $(anim[c]).show(); $(link[c]).addClass( cfg.cssClass.linkActive ); if (cfg.selector.prev!==undefined){ e.find(cfg.selector.prev).click(function(){ AnimPrev(); }); } if (cfg.selector.next!==undefined){ e.find(cfg.selector.next).click(function(){ AnimNext(); }); } if ( cfg.option.pauseWhenHover===true ){ $(anim).each( function(){ $(this).hover( function(){ Stop(); }, function(){ Play(); }); }); } var Anim=function(i){ if ( ((i>=image.length && i<0) || i==c ) || (cfg.option.disableWhenAnimated===true && ( $(anim[c]).is(':animated') || $(anim[i]).is(':animated') )) ) { return false; } Stop(); $(anim[c]).fadeOut(cfg.option.fadeDuration); $(anim[i]).fadeIn(cfg.option.fadeDuration); $(link[c]).removeClass(cfg.cssClass.linkActive); $(link[i]).addClass(cfg.cssClass.linkActive); c=i; Play(); } var AnimPrev=function(){ if (c<=0){ Anim(image.length-1); } else{ Anim(c-1); } } var AnimNext=function(){ if (c>=image.length-1){ Anim(0); } else{ Anim(c+1); } } var Play=function(){ tOut=setTimeout( AnimNext, cfg.option.interval ); } var Stop=function(){ if (tOut!==undefined){ clearTimeout(tOut); } } Play(); }, i: [] }; $(function(){ $( slideShowBanner.selector.main ).each( function( i ){ slideShowBanner.i[i]=slideShowBanner.f($(this)); }); }); function zobrazVolitelne(id,zob) { if (zob==1) document.getElementById(id).style.display='block'; if (zob==0) document.getElementById(id).style.display='none'; if (id=='id_user_pravnicka') document.getElementById('id_pravnicka_osoba').value=zob; if (id=='id_user_adresa') document.getElementById('id_dotaz_adresa').value=zob; } function checkvals() { var err = new Array(); var err2 = ''; if (document.getElementById('reg_login').value.length<4) err[err.length]='uživatelské jméno je příliš krátké (min 4 znaky)'; if (document.getElementById('reg_password').value!=document.getElementById('reg_password2').value) err[err.length]='zadaná hesla se neshodují'; if (document.getElementById('reg_password').value.length<4) err[err.length]='heslo je příliš krátké (min 4 znaky)'; if (document.getElementById('reg_i_jme').value.length<1) err[err.length]='musíte vyplnit své jméno'; if (document.getElementById('reg_i_pri').value.length<1) err[err.length]='musíte vyplnit své příjmení'; if (document.getElementById('reg_email').value=='') err[err.length]='není vyplněn e-mail u kontaktní osoby'; if (document.getElementById('reg_email').value!='' && JE_EMAIL(document.getElementById('reg_email').value)!=1) err[err.length]='e-mail byl zadán ve špatném formátu'; /* if(document.getElementById('reg_i_tel').value.length!=0){ if(JE_TEL(document.getElementById('reg_i_tel').value)==0) err[err.length]='zadán špatný formát telefonního čísla'; } */ if (document.getElementById('reg_i_mob').value.length==0){ err[err.length]='není vyplněn mobil u kontaktní osoby'; }else{ if(JE_TEL(document.getElementById('reg_i_mob').value)==0) err[err.length]='zadán špatný formát mobilního čísla'; } /* if(document.getElementById('i_fax').value.length!=0){ if(JE_TEL(document.getElementById('i_fax').value)==0) err[err.length]='zadán špatný formát faxového čísla'; } */ if (document.getElementById('reg_i_adr').value.length<2) err[err.length]='není vyplněna ulice u fakturační adresy'; if (document.getElementById('reg_i_mes').value.length<2) err[err.length]='není vyplněno město u fakturační adresy'; if (document.getElementById('reg_i_psc').value.length!=5 || isNaN(document.getElementById('reg_i_psc').value) || document.getElementById('reg_i_psc').value.length<2) err[err.length]='není vyplněno PSČ u fakturační adresy'; if (document.getElementById('id_dotaz_adresa').value=='1') { if (document.getElementById('reg_dod_ulice').value.length<2) err[err.length]='není vyplněna ulice u dodací adresy'; if (document.getElementById('reg_dod_obec').value.length<2) err[err.length]='není vyplněno město u dodací adresy'; if (document.getElementById('reg_dod_psc').value.length!=5 || isNaN(document.getElementById('reg_dod_psc').value) || document.getElementById('reg_dod_psc').value.length<2) err[err.length]='není vyplněno PSČ u dodací adresy (bez mezer)'; } if (document.getElementById('id_pravnicka_osoba').value=='1') { if (document.getElementById('reg_i_fir').value=='') err[err.length]='pokud registrujete firmu, musíte vyplnit obchodní jméno'; if (document.getElementById('reg_i_ico').value=='') err[err.length]='pokud registrujete firmu, musíte vyplnit IČ nebo DIČ'; } if (!document.getElementById('reg_obchpod').checked) err[err.length]='\npokud se chcete zaregistrovat, musíte souhlasit s obchodními podmínkami'; if (err.length>0) { err2='Registrace nemohla být provedena, protože některé z následujícíh údajů nebyly zadány korektně. Opravte prosím chybně zadané údaje:\n\n'; for (i=0; i