1//WideVision Was Here// 2$(document).ready(function ($) { 3 4 jQuery.fn.hasAttr = function(name) { 5 return this.attr(name) !== undefined; 6 } 7 8 setTimeout(function() { $("#preloader").fadeOut(); }, 3000 ); 9 10 if ($("#nav-icon-desktop").length > 0) { 11 $('#nav-icon-desktop').click(function(){ 12 $(this).toggleClass('open') 13 $("#main-menu-desktop").slideToggle() 14 }); 15 } 16 17 if ($("#main-nav").length > 0) { 18 19 $("#sld_contacts").trigger("mouseenter") //force menu close 20 21 //DescBox 22 if ( $('#desc_cnt').length > 0 ) { 23 $('#desc_box').html($('#desc_cnt').html()); 24 $('#read_more').click(function() { $('#dbx').slideToggle(); }); 25 } 26 27 //Menu 28 var _lang = $("#desk_nav").data("lang"); 29 var _bs_url = $("#desk_nav").data("url"); 30 $.post(_bs_url+"assets/inc/desk-nav.php", { 31 lang: _lang 32 }).done(function(data) { 33 $("#desk_nav").html(data); 34 }) 35 36 if ( $('.smenu').length > 0 ) { 37 $('.smenu').find("li").each(function() { 38 $(this).find("a").each(function() { 39 var ttl = $(this).attr('title'); 40 if (typeof ttl !== typeof undefined && ttl !== false) { 41 $(this).html(ttl); 42 } 43 }); 44 }); 45 } 46 47 } 48 49 $(document).off('click','.mnu_lnk').on('click','.mnu_lnk', function() { 50 51 var url = $(this).data("url") 52 location.href = url 53 54 }) 55 56 $(document).off('click','.mnu_lnk_blank').on('click','.mnu_lnk_blank', function() { 57 58 var url = $(this).data("url") 59 window.open(url, '_blank') 60 61 }) 62 63 //Detect Safari 64 let userAgentString = navigator.userAgent; 65 if (userAgentString.indexOf("Safari") > -1) { 66 $(".nav-logo_").css("top","56px !important") 67 } 68
69 //if(navigator.userAgent.search("mobile") > 0){ 70 if (( /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) && (window.innerWidth < 750) ) { 71 72 //Popup Wellness 73 if ($(".xtimes").length > 0) { 74 $(".xtimes").on("click", function() { 75 $("#popup-wellness").hide(); 76 }) 77 } 78 79 } else { 80 81 //Modal 82 if ( $('#modalPopup').length > 0 ) { 83 84 $('#modalPopup').modal('show'); 85 86 } 87 $(document).on("click", ".openModal", function(e) { 88 89 e.preventDefault() 90 $('#_modalPopup').fadeIn('fast') 91 92 if ($(this).hasAttr("data-modal")) { 93 94 var id = $(this).data("modal") 95 var stars = $('._rev_stars_'+id).html() 96 var ttl = $('._rev_ttl_'+id).html() 97 var txt = $('._rev_txt_'+id).html() 98 99 $("#rev_stars").html(stars) 100 $("#rev_title").html(ttl) 101 $("#rev_txt").html(txt) 102 103 } 104 105 }) 106 $(document).on("click", ".closeModal", function(e) { 107 108 e.preventDefault() 109 $('#_modalPopup').fadeOut('fast') 110 111 }) 112 113 //Header 114 var data_menu = $("body").data("page-menu"); 115 data_menu = (typeof data_menu !== 'undefined' && data_menu !== false) ? data_menu : ""; 116 if (data_menu == "nobg") { 117 118 $(window).scroll(function() { 119 if($(this).scrollTop() >= 300){ 120 if ($(".header_banqueting").length > 0) { 121 //$(".nav-logo_").addClass("nav-logo_black") 122 } else { 123 $("#header").addClass("header-bg") 124 } 125 } else { 126 $("#header").removeClass("header-bg") 127 if ($(".header_banqueting").length > 0) { 128 //$(".nav-logo_").removeClass("nav-logo_black") 129 } 130 } 131 }) 132 133 } 134 if ( ($("body").data("page-id") == 'iarticle') && (data_menu != "nobg") ) { $("#header").addClass("header-bg"); } 135 136 $('body').mousewheel(function(event) { 137 if ($(window).scrollTop() == 0) { 138 if (event.deltaY < 0) { 139 if (!$("#header").hasClass("scrolled")) { 140 $("#topper").css("padding-top","0"); $("#topper").css("transition", "all 300ms cubic-bezier(0.420, 0.000, 1.000, 1.000"); 141 if ($("body").data("page-id") != 'iarticle') { $("#header").addClass("header-bg"); } 142 $(".nav-logo").css("top", "57px"); $(".nav-logo").css("transition", "all 300ms cubic-bezier(0.420, 0.000, 1.000, 1.000"); 143 //$("#fixed_booking_").css("top", "0"); $("#fixed_booking_").css("transition", "all 300ms cubic-bezier(0.420, 0.000, 1.000, 1.000"); 144 //$("#booking-cnt").hide(); 145 } 146 } else { 147 $("#topper").css("padding-top","0"); 148 if ($("body").data("page-id") != 'iarticle') { $("#header").removeClass("header-bg"); } 149 $(".nav-logo").css("top", "57px"); 150 //$("#fixed_booking_").css("top","-50px"); 151 //$("#booking-cnt").show(); 152 } 153 } else { 154 //$("#booking-cnt").hide(); 155 if ($("body").data("page-id") != 'iarticle') { $("#header").addClass("header-bg"); } 156 } 157 }); 158 159 if ($(window).scrollTop() > 0) { 160 if ($("body").data("page-id") != 'iarticle') { $("#header").addClass("header-bg"); } 161 } 162 163 } 164 165 //Banqueting 166 if ($("#form_richiesta_banqueting").length > 0) { 167 168 //Hamburger Menu 169 const _body = document.getElementById('_banqueting_new') 170 const hamburger = document.getElementById('_bqt_hamburger') 171 const hamburger_mob = document.getElementById('_bqt_hamburger_mob') 172 const overlay = document.getElementById('_bqt_overlayMenu') 173 174 hamburger.addEventListener('click', () => { 175 hamburger.classList.toggle('_bqt_active') 176 overlay.classList.toggle('_bqt_active') 177 _body.classList.toggle('_bqt-no-overflow') 178 }) 179 180 hamburger_mob.addEventListener('click', () => { 181 hamburger_mob.classList.toggle('_bqt_active') 182 overlay.classList.toggle('_bqt_active') 183 _body.classList.toggle('_bqt-no-overflow') 184 }) 185 186 var wwidth = $(window).width() 187 var wheight = $(window).height() 188 $(".rr__button").hide() 189 190 /* 191 //media Query to calculate height 192 if (wheight >= 900) { 193 //bottom = 2200 194 } 195 /**/ 196 197 if (wwidth >= 800) { //only for desktop view 198 199 var b_width = $("#form_richiesta_banqueting").width() + 20 200 var distance = $("#form_richiesta_banqueting").offset().top 201 var distance_top = $("#form_richiesta_banqueting").offset().top + 100 202 var bottom = 2200 203 //var bottom = $("#scroll_end").offset().top 204 //var bottom = $("#banqueting_footer_box").offset().top 205 //var bottom = ($(window).height()) - $("#banqueting_footer_box").height() 206 //var bottom = $("#scroll_end").offset().top - 400 207 208 //$("#btnReq").html($(window).scrollTop()+' - '+bottom+' - '+wheight) 209 210 function handleBox() { 211 212 var distance_l = $("#form_richiesta_banqueting").offset().left 213 var distance_r = $("#form_richiesta_banqueting").offset().right 214 215 if ( ($(window).scrollTop() >= distance_top - 100) && ($(window).scrollTop() <= bottom - 150) ) { 216 $("#form_richiesta_banqueting").css({position:'fixed', top:'0px', left:distance_l+'px', 'z-index': '8', width: b_width+'px'}) 217 } else if ( ($(window).scrollTop() >= distance - 150) && ($(window).scrollTop() >= bottom - 250) ) { 218 $("#form_richiesta_banqueting").css({position:'absolute', top:bottom+'px', left:distance_l+'px', width: b_width+'px'}) 219 } else { 220 $("#form_richiesta_banqueting").css({position:'absolute', top:distance+'px', left:distance_l+'px', width: b_width+'px'}) 221 } 222 $("#form_richiesta_banqueting").data("right", distance_r) 223 224 } 225 226 window.addEventListener('scroll', handleBox) 227 window.addEventListener('resize', function() { 228 229 $("#form_richiesta_banqueting").removeAttr('style') 230 b_width = $("#form_richiesta_banqueting").width() + 25 231 $('html, body').scrollTop($(window).scrollTop() + 1) 232 233 }) 234 235 } else { 236 237 function isVisible($el) { 238 const rect = $el[0].getBoundingClientRect(); 239 return rect.top < window.innerHeight && rect.bottom > 0; 240 } 241 242 function toggleDiv() { 243 if (isVisible($('#form_richiesta_banqueting'))) { 244 $('#apt_btn_mobile').hide(); 245 } else { 246 $('#apt_btn_mobile').show(); 247 } 248 } 249 250 $(window).on('scroll resize load', toggleDiv); 251 252 } 253 254 $("#btnReqBanqueting").on("click", function() { 255 256 var btn = $(this) 257 var err = 0 258 var error = '' 259 260 $($(".form-req").get().reverse()).each(function() { 261 const val = $(this).val() 262 if ($(this).hasClass("form-checkbox-required")) { 263 if (!$(this).is(":checked")) { 264 err = 1 265 error = $(this).data("error") 266 } 267 } else if ($(this).hasClass("form-req-email")) { 268 if (!ValidateEmail(val)) { 269 err = 1 270 error = $(this).data("error") 271 } 272 } else { 273 if (val == "") { 274 err = 1 275 error = $(this).data("error") 276 } 277 } 278 }) 279 280 if (err == 1) { 281 282 swal(error) 283 284 } else { 285 286 document.banqueting_form.submit() 287 288 } 289 290 }) 291 292 } 293 294 //RR 295 $("#fixed_booking").css("display","none"); 296 $("#booking-box").css("display","none"); 297 $("#book_button").css("display","none"); 298 //$(".bookBtnHome").on("click", function() { $(".bookBtn").trigger("click") }) 299 //$(".bookBtn").click(function() { $('.book_button > span').trigger('click'); }); 300 301 //Hero Slider - New/Light version 302 if ($('.hero_slider').length > 0) { 303 304 var bgs = $('.hero_slider').data("bg") 305 var bg = bgs.split(";") 306 307 //Preload Images 308 for (let i = 0; i < bg.length; i++) { 309 $('.hero_slider').append('<img src="'+bg[i]+'" class="slide_bg">') 310 } 311 312 let count = 0; 313 314 function cycleArray() { 315 let b = bg[count]; 316 count++; 317 if (count === bg.length) { 318 count = 0; 319 } 320 $('.hero_slider').attr("style", "background:url("+b+") center center;background-size:cover") 321 } 322 323 cycleArray() 324 setInterval(cycleArray, 6000); 325 326 } 327 function moveScroll(){ 328 var scroll = $(window).scrollTop(); 329 var _header = $("#header").height() 330 var anchor_top = $("#micetbl").offset().top - _header;
331 var anchor_bottom = $("#bottom_anchor").offset().top - _header - 100; 332 if (scroll>anchor_top && scroll<anchor_bottom) { 333 clone_table = $("#clone"); 334 if(clone_table.length == 0){ 335 clone_table = $("#micetbl").clone(); 336 clone_table.attr('id', 'clone'); 337 clone_table.css({position:'fixed', 'pointer-events': 'none', top:_header}); 338 clone_table.width($("#micetbl").width()); 339 $("#table-container").append(clone_table); 340 $("#clone").css({visibility:'hidden'}); 341 $("#clone thead").css({'visibility':'visible','pointer-events':'auto'}); 342 } 343 } else { 344 $("#clone").remove(); 345 } 346 } 347 if ($("#micetbl").length > 0) { 348 349 $(window).scroll(moveScroll); 350 351 } 352 353 //Slideshow Home 354 if ($( '.a-hero-bg' ).length > 0) { 355 356 if (( /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) && (window.innerWidth < 750) ) { 357 358 //Camera Singola 359 if ($( '#camera-singola' ).length > 0) { 360 $("#camera-singola").vegas({ 361 slides: [ 362 { src: 'img/gallery/singola-comfort-letto.jpg' }, 363 { src: 'img/gallery/singola-comfort-finestra.jpg' }, 364 { src: 'img/gallery/singola-comfort-bagno.jpg' } 365 ], 366 preloadImage: true, 367 slidesToKeep: 1 368 }); 369 } 370 371 372 if ($( '#camera-double' ).length > 0) { 373 $("#camera-double").vegas({ 374 slides: [ 375 { src: 'img/gallery/standard-matrimoniale.jpg' }, 376 { src: 'img/gallery/standard-matrimoniale-scrivania.jpg' }, 377 { src: 'img/gallery/standard-matrimoniale-scrivania-food.jpg' }, 378 { src: 'img/gallery/standard-matrimoniale-bagno.jpg' } 379 ], 380 preloadImage: true, 381 slidesToKeep: 1 382 }); 383 } 384 385 386 if ($( '#business-suite' ).length > 0) { 387 $("#business-suite").vegas({ 388 slides: [ 389 { src: 'img/gallery/superior-business.jpg' }, 390 { src: 'img/gallery/superior-business-family-divano.jpg' }, 391 { src: 'img/gallery/superior-business-family-tavolo.jpg' } 392 393 ], 394 preloadImage: true, 395 slidesToKeep: 1 396 }); 397 } 398 399 if ($( '#family-suite' ).length > 0) { 400 $("#family-suite").vegas({ 401 slides: [ 402 { src: 'img/gallery/superior-family.jpg' }, 403 { src: 'img/gallery/superior-business-family-tavolo.jpg' }, 404 { src: 'img/gallery/superior-business-family-divano.jpg' } 405 ], 406 preloadImage: true, 407 slidesToKeep: 1 408 }); 409 } 410 411 if ($( '#deluxe-suite' ).length > 0) { 412 $("#deluxe-suite").vegas({ 413 slides: [ 414 { src: 'img/gallery/suite-deluxe.jpg' }, 415 { src: 'img/gallery/suite-letto-dettaglio.jpg' }, 416 { src: 'img/gallery/suite-deluxe-letto.jpg' }, 417 { src: 'img/gallery/suite-deluxe-bagno.jpg' } 418 ], 419 preloadImage: true, 420 slidesToKeep: 1 421 }); 422 } 423 424 } 425 426 //Home 427 if ($( '#hero-home' ).length > 0) { 428 $("#hero-home").vegas({ 429 slides: [ 430 // { src: 'img/gal/mice-event-new.jpg', ttl: loc.txt07, txt: loc.txt08 }, 431 { src: 'images/hero/hotel.jpg', ttl: loc.txt01, txt: loc.txt02 }, 432 { src: 'images/hero/camera.jpg', ttl: loc.txt01, txt: loc.txt02 }, 433 { src: 'img/gal/hero-wellness-1.jpg', ttl: loc.txt01, txt: loc.txt02 } 434 435 ], 436 preloadImage: true, 437 slidesToKeep: 1, 438 walk: function (index, slideSettings) { 439 //alert("Slide index " + index + " image " + slideSettings.src); 440 $("#slttl").fadeOut(); $("#sltxt").fadeOut(); 441 setTimeout(function() { $("#slttl").html(slideSettings.ttl); $("#sltxt").html(slideSettings.txt); }, 500 ); 442 setTimeout(function() { $("#slttl").fadeIn(); $("#sltxt").fadeIn(); }, 200 ); 443 } 444 }); 445 } 446 //Camera Singola 447 if ($( '#camera-singola' ).length > 0) { 448 $("#camera-singola").vegas({ 449 slides: [ 450 { src: 'images/hero/camera-singola-comfort.jpg' } 451 ], 452 preloadImage: true, 453 slidesToKeep: 1 454 }); 455 } 456 //Camera Double 457 if ($( '#camera-double' ).length > 0) { 458 $("#camera-double").vegas({ 459 slides: [ 460 { src: 'images/hero/camera-matrimoniale.jpg' } 461 ], 462 preloadImage: true, 463 slidesToKeep: 1 464 }); 465 } 466 //Business Suite 467 if ($( '#business-suite' ).length > 0) { 468 $("#business-suite").vegas({ 469 slides: [ 470 { src: 'images/hero/camera-superior.jpg' } 471 472 ], 473 preloadImage: true, 474 slidesToKeep: 1 475 }); 476 } 477 //Family Suite 478 if ($( '#family-suite' ).length > 0) { 479 $("#family-suite").vegas({ 480 slides: [ 481 { src: 'images/hero/camera-superior-family.jpg' } 482 ], 483 preloadImage: true, 484 slidesToKeep: 1 485 }); 486 } 487 //Deluxe Suite 488 if ($( '#deluxe-suite' ).length > 0) { 489 $("#deluxe-suite").vegas({ 490 slides: [ 491 { src: 'images/hero/suite-deluxe.jpg' } 492 ], 493 preloadImage: true, 494 slidesToKeep: 1 495 }); 496 } 497 //Ristorazione 498 if ($( '#food-drink' ).length > 0) { 499 $("#food-drink").vegas({ 500 slides: [ 501 { src: 'img/gallery/food-the-seasons-secondo.jpg' }, 502 { src: 'img/gallery/food-the-seasons-piatto.jpg' }, 503 { src: 'img/gallery/hausbar-esterno.jpg' }, 504 { src: 'img/gallery/food-the-seasons-hall.jpg' } 505 ], 506 preloadImage: true, 507 slidesToKeep: 1 508 }); 509 } 510 //The Seasons 511 if ($( '#seasons-hero' ).length > 0) { 512 $("#seasons-hero").vegas({ 513 slides: [ 514 { src: 'img/gallery/food-the-seasons-hero.jpg' },
515 { src: 'img/gallery/the-seasons-details.jpg' }, 516 { src: 'img/gallery/the-seasons-sala.jpg' } 517 ], 518 preloadImage: true, 519 slidesToKeep: 1 520 }); 521 } 522 //Hausbar 523 if ($( '#bar-hausbar' ).length > 0) { 524 $("#bar-hausbar").vegas({ 525 slides: [ 526 { src: 'img/gallery/hausbar-esterno.jpg' }, 527 { src: 'img/gallery/hausbar-sgabelli.jpg' } 528 ], 529 preloadImage: true, 530 slidesToKeep: 1 531 }); 532 } 533 //Meeting 534 if ($( '#meeting-bari' ).length > 0) { 535 $("#meeting-bari").vegas({ 536 slides: [ 537 { src: 'img/gal/mice-event-new.jpg' }, 538 { src: 'img/gal/mice-hall.jpg' }, 539 { src: 'img/gal/mice-hotel-new.jpg' }, 540 { src: 'img/gal/meeting-room.jpg' }, 541 { src: 'img/gal/meeting-hall.jpg' } 542 543 ], 544 preloadImage: true, 545 slidesToKeep: 1 546 }); 547 } 548 //Wellness 549 if ($( '#area-wellness' ).length > 0) { 550 $("#area-wellness").vegas({ 551 slides: [ 552 { src: 'img/gal/hero-wellness-1.jpg' }, 553 { src: 'img/gal/hero-wellness-2.jpg' }, 554 { src: 'img/gal/wellness-poolside.jpg' } 555 ], 556 preloadImage: true, 557 slidesToKeep: 1 558 }); 559 } 560 //Banqueting 561 if ($( '#sez-banqueting' ).length > 0) { 562 $("#sez-banqueting").vegas({ 563 slides: [ 564 { src: 'img/gal/hotel-cassiopea-hero.jpg' }, 565 { src: 'img/gal/hotel-cassiopea-hall.jpg' }, 566 { src: 'img/gal/hotel-roof.jpg' } 567 ], 568 preloadImage: true, 569 slidesToKeep: 1 570 }); 571 } 572 573 //Arrows 574 if ( ($( '.a-arw' ).length > 0) && ($( '.a-arw' ).is(':visible')) ) { 575 576 $('#vprev').click(function(){ $(".a-hero-bg").vegas('options', 'transition', 'slideRight2').vegas('options','transitionDuration','800').vegas('previous'); }); 577 $('#vnext').click(function(){ $(".a-hero-bg").vegas('options', 'transition', 'slideLeft2').vegas('options','transitionDuration','800').vegas('next'); }); 578 579 //Swipe 580 $(".a-hero").swipe({ 581 swipe:function(event, direction, distance, duration, fingerCount, fingerData) { 582 if (direction == 'left') { 583 $(".a-hero-bg").vegas('options', 'transition', 'slideLeft2').vegas('options','transitionDuration','800').vegas('previous'); 584 } else if (direction == 'right') { 585 $(".a-hero-bg").vegas('options', 'transition', 'slideRight2').vegas('options','transitionDuration','800').vegas('next'); 586 } else if (direction == 'down') { 587 return false; 588 } 589 } 590 }); 591 592 } 593 } 594 595 if ($("#main-nav").length > 0) { 596 597 //Mobile Menu & Booking Box 598 if (( /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) && (window.innerWidth < 750) ) { 599 600 $(".sld").click(function(e) { 601 602 e.preventDefault(); 603 var id = $(this).attr("id"); 604 var sp = id.split("_"); 605 $("#svc").html('<ul>'+$("#svc_"+sp[1]).html()+'</ul>'); 606 $("#subs_mobile").animate({left: "0px"}); 607 608 }); 609 $("#btnback").click(function(e) { 610 611 e.preventDefault(); 612 $("#subs_mobile").animate({left: "100%"}); 613 614 }); 615 $("#mobile_booking").click(function(e) { 616 617 e.preventDefault(); 618 $("#sub_booking_mobile").animate({top: "0"}); 619 $("#content").animate({top: "60px"}); 620 $("#close_mb").fadeIn(); 621 622 }); 623 $("#close_mb").click(function(e) { 624 625 e.preventDefault(); 626 $("#sub_booking_mobile").animate({top: "-130%"}); 627 $("#content").animate({top: "0"}); 628 $("#close_mb").fadeOut(); 629 630 }); 631 //Desktop Menu 632 } else { 633 634 /* 635 let pvc = $("#sld_hotel").position() 636 $("#desk_nav").animate({left: pvc.left+10+"px"}, 0) 637 638 $(window).resize(function(){ 639 let pvc = $("#sld_hotel").position(); 640 $("#desk_nav").animate({left: pvc.left+10+"px"}, 0); 641 }) 642 643 $("#main-nav > ul > li").mouseenter(function() { 644 645 $(this).find("ul").hide() 646 if ($("#desk_nav").is(":visible")) { 647 $(".desk_menu").hide() 648 $("#desk_nav").css("visibility","hidden") 649 } 650 651 let id = $(this).find("ul").attr("id") 652 653 if (typeof id !== 'undefined' && id !== false) { 654 let ul = 220 + $("#_"+id).height()*1; 655 $("#header").animate({ height: ul+"px" }, 200) 656 $("#header").addClass("header_bg") 657 setTimeout(function() { 658 $(".desk_menu").hide() 659 $("#_"+id).show() 660 $("#desk_nav").css("visibility","visible") 661 }, 200) 662 } else { 663 $("#header").animate({ height: "130px" }, 100) 664 $("#header").removeClass("header_bg") 665 } 666 667 }) 668 669 $("#desk_nav").mouseleave(function() { setTimeout(function() { $("#sld_contacts").trigger("mouseenter"); }, 500) }); 670 671 $("#sld_contacts").mouseenter(function() { 672 673 setTimeout(function(){ 674 $("#header").animate({ height: "130px" }, 100) 675 $("#header").removeClass("header_bg") 676 $(".desk_menu").hide() 677 },200) 678 679 }); 680 681 $(document).mouseup(function(e){ 682 var container = $("#header"); 683 if(!container.is(e.target) && container.has(e.target).length === 0){ 684 $("#header").animate({ height: "130px" }, 100) 685 $("#header").removeClass("header_bg") 686 $("#desk_nav").css("visibility","hidden") 687 } 688 }) 689 690 $(window).scroll(function(e) { 691 if ($("#header").hasClass("header_bg")) { 692 $("#sld_contacts").trigger("mouseenter") 693 } 694 }); 695 /**/ 696 697 } 698 699 } 700 701 //Modal Gal 702 if ( ($('.sbox').length > 0) && ($('.nogal').length == 0) ) { 703 $('.sbox').swipebox({ 704 useCSS : true, 705 useSVG : false, 706 initialIndexOnArray : 0, 707 hideCloseButtonOnMobile : false, 708 removeBarsOnMobile : true, 709 hideBarsDelay : 0, 710 videoMaxWidth : 1140, 711 beforeOpen: function() {}, 712 afterOpen: null, 713 afterClose: function() {}, 714 loopAtEnd: false 715 }); 716 } 717 if ( ($('._bbox').length > 0) && ($('.nogal').length == 0) ) { 718 $('._bbox').swipebox({ 719 useCSS : true, 720 useSVG : false, 721 initialIndexOnArray : 0, 722 hideCloseButtonOnMobile : false, 723 removeBarsOnMobile : true, 724 hideBarsDelay : 0, 725 videoMaxWidth : 1140, 726 beforeOpen: function() {}, 727 afterOpen: null, 728 afterClose: function() {}, 729 loopAtEnd: false 730 }); 731 } 732 733 $(document).on("click touchend",".a-menu-btn",function(e){ 734 e.preventDefault(); 735 $("#menu-btn").toggle("click"); 736 }); 737 738 $(document).on("click touchend",".impr, #_chevron, #barw",function(e){ 739 e.preventDefault(); 740 $(".bdet").slideToggle(); 741 if ($("#barw").hasClass("glyphicon-chevron-down")) { 742 $("#barw").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up"); 743 } else if ($("#barw").hasClass("glyphicon-chevron-up")) { 744 $("#barw").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down"); 745 } 746 }); 747 748 //Date 749 $('.datepicker-here').datepicker({ 750 language: loc.lang, 751 minDate: new Date(), 752 autoClose: true 753 }); 754 755 if ($('#arrival_date').length > 0) { 756 $('#arrival_date').datepicker({ 757 language: loc.lang, 758 minDate: new Date(), 759 autoClose: true, 760 position: "top right", 761 onSelect: function onSelect(fd, date) { 762 date.setDate(date.getDate() + 1); 763 $('#depart_date').removeAttr("disabled"); 764 $('#depart_date').datepicker({ 765 language: loc.lang, 766 minDate: date, 767 autoClose: true, 768 position: "top right" 769 }); 770 date.setDate(date.getDate() + 1); 771 var d = date.toISOString().slice(0,10); //YYYY-MM-DD 772 var dt = d.split("-"); 773 var dat = dt[2]+"/"+dt[1]+"/"+dt[0]; 774 $('#depart_date').val(dat); 775 } 776 }); 777 778 } 779 780 if ($('#checkin_date').length > 0) { 781 $('#checkin_date').datepicker({ 782 language: loc.lang, 783 minDate: new Date(), 784 autoClose: true, 785 onSelect: function onSelect(fd, date) { 786 date.setDate(date.getDate() + 1); 787 $('#checkout_date').datepicker({ 788 language: loc.lang, 789 minDate: date, 790 autoClose: true 791 }); 792 date.setDate(date.getDate() + 1); 793 var d = date.toISOString().slice(0,10); //YYYY-MM-DD 794 var dt = d.split("-"); 795 var dat = dt[2]+"/"+dt[1]+"/"+dt[0]; 796 $('#checkout_date').val(dat); 797 } 798 }); 799 800 } 801 802 //Navetta 803 if ($('#go_date').length > 0) { 804 $('#go_date').datepicker({ 805 language: loc.lang, 806 minDate: new Date(), 807 autoClose: true, 808 dateFormat: "dd/mm/yyyy", 809 onSelect: function onSelect(fd, date) { 810 811 var day = date.getDate(); 812 var monthIndex = date.getMonth() + 1; 813 var year = date.getFullYear(); 814 var passdate = (day + '/' + monthIndex + '/' + year); 815 816 $('#postdate').val(passdate); 817 818 } 819 }); 820 821 } 822 823
824 //Image Opacity 825 $(".gal, .ovr").hover(function(){ 826 $(this).stop().animate({"opacity": "0.6"}); 827 },function(){ 828 $(this).stop().animate({"opacity": "1"}); 829 }); 830 831 $(document).on("click touchend",".minus",function(e){ 832 e.preventDefault(); 833 var id = $(this).attr("id"); 834 var sp = id.split("_"); 835 var vl = $("#n_"+sp[1]).val() * 1; 836 var nm = vl; 837 if (vl > 0) { nm = vl - 1; } 838 $("#s_"+sp[1]).html(nm); 839 $("#n_"+sp[1]).val(nm); 840 update_booking(nm, sp[1]); 841 }); 842 $(document).on("click touchend",".plus",function(e){ 843 e.preventDefault(); 844 var id = $(this).attr("id"); 845 var sp = id.split("_"); 846 var vl = $("#n_"+sp[1]).val() * 1; 847 var nm = vl; 848 if (vl < 10) { nm = vl + 1; } 849 $("#s_"+sp[1]).html(nm); 850 $("#n_"+sp[1]).val(nm); 851 update_booking(nm, sp[1]); 852 }); 853 854 //Slide Click 855 $(document).on("click",".gto",function(e){ 856 e.preventDefault(); 857 var goto = $(this).find("a").attr("href"); 858 if (goto !== 'undefined') location.href = goto; 859 }); 860 861 //GDS Click 862 $('#gdsop').on("click",function(e){ 863 e.preventDefault(); 864 $.post("assets/inc/gds-modal.php").done(function(data) { 865 866 $('body').append(data); 867 $('#gdscodes').modal('show'); 868 869 $('#gdscodes').on('hidden.bs.modal', function () { 870 $(this).remove(); 871 }); 872 873 }); 874 }); 875 876 function update_booking(nm, tipo) { 877 878 if (tipo === 'camere') { 879 if ( (nm === 0) || (nm > 1) ) { $("#wroom").html(nm+" "+loc.camere); } else { $("#wroom").html(nm+" "+loc.camera); } 880 } 881 if (tipo === 'adulti') { 882 if ( (nm === 0) || (nm > 1) ) { $("#wadult").html(nm+" "+loc.adulti); } else { $("#wadult").html(nm+" "+loc.adulto); } 883 } 884 if (tipo === 'bambini') { 885 if ( (nm === 0) || (nm > 1) ) { $("#wchild").html(nm+" "+loc.bambini); } else { $("#wchild").html(nm+" "+loc.bambino); } 886 } 887 888 } 889 890 //Grid 891 // $(".gal-item").hover(function(){ 892 // $(this).find(".boxtxt").fadeIn(); 893 // }, function(){ 894 // $(this).find(".boxtxt").fadeOut(); 895 // }); 896 897 //Grid - Fixed Text 898 $(".ggal-item").hover(function(){ 899 $(this).find(".gmaintxt").fadeIn(); 900 if( /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { $(this).find("img").fadeOut(); } 901 }, function(){ 902 $(this).find(".gmaintxt").fadeOut(); 903 if( /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { $(this).find("img").fadeIn(); } 904 }); 905 906 //Slider Txt & Btn 907 if( /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 908 909 $(".a-pictures-carousel-nav, .goto-first").click(function() { 910 $(".swiper-slide").each(function (index, value) { 911 if ($(this).hasClass("swiper-slide-active")) { 912 var $this = $(this).find(".slidertxt"); 913 $(".slidertxt").removeClass("sliderVisible"); 914 $(".slidertxt").fadeOut(); 915 setTimeout(function(th) { $this.fadeIn(); }, 800 ); 916 $this.addClass("sliderVisible"); 917 } 918 }); 919 }); 920 } 921 $(document).on("click",".swiper-slide",function(e){ 922 $(".swiper-slide").each(function (index, value) { 923 if ($(this).hasClass("swiper-slide-active")) { 924 var $this = $(this).find(".slidertxt"); 925 if (!$this.hasClass("sliderVisible")) { 926 $(".slidertxt").removeClass("sliderVisible"); 927 $(".slidertxt").fadeOut(); 928 setTimeout(function() { $this.fadeIn(); }, 300 ); 929 $this.addClass("sliderVisible"); 930 } 931 } 932 }); 933 }); 934 $(document).on("click","#pprev",function(e){ 935 var attr = $(".previous").attr('disabled'); 936 if (typeof attr !== typeof undefined && attr !== false) { 937 //No slide Prev 938 } else { 939 $(".previous").trigger("click"); 940 } 941 }); 942 $(document).on("click","#pnext",function(e){ 943 var attr = $(".next").attr('disabled'); 944 if (typeof attr !== typeof undefined && attr !== false) { 945 //No slide Next 946 } else { 947 $(".next").trigger("click"); 948 } 949 }); 950 951 //WorkAround for Slider & Top Bar 952 if ($("body").hasClass("wln")) { $("body").attr("data-page-id","iarticle"); $("#mobile-title-bar").addClass("mob-fixed"); } 953 if ($("body").attr("data-page-id") == 'iarticle') { $("#mobile-title-bar").addClass("mob-fixed"); } 954 if ($("body").attr("data-mh") == 'fx') { $("#mobile-title-bar").addClass("mob-fixed"); } 955 956 //Slick 957 if ($( '.h-room-slider' ).length > 0) {
958 $( '.h-room-slider' ).slick({ arrows: false, dots: true }); 959 if ($( '.room-lnk' ).length > 0) { 960 $(".room-lnk").click(function() { 961 var lnk = $(this).attr("data-href"); 962 location.href = lnk; 963 }); 964 } 965 } 966 if ($( '.reviews-slider' ).length > 0) { 967 $( '.reviews-slider' ).slick({ arrows: false, dots: true }); 968 $('#sprev').click(function(){ $(".reviews-slider").slick('slickPrev'); }); 969 $('#snext').click(function(){ $(".reviews-slider").slick('slickNext'); }); 970 } 971 if ($( '.review-slider' ).length > 0) { 972 $( '.review-slider' ).slick({ arrows: false, dots: true, slidesToShow: 3, infinite: false, 973 responsive: [ 974 { 975 breakpoint: 1200, // max-width 1024px 976 settings: { 977 slidesToShow: 2 978 } 979 }, 980 { 981 breakpoint: 600, // max-width 600px 982 settings: { 983 slidesToShow: 1 984 } 985 } 986 ] 987 }); 988 $('#sprev').click(function(){ $(".review-slider").slick('slickPrev'); }); 989 $('#snext').click(function(){ $(".review-slider").slick('slickNext'); }); 990 } 991 992 if ($( '.slk-slider' ).length > 0) { 993 994 $( '.slk-slider' ).slick({ 995 centerMode: true, 996 centerPadding: '22%', 997 slidesToShow: 1, 998 dots: false, 999 prevArrow: $(".slk-prev"), 1000 nextArrow: $(".slk-next"), 1001 responsive: [ 1002 { 1003 breakpoint: 500, 1004 settings: { 1005 slidesToShow: 1, 1006 centerPadding: '0%', 1007 } 1008 } 1009 ], 1010 }) 1011 1012 if ($(".slk-video").length > 0) { 1013 $('.slk-slider').on('beforeChange', function(event, slick, currentSlide) { 1014 $('video').each(function() { 1015 $(this).get(0).pause() 1016 }) 1017 var video = $('.slick-current').data("id") 1018 document.getElementById("video_"+video).play() 1019 }); 1020 $('.slk-slider').on('afterChange', function(event, slick, currentSlide) { 1021 $('video').each(function() { 1022 $(this).get(0).pause() 1023 }) 1024 var video = $('.slick-current').data("id") 1025 document.getElementById("video_"+video).play() 1026 }); 1027 } 1028 1029 } 1030 1031 //MICE 1032 if ($( '.sel_filter_sale' ).length > 0) { 1033 $( '.sel_filter_sale' ).on('change', function() { 1034 1035 $(".micerec").hide(); 1036 1037 var tp_class = "micerec"; 1038 if ($('#tipologia_mice').val() != '') { 1039 tp_class = 'tp_'+$('#tipologia_mice').val(); 1040 } 1041 1042 var ln_class = "micerec"; 1043 if ($('#luce_mice').val() != '') { 1044 ln_class = 'ln_'+$('#luce_mice').val(); 1045 } 1046 1047 var cp_class = "micerec"; 1048 if ($('#partecipanti_mice').val() != '') { 1049 cp_class = 'cp_'+$('#partecipanti_mice').val(); 1050 } 1051 1052 var al_class = "micerec"; 1053 if ($('#allestimento_mice').val() != '') { 1054 al_class = 'al_'+$('#allestimento_mice').val(); 1055 } 1056 1057 var found = 0; 1058 $(".micerec").each(function() { 1059 if ( ($(this).hasClass(tp_class)) && ($(this).hasClass(ln_class)) && ($(this).hasClass(cp_class)) ) { 1060 $(this).show(); found = 1; 1061 } 1062 }); 1063 1064 if (found == 0) { $(".nosale").show(); } else { $(".nosale").hide(); } 1065 1066 if(!$('#sale_meeting').is(':visible')) { 1067 1068 smoothscroll("#micebox"); 1069 $('#sale_meeting').slideDown(); 1070 1071 } 1072 1073 }); 1074 } 1075 1076 //Piani MICE 1077 if ($('#select_piano').length > 0) { 1078 $("#meeting_due").hide(); 1079 $('#select_piano').on("change", function(){ 1080 if ($(this).val() === '-1') { $("#meeting_meno_uno").slideDown(); $("#meeting_due").slideUp(); } 1081 if ($(this).val() === '2') { $("#meeting_meno_uno").slideUp(); $("#meeting_due").show(); } 1082 }); 1083 } 1084 1085 //Smooth Scroll 1086 function smoothscroll(el, speed = 1000, offset = 120) { 1087 $('html, body').animate({ 1088 scrollTop: $(el).offset().top - offset 1089 }, 1000); 1090 } 1091 1092 if ($(".scrollto").length > 0) { 1093 $(".scrollto").click(function() { 1094 var target = $(this).data("scroll"); 1095 smoothscroll(target); 1096 }); 1097 } 1098 1099 //Mice Form 1100 if ($('#preventivo_mice').length > 0) { 1101 1102 if ($('.event_start_date').length > 0) { 1103 $('.event_start_date').datepicker({ 1104 language: loc.lang, 1105 minDate: new Date(), 1106 autoClose: true, 1107 onSelect: function onSelect(fd, date) { 1108 date.getDate(); 1109 $('.datepicker-here').datepicker({ 1110 language: loc.lang, 1111 minDate: date, 1112 autoClose: true 1113 }); 1114 $('#data_fine').val($('#data_inizio').val()); 1115 } 1116 }); 1117 1118 } 1119 1120 $('#proceed01').click(function() { 1121 1122 if ( ($("#data_inizio").val() != '') && ($("#data_fine").val() != '') ) { 1123 $("#step02").show(); 1124 smoothscroll("#step02",1000,200); 1125 $('#proceed01').hide(); 1126 } else { 1127 swal(loc.swal01); 1128 } 1129 1130 }); 1131 1132 $('#proceed02').click(function() { 1133 1134 if ($("#num_persone").val() != '') { 1135 $("#step03").show(); 1136 smoothscroll("#step03",1000,200); 1137 $('#proceed02').hide(); 1138 } else { 1139 swal(loc.swal02); 1140 } 1141 1142 }); 1143 1144 $('#proceed03').click(function() { 1145 1146 $("#step04").show(); 1147 smoothscroll("#step04",1000,200); 1148 $('#proceed03').hide(); 1149 1150 }); 1151 1152 $('#proceed04').click(function() { 1153 1154 $("#step05").show(); 1155 smoothscroll("#step05",1000,200); 1156 $('#proceed04').hide(); 1157 1158 }); 1159 1160 $('#proceed05').click(function(e) { 1161 1162 e.preventDefault(); 1163 var err = 0; 1164 1165 //Checkboxes 1166 $("#altri_servizi").val(""); 1167 $("#food_beverage").val(""); 1168 $("#altri_servizi_02").val(""); 1169 $("#food_beverage_02").val(""); 1170 $("#altri_servizi_03").val(""); 1171 $("#food_beverage_03").val(""); 1172 1173 for (i = 1; i < 4; i++) { 1174 $("#sala0"+i+" .cb_as").each(function(){ 1175 if ($(this).is(':checked')) { 1176 var string = $("#altri_servizi_0"+i).val(); 1177 var vl = $(this).attr("name"); 1178 var nm = vl.replace("[]", ""); 1179 var num = $("#sala0"+i+" ."+nm+"_num").val(); 1180 $("#altri_servizi_0"+i).val(string+nm+"|"+num+";"); 1181 } 1182 }); 1183 $("#sala0"+i+" .cb_fb").each(function(){ 1184 if ($(this).is(':checked')) { 1185 var string = $("#food_beverage_0"+i).val(); 1186 var vl = $(this).attr("name"); 1187 var nm = vl.replace("[]", ""); 1188 var num = $("#sala0"+i+" ."+nm+"_num").val(); 1189 $("#food_beverage_0"+i).val(string+nm+"|"+num+";"); 1190 } 1191 }); 1192 } 1193 1194 //Check 1195 if (!$('#accept_privacy').prop('checked')) { err = 1; swal(loc.swal32); } 1196 if ($("#memail").val() == '') { err = 1; swal(loc.swal03); } 1197 if ($("#telefono").val() == '') { err = 1; swal(loc.swal04); } 1198 if ($("#cap").val() == '') { err = 1; swal(loc.swal05); } 1199 if ($("#prov").val() == '') { err = 1; swal(loc.swal06); } 1200 if ($("#citta").val() == '') { err = 1; swal(loc.swal07); } 1201 if ($("#cognome").val() == '') { err = 1; swal(loc.swal08); } 1202 if ($("#nome").val() == '') { err = 1; swal(loc.swal09); } 1203 1204 if (err == 0) { 1205 1206 $('#proceed05').hide(); 1207 $('#proceed_wait').show(); 1208 setTimeout(function() { document.preventivo_mice.submit(); }, 500 ); 1209 1210 } 1211 1212 }); 1213 1214 //Masked Hours 1215 $(".orario").mask("99:99",{placeholder:"__:__"}); 1216 1217 $('.btn-sala').click(function(e) { $('.btn-sala').show(); }); 1218 1219 //Sale 1220 $('#add_sala_02').click(function(e) { 1221 1222 e.preventDefault(); 1223 1224 if ($("#sala01 .numpersone").val() != '') { 1225 1226 $('#add_sala_02').hide(); 1227 $("#boxsala02").show(); 1228 smoothscroll("#boxsala02",1000,200); 1229 1230 } else { 1231 1232 swal(loc.swal02); 1233 1234 } 1235 1236 }); 1237 $('#add_sala_03').click(function(e) { 1238 1239 e.preventDefault(); 1240 1241 if ($("#sala02 .numpersone").val() != '') { 1242 1243 $('#add_sala_03').hide(); 1244 $('#del_sala_02').hide(); 1245 $("#boxsala03").show(); 1246 smoothscroll("#boxsala03",1000,200); 1247 1248 } else { 1249 1250 swal(loc.swal02); 1251 1252 } 1253 1254 }); 1255 $('#del_sala_02').click(function(e) { 1256 1257 e.preventDefault(); 1258 $('#add_sala_01').show(); 1259 smoothscroll("#step02",1000,200); 1260 setTimeout(function() { $("#boxsala02").slideUp(); $("#sala02 .numpersone").val(""); }, 1000 ); 1261 1262 }); 1263 $('#del_sala_03').click(function(e) { 1264 1265 e.preventDefault(); 1266 $('#add_sala_03').show(); 1267 $('#del_sala_02').show(); 1268 smoothscroll("#boxsala02",1000,200); 1269 setTimeout(function() { $("#boxsala03").slideUp(); $("#sala03 .numpersone").val(""); }, 1000 ); 1270 1271 }); 1272 1273 //Rooms 1274 $('#add_room_02').click(function(e) { 1275 1276 e.preventDefault(); 1277 $('#add_room_02').hide(); 1278 $("#boxroom02").show(); 1279 smoothscroll("#boxroom02",1000,200); 1280 1281 }); 1282 $('#add_room_03').click(function(e) { 1283 1284 e.preventDefault(); 1285 $('#add_room_03').hide(); 1286 $('#del_room_02').hide(); 1287 $("#boxroom03").show(); 1288 smoothscroll("#boxroom03",1000,200); 1289 1290 }); 1291 $('#del_room_02').click(function(e) { 1292 1293 e.preventDefault(); 1294 $('#add_room_01').show(); 1295 smoothscroll("#step04",1000,200); 1296 setTimeout(function() { $("#boxroom02").slideUp(); }, 1000 ); 1297 1298 }); 1299 $('#del_room_03').click(function(e) { 1300 1301 e.preventDefault(); 1302 $('#add_room_03').show(); 1303 $('#del_room_02').show(); 1304 smoothscroll("#boxroom02",1000,200); 1305 setTimeout(function() { $("#boxroom03").slideUp(); }, 1000 ); 1306 1307 }); 1308 1309 } 1310 1311 //iCheck 1312 if ($('.icheck').length > 0) { 1313 $('.icheck').each(function(){ 1314 var self = $(this), 1315 label = self.next(), 1316 label_text = label.text(); 1317 1318 label.remove(); 1319 self.iCheck({ 1320 checkboxClass: 'icheckbox_line-grey', 1321 radioClass: 'iradio_line-grey', 1322 insert: '<div class="icheck_line-icon"></div>' + label_text 1323 }); 1324 }); 1325 } 1326 if ($('.check').length > 0) { 1327 $('.check').each(function(){ 1328 var self = $(this), 1329 label = self.next(), 1330 label_text = label.text(); 1331 1332 self.iCheck({ 1333 checkboxClass: 'icheckbox_square', 1334 radioClass: 'iradio_square' 1335 }); 1336 }); 1337 } 1338 1339 //Btn Click
1340 $(document).on("click touchend",".blnk",function(e){ 1341 e.preventDefault(); 1342 var goto = $(this).attr("data-href"); 1343 window.open(goto, '_self'); 1344 }); 1345 1346 //Rating 1347 if ($('.rating').length > 0) { 1348 $('.rating').barrating({ 1349 theme: 'bootstrap-stars' 1350 }); 1351 } 1352 1353 //Forms 1354 if ($('#btnCommunity').length > 0) { 1355 $(document).on("click touchend","#btnCommunity",function(e){ 1356 e.preventDefault(); 1357 var err = 0; 1358 1359 if (!$('#accept_newsletter').prop('checked')) { err = 1; swal(loc.swal32); } 1360 if ($('#communityLastName').val() == '') { err = 1; swal(loc.swal10); } 1361 if ($('#communityName').val() == '') { err = 1; swal(loc.swal25); } 1362 if ( ($('#communityEmail').val() == '') || (ValidateEmail($('#communityEmail').val()) == false) ) { err = 1; swal(loc.swal11); } 1363 1364 if (err == 0) { 1365 1366 $.post("assets/inc/get-form.php?v=1", { 1367 tipo: 'community', nome: $('#communityName').val(), cognome: $('#communityLastName').val(), email: $('#communityEmail').val() 1368 }).done(function(data) { 1369 1370 if (data == 'ko') { swal("", loc.swal12, "warning"); } 1371 if (data == 'ok') { swal("", loc.swal13, "success"); } 1372 1373 }); 1374 1375 } 1376 1377 }); 1378 } 1379 if ($('#btnRecensione').length > 0) { 1380 $(document).on("click touchend","#btnRecensione",function(e){ 1381 e.preventDefault(); 1382 1383 $.post("assets/inc/get-form.php?v=1", { 1384 tipo: 'reviews', note: $('#note').val(), camera: $('#camera').val(), colazione: $('#colazione').val(), 1385 personale: $('#personale').val(), altri_servizi: $('#altri_servizi').val() 1386 }).done(function(data) { 1387 1388 if (data == 'ok') { swal("", loc.swal14, "success"); } 1389 $("#review").modal("close"); 1390 1391 }); 1392 1393 }); 1394 } 1395 1396 if ($( '.abox' ).length > 0) { 1397 $(".abox").click(function() { 1398 let lnk = $(this).data("href"); 1399 location.href = lnk; 1400 }); 1401 } 1402 1403 if ($('#sendBanqueting').length > 0) { 1404 $('#sendBanqueting').click(function(e) { 1405 1406 e.preventDefault(); 1407 var err = 0; 1408 1409 //Check 1410 if (!$('#accept_privacy').prop('checked')) { err = 1; swal(loc.swal32); } 1411 if ($("#dettagli").val() == '') { err = 1; swal(loc.swal15); } 1412 if ($("#ora_app").val() == '') { err = 1; swal(loc.swal16); } 1413 if ($("#data_app").val() == '') { err = 1; swal(loc.swal17); } 1414 if ($("#memail").val() == '') { err = 1; swal(loc.swal18); } 1415 if ($("#telefono").val() == '') { err = 1; swal(loc.swal19); } 1416 if ($("#cognome").val() == '') { err = 1; swal(loc.swal20); } 1417 if ($("#nome").val() == '') { err = 1; swal(loc.swal21); } 1418 1419 if (err == 0) { 1420 1421 document.appuntamento_banqueting.submit(); 1422 1423 } 1424 1425 }); 1426 } 1427 if ($('#btnBookOffer').length > 0) { 1428 $('#btnBookOffer').click(function(e) { 1429 1430 e.preventDefault(); 1431 var err = 0; 1432 1433 //Check 1434 if (!$('#accept_privacy').prop('checked')) { err = 1; swal(loc.swal32); } 1435 if ($("#memail").val() == '') { err = 1; swal(loc.swal23); } 1436 if ($("#telefono").val() == '') { err = 1; swal(loc.swal24); } 1437 if ($("#cognome").val() == '') { err = 1; swal(loc.swal25); } 1438 if ($("#nome").val() == '') { err = 1; swal(loc.swal26); } 1439 1440 if (err == 0) { 1441 1442 document.req_offer.submit(); 1443 1444 } 1445 1446 }); 1447 } 1448 if ($('#sendContact').length > 0) { 1449 $('#sendContact').click(function(e) { 1450 1451 e.preventDefault(); 1452 var err = 0; 1453 1454 //Check 1455 if (!$('#accept_privacy').prop('checked')) { err = 1; swal(loc.swal32); } 1456 if ($("#dettagli").val() == '') { err = 1; swal(loc.swal22); } 1457 if ($("#memail").val() == '') { err = 1; swal(loc.swal23); } 1458 if ($("#telefono").val() == '') { err = 1; swal(loc.swal24); } 1459 if ($("#cognome").val() == '') { err = 1; swal(loc.swal25); } 1460 if ($("#nome").val() == '') { err = 1; swal(loc.swal26); } 1461 1462 if (err == 0) { 1463 1464 document.contact_form.submit(); 1465 1466 } 1467 1468 }); 1469 } 1470 if ($('#btnTable').length > 0) { 1471 $('#btnTable').click(function(e) { 1472 1473 e.preventDefault(); 1474 var err = 0; 1475 1476 //Check 1477 if (!$('#accept_privacy').prop('checked')) { err = 1; swal(loc.swal32); } 1478 if ($("#coperti").val() == '') { err = 1; swal(loc.swal40); } 1479 if ($("#orario").val() == '') { err = 1; swal(loc.swal27); } 1480 if ($("#data").val() == '') { err = 1; swal(loc.swal28); } 1481 if ($("#email").val() == '') { err = 1; swal(loc.swal23); } 1482 if ($("#telefono").val() == '') { err = 1; swal(loc.swal24); } 1483 if ($("#cognome").val() == '') { err = 1; swal(loc.swal29); } 1484 if ($("#nome").val() == '') { err = 1; swal(loc.swal30); } 1485 1486 if (err == 0) { 1487 1488 document.prenota_tavolo.submit(); 1489 1490 } 1491 1492 }); 1493 } 1494 1495 //Number Only 1496 $(".onlynum").keydown(function (e) { 1497 if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || 1498 (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) || 1499 (e.keyCode >= 35 && e.keyCode <= 40)) { 1500 return; 1501 } 1502 if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { 1503 e.preventDefault(); 1504 } 1505 }); 1506 1507 //Choose only one 1508 $(document).on("click", ".only_choose_one", function() { 1509 $(".only_choose_one").attr("checked", false) 1510 }) 1511 1512 if ($(".exp_btn").length > 0) { 1513 1514 $("#exp_offer").slideUp() 1515 $(".exp_btn").on("change", function() { 1516 1517 if ($(this).val() != '') { 1518 $("#exp_offer").slideDown() 1519 } else { 1520 $("#exp_offer").slideUp() 1521 $(".icheck").attr("checked", false).iCheck('update') 1522 } 1523 1524 }) 1525 1526 } 1527 1528 if ($(".expMobTreatment").length > 0) { 1529 $(".expMobTreatment").on("click", function() { 1530 1531 const id = $(this).data("id") 1532 $("#treatment_"+id).show() 1533 1534 }) 1535 } 1536 1537 //Supplementi 1538 if ($("#addRomanticSup").length > 0) { 1539 1540 $("#addRomanticSup").on("click", function() { 1541 $("#luxury_stay").prop("checked", true) 1542 $("#addRomanticSup").addClass("dnone") 1543 $("#delRomanticSup").removeClass("dnone") 1544 }) 1545 $("#delRomanticSup").on("click", function() { 1546 $("#luxury_stay").prop("checked", false) 1547 $("#delRomanticSup").addClass("dnone") 1548 $("#addRomanticSup").removeClass("dnone") 1549 }) 1550 1551 } 1552 1553 //Book Offer // Custom Version 1554 if ($('#book_offer').length > 0) { 1555 1556 //Check offer is active 1557 if ($("#offer_oid").length > 0) { 1558 1559 var oid = $("#offer_oid").data("oid") 1560 1561 $.post("assets/inc/get-offer.php", { 1562 oid: oid 1563 }).done(function(data) { 1564 1565 if (data == '0') { 1566 $("#book_now").addClass("dnone") 1567 } 1568 1569 }) 1570 1571 } 1572
1573 if ($("#tipo_cliente").length > 0) { 1574 1575 $("#npr").hide() 1576 1577 $("#tipo_cliente").on("change", function() { 1578 let val = $(this).find(':selected').attr('data-val') 1579 $("#get_price").val(val) 1580 $("#room_price").data("price", val) 1581 if ($(this).val() == 'si') { 1582 $("#npr").slideDown() 1583 } else { 1584 $("#npr").slideUp() 1585 } 1586 }) 1587 1588 } 1589 1590 if ($('#o_arrival_date').length > 0) { 1591 1592 if ( $('#o_arrival_date').val() == '' ) { 1593 $('#o_depart_date').attr("disabled",true); 1594 } 1595 1596 var disabledDays = ( ($('#t_offer').val() == 'valentino') ) ? [] :[1, 2, 3, 4]; 1597 disabledDays = ( ($('#t_offer').val() == 'easter') ) ? [] : disabledDays; 1598 var disabledDaysRet = ($('#o_svcal').length == 0) ? [1, 2, 3, 4] : [2, 3, 4]; 1599 disabledDaysRet = ( ($('#t_offer').val() == 'valentino') ) ? [] : disabledDaysRet; 1600 disabledDaysRet = ( ($('#t_offer').val() == 'easter') ) ? [] : disabledDaysRet; 1601 1602 var relax_xmas = ( ($('#t_offer_det').length > 0) && ($('#t_offer_det').val() == 'xmas_relax') ) ? 1 : 0 1603 disabledDays = ( relax_xmas === 1 ) ? [] : disabledDays; 1604 disabledDaysRet = ( relax_xmas === 1 ) ? [] : disabledDaysRet; 1605 1606 var tomorrow = new Date(); 1607 tomorrow.setDate(tomorrow.getDate() + 2); 1608 1609 var _mindate = ($('#o_svcal').length == 0) ? tomorrow : new Date('02/16/2019'); 1610 var _maxdate = ($('#t_offer').val() == 'family_summer') ? new Date('09/12/2020') : new Date('01/01/2030'); 1611 _maxdate = ( ($('#t_offer').val() == 'discover_bari') || ($('#t_offer').val() == 'luxury_package') ) ? new Date('10/31/2020') : _maxdate; 1612 //San Valentino 1613 _mindate = ($('#t_offer').val() == 'valentino') ? new Date('2/13/2026') : _mindate; 1614 _maxdate = ($('#t_offer').val() == 'valentino') ? new Date('2/15/2026') : _maxdate; 1615 //Spring 1616 _mindate = ($('#t_offer').val() == 'spring') ? new Date('4/15/2022') : _mindate; 1617 _maxdate = ($('#t_offer').val() == 'spring') ? new Date('4/25/2022') : _maxdate; 1618 //Easter 1619 _mindate = ($('#t_offer').val() == 'easter') ? new Date('4/4/2026') : _mindate; 1620 _maxdate = ($('#t_offer').val() == 'easter') ? new Date('4/5/2026') : _maxdate; 1621 1622 //Easter Family 1623 _mindate = ($('#t_offer').val() == 'easter for family') ? new Date('4/4/2026') : _mindate; 1624 _maxdate = ($('#t_offer').val() == 'easter for family') ? new Date('4/5/2026') : _maxdate; 1625 1626 //Relax/Romantic 1627 var enabledDays = ($('#t_offer').val() == 'rilassante') ? ["2024.4.24", "2024.4.25", "2024.4.29", "2024.4.30", "2024.5.1"] : []; 1628 var disabledSV = ( ($('#t_offer').val() == 'rilassante') || ($('#t_offer').val() == 'romantic') ) ? 1629 ["2026.2.13", "2026.2.14", "2026.2.15"] : []; 1630 var disabledSV = ($('#t_offer').val() == 'valentino') ? ["2024.2.12", "2024.2.13", "2024.2.15", "2024.2.16"] : disabledSV; 1631 var disabledDates = ['2020.8.15']; 1632 if ( ($('#t_offer').val() == 'apulian_taste') || ($('#t_offer').val() == 'summer_best') ) { 1633 var start_date = new Date('7/1/2023'); 1634 var current_date = new Date(); 1635 _mindate = (current_date.getTime() < start_date.getTime()) ? start_date : _mindate 1636 _maxdate = new Date('8/31/2023'); 1637 } 1638 if ($('#t_offer').val() == 'rilassante') { 1639 _mindate = tomorrow 1640 //_mindate = new Date('1/8/2024') 1641 var disabledSV = ['2026.2.13', '2026.2.14', '2026.2.15'] 1642 } 1643 1644 if ( ($('#t_offer_det').length > 0) && ( ($('#t_offer_det').val() == 'xmas_family') || ($('#t_offer_det').val() == 'xmas_relax') ) ) { 1645 var start_date = new Date('12/1/2025'); 1646 var current_date = new Date(); 1647 _mindate = (current_date.getTime() < start_date.getTime()) ? start_date : new Date('12/22/2025'); 1648 _maxdate = new Date('1/5/2026'); 1649 var disabledDates = ['2025.12.31'] 1650 } 1651 if ( ($('#t_offer').val() == 'winter_holiday') || ($('#t_offer_det').val() == 'xmas_family') || ($('#t_offer_det').val() == 'xmas_relax') ) { 1652 var disabledDays = []; 1653 var start_date = new Date('12/1/2025'); 1654 var current_date = new Date(); 1655 _mindate = (current_date.getTime() < start_date.getTime()) ? start_date : new Date('12/22/2025'); 1656 _maxdate = new Date('1/5/2026'); 1657 var disabledDates = ['2025.12.31'] 1658 } 1659 if ($('#t_offer_det').val() == 'family') { 1660 _mindate = tomorrow 1661 var disabledDates = ['2026.4.4', '2026.4.5'] 1662 } 1663 $('#o_arrival_date').datepicker({ 1664 language: loc.lang, 1665 minDate: _mindate, 1666 maxDate: _maxdate, 1667 autoClose: true, 1668 dateFormat: 'dd/mm/yyyy', 1669 beforeShowDay: function (date) { 1670 var dateStr = jQuery.datepicker.formatDate('yy-mm-dd', date); 1671 var _disabled = false 1672 _disabled = (disabledSV.indexOf(dateStr) == -1) ? true : _disabled 1673 _disabled = (enabledDays.indexOf(dateStr) != -1) ? false : _disabled 1674 return [_disabled]; 1675 }, 1676 onRenderCell: function (dt, cellType) { 1677 if ( $('#o_cal').length == 0) { 1678 if (cellType == 'day') { 1679 var disabled = false, 1680 formatted = getFormattedDate(dt), 1681 offer = $('#t_offer').val() 1682 1683 var day = dt.getDay() 1684 1685 //if (!offer.includes("valentino")) { 1686 disabled = disabledSV.filter(function(date){ 1687 return date == formatted; 1688 }).length 1689 //} 1690 1691 disabled = (disabledDays.indexOf(day) != -1) ? true : disabled 1692 disabled = (enabledDays.indexOf(formatted) != -1) ? false : disabled 1693 1694 return { 1695 disabled: disabled 1696 } 1697 } 1698 } 1699 if ( ($('#t_offer').val() == 'family_summer') || ($('#t_offer').val() == 'discover_bari') || ($('#t_offer').val() == 'luxury_package') ) { 1700 if (cellType == 'day') { 1701 var disabled = false, 1702 formatted = getFormattedDate(dt); 1703 1704 disabled = disabledDates.filter(function(date){ 1705 return date == formatted; 1706 }).length 1707 return { 1708 disabled: disabled 1709 } 1710 } 1711 } 1712 1713 if ( ($('#t_offer').val() == 'rilassante') && (relax_xmas === 0) ) { 1714 if (cellType == 'day') { 1715 var enabled = true, 1716 formatted = getFormattedDate(dt); 1717 1718 enabled = enabledDays.filter(function(date){ 1719 return date == formatted; 1720 }).length 1721 disabled = (enabled == true) ? false : true 1722 return { 1723 disabled: enabled 1724 } 1725 } 1726 if (cellType == 'day') { 1727 var disabled = false, 1728 formatted = getFormattedDate(dt); 1729 1730 disabled = disabledDates.filter(function(date){ 1731 return date == formatted; 1732 }).length 1733 return { 1734 disabled: disabled 1735 } 1736 } 1737 } 1738 1739 if ( ($('#t_offer_det').length > 0) && ($('#t_offer_det').val() == 'family') ) { 1740 if (cellType == 'day') { 1741 var disabled = false, 1742 formatted = getFormattedDate(dt); 1743 1744 disabled = disabledDates.filter(function(date){ 1745 return date == formatted; 1746 }).length 1747 return { 1748 disabled: disabled 1749 } 1750 } 1751 } 1752 1753 if ( ($('#t_offer_det').length > 0) && ( ($('#t_offer_det').val() == 'xmas_family') || ($('#t_offer_det').val() == 'xmas_relax') ) ) { 1754 if (cellType == 'day') { 1755 var disabled = false, 1756 formatted = getFormattedDate(dt); 1757 1758 disabled = disabledDates.filter(function(date){ 1759 return date == formatted; 1760 }).length 1761 return { 1762 disabled: disabled 1763 } 1764 } 1765 } 1766 1767 }, 1768 onSelect: function onSelect(fd, date) { 1769 if ($('#t_offer').val() != 'valentino') { /*$('#o_depart_date').attr("disabled",fal
1769se);/**/ } 1770 var day = date.getDay(); 1771 var maxdate = new Date(date); 1772 if (day == 4) { maxdate.setDate(maxdate.getDate() + 4); } //Thu 1773 if (day == 5) { maxdate.setDate(maxdate.getDate() + 3); } //Fri 1774 if (day == 6) { maxdate.setDate(maxdate.getDate() + 2); } //Sat 1775 if (day == 0) { maxdate.setDate(maxdate.getDate() + 1); } //Sun 1776 if ($('#o_cal').length > 0) { maxdate.setDate(maxdate.getDate() + 90); } 1777 if ($('#t_offer').val() == 'summer') { maxdate = new Date('09/30/2019'); } 1778 if ($('#t_offer').val() == 'hoinblack') { maxdate = new Date('12/30/2021'); } 1779 if ($('#t_offer').val() == 'easter') { maxdate = new Date('4/10/2023'); } 1780 if ($('#t_offer').val() == 'rilassante') { maxdate.setDate(maxdate.getDate() + 2); } 1781 if ( ($('#t_offer_det').length > 0) && ($('#t_offer_det').val() == 'xmas_family') ) { maxdate = new Date('1/5/2026') } 1782 if ( ($('#t_offer_det').length > 0) && ($('#t_offer_det').val() == 'xmas_relax') ) { maxdate = new Date('1/5/2026') } 1783 1784 if ($('#t_offer').val() == 'rilassante') { 1785 1786 //maxdate = new Date('1/8/2023'); 1787 $.post("assets/inc/get-supplemento-romantic.php", { 1788 arr: $('#o_arrival_date').val() 1789 }).done(function(data) { 1790 1791 /* 1792 if (data == 'OK') { 1793 $("#supplemento_romantic").slideDown() 1794 } else { 1795 $("#supplemento_romantic").slideUp() 1796 $("#delRomanticSup").trigger("click") 1797 } 1798 /**/ 1799 1800 }) 1801 1802 } 1803 date.setDate(date.getDate()); 1804 var mindate = new Date(date); 1805 if ( ($('#o_cal').length > 0) && ($('#o_cal').val() == '2') ) { mindate.setDate(date.getDate()+3); } else { mindate.setDate(date.getDate()+1); } 1806 if ($('#t_offer').val() == 'summer') { mindate.setDate(date.getDate()+1); } 1807 if ( ($('#t_offer').val() == 'apulian_taste') || ($('#t_offer').val() == 'summer_best') ) { 1808 //mindate = new Date('6/1/2022'); 1809 maxdate = new Date('8/31/2023'); 1810 } 1811 /* 1812 if ($('#t_offer').val() == 'valentino') { 1813 1814 if (date.getDate() == "10") $('#o_depart_date').val("11/02/2023") 1815 1816 } else 1817 /**/ 1818 1819 if ( ($('#t_offer').val() == 'family_summer') || ($('#t_offer').val() == 'luxury_package') ) { 1820 1821 //Family Summer / Luxury Package 1822 var nd = new Date(date); 1823 nd.setDate(date.getDate() + 4); 1824 var d = nd.toISOString().slice(0,10); //YYYY-MM-DD 1825 var dt = d.split("-"); 1826 var dat = dt[2]+"/"+dt[1]+"/"+dt[0]; 1827 $('#o_depart_date').val(dat); 1828 1829 } else if ($('#t_offer').val() == 'discover_bari') { 1830 1831 //Discover Bari 1832 var nd = new Date(date); 1833 nd.setDate(date.getDate() + 3); 1834 var d = nd.toISOString().slice(0,10); //YYYY-MM-DD 1835 var dt = d.split("-"); 1836 var dat = dt[2]+"/"+dt[1]+"/"+dt[0]; 1837 $('#o_depart_date').val(dat); 1838 1839 } else if ($('#t_offer').val() == 'stay_dinner') { 1840 1841 //Stay & Dinner 1842 $('#o_depart_date').datepicker({ 1843 language: loc.lang, 1844 minDate: mindate, 1845 maxDate: maxdate, 1846 autoClose: true, 1847 dateFormat: 'dd/mm/yyyy', 1848 onRenderCell: function (date, cellType) { 1849 if ($('#o_cal').length == 0) { 1850 if (cellType == 'day') { 1851 var day = date.getDay(), 1852 isDisabled = disabledDaysRet.indexOf(day) != -1; 1853 return { 1854 disabled: isDisabled 1855 } 1856 } 1857 } 1858 } 1859 }); 1860 var nd = new Date(date); 1861 nd.setDate(date.getDate() + 2); 1862 var d = nd.toISOString().slice(0,10); //YYYY-MM-DD 1863 var dt = d.split("-"); 1864 var dat = dt[2]+"/"+dt[1]+"/"+dt[0]; 1865 $('#o_depart_date').val(dat); 1866 1867 } else { 1868 1869 $('#o_depart_date').datepicker({ 1870 language: loc.lang, 1871 minDate: mindate, 1872 maxDate: maxdate, 1873 autoClose: true, 1874 dateFormat: 'dd/mm/yyyy', 1875 onRenderCell: function (date, cellType) { 1876 if ($('#o_cal').length == 0) { 1877 if (cellType == 'day') { 1878 var day = date.getDay(), 1879 formatted = getFormattedDate(date), 1880 isDisabled = disabledDaysRet.indexOf(day) != -1; 1881 isDisabled = (enabledDays.indexOf(formatted) != -1) ? false : isDisabled 1882 return { 1883 disabled: isDisabled 1884 } 1885 } 1886 } 1887 } 1888 }); 1889 var nd = new Date(date); 1890 if ( ($('#o_cal').length > 0) && ($('#o_cal').val() == '2') ) { 1891 if ($('#t_offer').val() == 'summer') { nd.setDate(date.getDate()+2); } else { nd.setDate(date.getDate()+4); } 1892 } else { 1893 nd.setDate(date.getDate()+2); 1894 } 1895 var d = nd.toISOString().slice(0,10); //YYYY-MM-DD 1896 var dt = d.split("-"); 1897 var dat = dt[2]+"/"+dt[1]+"/"+dt[0]; 1898 $('#o_depart_date').val(dat); 1899 1900 } 1901 } 1902 }); 1903 1904 } 1905 1906 function getFormattedDate(date) { 1907 var year = date.getFullYear(),
1908 month = date.getMonth() + 1, 1909 date = date.getDate(); 1910 1911 return year + '.' + month + '.' + date; 1912 } 1913 1914 function offerCheckPrice() { 1915 1916 var nights = $("#nights").val(); 1917 var p1 = $("#pprice").val(); 1918 var p2 = $("#addprice").val(); 1919 var mul = $("#o_multi").val(); 1920 1921 var total = (p1*mul*1) + (p2*mul*nights*1); 1922 1923 if (nights > 0) { $(".addnights").show(); } else { $(".addnights").hide(); } 1924 if ( ($('#luxury_stay').length > 0) && ($('#luxury_stay').is(':checked')) ) { 1925 $(".lstay").show(); total += 45; 1926 $("#lux_stay").val("1"); 1927 } else { 1928 $(".lstay").hide(); 1929 $("#lux_stay").val("0"); 1930 } 1931 if ( ($('#box_rose').length > 0) && ($('#box_rose').is(':checked')) ) { 1932 $(".boxrose").show(); total += 49; 1933 $("#_box_rose").val("1"); 1934 } else { 1935 $(".boxrose").hide(); 1936 $("#_box_rose").val("0"); 1937 } 1938 if ($('#t_offer').val() == 'family_summer') { 1939 1940 var rg = $('#kids_9-17').val()*1; 1941 $("#xrag").html(rg); 1942 $("#o_kids_9-17").val(rg); 1943 var kd = $('#kids_4-8').val()*1; 1944 $("#o_bambini012").val(kd); 1945 1946 } else if ( ($('#t_offer').val() == 'discover_bari') || ($('#t_offer').val() == 'luxury_package') ) { 1947 1948 var rg = $('#ragazzi1318').val()*1; 1949 $("#xrag").html(rg); 1950 $("#o_ragazzi1318").val(rg); 1951 var kd = $('#bambini012').val()*1; 1952 $("#xkids").html(kd); 1953 $("#o_bambini012").val(kd); 1954 1955 var total_ragazzi = ($("#addprice_ragazzi").val() * rg * 1); 1956 total += total_ragazzi; 1957 if (rg > 0) { $("#xrag_price").html("€ "+total_ragazzi+",00"); } 1958 if (kd > 0) { $("#xkids_price").html("Gratis/Free"); } 1959 1960 } else if ( ($('#t_offer').val() == 'stay_dinner') ) { 1961 1962 total = total*nights*1; 1963 1964 } else { 1965 if ( ($('#kids_9-17').length > 0) && ($('#kids_9-17').val() != '0') ) { 1966 var rg = $('#kids_9-17').val()*1; 1967 var rn = nights*1+1; 1968 $(".rstay").show(); 1969 $("#xrnights").html(rn); 1970 $("#xrag").html(rg); 1971 $("#o_kids_9-17").val(rg); 1972 total += (40 * rn * rg * 1); 1973 //alert(total+" - "+rn+" - "+rg) 1974 } else { 1975 $(".rstay").hide() 1976 } 1977 1978 if ( ($('#kids_0-3').length > 0) && ($('#kids_0-3').val() != '0') ) { 1979 var bm = $('#kids_0-3').val()*1; 1980 $("#o_kids_0-3").val(bm); 1981 } 1982 1983 if ( ($('#kids_4-8').length > 0) && ($('#kids_4-8').val() != '0') ) { 1984 1985 //var bm = $('#kids_4-8').val()*1; 1986 //$("#o_kids_4-8").val(bm); 1987 1988 var rg = $('#kids_4-8').val()*1; 1989 var rn = nights*1+1; 1990 $(".rkstay").show(); 1991 $("#krnights").html(rn); 1992 $("#krag").html(rg); 1993 $("#o_kids_4-8").val(rg); 1994 total += (20 * rn * rg * 1); 1995 1996 } else { 1997 $(".rkstay").hide() 1998 } 1999 } 2000 2001 total = total.toFixed(2); 2002 total = total.replace(".", ","); 2003 2004 if ($('#t_offer').val() != 'hoinblack') { 2005 $("#total").html('€ '+total); 2006 $("#totale").val(total); 2007 } 2008 2009 $('#book_offer').slideDown(); 2010 setTimeout(function() { 2011 $('#article').css("position","fixed"); 2012 $('#article').css("overflow","hidden"); 2013 }, 1000 ); 2014 } 2015 2016 $('#proceedWait').hide(); 2017 $('#btnConfirmWait').hide(); 2018 2019 //San valentino Dinner 2020 if ($("#sel_sv_giorno").length > 0) { 2021 2022 //Default 2023 $("#o_depart_date").val('14/02/2020'); 2024 $("#o_arrival_date").val('15/02/2020'); 2025 $("._arr").html("14<br>Feb"); 2026 $("._par").html("15<br>Feb"); 2027 2028 $("#sel_sv_giorno").on("change", function() { 2029 2030 if ($(this).val() == '14/02/2020') { 2031 2032 $("#o_depart_date").val('14/02/2020'); 2033 $("#o_arrival_date").val('15/02/2020'); 2034 $("._arr").html("14<br>Feb"); 2035 $("._par").html("15<br>Feb"); 2036 2037 } else { 2038 2039 $("#o_depart_date").val('15/02/2020'); 2040 $("#o_arrival_date").val('16/02/2020'); 2041 $("._arr").html("15<br>Feb"); 2042 $("._par").html("16<br>Feb"); 2043 2044 } 2045 2046 }); 2047 2048 } 2049 2050 $('#proceed').click(function(e) { 2051 2052 e.preventDefault(); 2053 2054 $('#proceed').hide(); 2055 $('#proceedWait').show(); 2056 2057 var arr = $("#o_arrival_date").val(); 2058 var par = $("#o_depart_date").val(); 2059 var adu = $("#o_adults").val(); 2060 var kid = ($("#kids_9-17").length > 0) ? $("#kids_9-17").val() : $("#o_kids").val(); 2061 var kid_4_8 = ($("#kids_4-8").length > 0) ? $("#kids_4-8").val() : 0; 2062 var kid_9_17 = ($("#kids_9-17").length > 0) ? $("#kids_9-17").val() : 0; 2063 var t_room = $("#t_room").val(); 2064 var get_price = $("#get_price").val(); 2065 2066 setTimeout(function() { 2067 2068 if ( (arr != '') && (par != '') ) { 2069 2070 $("#checkin").val(arr); 2071 $("#checkout").val(par); 2072 2073 if ($("#go_synexis").length > 0) { 2074 2075 var rate = $("#go_synexis").val() 2076 2077 //location.href = "https://be.synxis.com/?adult=2&arrive="+arr+"&chain=5375&child=0¤cy=EUR&depart="+par+"&hotel=61075&level=hotel&locale=it-IT&rooms=1" 2078 location.href = "https://be.synxis.com/?adult=2&arrive=2026-08-22&chain=5375&child=0¤cy=EUR&depart=2026-08-23&hotel=61075&level=hotel&locale=it-IT&productcurrency=EUR&rate="+rate+"&rooms=1" 2079 2080 } else { 2081 2082 var offer_ = $('#t_offer').val() 2083 2084 if ( 2085 offer_.includes('valentino') || offer_.includes('supplementi') || 2086 offer_.includes('spring') || ( offer_.includes('easter') && !offer_.includes('family') ) 2087 ) { //San Valentino/Supplementi/Wellness 2088 2089 var err_ = 0; 2090 var error_ = '' 2091
2092 if ($("#tipo_cliente").length > 0) { 2093 2094 if ($("#tipo_cliente").val() == '') { 2095 err_ = 1 2096 error_ = 'Seleziona se sei cliente interno o esterno' 2097 } 2098 2099 var npr = $("#num_prenotazione").val() 2100 if ( ($("#tipo_cliente").val() == 'si') && (npr.length < 5) ) { 2101 err_ = 1 2102 error_ = 'Inserisci un numero di prenotazione valido' 2103 } 2104 2105 } 2106 2107 if (err_ == 1) { 2108 2109 swal(error_); 2110 $('#proceed').show(); 2111 $('#proceedWait').hide(); 2112 2113 } else { 2114 2115 $.post("assets/inc/get-offer-days.php", { 2116 arr: arr, par: par 2117 }).done(function(data) { 2118 2119 var dt = data.split("|") 2120 $("._arr").html(dt[0]) 2121 $("._par").html(dt[1]) 2122 2123 var days = dt[2] 2124 var total = (offer_.includes('valentino')) ? $("#get_price").val()*1 : $("#get_price").val()*1*days; 2125 var extras = '' 2126 var _extras = '' 2127 2128 $(".cb_as").each(function() { 2129 if ($(this).is(':checked')) { //Checkbox 2130 2131 var val = ($(this).data("days") == '1') ? $(this).data("val")*days : $(this).data("val")*1 2132 var _val = val.toFixed(2) 2133 _val = _val.replace(".", ","); 2134 var txt = $(this).data("txt") 2135 total += val*1 2136 extras += '<div class="row xbrd"><div class="col-xs-7 col-sm-7"><h5>'+txt+'</h5></div><div class="col-xs-5 col-sm-5"><h5 class="bld">€ '+_val+'</h5></div></div>' 2137 _extras += txt+"|"+_val+";" 2138 2139 } 2140 if ($(this).val() != '0') { //Select 2141 2142 var v = $(this).val() 2143 var d = v.split("|") 2144 2145 var val = ($(this).data("days") == '1') ? d[1]*days : d[1]*1 2146 var _val = val.toFixed(2) 2147 _val = _val.replace(".", ","); 2148 if (_val != 'NaN') { 2149 var txt = d[0] 2150 total += val*1 2151 extras += '<div class="row xbrd"><div class="col-xs-7 col-sm-7"><h5>'+txt+'</h5></div><div class="col-xs-5 col-sm-5"><h5 class="bld">€ '+_val+'</h5></div></div>' 2152 _extras += txt+"|"+_val+";" 2153 } 2154 2155 } 2156 }) 2157 2158 var room_price = $("#room_price").data("price")*days 2159 room_price = room_price.toFixed(2) 2160 room_price = room_price.replace(".", ",") 2161 2162 total = total.toFixed(2) 2163 total = total.replace(".", ",") 2164 _total = total 2165 2166 if (total != '0,00') { 2167 2168 $("#room_price").html("€ "+room_price) 2169 $("#extras").html(extras) 2170 $("#_extras").val(_extras) 2171 $("#total").html('€ '+total); 2172 $(".total_").html('€ '+_total); 2173 $("#totale").val(total); 2174 $("#_nights").html(days) 2175 $('#book_offer').slideDown(); 2176 setTimeout(function() { 2177 $('#article').css("position","fixed"); 2178 $('#article').css("overflow","hidden"); 2179 }, 1000 ); 2180 /**/ 2181 2182 } else { 2183 2184 swal(loc.swal34); 2185 2186 } 2187 2188 }) 2189 2190 $('#proceed').show(); 2191 $('#proceedWait').hide(); 2192 2193 } //End Check Error 2194 2195 } else { 2196 2197 if ( ($('#o_cal').length > 0) && ($('#o_cal').val() == '2') ) { //Stay More Offer / Spring -10% 2198 2199 var t_sconto = $("#t_sconto").val(); 2200 var t_offer = ($("#t_offer").length > 0) ? $("#t_offer").val() : ''; 2201 2202 $.post("assets/inc/get-avail.php", { 2203 arr: arr, par: par, adult: adu, children: kid, room: t_room, offer: t_offer, sconto: t_sconto 2204 }).done(function(data) { 2205 2206 if (data != 'Closed') { 2207 2208 var dt = data.split("|"); 2209 $("._arr").html(dt[0]); 2210 $("._par").html(dt[1]); 2211 $("#xnights").html(dt[2]); 2212 $("#nights").val(dt[2]); 2213 $("#js_totale").val(dt[3]); 2214 2215 $(".addnights").hide(); 2216 $(".lstay").hide(); 2217 $(".rstay").hide(); 2218 2219 /**/ 2220 var total = dt[3]*1; 2221 var _total = dt[3]*1; 2222 2223 if ( ($('#luxury_stay').length > 0) && ($('#luxury_stay').is(':checked')) ) { 2224 $(".lstay").show(); total += 20; 2225 $("#lux_stay").val("1"); 2226 } else { 2227 $(".lstay").hide(); 2228 $("#lux_stay").val("0"); 2229 } 2230 2231 total = total.toFixed(2); 2232 total = total.replace(".", ","); 2233 _total = _total.toFixed(2); 2234 _total = _total.replace(".", ","); 2235 2236 var fprice = dt[4]*1; 2237 fprice = fprice.toFixed(2); 2238 fprice = fprice.replace(".", ","); 2239 2240 if (total != '0,00') { 2241 2242 $("#total").html('€ '+total); 2243 $(".total_").html('€ '+_total); 2244 $("#ftotal").html('€ '+fprice); 2245 $("#totale").val(total); 2246 $('#book_offer').slideDown(); 2247 setTimeout(function() { 2248 $('#article').css("position","fixed"); 2249 $('#article').css("overflow","hidden"); 2250 }, 1000 ); 2251 /**/ 2252 2253 } else { 2254 2255 swal(loc.swal34); 2256 2257 } 2258 2259 $('#proceed').show(); 2260 $('#proceedWait').hide(); 2261 2262 } else { 2263 2264 swal(loc.swal34); 2265 $('#proceed').show(); 2266 $('#proceedWait').hide(); 2267 2268 } 2269 2270 }); 2271 2272 } else { //All Other Offers 2273 2274 var t_offer = ($("#t_offer").length > 0) ? $("#t_offer").val() : ''; 2275 2276 var _err = 0;
2277 if ( ($('#t_offer').val() != 'family_summer') && ($('#t_offer').val() != 'discover_bari') && ($('#t_offer').val() != 'luxury_package') ) { 2278 if ( ($("#kids_9-17").length > 0) && ($("#kids_9-17").val() == 0) && ($("#kids_0-3").val() == 0) && ($("#kids_4-8").val() == 0) ) { 2279 2280 _err = 1; 2281 swal(loc.swal36); 2282 $('#proceed').show(); 2283 $('#proceedWait').hide(); 2284 2285 } 2286 } else { 2287 2288 if ( ($("#kids_9-17").val()*1 + $("#kids_4-8").val()*1 + $("#kids_0-3").val()*1) > 2) { 2289 2290 _err = 1; 2291 swal(loc.swal41); 2292 $('#proceed').show(); 2293 $('#proceedWait').hide(); 2294 2295 } 2296 2297 } 2298 2299 //Tot Ragazzi + Bambini max 2 2300 var tot_kids = ($("#kids_9-17").val()*1 + $("#kids_4-8").val()*1 + $("#kids_0-3").val()*1); 2301 if (tot_kids > 2) { 2302 2303 _err = 1; 2304 swal(loc.swal41); 2305 $('#proceed').show(); 2306 $('#proceedWait').hide(); 2307 2308 } 2309 2310 if (_err === 0) { 2311 2312 var lux = ( ($('#luxury_stay').length > 0) && ($('#luxury_stay').is(':checked')) ) ? 1 : 0; 2313 2314 $.post("assets/inc/get-avail-double.php", { 2315 arr: arr, par: par, adult: adu, children: kid, kid_4_8: kid_4_8, kid_9_17: kid_9_17, room: t_room, offer: t_offer, luxury: lux 2316 }).done(function(data) { 2317 2318 //alert(data); 2319 if (data != 'Closed') { 2320 2321 var dt = data.split("|"); 2322 $("._arr").html(dt[0]); 2323 $("._par").html(dt[1]); 2324 $("#xnights").html(dt[2]); 2325 $("#nights").val(dt[2]); 2326 2327 if ( (dt.length > 3) && (dt[3] != "") ) { 2328 2329 var _tt = dt[3] 2330 var _tot_ = (_tt.includes("€")) ? _tt : "€ "+_tt 2331 2332 var _totale_ = 0 2333 if (_tt.includes("€")) { 2334 //Mostra solo ultimo valore della stringa 2335 var _t = _tt.split("€ ") 2336 _totale_ = _t[2] 2337 } else { 2338 _totale_ = dt[3] 2339 } 2340 2341 setTimeout(function() { 2342 $("#total").html(_tot_); 2343 $("#offer_price").html(dt[3]); 2344 $("#totale").val(_totale_); 2345 if ( (dt.length > 4) && (dt[4] != "") ) { 2346 $(".family_day_price").html(dt[4]) 2347 } 2348 $('#proceed').show(); 2349 $('#proceedWait').hide(); 2350 }, 700 ); 2351 2352 } 2353 2354 if ( (dt.length > 5) && (dt[5] != "") ) { 2355 2356 $("#pprice").val(dt[5]) 2357 $("#addprice").val(dt[5]) 2358 2359 } 2360 2361 setTimeout(function() { 2362 2363 offerCheckPrice(); 2364 $('#proceed').show(); 2365 $('#proceedWait').hide(); 2366 2367 }, 500 ); 2368 2369 } else { 2370 2371 swal(loc.swal34); 2372 $('#proceed').show(); 2373 $('#proceedWait').hide(); 2374 2375 } 2376 2377 }); 2378 } 2379 } 2380 } 2381 } //Go Synexis 2382 2383 } else { 2384 2385 swal(loc.swal33); 2386 $('#proceed').show(); 2387 $('#proceedWait').hide(); 2388 2389 } 2390 2391 }, 500 ); 2392 2393 }); 2394 2395 $(".rm_lstay").click(function() { 2396 2397 $(".lstay").hide(); 2398 $('#luxury_stay').prop('checked','false'); 2399 $('#luxury_stay').iCheck('uncheck'); 2400 offerCheckPrice(); 2401 2402 }); 2403 2404 $(".rm_boxrose").click(function() { 2405 2406 $(".boxrose").hide(); 2407 $('#box_rose').prop('checked','false'); 2408 $('#box_rose').iCheck('uncheck'); 2409 offerCheckPrice(); 2410 2411 }); 2412 2413 $('.cls').click(function() { 2414 2415 $('#book_offer').slideUp(); 2416 $('#article').css("position","relative"); 2417 $('#article').css("overflow","auto"); 2418 $('html, body').animate({ 2419 scrollTop: $("#book_now").offset().top - 100 2420 }, 0); 2421 2422 }); 2423 2424 $("#btnConfirm").click(function(e) { 2425 2426 e.preventDefault(); 2427 var err = 0; 2428 2429 if (!$('#accept_privacy').prop('checked')) { err = 1; swal(loc.swal32); } 2430 if (ValidateEmail($("#mail").val()) == false) { err = 1; swal(loc.swal11); } 2431 if ($("#tel").val() == '') { err = 1; swal(loc.swal19); } 2432 if ($("#cognome").val() == '') { err = 1; swal(loc.swal29); } 2433 if ($("#nome").val() == '') { err = 1; swal(loc.swal30); } 2434 2435 if (err === 0) { 2436 2437 $('#btnConfirm').hide(); 2438 $('#btnConfirmWait').show(); 2439 2440 setTimeout(function() { 2441 document.book_offer.submit(); 2442 }, 600 ); 2443 } 2444 2445 }); 2446 2447 } 2448 2449 if ( ($("._goto").length > 0) ) { 2450 2451 $("._goto").on("click", function() { 2452 var target = $(this).attr("data-target"); 2453 $('html, body').animate({ scrollTop: $("#"+target).offset().top}, 500); 2454 }); 2455 2456 }
2457 if ($("#form_landing").length > 0) { 2458 2459 $(".title-book-btn").attr("href", "tel:00390805682036") //Banqueting 2460 $(".slk-arw").css("top", "93%") 2461 2462 } 2463 2464 /* jQuery Nice Select - */ 2465 !function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery); 2466 2467 if( /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) === false){ 2468 $('.switch_lang').niceSelect(); 2469 } 2470 2471 $(".switch_lang").change(function() { 2472 var vl = $(this).val(); 2473 window.location.href = vl; 2474 }); 2475 $(".switch_lang_mob").change(function() { 2476 var vl = $(this).val(); 2477 window.location.href = vl; 2478 }); 2479 2480 //Map 2481 $(document).on("click touchend","#map_local",function(){ initMap(15, 1, 41.1256548, 16.8696099); }); 2482 $(document).on("click touchend","#map_transport",function(){ initMap(13,2,41.115,16.8547788); }); 2483 $(document).on("click touchend","#map_bar",function(){ initMap(15,3,41.0990057,16.8547788); }); 2484 $(document).on("click touchend","#map_destinations",function(){ initMap(9,4); }); 2485 $(".maplinks span").on("click",function(){ $(".maplinks span").removeClass("selected"); $(this).addClass("selected"); }); 2486 2487 2488 //Cookies 2489 if ($("#cookietxt").length > 0) { $("#cookietxt").html(loc.cookietxt); } 2490 2491 //Community Footer 2492 if ($("#community_txt").length > 0) { $("#community_txt").html(loc.communitytxt); } 2493 2494 //Accept Cookies 2495 $("#accept_cookies").click(function(e) { 2496 2497 e.preventDefault(); 2498 $("#cookies").hide(); 2499 2500 document.cookie = "cookie_consent=1;365;path=/"; 2501 2502 }); 2503 2504 /* 2505 //Instagram 2506 setTimeout(function() { 2507 2508 $.post("assets/inc/get-instagram.php", { 2509 pics: 8 2510 }).done(function(data) { 2511 2512 $("#instagram_posts").html(data); 2513 2514 }); 2515 2516 }, 2000 ); 2517 /**/ 2518 2519 //Unveil 2520 if ($(".unveil").length > 0) { $(".unveil").unveil(100); } 2521 2522 //GDS Codes 2523 $("#gdscodes").html('<span class="brwn">GDS Codes</span><div class="row"><div class="col-xs-4 col-md-3"><span class="brwn">GDS/IDS</span><br>Amadeus(1A)<br>Sabre(AA)<br>
2523Galileo/Apollo(UA)<br>WorldSpan(1P)<br>PegsADS(WB)</div><div class="col-xs-4 col-md-3"><span class="brwn">Chain Code</span><br>YX<br>YX<br>YX<br>YX<br>GL</div><div class="col-xs-4 col-md-3"><span class="brwn">Property Code</span><br>BRINIH<br>218021<br>A4124<br>BRINIH<br>61075</div></div>'); 2524 2525}); 2526 2527/**/ 2528// Gmap 2529//------------------------------------------------------------------------------- 2530 2531 var map; 2532 function initMap(zoom = 13,mid = 2,lat = 41.115, lng = 16.8547788) { 2533 2534 map = new google.maps.Map(document.getElementById('map'), { 2535 zoom: zoom, 2536 center: new google.maps.LatLng(lat,lng), 2537 mapTypeId: 'roadmap', 2538 scrollwheel: false, 2539 styles: [{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#dde6e8"},{"visibility":"on"}]}], 2540 2541 }); 2542 2543 var iconBase = 'img/map/'; 2544 var icons = { info: { icon: iconBase + 'marker.png' }, nicolaus: { icon: iconBase + 'marker-nicolaus.png' } }; 2545 2546 if (mid == 1) { 2547 var features = [ 2548 { position: new google.maps.LatLng(41.0990057,16.8547788), icn: iconBase + 'marker-nicolaus.png', 2549 custom: loc.map01 }, 2550 { position: new google.maps.LatLng(41.126921,16.87187229999995), icn: iconBase + 'marker01.png', 2551 custom: loc.map02 }, 2552 { position: new google.maps.LatLng(41.1226974,16.8696099), icn: iconBase + 'marker02.png', 2553 custom: loc.map03 }, 2554 { position: new google.maps.LatLng(41.12356399999999,16.87313599999993), icn: iconBase + 'marker03.png', 2555 custom: loc.map04 }, 2556 { position: new google.maps.LatLng(41.1256548,16.874498600000038), icn: iconBase + 'marker04.png', 2557 custom: loc.map05 }, 2558 { position: new google.maps.LatLng(41.1285181,16.869050199999947), icn: iconBase + 'marker05.png', 2559 custom: loc.map06 }, 2560 { position: new google.maps.LatLng(41.1303135,16.870137399999976), icn: iconBase + 'marker06.png', 2561 custom: loc.map07 }, 2562 { position: new google.maps.LatLng(41.1284961,16.86660470000004), icn: iconBase + 'marker07.png', 2563 custom: loc.map08 } 2564 ]; 2565 } else if (mid == 2) { 2566 var features = [ 2567 { position: new google.maps.LatLng(41.0990057,16.8547788), icn: iconBase + 'marker-nicolaus.png', 2568 custom: loc.map01 }, 2569 { position: new google.maps.LatLng(41.137508,16.765202), icn: iconBase + 'airport.png', 2570 custom: loc.map09 }, 2571 { position: new google.maps.LatLng(41.117974,16.870113), icn: iconBase + 'treno.png', 2572 custom: loc.map10 }, 2573 { position: new google.maps.LatLng(41.132719,16.86683), icn: iconBase + 'nave.png', 2574 custom: loc.map11 }, 2575 { position: new google.maps.LatLng(41.090235,16.78541), icn: iconBase + 'autostrada.png', 2576 custom: loc.map12 }, 2577 { position: new google.maps.LatLng(41.094361,16.854558), icn: iconBase + 'bus.png', 2578 custom: loc.map13 }, 2579 { position: new google.maps.LatLng(41.088,16.854558), icn: iconBase + 'tangenziale.png', 2580 custom: loc.map14 } 2581 ]; 2582 } else if (mid == 3) { 2583 var features = [ 2584 { position: new google.maps.LatLng(41.0990057,16.8547788), icn: iconBase + 'marker-nicolaus.png', 2585 custom: loc.map01 }, 2586 { position: new google.maps.LatLng(41.106499,16.852628), icn: iconBase + 'marker01.png', 2587 custom: '1|Sensi - Food and Wine|sensi-food-wine.jpg|' }, 2588 { position: new google.maps.LatLng(41.106556,16.853108), icn: iconBase + 'marker02.png', 2589 custom: '1|Giotto - Pizzeria e Ristorante|giotto-pizzeria-ristorante.jpg|' }, 2590 { position: new google.maps.LatLng(41.096914,16.853778), icn: iconBase + 'marker03.png', 2591 custom: '1|Da Luigi â Piazzeria, Braceria, Antipasteria|da-luigi.jpg|' }, 2592 { position: new google.maps.LatLng(41.098238,16.850937), icn: iconBase + 'marker04.png', 2593 custom: '1|Tatami â Fusion Restaurant|tatami-fusion-restaurant.jpg|' }, 2594 { position: new google.maps.LatLng(41.098367,16.850971), icn: iconBase + 'marker05.png', 2595 custom: '1|Hagakure â Fusion Restaurant & Sushi Bar|hagakure-fusion-restaurant.jpg|' }, 2596 { position: new google.maps.LatLng(41.098860,16.855867), icn: iconBase + 'marker06.png', 2597 custom: '1|Le grand Tabou â Vin et cuisine|le-grand-tabou.jpg|' }, 2598 { position: new google.maps.LatLng(41.098804,16.855251), icn: iconBase + 'marker07.png', 2599 custom: '1|Blast|blast.jpg|' }, 2600 { position: new google.maps.LatLng(41.106070,16.853308), icn: iconBase + 'marker08.png', 2601 custom: '1|Mood â Food & coffee|mood-food-coffee.jpg|' }, 2602 { position: new google.maps.LatLng(41.097925,16.851225), icn: iconBase + 'marker09.png', 2603 custom: '1|Pane olio e sale|pane-olio-sale.jpg|' }, 2604 { position: new google.maps.LatLng(41.098847,16.852598), icn: iconBase + 'marker10.png', 2605 custom: '1|Gulp â Norcineria, Vineria, Birreria|gulp.jpg|' }, 2606 ]; 2607 } else if (mid == 4) { 2608 var features = [ 2609 { position: new google.maps.LatLng(41.0990057,16.8547788), icn: iconBase + 'marker-nicolaus.png', 2610 custom: loc.map01 }, 2611 { position: new google.maps.LatLng(40.7864131,17.240936000000033), icn: iconBase + 'marker01.png', 2612 custom: loc.map15 }, 2613 { position: new google.maps.LatLng(41.0847777,16.270648400000027), icn: iconBase + 'marker02.png', 2614 custom: loc.map16 }, 2615 { position: new google.maps.LatLng(41.2774857,16.417833400000063), icn: iconBase + 'marker03.png', 2616 custom: loc.map17 }, 2617 { position: new google.maps.LatLng(40.9948996,17.222538900000018), icn: iconBase + 'marker04.png', 2618 custom: loc.map18 }, 2619 { position: new google.maps.LatLng(40.8792212,17.163222399999995), icn: iconBase + 'marker05.png', 2620 custom: loc.map19 }, 2621 { position: new google.maps.LatLng(40.666379,16.604319900000064), icn: iconBase + 'marker06.png', 2622 custom: loc.map20 } 2623 ]; 2624 } 2625 2626 // Create markers.
2627 features.forEach(function(feature) { 2628 2629 var sp = feature.custom; 2630 var fs = sp.split("|"); 2631 var desc = (fs[3] != '') ? fs[3] : ''; 2632 2633 if (fs[2] != '') { 2634 var content = '<div id="iw-container">' + 2635 '<div id="iw-close" class="close_iw"><img src="assets/img/close.jpg" width="14"></div>' + 2636 '<div class="iw-title">'+ 2637 '<img src="img/map/'+fs[2]+'" alt="" width="100%"></div>' + 2638 '<div class="iw-content">' + 2639 '<div class="iw-subTitle">'+fs[1]+'</div>' + 2640 '<p>'+desc+'</p>' + 2641 '</div>' + 2642 '<div class="iw-bottom-gradient"></div>' + 2643 '</div>'; 2644 } else { 2645 var content = '<div id="iw-container">' + 2646 '<div id="iw-close" class="close_iw"><img src="assets/img/close.jpg" width="14"></div>' + 2647 '<div class="iw-content">' + 2648 '<div class="iw-subTitle">'+fs[1]+'</div>' + 2649 '<p>'+desc+'</p>' + 2650 '</div>' + 2651 '<div class="iw-bottom-gradient"></div>' + 2652 '</div>'; 2653 } 2654 2655 var infowindow = new google.maps.InfoWindow({ 2656 content: content, maxWidth: 350 2657 }); 2658 var marker = new google.maps.Marker({ 2659 position: feature.position, 2660 icon: feature.icn, 2661 map: map 2662 }); 2663 marker.addListener('click', function(event) { 2664 $(".close_iw").trigger("click"); 2665 infowindow.open(map, marker); 2666 }); 2667 2668 infowindow.addListener('domready', function() { 2669 2670 var iwOuter = $('.gm-style-iw'); 2671 var iwBackground = iwOuter.prev(); 2672 2673 iwBackground.children(':nth-child(2)').css({'display' : 'none'}); 2674 iwBackground.children(':nth-child(4)').css({'display' : 'none'}); 2675 iwOuter.parent().parent().css({left: '0'}); 2676 iwBackground.children(':nth-child(1)').attr('style', function(i,s){ return s + 'left: 36px !important;'}); 2677 iwBackground.children(':nth-child(3)').attr('style', function(i,s){ return s + 'left: 36px !important;'}); 2678 iwBackground.children(':nth-child(3)').find('div').children().css({'background': '#fff', 'box-shadow': 'none', 'z-index' : '1'}); 2679 2680 var iwCloseBtn = iwOuter.next(); 2681 //iwCloseBtn.css({opacity: '1', right: '5px', top: '20px', border: '3px solid #fff', background: '#fff url(assets/img/close.jpg) no-repeat', padding: '20px'}); 2682 iwCloseBtn.css({opacity: '0'}); 2683 2684 if($('.iw-content').height() < 140){ 2685 $('.iw-bottom-gradient').css({display: 'none'}); 2686 } 2687 2688 iwCloseBtn.mouseout(function(){ $(this).css({opacity: '0'}); }); 2689 2690 var closeBtn = $('.close_iw').get(); 2691 2692 google.maps.event.addDomListener(closeBtn[0], 'click', function() { 2693 infowindow.close(); 2694 }); 2695 }); 2696 2697 map.addListener("click", function(event) { 2698 infowindow.close(); 2699 }); 2700 2701 }); 2702 } 2703 2704 var mp; 2705 function initMapDintorni(zoom = 9, lat = 41.115, lng = 16.8547788) { 2706 2707 mp = new google.maps.Map(document.getElementById('map_dintorni'), { 2708 zoom: zoom, 2709 center: new google.maps.LatLng(lat,lng), 2710 mapTypeId: 'roadmap', 2711 scrollwheel: false, 2712 styles: [{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#dde6e8"},{"visibility":"on"}]}], 2713 2714 }); 2715 2716 var iconBase = 'img/map/'; 2717 var icons = { info: { icon: iconBase + 'marker.png' }, nicolaus: { icon: iconBase + 'marker-nicolaus.png' } }; 2718 2719 var features = [ 2720 { position: new google.maps.LatLng(41.0990057,16.8547788), icn: iconBase + 'marker-nicolaus.png', 2721 custom: '1|The Nicolaus Hotel Bari|the-nicolaus-hotel.jpg|' }, 2722 { position: new google.maps.LatLng(40.7864131,17.240936000000033), icn: iconBase + 'marker01.png', 2723 custom: loc.map15 }, 2724 { position: new google.maps.LatLng(41.0847777,16.270648400000027), icn: iconBase + 'marker02.png', 2725 custom: loc.map16 }, 2726 { position: new google.maps.LatLng(41.2774857,16.417833400000063), icn: iconBase + 'marker03.png', 2727 custom: loc.map17 }, 2728 { position: new google.maps.LatLng(40.9948996,17.222538900000018), icn: iconBase + 'marker04.png', 2729 custom: loc.map18 }, 2730 { position: new google.maps.LatLng(40.8792212,17.163222399999995), icn: iconBase + 'marker05.png', 2731 custom: loc.map19 }, 2732 { position: new google.maps.LatLng(40.666379,16.604319900000064), icn: iconBase + 'marker06.png', 2733 custom: loc.map20 } 2734 2735 ]; 2736 2737 // Create markers.
2738 features.forEach(function(feature) { 2739 2740 var sp = feature.custom; 2741 var fs = sp.split("|"); 2742 var desc = (fs[3] != '') ? fs[3] : ''; 2743 2744 if (fs[2] != '') { 2745 var content = '<div id="iw-container">' + 2746 '<div id="iw-close" class="close_iw"><img src="assets/img/close.jpg" width="14"></div>' + 2747 '<div class="iw-title">'+ 2748 '<img src="img/map/'+fs[2]+'" alt="" width="100%"></div>' + 2749 '<div class="iw-content">' + 2750 '<div class="iw-subTitle">'+fs[1]+'</div>' + 2751 '<p>'+desc+'</p>' + 2752 '</div>' + 2753 '<div class="iw-bottom-gradient"></div>' + 2754 '</div>'; 2755 } else { 2756 var content = '<div id="iw-container">' + 2757 '<div id="iw-close" class="close_iw"><img src="assets/img/close.jpg" width="14"></div>' + 2758 '<div class="iw-content">' + 2759 '<div class="iw-subTitle">'+fs[1]+'</div>' + 2760 '<p>'+desc+'</p>' + 2761 '</div>' + 2762 '<div class="iw-bottom-gradient"></div>' + 2763 '</div>'; 2764 } 2765 2766 var infowindow = new google.maps.InfoWindow({ 2767 content: content, maxWidth: 350 2768 }); 2769 var marker = new google.maps.Marker({ 2770 position: feature.position, 2771 icon: feature.icn, 2772 map: mp 2773 }); 2774 marker.addListener('click', function(event) { 2775 $(".close_iw").trigger("click"); 2776 infowindow.open(map, marker); 2777 }); 2778 2779 infowindow.addListener('domready', function() { 2780 2781 var iwOuter = $('.gm-style-iw'); 2782 var iwBackground = iwOuter.prev(); 2783 2784 iwBackground.children(':nth-child(2)').css({'display' : 'none'}); 2785 iwBackground.children(':nth-child(4)').css({'display' : 'none'}); 2786 iwOuter.parent().parent().css({left: '0'}); 2787 iwBackground.children(':nth-child(1)').attr('style', function(i,s){ return s + 'left: 76px !important;'}); 2788 iwBackground.children(':nth-child(3)').attr('style', function(i,s){ return s + 'left: 76px !important;'}); 2789 iwBackground.children(':nth-child(3)').find('div').children().css({'background': '#fff', 'box-shadow': 'none', 'z-index' : '1'}); 2790 2791 var iwCloseBtn = iwOuter.next(); 2792 //iwCloseBtn.css({opacity: '1', right: '5px', top: '20px', border: '3px solid #fff', background: '#fff url(assets/img/close.jpg) no-repeat', padding: '20px'}); 2793 iwCloseBtn.css({opacity: '0'}); 2794 2795 if($('.iw-content').height() < 140){ 2796 $('.iw-bottom-gradient').css({display: 'none'}); 2797 } 2798 2799 iwCloseBtn.mouseout(function(){ $(this).css({opacity: '0'}); }); 2800 2801 var closeBtn = $('.close_iw').get(); 2802 2803 google.maps.event.addDomListener(closeBtn[0], 'click', function() { 2804 infowindow.close(); 2805 }); 2806 }); 2807 2808 mp.addListener("click", function(event) { 2809 infowindow.close(); 2810 }); 2811 2812 }); 2813 } 2814 2815//Email validation 2816function ValidateEmail(email) { 2817 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)) { 2818 return (true) 2819 } else { 2820 return (false) 2821 } 2822} 2823 2824//AutoLoad Scripts 2825function loadScript(scrpt) { 2826 var list = document.getElementsByTagName('script'); 2827 var i = list.length, flag = false; 2828 while (i--) { 2829 if (list[i].src === scrpt) { 2830 flag = true; 2831 break; 2832 } 2833 } 2834 2835 if (!flag) { 2836 var tag = document.createElement('script'); 2837 tag.src = scrpt; 2838 document.getElementsByTagName('body')[0].appendChild(tag); 2839 } 2840} 2841 2842loadScript("//unpkg.com/sweetalert/dist/sweetalert.min.js");
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.