
//延迟
(function($) {
	$.fn.lazyload = function(options) {
		var settings = {
			threshold: 0,
			failurelimit: 0,
			event: "scroll",
			effect: "show",
			container: window
		};
		if (options) {
			$.extend(settings, options)
		}
		var elements = this;
		if ("scroll" == settings.event) {
			$(settings.container).bind("scroll", function(event) {
				var counter = 0;
				elements.each(function() {
					if ($.abovethetop(this, settings) || $.leftofbegin(this, settings)) {} else if (!$.belowthefold(this, settings) && !$.rightoffold(this, settings)) {
						$(this).trigger("appear")
					} else {
						if (counter++ > settings.failurelimit) {
							return false
						}
					}
				});
				var temp = $.grep(elements, function(element) {
					return !element.loaded
				});
				elements = $(temp)
			})
		}
		this.each(function() {
			var self = this;
			if (undefined == $(self).attr("original")) {
				$(self).attr("original", $(self).attr("src"))
			}
			if ("scroll" != settings.event || undefined == $(self).attr("src") || settings.placeholder == $(self).attr("src") || ($.abovethetop(self, settings) || $.leftofbegin(self, settings) || $.belowthefold(self, settings) || $.rightoffold(self, settings))) {
				if (settings.placeholder) {
					$(self).attr("src", settings.placeholder)
				} else {
					$(self).removeAttr("src")
				}
				self.loaded = false
			} else {
				self.loaded = true
			}
			$(self).one("appear", function() {
				if (!this.loaded) {
					$("<img />").bind("load", function() {
						$(self).hide().attr("src", $(self).attr("original"))[settings.effect](settings.effectspeed);
						self.loaded = true
					}).attr("src", $(self).attr("original"))
				}
			});
			if ("scroll" != settings.event) {
				$(self).bind(settings.event, function(event) {
					if (!self.loaded) {
						$(self).trigger("appear")
					}
				})
			}
		});
		$(settings.container).trigger(settings.event);
		return this
	};
	$.belowthefold = function(element, settings) {
		if (settings.container === undefined || settings.container === window) {
			var fold = $(window).height() + $(window).scrollTop()
		} else {
			var fold = $(settings.container).offset().top + $(settings.container).height()
		}
		return fold <= $(element).offset().top - settings.threshold
	};
	$.rightoffold = function(element, settings) {
		if (settings.container === undefined || settings.container === window) {
			var fold = $(window).width() + $(window).scrollLeft()
		} else {
			var fold = $(settings.container).offset().left + $(settings.container).width()
		}
		return fold <= $(element).offset().left - settings.threshold
	};
	$.abovethetop = function(element, settings) {
		if (settings.container === undefined || settings.container === window) {
			var fold = $(window).scrollTop()
		} else {
			var fold = $(settings.container).offset().top
		}
		return fold >= $(element).offset().top + settings.threshold + $(element).height()
	};
	$.leftofbegin = function(element, settings) {
		if (settings.container === undefined || settings.container === window) {
			var fold = $(window).scrollLeft()
		} else {
			var fold = $(settings.container).offset().left
		}
		return fold >= $(element).offset().left + settings.threshold + $(element).width()
	};
	$.extend($.expr[':'], {
		"below-the-fold": "$.belowthefold(a, {threshold : 0, container: window})",
		"above-the-fold": "!$.belowthefold(a, {threshold : 0, container: window})",
		"right-of-fold": "$.rightoffold(a, {threshold : 0, container: window})",
		"left-of-fold": "!$.rightoffold(a, {threshold : 0, container: window})"
	})
})(jQuery);
$(function() {
	$(".post_box img,.entry img,.cms-post img,.shop_main img,.related-item img").lazyload({
		
		effect: "fadeIn",
		threshold: 2,
		failurelimit: 5
	})
});
jQuery(document).ready(function() {
	var nav = $(".nav-sousuo");
	$("#mo-so").click(function() {
		$(".mini_search").slideToggle()
	})
});
jQuery(document).ready(function() {
	var nav = $(".mobile_aside");
	$(".nav-sjlogo i").click(function() {
		$(".mobile_aside").slideToggle(), $(".header-nav").removeClass("header-nav"), $(".sub-menu").toggleClass("m-sub-menu")
	})
});
jQuery(document).ready(function() {
	jQuery(".mobile-menu .nav-pills > li").each(function() {
		jQuery(this).children(".mobile-menu .m-sub-menu").not(".active").css('display', 'none');
		jQuery(this).children(".mobile-menu .toggle-btn").bind("click", function() {
			$('.mobile-menu .m-sub-menu').addClass('active');
			jQuery(this).children().addClass(function() {
				if (jQuery(this).hasClass("active")) {
					jQuery(this).removeClass("active");
					return ""
				}
				return "active"
			});
			jQuery(this).siblings(".mobile-menu .m-sub-menu").slideToggle()
		})
	})
});
jQuery(document).ready(function($) {
	$('#font-change span').click(function() {
		var selector = '.entry p';
		var increment = 1;
		var font_size = 15;
		var fs_css = $(selector).css('fontSize');
		var fs_css_c = parseFloat(fs_css, 10);
		var fs_unit = fs_css.slice(-2);
		var id = $(this).attr('id');
		switch (id) {
		case 'font-dec':
			fs_css_c -= increment;
			break;
		case 'font-inc':
			fs_css_c += increment;
			break;
		default:
			fs_css_c = font_size
		}
		$(selector).css('fontSize', fs_css_c + fs_unit);
		return false
	})
});
jQuery(document).ready(function($) {
	var datatype = $(".header-nav").attr("data-type");
	$("#backTop").hide();
	$('.nav-sjlogo i').click(function() {
		$('.home').toggleClass('navbar-on')
	});
	$('.nav-sjlogo i').click(function() {
		$('.nav-sjlogo i').toggleClass('active')
	});
	$('.r-hide a').click(function() {
		$('.site-content').toggleClass('primary')
	});
	$("#tab li").click(function() {
		$(this).addClass("tabhover").siblings().removeClass("tabhover");
		var index = $(this).index();
		$("#con_one ul").eq(index).fadeIn(500).siblings().hide()
	});
	$(".nav-pills>li ").each(function() {
		try {
			var myid = $(this).attr("id");
			if ("index" == datatype) {
				if (myid == "nvabar-item-index") {
					$("#nvabar-item-index a:first-child").addClass("on")
				}
			} else if ("category" == datatype) {
				var infoid = $(".header-nav").attr("data-infoid");
				if (infoid != null) {
					var b = infoid.split(' ');
					for (var i = 0; i < b.length; i++) {
						if (myid == "navbar-category-" + b[i]) {
							$("#navbar-category-" + b[i] + " a:first-child").addClass("on")
						}
					}
				}
			} else if ("article" == datatype) {
				var infoid = $(".header-nav").attr("data-infoid");
				if (infoid != null) {
					var b = infoid.split(' ');
					for (var i = 0; i < b.length; i++) {
						if (myid == "navbar-category-" + b[i]) {
							$("#navbar-category-" + b[i] + " a:first-child").addClass("on")
						}
					}
				}
			} else if ("page" == datatype) {
				var infoid = $(".header-nav").attr("data-infoid");
				if (infoid != null) {
					if (myid == "navbar-page-" + infoid) {
						$("#navbar-page-" + infoid + " a:first-child").addClass("on")
					}
				}
			} else if ("tag" == datatype) {
				var infoid = $(".header-nav").attr("data-infoid");
				if (infoid != null) {
					if (myid == "navbar-tag-" + infoid) {
						$("#navbar-tag-" + infoid + " a:first-child").addClass("on")
					}
				}
			}
		} catch (E) {}
	});
	$(".header-nav").delegate("a", "click", function() {
		$(".nav-pills>li a").each(function() {
			$(this).removeClass("on")
		});
		if ($(this).closest("ul") != null && $(this).closest("ul").length != 0) {
			if ($(this).closest("ul").attr("id") == "menu-navigation") {
				$(this).addClass("on")
			} else {
				$(this).closest("ul").closest("li").find("a:first-child").addClass("on")
			}
		}
	})
});
$.fn.extend({
	scrollFollow: function(d) {
		d = d || {};
		d.container = d.container || $(this).parent();
		d.bottomObj = d.bottomObj || '';
		d.bottomMargin = d.bottomMargin || 0;
		d.marginTop = d.marginTop || 0;
		d.marginBottom = d.marginBottom || 0;
		d.zindex = d.zindex || 0;
		var e = $(window);
		var f = $(this);
		if (f.length <= 0) {
			return false
		}
		var g = f.position().top;
		var h = d.container.height();
		var i = f.css("position");
		if (d.bottomObj == '' || $(d.bottomObj).length <= 0) {
			var j = false
		} else {
			var j = true
		}
		e.scroll(function(a) {
			var b = f.height();
			if (f.css("position") == i) {
				g = f.position().top
			}
			scrollTop = e.scrollTop();
			topPosition = Math.max(0, g - scrollTop);
			if (j == true) {
				var c = $(d.bottomObj).position().top - d.marginBottom - d.marginTop;
				topPosition = Math.min(topPosition, (c - scrollTop) - b)
			}
			if (scrollTop > g) {
				if (j == true && (g + b > c)) {
					f.css({
						position: i,
						top: g
					})
				} else {
					if (window.XMLHttpRequest) {
						f.css({
							position: "fixed",
							top: topPosition + d.marginTop,
							'z-index': d.zindex
						})
					} else {
						f.css({
							position: "absolute",
							top: scrollTop + topPosition + d.marginTop + 'px',
							'z-index': d.zindex
						})
					}
				}
			} else {
				f.css({
					position: i,
					top: g
				})
			}
		});
		return this
	}
});
$(document).ready(function() {
	$(".sidebar-right .movead").scrollFollow({
		bottomObj: '.footer',
		marginTop: 88,
		marginBottom: 32
	})
});
(function() {
	var sc = $(document);
	var tags_a = $("#divTags ul li,#hottags ul li");
	tags_a.each(function() {
		var x = 10;
		var y = 0;
		var rand = parseInt(Math.random() * (x - y + 1) + y);
		$(this).addClass("divTags" + rand)
	})
})();

