1document.createElement('main'); 2$('html').addClass('js'); 3 4$(document).ready(function(){ 5 6 // homeslider slogans 7 $('#homeslider .slider-layer.layer-slogans').each(function() { 8 9 var $slogans = $(this); 10 var $slogans_width_size = $slogans.find('.slogans').children('div').children('div'); 11 var $list = $slogans_width_size.find('ul'); 12 13 14 15 var sliderResized = function() { 16 17 $slogans_width_size[0].style.setProperty('--slogans-width', $slogans_width_size.width() + 'px'); 18 $slogans.addClass('resized'); 19 20 var nr = 0; 21 $list.children().each(function() { 22 $slogans_width_size[0].style.setProperty('--slogan' + nr+ '-width', $(this).width() + 'px'); 23 $slogans_width_size[0].style.setProperty('--slogan' + nr+ '-height', $(this).height() + 'px'); 24 $(this)[0].style.setProperty('--slogan-height', $(this).height() + 'px'); 25 nr++; 26 }); 27 28 $slogans_width_size[0].style.setProperty('--slogans-height', $list.height() + 'px'); 29 30 $slogans.addClass('resized2'); 31 32 33 34 //$slogans.addClass('resized2'); 35 36 /* 37 38 39 */ 40 } 41 42 43 44 sliderResized(); 45 $(window).load(sliderResized); 46 $(window).resize(sliderResized); 47 setInterval(sliderResized, 1000); 48 49 }); 50 51 setTimeout(function() { 52 $('html').addClass('animated'); 53 }, 250); 54 55 // cookie policy 56 $('#cookies-info').each(function() { 57 var $cookies_info = $(this); 58 setTimeout(function(){$cookies_info.addClass('show');}, 1000); 59 var cookies_id = $cookies_info.data('id'); 60 $cookies_info.find('.accept').click(function(e){ 61 $cookies_info.addClass('closed'); 62 $.cookie('cookie_info', cookies_id, {expires: 50, path: '/'}); 63 e.preventDefault(); 64 $(this).blur(); 65 }); 66 }); 67 68 // map 69 $('.page-module__map').each(function() { 70 var $map = $(this); 71 var $map_position = $map.find('.map-position'); 72 var $map_size = $map.find('.map-size'); 73 var $map_list = $map.find('.map-list'); 74 var $map_clicked = $map.find('.map-clicked'); 75 var $pins = $map.find('.pin'); 76 var $list_pins = $map.find('.list-pin'); 77 var position = 0; 78 var from_top = 0; 79 var all_height = 0; 80 var map_height = 0; 81 var list_height = 0; 82 var window_height = 0; 83 var first_position = 0; 84 var higher = false; 85 var smooth = false; 86 var max_move = 0; 87 if($map.hasClass('map-smooth')) 88 smooth = true; 89 $map.addClass('map-disabled'); 90 $map.addClass('map-position-0'); 91 92 var current_status = 'hovering'; 93 var current_clicked = 0; 94 var current_hovered = 0; 95 96 var setUnclicked = function() { 97 if(current_status === 'clicked') { 98 $map.find('.pin-' + current_clicked).removeClass('clicked'); 99 $map.find('.list-pin-' + current_clicked).removeClass('clicked'); 100 $map.addClass('map-hovering'); 101 $map.removeClass('map-clicked'); 102 current_clicked = 0; 103 current_status = 'hovering'; 104 } 105 }; 106 107 var setClicked = function(set_id) { 108 if(current_status === 'hovered') { 109 $map.find('.pin-' + current_hovered).removeClass('hovered'); 110 $map.find('.list-pin-' + current_hovered).removeClass('hovered'); 111 $map.removeClass('map-hovered'); 112 current_hovered = 0; 113 } 114 if(current_clicked == set_id) { 115 $map.find('.pin-' + current_clicked).removeClass('clicked'); 116 $map.find('.list-pin-' + current_clicked).removeClass('clicked'); 117 $map.addClass('map-hovering'); 118 $map.removeClass('map-clicked'); 119 current_clicked = 0; 120 current_status = 'hovering'; 121 } else { 122 $map.addClass('map-clicked'); 123 $map.find('.pin-' + set_id).addClass('clicked'); 124 $map.find('.list-pin-' + set_id).addClass('clicked'); 125 $map.removeClass('map-hovering'); 126 if(current_clicked != 0) { 127 $map.find('.pin-' + current_clicked).removeClass('clicked'); 128 $map.find('.list-pin-' + current_clicked).removeClass('clicked'); 129 } 130 current_clicked = set_id; 131 current_status = 'clicked'; 132 } 133 }; 134 135 var setHovered = function(set_id) { 136 if(current_status !== 'clicked' && current_hovered != set_id) { 137 $map.find('.pin-' + set_id).addClass('hovered'); 138 $map.find('.list-pin-' + set_id).addClass('hovered'); 139 if(current_hovered == 0) { 140 $map.addClass('map-hovered'); 141 $map.removeClass('map-hovering'); 142 } else { 143 $map.find('.pin-' + current_hovered).removeClass('hovered'); 144 $map.find('.list-pin-' + current_hovered).removeClass('hovered'); 145 } 146 current_hovered = set_id; 147 current_status = 'hovered'; 148 } 149 }; 150 var setUnhovered = function(set_id) { 151 if(current_hovered == set_id) { 152 $map.find('.pin-' + current_hovered).removeClass('hovered'); 153 $map.find('.list-pin-' + current_hovered).removeClass('hovered'); 154 $map.addClass('map-hovering'); 155 $map.removeClass('map-hovered'); 156 current_hovered = 0; 157 current_status = 'hovering'; 158 } 159 }; 160 $map_clicked.click(function(e){ 161 setUnclicked(); 162 $(this).preventDefault(); 163 $(this).blur(); 164 }); 165 166 167 $pins.each(function() { 168 var this_id = $(this).data('id'); 169 $(this).click(function(e){ 170 setClicked(this_id); 171 $(this).preventDefault(); 172 $(this).blur(); 173 }); 174 }); 175 176 $list_pins.each(function() { 177 var this_id = $(this).data('id'); 178 $(this).click(function(e){ 179 setClicked(this_id); 180 $(this).preventDefault(); 181 $(this).blur(); 182 }); 183 $(this).hover(function(){ 184 setHovered(this_id); 185 }, function(){ 186 setUnhovered(this_id); 187 }); 188 }); 189 190 191 192 var scrolled = function() { 193 var scrollpos = $(window).scrollTop(); 194 if(smooth) { 195 var posm = Math.max(0, second_position - first_position); 196 var posp = Math.max(0, Math.min((scrollpos - first_position), posm)); 197 if(posm == 0) { 198 $map_position.css('top', 0 + 'px'); 199 } else { 200 $map_position.css('top', 0 - ( (posp / posm) * max_move ) + 'px'); 201 } 202 } 203 var new_position = 0; 204 if(scrollpos >= first_position) { 205 new_position = 1; 206 } 207 if(scrollpos >= second_position) { 208 new_position = 2; 209 } 210 if(new_position != position) { 211 $map.addClass('map-position-' + new_position); 212 $map.removeClass('map-position-' + position); 213 position = new_position; 214 } 215 }; 216 var resized = function() { 217 $map_position.css('width', $map_size.width() + 'px'); 218 $map_position.css('left', $map_size.offset().left + 'px'); 219 map_height = $map_size.height(); 220 list_height = $map_list.height(); 221 all_height = $map.height(); 222 223 $map_list.css('top', Math.max(0, (all_height - list_height) / 2) + 'px'); 224 225 from_top = $map_size.offset().top; 226 if(all_height > map_height) { 227 if(!higher) { 228 higher = true; 229 $map.removeClass('map-disabled'); 230 } 231 } else { 232 if(higher) { 233 higher = false;
234 $map.removeClass('map-higher'); 235 } 236 } 237 window_height = $(window).height(); 238 second_position = from_top + Math.max(0, (map_height - window_height)) + Math.max(0, (all_height - map_height)); 239 $map_position.css('font-size', Math.max(0, (all_height - map_height)) + 'px'); 240 if(smooth) { 241 first_position = from_top; 242 max_move = Math.max(0, (map_height - window_height)); 243 } else { 244 first_position = from_top + Math.max(0, (map_height - window_height)); 245 $map_position.css('top', (0 - Math.max(0, (map_height - window_height))) + 'px'); 246 max_move = 0; 247 } 248 scrolled(); 249 }; 250 resized(); 251 $(window).load(resized); 252 $(window).resize(resized); 253 $(window).scroll(scrolled); 254 setInterval(function(){resized();}, 1000); 255 }); 256 257 // partners 258 $('.home-logos').each(function() { 259 var $mod = $(this); 260 var $mod_out = $mod; 261 var $mod_in = $mod.find('.in'); 262 var mod_move = false; 263 var mod_width = -1; 264 var mod_ul_width = -1; 265 var mod_position = -1; 266 var mod_speed = 1; 267 var mod_speed_slow = 0.2; 268 var mod_speed_current = mod_speed; 269 $mod.hover( function() { 270 mod_speed_current = mod_speed_slow; 271 }, function() { 272 mod_speed_current = mod_speed; 273 }); 274 $mod_out.find("li.nourl a").click(function(a) { 275 a.preventDefault(); 276 $(this).blur(); 277 }); 278 var $mod_ul = $mod.find('ul'); 279 $mod_ul.imagesLoaded() 280 .always( function( instance ) { 281 var $mod_ul2 = $mod_ul.clone().css('display','none'); 282 $mod_ul2.appendTo($mod_ul.parent()); 283 var modResize = function() { 284 var new_mod_width = $mod_out.width(); 285 var new_mod_ul_width = $mod_ul.width(); 286 if(new_mod_width != mod_width || new_mod_ul_width != mod_ul_width) { 287 mod_width = new_mod_width; 288 mod_ul_width = new_mod_ul_width; 289 mod_position = 0; 290 $mod_in.css('left','0px'); 291 if(mod_ul_width > mod_width) { 292 mod_move = true; 293 $mod_ul2.css('display','block'); 294 } else { 295 mod_move = false; 296 $mod_ul2.css('display','none'); 297 } 298 } 299 }; 300 modResize(); 301 $(window).resize(modResize); 302 var moveFrame = function(){ 303 if(mod_move) { 304 new_position = mod_position + mod_speed_current; 305 if(new_position >= mod_ul_width) { 306 new_position = 0; 307 } 308 mod_position = new_position; 309 $mod_in.css('left', (0 - mod_position) +'px'); 310 } 311 move = requestAnimationFrame(moveFrame); 312 } 313 var move = requestAnimationFrame(moveFrame); 314 }); 315 }); 316 317 318 // nourl 319 $('a.nourl').click(function(e){ 320 $(this).blur(); 321 e.preventDefault(); 322 }); 323 324 // home sections heights 325 $('#home-sections').each(function() { 326 var $sections = $(this).find('.section'); 327 if($sections.length > 1) { 328 var resized = function() { 329 var max_height = 0; 330 $sections.each(function() { 331 max_height = Math.max(max_height, $(this).height()); 332 }); 333 $sections.each(function() { 334 $(this).find('.section-box').css('font-size' , (max_height - $(this).height()) + 'px'); 335 }); 336 }; 337 resized(); 338 $(window).load(resized); 339 $(window).resize(resized); 340 } 341 }); 342 343 // clouds height 344 $('#home-slider .clouds').each(function() { 345 var $clouds = $(this); 346 var resized = function() { 347 $clouds.css('font-size', $clouds.height() + 'px'); 348 }; 349 resized(); 350 $(window).load(resized); 351 $(window).resize(resized); 352 setInterval(function(){ resized(); }, 2000); 353 $clouds.addClass('resized'); 354 }); 355 356 // randmove 357 $('.randmoveleft').each(function() { 358 var current_pos = 0; 359 var maxmove = 20; 360 var suffix = 'px'; 361 var speed = 20; 362 var $element = $(this); 363 var move = function() { 364 var new_pos = (Math.random() * 200) - 100; 365 var distance = Math.abs(current_pos - new_pos); 366 if(distance > 0) { 367 current_pos = new_pos; 368 var new_pos_css = ((new_pos / 100) * maxmove) + suffix ; 369 var time = distance * speed; 370 $element.animate({ left: new_pos_css }, time, 'linear', function() { 371 move(); 372 }); 373 } else { 374 move(); 375 } 376 }; 377 move(); 378 }); 379 $('.randmovetop').each(function() { 380 var current_pos = 0; 381 var maxmove = 20; 382 var suffix = 'px'; 383 var speed = 10; 384 var $element = $(this); 385 var move = function() { 386 var new_pos = (Math.random() * 200) - 100; 387 var distance = Math.abs(current_pos - new_pos); 388 if(distance > 0) { 389 current_pos = new_pos; 390 var new_pos_css = ((new_pos / 100) * maxmove) + suffix ; 391 var time = distance * speed; 392 $element.animate({ top: new_pos_css }, time, 'linear', function() { 393 move(); 394 }); 395 } else { 396 move(); 397 } 398 }; 399 move(); 400 }); 401 402 403 // mainmenu side 404 $('.mainmenu').each(function() { 405 406 var $mainmenu = $(this); 407 var $mainmenu_list = $mainmenu.children(); 408 409 410 var resized = function() { 411 412 $mainmenu.removeClass('resized'); 413 414 $mainmenu_list.each(function() { 415 416 var $item = $(this); 417 var onleft = false;
418 419 var submenu = false; 420 var maxright = -9999999; 421 422 if($item.find('ul').length) { 423 var submenu = true; 424 $item.find('ul').each(function() { 425 maxright = Math.max(maxright, $(this).offset().left + $(this).width()); 426 }); 427 } 428 429 if(submenu) { 430 431 var rightspace = $(window).width() - maxright; 432 var maxwidth = maxright - $(this).offset().left; 433 var leftspace = $(this).offset().left + $(this).width() - maxwidth; 434 435 if(rightspace < 0) { 436 if(leftspace > rightspace) { 437 onleft = true; 438 } 439 } 440 441 } 442 443 if(onleft) { 444 $item.addClass('onleft'); 445 } else { 446 $item.removeClass('onleft'); 447 } 448 449 }); 450 451 $mainmenu.addClass('resized'); 452 453 }; 454 resized(); 455 $(window).load(resized); 456 $(window).resize(resized); 457 458 }); 459 460 // header clone prepend 461 $('#header .prepend-clone').each(function() { 462 var cloned = $(this); 463 cloned.clone().addClass('clone').prependTo(cloned.parent()); 464 }); 465 466 // scrolled 467 468 // page scrolled 469 var page_scrolled = false; 470 var page_scrolled_down = false; 471 var page_scrolled_header = false;
472 var page_scrolled_last = 0; 473 474 var page_scrolled_header_scrolled = 0; 475 var $page_scrolled_header_scrolled = $('<div class="header-scrolled-height"></div>'); 476 $('#header').append($page_scrolled_header_scrolled); 477 478 var isPageScrolled = function(reset_scroll) { 479 var current_scroll = $(window).scrollTop(); 480 if(reset_scroll) { 481 if(page_scrolled_down) { 482 page_scrolled_down = false; 483 $('html').removeClass('page-scrolled-down'); 484 } 485 page_scrolled_header_scrolled = $page_scrolled_header_scrolled.height(); 486 page_scrolled_last = current_scroll; 487 } else { 488 if(current_scroll != page_scrolled_last) { 489 if(current_scroll > page_scrolled_last) { 490 if(!page_scrolled_down) { 491 page_scrolled_down = true; 492 $('html').addClass('page-scrolled-down'); 493 } 494 } else { 495 if(page_scrolled_down) { 496 page_scrolled_down = false; 497 $('html').removeClass('page-scrolled-down'); 498 } 499 } 500 page_scrolled_last = current_scroll; 501 } 502 } 503 if(current_scroll > 0) { 504 if(!page_scrolled) { 505 page_scrolled = true; 506 $('html').addClass('page-scrolled'); 507 } 508 } else { 509 if(page_scrolled) { 510 page_scrolled = false; 511 $('html').removeClass('page-scrolled'); 512 } 513 } 514 if(current_scroll > page_scrolled_header_scrolled) { 515 if(!page_scrolled_header) { 516 page_scrolled_header = true; 517 $('html').addClass('page-scrolled-header'); 518 } 519 } else { 520 if(page_scrolled_header) { 521 page_scrolled_header = false;
522 $('html').removeClass('page-scrolled-header'); 523 } 524 } 525 }; 526 isPageScrolled(true); 527 $(window).load(function() { isPageScrolled(true); }); 528 $(window).resize(function() { isPageScrolled(true); }); 529 $(window).scroll(function() { isPageScrolled(false); }); 530 531 // orientation 532 var orientation = 'landscape'; 533 $('html').addClass('orientation-landscape'); 534 var resizedOrientation = function() { 535 536 if($(window).width() >= $(window).height()) { 537 if(orientation !== 'landscape') { 538 orientation = 'landscape'; 539 $('html').addClass('orientation-landscape'); 540 $('html').removeClass('orientation-portrait'); 541 } 542 } else { 543 if(orientation !== 'portrait') { 544 orientation = 'portrait'; 545 $('html').addClass('orientation-portrait'); 546 $('html').removeClass('orientation-landscape'); 547 } 548 } 549 }; 550 resizedOrientation(); 551 $(window).load(resizedOrientation); 552 $(window).resize(resizedOrientation); 553 554 //gallery 555 $(".page-module__gallery ul").each(function(){ 556 $(this).find('a').magnificPopup({ 557 type: 'image', 558 gallery:{ 559 enabled:true 560 } 561 }); 562 }); 563 564 // contact form 565 $(".page-module__contact_form").each(function(){ 566 var form = $(this); 567 form.find(".email_bp").remove(); 568 form.find("textarea[name='message'], input[name='name'], input[name='email'], input[name='phone']").each(function(){ 569 var this_name = $(this).prop('name'); 570 if(form.find("input[name='" + this_name + "_ignore_value']").length) { 571 var this_ignore = form.find("input[name='" + this_name + "_ignore_value']").val(); 572 $(this).focus(function() { 573 if( $(this).val() === this_ignore) { $(this).val(''); } 574 }); 575 $(this).blur(function() { 576 if( $(this).val() === '') { $(this).val(this_ignore); } 577 }); 578 } 579 }); 580 form.find('.button').click(function(e) { 581 582 var rules1 = 0; 583 if(form.find('input[name=\'rules1\']').length && form.find('input[name=\'rules1\']').prop("checked")) { 584 rules1 = 1; 585 } 586 587 var rules2 = 0; 588 if(form.find('input[name=\'rules2\']').length && form.find('input[name=\'rules2\']').prop("checked")) { 589 rules2 = 1; 590 } 591 592 $.ajax({ 593 url: form.find('input[name=\'submit_url\']').val(), 594 type: 'post', 595 dataType: 'json', 596 data: 'form_id=' + form.find('input[name=\'form_id\']').val() + '&ajax=1&rules1=' + rules1 + '&rules2=' + rules2 + '&message=' + encodeURIComponent(form.find('textarea[name=\'message\']').val()) + '&name=' + encodeURIComponent(form.find('input[name=\'name\']').val()) + '&email=' + encodeURIComponent(form.find('input[name=\'email\']').val()) + '&phone=' + encodeURIComponent(form.find('input[name=\'phone\']').val()) + '&message_ignore_value=' + encodeURIComponent(form.find('textarea[name=\'message_ignore_value\']').val()) + '&name_ignore_value=' + encodeURIComponent(form.find('input[name=\'name_ignore_value\']').val()) + '&email_ignore_value=' + encodeURIComponent(form.find('input[name=\'email_ignore_value\']').val()) + '&phone_ignore_value=' + encodeURIComponent(form.find('input[name=\'phone_ignore_value\']').val()) + '&hash=' + encodeURIComponent(form.find('input[name=\'hash\']').val()), 597 beforeSend: function() { 598 form.find('.error').css('display','none'); 599 form.find('.button').attr('disabled', true); 600 form.find('.button').css('display','none'); 601 form.find('.notice').html(form.find('input[name=\'loading_text\']').val()); 602 form.find('.notice').css('display','block'); 603 }, 604 success: function(data) { 605 if (data['error']) { 606 form.find('.error').html(data['error']); 607 form.find('.error').css('display','block'); 608 form.find('.notice').css('display','none'); 609 form.find('.button').attr('disabled', false); 610 form.find('.button').css('display','block'); 611 } 612 if (data['success']) { 613 form.find('.notice').addClass('success').html(data['success']); 614 } 615 } 616 }); 617 e.preventDefault(); 618 }); 619 }); 620 621});
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.