1// JavaScript Document 2 3$(document).ready(function(){ 4 $('.turner').click(function(){ 5 $(this.hash).toggleClass('hddn'); 6 return false; 7 }); 8 $('.switch').click(function(){ 9 $(this.hash).slideDown(200); 10 $(this).slideUp(200); 11 return false; 12 }); 13 $('.burger').click(function(){ 14 $(this).find('span').toggleClass('active'); 15 $('.top-menu nav').fadeToggle(300); 16 }); 17 $('.cookie-alert .btn').click(function(e){ 18 e.preventDefault(); 19 document.cookie = "cookieconfirm=1; max-age=365*86400; path=/"; 20 $('.cookie-alert').fadeOut(300); 21 return false; 22 }); 23 $('.float-menu a').click(function(){ 24 $('html, body').animate({scrollTop: $(this.hash).offset().top-40}, 500,'swing'); 25 return false; 26 }); 27 $('.nonclicable').click(function(){ 28 return false; 29 }); 30 31 $('.search-start').click(function(){ 32 if ($(this).parent().find('label').hasClass('opened')) 33 { 34 if ($(this).parent().find('label input').val()=='') {$(this).parent().find('label').removeClass('opened');} 35 else {location.href=encodeURI('/search/'+$(this).parent().find('label input').val()+'/');} 36 } 37 else {$(this).parent().find('label').addClass('opened');} 38 }); 39 $('.search').on('keypress','input',function(event){ if (event.keyCode==13) {location.href=encodeURI('/search/'+$(this).val()+'/');} 40 }); 41 42 window.onload = function() { 43 resize_sliders(); 44 } 45 var old_w=$(window).width(); 46 $(window).resize(function() { 47 var new_w=$(window).width(); 48 if(new_w!=old_w) { 49 setTimeout(function(){resize_sliders();},800); 50 old_w=new_w; 51 } 52 }); 53 54 $('.slider').each(function(){ 55 var num = $(this).find('.slide-base > div').length; 56 var wdt = $(this).width(); 57 var prwdt = $(this).find('.slide-base > div').width(); 58 var spanline=''; 59 var cnter = Math.ceil(num*prwdt/wdt); 60 for (j=1;j<=cnter;j++) {spanline+='<span></span>';} 61 $(this).find('.slider-ruler').html(spanline); 62 }); 63 $('.slider-ruler span').click(function(){ 64 var wdt = $(this).parent().parent().width(); 65 var el = $(this).index(); 66 $(this).parent().parent().find('.slide-base').css('margin-left',(-wdt*el)+'px'); 67 $(this).parent().find('span').removeClass('active'); 68 $(this).addClass('active'); 69 }); 70 $('.slider-arrows span').click(function(){ 71 if ($(this).hasClass('left')) {$(this).parent().parent().find('.slider-ruler span.active').prev().click();} 72 if ($(this).hasClass('right')) {$(this).parent().parent().find('.slider-ruler span.active').next().click();} 73 }); 74 $('.large-slider, .slider').swipe({ 75 swipeLeft:function(){$(this).find('.slider-ruler span.active').next().click();}, 76 swipeRight:function(){$(this).find('.slider-ruler span.active').prev().click();}, 77 threshold:10 78 }); 79 var startslide = setInterval(function(){ 80 if ($('.large-slider .slider-ruler span.active').next().length) {$('.large-slider .slider-ruler span.active').next().click();} 81 else {$('.large-slider .slider-ruler span:first-child').click();} 82 },6000); 83 84 $('.treb-block-names input').keyup(function(){ 85 calctreb(); 86 }); 87 $('.treb-block select[name=type]').change(function(){ 88 calctreb(); 89 }); 90 $('.treb-block select[name=about]').change(function(){ 91 if ($(this).val()=='1') {$('.treb-block-names').removeClass('black-treb'); $('.blacktreb').hide(); $('.whitetreb').show(); $('.treb-block select[name=type]').prop('selectedIndex', 0);} 92 else {$('.treb-block-names').addClass('black-treb'); $('.blacktreb').show(); $('.whitetreb').hide(); $('.treb-block select[name=type]').prop('selectedIndex', 0);} 93 }); 94 $('input[name=person], input[name=email]').keyup(function(){ 95 $(this).css('background-color','transparent'); 96 }); 97 $('.mrc-go .btn').click(function(e){ 98 e.preventDefault(); 99 if (parseInt($('input[name=sum]').val())<parseInt($('input[name=sum]').attr('data-minsum'))) {$('input[name=sum]').val($('input[name=sum]').attr('data-minsum'));} 100 minidata=''; 101 $('.treb-block input, .treb-block select').each(function(){minidata+=$(this).attr('name')+'='+$(this).val()+'&';}); 102 minidata+='invid='+$('.mrc-form input[name=InvId]').val(); 103 if ($('input[name=person]').val()=='' || $('input[name=email]').val()=='') 104 { 105 if ($('input[name=person]').val()=='') {$('input[name=person]').css('background-color','#ffd0d0');} 106 if ($('input[name=email]').val()=='') {$('input[name=email]').css('background-color','#ffd0d0');} 107 } 108 else 109 { 110 //$('.mrc-go .btn').hide(); 111 $.ajax({
112 type: 'POST', 113 url: '/script/treb/', 114 data: minidata, 115 success: function(answer) { console.log(answer); 116 arr=JSON.parse(answer); 117 if (arr['status']=='ok') 118 { 119 window.location.href = arr['redirect']; 120 } 121 else {$('.mrc-go .btn').show();} 122 } 123 }); 124 } 125 }); 126 127 $('.gallery-zm').lightGallery({ 128 selector: '.gall-pic', 129 thumbnail: false, 130 animateThumb: false, 131 showThumbByDefault: false 132 }); 133 134 $('audio').on('play', function() { 135 $('audio').not(this).each(function() { 136 $(this).trigger('pause'); 137 }) 138 }) 139 140}); 141 142function resize_sliders() 143{ 144 145 $('.slider-unit, .slide-base, .slider-ruler, .slider-arrows').attr('style',''); 146 $('.slider-unit, .slide-base').css('transition','0s'); 147 $(this).find('.slider-ruler span').removeClass('active'); 148 $('.slider, .large-slider').each(function(){ 149 var num = $(this).find('.slide-base > div').length; 150 var prwdt = $(this).find('.slide-base > div').width(); 151 var hgt = $(this).find('.slide-base > div').height(); 152 var wdt = $(this).width(); 153 //var nxtwdt = wdt*Math.ceil(num*prwdt/wdt); 154 var nxtwdt = Math.ceil(wdt*num/Math.floor(wdt/prwdt)); 155 if (nxtwdt<wdt) {nxtwdt=wdt;} 156 $(this).find('.slider-unit').css('display','block'); 157 if ($(this).hasClass('large-slider')) {$(this).find('.slider-unit').css('width',wdt+'px');} 158 $(this).find('.slide-base').css('height',hgt+'px'); 159 $(this).find('.slide-base').css('width',nxtwdt+'px'); 160 $(this).find('.slide-base').css('margin-left','0px'); 161 $(this).find('.slider-ruler span:first-child').addClass('active'); 162 if (Math.ceil(num*prwdt/wdt)==1) {$(this).find('.slider-ruler').css('display','none'); $(this).find('.slider-arrows').css('display','none');} 163 }); 164 $('.slider-unit, .slide-base').css('transition','0.5s'); 165} 166 167 168function calctreb() 169{ 170 var n=0; 171 var s=10; 172 var ndx=parseInt($('select[name=type]').val()); 173 $('.treb-block-names input').each(function(){ 174 if ($(this).val()!='') {n++;} 175 }); 176 var c=[0,150,350,500,900,1600,3000,25000,300,300,300,300,300,300,250,400,550,1000,1800,3500,30000,150,350,500,900,1600,3000,25000,300,200,300]; 177 var b=[0,1,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0]; 178 if (b[ndx]==1) {n=1;} 179 s=c[ndx]*n; 180 if (s>0) {$('input[name=sum]').val(s).attr('data-minsum',s);} 181}
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.