PageSourceSearch

https://kamna.astranet.cz/js/scripts.js?t=1791454316

js astranet.cz collected 2026-10-08 10:12:00 UTC 9,124 bytes, 417 lines download raw bytes

1var timeoutHover;
2
3
4function calculateCartPrice() {
5    var total = 0;
6
7    $('.tableList tr').each(function() {
8        var price = parseFloat($(this).find('.cart-price').val()) || 0;
9        var count = parseInt($(this).find('.cart-count').val()) || 0;
10
11        total += price * count;
12    });
13
14    $('.cart-total').text(
15        total.toLocaleString('cs-CZ', {
16            minimumFractionDigits: 0,
17            maximumFractionDigits: 0
18        }) + ' Kč'
19    );
20}
21
22function ShowLoaderOverlay() {
23  $('#loaderOverlay').show();
24}
25
26function HideLoaderOverlay() {
27  $('#loaderOverlay').hide();
28}
29
30function ScrollToElem(selector)
31{
32  $('html, body').animate({
33      scrollTop: $(selector).offset().top
34  }, 600);
35}
36
37
38/* Init Slider - Slick */
39function InitSliderSlick1(selector)
40{
41  $(selector).slick({
42    dots: true,
43    vertical: false,
44    centerMode: false,
45    slidesToShow: 1,
46    slidesToScroll: 1,
47    autoplay: true,
48    autoplaySpeed: 5000,
49    arrows: false
50  });
51  
52  /*$(selector+' .arrow-l').on('click', function(){
53    $(selector).slick('slickPrev');
54  });
55  $(selector+' .arrow-r').on('click', function(){
56    $(selector).slick('slickNext');
57  });*/
58}
59
60
61function hideElement(id){
62  if(document.getElementById(id).style.display != "none"){
63    document.getElementById(id).style.display="none";
64  }
65}
66
67function showElement(id){
68  if(document.getElementById(id).style.display != "block"){
69    document.getElementById(id).style.display="block";
70  }
71}
72
73function bar(url)
74{
75  wasOpen  = false;
76  win = window.open(url);    
77  return (typeof(win)=='object')?true:false;
78}
79
80function scrollToId(id)
81{
82  if (id != '')
83  {
84    $("html, body").animate({ scrollTop: ($('#' + id).offset().top - 50) }, 1000);
85  }
86}
87
88$(function() 
89{
90  $( ".dialogContent" ).dialog({
91    autoOpen: false,
92    width: 400,
93    show: {
94      effect: "blind",
95      duration: 100
96    },
97    hide: {
98      effect: "explode",
99      duration: 100
100    }
101  });
102});
103
104$(document).ready(function() {
105  
106  //InitSliderSlick1('#mainBanner');
107  
108  $('.searchClose').click(function() {
109    $('#searchTipsContainer').slideUp();
110  });
111  
112  /* Cookies */
113  //GoogleAnalytics('default');
114  
115  /*
116  var stitekOpened = false;
117  $('#rightFloatedFrame .openerContainer').hover(
118    function() {
119      var width = 40;
120      var anim_time = 500;
121      if (stitekOpened == false)
122      {
123        width = 200;
124        stitekOpened = true;
125      }
126      else
127      {
128        anim_time = 200;
129        stitekOpened = false; 
130      }
131      
132      $(this).parent('#rightFloatedFrame').animate({
133      width: width
134      }, anim_time, function() {
135        // Animation complete.
136      });
137    },
138    function()
139    {
140      var width = 40;
141      $(this).parent('#rightFloatedFrame').css('width',width);
142      stitekOpened = false; 
143    }
144  );
145  */
146  
147  $('a[rel*=lightbox]').venobox(); 
148  $('.venobox').venobox({
149    numeratio: true
150  }); 
151  
152  
153  $('.orderFrame .inner .selector .arrow').hover(function() {
154    $(this).children('.subframe').slideToggle();
155  },
156  function () {
157    $(this).children('.subframe').hide();
158  }
159  );
160  
161  $('#menuFrame LI').hover(
162     function () 
163     {
164       $(this).children('.submenu').slideDown('fast');
165     },
166     function () 
167     {
168       $(this).children('.submenu').hide();
169     }
170  );
171  
172  $(function(){
173    $(window).scroll(function()
174    {
175      var pos = $('#fullMenuFrame').position();
176      var pos_top = pos.top + 90;
177      //console.log(pos_top);
178      if($(this).scrollTop()>=pos_top)
179      {
180        $('#fullStaticTopFrame').slideDown();
181      }
182      else
183      {
184        $('#fullStaticTopFrame').slideUp();
185      }
186    });
187  });
188  
189  $('.kosikPopupContainer').hover(
190     function () 
191     {
192       if (!timeoutHover)
193       {
194         timeoutHover = window.setTimeout(function(){
195           timeoutHover = null;
196           $.post('/jquery/scripts/load-top-kosik.php', {  },  function( data ) {
197        	   $('.kosikPopupContainer').append(data);
198        	   $('.kosikPopupFrame').slideDown('fast');
199           });
200         }, 300);
201       }
202     },
203     function () 
204     {
205       if (timeoutHover)
206       {
207         window.clearTimeout(timeoutHover);
208         timeoutHover = null;
209       }       
210       $('.kosikPopupFrame').hide();
211       $('.kosikPopupFrame').remove();
212     }
213  );
214  
215  $('.userPopupContainer').hover(
216     function () 
217     {
218       if (!timeoutHover)
219       {
220         timeoutHover = window.setTimeout(function(){
221           timeoutHover = null;
222           $('.userPopupFrame').slideDown('fast');
223         }, 300);
224       }
225     },
226     function () 
227     {
228       if (timeoutHover)
229       {
230         window.clearTimeout(timeoutHover);
231         timeoutHover = null;
232       }
233       $('.userPopupFrame').hide();
234     }
235  );
236  
237  $('.main-submenu-li').hover(
238     function () 
239     {
240       var elem = $(this);
241       if (!timeoutHover)
242       {         
243         timeoutHover = window.setTimeout(function(){
244           timeoutHover = null;           
245           $.post('/jquery/scripts/load-main-submenu.php', { id_cat:elem.data('id') },  function( data ) {
246        	   $('.submenu-container').html(data);
247        	   elem.find('.submenu').slideDown('fast');
248           });           
249         }, 300);
250       }
251     },
252     function () 
253     {
254       var elem = $(this);
255       if (timeoutHover)
256       {
257         window.clearTimeout(timeoutHover);
258         timeoutHover = null;
259       }
260       elem.find('.submenu').hide();
261     }
262  );
263  
264  $('.hamburger').unbind().click(function() {
265    $(this).parent('DIV').find('.hamburgerContent').slideToggle('fast');
266  });
267  
268  $('.hamburger.katalog').click(function() {
269    
270    $('.eshopLeftMenuFrame .catsFrame').slideToggle('fast');
271  });
272  
273  $('#do_address').click(function() {
274    if (this.checked) {
275      $('.addressDo').slideDown();
276    }
277    else
278    {
279      $('.addressDo').slideUp();
280    }
281  });
282  
283  $('#reg').click(function() {
284    if (this.checked) {
285      $('.password-cont').slideDown();
286    }
287    else
288    {
289      $('.password-cont').slideUp();
290    }
291  });
292  
293  /* VALIDACE DIC */
294  $('input[name=ic]').change( function() {
295    var elem = $(this).parent('.formLine').children('.loading');
296    elem.show();
297    var ico = $(this).val();
298    $.ajax({
299      url: "/jquery/scripts/ares.php",
300      contentType: "application/json; charset=utf-8",
301      dataType: "json", 
302      data: "ico="+ico,
303      cache: false,
304      success: function(data) {
305        console.log(data);
306        if (data.stav == 'ok') {
307          $('input[name=dic]').val(data.dic);
308          $('input[name=firm]').val(data.firma);
309          $('input[name=ulice]').val(data.ulice);
310          $('input[name=mesto]').val(data.mesto);
311          $('input[name=psc]').val(data.psc);
312          
313          setCustAddress('dic', data.dic);
314          setCustAddress('firm', data.firma);
315          setCustAddress('ulice', data.ulice);
316          setCustAddress('mesto', data.mesto);
317          setCustAddress('psc', data.psc);
318          
319          if ($('#map_canvas').length > 0) 
320          {
321            getDistance();
322          }
323          
324        } else {
325          //alert(data.stav);
326          console.log(data);
327        }
328        elem.hide();
329    },
330   });
331  });
332  
333  $('.formInput').focus(function() {
334    $(this).parent('.formLine').find('.tipContainer').slideDown();
335  });
336  $('.formInput').focusout(function() {
337    $(this).parent('.formLine').find('.tipContainer').slideUp('fast');
338  });
339  
340  $('.cntUp').click(function(){
341    var cnt = $('#inputCnt').val();
342    var new_cnt = parseInt(cnt) + 1;
343    $('#inputCnt').val(new_cnt);
344    if (new_cnt > 1)
345    {
346      $('.cntDown').removeClass('notAllowed');
347    }
348  });
349  
350  $('.cntDown').click(function(){
351    var cnt = $('#inputCnt').val();
352    var new_cnt = parseInt(cnt) - 1;
353    if (new_cnt > 0)
354    {
355      $('#inputCnt').val(new_cnt);
356    }
357    if (new_cnt < 2)
358    {
359      $('.cntDown').addClass('notAllowed');
360    }
361  });
362  
363});
364
365
366// funkce zjistí parametr z URL
367function getUrlFilter() 
368{
369  var regex = /f=[0-9,whdo-]{1,}/g,
370      matches,
371      url = location.href;
372      
373  //console.log(url);
374  //var regex = /f\=.*/;
375  matches = url.match(regex);
376  
377  if (matches)
378  {
379    return matches[0]; 
380  }  
381  else
382  {
383    return '';
384  }
385  
386  //return results == null ? null : results[1];
387}
388
389//Odstraneni prvku z pole pomoci regularniho vyrazu
390
391function removeArrItem(arr, str)
392{
393  var i = arr.length;
394
395  for (part in arr)
396  {
397    //console.log('SUBSTR['+part+']');
398    if (arr[part].substring(0,2) == str)
399    {
400      arr.splice(part, 1);
401    }
402  }
403  return arr;
404}
405
406function removeArrEmptyItem(arr)
407{
408  var k;
409  for (k in arr)
410  {
411    if (!arr[k])
412    {
413      arr.splice(k, 1);
414    }
415  }
416  return arr;
417}

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.