function autoScroll(obj) {
	$('#callboard').find("ul").animate({
		marginTop: "-29px"
	}, 600, function() {
		$(this).css({
			marginTop: "0px"
		}).find("li:first").appendTo(this)
	})
}
$(function() {
	setInterval('autoScroll("#callboard")', 5000)
});
$("<i class='fa fa-plus-square'></i>").insertBefore("#divPrevious ul li a");
$("<span class='toggle-btn'><i class='fa fa-plus'></i></span>").insertBefore(".sub-menu");
$("#tabcelan,#shangxi,#post_box1,#post_box2,#post_box3").removeClass("wow");
$("#tabcelan,#shangxi,#post_box1,#post_box2,#post_box3").removeClass("fadeInDown");
$(function() {
	var nav = $("#header");
	var win = $(window);
	var sc = $(document);
	win.scroll(function() {
		if (sc.scrollTop() >= 31) {
			nav.addClass("fixednav");
			$(".navTmp").fadeIn()
		} else {
			nav.removeClass("fixednav");
			$(".navTmp").fadeOut()
		}
	})
});
$(document).keypress(function(e) {
	var s = $('.button');
	if (e.ctrlKey && e.which == 13 || e.which == 10) {
		s.click();
		document.body.focus();
		return
	}
	if (e.shiftKey && e.which == 13 || e.which == 10) s.click()
});
$(function() {
	$("#backtop").each(function() {
		$(this).find(".weixin").mouseenter(function() {
			$(this).find(".pic").fadeIn("fast")
		});
		$(this).find(".weixin").mouseleave(function() {
			$(this).find(".pic").fadeOut("fast")
		});
		$(this).find(".phone").mouseenter(function() {
			$(this).find(".phones").fadeIn("fast")
		});
		$(this).find(".phone").mouseleave(function() {
			$(this).find(".phones").fadeOut("fast")
		});
		$(this).find(".top").click(function() {
			$("html, body").animate({
				"scroll-top": 0
			}, "fast")
		})
	});
	var lastRmenuStatus = false;
	$(window).scroll(function() {
		var _top = $(window).scrollTop();
		if (_top > 500) {
			$("#backtop").data("expanded", true)
		} else {
			$("#backtop").data("expanded", false)
		}
		if ($("#backtop").data("expanded") != lastRmenuStatus) {
			lastRmenuStatus = $("#backtop").data("expanded");
			if (lastRmenuStatus) {
				$("#backtop .top").slideDown()
			} else {
				$("#backtop .top").slideUp()
			}
		}
	})
});
//UBB
function addNumber(a){document.getElementById("txaArticle").value+=a}
if($('#comment-tools').length){objActive="txaArticle";function InsertText(a,b,c){if(b==""){return("")}var d=document.getElementById(a);if(document.selection){if(d.currPos){if(c&&(d.value=="")){d.currPos.text=b}else{d.currPos.text+=b}}else{d.value+=b}}else{if(c){d.value=d.value.slice(0,d.selectionStart)+b+d.value.slice(d.selectionEnd,d.value.length)}else{d.value=d.value.slice(0,d.selectionStart)+b+d.value.slice(d.selectionStart,d.value.length)}}}
function ReplaceText(a,b,c){var d=document.getElementById(a);var e;if(document.selection&&document.selection.type=="Text"){if(d.currPos){var f=document.selection.createRange();f.text=b+f.text+c;return("")}else{e=b+c;return(e)}}else{if(d.selectionStart||d.selectionEnd){e=b+d.value.slice(d.selectionStart,d.selectionEnd)+c;return(e)}else{e=b+c;return(e)}}}
if($('#ComtoolsFrame').length){$(this).bind("click",function(a){if(a&&a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}})}}
if($('.face-show').length){$("a.face-show").click(function(){$(".ComtoolsFrame").slideToggle()})}
function CommentComplete(){if($('.msgarticle,#divNewcomm').length){$('.msgarticle,#divNewcomm').each(function comreplace(){var a=$(this).html();a=a.replace(/\[B\](.*)\[\/B\]/g,'<strong>$1</strong>');a=a.replace(/\[U\](.*)\[\/U\]/g,'<u>$1</u>');a=a.replace(/\[S\](.*)\[\/S\]/g,'<del>$1</del>');a=a.replace(/\[I\](.*)\[\/I\]/g,'<em>$1</em>');/*a=a.replace(/\[([A-Za-z0-9]*)\]/g,'<img src="'+bloghost+'/zb_users/theme/talklee/include/emotion/$1.png">');*/$(this).html(a)})}}CommentComplete();
$(document).ready(function() {
	$('#faces').click(function() {
		$("#UbbFrame").slideToggle(666); /*CommentComplete()*/
	})
});

