/*diskuse*/ $(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); }); }); }); /*diskuse*/ $(function(){ $('.zmenitActiv').keydown(function(){ $('.kosikZmen').hide();$(this).parent().find('.kosikZmen').show(); }); /* homepage sloupce */ if($('.bg-hpKatOpak').length!=0){ var w1 = $('.bg-menuKategorie').outerHeight(); var w2 = $('.bg-hpKatOpak').outerHeight()-24; if(w1'+$(this).find('option:selected').text()+''; var options2 = ''; $(this).find('option').siblings().each(function(){ options2 += '
'+$(this).text()+'
'; }); if($(this).hasClass('small')) { var html = '
'+options1+'
'+options2+'
'; } else { var html = '
'+options1+'
'+options2+'
'; } parent.append(html); }) $('.selected').click(function(){ var parent = $(this).parent(); if(activeSelect!=null && parent.get(0)!==activeSelect) { $(activeSelect).find('.options').slideUp(300,'easeOutBounce'); } if(parent.get(0)!==activeSelect) { parent.find('.options').slideDown(300,'easeOutBounce',function(){ activeSelect = parent.get(0); }); } else { parent.find('.options').slideUp(300,'easeOutBounce'); activeSelect = null } }); $('.option').click(function(){ var parent = $(this).parent(); var parentPar = parent.parent(); var originSelect = parent.parent().parent().find('select'); originSelect.val($(this).attr('id')).change(); var divSel = parentPar.find('.selected'); /*var pomId = divSel.attr('id'); var pomText = divSel.text();*/ divSel.attr('id',$(this).attr('id')); divSel.text($(this).text()); /*$(this).attr('id',pomId); $(this).text(pomText);*/ parent.slideToggle(300,'easeOutBounce'); }); $('.serPop').show(); /* graficke selecty */ /* kontrola diskuse */ $('.diskusePridat').submit(function(){ if($(this).find('input[name$="diskname"]').val()=='') { alert('Vyplňte jméno...'); return false; } if($(this).find('textarea[name$="disktext"]').val()=='') { alert('Vyplňte text...'); return false; } if($(this).find('input[name$="diskusecaptcha"]').val()=='') { alert('Vyplňte kód...'); return false; } }); /* kontrola diskuse */ /*fancyboxy*/ $('#prihlasDialogOn').fancybox({ 'autoDimensions' : false, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'width' : 300, 'height' : 280, 'speedIn' : 300, 'speedOut' : 300, 'onStart' : function() { $('#prihlasDialog').show(); }, 'onClosed' : function() { $('#prihlasDialog').hide(); } }); $('#ucetDialogOn').fancybox({ 'autoDimensions' : false, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'width' : 430, 'height' : 280, 'speedIn' : 300, 'speedOut' : 300, 'onStart' : function() { $('#ucetDialog').show(); }, 'onClosed' : function() { $('#ucetDialog').hide(); } }); $('#hlidatCenuOn').fancybox({ 'autoDimensions' : false, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'width' : 430, 'height' : 280, 'speedIn' : 300, 'speedOut' : 300, 'onStart' : function() { $('#hlidatCenu').show(); }, 'onClosed' : function() { $('#hlidatCenu').hide(); } }); $('#dotazNaProdejceOn').fancybox({ 'autoDimensions' : false, 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'width' : 480, 'height' : 430, 'speedIn' : 300, 'speedOut' : 300, 'onStart' : function() { $('#dotazNaProdejce').show(); }, 'onClosed' : function() { $('#dotazNaProdejce').hide(); } }); /*eshop message*/ if($('.linkToMessage').length>0) { $('.linkToMessage').fancybox({ 'autoDimensions' : true, 'speedIn' : 300, 'speedOut' : 300, 'onStart' : function() { $('#message').show(); }, 'onClosed' : function() { $('#message').hide(); } }); $('.linkToMessage').trigger('click'); $('#fancybox-content .sedyButton.dvetlac').click(function(){ $('#fancybox-close').click(); }) } /* kontrola - vice info */ $('#dotazNaProdejceForm').submit(function(){ var tel = $(this).find('#infoobratem3').val(); var re1 = /^[0-9]{9}$|^[0-9]{12}$/; if(!re1.test(tel)) { alert('Telefon je ve špatném tvaru. Správný tvar je 123456789 nebo 420123456789.');return false; } var ema = $(this).find('#idinfoobratem').val(); var re2 = /^[_a-zA-Z0-9.-]+@[_a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/; if(!re2.test(ema)) { alert('E-mail je ve špatném tvaru. Správný tvar je neco@neco.tld.');return false; } var vzk = $(this).find('#infoobratem2').val(); if(!vzk) { alert('Napiště Váš vzkaz.');return false; } if($(this).find('#infoobratemcaptcha').val()=='') { alert('Opište kód z obrázku');return false; } }); /* kontrola - vice info */ /* kontrola - pes */ $('#idpesform').submit(function(){ var ema = $(this).find('#haf_mail').val(); var re2 = /^[_a-zA-Z0-9.-]+@[_a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/; if(!re2.test(ema)) { alert('E-mail je ve špatném tvaru. Správný tvar je neco@neco.tld.');return false; } if($(this).find('#haf_cena').is(':checked')) { if($(this).find('#haf_cena2').val()=='') { alert('Až cena klesne pod je prázdná...');return false; } } if(!$(this).find('#haf_cena').is(':checked') && !$(this).find('#haf_cena3').is(':checked')) { alert('Nevyplněný formulář...');return false; } }); /* kontrola - pes */ /* hledeat - kontrola */ $('.searchBar form').submit(function(){ if($(this).find('input[name=\'as_search\']').val()=='') { alert('Zadejte hledaný text'); return false; } }); /* kontrola regmailnovinky*/ $('#regmailnovinky').submit(function(){ var pattern = new RegExp(/^(('[\w-\s]+')|([\w-]+(?:\.[\w-]+)*)|('[\w-\s]+')([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i); if(!pattern.test($('#regmailnovinkyEmail').val())) { alert('Adresa není korektní...'); return false; } }); /* kontrola regmailnovinky*/ /* kontrola prihlasovani */ $('#prihlasDialogForm').submit(function(){ if($(this).find('#prihlasDialogFormLogin').val()=='' || $(this).find('#prihlasDialogFormPass').val()=='') { alert('Vyplňte všechny položky'); return false; } }); $('#regmailnovinky input').focusin(function(){ if($(this).val()=='Váš E-mail...') $(this).val(''); }).focusout(function(){ if($(this).val()=='') $(this).val('Váš E-mail...'); }); }); 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 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 pozadi(obj,obj2,akce) { var trida = 'inputDiv-'+akce; if (document.getElementById(obj2).value=='') document.getElementById(obj).className=trida; } $(function(){ $.extend($.fn.disableTextSelect = function() { return this.each(function(){ if($.browser.mozilla){//Firefox $(this).css('MozUserSelect','none'); }else if($.browser.msie){//IE $(this).bind('selectstart',function(){return false;}); }else{//Opera, etc. $(this).mousedown(function(){return false;}); } }); }); $('.bg-select').disableTextSelect();//No text selection on elements with a class of 'noSelect' }); 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); } var regRow = function(selector, test, bubble) { return {'selector': selector, 'test': test, 'bubble': ""+bubble+"" }; }; $(function(){ $('#regnov').each(function(){ var regnovForm = new formCheckClass(); regnovForm.configure({'formId':'regnov','bubbleRound':4,'bubbleWidth':150,'errorAlert':'Pro úspěšnou registraci odběru novinek z našeho servru prosím zadejte Vaší platnou emailovou adresu.'}) .setData([{'selector':'input[name=enov]','test':'email','required':true,'showIcon':false,'bubble':'pro registraci odběru novinek musíte zadat platnou emailovou adresu'}]) .run(); }); });