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('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');}} function removeEvent(elm, evType, fn, useCapture) {if (elm.removeEventListener) {elm.removeEventListener(evType, fn, useCapture); return true;} else if (elm.detachEvent) {var r = elm.detachEvent('on'+evType, fn); return r;} else {alert('Došlo k chybě při práci s event');}} function returnObj(ev) {var o=(ev.target)?ev.target:ev.srcElement; return o;} function returnAtr(ev,atr) {if(ev.target || ev.srcElement) {var o=(ev.target)?ev.target.getAttribute(atr):ev.srcElement.getAttribute(atr); return o;}} function pozadi(obj,obj2,akce){var trida = 'bg-input-'+akce; if (document.getElementById(obj2).value=='') document.getElementById(obj).className=trida;} function odskrtniVyrobce(pocet){if (document.getElementById('id_vyrobce_0').checked==true){for (var i=1; i<=pocet; i++){var trida = 'id_vyrobce_'+i;document.getElementById(trida).checked=false;}}} function odskrtniVyrobceVse(objekt){if (document.getElementById(objekt).checked==true) {document.getElementById('id_vyrobce_0').checked=false;}} function vyberVlastnost(selectid, hodnota) {if (document.getElementById(selectid)!=null) document.getElementById(selectid).value=hodnota;} var globalBublinaId=null; function hideBublina(id){ var bublina=null; try{bublina=document.getElementById('id_bublinaDostupnosti_'+id);}catch(e){} if(bublina!=null){ bublina.style.display='none'; /*globalBublinaId=null;*/ } } function cursorMoveForBublina(ev){ var obj=returnObj(ev); //document.getElementById('status').innerHTML='className='+obj.className; if(obj.className.indexOf('JaJsemBublina')==-1){ removeEvent(document,'mouseover',cursorMoveForBublina,true); hideBublina(globalBublinaId); //addEvent(document,'mouseover',cursorMoveForBublina,true); } } /* function showBublina(id,dostupnost,knihaURL,productID,backURL){ hideBublina(globalBublinaId); globalBublinaId=id; var bublina=null; try{bublina=document.getElementById('id_bublinaDostupnosti_'+id);} catch(e){} if(bublina!=null){ var cislo=myParseFloat(dostupnost); var html=new Array(); html[html.length]='