PageSourceSearch

https://www.lanex.cz/script/eshop.js?1789379968

js lanex.cz collected 2026-10-08 09:01:28 UTC 100,589 bytes, 3,216 lines download raw bytes

1document.createElement('header');
2document.createElement('nav');
3document.createElement('section');
4document.createElement('article');
5document.createElement('aside');
6document.createElement('footer');
7document.createElement('hgroup');
8document.createElement('main');
9
10var options = { path: '/', expires: 10 };
11
12
13var pust = true;
14
15var allowSubmit = false;
16
17$('form input[type="text"]').focus(function(){
18    if (!$('#recaptcha_script').length) {
19        $('body').append('
vendor: 121 bytes, line 19
19<script id="recaptcha_script" src="https://www.google.com/recaptcha/api.js?hl='+$('#lang').val()+'" async defer></script>
19');
20        setTimeout(function(){
21
22            var widgetId = grecaptcha.ready(function() {
23                $('.myCaptcha').each(function (index, el) {
24                    var object = $(this);
25                    grecaptcha.render(el, {
26                        'sitekey': $('#re_key').val(),  // required
27                        'theme': 'light',  // optional
28                        'badge': 'bottomleft',
29                        'size': 'invisible',
30                        "callback": function (token){
31                            $(".g-recaptcha-response").val(token);
32
33                        }
34                    });
35                    $(this).attr('data-widget-id',index)
36                });
37            });
38
39        },2000);
40    }
41});
42
43
44
45$(document).ready(function() {
46
47
48if (!("ontouchstart" in document.documentElement)) {
49   document.documentElement.className += " notouch";
50}else{
51   $('html').removeClass('notouch')
52}
53
54
55    if(window.location.href.indexOf("?getScroll=") != -1){
56        var thisUrl = location.search
57        var thisElement = thisUrl.substring(11)
58        if ($('*[data-scroll="'+thisElement+'"]').length){
59
60            setTimeout(function () {
61                if( ($('header').css("position") == "fixed") || ($('header').css("position") == "absolute")) {
62                    var headerHeight = $('header').outerHeight();
63                }else{
64                    var headerHeight = 0 ;
65                }
66                
67                var thisElementOffset = $('*[data-scroll="'+thisElement+'"]').offset().top - headerHeight;
68                $('html,body').animate({ scrollTop: thisElementOffset }, 600);
69            }, 400)
70        }
71    }
72
73
74
75    //$("select").selectbox();
76 	 $("#ico,#psc,#telefon,#count,#basket table.product_souhrn td.three .basket_count, .product_list .item .basket .count").numeric()
77
78    
79    $(document).on('focus', 'input[readonly]', function () {
80        this.blur();
81    });
82    
83    
84
85   
86
87
88 $('.uploadBtn').change(function(){
89   $(this).parents('.file').find('.uploadFile').val($(this).val());
90}); 
91    
92
93    
94    $( "header ul li ul li:nth-child(1)" ).hover(function() {
95      $( this ).parent('ul').addClass( "hover_efekt" );
96   }, function() {
97      $( this ).parent('ul').removeClass( "hover_efekt" );
98   }); 
99   
100   
101   $('header ul li ul li:nth-child(1)').each(function(){
102      if ( $(this).hasClass('active')){
103         $( this ).parent('ul').addClass( "special" );
104      }   
105   });
106   
107   if ( $( "header ul li ul li:nth-child(1)" ).hasClass('active')){
108      $( this ).parent('ul').addClass( "hover_efekt" );
109   }
110   
111   
112
113   
114
115    /*
116       var dateToday = new Date();
117       $('.datepicker').datepicker({ 
118         dateFormat: 'd.m.yy',
119         "minDate": dateToday,
120         firstDay: 1,
121         onSelect: function() {
122            if ( $("input[name='datum_od']").length && $("input[name='datum_do']").length ){
123               var startDt = $("input[name='datum_od']").datepicker("getDate")
124               var endDt = $("input[name='datum_do']").datepicker("getDate")
125               if( (startDt > endDt) && (endDt != null) ){
126                  var errorText = '<p>' + $('#datum_language').val() + '</p>'
127               	$('.control_popup .text').html(errorText);
128               	$('.control_popup').css({'display' : 'table'}); 
129               	setTimeout(function () {
130               		$('.control_popup').css({'opacity' : 1});
131               	},10)											
132               }
133            }
134             
135         } 
136      })
137      
138      $(document).click(function(e) { 
139         var ele = $(e.toElement); 
140         if (!ele.hasClass("hasDatepicker") && !ele.hasClass("ui-datepicker") && !ele.hasClass("ui-icon") && !$(ele).parent().parents(".ui-datepicker").length){
141            $(".hasDatepicker").datepicker("hide");
142         }    
143      });
144   */
145   
146   $("#password_kosik,#blabol2").keypress(function(e) {
147    	if(e.which == 13) {
148      	$('.log_user_krok_1').click();
149      	$(this).blur();
150      	return false;
151    	}	
152	});
153	$("#blabol3").keypress(function(e) {
154    	if(e.which == 13) {
155      	$('#repass_1_step').click();
156      	$(this).blur();
157      	return false;
158    	}	
159	});
160
161	checkDeliveryAddress();
162	$('#b_use_delivery_address').click(function(){
163		checkDeliveryAddress();
164	});
165   
166   $('a.finall_order').click(function() {
167      $('#basket .end_order a').addClass('disable')
168      $('#basket form#finalordform').addClass('opacity')
169    });
170
171    
172	$('.log_user_krok_1').click(function() {
173		var errorMessage = '';
174		if($('#blabol2').val() == '') {
175			errorMessage = errorMessage + '<p>' + $('#blabol_language_2').val() + '</p>';
176		}
177		if($('#password_kosik').val() == '') {
178			errorMessage = errorMessage + '<p>' + $('#password_language').val() + '</p>';
179		}
180		if (errorMessage > ''){
181			showControlPopup(errorMessage);
182			return false;
183	 	}
184		$.nette.ajax({
185		  url: '?do=logUser',
186		  data: {'val[s_email]': $('#blabol2').val(), 'val[s_password]': $('#password_kosik').val(), 'val[kroky]': 1},
187		  method: 'post',
188		  success: function(data) {
189		  	 
190		  },
191		});
192		return false;
193	 });
194	 
195	 $('#repass_1_step').click(function() {
196		$.nette.ajax({
197		  url: '?do=rePass',
198		  data: {'s_email': $('#blabol3').val(), 'kroky': 1, 'lost_password': 'ok'},
199		  method: 'post',
200		  success: function(data) {
201		  	 
202		  },
203		});
204		return false;
205	 });
206
207
208     var hpTabs = $('.profil_tabs li a');
209     $('.profil_tabs li a').click(function(){
210       var thisTab = $(this);
211       if( thisTab.parents('li').hasClass('active') ){
212       }else{
213          hpTabs.parents('li').removeClass("active");
214          thisTab.parents('li').addClass("active");  
215          $('#my_profile .obsah').css({'opacity' : 0}); 
216          setTimeout(function() { 
217             $('#my_profile .obsah').hide();
218             $('#obsah_'+thisTab.attr('id')).show();
219          }, 410);
220          setTimeout(function() { 
221             $('#obsah_'+thisTab.attr('id')).css({'opacity' : 1});
222          }, 430);
223       }
224       return false;
225     });
226
227    $('.message_centering span').click(function(){
228        $(this).parents('.flash.alert').slideUp();
229        $(this).parents('.message_centering').removeClass('active');
230    });
231    
232    $('a.return_false').click(function(){
233       return false;
234    });
235    
236	if ($('.flash.fade').length){ 
237   	$('.message_centering').each(function(){
238           var objekt = $(this);
239           setTimeout(function () {
240             objekt.removeClass('active');
241           }, 6000)
242   	});  
243   } 
244   
245   
246    
247   $('.scroll_top').click(function(){      
248      $('html,body').animate({ scrollTop: 0 }, 600);
249      return false;
250   });
251
252   if ( ($(document).scrollTop() > $(window).height() / 2)){
253      $('.scroll_top').addClass('active')
254   }else{
255      $('.scroll_top').removeClass('active')
256   }  
257   
258   $(window).scroll(function(){
259      if ( ($(document).scrollTop() > $(window).height() / 2)){
260         $('.scroll_top').addClass('active')
261      }else{
262         $('.scroll_top').removeClass('active')
263      }  
264   }); 
265    
266   
267   $('article table, .text_box table, .under_main .description_box .description_hide table').each(function(){
268      var tableWidth = $(this).width();
269      var parentWidth = $(this).parent().width();
270      if( tableWidth > parentWidth ){
271         $(this).addClass('over')
272      }else{
273         $(this).removeClass('over')
274      }
275    });
276       
277   
278   
279
280   
281   $('.control_popup .close').click(function(){
282      $('.web_container').attr('aria-hidden', 'false')
283      var thisForm = $('.control_popup').find('input[type="hidden"]').val();
284      $(this).parents('.control_popup').css({'opacity' : 0});
285      setTimeout(function () {
286         $('.control_popup').css({'display' : 'none'}); 
287      }, 250)
288      $('#'+thisForm).find('button[type="submit"]').focus();
289   });
290    
291   $('.control_popup').click(function(e){
292      var controlClass = $(e.target).attr('class');
293      if( controlClass == 'box' ){
294         $('.control_popup .close').click()
295      } 
296   });
297   
298   
299   $('.hobby_popup .close').click(function(){
300      $('.web_container').attr('aria-hidden', 'false')
301      var thisForm = $('.hobby_popup').find('input[type="hidden"]').val();
302      $(this).parents('.hobby_popup').css({'opacity' : 0});
303      setTimeout(function () {
304         $('.hobby_popup').css({'display' : 'none'}); 
305      }, 250)
306   });
307    
308   $('.hobby_popup').click(function(e){
309      var controlClass = $(e.target).attr('class');
310      if( controlClass == 'box' ){
311         $('.hobby_popup .close').click()
312      } 
313   });
314   
315   
316   $('.piktogram_popup .close').click(function(){
317      $('.web_container').attr('aria-hidden', 'false')
318      var thisForm = $('.piktogram_popup').find('input[type="hidden"]').val();
319      $(this).parents('.piktogram_popup').css({'opacity' : 0});
320      setTimeout(function () {
321         $('.piktogram_popup').css({'display' : 'none'}); 
322      }, 250)
323      $('#'+thisForm).find('button[type="submit"]').focus();
324   });
325    
326   $('.piktogram_popup').click(function(e){
327      var controlClass = $(e.target).attr('class');
328      if( controlClass == 'box' ){
329         $('.piktogram_popup .close').click()
330      } 
331   });
332   
333   
334   
335   $('.vzorkovnik_popup .close').click(function(){
336      $('.web_container').attr('aria-hidden', 'false')
337      $(this).parents('.vzorkovnik_popup').css({'opacity' : 0});
338      setTimeout(function () {
339         $('.vzorkovnik_popup').css({'display' : 'none'}); 
340      }, 250)
341   });
342    
343   $('.vzorkovnik_popup').click(function(e){
344      var controlClass = $(e.target).attr('class');
345      if( controlClass == 'box' ){
346         $('.vzorkovnik_popup .close').click()
347      } 
348   });
349    
350    
351               
352                  
353   $('.carrier_popup .close').click(function(){
354      $('.web_container').attr('aria-hidden', 'false')
355      $(this).parents('.carrier_popup').css({'opacity' : 0});
356      setTimeout(function () {
357         $('.carrier_popup').css({'display' : 'none'}); 
358      }, 250)
359      $('.carrier_pop').focus();
360   });
361    
362   $('.carrier_popup').click(function(e){
363      var controlClass = $(e.target).attr('class');
364      if( controlClass == 'box' ){
365         $('.carrier_popup .close').click()
366      } 
367   });
368   
369   
370   
371   $('.contact_popup .close').click(function(){
372      $('.web_container').attr('aria-hidden', 'false')
373      $(this).parents('.contact_popup').css({'opacity' : 0});
374      setTimeout(function () {
375         $('.contact_popup').css({'display' : 'none'}); 
376      }, 250)
377      $('.contact_popup').focus();
378   });
379    
380   $('.contact_popup').click(function(e){
381      var controlClass = $(e.target).attr('class');
382      if( controlClass == 'box' ){
383         $('.contact_popup .close').click()
384      } 
385   });
386   
387   $('.orders_popup .close').click(function(){
388      $('.web_container').attr('aria-hidden', 'false')
389      $(this).parents('.orders_popup').css({'opacity' : 0});
390      setTimeout(function () {
391         $('.orders_popup').css({'display' : 'none'}); 
392      }, 250)
393   });
394    
395   $('.orders_popup').click(function(e){
396      var controlClass = $(e.target).attr('class');
397      if( controlClass == 'box' ){
398         $('.orders_popup .close').click()
399      } 
400   });
401   
402   
403   
404   $('.tarif_popup .close').click(function(){
405      $('.web_container').attr('aria-hidden', 'false')
406      $(this).parents('.tarif_popup').css({'opacity' : 0});
407      setTimeout(function () {
408         $('.tarif_popup').css({'display' : 'none'}); 
409      }, 250)
410   });
411    
412   $('.tarif_popup').click(function(e){
413      var controlClass = $(e.target).attr('class');
414      if( controlClass == 'box' ){
415         $('.tarif_popup .close').click()
416      } 
417   });
418   
419   
420   $('.buy_popup .close').click(function(){
421      $('.web_container').attr('aria-hidden', 'false')
422      $(this).parents('.buy_popup').css({'opacity' : 0});
423      setTimeout(function () {
424         $('.buy_popup').css({'display' : 'none'}); 
425      }, 250)
426      $('#'+thisForm).find('button[type="submit"]').focus();
427   });
428    
429   $('.buy_popup').click(function(e){
430      var controlClass = $(e.target).attr('class');
431      if( controlClass == 'box' ){
432         $('.buy_popup .close').click()
433      } 
434   });
435   
436   
437   $('.gift_popup .close').click(function(){
438      $('.web_container').attr('aria-hidden', 'false')
439      $(this).parents('.gift_popup').css({'opacity' : 0});
440      setTimeout(function () {
441         $('.gift_popup').css({'display' : 'none'}); 
442      }, 250)
443   });
444
445   $('.gift_popup').click(function(e){
446      var controlClass = $(e.target).attr('class');
447      if( controlClass == 'box' ){
448         $('.gift_popup .close').click()
449      } 
450   });
451   
452   
453   
454   $('.popup_popup .close').click(function(){
455      $('.web_container').attr('aria-hidden', 'false')
456      $(this).parents('.popup_popup').css({'opacity' : 0});
457      setTimeout(function () {
458         $('.popup_popup').css({'display' : 'none'}); 
459      }, 250)
460   });
461    
462   $('.popup_popup').click(function(e){
463      var controlClass = $(e.target).attr('class');
464      if( controlClass == 'box' ){
465         $('.popup_popup .close').click()
466      } 
467   });
468   
469   
470   $('.video_popup .close').click(function(){
471      $('.web_container').attr('aria-hidden', 'false')
472      $(this).parents('.video_popup').css({'opacity' : 0});
473      setTimeout(function () {
474         $('.video_popup').css({'display' : 'none'}); 
475      }, 250)
476   });
477    
478   $('.video_popup').click(function(e){
479      var controlClass = $(e.target).attr('class');
480      if( controlClass == 'box' ){
481         $('.video_popup .close').click()
482      } 
483   });
484        
485       
486    
487      $(document).keyup(function(e) {
488         if ( (e.keyCode == 27)) { 
489            if ( $('.control_popup').css('opacity') == '1') { $('.control_popup .close').click(); }
490            if ( $('.vzorkovnik_popup').css('opacity') == '1') { $('.vzorkovnik_popup .close').click(); }
491            if ( $('.carrier_popup').css('opacity') == '1') { $('.carrier_popup .close').click(); }
492            if ( $('.contact_popup').css('opacity') == '1') { $('.contact_popup .close').click(); }
493            if ( $('.popup_popup').css('opacity') == '1') { $('.popup_popup .close').click(); }
494            if ( $('.video_popup').css('opacity') == '1') { $('.video_popup .close').click(); }
495         }     
496      }); 
497      
498       $(document).keyup(function(e) {
499         if ( (e.keyCode == 13) && ( ($('.control_popup').css('opacity') == '1') ) ) { 
500            $('.control_popup .close').click();
501         }
502         if ( (e.keyCode == 13) && ( ($('.vzorkovnik_popup').css('opacity') == '1') ) ) { 
503            $('.vzorkovnik_popup .close').click();
504         }
505      });
506      
507      
508      $(document).keydown(function(e) {
509         if ( (e.keyCode == 40) ){
510            if(  $('.silencer:not(.hide) li a').length ){        
511               if(  $('.silencer li.active').length ){
512                  var thisItem = $('.silencer li.active');
513                  if ( thisItem.next().hasClass('last') ){
514                  }else if ( thisItem.next().hasClass('move') ){
515                     thisItem.next().next().addClass('active');
516                     thisItem.next().next().find('a').focus();
517                     thisItem.removeClass('active');
518                  }else{
519                     thisItem.next().addClass('active');
520                     thisItem.next().find('a').focus();
521                     thisItem.removeClass('active');
522                  }
523               }else{
524                  $('.silencer li:nth-child(2)').addClass('active');
525                  $('.silencer li:nth-child(2)').find('a').focus();
526               }
527               window.addEventListener("keydown", function(e) {
528                   if([39, 40].indexOf(e.keyCode) > -1) {
529                       e.preventDefault();
530                   }
531               }, false);
532            }
533         }else if ( (e.keyCode == 38) ){
534            if(  $('.silencer:not(.hide) li a').length ){        
535               if(  $('.silencer li.active').length ){
536                  var thisItem = $('.silencer li.active');
537                  if ( thisItem.prev().index() === 0 ){
538                     var fieldInput = $('.search_box input[type=text]')
539				         var fieldInputText= $('.search_box input[type=text]').val();
540                     e.preventDefault();
541							fieldInput.val('');
542							fieldInput.val(fieldInputText);
543							fieldInput.focus();
544                     $('.silencer li').removeClass('active');
545                  }else if ( thisItem.prev().hasClass('move') ){
546                     thisItem.prev().prev().addClass('active');
547                     thisItem.prev().prev().find('a').focus();
548                     thisItem.removeClass('active');
549                  }else{
550                     thisItem.prev().addClass('active');
551                     thisItem.prev().find('a').focus();
552                     thisItem.removeClass('active');
553                  }
554               }
555               window.addEventListener("keydown", function(e) {
556                   if([39, 40].indexOf(e.keyCode) > -1) {
557                       e.preventDefault();
558                   }
559               }, false);
560            }
561         }
562      });
563      
564      $('html').click(function(e){
565          if (e.target == '.silencer' || $(e.target).parents('.silencer').length > 0) {
566          } else {
567              $('.silencer').addClass('hide')
568          }
569      });
570
571	$('.open_order_detail').click(function() {
572		$.nette.ajax({
573			  url: '?do=openOrderPopup&pk_tbl_order='+$(this).attr('data-order-id'),
574			  success: function(data) {
575			  	 
576			  },
577			  complete: function(data){
578			  		$('.orders_popup').css({'display' : 'table'}); 
579			  		$('.orders_popup').css({'opacity' : 1});
580			  }
581			});
582	});
583    
584    
585   $('.deliveryRadio.delivery_open_PPL').change(function(){
586	   initPPL();
587		$('.ppl_popup').css({'display' : 'table'}); 
588		$('.ppl_popup').css({'opacity' : 1});
589		return false;
590	});
591
592	$('#changePPL').click(function(){
593		$('.deliveryRadio.delivery_open_PPL').change();
594	});
595
596	$('#hledej_ppl').keyup(function(e){
597		var code = e.which;
598		if(code!=37&&code!=38&&code!=39&&code!=40){
599			var obj = $(this);
600			if(obj.val().length == 5) {
601				//$('#ppl_opacity').addClass('opacity'); 
602			}
603			$('.load_pop').addClass('active');
604	  		$('.list ul').hide();
605			$.nette.ajax({
606			  url: '?do=pplsearch&srch='+obj.val(),
607			  success: function(data) {
608			  	 
609			  },
610			  complete: function(data){
611			  		//$('.load_pop').removeClass('active');
612			  		//$('.list ul').show();
613			  }
614			})		
615		}
616	});
617
618
619
620	$('.deliveryRadio.delivery_open_CP').change(function(){
621		$('.cp_popup').css({'display' : 'table'}); 
622		$('.cp_popup').css({'opacity' : 1});
623		initCP();
624		if($('#user_adress').val() == 1) {
625			setTimeout(function() {
626				$('#hledej_cp').keyup();
627			}, 500);
628		}
629		return false;
630	});
631
632	$('#changeCP').click(function(){
633		$('.deliveryRadio.delivery_open_CP').change();
634      return false;
635	});
636
637	$('#hledej_cp').keyup(function(e){
638		var code = e.which;
639		if(code!=37&&code!=38&&code!=39&&code!=40){
640			var obj = $(this);
641			if(obj.val().length == 5) {
642				//$('#cp_opacity').addClass('opacity'); 
643			}
644			$('.load_pop').addClass('active');
645	  		$('.list ul').hide();
646			$.nette.ajax({
647			  url: '?do=cpsearch&srch='+obj.val()+'&withoutmap=1&hideClosest=1',
648			  success: function(data) {
649			  },
650			  complete: function(data){
651			  		//$('.load_pop').removeClass('active');
652			  		//$('.list ul').show();
653			  }
654			});	
655		}
656	}); 
657   
658   $('#footer_select').change(function(){
659		$(this).next().addClass('active'); 
660	});
661   
662     
663	$('.deliveryRadio.delivery_open_BALIKOVNA').change(function(){
664		$('.balikovna_popup').css({'display' : 'table'}); 
665		$('.balikovna_popup').css({'opacity' : 1});
666		initBalikovna();
667		if($('#user_adress').val() == 1) {
668			setTimeout(function() {
669				$('#hledej_balikovna').keyup();
670			}, 500);
671		}
672		return false;
673	});
674
675	$('#changeBALIKOVNA').click(function(){
676		$('.deliveryRadio.delivery_open_BALIKOVNA').change();
677      return false;
678	});
679
680	$('#hledej_balikovna').keyup(function(e){
681		var code = e.which;
682		if(code!=37&&code!=38&&code!=39&&code!=40){
683			var obj = $(this);
684			if(obj.val().length == 5) {
685				//$('#cp_opacity').addClass('opacity'); 
686			}
687			$('.load_pop').addClass('active');
688	  		$('.list ul').hide();
689			$.nette.ajax({
690			  url: '?do=balikovnasearch&srch='+obj.val()+'&withoutmap=1&hideClosest=1',
691			  success: function(data) {
692			  },
693			  complete: function(data){
694			  		//$('.load_pop').removeClass('active');
695			  		//$('.list ul').show();
696			  }
697			});	
698		}
699	});   
700	
701	$('.deliveryRadio.delivery_open_DPD').change(function(){
702		$('.dpd_popup').css({'display' : 'table'}); 
703		$('.dpd_popup').css({'opacity' : 1});
704		initDPD();
705		if($('#user_adress').val() == 1) {
706			setTimeout(function() {
707				$('#hledej_dpd').keyup();
708			}, 500);
709		}
710		return false;
711	});
712
713	$('#changeDPD').click(function(){
714		$('.deliveryRadio.delivery_open_DPD').change();
715      return false;
716	});
717
718	$('#hledej_dpd').keyup(function(e){
719		var code = e.which;
720		if(code!=37&&code!=38&&code!=39&&code!=40){
721			var obj = $(this);
722			if(obj.val().length == 5) {
723				//$('#dpd_opacity').addClass('opacity'); 
724			}
725			$('.load_pop').addClass('active');
726	  		$('.list ul').hide();
727			$.nette.ajax({
728			  url: '?do=dpdsearch&srch='+obj.val()+'&withoutmap=1&hideClosest=1',
729			  success: function(data) {
730			  },
731			  complete: function(data){
732			  		//$('.load_pop').removeClass('active');
733			  		//$('.list ul').show();
734			  }
735			});	
736		}
737	}); 
738	
739	$('.deliveryRadio.delivery_open_ZASILKOVNA').change(function(){
740		$('.zasilkovna_popup').css({'display' : 'table'}); 
741		$('.zasilkovna_popup').css({'opacity' : 1});
742		initZasilkovna();
743		if($('#user_adress').val() == 1) {
744			setTimeout(function() {
745				$('#hledej_zasilkovna').keyup();
746			}, 500);
747		}
748		return false;
749	});
750
751	$('#changeZASILKOVNA').click(function(){
752		$('.deliveryRadio.delivery_open_ZASILKOVNA').change();
753      return false;
754	});
755
756	$('#hledej_zasilkovna').keyup(function(e){
757		var code = e.which;
758		if(code!=37&&code!=38&&code!=39&&code!=40){
759			var obj = $(this);
760			if(obj.val().length == 5) {
761				//$('#zasilkovna_opacity').addClass('opacity'); 
762			}
763			$('.load_pop').addClass('active');
764	  		$('.list ul').hide();
765			$.nette.ajax({
766			  url: '?do=zasilkovnasearch&srch='+obj.val()+'&withoutmap=1&hideClosest=1',
767			  success: function(data) {
768			  },
769			  complete: function(data){
770			  		//$('.load_pop').removeClass('active');
771			  		//$('.list ul').show();
772			  }
773			});	
774		}
775	}); 
776
777    
778    $('#basket .basket_navigation ul li a.submit').click(function(){
779      $('#basket .align-center .btn.right')[0].click();
780   });
781    
782
783   $('#basket .doprava_platba .item.platba .box').click(function(){ 
784      if($(this).hasClass('active')){
785      }else{
786         $('#basket .doprava_platba .item.platba .box').removeClass('active');
787         $(this).addClass('active');
788      }  
789   }); 
790
791 
792   $('#basket .doprava_platba .item.doprava .box').click(function(){    
793      if( $(this).hasClass('popup_click')){
794         $('#basket .doprava_platba .item.doprava .box').removeClass('active');
795         $(this).find('a')[0].click();
796         $(this).addClass('active'); 
797         $('.reg_form .box.second').find('input[type=text]').val('')
798      }else if($(this).hasClass('active')){
799      }else{
800         $('#basket .doprava_platba .item.doprava .box').removeClass('active');
801         $(this).find('input[type=radio]')[0].click();
802         $(this).addClass('active');
803         $('.reg_form .box.second').find('input[type=text]').val('')
804      }                 
805   }); 
806   
807   
808   
809   
810   
811   
812   
813             
814    $('.detail .text .price .right_side .basket a.increment').click(function(){
815      var countValue = parseInt($(this).parents('.basket').find('#count').val());
816      countValue++
817      $(this).parents('.basket').find('#count').val(countValue);
818
819      return false;
820   });
821   
822   $('.detail .text .price .right_side .basket a.decrement').click(function(){
823      var countValue = parseInt($(this).parents('.basket').find('#count').val());
824      if(countValue == $('#minimum').val()){
825      
826      }else{
827         countValue--
828         $(this).parents('.basket').find('#count').val(countValue);
829      }
830
831      return false;
832   }); 
833   
834    
835   
836   
837
838   $('.delete_basket_item').click(function() {
839	   var pk_tbl_temporary_order = $(this).attr('item');
840	   $('.product_souhrn_box').addClass('opacity');
841
842	   $.nette.ajax({
843			url: '?do=deleteBasketItem&pk_tbl_temporary_order='+pk_tbl_temporary_order,
844			type: 'post',
845			cache: false,
846			success: function(data) {
847				$('.product_souhrn_box').removeClass('opacity');
848				
849				var n_total_price = '0 '+$('#mena').val();
850				if(data.n_total_price > '') {
851					var n_total_price = data.n_total_price;
852				}
853				if ($('.delete_basket_item').length == 1){
854				}else{
855					$('#set_total_price').html("<strong class='total'>"+n_total_price+"<span class='dph'>s DPH</span></strong>");
856					$('#n_total_rema').html(data.n_total_rema);
857					$('#basket_number').html(data.n_total_count);
858					$('#updatedPrice').html(data.n_total_price);
859					$('.basket_item_id_'+pk_tbl_temporary_order).remove();
860				}
861				$.nette.ajax({
862				  url: '?do=RefreshBasket',
863				  success: function(data) {
864				  },
865				  complete: function(data){
866				  }
867				});	
868	  		}	  		
869		});
870      return false;
871   });
872   
873      
874      $('#basket table.product_souhrn td.two .basket_service .service_checkbox').change(function(){
875	  		$('.product_souhrn_box').addClass('opacity');         
876	      
877         var pk_tbl_temporary_order = $(this).parents('tr:first').find('.pk_tbl_temporary_order').val();
878         var f = $(this).parents('tr:first').find('.service_checkbox,.service_h').serialize();
879         $.nette.ajax({
880				url: '?do=updateService&pk_tbl_temporary_order='+pk_tbl_temporary_order,
881				type: 'post',
882				data: f,
883				cache: false,
884				success: function(data) {
885					$('.product_souhrn_box').removeClass('opacity');
886
887					$('.count_price_'+pk_tbl_temporary_order).html(data.n_price_without_dph+"<sp
887an class='dph'>bez DPH</span>");
888					$('.count_price_dph_'+pk_tbl_temporary_order).html('<strong>'+data.n_price_with_dph+"<span class='dph'>s DPH</span></strong>");
889					$('#set_total_price').html("<strong class='total'>"+data.n_total_price+"<span class='dph'>s DPH</span></strong>");
890					$('#n_total_rema').html(data.n_total_rema);
891					$('#basket_number').html(data.n_total_count);
892					$('#updatedPrice').html(data.n_total_price);
893
894					$.nette.ajax({
895					  url: '?do=RefreshBasket',
896					  success: function(data) {
897					  },
898					  complete: function(data){
899					  }
900					});	
901					
902		  		},
903			});
904         return false;
905	   });
906   
907               
908     $( "#basket table.product_souhrn td.three .basket_count" ).keyup(function(){
909
910	  		$('.product_souhrn_box').addClass('opacity');         
911	  		
912         var newValue = $(this).val().replace('-', '');                           
913         $(this).val(newValue)                  
914         var preCountValue = $(this).attr('rel');
915         var countValue = $(this).val();
916			var pk_tbl_temporary_order = $(this).parent().find('.pk_tbl_temporary_order').val();
917			
918			$.nette.ajax({
919				url: '?do=changeBasketCount&pk_tbl_temporary_order='+pk_tbl_temporary_order+'&n_count='+countValue,
920				type: 'post',
921				cache: false,
922				success: function(data) {
923					$('.product_souhrn_box').removeClass('opacity');
924					
925					$('.count_price_'+pk_tbl_temporary_order).html(data.n_price_without_dph+"<span class='dph'>bez DPH</span>");
926					$('.count_price_dph_'+pk_tbl_temporary_order).html('<strong>'+data.n_price_with_dph+"<span class='dph'>s DPH</span></strong>");
927					$('#set_total_price').html("<strong class='total'>"+data.n_total_price+"<span class='dph'>s DPH</span></strong>");
928					$('#n_total_rema').html(data.n_total_rema);
929					$('#basket_number').html(data.n_total_count);
930					$('#updatedPrice').html(data.n_total_price);
931
932					$.nette.ajax({
933					  url: '?do=RefreshBasket',
934					  success: function(data) {
935					  },
936					  complete: function(data){
937					  }
938					});	
939
940		  		}
941			});
942			
943         $(this).attr('value', countValue);
944         if ( countValue == 1 ){
945            $('#basket table.product_souhrn td.three .decrement').addClass('opacity')   
946         }
947
948      });
949   
950   
951      //var timeoutIncrementBasket = "";
952      $('#basket table.product_souhrn td.three .increment').click(function(){
953			//clearTimeout(timeoutIncrementBasket);
954         var countValue = $(this).parents('td.three').find('.basket_count').val(); 
955         countValue++;
956	  		$('.product_souhrn_box').addClass('opacity');         
957         
958			$(this).parents('td.three').find('.basket_count').val(countValue);
959			$('#basket table.product_souhrn td.three .decrement').removeClass('opacity')
960         
961         var pk_tbl_temporary_order = $(this).parent().find('.pk_tbl_temporary_order').val();
962         
963         $.nette.ajax({
964				url: '?do=increment&pk_tbl_temporary_order='+pk_tbl_temporary_order,
965				type: 'post',
966				cache: false,
967				success: function(data) {
968					$('.product_souhrn_box').removeClass('opacity');
969
970					$('.count_price_'+pk_tbl_temporary_order).html(data.n_price_without_dph+"<span class='dph'>bez DPH</span>");
971					$('.count_price_dph_'+pk_tbl_temporary_order).html('<strong>'+data.n_price_with_dph+"<span class='dph'>s DPH</span></strong>");
972					$('#set_total_price').html("<strong class='total'>"+data.n_total_price+"<span class='dph'>s DPH</span></strong>");
973					$('#n_total_rema').html(data.n_total_rema);
974					$('#basket_number').html(data.n_total_count);
975					$('#updatedPrice').html(data.n_total_price);
976
977					$.nette.ajax({
978					  url: '?do=RefreshBasket',
979					  success: function(data) {
980					  },
981					  complete: function(data){
982					  }
983					});	
984					
985		  		},
986			});
987         return false;
988      });
989      //var timeoutDecrementBasket = "";
990      $('#basket table.product_souhrn td.three .decrement').click(function(){		       
991	      //clearTimeout(timeoutDecrementBasket);
992         var countValue = $(this).parents('td.three').find('.basket_count').val();
993         if ( countValue > 1 ) {
994            $('.product_souhrn_box').addClass('opacity');  
995            if ( countValue == 2 ){
996               $(this).addClass('opacity')
997            }
998            if ((countValue-1) < $(this).parents('td.three').find('.minimum').val()){
999					countValue = $(this).parents('td.three').find('.minimum').val();
1000				}else{
1001	            countValue--;
1002	         }
1003	         $(this).parents('td.three').find('.basket_count').val(countValue);
1004				
1005	         var pk_tbl_temporary_order = $(this).parent().find('.pk_tbl_temporary_order').val();
1006	         $.nette.ajax({
1007					url: '?do=decrement&pk_tbl_temporary_order='+pk_tbl_temporary_order,
1008					type: 'post',
1009					cache: false,
1010					success: function(data) {
1011
1012						$('.product_souhrn_box').removeClass('opacity');
1013
1014						$('.count_price_'+pk_tbl_temporary_order).html(data.n_price_without_dph+"<sp
1014an class='dph'>bez DPH</span>");
1015						$('.count_price_dph_'+pk_tbl_temporary_order).html('<strong>'+data.n_price_with_dph+"</strong><span class='dph'>s DPH</span>");
1016						$('#set_total_price').html("<strong class='total'>"+data.n_total_price+"<span class='dph'>s DPH</span></strong>");
1017						$('#n_total_rema').html(data.n_total_rema);
1018						$('#basket_number').html(data.n_total_count);
1019						$('#updatedPrice').html(data.n_total_price);
1020
1021						$.nette.ajax({
1022						  url: '?do=RefreshBasket',
1023						  success: function(data) {
1024						  },
1025						  complete: function(data){
1026						  }
1027						});	
1028
1029			  		},
1030				});
1031			}
1032         return false;
1033      }); 
1034      
1035      
1036      
1037      
1038   
1039         $('.spec_box p.open_login').click(function(){
1040            if ( $(this).hasClass('active') ){
1041               $(this).removeClass('active')
1042               $(this).parents('.spec_box').find('.login_form.hide').slideUp()
1043               $('.login_form.hide.pass').slideUp()
1044               $('.login_form .box table td .forgotten').removeClass('active')
1045            }else{
1046               $(this).addClass('active')
1047               $(this).parents('.spec_box').find('.login_form.hide').slideDown()         
1048            }
1049            return false; 
1050         });
1051         
1052         var loginFormBoxHeight = $('.login_form.hide').outerHeight() - 30;
1053         var loginFormBoxHeight2 = $('.login_form.hide2').outerHeight() - 92;
1054         $('.login_form.hide, .login_form.hide2').hide();
1055         $('.login_form.hide').css({'max-height' : loginFormBoxHeight, 'opacity' : 1})
1056         $('.login_form.hide2').css({'max-height' : loginFormBoxHeight2, 'opacity' : 1})
1057         
1058         $('.login_form .box table td .forgotten').click(function(){
1059            if( $('header').css("position") === "fixed"){
1060               var headerHeight = $('header').outerHeight() + 20;
1061            }else{
1062               var headerHeight = 20;
1063            }
1064            if ( $(this).hasClass('active') ){                   
1065               $(this).removeClass('active')
1066               $('.login_form .box table td .forgotten_2').removeClass('active')
1067               if ( $(this).parents().hasClass('spec_box') ){
1068                  $('.login_form.hide.pass').slideUp()
1069               }else{         
1070                  $('.login_form.hide').slideUp()
1071                  $('.login_form.hide2').slideUp()
1072               }
1073               
1074            }else{
1075               $(this).addClass('active')
1076               $('.login_form.hide').slideDown()
1077               if( $('#basket').html() > ''){
1078                  var offset = $('.login_form.hide.pass').offset().top - headerHeight;
1079               }else{
1080                  var offset = $('.login_form.hide').offset().top - headerHeight;
1081               }
1082               $('html,body').animate({ scrollTop: offset }, 1200);
1083            }
1084            return false; 
1085         });
1086         
1087         $('.login_form .box table td .forgotten_2').click(function(){
1088            if ( $(this).hasClass('active') ){
1089               $(this).removeClass('active')
1090               $('.login_form.hide2').slideUp()
1091            }else{
1092               $(this).addClass('active')
1093               $('.login_form.hide2').slideDown()
1094               if( $(window).width() < 768 ){
1095                  var offset = $('.login_form.hide2').offset().top - 64;
1096                  $('html,body').animate({ scrollTop: offset }, 1200);
1097               }
1098            }
1099            return false; 
1100         }); 
1101    
1102         setInterval(function () {
1103            $('#basket input[type="password"]').each(function(){
1104               $(this).val();
1105            });
1106      
1107         },500);
1108     
1109      //$('#basket .reg_form').find('.heslo_zaznam input').css({'cursor' : 'default'})
1110   
1111
1112      $( "#basket table.product_souhrn td.two a.main_link, #basket table.product_souhrn td.one a, #my_profile .bought table.product_souhrn td.two a.main_link, #my_profile .bought table.product_souhrn td.one a" ).hover(function() {
1113         $( this ).parents('tr').addClass( "hover_efekt" );
1114      }, function() {
1115         $( this ).parents('tr').removeClass( "hover_efekt" );
1116      }); 
1117      
1118      //$('#basket .reg_form').find('.firemni_zaznam input').css({'cursor' : 'default'})
1119         
1120      $('#basket.my_order .item p.title span.ikonka.car').click(function(){
1121   	  $(this).parents('.item').find('.zobrazit').click(); 
1122   	   })
1123   	   
1124      $('.zobrazit').each(function(){
1125    		$(this).click(function(){
1126          if($(this).parents('.item').hasClass('active')){
1127            $(this).parents('.item').removeClass('active');
1128            $(this).parents('.item').find('.box').slideUp();
1129            var thisTitle = $(this).attr('data-title')
1130            $(this).text(thisTitle);
1131          }else{
1132            setTimeout(function() {
1133               reloadImg();
1134            },400);
1135            $(this).parents('.item').addClass('active');
1136            $(this).parents('.item').find('.box').slideDown();
1137            var thisTitle = $(this).attr('data-title2')
1138            $(this).text(thisTitle);
1139          }                                                    
1140    			return false;
1141    		});
1142    	});  
1143      
1144      
1145      $('.under_main .description_box a.btn.open_text').click(function(){
1146         var thisText1 = $(this).attr('data-title')
1147         var thisText2 = $(this).attr('data-title2')
1148         if( $(this).hasClass('active') ){
1149            $(this).text(thisText1)
1150            $(this).removeClass('active')
1151            $(this).parents('.description_box').find('.description_hide').removeClass('active')
1152         }else{
1153            $(this).text(thisText2)
1154            $(this).addClass('active')
1155            $(this).parents('.description_box').find('.description_hide').addClass('active')
1156         }
1157    		return false;
1158         
1159    	});  
1160	
1161
1162
1163
1164    
1165   $('.check_email').change(function() {
1166	   var email = $(this).val();
1167	   if(email.length > 0) {
1168			$.nette.ajax({
1169				url: '?do=checkEmail&email='+email,
1170				type: 'get',
1171				cache: false,
1172				success: function(data) {
1173		  		},
1174		  		complete: function(data) {
1175			  		var ret = data['responseText'];
1176			  		var json = $.parseJSON(ret);
1177			  		if(json.response == 1) {
1178				  		$('.check_email').removeClass('emailFalse');
1179				  		$('.check_email').addClass('emailTrue');
1180			  		} else {
1181				  		$('.check_email').removeClass('emailTrue');
1182				  		$('.check_email').addClass('emailFalse');
1183			  		}
1184		  		}
1185			});    
1186	   }
1187   });
1188
1189
1190	
1191	  $('.deliveryRadio').each(function(){
1192	  	  $(this).change(function(){
1193           $('#basket .doprava_platba .item.platba.opacity').removeClass('opacity')
1194	  		  var paymentList = payment[$(this).val()].split(',');
1195	  		  var doprava = $('#delivery_price'+$(this).val()).val();
1196	  		  $('#delivery').val(doprava);
1197	  		  
1198	  		  $('#ulozenka-branch-select-options').hide();
1199			  if ($(this).attr('id') == 'Delivery11'){
1200				  $('#ulozenka-branch-select-options').show();
1201			  }
1202
1203	  		  //alert(paymentList);
1204	  		  //alert(delivery[$(this).val()]);
1205	  	  	  $('.paymentRadio').each(function(){
1206	  	  	  	  $(this).parents('div.box').hide();
1207	  	  	  });
1208	  	  	  var uz_zvoleno = false;
1209	 		  $('.paymentRadio').each(function(){
1210		 	  	  if (paymentList.indexOf($(this).val()) >= 0){
1211		 	  	  	  $(this).parents('div.box').show();
1212		 	  	  	  if (!uz_zvoleno){
1213			 	  	  	  $(this).click().click();
1214
1215			 	  	  	  Suma();
1216
1217			 	  	  	  uz_zvoleno = true;
1218			 	  	  }
1219		 	  	  }
1220		 	  });  	
1221	  	  });
1222	  });
1223	 // $('.deliveryRadio:first').change();
1224
1225	  $('.paymentRadio').each(function(){
1226	  	  $(this).change(function(){
1227	  		  $('.comgate_payments').hide();
1228	  		  var payment = $('#payment_price'+$(this).val()).val();
1229	  		  $('#payment').val(payment);
1230
1231	  		  var str = $(this).parents('.box:first').html().toLowerCase();
1232	  		  if (str.indexOf("comgate") >= 0){
1233	  		  		$('.comgate_payments').show();
1234	  		  }
1235
1236	  		  Suma();
1237
1238	  	  });
1239	  });
1240	  $('.paymentRadio:first').change();
1241	  
1242
1243	 
1244	 // objekt na kliknuti
1245	 $('.add_basket').unbind();
1246	 $('.add_basket').click(function(){  
1247
1248		var pustit = 1;
1249		$('.par_choose').each(function() {
1250			var name = $(this).attr('data-name');
1251			if ($('.'+name+'_choose').val() > ''){
1252			} else {
1253				pustit = 0;
1254			}	
1255		});
1256
1257		if(pustit == 0) {
1258         showControlPopup( '<p>' + $('#chooseParams').val() + '</p>' );
1259			return false;
1260		}	
1261
1262      var count = $('#count').val() > 0 ? $('#count').val() : 1;
1263		if (count < $('#minimum').val()){
1264			count = $('#minimum').val();
1265		}
1266      $('#count').val(count);
1267      
1268      var skladem = parseInt($('#skladem').val());
1269		var v_kosiku = parseInt($('#v_kosiku').val());
1270      var config = $('#sklady').val();
1271		if(config == 1) {
1272	      if (count > skladem) {
1273            showControlPopup( '<p>' + $('#notInStock').val() + '</p>' );
1274			}else if ((skladem - v_kosiku - count) < 0){
1275		      showControlPopup( '<p>' + $('#notInStock').val() + '</p>' );
1276	      }
1277      }
1278      if( $(window).width() > 1024 ){
1279			$.nette.ajax({
1280			  	url: $('#detail').attr('action'),
1281			  	data: $('#detail').serialize(),
1282			  	type: 'post',
1283			  	success: function(data) {
1284			  	},
1285			  	complete: function(){
1286					/*$.nette.ajax({
1287						  url: "?do=AddToBasket",
1288						  //data: $('#detail').serialize(),
1289						  type: 'post',
1290						  success: function(data) {
1291						  }
1292					});*/
1293			  }
1294			});		 
1295      }else{
1296      
1297		 // objekt s poctem kusu
1298		 //
1299			 $.nette.ajax({
1300			  url: $('#detail').attr('action'),
1301			  data: $('#detail').serialize(),
1302			  type: 'post',
1303			  success: function(data) {
1304				  
1305			  },
1306			  complete: function(){
1307					/*$.nette.ajax({
1308						  url: "?do=AddToBasket",
1309						  //data: $('#detail').serialize(),
1310						  type: 'post',
1311						  success: function(data) {
1312						  }
1313					});*/
1314	
1315			  }
1316			});		     
1317      }
1318
1319  	   $('#pocetZaNakup').html(precise_round(parseFloat($('#product_price').val())*parseInt($('.detail').find('#count').val()),0));
1320		if (count > 0){
1321			showBuyPopup();
1322		}
1323      return false;
1324	 });
1325	 
1326
1327	 koupit_button();
1328
1329	$('.param_choose').click(function() {
1330		var type = $(this).attr('data-name');
1331		$('.'+type+'_choose').val($(this).attr('data-value'));
1332		if ($(this).attr('data-price') > 0){
1333			var dec = $('#mena').val() == 'Kč' ? 0 : 2;
1334			/*if ($('#discount').val() > 0){
1335				var price = humanizeNumber(precise_round(($(this).attr('data-price')* (1 - ($('#discount').val()/100))),dec));
1336				var price_dph = humanizeNumber(precise_round((price*(1 + (2/100))),dec));;
1337			}else{*/
1338				var discount_price = humanizeNumber(precise_round($(this).attr('data-price-dph'),dec));
1339				var price = humanizeNumber(precise_round($(this).attr('data-price-discount'),dec));
1340				var price_dph = humanizeNumber(precise_round($(this).attr('data-price-dph-discount'),dec));;
1341			//}
1342			$('.price .main label').html(price_dph);
1343			$('.price .sub label').html(price);
1344			if ($('#discount').val() > 0){
1345				$('.price .discount label.dsct').html(discount_price);
1346				$('.price .discount label.save').html(humanizeNumber((precise_round($(this).attr('data-price-dph'),dec) - precise_round($(this).attr('data-price-dph-discount'),dec))));
1347			}
1348		}
1349		
1350	});
1351
1352
1353      
1354      
1355      
1356	  
1357	$('#sorting-form').on('submit',function() {
1358		$('.container').addClass('opacity');
1359	});
1360	 
1361	
1362
1363  $('#ic').blur(function(){
1364   var array = [];
1365   //array.push('kontrola0_1','kontrola0_2','kontrola0_4','kontrola0_3');
1366   	if ($('#ic').val() > ''){ 
1367        /*$.each(array, function(key, value) { 
1368          $('#'+value).attr('disabled','disabled'); 
1369        }); */     
1370        //$('#loading').append('<img src="/images/loader.gif" alt="" id="loader"/>');
1371        
1372        $.ajax({
1373          type: 'get',
1374          url: '/jquery/ares.php?ico='+$('#ic').val(),
1375          cache: false,
1376          success: function(data) {
1377            var json = $.parseJSON(data);
1378            $(json).each(function(i,val){
1379                $.each(val,function(k,v){
1380                  if ((k == 'firma')&&(v > '')&&(v != undefined)){
1381                    $('#firma').val(v);
1382                  }                    
1383                  if ((k == 'ulice')&&(v > '')&&(v != undefined)){
1384                    $('#ulice').val(v);
1385                  }                    
1386                  if ((k == 'psc')&&(v > '')&&(v != undefined)){
1387                    $('#psc').val(v);
1388                  }                    
1389                  if ((k == 'mesto')&&(v > '')&&(v != undefined)){
1390                    $('#mesto').val(v);
1391                  }                    
1392                                      
1393            });
1394            });
1395  
1396            /*$.each(array, function(key, value) { 
1397              $('#'+value).attr('disabled',''); 
1398            });  */   
1399            //$('#loader').remove(); 
1400            
1401          }
1402        });
1403      }    
1404  });
1405  
1406  /*------------------ Automatická kontrola file inputu  ------------------*/
1407  
1408  $("input[type=file]").change(function() {
1409	   var fileSize = (this.files[0].size/1024/1024); // Velikost souboru 
1410	   var maxSize = $(this).attr('max-size'); // Maximální velikost
1411	   
1412		var allowedExtensions = $(this).attr('allowed-extensions'); //Povolené přílohy
1413	   var fileExtension = allowedExtensions.split(',');
1414	   
1415	   if(fileSize >= maxSize && typeof(maxSize) != "undefined" && maxSize !== null  && maxSize !== '') {
1416			$(this).val('');
1417			showControlPopup("Maximální možná velikost je "+maxSize+" MB!");
1418         $(this).parents('.file').find('.uploadFile').val('');
1419			return false; 
1420	   } else if ($.inArray($(this).val().split('.').pop().toLowerCase(), fileExtension) == -1 && typeof(allowedExtensions) != "undefined" && allowedExtensions !== null && allowedExtensions !== '') {
1421			$(this).val('');
1422			showControlPopup("Podporované formáty: "+fileExtension.join(', ').toUpperCase());
1423         $(this).parents('.file').find('.uploadFile').val('');
1424			return false; 
1425	   }       
1426  });
1427  
1428  /*------------------------------------*/	
1429
1430	$('#orderitem .inp_count').each(function(){
1431		$(this).blur(function(){
1432			$('#orderitem').submit();
1433		});
1434	});
1435
1436    $('#container').css('visibility','visible');
1437    
1438    $('.prepocitat-arrows').click(function(){
1439      
1440      $('#orderitem').submit();
1441    });
1442
1443 
1444    $('#vypis2').click(function(){
1445      $.cookie('vypis', '1', options);
1446      
1447      window.location.reload();
1448      return false;
1449    });
1450    $('#vypis1').click(function(){
1451      $.cookie('vypis', '0', options);
1452      
1453      window.location.reload();
1454      return false;
1455    });
1456
1457
1458
1459    $('.delivery-list').find('.order-box-item label').each(function(){
1460    	$(this).click(function(){
1461    		
1462          var id = $(this).parent().find('.checkbox input').attr('id');
1463
1464          /*if ($(this).find('.checkbox input').is(':checked')){
1465            $('#deliveryPriceJS').val(parseInt($('#hiddenDeliveryPrice'+id).val()));
1466            SumFinalPrice();
1467          }*/
1468          //$(this).click(function(){
1469            //alert(parseInt($('#hiddenDeliveryPrice'+id).val()));
1470				var obj = $(this).parent();
1471            $('.delivery-list').find('.order-box-item').each(function(){
1472            	$(this).removeClass('checked');
1473            	//$(this).find('.checkbox input').prop('checked',false);
1474            });
1475            
1476            obj.parent().addClass('checked');
1477            
1478            //$('#'+id).prop('checked');
1479            
1480            //$(this).find('.checkbox input').click();
1481
1482            var id = $(this).parent().find('.checkbox input').attr('id').replace('delivery','');
1483            $('#deliveryPriceJS').val(parseInt($('#hiddenDeliveryPrice'+id).val()));
1484            SumFinalPrice();
1485            
1486            
1487          //});
1488	   });
1489    });
1490
1491    $('.payment-list').each(function(){
1492      $(this).find('input').each(function(){
1493        if ($(this).attr('type') == 'radio'){
1494          var id = $(this).attr('id').replace('payment','');
1495          if ($(this).is(':checked')){
1496            //alert($('#hiddenPaymentPrice'+id).val());
1497            $('#paymentPriceJS').val(parseInt($('#hiddenPaymentPrice'+id).val()));
1498            SumFinalPrice();
1499          }
1500          $(this).click(function(){
1501            var id = $(this).attr('id').replace('payment','');
1502            $('#paymentPriceJS').val(parseInt($('#hiddenPaymentPrice'+id).val()));
1503            SumFinalPrice();
1504
1505				var obj = $(this);
1506            $('.payment-list').find('.order-box-item').each(function(){
1507            	$(this).removeClass('checked');
1508            });
1509            
1510            obj.parent().parent().parent().addClass('checked');
1511
1512          });
1513        }
1514      });
1515    });
1516
1517    // popis dostupnosti
1518    $('.dostupnostPopUp').each(function(){
1519      $(this).hover(
1520        function () {
1521          $(this).parent().find('.dostupnostPopUpText').css('display','inline');
1522        }, 
1523        function () {
1524          $(this).parent().find('.dostupnostPopUpText').css('display','none');
1525        }
1526      );
1527    })
1528
1529
1530
1531
1532	 $('#deliveryCheck').click(function(){
1533	 	if ($(this).is(':checked')){
1534	 		$('.dodaci_adresa').show();
1535	 	}else{
1536	 		$('.dodaci_adresa').hide();
1537		   $('.dodaci_adresa').find('input').each(function(){
1538	        if (($(this).attr('type') == 'text')&&($(this).attr('id').indexOf('odaci_') > 0)){
1539			  	  $(this).val('');
1540			  }
1541			});
1542	 	}
1543
1544	 });
1545
1546   
1547});
1548
1549$(window).resize(function(){
1550
1551   $('article table').each(function(){
1552      var tableWidth = $(this).width();
1553      var parentWidth = $(this).parent().width();
1554      if( tableWidth > parentWidth ){
1555         $(this).addClass('over')
1556      }
1557    });
1558});
1559
1560
1561if( $('#MyGmaps').length ){
1562	
1563	var lng = $('#lng_1').val();
1564	var lat = $('#lat_1').val();
1565	var zoom = $('#zoom_1').val();
1566	
1567	if($('#MyGmaps').hasClass('pl_pobocka')) {
1568		var lng = $('#lng_4').val();
1569		var lat = $('#lat_4').val();
1570		var zoom = $('#zoom_4').val();
1571	} else if($('#MyGmaps').hasClass('ru_pobocka')) {
1572		var lng = $('#lng_5').val();
1573		var lat = $('#lat_5').val();
1574		var zoom = $('#zoom_5').val();
1575	}
1576         
1577	var center = SMap.Coords.fromWGS84(lng,lat);
1578	var m = new SMap(JAK.gel("MyGmaps"), center, zoom);
1579	
1580	m.addDefaultLayer(SMap.DEF_BASE).enable();
1581	m.addDefaultControls();
1582	
1583	var layer = new SMap.Layer.Marker();
1584	m.addLayer(layer);
1585	layer.enable();
1586	
1587	var options = {
1588	   url: '/img/map_pointer.svg'
1589	};
1590	var marker = new SMap.Marker(center, "myMarker", options);
1591	layer.addMarker(marker);         
1592	
1593	var mouseControl = null;
1594	var controls = m.getControls();
1595	
1596	for (var i = 0; i < controls.length; i++) {
1597	   if (controls[i] instanceof SMap.Control.Mouse) {
1598	      mouseControl = controls[i];
1599	   }
1600	}
1601	mouseControl.configure(SMap.MOUSE_PAN | SMap.MOUSE_ZOOM);
1602	   
1603   window.load = function() {
1604	  Loader.async = true;
1605	  Loader.load(null, null, createUrl);
1606	}	
1607	window.createUrl = function() {
1608		var destinationCoords = SMap.Coords.fromWGS84(lng,lat);
1609		var url = new SMap.URL.Route().addDestination(destinationCoords);
1610		document.getElementById("mapsUrl").setAttribute("href", url.toString());
1611		//document.getElementById("mapsUrl2").setAttribute("href", url.toString());
1612	}
1613	load();   
1614}else{
1615	//var destinationCoords = SMap.Coords.fromWGS84(lng,lat);
1616	//var url = new SMap.URL.Route().addDestination(destinationCoords);
1617	//document.getElementById("mapsUrl2").setAttribute("href", url.toString());
1618}
1619
1620
1621$(".swipebox").swipebox({
1622   selector: '.swipebox',
1623   afterOpen: function(){
1624     var $selectorClose = $("#swipebox-close");
1625     var clickAction = "touchend click";
1626
1627     $selectorClose.unbind(clickAction);
1628
1629     $selectorClose.bind(clickAction, function(event){
1630       event.preventDefault();
1631       event.stopPropagation();
1632
1633       $.swipebox.close();
1634     });
1635   }
1636});
1637
1638
1639
1640$('html').click(function(e){
1641   var thisClass = $(e.target).attr('id')
1642   if( (thisClass == 'swipebox-close') || (thisClass == 'swipebox-prev') || (thisClass == 'swipebox-next') || (thisClass == 'swipebox_download')){   
1643   }else{
1644      $("#swipebox-close").click();
1645      $('.swipebox_download').remove();
1646   }
1647}); 
1648
1649if($('#download_swipebox_button').val() == 1) {
1650	setInterval(function() {
1651	   if ( $('#swipebox-slider .slide.current').is(':visible') ) {
1652	     if ( $('#swipebox-slider .slide.current #swipebox_download').length > '' ){
1653	     }else{
1654	      var thisText = $('#language_download').val();
1655	      var thisSrc = $('#swipebox-slider .slide.current').find('img').attr('src')
1656	      $('#swipebox-slider .slide.current').append('<a href="'+thisSrc+'" download class="btn inline typ_14 small" id="swipebox_download">'+thisText+'</a>')
1657	     }
1658	     
1659	   }  
1660	},400);
1661}
1662
1663/*
1664* kontrola formularu
1665*/
1666function ControlForm(form){
1667  var errorMessage = '';
1668  var errorMessageUdaje = '';
1669  var errorMessageCaptcha = '';
1670  var obj = $('#'+form);
1671
1672  obj.find('input[type="text"]').each(function(){
1673	  $(this).val($(this).val().trim());
1674      
1675  });   
1676
1677  //var obj = $('#'+form);
1678/*
1679  var email = $('#form-email').val();
1680  var zprava = $('#form-zprava').val();
1681  var jmeno = $('#form-jmeno').val();
1682  var prijmeni = $('#form-prijmeni').val();
1683  var mesto = $('#form-mesto').val();
1684*/
1685   if (form == 'product_form'){
1686	   /*var diameter = false;
1687	   $('.diameter').each(function(){
1688		   if ($(this).is(':checked')){
1689			   diameter = true; 
1690			}
1691		});
1692		if (!diameter) {
1693	      errorMessage = errorMessage + '<p>' + $('#diameter_validation').val() + '</p>';
1694	   }
1695	   var color = false;
1696	   $('.color').each(function(){
1697		   if ($(this).is(':checked')){
1698			   color = true; 
1699			}
1700		});
1701		if (!color) {
1702	      errorMessage = errorMessage + '<p>' + $('#color_validation').val() + '</p>';
1703	   }*/
1704   }
1705
1706
1707  obj.find('input').each(function(){
1708    if ($(this).attr('data-validation') > ''){
1709      if (($(this).attr('type') == 'text')||(($(this).attr('type') == 'password'))){
1710			if ($(this).val() == ''){
1711          if ($(this).attr('name').search('blabol') != -1){
1712            if(!EmailControl($(this).val())){
1713              errorMessage = errorMessage + '<p>' + $(this).attr('data-validation') + '</p>';
1714            }
1715          }else{
1716              if ((($(this).attr('data-name') == 'firma')||($(this).attr('name') == 'blabol')||($(this).attr('data-name') == 'blabol')||($(this).attr('data-name') == 'jmeno')||($(this).attr('id') == 'prijmeni')||($(this).attr('data-name') == 'ulice')||($(this).attr('data-name') == 'mesto')||($(this).attr('data-name') == 'psc')||($(this).attr('data-name') == 'cp'))&&((!$('#fact').is(':checked')))){
1717                //if (errorMessage == ''){
1718                //  errorMessage = '\Fakturační adresa:\n' + $(this).attr('data-validation') + '\n';
1719                //}else{
1720                  errorMessage = errorMessage + '<p>' + $(this).attr('data-validation') + '</p>';
1721                //}
1722              }else if (($(this).attr('data-name') == 'slogin')/*||($(this).attr('id') == 'password_strength')*/){
1723                //if (errorMessageUdaje == ''){
1724                //  errorMessageUdaje = '\nPřihlašovací údaje:\n' + $(this).attr('data-validation') + '\n';
1725                //}else{
1726                  errorMessageUdaje = errorMessageUdaje + '<p>' + $(this).attr('data-validation') + '</p>';
1727                //}
1728		        }else if ($(this).attr('data-name') == 'telefon'){
1729		        		  
1730                    //
1731		        		//alert('a');
1732			        var telefon = $(this).val();
1733			        telefon = telefon.replace(/[^0-9]/g, '');
1734
1735                 if ((telefon.length < 9)) { 
1736                   errorMessage = errorMessage + '<p>' + $(this).attr('data-validation') + '</p>';
1737                 }
1738			                
1739              }else{/*else if (($(this).attr('id') != 'firma')&&($(this).attr('id') != 'email')&&($(this).attr('id') != 'telefon')&&($(this).attr('id') != 'jmeno')&&($(this).attr('id') != 'prijmeni')&&($(this).attr('id') != 'ulice')&&($(this).attr('id') != 'mesto')&&($(this).attr('id') != 'psc')&&($(this).attr('id') != 'cp')){*/
1740                errorMessage = errorMessage + '<p>' + $(this).attr('data-validation') + '</p>';
1741              }
1742          }
1743     }else if ((  $(this).attr('data-name') == 'psc') || ($(this).attr('data-name') == 'dodaci_psc')  ){
1744	  	
1745
1746	  
1747	  
1748	  /*}else if ( ($(this).attr('id') == 'blabol') && ( $('body .login_form').length )  ){ 
1749		  if($(this).hasClass('check_email') && $(this).hasClass('emailFalse')) {
1750			  errorMessage = errorMessage + '<p>' + $('#blabol_language').val() + '</p>';
1751		  }*/
1752		  
1753     }else if ($(this).attr('data-name') == 'telefon' || $(this).attr('name') == 'telefon' || $(this).attr('name') == 'phone'){
1754     		//
1755     		//alert('a');
1756        var telefon = $(this).val();
1757        telefon = telefon.replace(/[^0-9]/g, '');
1758        if ((telefon.length < 9)) { 
1759	        errorMessage = errorMessage + '<p>' + $('#telefon_language').val() + '</p>';
1760        }      
1761          
1762      }else if ($(this).attr('name') == 'blabol' || $(this).attr('data-name') == 'blabol'){
1763     	    //alert('b')
1764          if(!EmailControl($(this).val())){ 
1765		     errorMessage = errorMessage + '<p>' + $('#blabol_language').val() + '</p>';
1766		  }   
1767      }
1768    }
1769	}else{
1770      if ($(this).attr('data-name') == 'telefon' || $(this).attr('name') == 'telefon' || $(this).attr('name') == 'phone'){
1771     		//
1772     		//alert('a');
1773         if ($(this).val() != ''){
1774              var telefon = $(this).val();
1775              telefon = telefon.replace(/[^0-9]/g, '');
1776              if ((telefon.length < 9)) { 
1777                 errorMessage = errorMessage + '<p>' + $('#telefon_language').val() + '</p>';
1778              } 
1779            }
1780      }else if ($(this).attr('name') == 'blabol' || $(this).attr('data-name') == 'blabol'){
1781     	    //alert('b')
1782          if(!EmailControl($(this).val())){ 
1783		     errorMessage = errorMessage + '<p>' + $('#blabol_language').val() + '</p>';
1784		  }     
1785      }else if ($(this).attr('data-name') == 'ico'){
1786		   if ($('#firma').val() != '' && $('#ico').val() == ''){
1787            errorMessage = errorMessage + '<p>' + $('#ic_language').val() + '</p>';
1788         }
1789      }
1790   
1791   }
1792  });
1793  
1794   if(  (obj.find('#password_strength').length)  && ( obj.find('#password_strength').attr('data-validation') > '')   )  {  
1795  
1796	  /*if(obj.find('#password_strength').val().length == 0) {
1797	      errorMessage = errorMessage + '<p>' + $("#password_strength").attr('data-validation') + '!</p>';
1798	  }
1799	  
1800	  if($('#repassword').length) {  
1801		  if( (obj.find('#repassword').val().length == 0) ) {
1802		      errorMessage = errorMessage + '<p>' + $("#repassword").attr('data-validation') + '!</p>';
1803		   }
1804	  }*/
1805	  
1806	  if(obj.find('#password_strength').val().length < 8) {
1807	      errorMessage = errorMessage + '<p>' + $('#delka_hesla_language').val() + '!</p>';
1808	   }
1809	  
1810	  re = /[0-9]/;
1811	      if(!re.test(obj.find('#password_strength').val())) {
1812	        errorMessage = errorMessage + '<p>' + $('#cisla_hesla_language').val() + '!</p>';
1813	      }
1814	  
1815	  re = /[a-z]/;
1816	     	if(!re.test(obj.find('#password_strength').val())) {
1817	        errorMessage = errorMessage + '<p> ' + $('#male_pismeno_hesla_language').val() + '!</p>';
1818	      }
1819	  re = /[A-Z]/;
1820	     if(!re.test(obj.find('#password_strength').val())) {
1821	        errorMessage = errorMessage + '<p>' + $('#velke_pismeno_hesla_language').val() + '!</p>';
1822	      }
1823	   /*re = /[!#$%&?]/;
1824	      if(!re.test(obj.find('#password_strength').val())) {
1825	        errorMessage = errorMessage + '<p>' + $('#znaky_hesla_language').val() + '!</p>';
1826	   }*/
1827	   if ((obj.find('#password_strength').val() > '')&&(obj.find('#repassword').val() > '')&&(obj.find('#repassword').val() != undefined)&&(obj.find('#password_strength').val() != undefined)){
1828		  if (obj.find('#password_strength').val() != obj.find('#repassword').val()){
1829			  errorMessage = errorMessage + '<p>' + $('#kontrola_hesla_language').val() + '</p>';
1830
1831		  }
1832	  }
1833	} 
1834  
1835  obj.find('select').each(function(){ 
1836      //alert('test')
1837      if ($(this).attr('data-validation') > ''){
1838         if( $(this).val() === "" || $(this).val() == 'empty' || $(this).val() == 'null' || !$(this).val()   ){
1839            errorMessage = errorMessage + '<p>' + $(this).attr('data-validation') + '</p>';
1840         }
1841      }
1842   });
1843  
1844
1845  
1846  if ( obj.find('input[data-name="ulice"] ').val() > ''){
1847	  var ulice = obj.find('input[data-name="ulice"] ').val();
1848  	  //if(!$('#ulice').val().match(/[0-9]$/)) {	
1849  	  if ((ulice.indexOf('1') >= 0)||(ulice.indexOf('1') >= 0)||(ulice.indexOf('2') >= 0)||(ulice.indexOf('3') >= 0)||(ulice.indexOf('4') >= 0)||(ulice.indexOf('5') >= 0)||(ulice.indexOf('6') >= 0)||(ulice.indexOf('7') >= 0)||(ulice.indexOf('8') >= 0)||(ulice.indexOf('9') >= 0)){
1850  	  }else{
1851  	  	  errorMessage = errorMessage + '<p>' + $('#ulice_language').val() + '</p>';
1852  	  }
1853  }
1854  
1855  if (obj.find('input[data-name="dodaci_ulice"]').val() > ''){
1856	  var ulice = obj.find('input[data-name="dodaci_ulice"]').val();
1857  	  //if(!$('#ulice').val().match(/[0-9]$/)) {	
1858  	  if ((ulice.indexOf('1') >= 0)||(ulice.indexOf('1') >= 0)||(ulice.indexOf('2') >= 0)||(ulice.indexOf('3') >= 0)||(ulice.indexOf('4') >= 0)||(ulice.indexOf('5') >= 0)||(ulice.indexOf('6') >= 0)||(ulice.indexOf('7') >= 0)||(ulice.indexOf('8') >= 0)||(ulice.indexOf('9') >= 0)){
1859  	  }else{
1860  	  	  errorMessage = errorMessage + '<p>' + $('#ulice_dodaci_language').val() + '</p>';
1861  	  }
1862  }
1863
1864  
1865  if (obj.find('input[data-name="psc"]').val() > ''){
1866	  var psc = obj.find(' input[data-name="psc"] ').val();
1867  	  psc = psc.replace(' ','');
1868  	  //if(!$('#ulice').val().match(/[0-9]$/)) {	
1869  	  if (psc.length == 5){
1870  	  }else{
1871  	  	  errorMessage = errorMessage + '<p>' + $('#psc_language').val() + '</p>';
1872  	  }
1873  }
1874  
1875  
1876  if (obj.find('input[data-name="dodaci_psc"]').val() > ''){
1877	  var psc = obj.find('input[data-name="dodaci_psc"]').val();
1878  	  psc = psc.replace(' ','');
1879  	  //if(!$('#ulice').val().match(/[0-9]$/)) {	
1880  	  if (psc.length == 5){
1881  	  }else{
1882  	  	  errorMessage = errorMessage + '<p>' + $('#psc_dodaci_language').val() + '</p>';
1883  	  }
1884  }
1885
1886
1887  errorMessageDod = "";
1888  if (obj.find('#deliveryCheck').is(':checked')){
1889    
1890    $('#'+form).find('input').each(function(){
1891      if ($(this).attr('man') > ''){
1892        if (($(this).attr('type') == 'text')&&($(this).attr('id').indexOf('odaci_') > 0)){
1893          if ($(this).val() == ''){
1894              //if (errorMessageDod == ''){
1895              //  errorMessageDod = '\n\Fakturační údaje:\n' + $(this).attr('man') + '\n';
1896              //}else{
1897                errorMessageDod = errorMessageDod + '<p>' + $(this).attr('man') + '</p>';
1898              //}
1899          }
1900        }
1901      }
1902    });
1903    
1904  }
1905  
1906  
1907  if ($('#basket').length){
1908  }else{
1909    var countLetter1 = 10;
1910    var countLetter2 = 10;
1911    $('#'+form).find('input.special_control').each(function(){
1912      if (  $(this).val() > '' ){
1913         countLetter2--
1914      }  
1915    })
1916    
1917    if ( countLetter1 != countLetter2 ){
1918      $('#'+form).find('input.special_control').each(function(){
1919         if (  $(this).val() > '' ){
1920         }else{
1921            errorMessageDod = errorMessageDod + '<p>' + $(this).attr('data-rg') + '</p>';
1922         }    
1923      })
1924    }
1925  }
1926  
1927  
1928  $('#'+form).find('textarea').each(function(){
1929    if ($(this).attr('data-validation') > ''){
1930      if ($(this).val() == ''){
1931        errorMessage = errorMessage + '<p>' + $(this).attr('data-validation') + '</p>';
1932      } 
1933    }
1934  });
1935
1936  $('#'+form).find('input[type="checkbox"]').each(function(){
1937    if ($(this).attr('data-validation') > ''){
1938      if (!$(this).is(':checked')){
1939        errorMessage = errorMessage + '<p>' + $(this).attr('data-validation') + '</p>';
1940      } 
1941    }
1942  });
1943  
1944  
1945  $('#'+form).find('input[type="radio"]').each(function(){
1946    var thisName = $(this).attr('name');
1947    if ($(this).attr('data-validation') > ''){
1948      if ( $('#'+form).find('input[name="'+thisName+'"]').is(':checked')   ){
1949      }else{
1950        errorMessage = errorMessage + '<p>' + $(this).attr('data-validation') + '</p>';
1951      } 
1952    }
1953  });
1954  
1955   $('#'+form).find('input[type="file"]').each(function(){
1956    if ($(this).attr('data-validation') > ''){
1957      if ($(this).val() == ''){
1958        errorMessage = errorMessage + '<p>' + $(this).attr('data-validation') + '</p>';
1959      } 
1960    }
1961  });
1962
1963    if ((errorMessage > '') || (errorMessageDod > '') || (errorMessageCaptcha > '') || (errorMessageUdaje > '')) {
1964        //errorMessage = "<h1>Chyba!</h1><p>Musíte vyplnit všechny povinné pole.<br />Chybně vyplněné pole jsou: </p><div class='messages'>" + errorMessage + errorMessageUdaje + errorMessageDod + errorMessageCaptcha +"</div>";
1965        //PopupMessages(errorMessage,300,200,'errorMessages');
1966        showControlPopup(errorMessage + errorMessageDod + errorMessageUdaje, form);
1967        //alert(errorMessage+errorMessageDod+errorMessageUdaje);
1968        return false;
1969    } else {
1970        if ($('#' + form).find('.myCaptcha').val() != undefined) {
1971            if (allowSubmit){
1972                return true;
1973            }else {
1974                if ($('#' + form).find('.g-recaptcha-response').val() > '') {
1975                    allowSubmit = true;
1976                    $('#' + form).submit();
1977                } else {
1978                    var thisreCaptchaID = $('#' + form).find('.myCaptcha').attr('data-widget-id')
1979                    event.preventDefault();
1980                    grecaptcha.execute(thisreCaptchaID);
1981                    setTimeout(function(){
1982                        if (grecaptcha.getResponse() > '') {
1983                            allowSubmit = true;
1984                            $('#' + form).submit();
1985                        }
1986                    },300);
1987                }
1988            }
1989
1990        }else {
1991            return true;
1992        }
1993
1994
1995    }
1996  return false;
1997}
1998
1999
2000function EmailControl(f){
2001    if ((f=='' || 
2002	 		f=='[email protected]') || 
2003	 		f.indexOf('..') != -1 || 
2004	 		f.indexOf('.@') != -1 || 
2005	 		f.indexOf('@.') != -1 || 
2006	 		(
2007	 			f.indexOf('@') < 1 || 
2008	 			f.indexOf('@') != f.lastIndexOf('@') || 
2009	 			f.lastIndexOf('.') < f.lastIndexOf('@')+2 || 
2010	 			f.lastIndexOf('.') > (f.length-3) || 
2011	 			f.lastIndexOf('.') < (f.length-5) 
2012	 		)
2013	 	 ){
2014       return false;
2015      }
2016    if ((f.indexOf('ř') > -1) || (f.indexOf('ě') > -1) || (f.indexOf('š') > -1) || (f.indexOf(' ') > -1) || (f.indexOf('č') > -1) || (f.indexOf('ž') > -1) || (f.indexOf('ý') > -1) || (f.indexOf('á') > -1) || (f.indexOf('í') > -1) || (f.indexOf('é') > -1) || (f.indexOf('ů') > -1) || (f.indexOf('ú') > -1)){
2017       return false;
2018    }
2019    return true;
2020}
2021
2022function DelCountBasket(ID){
2023  document[ID].count.value = 0;
2024  document[ID].submit();
2025}
2026
2027function printDetail(url){
2028  window.open(url);
2029  //alert(url);
2030}
2031
2032function ControlNumber(){
2033     if ((event.keyCode <48) || (event.keyCode >57)) event.returnValue = false;
2034}
2035
2036function OpenWindow(sUrl,sParam){
2037  window.open(sUrl,"_blank",sParam);
2038}	
2039
2040
2041/*
2042* lightbox 
2043*/ 
2044
2045function checkDeliveryPayment() {
2046
2047   var mam_delivery = false;
2048   
2049   $(".deliveryRadio").each(function() {
2050      if($(this).is(":checked")) {
2051         mam_delivery = true;
2052      }
2053   });
2054   
2055   var mam_payment = false;
2056   $(".paymentRadio").each(function() {
2057      if($(this).is(":checked")) {
2058         mam_payment = true;
2059      }
2060   });
2061   
2062   if(mam_delivery == true && mam_payment == true) {
2063      $('#delivery').submit();   
2064   } else {
2065      showControlPopup( '<p>' + $('#delivery_payment_control').val() + '</p>' );
2066   }
2067   
2068   return false;
2069
2070}   
2071
2072
2073function hideDialog(){
2074  $('#addbuy').hide('slow');
2075}
2076function SumFinalPrice(){
2077  //alert($('#deliveryPriceJS').val());
2078  $('#finalPrice').html((parseInt($('#pricewithdph').val()) + parseInt($('#deliveryPriceJS').val())  + parseInt($('#paymentPriceJS').val()) ) + ' ' + $('#mena').val());  
2079}
2080
2081
2082
2083$.fn.getNodeName = function() {
2084  // returns the nodeName of the first matched element, or ""   
2085  return this[0] ? this[0].nodeName : ""; 
2086}; 
2087
2088$(window).on('load', function() {  
2089
2090
2091   setTimeout(function() {
2092      $('body').removeClass('preload')
2093   },450)
2094   
2095   
2096   reloadImg();
2097   
2098
2099      $('.reg_form .box.long .anotation.c_click span.text').click(function(){
2100         if( $('.reg_form .box.long .anotation.c_click').hasClass('active') ){
2101            $('.reg_form .box.long .anotation.c_click').removeClass('active')
2102            //$('.reg_form .box.long p.anotation.c_click input').click();
2103            if ( $(window).width() < 768 ){
2104               $('.reg_form').find('.heslo_zaznam').css({'display' : 'none'});
2105            }else{
2106               $('.reg_form').find('.heslo_zaznam').css({'display' : 'none'});
2107            }
2108            $('.reg_form').find('.heslo_zaznam input').attr('value', '').removeAttr('data-validation').attr('readonly', 'readonly');
2109   
2110            $('.reg_form').find('.heslo_zaznam.repass input').attr('value', '').removeAttr('data-validation').attr('readonly', 'readonly');
2111            
2112         }else{
2113            var passText = $('#heslo_language').val();
2114            var repassText = $('#reheslo_language').val();
2115            $('.reg_form .box.long .anotation.c_click').addClass('active')
2116            //$('.reg_form .box.long p.anotation.c_click input').click();
2117            $('.reg_form').find('.heslo_zaznam').css({'opacity' : 1});
2118            if ( $(window).width() < 768 ){
2119               $('.reg_form').find('.heslo_zaznam').css({'display' : 'block'});
2120            }else{
2121               $('.reg_form').find('.heslo_zaznam').css({'display' : 'table-cell'});
2122            }
2123            $('.reg_form').find('.heslo_zaznam input').attr('data-validation', passText).removeAttr('readonly')
2124   			
2125   			$('.reg_form').find('.heslo_zaznam.repass input').attr('data-validation', repassText).removeAttr('readonly')
2126   			
2127         }
2128      });
2129});
2130
2131
2132$( window ).resize(function() {  
2133
2134
2135    $('img.lazy:not(.bg)').unveil(200)
2136    
2137    $('img.lazy.bg').each(function(){
2138       var thisItem = $(this);
2139       thisItem.unveil(200, function() {
2140         thisItem.on('load', function() { 
2141          var thisSrc = this.getAttribute('src')
2142          this.parentElement.setAttribute('style','background-image: url("'+thisSrc+'")');
2143        });
2144      });
2145   });
2146 
2147    $('.img_hide.bg:not(.lazy)').each(function(){
2148	 	var thisSrc = $(this).attr('src')
2149		$(this).parent().attr('style','background-image: url("'+thisSrc+'")');
2150	 });
2151
2152
2153});
2154
2155
2156function Suma(){
2157	var cena = (parseFloat($('#delivery').val()*1.21) + parseFloat($('#payment').val()*1.21) + parseFloat($('#suma').val()));
2158	$('#celkova_cena').html(humanizeNumber(precise_round(cena,0))+' '+$('#mena').val());
2159}
2160
2161function humanizeNumber(n) {
2162  n = n.toString()
2163  while (true) {
2164    var n2 = n.replace(/(\d)(\d{3})($|,|\.)/g, '$1 $2$3')
2165    if (n == n2) break
2166    n = n2
2167  }
2168  return n
2169}
2170
2171
2172function showControlPopup(text,id_form){
2173   $('.web_container').attr('aria-hidden', 'true')
2174	$('.control_popup .text').html(text);
2175	$('.control_popup').css({'display' : 'table'}); 
2176	setTimeout(function () {
2177		$('.control_popup').css({'opacity' : 1});
2178	},10)											
2179   $('.control_popup').find('.close').focus();
2180   $('.control_popup').find('input[type="hidden"]').val(id_form)      
2181   findInsiders($('.control_popup'));
2182}
2183
2184function showBuyPopup(text,id_form){
2185   $('.web_container').attr('aria-hidden', 'true')
2186	$('.buy_popup').css({'display' : 'table'}); 
2187	setTimeout(function () {
2188		$('.buy_popup').css({'opacity' : 1});
2189	},10)	
2190   
2191   $('.buy_popup').find('input[type="hidden"]').val(id_form)      
2192   findInsiders($('.buy_popup'));										
2193
2194}
2195function showGiftPopup(text,id_form){
2196   $('.web_container').attr('aria-hidden', 'true')
2197	$('.gift_popup').css({'display' : 'table'}); 
2198	setTimeout(function () {
2199		$('.gift_popup').css({'opacity' : 1});
2200	},10)		
2201   
2202   $('.gift_popup').find('input[type="hidden"]').val(id_form)      
2203   findInsiders($('.gift_popup'));									
2204
2205}
2206
2207function showTarifPopup(){
2208   $('.web_container').attr('aria-hidden', 'true')
2209	$('.tarif_popup').css({'display' : 'table'}); 
2210	setTimeout(function () {
2211		$('.tarif_popup').css({'opacity' : 1});
2212	},10);
2213   
2214   $('.tarif_popup').find('input[type="hidden"]').val(id_form)      
2215   findInsiders($('.tarif_popup'));										
2216
2217}
2218
2219function reloadImg(){
2220   
2221
2222   $('img.lazy:not(.bg)').unveil(150)
2223   
2224   $('img.lazy:not(.bg)').each(function(){
2225      var thisItem = $(this);
2226      var thisItemOffset = thisItem.offset().top;
2227      if ($(window).scrollTop() > thisItemOffset - 90) {
2228         var thisSrc = $(this).attr('data-src')
2229         $(this).attr('src',thisSrc);
2230      }
2231   }); 
2232
2233   
2234   $('img.lazy.bg').each(function(){
2235      var thisItem = $(this);
2236      var thisItemOffset = thisItem.offset().top;
2237      if ($(window).scrollTop() > thisItemOffset - 90) {
2238         var thisSrc = $(this).attr('data-src')
2239         if ( $(this).parent().is(":visible")  ){
2240            $(this).parent().attr('style','background-image: url("'+thisSrc+'")');
2241         }
2242      
2243      }else{
2244         thisItem.unveil(150, function() {
2245            thisItem.on('load', function() { 
2246               var thisSrc = this.getAttribute('src')
2247               this.parentElement.setAttribute('style','background-image: url("'+thisSrc+'")');
2248            });
2249         });
2250      }
2251   });
2252
2253   $('.img_hide.bg:not(.lazy)').each(function(){
2254      var thisSrc = $(this).attr('src')
2255      if ( $(this).parent().is(":visible")  ){
2256         $(this).parent().attr('style','background-image: url("'+thisSrc+'")');
2257      }
2258   }); 
2259   
2260   $('.infographic').each(function(){
2261      var thisSrc = $(this).attr('data-src')
2262      $(this).attr('style','background-image: url("'+thisSrc+'")');
2263   }); 
2264
2265
2266
2267   $( ".product_list .item" ).hover(function() {
2268      $(this).find('.flipper').addClass( "flipped" );
2269   }, function() {
2270      $(this).find('.flipper').removeClass( "flipped" );
2271   });
2272   
2273   
2274   
2275   
2276}  
2277
2278function hidePPL(){
2279   $('.ppl_popup .box .list ul li a').click(function(){
2280		$(this).parents('ul').hide(); 
2281	}); 
2282};
2283function hideCP(){
2284   $('.cp_popup .box .list ul li a').click(function(){
2285		$(this).parents('ul').hide(); 
2286	}); 
2287};
2288function hideDPD(){
2289   $('.dpd_popup .box .list ul li a').click(function(){
2290		$(this).parents('ul').hide(); 
2291	}); 
2292};
2293function hideZasilkovna(){
2294	$('.zasilkovna_popup .box .list ul li a').click(function(){
2295		$(this).parents('ul').hide(); 
2296	}); 
2297};
2298function hideBalikovna(){
2299   $('.balikovna_popup .box .list ul li a').click(function(){
2300		$(this).parents('ul').hide(); 
2301	}); 
2302};
2303
2304
2305$('a.video_pop').click(function(){
2306	var thisID = $(this).attr('id');
2307   var iframe = $(this).attr('data-iframe');
2308	$('.video_popup').css({'display' : 'table'}); 
2309	setTimeout(function () {
2310		$('.video_popup').css({'opacity' : 1});
2311      $('.video_popup iframe').attr({'src' : iframe});
2312	},10)											
2313   return false;
2314});
2315
2316$('a.piktogram_pop').click(function(){
2317	var thisID = $(this).attr('data-show');
2318	$('.piktogram_popup.'+thisID).css({'display' : 'table'}); 
2319	setTimeout(function () {
2320		$('.piktogram_popup.'+thisID).css({'opacity' : '1'});
2321      reloadImg();
2322	},10)				
2323   							
2324   return false;
2325});
2326
2327$('table td.fr-civka').click(function(){
2328	$('.hobby_popup.civka').css({'display' : 'table'}); 
2329	setTimeout(function () {
2330		$('.hobby_popup.civka').css({'opacity' : '1'});
2331	},10)											
2332   return false;
2333});
2334
2335$('table td.fr-svazek').click(function(){
2336	$('.hobby_popup.svazek').css({'display' : 'table'}); 
2337	setTimeout(function () {
2338		$('.hobby_popup.svazek').css({'opacity' : '1'});
2339	},10)											
2340   return false;
2341});
2342
2343$('table td.fr-minisvazek').click(function(){
2344	$('.hobby_popup.minisvazek').css({'display' : 'table'}); 
2345	setTimeout(function () {
2346		$('.hobby_popup.minisvazek').css({'opacity' : '1'});
2347	},10)											
2348   return false;
2349});
2350
2351$('table td.fr-panenka').click(function(){
2352	$('.hobby_popup.panenka').css({'display' : 'table'}); 
2353	setTimeout(function () {
2354		$('.hobby_popup.panenka').css({'opacity' : '1'});
2355	},10)											
2356   return false;
2357});
2358
2359
2360$('a.video:not(.box)').click(function(){
2361   $('.web_container').attr('aria-hidden', 'true')
2362	$('.video_popup').css({'display' : 'table'}); 
2363	setTimeout(function () {
2364		$('.video_popup').css({'opacity' : 1});
2365	},10)											
2366   return false;
2367});
2368
2369
2370$('.carrier_pop').click(function(){
2371   $('.web_container').attr('aria-hidden', 'true')
2372	$('.carrier_popup').css({'display' : 'table'}); 
2373	setTimeout(function () {
2374		$('.carrier_popup').css({'opacity' : 1});
2375	},10)	
2376   findInsiders($('.carrier_popup'));										
2377   return false;
2378});
2379
2380
2381$('.vzorkovnik_pop').click(function(){
2382   $('.web_container').attr('aria-hidden', 'true')
2383	$('.vzorkovnik_popup').css({'display' : 'table'});
2384   reloadImg(); 
2385	setTimeout(function () {
2386		$('.vzorkovnik_popup').css({'opacity' : 1});
2387	},10)											
2388   return false;
2389});
2390
2391
2392
2393
2394
2395
2396$('.contact_pop').click(function(){
2397   var thisName = $(this).attr('data-name')
2398   var thisEmail = $(this).attr('data-email')
2399   $('.contact_popup .warning span').text(thisName)
2400   $('.contact_popup #sendto').val(thisEmail)
2401   $('.contact_popup #sendname').val(thisName)
2402   
2403   $('.web_container').attr('aria-hidden', 'true')
2404	$('.contact_popup').css({'display' : 'table'}); 
2405	setTimeout(function () {
2406		$('.contact_popup').css({'opacity' : 1});
2407	},10)	
2408   findInsiders($('.contact_popup'));										
2409   return false;
2410});
2411
2412
2413$('#my_profile .orders a').click(function(){
2414   $('.web_container').attr('aria-hidden', 'true')
2415	var thisID = $(this).attr('id');
2416	$('#pop_'+thisID+'').css({'display' : 'table'}); 
2417	setTimeout(function () {
2418		$('#pop_'+thisID+'').css({'opacity' : 1});
2419	},10)											
2420   return false;
2421});
2422
2423
2424function precise_round(num,decimals) {
2425    return Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals);
2426} 
2427
2428function nextPage(){
2429	$('#next_page').click(function(){
2430		if ((parseInt($('#page').val())+1) <= parseInt($('#max_page').val())){
2431			//$('#page').val(parseInt($('#page').val())+1);
2432			$('.product_list').attr('data-ajax-append',true);			
2433			//$('.category_list').attr('data-ajax-append','');    
2434	  	   var actualScroll = $(document).scrollTop();
2435	  		//alert(parseInt($('#page').val())+'-'+(parseInt($('#page').val())+1));
2436	  		$('#l').val(parseInt($('#page').val()));
2437	  		
2438	  		$('#page').val((parseInt($('#page').val())+1));
2439	     	loadCommodities(false,actualScroll);
2440	   }else{
2441			$('.load_next_page').hide();
2442		}
2443		return false;
2444	});
2445
2446	$('.strankovani ul li a').click(function(){
2447      if( $('header').css("position") === "fixed"){
2448         var headerHeight = $('header').outerHeight();
2449      }else{
2450         var headerHeight = 0;
2451      }
2452		$('html,body').animate({ scrollTop: ($('.product_list').offset().top - headerHeight - 100 ) }, 600);
2453		var actualScroll = ($('.product_list').offset().top - headerHeight - 100 );
2454		$('#page').val($(this).attr('data-page'));
2455		$('#l').val($(this).attr('data-page'));
2456		$('.product_list').removeAttr('data-ajax-append');
2457		loadCommodities(true,actualScroll);
2458		return false;
2459	});
2460}
2461	
2462function loadCommodities(vymazat){ 
2463	//$('#page').val(parseInt($('#page').val())+1);
2464	$('.product_list').css('opacity','0.5');
2465	if (vymazat){
2466		$('.product_list').removeAttr('data-ajax-append');
2467	}
2468	var producers = [];
2469	$('.producers_filter').each(function(){
2470	   if($(this).is(":checked")) {
2471         producers.push($(this).val());        
2472		}
2473	});
2474	$('#vyrobce').val(producers.toString());
2475
2476	$('.param_header').each(function(){
2477		var arr = [];
2478		var id = $(this).attr('id');
2479		$('.'+id+'_val').each(function(){
2480			if ($(this).val() > 0) {
2481                arr.push($(this).val());
2482            }else{
2483                arr.push('');
2484            }
2485			
2486		});
2487		$('#'+id).val(arr.toString());
2488	});
2489
2490	
2491	$.nette.ajax({
2492	  url: $('#url_kategorie').val() > '' ? $('#url_kategorie').val() : $('#sorting-form').attr('action'),
2493	  data: $('#sorting-form').serialize(),
2494	  success: function(data) {
2495		  //$('#load_content').html($('#load_content').html()+data);
2496		  pust = true;
2497	  },
2498	  complete: function(){
2499	  	  //$('html,body').animate({ scrollTop: actualScroll + 1 }, 0);
2500	  	  koupit_button();
2501			if ((parseInt($('#page').val())) == parseInt($('#max_page').val())){
2502				$('#next_page').hide();
2503				$('.load_next_page').hide();
2504			}
2505			$('.product_list').css('opacity','1');
2506	  }
2507	});
2508	var toUp = "";//page_hash ? "#page_hash" : "";
2509	window.history.pushState('page2', 'Title', '?'+$('#sorting-form').serialize()+toUp);	
2510}
2511
2512function AddRemoveNewsletter(obj){
2513   var produkty = $.cookie('newsletter_products') > '' ? $.cookie('newsletter_products') : "";
2514   var produkty_new = "";
2515
2516   pole = produkty.split(',');
2517   if (pole.indexOf(obj.attr('rel')) > -1){
2518      var thisText = obj.attr('data-title')
2519	   obj.text(thisText);
2520	   obj.removeClass('remove_from_newsletter');
2521		obj.addClass('add_to_newsletter');
2522
2523		$.each( pole, function( key, value ) {
2524		  //alert(value+':'+obj.attr('rel'));
2525		  if (value != obj.attr('rel')){
2526		  	  produkty_new += produkty_new > '' ? ","+value : value;
2527		  }
2528		});	
2529		//alert(produkty_new);	   
2530		$.cookie('newsletter_products', produkty_new , options);
2531	}else{
2532	   produkty += produkty > '' ? ","+obj.attr('rel') : obj.attr('rel');
2533      var thisText = obj.attr('data-title1')
2534	   obj.text(thisText);
2535	   obj.addClass('remove_from_newsletter');
2536		obj.removeClass('add_to_newsletter');
2537		$.cookie('newsletter_products', produkty , options);
2538	}
2539	setTimeout(function() {	
2540		$.nette.ajax({
2541			url: '?do=refreshFrontNewsletter',
2542			success: function(data) {
2543				
2544			}
2545		});	
2546	}, 200);
2547	return false;
2548};
2549
2550
2551function koupit_button(){
2552	 $('.koupit_button').unbind();
2553	 $('.koupit_button').each(function(){
2554      
2555	 	$(this).click(function(){
2556         if( $(window).width() > 1024 ){  
2557			 var obj = $(this);
2558
2559			 $.nette.ajax({
2560			  url: $(this).parents('form:first').attr('action'),
2561			  data: $(this).parents('form:first').serialize(),
2562			  type: 'post',
2563			  success: function(data) {
2564					//alert('a');				  
2565			  }
2566			});		 
2567//alert(obj.parents('form:first').find('.count').val());
2568			 obj.parents('form:first').find('.count').animate_from_to('#updatedPrice', {
2569		        pixels_per_second: 500,
2570		        callback: function(){ 
2571		        }
2572			  },obj.parents('form:first').find('.count').val());
2573		 	 
2574			 return false;
2575         }else{
2576         
2577          var obj = $(this);
2578
2579			 $.nette.ajax({
2580			  url: $(this).parents('form:first').attr('action'),
2581			  data: $(this).parents('form:first').serialize(),
2582			  type: 'post',
2583			  success: function(data) {
2584				  
2585			  }
2586			});		 
2587//alert(obj.parents('form:first').find('.count').val());
2588			 obj.parents('form:first').find('.count').animate_from_to('#updatedPrice', {
2589		        pixels_per_second: 500,
2590		        callback: function(){ 
2591		        }
2592			  },obj.parents('form:first').find('.count').val());
2593		 	 
2594			 return false;
2595         
2596         } 
2597          
2598		});
2599    });
2600    
2601    $('.add_kosik').unbind();
2602    	// objekt na kliknuti
2603	 $('.add_kosik').click(function(){  
2604		var product_id = $(this).attr('data-for-product');
2605      var count = $('.count_of_'+product_id).val() > 0 ? $('.count_of_'+product_id).val() : 1;
2606		if (count < $('.minimum_of_'+product_id).val()){
2607			count = $('.minimum_of_'+product_id).val();
2608			$('.count_of_'+product_id).val(count);
2609		}
2610		var skladem = parseInt($('input[data-stock-id="'+product_id+'"]').val());
2611		var v_kosiku = parseInt($('#v_kosiku').val());
2612      var config = $('#sklady').val();
2613      if(config == 1) {
2614	      if (count > skladem) {
2615            showControlPopup( '<p>' + $('#notInStock').val() + '</p>' );
2616			}else if ((skladem - v_kosiku - count) < 0){
2617            showControlPopup( '<p>' + $('#notInStock').val() + '</p>' );
2618	      }
2619      }
2620      if( $(window).width() > 1024 ){
2621		  	$.nette.ajax({
2622			  url: "?do=AddToBasket",
2623			  method: 'post',
2624			  data: {'buy': 1, 'val[fk_tbl_commodity]': product_id, 'val[n_count]' : count},
2625			  success: function(data) {
2626			  },
2627			  complete: function(data){
2628		  			reloadImg();
2629			  }
2630			});
2631		 
2632      }else{
2633      
2634		 // objekt s poctem kusu
2635		 //
2636			$.nette.ajax({
2637			  url: "?do=AddToBasket",
2638			  method: 'post',
2639			  data: {'buy': 1, 'val[fk_tbl_commodity]': product_id, 'val[n_count]' : count},
2640			  success: function(data) {
2641			  },
2642			  complete: function(data){
2643		  			reloadImg();
2644			  }
2645			});
2646		     
2647      }
2648
2649  	   $('#pocetZaNakup').html(precise_round(parseFloat($('#product_price').val())*parseInt($('.detail').find('#count').val()),0));
2650		if (count > 0){
2651			showBuyPopup();
2652		}
2653      return false;
2654	 });
2655	 
2656	 
2657	 $('.add_gift').unbind();
2658	 $('.add_gift').click(function(){  
2659		var product_id = $(this).attr('data-for-product');
2660		var prod = $(this).attr('prod-id');
2661      var count = 1;
2662
2663      if( $(window).width() > 1024 ){
2664		  	$.nette.ajax({
2665			  url: "?do=AddToBasket",
2666			  method: 'post',
2667			  data: {'buy': 1, 'val[fk_tbl_commodity]': product_id, 'val[n_count]' : count, 'val[gift]': 1},
2668			  success: function(data) {
2669			  }
2670			});
2671		 
2672      }else{
2673
2674			$.nette.ajax({
2675			  url: "?do=AddToBasket",
2676			  method: 'post',
2677			  data: {'buy': 1, 'val[fk_tbl_commodity]': product_id, 'val[n_count]' : count, 'val[gift]': 1},
2678			  success: function(data) {
2679			  }
2680			});
2681		     
2682      }
2683		$('.gift_popup').css({'display': 'none', 'opacity': 0});
2684      return false;
2685	 });
2686
2687  	  $( ".product_list .item a:not(.related_item, .wishlist)" ).hover(function() {
2688	      $( this ).parents('.item').addClass( "hover_efekt" );
2689	        }, function() {
2690	      $( this ).parents('.item').removeClass( "hover_efekt" );
2691	   });
2692		
2693	$('.product_list .item a.increment').unbind();
2694   $('.product_list .item a.increment').click(function(){
2695      var countValue = parseInt($(this).parents('form').find('.count').val());
2696      countValue++
2697      $(this).parents('form').find('.count').val(countValue);
2698		$(this).parents('form').find('.count').attr('value',countValue);
2699      return false;
2700   });
2701   
2702   $('.product_list .item a.decrement').unbind();
2703   $('.product_list .item a.decrement').click(function(){
2704      var countValue = parseInt($(this).parents('form').find('.count').val());
2705      if ((countValue-1) < parseInt($(this).parents('form').find('.minimum').val())){
2706			countValue = parseInt($(this).parents('form').find('.minimum').val());
2707		}else{
2708         countValue--;
2709      }
2710      $(this).parents('form').find('.count').val(countValue);
2711      $(this).parents('form').find('.count').attr('value',countValue);
2712      
2713      return false;
2714   });  
2715   
2716   /* ---------- Reklamace ---------- */
2717	
2718	$('#zpusob_vyzvenuti').change(function() {
2719		//var id = $(this).attr('change-to');
2720		var id = $('option:selected', this).attr('change-to');
2721		$('.zpusob_vyzvenuti').hide();
2722		$('#zpusob_vyzvenuti_'+id).show();
2723	});
2724	$('#zpusob_dodani').change(function() {
2725		//var id = $(this).attr('change-to');
2726		var id = $('option:selected', this).attr('change-to');
2727		$('.zpusob_dodani').hide();
2728		$('#zpusob_dodani_'+id).show();
2729	});
2730	$('#zpusob_vyrizeni').change(function() {
2731		//var id = $(this).attr('change-to');
2732		var id = $('option:selected', this).attr('change-to');
2733		$('.zpusob_vyrizeni').hide();
2734		$('#zpusob_vyrizeni_'+id).show();
2735	});
2736}
2737
2738
2739function add_basket() {
2740		 // objekt na kliknuti
2741	 $('.add_basket_front').click(function(){  
2742      var count = $('#count').val() > 0 ? $('#count').val() : 1;
2743		if (count < $('#minimum').val()){
2744			count = $('#minimum').val();
2745		}
2746      $('#count').val(count);
2747      var skladem = parseInt($('#skladem').val());
2748		var v_kosiku = parseInt($('#v_kosiku').val());
2749      var config = $('#sklady').val();
2750      var formid = "#"+$(this).attr('form-id');
2751     
2752		if(config == 1) {
2753	      if (count > skladem) {
2754            showControlPopup( '<p>' + $('#notInStock').val() + '</p>' );
2755			}else if ((skladem - v_kosiku - count) < 0){
2756            showControlPopup( '<p>' + $('#notInStock').val() + '</p>' );
2757	      }
2758      }
2759      if( $(window).width() > 1024 ){
2760			$.nette.ajax({
2761			  	url: $(formid).attr('action'),
2762			  	data: $(formid).serialize(),
2763			  	type: 'post',
2764			  	success: function(data) {
2765			  	},
2766			  	complete: function(){
2767					/*$.nette.ajax({
2768						  url: "?do=AddToBasket",
2769						  success: function(data) {
2770						  }
2771					});*/
2772			  }
2773			});		 
2774      }else{
2775      
2776		 // objekt s poctem kusu
2777		 //
2778			 $.nette.ajax({
2779			  url: $(formid).attr('action'),
2780			  data: $(formid).serialize(),
2781			  type: 'post',
2782			  success: function(data) {
2783				  
2784			  },
2785			  complete: function(){
2786					/*$.nette.ajax({
2787						  url: "?do=AddToBasket",
2788						  success: function(data) {
2789						  }
2790					});*/
2791	
2792			  }
2793			});		     
2794      }
2795
2796  	   $('#pocetZaNakup').html(precise_round(parseFloat($('#product_price').val())*parseInt($('.detail').find('#count').val()),0));
2797		if (count > 0){
2798			showBuyPopup();
2799		}
2800      return false;
2801	 });
2802}
2803
2804function addH(id, obj, type){
2805  $.nette.ajax({
2806    type: 'get',
2807    url: '?do=wishlist&id='+id+'&type='+type,
2808    success: function(data) {
2809	 },
2810	 complete: function(data) {
2811	 	//alert(data);
2812
2813
2814		//var objJson = jQuery.parseJSON(data.responseText);
2815
2816		/*if(objJson.favorites > 0) {
2817			$('#favorites_count_id').addClass('active');
2818		} else {
2819			$('#favorites_count_id').removeClass('active');
2820		}*/
2821
2822		if (obj.hasClass('active')){
2823	 		obj.attr('title','Přidat do oblíbených');
2824	 		obj.removeClass('active');
2825	 	}else{
2826	 		obj.attr('title','Odebrat z oblíbených');
2827	 		obj.addClass('active');
2828			/*obj.animate_from_to('header .favorite', {
2829		        pixels_per_second: 1000,
2830		        callback: function(){ 
2831
2832		        }
2833			},'1');*/
2834	 	}
2835	 }
2836  });
2837	
2838}
2839
2840function removeItemH(obj){
2841	obj.parents('.item:first').remove();
2842}
2843
2844function close_buttons() {
2845	$('.orders_popup .close').unbind();
2846	$('.orders_popup .close').click(function(){
2847        $(this).parents('.orders_popup').css({'opacity' : 0});
2848        setTimeout(function () {
2849            $('.orders_popup').css({'display' : 'none'}); 
2850        }, 250)
2851    });
2852    
2853    $('.orders_popup').unbind();
2854    $('.orders_popup').click(function(e){
2855      var controlClass = $(e.target).attr('class');
2856      if( controlClass == 'box' ){
2857         $('.orders_popup .close').click()
2858      } 
2859    });
2860}
2861
2862function closeButtons() {
2863	$(document).keyup(function(e) {
2864      if ( (e.keyCode == 27)) { 
2865         $('.cp_popup .boxes span.close').click();
2866         $('.ppl_popup .boxes span.close').click();
2867         $('.dpd_popup .boxes span.close').click();
2868         $('.zasilkovna_popup .boxes span.close').click();
2869         $('.balikovna_popup .boxes span.close').click();
2870      }
2871   });
2872   $('.cp_popup .close').click(function(){
2873      if($('#changeCP').hasClass('active')) {
2874		   
2875	   } else {
2876		   //$.cookie('CP_POBOCKA', '', options);
2877		   $('.deliveryRadio ').prop('checked', false);
2878		   $('.deliveryRadio ').parent().removeClass('checked');
2879         $('.deliveryRadio').parents('.box').removeClass('active');
2880         $('.paymentRadio').prop('checked', false);
2881         $('.paymentRadio').parent().removeClass('checked');
2882         $('.paymentRadio').parents('.box').removeClass('active');
2883         $('.paymentRadio').parents('.item').addClass('opacity');
2884         $('.doprava_platba .item.platba .box').show();
2885	   }
2886      $(this).parents('.cp_popup').css({'opacity' : 0});
2887      setTimeout(function () {
2888         $('.cp_popup').css({'display' : 'none'}); 
2889      }, 250)
2890		return false;
2891   });
2892    
2893   $('.cp_popup').click(function(e){
2894      var controlClass = $(e.target).attr('class');
2895      if( controlClass == 'box' ){
2896         $('.cp_popup .close').click()
2897      } 
2898   });
2899
2900   $('.balikovna_popup .close').click(function(){
2901      if($('#changeBALIKOVNA').hasClass('active')) {
2902		   
2903	   } else {
2904		   //$.cookie('CP_POBOCKA', '', options);
2905		   $('.deliveryRadio ').prop('checked', false);
2906		   $('.deliveryRadio ').parent().removeClass('checked');
2907         $('.deliveryRadio').parents('.box').removeClass('active');
2908         $('.paymentRadio').prop('checked', false);
2909         $('.paymentRadio').parent().removeClass('checked');
2910         $('.paymentRadio').parents('.box').removeClass('active');
2911         $('.paymentRadio').parents('.item').addClass('opacity');
2912         $('.doprava_platba .item.platba .box').show();
2913	   }
2914      $(this).parents('.balikovna_popup').css({'opacity' : 0});
2915      setTimeout(function () {
2916         $('.balikovna_popup').css({'display' : 'none'}); 
2917      }, 250)
2918		return false;
2919   });
2920    
2921   $('.balikovna_popup').click(function(e){
2922      var controlClass = $(e.target).attr('class');
2923      if( controlClass == 'box' ){
2924         $('.balikovna_popup .close').click()
2925      } 
2926   });
2927    
2928   $('.ppl_popup .close').click(function(){
2929      if($('#changePPL').hasClass('active')) {
2930		   
2931	   } else {
2932		   //$.cookie('PPL_POBOCKA', '', options);
2933		   $('.deliveryRadio ').prop('checked', false);
2934		   $('.deliveryRadio ').parent().removeClass('checked');
2935         $('.deliveryRadio').parents('.box').removeClass('active');
2936         $('.paymentRadio').prop('checked', false);
2937         $('.paymentRadio').parent().removeClass('checked');
2938         $('.paymentRadio').parents('.box').removeClass('active');
2939         $('.paymentRadio').parents('.item').addClass('opacity');
2940         $('.doprava_platba .item.platba .box').show();
2941	   }
2942      $(this).parents('.ppl_popup').css({'opacity' : 0});
2943      setTimeout(function () {
2944         $('.ppl_popup').css({'display' : 'none'}); 
2945      }, 250)
2946		return false;
2947   });
2948    
2949   $('.ppl_popup').click(function(e){
2950      var controlClass = $(e.target).attr('class');
2951      if( controlClass == 'box' ){
2952         $('.ppl_popup .close').click()
2953      } 
2954   });
2955    
2956   $('.dpd_popup .close').click(function(){
2957	   if($('#changeDPD').hasClass('active')) {
2958	   } else {
2959		   //$.cookie('DPD_POBOCKA', '', options);
2960		   $('.deliveryRadio ').prop('checked', false);
2961		   $('.deliveryRadio ').parent().removeClass('checked');
2962         $('.deliveryRadio').parents('.box').removeClass('active');
2963         $('.paymentRadio').prop('checked', false);
2964         $('.paymentRadio').parent().removeClass('checked');
2965         $('.paymentRadio').parents('.box').removeClass('active');
2966         $('.paymentRadio').parents('.item').addClass('opacity');
2967         $('.doprava_platba .item.platba .box').show();
2968	   }
2969      $(this).parents('.dpd_popup').css({'opacity' : 0});
2970      setTimeout(function () {
2971         $('.dpd_popup').css({'display' : 'none'}); 
2972      }, 250)
2973		return false;
2974   });
2975    
2976   $('.dpd_popup').click(function(e){
2977      var controlClass = $(e.target).attr('class');
2978      if( controlClass == 'box' ){
2979         $('.dpd_popup .close').click()
2980      } 
2981   });
2982   $('.zasilkovna_popup .close').click(function(){
2983	   if($('#changeZASILKOVNA').hasClass('active')) {
2984		   
2985	   } else {
2986		   //$.cookie('ZASILKOVNA_POBOCKA', '', options);
2987		   $('.deliveryRadio ').prop('checked', false);
2988		   $('.deliveryRadio ').parent().removeClass('checked');
2989         $('.deliveryRadio').parents('.box').removeClass('active');
2990         $('.paymentRadio').prop('checked', false);
2991         $('.paymentRadio').parent().removeClass('checked');
2992         $('.paymentRadio').parents('.box').removeClass('active');
2993         $('.paymentRadio').parents('.item').addClass('opacity');
2994         $('.doprava_platba .item.platba .box').show();
2995	   }
2996      $(this).parents('.zasilkovna_popup').css({'opacity' : 0});
2997      setTimeout(function () {
2998            $('.zasilkovna_popup').css({'display' : 'none'}); 
2999      }, 250)
3000		return false;
3001   });
3002    
3003   $('.zasilkovna_popup').click(function(e){
3004      var controlClass = $(e.target).attr('class');
3005      if( controlClass == 'box' ){
3006         $('.zasilkovna_popup .close').click()
3007      } 
3008   });
3009}
3010
3011
3012function closeGift() {
3013	$('.close_gift').unbind();
3014	$('.close_gift').click(function() {
3015		$.cookie('GIFT_HIDE', 1, options);
3016	});
3017}
3018
3019function VybratPobocku(obj,text, id){
3020
3021	$('#vyber_dopravy_PPL').html('<br />'+text);
3022	//$('#vyber_dopravy_CP').html('');
3023	//$('#vyber_dopravy_DPD').html('');
3024	//$('#vyber_dopravy_ZASILKOVNA').html('');
3025   $('.ppl_popup').css({'opacity' : 0});
3026   $('.ppl_popup').css({'display' : 'none'}); 
3027	//obj.parents('.boxes:first').find('.close').click();
3028	
3029	$('.deliveryRadio').each(function() {
3030		$(this).parent().removeClass('checked');
3031	});
3032	$('.delivery_open_PPL').parent().addClass('checked');
3033
3034	$.cookie('PPL_POBOCKA', id, options);
3035	$.cookie('DPD_POBOCKA', null, options);
3036	$.cookie('CP_POBOCKA', null, options);
3037	$.cookie('ZASILKOVNA_POBOCKA', null, options);
3038
3039	$('#changePPL').unbind();
3040	$('#changePPL').click(function(){
3041		$('.deliveryRadio.delivery_open_PPL').change();  
3042      return false;
3043	});    
3044   return false; 
3045}
3046
3047function VybratPobockuCP(obj,text, id){
3048
3049	$('#vyber_dopravy_CP').html('<br />'+text);
3050	//$('#vyber_dopravy_DPD').html('');
3051	//$('#vyber_dopravy_PPL').html('');
3052	//$('#vyber_dopravy_ZASILKOVNA').html('');
3053	
3054	$('.deliveryRadio').each(function() {
3055		$(this).parent().removeClass('checked');
3056	});
3057	$('.delivery_open_CP').parent().addClass('checked');
3058	$('#vyber_dopravy_CP').click();
3059	
3060   $('.cp_popup').css({'opacity' : 0});
3061   $('.cp_popup').css({'display' : 'none'}); 
3062	//obj.parents('.boxes:first').find('.close').click();
3063	
3064	obj.parents('.boxes:first').addClass('active');
3065	
3066
3067	$.cookie('CP_POBOCKA', id, options);
3068	$.cookie('DPD_POBOCKA', null, options);
3069	$.cookie('PPL_POBOCKA', null, options);
3070	$.cookie('ZASILKOVNA_POBOCKA', null, options);
3071	$.cookie('BALIKOVNA_POBOCKA', null, options);
3072	
3073	
3074	$('#changeCP').unbind();
3075	$('#changeCP').click(function(){
3076		$('.deliveryRadio.delivery_open_CP').change();   
3077      return false;
3078	});     
3079   return false;
3080}
3081
3082function VybratPobockuBalikovna(obj,text, id){
3083
3084	$('#vyber_dopravy_BALIKOVNA').html('<br />'+text);
3085	//$('#vyber_dopravy_DPD').html('');
3086	//$('#vyber_dopravy_PPL').html('');
3087	//$('#vyber_dopravy_ZASILKOVNA').html('');
3088	
3089	$('.deliveryRadio').each(function() {
3090		$(this).parent().removeClass('checked');
3091	});
3092	$('.delivery_open_BALIKOVNA').parent().addClass('checked');
3093	$('#vyber_dopravy_BALIKOVNA').click();
3094	
3095   $('.balikovna_popup').css({'opacity' : 0});
3096   $('.balikovna_popup').css({'display' : 'none'}); 
3097	//obj.parents('.boxes:first').find('.close').click();
3098	
3099	obj.parents('.boxes:first').addClass('active');
3100	
3101
3102	$.cookie('BALIKOVNA_POBOCKA', id, options);
3103	$.cookie('CP_POBOCKA', null, options);
3104	$.cookie('DPD_POBOCKA', null, options);
3105	$.cookie('PPL_POBOCKA', null, options);
3106	$.cookie('ZASILKOVNA_POBOCKA', null, options);
3107	
3108	
3109	$('#changeCP').unbind();
3110	$('#changeCP').click(function(){
3111		$('.deliveryRadio.delivery_open_CP').change();   
3112      return false;
3113	});     
3114   return false;
3115}
3116
3117function VybratPobockuDPD(obj,text, id){
3118
3119	$('#vyber_dopravy_DPD').html('<br />'+text);
3120	//$('#vyber_dopravy_CP').html('');
3121	//$('#vyber_dopravy_PPL').html(''); 
3122	//$('#vyber_dopravy_ZASILKOVNA').html('');
3123	
3124	$('.deliveryRadio').each(function() {
3125		$(this).parent().removeClass('checked');
3126	});
3127	
3128	$('.delivery_open_DPD').parent().addClass('checked');
3129	$('#vyber_dopravy_DPD').click();
3130	
3131	$('.dpd_popup').css({'opacity' : 0});
3132   $('.dpd_popup').css({'display' : 'none'});
3133
3134	$.cookie('DPD_POBOCKA', id, options);
3135	$.cookie('CP_POBOCKA', null, options);
3136	$.cookie('PPL_POBOCKA', null, options);
3137	$.cookie('ZASILKOVNA_POBOCKA', null, options);
3138	$.cookie('BALIKOVNA_POBOCKA', null, options);
3139
3140	$('#changeDPD').unbind();
3141	$('#changeDPD').click(function(){
3142		$('.deliveryRadio.delivery_open_DPD').change();    
3143      return false;
3144	}); 
3145   return false;  
3146}
3147function VybratPobockuZasilkovna(obj,text, id){
3148
3149	$('#vyber_dopravy_ZASILKOVNA').html('<br />'+text);
3150	//$('#vyber_dopravy_CP').html('');
3151	//$('#vyber_dopravy_PPL').html(''); 
3152	//$('#vyber_dopravy_DPD').html('');
3153	//alert('ahoj');
3154	$('.deliveryRadio').each(function() {
3155		$(this).parent().removeClass('checked');
3156	});
3157	
3158	$('.delivery_open_ZASILKOVNA').parent().addClass('checked');
3159	$('#vyber_dopravy_ZASILKOVNA').click();
3160	
3161	$('.zasilkovna_popup').css({'opacity' : 0});
3162   $('.zasilkovna_popup').css({'display' : 'none'});
3163		
3164	$.cookie('ZASILKOVNA_POBOCKA', id, options);
3165	$.cookie('CP_POBOCKA', null, options);
3166	$.cookie('PPL_POBOCKA', null, options);
3167	$.cookie('DPD_POBOCKA', null, options);
3168	$.cookie('BALIKOVNA_POBOCKA', null, options);
3169
3170
3171	$('#changeZASILKOVNA').unbind();
3172	$('#changeZASILKOVNA').click(function(){
3173		$('.deliveryRadio.delivery_open_ZASILKOVNA').change(); 
3174      return false;  
3175	});  
3176   return false;
3177}
3178
3179function controlEnters(id) {
3180	var key = window.event.keyCode;
3181
3182	// If the user has pressed enter
3183	if (key === 13) {
3184	   //document.getElementById(id).value = document.getElementById(id).value + "\r";
3185	   return false;
3186	} else {
3187	  return true;
3188	}
3189}
3190
3191function checkDeliveryAddress() {
3192	if ($('#b_use_delivery_address').is(':checked')){
3193		$('#use_delivery_address').addClass('active');
3194      $('#use_delivery_address input,#use_delivery_address select').each(function() {
3195         //var tabIndex = $(this).attr('tabindex').substring(1);
3196         //$(this).attr('tabindex', tabIndex);
3197         if($(this).attr('data-rg') > '') {
3198	         $(this).attr('data-validation', $(this).attr('data-rg'));
3199         }
3200      });
3201	}else{
3202		$('#use_delivery_address').removeClass('active');
3203      $('#use_delivery_address input,#use_delivery_address select').each(function() {
3204         //var tabIndex = $(this).attr('tabindex');
3205         //$(this).attr('tabindex', tabIndex);
3206         $(this).removeAttr('data-validation');
3207      });
3208	}
3209}
3210
3211function showWishPopup() {
3212	$('.addwish_popup').css({'display' : 'table'}); 
3213	setTimeout(function () {
3214		$('.addwish_popup').css({'opacity' : 1});
3215	},10)	
3216}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.