﻿
/*! Search */
function SiteSearchkwf(a) { var b = $.trim($(a).val()); 0 < b.length && "\u8f93\u5165\u5173\u5065\u5b57" != b && (window.location.href = "/search_" + encodeURI($(a).val()) + ".html"); return !1 };

/*! WJDH Message 1.0  */
$(function(){$("#wjdh-message").click(function(b){$.get("/message.html",function(a){$("body").append(a)})});$(".wjdh-message .close").click(function(){$(".wjdh-message").remove()})});

/*! WJDH Lazy Load 1.0  */
(function (c, e, h, k) { var f = c(e); c.fn.lazyload = function (a) { function b() { var a = 0; g.each(function () { var b = c(this); 0 == b.offset().top && (b.trigger("appear"), a = 0); if (!d.skip_invisible || b.is(":visible")) if (!c.belowthefold(this, d) && !c.abovethetop(this, d)) b.trigger("appear"), a = 0; else if (++a > d.failure_limit) return !1 }) } var g = this, d = { threshold: 0, failure_limit: 999, event: "scroll", effect: "fadeIn", container: e, data_attribute: "src", skip_invisible: !1, appear: null, load: null, placeholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" }; a && (void 0 !== a.failurelimit && (a.failure_limit = a.failurelimit, delete a.failurelimit), void 0 !== a.effectspeed && (a.effect_speed = a.effectspeed, delete a.effectspeed), c.extend(d, a)); a = void 0 === d.container || d.container === e ? f : c(d.container); 0 === d.event.indexOf("scroll") && a.bind(d.event, function () { return b() }); this.each(function () { var a = this, b = c(a); a.loaded = !1; (void 0 === b.attr("src") || !1 === b.attr("src")) && b.is("img") && b.attr("src", d.placeholder); b.one("appear", function () { this.loaded || (d.appear && d.appear.call(a, g.length, d), c("<img />").bind("load", function () { var e = b.attr("data-" + d.data_attribute); b.hide(); b.is("img") ? b.attr("src", e) : b.css("background-image", "url('" + e + "')"); b[d.effect](d.effect_speed); a.loaded = !0; e = c.grep(g, function (a) { return !a.loaded }); g = c(e); d.load && d.load.call(a, g.length, d) }).attr("src", b.attr("data-" + d.data_attribute))) }); 0 !== d.event.indexOf("scroll") && b.bind(d.event, function () { a.loaded || b.trigger("appear") }) }); f.bind("resize", function () { b() }); /(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion) && f.bind("pageshow", function (a) { a.originalEvent && a.originalEvent.persisted && g.each(function () { c(this).trigger("appear") }) }); c(h).ready(function () { b() }); return this }; c.belowthefold = function (a, b) { return (void 0 === b.container || b.container === e ? (e.innerHeight ? e.innerHeight : f.height()) + f.scrollTop() : c(b.container).offset().top + c(b.container).height()) <= c(a).offset().top - b.threshold }; c.rightoffold = function (a, b) { return (void 0 === b.container || b.container === e ? f.width() + f.scrollLeft() : c(b.container).offset().left + c(b.container).width()) <= c(a).offset().left - b.threshold }; c.abovethetop = function (a, b) { return (void 0 === b.container || b.container === e ? f.scrollTop() : c(b.container).offset().top) >= c(a).offset().top + b.threshold + c(a).height() }; c.leftofbegin = function (a, b) { return (void 0 === b.container || b.container === e ? f.scrollLeft() : c(b.container).offset().left) >= c(a).offset().left + b.threshold + c(a).width() }; c.inviewport = function (a, b) { return !c.rightoffold(a, b) && !c.leftofbegin(a, b) && !c.belowthefold(a, b) && !c.abovethetop(a, b) }; c.extend(c.expr[":"], { "below-the-fold": function (a) { return c.belowthefold(a, { threshold: 0 }) }, "above-the-top": function (a) { return !c.belowthefold(a, { threshold: 0 }) }, "right-of-screen": function (a) { return c.rightoffold(a, { threshold: 0 }) }, "left-of-screen": function (a) { return !c.rightoffold(a, { threshold: 0 }) }, "in-viewport": function (a) { return c.inviewport(a, { threshold: 0 }) }, "above-the-fold": function (a) { return !c.belowthefold(a, { threshold: 0 }) }, "right-of-fold": function (a) { return c.rightoffold(a, { threshold: 0 }) }, "left-of-fold": function (a) { return !c.rightoffold(a, { threshold: 0 }) } }) })(jQuery, window, document); $(function () { $("img").lazyload({}) });

/*导航吸顶*/
$(function(){var $nav=$('#fixedNav');var $top = $nav.offset().top;if($nav.length!=-1){$(window).scroll(function(){if($(window).scrollTop()>=$top){$("#fixedNav").addClass("fixedNav")}else{$("#fixedNav").removeClass("fixedNav")}})}});
