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("alt") : '';
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 () {
// åŠ height:" + this.options.height + "px',是为了æè¿°æ–‡å—,ä¸è®ºæ¨¡å—高度怎么å˜ï¼Œæ°¸è¿œåœ¨åº•éƒ¨
$(".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:absolute;left:0px;top:0px;width:100%;height:100%;}";
a += ".html5zoo-play-" + this.id + " {display:none;position:absolute;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:absolute;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:absolute;";
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:absolute;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);
var c = $(".html5zoo-img-box-" + this.id, this.container).css({ height: this.options.height });
var d = $(".html5zoo-img-" + this.id, this.container);
$(".html5zoo-img-box-" + this.id, this.container).unbind('transitionFinished').html("
");
this.isAnimating = false
}
this.sliderTimeout.stop();
this.tempPaused = false;
this.container.trigger('html5zoo.switch', [savedCur, this.curElem]);
$(".html5zoo-video-wrapper-" + this.id, this.container).find("iframe").each(function() {
$(this).attr('src', '')
});
if (this.options.autoplayvideo && (this.elemArray[this.curElem][ELEM_VIDEO].length > 0)) {
this.playVideo(true)
} else {
$(".html5zoo-video-wrapper-" + this.id, this.container).css({
display: 'none'
}).empty();
this.container.trigger('html5zoo.switchtext', [savedCur, this.curElem]);
var b = true;
if (a == -2) b = false;
else if (a == 1) b = true;
else if (a >= 0) b = (this.curElem > savedCur) ? true: false;
this.showImage(b)
} (new Image()).src = this.elemArray[this.prevElem][ELEM_SRC]; (new Image()).src = this.elemArray[this.nextElem][ELEM_SRC];
if (!this.options.randomplay && (this.options.loop > 0)) {
if (this.curElem == this.elemArray.length - 1) {
this.loopCount++;
if (this.options.loop <= this.loopCount) this.isPaused = true
}
}
if ((!this.isPaused) && (!this.tempPaused) && (this.elemArray.length > 1)) {
this.sliderTimeout.start()
}
},
showImage: function(g) {
var h = this;
var i = new Image();
$(i).load(function() {
var b = 100;
var c = $(".html5zoo-img-box-" + h.id, h.container);
var d = $(".html5zoo-img-" + h.id, h.container);
var e = $("
");
c.css({ height: h.options.height });
d.css({ height: h.options.height });
if(h.options.imgshowtype == 'fullscreen') e.find('img').css({ width: c.innerWidth(), height: h.options.height });
else e.find('img').css({ height: h.options.height });
/*
// 现在图片是高度按模å—高度,宽度是文档宽度
// TODO 图片从æ£ä¸å±€éƒ¨æ”¾å¤§
// 高度为模å—高度,图片从æ£ä¸å±€éƒ¨æ”¾å¤§
c.css({ height: h.options.height });
var winWidth = Math.max($(window).width(), $('body').width());
if (this.width < winWidth) {
e.find('img').css({ width: winWidth, height: h.options.height });
} else {
var left = -(this.width - winWidth) / 2;
console.log('left:' + left);
c.width(c.width() - left);
c.css({ left: left });
e.find('img').css({ width: this.width, height: h.options.height });
}
*/
if (d.length > 0) d.before(e);
else c.append(e);
if(h.options.imgshowtype == 'center'){
var left = (c.width() - e.find('img').width()) / 2;
e.find('img').css('left',(left / c.width() * 100) + '%');
}
e.find('img').css('visibility','visible');
var f = (h.firstslide && !h.options.transitiononfirstslide) ? '': h.options.transition;
h.firstslide = false;
h.isAnimating = true;
c.html5zooTransition(h.id, d, e, {
effect: f,
direction: g,
duration: h.options.transitionduration,
easing: h.options.transitioneasing,
crossfade: h.options.crossfade,
fade: h.options.fade,
slide: h.options.slide,
slice: h.options.slice,
blinds: h.options.blinds,
threed: h.options.threed,
threedhorizontal: h.options.threedhorizontal,
blocks: h.options.blocks,
shuffle: h.options.shuffle
},
function() {
h.isAnimating = false
},
function(a) {
h.transitionTimeout = a
});
if (h.elemArray[h.curElem][ELEM_LINK]) {
c.css({
cursor: 'pointer'
});
c.unbind('click').bind('click',
function() {
if (h.elemArray[h.curElem][ELEM_LIGHTBOX]) {
h.html5Lightbox.showItem(h.elemArray[h.curElem][ELEM_LINK])
} else {
var a = (h.elemArray[h.curElem][ELEM_TARGET]) ? h.elemArray[h.curElem][ELEM_TARGET] : '_self';
window.open(h.elemArray[h.curElem][ELEM_LINK], a)
}
})
} else {
c.css({
cursor: ''
});
c.unbind('click')
}
$(".html5zoo-play-" + h.id, h.container).css({
display: ((h.elemArray[h.curElem][ELEM_VIDEO].length > 0) ? 'block': 'none')
})
});
i.src = this.elemArray[this.curElem][ELEM_SRC]
},
calcIndex: function(a) {
var r;
if (a == -2) {
this.nextElem = this.curElem;
this.curElem = this.prevElem;
this.prevElem = ((this.curElem - 1) < 0) ? (this.elemArray.length - 1) : (this.curElem - 1);
if (this.options.randomplay) {
r = Math.floor(Math.random() * this.elemArray.length);
if (r != this.curElem) this.prevElem = r
}
} else if (a == -1) {
this.prevElem = this.curElem;
this.curElem = this.nextElem;
this.nextElem = ((this.curElem + 1) >= this.elemArray.length) ? 0 : (this.curElem + 1);
if (this.options.randomplay) {
r = Math.floor(Math.random() * this.elemArray.length);
if (r != this.curElem) this.nextElem = r
}
} else if (a >= 0) {
this.curElem = a;
this.prevElem = ((this.curElem - 1) < 0) ? (this.elemArray.length - 1) : (this.curElem - 1);
this.nextElem = ((this.curElem + 1) >= this.elemArray.length) ? 0 : (this.curElem + 1);
if (this.options.randomplay) {
r = Math.floor(Math.random() * this.elemArray.length);
if (r != this.curElem) this.prevElem = r;
r = Math.floor(Math.random() * this.elemArray.length);
if (r != this.curElem) this.nextElem = r
}
}
}
};
G = G || {};
for (var K in G) {
if (K.toLowerCase() !== K) {
G[K.toLowerCase()] = G[K];
delete G[K]
}
}
this.each(function() {
this.options = $.extend({},
G);
var c = this;
$.each($(this).data(),
function(a, b) {
c.options[a.toLowerCase()] = b
});
var d = {};
var e = window.location.search.substring(1).split("&");
for (var i = 0; i < e.length; i++) {
var f = e[i].split("=");
if (f && (f.length == 2)) {
var g = f[0].toLowerCase();
var h = unescape(f[1]).toLowerCase();
if (h == "true") d[g] = true;
else if (h == "false") d[g] = false;
else d[g] = h
}
}
this.options = $.extend(this.options, d);
var j = {
previewmode: false,
isresponsive: true,
autoplay: false,
pauseonmouseover: true,
slideinterval: 5000,
randomplay: false,
loop: 0,
skinsfoldername: 'skins',
showtimer: true,
timerposition: 'bottom',
timercolor: '#ffffff',
timeropacity: 0.6,
timerheight: 2,
autoplayvideo: false,
playvideoimage: 'play-video.png',
playvideoimagewidth: 64,
playvideoimageheight: 64,
enabletouchswipe: true,
border: 6,
bordercolor: '#ffffff',
borderradius: 0,
showshadow: true,
shadowsize: 5,
shadowcolor: '#aaaaaa',
showbottomshadow: false,
bottomshadowimage: 'bottom-shadow.png',
bottomshadowimagewidth: 140,
bottomshadowimagetop: 90,
showbackgroundimage: false,
backgroundimage: 'background.png',
backgroundimagewidth: 120,
backgroundimagetop: -10,
arrowstyle: 'mouseover',
arrowimage: 'arrows.png',
arrowwidth: 32,
arrowheight: 32,
arrowmargin: 0,
arrowhideonmouseleave: 1000,
arrowtop: 50,
showribbon: false,
ribbonimage: 'ribbon_topleft-0.png',
ribbonposition: 'topleft',
ribbonimagex: -11,
ribbonimagey: -11,
textstyle: 'static',
textpositionstatic: 'bottom',
textautohide: false,
textpositionmarginstatic: 0,
textpositiondynamic: 'topleft,topright,bottomleft,bottomright',
textpositionmarginleft: 24,
textpositionmarginright: 24,
textpositionmargintop: 24,
textpositionmarginbottom: 24,
texteffect: 'slide',
texteffecteasing: 'easeOutCubic',
texteffectduration: 600,
addfonts: true,
fonts: "Inder",
textcss: 'display:block; padding:12px; text-align:left;',
textbgcss: 'display:block; position:absolute; top:0px; left:0px; width:100%; height:100%; background-color:#333333; opacity:0.6; filter:alpha(opacity=60);',
titlecss: 'display:block; position:relative; font:bold 14px Inder,Arial,Tahoma,Helvetica,sans-serif; color:#fff;',
descriptioncss: 'display:block; position:relative; font:12px Anaheim,Arial,Tahoma,Helvetica,sans-serif; color:#fff;',
shownumbering: false,
numberingformat: "%NUM/%TOTAL ",
navstyle: 'thumbnails',
navswitchonmouseover: false,
navdirection: 'horizontal',
navposition: 'bottom',
navmargin: 24,
navwidth: 64,
navheight: 60,
navspacing: 8,
navshowpreview: true,
navpreviewposition: 'top',
navpreviewarrowimage: 'preview-arrow.png',
navpreviewarrowwidth: 20,
navpreviewarrowheight: 10,
navpreviewwidth: 120,
navpreviewheight: 60,
navpreviewborder: 8,
navpreviewbordercolor: '#ffff00',
navimage: 'bullets.png',
navradius: 0,
navcolor: '',
navhighlightcolor: '',
navfont: 'Lucida Console, Arial',
navfontcolor: '#666666',
navfonthighlightcolor: '#666666',
navfontsize: 12,
navbuttonshowbgimage: true,
navbuttonbgimage: 'navbuttonbgimage.png',
navshowbuttons: false,
navbuttonradius: 2,
navbuttoncolor: '#999999',
navbuttonhighlightcolor: '#333333',
navshowplaypause: true,
navshowarrow: true,
navplaypauseimage: 'nav-play-pause.png',
navarrowimage: 'nav-arrows.png',
navshowplaypausestandalone: false,
navshowplaypausestandaloneautohide: false,
navshowplaypausestandaloneposition: 'bottomright',
navshowplaypausestandalonemarginx: 24,
navshowplaypausestandalonemarginy: 24,
navshowplaypausestandalonewidth: 32,
navshowplaypausestandaloneheight: 32,
navopacity: 0.8,
navborder: 2,
navbordercolor: '#ff6600',
navshowfeaturedarrow: true,
navfeaturedarrowimage: 'featured-arrow.png',
navfeaturedarrowimagewidth: 20,
navfeaturedarrowimageheight: 10,
navthumbstyle: 'imageonly',
navthumbtitleheight: 20,
navthumbtitlewidth: 120,
navthumbtitlecss: 'display:block;position:relative;padding:2px 4px;text-align:left;font:bold 14px Arial,Helvetica,sans-serif;color:#333;',
navthumbtitlehovercss: 'text-decoration:underline;',
navthumbdescriptioncss: 'display:block;position:relative;padding:2px 4px;text-align:left;font:normal 12px Arial,Helvetica,sans-serif;color:#333;',
navthumbnavigationstyle: 'arrow',
navthumbnavigationarrowimage: 'carousel-arrows-32-32-0.png',
navthumbnavigationarrowimagewidth: 32,
navthumbnavigationarrowimageheight: 32,
navshowplayvideo: true,
navplayvideoimage: 'play-32-32-0.png',
transitiononfirstslide: false,
transition: 'slide',
transitionduration: 1000,
transitioneasing: 'easeOutQuad',
fade: {
duration: 1000,
easing: 'easeOutQuad'
},
crossfade: {
duration: 1000,
easing: 'easeOutQuad'
},
slide: {
duration: 1000,
easing: 'easeOutElastic'
},
slice: {
duration: 1500,
easing: 'easeOutQuad',
effects: "up,down,updown",
slicecount: 8
},
blinds: {
duration: 1500,
easing: 'easeOutQuad',
slicecount: 4
},
threed: {
duration: 1500,
easing: 'easeOutQuad',
slicecount: 4,
fallback: 'slice',
bgcolor: '#222222',
perspective: 1000,
perspectiveorigin: 'right',
scatter: 5
},
threedhorizontal: {
duration: 1500,
easing: 'easeOutQuad',
slicecount: 3,
fallback: 'slice',
bgcolor: '#222222',
perspective: 1000,
perspectiveorigin: 'bottom',
scatter: 5
},
blocks: {
duration: 1500,
easing: 'easeOutQuad',
effects: 'topleft, bottomright, top, bottom, random',
rowcount: 4,
columncount: 3
},
shuffle: {
duration: 1500,
easing: 'easeOutQuad',
rowcount: 4,
columncount: 3
},
versionmark: 'AMFree',
showwatermarkdefault: true,
watermarkstyledefault: 'text',
watermarktextdefault: '',
watermarkimagedefault: '',
watermarklinkdefault: 'http://childcloud.cn',
watermarktargetdefault: '_blank',
watermarkpositioncssdefault: 'display:block;position:absolute;bottom:6px;right:6px;',
watermarktextcssdefault: 'font:12px Arial,Tahoma,Helvetica,sans-serif;color:#666;padding:2px 4px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background-color:#fff;opacity:0.9;filter:alpha(opacity=90);',
watermarklinkcssdefault: 'text-decoration:none;font:12px Arial,Tahoma,Helvetica,sans-serif;color:#333;',
imgshowtype : 'fullscreen'
};
this.options = $.extend(j, this.options);
if (this.options.versionmark != ('AMCom')) {
this.options.showwatermark = (window.location.href.indexOf('://amazingslider.com') >= 0) ? false: this.options.showwatermarkdefault;
this.options.watermarkstyle = this.options.watermarkstyledefault;
this.options.watermarktext = this.options.watermarktextdefault;
this.options.watermarkimage = this.options.watermarkimagedefault;
this.options.watermarklink = this.options.watermarklinkdefault;
this.options.watermarktarget = this.options.watermarktargetdefault;
this.options.watermarkpositioncss = this.options.watermarkpositioncssdefault;
this.options.watermarktextcss = this.options.watermarktextcssdefault;
this.options.watermarklinkcss = this.options.watermarklinkcssdefault
}
if (typeof html5zoo_previewmode != 'undefined') this.options.previewmode = html5zoo_previewmode;
this.options.htmlfolder = window.location.href.substr(0, window.location.href.lastIndexOf("/") + 1);
if (this.options.skinsfoldername.length > 0) this.options.skinsfolder = this.options.jsfolder + this.options.skinsfoldername + '/';
else this.options.skinsfolder = this.options.jsfolder;
new J($(this), this.options, html5zooId++)
})
}
})(jQuery); (function($) {
$.fn.html5zooTransition = function(a, b, c, d, e, f) {
var g = this;
var h = d.effect;
var i = d.duration;
var j = d.easing;
var k = d.direction;
var l = null;
if (h) {
h = h.split(",");
l = h[Math.floor(Math.random() * h.length)];
l = $.trim(l.toLowerCase())
}
if (((l == 'threed') || (l == 'threedhorizontal')) && (!ASPlatforms.css33dTransformSupported())) {
l = d[l].fallback
}
if (l && d[l]) {
if (d[l].duration) i = d[l].duration;
if (d[l].easing) j = d[l].easing
}
if (l == "fade") {
g.css({
overflow: 'hidden'
});
c.show();
b.fadeOut(i, j,
function() {
b.remove();
e()
})
} else if (l == "crossfade") {
g.css({
overflow: 'hidden'
});
c.hide();
b.fadeOut(i / 2, j,
function() {
c.fadeIn(i / 2, j,
function() {
b.remove();
e()
})
})
} else if (l == 'slide') {
g.css({
overflow: 'hidden'
});
if (k) {
c.css({
left: '100%'
});
c.animate({
left: '0%'
},
i, j);
b.animate({
left: '-100%'
},
i, j,
function() {
b.remove();
e()
})
} else {
c.css({
left: '-100%'
});
c.animate({
left: '0%'
},
i, j);
b.animate({
left: '100%'
},
i, j,
function() {
b.remove();
e()
})
}
} else if (l == 'slice') {
g.css({
overflow: 'hidden'
});
g.sliceTransition(a, b, c, $.extend({
duration: i,
easing: j,
direction: k
},
d['slice']), e, f)
} else if (l == 'blinds') {
g.css({
overflow: 'hidden'
});
g.blindsTransition(a, b, c, $.extend({
duration: i,
easing: j,
direction: k
},
d['blinds']), e, f)
} else if (l == 'threed') {
g.css({
overflow: 'visible'
});
g.threedTransition(a, b, c, $.extend({
duration: i,
easing: j,
direction: k
},
d['threed']), e, f)
} else if (l == 'threedhorizontal') {
g.css({
overflow: 'visible'
});
g.threedHorizontalTransition(a, b, c, $.extend({
duration: i,
easing: j,
direction: k
},
d['threedhorizontal']), e, f)
} else if (l == 'blocks') {
g.css({
overflow: 'hidden'
});
g.blocksTransition(a, b, c, $.extend({
duration: i,
easing: j,
direction: k
},
d['blocks']), e, f)
} else if (l == 'shuffle') {
g.css({
overflow: 'visible'
});
g.shuffleTransition(a, b, c, $.extend({
duration: i,
easing: j,
direction: k
},
d['shuffle']), e, f)
} else {
c.show();
b.remove();
e()
}
};
$.fn.sliceTransition = function(b, c, d, e, f, g) {
var i, index;
var h = this;
var w = h.width();
var j = Math.ceil(w / e.slicecount);
d.hide();
for (i = 0; i < e.slicecount; i++) {
var k = $("
");
var l = $('img', d).clone().css({
'max-width': '',
left: '-' + j * i + 'px'
});
l.attr('style', l.attr('style') + '; max-width:' + w + 'px !important;');
k.append(l);
h.append(k)
}
var m = $('.html5zoo-img-slice-' + b, h);
if (!e.direction) m = $($.makeArray(m).reverse());
var n = e.effects.split(",");
var o = n[Math.floor(Math.random() * n.length)];
o = $.trim(o.toLowerCase());
h.unbind('transitionFinished').bind('transitionFinished',
function() {
h.unbind('transitionFinished');
c.remove();
d.show();
m.remove();
f()
});
var p = e.duration / 2;
var q = e.duration / 2 / e.slicecount;
index = 0;
m.each(function() {
var a = $(this);
switch (o) {
case 'up':
a.css({
top:
'',
bottom: '0%',
height: '0%'
});
break;
case 'down':
a.css({
top:
'0%',
height: '0%'
});
break;
case 'updown':
if (index % 2 == 0) a.css({
top: '0%',
height: '0%'
});
else a.css({
top: '',
bottom: '0%',
height: '0%'
});
break
}
setTimeout(function() {
a.animate({
height: '100%'
},
p, e.easing)
},
q * index);
index++
});
var r = setTimeout(function() {
h.trigger('transitionFinished')
},
e.duration);
g(r)
};
$.fn.blindsTransition = function(c, d, e, f, g, h) {
var i, index;
var j = this;
var w = j.width();
var k = Math.ceil(w / f.slicecount);
e.hide();
for (i = 0; i < f.slicecount; i++) {
var l = $("
");
var m = $("
");
var n = $('img', e).clone().css({
'max-width': '',
left: '-' + k * i + 'px'
});
n.attr('style', n.attr('style') + '; max-width:' + w + 'px !important;');
m.append(n);
l.append(m);
j.append(l)
}
var o = $('.html5zoo-img-slice-' + c, j);
if (!f.direction) o = $($.makeArray(o).reverse());
j.unbind('transitionFinished').bind('transitionFinished',
function() {
j.unbind('transitionFinished');
d.remove();
e.show();
$('.html5zoo-img-slice-wrapper-' + c, j).remove();
g()
});
index = 0;
o.each(function() {
var a = $(this);
var b;
if (!f.direction) {
a.css({
left: '',
right: '-100%'
});
b = {
right: '0%'
}
} else {
a.css({
left: '-100%'
});
b = {
left: '0%'
}
}
a.animate(b, f.duration * (index + 1) / f.slicecount, f.easing);
index++
});
var p = setTimeout(function() {
j.trigger('transitionFinished')
},
f.duration);
h(p)
};
$.fn.threedTransition = function(d, e, f, g, j, k) {
var i, index;
var l = this;
var w = l.width(),
h = l.height(),
dist = h / 2;
var m = Math.ceil(w / g.slicecount);
var n = $("
");
l.append(n);
n.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'perspective': g.perspective,
'perspective-origin': g.perspectiveorigin + ' center'
}));
f.hide();
for (i = 0; i < g.slicecount; i++) {
var o = $('img', f).clone().css({
'max-width': '',
left: '-' + m * i + 'px'
});
o.attr('style', o.attr('style') + '; max-width:' + w + 'px !important;');
var p = $("
");
p.append(o);
var q = $('img', e).clone().css({
'max-width': '',
left: '-' + m * i + 'px'
});
q.attr('style', q.attr('style') + '; max-width:' + w + 'px !important;');
var r = $("
");
r.append(q);
var s = $("
");
var t = $("
");
var u = $("
");
u.append(s);
u.append(t);
u.append(p);
u.append(r);
n.append(u);
s.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden',
'transform': 'rotateY(-90deg) translateZ(' + dist + 'px)'
}));
t.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden',
'transform': 'rotateY(90deg) translateZ(' + (m - dist) + 'px)'
}));
r.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden',
'transform': 'translateZ(' + dist + 'px)'
}));
p.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden',
'transform': 'rotateX(' + ((g.direction) ? '90': '-90') + 'deg) translateZ(' + dist + 'px)'
}))
}
var v = $('.html5zoo-img-cube-' + d, l);
l.unbind('transitionFinished').bind('transitionFinished',
function() {
l.unbind('transitionFinished');
e.remove();
f.show();
setTimeout(function() {
n.remove()
},
100);
j()
});
var x = g.duration / 2 / g.slicecount;
var y = g.duration / 2;
v.each(function() {
$(this).css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden'
}));
$(this).css(ASPlatforms.applyBrowserStyles({
'transition-property': 'transform'
},
true));
$(this).css(ASPlatforms.applyBrowserStyles({
'transform': 'translateZ(-' + dist + 'px)'
}))
});
e.hide();
index = 0;
v.each(function() {
var a = $(this);
var b = (g.slicecount - 1) / 2;
var c = Math.round((index - b) * g.scatter * w / 100);
setTimeout(function() {
a.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden'
}));
a.css(ASPlatforms.applyBrowserStyles({
'transition-property': 'transform'
},
true));
a.css(ASPlatforms.applyBrowserStyles({
'transition-duration': y + 'ms',
'transform': 'translateZ(-' + dist + 'px) rotateX(' + ((g.direction) ? '-89.99': '89.99') + 'deg)'
}));
a.animate({
left: '+=' + c + 'px'
},
y / 2 - 50,
function() {
a.animate({
left: '-=' + c + 'px'
},
y / 2 - 50)
})
},
x * index + 100);
index++
});
var z = setTimeout(function() {
l.trigger('transitionFinished')
},
g.duration);
k(z)
};
$.fn.threedHorizontalTransition = function(d, e, f, g, j, k) {
var i, index;
var l = this;
var w = l.width(),
h = l.height(),
dist = w / 2;
var m = Math.ceil(h / g.slicecount);
var n = $("
");
l.append(n);
n.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'perspective': g.perspective,
'perspective-origin': 'center ' + g.perspectiveorigin
}));
f.hide();
for (i = 0; i < g.slicecount; i++) {
var o = $('img', f).clone().css({
'max-height': '',
top: '-' + m * i + 'px'
});
o.attr('style', o.attr('style') + '; max-height:' + h + 'px !important;');
var p = $("
");
p.append(o);
var q = $('img', e).clone().css({
'max-height': '',
top: '-' + m * i + 'px'
});
q.attr('style', q.attr('style') + '; max-height:' + h + 'px !important;');
var r = $("
");
r.append(q);
var s = $("
");
var t = $("
");
var u = $("
");
u.append(s);
u.append(t);
u.append(p);
u.append(r);
n.append(u);
s.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden',
'transform': 'rotateX(90deg) translateZ(' + dist + 'px)'
}));
t.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden',
'transform': 'rotateX(-90deg) translateZ(' + (m - dist) + 'px)'
}));
r.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden',
'transform': 'translateZ(' + dist + 'px)'
}));
p.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden',
'transform': 'rotateY(' + ((g.direction) ? '-90': '90') + 'deg) translateZ(' + dist + 'px)'
}))
}
var v = $('.html5zoo-img-cube-' + d, l);
l.unbind('transitionFinished').bind('transitionFinished',
function() {
l.unbind('transitionFinished');
e.remove();
f.show();
setTimeout(function() {
n.remove()
},
100);
j()
});
var x = g.duration / 2 / g.slicecount;
var y = g.duration / 2;
v.each(function() {
$(this).css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden'
}));
$(this).css(ASPlatforms.applyBrowserStyles({
'transition-property': 'transform'
},
true));
$(this).css(ASPlatforms.applyBrowserStyles({
'transform': 'translateZ(-' + dist + 'px)'
}))
});
e.hide();
index = 0;
v.each(function() {
var a = $(this);
var b = (g.slicecount - 1) / 2;
var c = Math.round((index - b) * g.scatter * h / 100);
setTimeout(function() {
a.css(ASPlatforms.applyBrowserStyles({
'transform-style': 'preserve-3d',
'backface-visibility': 'hidden'
}));
a.css(ASPlatforms.applyBrowserStyles({
'transition-property': 'transform'
},
true));
a.css(ASPlatforms.applyBrowserStyles({
'transition-duration': y + 'ms',
'transform': 'translateZ(-' + dist + 'px) rotateY(' + ((g.direction) ? '89.99': '-89.99') + 'deg)'
}));
a.animate({
top: '+=' + c + 'px'
},
y / 2 - 50,
function() {
a.animate({
top: '-=' + c + 'px'
},
y / 2 - 50)
})
},
x * index + 100);
index++
});
var z = setTimeout(function() {
l.trigger('transitionFinished')
},
g.duration);
k(z)
};
$.fn.blocksTransition = function(c, d, e, f, g, k) {
var i, j, index;
var l = this;
var w = l.width(),
h = l.height();
var m = Math.ceil(w / f.columncount);
var n = Math.ceil(h / f.rowcount);
var o = f.effects.split(",");
var p = o[Math.floor(Math.random() * o.length)];
p = $.trim(p.toLowerCase());
e.hide();
for (i = 0; i < f.rowcount; i++) {
for (j = 0; j < f.columncount; j++) {
var q = $("
");
var r = $("
");
var s = $('img', e).clone().css({
'max-width': '',
'max-height': '',
left: '-' + m * j + 'px',
top: '-' + n * i + 'px'
});
s.attr('style', s.attr('style') + '; max-width:' + w + 'px !important;max-height:' + h + 'px !important;');
r.append(s);
q.append(r);
l.append(q)
}
}
var t = $('.html5zoo-img-block-' + c, l);
l.unbind('transitionFinished').bind('transitionFinished',
function() {
l.unbind('transitionFinished');
d.remove();
e.show();
$('.html5zoo-img-block-wrapper-' + c, l).remove();
g()
});
if ((p == 'bottomright') || (p == 'bottom')) t = $($.makeArray(t).reverse());
else if (p == 'random') t = $($.makeArray(t).sort(function() {
return 0.5 - Math.random()
}));
index = 0;
t.each(function() {
var a = $(this);
var b, col;
b = Math.floor(index / f.columncount);
col = index % f.columncount;
a.hide();
switch (p) {
case 'topleft':
case 'bottomright':
a.delay(f.duration * (b + col) / (f.rowcount + f.columncount)).fadeIn();
break;
case 'top':
case 'bottom':
case 'random':
a.delay(f.duration * index / (f.rowcount * f.columncount)).fadeIn();
break
}
index++
});
var u = setTimeout(function() {
l.trigger('transitionFinished')
},
f.duration);
k(u)
};
$.fn.shuffleTransition = function(f, g, k, l, m, n) {
var i, j, index;
var o = this;
var w = o.width(),
h = o.height();
var p = Math.ceil(w / l.columncount);
var q = Math.ceil(h / l.rowcount);
for (i = 0; i < l.rowcount; i++) {
for (j = 0; j < l.columncount; j++) {
var r = $("
");
var s = $("
");
var t = $('img', k).clone().css({
'max-width': '',
'max-height': '',
left: '-' + p * j + 'px',
top: '-' + q * i + 'px'
});
t.attr('style', t.attr('style') + '; max-width:' + w + 'px !important;max-height:' + h + 'px !important;');
s.append(t);
r.append(s);
o.append(r);
var u = $("
");
var v = $("
");
var x = $('img', g).clone().css({
'max-width': '',
'max-height': '',
left: '-' + p * j + 'px',
top: '-' + q * i + 'px'
});
x.attr('style', x.attr('style') + '; max-width:' + w + 'px !important;max-height:' + h + 'px !important;');
v.append(x);
u.append(v);
o.append(u)
}
}
k.hide();
g.hide();
var y = $('.html5zoo-img-block-wrapper-next-' + f, o);
var z = $('.html5zoo-img-block-wrapper-prev-' + f, o);
o.unbind('transitionFinished').bind('transitionFinished',
function() {
o.unbind('transitionFinished');
g.remove();
k.show();
$('.html5zoo-img-block-wrapper-next-' + f, o).remove();
$('.html5zoo-img-block-wrapper-prev-' + f, o).remove();
m()
});
var A = o.offset();
var B = -A.left;
var C = $(window).width() - A.left - o.width() / l.columncount;
var D = -A.top * 100 / o.height();
var E = $(window).height() - A.top - o.height() / l.rowcount;
index = 0;
z.each(function() {
var a = $(this);
var b = Math.random() * (C - B) + B;
var c = Math.random() * (E - D) + D;
a.animate({
left: b + 'px',
top: c + 'px',
opacity: 0
},
l.duration, l.easing);
index++
});
index = 0;
y.each(function() {
var a = $(this);
var b = Math.floor(index / l.columncount);
var c = index % l.columncount;
var d = Math.random() * (C - B) + B;
var e = Math.random() * (E - D) + D;
a.css({
left: d + 'px',
top: e + 'px',
opacity: 0
},
l.duration, l.easing);
a.animate({
left: c * p + 'px',
top: b * q + 'px',
opacity: 1
},
l.duration, l.easing);
index++
});
var F = setTimeout(function() {
o.trigger('transitionFinished')
},
l.duration);
n(F)
}
})(jQuery); (function($) {
$.fn.touchSwipe = function(d) {
var f = {
swipeLeft: null,
swipeRight: null,
swipeTop: null,
swipeBottom: null
};
if (d) $.extend(f, d);
return this.each(function() {
var b = -1,
startY = -1;
var c = -1,
curY = -1;
function touchStart(a) {
var e = a.originalEvent;
if (e.targetTouches.length >= 1) {
b = e.targetTouches[0].pageX;
startY = e.targetTouches[0].pageY
} else {
touchCancel(a)
}
};
function touchMove(a) {
var e = a.originalEvent;
if (e.targetTouches.length >= 1) {
c = e.targetTouches[0].pageX;
curY = e.targetTouches[0].pageY
} else {
touchCancel(a)
}
};
function touchEnd(a) {
if ((c > 0) || (curY > 0)) {
triggerHandler();
touchCancel(a)
} else {
touchCancel(a)
}
};
function touchCancel(a) {
b = -1;
startY = -1;
c = -1;
curY = -1
};
function triggerHandler() {
if (c > b) {
if (f.swipeRight) f.swipeRight.call()
} else {
if (f.swipeLeft) f.swipeLeft.call()
}
if (curY > startY) {
if (f.swipeBottom) f.swipeBottom.call()
} else {
if (f.swipeTop) f.swipeTop.call()
}
};
try {
$(this).bind('touchstart', touchStart);
$(this).bind('touchmove', touchMove);
$(this).bind('touchend', touchEnd);
$(this).bind('touchcancel', touchCancel)
} catch(e) {}
})
}
})(jQuery);
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend(jQuery.easing, {
def: 'easeOutQuad',
swing: function(x, t, b, c, d) {
return jQuery.easing[jQuery.easing.def](x, t, b, c, d)
},
easeInQuad: function(x, t, b, c, d) {
return c * (t /= d) * t + b
},
easeOutQuad: function(x, t, b, c, d) {
return - c * (t /= d) * (t - 2) + b
},
easeInOutQuad: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return c / 2 * t * t + b;
return - c / 2 * ((--t) * (t - 2) - 1) + b
},
easeInCubic: function(x, t, b, c, d) {
return c * (t /= d) * t * t + b
},
easeOutCubic: function(x, t, b, c, d) {
return c * ((t = t / d - 1) * t * t + 1) + b
},
easeInOutCubic: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
return c / 2 * ((t -= 2) * t * t + 2) + b
},
easeInQuart: function(x, t, b, c, d) {
return c * (t /= d) * t * t * t + b
},
easeOutQuart: function(x, t, b, c, d) {
return - c * ((t = t / d - 1) * t * t * t - 1) + b
},
easeInOutQuart: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
return - c / 2 * ((t -= 2) * t * t * t - 2) + b
},
easeInQuint: function(x, t, b, c, d) {
return c * (t /= d) * t * t * t * t + b
},
easeOutQuint: function(x, t, b, c, d) {
return c * ((t = t / d - 1) * t * t * t * t + 1) + b
},
easeInOutQuint: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
return c / 2 * ((t -= 2) * t * t * t * t + 2) + b
},
easeInSine: function(x, t, b, c, d) {
return - c * Math.cos(t / d * (Math.PI / 2)) + c + b
},
easeOutSine: function(x, t, b, c, d) {
return c * Math.sin(t / d * (Math.PI / 2)) + b
},
easeInOutSine: function(x, t, b, c, d) {
return - c / 2 * (Math.cos(Math.PI * t / d) - 1) + b
},
easeInExpo: function(x, t, b, c, d) {
return (t == 0) ? b: c * Math.pow(2, 10 * (t / d - 1)) + b
},
easeOutExpo: function(x, t, b, c, d) {
return (t == d) ? b + c: c * ( - Math.pow(2, -10 * t / d) + 1) + b
},
easeInOutExpo: function(x, t, b, c, d) {
if (t == 0) return b;
if (t == d) return b + c;
if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
return c / 2 * ( - Math.pow(2, -10 * --t) + 2) + b
},
easeInCirc: function(x, t, b, c, d) {
return - c * (Math.sqrt(1 - (t /= d) * t) - 1) + b
},
easeOutCirc: function(x, t, b, c, d) {
return c * Math.sqrt(1 - (t = t / d - 1) * t) + b
},
easeInOutCirc: function(x, t, b, c, d) {
if ((t /= d / 2) < 1) return - c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b
},
easeInElastic: function(x, t, b, c, d) {
var s = 1.70158;
var p = 0;
var a = c;
if (t == 0) return b;
if ((t /= d) == 1) return b + c;
if (!p) p = d * .3;
if (a < Math.abs(c)) {
a = c;
var s = p / 4
} else var s = p / (2 * Math.PI) * Math.asin(c / a);
return - (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b
},
easeOutElastic: function(x, t, b, c, d) {
var s = 1.70158;
var p = 0;
var a = c;
if (t == 0) return b;
if ((t /= d) == 1) return b + c;
if (!p) p = d * .3;
if (a < Math.abs(c)) {
a = c;
var s = p / 4
} else var s = p / (2 * Math.PI) * Math.asin(c / a);
return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b
},
easeInOutElastic: function(x, t, b, c, d) {
var s = 1.70158;
var p = 0;
var a = c;
if (t == 0) return b;
if ((t /= d / 2) == 2) return b + c;
if (!p) p = d * (.3 * 1.5);
if (a < Math.abs(c)) {
a = c;
var s = p / 4
} else var s = p / (2 * Math.PI) * Math.asin(c / a);
if (t < 1) return - .5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b
},
easeInBack: function(x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c * (t /= d) * t * ((s + 1) * t - s) + b
},
easeOutBack: function(x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b
},
easeInOutBack: function(x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b
},
easeInBounce: function(x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b
},
easeOutBounce: function(x, t, b, c, d) {
if ((t /= d) < (1 / 2.75)) {
return c * (7.5625 * t * t) + b
} else if (t < (2 / 2.75)) {
return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b
} else if (t < (2.5 / 2.75)) {
return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b
} else {
return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b
}
},
easeInOutBounce: function(x, t, b, c, d) {
if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b
}
});
if (typeof ASyoukuIframeAPIReady === 'undefined') {
var ASyoukuIframeAPIReady = false;
var ASyoukuTimeout = 0;
function onyoukuIframeAPIReady() {
ASyoukuIframeAPIReady = true
}
}
if (typeof html5zooId === 'undefined') {
var html5zooId = 0
};// END OF /scripts/jQPlugins/html5zoo.js
// STARTS OF /scripts/jQPlugins/lovelygallery.js
function CoolSlide(obj, height, effect,time,imgshowtype) {
var scripts = document.getElementsByTagName("script");
var jsFolder = "";
for (var i= 0; i< scripts.length; i++)
{
if( scripts[i].src && scripts[i].src.match(/lovelygallery\.js/i))
jsFolder = scripts[i].src.substr(0, scripts[i].src.lastIndexOf("/") + 1);
}
var params = {
height: height,
effect: effect,
time: time,
imgshowtype:imgshowtype
};
$(obj).data('params', params);
//height = "auto";
var win_width = $(window).width()>$(document).width()? $(window).width():$(document).width(); //$(window).width();
if(!imgshowtype && imgshowtype == '') imgshowtype = 'fullscreen';
jQuery(obj).html5zoo({
imgshowtype: imgshowtype, //图片显示方å¼ï¼Œ fullscreen = 平铺, center = å±…ä¸
jsfolder:jsFolder,
width:win_width,
height: height,
skinsfoldername:"",
loadimageondemand:false,
isresponsive:false,
autoplayvideo:false,
pauseonmouseover:true,
addmargin:true,
randomplay:false,
slideinterval: time, // 控制时间
enabletouchswipe:true,
transitiononfirstslide:false,
loop:0,
autoplay:true,
navplayvideoimage: "../../images/play-32-32-0.png",
navpreviewheight:60,
timerheight:2,
shownumbering:false,
skin:"Frontpage",
navshowplaypause:true,
navshowplayvideo:true,
navshowplaypausestandalonemarginx:8,
navshowplaypausestandalonemarginy:8,
navbuttonradius:0,
navthumbnavigationarrowimageheight:32,
navmarginy:-20,
showshadow:false,
navfeaturedarrowimagewidth:16,
navpreviewwidth:120,
textpositionmarginright:24,
bordercolor:"#ffffff",
navthumbnavigationarrowimagewidth:32,
navthumbtitlehovercss:"text-decoration:underline;",
navcolor:"#999999",
arrowwidth:48,
texteffecteasing:"easeOutCubic",
texteffect:"fade",
navspacing:12,
playvideoimage: "../../images/arrows-48-48-3.png",
ribbonimage: "../../images/ribbon_topleft-0.png",
navwidth:10,
showribbon:false,
arrowimage: "../../images/arrows-48-48-3.png",
timeropacity:0.6,
navthumbnavigationarrowimage: "../../images/carouselarrows-32-32-0.png",
navshowplaypausestandalone:false,
navpreviewbordercolor:"#ffffff",
ribbonposition:"topleft",
navthumbdescriptioncss:"display:block;position:relative;padding:2px 4px;text-align:left;font:normal 12px Arial,Helvetica,sans-serif;color:#333;",
arrowstyle:"mouseover",
navthumbtitleheight:20,
textpositionmargintop:24,
navswitchonmouseover:false,
navarrowimage: "../../images/navarrows-28-28-0.png",
arrowtop:50,
textstyle:"static",
playvideoimageheight:64,
navfonthighlightcolor:"#666666",
showbackgroundimage:false,
navpreviewborder:4,
navopacity:0.8,
shadowcolor:"#aaaaaa",
navbuttonshowbgimage:true,
navbuttonbgimage: "../../images/navbuttonbgimage-28-28-0.png",
textbgcss:"display:block; position:absolute; top:0px; left:0px; width:100%; height:100%; background-color:#333333; opacity:0.6; filter:alpha(opacity=60);",
navdirection:"horizontal",
navborder:4,
bottomshadowimagewidth:110,
showtimer:false,
navradius:0,
navshowpreview:true,
navpreviewarrowheight:8,
navmarginx:16,
navfeaturedarrowimage: "../../images/featuredarrow-16-8-0.png",
navfeaturedarrowimageheight:8,
navstyle:"bullets",
textpositionmarginleft:24,
descriptioncss:"display:block; position:relative; margin-top:4px; font:14px Inder,Arial,Tahoma,Helvetica,sans-serif; color:#fff;",
navplaypauseimage: "../../images/navplaypause-28-28-0.png",
backgroundimagetop:-10,
timercolor:"#ffffff",
numberingformat:"%NUM/%TOTAL ",
navfontsize:12,
navhighlightcolor:"#333333",
navimage: "../../images/bullet-24-24-4.png",
navheight:10,
navshowplaypausestandaloneautohide:false,
navbuttoncolor:"#999999",
navshowarrow:true,
navshowfeaturedarrow:false,
titlecss:"display:block; position:relative; font:16px Inder,Arial,Tahoma,Helvetica,sans-serif; color:#fff;",
ribbonimagey:0,
ribbonimagex:0,
navshowplaypausestandaloneposition:"bottomright",
shadowsize:5,
arrowhideonmouseleave:win_width,
navshowplaypausestandalonewidth:28,
navshowplaypausestandaloneheight:28,
backgroundimagewidth:120,
textautohide:true,
navthumbtitlewidth:120,
navpreviewposition:"top",
playvideoimagewidth:64,
arrowheight:48,
arrowmargin:0,
texteffectduration:win_width,
bottomshadowimage: "../../images/bottomshadow-110-100-5.png",
border:0,
timerposition:"bottom",
navfontcolor:"#333333",
navthumbnavigationstyle:"arrow",
borderradius:0,
navbuttonhighlightcolor:"#333333",
textpositionstatic:"bottom",
navthumbstyle:"imageonly",
textcss:"display:block; padding:12px; text-align:left;",
navbordercolor:"#ffffff",
navpreviewarrowimage:"../../images/previewarrow-16-8-0.png",
showbottomshadow:false,
textpositionmarginstatic:0,
backgroundimage:"",
navposition:"bottom",
navpreviewarrowwidth:16,
bottomshadowimagetop:100,
textpositiondynamic:"bottomleft",
navshowbuttons:false,
navthumbtitlecss:"display:block;position:relative;padding:2px 4px;text-align:left;font:bold 14px Arial,Helvetica,sans-serif;color:#333;",
textpositionmarginbottom:24,
ribbonmarginy:0,
ribbonmarginx:0,
slide: {
duration:win_width,
easing:"easeOutCubic",
checked:true
},
crossfade: {
duration:win_width,
easing:"easeOutCubic",
checked:true
},
threedhorizontal: {
checked:true,
bgcolor:"",
perspective:win_width,
slicecount:1,
duration:1500,
easing:"easeOutCubic",
fallback:"slice",
scatter:5,
perspectiveorigin:"bottom"
},
slice: {
duration:1500,
easing:"easeOutCubic",
checked:true,
effects:"up,down,updown",
slicecount:10
},
fade: {
duration:win_width,
easing:"easeOutCubic",
checked:true
},
blocks: {
columncount:5,
checked:true,
rowcount:5,
effects:"topleft,bottomright,top,bottom,random",
duration:1500,
easing:"easeOutCubic"
},
blinds: {
duration:2000,
easing:"easeOutCubic",
checked:true,
slicecount:3
},
shuffle: {
duration:1500,
easing:"easeOutCubic",
columncount:5,
checked:true,
rowcount:5
},
threed: {
checked:true,
bgcolor:"#222222",
perspective:win_width,
slicecount:5,
duration:1500,
easing:"easeOutCubic",
fallback:"slice",
scatter:5,
perspectiveorigin:"right"
},
transition:effect//"slide,crossfade,threedhorizontal,slice,fade,blocks,blinds,shuffle,threed"
});
};// END OF /scripts/jQPlugins/lovelygallery.js
// STARTS OF /scripts/jQuery/jquery.validate.min.js
/*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* https://github.com/jzaefferer/jquery-validation
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."),void 0;var i=t.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(e.target).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(e.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(e){function s(){var s;return i.settings.submitHandler?(i.submitButton&&(s=t("
").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),!1):!0}return i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,s()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):s():(i.focusInvalid(),!1)})),i)},valid:function(){if(t(this[0]).is("form"))return this.validate().form();var e=!0,i=t(this[0].form).validate();return this.each(function(){e=e&&i.element(this)}),e},removeAttrs:function(e){var i={},s=this;return t.each(e.split(/\s/),function(t,e){i[e]=s.attr(e),s.removeAttr(e)}),i},rules:function(e,i){var s=this[0];if(e){var r=t.data(s.form,"validator").settings,n=r.rules,a=t.validator.staticRules(s);switch(e){case"add":t.extend(a,t.validator.normalizeRule(i)),delete a.messages,n[s.name]=a,i.messages&&(r.messages[s.name]=t.extend(r.messages[s.name],i.messages));break;case"remove":if(!i)return delete n[s.name],a;var u={};return t.each(i.split(/\s/),function(t,e){u[e]=a[e],delete a[e]}),u}}var o=t.validator.normalizeRules(t.extend({},t.validator.classRules(s),t.validator.attributeRules(s),t.validator.dataRules(s),t.validator.staticRules(s)),s);if(o.required){var l=o.required;delete o.required,o=t.extend({required:l},o)}return o}}),t.extend(t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){return!!t.trim(""+t(e).val())},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return 1===arguments.length?function(){var i=t.makeArray(arguments);return i.unshift(e),t.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(t)).hide())},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){(9!==e.which||""!==this.elementValue(t))&&(t.name in this.submitted||t===this.lastElement)&&this.element(t)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(s):t(e).addClass(i).removeClass(s)},unhighlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(s):t(e).removeClass(i).addClass(s)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:t.validator.format("Please enter no more than {0} characters."),minlength:t.validator.format("Please enter at least {0} characters."),rangelength:t.validator.format("Please enter a value between {0} and {1} characters long."),range:t.validator.format("Please enter a value between {0} and {1}."),max:t.validator.format("Please enter a value less than or equal to {0}."),min:t.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function e(e){var i=t.data(this[0].form,"validator"),s="on"+e.type.replace(/^validate/,"");i.settings[s]&&i.settings[s].call(i,this[0],e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i=this.groups={};t.each(this.settings.groups,function(e,s){"string"==typeof s&&(s=s.split(/\s/)),t.each(s,function(t,s){i[s]=e})});var s=this.settings.rules;t.each(s,function(e,i){s[e]=t.validator.normalizeRule(i)}),t(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",e).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",e),this.settings.invalidHandler&&t(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(e){e=this.validationTargetFor(this.clean(e)),this.lastElement=e,this.prepareElement(e),this.currentElements=t(e);var i=this.check(e)!==!1;return i?delete this.invalid[e.name]:this.invalid[e.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(e){if(e){t.extend(this.errorMap,e),this.errorList=[];for(var i in e)this.errorList.push({message:e[i],element:this.findByName(i)[0]});this.successList=t.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){t.fn.resetForm&&t(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e=0;for(var i in t)e++;return e},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return t(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!e.objectLength(t(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(e){return t(e)[0]},errors:function(){var e=this.settings.errorClass.replace(" ",".");return t(this.settings.errorElement+"."+e,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([]),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var i=t(e).attr("type"),s=t(e).val();return"radio"===i||"checkbox"===i?t("input[name='"+t(e).attr("name")+"']:checked").val():"string"==typeof s?s.replace(/\r/g,""):s},check:function(e){e=this.validationTargetFor(this.clean(e));var i,s=t(e).rules(),r=!1,n=this.elementValue(e);for(var a in s){var u={method:a,parameters:s[a]};try{if(i=t.validator.methods[a].call(this,n,e,u.parameters),"dependency-mismatch"===i){r=!0;continue}if(r=!1,"pending"===i)return this.toHide=this.toHide.not(this.errorsFor(e)),void 0;if(!i)return this.formatAndAdd(e,u),!1}catch(o){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+u.method+"' method.",o),o}}return r?void 0:(this.objectLength(s)&&this.successList.push(e),!0)},customDataMessage:function(e,i){return t(e).data("msg-"+i.toLowerCase())||e.attributes&&t(e).attr("data-msg-"+i.toLowerCase())},customMessage:function(t,e){var i=this.settings.messages[t];return i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var t=0;arguments.length>t;t++)if(void 0!==arguments[t])return arguments[t];return void 0},defaultMessage:function(e,i){return this.findDefined(this.customMessage(e.name,i),this.customDataMessage(e,i),!this.settings.ignoreTitle&&e.title||void 0,t.validator.messages[i],"
Warning: No message defined for "+e.name+" ")},formatAndAdd:function(e,i){var s=this.defaultMessage(e,i.method),r=/\$?\{(\d+)\}/g;"function"==typeof s?s=s.call(this,i.parameters,e):r.test(s)&&(s=t.validator.format(s.replace(r,"{$1}"),i.parameters)),this.errorList.push({message:s,element:e}),this.errorMap[e.name]=s,this.submitted[e.name]=s},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e;for(t=0;this.errorList[t];t++){var i=this.errorList[t];this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return t(this.errorList).map(function(){return this.element})},showLabel:function(e,i){var s=this.errorsFor(e);s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(i)):(s=t("<"+this.settings.errorElement+">").attr("for",this.idOrName(e)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(s=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(s).length||(this.settings.errorPlacement?this.settings.errorPlacement(s,t(e)):s.insertAfter(e))),!i&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,e)),this.toShow=this.toShow.add(s)},errorsFor:function(e){var i=this.idOrName(e);return this.errors().filter(function(){return t(this).attr("for")===i})},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name).not(this.settings.ignore)[0]),t},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return t(this.currentForm).find("[name='"+e+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return t("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return e.length},depend:function(t,e){return this.dependTypes[typeof t]?this.dependTypes[typeof t](t,e):!0},dependTypes:{"boolean":function(t){return t},string:function(e,i){return!!t(e,i.form).length},"function":function(t,e){return t(e)}},optional:function(e){var i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,this.pending[t.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,0>this.pendingRequest&&(this.pendingRequest=0),delete this.pending[e.name],i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e){return t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var i={},s=t(e).attr("class");return s&&t.each(s.split(" "),function(){this in t.validator.classRuleSettings&&t.extend(i,t.validator.classRuleSettings[this])}),i},attributeRules:function(e){var i={},s=t(e),r=s[0].getAttribute("type");for(var n in t.validator.methods){var a;"required"===n?(a=s.get(0).getAttribute(n),""===a&&(a=!0),a=!!a):a=s.attr(n),/min|max/.test(n)&&(null===r||/number|range|text/.test(r))&&(a=Number(a)),a?i[n]=a:r===n&&"range"!==r&&(i[n]=!0)}return i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete i.maxlength,i},dataRules:function(e){var i,s,r={},n=t(e);for(i in t.validator.methods)s=n.data("rule-"+i.toLowerCase()),void 0!==s&&(r[i]=s);return r},staticRules:function(e){var i={},s=t.data(e.form,"validator");return s.settings.rules&&(i=t.validator.normalizeRule(s.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return t.each(e,function(s,r){if(r===!1)return delete e[s],void 0;if(r.param||r.depends){var n=!0;switch(typeof r.depends){case"string":n=!!t(r.depends,i.form).length;break;case"function":n=r.depends.call(i,i)}n?e[s]=void 0!==r.param?r.param:!0:delete e[s]}}),t.each(e,function(s,r){e[s]=t.isFunction(r)?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(i=e[this].split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(e.min&&e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),e.minlength&&e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return e},addMethod:function(e,i,s){t.validator.methods[e]=i,t.validator.messages[e]=void 0!==s?s:t.validator.messages[e],3>i.length&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,s){if(!this.depend(s,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var r=t(i).val();return r&&r.length>0}return this.checkable(i)?this.getLength(e,i)>0:t.trim(e).length>0},email:function(t,e){return this.optional(e)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)},url:function(t,e){return this.optional(e)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)},date:function(t,e){return this.optional(e)||!/Invalid|NaN/.test(""+new Date(t))},dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)},number:function(t,e){return this.optional(e)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},creditcard:function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i=0,s=0,r=!1;t=t.replace(/\D/g,"");for(var n=t.length-1;n>=0;n--){var a=t.charAt(n);s=parseInt(a,10),r&&(s*=2)>9&&(s-=9),i+=s,r=!r}return 0===i%10},minlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s},maxlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||s>=r},rangelength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s[0]&&s[1]>=r},min:function(t,e,i){return this.optional(e)||t>=i},max:function(t,e,i){return this.optional(e)||i>=t},range:function(t,e,i){return this.optional(e)||t>=i[0]&&i[1]>=t},equalTo:function(e,i,s){var r=t(s);return this.settings.onfocusout&&r.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,s){if(this.optional(i))return"dependency-mismatch";var r=this.previousValue(i);if(this.settings.messages[i.name]||(this.settings.messages[i.name]={}),r.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=r.message,s="string"==typeof s&&{url:s}||s,r.old===e)return r.valid;r.old=e;var n=this;this.startRequest(i);var a={};return a[i.name]=e,t.ajax(t.extend(!0,{url:s,mode:"abort",port:"validate"+i.name,dataType:"json",data:a,success:function(s){n.settings.messages[i.name].remote=r.originalMessage;var a=s===!0||"true"===s;if(a){var u=n.formSubmitted;n.prepareElement(i),n.formSubmitted=u,n.successList.push(i),delete n.invalid[i.name],n.showErrors()}else{var o={},l=s||n.defaultMessage(i,"remote");o[i.name]=r.message=t.isFunction(l)?l(e):l,n.invalid[i.name]=!0,n.showErrors(o)}r.valid=a,n.stopRequest(i,a)}},s)),"pending"}}}),t.format=t.validator.format})(jQuery),function(t){var e={};if(t.ajaxPrefilter)t.ajaxPrefilter(function(t,i,s){var r=t.port;"abort"===t.mode&&(e[r]&&e[r].abort(),e[r]=s)});else{var i=t.ajax;t.ajax=function(s){var r=("mode"in s?s:t.ajaxSettings).mode,n=("port"in s?s:t.ajaxSettings).port;return"abort"===r?(e[n]&&e[n].abort(),e[n]=i.apply(this,arguments),e[n]):i.apply(this,arguments)}}}(jQuery),function(t){t.extend(t.fn,{validateDelegate:function(e,i,s){return this.bind(i,function(i){var r=t(i.target);return r.is(e)?s.apply(r,arguments):void 0})}})}(jQuery);
;jQuery.validator.addMethod("CellPhone", function (value, element, params) {
var reg = /^[1][358]\d{9}$/;
return this.optional(element) || reg.test(value.replace(/\s/ig,""));
}, "例13800138000");
jQuery.validator.addMethod("isTel", function (value) {
var tel = /((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/;
return value ? tel.test(value) : true;
}, "例0757-82345678");
jQuery.validator.addMethod("CkDN", function (value) {
var reg = /^([a-zA-Z0-9\u4e00-\u9fa5][-a-zA-Z0-9\u4e00-\u9fa5]{0,62}(\.[a-zA-Z0-9\u4e00-\u9fa5][-a-zA-Z0-9\u4e00-\u9fa5]{0,62})+\.?)/;
return value ? reg.test(value) : true;
}, "输入域å的域åä¸æ£ç¡®ï¼");;// END OF /scripts/jQuery/jquery.validate.min.js
// STARTS OF /share/jquery.vticker-min.js
/*
* vertical news ticker
* Tadas Juozapaitis ( kasp3rito@gmail.com )
* http://plugins.jquery.com/project/vTicker
*/
(function (a) { a.fn.vTicker = function (b) { var c = { speed: 700, pause: 4000, showItems: 3, animation: "", mousePause: true, isPaused: false, direction: "up", height: 0 }; var b = a.extend(c, b); moveUp = function (g, d, e) { if (e.isPaused) { return } var f = g.children("ul"); var h = f.children("li:first").clone(true); if (e.height > 0) { d = f.children("li:first").height() } f.animate({ top: "-=" + d + "px" }, e.speed, function () { a(this).children("li:first").remove(); a(this).css("top", "0px") }); if (e.animation == "fade") { f.children("li:first").fadeOut(e.speed); if (e.height == 0) { f.children("li:eq(" + e.showItems + ")").hide().fadeIn(e.speed) } } h.appendTo(f) }; moveDown = function (g, d, e) { if (e.isPaused) { return } var f = g.children("ul"); var h = f.children("li:last").clone(true); if (e.height > 0) { d = f.children("li:first").height() } f.css("top", "-" + d + "px").prepend(h); f.animate({ top: 0 }, e.speed, function () { a(this).children("li:last").remove() }); if (e.animation == "fade") { if (e.height == 0) { f.children("li:eq(" + e.showItems + ")").fadeOut(e.speed) } f.children("li:first").hide().fadeIn(e.speed) } }; return this.each(function () { var f = a(this); var e = 0; f.css({ overflow: "hidden", position: "relative" }).children("ul").css({ position: "absolute", margin: 0, padding: 0 }).children("li").css({ margin: 0, padding: 0 }); if (b.height == 0) { f.children("ul").children("li").each(function () { if (a(this).height() > e) { e = a(this).height() } }); f.children("ul").children("li").each(function () { a(this).height(e) }); f.height(e * b.showItems) } else { f.height(b.height) } var d = setInterval(function () { if (b.direction == "up") { moveUp(f, e, b) } else { moveDown(f, e, b) } }, b.pause); if (b.mousePause) { f.bind("mouseenter", function () { b.isPaused = true }).bind("mouseleave", function () { b.isPaused = false }) } }) } })(jQuery);;// END OF /share/jquery.vticker-min.js
// STARTS OF /share/jquery.easyslider-min.js
/*
* Easy Slider 1.7 - jQuery plugin
* written by Alen Grakalic
* http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding
*
* Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* Built for jQuery library
* http://jquery.com
*
*/
/*
* markup example for $("#slider").easySlider();
*
*
*
*/
(function($) {
$.fn.easySlider = function(options){
// default configuration properties
var defaults = {
prevId: 'prevBtn',
prevText: 'Previous',
nextId: 'nextBtn',
nextText: 'Next',
controlsShow: true,
controlsBefore: '',
controlsAfter: '',
controlsFade: true,
firstId: 'firstBtn',
firstText: 'First',
firstShow: false,
lastId: 'lastBtn',
lastText: 'Last',
lastShow: false,
vertical: false,
speed: 800,
auto: false,
pause: 2000,
continuous: false,
numeric: false,
numericId: 'controls'
};
var options = $.extend(defaults, options);
this.each(function() {
var obj = $(this);
var s = $("li", obj).length;
var w = $("li", obj).width();
var h = $("li", obj).height();
var clickable = true;
obj.width(w);
obj.height(h);
obj.css("overflow","hidden");
var ts = s-1;
var t = 0;
$("ul", obj).css('width',s*w);
$("li", obj).css('width',w);
if(options.continuous){
$("ul", obj).prepend($("ul li:last-child", obj).clone().css("margin-left","-"+ w +"px"));
$("ul", obj).append($("ul li:nth-child(2)", obj).clone());
$("ul", obj).css('width',(s+1)*w);
};
if(!options.vertical) $("li", obj).css('float','left');
if(options.controlsShow){
var html = options.controlsBefore;
if(options.numeric){
html += '
';
} else {
if(options.firstShow) html += '
'+ options.firstText +' ';
html += '
'+ options.prevText +' ';
html += '
'+ options.nextText +' ';
if(options.lastShow) html += '
'+ options.lastText +' ';
};
html += options.controlsAfter;
$(obj).after(html);
};
if(options.numeric){
for(var i=0;i
'+ (i+1) +'')
.appendTo($("#"+ options.numericId))
.click(function(){
animate($("a",$(this)).attr('rel'),true);
});
};
} else {
$("a","#"+options.nextId).click(function(){
animate("next",true);
});
$("a","#"+options.prevId).click(function(){
animate("prev",true);
});
$("a","#"+options.firstId).click(function(){
animate("first",true);
});
$("a","#"+options.lastId).click(function(){
animate("last",true);
});
};
function setCurrent(i){
i = parseInt(i)+1;
$("li", "#" + options.numericId).removeClass("current");
$("li#" + options.numericId + i).addClass("current");
};
function adjust(){
if(t>ts) t=0;
if(t<0) t=ts;
if(!options.vertical) {
$("ul",obj).css("margin-left",(t*w*-1));
} else {
$("ul",obj).css("margin-left",(t*h*-1));
}
clickable = true;
if(options.numeric) setCurrent(t);
};
function animate(dir,clicked){
if (clickable){
clickable = false;
var ot = t;
switch(dir){
case "next":
t = (ot>=ts) ? (options.continuous ? t+1 : ts) : t+1;
break;
case "prev":
t = (t<=0) ? (options.continuous ? t-1 : 0) : t-1;
break;
case "first":
t = 0;
break;
case "last":
t = ts;
break;
default:
t = dir;
break;
};
var diff = Math.abs(ot-t);
var speed = diff*options.speed;
if(!options.vertical) {
p = (t*w*-1);
$("ul",obj).animate(
{ marginLeft: p },
{ queue:false, duration:speed, complete:adjust }
);
} else {
p = (t*h*-1);
$("ul",obj).animate(
{ marginTop: p },
{ queue:false, duration:speed, complete:adjust }
);
};
if(!options.continuous && options.controlsFade){
if(t==ts){
$("a","#"+options.nextId).hide();
$("a","#"+options.lastId).hide();
} else {
$("a","#"+options.nextId).show();
$("a","#"+options.lastId).show();
};
if(t==0){
$("a","#"+options.prevId).hide();
$("a","#"+options.firstId).hide();
} else {
$("a","#"+options.prevId).show();
$("a","#"+options.firstId).show();
};
};
if(clicked) clearTimeout(timeout);
if(options.auto && dir=="next" && !clicked){;
timeout = setTimeout(function(){
animate("next",false);
},diff*options.speed+options.pause);
};
};
};
// init
var timeout;
if(options.auto){;
timeout = setTimeout(function(){
animate("next",false);
},options.pause);
};
if(options.numeric) setCurrent(0);
if(!options.continuous && options.controlsFade){
$("a","#"+options.prevId).hide();
$("a","#"+options.firstId).hide();
};
});
};
})(jQuery);
;// END OF /share/jquery.easyslider-min.js
// STARTS OF /scripts/swiper2/js/idangerous.swiper.min.js
/*
* Swiper 2.7.0
* Mobile touch slider and framework with hardware accelerated transitions
*
* http://www.idangero.us/sliders/swiper/
*
* Copyright 2010-2014, Vladimir Kharlampidi
* The iDangero.us
* http://www.idangero.us/
*
* Licensed under GPL & MIT
*
* Released on: August 30, 2014
*/
var Swiper=function(a,b){"use strict";function c(a,b){return document.querySelectorAll?(b||document).querySelectorAll(a):jQuery(a,b)}function d(a){return"[object Array]"===Object.prototype.toString.apply(a)?!0:!1}function e(){var a=F-I;return b.freeMode&&(a=F-I),b.slidesPerView>C.slides.length&&!b.centeredSlides&&(a=0),0>a&&(a=0),a}function f(){function a(a){var c=new Image;c.onload=function(){"undefined"!=typeof C&&null!==C&&(void 0!==C.imagesLoaded&&C.imagesLoaded++,C.imagesLoaded===C.imagesToLoad.length&&(C.reInit(),b.onImagesReady&&C.fireCallback(b.onImagesReady,C)))},c.src=a}var d=C.h.addEventListener,e="wrapper"===b.eventTarget?C.wrapper:C.container;if(C.browser.ie10||C.browser.ie11?(d(e,C.touchEvents.touchStart,p),d(document,C.touchEvents.touchMove,q),d(document,C.touchEvents.touchEnd,r)):(C.support.touch&&(d(e,"touchstart",p),d(e,"touchmove",q),d(e,"touchend",r)),b.simulateTouch&&(d(e,"mousedown",p),d(document,"mousemove",q),d(document,"mouseup",r))),b.autoResize&&d(window,"resize",C.resizeFix),g(),C._wheelEvent=!1,b.mousewheelControl){if(void 0!==document.onmousewheel&&(C._wheelEvent="mousewheel"),!C._wheelEvent)try{new WheelEvent("wheel"),C._wheelEvent="wheel"}catch(f){}C._wheelEvent||(C._wheelEvent="DOMMouseScroll"),C._wheelEvent&&d(C.container,C._wheelEvent,j)}if(b.keyboardControl&&d(document,"keydown",i),b.updateOnImagesReady){C.imagesToLoad=c("img",C.container);for(var h=0;h=e&&k[0]<=e+g&&k[1]>=f&&k[1]<=f+h&&(c=!0)}if(!c)return}M?((37===b||39===b)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),39===b&&C.swipeNext(),37===b&&C.swipePrev()):((38===b||40===b)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),40===b&&C.swipeNext(),38===b&&C.swipePrev())}}function j(a){var c=C._wheelEvent,d=0;if(a.detail)d=-a.detail;else if("mousewheel"===c)if(b.mousewheelControlForceToAxis)if(M){if(!(Math.abs(a.wheelDeltaX)>Math.abs(a.wheelDeltaY)))return;d=a.wheelDeltaX}else{if(!(Math.abs(a.wheelDeltaY)>Math.abs(a.wheelDeltaX)))return;d=a.wheelDeltaY}else d=a.wheelDelta;else if("DOMMouseScroll"===c)d=-a.detail;else if("wheel"===c)if(b.mousewheelControlForceToAxis)if(M){if(!(Math.abs(a.deltaX)>Math.abs(a.deltaY)))return;d=-a.deltaX}else{if(!(Math.abs(a.deltaY)>Math.abs(a.deltaX)))return;d=-a.deltaY}else d=Math.abs(a.deltaX)>Math.abs(a.deltaY)?-a.deltaX:-a.deltaY;if(b.freeMode){var f=C.getWrapperTranslate()+d;if(f>0&&(f=0),f<-e()&&(f=-e()),C.setWrapperTransition(0),C.setWrapperTranslate(f),C.updateActiveSlide(f),0===f||f===-e())return}else(new Date).getTime()-U>60&&(0>d?C.swipeNext():C.swipePrev()),U=(new Date).getTime();return b.autoplay&&C.stopAutoplay(!0),a.preventDefault?a.preventDefault():a.returnValue=!1,!1}function k(a){C.allowSlideClick&&(m(a),C.fireCallback(b.onSlideClick,C,a))}function l(a){m(a),C.fireCallback(b.onSlideTouch,C,a)}function m(a){if(a.currentTarget)C.clickedSlide=a.currentTarget;else{var c=a.srcElement;do{if(c.className.indexOf(b.slideClass)>-1)break;c=c.parentNode}while(c);C.clickedSlide=c}C.clickedSlideIndex=C.slides.indexOf(C.clickedSlide),C.clickedSlideLoopIndex=C.clickedSlideIndex-(C.loopedSlides||0)}function n(a){return C.allowLinks?void 0:(a.preventDefault?a.preventDefault():a.returnValue=!1,b.preventLinksPropagation&&"stopPropagation"in a&&a.stopPropagation(),!1)}function o(a){return a.stopPropagation?a.stopPropagation():a.returnValue=!1,!1}function p(a){if(b.preventLinks&&(C.allowLinks=!0),C.isTouched||b.onlyExternal)return!1;var c=a.target||a.srcElement;document.activeElement&&document.activeElement!==c&&document.activeElement.blur();var d="input select textarea".split(" ");if(b.noSwiping&&c&&s(c))return!1;if($=!1,C.isTouched=!0,Z="touchstart"===a.type,!Z&&"which"in a&&3===a.which)return!1;if(!Z||1===a.targetTouches.length){C.callPlugins("onTouchStartBegin"),!Z&&!C.isAndroid&&d.indexOf(c.tagName.toLowerCase())<0&&(a.preventDefault?a.preventDefault():a.returnValue=!1);var e=Z?a.targetTouches[0].pageX:a.pageX||a.clientX,f=Z?a.targetTouches[0].pageY:a.pageY||a.clientY;C.touches.startX=C.touches.currentX=e,C.touches.startY=C.touches.currentY=f,C.touches.start=C.touches.current=M?e:f,C.setWrapperTransition(0),C.positions.start=C.positions.current=C.getWrapperTranslate(),C.setWrapperTranslate(C.positions.start),C.times.start=(new Date).getTime(),H=void 0,b.moveStartThreshold>0&&(W=!1),b.onTouchStart&&C.fireCallback(b.onTouchStart,C,a),C.callPlugins("onTouchStartEnd")}}function q(a){if(C.isTouched&&!b.onlyExternal&&(!Z||"mousemove"!==a.type)){var c=Z?a.targetTouches[0].pageX:a.pageX||a.clientX,d=Z?a.targetTouches[0].pageY:a.pageY||a.clientY;if("undefined"==typeof H&&M&&(H=!!(H||Math.abs(d-C.touches.startY)>Math.abs(c-C.touches.startX))),"undefined"!=typeof H||M||(H=!!(H||Math.abs(d-C.touches.startY)C.touches.startX)return}else if(!b.swipeToNext&&dC.touches.startY)return;if(a.assignedToSwiper)return void(C.isTouched=!1);if(a.assignedToSwiper=!0,b.preventLinks&&(C.allowLinks=!1),b.onSlideClick&&(C.allowSlideClick=!1),b.autoplay&&C.stopAutoplay(!0),!Z||1===a.touches.length){if(C.isMoved||(C.callPlugins("onTouchMoveStart"),b.loop&&(C.fixLoop(),C.positions.start=C.getWrapperTranslate()),b.onTouchMoveStart&&C.fireCallback(b.onTouchMoveStart,C)),C.isMoved=!0,a.preventDefault?a.preventDefault():a.returnValue=!1,C.touches.current=M?c:d,C.positions.current=(C.touches.current-C.touches.start)*b.touchRatio+C.positions.start,C.positions.current>0&&b.onResistanceBefore&&C.fireCallback(b.onResistanceBefore,C,C.positions.current),C.positions.current<-e()&&b.onResistanceAfter&&C.fireCallback(b.onResistanceAfter,C,Math.abs(C.positions.current+e())),b.resistance&&"100%"!==b.resistance){var f;if(C.positions.current>0&&(f=1-C.positions.current/I/2,C.positions.current=.5>f?I/2:C.positions.current*f),C.positions.current<-e()){var g=(C.touches.current-C.touches.start)*b.touchRatio+(e()+C.positions.start);f=(I+g)/I;var h=C.positions.current-g*(1-f)/2,i=-e()-I/2;C.positions.current=i>h||0>=f?i:h}}if(b.resistance&&"100%"===b.resistance&&(C.positions.current>0&&(!b.freeMode||b.freeModeFluid)&&(C.positions.current=0),C.positions.current<-e()&&(!b.freeMode||b.freeModeFluid)&&(C.positions.current=-e())),!b.followFinger)return;if(b.moveStartThreshold)if(Math.abs(C.touches.current-C.touches.start)>b.moveStartThreshold||W){if(!W)return W=!0,void(C.touches.start=C.touches.current);C.setWrapperTranslate(C.positions.current)}else C.positions.current=C.positions.start;else C.setWrapperTranslate(C.positions.current);return(b.freeMode||b.watchActiveIndex)&&C.updateActiveSlide(C.positions.current),b.grabCursor&&(C.container.style.cursor="move",C.container.style.cursor="grabbing",C.container.style.cursor="-moz-grabbin",C.container.style.cursor="-webkit-grabbing"),X||(X=C.touches.current),Y||(Y=(new Date).getTime()),C.velocity=(C.touches.current-X)/((new Date).getTime()-Y)/2,Math.abs(C.touches.current-X)<2&&(C.velocity=0),X=C.touches.current,Y=(new Date).getTime(),C.callPlugins("onTouchMoveEnd"),b.onTouchMove&&C.fireCallback(b.onTouchMove,C,a),!1}}}function r(a){if(H&&C.swipeReset(),!b.onlyExternal&&C.isTouched){C.isTouched=!1,b.grabCursor&&(C.container.style.cursor="move",C.container.style.cursor="grab",C.container.style.cursor="-moz-grab",C.container.style.cursor="-webkit-grab"),C.positions.current||0===C.positions.current||(C.positions.current=C.positions.start),b.followFinger&&C.setWrapperTranslate(C.positions.current),C.times.end=(new Date).getTime(),C.touches.diff=C.touches.current-C.touches.start,C.touches.abs=Math.abs(C.touches.diff),C.positions.diff=C.positions.current-C.positions.start,C.positions.abs=Math.abs(C.positions.diff);var c=C.positions.diff,d=C.positions.abs,f=C.times.end-C.times.start;5>d&&300>f&&C.allowLinks===!1&&(b.freeMode||0===d||C.swipeReset(),b.preventLinks&&(C.allowLinks=!0),b.onSlideClick&&(C.allowSlideClick=!0)),setTimeout(function(){"undefined"!=typeof C&&null!==C&&(b.preventLinks&&(C.allowLinks=!0),b.onSlideClick&&(C.allowSlideClick=!0))},100);var g=e();if(!C.isMoved&&b.freeMode)return C.isMoved=!1,b.onTouchEnd&&C.fireCallback(b.onTouchEnd,C,a),void C.callPlugins("onTouchEnd");if(!C.isMoved||C.positions.current>0||C.positions.current<-g)return C.swipeReset(),b.onTouchEnd&&C.fireCallback(b.onTouchEnd,C,a),void C.callPlugins("onTouchEnd");if(C.isMoved=!1,b.freeMode){if(b.freeModeFluid){var h,i=1e3*b.momentumRatio,j=C.velocity*i,k=C.positions.current+j,l=!1,m=20*Math.abs(C.velocity)*b.momentumBounceRatio;-g>k&&(b.momentumBounce&&C.support.transitions?(-m>k+g&&(k=-g-m),h=-g,l=!0,$=!0):k=-g),k>0&&(b.momentumBounce&&C.support.transitions?(k>m&&(k=m),h=0,l=!0,$=!0):k=0),0!==C.velocity&&(i=Math.abs((k-C.positions.current)/C.velocity)),C.setWrapperTranslate(k),C.setWrapperTransition(i),b.momentumBounce&&l&&C.wrapperTransitionEnd(function(){$&&(b.onMomentumBounce&&C.fireCallback(b.onMomentumBounce,C),C.callPlugins("onMomentumBounce"),C.setWrapperTranslate(h),C.setWrapperTransition(300))}),C.updateActiveSlide(k)}return(!b.freeModeFluid||f>=300)&&C.updateActiveSlide(C.positions.current),b.onTouchEnd&&C.fireCallback(b.onTouchEnd,C,a),void C.callPlugins("onTouchEnd")}G=0>c?"toNext":"toPrev","toNext"===G&&300>=f&&(30>d||!b.shortSwipes?C.swipeReset():C.swipeNext(!0)),"toPrev"===G&&300>=f&&(30>d||!b.shortSwipes?C.swipeReset():C.swipePrev(!0));var n=0;if("auto"===b.slidesPerView){for(var o,p=Math.abs(C.getWrapperTranslate()),q=0,r=0;rp){n=o;break}n>I&&(n=I)}else n=E*b.slidesPerView;"toNext"===G&&f>300&&(d>=n*b.longSwipesRatio?C.swipeNext(!0):C.swipeReset()),"toPrev"===G&&f>300&&(d>=n*b.longSwipesRatio?C.swipePrev(!0):C.swipeReset()),b.onTouchEnd&&C.fireCallback(b.onTouchEnd,C,a),C.callPlugins("onTouchEnd")}}function s(a){var c=!1;do a.className.indexOf(b.noSwipingClass)>-1&&(c=!0),a=a.parentElement;while(!c&&a.parentElement&&-1===a.className.indexOf(b.wrapperClass));return!c&&a.className.indexOf(b.wrapperClass)>-1&&a.className.indexOf(b.noSwipingClass)>-1&&(c=!0),c}function t(a,b){var c,d=document.createElement("div");return d.innerHTML=b,c=d.firstChild,c.className+=" "+a,c.outerHTML}function u(a,c,d){function e(){var f=+new Date,l=f-g;h+=i*l/(1e3/60),k="toNext"===j?h>a:a>h,k?(C.setWrapperTranslate(Math.ceil(h)),C._DOMAnimating=!0,window.setTimeout(function(){e()},1e3/60)):(b.onSlideChangeEnd&&("to"===c?d.runCallbacks===!0&&C.fireCallback(b.onSlideChangeEnd,C,j):C.fireCallback(b.onSlideChangeEnd,C,j)),C.setWrapperTranslate(a),C._DOMAnimating=!1)}var f="to"===c&&d.speed>=0?d.speed:b.speed,g=+new Date;if(C.support.transitions||!b.DOMAnimation)C.setWrapperTranslate(a),C.setWrapperTransition(f);else{var h=C.getWrapperTranslate(),i=Math.ceil((a-h)/f*(1e3/60)),j=h>a?"toNext":"toPrev",k="toNext"===j?h>a:a>h;if(C._DOMAnimating)return;e()}C.updateActiveSlide(a),b.onSlideNext&&"next"===c&&C.fireCallback(b.onSlideNext,C,a),b.onSlidePrev&&"prev"===c&&C.fireCallback(b.onSlidePrev,C,a),b.onSlideReset&&"reset"===c&&C.fireCallback(b.onSlideReset,C,a),("next"===c||"prev"===c||"to"===c&&d.runCallbacks===!0)&&v(c)}function v(a){if(C.callPlugins("onSlideChangeStart"),b.onSlideChangeStart)if(b.queueStartCallbacks&&C.support.transitions){if(C._queueStartCallbacks)return;C._queueStartCallbacks=!0,C.fireCallback(b.onSlideChangeStart,C,a),C.wrapperTransitionEnd(function(){C._queueStartCallbacks=!1})}else C.fireCallback(b.onSlideChangeStart,C,a);if(b.onSlideChangeEnd)if(C.support.transitions)if(b.queueEndCallbacks){if(C._queueEndCallbacks)return;C._queueEndCallbacks=!0,C.wrapperTransitionEnd(function(c){C.fireCallback(b.onSlideChangeEnd,c,a)})}else C.wrapperTransitionEnd(function(c){C.fireCallback(b.onSlideChangeEnd,c,a)});else b.DOMAnimation||setTimeout(function(){C.fireCallback(b.onSlideChangeEnd,C,a)},10)}function w(){var a=C.paginationButtons;if(a)for(var b=0;b0&&0===C.slides.length&&C.loadSlides(),b.loop&&C.createLoop(),C.init(),f(),b.pagination&&C.createPagination(!0),b.loop||b.initialSlide>0?C.swipeTo(b.initialSlide,0,!1):C.updateActiveSlide(0),b.autoplay&&C.startAutoplay(),C.centerIndex=C.activeIndex,b.onSwiperCreated&&C.fireCallback(b.onSwiperCreated,C),C.callPlugins("onSwiperCreated")}if(!document.body.outerHTML&&document.body.__defineGetter__&&HTMLElement){var B=HTMLElement.prototype;B.__defineGetter__&&B.__defineGetter__("outerHTML",function(){return(new XMLSerializer).serializeToString(this)})}if(window.getComputedStyle||(window.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(b){var c=/(\-([a-z]){1})/g;return"float"===b&&(b="styleFloat"),c.test(b)&&(b=b.replace(c,function(){return arguments[2].toUpperCase()})),a.currentStyle[b]?a.currentStyle[b]:null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){for(var c=b||0,d=this.length;d>c;c++)if(this[c]===a)return c;return-1}),(document.querySelectorAll||window.jQuery)&&"undefined"!=typeof a&&(a.nodeType||0!==c(a).length)){var C=this;C.touches={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,diff:0,abs:0},C.positions={start:0,abs:0,diff:0,current:0},C.times={start:0,end:0},C.id=(new Date).getTime(),C.container=a.nodeType?a:c(a)[0],C.isTouched=!1,C.isMoved=!1,C.activeIndex=0,C.centerIndex=0,C.activeLoaderIndex=0,C.activeLoopIndex=0,C.previousIndex=null,C.velocity=0,C.snapGrid=[],C.slidesGrid=[],C.imagesToLoad=[],C.imagesLoaded=0,C.wrapperLeft=0,C.wrapperRight=0,C.wrapperTop=0,C.wrapperBottom=0,C.isAndroid=navigator.userAgent.toLowerCase().indexOf("android")>=0;var D,E,F,G,H,I,J={eventTarget:"wrapper",mode:"horizontal",touchRatio:1,speed:300,freeMode:!1,freeModeFluid:!1,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,slidesPerView:1,slidesPerGroup:1,slidesPerViewFit:!0,simulateTouch:!0,followFinger:!0,shortSwipes:!0,longSwipesRatio:.5,moveStartThreshold:!1,onlyExternal:!1,createPagination:!0,pagination:!1,paginationElement:"span",paginationClickable:!1,paginationAsRange:!0,resistance:!0,scrollContainer:!1,preventLinks:!0,preventLinksPropagation:!1,noSwiping:!1,noSwipingClass:"swiper-no-swiping",initialSlide:0,keyboardControl:!1,mousewheelControl:!1,mousewheelControlForceToAxis:!1,useCSS3Transforms:!0,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,loop:!1,loopAdditionalSlides:0,roundLengths:!1,calculateHeight:!1,cssWidthAndHeight:!1,updateOnImagesReady:!0,releaseFormElements:!0,watchActiveIndex:!1,visibilityFullFit:!1,offsetPxBefore:0,offsetPxAfter:0,offsetSlidesBefore:0,offsetSlidesAfter:0,centeredSlides:!1,queueStartCallbacks:!1,queueEndCallbacks:!1,autoResize:!0,resizeReInit:!1,DOMAnimation:!0,loader:{slides:[],slidesHTMLType:"inner",surroundGroups:1,logic:"reload",loadAllSlides:!1},swipeToPrev:!0,swipeToNext:!0,slideElement:"div",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",wrapperClass:"swiper-wrapper",paginationElementClass:"swiper-pagination-switch",paginationActiveClass:"swiper-active-switch",paginationVisibleClass:"swiper-visible-switch"};b=b||{};for(var K in J)if(K in b&&"object"==typeof b[K])for(var L in J[K])L in b[K]||(b[K][L]=J[K][L]);else K in b||(b[K]=J[K]);C.params=b,b.scrollContainer&&(b.freeMode=!0,b.freeModeFluid=!0),b.loop&&(b.resistance="100%");var M="horizontal"===b.mode,N=["mousedown","mousemove","mouseup"];C.browser.ie10&&(N=["MSPointerDown","MSPointerMove","MSPointerUp"]),C.browser.ie11&&(N=["pointerdown","pointermove","pointerup"]),C.touchEvents={touchStart:C.support.touch||!b.simulateTouch?"touchstart":N[0],touchMove:C.support.touch||!b.simulateTouch?"touchmove":N[1],touchEnd:C.support.touch||!b.simulateTouch?"touchend":N[2]};for(var O=C.container.childNodes.length-1;O>=0;O--)if(C.container.childNodes[O].className)for(var P=C.container.childNodes[O].className.split(/\s+/),Q=0;Q=0;c--)a===C.slides[c]&&(b=c);return b},a.isActive=function(){return a.index()===C.activeIndex?!0:!1},a.swiperSlideDataStorage||(a.swiperSlideDataStorage={}),a.getData=function(b){return a.swiperSlideDataStorage[b]},a.setData=function(b,c){return a.swiperSlideDataStorage[b]=c,a},a.data=function(b,c){return"undefined"==typeof c?a.getAttribute("data-"+b):(a.setAttribute("data-"+b,c),a)},a.getWidth=function(b,c){return C.h.getWidth(a,b,c)},a.getHeight=function(b,c){return C.h.getHeight(a,b,c)},a.getOffset=function(){return C.h.getOffset(a)},a},C.calcSlides=function(a){var c=C.slides?C.slides.length:!1;C.slides=[],C.displaySlides=[];for(var d=0;d=0;d--)C._extendSwiperSlide(C.slides[d]);c!==!1&&(c!==C.slides.length||a)&&(h(),g(),C.updateActiveSlide(),C.params.pagination&&C.createPagination(),C.callPlugins("numberOfSlidesChanged"))},C.createSlide=function(a,c,d){c=c||C.params.slideClass,d=d||b.slideElement;var e=document.createElement(d);return e.innerHTML=a||"",e.className=c,C._extendSwiperSlide(e)},C.appendSlide=function(a,b,c){return a?a.nodeType?C._extendSwiperSlide(a).append():C.createSlide(a,b,c).append():void 0},C.prependSlide=function(a,b,c){return a?a.nodeType?C._extendSwiperSlide(a).prepend():C.createSlide(a,b,c).prepend():void 0},C.insertSlideAfter=function(a,b,c,d){return"undefined"==typeof a?!1:b.nodeType?C._extendSwiperSlide(b).insertAfter(a):C.createSlide(b,c,d).insertAfter(a)},C.removeSlide=function(a){if(C.slides[a]){if(b.loop){if(!C.slides[a+C.loopedSlides])return!1;C.slides[a+C.loopedSlides].remove(),C.removeLoopedSlides(),C.calcSlides(),C.createLoop()}else C.slides[a].remove();return!0}return!1},C.removeLastSlide=function(){return C.slides.length>0?(b.loop?(C.slides[C.slides.length-1-C.loopedSlides].remove(),C.removeLoopedSlides(),C.calcSlides(),C.createLoop()):C.slides[C.slides.length-1].remove(),!0):!1},C.removeAllSlides=function(){for(var a=C.slides.length-1;a>=0;a--)C.slides[a].remove()},C.getSlide=function(a){return C.slides[a]},C.getLastSlide=function(){return C.slides[C.slides.length-1]},C.getFirstSlide=function(){return C.slides[0]},C.activeSlide=function(){return C.slides[C.activeIndex]},C.fireCallback=function(){var a=arguments[0];if("[object Array]"===Object.prototype.toString.call(a))for(var c=0;c0&&(m.style.paddingLeft="",m.style.paddingRight="",m.style.paddingTop="",m.style.paddingBottom=""),m.style.width="",m.style.height="",b.offsetPxBefore>0&&(M?C.wrapperLeft=b.offsetPxBefore:C.wrapperTop=b.offsetPxBefore),b.offsetPxAfter>0&&(M?C.wrapperRight=b.offsetPxAfter:C.wrapperBottom=b.offsetPxAfter),b.centeredSlides&&(M?(C.wrapperLeft=(I-this.slides[0].getWidth(!0,b.roundLengths))/2,C.wrapperRight=(I-C.slides[C.slides.length-1].getWidth(!0,b.roundLengths))/2):(C.wrapperTop=(I-C.slides[0].getHeight(!0,b.roundLengths))/2,C.wrapperBottom=(I-C.slides[C.slides.length-1].getHeight(!0,b.roundLengths))/2)),M?(C.wrapperLeft>=0&&(m.style.paddingLeft=C.wrapperLeft+"px"),C.wrapperRight>=0&&(m.style.paddingRight=C.wrapperRight+"px")):(C.wrapperTop>=0&&(m.style.paddingTop=C.wrapperTop+"px"),C.wrapperBottom>=0&&(m.style.paddingBottom=C.wrapperBottom+"px")),k=0;var p=0;for(C.snapGrid=[],C.slidesGrid=[],h=0,l=0;lI){if(b.slidesPerViewFit)C.snapGrid.push(k+C.wrapperLeft),C.snapGrid.push(k+q-I+C.wrapperLeft);else for(var u=0;u<=Math.floor(q/(I+C.wrapperLeft));u++)C.snapGrid.push(0===u?k+C.wrapperLeft:k+C.wrapperLeft+I*u);C.slidesGrid.push(k+C.wrapperLeft)}else C.snapGrid.push(p),C.slidesGrid.push(p);p+=q/2+t/2}else{if(q>I)if(b.slidesPerViewFit)C.snapGrid.push(k),C.snapGrid.push(k+q-I);else if(0!==I)for(var v=0;v<=Math.floor(q/I);v++)C.snapGrid.push(k+I*v);else C.snapGrid.push(k);else C.snapGrid.push(k);C.slidesGrid.push(k)}k+=q,n+=f,o+=g}b.calculateHeight&&(C.height=h),M?(F=n+C.wrapperRight+C.wrapperLeft,m.style.width=n+"px",m.style.height=C.height+"px"):(F=o+C.wrapperTop+C.wrapperBottom,m.style.width=C.width+"px",m.style.height=o+"px")}else if(b.scrollContainer)m.style.width="",m.style.height="",i=C.slides[0].getWidth(!0,b.roundLengths),j=C.slides[0].getHeight(!0,b.roundLengths),F=M?i:j,m.style.width=i+"px",m.style.height=j+"px",E=M?i:j;else{if(b.calculateHeight){for(h=0,j=0,M||(C.container.style.height=""),m.style.height="",l=0;l0&&(M?C.wrapperLeft=E*b.offsetSlidesBefore:C.wrapperTop=E*b.offsetSlidesBefore),b.offsetSlidesAfter>0&&(M?C.wrapperRight=E*b.offsetSlidesAfter:C.wrapperBottom=E*b.offsetSlidesAfter),b.offsetPxBefore>0&&(M?C.wrapperLeft=b.offsetPxBefore:C.wrapperTop=b.offsetPxBefore),b.offsetPxAfter>0&&(M?C.wrapperRight=b.offsetPxAfter:C.wrapperBottom=b.offsetPxAfter),b.centeredSlides&&(M?(C.wrapperLeft=(I-E)/2,C.wrapperRight=(I-E)/2):(C.wrapperTop=(I-E)/2,C.wrapperBottom=(I-E)/2)),M?(C.wrapperLeft>0&&(m.style.paddingLeft=C.wrapperLeft+"px"),C.wrapperRight>0&&(m.style.paddingRight=C.wrapperRight+"px")):(C.wrapperTop>0&&(m.style.paddingTop=C.wrapperTop+"px"),C.wrapperBottom>0&&(m.style.paddingBottom=C.wrapperBottom+"px")),F=M?i+C.wrapperRight+C.wrapperLeft:j+C.wrapperTop+C.wrapperBottom,parseFloat(i)>0&&(!b.cssWidthAndHeight||"height"===b.cssWidthAndHeight)&&(m.style.width=i+"px"),parseFloat(j)>0&&(!b.cssWidthAndHeight||"width"===b.cssWidthAndHeight)&&(m.style.height=j+"px"),k=0,C.snapGrid=[],C.slidesGrid=[],l=0;l0&&(!b.cssWidthAndHeight||"height"===b.cssWidthAndHeight)&&(C.slides[l].style.width=f+"px"),parseFloat(g)>0&&(!b.cssWidthAndHeight||"width"===b.cssWidthAndHeight)&&(C.slides[l].style.height=g+"px")}C.initialized?(C.callPlugins("onInit"),b.onInit&&C.fireCallback(b.onInit,C)):(C.callPlugins("onFirstInit"),b.onFirstInit&&C.fireCallback(b.onFirstInit,C)),C.initialized=!0}},C.reInit=function(a){C.init(!0,a)},C.resizeFix=function(a){C.callPlugins("beforeResizeFix"),C.init(b.resizeReInit||a),b.freeMode?C.getWrapperTranslate()<-e()&&(C.setWrapperTransition(0),C.setWrapperTranslate(-e())):(C.swipeTo(b.loop?C.activeLoopIndex:C.activeIndex,0,!1),b.autoplay&&(C.support.transitions&&"undefined"!=typeof _?"undefined"!=typeof _&&(clearTimeout(_),_=void 0,C.startAutoplay()):"undefined"!=typeof ab&&(clearInterval(ab),ab=void 0,C.startAutoplay()))),C.callPlugins("afterResizeFix")},C.destroy=function(){var a=C.h.removeEventListener,c="wrapper"===b.eventTarget?C.wrapper:C.container;C.browser.ie10||C.browser.ie11?(a(c,C.touchEvents.touchStart,p),a(document,C.touchEvents.touchMove,q),a(document,C.touchEvents.touchEnd,r)):(C.support.touch&&(a(c,"touchstart",p),a(c,"touchmove",q),a(c,"touchend",r)),b.simulateTouch&&(a(c,"mousedown",p),a(document,"mousemove",q),a(document,"mouseup",r))),b.autoResize&&a(window,"resize",C.resizeFix),h(),b.paginationClickable&&w(),b.mousewheelControl&&C._wheelEvent&&a(C.container,C._wheelEvent,j),b.keyboardControl&&a(document,"keydown",i),b.autoplay&&C.stopAutoplay(),C.callPlugins("onDestroy"),C=null},C.disableKeyboardControl=function(){b.keyboardControl=!1,C.h.removeEventListener(document,"keydown",i)},C.enableKeyboardControl=function(){b.keyboardControl=!0,C.h.addEventListener(document,"keydown",i)};var U=(new Date).getTime();if(C.disableMousewheelControl=function(){return C._wheelEvent?(b.mousewheelControl=!1,C.h.removeEventListener(C.container,C._wheelEvent,j),!0):!1},C.enableMousewheelControl=function(){return C._wheelEvent?(b.mousewheelControl=!0,C.h.addEventListener(C.container,C._wheelEvent,j),!0):!1},b.grabCursor){var V=C.container.style;V.cursor="move",V.cursor="grab",V.cursor="-moz-grab",V.cursor="-webkit-grab"}C.allowSlideClick=!0,C.allowLinks=!0;var W,X,Y,Z=!1,$=!0;C.swipeNext=function(a){!a&&b.loop&&C.fixLoop(),!a&&b.autoplay&&C.stopAutoplay(!0),C.callPlugins("onSwipeNext");var c=C.getWrapperTranslate(),d=c;if("auto"===b.slidesPerView){for(var f=0;f=C.snapGrid[f]&&-cC.snapGrid[e]&&-d0&&(c=0),c===d?!1:(u(c,"prev"),!0)},C.swipeReset=function(){C.callPlugins("onSwipeReset");{var a,c=C.getWrapperTranslate(),d=E*b.slidesPerGroup;-e()}if("auto"===b.slidesPerView){a=0;for(var f=0;f=C.snapGrid[f]&&-c0?-C.snapGrid[f+1]:-C.snapGrid[f];break}}-c>=C.snapGrid[C.snapGrid.length-1]&&(a=-C.snapGrid[C.snapGrid.length-1]),c<=-e()&&(a=-e())}else a=0>c?Math.round(c/d)*d:0,c<=-e()&&(a=-e());return b.scrollContainer&&(a=0>c?c:0),a<-e()&&(a=-e()),b.scrollContainer&&I>E&&(a=0),a===c?!1:(u(a,"reset"),!0)},C.swipeTo=function(a,c,d){a=parseInt(a,10),C.callPlugins("onSwipeTo",{index:a,speed:c}),b.loop&&(a+=C.loopedSlides);var f=C.getWrapperTranslate();if(!(a>C.slides.length-1||0>a)){var g;return g="auto"===b.slidesPerView?-C.slidesGrid[a]:-a*E,g<-e()&&(g=-e()),g===f?!1:(d=d===!1?!1:!0,u(g,"to",{index:a,speed:c,runCallbacks:d}),!0)}},C._queueStartCallbacks=!1,C._queueEndCallbacks=!1,C.updateActiveSlide=function(a){if(C.initialized&&0!==C.slides.length){C.previousIndex=C.activeIndex,"undefined"==typeof a&&(a=C.getWrapperTranslate()),a>0&&(a=0);var c;if("auto"===b.slidesPerView){if(C.activeIndex=C.slidesGrid.indexOf(-a),C.activeIndex<0){for(c=0;cC.slidesGrid[c]&&-a=d?c:c+1}}else C.activeIndex=Math[b.visibilityFullFit?"ceil":"round"](-a/E);if(C.activeIndex===C.slides.length&&(C.activeIndex=C.slides.length-1),C.activeIndex<0&&(C.activeIndex=0),C.slides[C.activeIndex]){if(C.calcVisibleSlides(a),C.support.classList){var f;for(c=0;c=0?f.classList.add(b.slideVisibleClass):f.classList.remove(b.slideVisibleClass);C.slides[C.activeIndex].classList.add(b.slideActiveClass)}else{var g=new RegExp("\\s*"+b.slideActiveClass),h=new RegExp("\\s*"+b.slideVisibleClass);for(c=0;c=0&&(C.slides[c].className+=" "+b.slideVisibleClass);C.slides[C.activeIndex].className+=" "+b.slideActiveClass}if(b.loop){var i=C.loopedSlides;C.activeLoopIndex=C.activeIndex-i,C.activeLoopIndex>=C.slides.length-2*i&&(C.activeLoopIndex=C.slides.length-2*i-C.activeLoopIndex),C.activeLoopIndex<0&&(C.activeLoopIndex=C.slides.length-2*i+C.activeLoopIndex),C.activeLoopIndex<0&&(C.activeLoopIndex=0)
}else C.activeLoopIndex=C.activeIndex;b.pagination&&C.updatePagination(a)}}},C.createPagination=function(a){if(b.paginationClickable&&C.paginationButtons&&w(),C.paginationContainer=b.pagination.nodeType?b.pagination:c(b.pagination)[0],b.createPagination){var d="",e=C.slides.length,f=e;b.loop&&(f-=2*C.loopedSlides);for(var g=0;f>g;g++)d+="<"+b.paginationElement+' class="'+b.paginationElementClass+'">";C.paginationContainer.innerHTML=d}C.paginationButtons=c("."+b.paginationElementClass,C.paginationContainer),a||C.updatePagination(),C.callPlugins("onCreatePagination"),b.paginationClickable&&x()},C.updatePagination=function(a){if(b.pagination&&!(C.slides.length<1)){var d=c("."+b.paginationActiveClass,C.paginationContainer);if(d){var e=C.paginationButtons;if(0!==e.length){for(var f=0;fj&&(j=C.slides.length-2*C.loopedSlides+j),b.loop&&j>=C.slides.length-2*C.loopedSlides&&(j=C.slides.length-2*C.loopedSlides-j,j=Math.abs(j)),i.push(j)}for(h=0;h0&&(a+=C.wrapperLeft),!M&&C.wrapperTop>0&&(a+=C.wrapperTop);for(var g=0;g=-a&&-a+I>=f&&(h=!0),-a>=d&&f>=-a+I&&(h=!0)):(f>-a&&-a+I>=f&&(h=!0),d>=-a&&-a+I>d&&(h=!0),-a>d&&f>-a+I&&(h=!0)),h&&c.push(C.slides[g])}0===c.length&&(c=[C.slides[C.activeIndex]]),C.visibleSlides=c};var _,ab;C.startAutoplay=function(){if(C.support.transitions){if("undefined"!=typeof _)return!1;if(!b.autoplay)return;C.callPlugins("onAutoplayStart"),b.onAutoplayStart&&C.fireCallback(b.onAutoplayStart,C),z()}else{if("undefined"!=typeof ab)return!1;if(!b.autoplay)return;C.callPlugins("onAutoplayStart"),b.onAutoplayStart&&C.fireCallback(b.onAutoplayStart,C),ab=setInterval(function(){b.loop?(C.fixLoop(),C.swipeNext(!0)):C.swipeNext(!0)||(b.autoplayStopOnLast?(clearInterval(ab),ab=void 0):C.swipeTo(0))},b.autoplay)}},C.stopAutoplay=function(a){if(C.support.transitions){if(!_)return;_&&clearTimeout(_),_=void 0,a&&!b.autoplayDisableOnInteraction&&C.wrapperTransitionEnd(function(){z()}),C.callPlugins("onAutoplayStop"),b.onAutoplayStop&&C.fireCallback(b.onAutoplayStop,C)}else ab&&clearInterval(ab),ab=void 0,C.callPlugins("onAutoplayStop"),b.onAutoplayStop&&C.fireCallback(b.onAutoplayStop,C)},C.loopCreated=!1,C.removeLoopedSlides=function(){if(C.loopCreated)for(var a=0;aC.slides.length&&(C.loopedSlides=C.slides.length);var a,c="",d="",e="",f=C.slides.length,g=Math.floor(C.loopedSlides/f),h=C.loopedSlides%f;for(a=0;g*f>a;a++){var i=a;if(a>=f){var j=Math.floor(a/f);i=a-f*j}e+=C.slides[i].outerHTML}for(a=0;h>a;a++)d+=t(b.slideDuplicateClass,C.slides[a].outerHTML);for(a=f-h;f>a;a++)c+=t(b.slideDuplicateClass,C.slides[a].outerHTML);var k=c+e+D.innerHTML+e+d;for(D.innerHTML=k,C.loopCreated=!0,C.calcSlides(),a=0;a=C.slides.length-C.loopedSlides)&&C.slides[a].setData("looped",!0);C.callPlugins("onCreateLoop")}},C.fixLoop=function(){var a;C.activeIndex=2*C.loopedSlides||C.activeIndex>C.slides.length-2*b.slidesPerView)&&(a=-C.slides.length+C.activeIndex+C.loopedSlides,C.swipeTo(a,0,!1))},C.loadSlides=function(){var a="";C.activeLoaderIndex=0;for(var c=b.loader.slides,d=b.loader.loadAllSlides?c.length:b.slidesPerView*(1+b.loader.surroundGroups),e=0;d>e;e++)a+="outer"===b.loader.slidesHTMLType?c[e]:"<"+b.slideElement+' class="'+b.slideClass+'" data-swiperindex="'+e+'">'+c[e]+"";C.wrapper.innerHTML=a,C.calcSlides(!0),b.loader.loadAllSlides||C.wrapperTransitionEnd(C.reloadSlides,!0)},C.reloadSlides=function(){var a=b.loader.slides,c=parseInt(C.activeSlide().data("swiperindex"),10);if(!(0>c||c>a.length-1)){C.activeLoaderIndex=c;var d=Math.max(0,c-b.slidesPerView*b.loader.surroundGroups),e=Math.min(c+b.slidesPerView*(1+b.loader.surroundGroups)-1,a.length-1);if(c>0){var f=-E*(c-d);C.setWrapperTranslate(f),C.setWrapperTransition(0)}var g;if("reload"===b.loader.logic){C.wrapper.innerHTML="";var h="";for(g=d;e>=g;g++)h+="outer"===b.loader.slidesHTMLType?a[g]:"<"+b.slideElement+' class="'+b.slideClass+'" data-swiperindex="'+g+'">'+a[g]+"";C.wrapper.innerHTML=h}else{var i=1e3,j=0;for(g=0;gk||k>e?C.wrapper.removeChild(C.slides[g]):(i=Math.min(k,i),j=Math.max(k,j))}for(g=d;e>=g;g++){var l;i>g&&(l=document.createElement(b.slideElement),l.className=b.slideClass,l.setAttribute("data-swiperindex",g),l.innerHTML=a[g],C.wrapper.insertBefore(l,C.wrapper.firstChild)),g>j&&(l=document.createElement(b.slideElement),l.className=b.slideClass,l.setAttribute("data-swiperindex",g),l.innerHTML=a[g],C.wrapper.appendChild(l))}}C.reInit(!0)}},A()}};Swiper.prototype={plugins:{},wrapperTransitionEnd:function(a,b){"use strict";function c(h){if(h.target===f&&(a(e),e.params.queueEndCallbacks&&(e._queueEndCallbacks=!1),!b))for(d=0;d0||0>e)&&(e=a.offsetWidth-parseFloat(window.getComputedStyle(a,null).getPropertyValue("padding-left"))-parseFloat(window.getComputedStyle(a,null).getPropertyValue("padding-right"))),b&&(e+=parseFloat(window.getComputedStyle(a,null).getPropertyValue("padding-left"))+parseFloat(window.getComputedStyle(a,null).getPropertyValue("padding-right"))),c?Math.ceil(e):e},getHeight:function(a,b,c){"use strict";if(b)return a.offsetHeight;var d=window.getComputedStyle(a,null).getPropertyValue("height"),e=parseFloat(d);return(isNaN(e)||d.indexOf("%")>0||0>e)&&(e=a.offsetHeight-parseFloat(window.getComputedStyle(a,null).getPropertyValue("padding-top"))-parseFloat(window.getComputedStyle(a,null).getPropertyValue("padding-bottom"))),b&&(e+=parseFloat(window.getComputedStyle(a,null).getPropertyValue("padding-top"))+parseFloat(window.getComputedStyle(a,null).getPropertyValue("padding-bottom"))),c?Math.ceil(e):e},getOffset:function(a){"use strict";var b=a.getBoundingClientRect(),c=document.body,d=a.clientTop||c.clientTop||0,e=a.clientLeft||c.clientLeft||0,f=window.pageYOffset||a.scrollTop,g=window.pageXOffset||a.scrollLeft;return document.documentElement&&!window.pageYOffset&&(f=document.documentElement.scrollTop,g=document.documentElement.scrollLeft),{top:b.top+f-d,left:b.left+g-e}},windowWidth:function(){"use strict";return window.innerWidth?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:void 0},windowHeight:function(){"use strict";return window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:void 0},windowScroll:function(){"use strict";return"undefined"!=typeof pageYOffset?{left:window.pageXOffset,top:window.pageYOffset}:document.documentElement?{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}:void 0},addEventListener:function(a,b,c,d){"use strict";"undefined"==typeof d&&(d=!1),a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},removeEventListener:function(a,b,c,d){"use strict";"undefined"==typeof d&&(d=!1),a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)}},setTransform:function(a,b){"use strict";var c=a.style;c.webkitTransform=c.MsTransform=c.msTransform=c.MozTransform=c.OTransform=c.transform=b},setTranslate:function(a,b){"use strict";var c=a.style,d={x:b.x||0,y:b.y||0,z:b.z||0},e=this.support.transforms3d?"translate3d("+d.x+"px,"+d.y+"px,"+d.z+"px)":"translate("+d.x+"px,"+d.y+"px)";c.webkitTransform=c.MsTransform=c.msTransform=c.MozTransform=c.OTransform=c.transform=e,this.support.transforms||(c.left=d.x+"px",c.top=d.y+"px")},setTransition:function(a,b){"use strict";var c=a.style;c.webkitTransitionDuration=c.MsTransitionDuration=c.msTransitionDuration=c.MozTransitionDuration=c.OTransitionDuration=c.transitionDuration=b+"ms"},support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){"use strict";return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){"use strict";var a=document.createElement("div").style;return"webkitPerspective"in a||"MozPerspective"in a||"OPerspective"in a||"MsPerspective"in a||"perspective"in a}(),transforms:window.Modernizr&&Modernizr.csstransforms===!0||function(){"use strict";var a=document.createElement("div").style;return"transform"in a||"WebkitTransform"in a||"MozTransform"in a||"msTransform"in a||"MsTransform"in a||"OTransform"in a}(),transitions:window.Modernizr&&Modernizr.csstransitions===!0||function(){"use strict";var a=document.createElement("div").style;return"transition"in a||"WebkitTransition"in a||"MozTransition"in a||"msTransition"in a||"MsTransition"in a||"OTransition"in a}(),classList:function(){"use strict";var a=document.createElement("div");return"classList"in a}()},browser:{ie8:function(){"use strict";var a=-1;if("Microsoft Internet Explorer"===navigator.appName){var b=navigator.userAgent,c=new RegExp(/MSIE ([0-9]{1,}[\.0-9]{0,})/);null!==c.exec(b)&&(a=parseFloat(RegExp.$1))}return-1!==a&&9>a}(),ie10:window.navigator.msPointerEnabled,ie11:window.navigator.pointerEnabled}},(window.jQuery||window.Zepto)&&!function(a){"use strict";a.fn.swiper=function(b){var c;return this.each(function(d){var e=a(this);if(!e.data("swiper")){var f=new Swiper(e[0],b);d||(c=f),e.data("swiper",f)}}),c}}(window.jQuery||window.Zepto),"undefined"!=typeof module&&(module.exports=Swiper),"function"==typeof define&&define.amd&&define([],function(){"use strict";return Swiper});;// END OF /scripts/swiper2/js/idangerous.swiper.min.js
// STARTS OF /scripts/swiper.animate/swiper.animate1.0.2.min.js
//本æ’件由www.swiper.com.cnæä¾›
function swiperAnimateCache(){for(allBoxes=window.document.documentElement.querySelectorAll(".ani"),i=0;i]+>/gi, '');
}
function numberCeil(num, digit) {
digit = parseInt(digit);
if (isNaN(digit)) {
digit = 0;
}
if (digit < 0)
throw Exception('digit must be greater or equal than 0');
var scale = 1;
for (var i = 0; i < digit; i++) {
scale *= 10;
}
return Math.ceil(num * scale) / scale;
}
//é‡è½½ setTimeout
var _st = window.setTimeout;
window.setTimeoutEx = function(fRef, mDelay)
{
if(typeof(fRef) == 'function')
{
var argu = Array.prototype.slice.call(arguments,2);
var f = (function(){ fRef.apply(null, argu);});
return _st(f, mDelay);
}
return _st(fRef,mDelay);
}
// end of é‡è½½ setTimeout
//é‡è½½ setInterval
var _setInterval = window.setInterval;
window.setIntervalEx = function(fRef, mDelay)
{
if(typeof(fRef) == 'function')
{
var argu = Array.prototype.slice.call(arguments,2);
var f = (function(){ fRef.apply(null, argu);});
return _setInterval(f, mDelay);
}
return _setInterval(fRef,mDelay);
}
// end of é‡è½½ setInterval
/*
Cookie 相关函数
*/
function getCookieVal(offset)
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1) endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function getCookie(name)
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg) return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie(name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + "=" + escape(value) +
((expires == null) ? "" : (typeof expires === "number" ? "; max-age=" + expires : "; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
if(typeof setCookie == 'undefined') setCookie = SetCookie;
/*
var expdate = new Date();
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); //一年åŽè¿‡æœŸ
SetCookie("WebTongCid", WebTongCid, expdate ,"/");
*/
//** end of Cookie 相关函数
if(typeof(formatColorHex) == 'undefined'){
function formatColorHex(color) {
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
/*RGB颜色转æ¢ä¸º16进制*/
if (/^(rgb)/i.test(color)) {
var aColor = color.replace(/(?:\(|\)|rgb)*/gi, "").split(",");
var strHex = "#";
for (var i = 0; i < aColor.length; i++) {
var hex = Number(aColor[i]).toString(16);
if (hex.length == 1) {
hex = "0" + hex;
} //问题出在这里
if (hex === "0") {
hex += hex;
}
strHex += hex;
}
if (strHex.length !== 7) {
strHex = color;
}
return strHex;
} else if (reg.test(color)) {
var aNum = color.replace(/#/, "").split("");
if (aNum.length === 6) {
return color;
} else if (aNum.length === 3) {
var numHex = "#";
for (var i = 0; i < aNum.length; i += 1) {
numHex += (aNum[i] + aNum[i]);
}
return numHex;
}
} else {
return color;
}
}
}
//动æ€åŠ è½½ jscript
window.addedScript = {};
function addScript(path,callback,afterPageLoaded) {
if(window.addedScript[path]){
if(window.addedScript[path]== -1 && typeof callback == 'function'){
setTimeout(function(){addScript(path,callback,afterPageLoaded)},50);
return;
}
if(window.addedScript[path] == 1){
console.log(path + " have already loaded ");
if (typeof callback == 'function') callback();
return;
}
}
window.addedScript[path] = -1;
var addfun = function(){
var fileref = document.createElement("script")
fileref.type = "text/javascript";
fileref.src = path;
if (typeof fileref.onload != 'undefined') {
fileref.onload = function(){
window.addedScript[path] = 1;
if (typeof callback == 'function') callback();
};
}
else {
fileref.onreadystatechange = function () {
if (this.readyState == "loaded" || this.readyState == "complete") {
window.addedScript[path] = 1;
if (typeof callback == 'function') callback();
}
};
}
var headobj = document.getElementsByTagName('head')[0];
headobj.appendChild(fileref);
};
if(afterPageLoaded){
if(window.addEventListener) window.addEventListener('load', function(){ addfun(); }, false);
else window.attachEvent('onload', function(){ addfun(); });
}else addfun();
}
//动æ€åŠ 载一大波 jscript,ä¿è¯æŒ‰é¡ºåºåŠ è½½
function addScripts(paths, callback, afterPageLoaded) {
paths = paths || [];
var lastCb = callback;
for (var i = 0; i < paths.length; i++) {
lastCb = (function () {
var path = paths[paths.length - 1 - i];
var cb = lastCb;
var afterPageLoaded1 = afterPageLoaded;
return function () {
addScript(path, cb, afterPageLoaded1);
}
})(i);
}
lastCb();
}
window.addedCss = {};
function loadStyleSheet(path,afterPageLoaded){
if(window.addedCss[path]){
console.log(path + " have already loaded ");
return;
}
if(afterPageLoaded) $(window).load(function(){ $(' ').appendTo('head'); });
else $(' ').appendTo('head');
window.addedCss[path] = true;
}
(function ($) {
$.fn.extend({
"addrSelector":function(options){
var defaults = {
loadDefaultAddr: null,
selectAddr: $.noop,
createNewAddr: $.noop,
selectedAddrID: 0,
isShowIdCardNo: false,
isManagePage:false//是ä¸æ˜¯åœ°å€ç®¡ç†é¡µé¢ by hui
};
var opts = $.extend({}, defaults, options);
return this.each(function () {
if (typeof opts.loadDefaultAddr == 'function') {
$.getJSON('/index.php?c=front/Useraddr&a=GetDefaultAddr', {}, function (json) {
if (!json.success) {
alert(json.msg);
return;
}
opts.loadDefaultAddr(json.addr);
if (json && json.addr && !isNaN(Number(json.addr.ID)) && parseInt(json.addr.ID) > 0) {
opts.selectedAddrID = parseInt(json.addr.ID);
}
});
}
if(opts.isManagePage){
getUserAddrList(opts);
}else{
$(this).off('click.showAddrSelector').on('click.showAddrSelector', function () {
getUserAddrList(opts);
})
}
});
}
});
var getUserAddrList = function(opts){
if ($('#userAddrContent').length == 0) {
$.extend({
selectAddr: function (addr) {
if (typeof opts.selectAddr == 'function')
opts.selectAddr(addr);
},
createNewAddr: function (addr) {
if (typeof opts.createNewAddr == 'function')
opts.createNewAddr(addr);
},
selectedAddrID: opts.selectedAddrID,
isShowIdCardNo: opts.isShowIdCardNo,
isManagePage:opts.isManagePage
});
$.ajax({
type: 'get',
url: '/index.php?c=front/Useraddr',
dataType: 'html',
success: function (msg) {
$(msg).hide().appendTo('body');
$('#userAddrContent').stop().fadeIn();
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.responseText);
}
})
} else {
// $('#userAddrContent .addrList .addr .selectbtn').css('display','none');
// $('#userAddrContent .addrList .addr[addrID=' + $.selectedAddrID + '] .selectbtn').css('display','inline-block');
$('#userAddrContent .addrList .addr .select-status').hide();
$('#userAddrContent .addrList .addr[addrID=' + $.selectedAddrID + '] .select-status').show();
$('#userAddrContent').stop().fadeIn();
}
};
})(window.jQuery);
(function ($) {
$.fn.extend({
"districtSeletor": function (options) {
if (options == 'setValue') {
dataBind(arguments[1] || {}, this);
return this;
} else {
return this.each(function () {
var opts = $.extend({}, defaults, options);
var $this = $(this);
var sHtml = '';
sHtml = ''
sHtml += 'ä¸å›½ 其他 ';
sHtml += ' ';
sHtml += ' ';
sHtml += ' ';
$this.html(sHtml).addClass('districtSelector')//.attr('relid=' + relid);
if (opts.showCountry) {
$this.find('.level1').show();
} else {
$this.find('.level1').hide();
}
$this.find('.level1').on('change', function () {
if ($(this).val() == 1) {
$(this).nextAll('select').show();
getNextLevelList(this);
} else {
$(this).nextAll('select').hide();
}
})
$this.find('.level2, .level3').on('change', function () {
getNextLevelList(this);
});
dataBind(opts, $this);
});
}
}
});
var defaults = {
countryID: 1,
provinceID: null,
cityID: null,
districtID: null,
showCountry: 1
};
var getNextLevelList = function (selectElem) {
selectElem = $(selectElem);
var id = parseInt(selectElem.val());
if (isNaN(id)) return;
var level = parseInt(selectElem.attr('level'));
selectElem.nextAll('select').html('--请选择-- ');
if (id <= 0) return;
$.ajax({
type: 'get',
url: '/index.php?c=front/district&a=getChildrenList',
data: { act: 'getChildrenList', id: id },
async: false,
dataType: 'json',
success: function (json) {
if (!json.success) {
alert(json.msg);
return;
}
var targetSelectElem = selectElem.nextAll('.level' + (level + 1));
var list = json.list || [];
for (var i = 0; i < list.length; i++) {
targetSelectElem.append('' + list[i].Name + ' ');
}
if (list.length == 0) {
targetSelectElem.hide();
targetSelectElem.nextAll('.level' + (level + 2)).hide();
targetSelectElem.nextAll('.level' + (level + 3)).hide();
} else {
targetSelectElem.show();
targetSelectElem.nextAll('.level' + (level + 2)).show();
targetSelectElem.nextAll('.level' + (level + 3)).show();
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.responseText);
}
})
};
var dataBind = function (opts, $this) {
if (opts.countryID && parseInt(opts.countryID) > 0) {
$this.find('.level1').val(opts.countryID).change();
} else {
$this.find('.level1').val(-1).change();
}
if (opts.provinceID && parseInt(opts.provinceID) > 0) {
$this.find('.level2').val(opts.provinceID).change();
}
if (opts.cityID && parseInt(opts.cityID) > 0) {
$this.find('.level3').val(opts.cityID).change();
}
if (opts.districtID && parseInt(opts.districtID) > 0) {
$this.find('.level4').val(opts.districtID).change();
}
};
$.fn.districtSeletor.setValue = function (opts) {
dataBind(opts);
}
})(window.jQuery);
// 获å–当å‰é¡µé¢urlå‚æ•°
if (!window.location.getQueryString) window.location.getQueryString = function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return (r[2]); return null;
};// END OF /share/global.js
// STARTS OF /share/floaters.js
var floaters_delta = 0.15
var floaters_collection;
var floaters_timer = null;
var floaters_timer2 = null;
if(typeof(floaters) == 'undefined'){
function floaters() {
this.items = [];
this.addItem = function(id,x,y,content) {
if($('#'+id).length > 0){
m = $('#'+id);m.css({'position':'absolute','z-index':'4001','left':(typeof(x)=='string'?eval(x):x)+'px','top':(typeof(y)=='string'?eval(y):y)+'px'});
this.replace(m[0]);
}
else $("body").append(''+content+'
');
var found = false;
for(var i in this.items){
if($(this.items[i].object).attr('id') == id){
this.items[i].x = x; this.items[i].y = y; found = true;break;
}
}
if(!found){
var newItem = {};
newItem.object = document.getElementById(id);
newItem.x = x;
newItem.y = y;
this.items[this.items.length] = newItem;
}
}
this.play = function() {
if(this.floaters_timer2 != null){ alert('floaters play2 与 play 冲çª');return;}
floaters_collection = this.items;
if(this.floaters_timer == null) this.floaters_timer = setInterval('floaters_play()',20);
}
this.remove = function(id){
var newitems = [];
for(var i in this.items){
if($(this.items[i].object).attr('id') != id){
newitems.push(this.items[i]);
}
}
this.items = newitems;
floaters_collection = this.items;
}
this.replace = function(obj){
for(var i in this.items){
if($(this.items[i].object).attr('id') == $(obj).attr('id')){
this.items[i].object = obj;
}
}
}
// 新的用这个
this.addItem2 = function(options,action) {
if(action == 'remove'){
this.remove(options.floaterID);
return;
}
if($('#'+options.floaterID).length > 0){
m = $('#'+options.floaterID);m.css({'position':'absolute','z-index':'4001','left':options.distance_from_page_x+'px','top':options.distance_from_page_y+'px'});
this.replace(m[0]);
}
else $("body").append(''+options.content+'
');
var found = false;
for(var i in this.items){
if($(this.items[i].object).attr('id') == options.floaterID){
for(var key in options){
this.items[i][key] = options[key];
}
found = true;break;
}
}
if(!found){
var newItem = options || {};
newItem.object = document.getElementById(options.floaterID);
this.items[this.items.length] = newItem
}
return $('#' + options.floaterID);
}
this.play2 = function() {
if(this.floaters_timer != null){ alert('floaters play 与 play2 冲çª');return;}
floaters_collection = this.items
if(this.floaters_timer2 == null) this.floaters_timer2 = setInterval('floaters_play2()',20);
}
this.stop = function(){
clearInterval(floaters_timer);
clearInterval(floaters_timer2);
}
}
function floaters_play() {
for(var i = 0;i < floaters_collection.length;i++) {
var followObj = floaters_collection[i].object;
if($(followObj).attr("float-disabled") == "true") continue;
var followObj_x = (typeof(floaters_collection[i].x) == 'string' ? eval(floaters_collection[i].x):floaters_collection[i].x);
var followObj_y = (typeof(floaters_collection[i].y) == 'string' ? eval(floaters_collection[i].y):floaters_collection[i].y);
// 用了æŸäº›DOCTYPE åŽ ie document.body.scrollTop,document.body.scrollLeft 始终为0,所以这里兼容一下
var scrollLeft = document.body.scrollLeft;
if (scrollLeft == 0 && document.documentElement.scrollLeft > 0) {
scrollLeft = document.documentElement.scrollLeft;
}
var scrollTop = document.body.scrollTop;
if (scrollTop == 0 && document.documentElement.scrollTop > 0) {
scrollTop = document.documentElement.scrollTop;
}
if (followObj.offsetLeft != (scrollLeft + followObj_x)) {
var dx = (scrollLeft + followObj_x - followObj.offsetLeft) * floaters_delta;
dx = (dx > 0 ? 1 : -1) * Math.ceil(Math.abs(dx));
followObj.style.left = followObj.offsetLeft + dx + "px";
}
if (followObj.offsetTop != (scrollTop + followObj_y)) {
var dy = (scrollTop + followObj_y - followObj.offsetTop) * floaters_delta;
dy = (dy > 0 ? 1 : -1) * Math.ceil(Math.abs(dy));
followObj.style.top = followObj.offsetTop + dy + "px";
}
//followObj.style.display = '';
}
}
// 浮动层滚动效果增强版,浮动框必须为ç»å¯¹å®šä½ï¼Œå¹¶ä¸”是body必须是å级
function floaters_play2(){
//处ç†åœ¨çº¿å®¢æœçš„
for(var i = 0;i < floaters_collection.length;i++) {
if($(floaters_collection[i].object).attr('id') == 'IMPanel'){
if((SiteType == 1 && $(window).width() < 993) || typeof frames['pageframe'] != 'undefined'){
floaters_collection[i].object.style.display = 'none';
return;
}else floaters_collection[i].object.style.display = 'block';
}
}
var defaults = {
floaterID: 0,
content: '',
xFloat: 'left', // left, right, null, 表示选择è·è§†çª—左还是è·å³è®¡ç®—,null表示ä¸è®¡ç®—
yFloat: 'top', // top, bottom, null, 表示选择è·è§†çª—上还是è·ä¸‹è®¡ç®—,null表示ä¸è®¡ç®—
// 下é¢è¿™å››ä¸ªå€¼å¤§äºŽç‰äºŽ0ï¼Œæ ¹æ®xFloatå’ŒyFloatæ¥é€‰æ‹©æ€§ä¼
distanceFromPageTop: 0,
distanceFromPageBottom: 0,
distanceFromPageLeft: 0,
distanceFromPageRight: 0
};
for(var i = 0;i < floaters_collection.length;i++) {
options = $.extend(true, defaults, floaters_collection[i]);
var followObj = floaters_collection[i].object;
if($(followObj).attr("float-disabled") == "true") continue; //float-disabled是在拖动浮动模å—(/scripts/jQPlugins/YouDraggable.js)的地方设置的,是为了é¿å…在拖动ä¸æ¨¡å—浮动
var curLeft = $(followObj).offset().left;
var targetLeft = 0;
if(options.xFloat == 'left'){
targetLeft = $(window).scrollLeft() + options.distanceFromPageLeft;
}else if(options.xFloat == 'right'){
targetLeft = $(window).scrollLeft() + $(window).width() - $(followObj).outerWidth() - options.distanceFromPageRight;
}else{
targetLeft = curLeft;
}
var scrollDistanceX = (targetLeft - curLeft) * floaters_delta;
var curTop = $(followObj).offset().top;
var targetTop = 0;
if(options.yFloat == 'top'){
targetTop = $(window).scrollTop() + options.distanceFromPageTop;
}else if(options.yFloat == 'bottom'){
targetTop = $(window).scrollTop() + $(window).height() - $(followObj).outerHeight() - options.distanceFromPageBottom;
}else{
targetTop = curTop;
}
var scrollDistanceY = (targetTop - curTop) * floaters_delta;
$(followObj).css({
'left': curLeft + scrollDistanceX,
'top': curTop + scrollDistanceY
});
}
}
}
// 创建在线客æœæµ®åŠ¨æ¡†
function createOnlineService(options){
var onlineim = new floaters();
$('head').append(' ');
var floaterID = 'IMPanel';
if(options.style == 20){
var floaterElem = null;
if(options.location == "1") { // é å³æµ®åŠ¨
floaterElem = onlineim.addItem2({
floaterID: floaterID,
content: options.content,
xFloat: 'right',
yFloat: 'top',
distanceFromPageTop: 100,
'distanceFromPageRight':0
});
floaterElem.children().addClass('right');
floaterElem.css({'left': $(window).width() - 228, 'top': 100});
}
else{ // é 左浮动
floaterElem = onlineim.addItem2({
floaterID: floaterID,
content: options.content,
xFloat: 'left',
yFloat: 'top',
distanceFromPageTop: 100,
'distanceFromPageLeft':0
});
floaterElem.children().addClass('left');
floaterElem.css({'left': 0,'top': 100});
}
floaterElem.find('.online-service-toggle-btn').off().on('click', function(){
var state = $(this).attr('state') || 0; // 0: 显示主体 , 1:éšè—主体
var location = floaterElem.children().hasClass('left') ? 'left' : 'right';
if(location == 'left'){
if(state == 1){
$(this).attr('state', 0);
var self = this;
floaterElem.children().removeClass('out');
floaterElem.find('.online-service-header').show();
floaterElem.find('.online-service-content').show();
$(self).css("left","209px");
floaterElem.stop().animate({'left': 0}, function(){
$(self).removeClass('right').addClass('left');
floaterElem.attr("float-disabled",'false');
});
}else{
$(this).attr('state', 1);
var self = this;
floaterElem.find('.online-service-toggle-btn').css('top', floaterElem.outerHeight() / 2);
floaterElem.attr("float-disabled",'true');
floaterElem.stop().animate({'left': -floaterElem.outerWidth()}, function(){
floaterElem.children().addClass('out');
$(self).removeClass('left').addClass('right');
floaterElem.find('.online-service-header').hide();
floaterElem.find('.online-service-content').hide();
$(self).css("left","0px");
floaterElem.attr("float-disabled",'false');
});
}
}else{
if(state == 1){
$(this).attr('state', 0);
var self = this;
floaterElem.children().removeClass('out');
floaterElem.stop().animate({'left': $(window).width() - floaterElem.outerWidth()}, function(){
$(self).removeClass('left').addClass('right');
});
}else{
$(this).attr('state', 1);
var self = this;
floaterElem.find('.online-service-toggle-btn').css('top', floaterElem.outerHeight() / 2);
floaterElem.stop().animate({'left': $(window).width() - (parseFloat($(self).css('border-left-width')) || 0)}, function(){
floaterElem.children().addClass('out');
$(self).removeClass('right').addClass('left');
});
}
}
});
floaterElem.find('.online-service-header-close').off().on('click', function(){
floaterElem.find('.online-service-toggle-btn').click();
});
onlineim.play2();
}
else if(options.style == 21){
var floaterElem = null;
if(options.location == "1") { // é å³æµ®åŠ¨
floaterElem = onlineim.addItem2({
floaterID: floaterID,
content: options.content,
xFloat: 'right',
yFloat: 'top',
distanceFromPageTop: 100,
distanceFromPageRight: 20
});
floaterElem.children().addClass('right');
floaterElem.css({'left': $(window).width() - 228 - 50, 'top': 100});
}
else{ // é 左浮动
floaterElem = onlineim.addItem2({
floaterID: floaterID,
content: options.content,
xFloat: 'left',
yFloat: 'top',
distanceFromPageTop: 100,
distanceFromPageLeft: 20
});
floaterElem.children().addClass('left');
floaterElem.css({'left': 20,'top': 100});
}
floaterElem.find('.online-service-header-close').off().on('click', function(){
floaterElem.remove();
});
onlineim.play2();
}
else if(options.style == 22 || options.style == 23){
var floaterElem = $(options.content).attr('id', floaterID).appendTo('body');
var location = options.location;
if(location == '1'){
floaterElem.addClass('right');
}else{
floaterElem.addClass('left');
}
floaterElem.find('.online-service-btn').off('mouseenter').on('mouseenter', function(){
if(typeof onlineService2Timeout != 'undefined'){
clearTimeout(onlineService2Timeout);
}
var targetPanel = $(this).attr('target');
floaterElem.find('.online-service-content').show();
floaterElem.find('.online-service-content').children().not('[about=' + targetPanel + ']').hide();
floaterElem.find('.online-service-content').children('[about=' + targetPanel + ']').show();
});
floaterElem.find('.online-service-content').off('mouseenter').on('mouseenter', function(){
if(typeof onlineService2Timeout != 'undefined'){
clearTimeout(onlineService2Timeout);
}
});
floaterElem.find('.online-service-btn, .online-service-content').off('mouseleave').on('mouseleave', function(){
onlineService2Timeout = setTimeout(function(){
floaterElem.find('.online-service-content').hide();
}, 300);
});
if(SiteType == "1" && $(window).width() < 993) floaterElem.css('display','none');
$(window).resize(function(){
if(SiteType == "1" && $(window).width() < 993) floaterElem.css('display','none');
else floaterElem.css('display','block');
});
setInterval(function(){
if(typeof frames['pageframe'] != 'undefined') floaterElem.css('display','none'); //ä¿è¯ç¼–辑框架下ä¸æ˜¾ç¤º
},5);
}
};// END OF /share/floaters.js
// STARTS OF /share/JScript.js
$(function () {
if(getCookie("SiteType") == "1"){
$(window).resize(function(e){
if(e.target === window){
showhideNav();
setTimeout(function(){moduleImageTextHide();},20);
computeFreeModulePosition();
computeJiuGondHeight();
}
});
$(window).load(function(){showhideNav();computeFreeModulePosition();});
setTimeout(function(){moduleImageTextHide();},20);
}
$(window).load(function(){initHoverAnimate();});
doSomeWhanPreview();
keepFullScreenModules100Width();
//广告
if($("#ChargeTips").height()){
$("body > .ModuleItem").each(function(i,item){ $(item).css("top",parseInt($(item).css("top")) + $("#ChargeTips").height()); });
}
setMobileNav();
matchNavAndFootNavBgColor();
setModuleCls();
NewsList();
TopNewLoad();
BindPagerAction(); //接管模å—的分页链接,用ajax请求
SetImageWidth();
setZonePadding();
var $container = $('.masonry-container');
if ($container.length > 0) {
$container.imagesLoaded(function () {
$container.masonry({
columnWidth: '.productItem',
itemSelector: '.productItem'
});
});
}
});
function isMobileBroswer() {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
var bIsWeixin = sUserAgent.match(/micromessenger/i) == "micromessenger";
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM || bIsWeixin) {
return true;
} else {
return false;
}
}
function setZonePadding(){
if($("#BodyLeftZone").length > 0 && $("#BodyLeftZone").css("display") != "none") $("#BodyMain1Zone,#BodyMain2Zone,#BodyMain3Zone,#BodyMain4Zone").css({"padding-left":"3px"});
else $("#BodyMain1Zone,#BodyMain2Zone,#BodyMain3Zone,#BodyMain4Zone").css({"padding-left":"0px"});
if($("#BodyRightZone").length > 0 && $("#BodyRightZone").css("display") != "none") $("#BodyMain1Zone,#BodyMain2Zone,#BodyMain3Zone,#BodyMain4Zone").css({"padding-right":"3px"});
else $("#BodyMain1Zone,#BodyMain2Zone,#BodyMain3Zone,#BodyMain4Zone").css({"padding-right":"0px"});
if(typeof CanDesign != 'undefined' && CanDesign == "True" && SiteType == "0") setTimeout(setZonePadding,300);
}
function hasAbsoluteObj(){
var flag = false;
if(SiteType == "1"){
$("#BodyHeaderZone,#BodyMain1Zone,#BodyFooterZone").find(".ModuleItem:visible").each(function(i,item){
if($(item).css("position") == "absolute"){
flag = true;
}
});
}
return flag;
}
// 详情页é¢é‡æ–°è®¡ç®—区域高度
function computeZoneHeight(zoneElem) {
var oZone = $(zoneElem);
resizeZone(oZone);
if (oZone.find(".ModuleProductDetail, .ModuleNewsDetail, .ModuleDownDetail").length > 0) {
$(zoneElem).find('img').each(function () {
this.onload = function () {
resizeZone(oZone);
}
});
}
if (!oZone.hasClass('ModuleTabsContent')){
setTimeout(function () { resizeZone(zoneElem) }, 500);
setTimeout(function () { resizeZone(zoneElem) }, 1000);
setTimeout(function () { resizeZone(zoneElem) }, 2000);
setTimeout(function () { resizeZone(zoneElem) }, 4000);
}
}
//h5 计算自由模å—的横åæ ‡
function zoneHasAbsoluteObj(zone){
var hasAbsolute = false;
$(zone).find(".ModuleItem:visible").each(function(i,item){
if($(item).css("position") == "absolute"){
hasAbsolute = true;
}
});
return hasAbsolute;
}
function computeFreeModulePosition(module){
if(SiteType != "1") return;
window.nodelayimg = true; //H5站混åˆé™æ€å’Œè‡ªç”±æ¨¡å—时,ä¸èƒ½ä½¿ç”¨å›¾ç‰‡å»¶æ—¶åŠ è½½ï¼Œå› ä¸ºå›¾ç‰‡å»¶æ—¶åŠ è½½ä¼šæ”¹å˜é¡µé¢çš„高度
if(module){
var m = null;
if(typeof module == 'object') m = $(module);
else m = $('#' + module);
var parent = m.closest("#HeaderZone,#FooterZone,#BodyMain1Zone");
if($(window).width() > 993){
if(m.attr('float') == 'free'){
var helperid = 'freemodulehelper';
var helper = $("#"+helperid);
var left = helper.offset().left + parseInt(m.attr('floatx'));
m.css({'visibility':'visible','display':'block','left':left+"px"});
}
m.parent().find('.ModuleGridContainer').each(function(i,grid){
$(grid).css('min-width',$(grid).css('max-width'));
});
//处ç†äº§å“列表模å—çš„å“应横版PAD的功能
m.parent().find('.productsBox').each(function(i,prolist){
for(var k=1;k<11;k++){$(prolist).removeClass('col-md-'+k);$(prolist).removeClass('col-sm-'+k);$(prolist).removeClass('col-xs-'+k);}
$(prolist).addClass('col-xs-'+$(prolist).attr('pc-col'));
});
computeZoneHeight(parent);
}else{
m.css({'visibility':'hidden','display':'none'});
if(!zoneHasAbsoluteObj(parent)) parent.css("height","auto");
m.parent().find('.ModuleGridContainer').each(function(i,grid){
$(grid).css('min-width','0');
});
}
}else{
var modules = $(".ModuleItem[float=free]");
$.each(modules,function(i,item){
computeFreeModulePosition(item);
});
}
}
function resizeZone(oZone) {
var iZoneHeight = 0;
//var padscale = isPad();
oZone.children('.ModuleItem:visible').each(function () {
iZoneHeight = Math.max(iZoneHeight, $(this).outerHeight(false) + $(this).position().top);
});
oZone.css('height',iZoneHeight);
if(getCookie("SiteType") == "1" && !zoneHasAbsoluteObj(oZone)){
$(oZone).css('height', 'auto');
}
}
//è®©å›¾ç‰‡æ ¹æ®ä¸Šçº§å®¹å™¨çš„尺寸自动适应大å°
function resizeImage(imgo){
var img = new Image();
img.src = $(imgo).prop('src');
// 按比例缩放,原图å°äºŽå¤–框ä¸æ“作
var bw = $(imgo).parent().width();
var bh = $(imgo).parent().height();
var ow = img.width;
var oh = img.height;
var nw, nh;
if(ow > bw || oh > bh){
if(ow / oh >= bw / bh){
nw = bw;
nh = nw * oh / ow;
}else if(ow / oh < bw / bh){
nh = bh;
nw = nh * ow / oh;
}
}else{
nw = ow;
nh = oh;
}
$(imgo).width(nw);
$(imgo).height(nh);
$(imgo).css({'margin-top': (bh - $(imgo).outerHeight(false)) / 2 + 'px' });
}
function SetImageWidth() {
if (SiteType == "1") {
$("img").each(function () {
if ($(this).closest('.ModuleNewsDetail').length > 0 || $(this).closest('.ModuleJiuGong,.ModuleJiuGongV2').length > 0) return true;
// $(this).css('max-width', '100%');
});
$('.goods-detail-content table').each(function () {
if ($(this).width() > $("#pagebody").width()) {
$(this).css('width', '100%');
}
});
}
$("img").each(function () {
if ($(this).closest('.ModuleNewsDetail').length > 0 || $(this).hasClass('vCodeImg')) return true;
if ($(this).width() > $("#pagebody").width() && $("#pagebody").length > 0) {
var oldh = $(this).height();
var oldw = $(this).width();
try {
var offsetp = $(this).closest(".ModuleItem").offset().left;
var offset = $(this).offset().left;
var offsetx = offset - offsetp;
if (offsetx < 0) offsetx = 0;
} catch (e) { }
var w = parseInt($("#pagebody").width() * 0.95) - offsetx;
var h = parseInt(oldh / (oldw / w));
if(SiteType == 0) $(this).css({ "width": w, "height": h });
}
if ($(this).closest('.PIMG').length == 0) {
$(this).prop("src", $(this).attr("src"));
$(this).on('load', function () {
if ($(this).width > $("#pagebody").width()) {
var oldh = $(this).height();
var oldw = $(this).width();
try {
var offsetp = $(this).closest(".ModuleItem").offset().left;
var offset = $(this).offset().left;
var offsetx = offset - offsetp;
if (offsetx < 0) offsetx = 0;
} catch (e) { }
var w = parseInt($("#pagebody").width() * 0.95) - offsetx;
var h = parseInt(oldh / (oldw / w));
$(this).css({ "width": w, "height": h });
}
});
}
});
}
function showhideNav(){
if($("#MobileFootNav").attr("enable") == 1 && $("#pagebody").width() >= 1200 || $("#MobileFootNav").attr("enable") == 1 && ($("#pagebody").width() >= 975 && $("#pagebody").width() < 1200)){
$('#MobileFootNav,#MobileFootNavRenderElem').hide();
}else if($("#MobileFootNav").attr("enable") == 1 && ($("#pagebody").width() >= 751 && $("#pagebody").width() < 975) || $("#MobileFootNav").attr("enable") == 1 && $("#pagebody").width() < 751){
$('#MobileFootNav,#MobileFootNavRenderElem').show();
}else if($("#MobileFootNav").attr("enable") == 0 && $("#pagebody").width() >= 1200 || $("#MobileFootNav").attr("enable") == 0 && ($("#pagebody").width() >= 975 && $("#pagebody").width() < 1200) || $("#MobileFootNav").attr("enable") == 0 && ($("#pagebody").width() >= 751 && $("#pagebody").width() < 975) || $("#MobileFootNav").attr("enable") == 0 && $("#pagebody").width() < 751){
$('#MobileFootNav,#MobileFootNavRenderElem').hide();
}
if ($("#MobileNav").attr("enable") == 1 && $("#pagebody").width() >= 1200 || $("#MobileNav").attr("enable") == 1 && ($("#pagebody").width() >= 975 && $("#pagebody").width() < 1200)) {
$('#MobileNav,#MobileNavRenderElem,#MobileNavFloatLayer,#MobileNavMask').hide();
$('#pagebody').css("left", "0rem");
$("#MobileFootNav").removeClass("showFloatNav");
} else if($("#MobileNav").attr("enable") == 1 && ($("#pagebody").width() >= 751 && $("#pagebody").width() < 975) || $("#MobileNav").attr("enable") == 1 && $("#pagebody").width() < 740){
$('#MobileNav,#MobileNavRenderElem,#MobileNavFloatLayer,#MobileNavMask').show();
if($("#MobileNav").attr("navnum") == 4 || $("#MobileNav").attr("navnum") == 6 || $("#MobileNav").attr("navnum") == 7){
$('#MobileNavRenderElem').hide();
}else{
$('#MobileNavRenderElem').show();
}
if($("#MobileNavFloatLayer").hasClass("showFloatNav") == false){
$('#pagebody').css("left", "0rem");
$("#MobileFootNav").removeClass("showFloatNav");
}else{
if($("#MobileNav").attr("navnum") == 5){
$('#pagebody').css("left", "6.25rem");
$("#MobileFootNav").addClass("showFloatNav");
}else if($("#MobileNav").attr("navnum") == 1){
$('#pagebody').css("left", "10rem");
$("#MobileFootNav").addClass("showFloatNav");
}
}
} else if($("#MobileNav").attr("enable") == 0 && $("#pagebody").width() > 1200 || $("#MobileNav").attr("enable") == 0 && ($("#pagebody").width() >= 975 && $("#pagebody").width() < 1200) || $("#MobileNav").attr("enable") == 0 && ($("#pagebody").width() >= 751 && $("#pagebody").width() < 975) || $("#MobileNav").attr("enable") == 0 && $("#pagebody").width() < 740){
$('#MobileNav,#MobileNavRenderElem,#MobileNavFloatLayer,#MobileNavMask').hide();
}
if($('#MobileNav').attr('navnum') == 4){
if($("#pagebody").width() < 740){
$('#MobileNavFloatLayer').css("left","18.9%")
}else if($("#pagebody").width() > 500 && $("#pagebody").width() <= 751){
$('#MobileNavFloatLayer').css("left","13%")
}else if($("#pagebody").width() > 751 && $("#pagebody").width() <= 975){
$('#MobileNavFloatLayer').css("left","11.5%")
}else{
$('#MobileNavFloatLayer').css("left","8%")
}
}
if($("#pagebody").width() > 768){
$(".FootNavMask,.FootNavQRCodeImg,.QQList").hide();
$(".goods-btn").show();
}else{
$(".FootNavMask,.FootNavQRCodeImg,.QQList").show();
$(".goods-btn").hide();
}
if($("#MobileFootNav").length > 0){
if($("#MobileFootNav").is(":hidden")){
$('#pagebody').css('padding-bottom',"0")
}else{
$('#pagebody').css('padding-bottom',$("#MobileFootNav").height());
}
}
$(".FootNavQRCodeImg").css({
"width": "192px",
"height": "192px",
"top": "initial",
"bottom": $('#MobileFootNav').innerHeight(),
"left": ($('body').outerWidth() / 2 - $(".FootNavQRCodeImg").outerWidth() / 2)
});
}
function TopNewLoad() {
$(".TopNews").each(function () {
var repNum = Number($(this).attr("lang"));
var iWidth = ($(this).width() / repNum) - (repNum * 10); //($(this).find("li").width() / repNum) - (repNum * 10);
$(this).find("li>span").css({ "width": iWidth + "px", "margin-right": "8px" });
$(this).find("li").each(function () {
if ($(this).children("span").toArray().length > 1) {
$(this).children("span").last().css({ "margin-right": "0px", "float": "right" });
}
});
});
}
function NewsList() {
$(".BodyCenterNews").each(function () {
var repNum = parseInt($(this).attr("RepeatNum")) > 0 ? parseInt($(this).attr("RepeatNum")) : 1;
var iWidth = ($(this).find("li").width() / repNum) - (repNum * 9);
$(this).find("i").css({ /*"width": iWidth + "px",*/"margin-right": "5px", "overflow": "hidden" });
$(this).find("li").each(function () {
if ($(this).children("i").length > 1) {
$(this).children("i").last().css({ "margin-right": "0px", "float": "right" });
}
});
if ($(this).attr("value") !== "") {
var itemHeight = $(this).find(".vTicker").find("li").height();
var iHeight = $(this).find(".vTicker>ul").height();
var showItems = parseInt(iHeight / itemHeight);
$(this).find(".vTicker").vTicker({
speed: 500,
pause: 3000,
direction: $(this).attr("value"),
mousePause: true,
showItems: showItems
}).css({ "height": iHeight + "px" }).find("li").css({ "padding": "0 5px" });
}
});
}
function ProductList() {
$(".ModuleProductList").each(function () {
if ($(this).find(".myslider").attr("value") !== "") {
$(this).find(".myslider").easySlider({
auto: true,
continuous: true,
vertical: false,
controlsShow: false
});
}
});
}
function SetProductListImage(module,sitetype) {
if(typeof(module) != "object") module = $('#module_' + module);
module.find('.PIMG>img').each(function () {
var src = $(this).attr("src");
$(this).attr("src", '');
$(this).on('load', function () { resizeProductListImageSize(this); });
$(this).attr("src", src);
});
initProductListEffect(module, sitetype);
}
function resizeProductListImageSize(img) {
$(img).css({'width':'auto','height':'auto'}); //先清除图片的高宽
var picWrapper = $(img).closest('.PicWrapper');
var imgParent = $(img).parent();
var imgp_pl = parseFloat(imgParent.css('padding-left') ? imgParent.css('padding-left') : 0);
var imgp_pr = parseFloat(imgParent.css('padding-right') ? imgParent.css('padding-right') : 0);
var imgp_pt = parseFloat(imgParent.css('padding-top') ? imgParent.css('padding-top') : 0);
var imgp_pb = parseFloat(imgParent.css('padding-bottom') ? imgParent.css('padding-bottom') : 0);
var imgp_bl = parseFloat(imgParent.css('border-left') ? imgParent.css('border-left') : 0);
var imgp_br = parseFloat(imgParent.css('border-right') ? imgParent.css('border-right') : 0);
var imgp_bt = parseFloat(imgParent.css('border-top') ? imgParent.css('border-top') : 0);
var imgp_bb = parseFloat(imgParent.css('border-bottom') ? imgParent.css('border-bottom') : 0);
var bw = picWrapper.innerWidth() - imgp_pl - imgp_pr - imgp_bl - imgp_br;
var bh = picWrapper.innerHeight() - imgp_pt - imgp_pb - imgp_bt - imgp_bb;
var ow = img.width;
var oh = img.height;
var nw, nh;
if (ow > bw || oh > bh) {
if (ow / oh >= bw / bh) {
nw = bw;
nh = nw * oh / ow;
} else if (ow / oh < bw / bh) {
nh = bh;
nw = nh * ow / oh;
}
} else {
nw = ow;
nh = oh;
}
$(img).css({
width: nw + 'px',
height: nh + 'px'
});
$(img).css({ 'margin-top': (bh - $(img).outerHeight(false)) / 2 + 'px' });
if ($(img).parent().css('text-align').toLowerCase() != 'center') {
$(img).css({ 'margin-left': (bw - $(img).outerWidth(false)) / 2 + 'px' });
}
}
function initProductListEffect(module, sitetype) {
if(typeof(module) != "object") module = $('#module_' + module);
var oProductList = $(module).find('.ProductList');
var showstyle = oProductList.attr('showstyle');
var direction = oProductList.attr('direction');
var countPerGroup = oProductList.attr('repeatnum');
if(CanDesign == "True" && showstyle > 0){
module.resize(function(){ if(module.css("position") != 'absolute') oProductList.parent().css({'position': 'relative',overflow: 'hidden','width':module.width()+"px"});});
}
if (sitetype == 1) {
// ä¿®å¤æ‰‹æœºä¸‹ï¼Œæè¿°æ–‡å—ä¸ç¡®å®šå¯¼è‡´".PDetail"高度ä¸é½çš„çš„bug
if(!module.attr("haschangedetail")){
iRepeatnum = parseFloat(oProductList.attr('repeatnum'));
if (iRepeatnum == 0 || showstyle == 1 || showstyle == 2) {
var iMaxHeight = 0;
module.find('.PDetail').each(function () {
iMaxHeight = Math.max(iMaxHeight, $(this).height());
})
module.find('.PDetail').css('height', iMaxHeight);
} else {
var iTotalLine = Math.ceil(module.find('.PDetail').length / iRepeatnum);
var oPDetails = module.find('.PDetail');
for (var i = 0; i < iTotalLine; i++) {
var iMaxHeight = 0;
oPDetails.each(function (j) {
if (i * iRepeatnum <= j && j < (i + 1) * iRepeatnum) {
iMaxHeight = Math.max(iMaxHeight, $(this).height());
}
})
oPDetails.slice(i * iRepeatnum, (i + 1) * iRepeatnum).css('height', iMaxHeight);
}
}
module.attr("haschangedetail","1");
}
}
if (window['effectInterval_' + module.attr('id')]) {
clearInterval(window['effectInterval_' + module.attr('id')]);
}
if (module.length > 0) {
if (showstyle == 1) { // è¿žç»æ»šåŠ¨
var oProductBoxes = oProductList.children('.ProductBox').css({ float: 'left' });
if (sitetype == 1) {
oProductList.find('center').css('display', 'inline-block');
// 手机实际width通常是带å°æ•°çš„,但jquery所有方法返回宽度都是å‘下å–的整数,所以为了计算准确,+1px
oProductBoxes.css({ width: 'auto' }).css({ width: oProductBoxes.width() + 1 });
}
var listWidth = module.width();
oProductList.parent().css({'position': 'relative',overflow: 'hidden','width':module.width()+"px"});
var iWidth = oProductBoxes.outerWidth(true) * oProductBoxes.length * 2;
var iHeight = oProductBoxes.outerHeight(true);
oProductList.css({ position: 'relative', left: '0px', width: iWidth + 'px', height: iHeight + 'px', overflow: 'hidden' });
if (module.width() > iWidth) return;
if(module.attr('hasinit')!=1){
oProductList.append(oProductList.clone(true).children());
module.attr('hasinit',1);
};
var iRefreshInterval = 40;
var iStep = 1;
if(window['effectInterval_' + module.attr('id')]){
clearInterval(window['effectInterval_' + module.attr('id')])
}
window['effectInterval_' + module.attr('id')] = setInterval(function () {
if (oProductList.attr('ishovering') == 1 && oProductList.attr('hoverstop') == 1) {
return;
}
if (direction == 'left') {
if (oProductList.position().left <= -oProductList.innerWidth() / 2) {
oProductList.css('left', (oProductList.position().left + oProductList.innerWidth() / 2) + 'px');
}
oProductList.css('left', (oProductList.position().left - parseInt(oProductList.parent().css('padding-left')) - iStep) + 'px');
} else {
if (oProductList.position().left >= 0) {
oProductList.css('left', (-oProductList.innerWidth() / 2) + 'px');
}
oProductList.css('left', (oProductList.position().left - parseInt(oProductList.parent().css('padding-left')) + iStep) + 'px');
}
}, iRefreshInterval);
} else if (showstyle == 2) { // 一å±å±æ»šåŠ¨
var oProductBoxes = module.find('.ProductBox');
var iGroupCount = Math.ceil(oProductBoxes.length / countPerGroup);
for (var i = 0; i < iGroupCount; i++) {
$(oProductBoxes.slice(i * countPerGroup, i * countPerGroup + countPerGroup)).wrapAll('
');
}
if (sitetype == 1) {
oProductBoxes.css({ width: 'auto', height: 'auto', padding: '2px' });
}
oProductList.parent().css({'position': 'relative',overflow: 'hidden','width':module.width()+"px"});
var oProductGroups = module.find('.ProductGroup');
if(!oProductGroups.parent().is('.ProductGroupList')){
oProductGroups.wrapAll('
');
}
var oProductGroupList = module.find('.ProductGroupList');
if(module.css("position") != "absolute"){ iHeight = $(oProductBoxes[0]).height();}
oProductGroupList.css({ position: 'relative', top: '0px', width: module.innerWidth() * iGroupCount + 'px', overflow: 'hidden' });
oProductGroups.css({ float: 'left', width: module.innerWidth() + 'px', height: module.innerHeight() + 'px' });
if (iGroupCount <= 1) {
return;
}
if (direction == 'left') {
oProductGroupList.css({ left: '0px', right: 'auto' });
} else {
for (var i = 0 ; i < iGroupCount; i++) {
oProductGroups = module.find('.ProductGroup');
oProductGroups.eq(-1).insertBefore(oProductGroups.eq(i));
}
oProductGroupList.css({ left: 'auto', right: module.innerWidth() * (iGroupCount - 1) + 'px' });
}
module.find('.PDetail').css('width', module.find('.PicWrapper').width());
window['effectInterval_' + module.attr('id')] = setInterval(function () {
if (module.find('.ProductList').attr('ishovering') == 1 && module.find('.ProductList').attr('hoverstop') == 1) {
return;
}
var oProductGroupList = module.find('.ProductGroupList');
var oProductGroups = module.find('.ProductGroup');
if (direction == 'left') {
oProductGroupList.animate({
left: '-=' + oProductGroups.outerWidth(true) + 'px'
}, 1000, function () {
oProductGroups.eq(0).insertAfter(oProductGroups.eq(-1));
oProductGroupList.css('left', 0);
});
} else {
oProductGroupList.animate({
right: '-=' + oProductGroups.outerWidth(true) + 'px'
}, 1000, function () {
oProductGroups.eq(-1).insertBefore(oProductGroups.eq(0));
oProductGroupList.css('right', oProductGroups.outerWidth(true) * (iGroupCount - 1) + 'px');
});
}
}, 6000);
}
}
}
function showShopModal(productid, e, productShowType){
e = e || window.event;
e.stopPropagation && e.stopPropagation();
e.preventDefault && e.preventDefault();
e.cancelBubble = true;
if (!productid){
return false;
}
if(typeof productShowType == 'undefined'){
productShowType = 0;
}
var productSkus = [];
$.ajax({
url: '/index.php?c=Front/ProductData',
type: 'get',
data: { id: productid, productShowType: productShowType },
dataType: 'json',
async: false,
cache: false,
success: function (json) {
if (!json) {
alert('æ— æ¤å•†å“');
return;
}
var lg = json.lg;//多è¯è¨€
var windowWidth = $(window).width();
productShowType = json.productShowType;
productSkus = json.productSkus || [];
var html = '';
html += '';
html += '';
html += ' ';
html += ' ';
html += ' ';
html += ' ';
html += ' ';
html += '';
var dialog = bootbox.dialog({
title: lg.quick_purchase,
message: html,
show: false,
className: 'shopCartModal',
buttons: {}
}).on('shown.bs.modal', function (){
$('.pro_appeal').height($('.pro_appeal').width());
}).on('hidden.bs.modal',function(){
$('.swiper-container').each(function(){
$(this)[0].swiper.startAutoplay();
});
}).modal('show');
var surplus = parseInt(json.surplus);
if(isNaN(surplus) || surplus == 0){
$('.shopCartModal .Shtml').hide();
}else{
$('.shopCartModal .Shtml').show();
}
function checkValid() {
if (!/^\d+$/.test($('#ShopModalProNum').val() + '')) {
alert(lg.file_in_quantity);
return;
}
var enableInventory = $('.shopCartModal [name=enableInventory]').val();
if (enableInventory) {
var productQuantity = parseInt($('.shopCartModal .productQuantity').attr('productQuantity'));
if (!isNaN(productQuantity) && parseInt($('#ShopModalProNum').val()) > productQuantity) {
alert(lg.not_exceed_stock);
return false;
}
}
if(productSkus.length > 0 && !$('.shopCartModal [name="skuid"]').val()){
alert(lg.select_spec);
return false;
}
return true;
}
$('.shopCartModal .pro_amount').disableSelection();
$('.shopCartModal .sys_spec_text>li').off().on('click', function () {
if($(this).hasClass('outOfStock')){
return;
}
if($(this).hasClass('selected')){
$(this).removeClass('selected');
}else{
var attrkeyid = $(this).attr('attrkeyid');
$('[attrkeyid=' + attrkeyid +']').not(this).removeClass('selected');
$(this).addClass('selected');
}
var attrkeycount = $('.shopCartModal .sys_spec_text').length;
var attrvalselectedcount = $('.shopCartModal .sys_spec_text>li.selected').length;
if(attrkeycount - attrvalselectedcount == 1 || attrkeycount == attrvalselectedcount){
$('.shopCartModal .sys_spec_text>li').removeClass('outOfStock');
var elemAttrVals = $('.shopCartModal .sys_spec_text>li').not('.selected');
elemAttrVals.each(function(){
var path = '';
var elemAttrValInOtherKeys = $('.shopCartModal .sys_spec_text').not($(this).closest('.shopCartModal .sys_spec_text')).find('li.selected');
elemAttrValInOtherKeys.each(function(){
path += $(this).attr('attrvalid') + ',';
});
path += $(this).attr('attrvalid');
path = path.split(',').sort().join(',');
for(var i = 0; i < productSkus.length; i++){
var sku = productSkus[i];
var skuPath = (sku.Path || '').split(',').sort().join(',');
if(skuPath == path){
if(sku.ProductQuantity <= 0){
$(this).addClass('outOfStock');
}else{
$(this).removeClass('outOfStock');
}
break;
}
}
});
}else{
$('.shopCartModal .sys_spec_text>li').removeClass('outOfStock');
}
if(attrkeycount == attrvalselectedcount){
var attrkeyid = $(this).attr('attrkeyid');
$('[attrkeyid=' + attrkeyid +']').not(this).removeClass('selected');
$(this).addClass('selected');
var path = '';
$('.shopCartModal .sys_spec_text>li.selected').each(function(){
path += $(this).attr('attrvalid') + ',';
});
path = path.replace(/(^,)|(,$)/g, '');
path = path.split(',').sort().join(',');
var price = 0;
var point =0;
var skuid = 0;
var surplus=0;
var productQuantity = 0;
for(var i = 0; i < productSkus.length; i++){
if(path == productSkus[i].Path.split(',').sort().join(',')){
point = productSkus[i].Jf_convert;
price = productSkus[i].Price;
skuid = productSkus[i].SkuID;
surplus = productSkus[i].surplus;
productQuantity = productSkus[i].ProductQuantity;
break;
}
}
var priceHtml = '';
if(productShowType == 1){
point = parseFloat(point).toFixed(2);
surplus = parseFloat(surplus).toFixed(2);
$('.shopCartModal .price').text(point).data('singlePrice', price);
$(".shopCartModal .Shtml").attr('surplus', surplus).html(lg.pay_extra+'ï¿¥'+surplus);
var surplus = parseInt(json.surplus);
if(isNaN(surplus) || surplus == 0){
$('.shopCartModal .Shtml').hide();
}else{
$('.shopCartModal .Shtml').show();
}
priceHtml = point;
}else{
price = parseFloat(price).toFixed(2);
$('.shopCartModal .price').text('ï¿¥' + price).data('singlePrice', price);
}
$(".shopCartModal input[name=skuid]").val(skuid);
$('.shopCartModal .productQuantity').text(productQuantity).attr('productQuantity', productQuantity);
}else{
var minVal = -1, maxVal = 0, productQuantity = 0;
for(var i = 0; i < productSkus.length; i++){
var val = 0;
if(productShowType == 1){
val = parseFloat(productSkus[i].Jf_convert);
}else{
val = parseFloat(productSkus[i].Price);
}
minVal = minVal == -1 ? val : Math.min(minVal, val);
maxVal = maxVal == -1 ? val : Math.max(maxVal, val);
productQuantity += parseInt(productSkus[i].ProductQuantity);
}
var pHtml = minVal.toFixed(2);
if(minVal != maxVal){
pHtml = minVal.toFixed(2) + ' - ' + maxVal.toFixed(2);
}
if(productShowType != 1){
pHtml = 'ï¿¥' + pHtml;
}
$(".shopCartModal .Shtml").hide();
$('.shopCartModal .price').text(pHtml);//.data('singlePrice', price);
$(".shopCartModal input[name=skuid]").val(skuid);
$('.shopCartModal .productQuantity').text(productQuantity).attr('productQuantity', productQuantity);
}
});
$('.shopCartModal .sys_spec_text>li:nth-child(1)').each(function () {
$(this).click();
});
$(".shopCartModal .reduce").off().on('click', function () {
var num = parseInt($("#ShopModalProNum").val());
if (num == 1) return;
else $("#ShopModalProNum").val(num - 1);
var price = $('.shopCartModal .price').data('singlePrice');
//$('.shopCartModal .price').text('ï¿¥' + ((parseFloat(price) * (num - 1))).toFixed(2));
});
$(".shopCartModal .add").off().on('click', function () {
var num = parseInt($("#ShopModalProNum").val());
$("#ShopModalProNum").val(num + 1);
var price = $('.shopCartModal .price').data('singlePrice');
//$('.shopCartModal .price').text('ï¿¥' + ((parseFloat(price) * (num + 1))).toFixed(2));
});
$(".shopCartModal #ShopModalProNum").off().on('change', function () {
var num = parseInt($("#ShopModalProNum").val());
var price = $('.shopCartModal .price').data('singlePrice');
//$('.shopCartModal .price').text('ï¿¥' + ((parseFloat(price) * num)).toFixed(2));
});
if (json.isSingleNorm) {
$('.shopCartModal .price').data('singlePrice', json.price);
}
/*
$('.shopCartModal .Buy').off().on('click',function(){
if (!checkValid()) return false;
$("form[name=ShopModalForm]").submit();
bootbox.hideAll();
});
*/
$('.shopCartModal .ShopCart,.shopCartModal .Buy').off().on('click',function(){
var islocation = $(this).attr('islocation');
var skuid = $("form[name=ShopModalForm]").find("input[name=skuid]").val();
var num = $("form[name=ShopModalForm]").find("input[name=Num]").val();
if (!checkValid()) return false;
$('.add-cart-result').remove();
var hintHtml = '';
$(hintHtml).appendTo('body');
$(".add-cart-result").find(".close").unbind('click').click(function () {
$(".add-cart-result").hide();
return false;
});
var url = '/index.php?c=front/Productorder&a=AddToCart&Action=Add&ProductID=' + productid + '&skuid=' + skuid + '&Num=' + num;
var backurl = '/index.php?c=front/Productorder&Action=Add&ProductID=' + productid + '&skuid=' + skuid + '&Num=' + num;
$.get(url, null, function (data, textStatus, jqXHR) {
if(data.redirectUrl){
location.href = data.redirectUrl;
return;
}
if (data.success) {
bootbox.hideAll();
//ç«‹å³è´ä¹°ä¼šè·³è½¬
if(islocation == 1){
location.href = backurl;
return;
}
$(".add-cart-result").css({
opacity: 1,
top: ($(window).height() - $(".add-cart-result").outerHeight()) / 2 + $(window).scrollTop() + 'px',
left: ($(window).width() - $(".add-cart-result").outerWidth()) / 2 + 'px',
position: 'absolute',
width: 'auto',
height: 'auto'
});
$("#cartnum").html("(" + data.productnum + ")");
$(".add-cart-result").slideToggle(300);
setTimeout(function () {
$(".add-cart-result").find(".close").click();
}, 2000);
if($('.footNavShopCartNum').length > 0){
getShopCartNum(function(num){
$('.footNavShopCartNum').text(num);
});
}
} else {
//没有登录的è¯ç›´æŽ¥è·³åˆ°ç™»å½•é¡µé¢
if(data.isLogin == '0'){
location.href = '/index.php?c=front/Userlogin&a=GoLogin&BackUrl=' + escape(backurl);
return;
}
if(data.redirectUrl){
location.href = data.redirectUrl;
return;
}else{
alert(data.msg);
}
}
}, "json");
});
$('.shopCartModal .ViewCart').off().on('click',function(){
location = '/productorder';
});
},
error: function () {
alert('error');
}
});
}
function sortProductList(obj,moduleID,pageLink){
if($(obj).hasClass('selected') && !$(obj).hasClass('sort')) return;
var url = pageLink.replace("{PageNo}", 1);
var orderBy = $(obj).attr('value') || '';
var orderByStr = '&orderby=' + orderBy;
var sortByStr = "";
if($.inArray(orderBy, ['price','lastest']) > -1){
sortByStr = '&sortby=' + ($(obj).hasClass('descent') ? 0 : 1);
}
var newUrl = '/index.php?c=front/LoadModulePageData&' + url.substring(url.indexOf("?") + 1) + orderByStr + sortByStr;
$.ajax({
url: newUrl, async: true, dataType: "text/html", complete: function (request, status, error) {
$("#module_" + moduleID).replaceWith(request.responseText);
BindPagerAction();
}
});
}
function checkBowerTip(){
var $checkbower = $(''+
'
当å‰æµè§ˆå™¨ç‰ˆæœ¬è¿‡ä½Žï¼Œå½±å“整体的访问体验.建议å‡çº§åˆ°IE9以上版本,或者下载360æµè§ˆå™¨ ,谷æŒæµè§ˆå™¨ ç‰ '+
'
'+
'
');
$('body').prepend($checkbower);
$checkbower.width(window.innerWidth);
$checkbower.find('img').eq(0).click(function() {$checkbower.addClass('hidden');});
if($checkbower.width() < 400)$checkbower.css({'font-size':'12px','padding':'5px 0','text-align':'left'}).find('span').eq(0).css('padding-right','10px')
}
function filterProductList_Pc(obj1,obj2,moduleID,pageLink){
var url = pageLink.replace("{PageNo}", 1);
var params = '';
var filterid2 = $(obj2).attr('filterid');
var valueid2 = $(obj2).attr('valueid');
$(obj1).find('li').each(function(index,element){
var valueid = $(element).attr('valueid');
var filterid = $(element).attr('filterid');
if(filterid2 != filterid)
params += valueid + ',';
});
if($(obj2).hasClass('selected-light')){
params += valueid2 + ',';
}
var match = url.match(/filtervalue=([,]?\d+[,]?)+/);
if (match && match.length > 1){
url = url.replace(/filtervalue=([,]?\d+[,]?)+/,'filtervalue='+params);
}else{
url += '&filtervalue='+params;
}
var newUrl = '/index.php?c=front/LoadModulePageData&' + url.substring(url.indexOf("?") + 1);
$.ajax({
url: newUrl, async: true, dataType: "text/html", complete: function (request, status, error) {
//if(window.innerWidth > 992){
// //debugger
// //$("#module_" + moduleID +" .productListOrderCtrlTab").hide();
// //$("#module_" + moduleID +" .pro-container").replaceWith(request.responseText);
// $("#module_" + moduleID +" .pro-container").replaceWith(request.responseText);
// //$("#module_" + moduleID).replaceWith(request.responseText);
//}
//else{
//
//}
// $("#module_" + moduleID +" .pro-container").replaceWith(request.responseText);
$("#module_" + moduleID).replaceWith(request.responseText);
BindPagerAction();
}
});
}
function filterProductList_Mobile(obj,moduleID,pageLink){
var url = pageLink.replace("{PageNo}", 1);
var params = '';
$(obj).find('li.items-active').each(function(index,element){
var valueid = $(element).attr('valueid');
var filterid = $(element).attr('filterid');
params += valueid + ',';
});
var match = url.match(/filtervalue=([,]?\d+[,]?)+/);
if (match && match.length > 1){
url = url.replace(/filtervalue=([,]?\d+[,]?)+/,'filtervalue='+params);
}else{
url += '&filtervalue='+params;
}
loadingText = getLang('loading') + '...';
var pageLoadingHtml = '';
pageLoadingHtml += '
';
pageLoadingHtml += ' ';
//pageLoadingHtml += '' + loadingText + ' ';
pageLoadingHtml += '
';
pageLoadingHtml += '
';
$("#module_" + moduleID).children().append(pageLoadingHtml);
//debugger
var newUrl = '/index.php?c=front/LoadModulePageData&' + url.substring(url.indexOf("?") + 1);
$.ajax({
url: newUrl, async: true, dataType: "text/html", complete: function (request, status, error) {
$("#module_" + moduleID).replaceWith(request.responseText);
$("#module_" + moduleID).find('.PageLoading').remove();
BindPagerAction();
}
});
}
// åˆå§‹åŒ–产å“展示的瀑布æµ
function initProductListMasonry(moduleid){
var $container = $('#module_' + moduleid + ' .masonry-container');
if ($container.length > 0) {
$container.imagesLoaded(function () {
$container.masonry({
columnWidth: '.productItem',
itemSelector: '.productItem'
});
});
}
}
// åˆå§‹åŒ–产å“展示
function initProductList(options){
if(typeof options.ModuleID == 'undefined' || typeof options.ShowStyle == 'undefined') return;
var moduleid = parseInt(options.ModuleID);
var showStyle = parseInt(options.ShowStyle);
$(window).off('resize.productlistImgSizeType' + moduleid);
$(window).off('resize.initProductListSlide' + moduleid);
// åˆå§‹åŒ–瀑布æµ
if(showStyle == 13){
initProductListMasonry(moduleid);
}
// 设置产å“展示图片,确ä¿æ¯”例
var imgSizeType = options.ImgSizeType;
setProductListImg(moduleid, showStyle, imgSizeType);
// 是å¦æ˜¾ç¤ºæ»šåŠ¨
var isScroll = options.IsScroll;
if(options.IsScroll == 1 && showStyle != 13){
var direction = options.Direction;
$('#module_' + moduleid + ' .ModuleProductList .proMore').remove();
$('#module_' + moduleid + ' .ModuleProductList').addClass('swiper-container');
if(direction == 'right'){
$('#module_' + moduleid + ' .ModuleProductList').attr('dir',"rtl");
}
$('#module_' + moduleid + ' .ModuleProductList .ProductList').addClass('swiper-wrapper').css('overflow','visible');
$('#module_' + moduleid + ' .ModuleProductList .ProductList .productsBox').addClass('swiper-slide');
var btnPrevNext = '
';
$('#module_' + moduleid + ' .ModuleProductList').after(btnPrevNext);
var slidePerGroup = calProductListSlidePerGroup(moduleid);
var mySwiper = new Swiper('#module_' + moduleid + ' .swiper-container', {
autoplay: 5000,
speed: 1000,
slidesPerView:slidePerGroup,
slidesPerGroup:slidePerGroup,
// loopedSlides:slidePerGroup,
loopAdditionalSlides:slidePerGroup,
spaceBetween:0,
autoplayDisableOnInteraction:false,
// prevButton: '#module_' + moduleid + (direction == 'left' ? ' .btnNext' : ' .btnPrev'),
// nextButton: '#module_' + moduleid + (direction == 'left' ? ' .btnPrev' : ' .btnNext'),
loop:true
});
$(window).off('resize.initProductListSlide' + moduleid).on('resize.initProductListSlide' + moduleid, function(){
var slidePerGroup = calProductListSlidePerGroup(moduleid);
mySwiper.params.slidesPerGroup = slidePerGroup;
mySwiper.params.slidesPerView = slidePerGroup;
mySwiper.params.loopedSlides = slidePerGroup;
mySwiper.updateSlidesSize();
mySwiper.updateContainerSize();
setProductListImg(moduleid, showStyle, imgSizeType);
});
$('#module_' + moduleid + ' .btnPrev').off().on('click', function(){
mySwiper.animating = false;
direction == 'left' ? mySwiper.slideNext() : mySwiper.slidePrev();
}).disableSelection();
$('#module_' + moduleid + ' .btnNext').off().on('click', function(){
mySwiper.animating = false;
direction == 'left' ? mySwiper.slidePrev() : mySwiper.slideNext();
}).disableSelection();
}else{
$(window).off('resize.initProductListSlide' + moduleid);
}
if($.inArray(showStyle,[11,12,13,14,15,16]) > -1){
var productShowType = options.ProductShowType;
// è´ä¹°æŒ‰é’®ç‚¹å‡»ï¼Œå¼¹å‡ºæ¡†
var event = 'touchend.pro_join' + moduleid +' click.pro_join' + moduleid;
$(document).off(event).on(event, '#module_' + moduleid + ' .pro_join, #module_' + moduleid + ' .proBuyBtn', function (evt) {
if(mySwiper){
if(mySwiper.animating) return false;
mySwiper.stopAutoplay();
}
showShopModal($(this).attr('productid'), evt, productShowType);
return false;
});
// 排åºæ ‡ç¾ç‚¹å‡»
$('#module_' + moduleid + ' .orderCtrlPanel>li').off('touchend.orderCtrl click.orderCtrl').on('touchend.orderCtrl click.orderCtrl', function (e) {
sortProductList(this, moduleid, options.PageLink);
});
}
// 绑定更多点击事件
var pcount = 2;
var pagecount = options.PageCount;
$('#module_' + moduleid +' .ProductListMore').off("click").on("click", function (e) {
if (pcount <= pagecount) {
var url = options.PageLink.replace('{PageNo}', pcount);
var self = this;
$.ajax({
type: "GET",
url: '/index.php?c=front/LoadModulePageData&' + url.substring(url.indexOf("?") + 1),
dataType: "html",
success: function (response) {
$resultlist = $(response).find(".ProductList");
var newitems = $resultlist.find(".productsBox").clone();
$('#module_' + moduleid + ' .ProductList').append(newitems);
setProductListImg(moduleid, showStyle, imgSizeType);
if($(self).closest('.ModuleItem').find('.masonry-container').length > 0){
$('#module_' + moduleid + ' .ProductList').imagesLoaded(function () {
$('#module_' + moduleid + ' .ProductList').masonry('appended', newitems);
});
}
if (pcount == pagecount)
$('#module_' + moduleid + ' .ProductListMore').removeClass('moreLoad').removeAttr('onclick').text(options.NoMoreProductText);
pcount++;
}
});
}
});
// 电脑访问点击产å“,新开一个页é¢æ‰“开,移动设备在åŒä¸€ä¸ªé¡µé¢è·³è½¬
$('#module_' + moduleid + ' .proCont').attr('target', isMobileBroswer() || parent != window ? '_self' : '_blank');
}
// 设置产å“展示图片,确ä¿æ¯”例
function setProductListImg(moduleid, showStyle, imgSizeType){
if($.inArray(showStyle,[12,15,16]) > -1 && imgSizeType == 3){
$('#module_' + moduleid + ' .proImg').height($('#module_' + moduleid + ' .proImg').width());
$(window).off('resize.productlistImgSizeType' + moduleid).on('resize.productlistImgSizeType' + moduleid, function(evt){
$('#module_' + moduleid + ' .proImg').height($('#module_' + moduleid + ' .proImg').width());
});
}else{
$(window).off('resize.productlistImgSizeType' + moduleid);
}
}
// 获å–è´ç‰©è½¦æ•°é‡
function getShopCartNum(callback){
$.ajax({
type:'get',
url: '/index.php?c=front/productorder&a=GetShopCartNum',
async: true,
dataType: "json",
success:function (json) {
if(json.success){
if(typeof callback == 'function'){
callback(json.num);
}
}
},
error:function () {
}
});
}
function calProductListSlidePerGroup(moduleid){
var itemCountPerGroup = 0;
var classText = $('#module_' + moduleid).find('.productsBox').prop('class');
var winWidth = window.innerWidth;
if(winWidth >= 1200){
itemCountPerGroup = 12 / parseInt(classText.match(/col-lg-(\d+)/)[1]);
}else if(winWidth >= 992){
itemCountPerGroup = 12 / parseInt(classText.match(/col-md-(\d+)/)[1]);
}else if(winWidth >= 768){
itemCountPerGroup = 12 / parseInt(classText.match(/col-sm-(\d+)/)[1]);
}else{
itemCountPerGroup = 12 / parseInt(classText.match(/col-xs-(\d+)/)[1]);
}
return itemCountPerGroup;
}
function productListMouseOver(elem) {
$(elem).attr('ishovering', 1);
}
function productListMouseOut(elem) {
$(elem).attr('ishovering', 0);
}
function BindPagerAction(){
$(".ModuleItem").off('click.pager_num_click').on('click.pager_num_click', '.PageNavigate a,.page-nav a,.page-more a' , function(evt){
// $(".PageNavigate a,.page-nav a,.page-more a").off('click').on('click', function(evt){
evt = evt || window.event;
evt.preventDefault && evt.preventDefault();
evt.stopPropagation && evt.stopPropagation();
pagerSubmit(this, $(this).attr("href"));
return false;
});
$(".ModuleItem").off('click.pager_submit').on('click.pager_submit', '.pagerGiant .submit' , function(evt){
// $('.pagerGiant .submit').off().on('click', function(){
var pageNo = $(this).closest('.pagerGiant').find('.inputer').val() || '';
var url = $(this).closest('.pagerGiant').find('[name=pagerUrl]').val() || '';
url = url.replace('{pageNo}', pageNo);
if(/^\d+$/.test(pageNo) && parseInt(pageNo) > 0){
var pagerCount = parseInt($(this).closest('.pagerGiant').find('[name=pagerCount]').val() || -1);
if(pagerCount > -1 && parseInt(pageNo) > pagerCount){
return false;
}
pagerSubmit(this, url);
}
return false;
});
$(".ModuleItem").off('keypress.pager_inputer').on('keypress.pager_inputer', '.pagerGiant .inputer' , function(evt){
// $('.pagerGiant .inputer').off().on('keypress', function(evt){
evt = evt || window.event;
var keyCode = evt.keyCode;
if((evt.keyCode < 48 || evt.keyCode > 57) && evt.keyCode != 13){
evt.preventDefault && evt.preventDefault();
evt.stopPropagation && evt.stopPropagation();
return false;
}
if(keyCode == 13){
var pageNo = $(this).closest('.pagerGiant').find('.inputer').val() || '';
var url = $(this).closest('.pagerGiant').find('[name=pagerUrl]').val() || '';
url = url.replace('{pageNo}', pageNo);
if(/^\d+$/.test(pageNo) && parseInt(pageNo) > 0){
var pagerCount = parseInt($(this).closest('.pagerGiant').find('[name=pagerCount]').val() || -1);
if(pagerCount > -1 && parseInt(pageNo) > pagerCount){
return false;
}
pagerSubmit(this, url);
}
}
});
}
/**
* js获å–多è¯è¨€
* @param string lang è¦èŽ·å–多è¯è¨€çš„key
* @return string 多è¯è¨€
*/
function getLang(lang){
if(window.AllLang){
return window.AllLang[lang];
} else {
var site_lang = (getCookie && getCookie('Lang')) ? getCookie('Lang') : 'en';
var lang_url = '/share/lang/lang_' + site_lang + '.json?v=' + Math.random(1,9999);
$.ajax({
url: lang_url,
type: 'GET',
dataType: 'json',
async: false,
success: function(json){
window.AllLang = json;
}
});
return window.AllLang[lang];
}
}
function pagerSubmit(item, url){
if(url && url.indexOf("PageNo=") > -1){
var path = url.split("?")[0];
var params = url.split("?")[1];
var classid = null;
if(params){
var match = params.match(/classid=(\d*)/i);
if (match && match.length > 1) classid = match[1];
}
var newUrl = "/index.php?c=Front/LoadModulePageData&" + params;
/responseModuleId=(\d+)/.test(newUrl);
var moduleId = parseInt(RegExp.$1);
if(moduleId > 0){
var ispagemore = $(item).is(".page-more") || $(item).parent().is(".page-more");
if(ispagemore){
if($(item).attr("pagecount") == $(item).attr("curpage")){
alert(getLang('last_page'));
return false;
}
}
// $("#module_" + moduleId).append("æ£åœ¨åŠ 载,请ç¨å€™...
");
var top = $("#module_" + moduleId).outerHeight() / 2;
loadingText = ispagemore ? getLang('loading_wait') : getLang('loading') + '...';
// var loadingText = 'Loading...';
// if(getCookie && getCookie('Lang') == 'cn'){
// loadingText = ispagemore ? 'æ£åœ¨åŠ 载,请ç¨åŽ' : 'æ£åœ¨åŠ è½½';
// }
if(ispagemore){
$("#module_" + moduleId).find('.page-more').hide();
var pageLoadingHtml = '';
pageLoadingHtml += '
';
pageLoadingHtml += ' ';
pageLoadingHtml += '' + loadingText + ' ';
pageLoadingHtml += '
';
pageLoadingHtml += '
';
$("#module_" + moduleId).find('.page-more').after(pageLoadingHtml);
}else{
$("#module_" + moduleId).find('.BodyCenter').css({'opacity':'0','visibility':'hidden'});
var pageLoadingHtml = '';
pageLoadingHtml += '
';
pageLoadingHtml += ' ';
pageLoadingHtml += '' + loadingText + ' ';
pageLoadingHtml += '
';
pageLoadingHtml += '
';
$("#module_" + moduleId).children().append(pageLoadingHtml);
}
$("#module_" + moduleId).children().css('position', 'relative');
$.ajax({
url: newUrl, async: true, dataType: "text/html", complete: function (request, status, error) {
if(ispagemore){
$("#module_" + moduleId).find('.PageLoading').remove();
$("#module_" + moduleId).find('.page-more-loading').remove();
$("#module_" + moduleId).find('.page-more').show();
var newitems = $(request.responseText).find(".news-container,.pro-container,.download-container,.guestbooklist-container,.gallery-container").children();
$("#module_" + moduleId).find(".news-container,.pro-container,.download-container,.guestbooklist-container,.gallery-container").append(newitems);
var initFunc = window['initFunc' + moduleId];
if(typeof initFunc == 'function'){
initFunc({
newitems:newitems
});
}
//åŒæ¥åˆ†é¡µçš„状æ€
var page_more = $(request.responseText).find(".page-more");
if(page_more.length == 0){
page_more = $('' + getLang('all_loaded') + 'ï¼
');
}
$(item).closest(".page-more").replaceWith(page_more);
$("#module_" + moduleId).find(".PageNavigate,.page-nav").replaceWith($(request.responseText).find(".PageNavigate,.page-nav"));
}else{
$("#module_" + moduleId).replaceWith(request.responseText);
}
BindPagerAction();
if (typeof CanDesign != 'undefined' && CanDesign != "True") {
var bodyClientHeight = document.documentElement.clientHeight // å› ä¸ºæœ‰DOCTYPE
if (bodyClientHeight == 0) bodyClientHeight = window.innerHeight;
var bodySrollTop = $('body').scrollTop();
if (bodySrollTop == 0) bodySrollTop = $(window).scrollTop();
var relModule = $("#module_" + moduleId).eq(0);
var originModuleHeight = relModule.height();
if (relModule.length > 0) {
if(!ispagemore){
if (SiteType == 0) {
if (originModuleHeight > bodyClientHeight || getElementTop(relModule[0]) < bodySrollTop) {
$('body,html').animate({ scrollTop: getElementTop(relModule[0]) }, 1000);
}
} else {
window.location.href = "#module_" + moduleId;
}
}
}
}
//åŠ è½½å®ŒæˆåŽ é‡æ–°è°ƒç”¨ä¸€ä¸‹è¯¥æ¨¡å—çš„init方法
if(window["initFunc" + moduleId]){
window["initFunc" + moduleId]();
}
}
});
return false;
}
}
}
function getElementTop(obj) {
var i = obj.offsetTop;
if (obj.offsetParent != null) i += getElementTop(obj.offsetParent);
return i;
}
function getElementLeft(obj) {
var i = obj.offsetLeft;
if (obj.offsetParent != null) i += getElementLeft(obj.offsetParent);
return i;
}
function getElementTopWithBorder(obj) {
var i = obj.offsetTop + parseFloat($(obj).css('border-top-width'));
if (obj.offsetParent != null) i += getElementTopWithBorder(obj.offsetParent);
return i;
}
function getElementLeftWithBorder(obj) {
var i = obj.offsetLeft + parseFloat($(obj).css('border-left-width'));
if (obj.offsetParent != null) i += getElementLeftWithBorder(obj.offsetParent);
return i;
}
function AddFavorite(sURL, sTitle) {
if (!sURL) sURL = location.href;
if (!sTitle) sTitle = document.title;
try {
window.external.addFavorite(sURL, sTitle);
}catch (e) {
try {
window.sidebar.addPanel(sTitle, sURL, "");
}catch (e) {
alert("åŠ å…¥æ”¶è—失败,请使用Ctrl+Dè¿›è¡Œæ·»åŠ ");
}
}
}
function SetHome() {
if (document.all){
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage(window.location.href);
}else if (window.sidebar){
if(window.netscape){
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}catch (e){
alert( "该æ“作被æµè§ˆå™¨æ‹’ç»ï¼Œå¦‚果想å¯ç”¨è¯¥åŠŸèƒ½ï¼Œè¯·åœ¨åœ°å€æ 内输入 about:config,然åŽå°†é¡¹ signed.applets.codebase_principal_support 值改为true" );
}
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',window.location.href);
}else{
alert('您的æµè§ˆå™¨ä¸æ”¯æŒè‡ªåŠ¨è‡ªåŠ¨è®¾ç½®é¦–页, 请使用æµè§ˆå™¨èœå•æ‰‹åŠ¨è®¾ç½®!');
}
}
/************
2015å¹´3月24æ—¥14:21:59 创建人:郑江 主è¦é’ˆå¯¹æ¨¡å—的高级功能的js
************/
//图片的åŠé€æ˜Žæ•ˆæžœ
function ShowTransparent(obj) {
$(obj).animate({
opacity: 0.7
}, 300, function () {
});
}
//图片ä¸é€æ˜Ž
function HideTransparent(obj) {
$(obj).animate({
opacity: 1
}, 300, function () {
});
}
//浮影
var oSetTimeout = null;
function ImgShade(obj, type) {
var oDiv = $(obj).parent().find("div[name='shade']");
$(obj).parent().css("position","relative");
if($(obj).parent().is("a")) $(obj).parent().css("display","block");
if (oDiv.length == 0) {
oDiv = $("" + $(obj).attr('alt') + "
").appendTo($(obj).parent()).css('height', 0);
}
var bc = $(obj);//.closest('.BodyCenter');
var module = $(obj).closest('.ModuleItem');
var top = bc.position().top;
var left = bc.offset().left - $(obj).closest('.BodyCenter').offset().left;
var w = bc.width();
var h = bc.height();
if (type == 'ShadeTop'){
$(oDiv).attr("class", "showShadeTop").css({'width':w,'left':left,'top':0}).show();
}else if(type == 'ShadeBottom'){
$(oDiv).attr("class", "showShadeBottom").css({'width':w,'left':left,'bottom':0}).show();
}else{
$(oDiv).attr("class", "showShadeTop").css({'width':w,'left':left,'top':0}).show();
}
var isShadeAll = type == 'Shade';
if(isShadeAll) $(oDiv).css({'line-height':h +'px','font-size':'18px'});
$(oDiv).stop().animate({ height: (isShadeAll ? h +'px' :"50px") }, (isShadeAll ? 100:200), function () { });
//2015å¹´6月1æ—¥17:44:45 郑江 å½“é¼ æ ‡è¿›å…¥div(浮影)的时候关掉定时器
$(oDiv).mouseenter(function () {
clearTimeout(oSetTimeout);
});
$(oDiv).mouseleave(function () {
divZoom(oDiv,type);
});
}
function unImgShade(obj, type) {
if ($(obj).parent().find("div[name='shade']").length == 0) $(obj).parent().append("" + $(obj).attr('alt') + "
");
var oDiv = $(obj).parent().find("div[name='shade']");
oSetTimeout = setTimeout(function () {
divZoom(oDiv,type);
}, 200);
}
//2015å¹´6月2æ—¥14:19:10 郑江 éšè—div动画
function divZoom(obj,type) {
$(obj).stop().animate({
height: "0px"
}, 200, function () {
if (type == 'ShadeTop') $(obj).attr("class", "hideShadeTop").hide();
else $(obj).attr("class", "hideShadeBottom").hide();
});
}
function moduleImageHover(obj) {
var width = $(obj).width();
$(obj).stop().animate({ opacity: 0 }, 250, function () {
$(this).css('visibility', 'hidden');
});
$(obj).parent().css('position','relative');
if(!$(obj).parent().is('.BodyCenter')){
$(obj).parent().css('display', 'block');
}
var left = ($(obj).parent().width() - $(obj).width()) / 2;
$(obj).siblings('img').stop().show().css({'visibility':'visible',
'box-sizing': 'border-box',
'top':'0',
'left': left + 'px',
'padding-top': $(obj).parent().css('padding-top') || 0,
'padding-left': $(obj).parent().css('padding-left') || 0,
'padding-bottom': $(obj).parent().css('padding-bottom') || 0,
'padding-right': $(obj).parent().css('padding-right') || 0
}).animate({ opacity: 1 }, 250);
}
function moduleImageUnHover(obj) {
// $('.ModuleImage img:eq(1)').stop().animate({ opacity: 0 }, 250, function () {
$(obj).stop().animate({ opacity: 0 }, 250, function () {
$(this).css('visibility', 'hidden');
});
$(obj).siblings('img').stop().show().css('visibility', 'visible').animate({ opacity: 1 }, 250);
}
function ImgZoom(obj){
var scale = $(obj).width() > 500 ? 1.02 : 1.10;
var step = $(obj).width() > 500 ? 0.001 : 0.005;
var curscale = 1;
$(obj).attr('zoom-step',step);
$(obj).parent().attr('zoom-overflow',$(obj).parent().css('overflow'));
$(obj).parent().css({'overflow':'hidden'});
if($(obj).parent().is('a')) $(obj).parent().css({'display':'block'});
var f = function(){
$(obj).attr('zoom-scale',curscale);
$(obj).css({'-webkit-transform':'scale('+curscale+')','-ms-transform':'scale('+curscale+')','-moz-transform':'scale('+curscale+')','-o-transform':'scale('+curscale+')','transform':'scale('+curscale+')' });
curscale += step;
if(curscale < scale) setTimeout(f,10);
}
f();
}
function unImgZoom(obj){
var scale = 1;
var curscale = parseFloat($(obj).attr('zoom-scale'));
var step = parseFloat($(obj).attr('zoom-step'));
var f = function(){
$(obj).css({'-webkit-transform':'scale('+curscale+')','-ms-transform':'scale('+curscale+')','-moz-transform':'scale('+curscale+')','-o-transform':'scale('+curscale+')','transform':'scale('+curscale+')' });
curscale -= step;
if(curscale > scale) setTimeout(f,10);
else $(obj).parent().css('overflow',$(obj).parent().attr('zoom-overflow'));
}
f();
}
/* start of 图文自动éšè— */
function moduleImageTextHide(option) {
//多è¯è¨€å¤„ç†
if(!window.lang && typeof option != 'undefined'){
window.lang = {};
window.lang.show_more = option.lang.show_more;
}
var show_more = '显示更多';
if(typeof option != 'undefined'){
show_more = option.lang.show_more;
}else if(window.lang) {
show_more = window.lang.show_more;
}
//如果有ç»å¯¹å®šä½çš„模å—,那自动éšè—就会有问题
if(SiteType == "1"){
$(".ModuleImageText,.ModuleImageTextV2,.ModuleImageTextGiant").each(function(i,item){
var m = $(item).closest(".ModuleItem");
var textcontainer = $(item).find(".imageTextContainer");
var id = m.attr('id');
var referwidth = $('#pagebody').width(); //m.width();
var hidew = 800;
if(textcontainer.attr('hidewidth')) hidew = parseInt(textcontainer.attr('hidewidth'));
var hideh = 150;
if(textcontainer.attr('hideheight')) hideh = parseInt(textcontainer.attr('hideheight'));
if((m.css("position") == 'static' || m.css("position") == '')){
if(referwidth < hidew && textcontainer.attr('autohide') == '1' && textcontainer.attr('hasResponsive') == '1' && textcontainer.attr('hasshow') != '1'){
if(m.find('.showHandle').length == 0){
$bodyc = m.find(".BodyCenter");
$bodyc.css({'height':hideh + 'px','overflow':'hidden'});
$bodyc.parent().append("");
}
}
else if(/*window.isDesignMode &&*/ referwidth > hidew){//æ·»åŠ åˆ°åˆ†æ æ—¶ 编辑状æ€ä¸‹ 显示有问题 æ¢ä¸ºpagebody的宽度åšæ¯”较
//else if(/*window.isDesignMode &&*/ m.width() > hidew){
moduleImageTextShow(id);
}
}
});
}
}
function moduleImageTextShow(id){
var m = $("#"+id);
m.find(".showHandle").remove();
m.find(".BodyCenter").css({'height':'auto','overflow':'visible'});
// if(CanDesign != "True") m.find(".imageTextContainer").attr("hasshow","1");
}
/* end of 图文自动éšè— */
function showSubMenu(obj,direction,subItemLocation) {
var oModuleNav = $(obj).closest('.ModuleNav,.ModuleNavGiant');
var oModuleItem = $(obj).closest('.ModuleItem');
var oContent = $(obj).closest('.main-nav-content');
var oNavSubMenu = $(obj).children('.NavSubMenu,.sub-nav-item-group');
var subAlign = $(obj).closest('.pre_nav').attr('SubAlign'); //left:左对é½ï¼Œright:å³å¯¹é½, auto: æ ¹æ®ä¸»èœå•çš„在å±å¹•ä¸çš„相对ä½ç½®å¯¹é½
var subHolder = $(obj).closest('.pre_nav').attr('SubHolder');
var timeoutId = "moduleNavTimeout";
if(typeof direction == 'undefined') direction = $(obj).closest('.pre_nav').attr('data-direction');
if(typeof subItemLocation == 'undefined') subItemLocation = $(obj).closest('.pre_nav').attr('data-subitem-location');
if (window[timeoutId]) {
clearTimeout(window[timeoutId]);
}
oModuleNav.find('.NavSubMenu,.sub-nav-item-group').not(oNavSubMenu).hide();
oModuleNav.find('.navMainItem,.main-nav-item').not($(obj).children('.navMainItem,.main-nav-item')).removeClass('navMainItemHover');
$(obj).children('.navMainItem,.main-nav-item').addClass('navMainItemHover');
if ($('.moduleNavFloatSubMenu').attr('submenuid') != $(obj).attr('id')) {
$('.moduleNavFloatSubMenu').remove();
}
if (oNavSubMenu.children().length == 0) return;
if (oModuleNav.is(".ModuleNavGiant") && oNavSubMenu.find(".sub-nav-item").length == 0) return;
var navSubMenuClone = $(obj).clone(true).attr('onmouseover', null);
var classes = oModuleItem.find(">div").attr('class');
$(".moduleNavFloatSubMenu").remove();$(".sub-nav-holder").hide();
var html = '';
var floatSubMenu = $(html);
if(window.isDesignMode == true){
floatSubMenu.appendTo('#pagebody');
} else {
floatSubMenu.appendTo('body');
}
var originOpacity = oModuleItem.css('opacity');
floatSubMenu.css('opacity', '1'); // é€æ˜Žåº¦ä¸ä¸º1,会有bug。。。
navSubMenuClone.find('.NavSubMenu,.sub-nav-item-group').css('opacity', originOpacity);
floatSubMenu.find('dl').append(navSubMenuClone);
floatSubMenu.find('.pre_nav').addClass($(obj).closest('.pre_nav').attr('class'));
floatSubMenu.find('.navMainItem,.main-nav-item').remove();
floatSubMenu.css({ position: 'static', height:0, overflow: 'hidden' });
floatSubMenu.on('mouseenter', function () {
//debugger
if (window[timeoutId]) {
clearTimeout(window[timeoutId]);
}
});
$(subHolder).mouseenter(function(){ if (window[timeoutId])clearTimeout(window[timeoutId]); }).mouseleave(function(){hideSubMenu(obj)});
var iSubMenuMarginLeft = (floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').outerWidth() - $(obj).find('.navMainItem,.main-nav-item').outerWidth()) / 2;
var isAlignRight = false;
if(subAlign == 'left') iSubMenuMarginLeft = 0;
if(subAlign == 'auto'){
if($(obj).offset().left < (oModuleNav.offset().left + oModuleNav.width() / 2)) iSubMenuMarginLeft = 0;
else isAlignRight = true;
}
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
position: 'absolute',
display: 'block',
zIndex: '999999'
});
floatSubMenu.find('.main-nav-content').css('position', 'static');
//å…¨å±çš„åèœå•èƒŒæ™¯ï¼ˆlayout-109 专用 )
//$(subHolder).css({"top":($(obj).offset().top + $(obj).height()) + "px","position":"absolute","left":"0","width":"100%"}).show();
if (direction == '1' && subItemLocation == '0') {
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
left: $(obj).offset().left - floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').outerWidth(),
top: $(obj).offset().top,
marginTop: $(obj).find('.navMainItem,.main-nav-item').css('margin-top')
});
} else if (direction == '1' && subItemLocation == '1') {
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
position: 'absolute',
display: 'block',
left: $(obj).offset().left + $(obj).outerWidth(),
top: $(obj).offset().top,
marginTop: $(obj).find('.navMainItem,.main-nav-item').css('margin-top')
});
} else if (direction == '0' && subItemLocation == '0') {
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
top: $(obj).offset().top - floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').outerHeight(),
left: $(obj).offset().left + (parseInt($(obj).css('padding-left')) || 0),
marginLeft: -iSubMenuMarginLeft
});
} else {
if (getCookie("SiteType") == "1") {
if (false && window.isDesignMode == true) {
var top = 0;
var left = 0;
var elem = $(obj)[0];
while (elem != null && $(elem).closest('#pagebody').length > 0 && !$(elem).is('#pagebody')) {
top += elem.offsetTop;
left += elem.offsetLeft;
elem = $(elem)[0].offsetParent;
}
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
top: top + $(obj).outerHeight(),
left: left,
marginLeft: -iSubMenuMarginLeft
});
} else {
// debugger
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
top: $(obj).offset().top + $(obj).outerHeight(),
left: $(obj).find('.sub-nav-side-group').children().length>0?$(obj).find('.OneRow').offset().left:$(obj).find('.sub-nav-side-group').hasClass('nav-giant-layout-112')?$(obj).offset().left-20:$(obj).offset().left,
marginLeft: $(obj).find('.sub-nav-side-group').hasClass('nav-giant-layout-112')?0:-iSubMenuMarginLeft,
maxWidth:window.innerWidth
});
}
floatSubMenu.find('.nav').show().css({ height: 0 });
} else {
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
top: $(obj).offset().top + $(obj).outerHeight(),
left: $(obj).offset().left + (parseInt($(obj).css('padding-left')) || 0),
marginLeft: -iSubMenuMarginLeft
});
}
}
if(isAlignRight && !floatSubMenu.find('.sub-nav-item-group').hasClass('nav-giant-layout-112')){
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({"left":$(obj).offset().left + $(obj).width() - floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').outerWidth(true)});
}
//解决åèœå•èƒŒæ™¯æ ¹æ®äºŒçº§å¯¼èˆªæ¢è¡Œè€Œè‡ªé€‚应高度 by Kong 2017/8/1
var diffHeight = 0;
var subItemHeight = 40;
var treeNavHeight = 13;
if(floatSubMenu.find('.sub-nav-item').length > 0){
//2级èœå•çš„高度
diffHeight = floatSubMenu.find('.sub-nav-item:last').offset().top - floatSubMenu.find('.sub-nav-item:first').offset().top;
subItemHeight = floatSubMenu.find('.sub-nav-item:first').outerHeight();
//如果å˜åœ¨ä¸‰çº§èœå•
if(floatSubMenu.find('.sub-nav-side-group.nav-giant-layout-112').children().length>0){
var objs = floatSubMenu.find('.sub-nav-side-group');
treeNavHeight += objs.eq(0).outerHeight();
$.each(objs, function(idx, obj) {
//当å‰è¿™ä¸ªui的高度是å¦å¤§äºŽä¸Šä¸€æ¬¡ul的高度
if(idx>0){
if($(obj).outerHeight()>objs.eq(idx-1).outerHeight()){
treeNavHeight += $(obj).outerHeight();
}
}
});
}else{
treeNavHeight = 0;
}
$(obj).addClass('on').siblings().removeClass('on');
}
// layout-111
if (floatSubMenu.find('.sub-nav-item-group').hasClass('nav-giant-layout-111') ) {
// 当å‰èœå•è·å³çš„å移
var navGiantOffsetRight = Math.abs($(window).width() - $(obj).offset().left);
// 当å‰èœå•çš„二级èœå•çš„总宽度
var navGiantWidth = floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').length *
parseInt(floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').eq(0).css('width')) +
parseInt(floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').eq(0).css('padding-right'));
// 判æ–对é½æ–¹å‘
if (oContent.css('text-align')) {
var navGiantStyleObj = '';
// åèœå•é¢æ¿å¯èƒ½çš„最大宽度
var navGiantContentWidth = navGiantOffsetRight;
switch (oContent.css('text-align')) {
// left 对é½
case 'left':
// 如果å³è¾¹å·²ç»æ»¡äº†ï¼Œä½†æ˜¯å·¦è¾¹è¿˜æœ‰ç©ºéš™
var navGiantContentStyleLeft = $(obj).offset().left
if (navGiantContentWidth < navGiantWidth) {
if (navGiantWidth < window.innerWidth) {
navGiantContentStyleLeft = window.innerWidth - navGiantWidth
} else {
navGiantContentStyleLeft = parseInt(floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').eq(0).css('width')) / 4
}
}
navGiantContentWidth += (navGiantContentStyleLeft * 6)
navGiantStyleObj = {
left: navGiantContentStyleLeft
}
break;
// center 对é½
case 'center':
navGiantContentWidth += (navGiantContentStyleLeft * 6)
navGiantStyleObj = {
marginLeft: 0
}
break;
// right 对é½
case 'right':
navGiantStyleObj = {
left: '',
right: navGiantOffsetRight - $(obj).width(),
marginLeft: 0
}
navGiantContentWidth = $(obj).offset().left
break;
}
}
// 当å‰äºŒçº§èœå•ä¸ªæ•°
var subMenuBoxItem = floatSubMenu.find('.sub-nav-item-group>.sub-menu-box').length;
// 用于储å˜æ¯ä¸ªäºŒçº§åˆ—表下的三级列表个数
var threeItem = [];
// 查找æ¯ä¸ªäºŒçº§åˆ—表下的三级列表个数
floatSubMenu.find('.sub-nav-item-group>.sub-menu-box').each(function () {
threeItem.push($(this).find('.three-nav-item-group>p').length)
});
// 判æ–个数
if (threeItem.length > 1) {
// 获å–三级列表数组的个数最大值
var threeItemMAX = Math.max.apply(null, threeItem);
// 用åèœå•é¢æ¿å¯èƒ½çš„最大宽度跟当å‰èœå•çš„二级èœå•çš„总宽度æ¥åˆ¤æ–是å¦æ»¡è¶³æ¢è¡Œ
if (navGiantContentWidth < navGiantWidth) {
// é‡ç½®åœ†è§’
floatSubMenu.find('.sub-nav-item-group>.sub-menu-box').eq(0).css('border-radius', '0px')
// 循环判æ–æ˜¯ä»Žç¬¬å‡ ä¸ªå¼€å§‹æ¢è¡Œ
for (var i = 0, len = subMenuBoxItem; i < len; i++) {
if (navGiantContentWidth < (i * floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').eq(0).width() + 25)) {
break;
}
}
// é‡æ–°è®¾ç½®æ¢è¡ŒåŽçš„圆角
floatSubMenu.find('.sub-nav-item-group>.sub-menu-box').eq(i).css('border-radius', '0px 0px 0px 16px')
// 判æ–是å¦éœ€è¦è¡¥é½æ¢è¡Œçš„宽度
if ((subMenuBoxItem / 2) < i) {
// 补全缺失的宽度
for (var j = 0, len = (i - (subMenuBoxItem - i)); j < len; j++) {
floatSubMenu.find('.sub-nav-item-group').append('')
}
}
}
}
floatSubMenu.find('.sub-nav-item-group').css(navGiantStyleObj)
}
if(floatSubMenu.find('.sub-nav-item-group').hasClass('nav-giant-layout-112')){
//å·²ç»æ”¾æ»¡
// debugger
if(window.innerWidth-(floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-112').offset().left+floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-112').outerWidth()) < 168){
if(window.innerWidth - (floatSubMenu.find('.nav-list').length+1) * 168>0){
floatSubMenu.find('.sub-nav-item-group.sub-nav-item-group').css('left',window.innerWidth - (floatSubMenu.find('.nav-list').length+1) * 168)
}else{
floatSubMenu.find('.sub-nav-item-group.sub-nav-item-group').css('left',0)
}
}else{
floatSubMenu.find('.sub-nav-item-group').css('left',$(obj).offset().left+'px');
}
diffHeight = floatSubMenu.find('.sub-nav-item:last').offset().top - floatSubMenu.find('.sub-nav-item:first').offset().top;
}
$(subHolder).css({"top":($(obj).offset().top + $(obj).height()) + "px","position":"absolute","left":"0","width":"100%","height":+ (subItemHeight+diffHeight+treeNavHeight) + "px"}).show();
}
function hideSubMenu(obj, evt) {
var oModuleNav = $(obj).closest('.ModuleNav,.ModuleNavGiant');
var oModuleItem = $(obj).closest('.ModuleItem');
var subHolder = $(obj).closest('.pre_nav').attr('SubHolder');
var timeoutId = "moduleNavTimeout";
evt = evt || window.event;
var relatedTarget = evt.relatedTarget || evt.toElement;
if ($(relatedTarget).is('.moduleNavFloatSubMenu') || $(relatedTarget).closest('.moduleNavFloatSubMenu').length > 0) {
return false;
}
if (window[timeoutId]) {
clearTimeout(window[timeoutId]);
}
window[timeoutId] = setTimeout(function () {
$('.moduleNavFloatSubMenu').remove();
oModuleNav.find('.navMainItem').removeClass('navMainItemHover');
//å…¨å±çš„åèœå•èƒŒæ™¯ï¼ˆlayout-109 专用 )
$(subHolder).hide();
$('.main-nav-item-group').removeClass('on').siblings().removeClass('on');
}, 100);
}
function isHorizontalPad() {
if (CanDesign != "True" && window.CanEditFront == "True") return false;
var padscale = false;
if (SiteType == "1" && CanDesign != "True") {
if(navigator.userAgent.toLowerCase().indexOf("pad") > -1 || window.location.toString().indexOf("testpad") > -1 || ($(window).height() > 768 && $(window).width() > 768 && $(window).height() <= 1024 && $(window).width() <= 1024) ){ //横å‘pad的分辨率一般都在7以上
padscale = true;
}
}
return padscale;
}
function showMobileNavFloatLayer(elem) {
var iCurNum = $('#MobileNav').attr('navnum') || 1;
if (iCurNum == 1 || iCurNum == 5) {
$("#pagebody").css({"-ms-transition": "0.5s","-webkit-transition": "0.5s","-khtml-transition": "0.5","-o-transition": "0.5s","-moz-transition": "0.5s","transition": "0.5s"});
var iTranslateX = 0;
// if (!$('#pagebody').hasClass('showFloatNav')) {
// if (iCurNum == 1) iTranslateX = 17 + 'rem';
// if (iCurNum == 5) iTranslateX = 6 + 'rem';
// }
$('#pagebody').css('left', iTranslateX);
} else {
$("#pagebody").css({"-ms-transition": "","-webkit-transition": "","-khtml-transition": "","-o-transition": "","-moz-transition": "","transition": ""});
}
$('#MobileNav').toggleClass('showFloatNav');
$('#MobileNavRenderElem').toggleClass('showFloatNav');
$('#MobileNavFloatLayer').toggleClass('showFloatNav');
$('#pagebody').toggleClass('showFloatNav');
$('#MobileFootNav').toggleClass('showFloatNav');
$('#MobileNavMask').toggleClass('showFloatNav');
}
function setMobileNav() {
if ($('#MobileNav').length > 0) {
var iCurNum = $('#MobileNav').attr('navnum') || 1;
var iCurColor = $('#MobileNav').attr('navcolor') || 'black';
var iItemType = $('#MobileNav').attr('navitemtype') || 0;
var iEnable = $('#MobileNav').attr('enable') || 0;
$('#MobileNav').attr('class', 'mobileNav mobileNav_' + iCurNum + ' ' + iCurColor);
$('#MobileNavRenderElem').attr('class', 'mobileNavRenderElem mobileNavRenderElem_' + iCurNum + ' ' + iCurColor);
$('#MobileNavFloatLayer').attr('class', 'mobileNavFloatLayer mobileNavFloatLayer_' + iCurNum + ' ' + iCurColor + ' itemType' + iItemType);
$('#pagebody').attr('class', $('#pagebody').attr('class').replace(/(pagebody_nav(_\d+)?)|(showFloatNav)/ig, '') + ' pagebody_nav pagebody_nav_' + iCurNum);
if ($('#MobileFootNav').length > 0) {
$('#MobileFootNav').attr('class', $('#MobileFootNav').attr('class').replace(/(mobileFootNav(_\d+)?)|(showFloatNav)/ig, '') + ' mobileFootNav_' + iCurNum);
}
$('#MobileNavMask').attr('class', 'mobileNavMask mobileNavMask_' + iCurNum).off('click').on('click', function () {
showMobileNavFloatLayer();
}).off('touchstart').on('touchstart', function () {
evt = window.event || evt;
evt.preventDefault();
showMobileNavFloatLayer();
return false;
})
$('#MobileNavFloatLayer').off('click'); $('#MobileNavFloatLayer').off('touchstart'); $('#MobileNavFloatLayer').off('touchmove');
// åˆ†å¼€å†™æ˜¯å› ä¸ºpagebody scaleåŽï¼Œä¼šå½±å“pagebodyåŒçº§çš„100%é«˜åº¦çš„å…ƒç´ çš„é«˜åº¦
if ($.inArray(iCurNum, ["1", "2", "5", "8"]) > -1) {
$('#MobileNavFloatLayer').off().on('touchstart', function (evt) {
evt = window.event || evt;
iStartPosY = evt.targetTouches[0].pageY;
var top = $(this).children('.itemList').css('top');
if(top == 'auto' || top == '') top = 0;
iMobileNavItemListStartTop = parseInt(top);
}).on('touchmove', function (evt) {
if ($(window).height() > $(this).children('.itemList').outerHeight()) {
evt.preventDefault();
return false;
}
evt = window.event || evt;
evt.preventDefault();
iEndPosY = evt.targetTouches[0].pageY;
iSlideDistance = iEndPosY - iStartPosY;
var iTop = iMobileNavItemListStartTop + iSlideDistance;
if (iTop > 0) iTop = 0;
var iHiddenHeight = $(window).height() - $(this).children('.itemList').outerHeight() - $('#MobileNavFloatLayer').position().top - parseInt($(this).children('.itemList').css('margin-top'));
if (iTop < iHiddenHeight) iTop = iHiddenHeight;
if(typeof(window.top.frames['pageframe']) == 'undefined') $('#MobileNavFloatLayer .itemList').css('top', iTop + "px");
return false;
});
}
if($.inArray(iCurNum, ["2", "3", "8"]) > -1){
$('#MobileNavFloatLayer').css("top",$(".mobileNav").height())
}
if($.inArray(iCurNum, ["1", "5"]) > -1){
try{
if(typeof(window.top.frames['pageframe']) != 'undefined') $('#MobileNavFloatLayer').css("top",'0');
}catch(ex){
}
}
if(iEnable != 1 || $.inArray(iCurNum, ["4", "6", "7"]) > -1){
$('#MobileNavRenderElem').hide();
}else{
//$('#MobileNavRenderElem').show();
}
if ($.inArray(iCurNum, ["4"]) > -1) {
$('#MobileNavFloatLayer').off().on('touchstart', function (evt) {
evt = window.event || evt;
iStartPosY = evt.targetTouches[0].pageY;
iMobileNavItemListStartTop = parseInt($(this).children('.itemList').css('top'));
}).on('touchmove', function (evt) {
if ($(this).height() > $(this).children('.itemList').outerHeight()) {
evt.preventDefault();
return false;
}
evt = window.event || evt;
evt.preventDefault();
iEndPosY = evt.targetTouches[0].pageY;
iSlideDistance = iEndPosY - iStartPosY;
var iTop = iMobileNavItemListStartTop + iSlideDistance;
if (iTop > 0) iTop = 0;
var iHiddenHeight = $(this).height() - $(this).children('.itemList').outerHeight();
if (iTop < iHiddenHeight) iTop = iHiddenHeight;
$('#MobileNavFloatLayer .itemList').css('top', iTop + "px");
return false;
});
}
if (iCurNum == 6) {
if (typeof isDesignMode != 'undefined' && isDesignMode === true) {
$('#MobileNavFloatLayer').on('click', function () {
showMobileNavFloatLayer();
})
}
$('#MobileNavFloatLayer').on('touchstart', function (evt) {
evt = window.event || evt;
var curTarget = $(evt.targetTouches[0].target);
if (curTarget.is('.itemLink') || curTarget.is('.icon') || curTarget.is('.menuName')) {
return true;
}
evt.preventDefault();
showMobileNavFloatLayer();
return false;
});
}
if (iCurNum == 7) {
$('#MobileNavFloatLayer').on('touchstart', function (evt) {
evt = window.event || evt;
iStartPosX = evt.targetTouches[0].pageX;
iMobileNavFloatLayerItemListStartPosX = parseInt($(this).children('.itemList').css('left'));
});
$('#MobileNavFloatLayer').on('touchmove', function (evt) {
evt = window.event || evt;
if ($(this).width() > $(this).children('.itemList').outerWidth()) {
evt.preventDefault();
return false;
}
evt.preventDefault();
iEndPosX = evt.targetTouches[0].pageX;
iSlideDistance = iEndPosX - iStartPosX;
var iItemListLeft = iMobileNavFloatLayerItemListStartPosX + iSlideDistance;
if (iItemListLeft > 0) iItemListLeft = 0;
var iHiddenWidth = $(this).width() - $(this).children('.itemList').outerWidth();
if (iItemListLeft < iHiddenWidth) iItemListLeft = iHiddenWidth;
$('#MobileNavFloatLayer .itemList').css('left', iItemListLeft + "px");
return false;
});
} else {
$('#MobileNavFloatLayer .itemList').css({
width: ''
});
}
}
}
function matchNavAndFootNavBgColor() {
setInterval(function () {
if ($('#MobileFootNav').attr('bgcolorrelatedtomobilenav') == 0) {
var bgcolor = $('.ModuleMobileNavGiant #header').length > 0?$('.ModuleMobileNavGiant #header').css('background-color'):$('#MobileNav').css('background-color');
// console.log(bgcolor,'aaaa');
if($('#MobileFootNav .foot-nav-list').css('background-color') != bgcolor)
$('#MobileFootNav .foot-nav-list').css('background-color', bgcolor);
}
}, 50);
}
function doSomeWhanPreview() {
if (window.location.getQueryString('view') == '1') {
$("body").find('a').each(function (i, elm) {
if (/^(javascript|#)/i.test($(this).attr('href'))) {
return true;
}
if ($(this).prop('href').indexOf(location.protocol + "//" + location.hostname) == 0) {
var url = $(this).attr('href');
if (url) {
if($(this).hasClass("ui-tabs-anchor") == false){
// url = url.replace("#", "");
// url = url.indexOf("?") > -1 ? url + "&view=1" : url + "?view=1";
url = url.replace(/^([^\?#]*)(\??)([^#]*)(#?)/, '$1\?$3&view=1$4');
}
}
$(this).attr('href', url);
$(this).attr('target', '_self');
}
});
$('.ModuleUserLogin [registerurl]').off().on('click', function (evt) {
var url = $(this).attr('registerUrl');
window.location = url.indexOf("?") > -1 ? url + "&view=1" : url + "?view=1";
evt.preventDefault();
return false;
});
}
}
function doLoginWithUserNamePassword(obj) {
obj = $(obj);
var url = $(obj).attr('action');
if ($.trim($(obj).find('[name=BackUrl]').val()) == '') {
//$.trim($(obj).find('[name=BackUrl]').val(location.pathname));
}
var data = $(obj).serializeArray();
if (obj.length > 0) {
$.ajax({
type: "post",
url: url,
cache: false,
data: data,
dataType: "json",
success: function (data) {
if (!data.success) {
alert(data.msg);
return;
}
if (data.msg) {
window.location.href = decodeURIComponent(data.msg);
}
},
error: function (req) {
alert(req.responseText);
}
});
}
}
function AjaxResetPassword(obj) {
if (obj) {
var data=$(obj).serialize()+'&act=resetpassword'
$.ajax({
type: "POST",
url: $(obj).attr('action'),
cache: false,
beforeSend: function (XMLHttpRequest) {
$('input[type="submit"]', $(obj)).hide();
$('.Loading', $(obj)).show();
},
dataType: "json",
data: data,
success: function (data) {
console.log(data);
if (data) {
if (!data.success){
$('input[type="submit"]', $(obj)).show();
}
$('.Loading', $(obj)).hide();
$(".container", $(obj)).show();
$(".errorMsg", $(obj)).html(data.msg);
}
},
complete: function (XMLHttpRequest, textStatus) {
$('input[type="submit"]', $(obj)).show();
$('.Loading', $(obj)).hide();
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
$('input[type="submit"]', $(obj)).show();
$('.Loading', $(obj)).hide();
}
});
}
};
//弹出微信扫ç 支付的对è¯æ¡†
function WxScanPay(orderid) {
if (!-[1, ]) { // ie7,8ä¸å…许
alert('很抱æ‰ï¼Œå½“å‰æµè§ˆå™¨ä¸æ”¯æŒå¾®ä¿¡æ‰«ç 支付,请å‡çº§æˆ–æ›´æ¢å…¶ä»–æµè§ˆå™¨é‡è¯•ã€‚');
return;
}
$("#WxScanPayDiv").remove();
var WxScanPayDiv = $('
');
$("body").append(WxScanPayDiv);
$(WxScanPayDiv).dialog({
title: '微信支付 - Pay', modal: true, width: 500, position: 'center',
resizable: false,
buttons: {
"å–消": function () {
$(this).dialog("close");
}
},
close: function () {
$("#WxScanPayDiv").remove();
}
});
}
// å…¨å±æ¨¡å—ç»å¯¹å®šä½100%宽度å–的是å±å¹•çš„å¯è§†å®½åº¦ï¼Œå½“设置的站点宽度超过å±å¹•å¯è§†å®½åº¦æ—¶å€™ï¼Œå…¨å±æ¨¡å—å³ä¾§ç•™ç™½ï¼Œæ‰€ä»¥å®šæ—¶å™¨è®¾å®ƒé—¨ä¸€ä¸ªå›ºå®šå®½åº¦
function keepFullScreenModules100Width() {
setInterval(function () {
$('body>.ModuleItem').each(function(i,item){
if(!$(this).attr('float')) $(this).css('width', $('#pagebody').width()); //éžæµ®åŠ¨æ¨¡å—ä¿æŒå…¨å±
});
}, 200);
}
function runSlide(id,pattern,time,imageready){
var module = $("#module_" + id);
var mm = module.clone();
var text = $('#txt_'+ id);
if(text.length == 0){
var text = $("");
}
$("body").append(text);
var obj = $("#myFocus" + id);
// 以下特殊å—符必须处ç†ï¼Œé˜²æ¢myfocus解æžé”™è¯¯
obj.find('img').each(function(){
$(this).attr('alt', ($(this).attr('alt') || '').replace(/[<>&"]/g,function(c){return {'<':'<','>':'>','&':'&','"':'"'}[c];}));
$(this).attr('text', ($(this).attr('text') || '').replace(/[<>&"]/g,function(c){return {'<':'<','>':'>','&':'&','"':'"'}[c];}));
});
var readyCallback = function(){
// ä¿®å¤mF_ladyQé£Žæ ¼ä¸‹ï¼Œæ ‡é¢˜æ–‡å—在第一次循环ä¸æ˜¾ç¤ºçš„bug
if(pattern == "mF_ladyQ"){
module.find('.txt li').css({
'-webkit-transition': 'none',
'-moz-transition': 'none',
'-o-transition': 'none'
});
}
}
if(module.css("position") != "absolute"){
var width = module.parent().width() - parseInt(module.parent().css("padding-left")) - parseInt(module.parent().css("padding-right"));
if(!obj.attr("hasreload")){
obj.find("*[name=slideImg]").each(function(i,item){
var src = $(item).attr("src");
$(item).src = '';
$(item).on("load",function(){
if(obj.attr("hasreload")) return;
if($(item).height() == 0) return;
obj.height($(item).height());
module.height($(item).height());
obj.width(width);
module.width(width);
obj.attr("hasreload","1");
myFocus.set({ id: "myFocus" + id, pattern: pattern, loadIMGTimeout: 0, time: time}, readyCallback);
});
$(item).src = src;
});
}
}else{
myFocus.set({ id: "myFocus" + id, pattern: pattern, loadIMGTimeout: 0, time: time}, readyCallback);
var $Img = module.find('img[name=slideImg]');
if(pattern == 'mF_slide3D'){
$Img.attr({'style':null,'width':null});
setTimeout(function(){
$('.mF_slide3D_wrap').css({'padding':0});
console.log($('.mF_slide3D_wrap'))},150)
}else if(pattern == 'mF_YSlider'){
var imgHeight = module.height();
$Img.attr({'style':'height:'+imgHeight+'px'});
}else if(pattern == 'mF_shutters'){
var imgHeight = module.height();
var imgWidth = module.width();
console.log(imgHeight,imgWidth);
$Img.attr({'style':'height:'+imgHeight+'px','width':imgWidth});
}
}
module.attr({"mid":id,"pattern":pattern,"time":time});
}
function runMobileSlide(moduleid){
$(window).load(function(){
$('#swiper' + moduleid).width($('#module_' + moduleid).parent().width());
$('#module_' + moduleid).resize(function(){
$('#swiper' + moduleid).width($('#module_' + moduleid).parent().width());
window['swiper' + moduleid].destroy(false);
window['swiper' + moduleid] = new Swiper('#swiper' + moduleid,{ autoplay:3000,loop : true,pagination : '.SNum' + moduleid });
});
window['swiper' + moduleid] = new Swiper('#swiper' + moduleid,{ autoplay:3000,loop : true,pagination : '.SNum' + moduleid });
});
}
// 调整幻ç¯ç‰‡æ¨¡å—æ˜¾ç¤ºæ ·å¼
function adjustModuleSlide(obj) {
if (!obj) {
var moduleSlides = $('.ModuleSlide').parent();
for (var i = 0; i < moduleSlides.length; i++) {
adjustModuleSlide(moduleSlides[i]);
}
}
obj = $(obj);
if (obj.children().is('.ModuleSlide') && SiteType == 0) {
var moduleid = obj.attr('id').replace(/module_/i, '');
var aa = $("#txt_" + moduleid);
var mm = $(aa.val().replace("runSlide",""));
mm.css({"position":obj.css("position"),"left":obj.css("left"),"top":obj.css("top"),"width":obj.width() + "px", "height":obj.height() + "px"});
var myfocusObj = mm.find('#myFocus' + moduleid);
var moduleHead = mm.find('.ModuleHead').get(0);
var moduleHeadHeight = moduleHead ? mm.find('.ModuleHead').get(0).offsetHeight : 0;
myfocusObj.height(mm.height() - moduleHeadHeight);
myfocusObj.width(mm.width());
$(obj).replaceWith(mm);
var id = obj.attr("mid");
var pattern = obj.attr("pattern");
var time = obj.attr("time");
runSlide(id,pattern,time);
}
}
//显示产å“ã€æ–‡ç« ç‰å分类
function setModuleCls(obj) {
var strCls = ".ModuleProductCls,.ModuleNewsCls,.ModuleDownCls,.ModuleNewsClsV2,.ModuleProductClsV2";
if (!obj) {
var moduleCls = $(strCls);
for (var i = 0; i < moduleCls.length; i++) {
setModuleCls(moduleCls[i]);
}
}
obj = $(obj);
var showStyle = obj.find("[class*=ModuleClsShowStyle]").attr('showstyle');
if (showStyle == 0) {
var hidesubTimer = new Object();
obj.find(".SHOWSUB>li").mouseover(function () {
var moduleid = $(this).closest('.ModuleItem').attr("id").replace('module_', '');
var id = 'subclass' + $(this).children("ul").attr("id");
var obj = $(this).get(0);
var type = '';
var moduleClasses = $(this).closest(strCls).attr('class').split(/\s+/);
var clsClasses = strCls.split(',');
for(var i = 0; i < moduleClasses.length; i++){
for(var j = 0; j < clsClasses.length; j++){
if(clsClasses[j].replace(/\s|\./g, '') == moduleClasses[i]){
type = moduleClasses[i];
break;
}
}
if(type) break;
}
$(obj).removeClass("SubMaskColor");
$(obj).removeClass("SubMaskBorder1");
$("#mask" + id).remove(); $("#" + id).remove();
if (!$(this).children("ul").html()) return;
var obj = $(this).get(0);
var p = $("
");
p.append($(this).children("ul").clone());
p.children("ul").css("display", "block");
p.off().mouseenter(function () {
clearTimeout(hidesubTimer[id]);
}).mouseleave(function () {
$("#" + id).remove();
$("#mask" + id).remove();
$(obj).removeClass("SubMaskColor");
$(obj).removeClass("SubMaskBorder1");
});
$("body").append(p);
var zindex = parseInt($(this).css("z-index"));
if (isNaN(zindex)) zindex = 0;
$("body").append("
");
$(this).addClass("SubMaskColor");
$(this).addClass("SubMaskBorder1");
var borderwidth = parseInt($("#" + id).css("border-top-width"));
if (isNaN(borderwidth)) borderwidth = 0;
var func = function () {
$("#" + id).css({ "display": "block", "top": $(obj).offset().top, "left": ($(obj).offset().left + $(obj).width()) });
$("#mask" + id).css({ "top": $(obj).offset().top + borderwidth, "left": ($(obj).offset().left + $(obj).width() - 3) });
};
func();
setTimeout(func, 50); //å› ä¸ºå¦‚æžœä»Žä¸€ä¸ªåˆ†ç±»å¿«é€Ÿåˆ‡æ¢åˆ°å¦ä¸€ä¸ªåˆ†ç±»ï¼ŒåŽŸåˆ†ç±»ä¼šå»¶æ—¶50msæ‰ä¼šæ¶ˆå¤±ï¼Œè¿™æ—¶å¦‚果原分类有border,会å äº†å‡ ä¸ªåƒç´ 的高度,会导致åŽé¢çš„分类ä½ç½®è®¡ç®—ä¸å‡†ï¼Œè¿™é‡Œå»¶æ—¶50msé‡æ–°è®¡ç®—一下解决了这个问题
}).mouseleave(function () {
$(this).children("ul").hide();
var id = 'subclass' + $(this).children("ul").attr("id");
var obj = $(this).get(0);
hidesubTimer[id] = setTimeout(function () {
$(obj).removeClass("SubMaskColor");
$(obj).removeClass("SubMaskBorder1");
$("#mask" + id).remove();
$("#" + id).remove();
}, 50);
});
} else if (showStyle == 3) {
obj.find('.MainClassItem:last-child').css({
borderBottom: '0px'
});
} else if (showStyle == 7) {
obj.find('.clsAllList > .clsItem').off().on('mouseenter', function () {
var moduleItem = $(this).closest('.ModuleItem');
var moduleid = moduleItem.attr('id');
moduleid = moduleid.replace('module_', '');
var floatElem = $('
').append('
');
floatElem.children('.clsAllList').append($(this).find('.clsItemList').clone());
$('body').append(floatElem);
$('body').append('
');
var moduleZIndex = parseFloat(moduleItem.css('z-index'));
if (isNaN(moduleZIndex)) moduleZIndex = 0;
moduleZIndex++; moduleZIndex = 9999;
var floatElemMinHeight = moduleItem.find('.clsAllList').height();
moduleItem.find('.clsAllList > .clsItem').removeClass('hover');
$(this).addClass('hover');
floatElem.css({
position: 'absolute',
top: getElementTopWithBorder(moduleItem[0]),
left: getElementLeftWithBorder(moduleItem[0]) + moduleItem.outerWidth(false),
zIndex: moduleZIndex
});
floatElem.find('.clsItemList').css({
position: 'static',
minHeight: floatElemMinHeight
}).show();
$('.ModuleProductClsStyle7_Mask').css({
position: 'absolute',
left: Math.ceil((getElementLeftWithBorder(this) + $(this).width()).toFixed(2)) * 100 / 100 - 1,
top: getElementTopWithBorder(this),
zIndex: moduleZIndex,
width: parseFloat(moduleItem.find('.clsAllList').css('border-right-width')) + parseFloat(moduleItem.css('border-right-width')) + parseFloat(floatElem.find('.clsAllList').css('border-left-width')) + 1,
height: parseFloat(moduleItem.find('.clsItem').height())
});
$('.ModuleClsShowStyle7_floatElem').off().on('mouseleave', function (evt) {
$('.ModuleClsShowStyle7_floatElem').remove();
$('.ModuleProductClsStyle7_Mask').remove();
$('#module_' + $(this).attr('relatedmoduleid')).find('.clsAllList > .clsItem').removeClass('hover');
});
$('.ModuleProductClsStyle7_Mask').off().on('mouseleave', function (evt) {
var relatedTarget = evt.toElement || evt.relatedTarget;
if (!$(relatedTarget).closest('.ModuleClsShowStyle7').hasClass('ModuleClsShowStyle7_floatElem')
&& !$(relatedTarget).hasClass('ModuleProductClsStyle7_Mask')) {
$('.ModuleClsShowStyle7_floatElem').remove();
$('.ModuleProductClsStyle7_Mask').remove();
$('#module_' + $(this).attr('relatedmoduleid')).find('.clsAllList > .clsItem').removeClass('hover');
}
});
}).on('mouseleave', function (evt) {
var relatedTarget = evt.toElement || evt.relatedTarget;
if (!$(relatedTarget).closest('.ModuleClsShowStyle7').hasClass('ModuleClsShowStyle7_floatElem')
&& !$(relatedTarget).hasClass('ModuleProductClsStyle7_Mask')) {
$('.ModuleClsShowStyle7_floatElem').remove();
$('.ModuleProductClsStyle7_Mask').remove();
$(this).removeClass('hover');
}
});
}
}
/**
* å…‹éš†å…ƒç´ æ ·å¼
* @author tang bin
* @version 0.1
* @see http://www.planeart.cn/?p=1499
* @param {HTMLElement} 被克隆的元ç´
* @param {Boolean} 是å¦å¯ç”¨ç¼“å˜ï¼ˆé»˜è®¤true)
* @return {String} cssç±»å
*/
var cloneStyle = (function (doc) {
var rstyle = /^(number|string)$/,
cloneName = '${cloneName}',
sData = {},
addHeadStyle = function (content) {
var style = sData[doc];
if (!style) {
style = sData[doc] = doc.createElement('style');
doc.getElementsByTagName('head')[0].appendChild(style);
};
style.styleSheet && (style.styleSheet.cssText += content) || style.appendChild(doc.createTextNode(content));
},
getStyle = 'getComputedStyle' in window ? function (elem, name) {
return getComputedStyle(elem, null)[name];
} : function (elem, name) {
return elem.currentStyle[name];
};
return function (source, cache) {
if (!cache && source[cloneName]) return source[cloneName];
var className, name,
cssText = [],
sStyle = source.style;
for (name in sStyle) {
val = getStyle(source, name);
if (val !== '' && rstyle.test(typeof val)) {
name = name.replace(/([A-Z])/g, "-$1").toLowerCase();
cssText.push(name);
cssText.push(':');
cssText.push(val);
cssText.push(';');
};
};
cssText = cssText.join('');
source[cloneName] = className = 'clone' + (new Date).getTime();
addHeadStyle('.' + className + '{' + cssText + '}');
return className;
};
}(document));
function runAllAnimate(list){
if(!list) list = $(".ModuleItem");
$(list).each(function(i,item){
var html = $(item)[0].outerHTML;
var animatename = $(item).attr("animate");
if(!animatename){
var match = html.match(/wow\s+([a-z]+)/gi);
if(match){
animatename = match[0].replace(/wow\s+/,'');
}
}
if(animatename){
if(html.indexOf("ModuleFullSwitch") > -1) return;
$(item).removeClass(animatename);
var duration = $(item).attr("data-wow-duration");
var delay = $(item).attr("data-wow-delay");
var animate = {"animation-name":animatename};
if(duration) animate["animation-duration"] = duration;
if(delay) animate["animation-delay"] = delay;
$(item).css({"animation-name":'aaa'});
setTimeout(function(){
$(item).css({"animation-name":animatename,"animation-duration":duration,"animation-delay":delay});
},10);
$(item).attr("animate",animatename);
}
});
}
// pc相册
function adjustModuleSiteGallery(moduleID) {
// TODO box-sizing: content-box 计算margin
var iSingleItemWidth = $("#module_" + moduleID + " .imgItem").outerWidth();
var iModuleWidth = $("#module_" + moduleID).width();
var iModuleHeight = $("#module_" + moduleID).height();
var iColCount = Math.floor(iModuleWidth / iSingleItemWidth);
var iTotalCount = $("#module_" + moduleID + " .imgItem").length;
$("#module_" + moduleID + " .imgItem").each(function (i) {
if (i % iColCount == 0) {
$(this).css({ marginLeft: 0 });
} else if (i % iColCount == iColCount - 1) {
$(this).css({ marginRight: 0 });
}
if (i < iColCount) {
$(this).css({ marginTop: 0 });
} else if (i > iTotalCount - iColCount) {
$(this).css({ marginBottom: 0 });
}
});
}
// åˆå§‹åŒ–pc相册
function setModuleSiteGallery(obj) {
var defaults = {
padding: 0,
prevEffect: 'fade',
nextEffect: 'fade',
viewDetails: '查看详情',
closeBtn: true,
openOpacity: true,
helpers: {
overlay: {
css: { 'background': 'rgba(0,0,0, 0.9)' },
closeClick: false
},
title: { type: 'outside' },
//buttons: {},
thumbs: {
width: 50,
height: 50,
position: 'bottom'
}
},
modal: false,
tpl: {
next: ' ',
prev: ' '
},
beforeLoad: function () {
if (this.element) {
var oImg = $(this.element).children('img');
var sLink = '';
if (oImg.attr('redirectUrl') + '' != '') {
sLink = ''+obj.viewDetails+' ';
}
this.title = oImg.attr('alt') + sLink;
} else {
var sLink = '';
if (this.url) {
sLink = ''+obj.viewDetails+' ';
}
this.title = this.title + sLink;
}
},
afterShow: function () {
if ($('.fancybox-overlay>.fancybox-prev').length == 0) {
$('.fancybox-outer>.fancybox-prev').appendTo('.fancybox-overlay');
} else {
$('.fancybox-outer>.fancybox-prev').remove();
}
if ($('.fancybox-overlay>.fancybox-next').length == 0) {
$('.fancybox-outer>.fancybox-next').appendTo('.fancybox-overlay');
} else {
$('.fancybox-outer>.fancybox-next').remove();
}
if ($('.fancybox-overlay>.fancybox-close').length == 0) {
$('.fancybox-skin>.fancybox-close').appendTo('.fancybox-overlay').css({
right: "0px",
top: "0px"
});
} else {
$('.fancybox-skin>.fancybox-close').remove();
}
//æ›´æ–°å‰ä¸€å¼ å’Œä¸‹ä¸€å¼ çš„é®ç›–高度,ä¸é®ä½ä¸‹é¢çš„超链接
var fancyboxInner = $(".fancybox-inner").eq(0);
var fancyboxWrap = $(".fancybox-wrap").eq(0);
if(fancyboxInner && fancyboxWrap) {
var top = parseInt(fancyboxWrap.css("top").replace("px", ""));
var height = fancyboxInner.height();
$(".fancybox-next").css("height", height + top);
$(".fancybox-prev").css("height", height + top);
}
}
}
if (obj.effectID != 0) delete defaults.helpers.thumbs;
$("#module_" + obj.moduleID + " .imgBox img").css('position', 'relative');
if (obj.isExpandDir == 0) {
$("#module_" + obj.moduleID + " .imgBox").off().click(function () {
$.fancybox.open(obj.galleryItems[$("#module_" + obj.moduleID + " .imgBox").index(this) + 1], defaults);
return false;
});
} else {
$("#module_" + obj.moduleID + " .imgBox").off().click(function () {
var items = obj.galleryItems[1] || [];
for (var i = 0; i < items.length; i++) {
if (($(this).prop('href') + '').replace(/\?.*$/, '').indexOf((items[i].href + '').replace(/\?.*$/, '')) > -1) {
break;
}
}
var opts = $.extend({}, defaults);
opts.index = i;
$.fancybox.open(obj.galleryItems[1], opts);
return false;
});
}
$("#module_" + obj.moduleID + " .imgBox img").each(function () {
var sSrc = $(this).attr('src');
$(this).attr('src', '');
$(this).off('load').on('load', function () {
$(this).attr('originWidth', $(this).parent().width());
$(this).attr('originHeight', $(this).parent().height());
});
$(this).attr('src', sSrc);
});
$("#module_" + obj.moduleID + " .imgBox img").off('mouseover').on('mouseover', function () {
var oZoomImage = $(this);
var iOriginWidth = oZoomImage.attr('originWidth') || $(this).parent().width();
var iOriginHeight = oZoomImage.attr('originHeight') || $(this).parent().height();
var iZoomPx = 50;
oZoomImage.stop().animate({
left: -iZoomPx / 2 + 'px',
top: -iZoomPx / 2 + 'px',
width: parseInt(iOriginWidth) + iZoomPx + 'px',
height: parseInt(iOriginHeight) + iZoomPx + 'px'
}, 600);
$('.imgMask').remove();
var iLeft = parseFloat($(this).closest('.imgItem').css('padding-left'));
var iTop = parseFloat($(this).closest('.imgItem').css('padding-top'));
$(' ').css({
left: iLeft + 'px',
top: iTop + 'px',
width: iOriginWidth + 'px',
height: iOriginHeight + 'px'
}).insertAfter(this).off().on('mouseleave', function () {
var oZoomImage = $(this).closest('.imgItem').find('.imgBox img');
var iOriginWidth = oZoomImage.attr('originWidth');
var iOriginHeight = oZoomImage.attr('originHeight');
oZoomImage.stop().animate({
left: '0',
top: '0',
width: iOriginWidth + 'px',
height: iOriginHeight + 'px'
}, 600);
$('.imgMask').remove();
}).on('click', function () {
})
});
}
function setMobileModuleSiteGallery(obj){
if (obj.isExpandDir == 0) {
$("#module_" + obj.moduleID + " .grid-cont").off().click(function () {
$(this).lightGallery({
dynamic: true,
thumbnail: true,
dynamicEl:obj.galleryItems[$("#module_" + obj.moduleID + " .grid-cont").index(this) + 1]
});
return false;
});
}
}
// åˆå§‹åŒ–音ä¹æ¨¡å—
function initModuleMusic(opts) {
var bgMusicFilePath = opts.bgMusicFilePath;
var moduleid = opts.moduleid;
var siteType = opts.siteType;
var isAutoPlay = opts.isAutoPlay;
var isLoop = opts.isLoop;
var canPlay = opts.canPlay;
if (canPlay) {
var ua = navigator.userAgent.toLowerCase();
var elem = $('#module_' + moduleid);
if (siteType == 0) {
if (ua.match(/msie ([\d.]+)/)) {
$(elem).find('#music' + moduleid).html(' ');
} else if (ua.match(/firefox\/([\d.]+)/)) {
$(elem).find('#music' + moduleid).html(' ');
} else if (ua.match(/chrome\/([\d.]+)/)) {
$(elem).find('#music' + moduleid).html(' ');
} else if (ua.match(/opera.([\d.]+)/)) {
$(elem).find('#music' + moduleid).html(' ');
} else if (ua.match(/version\/([\d.]+).*safari/)) {
$(elem).find('#music' + moduleid).html(' ');
} else {
$(elem).find('#music' + moduleid).html('');
}
} else {
$(elem).find('#music' + moduleid).html(' ');
}
if (/(iphone)|(ipad)/i.test(ua)) {
function forceSafariPlayAudio() {
audioEl.load(); // iOS 9 还需è¦é¢å¤–çš„ load 一下, å¦åˆ™ç›´æŽ¥ play æ— æ•ˆ
audioEl.play(); // iOS 7/8 ä»…éœ€è¦ play 一下
}
var audioEl = $('#music' + moduleid).find('audio')[0];
audioEl.addEventListener('play', function () {
// 当 audio 能够æ’放åŽ, 移除这个事件
window.removeEventListener('touchstart', forceSafariPlayAudio, false);
}, false);
// 由于 iOS Safari é™åˆ¶ä¸å…许 audio autoplay, 必须用户主动交互(例如 click)åŽæ‰èƒ½æ’放 audio,
// å› æ¤æˆ‘们通过一个用户交互事件æ¥ä¸»åŠ¨ play 一下 audio.
window.addEventListener('touchstart', forceSafariPlayAudio, false);
audioEl.src = bgMusicFilePath;
}
}
function setMusicImg(moduleid, isPlaying) {
var musicImg = $('#musicPic' + moduleid).find('img');
if (isPlaying) {
musicImg.attr('src', musicImg.attr('playing_src')).addClass('playing');
} else {
musicImg.attr('src', musicImg.attr('_src')).removeClass('playing');
}
}
setMusicImg(moduleid, isAutoPlay);
$('#musicPic' + moduleid).off().on('click', function () {
var audioEl = $('#music' + moduleid).find('audio')[0];
if (audioEl) {
if (audioEl.paused) {
audioEl.play();
setMusicImg(moduleid, true);
} else {
audioEl.pause();
setMusicImg(moduleid, false);
}
}
audioEl = $('#music' + moduleid).find('embed')[0];
if (audioEl) {
if (audioEl.playState == 2) {
audioEl.pause();
setMusicImg(moduleid, false);
} else {
audioEl.play();
setMusicImg(moduleid, true);
}
}
audioEl = $('#music' + moduleid).find('object')[0];
if (audioEl) {
if (audioEl.PlayState == 2) {
audioEl.Pause();
setMusicImg(moduleid, false);
} else {
audioEl.Play();
setMusicImg(moduleid, true);
}
}
});
}
// åˆå§‹åŒ–æ ‡ç¾é¡µæ¨¡å—
function initModuleTabContainer(moduleID, showStyle){
//有swiper组件的都è¦åœ¨åˆå§‹åŒ–模å—的时候讲模å—åç§°å¢žåŠ "Swiper",以下为例å
//其余æ£å¸¸ä¾‹ååªéœ€è¦initFunc
//*注:å› ä¸ºswperè½®æ’组件åˆå§‹åŒ–的时候回判æ–å…ƒç´ æ˜¯å¦è¢«éšè—,如果被éšè—æ³½ä¸ä¼šè¢«åˆå§‹åŒ–æˆåŠŸ
//swper模å—必须注册该事件
//如果有swiperéšè—的模å—,记得注册该事件
$("#module_"+moduleID+" .Nav-Container").on({
"click":function(){solveSwiperEvent()},
"mouseover":function(){solveSwiperEvent()}
});
var solveSwiperEvent = function(){
for (var key in window) {
if (key.substr(0, 14) == 'initSwiperFunc') {
var mid = key.substr(14);
if($("#module_"+moduleID+" #module_"+mid).length > 0){
window[key]();
}
}
}
}
if(showStyle == 0){
var module = $('#module_' + moduleID);
if(module.length == 0) return;
$('.btnScrollRight', module).on('click', function(){
var panelBtnScrollLeft = $(this).parent().position().left;
var targetElem = null;
var oldscrollLeft = ('.nav', module).scrollLeft();
$('.nav', module).children('li').each(function(i){
var leftEdgeLeft = $(this).position().left;
var rightEdgeLeft = $(this).position().left + $(this).outerWidth(true);
if(oldscrollLeft <= leftEdgeLeft){
targetElem = $(this);
return false;
}
});
if(targetElem){
var scrollLeft = $('.nav', module).scrollLeft() + targetElem.position().left + targetElem.outerWidth(true) - panelBtnScrollLeft;
var scrollLeft2 = $('.nav', module).scrollLeft() + targetElem.outerWidth(true);
var marginRight = 0;
if(targetElem.is($('.nav>li:last', module))){
marginRight = $('.panelBtnScroll', module).outerWidth(true) + 10;
scrollLeft = getNavRealWidth();
}
$('.nav', module).stop().animate({'scrollLeft': scrollLeft2, 'margin-right': marginRight}, 300, function(){
setButtonDisabled();
});
}
});
$('.btnScrollLeft', module).on('click', function(){
var targetElem = null;
$('.nav', module).children('li').each(function(i){
if($(this).position().left + $(this).outerWidth(true) >= 0){
targetElem = $(this);
return false;
}
});
if(targetElem){
var scrollLeft = $('.nav', module).scrollLeft() + targetElem.position().left;
$('.nav', module).stop().animate({'scrollLeft': scrollLeft, 'margin-right': 0}, 300, function(){
setButtonDisabled();
});
}
});
function getNavRealWidth(){
var width = 0;
$('.nav>li', module).each(function(){
width += $(this).outerWidth(true);
});
return width;
}
function setButtonDisabled(){
if($('.nav', module).scrollLeft() == 0){
$('.btnScrollLeft', module).css('color', '#ccc');
}else{
$('.btnScrollLeft', module).css('color', '');
}
var navRealWidth = getNavRealWidth();
if($('.nav', module).scrollLeft() + $('.nav', module).outerWidth(true) >= navRealWidth && parseFloat($('.nav', module).css('margin-right') || 0) > 0){
$('.btnScrollRight', module).css('color', '#ccc');
}else{
$('.btnScrollRight', module).css('color', '');
}
}
function setPanelBtnScroll(){
var navRealWidth = getNavRealWidth();
if(isMobileBroswer()){
$('.nav', module).css('overflow', 'auto');
}else{
$('.nav', module).css('overflow', 'hidden');
}
if(!isMobileBroswer() && navRealWidth > $('.nav', module).width()){
$('.panelBtnScroll', module).show();
}else{
$('.panelBtnScroll', module).hide();
}
$('.panelBtnScroll').css({
'height': $('.nav', module).outerHeight(),
'padding-top': ($('.nav', module).outerHeight() - $('.panelBtnScroll>:first-child', module).outerHeight()) / 2
});
/*å¦‚æžœæ˜¯æ–°çš„æ ‡ç¾æ¨¡å—;左å³çš„按钮é‡æ–°å®šä½ï¼ˆåŸºäºŽæŒ‰é’®å±…ä¸ï¼‰*/
if(module.find('.ModuleTabContainerGiant').length>0){
var pdtp = Number($('.Nav-Container li', module).css('margin-top').replace(/px/,''))+$('.Nav-Container li', module).outerHeight()/2-11;
module.find('.panelBtnScroll').css({
'padding-top':pdtp
})
}
setButtonDisabled();
}
setPanelBtnScroll();
$(window).off('resize.tabContainer' + moduleID).on('resize.tabContainer' + moduleID, function(){
setPanelBtnScroll();
});
$('.panelBtnScroll, .nav', module).disableSelection();
}
}
// é‡è°ƒå…¨å±å¹»ç¯ç‰‡æ¨¡å—
function adjustModuleFullSlide(moduleid){
moduleid = (moduleid + '').replace(/^module_/i, '');
var data = $('#module_' + moduleid).find('#Full' + moduleid).data('params');
if(data){
var height = $('#module_' + moduleid).height();
CoolSlide('#Full' + moduleid, height, data.effect, data.time, data.imgshowtype);
}
}
// 产å“详情二维ç 控制
function initProductDetailQrcode(qrcodeText){
var moduleProductDetailQrcodeTimeoutId = "moduleProductDetailQrcode";
$(".icon-qrcode").on("mouseenter click",function(){
if (window[moduleProductDetailQrcodeTimeoutId]) {
clearTimeout(window[moduleProductDetailQrcodeTimeoutId]);
}
$("#divQrcode").remove();
var html = "";
html += "
" + qrcodeText + "
";
html += "
";
$("body").append(html);
$('#pro-qrcode').qrcode({text:location.href.replace(/(\?|#).*$/,''),width:140,height:140});
$("#divQrcode").css({top:$(this).offset().top + 30,left:$(this).offset().left - $('#divQrcode').width() + 30});
$('#divQrcode').off('mouseenter').on('mouseenter', function(){
if (window[moduleProductDetailQrcodeTimeoutId]) {
clearTimeout(window[moduleProductDetailQrcodeTimeoutId]);
}
});
$(".icon-qrcode, #divQrcode").off("mouseleave").on("mouseleave",function(evt){
evt = evt || window.event;
var relatedTarget = evt.relatedTarget || evt.toElement;
if ($(relatedTarget).is('.icon-qrcode, #divQrcode') || $(relatedTarget).closest('.icon-qrcode, #divQrcode').length > 0) {
return false;
}
if (window[moduleProductDetailQrcodeTimeoutId]) {
clearTimeout(window[moduleProductDetailQrcodeTimeoutId]);
}
window[moduleProductDetailQrcodeTimeoutId] = setTimeout(function() {
$("#divQrcode").remove();
}, 300);
});
});
}
//点击å‘é€çŸä¿¡éªŒè¯ç
var InterValObj; //timerå˜é‡ï¼ŒæŽ§åˆ¶æ—¶é—´
var count = 60; //间隔函数,1秒执行
var curCount;//当å‰å‰©ä½™ç§’æ•°
function sendMessage(ModuleID) {
var mobile = $('#resetMobile'+ModuleID).val();
var mobilereg = /^1[3|4|5|7|8]\d{9}$/;
if(!mobilereg.test(mobile)){
alert('请输入有效的手机å·ç ï¼');
return false;
}
 curCount = count;
//设置button效果,开始计时
$("#btnSendCode"+ModuleID).attr("disabled", "true");
$("#btnSendCode"+ModuleID).text("请在" + curCount + "秒内输入验è¯ç ");
InterValObj = window.setInterval(function(){SetRemainTime(ModuleID);}, 1000); //å¯åŠ¨è®¡æ—¶å™¨ï¼Œ1秒执行一次
//å‘åŽå°å‘é€å¤„ç†æ•°æ®
$.ajax({
  type: "POST", //用POSTæ–¹å¼ä¼ 输
  dataType: "JSON", //æ•°æ®æ ¼å¼:JSON
  url: '/index.php?c=Front/Userlogin&a=getcode', //ç›®æ ‡åœ°å€
   data: {mobile:mobile},
   error: function (XMLHttpRequest, textStatus, errorThrown) { },
  success: function (data){
if(data.success){
alert(data.msg);
}
if(!data.success){
alert(data.msg);
}
  }
});
}
//timer处ç†å‡½æ•°
function SetRemainTime(ModuleID) {
if (curCount == 0) {
window.clearInterval(InterValObj);//åœæ¢è®¡æ—¶å™¨
$("#btnSendCode"+ModuleID).removeAttr("disabled");//å¯ç”¨æŒ‰é’®
$("#btnSendCode"+ModuleID).text("é‡æ–°å‘é€éªŒè¯ç ");
}
else {
curCount--;
$("#btnSendCode"+ModuleID).text("请在" + curCount + "秒内输入验è¯ç ");
}
}
//å°†urlä¸çš„querystring转为对象
function getQueryParam(){
if(!document.location.search) return null;
var URLParams = new Object();
var aParams = document.location.search.substr(1).split('&');
for (i = 0 ; i < aParams.length ; i++) {
var aParam = aParams[i].split('=');
var value = aParam[1];
if(value && value.indexOf("#") > -1) value = value.substring(0,value.indexOf("#"));
URLParams[aParam[0]] = decodeURIComponent(value);
}
return URLParams;
}
//替æ¢æŒ‡å®šçš„模å—
window.replaceModules = {};
function replaceModule(moduleid){
if(window.replaceModules['moduleid'] || moduleid == 0 || moduleid == 'module_0') return;
var params = getQueryParam();
var str = '';
for(key in params){
if(key != 'c' && key != 'moduleId') str += "&"+key+"="+escape(params[key]);
}
$.get("/index.php?c=front/LoadModule&moduleId=" + moduleid + str,null,function(data){
window.replaceModules['moduleid'] = true;
$('#' + moduleid).replaceWith(data);
$('#' + moduleid).find('.ModuleUserLogin,.ModuleUserLoginV2').find('.userLoginContent').show().css('visibility','visible');
});
}
// 获å–当å‰é¡µé¢urlå‚æ•°
if (!window.location.getQueryString) window.location.getQueryString = function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return (r[2]); return null;
}
// jquery resize事件
if (!jQuery.resize) {
(function ($, h, c) { var a = $([]), e = $.resize = $.extend($.resize, {}), i, k = "setTimeout", j = "resize", d = j + "-special-event", b = "delay", f = "throttleWindow"; e[b] = 250; e[f] = true; $.event.special[j] = { setup: function () { if (!e[f] && this[k]) { return false } var l = $(this); a = a.add(l); $.data(this, d, { w: l.width(), h: l.height() }); if (a.length === 1) { g() } }, teardown: function () { if (!e[f] && this[k]) { return false } var l = $(this); a = a.not(l); l.removeData(d); if (!a.length) { clearTimeout(i) } }, add: function (l) { if (!e[f] && this[k]) { return false } var n; function m(s, o, p) { var q = $(this), r = $.data(this, d); r.w = o !== c ? o : q.width(); r.h = p !== c ? p : q.height(); n.apply(this, arguments) } if ($.isFunction(l)) { n = l; return m } else { n = l.handler; l.handler = m } } }; function g() { i = h[k](function () { a.each(function () { var n = $(this), m = n.width(), l = n.height(), o = $.data(this, d); if (m !== o.w || l !== o.h) { n.trigger(j, [o.w = m, o.h = l]) } }); g() }, e[b]) } })(jQuery, this);
}
// *** 分享推广代ç
// 如果原æ¥æ²¡æœ‰è®¾ç½®æŽ¨å¹¿æ¥æº
//$(window).load(function(){
var match = window.location.href.match(/#invite(\d+)/i);
if(match){
if(window.location.toString().indexOf("debug") > -1) alert(document.cookie);
$.get("/index.php?c=SetCookie&name=invite&value=" + match[1]); //用js设置cookie会令.netå–ä¸åˆ°æ£ç¡®çš„值,è¦æ”¹ä¸ºç”¨aspnet的程åºæ¥è®¾ç½®
}
//});
// 生æˆå½“å‰ç”¨æˆ·çš„推广链接
var match = document.cookie.match(/WebUserID=(\d+)/i);
if(match){
var WebUserID = match[1];
var um = navigator.userAgent.match(/MicroMessenger/gi);
if(um || true){
if(window.location.toString().indexOf("#invite") == -1 && window.location.toString().indexOf("?invite=" + WebUserID) == -1){
window.location.href = window.location + "#invite" + WebUserID;
}
}
}
// *** END OF 分享推广代ç
//*** start of 自动转æ¢å—体大å°
var rootfont = parseFloat($("html").css('font-size'));
function torem(px){
if(px > 22) px = 22;
if(px < 12) px = 12;
return parseFloat(px / rootfont)+'rem';
}
function changeFontSize(parentObj){
if(SiteType != "1") return;
var modules = null;
var selector = ".ModuleNewsDetail,.ModuleNewsDetailV2,.ModuleProductDetail,.ModuleProductDetailV2,.ModuleImageTextV2,.ModuleImageText,.ModuleNewsDetailGiant,.ModuleProductDetailGiant,.ModuleImageTextGiant";
if(parentObj) modules = $(parentObj).find(selector);
else modules = $(selector);
modules.each(function(i,module){
var mp = $(module).closest(".ModuleItem");
if(mp.css("position") == "absolute") return;
var texts = null;
if(mp.is(".ModuleProductDetail") || mp.is(".ModuleProductDetailV2")) texts = $(module).find(".goods-detail-content,.pro-detail-content").find("div,span,td,p,li,a,font");
else if(mp.is(".ModuleNewsDetail") || mp.is(".ModuleNewsDetailV2")) texts = $(module).find(".NewsContent").find("div,span,td,p,li,a,font");
else texts = $(module).find("div,span,td,p,li,a,font");
texts.each(function(j,item){
if($(item).is(".goods-attrval-name"))return;
// cloneåŽï¼Œå°±ç®—æ²¡åŠ åˆ°body,cloneå…ƒç´ é‡Œé¢çš„图片资æºä¹Ÿä¼šçœŸçš„去请求
// 这个特性会导致验è¯ç 失效,所以会å¦å¤–一ç§æ–¹æ³•
// var tmp = $(item).clone();
var tmp = $(item).children().length == 0 ? $(item).clone() : $(""+$(item).html().replace(/
]+c=validatecode[^>]+>/ig, '')+"
");
tmp.find(':nth-child(n)').remove();
if(tmp.text().trim().length <= 8) return;
if($(window).width() > 900){
if($(item).attr('ori-font-size')){
$(item).css('font-size',$(item).attr('ori-font-size'));
$(item).attr('ori-font-size',null);
}
if($(item).attr('ori-line-height')){
$(item).css('line-height',$(item).attr('ori-line-height'));
$(item).attr('ori-line-height',null);
}
return;
}
var oldfontsize = $(item).css('font-size');
var lineheightScal = parseFloat($(item).css('line-height'))/parseFloat(oldfontsize);
if(/(px)$/.test(oldfontsize)){
var fontsize = parseFloat(oldfontsize);
var newsize = torem(fontsize);
$(item).css('font-size',newsize);
if(!$(item).attr('ori-font-size')) $(item).attr('ori-font-size',oldfontsize);
if(lineheightScal > 1){
$(item).css('line-height',(lineheightScal*100)+"%"); //ä¿æŒæ¯”例
if(!$(item).attr('ori-line-height')) $(item).attr('ori-line-height',(lineheightScal*100)+"%");
}
}
});
});
}
$(window).load(function(){ console.log('JScsipt 自动转æ¢å—体大å°'); initSubtreeFont=function(){};changeFontSize()});
$(window).resize(function(){changeFontSize()});
//*** end of 自动转æ¢å—体大å°
//** start of 模å—浮动
if(typeof(floaters) != 'undefined'){ //一些独立的页é¢ï¼ˆæ¯”如店掌柜的)è¦åŠ è½½JScript,但åˆä¸éœ€è¦æ¨¡å—浮动的功能,就ä¸å¿…åˆå§‹åŒ–了
var floatplayer = new floaters();
var floatElems = new Array();
function runFloaters(module,action) {
if(typeof(module) == 'string') module = $('#'+module);
if(action == 'remove'){
module.css("overflow-y",'auto');
module.css("display","block");
floatplayer.remove(module.attr('id'));
return;
}
if(/^(float\-)/i.test(module.attr('float'))){
module.css("overflow-y",'hidden');
module.appendTo("body");
module.show();
var top = parseInt(module.attr('floaty'));
if(isNaN(top)) top = parseInt(module.css('top'));
var id = module.attr('id');
if(/^(float\-left)/i.test(module.attr('float'))){
var left = parseInt(module.attr('floatx'));
if(isNaN(left)) left = parseInt(module.css('left'));
var options = {'floaterID':id,'distanceFromPageLeft':left,'distanceFromPageTop':top,width:module.css('width'),'xFloat':'left'};
var floatElem = floatplayer.addItem2(options,action);
floatElems.push(floatElem);
}else if(/^(float\-right)/i.test(module.attr('float'))){
var right = parseInt(module.attr('floatx'));
if(isNaN(right)) right = parseInt(module.css('right'));
var options = {'floaterID':id,'distanceFromPageRight':right,'distanceFromPageTop':top,'xFloat':'right'};
var floatElem = floatplayer.addItem2(options,action);
floatElems.push(floatElem);
}
floatplayer.play2();
}
}
setInterval(function(){
for(var k=0;k 110) height = 110;
if((st == "2" || st == "4") && height > 80) height = 80;
$(item).height(height);
});
var hasText = false;
m.find(".JiuGongItemText").each(function(i,item){
if(st == 4) $(item).css('line-height',$(item).height()+'px');
hasText = true;
});
//åªæœ‰å›¾æ ‡æ²¡æœ‰æ ‡é¢˜æ—¶ï¼Œä¸é™åˆ¶å›¾æ ‡çš„大å°
if(hasText == false){
m.find(".JiuGongItemImg").each(function(i,item){
$(item).css({"width":"auto","height":"auto"});
});
m.find(".JiuGongItem").each(function(i,item){
$(item).css({"width":"auto","height":"auto"});
});
return;
}
var cc = parseInt(m.find('.JiuGongTab').attr("CellCount"));
if(st == "0"){ //上下结构
m.find(".JiuGongItemImg").each(function(i,item){
var w = 50,h = 50;
if(cc >=5 && m.width() < 700) w = 40,h = 40;
$(item).css({"max-width":w,"max-height":h});
});
}
if(st == "2"){ //å·¦å³ç»“æž„
m.find(".JiuGongItemImg,.JiuGongItemImg2").each(function(i,item){
var w = 30,h = 30;
if(cc <=2) w = 40,h = 40;
if(m.width() > 700) w = 50,h = 50;
$(item).css({"min-width":w,"min-height":h});
});
}
}else{
var modules = $(".ModuleJiuGongV2").closest(".ModuleItem");
$.each(modules,function(i,item){
computeJiuGondHeight(item);
});
}
}
//地图模å—åˆå§‹åŒ–
var citylocation, map, marker, infoWin = null;
function moduleMap(latitude, longitude, title) {
var center = new qq.maps.LatLng(latitude, longitude);
var map = new qq.maps.Map(document.getElementById('mapContainer{{ModuleID}}'), {
center: center,
zoom: 13
});
infoWin = new qq.maps.InfoWindow({
map: map
});
infoWin.open();
infoWin.setContent(title);
infoWin.setPosition(map.getCenter());
marker = new qq.maps.Marker({
position: center,
draggable: true,
map: map
});
}
// swiper animation 效果
function runAnimate(jqobj,animate,duration,delay) {
$(jqobj).css({ "animation-name": animate, "animation-duration": duration, "animation-delay": delay }).one(
'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
$(jqobj).css({ "animation-name": "none", "animation-duration": "none", "animation-delay": "none" });
}
);
}
//模å—悬åœåŠ¨ç”»
function initHoverAnimate(){
$(document).on("mouseenter",".ModuleItem",function(){
if(typeof CanDesign != 'undefined' && CanDesign == 'False'){
var jqobj = $(this);
if($(jqobj).attr('hover-effect')){
runAnimate($(jqobj),$(jqobj).attr('hover-effect'),$(jqobj).attr('hover-duration'),$(jqobj).attr('hover-delay'));
}
}
});
$(document).on("mouseenter",".image-animation,img",function(){
if(typeof CanDesign != 'undefined' && CanDesign == 'False'){
var jqobj = $(this).closest(".ModuleItem");
var imgobj = $(this).closest(".image-animation");
if(imgobj.length == 0) imgobj = $(this);
if($(jqobj).attr('image-hover-effect')){
if($(jqobj).attr('image-hover-effect') == 'zoom'){ ImgZoom(imgobj); imgobj.on("mouseleave",function(){ unImgZoom(imgobj) });}
else runAnimate($(imgobj),$(jqobj).attr('image-hover-effect'),$(jqobj).attr('image-hover-duration'),$(jqobj).attr('image-hover-delay'));
}
}
});
}
;// END OF /share/JScript.js
// STARTS OF /scripts/fancyBox/lib/jquery.mousewheel-3.0.6.pack.js
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.6
*
* Requires: 1.2.2+
*/
(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=
d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);;// END OF /scripts/fancyBox/lib/jquery.mousewheel-3.0.6.pack.js
// STARTS OF /scripts/fancyBox/source/jquery.fancybox.js
/*!
* fancyBox - jQuery Plugin
* version: 2.1.5 (Fri, 14 Jun 2013)
* @requires jQuery v1.6 or later
*
* Examples at http://fancyapps.com/fancybox/
* License: www.fancyapps.com/fancybox/#license
*
* Copyright 2012 Janis Skarnelis - janis@fancyapps.com
*
*/
(function (window, document, $, undefined) {
"use strict";
var H = $("html"),
W = $(window),
D = $(document),
F = $.fancybox = function () {
F.open.apply( this, arguments );
},
IE = navigator.userAgent.match(/msie/i),
didUpdate = null,
isTouch = document.createTouch !== undefined,
isQuery = function(obj) {
return obj && obj.hasOwnProperty && obj instanceof $;
},
isString = function(str) {
return str && $.type(str) === "string";
},
isPercentage = function(str) {
return isString(str) && str.indexOf('%') > 0;
},
isScrollable = function(el) {
return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
},
getScalar = function(orig, dim) {
var value = parseInt(orig, 10) || 0;
if (dim && isPercentage(orig)) {
value = F.getViewport()[ dim ] / 100 * value;
}
return Math.ceil(value);
},
getValue = function(value, dim) {
return getScalar(value, dim) + 'px';
};
$.extend(F, {
// The current version of fancyBox
version: '2.1.5',
defaults: {
padding : 15,
margin : 20,
width : 800,
height : 600,
minWidth : 100,
minHeight : 100,
maxWidth : 9999,
maxHeight : 9999,
pixelRatio: 1, // Set to 2 for retina display support
autoSize : true,
autoHeight : false,
autoWidth : false,
autoResize : true,
autoCenter : !isTouch,
fitToView : true,
aspectRatio : false,
topRatio : 0.5,
leftRatio : 0.5,
scrolling : 'auto', // 'auto', 'yes' or 'no'
wrapCSS : '',
arrows : true,
closeBtn : true,
closeClick : false,
nextClick : false,
mouseWheel : true,
autoPlay : false,
playSpeed : 3000,
preload : 3,
modal : false,
loop : true,
ajax : {
dataType : 'html',
headers : { 'X-fancyBox': true }
},
iframe : {
scrolling : 'auto',
preload : true
},
swf : {
wmode: 'transparent',
allowfullscreen : 'true',
allowscriptaccess : 'always'
},
keys : {
next : {
13 : 'left', // enter
34 : 'up', // page down
39 : 'left', // right arrow
40 : 'up' // down arrow
},
prev : {
8 : 'right', // backspace
33 : 'down', // page up
37 : 'right', // left arrow
38 : 'down' // up arrow
},
close : [27], // escape key
play : [32], // space - start/stop slideshow
toggle : [70] // letter "f" - toggle fullscreen
},
direction : {
next : 'left',
prev : 'right'
},
scrollOutside : true,
// Override some properties
index : 0,
type : null,
href : null,
content : null,
title : null,
// HTML templates
tpl: {
wrap : '',
image : ' ',
iframe : '',
error : 'The requested content cannot be loaded. Please try again later.
',
closeBtn : ' ',
next : ' ',
prev : ' '
},
// Properties for each animation type
// Opening fancyBox
openEffect : 'fade', // 'elastic', 'fade' or 'none'
openSpeed : 250,
openEasing : 'swing',
openOpacity : true,
openMethod : 'zoomIn',
// Closing fancyBox
closeEffect : 'fade', // 'elastic', 'fade' or 'none'
closeSpeed : 250,
closeEasing : 'swing',
closeOpacity : true,
closeMethod : 'zoomOut',
// Changing next gallery item
nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
nextSpeed : 250,
nextEasing : 'swing',
nextMethod : 'changeIn',
// Changing previous gallery item
prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
prevSpeed : 250,
prevEasing : 'swing',
prevMethod : 'changeOut',
// Enable default helpers
helpers : {
overlay : true,
title : true
},
// Callbacks
onCancel : $.noop, // If canceling
beforeLoad : $.noop, // Before loading
afterLoad : $.noop, // After loading
beforeShow : $.noop, // Before changing in current item
afterShow : $.noop, // After opening
beforeChange : $.noop, // Before changing gallery item
beforeClose : $.noop, // Before closing
afterClose : $.noop // After closing
},
//Current state
group : {}, // Selected group
opts : {}, // Group options
previous : null, // Previous element
coming : null, // Element being loaded
current : null, // Currently loaded element
isActive : false, // Is activated
isOpen : false, // Is currently open
isOpened : false, // Have been fully opened at least once
wrap : null,
skin : null,
outer : null,
inner : null,
player : {
timer : null,
isActive : false
},
// Loaders
ajaxLoad : null,
imgPreload : null,
// Some collections
transitions : {},
helpers : {},
/*
* Static methods
*/
open: function (group, opts) {
if (!group) {
return;
}
if (!$.isPlainObject(opts)) {
opts = {};
}
// Close if already active
if (false === F.close(true)) {
return;
}
// Normalize group
if (!$.isArray(group)) {
group = isQuery(group) ? $(group).get() : [group];
}
// Recheck if the type of each element is `object` and set content type (image, ajax, etc)
$.each(group, function(i, element) {
var obj = {},
href,
title,
content,
type,
rez,
hrefParts,
selector;
if ($.type(element) === "object") {
// Check if is DOM element
if (element.nodeType) {
element = $(element);
}
if (isQuery(element)) {
obj = {
href : element.data('fancybox-href') || element.attr('href'),
title : element.data('fancybox-title') || element.attr('title'),
isDom : true,
element : element
};
if ($.metadata) {
$.extend(true, obj, element.metadata());
}
} else {
obj = element;
}
}
href = opts.href || obj.href || (isString(element) ? element : null);
title = opts.title !== undefined ? opts.title : obj.title || '';
content = opts.content || obj.content;
type = content ? 'html' : (opts.type || obj.type);
if (!type && obj.isDom) {
type = element.data('fancybox-type');
if (!type) {
rez = element.prop('class').match(/fancybox\.(\w+)/);
type = rez ? rez[1] : null;
}
}
if (isString(href)) {
// Try to guess the content type
if (!type) {
if (F.isImage(href)) {
type = 'image';
} else if (F.isSWF(href)) {
type = 'swf';
} else if (href.charAt(0) === '#') {
type = 'inline';
} else if (isString(element)) {
type = 'html';
content = element;
}
}
// Split url into two pieces with source url and content selector, e.g,
// "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
if (type === 'ajax') {
hrefParts = href.split(/\s+/, 2);
href = hrefParts.shift();
selector = hrefParts.shift();
}
}
if (!content) {
if (type === 'inline') {
if (href) {
content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
} else if (obj.isDom) {
content = element;
}
} else if (type === 'html') {
content = href;
} else if (!type && !href && obj.isDom) {
type = 'inline';
content = element;
}
}
$.extend(obj, {
href : href,
type : type,
content : content,
title : title,
selector : selector
});
group[ i ] = obj;
});
// Extend the defaults
F.opts = $.extend(true, {}, F.defaults, opts);
// All options are merged recursive except keys
if (opts.keys !== undefined) {
F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
}
F.group = group;
return F._start(F.opts.index);
},
// Cancel image loading or abort ajax request
cancel: function () {
var coming = F.coming;
if (!coming || false === F.trigger('onCancel')) {
return;
}
F.hideLoading();
if (F.ajaxLoad) {
F.ajaxLoad.abort();
}
F.ajaxLoad = null;
if (F.imgPreload) {
F.imgPreload.onload = F.imgPreload.onerror = null;
}
if (coming.wrap) {
coming.wrap.stop(true, true).trigger('onReset').remove();
}
F.coming = null;
// If the first item has been canceled, then clear everything
if (!F.current) {
F._afterZoomOut( coming );
}
},
// Start closing animation if is open; remove immediately if opening/closing
close: function (event) {
F.cancel();
if (false === F.trigger('beforeClose')) {
return;
}
F.unbindEvents();
if (!F.isActive) {
return;
}
if (!F.isOpen || event === true) {
$('.fancybox-wrap').stop(true).trigger('onReset').remove();
F._afterZoomOut();
} else {
F.isOpen = F.isOpened = false;
F.isClosing = true;
$('.fancybox-item, .fancybox-nav').remove();
F.wrap.stop(true, true).removeClass('fancybox-opened');
F.transitions[ F.current.closeMethod ]();
}
},
// Manage slideshow:
// $.fancybox.play(); - toggle slideshow
// $.fancybox.play( true ); - start
// $.fancybox.play( false ); - stop
play: function ( action ) {
var clear = function () {
clearTimeout(F.player.timer);
},
set = function () {
clear();
if (F.current && F.player.isActive) {
F.player.timer = setTimeout(F.next, F.current.playSpeed);
}
},
stop = function () {
clear();
D.unbind('.player');
F.player.isActive = false;
F.trigger('onPlayEnd');
},
start = function () {
if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
F.player.isActive = true;
D.bind({
'onCancel.player beforeClose.player' : stop,
'onUpdate.player' : set,
'beforeLoad.player' : clear
});
set();
F.trigger('onPlayStart');
}
};
if (action === true || (!F.player.isActive && action !== false)) {
start();
} else {
stop();
}
},
// Navigate to next gallery item
next: function ( direction ) {
var current = F.current;
if (current) {
if (!isString(direction)) {
direction = current.direction.next;
}
F.jumpto(current.index + 1, direction, 'next');
}
},
// Navigate to previous gallery item
prev: function ( direction ) {
var current = F.current;
if (current) {
if (!isString(direction)) {
direction = current.direction.prev;
}
F.jumpto(current.index - 1, direction, 'prev');
}
},
// Navigate to gallery item by index
jumpto: function ( index, direction, router ) {
var current = F.current;
if (!current) {
return;
}
index = getScalar(index);
F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
F.router = router || 'jumpto';
if (current.loop) {
if (index < 0) {
index = current.group.length + (index % current.group.length);
}
index = index % current.group.length;
}
if (current.group[ index ] !== undefined) {
F.cancel();
F._start(index);
}
},
// Center inside viewport and toggle position type to fixed or absolute if needed
reposition: function (e, onlyAbsolute) {
var current = F.current,
wrap = current ? current.wrap : null,
pos;
if (wrap) {
pos = F._getPosition(onlyAbsolute);
if (e && e.type === 'scroll') {
delete pos.position;
wrap.stop(true, true).animate(pos, 200);
} else {
wrap.css(pos);
current.pos = $.extend({}, current.dim, pos);
}
}
},
update: function (e) {
var type = (e && e.type),
anyway = !type || type === 'orientationchange';
if (anyway) {
clearTimeout(didUpdate);
didUpdate = null;
}
if (!F.isOpen || didUpdate) {
return;
}
didUpdate = setTimeout(function() {
var current = F.current;
if (!current || F.isClosing) {
return;
}
F.wrap.removeClass('fancybox-tmp');
if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
F._setDimension();
}
if (!(type === 'scroll' && current.canShrink)) {
F.reposition(e);
}
F.trigger('onUpdate');
didUpdate = null;
}, (anyway && !isTouch ? 0 : 300));
},
// Shrink content to fit inside viewport or restore if resized
toggle: function ( action ) {
if (F.isOpen) {
F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
// Help browser to restore document dimensions
if (isTouch) {
F.wrap.removeAttr('style').addClass('fancybox-tmp');
F.trigger('onUpdate');
}
F.update();
}
},
hideLoading: function () {
D.unbind('.loading');
$('#fancybox-loading').remove();
},
showLoading: function () {
var el, viewport;
F.hideLoading();
el = $('').click(F.cancel).appendTo('body');
// If user will press the escape-button, the request will be canceled
D.bind('keydown.loading', function(e) {
if ((e.which || e.keyCode) === 27) {
e.preventDefault();
F.cancel();
}
});
if (!F.defaults.fixed) {
viewport = F.getViewport();
el.css({
position : 'absolute',
top : (viewport.h * 0.5) + viewport.y,
left : (viewport.w * 0.5) + viewport.x
});
}
},
getViewport: function () {
var locked = (F.current && F.current.locked) || false,
rez = {
x: W.scrollLeft(),
y: W.scrollTop()
};
if (locked) {
rez.w = locked[0].clientWidth;
rez.h = locked[0].clientHeight;
} else {
// See http://bugs.jquery.com/ticket/6724
rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width();
rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
}
return rez;
},
// Unbind the keyboard / clicking actions
unbindEvents: function () {
if (F.wrap && isQuery(F.wrap)) {
F.wrap.unbind('.fb');
}
D.unbind('.fb');
W.unbind('.fb');
},
bindEvents: function () {
var current = F.current,
keys;
if (!current) {
return;
}
// Changing document height on iOS devices triggers a 'resize' event,
// that can change document height... repeating infinitely
W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
keys = current.keys;
if (keys) {
D.bind('keydown.fb', function (e) {
var code = e.which || e.keyCode,
target = e.target || e.srcElement;
// Skip esc key if loading, because showLoading will cancel preloading
if (code === 27 && F.coming) {
return false;
}
// Ignore key combinations and key events within form elements
if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
$.each(keys, function(i, val) {
if (current.group.length > 1 && val[ code ] !== undefined) {
F[ i ]( val[ code ] );
e.preventDefault();
return false;
}
if ($.inArray(code, val) > -1) {
F[ i ] ();
e.preventDefault();
return false;
}
});
}
});
}
if ($.fn.mousewheel && current.mouseWheel) {
F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
var target = e.target || null,
parent = $(target),
canScroll = false;
while (parent.length) {
if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
break;
}
canScroll = isScrollable( parent[0] );
parent = $(parent).parent();
}
if (delta !== 0 && !canScroll) {
if (F.group.length > 1 && !current.canShrink) {
if (deltaY > 0 || deltaX > 0) {
F.prev( deltaY > 0 ? 'down' : 'left' );
} else if (deltaY < 0 || deltaX < 0) {
F.next( deltaY < 0 ? 'up' : 'right' );
}
e.preventDefault();
}
}
});
}
},
trigger: function (event, o) {
var ret, obj = o || F.coming || F.current;
if (!obj) {
return;
}
if ($.isFunction( obj[event] )) {
ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
}
if (ret === false) {
return false;
}
if (obj.helpers) {
$.each(obj.helpers, function (helper, opts) {
if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
}
});
}
D.trigger(event);
},
isImage: function (str) {
return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
},
isSWF: function (str) {
return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
},
_start: function (index) {
var coming = {},
obj,
href,
type,
margin,
padding;
index = getScalar( index );
obj = F.group[ index ] || null;
if (!obj) {
return false;
}
coming = $.extend(true, {}, F.opts, obj);
// Convert margin and padding properties to array - top, right, bottom, left
margin = coming.margin;
padding = coming.padding;
if ($.type(margin) === 'number') {
coming.margin = [margin, margin, margin, margin];
}
if ($.type(padding) === 'number') {
coming.padding = [padding, padding, padding, padding];
}
// 'modal' propery is just a shortcut
if (coming.modal) {
$.extend(true, coming, {
closeBtn : false,
closeClick : false,
nextClick : false,
arrows : false,
mouseWheel : false,
keys : null,
helpers: {
overlay : {
closeClick : false
}
}
});
}
// 'autoSize' property is a shortcut, too
if (coming.autoSize) {
coming.autoWidth = coming.autoHeight = true;
}
if (coming.width === 'auto') {
coming.autoWidth = true;
}
if (coming.height === 'auto') {
coming.autoHeight = true;
}
/*
* Add reference to the group, so it`s possible to access from callbacks, example:
* afterLoad : function() {
* this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
* }
*/
coming.group = F.group;
coming.index = index;
// Give a chance for callback or helpers to update coming item (type, title, etc)
F.coming = coming;
if (false === F.trigger('beforeLoad')) {
F.coming = null;
return;
}
type = coming.type;
href = coming.href;
if (!type) {
F.coming = null;
//If we can not determine content type then drop silently or display next/prev item if looping through gallery
if (F.current && F.router && F.router !== 'jumpto') {
F.current.index = index;
return F[ F.router ]( F.direction );
}
return false;
}
F.isActive = true;
if (type === 'image' || type === 'swf') {
coming.autoHeight = coming.autoWidth = false;
coming.scrolling = 'visible';
}
if (type === 'image') {
coming.aspectRatio = true;
}
if (type === 'iframe' && isTouch) {
coming.scrolling = 'scroll';
}
// Build the neccessary markup
coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
$.extend(coming, {
skin : $('.fancybox-skin', coming.wrap),
outer : $('.fancybox-outer', coming.wrap),
inner : $('.fancybox-inner', coming.wrap)
});
$.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
});
F.trigger('onReady');
// Check before try to load; 'inline' and 'html' types need content, others - href
if (type === 'inline' || type === 'html') {
if (!coming.content || !coming.content.length) {
return F._error( 'content' );
}
} else if (!href) {
return F._error( 'href' );
}
if (type === 'image') {
F._loadImage();
} else if (type === 'ajax') {
F._loadAjax();
} else if (type === 'iframe') {
F._loadIframe();
} else {
F._afterLoad();
}
},
_error: function ( type ) {
$.extend(F.coming, {
type : 'html',
autoWidth : true,
autoHeight : true,
minWidth : 0,
minHeight : 0,
scrolling : 'no',
hasError : type,
content : F.coming.tpl.error
});
F._afterLoad();
},
_loadImage: function () {
// Reset preload image so it is later possible to check "complete" property
var img = F.imgPreload = new Image();
img.onload = function () {
this.onload = this.onerror = null;
F.coming.width = this.width / F.opts.pixelRatio;
F.coming.height = this.height / F.opts.pixelRatio;
F._afterLoad();
};
img.onerror = function () {
this.onload = this.onerror = null;
F._error( 'image' );
};
img.src = F.coming.href;
if (img.complete !== true) {
F.showLoading();
}
},
_loadAjax: function () {
var coming = F.coming;
F.showLoading();
F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
url: coming.href,
error: function (jqXHR, textStatus) {
if (F.coming && textStatus !== 'abort') {
F._error( 'ajax', jqXHR );
} else {
F.hideLoading();
}
},
success: function (data, textStatus) {
if (textStatus === 'success') {
coming.content = data;
F._afterLoad();
}
}
}));
},
_loadIframe: function() {
var coming = F.coming,
iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
.attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
.attr('src', coming.href);
// This helps IE
$(coming.wrap).bind('onReset', function () {
try {
$(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
} catch (e) {}
});
if (coming.iframe.preload) {
F.showLoading();
iframe.one('load', function() {
$(this).data('ready', 1);
// iOS will lose scrolling if we resize
if (!isTouch) {
$(this).bind('load.fb', F.update);
}
// Without this trick:
// - iframe won't scroll on iOS devices
// - IE7 sometimes displays empty iframe
$(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
F._afterLoad();
});
}
coming.content = iframe.appendTo( coming.inner );
if (!coming.iframe.preload) {
F._afterLoad();
}
},
_preloadImages: function() {
var group = F.group,
current = F.current,
len = group.length,
cnt = current.preload ? Math.min(current.preload, len - 1) : 0,
item,
i;
for (i = 1; i <= cnt; i += 1) {
item = group[ (current.index + i ) % len ];
if (item.type === 'image' && item.href) {
new Image().src = item.href;
}
}
},
_afterLoad: function () {
var coming = F.coming,
previous = F.current,
placeholder = 'fancybox-placeholder',
current,
content,
type,
scrolling,
href,
embed;
F.hideLoading();
if (!coming || F.isActive === false) {
return;
}
if (false === F.trigger('afterLoad', coming, previous)) {
coming.wrap.stop(true).trigger('onReset').remove();
F.coming = null;
return;
}
if (previous) {
F.trigger('beforeChange', previous);
previous.wrap.stop(true).removeClass('fancybox-opened')
.find('.fancybox-item, .fancybox-nav')
.remove();
}
F.unbindEvents();
current = coming;
content = coming.content;
type = coming.type;
scrolling = coming.scrolling;
$.extend(F, {
wrap : current.wrap,
skin : current.skin,
outer : current.outer,
inner : current.inner,
current : current,
previous : previous
});
href = current.href;
switch (type) {
case 'inline':
case 'ajax':
case 'html':
if (current.selector) {
content = $('').html(content).find(current.selector);
} else if (isQuery(content)) {
if (!content.data(placeholder)) {
content.data(placeholder, $('
').insertAfter( content ).hide() );
}
content = content.show().detach();
current.wrap.bind('onReset', function () {
if ($(this).find(content).length) {
content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);
}
});
}
break;
case 'image':
content = current.tpl.image.replace('{href}', href);
break;
case 'swf':
content = '
';
embed = '';
$.each(current.swf, function(name, val) {
content += ' ';
embed += ' ' + name + '="' + val + '"';
});
content += '';
break;
}
if (!(isQuery(content) && content.parent().is(current.inner))) {
current.inner.append( content );
}
// Give a chance for helpers or callbacks to update elements
F.trigger('beforeShow');
// Set scrolling before calculating dimensions
current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
// Set initial dimensions and start position
F._setDimension();
F.reposition();
F.isOpen = false;
F.coming = null;
F.bindEvents();
if (!F.isOpened) {
$('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
} else if (previous.prevMethod) {
F.transitions[ previous.prevMethod ]();
}
F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
F._preloadImages();
},
_setDimension: function () {
var viewport = F.getViewport(),
steps = 0,
canShrink = false,
canExpand = false,
wrap = F.wrap,
skin = F.skin,
inner = F.inner,
current = F.current,
width = current.width,
height = current.height,
minWidth = current.minWidth,
minHeight = current.minHeight,
maxWidth = current.maxWidth,
maxHeight = current.maxHeight,
scrolling = current.scrolling,
scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,
margin = current.margin,
wMargin = getScalar(margin[1] + margin[3]),
hMargin = getScalar(margin[0] + margin[2]),
wPadding,
hPadding,
wSpace,
hSpace,
origWidth,
origHeight,
origMaxWidth,
origMaxHeight,
ratio,
width_,
height_,
maxWidth_,
maxHeight_,
iframe,
body;
// Reset dimensions so we could re-check actual size
wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
wPadding = getScalar(skin.outerWidth(true) - skin.width());
hPadding = getScalar(skin.outerHeight(true) - skin.height());
// Any space between content and viewport (margin, padding, border, title)
wSpace = wMargin + wPadding;
hSpace = hMargin + hPadding;
origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;
origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
if (current.type === 'iframe') {
iframe = current.content;
if (current.autoHeight && iframe.data('ready') === 1) {
try {
if (iframe[0].contentWindow.document.location) {
inner.width( origWidth ).height(9999);
body = iframe.contents().find('body');
if (scrollOut) {
body.css('overflow-x', 'hidden');
}
origHeight = body.outerHeight(true);
}
} catch (e) {}
}
} else if (current.autoWidth || current.autoHeight) {
inner.addClass( 'fancybox-tmp' );
// Set width or height in case we need to calculate only one dimension
if (!current.autoWidth) {
inner.width( origWidth );
}
if (!current.autoHeight) {
inner.height( origHeight );
}
if (current.autoWidth) {
origWidth = inner.width();
}
if (current.autoHeight) {
origHeight = inner.height();
}
inner.removeClass( 'fancybox-tmp' );
}
width = getScalar( origWidth );
height = getScalar( origHeight );
ratio = origWidth / origHeight;
// Calculations for the content
minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
// These will be used to determine if wrap can fit in the viewport
origMaxWidth = maxWidth;
origMaxHeight = maxHeight;
if (current.fitToView) {
maxWidth = Math.min(viewport.w - wSpace, maxWidth);
maxHeight = Math.min(viewport.h - hSpace, maxHeight);
}
maxWidth_ = viewport.w - wMargin;
maxHeight_ = viewport.h - hMargin;
if (current.aspectRatio) {
if (width > maxWidth) {
width = maxWidth;
height = getScalar(width / ratio);
}
if (height > maxHeight) {
height = maxHeight;
width = getScalar(height * ratio);
}
if (width < minWidth) {
width = minWidth;
height = getScalar(width / ratio);
}
if (height < minHeight) {
height = minHeight;
width = getScalar(height * ratio);
}
} else {
width = Math.max(minWidth, Math.min(width, maxWidth));
if (current.autoHeight && current.type !== 'iframe') {
inner.width( width );
height = inner.height();
}
height = Math.max(minHeight, Math.min(height, maxHeight));
}
// Try to fit inside viewport (including the title)
if (current.fitToView) {
inner.width( width ).height( height );
wrap.width( width + wPadding );
// Real wrap dimensions
width_ = wrap.width();
height_ = wrap.height();
if (current.aspectRatio) {
while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
if (steps++ > 19) {
break;
}
height = Math.max(minHeight, Math.min(maxHeight, height - 10));
width = getScalar(height * ratio);
if (width < minWidth) {
width = minWidth;
height = getScalar(width / ratio);
}
if (width > maxWidth) {
width = maxWidth;
height = getScalar(width / ratio);
}
inner.width( width ).height( height );
wrap.width( width + wPadding );
width_ = wrap.width();
height_ = wrap.height();
}
} else {
width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));
height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
}
}
if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
width += scrollOut;
}
inner.width( width ).height( height );
wrap.width( width + wPadding );
width_ = wrap.width();
height_ = wrap.height();
canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
$.extend(current, {
dim : {
width : getValue( width_ ),
height : getValue( height_ )
},
origWidth : origWidth,
origHeight : origHeight,
canShrink : canShrink,
canExpand : canExpand,
wPadding : wPadding,
hPadding : hPadding,
wrapSpace : height_ - skin.outerHeight(true),
skinSpace : skin.height() - height
});
if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
inner.height('auto');
}
},
_getPosition: function (onlyAbsolute) {
var current = F.current,
viewport = F.getViewport(),
margin = current.margin,
width = F.wrap.width() + margin[1] + margin[3],
height = F.wrap.height() + margin[0] + margin[2],
rez = {
position: 'absolute',
top : margin[0],
left : margin[3]
};
if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
rez.position = 'fixed';
} else if (!current.locked) {
rez.top += viewport.y;
rez.left += viewport.x;
}
rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio)));
return rez;
},
_afterZoomIn: function () {
var current = F.current;
if (!current) {
return;
}
F.isOpen = F.isOpened = true;
F.wrap.css('overflow', 'visible').addClass('fancybox-opened');
F.update();
// Assign a click event
if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {
F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
e.preventDefault();
F[ current.closeClick ? 'close' : 'next' ]();
}
});
}
// Create a close button
if (current.closeBtn) {
$(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {
e.preventDefault();
F.close();
});
}
// Create navigation arrows
if (current.arrows && F.group.length > 1) {
if (current.loop || current.index > 0) {
$(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
}
if (current.loop || current.index < F.group.length - 1) {
$(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
}
}
F.trigger('afterShow');
// Stop the slideshow if this is the last item
if (!current.loop && current.index === current.group.length - 1) {
F.play( false );
} else if (F.opts.autoPlay && !F.player.isActive) {
F.opts.autoPlay = false;
F.play();
}
},
_afterZoomOut: function ( obj ) {
obj = obj || F.current;
$('.fancybox-wrap').trigger('onReset').remove();
$.extend(F, {
group : {},
opts : {},
router : false,
current : null,
isActive : false,
isOpened : false,
isOpen : false,
isClosing : false,
wrap : null,
skin : null,
outer : null,
inner : null
});
F.trigger('afterClose', obj);
}
});
/*
* Default transitions
*/
F.transitions = {
getOrigPosition: function () {
var current = F.current,
element = current.element,
orig = current.orig,
pos = {},
width = 50,
height = 50,
hPadding = current.hPadding,
wPadding = current.wPadding,
viewport = F.getViewport();
if (!orig && current.isDom && element.is(':visible')) {
orig = element.find('img:first');
if (!orig.length) {
orig = element;
}
}
if (isQuery(orig)) {
pos = orig.offset();
if (orig.is('img')) {
width = orig.outerWidth();
height = orig.outerHeight();
}
} else {
pos.top = viewport.y + (viewport.h - height) * current.topRatio;
pos.left = viewport.x + (viewport.w - width) * current.leftRatio;
}
if (F.wrap.css('position') === 'fixed' || current.locked) {
pos.top -= viewport.y;
pos.left -= viewport.x;
}
pos = {
top : getValue(pos.top - hPadding * current.topRatio),
left : getValue(pos.left - wPadding * current.leftRatio),
width : getValue(width + wPadding),
height : getValue(height + hPadding)
};
return pos;
},
step: function (now, fx) {
var ratio,
padding,
value,
prop = fx.prop,
current = F.current,
wrapSpace = current.wrapSpace,
skinSpace = current.skinSpace;
if (prop === 'width' || prop === 'height') {
ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
if (F.isClosing) {
ratio = 1 - ratio;
}
padding = prop === 'width' ? current.wPadding : current.hPadding;
value = now - padding;
F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) );
F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
}
},
zoomIn: function () {
var current = F.current,
startPos = current.pos,
effect = current.openEffect,
elastic = effect === 'elastic',
endPos = $.extend({opacity : 1}, startPos);
// Remove "position" property that breaks older IE
delete endPos.position;
if (elastic) {
startPos = this.getOrigPosition();
if (current.openOpacity) {
startPos.opacity = 0.1;
}
} else if (effect === 'fade') {
startPos.opacity = 0.1;
}
F.wrap.css(startPos).animate(endPos, {
duration : effect === 'none' ? 0 : current.openSpeed,
easing : current.openEasing,
step : elastic ? this.step : null,
complete : F._afterZoomIn
});
},
zoomOut: function () {
var current = F.current,
effect = current.closeEffect,
elastic = effect === 'elastic',
endPos = {opacity : 0.1};
if (elastic) {
endPos = this.getOrigPosition();
if (current.closeOpacity) {
endPos.opacity = 0.1;
}
}
F.wrap.animate(endPos, {
duration : effect === 'none' ? 0 : current.closeSpeed,
easing : current.closeEasing,
step : elastic ? this.step : null,
complete : F._afterZoomOut
});
},
changeIn: function () {
var current = F.current,
effect = current.nextEffect,
startPos = current.pos,
endPos = { opacity : 1 },
direction = F.direction,
distance = 200,
field;
startPos.opacity = 0.1;
if (effect === 'elastic') {
field = direction === 'down' || direction === 'up' ? 'top' : 'left';
if (direction === 'down' || direction === 'right') {
startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
endPos[ field ] = '+=' + distance + 'px';
} else {
startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
endPos[ field ] = '-=' + distance + 'px';
}
}
// Workaround for http://bugs.jquery.com/ticket/12273
if (effect === 'none') {
F._afterZoomIn();
} else {
F.wrap.css(startPos).animate(endPos, {
duration : current.nextSpeed,
easing : current.nextEasing,
complete : F._afterZoomIn
});
}
},
changeOut: function () {
var previous = F.previous,
effect = previous.prevEffect,
endPos = { opacity : 0.1 },
direction = F.direction,
distance = 200;
if (effect === 'elastic') {
endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
}
previous.wrap.animate(endPos, {
duration : effect === 'none' ? 0 : previous.prevSpeed,
easing : previous.prevEasing,
complete : function () {
$(this).trigger('onReset').remove();
}
});
}
};
/*
* Overlay helper
*/
F.helpers.overlay = {
defaults : {
closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay
speedOut : 200, // duration of fadeOut animation
showEarly : true, // indicates if should be opened immediately or wait until the content is ready
css : {}, // custom CSS properties
locked : !isTouch, // if true, the content will be locked into overlay
fixed : true // if false, the overlay CSS position property will not be set to "fixed"
},
overlay : null, // current handle
fixed : false, // indicates if the overlay has position "fixed"
el : $('html'), // element that contains "the lock"
// Public methods
create : function(opts) {
opts = $.extend({}, this.defaults, opts);
if (this.overlay) {
this.close();
}
this.overlay = $('
').appendTo( F.coming ? F.coming.parent : opts.parent );
this.fixed = false;
if (opts.fixed && F.defaults.fixed) {
this.overlay.addClass('fancybox-overlay-fixed');
this.fixed = true;
}
},
open : function(opts) {
var that = this;
opts = $.extend({}, this.defaults, opts);
if (this.overlay) {
this.overlay.unbind('.overlay').width('auto').height('auto');
} else {
this.create(opts);
}
if (!this.fixed) {
W.bind('resize.overlay', $.proxy( this.update, this) );
this.update();
}
if (opts.closeClick) {
this.overlay.bind('click.overlay', function(e) {
if ($(e.target).hasClass('fancybox-overlay')) {
if (F.isActive) {
F.close();
} else {
that.close();
}
return false;
}
});
}
this.overlay.css( opts.css ).show();
},
close : function() {
var scrollV, scrollH;
W.unbind('resize.overlay');
if (this.el.hasClass('fancybox-lock')) {
$('.fancybox-margin').removeClass('fancybox-margin');
scrollV = W.scrollTop();
scrollH = W.scrollLeft();
this.el.removeClass('fancybox-lock');
W.scrollTop( scrollV ).scrollLeft( scrollH );
}
$('.fancybox-overlay').remove().hide();
$.extend(this, {
overlay : null,
fixed : false
});
},
// Private, callbacks
update : function () {
var width = '100%', offsetWidth;
// Reset width/height so it will not mess
this.overlay.width(width).height('100%');
// jQuery does not return reliable result for IE
if (IE) {
offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
if (D.width() > offsetWidth) {
width = D.width();
}
} else if (D.width() > W.width()) {
width = D.width();
}
this.overlay.width(width).height(D.height());
},
// This is where we can manipulate DOM, because later it would cause iframes to reload
onReady : function (opts, obj) {
var overlay = this.overlay;
$('.fancybox-overlay').stop(true, true);
if (!overlay) {
this.create(opts);
}
if (opts.locked && this.fixed && obj.fixed) {
if (!overlay) {
this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
}
obj.locked = this.overlay.append( obj.wrap );
obj.fixed = false;
}
if (opts.showEarly === true) {
this.beforeShow.apply(this, arguments);
}
},
beforeShow : function(opts, obj) {
var scrollV, scrollH;
if (obj.locked) {
if (this.margin !== false) {
$('*').filter(function(){
return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
}).addClass('fancybox-margin');
this.el.addClass('fancybox-margin');
}
scrollV = W.scrollTop();
scrollH = W.scrollLeft();
this.el.addClass('fancybox-lock');
W.scrollTop( scrollV ).scrollLeft( scrollH );
}
this.open(opts);
},
onUpdate : function() {
if (!this.fixed) {
this.update();
}
},
afterClose: function (opts) {
// Remove overlay if exists and fancyBox is not opening
// (e.g., it is not being open using afterClose callback)
//if (this.overlay && !F.isActive) {
if (this.overlay && !F.coming) {
this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
}
}
};
/*
* Title helper
*/
F.helpers.title = {
defaults : {
type : 'float', // 'float', 'inside', 'outside' or 'over',
position : 'bottom' // 'top' or 'bottom'
},
beforeShow: function (opts) {
var current = F.current,
text = current.title,
type = opts.type,
title,
target;
if ($.isFunction(text)) {
text = text.call(current.element, current);
}
if (!isString(text) || $.trim(text) === '') {
return;
}
title = $('
' + text + '
');
switch (type) {
case 'inside':
target = F.skin;
break;
case 'outside':
target = F.wrap;
break;
case 'over':
target = F.inner;
break;
default: // 'float'
target = F.skin;
title.appendTo('body');
if (IE) {
title.width( title.width() );
}
title.wrapInner('
');
//Increase bottom margin so this title will also fit into viewport
F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
break;
}
title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target);
}
};
// jQuery plugin initialization
$.fn.fancybox = function (options) {
var index,
that = $(this),
selector = this.selector || '',
run = function(e) {
var what = $(this).blur(), idx = index, relType, relVal;
if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
relType = options.groupAttr || 'data-fancybox-group';
relVal = what.attr(relType);
if (!relVal) {
relType = 'rel';
relVal = what.get(0)[ relType ];
}
if (relVal && relVal !== '' && relVal !== 'nofollow') {
what = selector.length ? $(selector) : that;
what = what.filter('[' + relType + '="' + relVal + '"]');
idx = what.index(this);
}
options.index = idx;
// Stop an event from bubbling if everything is fine
if (F.open(what, options) !== false) {
e.preventDefault();
}
}
};
options = options || {};
index = options.index || 0;
if (!selector || options.live === false) {
that.unbind('click.fb-start').bind('click.fb-start', run);
} else {
D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
}
this.filter('[data-fancybox-start=1]').trigger('click');
return this;
};
// Tests that need a body at doc ready
D.ready(function() {
var w1, w2;
if ( $.scrollbarWidth === undefined ) {
// http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
$.scrollbarWidth = function() {
var parent = $('
').appendTo('body'),
child = parent.children(),
width = child.innerWidth() - child.height( 99 ).innerWidth();
parent.remove();
return width;
};
}
if ( $.support.fixedPosition === undefined ) {
$.support.fixedPosition = (function() {
var elem = $('
').appendTo('body'),
fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
elem.remove();
return fixed;
}());
}
$.extend(F.defaults, {
scrollbarWidth : $.scrollbarWidth(),
fixed : $.support.fixedPosition,
parent : $('body')
});
//Get real width of page scroll-bar
w1 = $(window).width();
H.addClass('fancybox-lock-test');
w2 = $(window).width();
H.removeClass('fancybox-lock-test');
$("").appendTo("head");
});
}(window, document, jQuery));;// END OF /scripts/fancyBox/source/jquery.fancybox.js
// STARTS OF /scripts/fancyBox/source/helpers/jquery.fancybox-thumbs.js
/*!
* Thumbnail helper for fancyBox
* version: 1.0.7 (Mon, 01 Oct 2012)
* @requires fancyBox v2.0 or later
*
* Usage:
* $(".fancybox").fancybox({
* helpers : {
* thumbs: {
* width : 50,
* height : 50
* }
* }
* });
*
*/
(function ($) {
//Shortcut for fancyBox object
var F = $.fancybox;
//Add helper object
F.helpers.thumbs = {
defaults : {
width : 50, // thumbnail width
height : 50, // thumbnail height
position : 'bottom', // 'top' or 'bottom'
source : function ( item ) { // function to obtain the URL of the thumbnail image
var href;
if (item.element) {
href = $(item.element).find('img').attr('src');
}
if (!href && item.type === 'image' && item.href) {
href = item.href;
}
return href;
}
},
wrap : null,
list : null,
width : 0,
init: function (opts, obj) {
var that = this,
list,
thumbWidth = opts.width,
thumbHeight = opts.height,
thumbSource = opts.source;
//Build list structure
list = '';
for (var n = 0; n < obj.group.length; n++) {
list += '
';
}
this.wrap = $('
').addClass(opts.position).appendTo('body');
this.list = $('
').appendTo(this.wrap);
//Load each thumbnail
$.each(obj.group, function (i) {
var href = thumbSource( obj.group[ i ] );
if (!href) {
return;
}
$("
").load(function () {
var width = this.width,
height = this.height,
widthRatio, heightRatio, parent;
if (!that.list || !width || !height) {
return;
}
//Calculate thumbnail width/height and center it
widthRatio = width / thumbWidth;
heightRatio = height / thumbHeight;
parent = that.list.children().eq(i).find('a');
if (widthRatio >= 1 && heightRatio >= 1) {
if (widthRatio > heightRatio) {
width = Math.floor(width / heightRatio);
height = thumbHeight;
} else {
width = thumbWidth;
height = Math.floor(height / widthRatio);
}
}
$(this).css({
width : width,
height : height,
top : Math.floor(thumbHeight / 2 - height / 2),
left : Math.floor(thumbWidth / 2 - width / 2)
});
parent.width(thumbWidth).height(thumbHeight);
$(this).hide().appendTo(parent).fadeIn(300);
}).attr('src', href);
});
//Set initial width
this.width = this.list.children().eq(0).outerWidth(true);
this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));
},
beforeLoad: function (opts, obj) {
//Remove self if gallery do not have at least two items
if (obj.group.length < 2) {
obj.helpers.thumbs = false;
return;
}
//Increase bottom margin to give space for thumbs
obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
},
afterShow: function (opts, obj) {
//Check if exists and create or update list
if (this.list) {
this.onUpdate(opts, obj);
} else {
this.init(opts, obj);
}
//Set active element
this.list.children().removeClass('active').eq(obj.index).addClass('active');
},
//Center list
onUpdate: function (opts, obj) {
if (this.list) {
this.list.stop(true).animate({
'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
}, 150);
}
},
beforeClose: function () {
if (this.wrap) {
this.wrap.remove();
}
this.wrap = null;
this.list = null;
this.width = 0;
}
}
}(jQuery));;// END OF /scripts/fancyBox/source/helpers/jquery.fancybox-thumbs.js
// STARTS OF /share/imagesloaded.pkgd.min.js
/*!
* imagesLoaded PACKAGED v3.2.0
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
(function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,s=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t
h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;be;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a){function b(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function c(){}function d(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0}return a}function e(c){function e(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||f("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=c("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var g=document.body||document.documentElement;g.appendChild(e);var h=j(e);l=200===b(h.width),g.removeChild(e)}}}function h(a){if(e(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var c=j(a);if("none"===c.display)return d();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var h=f.isBorderBox=!(!k||!c[k]||"border-box"!==c[k]),m=0,n=g.length;n>m;m++){var o=g[m],p=c[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q}var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=h&&l,y=b(c.width);y!==!1&&(f.width=y+(x?0:r+v));var z=b(c.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}}function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c}var j,k,l,m=!1;return h}var f="undefined"==typeof console?c:function(a){console.error(a)},g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property")):a.getSize=e(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()}function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b}var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){function b(a,b){return a[g](b)}function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}function e(a,d){return c(a),b(a,d)}var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c}var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue}var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={},a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){function f(a){for(var b in a)return!1;return b=null,!0}function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}function h(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}var i=a.getComputedStyle,j=i?function(a){return i(a,null)}:function(a){return a.currentStyle},k=d("transition"),l=d("transform"),m=k&&l,n=!!d("perspective"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[k],p=["transform","transition","transitionDuration","transitionProperty"],q=function(){for(var a={},b=0,c=p.length;c>b;b++){var e=p[b],f=d(e);f&&f!==e&&(a[e]=f)}return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=q[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=j(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=a[c?"left":"right"],f=a[d?"top":"bottom"],g=this.layout.size,h=-1!=e.indexOf("%")?parseFloat(e)/100*g.width:parseInt(e,10),i=-1!=f.indexOf("%")?parseFloat(f)/100*g.height:parseInt(f,10);h=isNaN(h)?0:h,i=isNaN(i)?0:i,h-=c?g.paddingLeft:g.paddingRight,i-=d?g.paddingTop:g.paddingBottom,this.position.x=h,this.position.y=i},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left":"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];c[e]=this.getXValue(g),c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];c[i]=this.getYValue(k),c[j]="",this.css(c),this.emitEvent("layout",[this])},g.prototype.getXValue=function(a){var b=this.layout.options;return b.percentPosition&&!b.isHorizontal?a/this.layout.size.width*100+"%":a+"px"},g.prototype.getYValue=function(a){var b=this.layout.options;return b.percentPosition&&b.isHorizontal?a/this.layout.size.height*100+"%":a+"px"},g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={};j.transform=this.getTranslate(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.getTranslate=function(a,b){var c=this.layout.options;return a=c.isOriginLeft?a:-a,b=c.isOriginTop?b:-b,n?"translate3d("+a+"px, "+b+"px, 0)":"translate("+a+"px, "+b+"px)"},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=m?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r="opacity,"+h(q.transform||"transform");g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(o,this,!1))},g.prototype.transition=g.prototype[k?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]}this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!k||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()}var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)}this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.dispatchEvent(a+"Complete",null,[b])}function d(){g++,g===f&&c()}var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.dispatchEvent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitEvent(a,d),i)if(this.$element=this.$element||i(this.element),b){var e=i.Event(b);e.type=a,this.$element.trigger(e,c)}else this.$element.trigger(a,c)},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)}return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]},g.create=function(a,b){function c(){g.apply(this,arguments)}return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d});;// END OF /share/masonry.pkgd.min.js
// STARTS OF /scripts/imgdelayload.js
//是å¦ä¸ºie,并读出ie版本
window.isIE = !! navigator.userAgent.match(/MSIE\b\s*([0-9]\.[0-9]);/img);
window.isIE && (window.isIE = RegExp.$1);
window.delayImages = [];
window.delayScroll = function(){
try{
//是å¦ä¸ºchrome
var isGoo = !! navigator.userAgent.match(/AppleWebKit\b/img);
//获得å¯ä»¥è§¦å‘scroll事件的对象
var box = window.isIE ? document.documentElement : document;
//读å–滚动æ¡çš„ä½ç½®å’Œæµè§ˆå™¨çª—å£çš„显示大å°
var doctop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
left = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft,
width = document.documentElement.clientWidth,
height = document.documentElement.clientHeight;
//对所有图片进行批é‡åˆ¤æ–是å¦åœ¨æµè§ˆå™¨æ˜¾ç¤ºåŒºåŸŸå†…
for (var i = 0; i < window.delayImages.length; i++) {
var _top = $(window.delayImages[i]).offset().top,
_left = $(window.delayImages[i]).offset().left;
//判æ–图片是å¦åœ¨æ˜¾ç¤ºåŒºåŸŸå†…,有50个åƒç´ çš„å移是为了æå‰é¢„åŠ è½½
//(_top + 100 >= doctop && _left >= left && _top - 100 <= doctop + height && _left <= left + width)
//当图片是居ä¸å¯¹é½æ—¶ï¼Œå› 为loading图很å°ï¼Œè€Œå›¾ç‰‡çš„父框å¯èƒ½æ¯”较大,这里拿到的 _left > left + width,导致图片永远ä¸èƒ½è¢«åŠ è½½,æš‚æ—¶ä¸é™åˆ¶æ¨ªå‘宽度,
//è¿™æ ·ä¼šå¯¼è‡´æœ‰æ¨ªå‘滚动æ¡æ—¶ï¼Œå½“拖动到å¦ä¸€ä½ç½®æ—¶ï¼Œå³ä¾§çš„æ‰€æœ‰å›¾ç‰‡éƒ½ä¼šè¢«åŠ è½½ï¼Œä½†å¾ˆå°‘ç½‘ç«™æœ‰æ¨ªå‘滚动æ¡ï¼Œå…ˆä¸ç®¡äº†
var needshow = _top == 0; //一般图片在滚动组件内的情况(如新闻,产å“ç‰çš„滚动显示
needshow |= (_top + 100 >= doctop && _left >= left && _top - 100 <= doctop + height); //图片在å¯è§†åŒºåŸŸçš„情况
needshow |= doctop + height + 400 > $(document).height(); //拖动到页底的情况,ç†æƒ³æƒ…况下其实ä¸éœ€è¦è¿™è¡Œï¼Œå› 为ç†è®ºä¸Š doctop + height == $(document).height(),但在手机上实际获å–到的scroll好åƒæœ‰ç‚¹é—®é¢˜ï¼Œæ‰€ä»¥+500
if (needshow){
var _src = window.delayImages[i].getAttribute('_src');
var _images = $("img[_src='"+_src+"']"); //有些图片对象是事åŽé€šè¿‡è„šæœ¬å¤åˆ¶æ¥çš„,é‡æ–°èŽ·å–下这个图片,ä¿è¯æµè§ˆå™¨èƒ½æ‰¾åˆ°è¿™ä¸ªå¯¹è±¡
for(var k = 0;k < _images.length;k++){
//如果图片已ç»æ˜¾ç¤ºï¼Œåˆ™å–消赋值
if (_src && $(_images[k]).attr('src') !== _src && (_top == 0 || $(_images[k]).is(":visible"))) {
$(_images[k]).attr('src',_src);
$(_images[k]).css('background','none');
}
}
}
}
}catch(e){
console.log('imgdelayload.js',e);
}
}
function check_webp_feature(feature, callback) {
var kTestImages = {
lossy: "UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",
lossless: "UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",
alpha: "UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",
animation: "UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"
};
var img = new Image();
img.onload = function () {
var result = (img.width > 0) && (img.height > 0);
callback(feature, result);
};
img.onerror = function () {
callback(feature, false);
};
img.src = "data:image/webp;base64," + kTestImages[feature];
}
window.supportWebp = false;
check_webp_feature('alpha',function(feature,result){ window.supportWebp = result;});
function delayload(option){
if(window.nodelayimg) return; //H5站混åˆé™æ€å’Œè‡ªç”±æ¨¡å—时,ä¸èƒ½ä½¿ç”¨å›¾ç‰‡å»¶æ—¶åŠ è½½ï¼Œå› ä¸ºå›¾ç‰‡å»¶æ—¶åŠ è½½ä¼šæ”¹å˜é¡µé¢çš„高度
delayload2(option);
}
function delayload2(option){
if(window.isIE) return; //IE支æŒä¸å¥½ï¼ŒIEå…ˆä¸å¯ç”¨å»¶æ—¶åŠ è½½
//å›¾ç‰‡æœªåŠ è½½æ—¶æ˜¾ç¤ºçš„å›¾ç‰‡
var src = option.src ? option.src : '';
var bgsrc = option.bgsrc ? option.bgsrc : '';
//指定那些id下的imgå…ƒç´ ä½¿ç”¨å»¶è¿Ÿæ˜¾ç¤º
var id = option.id ? option.id : [];
//获得所有的图片元ç´
window.delayImages = [];
var top = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
var width = document.documentElement.clientWidth;
var height = document.documentElement.clientHeight;
for (var i = 0; i < id.length; i++) {
var idbox = document.getElementById(id[i]),_imgs;
if (idbox && (_imgs = idbox.getElementsByTagName('img'))) {
for (var t = 0; t < _imgs.length; t++) {
if($(_imgs[t])[0].outerHTML.indexOf(src) > -1) continue; //é¿å…与 mod_pagespeed 冲çª
//window.delayImages.push(_imgs[t]);
var _top = $(_imgs[t]).offset().top;
var _showed = _top + 50 >= top && _top - 50 <= top + height;
if(_showed) continue;
var flag = true;
var m = $(_imgs[t]).closest(".ModuleItem");
if(m && (m.html() + "").toLowerCase().indexOf("slide") > -1) flag = false; //忽略幻ç¯ç‰‡æ¨¡å—
if(m && m.find(".ProductList").length > 0 && m.find(".ProductList[showstyle=1]").length > 0 ) flag = false; //è½®æ’的产å“列表模å—判æ–图片ä½ç½®æœ‰é—®é¢˜ï¼Œå…ˆå¿½ç•¥
if(m && m.find(".ModuleSiteGallery").length > 0 && m.find(".grid-item").length > 0 ) flag = false; //相册模å—判æ–图片ä½ç½®æœ‰é—®é¢˜ï¼Œå…ˆå¿½ç•¥
if($(_imgs[t]).attr('nodelay') == '1') flag = false; //å›¾ç‰‡æ·»åŠ äº†ä¸å»¶æ—¶çš„属性
if($(_imgs[t]).attr('src').indexOf('c=validatecode') > -1) flag = false; //验è¯ç 图片ä¸ä½œå¤„ç†
if(flag){
window.delayImages.push(_imgs[t]);
}
}
}
}
//将所有的图片设置为指定的loading图片
for (var i = 0; i < window.delayImages.length; i++) {
//图片本æ¥çš„图片路径放入_srcä¸
var osrc = window.delayImages[i].src;
if($(window.delayImages[i]).attr('data-pagespeed-lazy-src')) osrc = $(window.delayImages[i]).attr('data-pagespeed-lazy-src'); //é¿å…与 mod_pagespeed 冲çª
if(window.supportWebp && isPlatformVersion == '1' && osrc.indexOf('?') == -1 && osrc.indexOf("comdata/") > -1 && /\.(jpg|jpeg|png)$/i.test(osrc)){
//osrc += ".webp"; //共享目录的时候,对这个支æŒä¸å¥½ï¼ˆä¼šå‡ºçŽ° IIS çš„ Rewrite Module 错误,实际上是IIS的问题)
}
window.delayImages[i].setAttribute('_src', osrc);
window.delayImages[i].style.background = 'url('+src+') center center no-repeat'; //loading图用背景æ¥å¤„ç†
window.delayImages[i].src = bgsrc; //放个é€æ˜Žçš„图æ¥å ä½
//这里è¦åŠ 一个onload事件处ç†äº§å“模å—çš„å“应å¼é—®é¢˜å’Œæ³½å½¬åšçš„产å“图片效果
if($.fn.masonry) $(window.delayImages[i]).on('load',function(){$('.masonry-container,.gallery-list').masonry()});
}
var load = new Image();
load.src = src;
load.onload = function() {
delayScroll();
};
$(window).on("scroll",function (){delayScroll();});
$(window).load(function (){delayScroll();});
$('body')[0].addEventListener("DOMSubtreeModified", function (ev) {
//å…¼å®¹æ–‡ç« åˆ—è¡¨ 滚动公告的效果 如果ä¸å»¶è¿Ÿæ‰§è¡Œ chrome ä¼šæŠŠæ–‡ç« åˆ—è¡¨å¼ºåˆ¶æ»šåŠ¨åˆ°å¯è§†åŒºåŸŸçš„行为
if(window.delaytimer) clearTimeout(window.delaytimer);
window.delaytimer = setTimeout(function(){delayScroll();},500);
}, false);
}
/*delayload({
id: ['pagebody'],
src: 'http://h560.72dns.net/images/loading2.gif'
});*/;// END OF /scripts/imgdelayload.js
// STARTS OF /share/RulersGuides/RulersGuides.js
function RulersGuides(){
if($('#RulersGuides').length > 0){
var $this = $('#RulersGuides');
topRulers = $('.Rulers.top', $this),
rightRulers = $('.Rulers.right', $this);
}else{
var $this = $('');
topRulers = $('
'),
rightRulers = $('
'),
scaleNumberObj = $('
');
$('body').prepend($this.prepend(topRulers).prepend(rightRulers));
var bHeight = document.body.scrollHeight,
dHeight = document.documentElement.scrollHeight;
rightRulers.height(Math.max(bHeight, dHeight));
var j = jj = i = scaleNumber = 0;
j = topRulers.width()/100;
jj = rightRulers.height()/100;
for(; i < Math.max(j,jj); i++){
scaleNumber = i * 100;
if(i < j) topRulers.append(scaleNumberObj.clone().css('left', scaleNumber+3).html(scaleNumber));
if(i < jj) rightRulers.append(scaleNumberObj.clone().css('top', scaleNumber+3).html(scaleNumber));
}
}
topRulers.click(function(event){
var y = $('
');
$this.append(y);
y.append('
');
y.css('left', event.pageX);
y.draggable({
axis: "x",
drag: function(event, ui){
if(ui.offset.left >= topRulers.width() - 20){
ui.helper.remove();
}
}
});
y.dblclick(function(){
$(this).remove();
});
});
rightRulers.click(function(event){
var x = $('
');
$this.append(x);
x.append('
');
x.css('top', event.pageY);
x.draggable({
axis: "y",
drag: function(event, ui){
if(ui.offset.top <= 20){
ui.helper.remove();
}
}
});
x.dblclick(function(){
$(this).remove();
});
});
this.show = function(){
$this.show();
};
this.getTopRulersHeight = function(){
if($this.css("display") != "none") return topRulers.height();
else return 0;
}
this.toggle = function(callback,callbackargs){
if($this.css("display") == "none") $this.show();
else $this.hide();
if(callback) callback.apply(null,callbackargs ? callbackargs : new Array());
}
this.setTopRulersTop = function(val){
topRulers.css({"left":"0","position": "relative", "top": val + "px" });
}
this.hide = function(){
$this.hide();
};
$this.hide();
try{
$( ".block" ).draggable( "option", "snap", ".line" );
}catch(e){
}
};;// END OF /share/RulersGuides/RulersGuides.js
addScript('/framework/ref/scripts/jquery.ajaxfileupload.js',null,true);
addScript('/scripts/cityselect/Region.js',null,true);
addScript('/share/datetimepicker/jquery.datetimepicker.js',null,true);