(function (){
"use strict";
function EventEmitter(){}
var proto=EventEmitter.prototype;
var exports=this;
var originalGlobalValue=exports.EventEmitter;
function indexOfListener(listeners, listener){
var i=listeners.length;
while (i--){
if(listeners[i].listener===listener){
return i;
}}
return -1;
}
function alias(name){
return function aliasClosure(){
return this[name].apply(this, arguments);
};}
proto.getListeners=function getListeners(evt){
var events=this._getEvents();
var response;
var key;
if(typeof evt==='object'){
response={};
for (key in events){
if(events.hasOwnProperty(key)&&evt.test(key)){
response[key]=events[key];
}}
}else{
response=events[evt]||(events[evt]=[]);
}
return response;
};
proto.flattenListeners=function flattenListeners(listeners){
var flatListeners=[];
var i;
for (i=0; i < listeners.length; i +=1){
flatListeners.push(listeners[i].listener);
}
return flatListeners;
};
proto.getListenersAsObject=function getListenersAsObject(evt){
var listeners=this.getListeners(evt);
var response;
if(listeners instanceof Array){
response={};
response[evt]=listeners;
}
return response||listeners;
};
proto.addListener=function addListener(evt, listener){
var listeners=this.getListenersAsObject(evt);
var listenerIsWrapped=typeof listener==='object';
var key;
for (key in listeners){
if(listeners.hasOwnProperty(key)&&indexOfListener(listeners[key], listener)===-1){
listeners[key].push(listenerIsWrapped ? listener:{
listener: listener,
once: false
});
}}
return this;
};
proto.on=alias('addListener');
proto.addOnceListener=function addOnceListener(evt, listener){
return this.addListener(evt, {
listener: listener,
once: true
});
};
proto.once=alias('addOnceListener');
proto.defineEvent=function defineEvent(evt){
this.getListeners(evt);
return this;
};
proto.defineEvents=function defineEvents(evts){
for (var i=0; i < evts.length; i +=1){
this.defineEvent(evts[i]);
}
return this;
};
proto.removeListener=function removeListener(evt, listener){
var listeners=this.getListenersAsObject(evt);
var index;
var key;
for (key in listeners){
if(listeners.hasOwnProperty(key)){
index=indexOfListener(listeners[key], listener);
if(index!==-1){
listeners[key].splice(index, 1);
}}
}
return this;
};
proto.off=alias('removeListener');
proto.addListeners=function addListeners(evt, listeners){
return this.manipulateListeners(false, evt, listeners);
};
proto.removeListeners=function removeListeners(evt, listeners){
return this.manipulateListeners(true, evt, listeners);
};
proto.manipulateListeners=function manipulateListeners(remove, evt, listeners){
var i;
var value;
var single=remove ? this.removeListener:this.addListener;
var multiple=remove ? this.removeListeners:this.addListeners;
if(typeof evt==='object'&&!(evt instanceof RegExp)){
for (i in evt){
if(evt.hasOwnProperty(i)&&(value=evt[i])){
if(typeof value==='function'){
single.call(this, i, value);
}else{
multiple.call(this, i, value);
}}
}}else{
i=listeners.length;
while (i--){
single.call(this, evt, listeners[i]);
}}
return this;
};
proto.removeEvent=function removeEvent(evt){
var type=typeof evt;
var events=this._getEvents();
var key;
if(type==='string'){
delete events[evt];
}
else if(type==='object'){
for (key in events){
if(events.hasOwnProperty(key)&&evt.test(key)){
delete events[key];
}}
}else{
delete this._events;
}
return this;
};
proto.removeAllListeners=alias('removeEvent');
proto.emitEvent=function emitEvent(evt, args){
var listeners=this.getListenersAsObject(evt);
var listener;
var i;
var key;
var response;
for (key in listeners){
if(listeners.hasOwnProperty(key)){
i=listeners[key].length;
while (i--){
listener=listeners[key][i];
if(listener.once===true){
this.removeListener(evt, listener.listener);
}
response=listener.listener.apply(this, args||[]);
if(response===this._getOnceReturnValue()){
this.removeListener(evt, listener.listener);
}}
}}
return this;
};
proto.trigger=alias('emitEvent');
proto.emit=function emit(evt){
var args=Array.prototype.slice.call(arguments, 1);
return this.emitEvent(evt, args);
};
proto.setOnceReturnValue=function setOnceReturnValue(value){
this._onceReturnValue=value;
return this;
};
proto._getOnceReturnValue=function _getOnceReturnValue(){
if(this.hasOwnProperty('_onceReturnValue')){
return this._onceReturnValue;
}else{
return true;
}};
proto._getEvents=function _getEvents(){
return this._events||(this._events={});
};
EventEmitter.noConflict=function noConflict(){
exports.EventEmitter=originalGlobalValue;
return EventEmitter;
};
if(typeof define==='function'&&define.amd){
define('eventEmitter/EventEmitter',[],function (){
return EventEmitter;
});
}
else if(typeof module==='object'&&module.exports){
module.exports=EventEmitter;
}else{
this.EventEmitter=EventEmitter;
}}.call(this));
(function(window){
var docElem=document.documentElement;
var bind=function(){};
function getIEEvent(obj){
var event=window.event;
event.target=event.target||event.srcElement||obj;
return event;
}
if(docElem.addEventListener){
bind=function(obj, type, fn){
obj.addEventListener(type, fn, false);
};}else if(docElem.attachEvent){
bind=function(obj, type, fn){
obj[ type + fn ]=fn.handleEvent ?
function(){
var event=getIEEvent(obj);
fn.handleEvent.call(fn, event);
} :
function(){
var event=getIEEvent(obj);
fn.call(obj, event);
};
obj.attachEvent("on" + type, obj[ type + fn ]);
};}
var unbind=function(){};
if(docElem.removeEventListener){
unbind=function(obj, type, fn){
obj.removeEventListener(type, fn, false);
};}else if(docElem.detachEvent){
unbind=function(obj, type, fn){
obj.detachEvent("on" + type, obj[ type + fn ]);
try {
delete obj[ type + fn ];
} catch(err){
obj[ type + fn ]=undefined;
}};}
var eventie={
bind: bind,
unbind: unbind
};
if(typeof define==='function'&&define.amd){
define('eventie/eventie',eventie);
}else{
window.eventie=eventie;
}})(this);
(function(window, factory){
if(typeof define==='function'&&define.amd){
define([
'eventEmitter/EventEmitter',
'eventie/eventie'
], function(EventEmitter, eventie){
return factory(window, EventEmitter, eventie);
});
}else if(typeof exports==='object'){
module.exports=factory(
window,
require('wolfy87-eventemitter'),
require('eventie')
);
}else{
window.imagesLoaded=factory(
window,
window.EventEmitter,
window.eventie
);
}})(window,
function factory(window, EventEmitter, eventie){
var $=window.jQuery;
var console=window.console;
var hasConsole=typeof console!=='undefined';
function extend(a, b){
for(var prop in b){
a[ prop ]=b[ prop ];
}
return a;
}
var objToString=Object.prototype.toString;
function isArray(obj){
return objToString.call(obj)==='[object Array]';
}
function makeArray(obj){
var ary=[];
if(isArray(obj)){
ary=obj;
}else if(typeof obj.length==='number'){
for(var i=0, len=obj.length; i < len; i++){
ary.push(obj[i]);
}}else{
ary.push(obj);
}
return ary;
}
function ImagesLoaded(elem, options, onAlways){
if(!(this instanceof ImagesLoaded)){
return new ImagesLoaded(elem, options);
}
if(typeof elem==='string'){
elem=document.querySelectorAll(elem);
}
this.elements=makeArray(elem);
this.options=extend({}, this.options);
if(typeof options==='function'){
onAlways=options;
}else{
extend(this.options, options);
}
if(onAlways){
this.on('always', onAlways);
}
this.getImages();
if($){
this.jqDeferred=new $.Deferred();
}
var _this=this;
setTimeout(function(){
_this.check();
});
}
ImagesLoaded.prototype=new EventEmitter();
ImagesLoaded.prototype.options={};
ImagesLoaded.prototype.getImages=function(){
this.images=[];
for(var i=0, len=this.elements.length; i < len; i++){
var elem=this.elements[i];
if(elem.nodeName==='IMG'){
this.addImage(elem);
}
var nodeType=elem.nodeType;
if(!nodeType||!(nodeType===1||nodeType===9||nodeType===11)){
continue;
}
var childElems=elem.querySelectorAll('img');
for(var j=0, jLen=childElems.length; j < jLen; j++){
var img=childElems[j];
this.addImage(img);
}}
};
ImagesLoaded.prototype.addImage=function(img){
var loadingImage=new LoadingImage(img);
this.images.push(loadingImage);
};
ImagesLoaded.prototype.check=function(){
var _this=this;
var checkedCount=0;
var length=this.images.length;
this.hasAnyBroken=false;
if(!length){
this.complete();
return;
}
function onConfirm(image, message){
if(_this.options.debug&&hasConsole){
console.log('confirm', image, message);
}
_this.progress(image);
checkedCount++;
if(checkedCount===length){
_this.complete();
}
return true;
}
for(var i=0; i < length; i++){
var loadingImage=this.images[i];
loadingImage.on('confirm', onConfirm);
loadingImage.check();
}};
ImagesLoaded.prototype.progress=function(image){
this.hasAnyBroken=this.hasAnyBroken||!image.isLoaded;
var _this=this;
setTimeout(function(){
_this.emit('progress', _this, image);
if(_this.jqDeferred&&_this.jqDeferred.notify){
_this.jqDeferred.notify(_this, image);
}});
};
ImagesLoaded.prototype.complete=function(){
var eventName=this.hasAnyBroken ? 'fail':'done';
this.isComplete=true;
var _this=this;
setTimeout(function(){
_this.emit(eventName, _this);
_this.emit('always', _this);
if(_this.jqDeferred){
var jqMethod=_this.hasAnyBroken ? 'reject':'resolve';
_this.jqDeferred[ jqMethod ](_this);
}});
};
if($){
$.fn.imagesLoaded=function(options, callback){
var instance=new ImagesLoaded(this, options, callback);
return instance.jqDeferred.promise($(this));
};}
function LoadingImage(img){
this.img=img;
}
LoadingImage.prototype=new EventEmitter();
LoadingImage.prototype.check=function(){
var resource=cache[ this.img.src ]||new Resource(this.img.src);
if(resource.isConfirmed){
this.confirm(resource.isLoaded, 'cached was confirmed');
return;
}
if(this.img.complete&&this.img.naturalWidth!==undefined){
this.confirm(this.img.naturalWidth!==0, 'naturalWidth');
return;
}
var _this=this;
resource.on('confirm', function(resrc, message){
_this.confirm(resrc.isLoaded, message);
return true;
});
resource.check();
};
LoadingImage.prototype.confirm=function(isLoaded, message){
this.isLoaded=isLoaded;
this.emit('confirm', this, message);
};
var cache={};
function Resource(src){
this.src=src;
cache[ src ]=this;
}
Resource.prototype=new EventEmitter();
Resource.prototype.check=function(){
if(this.isChecked){
return;
}
var proxyImage=new Image();
eventie.bind(proxyImage, 'load', this);
eventie.bind(proxyImage, 'error', this);
proxyImage.src=this.src;
this.isChecked=true;
};
Resource.prototype.handleEvent=function(event){
var method='on' + event.type;
if(this[ method ]){
this[ method ](event);
}};
Resource.prototype.onload=function(event){
this.confirm(true, 'onload');
this.unbindProxyEvents(event);
};
Resource.prototype.onerror=function(event){
this.confirm(false, 'onerror');
this.unbindProxyEvents(event);
};
Resource.prototype.confirm=function(isLoaded, message){
this.isConfirmed=true;
this.isLoaded=isLoaded;
this.emit('confirm', this, message);
};
Resource.prototype.unbindProxyEvents=function(event){
eventie.unbind(event.target, 'load', this);
eventie.unbind(event.target, 'error', this);
};
return ImagesLoaded;
});
(function($){
var body=$('body'),
_window=$(window),
nav, button, menu;
nav=$('#primary-navigation');
button=nav.find('.menu-toggle');
menu=nav.find('.nav-menu');
(function(){
if(! nav||! button){
return;
}
if(! menu||! menu.children().length){
button.hide();
return;
}
button.on('click.crewtransport', function(){
nav.toggleClass('toggled-on');
if(nav.hasClass('toggled-on')){
$(this).attr('aria-expanded', 'true');
menu.attr('aria-expanded', 'true');
}else{
$(this).attr('aria-expanded', 'false');
menu.attr('aria-expanded', 'false');
}});
})();
_window.on('hashchange.crewtransport', function(){
var hash=location.hash.substring(1), element;
if(! hash){
return;
}
element=document.getElementById(hash);
if(element){
if(! /^(?:a|select|input|button|textarea)$/i.test(element.tagName)){
element.tabIndex=-1;
}
element.focus();
window.scrollBy(0, -80);
}});
$(function(){
$('.search-toggle').on('click.crewtransport', function(event){
var that=$(this),
wrapper=$('#search-container'),
container=that.find('a');
that.toggleClass('active');
wrapper.toggleClass('hide');
if(that.hasClass('active')){
container.attr('aria-expanded', 'true');
}else{
container.attr('aria-expanded', 'false');
}
if(that.is('.active')||$('.search-toggle .screen-reader-text')[0]===event.target){
wrapper.find('.search-field').focus();
}});
});
jQuery(document).ready(function($){
/*
$('#opallostpasswordform').hide();
$('#modalLoginForm form .btn-cancel').on('click', function(){
$('#modalLoginForm').modal('hide');
$('#modalLoginForm .alert').remove();
});
$('form.login-form').on('submit', function(){
var $this=$(this);
$('.alert', this).remove();
$.ajax({
url: crewtransportAjax.ajaxurl,
type:'POST',
dataType: 'json',
data:  $(this).serialize()+"&action=opalajaxlogin"
}).done(function(data){
if(data.loggedin){
$this.prepend('<div class="alert alert-info">'+data.message+'</div>');
location.reload();
}else{
$this.prepend('<div class="alert alert-warning">'+data.message+'</div>');
}});
return false;
});
$('form#opalrgtRegisterForm').on('submit', function(){
var $this=$(this);
$('.alert', this).remove();
$.ajax({
url: crewtransportAjax.ajaxurl,
type:'POST',
dataType: 'json',
data:  $(this).serialize()+"&action=opalajaxregister"
}).done(function(data){
if(data.status==1){
$this.prepend('<div class="alert alert-info">'+data.msg+'</div>');
location.reload();
}else{
$this.prepend('<div class="alert alert-warning">'+data.msg+'</div>');
}});
return false;
});
*/
$('form .toggle-links').on('click', function(){
$('.form-wrapper').hide();
$($(this).attr('href')).show();
return false;
});
$('form.lostpassword-form').on('submit', function(){
var $this=$(this);
$('.alert', this).remove();
$.ajax({
url: crewtransportAjax.ajaxurl,
type:'POST',
dataType: 'json',
data:  $(this).serialize()+"&action=opalajaxlostpass"
}).done(function(data){
if(data.loggedin){
$this.prepend('<div class="alert alert-info">'+data.message+'</div>');
location.reload();
}else{
$this.prepend('<div class="alert alert-warning">'+data.message+'</div>');
}});
return false;
});
});
if($('.wpb_map_wraper').length > 0){
$('.wpb_map_wraper').on('click', function (){
$('.wpb_map_wraper iframe').css("pointer-events", "auto");
});
$(".wpb_map_wraper").mouseleave(function(){
$('.wpb_map_wraper iframe').css("pointer-events", "none");
});
}
jQuery(window).scroll(function(){
if(jQuery(this).scrollTop() > 200){
jQuery('.scrollup').fadeIn();
}else{
jQuery('.scrollup').fadeOut();
}});
jQuery('.scrollup').on('click', function(){
jQuery("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
$('[data-toggle="offcanvas"], .btn-offcanvas').on('click', function (){
$('.row-offcanvas').toggleClass('active')
$('#opal-off-canvas').toggleClass('active');
});
$('#main-menu-offcanvas .caret').on('click', function (){
if(jQuery(this).parent().children().hasClass('show')){
jQuery(this).parent().children().removeClass('show');
}else
jQuery(this).parent().children().addClass('show');
});
$('.showright').on('click', function(){
$('.offcanvas-showright').toggleClass('active');
});
$("a[rel^='prettyPhoto[pp_gal]']").prettyPhoto({
animation_speed:'normal',
theme:'light_square',
social_tools: false,
});
jQuery('.isotope-masonry').each(function(){
var $container=jQuery(this);
$container.imagesLoaded(function(){
$container.isotope({
itemSelector:'.masonry-item',
transformsEnabled: true
});
});
});
jQuery('.isotope-filter li a').click(function(){
var parentul=jQuery(this).parents('ul.isotope-filter').data('related-grid');
jQuery(this).parents('ul.isotope-filter').find('li a').removeClass('active');
jQuery(this).addClass('active');
var selector=jQuery(this).attr('data-option-value');
jQuery('#'+parentul).isotope({ filter: selector }, function(){ });
return(false);
});
$(document).ready(function(){
$(".dropdown-toggle-overlay").on('click', function(){
$($(this).data('target')).addClass("active");
});
$(".dropdown-toggle-button").on('click', function(){
$($(this).data('target')).removeClass("active");
return false;
});
$(".owl-carousel-play .owl-carousel").each(function(){
var config={
navigation:false,
slideSpeed:300,
paginationSpeed:400,
pagination:$(this).data('pagination'),
autoHeight: true,
pagination:true,
};
var owl=$(this);
if($(this).data('slide')==1){
config.singleItem=true;
}else{
config.items=$(this).data('slide');
}
if($(this).data('desktop')){
config.itemsDesktop=$(this).data('desktop');
}
if($(this).data('desktopsmall')){
config.itemsDesktopSmall=$(this).data('desktopsmall');
}
if($(this).data('desktopsmall')){
config.itemsTablet=$(this).data('tablet');
}
if($(this).data('tabletsmall')){
config.itemsTabletSmall=$(this).data('tabletsmall');
}
if($(this).data('mobile')){
config.itemsMobile=$(this).data('mobile');
}
$(this).owlCarousel(config);
$('.left',$(this).parent()).on('click', function(){
owl.trigger('owl.prev');
return false;
});
$('.right',$(this).parent()).on('click', function(){
owl.trigger('owl.next');
return false;
});
});
if($('.page-static-left')){
$('.page-static-left .button-action').on('click', function(){
$('.page-static-left').toggleClass('active');
});
}
$('.kc-google-maps').click(function (){
$('.kc-google-maps iframe').css("pointer-events", "auto");
});
$('.menu-button').on('click', function(){
$(this).toggleClass('menu-close');
$('.wrapper').toggleClass('active');
});
jQuery('.isotope-items,.blog-masonry').each(function(){
var $container=jQuery(this);
$container.imagesLoaded(function(){
$container.isotope({
itemSelector:'.isotope-item',
transformsEnabled: true
});
});
});
});
})(jQuery);
function setCookie(cname, cvalue, exdays){
var d=new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires="expires="+d.toUTCString();
document.cookie=cname + "=" + cvalue + "; " + expires;
}
function getCookie(cname){
var name=cname + "=";
var ca=document.cookie.split(';');
for(var i=0; i<ca.length; i++){
var c=ca[i];
while (c.charAt(0)==' ') c=c.substring(1);
if(c.indexOf(name)==0) return c.substring(name.length,c.length);
}
return "";
};