(function($) {
$.fn.html5lightbox = function(k) {
var l = this;
l.options = jQuery.extend({
autoplay: true,
html5player: true,
overlaybgcolor: "#ffffff",
overlayopacity: 0.9,
bgcolor: "#ffffff",
bordersize: 8,
barheight: 36,
loadingwidth: 64,
loadingheight: 64,
resizespeed: 400,
fadespeed: 400,
skinfolder: "skins/",
nextimage: "lightbox-next.png",
previmage: "lightbox-prev.png",
closeimage: "lightbox-close.png",
playvideoimage: "lightbox-playvideo.png",
titlecss: "{color:#ffffff; font-size:16px; font-family:Armata,sans-serif,Arial; overflow:hidden; white-space:nowrap;}",
errorwidth: 280,
errorheight: 48,
errorcss: "{text-align:center; color:#ff0000; font-size:14px; font-family:Arial, sans-serif;}",
supportesckey: true,
supportarrowkeys: true,
version: "1.8",
stamp: false,
freemark: "html5box.com",
freelink: "",
watermark: "",
watermarklink: ""
},
k);
if ((typeof html5lightbox_options != 'undefined') && html5lightbox_options) jQuery.extend(l.options, html5lightbox_options);
l.options.htmlfolder = window.location.href.substr(0, window.location.href.lastIndexOf("/") + 1);
if ((l.options.skinfolder.charAt(0) != "/") && (l.options.skinfolder.substring(0, 5) != "http:") && (l.options.skinfolder.substring(0, 6) != "https:")) l.options.skinfolder = l.options.jsfolder + l.options.skinfolder;
l.options.types = ["IMAGE", "FLASH", "VIDEO", "youku", "VIMEO", "PDF", "MP3", "WEB"];
l.elemArray = new Array();
l.options.curElem = -1;
l.options.flashInstalled = false;
try {
if (new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) l.options.flashInstalled = true
} catch(e) {
if (navigator.mimeTypes["application/x-shockwave-flash"]) l.options.flashInstalled = true
}
l.options.html5VideoSupported = ( !! document.createElement('video').canPlayType);
l.options.isChrome = (navigator.userAgent.match(/Chrome/i) != null);
l.options.isFirefox = (navigator.userAgent.match(/Firefox/i) != null);
l.options.isOpera = (navigator.userAgent.match(/Opera/i) != null);
l.options.isSafari = (navigator.userAgent.match(/Safari/i) != null);
l.options.isIE = (navigator.userAgent.match(/MSIE/i) != null) && !l.options.isOpera;
l.options.isIE9 = l.options.isIE && l.options.html5VideoSupported;
l.options.isIE678 = l.options.isIE && !l.options.isIE9;
l.options.isIE6 = (navigator.userAgent.match(/MSIE 6/i) != null) && !l.options.isOpera;
l.options.isAndroid = (navigator.userAgent.match(/Android/i) != null);
l.options.isIPad = (navigator.userAgent.match(/iPad/i) != null);
l.options.isIPhone = ((navigator.userAgent.match(/iPod/i) != null) || (navigator.userAgent.match(/iPhone/i) != null));
l.options.isMobile = (l.options.isAndroid || l.options.isIPad || l.options.isIPhone);
l.options.isIOSLess5 = l.options.isIPad && l.options.isIPhone && ((navigator.userAgent.match(/OS 4/i) != null) || (navigator.userAgent.match(/OS 3/i) != null));
l.options.supportCSSPositionFixed = !l.options.isIE6 && !l.options.isIOSLess5;
l.options.resizeTimeout = -1;
var l = this;
l.init = function() {
l.showing = false;
l.readData();
l.createMarkup();
l.supportKeyboard()
};
var m = 0,
ELEM_HREF = 1,
ELEM_TITLE = 2,
ELEM_GROUP = 3,
ELEM_WIDTH = 4,
ELEM_HEIGHT = 5,
ELEM_HREF_WEBM = 6,
ELEM_HREF_OGG = 7;
l.readData = function() {
l.each(function() {
if (this.nodeName.toLowerCase() != 'a') return;
var a = $(this);
var b = l.checkType(a.attr('href'));
if (b < 0) return;
l.elemArray.push(new Array(b, a.attr('href'), a.attr('title'), a.data('group'), a.data('width'), a.data('height'), a.data('webm'), a.data('ogg')))
})
};
l.createMarkup = function() {
var a = ('https:' == document.location.protocol ? 'https': 'http') + "://fonts.apis.com/css?family=Armata";
var b = document.createElement("link");
b.setAttribute("rel", "stylesheet");
b.setAttribute("type", "text/css");
b.setAttribute("href", a);
document.getElementsByTagName("head")[0].appendChild(b);
var c = "#html5-text " + l.options.titlecss;
c += ".html5-error " + l.options.errorcss;
$("head").append("");
l.$lightbox = jQuery("
The required Adobe Flash Player plugin is not installed
")
}
};
l.checkType = function(a) {
if (!a) return - 1;
if (a.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)) return 0;
if (a.match(/[^\.]\.(swf)\s*$/i)) return 1;
if (a.match(/\.(flv|mp4|m4v|ogv|ogg|webm)(.*)?$/i)) return 2;
if ((a.match(/\:\/\/.*(youku\.com)/i)) || (a.match(/\:\/\/.*(youtu\.be)/i))) return 3;
if (a.match(/\:\/\/.*(vimeo\.com)/i)) return 4;
if (a.match(/[^\.]\.(pdf)\s*$/i)) return 5;
if (a.match(/[^\.]\.(mp3)\s*$/i)) return 6;
return 7
};
l.showLightbox = function(a, b, c, d, e, f, g) {
l.$next.hide();
l.$prev.hide();
l.reset();
l.$lightbox.show();
if (!l.options.supportCSSPositionFixed) l.$lightbox.css("top", $(window).scrollTop());
var h = l.options.loadingwidth + 2 * l.options.bordersize;
var i = l.options.loadingheight + 2 * l.options.bordersize;
var j = Math.round($(window).height() / 2 - (i + l.options.barheight) / 2);
l.$lightboxBox.css({
"margin-top": j,
"width": h,
"height": i
});
l.$elemWrap.css({
"width": h,
"height": i
});
l.loadElem(new Array(a, b, c, null, d, e, f, g))
};
l.addItem = function(a, b, c, d, e, f, g) {
type = l.checkType(a);
l.elemArray.push(new Array(type, a, b, c, d, e, f, g))
};
l.showItem = function(a) {
if (l.elemArray.length <= 0) return true;
l.hideObjects();
for (var i = 0; i < l.elemArray.length; i++) {
if (l.elemArray[i][ELEM_HREF] == a) break
}
if (i == l.elemArray.length) return true;
l.options.curElem = i;
l.options.nextElem = -1;
l.options.prevElem = -1;
l.calcNextPrevElem();
l.$next.hide();
l.$prev.hide();
l.reset();
l.$lightbox.show();
if (!l.options.supportCSSPositionFixed) l.$lightbox.css("top", $(window).scrollTop());
var b = l.options.loadingwidth + 2 * l.options.bordersize;
var c = l.options.loadingheight + 2 * l.options.bordersize;
var d = Math.round($(window).height() / 2 - (c + l.options.barheight) / 2);
l.$lightboxBox.css({
"margin-top": d,
"width": b,
"height": c
});
l.$elemWrap.css({
"width": b,
"height": c
});
l.loadCurElem();
return false
};
l.init();
return l.unbind('click').click(l.clickHandler)
}
})(jQuery);
function ASTimer(a, b, c) {
var d = 50;
var e = null;
var f = 0;
var g = false;
var h = false;
this.pause = function() {
if (h) {
g = true;
clearInterval(e)
}
};
this.resume = function() {
if (h && g) {
g = false;
e = setInterval(function() {
f += d;
if (f > a) {
clearInterval(e);
if (b) b()
}
if (c) c(f / a)
},
d)
}
};
this.stop = function() {
clearInterval(e);
if (c) c( - 1);
f = 0;
g = false;
h = false
};
this.start = function() {
f = 0;
g = false;
h = true;
e = setInterval(function() {
f += d;
if (f > a) {
clearInterval(e);
if (b) b()
}
if (c) c(f / a)
},
d)
}
}
var ASPlatforms = {
flashInstalled: function() {
var a = false;
try {
if (new ActiveXObject('ShockwaveFlash.ShockwaveFlash')) a = true
} catch(e) {
if (navigator.mimeTypes["application/x-shockwave-flash"]) a = true
}
return a
},
html5VideoSupported: function() {
return ( !! document.createElement('video').canPlayType)
},
isChrome: function() {
return (navigator.userAgent.match(/Chrome/i) != null)
},
isFirefox: function() {
return (navigator.userAgent.match(/Firefox/i) != null)
},
isOpera: function() {
return (navigator.userAgent.match(/Opera/i) != null)
},
isSafari: function() {
return (navigator.userAgent.match(/Safari/i) != null)
},
isAndroid: function() {
return (navigator.userAgent.match(/Android/i) != null)
},
isIPad: function() {
return (navigator.userAgent.match(/iPad/i) != null)
},
isIPhone: function() {
return ((navigator.userAgent.match(/iPod/i) != null) || (navigator.userAgent.match(/iPhone/i) != null))
},
isIOS: function() {
return this.isIPad() || this.isIPhone()
},
isIE9: function() {
return (navigator.userAgent.match(/MSIE/i) != null) && this.html5VideoSupported() && !this.isOpera()
},
isIE8: function() {
return (navigator.userAgent.match(/MSIE 8/i) != null) && !this.isOpera()
},
isIE7: function() {
return (navigator.userAgent.match(/MSIE 7/i) != null) && !this.isOpera()
},
isIE6: function() {
return (navigator.userAgent.match(/MSIE 6/i) != null) && !this.isOpera()
},
isIE678: function() {
return this.isIE6() || this.isIE7() || this.isIE8()
},
css33dTransformSupported: function() {
return ! this.isIE6() && !this.isIE7() && !this.isIE8() && !this.isIE9() && !this.isOpera()
},
applyBrowserStyles: function(a, b) {
var c = {};
for (var d in a) {
c[d] = a[d];
c['-webkit-' + d] = (b) ? '-webkit-' + a[d] : a[d];
c['-moz-' + d] = (b) ? '-moz-' + a[d] : a[d];
c['-ms-' + d] = (b) ? '-ms-' + a[d] : a[d];
c['-o-' + d] = (b) ? '-o-' + a[d] : a[d]
}
return c
}
}; (function($) {
$.fn.html5zoo = function(G) {
var H = 0,
ELEM_SRC = 1,
ELEM_TITLE = 2,
ELEM_DESCRIPTION = 3,
ELEM_LINK = 4,
ELEM_TARGET = 5,
ELEM_VIDEO = 6,
ELEM_THUMBNAIL = 7,
ELEM_LIGHTBOX = 8,
ELEM_LIGHTBOXWIDTH = 9,
ELEM_LIGHTBOXHEIGHT = 10;
var I = 1,
TYPE_SWF = 2,
TYPE_MP3 = 3,
TYPE_PDF = 4,
TYPE_VIDEO_FLASH = 5,
TYPE_VIDEO_MP4 = 6,
TYPE_VIDEO_OGG = 7,
TYPE_VIDEO_WEBM = 8,
TYPE_VIDEO_youku = 9,
TYPE_VIDEO_VIMEO = 10;
var J = function(a, b, c) {
this.container = a;
this.options = b;
this.id = c;
this.transitionTimeout = null;
this.arrowTimeout = null;
this.lightboxArray = [];
this.elemArray = [];
this.container.children().hide();
this.container.css({
"display": "block",
"position": "relative"
});
this.initData(this.init)
};
J.prototype = {
initData: function(a) {
this.readTags();
a(this)
},
readTags: function() {
var m = this;
$('.html5zoo-slides', this.container).find('li').each(function() {
var a = $('img', $(this));
if (a.length > 0) {
var b = (a.data("src") && (a.data("src").length > 0)) ? a.data("src") : '';
var c = (a.attr("src") && (a.attr("src").length > 0)) ? a.attr("src") : b;
var d = (a.attr("alt") && (a.attr("alt").length > 0)) ? a.attr("") : '';
var e = (a.data("description") && (a.data("description").length > 0)) ? a.data("description") : '';
var f = (a.parent() && a.parent().is("a")) ? a.parent().attr("href") : '';
var g = (a.parent() && a.parent().is("a")) ? a.parent().attr("target") : '';
var h = (a.parent() && a.parent().is("a")) ? a.parent().hasClass("html5lightbox") : false;
var i = (a.parent() && h) ? a.parent().data("width") : 0;
var j = (a.parent() && h) ? a.parent().data("height") : 0;
var k = [];
if ($('video', $(this)).length > 0) {
$('video', $(this)).each(function() {
k.push({
href: $(this).attr('src'),
type: m.checkVideoType($(this).attr('src'))
})
})
}
var l = new Array(m.elemArray.length, c, d, e, f, g, k, "", h, i, j);
m.elemArray.push(l);
if (h) m.lightboxArray.push(l)
}
});
$('.html5zoo-thumbnails', this.container).find('li').each(function(a) {
var b = $('img', $(this));
if ((b.length > 0) && (m.elemArray.length > a)) {
var c = (b.data("src") && (b.data("src").length > 0)) ? b.data("src") : '';
var d = (b.attr("src") && (b.attr("src").length > 0)) ? b.attr("src") : c;
m.elemArray[a][ELEM_THUMBNAIL] = d
}
});
if (this.options.shownumbering) {
for (var i = 0; i < this.elemArray.length; i++) {
var n = this.options.numberingformat.replace("%NUM", i + 1).replace("%TOTAL", this.elemArray.length);
this.elemArray[i][ELEM_TITLE] = n + this.elemArray[i][ELEM_TITLE]
}
}
},
init: function(a) {
if (a.elemArray.length <= 0) return;
a.isAnimating = false;
a.isPaused = !a.options.autoplay;
a.tempPaused = false;
a.initVideoApi();
a.createMarkup();
a.createStyle();
a.createNav();
a.createArrows();
a.createBottomShadow();
a.createBackgroundImage();
a.createText();
a.createSliderTimeout();
a.createWatermark();
a.createRibbon();
a.createGoogleFonts();
a.initHtml5Lightbox();
a.curElem = -1;
a.prevElem = -1;
a.nextElem = -1;
a.firstslide = true;
a.loopCount = 0;
a.pauseCarousel = false;
var b = 0;
var c = a.getParams();
var d = parseInt(c["firstslideid"]);
if (!isNaN(d) && (d >= 1) && (d <= a.elemArray.length)) b = d - 1;
else if (a.options.randomplay) b = Math.floor(Math.random() * a.elemArray.length);
a.slideRun(b)
},
getParams: function() {
var a = {};
var b = window.location.search.substring(1).split("&");
for (var i = 0; i < b.length; i++) {
var c = b[i].split("=");
if (c && (c.length == 2)) a[c[0].toLowerCase()] = unescape(c[1])
}
return a
},
initHtml5Lightbox: function() {
var i;
if (this.lightboxArray.length > 0) {
var a = (this.options.skinsfoldername.length > 0) ? (this.options.skinsfoldername + '/') : '';
this.html5Lightbox = $([]).html5lightbox({
jsfolder: this.options.jsfolder,
skinfolder: a
});
for (i = 0; i < this.lightboxArray.length; i++) {
this.html5Lightbox.addItem(this.lightboxArray[i][ELEM_LINK], this.lightboxArray[i][ELEM_TITLE], 'html5zoo' + this.id, this.lightboxArray[i][ELEM_LIGHTBOXWIDTH], this.lightboxArray[i][ELEM_LIGHTBOXHEIGHT], null, null)
}
}
},
createGoogleFonts: function() {
if (this.options.previewmode) return;
if (this.options.addfonts && this.options.fonts && this.options.fonts.length > 0) {}
},
createRibbon: function() {
if (!this.options.showribbon || (this.options.ribbonimage.length <= 0)) return;
$(".html5zoo-ribbon-" + this.id, this.container).html("
")
},
createWatermark: function() {
if (!this.options.showwatermark) return;
if ((this.options.watermarkstyle == 'text') && (this.options.watermarktext.length <= 0)) return;
if ((this.options.watermarkstyle == 'image') && (this.options.watermarkimage.length <= 0)) return;
var a = '';
if (this.options.watermarklink) {
a += "
"
}
if (this.options.watermarklink) a += "";
$(".html5zoo-watermark-" + this.id, this.container).html(a)
},
initVideoApi: function() {
var i, j, videos;
var a = false,
initVimeo = false;
for (i = 0; i < this.elemArray.length; i++) {
videos = this.elemArray[i][ELEM_VIDEO];
for (j = 0; j < videos.length; j++) {
if (videos[j].type == TYPE_VIDEO_youku) a = true;
else if (videos[j].type == TYPE_VIDEO_VIMEO) initVimeo = true
}
}
if (a) {
var b = document.createElement('script');
b.src = ('https:' == document.location.protocol ? 'https': 'http') + "://www.youku.com/iframe_api";
var c = document.getElementsByTagName('script')[0];
c.parentNode.insertBefore(b, c)
}
if (initVimeo) {
var b = document.createElement('script');
b.src = this.options.jsfolder + "froogaloop2.min.js";
var c = document.getElementsByTagName('script')[0];
c.parentNode.insertBefore(b, c)
}
},
createSliderTimeout: function() {
var b = this;
this.sliderTimeout = new ASTimer(this.options.slideinterval,
function() {
b.slideRun( - 1)
},
((this.options.showtimer) ? (function(a) {
b.updateTimer(a)
}) : null));
if (b.options.pauseonmouseover) {
$(".html5zoo-slider-" + this.id, this.container).hover(function() {
if (!b.isPaused) b.sliderTimeout.pause()
},
function() {
if (!b.isPaused) b.sliderTimeout.resume()
})
}
if (b.options.showtimer) $(".html5zoo-timer-" + b.id, b.container).css({
display: 'block',
position: 'absolute',
left: '0px',
top: ((b.options.timerposition == 'bottom') ? '': '0px'),
bottom: ((b.options.timerposition == 'bottom') ? '0px': ''),
width: '0%',
height: b.options.timerheight + 'px',
'background-color': b.options.timercolor,
opacity: b.options.timeropacity,
filter: 'alpha(opacity=' + Math.round(100 * b.options.timeropacity) + ')'
})
},
updateTimer: function(a) {
w = Math.round(a * 100) + 1;
if (w > 100) w = 100;
if (w < 0) w = 0;
$(".html5zoo-timer-" + this.id, this.container).css({
width: w + '%'
})
},
createMarkup: function() {
this.$wrapper = jQuery("
");
this.$wrapper.appendTo(this.container);
var a = this;
if (this.options.enabletouchswipe) {
$(".html5zoo-swipe-box-" + this.id, this.container).touchSwipe({
swipeLeft: function() {
a.slideRun( - 1)
},
swipeRight: function() {
a.slideRun( - 2)
}
})
}
$(".html5zoo-play-" + this.id, this.container).click(function() {
a.playVideo(true)
})
},
playVideo: function(a) {
var b = this.elemArray[this.curElem][ELEM_VIDEO];
if (b.length <= 0) return;
this.sliderTimeout.stop();
this.tempPaused = true;
var c = b[0].href;
var d = b[0].type;
if (d == TYPE_VIDEO_youku) this.playyoukuVideo(c, a);
else if (d == TYPE_VIDEO_VIMEO) this.playVimeoVideo(c, a)
},
playVimeoVideo: function(b, c) {
var d = $(".html5zoo-video-wrapper-" + this.id, this.container);
d.css({
display: 'block',
width: '100%',
height: '100%'
});
if (this.options.previewmode) {
d.html("
To view Vimeo video, publish the slider then open it in your web browser
");
return
} else {
var e = b + ((b.indexOf("?") < 0) ? '?': '&') + 'autoplay=' + (c ? '1': '0') + '&api=1&player_id=html5zoo_vimeo_' + this.id;
d.html("
");
var f = $('#html5zoo_vimeo_' + this.id)[0];
var g = $f(f);
var h = this;
g.addEvent('ready',
function() {
g.addEvent('finish',
function(a) {
h.tempPaused = false;
if (!h.isPaused) h.slideRun( - 1)
})
})
}
},
playyoukuVideo: function(b, c) {
var d = $(".html5zoo-video-wrapper-" + this.id, this.container);
d.css({
display: 'block',
width: '100%',
height: '100%'
});
if (this.options.previewmode) {
d.html("
To view youku video, publish the slider then open it in your web browser
");
return
}
var e = this;
if (!ASyoukuIframeAPIReady) {
ASyoukuTimeout += 100;
if (ASyoukuTimeout < 3000) {
setTimeout(function() {
e.playyoukuVideo(b, c)
},
100);
return
}
}
if (ASyoukuIframeAPIReady && !ASPlatforms.isIE6() && !ASPlatforms.isIE7() && !ASPlatforms.isIOS()) {
d.html("
");
var f = b.match(/(\?v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]+)/)[2];
new YT.Player('html5zoo-video-' + this.id, {
width: e.options.width,
height: e.options.height,
videoId: f,
playerVars: {
'autoplay': 1,
'rel': 0,
'autohide': 1,
'wmode': 'transparent'
},
events: {
'onReady': function(a) {
a.target.playVideo()
},
'onStateChange': function(a) {
if (a.data == YT.PlayerState.ENDED) {
e.tempPaused = false;
if (!e.isPaused) e.slideRun( - 1)
}
}
}
})
} else {
var g = b + ((b.indexOf("?") < 0) ? '?': '&') + "autoplay=1&wmode=transparent&rel=0&autohide=1";
d.html("
")
}
},
checkVideoType: function(a) {
if (!a) return - 1;
if (a.match(/\.(flv)(.*)?$/i)) return TYPE_VIDEO_FLASH;
if (a.match(/\.(mp4|m4v)(.*)?$/i)) return TYPE_VIDEO_MP4;
if (a.match(/\.(ogv|ogg)(.*)?$/i)) return TYPE_VIDEO_OGG;
if (a.match(/\.(webm)(.*)?$/i)) return TYPE_VIDEO_WEBM;
if ((a.match(/\:\/\/.*(youku\.com)/i)) || (a.match(/\:\/\/.*(youtu\.be)/i))) return TYPE_VIDEO_youku;
if (a.match(/\:\/\/.*(vimeo\.com)/i)) return TYPE_VIDEO_VIMEO;
return 0
},
createText: function() {
if (this.options.textstyle == 'none') return;
var m = this;
var n = $(".html5zoo-text-wrapper-" + this.id, this.container);
if (this.options.textstyle == 'static') {
n.html("
");
n.css({
display: ((this.options.textautohide) ? 'none': 'block'),
overflow: 'hidden',
width: '100%',
height: 'auto',
position: 'absolute'
});
if (this.options.textautohide) {
$(".html5zoo-slider-" + this.id, this.container).hover(function() {
$(".html5zoo-text-wrapper-" + m.id, m.container).fadeIn()
},
function() {
$(".html5zoo-text-wrapper-" + m.id, m.container).fadeOut()
})
}
switch (this.options.textpositionstatic) {
case 'top':
n.css({
left:
'0px',
top: '0px',
'margin-top': this.options.textpositionmarginstatic + 'px'
});
break;
case 'bottom':
n.css({
left:
'0px',
bottom: '0px',
'margin-bottom': this.options.textpositionmarginstatic + 'px'
});
break;
case 'topoutside':
n.css({
left:
'0px',
bottom: '100%',
'margin-bottom': this.options.textpositionmarginstatic + 'px'
});
break;
case 'bottomoutside':
n.css({
left:
'0px',
top: '100%',
'margin-top': this.options.textpositionmarginstatic + 'px'
});
break
}
} else {
n.html("
");
n.css({
display: 'none',
overflow: 'hidden',
position: 'absolute'
})
}
$("head").append("");
this.container.bind('html5zoo.switchtext',
function(f, g, h) {
var i = $(".html5zoo-text-wrapper-" + m.id, m.container);
var j = $(".html5zoo-text-bg-" + m.id, m.container);
var k = $(".html5zoo-title-" + m.id, m.container);
var l = $(".html5zoo-description-" + m.id, m.container);
if (m.options.textstyle == 'static') {
k.html(m.elemArray[h][ELEM_TITLE]);
l.html(m.elemArray[h][ELEM_DESCRIPTION]);
if (!m.elemArray[h][ELEM_TITLE] && !m.elemArray[h][ELEM_DESCRIPTION]) j.hide();
else j.show()
} else if (m.options.textstyle == 'dynamic') {
if (!m.elemArray[h][ELEM_TITLE] && !m.elemArray[h][ELEM_DESCRIPTION]) i.fadeOut();
else {
i.fadeOut(function() {
var a = 'bottomleft';
var b = m.options.textpositiondynamic;
if (b) {
b = b.split(",");
a = b[Math.floor(Math.random() * b.length)];
a = $.trim(a.toLowerCase())
}
switch (a) {
case 'topleft':
i.css({
left:
'0px',
right: '',
top: '0px',
bottom: ''
});
i.css({
margin: m.options.textpositionmargintop + 'px ' + m.options.textpositionmarginleft + 'px'
});
break;
case 'topright':
i.css({
left:
'',
right: '0px',
top: '0px',
bottom: ''
});
i.css({
margin: m.options.textpositionmargintop + 'px ' + m.options.textpositionmarginright + 'px'
});
break;
case 'bottomleft':
i.css({
left:
'0px',
right: '',
top: '',
bottom: '0px'
});
i.css({
margin: m.options.textpositionmarginbottom + 'px ' + m.options.textpositionmarginleft + 'px'
});
break;
case 'bottomright':
i.css({
left:
'',
right: '0px',
top: '',
bottom: '0px'
});
i.css({
margin: m.options.textpositionmarginbottom + 'px ' + m.options.textpositionmarginright + 'px'
});
break
}
k.html(m.elemArray[h][ELEM_TITLE]);
l.html(m.elemArray[h][ELEM_DESCRIPTION]);
var c = null;
var d = m.options.texteffect;
if (d) {
d = d.split(",");
c = d[Math.floor(Math.random() * d.length)];
c = $.trim(c.toLowerCase())
}
var e = $(".html5zoo-text-" + m.id, m.container);
switch (c) {
case 'fade':
e.hide();
i.show();
e.delay(500).fadeIn(m.options.texteffectduration);
break;
case 'slide':
e.css({
left:
'-100%',
opacity: 0,
display: 'block'
});
i.show();
e.delay(500).animate({
left: '0%',
opacity: 1
},
m.options.texteffectduration, m.options.texteffecteasing);
break;
default:
e.delay(500).show()
}
})
}
}
})
},
createStyle: function() {
$(".html5zoo-space-" + this.id, this.container).html("
");
if (this.options.isresponsive) this.container.css({
"max-width": this.options.width,
"max-height": this.options.height
});
else this.container.css({
"width": this.options.width,
"height": this.options.height
});
var a = ".html5zoo-wrapper-" + this.id + " {display:block;position:relative;width:100%;height:auto;}";
a += ".html5zoo-slider-" + this.id + " {display:block;position:relative;left:0px;top:0px;width:100%;height:auto;";
if (this.options.border > 0) a += "margin-left:-" + this.options.border + "px;border-width:" + this.options.border + "px;border-style:solid;border-color:" + this.options.bordercolor + ";";
if (this.options.borderradius > 0) a += "border-radius:" + this.options.borderradius + "px;-moz-border-radius:" + this.options.borderradius + "px;-webkit-border-radius:" + this.options.borderradius + "px;";
if (this.options.showshadow) {
var b = "0px 0px " + this.options.shadowsize + "px " + this.options.shadowcolor;
a += "box-shadow:" + b + ";-moz-box-shadow:" + b + ";-webkit-box-shadow:" + b + ";";
if (ASPlatforms.isIE678() || ASPlatforms.isIE9) {
a += "filter:progid:DXImageTransform.Microsoft.Shadow(color=" + this.options.shadowcolor + ",direction=135,strength=" + this.options.shadowsize + ");"
}
}
a += "}";
a += ".html5zoo-box-" + this.id + " {display:block;position:relative;left:0px;top:0px;width:100%;height:auto;}";
a += ".html5zoo-swipe-box-" + this.id + " {display:block;position:relative;left:0px;top:0px;width:100%;height:auto;}";
a += ".html5zoo-space-" + this.id + " {display:block;position:relative;left:0px;top:0px;width:100%;height:auto;visibility:hidden;line-height:0px;font-size:0px;}";
a += ".html5zoo-img-box-" + this.id + " {display:block;position:static;left:0px;top:0px;width:100%;height:100%;}";
a += ".html5zoo-play-" + this.id + " {display:none;position:static;left:50%;top:50%;cursor:pointer;width:" + this.options.playvideoimagewidth + "px;height:" + this.options.playvideoimageheight + "px;margin-top:-" + Math.round(this.options.playvideoimageheight / 2) + "px;margin-left:" + '-' + Math.round(this.options.playvideoimagewidth / 2) + "px; background:url('" + this.options.skinsfolder + this.options.playvideoimage + "') no-repeat left top;}";
a += ".html5zoo-video-wrapper-" + this.id + " {display:none;position:static;left:0px;top:0px;background-color:#000;text-align:center;}";
a += ".html5zoo-error-" + this.id + " {display:block;position:relative;margin:0 auto;width:80%;top:50%;color:#fff;font:16px Arial,Tahoma,Helvetica,sans-serif;}";
if (this.options.showwatermark) {
if (((this.options.watermarkstyle == 'text') && (this.options.watermarktext.length > 0)) || ((this.options.watermarkstyle == 'image') && (this.options.watermarkimage.length > 0))) {
a += ".html5zoo-watermark-" + this.id + " {" + this.options.watermarkpositioncss;
if ((this.options.watermarkstyle == 'text') && (this.options.watermarktext.length > 0)) a += this.options.watermarktextcss;
if (this.options.watermarklink) a += "cursor:pointer;";
a += "}"
}
}
if (this.options.showribbon) {
a += ".html5zoo-ribbon-" + this.id + " {display:block;position:static;";
switch (this.options.ribbonposition) {
case 'topleft':
a += "left:" + this.options.ribbonimagex + "px;top:" + this.options.ribbonimagey + "px;";
break;
case 'topright':
a += "right:" + this.options.ribbonimagex + "px;top:" + this.options.ribbonimagey + "px;";
break;
case 'bottomleft':
a += "left:" + this.options.ribbonimagex + "px;bottom:" + this.options.ribbonimagey + "px;";
break;
case 'bottomright':
a += "right:" + this.options.ribbonimagex + "px;bottom:" + this.options.ribbonimagey + "px;";
break;
case 'top':
a += "width:100%;height:auto;margin:0 auto;top:" + this.options.ribbonimagey + "px;";
case 'bottom':
a += "width:100%;height:auto;text-align:center;bottom:" + this.options.ribbonimagey + "px;"
}
a += "}"
}
a += ".html5zoo-video-wrapper-" + this.id + " video {max-width:100%;height:auto;}";
a += ".html5zoo-video-wrapper-" + this.id + " iframe, .html5zoo-video-wrapper-" + this.id + " object, .html5zoo-video-wrapper-" + this.id + " embed {position:static;top:0;left:0;width:100%;height:100%;}";
if ((this.options.navstyle == "thumbnails") && (this.options.navthumbstyle != 'imageonly')) {
a += ".html5zoo-nav-thumbnail-tite-" + this.id + " {" + this.options.navthumbtitlecss + "}";
a += ".html5zoo-nav-thumbnail-tite-" + this.id + ":hover {" + this.options.navthumbtitlehovercss + "}";
if (this.options.navthumbstyle == 'imageandtitledescription') a += ".html5zoo-nav-thumbnail-description-" + this.id + " {" + this.options.navthumbdescriptioncss + "}"
}
$("head").append("")
},
createBottomShadow: function() {
if (!this.options.showbottomshadow) return;
var a = $(".html5zoo-bottom-shadow-" + this.id, this.container);
var l = (100 - this.options.bottomshadowimagewidth) / 2;
a.css({
display: 'block',
position: 'absolute',
left: l + '%',
top: this.options.bottomshadowimagetop + '%',
width: this.options.bottomshadowimagewidth + '%',
height: 'auto'
});
a.html("
")
},
createBackgroundImage: function() {
if (!this.options.showbackgroundimage || !this.options.backgroundimage) return;
var a = $(".html5zoo-background-image-" + this.id, this.container);
var l = (100 - this.options.backgroundimagewidth) / 2;
a.css({
display: 'block',
position: 'absolute',
left: l + '%',
top: this.options.backgroundimagetop + '%',
width: this.options.backgroundimagewidth + '%',
height: 'auto'
});
a.html("
")
},
createArrows: function() {
if (this.options.arrowstyle == 'none') return;
var a = this;
var b = $(".html5zoo-arrow-left-" + this.id, this.container);
var c = $(".html5zoo-arrow-right-" + this.id, this.container);
b.css({
overflow: 'hidden',
position: 'absolute',
cursor: 'pointer',
width: this.options.arrowwidth + 'px',
height: this.options.arrowheight + 'px',
left: this.options.arrowmargin + 'px',
top: this.options.arrowtop + '%',
'margin-top': '-' + this.options.arrowheight / 2 + 'px',
background: "url('" + this.options.skinsfolder + this.options.arrowimage + "') no-repeat left top"
});
if (ASPlatforms.isIE678()) b.css({
opacity: 'inherit',
filter: 'inherit'
});
b.hover(function() {
$(this).css({
'background-position': 'left bottom'
})
},
function() {
$(this).css({
'background-position': 'left top'
})
});
b.click(function() {
a.slideRun( - 2)
});
c.css({
overflow: 'hidden',
position: 'absolute',
cursor: 'pointer',
width: this.options.arrowwidth + 'px',
height: this.options.arrowheight + 'px',
right: this.options.arrowmargin + 'px',
top: this.options.arrowtop + '%',
'margin-top': '-' + this.options.arrowheight / 2 + 'px',
background: "url('" + this.options.skinsfolder + this.options.arrowimage + "') no-repeat right top"
});
if (ASPlatforms.isIE678()) c.css({
opacity: 'inherit',
filter: 'inherit'
});
c.hover(function() {
$(this).css({
'background-position': 'right bottom'
})
},
function() {
$(this).css({
'background-position': 'right top'
})
});
c.click(function() {
a.slideRun( - 1)
});
if (this.options.arrowstyle == 'always') {
b.css({
display: 'block'
});
c.css({
display: 'block'
})
} else {
b.css({
display: 'none'
});
c.css({
display: 'none'
});
$(".html5zoo-slider-" + this.id, this.container).hover(function() {
clearTimeout(a.arrowTimeout);
if (ASPlatforms.isIE678()) {
$(".html5zoo-arrow-left-" + a.id, a.container).show();
$(".html5zoo-arrow-right-" + a.id, a.container).show()
} else {
$(".html5zoo-arrow-left-" + a.id, a.container).fadeIn();
$(".html5zoo-arrow-right-" + a.id, a.container).fadeIn()
}
},
function() {
a.arrowTimeout = setTimeout(function() {
if (ASPlatforms.isIE678()) {
$(".html5zoo-arrow-left-" + a.id, a.container).hide();
$(".html5zoo-arrow-right-" + a.id, a.container).hide()
} else {
$(".html5zoo-arrow-left-" + a.id, a.container).fadeOut();
$(".html5zoo-arrow-right-" + a.id, a.container).fadeOut()
}
},
a.options.arrowhideonmouseleave)
})
}
},
carMoveLeft: function() {
var a = $(".html5zoo-nav-container-" + this.id, this.container);
var b = $(".html5zoo-bullet-wrapper-" + this.id, this.container);
if (a.width() >= b.width()) return;
if (this.options.navshowpreview) $(".html5zoo-nav-preview-" + this.id, this.container).hide();
var c = a.width() + this.options.navspacing;
var l = (isNaN(parseInt(b.css("margin-left"))) ? 0 : parseInt(b.css("margin-left"))) - c;
if (l <= (a.width() - b.width())) l = (a.width() - b.width());
if (l >= 0) l = 0;
b.animate({
"margin-left": l
},
{
queue: false,
duration: 500,
easing: "easeOutCirc"
});
if (this.options.navthumbnavigationstyle != 'auto') this.updateCarouselLeftRightArrow(l)
},
carMoveRight: function() {
var a = $(".html5zoo-nav-container-" + this.id, this.container);
var b = $(".html5zoo-bullet-wrapper-" + this.id, this.container);
if (a.width() >= b.width()) return;
if (this.options.navshowpreview) $(".html5zoo-nav-preview-" + this.id, this.container).hide();
var c = a.width() + this.options.navspacing;
var l = (isNaN(parseInt(b.css("margin-left"))) ? 0 : parseInt(b.css("margin-left"))) + c;
if (l <= (a.width() - b.width())) l = (a.width() - b.width());
if (l >= 0) l = 0;
b.animate({
"margin-left": l
},
{
queue: false,
duration: 500,
easing: "easeOutCirc"
});
if (this.options.navthumbnavigationstyle != 'auto') this.updateCarouselLeftRightArrow(l)
},
carMoveBottom: function() {
var a = $(".html5zoo-nav-container-" + this.id, this.container);
var b = $(".html5zoo-bullet-wrapper-" + this.id, this.container);
if (a.height() >= b.height()) return;
if (this.options.navshowpreview) $(".html5zoo-nav-preview-" + this.id, this.container).hide();
var c = a.height() + this.options.navspacing;
var l = (isNaN(parseInt(b.css("margin-top"))) ? 0 : parseInt(b.css("margin-top"))) + c;
if (l <= (a.height() - b.height())) l = (a.height() - b.height());
if (l >= 0) l = 0;
b.animate({
"margin-top": l
},
{
queue: false,
duration: 500,
easing: "easeOutCirc"
});
if (this.options.navthumbnavigationstyle != 'auto') this.updateCarouselLeftRightArrow(l)
},
carMoveTop: function() {
var a = $(".html5zoo-nav-container-" + this.id, this.container);
var b = $(".html5zoo-bullet-wrapper-" + this.id, this.container);
if (a.height() >= b.height()) return;
if (this.options.navshowpreview) $(".html5zoo-nav-preview-" + this.id, this.container).hide();
var c = a.height() + this.options.navspacing;
var l = (isNaN(parseInt(b.css("margin-top"))) ? 0 : parseInt(b.css("margin-top"))) - c;
if (l <= (a.height() - b.height())) l = (a.height() - b.height());
if (l >= 0) l = 0;
b.animate({
"margin-top": l
},
{
queue: false,
duration: 500,
easing: "easeOutCirc"
});
if (this.options.navthumbnavigationstyle != 'auto') this.updateCarouselLeftRightArrow(l)
},
updateCarouselLeftRightArrow: function(l) {
var a = $(".html5zoo-nav-container-" + this.id, this.container);
var b = $(".html5zoo-bullet-wrapper-" + this.id, this.container);
if (this.options.navdirection == 'vertical') {
if (l == 0) {
$(".html5zoo-car-left-arrow-" + this.id, this.container).css({
'background-position': 'left bottom',
cursor: ''
});
$(".html5zoo-car-left-arrow-" + this.id, this.container).data('disabled', true)
} else {
$(".html5zoo-car-left-arrow-" + this.id, this.container).css({
'background-position': 'left top',
cursor: 'pointer'
});
$(".html5zoo-car-left-arrow-" + this.id, this.container).data('disabled', false)
}
if ((l == (a.height() - b.height()))) {
$(".html5zoo-car-right-arrow-" + this.id, this.container).css({
'background-position': 'right bottom',
cursor: ''
});
$(".html5zoo-car-right-arrow-" + this.id, this.container).data('disabled', true)
} else {
$(".html5zoo-car-right-arrow-" + this.id, this.container).css({
'background-position': 'right top',
cursor: 'pointer'
});
$(".html5zoo-car-right-arrow-" + this.id, this.container).data('disabled', false)
}
} else {
if (l == 0) {
$(".html5zoo-car-left-arrow-" + this.id, this.container).css({
'background-position': 'left bottom',
cursor: ''
});
$(".html5zoo-car-left-arrow-" + this.id, this.container).data('disabled', true)
} else {
$(".html5zoo-car-left-arrow-" + this.id, this.container).css({
'background-position': 'left top',
cursor: 'pointer'
});
$(".html5zoo-car-left-arrow-" + this.id, this.container).data('disabled', false)
}
if ((l == (a.width() - b.width()))) {
$(".html5zoo-car-right-arrow-" + this.id, this.container).css({
'background-position': 'right bottom',
cursor: ''
});
$(".html5zoo-car-right-arrow-" + this.id, this.container).data('disabled', true)
} else {
$(".html5zoo-car-right-arrow-" + this.id, this.container).css({
'background-position': 'right top',
cursor: 'pointer'
});
$(".html5zoo-car-right-arrow-" + this.id, this.container).data('disabled', false)
}
}
},
createNav: function() {
if ((this.options.navstyle == 'none') && (!this.options.navshowbuttons)) return;
var f = this;
var i;
var g = $(".html5zoo-nav-" + this.id, this.container);
var h = $(".html5zoo-nav-container-" + this.id, this.container);
var j = $("
");
if (this.options.navstyle == 'thumbnails') {
this.options.navimagewidth = this.options.navwidth - this.options.navborder * 2;
this.options.navimageheight = this.options.navheight - this.options.navborder * 2;
if (this.options.navthumbstyle == 'imageandtitle') this.options.navheight += this.options.navthumbtitleheight;
else if (this.options.navthumbstyle == 'imageandtitledescription') this.options.navwidth += this.options.navthumbtitlewidth
}
if (this.options.navdirection == 'vertical') {
var k = (this.options.navstyle == 'none') ? 0 : this.elemArray.length * this.options.navheight + (this.elemArray.length - 1) * this.options.navspacing;
if (this.options.navshowbuttons) {
if (this.options.navshowarrow) {
k += (k > 0) ? this.options.navspacing: 0;
k += 2 * this.options.navheight + this.options.navspacing
}
if (this.options.navshowplaypause && !this.options.navshowplaypausestandalone) {
k += (k > 0) ? this.options.navspacing: 0;
k += this.options.navheight
}
}
j.css({
height: k + "px",
width: "auto"
})
} else {
var k = (this.options.navstyle == 'none') ? 0 : this.elemArray.length * this.options.navwidth + (this.elemArray.length - 1) * this.options.navspacing;
if (this.options.navshowbuttons) {
if (this.options.navshowarrow) {
k += (k > 0) ? this.options.navspacing: 0;
k += 2 * this.options.navwidth + this.options.navspacing
}
if (this.options.navshowplaypause && !this.options.navshowplaypausestandalone) {
k += (k > 0) ? this.options.navspacing: 0;
k += this.options.navwidth
}
}
j.css({
width: k + "px",
height: "auto"
})
}
h.append(j);
var o = 0;
var q = (this.options.navdirection == 'vertical') ? this.options.navwidth: this.options.navheight;
if ((this.options.navstyle == 'thumbnails') && this.options.navshowfeaturedarrow) {
q += (this.options.navdirection == 'vertical') ? this.options.navfeaturedarrowimagewidth: this.options.navfeaturedarrowimageheight;
o = (this.options.navdirection == 'vertical') ? this.options.navfeaturedarrowimagewidth: this.options.navfeaturedarrowimageheight
}
var s = ('navmarginx' in this.options) ? this.options.navmarginx: this.options.navmargin;
var t = ('navmarginy' in this.options) ? this.options.navmarginy: this.options.navmargin;
g.css({
display: 'block',
position: 'absolute',
height: 'auto'
});
switch (this.options.navposition) {
case 'top':
j.css({
"margin-left":
'auto',
"margin-right": 'auto',
'height': q + 'px'
});
g.css({
overflow: 'hidden',
'width': '100%',
top: '0%',
left: '0px',
'margin-top': t + 'px'
});
break;
case 'topleft':
j.css({
'height':
q + 'px'
});
g.css({
overflow: 'hidden',
'max-width': '100%',
top: '0px',
left: '0px',
'margin-top': t + 'px',
'margin-left': s + 'px'
});
break;
case 'topright':
j.css({
'height':
q + 'px'
});
g.css({
overflow: 'hidden',
'max-width': '100%',
top: '0px',
right: '0px',
'margin-top': t + 'px',
'margin-right': s + 'px'
});
break;
case 'bottom':
j.css({
"margin-left":
'auto',
"margin-right": 'auto',
'margin-top': o + 'px'
});
g.css({
overflow: 'hidden',
'width': '100%',
top: '100%',
left: '0px',
'margin-top': String(t - o) + 'px'
});
break;
case 'bottomleft':
j.css({
'margin-top':
o + 'px'
});
g.css({
overflow: 'hidden',
'max-width': '100%',
bottom: '0px',
left: '0px',
'margin-bottom': t + 'px',
'margin-top': String(t - o) + 'px',
'margin-left': s + 'px'
});
break;
case 'bottomright':
j.css({
'margin-top':
o + 'px'
});
g.css({
overflow: 'hidden',
'max-width': '100%',
bottom: '0px',
right: '0px',
'margin-bottom': t + 'px',
'margin-top': String(t - o) + 'px',
'margin-right': s + 'px'
});
break;
case 'left':
j.css({
'width':
q + 'px'
});
g.css({
overflow: 'hidden',
'height': '100%',
width: q + 'px',
top: '0%',
left: '0%',
'margin-left': s + 'px'
});
h.css({
display: 'block',
position: 'absolute',
top: '0px',
bottom: '0px',
left: '0px',
right: '0px',
height: 'auto'
});
break;
case 'right':
j.css({
'margin-left':
o + 'px'
});
g.css({
overflow: 'hidden',
'height': '100%',
width: q + 'px',
top: '0%',
left: '100%',
'margin-left': String(s - o) + 'px'
});
h.css({
display: 'block',
position: 'absolute',
top: '0px',
bottom: '0px',
left: '0px',
right: '0px',
height: 'auto'
});
break
}
if (this.options.navstyle != 'none') {
var u;
for (i = 0; i < this.elemArray.length; i++) {
u = this.createNavBullet(i);
j.append(u)
}
g.mouseenter(function() {
f.pauseCarousel = true
});
g.mouseleave(function() {
f.pauseCarousel = false
});
if (f.options.navthumbnavigationstyle == 'auto') {
g.mousemove(function(e) {
if (f.options.navdirection == 'vertical') {
if (g.height() >= j.height()) return;
var d = e.pageY - g.offset().top;
if (d < 10) d = 0;
if (d > g.height() - 10) d = g.height();
var r = d / g.height();
var l = (g.height() - j.height()) * r;
j.animate({
"margin-top": l
},
{
queue: false,
duration: 20,
easing: "easeOutCubic"
})
} else {
if (g.width() >= j.width()) return;
var d = e.pageX - g.offset().left;
if (d < 10) d = 0;
if (d > g.width() - 10) d = g.width();
var r = d / g.width();
var l = (g.width() - j.width()) * r;
j.animate({
"margin-left": l
},
{
queue: false,
duration: 20,
easing: "easeOutCubic"
})
}
})
} else {
if (((f.options.navdirection == 'vertical') && (j.height() > h.height())) || ((f.options.navdirection == 'horizontal') && (j.width() > h.width()))) {
var m = f.options.navthumbnavigationarrowimagewidth + f.options.navspacing;
if (f.options.navdirection == "horizontal") {
var n = Math.floor(((g.width() - 2 * m) + f.options.navspacing) / (f.options.navwidth + f.options.navspacing));
m = Math.floor((g.width() - n * f.options.navwidth - (n - 1) * f.options.navspacing) / 2)
}
if (f.options.navdirection == 'vertical') h.css({
'margin-top': m + 'px',
'margin-bottom': m + 'px',
overflow: 'hidden'
});
else h.css({
'margin-left': m + 'px',
'margin-right': m + 'px',
overflow: 'hidden'
});
var v = $("
");
var w = $("
");
g.append(v);
g.append(w);
v.css({
overflow: 'hidden',
position: 'absolute',
cursor: 'pointer',
width: f.options.navthumbnavigationarrowimagewidth + 'px',
height: f.options.navthumbnavigationarrowimageheight + 'px',
background: "url('" + f.options.skinsfolder + f.options.navthumbnavigationarrowimage + "') no-repeat left top"
});
w.css({
overflow: 'hidden',
position: 'absolute',
cursor: 'pointer',
width: f.options.navthumbnavigationarrowimagewidth + 'px',
height: f.options.navthumbnavigationarrowimageheight + 'px',
background: "url('" + f.options.skinsfolder + f.options.navthumbnavigationarrowimage + "') no-repeat right top"
});
var p = (f.options.navdirection == 'vertical') ? (f.options.navwidth / 2 - f.options.navthumbnavigationarrowimagewidth / 2) : (f.options.navheight / 2 - f.options.navthumbnavigationarrowimageheight / 2);
if ((f.options.navposition == 'bottomleft') || (f.options.navposition == 'bottomright') || (f.options.navposition == 'bottom') || (f.options.navposition == 'right')) p += o;
if (f.options.navdirection == 'vertical') {
v.css({
top: '0px',
left: '0px',
'margin-left': p + 'px'
});
w.css({
bottom: '0px',
left: '0px',
'margin-left': p + 'px'
})
} else {
v.css({
left: '0px',
top: '0px',
'margin-top': p + 'px'
});
w.css({
right: '0px',
top: '0px',
'margin-top': p + 'px'
})
}
if (ASPlatforms.isIE678()) v.css({
opacity: 'inherit',
filter: 'inherit'
});
v.hover(function() {
if (!$(this).data('disabled')) $(this).css({
'background-position': 'left center'
})
},
function() {
if (!$(this).data('disabled')) $(this).css({
'background-position': 'left top'
})
});
v.click(function() {
if (f.options.navdirection == 'vertical') f.carMoveBottom();
else f.carMoveRight()
});
if (ASPlatforms.isIE678()) w.css({
opacity: 'inherit',
filter: 'inherit'
});
w.hover(function() {
if (!$(this).data('disabled')) $(this).css({
'background-position': 'right center'
})
},
function() {
if (!$(this).data('disabled')) $(this).css({
'background-position': 'right top'
})
});
w.click(function() {
if (f.options.navdirection == 'vertical') f.carMoveTop();
else f.carMoveLeft()
});
v.css({
display: 'block',
'background-position': 'left bottom',
cursor: ''
});
v.data('disabled', true);
w.css({
display: 'block'
})
}
}
if (f.options.navdirection == 'vertical') {
g.touchSwipe({
swipeTop: function(a) {
f.carMoveTop()
},
swipeBottom: function() {
f.carMoveBottom()
}
})
} else {
g.touchSwipe({
swipeLeft: function(a) {
f.carMoveLeft()
},
swipeRight: function() {
f.carMoveRight()
}
})
}
this.container.bind('html5zoo.switch',
function(a, b, c) {
$(".html5zoo-bullet-" + f.id + "-" + b, f.container)["bulletNormal" + f.id]();
$(".html5zoo-bullet-" + f.id + "-" + c, f.container)["bulletSelected" + f.id]()
});
if (this.options.navshowpreview) {
var x = $("
");
var y = $("
");
switch (this.options.navpreviewposition) {
case 'bottom':
y.css({
left:
'50%',
bottom: '100%',
'margin-left': '-' + Math.round(this.options.navpreviewarrowwidth / 2) + 'px'
});
break;
case 'top':
y.css({
left:
'50%',
top: '100%',
'margin-left': '-' + Math.round(this.options.navpreviewarrowwidth / 2) + 'px'
});
break;
case 'left':
y.css({
top:
'50%',
left: '100%',
'margin-top': '-' + Math.round(this.options.navpreviewarrowheight / 2) + 'px'
});
break;
case 'right':
y.css({
top:
'50%',
right: '100%',
'margin-top': '-' + Math.round(this.options.navpreviewarrowheight / 2) + 'px'
});
break
}
var z = $("
");
x.append(y);
x.append(z);
if (this.options.navshowplayvideo) {
var A = $("
");
x.append(A)
}
$(".html5zoo-wrapper-" + this.id, this.container).append(x)
}
if (this.options.navshowfeaturedarrow) {
j.append("
")
}
}
if (this.options.navshowbuttons) {
var B = (this.options.navdirection == 'vertical') ? 'top': 'left';
var C = (this.options.navstyle == 'none') ? 0 : this.options.navspacing;
if (this.options.navshowarrow) {
var D = $("
");
j.append(D);
if (this.options.navbuttonradius) D.css(ASPlatforms.applyBrowserStyles({
'border-radius': this.options.navbuttonradius + 'px'
}));
if (this.options.navbuttoncolor) D.css({
'background-color': this.options.navbuttoncolor
});
if (this.options.navarrowimage) D.css({
'background-image': "url('" + this.options.skinsfolder + this.options.navarrowimage + "')",
'background-repeat': 'no-repeat',
'background-position': 'left top'
});
D.hover(function() {
if (f.options.navbuttonhighlightcolor) $(this).css({
'background-color': f.options.navbuttonhighlightcolor
});
if (f.options.navarrowimage) $(this).css({
'background-position': 'left bottom'
})
},
function() {
if (f.options.navbuttoncolor) $(this).css({
'background-color': f.options.navbuttoncolor
});
if (f.options.navarrowimage) $(this).css({
'background-position': 'left top'
})
});
D.click(function() {
f.slideRun( - 2)
});
C = this.options.navspacing
}
if (this.options.navshowplaypause) {
var E, $navPause;
if (this.options.navshowplaypausestandalone) {
E = $("
");
this.$wrapper.append(E);
$navPause = $("
");
this.$wrapper.append($navPause);
switch (this.options.navshowplaypausestandaloneposition) {
case 'topleft':
E.css({
top:
0,
left: 0,
'margin-left': this.options.navshowplaypausestandalonemarginx + 'px',
'margin-top': this.options.navshowplaypausestandalonemarginy + 'px'
});
$navPause.css({
top: 0,
left: 0,
'margin-left': this.options.navshowplaypausestandalonemarginx + 'px',
'margin-top': this.options.navshowplaypausestandalonemarginy + 'px'
});
break;
case 'topright':
E.css({
top:
0,
right: 0,
'margin-right': this.options.navshowplaypausestandalonemarginx + 'px',
'margin-top': this.options.navshowplaypausestandalonemarginy + 'px'
});
$navPause.css({
top: 0,
right: 0,
'margin-right': this.options.navshowplaypausestandalonemarginx + 'px',
'margin-top': this.options.navshowplaypausestandalonemarginy + 'px'
});
break;
case 'bottomleft':
E.css({
bottom:
0,
left: 0,
'margin-left': this.options.navshowplaypausestandalonemarginx + 'px',
'margin-bottom': this.options.navshowplaypausestandalonemarginy + 'px'
});
$navPause.css({
bottom: 0,
left: 0,
'margin-left': this.options.navshowplaypausestandalonemarginx + 'px',
'margin-bottom': this.options.navshowplaypausestandalonemarginy + 'px'
});
break;
case 'bottomright':
E.css({
bottom:
0,
right: 0,
'margin-right': this.options.navshowplaypausestandalonemarginx + 'px',
'margin-bottom': this.options.navshowplaypausestandalonemarginy + 'px'
});
$navPause.css({
bottom: 0,
right: 0,
'margin-right': this.options.navshowplaypausestandalonemarginx + 'px',
'margin-bottom': this.options.navshowplaypausestandalonemarginy + 'px'
});
break;
case 'center':
E.css({
top:
'50%',
left: '50%',
'margin-left': '-' + Math.round(this.options.navshowplaypausestandalonewidth / 2) + 'px',
'margin-top': '-' + Math.round(this.options.navshowplaypausestandaloneheight / 2) + 'px'
});
$navPause.css({
top: '50%',
left: '50%',
'margin-left': '-' + Math.round(this.options.navshowplaypausestandalonewidth / 2) + 'px',
'margin-top': '-' + Math.round(this.options.navshowplaypausestandaloneheight / 2) + 'px'
});
break
}
} else {
E = $("
");
j.append(E);
$navPause = $("
");
j.append($navPause)
}
if (this.options.navbuttonradius) E.css(ASPlatforms.applyBrowserStyles({
'border-radius': this.options.navbuttonradius + 'px'
}));
if (this.options.navbuttoncolor) E.css({
'background-color': this.options.navbuttoncolor
});
if (this.options.navarrowimage) E.css({
'background-image': "url('" + this.options.skinsfolder + this.options.navplaypauseimage + "')",
'background-repeat': 'no-repeat',
'background-position': 'left top'
});
E.hover(function() {
if (f.options.navbuttonhighlightcolor) $(this).css({
'background-color': f.options.navbuttonhighlightcolor
});
if (f.options.navarrowimage) $(this).css({
'background-position': 'left bottom'
})
},
function() {
if (f.options.navbuttoncolor) $(this).css({
'background-color': f.options.navbuttoncolor
});
if (f.options.navarrowimage) $(this).css({
'background-position': 'left top'
})
});
E.click(function() {
f.isPaused = false;
f.loopCount = 0;
if (!f.tempPaused) f.sliderTimeout.start();
$(this).css({
display: 'none'
});
$(".html5zoo-nav-pause-" + f.id, f.container).css({
display: 'block'
})
});
if (this.options.navbuttonradius) $navPause.css(ASPlatforms.applyBrowserStyles({
'border-radius': this.options.navbuttonradius + 'px'
}));
if (this.options.navbuttoncolor) $navPause.css({
'background-color': this.options.navbuttoncolor
});
if (this.options.navarrowimage) $navPause.css({
'background-image': "url('" + this.options.skinsfolder + this.options.navplaypauseimage + "')",
'background-repeat': 'no-repeat',
'background-position': 'right top'
});
$navPause.hover(function() {
if (f.options.navbuttonhighlightcolor) $(this).css({
'background-color': f.options.navbuttonhighlightcolor
});
if (f.options.navarrowimage) $(this).css({
'background-position': 'right bottom'
})
},
function() {
if (f.options.navbuttoncolor) $(this).css({
'background-color': f.options.navbuttoncolor
});
if (f.options.navarrowimage) $(this).css({
'background-position': 'right top'
})
});
$navPause.click(function() {
f.isPaused = true;
f.sliderTimeout.stop();
$(this).css({
display: 'none'
});
$(".html5zoo-nav-play-" + f.id, f.container).css({
display: 'block'
})
});
if (this.options.navshowplaypausestandalone && this.options.navshowplaypausestandaloneautohide) {
E.css({
display: 'none'
});
$navPause.css({
display: 'none'
});
this.$wrapper.hover(function() {
if (f.isPaused) {
E.fadeIn();
$navPause.css({
display: 'none'
})
} else {
E.css({
display: 'none'
});
$navPause.fadeIn()
}
},
function() {
E.fadeOut();
$navPause.fadeOut()
})
} else {
E.css({
display: ((f.isPaused) ? 'block': 'none')
});
$navPause.css({
display: ((f.isPaused) ? 'none': 'block')
})
}
}
if (this.options.navshowarrow) {
var F = $("
");
j.append(F);
if (this.options.navbuttonradius) F.css(ASPlatforms.applyBrowserStyles({
'border-radius': this.options.navbuttonradius + 'px'
}));
if (this.options.navbuttoncolor) F.css({
'background-color': this.options.navbuttoncolor
});
if (this.options.navarrowimage) F.css({
'background-image': "url('" + this.options.skinsfolder + this.options.navarrowimage + "')",
'background-repeat': 'no-repeat',
'background-position': 'right top'
});
F.hover(function() {
if (f.options.navbuttonhighlightcolor) $(this).css({
'background-color': f.options.navbuttonhighlightcolor
});
if (f.options.navarrowimage) $(this).css({
'background-position': 'right bottom'
})
},
function() {
if (f.options.navbuttoncolor) $(this).css({
'background-color': f.options.navbuttoncolor
});
if (f.options.navarrowimage) $(this).css({
'background-position': 'right top'
})
});
F.click(function() {
f.slideRun( - 1)
})
}
}
},
createNavBullet: function(r) {
var s = this;
var f = (this.options.navdirection == 'vertical') ? 'top': 'left';
var u = (this.options.navdirection == 'vertical') ? 'bottom': 'right';
var v = (r == this.elemArray.length - 1) ? 0 : this.options.navspacing;
var w = (this.options.navstyle == 'thumbnails') ? this.options.navwidth - this.options.navborder * 2 : this.options.navwidth;
var h = (this.options.navstyle == 'thumbnails') ? this.options.navheight - this.options.navborder * 2 : this.options.navheight;
var x = $("
");
x.data('index', r);
x.hover(function() {
if ($(this).data('index') != s.curElem) $(this)["bulletHighlight" + s.id]();
var d = $(this).data('index');
if (s.options.navswitchonmouseover) {
if (d != s.curElem) s.slideRun(d)
}
if (s.options.navshowpreview) {
var e = $(".html5zoo-nav-preview-" + s.id, s.container);
var f = $(".html5zoo-nav-preview-images-" + s.id, e);
if (s.options.navshowplayvideo) {
var g = $(".html5zoo-nav-preview-play-" + s.id, e);
if (s.elemArray[d][ELEM_VIDEO].length > 0) g.show();
else g.hide()
}
var h = $(".html5zoo-nav-" + s.id, s.container);
var i = $(".html5zoo-bullet-wrapper-" + s.id, s.container);
var j = $(this).position();
var k = h.position();
var m = i.position();
j.left += k.left + m.left;
j.left += (isNaN(parseInt(i.css('margin-left'))) ? 0 : parseInt(i.css('margin-left')));
j.left += (isNaN(parseInt(h.css('margin-left'))) ? 0 : parseInt(h.css('margin-left')));
j.top += k.top + m.top;
j.top += (isNaN(parseInt(i.css('margin-top'))) ? 0 : parseInt(i.css('margin-top')));
j.top += (isNaN(parseInt(h.css('margin-top'))) ? 0 : parseInt(h.css('margin-top')));
if (s.options.navdirection == 'vertical') {
var n = $(".html5zoo-nav-container-" + s.id, s.container);
j.top += (isNaN(parseInt(n.css('margin-top'))) ? 0 : parseInt(n.css('margin-top')))
}
var t, l = j.left + s.options.navwidth / 2 - s.options.navpreviewwidth / 2 - s.options.navpreviewborder;
var o, tv = j.top + s.options.navheight / 2 - s.options.navpreviewheight / 2 - s.options.navpreviewborder;
var p = {};
switch (s.options.navpreviewposition) {
case 'bottom':
t = j.top + s.options.navheight + s.options.navpreviewarrowheight;
p = {
left: l + 'px',
top: t + 'px'
};
break;
case 'top':
t = j.top - s.options.navpreviewheight - 2 * s.options.navpreviewborder - s.options.navpreviewarrowheight;
p = {
left: l + 'px',
top: t + 'px'
};
break;
case 'left':
o = j.left - s.options.navpreviewwidth - 2 * s.options.navpreviewborder - s.options.navpreviewarrowwidth;
p = {
left: o + 'px',
top: tv + 'px'
};
break;
case 'right':
o = j.left + s.options.navwidth + s.options.navpreviewarrowwidth;
p = {
left: o + 'px',
top: tv + 'px'
};
break
}
var q = new Image();
$(q).load(function() {
var a;
if (this.width / this.height <= s.options.navpreviewwidth / s.options.navpreviewheight) a = "width:" + s.options.navpreviewwidth + "px;height:auto;margin-top:-" + Math.floor((this.height / this.width) * s.options.navpreviewwidth / 2 - s.options.navpreviewheight / 2) + "px";
else a = "width:auto;height:" + s.options.navpreviewheight + "px;margin-left:-" + Math.floor((this.width / this.height) * s.options.navpreviewheight / 2 - s.options.navpreviewwidth / 2) + "px";
var b = $(".html5zoo-nav-preview-img-" + s.id, f);
if (s.options.navdirection == 'vertical') {
var c = $("
");
f.append(c);
if (b.length > 0) {
b.animate({
top: '-' + s.options.navpreviewheight + 'px'
},
function() {
b.remove()
})
}
if (e.is(":visible")) {
c.animate({
top: '0px'
});
e.stop(true, true).animate(p)
} else {
c.css({
top: '0px'
});
e.stop(true, true).css(p).fadeIn()
}
} else {
var c = $("
");
f.append(c);
if (b.length > 0) {
b.animate({
left: '-' + s.options.navpreviewwidth + 'px'
},
function() {
b.remove()
})
}
if (e.is(":visible")) {
c.animate({
left: '0px'
});
e.stop(true, true).animate(p)
} else {
c.css({
left: '0px'
});
e.stop(true, true).css(p).fadeIn()
}
}
});
q.src = s.elemArray[d][ELEM_THUMBNAIL]
}
},
function() {
if ($(this).data('index') != s.curElem) $(this)["bulletNormal" + s.id]();
if (s.options.navshowpreview) {
var a = $(".html5zoo-nav-preview-" + s.id, s.container);
a.delay(500).fadeOut()
}
});
x.click(function() {
s.slideRun($(this).data('index'))
});
if (this.options.navstyle == 'bullets') {
x.css({
background: "url('" + this.options.skinsfolder + this.options.navimage + "') no-repeat left top"
});
$.fn["bulletNormal" + this.id] = function() {
$(this).css({
'background-position': 'left top'
})
};
$.fn["bulletHighlight" + this.id] = $.fn["bulletSelected" + this.id] = function() {
$(this).css({
'background-position': 'left bottom'
})
}
} else if (this.options.navstyle == 'numbering') {
x.text(r + 1);
x.css({
'background-color': this.options.navcolor,
color: this.options.navfontcolor,
'font-size': this.options.navfontsize,
'font-family': this.options.navfont,
'text-align': 'center',
'line-height': this.options.navheight + 'px'
});
x.css(ASPlatforms.applyBrowserStyles({
'border-radius': this.options.navradius + 'px'
}));
if (this.options.navbuttonshowbgimage && this.options.navbuttonbgimage) {
x.css({
background: "url('" + this.options.skinsfolder + this.options.navbuttonbgimage + "') no-repeat center top"
})
}
$.fn["bulletNormal" + this.id] = function() {
$(this).css({
'background-color': s.options.navcolor,
'color': s.options.navfontcolor
});
if (s.options.navbuttonshowbgimage && s.options.navbuttonbgimage) $(this).css({
'background-position': 'center top'
})
};
$.fn["bulletHighlight" + this.id] = $.fn["bulletSelected" + this.id] = function() {
$(this).css({
'background-color': s.options.navhighlightcolor,
'color': s.options.navfonthighlightcolor
});
if (s.options.navbuttonshowbgimage && s.options.navbuttonbgimage) $(this).css({
'background-position': 'center bottom'
})
}
} else if (this.options.navstyle == 'thumbnails') {
x.css({
padding: this.options.navborder + 'px',
'background-color': this.options.navbordercolor
});
x.css({
opacity: this.options.navopacity,
filter: "alpha(opacity=" + Math.round(100 * this.options.navopacity) + ")"
});
var y = new Image();
var s = this;
$(y).load(function() {
var a;
if (this.width / this.height <= s.options.navimagewidth / s.options.navimageheight) a = "max-width:none !important;width:100%;height:auto;margin-top:-" + Math.floor((this.height / this.width) * s.options.navimagewidth / 2 - s.options.navimageheight / 2) + "px";
else a = "max-width:none !important;width:auto;height:100%;margin-left:-" + Math.floor((this.width / this.height) * s.options.navimageheight / 2 - s.options.navimagewidth / 2) + "px";
x.append("
");
if ((s.options.navshowplayvideo) && (s.elemArray[r][ELEM_VIDEO].length > 0)) {
x.append("
")
}
if (s.options.navthumbstyle != 'imageonly') {
var b = "
" + s.elemArray[r][ELEM_TITLE] + "
";
if (s.options.navthumbstyle == 'imageandtitledescription') b += "
" + s.elemArray[r][ELEM_DESCRIPTION] + "
";
b += "
";
x.append(b)
}
});
y.src = this.elemArray[r][ELEM_THUMBNAIL];
$.fn["bulletNormal" + this.id] = function() {
$(this).css({
opacity: s.options.navopacity,
filter: "alpha(opacity=" + Math.round(100 * s.options.navopacity) + ")"
})
};
$.fn["bulletHighlight" + this.id] = function() {
$(this).css({
opacity: 1,
filter: "alpha(opacity=100)"
})
};
$.fn["bulletSelected" + this.id] = function() {
$(this).css({
opacity: 1,
filter: "alpha(opacity=100)"
});
if (s.options.navshowfeaturedarrow) {
var a = $(".html5zoo-nav-featuredarrow-" + s.id, s.container);
var b = $(this).position();
var c = $(".html5zoo-nav-container-" + s.id, s.container);
var d = $(".html5zoo-bullet-wrapper-" + s.id, s.container);
if (s.options.navdirection == 'horizontal') {
var t, l = b.left + s.options.navwidth / 2 - s.options.navfeaturedarrowimagewidth / 2;
if ((s.options.navposition == 'top') || (s.options.navposition == 'topleft') || (s.options.navposition == 'topright')) t = b.top + s.options.navheight;
else t = b.top - s.options.navfeaturedarrowimageheight;
a.css({
top: t + 'px'
});
if (a.is(":visible")) {
a.stop(true, true).animate({
left: l + 'px'
})
} else {
a.css({
display: 'block',
left: l + 'px'
})
}
if ((c.width() < d.width()) && !s.pauseCarousel) {
var m = Math.abs(isNaN(parseInt(d.css("margin-left"))) ? 0 : parseInt(d.css("margin-left")));
if ((b.left < m) || ((b.left + s.options.navwidth) > m + c.width())) {
var e = -b.left;
if (e <= (c.width() - d.width())) e = (c.width() - d.width());
if (e >= 0) e = 0;
d.animate({
"margin-left": e + 'px'
},
{
queue: false,
duration: 500,
easing: "easeOutCirc"
});
s.updateCarouselLeftRightArrow(e)
}
}
} else {
var l, t = b.top + s.options.navheight / 2 - s.options.navfeaturedarrowimageheight / 2;
if (s.options.navposition == 'left') l = b.left + s.options.navwidth;
else l = b.left - s.options.navfeaturedarrowimagewidth;
a.css({
left: l + 'px'
});
if (a.is(":visible")) {
a.stop(true, true).animate({
top: t + 'px'
})
} else {
a.css({
display: 'block',
top: t + 'px'
})
}
if ((c.height() < d.height()) && !s.pauseCarousel) {
var m = Math.abs(isNaN(parseInt(d.css("margin-top"))) ? 0 : parseInt(d.css("margin-top")));
if ((b.top < m) || ((b.top + s.options.navheight) > m + c.height())) {
var e = -b.top;
if (e <= (c.height() - d.height())) e = (c.height() - d.height());
if (e >= 0) e = 0;
d.animate({
"margin-top": e + 'px'
},
{
queue: false,
duration: 500,
easing: "easeOutCirc"
});
s.updateCarouselLeftRightArrow(e)
}
}
}
}
}
}
return x
},
slideRun: function(a) {
savedCur = this.curElem;
this.calcIndex(a);
if (savedCur == this.curElem) return;
if (this.isAnimating) {
if (this.transitionTimeout) clearTimeout(this.transitionTimeout);
$(".html5zoo-img-box-" + this.id, this.container).unbind('transitionFinished').html("