//特效
(function webpackUniversalModuleDefinition(root, factory) {
	if (typeof exports === 'object' && typeof module === 'object') module.exports = factory();
	else if (typeof define === 'function' && define.amd) define([], factory);
	else if (typeof exports === 'object') exports["POWERMODE"] = factory();
	else root["POWERMODE"] = factory()
})(this, function() {
	return (function(modules) {
		var installedModules = {};

		function __webpack_require__(moduleId) {
			if (installedModules[moduleId]) return installedModules[moduleId].exports;
			var module = installedModules[moduleId] = {
				exports: {},
				id: moduleId,
				loaded: false
			};
			modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
			module.loaded = true;
			return module.exports
		}
		__webpack_require__.m = modules;
		__webpack_require__.c = installedModules;
		__webpack_require__.p = "";
		return __webpack_require__(0)
	})([function(module, exports, __webpack_require__) {
		'use strict';
		var canvas = document.createElement('canvas');
		canvas.width = window.innerWidth;
		canvas.height = window.innerHeight;
		canvas.style.cssText = 'position:fixed;top:0;left:0;pointer-events:none;z-index:999999';
		window.addEventListener('resize', function() {
			canvas.width = window.innerWidth;
			canvas.height = window.innerHeight
		});
		document.body.appendChild(canvas);
		var context = canvas.getContext('2d');
		var particles = [];
		var particlePointer = 0;
		POWERMODE.shake = true;

		function getRandom(min, max) {
			return Math.random() * (max - min) + min
		}
		function getColor(el) {
			if (POWERMODE.colorful) {
				var u = getRandom(0, 360);
				return 'hsla(' + getRandom(u - 10, u + 10) + ', 100%, ' + getRandom(50, 80) + '%, ' + 1 + ')'
			} else {
				return window.getComputedStyle(el).color
			}
		}
		function getCaret() {
			var el = document.activeElement;
			var bcr;
			if (el.tagName === 'TEXTAREA' || (el.tagName === 'INPUT' && el.getAttribute('type') === 'text')) {
				var offset = __webpack_require__(1)(el, el.selectionStart);
				bcr = el.getBoundingClientRect();
				return {
					x: offset.left + bcr.left,
					y: offset.top + bcr.top,
					color: getColor(el)
				}
			}
			var selection = window.getSelection();
			if (selection.rangeCount) {
				var range = selection.getRangeAt(0);
				var startNode = range.startContainer;
				if (startNode.nodeType === document.TEXT_NODE) {
					startNode = startNode.parentNode
				}
				bcr = range.getBoundingClientRect();
				return {
					x: bcr.left,
					y: bcr.top,
					color: getColor(startNode)
				}
			}
			return {
				x: 0,
				y: 0,
				color: 'transparent'
			}
		}
		function createParticle(x, y, color) {
			return {
				x: x,
				y: y,
				alpha: 1,
				color: color,
				velocity: {
					x: -1 + Math.random() * 2,
					y: -3.5 + Math.random() * 2
				}
			}
		}
		function POWERMODE() {
			{
				var caret = getCaret();
				var numParticles = 5 + Math.round(Math.random() * 10);
				while (numParticles--) {
					particles[particlePointer] = createParticle(caret.x, caret.y, caret.color);
					particlePointer = (particlePointer + 1) % 500
				}
			} {
				if (POWERMODE.shake) {
					var intensity = 1 + 2 * Math.random();
					var x = intensity * (Math.random() > 0.5 ? -1 : 1);
					var y = intensity * (Math.random() > 0.5 ? -1 : 1);
					document.body.style.marginLeft = x + 'px';
					document.body.style.marginTop = y + 'px';
					setTimeout(function() {
						document.body.style.marginLeft = '';
						document.body.style.marginTop = ''
					}, 75)
				}
			}
		};
		POWERMODE.colorful = false;

		function loop() {
			requestAnimationFrame(loop);
			context.clearRect(0, 0, canvas.width, canvas.height);
			for (var i = 0; i < particles.length; ++i) {
				var particle = particles[i];
				if (particle.alpha <= 0.1) continue;
				particle.velocity.y += 0.075;
				particle.x += particle.velocity.x;
				particle.y += particle.velocity.y;
				particle.alpha *= 0.96;
				context.globalAlpha = particle.alpha;
				context.fillStyle = particle.color;
				context.fillRect(Math.round(particle.x - 1.5), Math.round(particle.y - 1.5), 3, 3)
			}
		}
		requestAnimationFrame(loop);
		module.exports = POWERMODE
	}, function(module, exports) {
		(function() {
			var properties = ['direction', 'boxSizing', 'width', 'height', 'overflowX', 'overflowY', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'borderStyle', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'fontStyle', 'fontVariant', 'fontWeight', 'fontStretch', 'fontSize', 'fontSizeAdjust', 'lineHeight', 'fontFamily', 'textAlign', 'textTransform', 'textIndent', 'textDecoration', 'letterSpacing', 'wordSpacing', 'tabSize', 'MozTabSize'];
			var isFirefox = window.mozInnerScreenX != null;

			function getCaretCoordinates(element, position, options) {
				var debug = options && options.debug || false;
				if (debug) {
					var el = document.querySelector('#input-textarea-caret-position-mirror-div');
					if (el) {
						el.parentNode.removeChild(el)
					}
				}
				var div = document.createElement('div');
				div.id = 'input-textarea-caret-position-mirror-div';
				document.body.appendChild(div);
				var style = div.style;
				var computed = window.getComputedStyle ? getComputedStyle(element) : element.currentStyle;
				style.whiteSpace = 'pre-wrap';
				if (element.nodeName !== 'INPUT') style.wordWrap = 'break-word';
				style.position = 'absolute';
				if (!debug) style.visibility = 'hidden';
				properties.forEach(function(prop) {
					style[prop] = computed[prop]
				});
				if (isFirefox) {
					if (element.scrollHeight > parseInt(computed.height)) style.overflowY = 'scroll'
				} else {
					style.overflow = 'hidden'
				}
				div.textContent = element.value.substring(0, position);
				if (element.nodeName === 'INPUT') div.textContent = div.textContent.replace(/\s/g, "\u00a0");
				var span = document.createElement('span');
				span.textContent = element.value.substring(position) || '.';
				div.appendChild(span);
				var coordinates = {
					top: span.offsetTop + parseInt(computed['borderTopWidth']),
					left: span.offsetLeft + parseInt(computed['borderLeftWidth'])
				};
				if (debug) {
					span.style.backgroundColor = '#aaa'
				} else {
					document.body.removeChild(div)
				}
				return coordinates
			}
			if (typeof module != "undefined" && typeof module.exports != "undefined") {
				module.exports = getCaretCoordinates
			} else {
				window.getCaretCoordinates = getCaretCoordinates
			}
		}())
	}])
});
(function() {
	var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX, bind = function(fn, me) {
			return function() {
				return fn.apply(me, arguments)
			}
		},
		indexOf = [].indexOf ||
	function(item) {
		for (var i = 0, l = this.length; i < l; i++) {
			if (i in this && this[i] === item) return i
		}
		return -1
	};
	Util = (function() {
		function Util() {}
		Util.prototype.extend = function(custom, defaults) {
			var key, value;
			for (key in defaults) {
				value = defaults[key];
				if (custom[key] == null) {
					custom[key] = value
				}
			}
			return custom
		};
		Util.prototype.isMobile = function(agent) {
			return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent)
		};
		Util.prototype.createEvent = function(event, bubble, cancel, detail) {
			var customEvent;
			if (bubble == null) {
				bubble = false
			}
			if (cancel == null) {
				cancel = false
			}
			if (detail == null) {
				detail = null
			}
			if (document.createEvent != null) {
				customEvent = document.createEvent('CustomEvent');
				customEvent.initCustomEvent(event, bubble, cancel, detail)
			} else if (document.createEventObject != null) {
				customEvent = document.createEventObject();
				customEvent.eventType = event
			} else {
				customEvent.eventName = event
			}
			return customEvent
		};
		Util.prototype.emitEvent = function(elem, event) {
			if (elem.dispatchEvent != null) {
				return elem.dispatchEvent(event)
			} else if (event in (elem != null)) {
				return elem[event]()
			} else if (("on" + event) in (elem != null)) {
				return elem["on" + event]()
			}
		};
		Util.prototype.addEvent = function(elem, event, fn) {
			if (elem.addEventListener != null) {
				return elem.addEventListener(event, fn, false)
			} else if (elem.attachEvent != null) {
				return elem.attachEvent("on" + event, fn)
			} else {
				return elem[event] = fn
			}
		};
		Util.prototype.removeEvent = function(elem, event, fn) {
			if (elem.removeEventListener != null) {
				return elem.removeEventListener(event, fn, false)
			} else if (elem.detachEvent != null) {
				return elem.detachEvent("on" + event, fn)
			} else {
				return delete elem[event]
			}
		};
		Util.prototype.innerHeight = function() {
			if ('innerHeight' in window) {
				return window.innerHeight
			} else {
				return document.documentElement.clientHeight
			}
		};
		return Util
	})();
	WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() {
		function WeakMap() {
			this.keys = [];
			this.values = []
		}
		WeakMap.prototype.get = function(key) {
			var i, item, j, len, ref;
			ref = this.keys;
			for (i = j = 0, len = ref.length; j < len; i = ++j) {
				item = ref[i];
				if (item === key) {
					return this.values[i]
				}
			}
		};
		WeakMap.prototype.set = function(key, value) {
			var i, item, j, len, ref;
			ref = this.keys;
			for (i = j = 0, len = ref.length; j < len; i = ++j) {
				item = ref[i];
				if (item === key) {
					this.values[i] = value;
					return
				}
			}
			this.keys.push(key);
			return this.values.push(value)
		};
		return WeakMap
	})());
	MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() {
		function MutationObserver() {
			if (typeof console !== "undefined" && console !== null) {
				console.warn('MutationObserver is not supported by your browser.')
			}
			if (typeof console !== "undefined" && console !== null) {
				console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.')
			}
		}
		MutationObserver.notSupported = true;
		MutationObserver.prototype.observe = function() {};
		return MutationObserver
	})());
	getComputedStyle = this.getComputedStyle ||
	function(el, pseudo) {
		this.getPropertyValue = function(prop) {
			var ref;
			if (prop === 'float') {
				prop = 'styleFloat'
			}
			if (getComputedStyleRX.test(prop)) {
				prop.replace(getComputedStyleRX, function(_, _char) {
					return _char.toUpperCase()
				})
			}
			return ((ref = el.currentStyle) != null ? ref[prop] : void 0) || null
		};
		return this
	};
	getComputedStyleRX = /(\-([a-z]){1})/g;
	this.WOW = (function() {
		WOW.prototype.defaults = {
			boxClass: 'wow',
			animateClass: 'animated',
			offset: 0,
			mobile: true,
			live: true,
			callback: null,
			scrollContainer: null
		};

		function WOW(options) {
			if (options == null) {
				options = {}
			}
			this.scrollCallback = bind(this.scrollCallback, this);
			this.scrollHandler = bind(this.scrollHandler, this);
			this.resetAnimation = bind(this.resetAnimation, this);
			this.start = bind(this.start, this);
			this.scrolled = true;
			this.config = this.util().extend(options, this.defaults);
			if (options.scrollContainer != null) {
				this.config.scrollContainer = document.querySelector(options.scrollContainer)
			}
			this.animationNameCache = new WeakMap();
			this.wowEvent = this.util().createEvent(this.config.boxClass)
		}
		WOW.prototype.init = function() {
			var ref;
			this.element = window.document.documentElement;
			if ((ref = document.readyState) === "interactive" || ref === "complete") {
				this.start()
			} else {
				this.util().addEvent(document, 'DOMContentLoaded', this.start)
			}
			return this.finished = []
		};
		WOW.prototype.start = function() {
			var box, j, len, ref;
			this.stopped = false;
			this.boxes = (function() {
				var j, len, ref, results;
				ref = this.element.querySelectorAll("." + this.config.boxClass);
				results = [];
				for (j = 0, len = ref.length; j < len; j++) {
					box = ref[j];
					results.push(box)
				}
				return results
			}).call(this);
			this.all = (function() {
				var j, len, ref, results;
				ref = this.boxes;
				results = [];
				for (j = 0, len = ref.length; j < len; j++) {
					box = ref[j];
					results.push(box)
				}
				return results
			}).call(this);
			if (this.boxes.length) {
				if (this.disabled()) {
					this.resetStyle()
				} else {
					ref = this.boxes;
					for (j = 0, len = ref.length; j < len; j++) {
						box = ref[j];
						this.applyStyle(box, true)
					}
				}
			}
			if (!this.disabled()) {
				this.util().addEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler);
				this.util().addEvent(window, 'resize', this.scrollHandler);
				this.interval = setInterval(this.scrollCallback, 50)
			}
			if (this.config.live) {
				return new MutationObserver((function(_this) {
					return function(records) {
						var k, len1, node, record, results;
						results = [];
						for (k = 0, len1 = records.length; k < len1; k++) {
							record = records[k];
							results.push((function() {
								var l, len2, ref1, results1;
								ref1 = record.addedNodes || [];
								results1 = [];
								for (l = 0, len2 = ref1.length; l < len2; l++) {
									node = ref1[l];
									results1.push(this.doSync(node))
								}
								return results1
							}).call(_this))
						}
						return results
					}
				})(this)).observe(document.body, {
					childList: true,
					subtree: true
				})
			}
		};
		WOW.prototype.stop = function() {
			this.stopped = true;
			this.util().removeEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler);
			this.util().removeEvent(window, 'resize', this.scrollHandler);
			if (this.interval != null) {
				return clearInterval(this.interval)
			}
		};
		WOW.prototype.sync = function(element) {
			if (MutationObserver.notSupported) {
				return this.doSync(this.element)
			}
		};
		WOW.prototype.doSync = function(element) {
			var box, j, len, ref, results;
			if (element == null) {
				element = this.element
			}
			if (element.nodeType !== 1) {
				return
			}
			element = element.parentNode || element;
			ref = element.querySelectorAll("." + this.config.boxClass);
			results = [];
			for (j = 0, len = ref.length; j < len; j++) {
				box = ref[j];
				if (indexOf.call(this.all, box) < 0) {
					this.boxes.push(box);
					this.all.push(box);
					if (this.stopped || this.disabled()) {
						this.resetStyle()
					} else {
						this.applyStyle(box, true)
					}
					results.push(this.scrolled = true)
				} else {
					results.push(void 0)
				}
			}
			return results
		};
		WOW.prototype.show = function(box) {
			this.applyStyle(box);
			box.className = box.className + " " + this.config.animateClass;
			if (this.config.callback != null) {
				this.config.callback(box)
			}
			this.util().emitEvent(box, this.wowEvent);
			this.util().addEvent(box, 'animationend', this.resetAnimation);
			this.util().addEvent(box, 'oanimationend', this.resetAnimation);
			this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation);
			this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation);
			return box
		};
		WOW.prototype.applyStyle = function(box, hidden) {
			var delay, duration, iteration;
			duration = box.getAttribute('data-wow-duration');
			delay = box.getAttribute('data-wow-delay');
			iteration = box.getAttribute('data-wow-iteration');
			return this.animate((function(_this) {
				return function() {
					return _this.customStyle(box, hidden, duration, delay, iteration)
				}
			})(this))
		};
		WOW.prototype.animate = (function() {
			if ('requestAnimationFrame' in window) {
				return function(callback) {
					return window.requestAnimationFrame(callback)
				}
			} else {
				return function(callback) {
					return callback()
				}
			}
		})();
		WOW.prototype.resetStyle = function() {
			var box, j, len, ref, results;
			ref = this.boxes;
			results = [];
			for (j = 0, len = ref.length; j < len; j++) {
				box = ref[j];
				results.push(box.style.visibility = 'visible')
			}
			return results
		};
		WOW.prototype.resetAnimation = function(event) {
			var target;
			if (event.type.toLowerCase().indexOf('animationend') >= 0) {
				target = event.target || event.srcElement;
				return target.className = target.className.replace(this.config.animateClass, '').trim()
			}
		};
		WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) {
			if (hidden) {
				this.cacheAnimationName(box)
			}
			box.style.visibility = hidden ? 'hidden' : 'visible';
			if (duration) {
				this.vendorSet(box.style, {
					animationDuration: duration
				})
			}
			if (delay) {
				this.vendorSet(box.style, {
					animationDelay: delay
				})
			}
			if (iteration) {
				this.vendorSet(box.style, {
					animationIterationCount: iteration
				})
			}
			this.vendorSet(box.style, {
				animationName: hidden ? 'none' : this.cachedAnimationName(box)
			});
			return box
		};
		WOW.prototype.vendors = ["moz", "webkit"];
		WOW.prototype.vendorSet = function(elem, properties) {
			var name, results, value, vendor;
			results = [];
			for (name in properties) {
				value = properties[name];
				elem["" + name] = value;
				results.push((function() {
					var j, len, ref, results1;
					ref = this.vendors;
					results1 = [];
					for (j = 0, len = ref.length; j < len; j++) {
						vendor = ref[j];
						results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value)
					}
					return results1
				}).call(this))
			}
			return results
		};
		WOW.prototype.vendorCSS = function(elem, property) {
			var j, len, ref, result, style, vendor;
			style = getComputedStyle(elem);
			result = style.getPropertyCSSValue(property);
			ref = this.vendors;
			for (j = 0, len = ref.length; j < len; j++) {
				vendor = ref[j];
				result = result || style.getPropertyCSSValue("-" + vendor + "-" + property)
			}
			return result
		};
		WOW.prototype.animationName = function(box) {
			var animationName, error;
			try {
				animationName = this.vendorCSS(box, 'animation-name').cssText
			} catch (error) {
				animationName = getComputedStyle(box).getPropertyValue('animation-name')
			}
			if (animationName === 'none') {
				return ''
			} else {
				return animationName
			}
		};
		WOW.prototype.cacheAnimationName = function(box) {
			return this.animationNameCache.set(box, this.animationName(box))
		};
		WOW.prototype.cachedAnimationName = function(box) {
			return this.animationNameCache.get(box)
		};
		WOW.prototype.scrollHandler = function() {
			return this.scrolled = true
		};
		WOW.prototype.scrollCallback = function() {
			var box;
			if (this.scrolled) {
				this.scrolled = false;
				this.boxes = (function() {
					var j, len, ref, results;
					ref = this.boxes;
					results = [];
					for (j = 0, len = ref.length; j < len; j++) {
						box = ref[j];
						if (!(box)) {
							continue
						}
						if (this.isVisible(box)) {
							this.show(box);
							continue
						}
						results.push(box)
					}
					return results
				}).call(this);
				if (!(this.boxes.length || this.config.live)) {
					return this.stop()
				}
			}
		};
		WOW.prototype.offsetTop = function(element) {
			var top;
			while (element.offsetTop === void 0) {
				element = element.parentNode
			}
			top = element.offsetTop;
			while (element = element.offsetParent) {
				top += element.offsetTop
			}
			return top
		};
		WOW.prototype.isVisible = function(box) {
			var bottom, offset, top, viewBottom, viewTop;
			offset = box.getAttribute('data-wow-offset') || this.config.offset;
			viewTop = (this.config.scrollContainer && this.config.scrollContainer.scrollTop) || window.pageYOffset;
			viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset;
			top = this.offsetTop(box);
			bottom = top + box.clientHeight;
			return top <= viewBottom && bottom >= viewTop
		};
		WOW.prototype.util = function() {
			return this._util != null ? this._util : this._util = new Util()
		};
		WOW.prototype.disabled = function() {
			return !this.config.mobile && this.util().isMobile(navigator.userAgent)
		};
		return WOW
	})()
}).call(this);
//目录

