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('eshopbaby-r-plus.gif')>-1) document.getElementById('kimg'+id).src=dir+'/eshopbaby-r-minus.gif'; else document.getElementById('kimg'+id).src=dir+'/eshopbaby-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 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');}} var Kolotoc = function(id, topSledNum, perioda) { var perioda = perioda, topsled = document.getElementById(id).childNodes, topSledNum = topSledNum, rnd = []; this.Roztocit = function() { clear() random(); show(); } var random = function() { for (var i = 0; i < topSledNum; i++) { rnd[i] = Math.floor(Math.random()*(topsled.length - 1)); for (var j = 0; j < rnd.length - 1; j++) { if (rnd[j] == rnd[i]) { i = i - 1; break; } } } } var clear = function() { for(var i = 0; i < rnd.length - 1; i++) topsled[i].style.display = 'none'; rnd = []; } var show = function() { for(var i = 0; i < rnd.length - 1; i++) topsled[rnd[i]].style.display = 'block'; } if (topSledNum < topsled.length) { this.Roztocit(); var interval = window.setInterval(this.Roztocit, perioda*1000); var el = document.getElementById(id) } } function switchElements(id1, id2) { function vymena(a, b) { if (a.nodeName!='DIV' || b.value=='') { a.style.display = 'block'; a.focus(); b.style.display = 'none'; } } var x = document.getElementById(id1); var y = document.getElementById(id2); if (x.style.display == 'block;') vymena(x, y); else vymena(y, x); } $(document).ready(function() { var lgn = $('#id_loginform'); var psw = $('#id_password'); lgn.blur(function() { if(lgn.val().length==0) lgn.removeClass('bg-inp0').addClass('bg-inp1')}); lgn.focus(function(){ if(lgn.val().length==0) lgn.addClass('bg-inp0').removeClass('bg-inp1')}); psw.blur(function() { if(psw.val().length==0) psw.removeClass('bg-inp0').addClass('bg-inp2')}); psw.focus(function(){ if(psw.val().length==0) psw.addClass('bg-inp0').removeClass('bg-inp2')}); }); function doprava(id) { for(i=0;i