( function($){$.fn.picturefill = function(user_options){return this.each(function(){var $this = $(this);$this.find('[data-picture=""]').each(function(){var $dataPicture = $(this);var matchesAr = [];$dataPicture.find('div[data-src!=""]').each(function(){var $dataMedia = $(this);var media = $dataMedia.data('media');if( (media == undefined) || (window.matchMedia && window.matchMedia( media ).matches)){matchesAr.push($dataMedia)}});var $img = $dataPicture.find('img');if(matchesAr.length){if($img.length > 0){$img.attr('src', matchesAr.pop().data('src'))}else{var $newImg = $('').attr('alt', $dataPicture.data('alt')).attr('title', $dataPicture.data('title'));if( $dataPicture.data('class') != "" ) $newImg.addClass($dataPicture.data('class'));if( $dataPicture.data('width') != "" ) $newImg.attr('width', $dataPicture.data('width'));if( $dataPicture.data('position') != "" ) $newImg.css('position', $dataPicture.data('position'));var src = matchesAr.pop().data('src');$newImg.attr('src', src);$dataPicture.append($newImg)}$dataPicture.imagesLoaded(function(){$dataPicture.imageFrame()})}})})}})(jQuery);;(function($, undefined){'use strict';var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';$.fn.imagesLoaded = function( callback ){var $this = this,deferred = $.isFunction($.Deferred) ? $.Deferred() :0,hasNotify = $.isFunction(deferred.notify),$images = $this.find('img').add( $this.filter('img') ),loaded = [],proper = [],broken = [];if ($.isPlainObject(callback)){$.each(callback, function (key, value){if (key === 'callback'){callback = value} else if (deferred){deferred[key](value)}})}function doneLoading(){var $proper = $(proper),$broken = $(broken);if ( deferred ){if ( broken.length ){deferred.reject( $images, $proper, $broken )} else{deferred.resolve( $images )}}if ( $.isFunction( callback ) ){callback.call( $this, $images, $proper, $broken )}}function imgLoadedHandler( event ){imgLoaded( event.target, event.type === 'error' )}function imgLoaded( img, isBroken ){if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ){return}loaded.push( img );if ( isBroken ){broken.push( img )} else{proper.push( img )}$.data( img, 'imagesLoaded',{ isBroken:isBroken, src:img.src } );if ( hasNotify ){deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] )}if ( $images.length === loaded.length ){setTimeout( doneLoading );$images.unbind( '.imagesLoaded', imgLoadedHandler )}}if ( !$images.length ){doneLoading()} else{$images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoadedHandler ).each( function( i, el ){var src = el.src;var cached = $.data( el, 'imagesLoaded' );if ( cached && cached.src === src ){imgLoaded( el, cached.isBroken );return}if ( el.complete && el.naturalWidth !== undefined ){imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 );return}if ( el.readyState || el.complete ){el.src = BLANK;el.src = src}})}return deferred ? deferred.promise( $this ) :$this}})(jQuery);(function($){function img(url){var i = new Image;i.src = url;return i}if ('naturalWidth' in (new Image)){$.fn.naturalWidth= function(){ return this[0].naturalWidth};$.fn.naturalHeight = function(){ return this[0].naturalHeight};return}$.fn.naturalWidth= function(){ var ie = img(this[0].src);if(ie.complete){return ie.width}else{$(ie).load(function(){return ie.width})}return img(this.src).width};$.fn.naturalHeight = function(){ var ie = img(this[0].src);if(ie.complete){return ie.height}else{$(ie).load(function(){return ie.height})}return img(this.src).height}})(jQuery);(function($){$.attrFn = $.attrFn ||{};var isChromeDesktop = ((navigator.userAgent.toLowerCase().indexOf('chrome') > -1) && ( (navigator.userAgent.toLowerCase().indexOf('windows') > -1) || (navigator.userAgent.toLowerCase().indexOf('macintosh') > -1) || (navigator.userAgent.toLowerCase().indexOf('linux') > -1)));var settings ={swipe_h_threshold :50,swipe_v_threshold :50,taphold_threshold :750,doubletap_int:500,touch_capable:('ontouchstart' in document.documentElement && navigator.userAgent.toLowerCase().indexOf('chrome') == -1),orientation_support:('orientation' in window && 'onorientationchange' in window),startevent:('ontouchstart' in document.documentElement && !isChromeDesktop) ? 'touchstart' :'mousedown',endevent:('ontouchstart' in document.documentElement && !isChromeDesktop) ? 'touchend' :'mouseup',moveevent:('ontouchstart' in document.documentElement && !isChromeDesktop) ? 'touchmove' :'mousemove',tapevent:('ontouchstart' in document.documentElement && !isChromeDesktop) ? 'tap' :'click',scrollevent:('ontouchstart' in document.documentElement && !isChromeDesktop) ? 'touchmove' :'scroll',hold_timer:null,tap_timer:null};$.each(('tapstart tapend tap singletap doubletap taphold swipe swipeup swiperight swipedown swipeleft scrollstart scrollend orientationchange').split(' '), function(i, name){$.fn[name] = function(fn){return fn ? this.bind(name, fn) :this.trigger(name)};$.attrFn[name] = true});$.event.special.tapstart ={setup:function(){var thisObject = this,$this = $(thisObject);$this.bind(settings.startevent, function(e){if(e.which && e.which !== 1){return false}else{triggerCustomEvent(thisObject, 'tapstart', e);return true}})}};$.event.special.tapend ={setup:function(){var thisObject = this,$this = $(thisObject);$this.bind(settings.endevent, function(e){triggerCustomEvent(thisObject, 'tapend', e);return true})}};$.event.special.taphold ={setup:function(){var thisObject = this,$this = $(thisObject),origTarget,timer,start_pos ={ x :0, y :0 };$this.bind(settings.startevent, function(e){if(e.which && e.which !== 1){return false}else{$this.data('tapheld', false);origTarget = e.target;start_pos.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX :e.pageX;start_pos.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY :e.pageY;settings.hold_timer = window.setTimeout(function(){var end_x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX :e.pageX,end_y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY :e.pageY;if(e.target == origTarget && (start_pos.x == end_x && start_pos.y == end_y)){$this.data('tapheld', true);triggerCustomEvent(thisObject, 'taphold', e)}}, settings.taphold_threshold);return true}}).bind(settings.endevent, function(){$this.data('tapheld', false);window.clearTimeout(settings.hold_timer)})}};$.event.special.doubletap ={setup:function(){var thisObject = this,$this = $(thisObject),origTarget,action;$this.bind(settings.startevent, function(e){if(e.which && e.which !== 1){return false}else{$this.data('doubletapped', false);origTarget = e.target;return true}}).bind(settings.endevent, function(e){var now = new Date().getTime();var lastTouch = $this.data('lastTouch') || now + 1;var delta = now - lastTouch;window.clearTimeout(action);if(delta < settings.doubletap_int && delta > 0 && (e.target == origTarget) && delta > 100){$this.data('doubletapped', true);window.clearTimeout(settings.tap_timer);triggerCustomEvent(thisObject, 'doubletap', e)}else{$this.data('lastTouch', now);action = window.setTimeout(function(e){ window.clearTimeout(action)}, settings.doubletap_int, [e])}$this.data('lastTouch', now)})}};$.event.special.singletap ={setup:function(){var thisObject = this,$this = $(thisObject),origTarget = null, startTime = null, start_pos ={ x:0, y:0 };$this.bind(settings.startevent, function(e){if(e.which && e.which !== 1){return false}else{startTime = new Date().getTime();origTarget = e.target;start_pos.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX :e.pageX;start_pos.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY :e.pageY;return true}}).bind(settings.endevent, function(e){if(e.target == origTarget){end_pos_x = (e.originalEvent.changedTouches) ? e.originalEvent.changedTouches[0].pageX :e.pageX;end_pos_y = (e.originalEvent.changedTouches) ? e.originalEvent.changedTouches[0].pageY :e.pageY;settings.tap_timer = window.setTimeout(function(){if(!$this.data('doubletapped') && !$this.data('tapheld') && (start_pos.x == end_pos_x) && (start_pos.y == end_pos_y)){triggerCustomEvent(thisObject, 'singletap', e)}}, settings.doubletap_int)}})}};$.event.special.tap ={setup:function(){var thisObject = this,$this = $(thisObject),started = false,origTarget = null,start_time,start_pos ={ x :0, y :0 };$this.bind(settings.startevent, function(e){if(e.which && e.which !== 1){return false}else{started = true;start_pos.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX :e.pageX;start_pos.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY :e.pageY;start_time = new Date().getTime();origTarget = e.target;return true}}).bind(settings.endevent, function(e){var end_x = (e.originalEvent.targetTouches) ? e.originalEvent.changedTouches[0].pageX :e.pageX,end_y = (e.originalEvent.targetTouches) ? e.originalEvent.changedTouches[0].pageY :e.pageY;if(origTarget == e.target && started && ((new Date().getTime() - start_time) < settings.taphold_threshold) && (start_pos.x == end_x && start_pos.y == end_y)){triggerCustomEvent(thisObject, 'tap', e)}})}};$.event.special.swipe ={setup:function(){var thisObject = this,$this = $(thisObject),started = false,originalCoord ={ x:0, y:0 },finalCoord={ x:0, y:0 };function touchStart(e){originalCoord.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX :e.pageX;originalCoord.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY :e.pageY;finalCoord.x = originalCoord.x;finalCoord.y = originalCoord.y;started = true;var dt = new Date();while ((new Date()) - dt < 100){ }}function touchMove(e){e.stopPropagation();finalCoord.x = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageX :e.pageX;finalCoord.y = (e.originalEvent.targetTouches) ? e.originalEvent.targetTouches[0].pageY :e.pageY;window.clearTimeout(settings.hold_timer);var swipedir;var ele_x_threshold = $this.attr('data-xthreshold'),ele_y_threshold = $this.attr('data-ythreshold'),h_threshold = (typeof ele_x_threshold !== 'undefined' && ele_x_threshold !== false && parseInt(ele_x_threshold)) ? parseInt(ele_x_threshold) :settings.swipe_h_threshold,v_threshold = (typeof ele_y_threshold !== 'undefined' && ele_y_threshold !== false && parseInt(ele_y_threshold)) ? parseInt(ele_y_threshold) :settings.swipe_v_threshold;if(originalCoord.y > finalCoord.y && (originalCoord.y - finalCoord.y > v_threshold)){ swipedir = 'swipeup'}if(originalCoord.x < finalCoord.x && (finalCoord.x - originalCoord.x > h_threshold)){ swipedir = 'swiperight'}if(originalCoord.y < finalCoord.y && (finalCoord.y - originalCoord.y > v_threshold)){ swipedir = 'swipedown'}if(originalCoord.x > finalCoord.x && (originalCoord.x - finalCoord.x > h_threshold)){ swipedir = 'swipeleft'}if(swipedir != undefined && started){originalCoord.x = 0;originalCoord.y = 0;finalCoord.x = 0;finalCoord.y = 0;started = false;$this.trigger('swipe').trigger(swipedir)}}function touchEnd(event){started = false}$this.bind(settings.startevent, touchStart);$this.bind(settings.moveevent, touchMove);$this.bind(settings.endevent, touchEnd)}};$.event.special.scrollstart ={setup:function(){var thisObject = this,$this = $(thisObject),scrolling,timer;function trigger(event, state){scrolling = state;triggerCustomEvent(thisObject, scrolling ? 'scrollstart' :'scrollend', event)}$this.bind(settings.scrollevent, function(event){if(!scrolling){trigger(event, true)}clearTimeout(timer);timer = setTimeout(function(){ trigger(event, false)}, 50)})}};var win = $(window),special_event,get_orientation,last_orientation,initial_orientation_is_landscape,initial_orientation_is_default,portrait_map ={ '0':true, '180':true };if(settings.orientation_support){var ww = window.innerWidth || $(window).width(),wh = window.innerHeight || $(window).height(),landscape_threshold = 50;initial_orientation_is_landscape = ww > wh && (ww - wh) > landscape_threshold;initial_orientation_is_default = portrait_map[window.orientation];if((initial_orientation_is_landscape && initial_orientation_is_default) || (!initial_orientation_is_landscape && !initial_orientation_is_default)){portrait_map ={ '-90':true, '90':true }}}$.event.special.orientationchange = special_event ={setup:function(){if(settings.orientation_support){return false}last_orientation = get_orientation();win.bind('throttledresize', handler);return true},teardown:function(){if (settings.orientation_support){return false}win.unbind('throttledresize', handler);return true},add:function(handleObj){var old_handler = handleObj.handler;handleObj.handler = function(event){event.orientation = get_orientation();return old_handler.apply(this, arguments)}}};function handler(){var orientation = get_orientation();if(orientation !== last_orientation){last_orientation = orientation;win.trigger( "orientationchange" )}}$.event.special.orientationchange.orientation = get_orientation = function(){var isPortrait = true,elem = document.documentElement;if(settings.orientation_support){isPortrait = portrait_map[window.orientation]}else{isPortrait = elem && elem.clientWidth / elem.clientHeight < 1.1}return isPortrait ? 'portrait' :'landscape'};$.event.special.throttledresize ={setup:function(){$(this).bind('resize', throttle_handler)},teardown:function(){$(this).unbind('resize', throttle_handler)}};var throttle = 250,throttle_handler = function(){curr = (new Date()).getTime();diff = curr - lastCall;if(diff >= throttle){lastCall = curr;$(this).trigger('throttledresize')}else{if(heldCall){window.clearTimeout(heldCall)}heldCall = window.setTimeout(handler, throttle - diff)}},lastCall = 0,heldCall,curr,diff;function triggerCustomEvent( obj, eventType, event ){var originalType = event.type;event.type = eventType;$.event.dispatch.call( obj, event );event.type = originalType}$.each({scrollend:'scrollstart',swipeup:'swipe',swiperight:'swipe',swipedown:'swipe',swipeleft:'swipe'}, function(e, srcE){$.event.special[e] ={setup:function(){$(this).bind(srcE, $.noop)}}})}) (jQuery);(function( $ ){$.fn.fitText = function( kompressor, options ){var compressor = kompressor || 1,settings = $.extend({'minFontSize' :Number.NEGATIVE_INFINITY,'maxFontSize' :Number.POSITIVE_INFINITY}, options);return this.each(function(){var $this = $(this);var resizer = function (){$this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)))};resizer();$(window).on('resize', resizer)})}})( jQuery );(function(){var $, Lightbox, LightboxOptions;$ = jQuery;LightboxOptions = (function(){function LightboxOptions(){this.fileLoadingImage = 'http://www.hotelgranvia.com/resources/lib/plugins/lightbox/images/loading.gif';this.fileCloseImage = 'http://www.hotelgranvia.com/resources/lib/plugins/lightbox/images/close.png';this.resizeDuration = 700;this.fadeDuration = 500;this.labelImage = "Image";this.labelOf = "of"}return LightboxOptions})();Lightbox = (function(){function Lightbox(options){this.options = options;this.album = [];this.currentImageIndex = void 0;this.init()}Lightbox.prototype.init = function(){this.enable();return this.build()};Lightbox.prototype.enable = function(){var _this = this;return $('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox]', function(e){if(window.matchMedia( '(min-width:685px)' ).matches){_this.start($(e.currentTarget))}return false})};Lightbox.prototype.build = function(){var $lightbox,_this = this;$("
",{id:'lightboxOverlay'}).after($('
',{id:'lightbox'}).append($('
',{"class":'lb-outerContainer'}).append($('
',{"class":'lb-container'}).append($('',{"class":'lb-image'}), $('
',{"class":'lb-nav'}).append($('',{"class":'lb-prev'}), $('',{"class":'lb-next'})), $('
',{"class":'lb-loader'}).append($('',{"class":'lb-cancel'}).append($('',{src:this.options.fileLoadingImage}))))), $('
',{"class":'lb-dataContainer'}).append($('
',{"class":'lb-data'}).append($('
',{"class":'lb-details'}).append($('',{"class":'lb-caption'}), $('',{"class":'lb-number'})), $('
',{"class":'lb-closeContainer'}).append($('',{"class":'lb-close'}).append($('',{src:this.options.fileCloseImage}))))))).appendTo($('body'));$('#lightboxOverlay').hide().on('click', function(e){_this.end();return false});$lightbox = $('#lightbox');$lightbox.hide().on('click', function(e){if ($(e.target).attr('id') === 'lightbox') _this.end();return false});$lightbox.find('.lb-outerContainer').on('click', function(e){if ($(e.target).attr('id') === 'lightbox') _this.end();return false});$lightbox.find('.lb-prev').on('click', function(e){_this.changeImage(_this.currentImageIndex - 1);return false});$lightbox.find('.lb-next').on('click', function(e){_this.changeImage(_this.currentImageIndex + 1);return false});$lightbox.find('.lb-loader, .lb-close').on('click', function(e){_this.end();return false})};Lightbox.prototype.start = function($link){var $lightbox, $window, a, i, imageNumber, left, top, _len, _ref;$(window).on("resize", this.sizeOverlay);$('select, object, embed').css({visibility:"hidden"});$('#lightboxOverlay').width($(document).width()).height($(document).height()).fadeIn(this.options.fadeDuration);this.album = [];imageNumber = 0;if ($link.attr('rel') === 'lightbox'){this.album.push({link:$link.attr('href'),title:$link.attr('title')})} else{_ref = $($link.prop("tagName") + '[rel="' + $link.attr('rel') + '"]');for (i = 0, _len = _ref.length;i < _len;i++){a = _ref[i];this.album.push({link:$(a).attr('href'),title:$(a).attr('title')});if ($(a).attr('href') === $link.attr('href')) imageNumber = i}}$window = $(window);top = $window.scrollTop() + $window.height() / 10;left = $window.scrollLeft();$lightbox = $('#lightbox');$lightbox.css({top:top + 'px',left:left + 'px'}).fadeIn(this.options.fadeDuration);this.changeImage(imageNumber)};Lightbox.prototype.changeImage = function(imageNumber){var $image, $lightbox, preloader,_this = this;this.disableKeyboardNav();$lightbox = $('#lightbox');$image = $lightbox.find('.lb-image');this.sizeOverlay();$('#lightboxOverlay').fadeIn(this.options.fadeDuration);$('.loader').fadeIn('slow');$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();$lightbox.find('.lb-outerContainer').addClass('animating');preloader = new Image;preloader.onload = function(){$image.attr('src', _this.album[imageNumber].link);$image.width = preloader.width;$image.height = preloader.height;return _this.sizeContainer(preloader.width, preloader.height)};preloader.src = this.album[imageNumber].link;this.currentImageIndex = imageNumber};Lightbox.prototype.sizeOverlay = function(){return $('#lightboxOverlay').css({'width':'100%'}).height($(document).height())};Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight){var $container, $lightbox, $outerContainer, containerBottomPadding, containerLeftPadding, containerRightPadding, containerTopPadding, newHeight, newWidth, oldHeight, oldWidth,_this = this;$lightbox = $('#lightbox');$outerContainer = $lightbox.find('.lb-outerContainer');oldWidth = $outerContainer.outerWidth();oldHeight = $outerContainer.outerHeight();$container = $lightbox.find('.lb-container');containerTopPadding = parseInt($container.css('padding-top'), 10);containerRightPadding = parseInt($container.css('padding-right'), 10);containerBottomPadding = parseInt($container.css('padding-bottom'), 10);containerLeftPadding = parseInt($container.css('padding-left'), 10);newWidth = imageWidth + containerLeftPadding + containerRightPadding;newHeight = imageHeight + containerTopPadding + containerBottomPadding;if(newWidth > $(window).width() ){$outerContainer.css({'width':'90%','height':'auto'});$lightbox.find('.lb-dataContainer').css({'width':'90%'})}else{$outerContainer.css({'width':newWidth + 'px','height':newHeight + 'px'});$lightbox.find('.lb-dataContainer').css({'width':newWidth + 'px'})}$lightbox.find('.lb-prevLink').height(newHeight);$lightbox.find('.lb-nextLink').height(newHeight);_this.showImage()};Lightbox.prototype.showImage = function(){var $lightbox;$lightbox = $('#lightbox');$lightbox.find('.lb-loader').hide();$lightbox.find('.lb-image').fadeIn('slow');this.updateNav();this.updateDetails();this.preloadNeighboringImages();this.enableKeyboardNav()};Lightbox.prototype.updateNav = function(){var $lightbox;$lightbox = $('#lightbox');$lightbox.find('.lb-nav').show();if (this.currentImageIndex > 0) $lightbox.find('.lb-prev').show();if (this.currentImageIndex < this.album.length - 1){$lightbox.find('.lb-next').show()}};Lightbox.prototype.updateDetails = function(){var $lightbox,_this = this;$lightbox = $('#lightbox');if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== ""){$lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast')}if (this.album.length > 1){$lightbox.find('.lb-number').html(this.options.labelImage + ' ' + (this.currentImageIndex + 1) + ' ' + this.options.labelOf + '' + this.album.length).fadeIn('fast')} else{$lightbox.find('.lb-number').hide()}$lightbox.find('.lb-outerContainer').removeClass('animating');$lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration, function(){return _this.sizeOverlay()})};Lightbox.prototype.preloadNeighboringImages = function(){var preloadNext, preloadPrev;if (this.album.length > this.currentImageIndex + 1){preloadNext = new Image;preloadNext.src = this.album[this.currentImageIndex + 1].link}if (this.currentImageIndex > 0){preloadPrev = new Image;preloadPrev.src = this.album[this.currentImageIndex - 1].link}};Lightbox.prototype.enableKeyboardNav = function(){$(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this))};Lightbox.prototype.disableKeyboardNav = function(){$(document).off('.keyboard')};Lightbox.prototype.keyboardAction = function(event){var KEYCODE_ESC, KEYCODE_LEFTARROW, KEYCODE_RIGHTARROW, key, keycode;KEYCODE_ESC = 27;KEYCODE_LEFTARROW = 37;KEYCODE_RIGHTARROW = 39;keycode = event.keyCode;key = String.fromCharCode(keycode).toLowerCase();if (keycode === KEYCODE_ESC || key.match(/x|o|c/)){this.end()} else if (key === 'p' || keycode === KEYCODE_LEFTARROW){if (this.currentImageIndex !== 0){this.changeImage(this.currentImageIndex - 1)}} else if (key === 'n' || keycode === KEYCODE_RIGHTARROW){if (this.currentImageIndex !== this.album.length - 1){this.changeImage(this.currentImageIndex + 1)}}};Lightbox.prototype.end = function(){this.disableKeyboardNav();$(window).off("resize", this.sizeOverlay);$('#lightbox').fadeOut(this.options.fadeDuration);$('#lightboxOverlay').fadeOut(this.options.fadeDuration);return $('select, object, embed').css({visibility:"visible"})};return Lightbox})();$(function(){var lightbox, options;options = new LightboxOptions;return lightbox = new Lightbox(options)})}).call(this);;(function(d){d.flexslider=function(i,k){var a=d(i),c=d.extend({},d.flexslider.defaults,k),e=c.namespace,r="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,s=r?"touchend":"click",l="vertical"===c.direction,m=c.reverse,h=0');if(1':""+b+"",a.controlNavScaffold.append("
  • "+g+"
  • "),b++;a.controlsContainer?d(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold);f.controlNav.set();f.controlNav.active();a.controlNavScaffold.delegate("a, img",s,function(b){b.preventDefault();var b=d(this),g=a.controlNav.index(b);b.hasClass(e+"active")||(a.direction=g>a.currentSlide?"next":"prev",a.flexAnimate(g,c.pauseOnAction))});r&&a.controlNavScaffold.delegate("a", "click touchstart",function(a){a.preventDefault()})},setupManual:function(){a.controlNav=a.manualControls;f.controlNav.active();a.controlNav.live(s,function(b){b.preventDefault();var b=d(this),g=a.controlNav.index(b);b.hasClass(e+"active")||(g>a.currentSlide?a.direction="next":a.direction="prev",a.flexAnimate(g,c.pauseOnAction))});r&&a.controlNav.live("click touchstart",function(a){a.preventDefault()})},set:function(){a.controlNav=d("."+e+"control-nav li "+("thumbnails"===c.controlNav?"img":"a"), a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(e+"active").eq(a.animatingTo).addClass(e+"active")},update:function(b,c){1"+a.count+"")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(c).closest("li").remove();f.controlNav.set();1
  • '+c.prevText+'
  • '+c.nextText+"
  • ");a.controlsContainer?(d(a.controlsContainer).append(b),a.directionNav=d("."+e+"direction-nav li a",a.controlsContainer)):(a.append(b),a.directionNav=d("."+e+"direction-nav li a",a));f.directionNav.update();a.directionNav.bind(s,function(b){b.preventDefault();b=d(this).hasClass(e+"next")?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(b,c.pauseOnAction)});r&&a.directionNav.bind("click touchstart",function(a){a.preventDefault()})},update:function(){var b=e+"disabled";1===a.pagingCount?a.directionNav.addClass(b):c.animationLoop?a.directionNav.removeClass(b):0===a.animatingTo?a.directionNav.removeClass(b).filter("."+e+"prev").addClass(b):a.animatingTo===a.last?a.directionNav.removeClass(b).filter("."+e+"next").addClass(b):a.directionNav.removeClass(b)}},pausePlay:{setup:function(){var b=d('
    ');a.controlsContainer? (a.controlsContainer.append(b),a.pausePlay=d("."+e+"pauseplay a",a.controlsContainer)):(a.append(b),a.pausePlay=d("."+e+"pauseplay a",a));f.pausePlay.update(c.slideshow?e+"pause":e+"play");a.pausePlay.bind(s,function(b){b.preventDefault();if(d(this).hasClass(e+"pause")){a.manualPause=true;a.manualPlay=false;a.pause()}else{a.manualPause=false;a.manualPlay=true;a.play()}});r&&a.pausePlay.bind("click touchstart",function(a){a.preventDefault()})},update:function(b){"play"===b?a.pausePlay.removeClass(e+ "pause").addClass(e+"play").text(c.playText):a.pausePlay.removeClass(e+"play").addClass(e+"pause").text(c.pauseText)}},touch:function(){function b(b){j=l?d-b.touches[0].pageY:d-b.touches[0].pageX;p=l?Math.abs(j)j||a.currentSlide===a.last&&0Number(new Date)-k&&50o/2)?a.flexAnimate(l,c.pauseOnAction):a.flexAnimate(a.currentSlide,c.pauseOnAction,!0)}i.removeEventListener("touchmove",b,!1);i.removeEventListener("touchend",g,!1);f=j=e=d=null}var d,e,f,o,j,k,p=!1;i.addEventListener("touchstart",function(j){a.animating?j.preventDefault():1===j.touches.length&&(a.pause(),o=l?a.h:a.w,k=Number(new Date),f=h&& m&&a.animatingTo===a.last?0:h&&m?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:h&&a.currentSlide===a.last?a.limit:h?(a.itemW+c.itemMargin)*a.move*a.currentSlide:m?(a.last-a.currentSlide+a.cloneOffset)*o:(a.currentSlide+a.cloneOffset)*o,d=l?j.touches[0].pageY:j.touches[0].pageX,e=l?j.touches[0].pageX:j.touches[0].pageY,i.addEventListener("touchmove",b,!1),i.addEventListener("touchend",g,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(h||a.doMath(),q?f.smoothHeight():h?(a.slides.width(a.computedW), a.update(a.pagingCount),a.setProps()):l?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(c.smoothHeight&&f.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(b){if(!l||q){var c=q?a:a.viewport;b?c.animate({height:a.slides.eq(a.animatingTo).height()},b):c.height(a.slides.eq(a.animatingTo).height())}},sync:function(b){var g=d(c.sync).data("flexslider"),e=a.animatingTo;switch(b){case "animate":g.flexAnimate(e,c.pauseOnAction,!1,!0);break;case "play":!g.playing&& !g.asNav&&g.play();break;case "pause":g.pause()}}};a.flexAnimate=function(b,g,n,i,k){p&&1===a.pagingCount&&(a.direction=a.currentItema.w?2*c.itemMargin:c.itemMargin,b=(a.itemW+b)*a.move*a.animatingTo,b=b>a.limit&&1!==a.visible?a.limit:b):b=0===a.currentSlide&&b===a.count-1&&c.animationLoop&&"next"!==a.direction?m?(a.count+a.cloneOffset)*o:0:a.currentSlide===a.last&&0===b&&c.animationLoop&&"prev"!==a.direction?m?0:(a.count+1)*o:m?(a.count-1-b+a.cloneOffset)*o:(b+a.cloneOffset)*o;a.setProps(b, "",c.animationSpeed);if(a.transitions){if(!c.animationLoop||!a.atEnd)a.animating=!1,a.currentSlide=a.animatingTo;a.container.unbind("webkitTransitionEnd transitionend");a.container.bind("webkitTransitionEnd transitionend",function(){a.wrapup(o)})}else a.container.animate(a.args,c.animationSpeed,c.easing,function(){a.wrapup(o)})}c.smoothHeight&&f.smoothHeight(c.animationSpeed)}};a.wrapup=function(b){!q&&!h&&(0===a.currentSlide&&a.animatingTo===a.last&&c.animationLoop?a.setProps(b,"jumpEnd"):a.currentSlide=== a.last&&(0===a.animatingTo&&c.animationLoop)&&a.setProps(b,"jumpStart"));a.animating=!1;a.currentSlide=a.animatingTo;c.after(a)};a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))};a.pause=function(){clearInterval(a.animatedSlides);a.playing=!1;c.pausePlay&&f.pausePlay.update("play");a.syncExists&&f.sync("pause")};a.play=function(){a.animatedSlides=setInterval(a.animateSlides,c.slideshowSpeed);a.playing=!0;c.pausePlay&&f.pausePlay.update("pause");a.syncExists&&f.sync("play")};a.canAdvance=function(b,g){var d=p?a.pagingCount-1:a.last;return g?!0:p&&a.currentItem===a.count-1&&0===b&&"prev"===a.direction?!0:p&&0===a.currentItem&&b===a.pagingCount-1&&"next"!==a.direction?!1:b===a.currentSlide&&!p?!1:c.animationLoop?!0:a.atEnd&&0===a.currentSlide&&b===d&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===d&&0===b&&"next"===a.direction?!1:!0};a.getTarget=function(b){a.direction=b;return"next"===b?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide- 1};a.setProps=function(b,g,d){var e,f=b?b:(a.itemW+c.itemMargin)*a.move*a.animatingTo;e=-1*function(){if(h)return"setTouch"===g?b:m&&a.animatingTo===a.last?0:m?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:a.animatingTo===a.last?a.limit:f;switch(g){case "setTotal":return m?(a.count-1-a.currentSlide+a.cloneOffset)*b:(a.currentSlide+a.cloneOffset)*b;case "setTouch":return b;case "jumpEnd":return m?b:a.count*b;case "jumpStart":return m?a.count*b:b;default:return b}}()+"px";a.transitions&&(e=l? "translate3d(0,"+e+",0)":"translate3d("+e+",0,0)",d=void 0!==d?d/1E3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",d));a.args[a.prop]=e;(a.transitions||void 0===d)&&a.container.css(a.args)};a.setup=function(b){if(q)a.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===b&&a.slides.eq(a.currentSlide).fadeIn(c.animationSpeed,c.easing),c.smoothHeight&&f.smoothHeight();else{var g,n;"init"===b&&(a.viewport=d('
    ').css({overflow:"hidden", position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=0,m&&(n=d.makeArray(a.slides).reverse(),a.slides=d(n),a.container.empty().append(a.slides)));c.animationLoop&&!h&&(a.cloneCount=2,a.cloneOffset=1,"init"!==b&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone")));a.newSlides=d(c.selector,a);g=m?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset;l&&!h?(a.container.height(200* (a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){a.newSlides.css({display:"block"});a.doMath();a.viewport.height(a.h);a.setProps(g*a.h,"init")},"init"===b?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(g*a.computedW,"init"),setTimeout(function(){a.doMath();a.newSlides.css({width:a.computedW,"float":"left",display:"block"});c.smoothHeight&&f.smoothHeight()},"init"===b?100:0))}h||a.slides.removeClass(e+"active-slide").eq(a.currentSlide).addClass(e+ "active-slide")};a.doMath=function(){var b=a.slides.first(),d=c.itemMargin,e=c.minItems,f=c.maxItems;a.w=a.width();a.h=b.height();a.boxPadding=b.outerWidth()-b.width();h?(a.itemT=c.itemWidth+d,a.minW=e?e*a.itemT:a.w,a.maxW=f?f*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-d*e)/e:a.maxWa.w?a.w:c.itemWidth,a.visible=Math.floor(a.w/(a.itemW+d)),a.move=0a.w?(a.itemW+2*d)*a.count-a.w-d:(a.itemW+d)*a.count-a.w-d):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1);a.computedW=a.itemW-a.boxPadding};a.update=function(b,d){a.doMath();h||(ba.controlNav.length)f.controlNav.update("add");else if("remove"===d&&!h||a.pagingCount a.last&&(a.currentSlide-=1,a.animatingTo-=1),f.controlNav.update("remove",a.last);c.directionNav&&f.directionNav.update()};a.addSlide=function(b,e){var f=d(b);a.count+=1;a.last=a.count-1;l&&m?void 0!==e?a.slides.eq(a.count-e).after(f):a.container.prepend(f):void 0!==e?a.slides.eq(e).before(f):a.container.append(f);a.update(e,"add");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.added(a)};a.removeSlide=function(b){var e=isNaN(b)?a.slides.index(d(b)):b;a.count-=1;a.last=a.count-1;isNaN(b)?d(b, a.slides).remove():l&&m?a.slides.eq(a.last).remove():a.slides.eq(b).remove();a.doMath();a.update(e,"remove");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.removed(a)};f.init()};d.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7E3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0, directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};d.fn.flexslider=function(i){void 0===i&&(i={});if("object"===typeof i)return this.each(function(){var a=d(this),c=a.find(i.selector? i.selector:".slides > li");1===c.length?(c.fadeIn(400),i.start&&i.start(a)):void 0===a.data("flexslider")&&new d.flexslider(this,i)});var k=d(this).data("flexslider");switch(i){case "play":k.play();break;case "pause":k.pause();break;case "next":k.flexAnimate(k.getTarget("next"),!0);break;case "prev":case "previous":k.flexAnimate(k.getTarget("prev"),!0);break;default:"number"===typeof i&&k.flexAnimate(i,!0)}}})(jQuery);(function($){$.fn.imageFrame = function(){return this.each(function(){var $this = $(this);$this.find('img').each(function(){var $img = $(this);if(!$img.hasClass('no-frame')){if( $img.parent().hasClass('wrap-img') ){$img.unwrap();$img.parent().find('.frame').remove()}$img.wrap('
    ');var imgHeight = $(this).height();var imgWidth = $(this).width();$img.parent().css("max-width",imgWidth);$img.parent().css("max-height",imgHeight);$img.parent().append("
    ")}})})}})(jQuery);(function($){$.fn.homeSlideShow = function(user_options){return this.each(function(){var $this = $(this);var totalWidth = $(window).width();var $slidesWrap = $this.find('ul.slides');var $slides = $slidesWrap.find('li');var nSlides = $slides.length;var listWidth = 0;var slideTime = 3000;var slideTransitionIni = 250;var slideTransition = slideTransitionIni;var transition = 'linear';var acSlide = 0;var moving = false;var timer;var traveling = false;var travelToSlide = 0;var iniListMargin = 0;var slideMargin = 5;var getSlideWidth = function($slide){var w = 0;if($slide.hasClass('text-center')){w = $slide.outerWidth()}else{w = $slide.outerWidth()}w = w + slideMargin;return w};var getSlide = function(slideIndex){return $slides.filter('[data-slide-index="' + slideIndex + '"]')};var setActiveBullet = function(slideIndex){var $bullets = $('ul.slide-bullet-ctr li a');$bullets.removeClass('active');$bullets.filter('[data-slide-index="' + slideIndex + '"]').addClass('active')};var initSliderElements = function(){listWidth = 0;$slides.each(function(i){var $this = $(this);if (window.matchMedia( '(max-width:685px)' ).matches){if($this.hasClass('text-center')){$this.css({'height':'200px'})}else{imgW = $this.find('img').naturalWidth();$this.css({'width':imgW/2 + 'px'})}}else{if($this.hasClass('text-center')){$this.css({'height':'400px'})}else{imgW = $this.find('img').naturalWidth();$this.css({'width':imgW + 'px'})}}var sw = getSlideWidth($this);$this.attr('data-slide-index', i);listWidth = listWidth + sw});$slidesWrap.css({'position':'relative','overflow':'hidden','width':listWidth + 'px'});$slides.css({'position':'relative','float':'left','margin-left':slideMargin + 'px'})};var initSliderControls = function(){var $bulletCtr = $('