function autotree() {
	$(document).ready(function() {
		var c = 1,
			b = $("#listree-ol");
		$("#listree-bodys").find("h1, h2, h3").each(function(a) {
			if ("" !== $(this).text().trim()) {
				$(this).attr("id", "listree-list" + a);
				var d = parseInt($(this)[0].tagName.slice(1));
				0 === a || d === c ? (a = $('<li><a id="listree-click" href="#listree-list' + a + '">' + $(this).text() + "</a></li>"), b.append(a)) : d > c ? (a = $('<ol style="margin-left: 14px;"><li><a id="listree-click" href="#listree-list' + a + '">' + $(this).text() + "</a></li></ol>"), b.append(a), b = a) : d < c && (a = $('<li><a id="listree-click" href="#listree-list' + a + '">' + $(this).text() + "</a></li>"), 1 === d ? ($("#listree-ol").append(a), b = $("#listree-ol")) : (b.parent("ol").append(a), b = b.parent("ol")));
				c = d
			}
		});
		$(".listree-btn").click(function() {
			"[+]" == $(".listree-btn").text() ? $(".listree-btn").attr("title", "\u6536\u8d77").text("[-]").parent().next().show() : $(".listree-btn").attr("title", "\u5c55\u5f00").text("[+]").parent().next().hide();
			return !1
		});
		$("a#listree-click").click(function(a) {
			a.preventDefault();
			$("html, body").animate({
				scrollTop: $($(this).attr("href")).offset().top - 100
			}, 800)
		});
		1 < c && $(".listree-box").css("display", "block")
	})
}
autotree();
//fancybox
!
function(a, b, c, d) {
	"use strict";
	var e = c(a),
		f = c(b),
		g = c.fancybox = function() {
			g.open.apply(this, arguments)
		},
		h = navigator.userAgent.match(/msie/),
		i = null,
		j = b.createTouch !== d,
		k = function(a) {
			return a && a.hasOwnProperty && a instanceof c
		},
		l = function(a) {
			return a && "string" === c.type(a)
		},
		m = function(a) {
			return l(a) && a.indexOf("%") > 0
		},
		n = function(a) {
			return a && !(a.style.overflow && "hidden" === a.style.overflow) && (a.clientWidth && a.scrollWidth > a.clientWidth || a.clientHeight && a.scrollHeight > a.clientHeight)
		},
		o = function(a, b) {
			var c = parseInt(a, 10) || 0;
			return b && m(a) && (c = g.getViewport()[b] / 100 * c), Math.ceil(c)
		},
		p = function(a, b) {
			return o(a, b) + "px"
		};
	c.extend(g, {
		version: "2.1.4",
		defaults: {
			padding: 10,
			margin: 20,
			width: 640,
			height: 420,
			minWidth: 100,
			minHeight: 100,
			maxWidth: 9999,
			maxHeight: 9999,
			autoSize: !0,
			autoHeight: !1,
			autoWidth: !1,
			autoResize: !0,
			autoCenter: !j,
			fitToView: !0,
			aspectRatio: !1,
			topRatio: .5,
			leftRatio: .5,
			scrolling: "auto",
			wrapCSS: "",
			arrows: !0,
			closeBtn: !0,
			closeClick: !0,
			nextClick: !1,
			mouseWheel: !0,
			autoPlay: !1,
			playSpeed: 3e3,
			preload: 3,
			modal: !1,
			loop: !0,
			ajax: {
				dataType: "html",
				headers: {
					"X-fancyBox": !0
				}
			},
			iframe: {
				scrolling: "auto",
				preload: !0
			},
			swf: {
				wmode: "transparent",
				allowfullscreen: "true",
				allowscriptaccess: "always"
			},
			keys: {
				next: {
					13: "left",
					34: "up",
					39: "left",
					40: "up"
				},
				prev: {
					8: "right",
					33: "down",
					37: "right",
					38: "down"
				},
				close: [27],
				play: [32],
				toggle: [70]
			},
			direction: {
				next: "left",
				prev: "right"
			},
			scrollOutside: !0,
			index: 0,
			type: null,
			href: null,
			content: null,
			title: null,
			tpl: {
				wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
				image: '<img class="fancybox-image" src="{href}" alt="" />',
				iframe: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (h ? ' allowtransparency="true"' : "") + "></iframe>",
				error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
				closeBtn: '<a title="关闭" class="fancybox-item fancybox-close" href="javascript:;"></a>',
				next: '<a title="下一张" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
				prev: '<a title="上一张" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
			},
			openEffect: "fade",
			openSpeed: 150,
			openEasing: "swing",
			openOpacity: !0,
			openMethod: "zoomIn",
			closeEffect: "fade",
			closeSpeed: 150,
			closeEasing: "swing",
			closeOpacity: !0,
			closeMethod: "zoomOut",
			nextEffect: "elastic",
			nextSpeed: 250,
			nextEasing: "swing",
			nextMethod: "changeIn",
			prevEffect: "elastic",
			prevSpeed: 250,
			prevEasing: "swing",
			prevMethod: "changeOut",
			helpers: {
				overlay: !0,
				title: !0
			},
			onCancel: c.noop,
			beforeLoad: c.noop,
			afterLoad: c.noop,
			beforeShow: c.noop,
			afterShow: c.noop,
			beforeChange: c.noop,
			beforeClose: c.noop,
			afterClose: c.noop
		},
		group: {},
		opts: {},
		previous: null,
		coming: null,
		current: null,
		isActive: !1,
		isOpen: !1,
		isOpened: !1,
		wrap: null,
		skin: null,
		outer: null,
		inner: null,
		player: {
			timer: null,
			isActive: !1
		},
		ajaxLoad: null,
		imgPreload: null,
		transitions: {},
		helpers: {},
		open: function(a, b) {
			return a && (c.isPlainObject(b) || (b = {}), !1 !== g.close(!0)) ? (c.isArray(a) || (a = k(a) ? c(a).get() : [a]), c.each(a, function(e, f) {
				var i, j, m, n, o, p, q, h = {};
				"object" === c.type(f) && (f.nodeType && (f = c(f)), k(f) ? (h = {
					href: f.data("fancybox-href") || f.attr("href"),
					title: f.data("fancybox-title") || f.attr("title"),
					isDom: !0,
					element: f
				}, c.metadata && c.extend(!0, h, f.metadata())) : h = f), i = b.href || h.href || (l(f) ? f : null), j = b.title !== d ? b.title : h.title || "", m = b.content || h.content, n = m ? "html" : b.type || h.type, !n && h.isDom && (n = f.data("fancybox-type"), n || (o = f.prop("class").match(/fancybox\.(\w+)/), n = o ? o[1] : null)), l(i) && (n || (g.isImage(i) ? n = "image" : g.isSWF(i) ? n = "swf" : "#" === i.charAt(0) ? n = "inline" : l(f) && (n = "html", m = f)), "ajax" === n && (p = i.split(/\s+/, 2), i = p.shift(), q = p.shift())), m || ("inline" === n ? i ? m = c(l(i) ? i.replace(/.*(?=#[^\s]+$)/, "") : i) : h.isDom && (m = f) : "html" === n ? m = i : n || i || !h.isDom || (n = "inline", m = f)), c.extend(h, {
					href: i,
					type: n,
					content: m,
					title: j,
					selector: q
				}), a[e] = h
			}), g.opts = c.extend(!0, {}, g.defaults, b), b.keys !== d && (g.opts.keys = b.keys ? c.extend({}, g.defaults.keys, b.keys) : !1), g.group = a, g._start(g.opts.index)) : void 0
		},
		cancel: function() {
			var a = g.coming;
			a && !1 !== g.trigger("onCancel") && (g.hideLoading(), g.ajaxLoad && g.ajaxLoad.abort(), g.ajaxLoad = null, g.imgPreload && (g.imgPreload.onload = g.imgPreload.onerror = null), a.wrap && a.wrap.stop(!0, !0).trigger("onReset").remove(), g.coming = null, g.current || g._afterZoomOut(a))
		},
		close: function(a) {
			g.cancel(), !1 !== g.trigger("beforeClose") && (g.unbindEvents(), g.isActive && (g.isOpen && a !== !0 ? (g.isOpen = g.isOpened = !1, g.isClosing = !0, c(".fancybox-item, .fancybox-nav").remove(), g.wrap.stop(!0, !0).removeClass("fancybox-opened"), g.transitions[g.current.closeMethod]()) : (c(".fancybox-wrap").stop(!0).trigger("onReset").remove(), g._afterZoomOut())))
		},
		play: function(a) {
			var b = function() {
					clearTimeout(g.player.timer)
				},
				d = function() {
					b(), g.current && g.player.isActive && (g.player.timer = setTimeout(g.next, g.current.playSpeed))
				},
				e = function() {
					b(), c("body").unbind(".player"), g.player.isActive = !1, g.trigger("onPlayEnd")
				},
				f = function() {
					g.current && (g.current.loop || g.current.index < g.group.length - 1) && (g.player.isActive = !0, c("body").bind({
						"afterShow.player onUpdate.player": d,
						"onCancel.player beforeClose.player": e,
						"beforeLoad.player": b
					}), d(), g.trigger("onPlayStart"))
				};
			a === !0 || !g.player.isActive && a !== !1 ? f() : e()
		},
		next: function(a) {
			var b = g.current;
			b && (l(a) || (a = b.direction.next), g.jumpto(b.index + 1, a, "next"))
		},
		prev: function(a) {
			var b = g.current;
			b && (l(a) || (a = b.direction.prev), g.jumpto(b.index - 1, a, "prev"))
		},
		jumpto: function(a, b, c) {
			var e = g.current;
			e && (a = o(a), g.direction = b || e.direction[a >= e.index ? "next" : "prev"], g.router = c || "jumpto", e.loop && (0 > a && (a = e.group.length + a % e.group.length), a %= e.group.length), e.group[a] !== d && (g.cancel(), g._start(a)))
		},
		reposition: function(a, b) {
			var f, d = g.current,
				e = d ? d.wrap : null;
			e && (f = g._getPosition(b), a && "scroll" === a.type ? (delete f.position, e.stop(!0, !0).animate(f, 200)) : (e.css(f), d.pos = c.extend({}, d.dim, f)))
		},
		update: function(a) {
			var b = a && a.type,
				c = !b || "orientationchange" === b;
			c && (clearTimeout(i), i = null), g.isOpen && !i && (i = setTimeout(function() {
				var d = g.current;
				d && !g.isClosing && (g.wrap.removeClass("fancybox-tmp"), (c || "load" === b || "resize" === b && d.autoResize) && g._setDimension(), "scroll" === b && d.canShrink || g.reposition(a), g.trigger("onUpdate"), i = null)
			}, c && !j ? 0 : 300))
		},
		toggle: function(a) {
			g.isOpen && (g.current.fitToView = "boolean" === c.type(a) ? a : !g.current.fitToView, j && (g.wrap.removeAttr("style").addClass("fancybox-tmp"), g.trigger("onUpdate")), g.update())
		},
		hideLoading: function() {
			f.unbind(".loading"), c("#fancybox-loading").remove()
		},
		showLoading: function() {
			var a, b;
			g.hideLoading(), a = c('<div id="fancybox-loading"><div></div></div>').click(g.cancel).appendTo("body"), f.bind("keydown.loading", function(a) {
				27 === (a.which || a.keyCode) && (a.preventDefault(), g.cancel())
			}), g.defaults.fixed || (b = g.getViewport(), a.css({
				position: "absolute",
				top: .5 * b.h + b.y,
				left: .5 * b.w + b.x
			}))
		},
		getViewport: function() {
			var b = g.current && g.current.locked || !1,
				c = {
					x: e.scrollLeft(),
					y: e.scrollTop()
				};
			return b ? (c.w = b[0].clientWidth, c.h = b[0].clientHeight) : (c.w = j && a.innerWidth ? a.innerWidth : e.width(), c.h = j && a.innerHeight ? a.innerHeight : e.height()), c
		},
		unbindEvents: function() {
			g.wrap && k(g.wrap) && g.wrap.unbind(".fb"), f.unbind(".fb"), e.unbind(".fb")
		},
		bindEvents: function() {
			var b, a = g.current;
			a && (e.bind("orientationchange.fb" + (j ? "" : " resize.fb") + (a.autoCenter && !a.locked ? " scroll.fb" : ""), g.update), b = a.keys, b && f.bind("keydown.fb", function(e) {
				var f = e.which || e.keyCode,
					h = e.target || e.srcElement;
				return 27 === f && g.coming ? !1 : (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey || h && (h.type || c(h).is("[contenteditable]")) || c.each(b, function(b, h) {
					return a.group.length > 1 && h[f] !== d ? (g[b](h[f]), e.preventDefault(), !1) : c.inArray(f, h) > -1 ? (g[b](), e.preventDefault(), !1) : void 0
				}), void 0)
			}), c.fn.mousewheel && a.mouseWheel && g.wrap.bind("mousewheel.fb", function(b, d, e, f) {
				for (var h = b.target || null, i = c(h), j = !1; i.length && !(j || i.is(".fancybox-skin") || i.is(".fancybox-wrap"));) j = n(i[0]), i = c(i).parent();
				0 === d || j || g.group.length > 1 && !a.canShrink && (f > 0 || e > 0 ? g.prev(f > 0 ? "down" : "left") : (0 > f || 0 > e) && g.next(0 > f ? "up" : "right"), b.preventDefault())
			}))
		},
		trigger: function(a, b) {
			var d, e = b || g.coming || g.current;
			if (e) {
				if (c.isFunction(e[a]) && (d = e[a].apply(e, Array.prototype.slice.call(arguments, 1))), d === !1) return !1;
				e.helpers && c.each(e.helpers, function(b, d) {
					d && g.helpers[b] && c.isFunction(g.helpers[b][a]) && (d = c.extend(!0, {}, g.helpers[b].defaults, d), g.helpers[b][a](d, e))
				}), c.event.trigger(a + ".fb")
			}
		},
		isImage: function(a) {
			return l(a) && a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)
		},
		isSWF: function(a) {
			return l(a) && a.match(/\.(swf)((\?|#).*)?$/i)
		},
		_start: function(a) {
			var d, e, f, h, i, b = {};
			if (a = o(a), d = g.group[a] || null, !d) return !1;
			if (b = c.extend(!0, {}, g.opts, d), h = b.margin, i = b.padding, "number" === c.type(h) && (b.margin = [h, h, h, h]), "number" === c.type(i) && (b.padding = [i, i, i, i]), b.modal && c.extend(!0, b, {
				closeBtn: !1,
				closeClick: !1,
				nextClick: !1,
				arrows: !1,
				mouseWheel: !1,
				keys: null,
				helpers: {
					overlay: {
						closeClick: !1
					}
				}
			}), b.autoSize && (b.autoWidth = b.autoHeight = !0), "auto" === b.width && (b.autoWidth = !0), "auto" === b.height && (b.autoHeight = !0), b.group = g.group, b.index = a, g.coming = b, !1 === g.trigger("beforeLoad")) return g.coming = null, void 0;
			if (f = b.type, e = b.href, !f) return g.coming = null, g.current && g.router && "jumpto" !== g.router ? (g.current.index = a, g[g.router](g.direction)) : !1;
			if (g.isActive = !0, ("image" === f || "swf" === f) && (b.autoHeight = b.autoWidth = !1, b.scrolling = "visible"), "image" === f && (b.aspectRatio = !0), "iframe" === f && j && (b.scrolling = "scroll"), b.wrap = c(b.tpl.wrap).addClass("fancybox-" + (j ? "mobile" : "desktop") + " fancybox-type-" + f + " fancybox-tmp " + b.wrapCSS).appendTo(b.parent || "body"), c.extend(b, {
				skin: c(".fancybox-skin", b.wrap),
				outer: c(".fancybox-outer", b.wrap),
				inner: c(".fancybox-inner", b.wrap)
			}), c.each(["Top", "Right", "Bottom", "Left"], function(a, c) {
				b.skin.css("padding" + c, p(b.padding[a]))
			}), g.trigger("onReady"), "inline" === f || "html" === f) {
				if (!b.content || !b.content.length) return g._error("content")
			} else if (!e) return g._error("href");
			"image" === f ? g._loadImage() : "ajax" === f ? g._loadAjax() : "iframe" === f ? g._loadIframe() : g._afterLoad()
		},
		_error: function(a) {
			c.extend(g.coming, {
				type: "html",
				autoWidth: !0,
				autoHeight: !0,
				minWidth: 0,
				minHeight: 0,
				scrolling: "no",
				hasError: a,
				content: g.coming.tpl.error
			}), g._afterLoad()
		},
		_loadImage: function() {
			var a = g.imgPreload = new Image;
			a.onload = function() {
				this.onload = this.onerror = null, g.coming.width = this.width, g.coming.height = this.height, g._afterLoad()
			}, a.onerror = function() {
				this.onload = this.onerror = null, g._error("image")
			}, a.src = g.coming.href, a.complete !== !0 && g.showLoading()
		},
		_loadAjax: function() {
			var a = g.coming;
			g.showLoading(), g.ajaxLoad = c.ajax(c.extend({}, a.ajax, {
				url: a.href,
				error: function(a, b) {
					g.coming && "abort" !== b ? g._error("ajax", a) : g.hideLoading()
				},
				success: function(b, c) {
					"success" === c && (a.content = b, g._afterLoad())
				}
			}))
		},
		_loadIframe: function() {
			var a = g.coming,
				b = c(a.tpl.iframe.replace(/\{rnd\}/g, (new Date).getTime())).attr("scrolling", j ? "auto" : a.iframe.scrolling).attr("src", a.href);
			c(a.wrap).bind("onReset", function() {
				try {
					c(this).find("iframe").hide().attr("src", "//about:blank").end().empty()
				} catch (a) {}
			}), a.iframe.preload && (g.showLoading(), b.one("load", function() {
				c(this).data("ready", 1), j || c(this).bind("load.fb", g.update), c(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(), g._afterLoad()
			})), a.content = b.appendTo(a.inner), a.iframe.preload || g._afterLoad()
		},
		_preloadImages: function() {
			var e, f, a = g.group,
				b = g.current,
				c = a.length,
				d = b.preload ? Math.min(b.preload, c - 1) : 0;
			for (f = 1; d >= f; f += 1) e = a[(b.index + f) % c], "image" === e.type && e.href && ((new Image).src = e.href)
		},
		_afterLoad: function() {
			var e, f, h, i, j, l, a = g.coming,
				b = g.current,
				d = "fancybox-placeholder";
			if (g.hideLoading(), a && g.isActive !== !1) {
				if (!1 === g.trigger("afterLoad", a, b)) return a.wrap.stop(!0).trigger("onReset").remove(), g.coming = null, void 0;
				switch (b && (g.trigger("beforeChange", b), b.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()), g.unbindEvents(), e = a, f = a.content, h = a.type, i = a.scrolling, c.extend(g, {
					wrap: e.wrap,
					skin: e.skin,
					outer: e.outer,
					inner: e.inner,
					current: e,
					previous: b
				}), j = e.href, h) {
				case "inline":
				case "ajax":
				case "html":
					e.selector ? f = c("<div>").html(f).find(e.selector) : k(f) && (f.data(d) || f.data(d, c('<div class="' + d + '"></div>').insertAfter(f).hide()), f = f.show().detach(), e.wrap.bind("onReset", function() {
						c(this).find(f).length && f.hide().replaceAll(f.data(d)).data(d, !1)
					}));
					break;
				case "image":
					f = e.tpl.image.replace("{href}", j);
					break;
				case "swf":
					f = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + j + '"></param>', l = "", c.each(e.swf, function(a, b) {
						f += '<param name="' + a + '" value="' + b + '"></param>', l += " " + a + '="' + b + '"'
					}), f += '<embed src="' + j + '" type="application/x-shockwave-flash" width="100%" height="100%"' + l + "></embed></object>"
				}
				k(f) && f.parent().is(e.inner) || e.inner.append(f), g.trigger("beforeShow"), e.inner.css("overflow", "yes" === i ? "scroll" : "no" === i ? "hidden" : i), g._setDimension(), g.reposition(), g.isOpen = !1, g.coming = null, g.bindEvents(), g.isOpened ? b.prevMethod && g.transitions[b.prevMethod]() : c(".fancybox-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(), g.transitions[g.isOpened ? e.nextMethod : e.openMethod](), g._preloadImages()
			}
		},
		_setDimension: function() {
			var y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, a = g.getViewport(),
				b = 0,
				d = !1,
				e = !1,
				f = g.wrap,
				h = g.skin,
				i = g.inner,
				j = g.current,
				k = j.width,
				l = j.height,
				n = j.minWidth,
				q = j.minHeight,
				r = j.maxWidth,
				s = j.maxHeight,
				t = j.scrolling,
				u = j.scrollOutside ? j.scrollbarWidth : 0,
				v = j.margin,
				w = o(v[1] + v[3]),
				x = o(v[0] + v[2]);
			if (f.add(h).add(i).width("auto").height("auto").removeClass("fancybox-tmp"), y = o(h.outerWidth(!0) - h.width()), z = o(h.outerHeight(!0) - h.height()), A = w + y, B = x + z, C = m(k) ? (a.w - A) * o(k) / 100 : k, D = m(l) ? (a.h - B) * o(l) / 100 : l, "iframe" === j.type) {
				if (L = j.content, j.autoHeight && 1 === L.data("ready")) try {
					L[0].contentWindow.document.location && (i.width(C).height(9999), M = L.contents().find("body"), u && M.css("overflow-x", "hidden"), D = M.height())
				} catch (N) {}
			} else(j.autoWidth || j.autoHeight) && (i.addClass("fancybox-tmp"), j.autoWidth || i.width(C), j.autoHeight || i.height(D), j.autoWidth && (C = i.width()), j.autoHeight && (D = i.height()), i.removeClass("fancybox-tmp"));
			if (k = o(C), l = o(D), G = C / D, n = o(m(n) ? o(n, "w") - A : n), r = o(m(r) ? o(r, "w") - A : r), q = o(m(q) ? o(q, "h") - B : q), s = o(m(s) ? o(s, "h") - B : s), E = r, F = s, j.fitToView && (r = Math.min(a.w - A, r), s = Math.min(a.h - B, s)), J = a.w - w, K = a.h - x, j.aspectRatio ? (k > r && (k = r, l = o(k / G)), l > s && (l = s, k = o(l * G)), n > k && (k = n, l = o(k / G)), q > l && (l = q, k = o(l * G))) : (k = Math.max(n, Math.min(k, r)), j.autoHeight && "iframe" !== j.type && (i.width(k), l = i.height()), l = Math.max(q, Math.min(l, s))), j.fitToView) if (i.width(k).height(l), f.width(k + y), H = f.width(), I = f.height(), j.aspectRatio) for (;
			(H > J || I > K) && k > n && l > q && !(b++ > 19);) l = Math.max(q, Math.min(s, l - 10)), k = o(l * G), n > k && (k = n, l = o(k / G)), k > r && (k = r, l = o(k / G)), i.width(k).height(l), f.width(k + y), H = f.width(), I = f.height();
			else k = Math.max(n, Math.min(k, k - (H - J))), l = Math.max(q, Math.min(l, l - (I - K)));
			u && "auto" === t && D > l && J > k + y + u && (k += u), i.width(k).height(l), f.width(k + y), H = f.width(), I = f.height(), d = (H > J || I > K) && k > n && l > q, e = j.aspectRatio ? E > k && F > l && C > k && D > l : (E > k || F > l) && (C > k || D > l), c.extend(j, {
				dim: {
					width: p(H),
					height: p(I)
				},
				origWidth: C,
				origHeight: D,
				canShrink: d,
				canExpand: e,
				wPadding: y,
				hPadding: z,
				wrapSpace: I - h.outerHeight(!0),
				skinSpace: h.height() - l
			}), !L && j.autoHeight && l > q && s > l && !e && i.height("auto")
		},
		_getPosition: function(a) {
			var b = g.current,
				c = g.getViewport(),
				d = b.margin,
				e = g.wrap.width() + d[1] + d[3],
				f = g.wrap.height() + d[0] + d[2],
				h = {
					position: "absolute",
					top: d[0],
					left: d[3]
				};
			return b.autoCenter && b.fixed && !a && f <= c.h && e <= c.w ? h.position = "fixed" : b.locked || (h.top += c.y, h.left += c.x), h.top = p(Math.max(h.top, h.top + (c.h - f) * b.topRatio)), h.left = p(Math.max(h.left, h.left + (c.w - e) * b.leftRatio)), h
		},
		_afterZoomIn: function() {
			var a = g.current;
			a && (g.isOpen = g.isOpened = !0, g.wrap.css("overflow", "visible").addClass("fancybox-opened"), g.update(), (a.closeClick || a.nextClick && g.group.length > 1) && g.inner.css("cursor", "pointer").bind("click.fb", function(b) {
				c(b.target).is("a") || c(b.target).parent().is("a") || (b.preventDefault(), g[a.closeClick ? "close" : "next"]())
			}), a.closeBtn && c(a.tpl.closeBtn).appendTo(g.skin).bind("click.fb", function(a) {
				a.preventDefault(), g.close()
			}), a.arrows && g.group.length > 1 && ((a.loop || a.index > 0) && c(a.tpl.prev).appendTo(g.outer).bind("click.fb", g.prev), (a.loop || a.index < g.group.length - 1) && c(a.tpl.next).appendTo(g.outer).bind("click.fb", g.next)), g.trigger("afterShow"), a.loop || a.index !== a.group.length - 1 ? g.opts.autoPlay && !g.player.isActive && (g.opts.autoPlay = !1, g.play()) : g.play(!1))
		},
		_afterZoomOut: function(a) {
			a = a || g.current, c(".fancybox-wrap").trigger("onReset").remove(), c.extend(g, {
				group: {},
				opts: {},
				router: !1,
				current: null,
				isActive: !1,
				isOpened: !1,
				isOpen: !1,
				isClosing: !1,
				wrap: null,
				skin: null,
				outer: null,
				inner: null
			}), g.trigger("afterClose", a)
		}
	}), g.transitions = {
		getOrigPosition: function() {
			var a = g.current,
				b = a.element,
				c = a.orig,
				d = {},
				e = 50,
				f = 50,
				h = a.hPadding,
				i = a.wPadding,
				j = g.getViewport();
			return !c && a.isDom && b.is(":visible") && (c = b.find("img:first"), c.length || (c = b)), k(c) ? (d = c.offset(), c.is("img") && (e = c.outerWidth(), f = c.outerHeight())) : (d.top = j.y + (j.h - f) * a.topRatio, d.left = j.x + (j.w - e) * a.leftRatio), ("fixed" === g.wrap.css("position") || a.locked) && (d.top -= j.y, d.left -= j.x), d = {
				top: p(d.top - h * a.topRatio),
				left: p(d.left - i * a.leftRatio),
				width: p(e + i),
				height: p(f + h)
			}
		},
		step: function(a, b) {
			var c, d, e, f = b.prop,
				h = g.current,
				i = h.wrapSpace,
				j = h.skinSpace;
			("width" === f || "height" === f) && (c = b.end === b.start ? 1 : (a - b.start) / (b.end - b.start), g.isClosing && (c = 1 - c), d = "width" === f ? h.wPadding : h.hPadding, e = a - d, g.skin[f](o("width" === f ? e : e - i * c)), g.inner[f](o("width" === f ? e : e - i * c - j * c)))
		},
		zoomIn: function() {
			var a = g.current,
				b = a.pos,
				d = a.openEffect,
				e = "elastic" === d,
				f = c.extend({
					opacity: 1
				}, b);
			delete f.position, e ? (b = this.getOrigPosition(), a.openOpacity && (b.opacity = .1)) : "fade" === d && (b.opacity = .1), g.wrap.css(b).animate(f, {
				duration: "none" === d ? 0 : a.openSpeed,
				easing: a.openEasing,
				step: e ? this.step : null,
				complete: g._afterZoomIn
			})
		},
		zoomOut: function() {
			var a = g.current,
				b = a.closeEffect,
				c = "elastic" === b,
				d = {
					opacity: .1
				};
			c && (d = this.getOrigPosition(), a.closeOpacity && (d.opacity = .1)), g.wrap.animate(d, {
				duration: "none" === b ? 0 : a.closeSpeed,
				easing: a.closeEasing,
				step: c ? this.step : null,
				complete: g._afterZoomOut
			})
		},
		changeIn: function() {
			var h, a = g.current,
				b = a.nextEffect,
				c = a.pos,
				d = {
					opacity: 1
				},
				e = g.direction,
				f = 200;
			c.opacity = .1, "elastic" === b && (h = "down" === e || "up" === e ? "top" : "left", "down" === e || "right" === e ? (c[h] = p(o(c[h]) - f), d[h] = "+=" + f + "px") : (c[h] = p(o(c[h]) + f), d[h] = "-=" + f + "px")), "none" === b ? g._afterZoomIn() : g.wrap.css(c).animate(d, {
				duration: a.nextSpeed,
				easing: a.nextEasing,
				complete: g._afterZoomIn
			})
		},
		changeOut: function() {
			var a = g.previous,
				b = a.prevEffect,
				d = {
					opacity: .1
				},
				e = g.direction,
				f = 200;
			"elastic" === b && (d["down" === e || "up" === e ? "top" : "left"] = ("up" === e || "left" === e ? "-" : "+") + "=" + f + "px"), a.wrap.animate(d, {
				duration: "none" === b ? 0 : a.prevSpeed,
				easing: a.prevEasing,
				complete: function() {
					c(this).trigger("onReset").remove()
				}
			})
		}
	}, g.helpers.overlay = {
		defaults: {
			closeClick: !0,
			speedOut: 200,
			showEarly: !0,
			css: {},
			locked: !j,
			fixed: !0
		},
		overlay: null,
		fixed: !1,
		create: function(a) {
			a = c.extend({}, this.defaults, a), this.overlay && this.close(), this.overlay = c('<div class="fancybox-overlay"></div>').appendTo("body"), this.fixed = !1, a.fixed && g.defaults.fixed && (this.overlay.addClass("fancybox-overlay-fixed"), this.fixed = !1)
		},
		open: function(a) {
			var b = this;
			a = c.extend({}, this.defaults, a), this.overlay ? this.overlay.unbind(".overlay").width("auto").height("auto") : this.create(a), this.fixed || (e.bind("resize.overlay", c.proxy(this.update, this)), this.update()), a.closeClick && this.overlay.bind("click.overlay", function(a) {
				c(a.target).hasClass("fancybox-overlay") && (g.isActive ? g.close() : b.close())
			}), this.overlay.css(a.css).show()
		},
		close: function() {
			c(".fancybox-overlay").remove(), e.unbind("resize.overlay"), this.overlay = null, this.margin !== !1 && (c("body").css("margin-right", this.margin), this.margin = !1), this.el && this.el.removeClass("fancybox-lock")
		},
		update: function() {
			var c, a = "100%";
			this.overlay.width(a).height("100%"), h ? (c = Math.max(b.documentElement.offsetWidth, b.body.offsetWidth), f.width() > c && (a = f.width())) : f.width() > e.width() && (a = f.width()), this.overlay.width(a).height(f.height())
		},
		onReady: function(a, d) {
			c(".fancybox-overlay").stop(!0, !0), this.overlay || (this.margin = f.height() > e.height() || "scroll" === c("body").css("overflow-y") ? c("body").css("margin-right") : !1, this.el = b.all && !b.querySelector ? c("html") : c("body"), this.create(a)), a.locked && this.fixed && (d.locked = this.overlay.append(d.wrap), d.fixed = !1), a.showEarly === !0 && this.beforeShow.apply(this, arguments)
		},
		beforeShow: function(a, b) {
			b.locked && (this.el.addClass("fancybox-lock"), this.margin !== !1 && c("body").css("margin-right", o(this.margin) + b.scrollbarWidth)), this.open(a)
		},
		onUpdate: function() {
			this.fixed || this.update()
		},
		afterClose: function(a) {
			this.overlay && !g.isActive && this.overlay.fadeOut(a.speedOut, c.proxy(this.close, this))
		}
	}, g.helpers.title = {
		defaults: {
			type: "inside",
			position: "bottom"
		},
		beforeShow: function(a) {
			var f, i, b = g.current,
				d = b.title,
				e = a.type;
			if (c.isFunction(d) && (d = d.call(b.element, b)), l(d) && "" !== c.trim(d)) {
				switch (f = c('<div class="fancybox-title fancybox-title-' + e + '-wrap">' + d + "</div>"), e) {
				case "inside":
					i = g.skin;
					break;
				case "outside":
					i = g.wrap;
					break;
				case "over":
					i = g.inner;
					break;
				default:
					i = g.skin, f.appendTo("body"), h && f.width(f.width()), f.wrapInner('<span class="child"></span>'), g.current.margin[2] += Math.abs(o(f.css("margin-bottom")))
				}
				f["top" === a.position ? "prependTo" : "appendTo"](i)
			}
		}
	}, c.fn.fancybox = function(a) {
		var b, d = c(this),
			e = this.selector || "",
			h = function(f) {
				var j, k, h = c(this).blur(),
					i = b;
				f.ctrlKey || f.altKey || f.shiftKey || f.metaKey || h.is(".fancybox-wrap") || (j = a.groupAttr || "data-fancybox-group", k = h.attr(j), k || (j = "rel", k = h.get(0)[j]), k && "" !== k && "nofollow" !== k && (h = e.length ? c(e) : d, h = h.filter("[" + j + '="' + k + '"]'), i = h.index(this)), a.index = i, g.open(h, a) !== !1 && f.preventDefault())
			};
		return a = a || {}, b = a.index || 0, e && a.live !== !1 ? f.undelegate(e, "click.fb-start").delegate(e + ":not('.fancybox-item, .fancybox-nav')", "click.fb-start", h) : d.unbind("click.fb-start").bind("click.fb-start", h), this.filter("[data-fancybox-start=1]").trigger("click"), this
	}, f.ready(function() {
		c.scrollbarWidth === d && (c.scrollbarWidth = function() {
			var a = c('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),
				b = a.children(),
				d = b.innerWidth() - b.height(99).innerWidth();
			return a.remove(), d
		}), c.support.fixedPosition === d && (c.support.fixedPosition = function() {
			var a = c('<div style="position:fixed;top:20px;"></div>').appendTo("body"),
				b = 20 === a[0].offsetTop || 15 === a[0].offsetTop;
			return a.remove(), b
		}()), c.extend(g.defaults, {
			scrollbarWidth: c.scrollbarWidth(),
			fixed: c.support.fixedPosition,
			parent: c("body")
		})
	})
}(window, document, jQuery), function(a) {
	function b(b) {
		var c = b || window.event,
			d = [].slice.call(arguments, 1),
			e = 0,
			f = 0,
			g = 0,
			b = a.event.fix(c);
		return b.type = "mousewheel", c.wheelDelta && (e = c.wheelDelta / 120), c.detail && (e = -c.detail / 3), g = e, void 0 !== c.axis && c.axis === c.HORIZONTAL_AXIS && (g = 0, f = -1 * e), void 0 !== c.wheelDeltaY && (g = c.wheelDeltaY / 120), void 0 !== c.wheelDeltaX && (f = -1 * c.wheelDeltaX / 120), d.unshift(b, e, f, g), (a.event.dispatch || a.event.handle).apply(this, d)
	}
	var d, c = ["DOMMouseScroll", "mousewheel"];
	if (a.event.fixHooks) for (d = c.length; d;) a.event.fixHooks[c[--d]] = a.event.mouseHooks;
	a.event.special.mousewheel = {
		setup: function() {
			if (this.addEventListener) for (var a = c.length; a;) this.addEventListener(c[--a], b, !1);
			else this.onmousewheel = b
		},
		teardown: function() {
			if (this.removeEventListener) for (var a = c.length; a;) this.removeEventListener(c[--a], b, !1);
			else this.onmousewheel = null
		}
	}, a.fn.extend({
		mousewheel: function(a) {
			return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
		},
		unmousewheel: function(a) {
			return this.unbind("mousewheel", a)
		}
	})
}(jQuery);
$(document).ready(function() {
	$(".fancybox").fancybox();
});