1/* Overwritable functions 2-------------------------------------*/ 3 4function formDataUpload(form, formName, post_id, callback){ 5 if (form.find('input[type=file]').length > 0) { 6 var formData = new FormData(form[0]); 7 formData.append('action', 'hotel_form'); 8 formData.append('form', formName); 9 formData.append('lang', _lang); 10 if (post_id && post_id !== '0') { 11 formData.append('source_post_id', post_id); 12 } 13 $.ajax({ 14 type: "POST", 15 url: ajax_url, 16 data: formData, 17 //use contentType, processData for sure. 18 contentType: false, 19 processData: false, 20 success: function (response) { 21 callback(response); 22 }, 23 error: function() { 24 alert('error, please try again') 25 } 26 }); 27 } 28} 29function formResponseContainsSuccess(response) { 30 try { 31 var dummy =$('<div/>'); 32 dummy.append(response); 33 if (dummy.find('.mail_sent').length > 0) { 34 return true; 35 } 36 } catch (e) { 37 /*Just tracking, no problem*/ 38 } 39 return false; 40} 41 42var __offer_book_now_clicked = false; 43var __offer_book_now_calendar_open = false; 44if ( typeof sft_add_break === 'undefined' ) { 45 function sft_add_break( elmts ) { 46 $( elmts ).each(function() { 47 var _pond = $(this).text().split(' '); 48 if(_pond.length > 1) { 49 if(_pond.length > 2) { 50 $(this).addClass('multiline'); 51 var _mid = 1; 52 if(typeof(_hotel_name) !== 'undefined') { _mid = _hotel_name; } 53 if(typeof(_pond[_mid]) !== 'undefined') { _pond[_mid] += '<br>'; } 54 $(this).html(_pond.join(' ')); 55 } else { 56 $(this).addClass('singleline'); 57 } 58 } 59 }); 60 } 61} 62 63// if ( typeof sft_double_char === 'undefined' ) { 64// function sft_double_char( elmts ) { 65// $(elmts).each(function() { 66// var _p = $(this).text().length; 67// var _table = $(this).text().split(''); 68// var _l = parseInt(_p / 2, 10) - 1;
69// var array = ['a', 'b', 'd', 'e', 'o', 'p', 'q', 'r', 'u', 'y']; 70// if (typeof _table[_l] === 'undefined') { 71// return; 72// } 73// 74// if( array.indexOf( _table[_l].toLowerCase() ) > -1 ) { 75// _table[_l] = '<span class="double double-'+_table[_l].toLowerCase()+'">'+_table[_l] +'</span>'; 76// } else { 77// for(var _i = 0; _i <= _l; _i++) { 78// if(array.indexOf(_table[_l-_i].toLowerCase()) > -1) { 79// _table[_l-_i] = '<span class="double double-'+_table[_l-_i].toLowerCase()+'">'+_table[_l-_i] +'</span>'; 80// break; 81// } else if(array.indexOf(_table[_l+_i].toLowerCase()) > -1) { 82// _table[_l+_i] = '<span class="double double-'+_table[_l+_i].toLowerCase()+'">'+_table[_l+_i] +'</span>'; 83// break; 84// } 85// } 86// } 87// 88// _table = _table.join(''); 89// $(this).html(_table); 90// }); 91// } 92// } 93 94if ( typeof sft_copy_title_to_ext_menu === 'undefined' ) { 95 function sft_copy_title_to_ext_menu() { 96 $('.small_logo > span').clone().appendTo('#extended_menu'); 97 } 98} 99 100/**************/ 101 102if(document.getElementById('hp_video') !== undefined) { 103 var script = document.createElement("script"); 104 script.type = "text/javascript"; 105 script.onload = function() { }; 106 document.getElementsByTagName("head")[0].appendChild(script); 107 script.src = 'https://www.youtube.com/iframe_api'; 108 109 var player, player_h, slideshow_orig_h; 110 function onYouTubePlayerAPIReady() { 111 player = new YT.Player('hp_video', { 112 videoId: jQuery('#hp_video').attr('data-videoid'), 113 playerVars: { 114 controls: 0, 115 cc_load_policy: 0, 116 enablejsapi: 1, 117 fs: 0, 118 modestbranding: 1, 119 rel: 0, 120 showinfo: 0, 121 iv_load_policy: 3, 122 }, 123 events: { 124 'onReady': onPlayerReady, 125 'onStateChange': onPlayerStateChange 126 } 127 }); 128 } 129 130 function onPlayerReady(event) { 131 player.seekTo((typeof(_video_start) !== 'undefined' ? _video_start : 0)); 132 player.pauseVideo(); 133 if(typeof(_video_start) !== 'undefined') { player.setVolume(0); } 134 slideshow_orig_h = $('#main_slideshow').innerHeight(); 135 player_h = $('#video-container').outerHeight(true); 136 } 137 138 function stopVideo() { 139 $('body').removeClass('playing-video'); 140 $('#booking, .mute_video, .stop_video').removeAttr('style'); 141 $('#booking, .main_slideshow').css('opacity',1); 142 $('#main_slideshow').height(slideshow_orig_h); 143 $('.mute_video').removeClass('mute'); 144 player.seekTo((typeof(_video_start) !== 'undefined' ? _video_start : 0)); 145 player.pauseVideo(); 146 player.setVolume(0); 147 } 148 149 function onPlayerStateChange(event) { 150 if(event.data === 1) { 151 if(typeof(_video_start) !== 'undefined') { 152 var i = 0; 153 riseVolume = setInterval( function() { 154 i++; 155 player.setVolume(i); 156 if(i >= 100) {clearInterval(riseVolume);} 157 }, 100); 158 } 159 if(typeof(_video_end) !== 'undefined') { 160 var checkTime = setInterval( function() { 161 if(player.getCurrentTime() >= (_video_end - 12)) { 162 clearInterval(checkTime); 163 var i = 100; 164 if(!$('.mute_video').hasClass('muted')) { 165 var lowVolume = setInterval( function() { 166 i--; 167 player.setVolume(i); 168 if(i <= 0) { 169 clearInterval(lowVolume); 170 setTimeout(function() { stopVideo(); }, 1800); 171 } 172 }, 100); 173 } else { 174 setTimeout(function() { stopVideo(); }, 11800); 175 } 176 } 177 }, 1000); 178 } 179 } else if(event.data === 0) { stopVideo(); } 180 } 181 182} 183 184/* Functions for Greyscale Thumbnails 185-------------------------------------*/ 186 187// PDF thumbnails sizes 188var _mw = 270, _mh = 350; 189// Webkit 190var isWebkit = 'WebkitAppearance' in document.documentElement.style; 191// Safari 6 192var isSafari_6 = !!navigator.userAgent.match(/safari/i) && !navigator.userAgent.match(/chrome/i) && typeof document.body.style.webkitFilter !== "undefined"; 193// Chrome * 194var isChromium = !!window.chrome; 195 196function CrossBrowserThumb(_self) { 197 198 var _span = ''; 199 // IE < 9 200 if($.browser.msie == true && parseInt($.browser.version) < 9) { 201 return; 202 // IE 10+ 203 } else if(($.browser.msie == true && parseInt($.browser.version) > 9) || !!navigator.userAgent.match(/Trident\/7\./)) { 204 _span = '<svg xmlns="http://www.w3.org/2000/svg" id="svgroot" viewBox="0 0 '+_mw+' '+_mh+'" width="'+_mw+'" height="'+_mh+'">'+ 205 '<defs>'+ 206 '<filter id="filtersPicture">'+ 207 '<feComposite result="inputTo_38" in="SourceGraphic" in2="SourceGraphic" operator="arithmetic" k1="0" k2="1" k3="0" k4="0" />'+ 208 '<feColorMatrix id="filter_38" type="saturate" values="0" data-filterid="38" />'+ 209 '</filter>'+ 210 '</defs>'+
211 '<image filter="url("#filtersPicture")" x="0" y="0" width="'+_mw+'" height="'+_mh+'" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="'+ _self.attr('data-image') +'" />'+ 212 '</svg>'; 213 _self.find('.cover').append( $(_span) ); 214 } 215 // Safari < 6, Opera 216 else if((isWebkit == true && isSafari_6 == false && isChromium == false) || ($.browser.opera == true)) { 217 var _i = Math.round(Math.random()*100000) + 1; 218 _span = $('<canvas/>',{'id':'menu-canvas-'+_i}).attr('width', _mw).attr('height', _mh).width(_mw).height(_mh); 219 _self.find('.cover').append( $(_span) ); 220 var imageObj = new Image(); 221 imageObj.onload = function() { 222 drawImage(this, 'menu-canvas-'+_i); 223 }; 224 imageObj.src = _self.attr('data-image'); 225 } 226 // Others browsers (Firefox, Chrome, ...) 227 else { 228 _span = '<img class="grayscale" src="'+ _self.attr('data-image') +'" width="'+_mw+'" height="'+_mh+'">'; 229 _self.find('.cover').append( $(_span) ); 230 } 231} 232 233function drawImage(imageObj, canvas) { 234 var canvas = document.getElementById(canvas); 235 var context = canvas.getContext('2d'); 236 var x = 0; 237 var y = 0; 238 239 if(imageObj.width > _mw) { 240 context.drawImage(imageObj,0,0,imageObj.width,imageObj.height,0,0,_mw,_mh); 241 } else { 242 context.drawImage(imageObj, x, y); 243 } 244 245 var imageData = context.getImageData(x, y, imageObj.width, imageObj.height); 246 var data = imageData.data; 247 248 for(var i = 0; i < data.length; i += 4) { 249 var brightness = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]; 250 // red 251 data[i] = brightness; 252 // green 253 data[i + 1] = brightness; 254 // blue 255 data[i + 2] = brightness; 256 } 257 258 // overwrite original image 259 context.putImageData(imageData, x, y); 260} 261 262/*-------------------------------------*/ 263 264// Because of the use of the defer mode, we need to be sure all CSS are parsed before 265var _jquery_webfont_inte = setInterval(function() { 266 if(typeof(WebFont) !== "undefined") { 267 clearInterval(_jquery_webfont_inte); 268 WebFont.load({ 269 custom: { 270 families: ['GT America LV'] 271 }, 272 fontactive: function(familyName, fvd) { 273 274 var scrollbarWidth; 275 276 jQuery(document).ready(function($){ 277 // DOCUMENT READY IS HERE!!!!!!!!!!!!!!!!!! 278 if ($(window).width() < 800 && $('#video-container').length) { 279 $('.slideshow_title').removeClass('slideshow_title'); 280 } 281 282 if($(window).width() <= 1320) { menuRender(true); } else { menuRender(false); } 283 284 // double characters 285 // sft_double_char( '.home .section h3:not(.nodoubleletters), .section h2:not(.nodoubleletters)[class!="news-title"], .doubleletters' ); 286 287 // add breaks 288 sft_add_break( '.small_logo > span, #hotel-name h1' ); 289 290 291 if($('body').hasClass('home')) { $('#hotel-name').appendTo('#main_slideshow'); } 292 293 // Seobar 294 $('#seobar').insertBefore('#copyright').show(); 295 296 // Combobox 297 $('.choose_offers select, #form_gender, #brand_news_language, #news_language').each(function(n) { 298 var _self = $(this); 299 var _id = 'select-box-'+ n; 300 var _ctx = $('<div class="select-box" id="'+ _id +'"></div>'); 301 var _ul = $('<ul></ul>'); 302 var _span = $('<span></span>'); 303 _self.wrap(_ctx); 304 _ul.appendTo('#'+ _id); 305 _ul.css('width', _self.innerWidth()+20); 306 $('#'+ _id).css('width', _self.innerWidth()+20); 307 _self.hide(); 308 _span.appendTo('#'+ _id).text(_self.find('option:first-child').text()); 309 if( _self.data().type !== 'undefined' ) { _ul.attr('data-type', _self.data().type); } 310 _self.find('option').each(function() { 311 var _li = $('<li></li>'); 312 if( $(this).attr('data-'+ _self.data().type) !== 'undefined' ) { _li.attr('data-'+_self.data().type, $(this).attr('data-'+_self.data().type)); } 313 _li.text($(this).text()); 314 _li.appendTo(_ul); 315 _li.on('click', function() { _span.text($(this).text()); _ul.stop(true, true).slideToggle(); _self.find('option').prop('selected', false); _self.find('option[data-'+_self.data().type+'="'+$(this).attr('data-'+_self.data().type)+'"]').prop('selected', true); _self.trigger('change'); }); 316 });
317 _span.on('click', function() { $('#'+_id).toggleClass('opened'); _ul.stop(true, true).slideToggle(); }); 318 }); 319 320 // Extended menu 321 sft_copy_title_to_ext_menu(); 322 $('#extended_menu').insertAfter('#header'); 323 $('nav li.hamburger a').on('tap', function() { 324 if($('#extended_menu').hasClass('open')) { 325 $('#extended_menu').removeClass('open'); 326 $('div.book_overlay').fadeOut(250, function() { 327 $('html, body').css('overflow', 'auto'); 328 $('.w-resp, .main_slideshow').each(function() { 329 $(this).resizeCenter(); 330 }); 331 }); 332 } else { 333 $('div.book_overlay').fadeIn(250, function() { 334 $('html, body').css('overflow', 'hidden'); $('#extended_menu').addClass('open'); 335 $('.w-resp, .main_slideshow').each(function() { 336 $(this).resizeCenter(); 337 }); 338 }); 339 } 340 }); 341 $('#extended_menu span.book_close').on('tap', function() { $('nav li.hamburger a').trigger('tap'); }); 342 343 // Book button for rooms 344 $('.roomtype li a.book, #bookthisroom > a, div.book a.book_room').accorBookNowLink(); 345 346 // Booking form 347 if($('body').hasClass('home')) { 348 //HOMEPAGE 349 $('#booking').insertAfter($('#main_slideshow')); 350 var dateFormat = 'dd MM yy'; 351 if($('html').hasClass('lang_ko')){ 352 dateFormat = 'yyë MM ddì¼'; 353 } 354 $('#bookingform-home').accorBookingInitSingleDatepicker( 355 { 356 checkinDateSelector: '.checkin', 357 checkoutDateSelector: '.checkout', 358 dateFormat: dateFormat 359 } 360 ); 361 jQuery('#bookingform-home').accorBookingForm(); 362 363 $('#bookingform-home .checkin_checkout_ctx').click(function() { 364 if (!$('#bookingform-home .checkinout_wrapper').is(':visible')) { 365 $(document).trigger('accor_event.open_calendar'); 366 } 367 $('#bookingform-home .checkinout_wrapper').toggle(); 368 }); 369 370 } else { 371 //INTERNAL PAGE 372 $('#bookingform-popin').accorBookingInitSingleDatepicker( 373 { 374 checkinDateSelector: '.checkin', 375 checkoutDateSelector: '.checkout', 376 dateFormat: 'dd MM yy' 377 } 378 ); 379 jQuery('#bookingform-popin').accorBookingForm(); 380 $('#book_panel span.book_close').on('tap', function() { $('#book_button').trigger('click'); }); 381 } 382 383 // Home : Local Measure 384 if(typeof(localmeasure) !== 'undefined') { 385 386 $.ajax({
387 url : "https://cdn.getlocalmeasure.com/public/"+localmeasure.id+"/data.js", 388 jsonpCallback: "jsonCallback_"+localmeasure.id, 389 jsonp: false, 390 dataType: "jsonp" 391 }).done(function( data ) { 392 393 if(data.posts !== '') { 394 395 if($('body').hasClass('rtl')) { 396 $('<span id="fb-social-popup-prev"><img class="fbsocial-svg svg-prev" src="'+ localmeasure.host +'localmeasure/arrow-next.svg"/></span><span id="fb-social-popup-next"><img class="fbsocial-svg svg-next" src="'+ localmeasure.host +'localmeasure/arrow-prev.svg"/></span>').appendTo($('body')); 397 } else { 398 $('<span id="fb-social-popup-prev"><img class="fbsocial-svg svg-prev" src="'+ localmeasure.host +'localmeasure/arrow-prev.svg"/></span><span id="fb-social-popup-next"><img class="fbsocial-svg svg-next" src="'+ localmeasure.host +'localmeasure/arrow-next.svg"/></span>').appendTo($('body')); 399 } 400 $('<span id="fb-social-popup-close"><img class="fbsocial-svg svg-close" src="'+ localmeasure.host +'localmeasure/close.svg"/></span>').appendTo($('body')); 401 402 $('img.fbsocial-svg').each(function(){ 403 var $img = $(this); 404 var imgID = $img.attr('id'); 405 var imgClass = $img.attr('class'); 406 var imgURL = $img.attr('src'); 407 408 $.get(imgURL, function(data) { 409 var $svg = jQuery(data).find('svg'); 410 if(typeof imgID !== 'undefined') { $svg = $svg.attr('id', imgID); } 411 if(typeof imgClass !== 'undefined') { $svg = $svg.attr('class', imgClass+' replaced-svg'); } 412 $svg = $svg.removeAttr('xmlns:a'); 413 $img.replaceWith($svg); 414 }, 'xml'); 415 });
416 417 for(var i = 0; i < 6; i++) { 418 419 if(data.posts[i] !== undefined ) { 420 421 var _lm_format = 'landscape'; 422 if(data.posts[i].image_size.height > data.posts[i].image_size.width) { 423 _lm_format = 'portrait'; 424 } 425 426 var _lm_item = $('<div class="fb-social-widget" data-width="'+ data.posts[i].image_size.width +'" data-height="'+ data.posts[i].image_size.height +'" data-format="'+ _lm_format +'" data-type="'+ ((data.posts[i].kind === 'video') ? 'video' : 'image') +'" data-img="'+ data.posts[i].image +'" data-video="'+ ((data.posts[i].video !== '') ? data.posts[i].video : '') +'" data-xiti="home::guestimage">'+ 427 '<div class="fb-social-info">'+ 428 '<div class="fb-social-author">'+ 429 '<span class="fb-social-author-picture"><img src="'+ data.posts[i].poster.avatar +'" alt=""></span>'+ 430 '<span class="fb-social-author-name">'+ data.posts[i].poster.name +'</span>'+ 431 '</div>'+ 432 '<span class="fb-social-date">'+ $.datepicker.formatDate( 'dd/mm/yy', new Date(data.posts[i].created), {} ) +'</span>'+ 433 '<div class="fb-social-text"><span>'+ data.posts[i].text +'</span></div>'+ 434 '<a href="'+ data.posts[i].source.link +'" target="blank" class="fb-social-logo fb-social-'+ data.posts[i].source.network +'-logo">link</a>'+ 435 '</div>'+ 436 '<div class="fb-social-image">'+ 437 '<img src="'+ data.posts[i].images[0].url +'" alt="">'+ 438 '</div></div>'); 439 440 _lm_item.appendTo('#localmeasure'); 441 442 $('.fb-social-widget').each(function(n) { 443 var _self = $(this); 444 _self.find('div.fb-social-image').resizeCenter({ 445 onLoad: function() { setTimeout( function() { _self.find('img').animate({'opacity' : 1}); }, 150); } 446 }); 447 _self.unbind('click'); 448 _self.bind('click', function() { click(this); }); 449 450 function click(el) { 451 var _content = $(el).find('.fb-social-info').html(), 452 _video = $(el).data('video'), 453 _img = $(el).data('img'), 454 _type = $(el).data('type'), 455 _format = $(el).data('format'), 456 _img_w = $(el).data('width'), 457 _img_h = $(el).data('height'); 458 var _media = '<img src="'+ _img +'">'; 459 if(_type === 'video') { 460 _media = '<video id="fb-social-popup-video" autoplay loop height="600" width="600" src="'+ _video +'" controls poster="'+ _img +'" preload="none"></video>'; 461 } 462 $.fancybox({ 463 tpl : { 464 wrap : '<div class="fancybox-wrap fb-social-fancybox" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>' 465 }, 466 padding : 0, 467 href: '', 468 content : '<div id="fb-social-popup"><div class="fb-social-images '+ _format +'">'+ _media +'</div><div class="fb-social-info">'+ _content +'</div></div>', 469 scrolling : 'no', 470 autoResize : true, 471 aspectRatio : true, 472 openEffect : 'none', 473 nextEffect : 'none', 474 closeBtn : false, 475 helpers : { overlay : { locked : false } }, 476 beforeClose : function() { 477 $('#fb-social-popup-next, #fb-social-popup-prev, #fb-social-popup-close').hide(); 478 }, 479 afterClose : function() { 480 $('body').removeClass('fb_social_open'); 481 }, 482 beforeShow : function() { 483 $('body').addClass('fb_social_open'); 484 $('#fb-social-popup-close').on('click', function() { $.fancybox.close(); }); 485 }, 486 afterShow : function() { 487 $('#fb-social-popup-next, #fb-social-popup-prev, #fb-social-popup-close').show(); 488 if($($('.fb-social-widget').get(n+1)).hasClass('fb-social-hidden') || (n+1) >= 6) { $('#fb-social-popup-next').hide(); } 489 if(n === 0) { $('#fb-social-popup-prev').hide(); } 490 $('#fb-social-popup-next').unbind('click'); 491 $('#fb-social-popup-next').bind('click', function() { 492 $($('.fb-social-widget').get(n+1)).trigger('click'); 493 });
494 $('#fb-social-popup-prev').unbind('click'); 495 $('#fb-social-popup-prev').bind('click', function() { 496 $($('.fb-social-widget').get(n-1)).trigger('click'); 497 }); 498 499 var _width, _height, __w = $('.fb-social-images').innerWidth(), __h = $('.fb-social-images').innerHeight(); 500 501 switch(_format) { 502 case 'landscape': 503 _width = __w; 504 _height = Math.round((_width * _img_h / _img_w)); 505 break; 506 case 'square' : 507 _width = __w; 508 _height = Math.round((_width * _img_h / _img_w)); 509 break; 510 case 'portrait' : { 511 _height = __h; 512 _width = Math.round((_height * _img_w / _img_h)); 513 break; 514 } 515 } 516 517 var __pop_w = Math.ceil((_width + $('#fb-social-popup .fb-social-info').innerWidth())); 518 519 var __top = ($(window).height() - _height - parseFloat($('.fancybox-skin').css('padding-top')) - parseFloat($('.fancybox-skin').css('padding-bottom')) ) / 2, 520 __left = ($('.fancybox-outer').innerWidth() - __pop_w) / 2; 521 522 $('#fb-social-popup div.fb-social-images').animate({'height': _height, 'width': _width}, 1, function() { 523 $('.fancybox-inner').animate({'width': __pop_w, 'left': __left}, 1, function() { 524 $('.fancybox-wrap').css('top',__top); 525 $('#fb-social-popup').animate({'opacity':1}, 500); 526 }); 527 }); 528 529 } 530 }); 531 } 532 533 }); 534 535 } 536 537 } 538 539 $('#social div.text').insertAfter($($('div.fb-social-widget')[0])); 540 $('#social div.text > div').css('margin-top', -$('#social div.text > div').innerHeight() / 2); 541 } 542 543 }) 544 .fail(function( jqxhr, settings, exception ) { 545 if(window.console && console.log) { 546 console.log( "Local Measure : Triggered ajaxError handler." ); 547 } 548 }); 549 550 } 551 552 553 // Homepage Video 554 if($('#video-container').length > 0) { 555 $('body').addClass('hasVideo'); 556 $('#video-container').appendTo('#main_slideshow'); 557 var _video_play = $('<span id="hp_video_play" class="video-play"></span>'); 558 _video_play.appendTo('#main_slideshow'); 559 _video_play.on('click', function() { 560 if(player !== undefined) { 561 $('#booking').css('opacity',0); 562 player.playVideo(); 563 $('.main_slideshow').animate({'opacity':0}, function() { 564 $('#main_slideshow').height(player_h); 565 $('body').addClass('playing-video'); 566 }); 567 } 568 }); 569 $('.stop_video').on('click', function() { onPlayerStateChange({'data' : 0}); }); 570 $('.mute_video').on('click', function() { 571 if($(this).hasClass('muted')) { 572 $(this).removeClass('muted'); 573 player.setVolume(100); 574 } else { 575 $(this).addClass('muted'); 576 (typeof riseVolume !== 'undefined') && clearInterval(riseVolume); 577 player.setVolume(0); 578 } 579 }); 580 } 581 582 // Main slideshow 583 function detectIE() { 584 var ua = window.navigator.userAgent; 585 var msie = ua.indexOf('MSIE '); 586 if (msie > 0) { return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); } 587 var trident = ua.indexOf('Trident/'); 588 if (trident > 0) { var rv = ua.indexOf('rv:'); return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); } 589 var edge = ua.indexOf('Edge/'); 590 if (edge > 0) { return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); } 591 return false; 592 } 593 // - Fix for IE 594 var IEversion = detectIE(); 595 if(IEversion !== false) { 596 $('.main_slideshow li img').each(function() { 597 if (!$(this).attr('srcset')) { 598 return; 599 } 600 var _img = $(this).attr('srcset').split(', '); 601 _img = _img[_img.length-1].split(' '); 602 $(this).attr('src', _img[0]); 603 });
604 } 605 606 if($('body').hasClass('home')) { 607 $('#main_slideshow, .main_slideshow').height($(window).innerHeight()); 608 } else if($('body').hasClass('page-template-template-restaurant')) { 609 $('#main_slideshow, .main_slideshow').height($(window).innerHeight() - $('#subnav').innerHeight()); 610 } 611 $('.main_slideshow').each(function() { 612 var _self = $(this); 613 _self.resizeCenter({ 614 onLoad: function() { 615 _self.appendTo($('#main_slideshow')); 616 _self.find('ul.cycle').on('cycle-initialized', function( event, opts ) { 617 _self.find('img').animate({'opacity' : 1}); 618 }); 619 $('#main_slideshow').removeClass('loading'); 620 _self.find('ul.cycle').cycle({ 621 fx : 'fadeout', 622 timeout : 6000, 623 swipe : true, 624 slides : '> li', 625 sync : true, 626 pager : '#paging > div', 627 pagerTemplate : '<a href="#" class=""></a>', 628 pagerActiveClass : 'active', 629 next : 'span.arrows.right', 630 prev : 'span.arrows.left' 631 });
632 } 633 }); 634 }); 635 636 // Main book button 637 if(_is_mobile === false || ($('html').hasClass('tablet') && $('html').hasClass('landscape')) ) { 638 $('#book_button').prependTo($('#header nav')); 639 } 640 $('#book_button').on('click', function() { 641 if ($(this).hasClass('dontopenbookingform')) { 642 return; 643 } 644 if(_is_mobile == false) { 645 if ($('body').hasClass('home')) { 646 $('html,body').animate({scrollTop:$('#booking').offset().top-220}, 500); 647 $('#bookingform-home .checkinout_wrapper').show(); 648 $(document).trigger('accor_event.open_calendar'); 649 } else { 650 if($('#book_panel').hasClass('open')) { 651 $('#book_panel').removeClass('open'); 652 $('div.book_overlay').fadeOut(250, function() { $('html, body').css('overflow', 'auto'); }); 653 __offer_book_now_calendar_open = false; 654 } else { 655 if (!__offer_book_now_clicked) { 656 $(document).trigger('accor_event.open_calendar'); 657 } 658 $('div.book_overlay').fadeIn(250, function() { 659 $('html, body').css('overflow', 'hidden'); $('#book_panel').addClass('open'); 660 }); 661 } 662 } 663 } else { 664 $('.book_overlay').hide(); 665 //Specific mobile booking link 666 if (typeof accorMobileOpenQS !== 'undefined') { 667 var reference_form = $('body').hasClass('home') ? $('#bookingform-home') : $('#bookingform-popin'); 668 if ($('body').hasClass('single-offers')) { 669 reference_form = $('#bookingform'); 670 } 671 accorMobileOpenQS('form', reference_form); 672 } else { 673 if($('body').hasClass('home')) { 674 $('#bookingform-home').submit(); 675 } else { 676 $('#bookingform-popin').submit(); 677 } 678 } 679 } 680 }); 681 $('.single-offers #bookingform input.submit_button').on('click', function(e) { 682 $('#bookingform-popin').data($('#bookingform').data()); 683 $('#bf_multiroom').data($('#bookingform').data()); 684 $('#bookingform-popin .checkinout').datepicker('destroy'); 685 $('#bf_multiroom .bf_checkout').datepicker('destroy'); 686 $('#bookingform-popin').accorBookingInitSingleDatepicker( 687 { 688 checkinDateSelector: '.checkin', 689 checkoutDateSelector: '.checkout', 690 dateFormat: 'dd MM yy' 691 } 692 ); 693 $('#bf_multiroom').accorBookingInitSingleDatepicker( 694 { 695 checkinDateSelector: '.checkin', 696 checkoutDateSelector: '.checkout', 697 dateFormat: 'dd MM yy' 698 } 699 ); 700 jQuery('#bookingform-popin').accorBookingForm(); 701 jQuery('#bf_multiroom').accorBookingForm(); 702 $(this).trigger('accor_event.offer_open_calendar'); 703 __offer_book_now_clicked = true; 704 __offer_book_now_calendar_open = true; 705 e.preventDefault(); 706 e.stopPropagation(); 707 $('#preferredCode_dp').val($('#bookingform #preferredCode').val()); 708 $('#book_button').trigger('click'); 709 $('#bookingform-popin').data({}); 710 $('#bf_multiroom').data({}); 711 712 __offer_book_now_clicked = false; 713 }); 714 715 // Languages 716 $('#lang').on('click', function() { 717 var content_html = $(this).find('.languages').html(); 718 $.fancybox({ 719 padding: 0, 720 href: '', 721 content : '<div id="popup_content"><strong>'+ _choose_language +'</strong><hr><ul>'+content_html+'</ul></div>', 722 scrolling : 'no', 723 helpers : { overlay : null }, 724 afterShow : function() { 725 $('#popup_content li.select > select').attr('data-xiti','transverse::language::selection').on('change', function() { 726 var _url = $(this).find('option:selected').data('url'); 727 if(_url !== undefined) { 728 $(document).trigger('accor_event.other_language'); 729 var w = window.open(_url, '_blank'); 730 w.focus(); 731 } 732 });
733 }, 734 beforeClose: function() { 735 if($('.book_overlay').hasClass('shown')) { $('.book_overlay').removeClass('shown'); } 736 } 737 }); 738 }); 739 740 // Rooms main page 741 $('#rooms-filter li').each(function() { 742 $(this).on('click', function() { 743 $('#rooms-filter li').removeClass('active'); 744 $(this).addClass('active'); 745 $('.roomtype li').hide(); 746 if($(this).data('type') === 'all') { 747 $('.roomtype li').show(); 748 } else { 749 $('.roomtype li.'+$(this).data('type')).show(); 750 } 751 }); 752 }); 753 754 // Room single page 755 if($('#services').length > 0 && _is_mobile === false) { 756 var _sc = _sh = 0; 757 var _sl = $('#services div.service > div > div > ul').length; 758 var _sw = $('#services div.service > div > div').innerWidth(); 759 $('#services div.service > div > div > ul').each(function() { 760 if($(this).innerHeight() > _sh) { _sh = $(this).innerHeight(); } 761 }); 762 $('#services div.service > div > div, #services div.service > div').height(_sh); 763 $('#services div.service > div > div > ul').width(_sw); 764 $('#services div.service > div > div').width(_sl * _sw); 765 $('#services div.service > span > a').on('click', function() { 766 _sc++; 767 if(_sc+1 > _sl) { _sc = 0; } 768 $('#services div.service > div > div').stop(true, true).animate({'left':-_sw*_sc}); 769 }); 770 } 771 772 // Homepage highlighted pages 773 if(_is_mobile === false) { 774 $('#highlighted ul li').each(function() { 775 // we want to optimize the google pagespeed score and give the user the joy to enjoy nice images 776 $(this).find('img').waypoint(function() { 777 var _self = $(this); 778 var _src = _self.data('src'); 779 var _parent = $(this).parents('div.w-resp').first(); 780 _self.get(0).onload = function() { 781 _parent.resizeCenter({onLoad: function() { _self.animate({'opacity' : 1}); } }); 782 } 783 _self.attr('src', _src); 784 }, { 785 offset: '100%' 786 }); 787 }); 788 } else { 789 $('#highlighted ul li').each(function() { 790 var _self = $(this).find('img'); 791 var _src = _self.data('src'); 792 _self.attr('src', _src).css({'opacity' : 1}); 793 }); 794 } 795 796 // Map 797 if(typeof(_hotel) != 'undefined' && typeof($.fn.FBMap) != 'undefined') { 798 $('#map_canvas').FBMap({ 799 lat : _hotel.lat, 800 lng : _hotel.lng, 801 marker : _hotel.marker, 802 train_station : _hotel.img_path + 'point.png', 803 airport : _hotel.img_path + 'point.png', 804 subway_station : _hotel.img_path + 'point.png', 805 taxi_stand : _hotel.img_path + 'point.png', 806 cafe : _hotel.img_path + 'point.png', 807 restaurant : _hotel.img_path + 'point.png', 808 museum : _hotel.img_path + 'point.png', 809 art_gallery : _hotel.img_path + 'point.png', 810 blank : _hotel.img_path + 'point.png', 811 noplaces_text : map_noplaces_text, 812 link_text : map_directions_text, 813 zoomControl : { 814 'display': true, 815 'style': 'LARGE', 816 'position': ($('body').hasClass('rtl')) ? 'LEFT_TOP' : 'RIGHT_TOP' 817 }, 818 'infobox_options' : { 819 'boxStyle': { 820 'background': "" 821 }, 822 'closeBoxURL': "" 823 }, 824 mapStyle : [ 825 {"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]}, 826 {"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]}, 827 {"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]}, 828 {"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"},{"lightness":29},{"weight":0.2}]}, 829 {"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":18}]}, 830 {"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#ffffff"},{"lightness":16}]}, 831 {"featureType":"poi","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":21}]}, 832 {"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#dedede"},{"lightness":21}]}, 833 {"featureType": "poi", "elementType": "labels", "stylers": [ { "visibility": "off" } ] }, 834 {"featureType": "poi.business", "elementType": "all", "stylers": [ { "visibility": "off" } ] }, 835 {"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#ffffff"},{"lightness":16}]}, 836 {"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#333333"},{"lightness":40}]}, 837 {"elementType":"labels.icon","stylers":[{"visibility":"off"}]}, 838 {"featureType":"transit","elementType":"geometry","stylers":[{"color":"#f2f2f2"},{"lightness":19}]}, 839 {"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#fefefe"},{"lightness":20}]}, 840 {"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#fefefe"},{"lightness":17},{"weight":1.2}]} 841 ], 842 pois : ((typeof(pois) !== 'undefined') ? pois : null), 843 display_pois : true, 844 group_fit_bounds : false, 845 draggable : (_is_mobile) ? false : true 846 });
847 $('#map_actions > ul > li').on('click', function() { 848 if(!$(this).hasClass('active')) { 849 $('#map_actions > ul > li > div').slideUp(); 850 $('#map_actions > ul > li').removeClass('active'); 851 $(this).addClass('active'); 852 $(this).find('> div').slideDown(); 853 $(this).find('> div').css('display','flex'); 854 } 855 }); 856 $('#map_actions > ul > li').first().trigger('click'); 857 var _wait_poi = setInterval(function() { 858 if($('#monuments > li').first().children().length > 0) { 859 clearInterval(_wait_poi); 860 $('#monuments > li').each(function() { 861 var _checkbox = $('<span class="checkbox"></span>'); 862 _checkbox.prependTo($(this)); 863 }); 864 $('#monuments > li > strong').each(function() { 865 $(this).on('click', function(){ 866 $('#monuments > li').removeClass('active'); 867 $(this).parent('li').addClass('active'); 868 }); 869 }); 870 } 871 }, 50); 872 $('#streetview').on('click', function() { $('#places_content').hide(); }); 873 if(_is_mobile === true) { 874 $('#map_ctx, #map_canvas').height($(window).innerWidth()); 875 if($('body').hasClass('page-template-template-location')) { 876 $('#map_actions').insertAfter('#location'); 877 } else { 878 $('#map_actions').insertBefore('#map_canvas'); 879 } 880 } 881 } 882 883 // Tripadvisor 884 $('#tripadvisor ul').first().cycle({slides: "> li", timeout:6000 }); 885 $('a.tripadvisor_reviews').fancybox({ 886 maxWidth : 800, 887 maxHeight : 600, 888 fitToView : false, 889 width : '70%', 890 height : '70%', 891 padding : 0 892 }); 893 894 // Location link 895 if($('body').hasClass('home')) { 896 $('a.location_link').attr('href', '#location').on('click', function(e) { 897 e.preventDefault(); 898 $('html,body').stop(0,0).animate({ 899 scrollTop: $('#location').offset().top-$('#header').innerHeight() 900 },1000); 901 }); 902 if(window.location.hash!=='' && window.location.hash.match(/^#[a-zA-Z0-9-_]+$/) ) { 903 $('html,body').animate({ 904 scrollTop: $(window.location.hash).offset().top-$('#header').innerHeight() 905 },1000); 906 } 907 } 908 909 // Page single (move the title into the slideshow) 910 $('.slideshow_title').appendTo($('div.main_slideshow')).css({'height': $('div.main_slideshow').innerHeight()+'px', 'line-height': $('div.main_slideshow').innerHeight()+'px'}).show(); 911 912 // Restaurant page || Spa page 913 $('.slideshow_title > strong').css('margin-top', -$('.slideshow_title > strong').innerHeight() / 2); 914 $('#informations').css('background-image','url('+$('.main_slideshow li img').attr('src')+')'); 915 $('.page-template-template-restaurant .fancy a').fancybox({ 916 openEffect : 'none', 917 closeEffect : 'none', 918 padding: 0, 919 afterShow: function() { $('body').addClass('fancybox-restaurant'); }, 920 beforeClose : function() { $('body').removeClass('fancybox-restaurant'); } 921 }); 922 $('.restaurant_press li').each(function() { 923 var _self = $(this).find('a'); 924 if(typeof(_self.attr('data-image')) !== 'undefined' && _self.attr('data-image') != '') { 925 var _span = '<span class="cover"></span>'; 926 $(_span).prependTo(_self); 927 CrossBrowserThumb(_self); 928 } 929 }); 930 931 // Gallery 932 if($('#gallery-photo').length > 0) { makeGallery(); } 933 934 // Gallery page 935 var photogallery_category=location.hash.replace('#___', ''); 936 var $container = $('#gallery'); 937 $container.imagesLoaded( function() { 938 var _l = $container.find('div.elm').length; 939 function appear(i) { 940 if((i+1) <= _l) { 941 $($container.find('div.elm').get(i)).animate({'opacity':1}, 80, function() { $(this).addClass('set'); appear(i+1); }); 942 } 943 } 944 appear(0); 945 946 if(_is_mobile === false) { 947 948 $('.home .fancy a, .page-template-template-gallery .fancy a, .page-template-template-gallery-wp .fancy a').attr('href', 'javascript:void(0);').on('click', function() { 949 galleryPopin($(this).data('id')); 950 return false; 951 });
952 var _tags = $('#gallery-tags li'); 953 _tags.each(function() { 954 $(this).on('click', function() { 955 _tags.removeClass('active'); 956 $(this).addClass('active'); 957 var _tag = $(this).data('tag'); 958 if(_tag !== undefined) { $container.isotope({filter : '.'+ _tag}); } 959 else { $container.isotope({ filter: '*' }); } 960 }); 961 }); 962 963 if (photogallery_category != '') { 964 $('#gallery-tags li[data-tag='+photogallery_category+']').trigger('click'); 965 } 966 967 } else { 968 969 $('#video').prependTo('#gallery'); 970 $('.fancy.video > a').each(function() { 971 var _href = '//www.youtube.com/embed/' + YouTubeGetID($(this).attr('href')) + '?showinfo=0&rel=0&modestbranding=1&autoplay=1&wmode=opaque'; 972 $(this).attr('data-href', _href).attr('href', 'javascript:void(0);'); 973 $(this).addClass('fancybox.iframe').fancybox({ 974 fitToView : true, 975 href : _href, 976 openEffect : 'none', 977 closeEffect : 'none', 978 padding: 0 979 });
980 }); 981 $('.fancy.virtualtour > a').each(function() { 982 var _href = $(this).attr('href'); 983 $(this).attr('data-href', _href).attr('href', 'javascript:void(0);'); 984 $(this).addClass('fancybox.iframe').fancybox({ 985 fitToView : true, 986 href : _href, 987 openEffect : 'none', 988 closeEffect : 'none', 989 padding: 0 990 }); 991 }); 992 $('.fancy.image a').each(function() { 993 var _href = $(this).attr('href'); 994 $(this).attr('data-href', _href).attr('href', 'javascript:void(0);'); 995 $(this).on('click', function() { 996 $.fancybox({ 997 openEffect : 'elastic', 998 closeEffect : 'elastic', 999 href : _href, 1000 padding: 0 1001 }); 1002 }); 1003 }); 1004 var _tags = $('#gallery-tags li'); 1005 var _select_photos = $('<select></select>'); 1006 _select_photos.appendTo('#gallery-tags'); 1007 _tags.each(function() { 1008 var _option = $('<option value="'+$(this).data('tag')+'">'+$(this).text()+'</option>'); 1009 _option.appendTo(_select_photos); 1010 }); 1011 $('#gallery-tags ul').remove(); 1012 $('#gallery-tags').insertAfter('#header').show(); 1013 _select_photos.on('change', function() { 1014 var _tag = $(this).val(); 1015 if(_tag !== 'undefined') { $container.isotope({filter : '.'+ _tag}); } 1016 else { $container.isotope({ filter: '*' }); } 1017 $('html, body').scrollTop(0); 1018 }); 1019 1020 if (photogallery_category != '') { 1021 _select_photos.val(photogallery_category).trigger('change'); 1022 } 1023 1024 $('#gallery div.elm').each(function() { 1025 if($(this).hasClass('video')) { 1026 var _src = $(this).find('img').attr('src').replace(/hqdefault/g,'maxresdefault'); 1027 } else if($(this).hasClass('fancy')) { 1028 var _src = $(this).find('img').attr('src'); 1029 } 1030 else { 1031 var _src = $(this).find('a').first().data('href'); 1032 } 1033 $(this).find('img').attr('src', _src); 1034 }); 1035 $('#video, #video-ctx, #gallery div.video, #gallery .video-ctx, #gallery div.elm').each(function() { 1036 var _self = $(this); 1037 $(this).parents().each(function() { 1038 var _w = $(this).width(); 1039 if(_w !== 0) { 1040 _self.css({'width': _w, 'height' : _w * 9 /16}); 1041 return false; 1042 } 1043 });
1044 1045 }); 1046 $('.w-resp, #gallery div.elm').each(function() { 1047 var _self = $(this); 1048 setTimeout( function() { _self.resizeCenter(); }, 250); 1049 }); 1050 $(window).on('resize', function() { 1051 $('#video, #video-ctx, #gallery div.video, #gallery .video-ctx, #gallery div.elm').each(function() { 1052 var _self = $(this); 1053 $(this).parents().each(function() { 1054 var _w = $(this).width(); 1055 if(_w !== 0) { 1056 _self.css({'width': _w, 'height' : _w * 9 /16}); 1057 return false; 1058 } 1059 }); 1060 1061 }); 1062 $('.w-resp, #gallery div.elm').each(function() { 1063 var _self = $(this); 1064 setTimeout( function() { _self.resizeCenter(); }, 250); 1065 }); 1066 }); 1067 1068 } 1069 1070 $container.isotope({ 1071 itemSelector : '.fancy', 1072 layoutMode : 'masonry', 1073 isOriginLeft : ($('body').hasClass('rtl')) ? false : true 1074 }); 1075 1076 }); 1077 1078 // News main page 1079 var _news_max = $('.news-section ul li').length; 1080 $('.news-section span.load_more').on('click', function() { 1081 var _min = $('.news-section ul li:visible').length; 1082 var _max = _min + 9; 1083 for(i = _min; i < _max; i++) { 1084 $($('.news-section ul li').get(i)).removeClass('hidden'); 1085 } 1086 if(_max >= _news_max) { $(this).remove(); } 1087 }); 1088 1089 // News single page 1090 $('.mini_slideshow').each(function() { 1091 var _self = $(this); 1092 _self.resizeCenter({ 1093 onLoad: function() { 1094 _self.on('cycle-initialized', function( event, opts ) { 1095 _self.find('img').animate({'opacity' : 1}); 1096 });
1097 _self.cycle({ 1098 fx : 'fadeout', 1099 timeout : 6000, 1100 swipe : true, 1101 slides : '> li', 1102 sync : true, 1103 next : 'span.mini_slideshow_next', 1104 prev : 'span.mini_slideshow_prev' 1105 }); 1106 } 1107 }); 1108 }); 1109 1110 // Meeting single page || Restaurant single page || Spa main page || Wedding single page 1111 if($('body').hasClass('single-offers') 1112 || $('body').hasClass('page-template-template-meeting') 1113 || $('body').hasClass('page-template-template-restaurant') 1114 || $('body').hasClass('page-template-template-wellness-single') 1115 || $('body').hasClass('page-template-template-wedding') 1116 || $('body').hasClass('page-template-template-meetings') 1117 || $('body').hasClass('page-template-template-recruitments') 1118 ) { 1119 1120 function updateForm(_content, _form, _lang, _title) { 1121 1122 $('input[name="restaurant"]').val(_title); 1123 var _hours = $('#form_hours > option:disabled'); 1124 var _minutes = $('#form_minutes > option:disabled'); 1125 1126 $('#form_date,.contact_form_datepicker').datepicker({ 1127 numberOfMonths:2, 1128 minDate:new Date(), 1129 onSelect : function(dateText, inst) { 1130 var _date = new Date(); 1131 1132 if( $('body').hasClass('page-template-template-restaurant') && $(this).datepicker('getDate').toDateString() === _date.toDateString() ) { 1133 $('#form_hours > option').each(function(i) { 1134 if(typeof(_hours[i]) !== 'undefined') { $(this).prop('disabled', true); } 1135 }); 1136 $('#form_minutes > option').each(function(i) { 1137 if(typeof(_minutes[i]) !== 'undefined') { $(this).prop('disabled', false); } 1138 }); 1139 } else { 1140 $('#form_hours > option, #form_minutes > option').each(function() { 1141 $(this).prop('disabled', false); 1142 }); 1143 } 1144 } 1145 }); 1146 1147 if($('#g-recaptcha').length > 0) { 1148 var _key = $('#g-recaptcha').attr('data-sitekey'); 1149 grecaptcha.render('g-recaptcha', { 'sitekey' : _key }); 1150 } 1151 1152 $('.tableplus-submit').click(function(){ 1153 $(this).trigger('accor_event.submit_form'); 1154 $.fancybox.close(); 1155 return true; 1156 }); 1157 1158 $('form.form').on('submit', function(e) { 1159 e.preventDefault(); 1160 var button = $(this).find('.submit input.btn'); 1161 button.attr('disabled', 'disabled'); 1162 $(this).trigger('accor_event.submit_form'); 1163 var data = $('form.form').serialize() + '&action=hotel_form&form=' + _form + '&lang='+ _lang; 1164 var post_id = $('meta[name=accor_post_id]').attr('content'); 1165 1166 var form = $(this); 1167 if (form.find('input[type=file]').length > 0) { 1168 formDataUpload(form, _form, post_id, function(response){ 1169 if (formResponseContainsSuccess(response)) { 1170 form.trigger('accor_event.form_success'); 1171 } 1172 $('.fancybox-inner').html(response); 1173 $.fancybox.update(); 1174 $.fancybox.reposition(); 1175 updateForm(response, _form, _lang, _title); 1176 button.removeAttr('disabled'); 1177 }); 1178 } else { 1179 if (post_id && post_id !== '0') { 1180 data = data + '&source_post_id=' + post_id; 1181 } 1182 jQuery.post(ajax_url, data, function(response) { 1183 if (formResponseContainsSuccess(response)) { 1184 form.trigger('accor_event.form_success'); 1185 } 1186 $('.fancybox-inner').html(response); 1187 $.fancybox.update(); 1188 $.fancybox.reposition(); 1189 updateForm(response, _form, _lang, _title); 1190 button.removeAttr('disabled'); 1191 }); 1192 return false; 1193 } 1194 }); 1195 1196 } 1197 1198 $('a[data-form]').on('click', function() { 1199 $(this).trigger('accor_event.open_form'); 1200 var _form = $(this).data('form'); 1201 var _title = $(this).data('post'); 1202 var _id = $(this).data('id'); 1203 var data = { 'action': 'hotel_form', 'form': _form, 'title': _title, 'restaurant_post_id': _id, 'lang' : _lang }; 1204 var post_id = $('meta[name=accor_post_id]').attr('content'); 1205 if (post_id && post_id !== '0') { 1206 data.source_post_id = post_id; 1207 } 1208 jQuery.get(ajax_url, data, function(response) { 1209 $.fancybox({ 1210 padding : 0, 1211 href : '', 1212 content : response, 1213 scrolling : 'no', 1214 fitToView : false, 1215 width : '70%', 1216 height : '70%', 1217 autoSize : true, 1218 helpers : { overlay : { locked : false } }, 1219 afterShow : function() { 1220 updateForm(this.content, _form, _lang, _title); 1221 if( typeof(xiti_tracking) !== 'undefined' ) { xiti_tracking(); } 1222 } 1223 });
1224 }); 1225 return false; 1226 }); 1227 1228 if($(window).scrollTop() > $('.main_slideshow').innerHeight()){ 1229 $('.subnav').addClass('fixed'); 1230 } else { 1231 $('.subnav').removeClass('fixed'); 1232 } 1233 $('.subnav li a').each(function() { 1234 $(this).on('click', function() { 1235 $('.subnav li').removeClass('current'); 1236 $(this).parents('li').first().addClass('current'); 1237 var _href = $(this).attr('href'); 1238 $('html,body').addClass('scrolling').stop(0,0).animate({ 1239 scrollTop: $(_href).offset().top-$('#header').innerHeight() 1240 },1000, function() { $(this).removeClass('scrolling'); }); 1241 }); 1242 }); 1243 if(window.location.hash!=='' && window.location.hash.match(/^#[a-zA-Z0-9-_]+$/)) { 1244 $('.subnav li a[href="'+window.location.hash+'"]').parents('li').first().addClass('current'); 1245 $('html,body').animate({ 1246 scrollTop: $(window.location.hash).offset().top-$('#header').innerHeight() 1247 },1000); 1248 } 1249 } 1250 1251 // Offers Main Page 1252 $('a[data-offer]').each(function() { 1253 $(this).on('click', function() { 1254 var _offer = $(this).data('offer').split(':'); 1255 if(_offer[1] !== '') { 1256 var _dayIn = _offer[1]; 1257 var _monthIn = _offer[2]; 1258 var _yearIn = _offer[3]; 1259 } 1260 if(_offer[0] !== '') { 1261 var _tk = _offer[0]; 1262 accorBookNow({"preferredCode": _tk, "dayIn": _dayIn, "monthIn": _monthIn, "yearIn": _yearIn}); 1263 } else { 1264 accorBookNow(); 1265 } 1266 return false; 1267 }); 1268 }); 1269 $('.choose_offers select').each(function() { 1270 $(this).on('change', function() { 1271 var _cat = $(this).data('type'); 1272 var _val = $(this).find('option:selected').data(_cat); 1273 if(_val === 'all') { 1274 $('li.offer_detail').show(); 1275 } else { 1276 $('li.offer_detail').removeClass('last').hide(); 1277 $('li.offer_detail[data-'+_cat+'="'+ _val +'"]').show(); 1278 $('li.offer_detail:visible').each(function(n) { 1279 if((n+1) % 3 === 0) { $(this).addClass('last'); } 1280 });
1281 } 1282 }); 1283 }); 1284 1285 var _getUrlParams = function() { 1286 var regex = /[?&]([^=#]+)=([^&#]*)/g, 1287 url = window.location.href, 1288 params = {}, 1289 match; 1290 while(match = regex.exec(url)) { 1291 params[match[1]] = match[2]; 1292 } 1293 return params; 1294 }; 1295 var urlParams = _getUrlParams(); 1296 if (typeof urlParams.product !== 'undefined' && $('.choose_offers').length > 0) { 1297 $('.choose_offers select[data-type="product"] option').each(function() { 1298 var option = $(this); 1299 var select = option.parent(); 1300 if (option.data('product').toLowerCase() === urlParams.product.toLowerCase()) { 1301 select.find('option:selected').removeAttr('selected'); 1302 option.attr('selected', 'selected'); 1303 select.trigger('change'); 1304 select.closest('.select-box').find('> span').text(option.text()); 1305 } 1306 }); 1307 } 1308 if (typeof urlParams.theme !== 'undefined' && $('.choose_offers').length > 0) { 1309 $('.choose_offers select[data-type="category"] option').each(function() { 1310 var option = $(this); 1311 var select = option.parent(); 1312 if (option.data('category').toLowerCase() === urlParams.theme.toLowerCase()) { 1313 select.find('option:selected').removeAttr('selected'); 1314 option.attr('selected', 'selected'); 1315 select.trigger('change'); 1316 select.closest('.select-box').find('> span').text(option.text()); 1317 } 1318 }); 1319 } 1320 1321 // Offers single page 1322 $('.single_offer #bookingform #checkin, .single_offer #bookingform #checkout').on('click', function() { 1323 $('.single_offer #bookingform .children, .single_offer #bookingform .adults, .single_offer #bookingform .loyalty').slideDown(); 1324 }); 1325 1326 // Newsletter page 1327 $('select[name="brand_news_language"], select[name="news_language"]').on('change', function() { 1328 var _checkbox = $(this).parents('p.checkbox').first().find('input[type="checkbox"]'); 1329 if($(this).val() !== '') { _checkbox.prop('checked', true); } else { _checkbox.prop('checked', false); } 1330 }); 1331 1332 // set main navigation bar 1333 $('body').addClass('fixed'); 1334 if($('body').hasClass('page-template-template-restaurant')) {$('body').removeClass('fixed');} 1335 if($('body').hasClass('home')) { 1336 if($(window).scrollTop() >= $('#main_slideshow').innerHeight()) { 1337 $('body').addClass('fixed'); 1338 } else { 1339 $('body').removeClass('fixed'); 1340 } 1341 } 1342 1343 // Resize and center images 1344 $('.w-resp').each(function() { 1345 var _self = $(this); 1346 _self.resizeCenter({ 1347 onLoad: function() { setTimeout( function() { _self.find('img.resp').animate({'opacity' : 1}); }, 200); } 1348 }); 1349 1350 }); 1351 var scrollDiv = document.createElement("div"); 1352 scrollDiv.className = "scrollbar-measure"; 1353 document.body.appendChild(scrollDiv); 1354 scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; 1355 document.body.removeChild(scrollDiv); 1356 1357 // Responsive way 1358 if($(window).innerWidth() + scrollbarWidth <= 800 && _is_mobile === false || $('html').hasClass('mobile')) { 1359 mobileRender(true); 1360 } else if($(window).innerWidth() + scrollbarWidth > 800 && _is_mobile === true) { 1361 mobileRender(false); 1362 } 1363 1364 // Fix on mobile for rtl language (white gap) 1365 if(_is_mobile === true && $('body').hasClass('rtl')) { 1366 setTimeout(function() { 1367 $('html,body').scrollTop(1); 1368 }, 100); 1369 } 1370 1371 }); 1372 1373 $(window).resize(function() { 1374 1375 if($('body').hasClass('home') && !$('body').hasClass('playing-video')) { 1376 $('#main_slideshow, .main_slideshow').height($(window).innerHeight()); 1377 } else if($('body').hasClass('page-template-template-restaurant')) { 1378 $('#main_slideshow, .main_slideshow').height($(window).innerHeight() - $('#subnav').innerHeight()); 1379 } else if($('body').hasClass('playing-video')) { 1380 $('#main_slideshow').css('height', 'auto'); 1381 $('#booking').css('bottom', $(window).innerHeight() - $('#video-container').innerHeight() + $('#booking').innerHeight() + 90); 1382 $('.mute_video, .stop_video').css('bottom', $('#video-container').innerHeight() - $(window).innerHeight() + $('.mute_video').innerHeight()); 1383 } 1384 // 1385 $('#rooms ul li').each(function() { 1386 var _height = parseFloat($('#rooms ul li:first').innerWidth() * 80 / 100); 1387 $(this).css('height', _height); 1388 });
1389 1390 // Rooms menu 1391 if($('#room-nav div.room_slider').length > 0) { 1392 var _slider_w = $('#room-nav div.room_slider').data('initial-width') + $('.previous_room').innerWidth() + $('.next_room').innerWidth(); 1393 var _slider_diff = $('#room-nav').innerWidth() - _slider_w; 1394 if(_slider_diff < 0) { 1395 $('#room-nav div.room_slider').width($('#room-nav div.room_slider').data('initial-width')+_slider_diff); 1396 } else { 1397 $('#room-nav div.room_slider').width($('#room-nav div.room_slider').data('initial-width')); 1398 } 1399 } 1400 1401 // Homepage highlighted pages 1402 if(_is_mobile === false) { 1403 $('#highlighted ul li').each(function() { 1404 // we want to optimize the google pagespeed score and give the user the joy to enjoy nice images 1405 $(this).find('img').waypoint(function() { 1406 var _self = $(this); 1407 var _src = _self.data('src'); 1408 var _parent = $(this).parents('div.w-resp').first(); 1409 _self.get(0).onload = function() { 1410 _parent.resizeCenter({onLoad: function() { _self.animate({'opacity' : 1}); } }); 1411 } 1412 _self.attr('src', _src); 1413 }, { 1414 offset: '100%' 1415 }); 1416 }); 1417 } else { 1418 $('#highlighted ul li').each(function() { 1419 var _self = $(this).find('img'); 1420 var _src = _self.data('src'); 1421 _self.attr('src', _src).css({'opacity' : 1}); 1422 }); 1423 } 1424 1425 // Page single (adjust the title) 1426 if(_is_mobile === false) { 1427 $('.slideshow_title').css({'height': $('div.main_slideshow').innerHeight()+'px', 'line-height': $('div.main_slideshow').innerHeight()+'px'}); 1428 } 1429 1430 // Restaurant page 1431 $('.slideshow_title > strong').css('margin-top', -$('.slideshow_title > strong').innerHeight() / 2); 1432 1433 // Gallery 1434 if($('#gallery-photo').length > 0) { makeGallery(); } 1435 1436 // Responsive way 1437 if($(window).innerWidth() + scrollbarWidth <= 1300) { menuRender(true); } else { menuRender(false); } 1438 1439 if($(window).innerWidth() + scrollbarWidth <= 800 && _is_mobile === false) { 1440 mobileRender(true); 1441 } else if($(window).innerWidth() + scrollbarWidth > 800 && _is_mobile === true) { 1442 mobileRender(false); 1443 } 1444 1445 1446 }).blur(function() { 1447 1448 // pause the main slideshow 1449 $('.main_slideshow ul.cycle').cycle('pause'); 1450 1451 }).focus(function() { 1452 1453 // resume the main slideshow 1454 $('.main_slideshow ul.cycle').cycle('resume'); 1455 1456 }).scroll(function() { 1457 1458 // homepage 1459 if($('body').hasClass('home')) { 1460 1461 // set main navigation bar 1462 $('body').addClass('fixed'); 1463 if($('body').hasClass('page-template-template-restaurant')) {$('body').removeClass('fixed');} 1464 if($('body').hasClass('home')) { 1465 if($(window).scrollTop() >= $('#main_slideshow').innerHeight()) { 1466 $('body').addClass('fixed'); 1467 } else { 1468 $('body').removeClass('fixed'); 1469 } 1470 } 1471 1472 } 1473 1474 // restaurant menu 1475 if($(window).scrollTop() > $('.main_slideshow').innerHeight()){ 1476 $('.subnav').addClass('fixed'); 1477 } else { 1478 $('.subnav').removeClass('fixed'); 1479 } 1480 if(!$('html,body').hasClass('scrolling')) { 1481 var _subnav = new Array(); 1482 $('.subnav li a').each(function() { _subnav.push($(this).attr('href')); }); 1483 $.map(_subnav, function(el) { 1484 if($(window).scrollTop() >= ($(el).offset().top-$('#header').innerHeight())){ 1485 $('.subnav li').removeClass('current'); 1486 $('.subnav li a[href="'+el+'"]').parents('li').first().addClass('current'); 1487 } 1488 }); 1489 } 1490 // 1491 1492 }).load(function() { 1493 1494 }).bind('click tap', function(e) { 1495 1496 // close the book panel by clicking on the overlay 1497 if($(e.target) != undefined && $('#book_panel').hasClass('open') && $('div.book_overlay').is(':visible') && $(e.target).hasClass('book_overlay') && _is_mobile === false) { 1498 $('#book_button').trigger('click'); 1499 } 1500 // close the extended menu by clicking on the overlay 1501 if($(e.target) != undefined && $('#extended_menu').hasClass('open') && $('div.book_overlay').is(':visible') && $(e.target).hasClass('book_overlay') && _is_mobile === false) { 1502 $.fancybox.close(); 1503 $('nav li.hamburger a').trigger('tap'); 1504 } 1505 // close the home booking form 1506 if($(e.target) != undefined && $(e.target).parents('.singledp').length < 1 && $('#bookingform-home .checkinout_wrapper').is(':visible') && $('#bookingform-home').hasClass('selection-finished')) { 1507 $('#bookingform-home .checkinout_wrapper').hide(); 1508 $('#bookingform-home').removeClass('selection-finished'); 1509 } 1510 1511 }).keydown(function(e) { 1512 1513 // Gallery popin 1514 if($('#gallery_popin').hasClass('shown')) { 1515 switch(e.which) { 1516 case 37: 1517 $('.gallery_prev').trigger('click'); 1518 break; 1519 case 39: 1520 $('.gallery_next').trigger('click'); 1521 break; 1522 default: return; 1523 } 1524 e.preventDefault(); 1525 } 1526 1527 }); 1528 1529 } 1530 }); 1531 } 1532}, 50); 1533 1534var menuRender = function(state) { 1535 1536 if(state === true) { 1537 $($("#header nav > ul > li").get().reverse()).each(function() { 1538 if(!$(this).hasClass('hamburger')) { $(this).addClass('mobile-menu').insertAfter('#extended_menu > ul > li:first-child'); } 1539 }); 1540 } else { 1541 $($("#extended_menu li.mobile-menu").get().reverse()).each(function() { 1542 $(this).removeClass('mobile-menu').prependTo('#header nav > ul'); 1543 }); 1544 } 1545 1546}; 1547 1548var mobileRender = function(state) { 1549 1550 if(state === true) { 1551 1552 _is_mobile = true; 1553 1554 $('#hotel_address').insertBefore('#intro div.quote'); 1555 1556 menuRender(true); 1557 1558 $('#social div.text').insertBefore('.fb-social-container'); 1559 1560 $('#lang').on('click', function() { 1561 $('.book_overlay').addClass('shown').show(); 1562 $('.book_overlay').on('tap', function() { 1563 $(this).removeClass('shown'); 1564 $.fancybox.close(); 1565 }); 1566 }); 1567 1568 if($('.mobile_book_button').length === 0) { $('#book_button').wrap('<div class="mobile_book_button"></div>'); } 1569 $('#book_button').text($('#book_button').data('wording'));
1570 1571 $(window).bind('scrollstart', function() { 1572 $('.mobile_book_button').addClass('hide'); 1573 }).bind('scrollstop', function() { 1574 $('.mobile_book_button').removeClass('hide'); 1575 }); 1576 1577 if(!$('html').hasClass('landscape')) { 1578 $('div.mobile_apps').insertBefore('div.newsletter'); 1579 } 1580 1581 if($('#rooms-filter ul').length > 0) { 1582 $('#rooms-filter ul').hide(); 1583 var _select = $('<select></select>'); 1584 _select.appendTo('#rooms-filter > div'); 1585 $('#rooms-filter li').each(function() { 1586 var _option = $('<option value="'+$(this).data('type')+'">'+$(this).text()+'</option>'); 1587 _option.prependTo(_select); 1588 }); 1589 _select.on('change', function() { 1590 $('.roomtype li').hide(); 1591 if($(this).val() === 'all') { 1592 $('.roomtype li').show(); 1593 } else { 1594 $('.roomtype li.'+$(this).val()).show(); 1595 } 1596 }); 1597 } 1598 1599 // restaurant || meeting single page form 1600 function updateForm(_content, _form, _lang, _title) { 1601 1602 $('input[name="restaurant"]').val(_title); 1603 $('#form_date').datepicker('destroy').prop('type','date'); 1604 1605 if($('#g-recaptcha').length > 0 && $('#g-recaptcha').find('iframe').length == 0) { 1606 var _key = $('#g-recaptcha').attr('data-sitekey'); 1607 1608 grecaptcha.render('g-recaptcha', { 'sitekey' : _key }); 1609 } 1610 1611 $('form.form').on('submit', function(e) { 1612 e.preventDefault(); 1613 var form = $(this); 1614 var post_id = $('meta[name=accor_post_id]').attr('content'); 1615 if (form.find('input[type=file]').length > 0) { 1616 formDataUpload(form, _form, post_id, function(response){ 1617 if (formResponseContainsSuccess(response)) { 1618 form.trigger('accor_event.form_success'); 1619 } 1620 $('#' + _form + '_form').html(response); 1621 $(this).find('input[type=submit]').removeAttr('disabled'); 1622 updateForm(response, _form, _lang, _title); 1623 }); 1624 } else { 1625 var data = $('form.form').serialize() + '&action=hotel_form&form=' + _form + '&lang=' + _lang; 1626 // $(this).find('input[type=submit]').attr('disabled', 'disabled'); 1627 if (post_id && post_id !== '0') { 1628 data = data + '&source_post_id=' + post_id; 1629 } 1630 $(this).hide(); 1631 jQuery.post(ajax_url, data, function (response) { 1632 if (formResponseContainsSuccess(response)) { 1633 form.trigger('accor_event.form_success'); 1634 } 1635 $('#' + _form + '_form').html(response); 1636 $(this).find('input[type=submit]').removeAttr('disabled'); 1637 updateForm(response, _form, _lang, _title); 1638 }); 1639 return false; 1640 } 1641 }); 1642 1643 } 1644 1645 $('a[data-form]').each(function() { 1646 var _slef = $(this); 1647 var _html = $(this).parents('div').first(); 1648 var _form = $(this).data('form'); 1649 var _title = $(this).data('post'); 1650 var _id = $(this).data('id'); 1651 var data = { 'action': 'hotel_form', 'form': _form, 'title': _title, 'restaurant_post_id': _id, lang: _lang }; 1652 var post_id = $('meta[name=accor_post_id]').attr('content'); 1653 if (post_id && post_id !== '0') { 1654 data.source_post_id = post_id; 1655 } 1656 jQuery.get(ajax_url, data, function(response) { 1657 if($('body').hasClass('page-template-template-restaurant')) { 1658 $('#restaurant').after(response); } 1659 else { $(_html).append(response); 1660 } 1661 updateForm(response, _form, _lang, _title); 1662 if( typeof(xiti_tracking) !== 'undefined' ) { xiti_tracking(); } 1663 _slef.hide(); 1664 }); 1665 return false; 1666 }); 1667 1668 } else { 1669 1670 _is_mobile = false; 1671 1672 $('#hotel_address').insertAfter('#intro'); 1673 $('#rooms-filter select').remove(); 1674 $('#rooms-filter ul').show(); 1675 $('ul.mobile_apps').appendTo('#footer > div.w-container div.mobile_apps'); 1676 menuRender(false); 1677 $('#social div.text').insertAfter($($('div.fb-social-widget')[0])); 1678 $('a[data-form]').each(function() { 1679 $(this).show(); 1680 $(this).next('div[class*="_form"]').remove(); 1681 }); 1682 1683 } 1684} 1685 1686var makeGallery = function() { 1687 1688 $('.fancy.video > a').each(function() { 1689 var _img = $(this).find('img'); 1690 _img.css({ 1691 'height': _img.data('height'), 1692 'width': _img.data('width'), 1693 'margin': '-'+_img.data('height')/2+'px 0px 0px -'+_img.data('width')/2+'px', 1694 'opacity': 1 1695 }); 1696 }); 1697 $('#gallery-photo ul > li').removeClass('first').removeClass('last'); 1698 1699 var cssMargin = parseFloat($('#gallery-photo ul > li').first().css('margin-right')); 1700 var containerWidth = $(window).innerWidth() - 20; 1701 var imageWidth = $('#gallery-photo ul > li').first().innerWidth(); 1702 var nImages = $('#gallery-photo ul > li').length; 1703 var imageFullWidth = imageWidth + 2*cssMargin; 1704 var imagesPerPage = Math.floor((containerWidth+2*cssMargin)/imageFullWidth);
1705 var pages = Math.ceil(nImages/imagesPerPage); 1706 1707 if (imagesPerPage * imageFullWidth - 2 * cssMargin < containerWidth) { 1708 containerWidth = containerWidth - (containerWidth - Math.min(imagesPerPage, nImages) * imageFullWidth + 2 * cssMargin); 1709 } 1710 $('#gallery-photo > div').width(containerWidth); 1711 1712 $('#gallery-photo > div > ul').css('width', nImages * imageFullWidth); 1713 1714 $('#gallery-photo ul > li').each(function(n) { 1715 switch ((n+1) % imagesPerPage) { 1716 case 0: 1717 $(this).addClass('last'); 1718 break; 1719 case 1: 1720 $(this).addClass('first'); 1721 break; 1722 } 1723 // mobile 1724 if (imagesPerPage == 1) { 1725 $(this).addClass('first'); 1726 } 1727 }); 1728 1729 var _current = 0; 1730 $('#gallery-photo ul').css('left',0); 1731 if(pages > 1) { 1732 $('#gallery-photo span.shadow span').show(); 1733 $('#gallery-photo span.shadow.left span').hide(); 1734 } else { 1735 $('#gallery-photo span.shadow').hide(); 1736 } 1737 function galleryMoveLeft() { 1738 _current--; 1739 var _self = $(this); 1740 $('#gallery-photo span.shadow').hide(); 1741 if(_is_mobile && _current < 0) { 1742 _current = nImages - 1; 1743 } 1744 $('#gallery-photo ul').stop(true, true).animate({'left' : -$($('#gallery-photo li.first').get(_current)).position().left}, function() { 1745 $('#gallery-photo span.shadow, #gallery-photo span.shadow span').show(); 1746 if(_current <= 0) { 1747 _self.hide(); 1748 } 1749 }); 1750 } 1751 function galleryMoveRight() { 1752 _current++; 1753 var _self = $(this); 1754 $('#gallery-photo span.shadow').hide(); 1755 if(_is_mobile && _current >= nImages) { 1756 _current = 0; 1757 } 1758 $('#gallery-photo ul').stop(true, true).animate({'left' : -$($('#gallery-photo li.first').get(_current)).position().left}, function() { 1759 $('#gallery-photo span.shadow, #gallery-photo span.shadow span').show(); 1760 if (pages === _current +1) { 1761 _self.hide(); 1762 $(' #gallery-photo span.shadow.right').hide(); 1763 } 1764 }); 1765 } 1766 $('#gallery-photo span.shadow.left span').unbind('click', galleryMoveLeft); 1767 $('#gallery-photo span.shadow.right span').unbind('click', galleryMoveRight); 1768 if(pages > 1) { 1769 $('#gallery-photo span.shadow.left span').bind('click', galleryMoveLeft); 1770 $('#gallery-photo span.shadow.right span').bind('click',galleryMoveRight); 1771 $('#gallery-photo > div').on('swipeleft', galleryMoveRight); 1772 $('#gallery-photo > div').on('swiperight', galleryMoveLeft); 1773 } 1774} 1775 1776var galleryPopin = function(id, panel, category) { 1777 if (typeof category === 'undefined') { 1778 category = false; 1779 } 1780 $.ajax({ 1781 type : "GET", 1782 data : { 'action' : 'gallery', 'lang' : ((_lang !== undefined) ? _lang : 'en'), 'test_rebrand': location.href.indexOf('test_rebrand') !== -1 ? 1 : undefined }, 1783 url: ajax_url, 1784 error: function() { 1785 if(window.console && console.log) { console.log( "error while getting the gallery data !" ); } 1786 }, 1787 success: function(gallery) { 1788 if( gallery !== 'error' ) { gallery_html = gallery; } 1789 else { if(window.console && console.log) { console.log( "error during success while getting the gallery data !" ); } } 1790 }, 1791 complete: function() { 1792 if(gallery_html !== undefined) { 1793 1794 $('.main_slideshow ul.cycle').cycle('pause'); 1795 1796 var gallery_current = 0; 1797 1798 $('html, body').css('overflow', 'hidden'); 1799 $('#gallery_popin').html(gallery_html); 1800 1801 $('#gallery_categories li').each(function() { 1802 $(this).on('click', function() { 1803 $('#gallery_categories li').removeClass('active'); 1804 $(this).addClass('active'); 1805 var _tag = $(this).data('tag'); 1806 $container.width(_width); 1807 if(_tag !== undefined) { $container.isotope({filter : '.'+ _tag}); } 1808 else { $container.isotope({ filter: '*' }); } 1809 $('.gallery_info').text($(this).text()); 1810 if(_is_mobile === true && $('html').hasClass('portrait')) { 1811 $('.gallery_menu').trigger('click'); 1812 } 1813 }); 1814 }); 1815 1816 var _width = $('#gallery_thumbnails_ctx li:visible').length * $('#gallery_thumbnails_ctx li:visible').outerWidth(true); 1817 var $container = $('#gallery_thumbnails_ctx > ul'); 1818 $container.width(_width); 1819 $container.isotope({ 1820 itemSelector : '.thumb', 1821 layoutMode : 'masonry', 1822 isOriginLeft : ($('body').hasClass('rtl')) ? false : true 1823 }); 1824 $container.on('arrangeComplete', function( event, filteredItems ) { 1825 $('#gallery_caption i.gallery_total').text($('#gallery_thumbnails_ctx li[data-type!="video"]:visible').length - $('#gallery_thumbnails_ctx li[data-type="virtual"]:visible').length); 1826 gallery_current = 0; 1827 $($('#gallery_thumbnails_ctx li:visible').get(gallery_current)).trigger('click'); 1828 }); 1829 1830 $('#gallery_thumbnails_ctx li').each(function() { 1831 $(this).on('click', function() { 1832 1833 var _self = $(this); 1834 var _caption = _self.data('caption'); 1835 var _category = _self.data('cat'); 1836 gallery_current = $('#gallery_thumbnails_ctx li:visible').index(this); 1837 1838 if(gallery_current <= 0) { $('.gallery_prev').hide(); $('.gallery_next').show(); } 1839 else if(gallery_current+1 >= $('#gallery_thumbnails_ctx li:visible').length) { $('.gallery_next').hide(); $('.gallery_prev').show(); } 1840 else { $('.gallery_next, .gallery_prev').show(); } 1841 1842 $('#gallery_thumbnails_ctx li').removeClass('current'); 1843 _self.addClass('current'); 1844 1845 $('#gallery_preview > img.resp, #gallery_preview > iframe').fadeOut(750, function() { $(this).remove(); }); 1846 1847 if(_self.data('type') == 'image') { 1848 var _img = new Image(); 1849 _img.onload = function() { 1850 var _image = $(_img).addClass('resp'); 1851 _image.prependTo($('#gallery_preview')); 1852 $('#gallery_preview').resizeCenter({onLoad: function() { 1853 $('#gallery_preview > img.resp').animate({'opacity' : 1}); 1854 $('#gallery_caption').show(); 1855 var _index = $('#gallery_thumbnails_ctx li[data-type!="video"]:visible').not( '[data-type="virtual"]' ).index(_self.get(0))+1; 1856 $('#gallery_caption i.gallery_current').text(_index); 1857 $('#gallery_caption strong').text(_caption); 1858 $('#gallery_caption span').text(_category); 1859 $('.gallery_info').text(_category); 1860 }}); 1861 }; 1862 _img.src = $(this).data('big'); 1863 } else if(_self.data('type') == 'virtual') { 1864 $('#gallery_caption').hide(); 1865 if(!($('#gallery_categories').hasClass('closed'))) { 1866 $('#gallery_categories').addClass('closed'); 1867 } 1868 var _iframe = $('<iframe width="100%" height="100%" src="'+ _self.data('big') +'" style="border:0" frameborder="0" allowfullscreen></iframe>'); 1869 if(_is_mobile === true && $('html').hasClass('portrait')) { 1870 var _mhv = $('#gallery_preview').innerHeight(), _mwv = $('#gallery_preview').innerWidth(); 1871 _iframe.css({ 1872 'width' : _mhv, 1873 'height' : _mwv, 1874 'left' : -(_mhv - _mwv) / 2, 1875 'bottom' : (_mhv - _mwv) / 2 1876 });
1877 } 1878 _iframe.prependTo($('#gallery_preview')); 1879 } else { 1880 $('#gallery_caption').hide(); 1881 var _video = $('<iframe width="100%" height="100%" src="https://www.youtube.com/embed/'+ _self.data('big') +'?showinfo=0&rel=0&modestbranding=1&autoplay=1&wmode=opaque" frameborder="0" allowfullscreen></iframe>'); 1882 if(_is_mobile === true && $('html').hasClass('portrait')) { 1883 var _mhv = $('#gallery_preview').innerHeight(), _mwv = $('#gallery_preview').innerWidth(); 1884 _video.css({ 1885 'width' : _mhv, 1886 'height' : _mwv, 1887 'left' : -(_mhv - _mwv) / 2, 1888 'bottom' : (_mhv - _mwv) / 2 1889 }); 1890 } 1891 _video.prependTo($('#gallery_preview')); 1892 } 1893 1894 var _center = $('#gallery_thumbnails_ctx').innerWidth() / _self.outerWidth(true) / 2; 1895 $('#gallery_thumbnails_ctx').animate({scrollLeft : _self.position().left - _center*_self.innerWidth() }); 1896 }); 1897 }); 1898 1899 $('.gallery_menu').on('click', function() { 1900 if($('#gallery_categories').hasClass('closed')) { 1901 $('#gallery_categories').removeClass('closed'); 1902 $('#gallery_preview').removeClass('closed'); 1903 } else { 1904 $('#gallery_categories').addClass('closed'); 1905 $('#gallery_preview').addClass('closed'); 1906 } 1907 }); 1908 $('.gallery_next').on('click', function() { 1909 gallery_current = gallery_current + 1; 1910 $('.gallery_prev, .gallery_next').show(); 1911 $($('#gallery_thumbnails_ctx li:visible').get(gallery_current)).trigger('click'); 1912 }); 1913 $('.gallery_prev').on('click', function() { 1914 gallery_current = gallery_current - 1; 1915 $($('#gallery_thumbnails_ctx li:visible').get(gallery_current)).trigger('click'); 1916 }); 1917 $('#gallery_popin span.close').on('click', function() { 1918 $('#gallery_popin_ctx').fadeOut(750, function() { 1919 $('#gallery_popin').children().remove(); 1920 $('#gallery_popin').html('').removeClass('shown'); 1921 $('html, body').css('overflow', 'auto'); 1922 $('.main_slideshow ul.cycle').cycle('resume'); 1923 }); 1924 }); 1925 1926 if(gallery_current == 0) { $('.gallery_prev').hide(); } 1927 if(gallery_current+1 >= $('#gallery_thumbnails_ctx li:visible').length) { $('.gallery_next').hide(); } 1928 if(id === undefined) { id = 0; } 1929 if(panel !== undefined) { $('.gallery_menu').trigger('click'); } 1930 1931 $('#gallery_caption i.gallery_total').text($('#gallery_thumbnails_ctx li[data-type!="video"]:visible').length - $('#gallery_thumbnails_ctx li[data-type="virtual"]:visible').length); 1932 $($('#gallery_thumbnails_ctx li:visible').get(id)).trigger('click'); 1933 1934 $('#gallery_popin').addClass('shown'); 1935 1936 if (category) { 1937 $('#gallery_popin li[data-tag='+category+']').trigger('click'); 1938 } 1939 1940 $(window).resize(function() { 1941 if(_is_mobile === true && $('html').hasClass('portrait')) { 1942 var _mhv = $('#gallery_preview').innerHeight(), _mwv = $('#gallery_preview').innerWidth(); 1943 $('#gallery_preview iframe').css({ 1944 'width' : _mhv, 1945 'height' : _mwv, 1946 'left' : -(_mhv - _mwv) / 2, 1947 'bottom' : (_mhv - _mwv) / 2 1948 }); 1949 } 1950 }); 1951 1952 } 1953 } 1954 }); 1955 1956} 1957 1958/** 1959* Get YouTube ID from various YouTube URL 1960* @author: takien 1961* @url: http://takien.com 1962* For PHP YouTube parser, go here http://takien.com/864 1963*/ 1964 1965function YouTubeGetID(url){ 1966 var ID = ''; 1967 url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/); 1968 if(url[2] !== undefined) { ID = url[2].split(/[^0-9a-z_\-]/i); ID = ID[0]; } 1969 else { ID = url; } 1970 return ID; 1971} 1972 1973/*! 1974 * imagesLoaded PACKAGED v3.1.8 1975 * JavaScript is all like "You images are done yet or what?" 1976 * MIT License 1977 */ 1978 1979(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1
1979);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit
1979("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); 1980 1981/*! 1982 * Isotope PACKAGED v2.2.2 1983 * 1984 * Licensed GPLv3 for open source use 1985 * or Isotope Commercial License for commercial use 1986 * 1987 * http://isotope.metafizzy.co 1988 * Copyright 2015 Metafizzy 1989 */ 1990 1991!function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){"use strict";function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&-1===b(e[d],c)&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),-1!==d&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if(a instanceof RegExp)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g=this.getListenersAsObject(a);for(e in g)if(g.hasOwnProperty(e))for(d=g[e].length;d--;)c=g[e][d],c.once===!0&&this.removeListener(a,c.listener),f=c.listener.apply(this,b||[]),f===this._getOnceReturnValue()&&this.removeListener(a,c.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1
1991);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return a}):"object"==typeof module&&module.exports?module.exports=a:e.EventEmitter=a}.call(this),function(a){function b(a){if(a){if("string"==typeof d[a])return a;a=a.charAt(0).toUpperCase()+a.slice(1);for(var b,e=0,f=c.length;f>e;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a,b){function c(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function d(){}function e(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=h.length;c>b;b++){var d=h[b];a[d]=0}return a}function f(b){function d(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||g("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=b("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var f=document.body||document.documentElement;f.appendChild(e);var h=j(e);l=200===c(h.width),f.removeChild(e)}}}function f(a){if(d(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var b=j(a);if("none"===b.display)return e();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var g=f.isBorderBox=!(!k||!b[k]||"border-box"!==b[k]),m=0,n=h.length;n>m;m++){var o=h[m],p=b[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q}var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=g&&l,y=c(b.width);y!==!1&&(f.width=y+(x?0:r+v));var z=c(b.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}}function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c}var j,k,l,m=!1;return f}var g="undefined"==typeof console?d:function(a){console.error(a)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],f):"object"==typeof exports?module.exports=f(require("desandro-get-style-property")):a.getSize=f(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()}function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b}var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){"use strict";function b(a,b){return a[g](b)}function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}function e(a,d){return c(a),b(a,d)}var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"use strict";"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c}var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue}var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={}
1991,a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){"use strict";function f(a){for(var b in a)return!1;return b=null,!0}function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}function h(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}var i=a.getComputedStyle,j=i?function(a){return i(a,null)}:function(a){return a.currentStyle},k=d("transition"),l=d("transform"),m=k&&l,n=!!d("perspective"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[k],p=["transform","transition","transitionDuration","transitionProperty"],q=function(){for(var a={},b=0,c=p.length;c>b;b++){var e=p[b],f=d(e);f&&f!==e&&(a[e]=f)}return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=q[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=j(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=a[c?"left":"right"],f=a[d?"top":"bottom"],g=this.layout.size,h=-1!=e.indexOf("%")?parseFloat(e)/100*g.width:parseInt(e,10),i=-1!=f.indexOf("%")?parseFloat(f)/100*g.height:parseInt(f,10);h=isNaN(h)?0:h,i=isNaN(i)?0:i,h-=c?g.paddingLeft:g.paddingRight,i-=d?g.paddingTop:g.paddingBottom,this.position.x=h,this.position.y=i},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left":"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];c[e]=this.getXValue(g),c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];c[i]=this.getYValue(k),c[j]="",this.css(c),this.emitEvent("layout",[this])},g.prototype.getXValue=function(a){var b=this.layout.options;return b.percentPosition&&!b.isHorizontal?a/this.layout.size.width*100+"%":a+"px"},g.prototype.getYValue=function(a){var b=this.layout.options;return b.percentPosition&&b.isHorizontal?a/this.layout.size.height*100+"%":a+"px"},g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={};j.transform=this.getTranslate(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.getTranslate=function(a,b){var c=this.layout.options;return a=c.isOriginLeft?a:-a,b=c.isOriginTop?b:-b,n?"translate3d("+a+"px, "+b+"px, 0)":"translate("+a+"px, "+b+"px)"},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=m?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r="opacity,"+h(q.transform||"transform");g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(o,this,!1))},g.prototype.transition=g.prototype[k?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};
1991g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]}this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!k||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){"use strict";function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()}var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.get
1991Size()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)}this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.dispatchEvent(a+"Complete",null,[b])}function d(){g++,g===f&&c()}var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.dispatchEvent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitEvent(a,d),i)if(this.$element=this.$element||i(this.element),b){var e=i.Event(b);e.type=a,this.$element.trigger(e,c)}else this.$element.trigger(a,c)},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)}return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]}
1991,g.create=function(a,b){function c(){g.apply(this,arguments)}return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],b):"object"==typeof exports?module.exports=b(require("outlayer")):(a.Isotope=a.Isotope||{},a.Isotope.Item=b(a.Outlayer))}(window,function(a){"use strict";function b(){a.Item.apply(this,arguments)}b.prototype=new a.Item,b.prototype._create=function(){this.id=this.layout.itemGUID++,a.Item.prototype._create.call(this),this.sortData={}},b.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var a=this.layout.options.getSortData,b=this.layout._sorters;for(var c in a){var d=b[c];this.sortData[c]=d(this.element,this)}}};var c=b.prototype.destroy;return b.prototype.destroy=function(){c.apply(this,arguments),this.css({display:""})},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],b):"object"==typeof exports?module.exports=b(require("get-size"),require("outlayer")):(a.Isotope=a.Isotope||{},a.Isotope.LayoutMode=b(a.getSize,a.Outlayer))}(window,function(a,b){"use strict";function c(a){this.isotope=a,a&&(this.options=a.options[this.namespace],this.element=a.element,this.items=a.filteredItems,this.size=a.size)}return function(){function a(a){return function(){return b.prototype[a].apply(this.isotope,arguments)}}for(var d=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],e=0,f=d.length;f>e;e++){var g=d[e];c.prototype[g]=a(g)}}(),c.prototype.needsVerticalResizeLayout=function(){var b=a(this.isotope.element),c=this.isotope.size&&b;return c&&b.innerHeight!=this.isotope.size.innerHeight},c.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},c.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},c.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},c.prototype.getSegmentSize=function(a,b){var c=a+b,d="outer"+b;if(this._getMeasurement(c,d),!this[c]){var e=this.getFirstItemSize();this[c]=e&&e[d]||this.isotope.size["inner"+b]}},c.prototype.getFirstItemSize=function(){var b=this.isotope.filteredItems[0];return b&&b.element&&a(b.element)},c.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},c.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},c.modes={},c.create=function(a,b){function d(){c.apply(this,arguments)}return d.prototype=new c,b&&(d.options=b),d.prototype.namespace=a,c.modes[a]=d,d},c}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);
1991this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],b):"object"==typeof exports?module.exports=b(require("../layout-mode"),require("masonry-layout")):b(
1991a.Isotope.LayoutMode,a.Masonry)}(window,function(a,b){"use strict";function c(a,b){for(var c in b)a[c]=b[c];return a}var d=a.create("masonry"),e=d.prototype._getElementOffset,f=d.prototype.layout,g=d.prototype._getMeasurement; 1992c(d.prototype,b.prototype),d.prototype._getElementOffset=e,d.prototype.layout=f,d.prototype._getMeasurement=g;var h=d.prototype.measureColumns;d.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,h.call(this)};var i=d.prototype._manageStamp;return d.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,i.apply(this,arguments)},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],b):"object"==typeof exports?module.exports=b(require("../layout-mode")):b(a.Isotope.LayoutMode)}(window,function(a){"use strict";var b=a.create("fitRows");return b.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},b.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth+this.gutter,c=this.isotope.size.innerWidth+this.gutter;0!==this.x&&b+this.x>c&&(this.x=0,this.y=this.maxY);var d={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+a.size.outerHeight),this.x+=b,d},b.prototype._getContainerSize=function(){return{height:this.maxY}},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],b):"object"==typeof exports?module.exports=b(require("../layout-mode")):b(a.Isotope.LayoutMode)}(window,function(a){"use strict";var b=a.create("vertical",{horizontalAlignment:0});return b.prototype._resetLayout=function(){this.y=0},b.prototype._getItemLayoutPosition=function(a){a.getSize();var b=(this.isotope.size.innerWidth-a.size.outerWidth)*this.options.horizontalAlignment,c=this.y;return this.y+=a.size.outerHeight,{x:b,y:c}},b.prototype._getContainerSize=function(){return{height:this.y}},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","fizzy-ui-utils/utils","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],function(c,d,e,f,g,h){return b(a,c,d,e,f,g,h)}):"object"==typeof exports?module.exports=b(a,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("./item"),require("./layout-mode"),require("./layout-modes/masonry"),require("./layout-modes/fit-rows"),require("./layout-modes/vertical")):a.Isotope=b(a,a.Outlayer,a.getSize,a.matchesSelector,a.fizzyUIUtils,a.Isotope.Item,a.Isotope.LayoutMode)}(window,function(a,b,c,d,e,f,g){function h(a,b){return function(c,d){for(var e=0,f=a.length;f>e;e++){var g=a[e],h=c.sortData[g],i=d.sortData[g];if(h>i||i>h){var j=void 0!==b[g]?b[g]:b,k=j?1:-1;return(h>i?1:-1)*k}}return 0}}var i=a.jQuery,j=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^\s+|\s+$/g,"")},k=document.documentElement,l=k.textContent?function(a){return a.textContent}:function(a){return a.innerText},m=b.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});m.Item=f,m.LayoutMode=g,m.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),b.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var a in g.modes)this._initLayoutMode(a)},m.prototype.reloadItems=function(){this.itemGUID=0,b.prototype.reloadItems.call(this)},m.prototype._itemize=function(){for(var a=b.prototype._itemize.apply(this,arguments),c=0,d=a.length;d>c;c++){var e=a[c];e.id=this.itemGUID++}return this._updateItemsSortData(a),a},m.prototype._initLayoutMode=function(a){var b=g.modes[a],c=this.options[a]||{};this.options[a]=b.options?e.extend(b.options,c):c,this.modes[a]=new b(this)},m.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?void this.arrange():void this._layout()},m.prototype._layout=function(){var a=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,a),this._isLayoutInited=!0},m.prototype.arrange=function(a){function b(){d.reveal(c.needReveal),d.hide(c.needHide)}this.option(a),this._getIsInstant();var c=this._filter(this.items);this.filteredItems=c.matches;var d=this;this._bindArrangeComplete(),this._isInstant?this._noTransition(b):b(),this._sort(),this._layout()},m.prototype._init=m.prototype.arrange,m.prototype._getIsInstant=function(){var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=a,a},m.prototype._bindArrangeComplete=function(){function a(){b&&c&&d&&e.dispatchEvent("arrangeComplete",null,[e.filteredItems])}var b,c,d,e=this;this.once("layoutComplete",function(){b=!0,a()}),this.once("hideComplete",function(){c=!0,a()}),this.once("revealComplete",function(){d=!0,a()})},m.prototype._filter=function(a){var b=this.options.filter;b=b||"*";for(var c=[],d=[],e=[],f=this._getFilterTest(b),g=0,h=a.length;h>g;g++){var i=a[g];if(!i.isIgnored){var j=f(i);j&&c.push(i),j&&i.isHidden?d.push(i):j||i.isHidden||e.push(i)}}return{matches:c,needReveal:d,needHide:e}},m.prototype._getFilterTest=function(a){return i&&this.options.isJQueryFiltering?function(b){return i(b.element).is(a)}:"function"==typeof a?function(b){return a(b.element)}:function(b){return d(b.element,a)}},m.prototype.updateSortData=function(a){var b;a?(a=e.makeArray(a),b=this.getItems(a)):b=this.items,this._getSorters(),this._updateItemsSortData(b)},m.prototype._getSorters=function(){var a=this.options.getSortData;for(var b in a){var c=a[b];this._sorters[b]=n(c)}},m.prototype._updateItemsSortData=function(a){for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.updateSortData()}};var n=function(){function a(a){if("string"!=typeof a)return a;var c=j(a).split(" "),d=c[0],e=d.match(/^\[(.+)\]$/),f=e&&e[1],g=b(f,d),h=m.sortDataParsers[c[1]];return a=h?function(a){return a&&h(g(a))}:function(a){return a&&g(a)}}function b(a,b){var c;return c=a?function(b){return b.getAttribute(a)}:function(a){var c=a.querySelector(b);return c&&l(c)}}return a}();m.sortDataParsers={parseInt:function(a){return parseInt(a,10)},parseFloat:function(a){return parseFloat(a)}},m.prototype._sort=function(){var a=this.options.sortBy;if(a){var b=[].concat.apply(a,this.sortHistory),c=h(b,this.options.sortAscending);this.filteredItems.sort(c),a!=this.sortHistory[0]&&this.sortHistory.unshift(a)}},m.prototype._mode=function(){var a=this.options.layoutMode,b=this.modes[a];if(!b)throw new Error("No layout mode: "+a);return b.options=this.options[a],b},m.prototype._resetLayout=function(){b.prototype._resetLayout.call(this),this._mode()._resetLayout()},m.prototype._getItemLayoutPosition=function(a){return this._mode()._getItemLayoutPosition(a)},m.prototype._manageStamp=function(a){this._mode()._manageStamp(a)},m.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},m.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},m.prototype.appended=function(a){var b=this.addItems(a);if(b.length){var c=this._filterRevealAdded(b);this.filteredItems=this.filteredItems.concat(c)}},m.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){this._resetLayout(),this._manageStamps();var c=this._filterRevealAdded(b);this.layoutItems(this.filteredItems),this.filteredItems=c.concat(this.filteredItems),this.items=b.concat(this.items)}},m.prototype._filterRevealAdded=function(a){var b=this._filter(a);return this.hide(b.needHide),this.reveal(b.matches),this.layoutItems(b.matches,!0),b.matches},m.prototype.insert=function(a){var b=this.addItems(a);if(b.length){var c,d,e=b.length;for(c=0;e>c;c++)d=b[c],this.element.appendChild(d.element);var f=this._filter(b).matches;for(c=0;e>c;c++)b[c].isLayoutInstant=!0;for(this.arrange(),c=0;e>c;c++)delete b[c].isLayoutInstant;this.reveal(f)}};var o=m.prototype.remove;return m.prototype.remove=function(a){a=e.makeArray(a);var b=this.getItems(a);o.call(this,a);var c=b&&b.length;if(c)for(var d=0;c>d;d++){var f=b[d];e.removeFrom(this.filteredItems,f)}},m.prototype.shuffle=function(){for(var a=0,b=this.items.length;b>a;a++){var c=this.items[a];c.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},m.prototype._noTransition=function(a){var b=this.options.transitionDuration;this.options.transitionDuration=0;var c=a.call(this);return this.options.transitionDuration=b,c},m.prototype.getFilteredItemElements=function(){for(var a=[],b=0,c=this.filteredItems.length;c>b;b++)a.push(this.filteredItems[b].element);return a},m}); 1993 1994/*! device.js 0.2.7 */ 1995(function(){var a,b,c,d,e,f,g,h,i,j;b=window.device,a={},window.device=a,d=window.document.documentElement,j=window.navigator.userAgent.toLowerCase(),a.ios=function(){return a.iphone()||a.ipod()||a.ipad()},a.iphone=function(){return!a.windows()&&e("iphone")},a.ipod=function(){return e("ipod")},a.ipad=function(){return e("ipad")},a.android=function(){return!a.windows()&&e("android")},a.androidPhone=function(){return a.android()&&e("mobile")},a.androidTablet=function(){return a.android()&&!e("mobile")},a.blackberry=function(){return e("blackberry")||e("bb10")||e("rim")},a.blackberryPhone=function(){return a.blackberry()&&!e("tablet")},a.blackberryTablet=function(){return a.blackberry()&&e("tablet")},a.windows=function(){return e("windows")},a.windowsPhone=function(){return a.windows()&&e("phone")},a.windowsTablet=function(){return a.windows()&&e("touch")&&!a.windowsPhone()},a.fxos=function(){return(e("(mobile;")||e("(tablet;"))&&e("; rv:")},a.fxosPhone=function(){return a.fxos()&&e("mobile")},a.fxosTablet=function(){return a.fxos()&&e("tablet")},a.meego=function(){return e("meego")},a.cordova=function(){return window.cordova&&"file:"===location.protocol},a.nodeWebkit=function(){return"object"==typeof window.process}
1995,a.mobile=function(){return a.androidPhone()||a.iphone()||a.ipod()||a.windowsPhone()||a.blackberryPhone()||a.fxosPhone()||a.meego()},a.tablet=function(){return a.ipad()||a.androidTablet()||a.blackberryTablet()||a.windowsTablet()||a.fxosTablet()},a.desktop=function(){return!a.tablet()&&!a.mobile()},a.television=function(){var a;for(television=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","roku","pov_tv","hbbtv","ce-html"],a=0;a<television.length;){if(e(television[a]))return!0;a++}return!1},a.portrait=function(){return window.innerHeight/window.innerWidth>1},a.landscape=function(){return window.innerHeight/window.innerWidth<1},a.noConflict=function(){return window.device=b,this},e=function(a){return-1!==j.indexOf(a)},g=function(a){var b;return b=new RegExp(a,"i"),d.className.match(b)},c=function(a){var b=null;g(a)||(b=d.className.replace(/^\s+|\s+$/g,""),d.className=b+" "+a)},i=function(a){g(a)&&(d.className=d.className.replace(" "+a,""))},a.ios()?a.ipad()?c("ios ipad tablet"):a.iphone()?c("ios iphone mobile"):a.ipod()&&c("ios ipod mobile"):a.android()?c(a.androidTablet()?"android tablet":"android mobile"):a.blackberry()?c(a.blackberryTablet()?"blackberry tablet":"blackberry mobile"):a.windows()?c(a.windowsTablet()?"windows tablet":a.windowsPhone()?"windows mobile":"desktop"):a.fxos()?c(a.fxosTablet()?"fxos tablet":"fxos mobile"):a.meego()?c("meego mobile"):a.nodeWebkit()?c("node-webkit"):a.television()?c("television"):a.desktop()&&c("desktop"),a.cordova()&&c("cordova"),f=function(){a.landscape()?(i("portrait"),c("landscape")):(i("landscape"),c("portrait"))},h=Object.prototype.hasOwnProperty.call(window,"onorientationchange")?"orientationchange":"resize",window.addEventListener?window.addEventListener(h,f,!1):window.attachEvent?window.attachEvent(h,f):window[h]=f,f(),"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return a}):"undefined"!=typeof module&&module.exports?module.exports=a:window.device=a}).call(this); 1996 1997/*! jQuery Mobile v1.4.5 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */ 1998/*! ONLY TOUCH EVENTS */ 1999(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function T(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function N(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=T(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function C(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function k(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function L(){g=!1}function A(){g=!0}function O(){E=0,v.length=0,m=!1,A()}function M(){L()}function _(){D(),c=setTimeout(function(){c=0,O()},e.vmouse.resetTimerDuration)}function D(){c&&(clearTimeout(c),c=0)}function P(t,n,r){var i;if(r&&r[t]||!r&&k(n.target,t))i=N(n,t),e(n.target).trigger(i);return i}function H(t){var n=e.data(t.target,s),r;!m&&(!E||E!==n)&&(r=P("v"+t.type,t),r&&(r.isDefaultPrevented()&&t.preventDefault(),r.isPropagationStopped()&&t.stopPropagation(),r.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function B(t){var n=T(t).touches,r,i,o;n&&n.length===1&&(r=t.target,i=C(r),i.hasVirtualBinding&&(E=w++,e.data(r,s,E),D(),M(),d=!1,o=T(t).touches[0],h=o.pageX,p=o.pageY,P("vmouseover",t,i),P("vmousedown",t,i)))}function j(e){if(g)return;d||P("vmousecancel",e,C(e.target)),d=!0,_()}function F(t){if(g)return;var n=T(t).touches[0],r=d,i=e.vmouse.moveDistanceThreshold,s=C(t.target);d=d||Math.abs(n.pageX-h)>i||Math.abs(n.pageY-p)>i,d&&!r&&P("vmousecancel",t,s),P("vmousemove",t,s),_()}function I(e){if(g)return;A();var t=C(e.target),n,r;P("vmouseup",e,t),d||(n=P("vclick",e,t),n&&n.isDefaultPrevented()&&(r=T(e).changedTouches[0],v.push({touchID:E,x:r.clientX,y:r.clientY}),m=!0)),P("vmouseout",e,t),d=!1,_()}function q(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function R(){}function U(t){var n=t.substr(1);return{setup:function(){q(this)||e.data(this,i,{});var r=e.data(this,i);r[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,H),e(this).bind(n,R),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",B).bind("touchend",I).bind("touchmove",F).bind("scroll",j))},teardown:function(){--l[t],l[t]||b.unbind(n,H),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",B).unbind("touchmove",F).unbind("touchend",I).unbind("scroll",j));var r=e(this),s=e.data(this,i);s&&(s[t]=!1),r.unbind(n,R),q(this)||r.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S,x;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(x=0;x<o.length;x++)e.event.special[o[x]]=U(o[x]);y&&n.addEventListener("click",function(t){var n=v.length,r=t.target,i,o,u,a,f,l;if(n){i=t.clientX,o=t.clientY,S=e.vmouse.clickDistanceThreshold,u=r;while(u){for(a=0;a<n;a++){f=v[a],l=0;if(u===r&&Math.abs(f.x-i)<S&&Math.abs(f.y-o)<S||e.data(u,s)===f.touchID){t.preventDefault(),t.stopPropagation();return}}u=u.parentNode}}},!0)})(e,t,n),function(e){e.mobile={}}(e),function(e,t){var r={touch:"ontouchend"in n};
1999e.mobile.support=e.mobile.support||{},e.extend(e.support,r),e.extend(e.mobile.support,r)}(e),function(e,t,r){function l(t,n,i,s){var o=i.type;i.type=n,s?e.event.trigger(i,r,t):e.event.dispatch.call(t,i),i.type=o}var i=e(n),s=e.mobile.support.touch,o="touchmove scroll",u=s?"touchstart":"mousedown",a=s?"touchend":"mouseup",f=s?"touchmove":"mousemove";e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function s(e,n){r=n,l(t,r?"scrollstart":"scrollstop",e)}var t=this,n=e(t),r,i;n.bind(o,function(t){if(!e.event.special.scrollstart.enabled)return;r||s(t,!0),clearTimeout(i),i=setTimeout(function(){s(t,!1)},50)})},teardown:function(){e(this).unbind(o)}},e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,n=e(t),r=!1;n.bind("vmousedown",function(s){function a(){clearTimeout(u)}function f(){a(),n.unbind("vclick",c).unbind("vmouseup",a),i.unbind("vmousecancel",f)}function c(e){f(),!r&&o===e.target?l(t,"tap",e):r&&e.preventDefault()}r=!1;if(s.which&&s.which!==1)return!1;var o=s.target,u;n.bind("vmouseup",a).bind("vclick",c),i.bind("vmousecancel",f),u=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(r=!0),l(t,"taphold",e.Event("taphold",{target:o}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),i.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(e){var n=t.pageXOffset,r=t.pageYOffset,i=e.clientX,s=e.clientY;if(e.pageY===0&&Math.floor(s)>Math.floor(e.pageY)||e.pageX===0&&Math.floor(i)>Math.floor(e.pageX))i-=n,s-=r;else if(s<e.pageY-r||i<e.pageX-n)i=e.pageX-n,s=e.pageY-r;return{x:i,y:s}},start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y],origin:e(t.target)}},stop:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y]}},handleSwipe:function(t,n,r,i){if(n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.
1999coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var s=t.coords[0]>n.coords[0]?"swipeleft":"swiperight";return l(r,"swipe",e.Event("swipe",{target:i,swipestart:t,swipestop:n}),!0),l(r,s,e.Event(s,{target:i,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,r=e(n),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(e.event.special.swipe.eventInProgress)return;e.event.special.swipe.eventInProgress=!0;var r,o=e.event.special.swipe.start(t),u=t.target,l=!1;s.move=function(t){if(!o||t.isDefaultPrevented())return;r=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(o,r,n,u),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(o.coords[0]-r.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,i.off(f,s.move),s.move=null},i.on(f,s.move).one(a,s.stop)},r.on(u,s.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,t.length--,t.length===0&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(u,n.start),n.move&&i.off(f,n.move),n.stop&&i.off(a,n.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}})}(e,this)}); 2000 2001 2002// Sticky Book button for Restaurant and Special offers 2003(function($){ 2004 $(document).ready(function() { 2005 // Restaurant 2006 if ($(document.body).hasClass('page-template-template-restaurant')) { 2007 var bookatable_button = $('.subnav a.restaurant_order'); 2008 if (bookatable_button.length > 0) { 2009 // Mobile 2010 var mobileButton = $('<a>', { 2011 href: '#', 2012 class: 'btn mobile_table_booking_link', 2013 text: bookatable_button.text() 2014 }); 2015 $('#book_button').remove(); 2016 mobileButton.appendTo('#container'); 2017 mobileButton.click(function(e) { 2018 e.preventDefault(); 2019 $('a[data-form=restaurant]').trigger('accor_event.open_form'); 2020 if (bookatable_button.attr('href').match(/^https?:\/\/.+/)) { 2021 window.open(bookatable_button.attr('href'), '_blank'); 2022 } else { 2023 $('html,body').stop().animate({ 2024 'scrollTop': $('#restaurant_form').offset().top 2025 }); 2026 } 2027 }); 2028 } 2029 } 2030 2031 // Offer 2032 if ($(document.body).hasClass('single-offers')) { 2033 var header_book_btn = $('#book_button'); 2034 var offer_book_btn = $('.single_offer #bookingform .submit_button'); 2035 var has_booking_form = $('.single_offer #bookingform').length > 0; 2036 var custom_button = $('.offer_custom_button a'); 2037 var links_to_restaurant_page = $('.offer_restaurant_button_container').length > 0; 2038 var has_custom_button_form = custom_button.length > 0 && custom_button.attr('href') == 'javascript:;'; 2039 var has_custom_button_link = custom_button.length > 0 && (!! custom_button.attr('href').match(/^https?:\/\/.+/)); 2040 var is_bookable = ( has_booking_form || links_to_restaurant_page || has_custom_button_form || has_custom_button_link ); 2041 if (is_bookable) { 2042 var book_offer_text = ''; 2043 if (has_booking_form) { 2044 book_offer_text = $.trim($('#bookingform > strong:first-child').text()); 2045 } else if (links_to_restaurant_page) { 2046 book_offer_text = $.trim($('.offer_restaurant_button_container').find('a').eq(0).text()); 2047 } else if (has_custom_button_form || has_custom_button_link) { 2048 book_offer_text = $.trim(custom_button.text()); 2049 } 2050 if (book_offer_text == '') { 2051 book_offer_text = 'Book this offer'; 2052 } 2053 if ($(window).width() > 767) { 2054 book_offer_text = header_book_btn.text(); 2055 } 2056 // Desktop + Mobile (mobile/custom.js moves this to the right place when on mobile) 2057 var newButton = $('<a>', { 2058 href: '#', 2059 id: 'book_button', 2060 'data-wording': offer_book_btn.val(), 2061 text: book_offer_text, 2062 class: 'sticky_offer_book_desktop '+ ( !has_booking_form ? 'dontopenbookingform' : '' ) 2063 }); 2064 header_book_btn.remove(); 2065 if (hiddenButton !== '1') { 2066 newButton.prependTo('#header nav'); 2067 } 2068 newButton.off('click'); 2069 newButton.click(function(e) { 2070 if (has_booking_form) { 2071 $('#preferredCode_dp').val($('#bookingform #preferredCode').val()); 2072 } else if (links_to_restaurant_page) { 2073 location.href = $('.offer_restaurant_button_container').find('a').eq(0).attr('href'); 2074 } else if (has_custom_button_form ) { 2075 if ($('html').hasClass('mobile')) { 2076 $('html,body').stop().animate({ 2077 'scrollTop': $('.pop_form').offset().top - $('#header').height() 2078 });
2079 } else { 2080 custom_button.trigger('click'); 2081 } 2082 } else if (has_custom_button_link) { 2083 window.open(custom_button.attr('href'), '_blank'); 2084 } 2085 }); 2086 } 2087 } 2088 }); 2089})(jQuery); 2090 2091// Inject Language picker as nav menu item 2092(function($){ 2093 $(document).ready(function() { 2094 if ($('#lang ul.languages li').not('.select').length < 2) { return; } 2095 var selected_lang_link = $('.languages .lang_sel_sel'); 2096 if (selected_lang_link.length > 0) { 2097 var lang_li = selected_lang_link.closest('li'); 2098 if (lang_li.length > 0) { 2099 var re = /icl-([a-z-]+)/; 2100 var cl = lang_li.attr('class'); 2101 if (re.test(cl)) { 2102 var matches = cl.match(re); 2103 if (matches && matches[1]) { 2104 var newLi = $('<li/>', { 2105 'class': 'external_lang_switcher menu-main__li set', 2106 }).append($('<a/>', { 2107 href: 'javascript:;', 2108 class: 'menu-main__a', 2109 title: (typeof _choose_language !== 'undefined') ? _choose_language : 'Choose Language', 2110 text: matches[1].toUpperCase() + ' â¼' 2111 })); 2112 newLi.insertBefore($('.menu-main__li--hamburger')); 2113 newLi.click(function() { 2114 $('#lang').trigger('click'); 2115 }); 2116 } 2117 } 2118 } 2119 } 2120 }); 2121})(jQuery);
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.