/* Minification failed. Returning unminified contents.
(15,1): run-time error CSS1019: Unexpected token, found '('
(15,11): run-time error CSS1031: Expected selector, found '('
(15,11): run-time error CSS1025: Expected comma or open brace, found '('
(684,2): run-time error CSS1019: Unexpected token, found ')'
(684,3): run-time error CSS1019: Unexpected token, found '('
(684,10): run-time error CSS1031: Expected selector, found ')'
(684,10): run-time error CSS1025: Expected comma or open brace, found ')'
(686,15): run-time error CSS1030: Expected identifier, found ''jswing''
(686,15): run-time error CSS1033: Expected closing bracket, found ''jswing''
(686,23): run-time error CSS1031: Expected selector, found ']'
(686,23): run-time error CSS1025: Expected comma or open brace, found ']'
(687,8): run-time error CSS1030: Expected identifier, found 'extend('
(687,8): run-time error CSS1031: Expected selector, found 'extend('
(687,8): run-time error CSS1025: Expected comma or open brace, found 'extend('
(834,2): run-time error CSS1019: Unexpected token, found ')'
(849,13): run-time error CSS1031: Expected selector, found '='
(849,13): run-time error CSS1025: Expected comma or open brace, found '='
(850,13): run-time error CSS1031: Expected selector, found '='
(850,13): run-time error CSS1025: Expected comma or open brace, found '='
(851,13): run-time error CSS1031: Expected selector, found '='
(851,13): run-time error CSS1025: Expected comma or open brace, found '='
(857,10): run-time error CSS1031: Expected selector, found 'hex_md5('
(857,10): run-time error CSS1025: Expected comma or open brace, found 'hex_md5('
(858,10): run-time error CSS1031: Expected selector, found 'b64_md5('
(858,10): run-time error CSS1025: Expected comma or open brace, found 'b64_md5('
(859,10): run-time error CSS1031: Expected selector, found 'str_md5('
(859,10): run-time error CSS1025: Expected comma or open brace, found 'str_md5('
(860,10): run-time error CSS1031: Expected selector, found 'hex_hmac_md5('
(860,10): run-time error CSS1025: Expected comma or open brace, found 'hex_hmac_md5('
(861,10): run-time error CSS1031: Expected selector, found 'b64_hmac_md5('
(861,10): run-time error CSS1025: Expected comma or open brace, found 'b64_hmac_md5('
(862,10): run-time error CSS1031: Expected selector, found 'str_hmac_md5('
(862,10): run-time error CSS1025: Expected comma or open brace, found 'str_hmac_md5('
(867,10): run-time error CSS1031: Expected selector, found 'md5_vm_test('
(867,10): run-time error CSS1025: Expected comma or open brace, found 'md5_vm_test('
(875,10): run-time error CSS1031: Expected selector, found 'core_md5('
(875,10): run-time error CSS1025: Expected comma or open brace, found 'core_md5('
(973,10): run-time error CSS1031: Expected selector, found 'md5_cmn('
(973,10): run-time error CSS1025: Expected comma or open brace, found 'md5_cmn('
(977,10): run-time error CSS1031: Expected selector, found 'md5_ff('
(977,10): run-time error CSS1025: Expected comma or open brace, found 'md5_ff('
(981,10): run-time error CSS1031: Expected selector, found 'md5_gg('
(981,10): run-time error CSS1025: Expected comma or open brace, found 'md5_gg('
(985,10): run-time error CSS1031: Expected selector, found 'md5_hh('
(985,10): run-time error CSS1025: Expected comma or open brace, found 'md5_hh('
(989,10): run-time error CSS1031: Expected selector, found 'md5_ii('
(989,10): run-time error CSS1025: Expected comma or open brace, found 'md5_ii('
(997,10): run-time error CSS1031: Expected selector, found 'core_hmac_md5('
(997,10): run-time error CSS1025: Expected comma or open brace, found 'core_hmac_md5('
(1017,10): run-time error CSS1031: Expected selector, found 'safe_add('
(1017,10): run-time error CSS1025: Expected comma or open brace, found 'safe_add('
(1027,10): run-time error CSS1031: Expected selector, found 'bit_rol('
(1027,10): run-time error CSS1025: Expected comma or open brace, found 'bit_rol('
(1036,10): run-time error CSS1031: Expected selector, found 'str2binl('
(1036,10): run-time error CSS1025: Expected comma or open brace, found 'str2binl('
(1048,10): run-time error CSS1031: Expected selector, found 'binl2str('
(1048,10): run-time error CSS1025: Expected comma or open brace, found 'binl2str('
(1060,10): run-time error CSS1031: Expected selector, found 'binl2hex('
(1060,10): run-time error CSS1025: Expected comma or open brace, found 'binl2hex('
(1075,10): run-time error CSS1031: Expected selector, found 'binl2b64('
(1075,10): run-time error CSS1025: Expected comma or open brace, found 'binl2b64('
(1094,12): run-time error CSS1031: Expected selector, found '='
(1094,12): run-time error CSS1025: Expected comma or open brace, found '='
(1099,12): run-time error CSS1031: Expected selector, found '='
(1099,12): run-time error CSS1025: Expected comma or open brace, found '='
(1131,18): run-time error CSS1031: Expected selector, found '='
(1131,18): run-time error CSS1025: Expected comma or open brace, found '='
(1228,13): run-time error CSS1031: Expected selector, found '='
(1228,13): run-time error CSS1025: Expected comma or open brace, found '='
(1229,13): run-time error CSS1031: Expected selector, found '='
(1229,13): run-time error CSS1025: Expected comma or open brace, found '='
(1230,15): run-time error CSS1031: Expected selector, found '='
(1230,15): run-time error CSS1025: Expected comma or open brace, found '='
(1231,15): run-time error CSS1031: Expected selector, found '='
(1231,15): run-time error CSS1025: Expected comma or open brace, found '='
(1237,18): run-time error CSS1031: Expected selector, found '='
(1237,18): run-time error CSS1025: Expected comma or open brace, found '='
(1250,21): run-time error CSS1031: Expected selector, found '='
(1250,21): run-time error CSS1025: Expected comma or open brace, found '='
(1296,15): run-time error CSS1031: Expected selector, found '='
(1296,15): run-time error CSS1025: Expected comma or open brace, found '='
(1341,14): run-time error CSS1031: Expected selector, found '='
(1341,14): run-time error CSS1025: Expected comma or open brace, found '='
(1343,8): run-time error CSS1031: Expected selector, found '('
(1343,8): run-time error CSS1025: Expected comma or open brace, found '('
(1373,13): run-time error CSS1031: Expected selector, found '='
(1373,13): run-time error CSS1025: Expected comma or open brace, found '='
(1656,17): run-time error CSS1031: Expected selector, found '='
(1656,17): run-time error CSS1025: Expected comma or open brace, found '='
(1690,12): run-time error CSS1031: Expected selector, found '='
(1690,12): run-time error CSS1025: Expected comma or open brace, found '='
(1734,16): run-time error CSS1031: Expected selector, found '='
(1734,16): run-time error CSS1025: Expected comma or open brace, found '='
(1771,13): run-time error CSS1031: Expected selector, found '='
(1771,13): run-time error CSS1025: Expected comma or open brace, found '='
(2532,1): run-time error CSS1019: Unexpected token, found '$'
(2532,2): run-time error CSS1019: Unexpected token, found '('
(2532,12): run-time error CSS1031: Expected selector, found '('
(2532,12): run-time error CSS1025: Expected comma or open brace, found '('
(2616,2): run-time error CSS1019: Unexpected token, found ')'
(2617,13): run-time error CSS1031: Expected selector, found '='
(2617,13): run-time error CSS1025: Expected comma or open brace, found '='
(2618,12): run-time error CSS1031: Expected selector, found '='
(2618,12): run-time error CSS1025: Expected comma or open brace, found '='
(2619,10): run-time error CSS1031: Expected selector, found '='
(2619,10): run-time error CSS1025: Expected comma or open brace, found '='
(2620,10): run-time error CSS1031: Expected selector, found 'getuid('
(2620,10): run-time error CSS1025: Expected comma or open brace, found 'getuid('
(2621,4): run-time error CSS1031: Expected selector, found '('
(2621,4): run-time error CSS1025: Expected comma or open brace, found '('
(2624,10): run-time error CSS1035: Expected colon, found '='
(2627,10): run-time error CSS1031: Expected selector, found 'initVideo('
(2627,10): run-time error CSS1025: Expected comma or open brace, found 'initVideo('
(2696,10): run-time error CSS1031: Expected selector, found 'AddClose('
(2696,10): run-time error CSS1025: Expected comma or open brace, found 'AddClose('
(2700,10): run-time error CSS1031: Expected selector, found 'RemoveClose('
(2700,10): run-time error CSS1025: Expected comma or open brace, found 'RemoveClose('
(2704,1): run-time error CSS1019: Unexpected token, found 'jQuery('
(2704,8): run-time error CSS1019: Unexpected token, found '"#ContentBody"'
(2704,22): run-time error CSS1019: Unexpected token, found ')'
(2704,24): run-time error CSS1030: Expected identifier, found 'on('
(2704,24): run-time error CSS1019: Unexpected token, found 'on('
(2704,27): run-time error CSS1019: Unexpected token, found '"click"'
(2704,34): run-time error CSS1019: Unexpected token, found ','
(2704,36): run-time error CSS1019: Unexpected token, found '".closevideo"'
(2704,49): run-time error CSS1019: Unexpected token, found ','
(2704,60): run-time error CSS1031: Expected selector, found '('
(2704,60): run-time error CSS1025: Expected comma or open brace, found '('
(2717,2): run-time error CSS1019: Unexpected token, found ')'
(2719,10): run-time error CSS1031: Expected selector, found 'VideoSmall('
(2719,10): run-time error CSS1025: Expected comma or open brace, found 'VideoSmall('
(2745,10): run-time error CSS1031: Expected selector, found 'initLangKeVideo('
(2745,10): run-time error CSS1025: Expected comma or open brace, found 'initLangKeVideo('
(2770,1): run-time error CSS1019: Unexpected token, found 'initLangKeVideo('
(2770,17): run-time error CSS1019: Unexpected token, found ')'
(2771,1): run-time error CSS1019: Unexpected token, found 'jQuery('
(2771,14): run-time error CSS1031: Expected selector, found ')'
(2771,14): run-time error CSS1025: Expected comma or open brace, found ')'
(2773,2): run-time error CSS1019: Unexpected token, found ')'
(2774,1): run-time error CSS1019: Unexpected token, found 'jQuery('
(2774,17): run-time error CSS1031: Expected selector, found '('
(2774,17): run-time error CSS1025: Expected comma or open brace, found '('
(3104,2): run-time error CSS1019: Unexpected token, found ')'
(3105,1): run-time error CSS1019: Unexpected token, found '!'
(3105,2): run-time error CSS1019: Unexpected token, found 'function('
(3105,12): run-time error CSS1031: Expected selector, found ')'
(3105,12): run-time error CSS1025: Expected comma or open brace, found ')'
(3105,489): run-time error CSS1019: Unexpected token, found '('
(3105,490): run-time error CSS1019: Unexpected token, found '{'
(3105,491): run-time error CSS1019: Unexpected token, found '3'
(3105,507): run-time error CSS1062: Expected semicolon or closing curly-brace, found '!'
(3105,3746): run-time error CSS1019: Unexpected token, found ','
(3105,3747): run-time error CSS1019: Unexpected token, found '8'
(3105,3769): run-time error CSS1035: Expected colon, found 'o'
(3105,3782): run-time error CSS1035: Expected colon, found '.'
(3105,3792): run-time error CSS1019: Unexpected token, found '}'
(3105,3793): run-time error CSS1019: Unexpected token, found ')'
 */
/*!
 * SuperSlide v2.1.1 
 * 轻松解决网站大部分特效展示问题
 * 详尽信息请看官网：http://www.SuperSlide2.com/
 *
 * Copyright 2011-2013, 大话主席
 *
 * 请尊重原创，保留头部版权
 * 在保留版权的前提下可应用于个人或商业用途

 * v2.1.1：修复当调用多个SuperSlide，并设置returnDefault:true 时返回defaultIndex索引错误

 */

(function ($) {
	$.fn.slide = function (options) {
		$.fn.slide.defaults = {
			type: "slide",
			effect: "fade",
			autoPlay: false,
			delayTime: 500,
			interTime: 2500,
			triggerTime: 150,
			defaultIndex: 0,
			titCell: ".hd li",
			mainCell: ".bd",
			targetCell: null,
			trigger: "mouseover",
			scroll: 1,
			vis: 1, //可视个数
			titOnClassName: "on",
			autoPage: false,
			prevCell: ".prev",
			nextCell: ".next",
			pageStateCell: ".pageState",
			opp: false,
			pnLoop: true,
			easing: "swing",
			startFun: null,
			endFun: null,
			switchLoad: null,

			playStateCell: ".playState",
			mouseOverStop: true,
			defaultPlay: true,
			returnDefault: false
		};

		return this.each(function () {

			var opts = $.extend({}, $.fn.slide.defaults, options);
			var slider = $(this);
			var effect = opts.effect;
			var prevBtn = $(opts.prevCell, slider);
			var nextBtn = $(opts.nextCell, slider);
			var pageState = $(opts.pageStateCell, slider);
			var playState = $(opts.playStateCell, slider);

			var navObj = $(opts.titCell, slider); //导航子元素结合
			var navObjSize = navObj.size();
			var conBox = $(opts.mainCell, slider); //内容元素父层对象
			var conBoxSize = conBox.children().size();
			var sLoad = opts.switchLoad;
			var tarObj = $(opts.targetCell, slider);

			/*字符串转换*/
			var index = parseInt(opts.defaultIndex);
			var delayTime = parseInt(opts.delayTime);
			var interTime = parseInt(opts.interTime);
			var triggerTime = parseInt(opts.triggerTime);
			var scroll = parseInt(opts.scroll);
			var vis = parseInt(opts.vis);
			var autoPlay = (opts.autoPlay == "false" || opts.autoPlay == false) ? false : true;
			var opp = (opts.opp == "false" || opts.opp == false) ? false : true;
			var autoPage = (opts.autoPage == "false" || opts.autoPage == false) ? false : true;
			var pnLoop = (opts.pnLoop == "false" || opts.pnLoop == false) ? false : true;
			var mouseOverStop = (opts.mouseOverStop == "false" || opts.mouseOverStop == false) ? false : true;
			var defaultPlay = (opts.defaultPlay == "false" || opts.defaultPlay == false) ? false : true;
			var returnDefault = (opts.returnDefault == "false" || opts.returnDefault == false) ? false : true;

			var slideH = 0;
			var slideW = 0;
			var selfW = 0;
			var selfH = 0;
			var easing = opts.easing;
			var inter = null; //autoPlay-setInterval 
			var mst = null; //trigger-setTimeout
			var rtnST = null; //returnDefault-setTimeout
			var titOn = opts.titOnClassName;

			var onIndex = navObj.index(slider.find("." + titOn));
			var oldIndex = index = onIndex == -1 ? index : onIndex;
			var defaultIndex = index;


			var _ind = index;
			var cloneNum = conBoxSize >= vis ? (conBoxSize % scroll != 0 ? conBoxSize % scroll : scroll) : 0;
			var _tar;
			var isMarq = effect == "leftMarquee" || effect == "topMarquee" ? true : false;

			var doStartFun = function () {
				if ($.isFunction(opts.startFun)) {
					opts.startFun(index, navObjSize, slider, $(opts.titCell, slider), conBox, tarObj, prevBtn, nextBtn)
				}
			}
			var doEndFun = function () {
				if ($.isFunction(opts.endFun)) {
					opts.endFun(index, navObjSize, slider, $(opts.titCell, slider), conBox, tarObj, prevBtn, nextBtn)
				}
			}
			var resetOn = function () {
				navObj.removeClass(titOn);
				if (defaultPlay) navObj.eq(defaultIndex).addClass(titOn)
			}



			//单独处理菜单效果
			if (opts.type == "menu") {

				if (defaultPlay) {
					navObj.removeClass(titOn).eq(index).addClass(titOn);
				}
				navObj.hover(
					function () {
						_tar = $(this).find(opts.targetCell);
						var hoverInd = navObj.index($(this));

						mst = setTimeout(function () {
							index = hoverInd;
							navObj.removeClass(titOn).eq(index).addClass(titOn);
							doStartFun();
							switch (effect) {
								case "fade":
									_tar.stop(true, true).animate({
										opacity: "show"
									}, delayTime, easing, doEndFun);
									break;
								case "slideDown":
									_tar.stop(true, true).animate({
										height: "show"
									}, delayTime, easing, doEndFun);
									break;
							}
						}, opts.triggerTime);

					},
					function () {
						clearTimeout(mst);
						switch (effect) {
							case "fade":
								_tar.animate({
									opacity: "hide"
								}, delayTime, easing);
								break;
							case "slideDown":
								_tar.animate({
									height: "hide"
								}, delayTime, easing);
								break;
						}
					}
				);

				if (returnDefault) {
					slider.hover(function () {
						clearTimeout(rtnST);
					}, function () {
						rtnST = setTimeout(resetOn, delayTime);
					});
				}


				return;
			}


			//处理分页
			if (navObjSize == 0) navObjSize = conBoxSize; //只有左右按钮
			if (isMarq) navObjSize = 2;
			if (autoPage) {
				if (conBoxSize >= vis) {
					if (effect == "leftLoop" || effect == "topLoop") {
						navObjSize = conBoxSize % scroll != 0 ? (conBoxSize / scroll ^ 0) + 1 : conBoxSize / scroll;
					} else {
						var tempS = conBoxSize - vis;
						navObjSize = 1 + parseInt(tempS % scroll != 0 ? (tempS / scroll + 1) : (tempS / scroll));
						if (navObjSize <= 0) navObjSize = 1;
					}
				} else {
					navObjSize = 1
				}

				navObj.html("");
				var str = "";

				if (opts.autoPage == true || opts.autoPage == "true") {
					for (var i = 0; i < navObjSize; i++) {
						str += "<li>" + (i + 1) + "</li>"
					}
				} else {
					for (var i = 0; i < navObjSize; i++) {
						str += opts.autoPage.replace("$", (i + 1))
					}
				}
				navObj.html(str);

				var navObj = navObj.children(); //重置导航子元素对象
			}
			if (conBoxSize >= vis) { //当内容个数少于可视个数，不执行效果。
				conBox.children().each(function () { //取最大值
					if ($(this).width() > selfW) {
						selfW = $(this).width();
						slideW = $(this).outerWidth(true);
					}
					if ($(this).height() > selfH) {
						selfH = $(this).height();
						slideH = $(this).outerHeight(true);
					}
				});
				var _chr = conBox.children();
				var cloneEle = function () {
					for (var i = 0; i < vis; i++) {
						_chr.eq(i).clone().addClass("clone").appendTo(conBox);
					}
					for (var i = 0; i < cloneNum; i++) {
						_chr.eq(conBoxSize - i - 1).clone().addClass("clone").prependTo(conBox);
					}
				}

				switch (effect) {
					case "fold":
						conBox.css({
							"position": "relative",
							"width": slideW,
							"height": slideH
						}).children().css({
							"position": "absolute",
							"width": selfW,
							"left": 0,
							"top": 0,
							"display": "none"
						});
						break;
					case "top":
						conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:' + vis * slideH + 'px"></div>').css({
							"top": -(index * scroll) * slideH,
							"position": "relative",
							"padding": "0",
							"margin": "0"
						}).children().css({
							"height": selfH
						});
						break;
					case "left":
						conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:' + vis * slideW + 'px"></div>').css({
							"width": conBoxSize * slideW,
							"left": -(index * scroll) * slideW,
							"position": "relative",
							"overflow": "hidden",
							"padding": "0",
							"margin": "0"
						}).children().css({
							"float": "left",
							"width": selfW
						});
						break;
					case "leftLoop":
					case "leftMarquee":
						cloneEle();
						conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:' + vis * slideW + 'px"></div>').css({
							"width": (conBoxSize + vis + cloneNum) * slideW,
							"position": "relative",
							"overflow": "hidden",
							"padding": "0",
							"margin": "0",
							"left": -(cloneNum + index * scroll) * slideW
						}).children().css({
							"float": "left",
							"width": selfW
						});
						break;
					case "topLoop":
					case "topMarquee":
						cloneEle();
						conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:' + vis * slideH + 'px"></div>').css({
							"height": (conBoxSize + vis + cloneNum) * slideH,
							"position": "relative",
							"padding": "0",
							"margin": "0",
							"top": -(cloneNum + index * scroll) * slideH
						}).children().css({
							"height": selfH
						});
						break;
				}
			}



			//针对leftLoop、topLoop的滚动个数
			var scrollNum = function (ind) {
				var _tempCs = ind * scroll;
				if (ind == navObjSize) {
					_tempCs = conBoxSize;
				} else if (ind == -1 && conBoxSize % scroll != 0) {
					_tempCs = -conBoxSize % scroll;
				}
				return _tempCs;
			}

			//切换加载
			var doSwitchLoad = function (objs) {

				var changeImg = function (t) {
					for (var i = t; i < (vis + t); i++) {
						objs.eq(i).find("img[" + sLoad + "]").each(function () {
							var _this = $(this);
							_this.attr("src", _this.attr(sLoad)).removeAttr(sLoad);
							if (conBox.find(".clone")[0]) { //如果存在.clone
								var chir = conBox.children();
								for (var j = 0; j < chir.size(); j++) {
									chir.eq(j).find("img[" + sLoad + "]").each(function () {
										if ($(this).attr(sLoad) == _this.attr("src")) $(this).attr("src", $(this).attr(sLoad)).removeAttr(sLoad)
									})
								}
							}
						})
					}
				}

				switch (effect) {
					case "fade":
					case "fold":
					case "top":
					case "left":
					case "slideDown":
						changeImg(index * scroll);
						break;
					case "leftLoop":
					case "topLoop":
						changeImg(cloneNum + scrollNum(_ind));
						break;
					case "leftMarquee":
					case "topMarquee":
						var curS = effect == "leftMarquee" ? conBox.css("left").replace("px", "") : conBox.css("top").replace("px", "");
						var slideT = effect == "leftMarquee" ? slideW : slideH;
						var mNum = cloneNum;
						if (curS % slideT != 0) {
							var curP = Math.abs(curS / slideT ^ 0);
							if (index == 1) {
								mNum = cloneNum + curP
							} else {
								mNum = cloneNum + curP - 1
							}
						}
						changeImg(mNum);
						break;
				}
			} //doSwitchLoad end


			//效果函数
			var doPlay = function (init) {
				// 当前页状态不触发效果
				if (defaultPlay && oldIndex == index && !init && !isMarq) return;

				//处理页码
				if (isMarq) {
					if (index >= 1) {
						index = 1;
					} else if (index <= 0) {
						index = 0;
					}
				} else {
					_ind = index;
					if (index >= navObjSize) {
						index = 0;
					} else if (index < 0) {
						index = navObjSize - 1;
					}
				}

				doStartFun();

				//处理切换加载
				if (sLoad != null) {
					doSwitchLoad(conBox.children())
				}

				//处理targetCell
				if (tarObj[0]) {
					_tar = tarObj.eq(index);
					if (sLoad != null) {
						doSwitchLoad(tarObj)
					}
					if (effect == "slideDown") {
						tarObj.not(_tar).stop(true, true).slideUp(delayTime);
						_tar.slideDown(delayTime, easing, function () {
							if (!conBox[0]) doEndFun()
						});
					} else {
						tarObj.not(_tar).stop(true, true).hide();
						_tar.animate({
							opacity: "show"
						}, delayTime, function () {
							if (!conBox[0]) doEndFun()
						});
					}
				}

				if (conBoxSize >= vis) { //当内容个数少于可视个数，不执行效果。
					switch (effect) {
						case "fade":
							conBox.children().stop(true, true).eq(index).animate({
								opacity: "show"
							}, delayTime, easing, function () {
								doEndFun()
							}).siblings().hide();
							break;
						case "fold":
							conBox.children().stop(true, true).eq(index).animate({
								opacity: "show"
							}, delayTime, easing, function () {
								doEndFun()
							}).siblings().animate({
								opacity: "hide"
							}, delayTime, easing);
							break;
						case "top":
							conBox.stop(true, false).animate({
								"top": -index * scroll * slideH
							}, delayTime, easing, function () {
								doEndFun()
							});
							break;
						case "left":
							conBox.stop(true, false).animate({
								"left": -index * scroll * slideW
							}, delayTime, easing, function () {
								doEndFun()
							});
							break;
						case "leftLoop":
							var __ind = _ind;
							conBox.stop(true, true).animate({
								"left": -(scrollNum(_ind) + cloneNum) * slideW
							}, delayTime, easing, function () {
								if (__ind <= -1) {
									conBox.css("left", -(cloneNum + (navObjSize - 1) * scroll) * slideW);
								} else if (__ind >= navObjSize) {
									conBox.css("left", -cloneNum * slideW);
								}
								doEndFun();
							});
							break; //leftLoop end

						case "topLoop":
							var __ind = _ind;
							conBox.stop(true, true).animate({
								"top": -(scrollNum(_ind) + cloneNum) * slideH
							}, delayTime, easing, function () {
								if (__ind <= -1) {
									conBox.css("top", -(cloneNum + (navObjSize - 1) * scroll) * slideH);
								} else if (__ind >= navObjSize) {
									conBox.css("top", -cloneNum * slideH);
								}
								doEndFun();
							});
							break; //topLoop end

						case "leftMarquee":
							var tempLeft = conBox.css("left").replace("px", "");
							if (index == 0) {
								conBox.animate({
									"left": ++tempLeft
								}, 0, function () {
									if (conBox.css("left").replace("px", "") >= 0) {
										conBox.css("left", -conBoxSize * slideW)
									}
								});
							} else {
								conBox.animate({
									"left": --tempLeft
								}, 0, function () {
									if (conBox.css("left").replace("px", "") <= -(conBoxSize + cloneNum) * slideW) {
										conBox.css("left", -cloneNum * slideW)
									}
								});
							}
							break; // leftMarquee end

						case "topMarquee":
							var tempTop = conBox.css("top").replace("px", "");
							if (index == 0) {
								conBox.animate({
									"top": ++tempTop
								}, 0, function () {
									if (conBox.css("top").replace("px", "") >= 0) {
										conBox.css("top", -conBoxSize * slideH)
									}
								});
							} else {
								conBox.animate({
									"top": --tempTop
								}, 0, function () {
									if (conBox.css("top").replace("px", "") <= -(conBoxSize + cloneNum) * slideH) {
										conBox.css("top", -cloneNum * slideH)
									}
								});
							}
							break; // topMarquee end

					} //switch end
				}

				navObj.removeClass(titOn).eq(index).addClass(titOn);
				oldIndex = index;
				if (!pnLoop) { //pnLoop控制前后按钮是否继续循环
					nextBtn.removeClass("nextStop");
					prevBtn.removeClass("prevStop");
					if (index == 0) {
						prevBtn.addClass("prevStop");
					}
					if (index == navObjSize - 1) {
						nextBtn.addClass("nextStop");
					}
				}

				pageState.html("<span>" + (index + 1) + "</span>/" + navObjSize);

			}; // doPlay end

			//初始化执行
			if (defaultPlay) {
				doPlay(true);
			}

			if (returnDefault) //返回默认状态
			{
				slider.hover(function () {
					clearTimeout(rtnST)
				}, function () {
					rtnST = setTimeout(function () {
						index = defaultIndex;
						if (defaultPlay) {
							doPlay();
						} else {
							if (effect == "slideDown") {
								_tar.slideUp(delayTime, resetOn);
							} else {
								_tar.animate({
									opacity: "hide"
								}, delayTime, resetOn);
							}
						}
						oldIndex = index;
					}, 300);
				});
			}

			///自动播放函数
			var setInter = function (time) {
				inter = setInterval(function () {
					opp ? index-- : index++;
					doPlay()
				}, !!time ? time : interTime);
			}
			var setMarInter = function (time) {
				inter = setInterval(doPlay, !!time ? time : interTime);
			}
			// 处理mouseOverStop
			var resetInter = function () {
				if (!mouseOverStop) {
					clearInterval(inter);
					setInter()
				}
			}
			// 前后按钮触发
			var nextTrigger = function () {
				if (pnLoop || index != navObjSize - 1) {
					index++;
					doPlay();
					if (!isMarq) resetInter();
				}
			}
			var prevTrigger = function () {
				if (pnLoop || index != 0) {
					index--;
					doPlay();
					if (!isMarq) resetInter();
				}
			}
			//处理playState
			var playStateFun = function () {
				clearInterval(inter);
				isMarq ? setMarInter() : setInter();
				playState.removeClass("pauseState")
			}
			var pauseStateFun = function () {
				clearInterval(inter);
				playState.addClass("pauseState");
			}

			//自动播放
			if (autoPlay) {
				if (isMarq) {
					opp ? index-- : index++;
					setMarInter();
					if (mouseOverStop) conBox.hover(pauseStateFun, playStateFun);
				} else {
					setInter();
					if (mouseOverStop) slider.hover(pauseStateFun, playStateFun);
				}
			} else {
				if (isMarq) {
					opp ? index-- : index++;
				}
				playState.addClass("pauseState");
			}

			playState.click(function () {
				playState.hasClass("pauseState") ? playStateFun() : pauseStateFun()
			});

			//titCell事件
			if (opts.trigger == "mouseover") {
				navObj.hover(function () {
					var hoverInd = navObj.index(this);
					mst = setTimeout(function () {
						index = hoverInd;
						doPlay();
						resetInter();
					}, opts.triggerTime);
				}, function () {
					clearTimeout(mst)
				});
			} else {
				navObj.click(function () {
					index = navObj.index(this);
					doPlay();
					resetInter();
				})
			}

			//前后按钮事件
			if (isMarq) {

				nextBtn.mousedown(nextTrigger);
				prevBtn.mousedown(prevTrigger);
				//前后按钮长按10倍加速
				if (pnLoop) {
					var st;
					var marDown = function () {
						st = setTimeout(function () {
							clearInterval(inter);
							setMarInter(interTime / 10 ^ 0)
						}, 150)
					}
					var marUp = function () {
						clearTimeout(st);
						clearInterval(inter);
						setMarInter()
					}
					nextBtn.mousedown(marDown);
					nextBtn.mouseup(marUp);
					prevBtn.mousedown(marDown);
					prevBtn.mouseup(marUp);
				}
				//前后按钮mouseover事件
				if (opts.trigger == "mouseover") {
					nextBtn.hover(nextTrigger, function () {});
					prevBtn.hover(prevTrigger, function () {});
				}
			} else {
				nextBtn.click(nextTrigger);
				prevBtn.click(prevTrigger);
			}

		}); //each End

	}; //slide End

})(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;
	}
});

/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */

/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */
var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */

/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */
function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }

/*
 * Perform a simple self-test to see if the VM is working
 */
function md5_vm_test()
{
  return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}

/*
 * Calculate the MD5 of an array of little-endian words, and a bit length
 */
function core_md5(x, len)
{
  /* append padding */
  x[len >> 5] |= 0x80 << ((len) % 32);
  x[(((len + 64) >>> 9) << 4) + 14] = len;

  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;

  for(var i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;

    a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
    d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
    c = md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
    b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
    a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
    d = md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
    c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
    b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
    a = md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
    d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
    c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
    b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
    a = md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
    d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
    c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
    b = md5_ff(b, c, d, a, x[i+15], 22,  1236535329);

    a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
    d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
    c = md5_gg(c, d, a, b, x[i+11], 14,  643717713);
    b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
    a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
    d = md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
    c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
    b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
    a = md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
    d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
    c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
    b = md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
    a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
    d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
    c = md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
    b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);

    a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
    d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
    c = md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
    b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
    a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
    d = md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
    c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
    b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
    a = md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
    d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
    c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
    b = md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
    a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
    d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
    c = md5_hh(c, d, a, b, x[i+15], 16,  530742520);
    b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);

    a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
    d = md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
    c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
    b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
    a = md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
    d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
    c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
    b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
    a = md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
    d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
    c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
    b = md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
    a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
    d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
    c = md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
    b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
  }
  return Array(a, b, c, d);

}

/*
 * These functions implement the four basic operations the algorithm uses.
 */
function md5_cmn(q, a, b, x, s, t)
{
  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
  return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}

/*
 * Calculate the HMAC-MD5, of a key and some data
 */
function core_hmac_md5(key, data)
{
  var bkey = str2binl(key);
  if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  for(var i = 0; i < 16; i++)
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
  return core_md5(opad.concat(hash), 512 + 128);
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function safe_add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left.
 */
function bit_rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * Convert a string to an array of little-endian words
 * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
 */
function str2binl(str)
{
  var bin = Array();
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < str.length * chrsz; i += chrsz)
    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
  return bin;
}

/*
 * Convert an array of little-endian words to a string
 */
function binl2str(bin)
{
  var str = "";
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
  return str;
}

/*
 * Convert an array of little-endian words to a hex string.
 */
function binl2hex(binarray)
{
  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i++)
  {
    str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
           hex_tab.charAt((binarray[i>>2] >> ((i%4)*8  )) & 0xF);
  }
  return str;
}

/*
 * Convert an array of little-endian words to a base-64 string
 */
function binl2b64(binarray)
{
  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i += 3)
  {
    var triplet = (((binarray[i   >> 2] >> 8 * ( i   %4)) & 0xFF) << 16)
                | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
                |  ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
    for(var j = 0; j < 4; j++)
    {
      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
    }
  }
  return str;
}

//module.exports = hex_md5
var config = {
    "guba": "https://gbapi.eastmoney.com/",
    "push": "https://push2.eastmoney.com/"
};

var cookie = {
    get: function(name) {
        var xarr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
        if (xarr != null) return decodeURIComponent(xarr[2]);
        return null;
    },
    set: function(key, value, expiredays, domain) {
        var cookiestr = key + "=" + escape(value)

        if (expiredays != undefined) {
            var exdate = new Date();
            exdate.setDate(exdate.getDate() + expiredays);
            cookiestr += ";expires=" + exdate.toGMTString()
        }
        if (domain != undefined) {
            cookiestr += ";domain=" + domain;
        }
        cookiestr += ';path=/';
        document.cookie = cookiestr;

    },
    del: function(key, domain) {
        var exdate = new Date((new Date).getTime() - 1);
        if (domain) {
            document.cookie = key + '=;path=/;expires=' + exdate.toGMTString() + ';domain=' + domain;
        } else {
            document.cookie = key + '=;path=/;expires=' + exdate.toGMTString();
        }

    }
};

var userpassport = {
    /**
     * 获取用户信息
     */
    get: function () {
        if (cookie.get('ut') && cookie.get('ct') && cookie.get('uidal')) {

            //获取加v信息
            var jiav = { vtype: null, state: null, name: '' };
            if (cookie.get('vtpst') && cookie.get('vtpst') != '|') {
                var jiavarr = cookie.get('vtpst').split('|');
                if (jiavarr.length > 1) {
                    //console.info(typeof jiavarr[0]);
                    if (jiavarr[1] == "0" || jiavarr[1] == "3") {
                        switch (jiavarr[0]) {
                            case "301":
                                jiav.vtype = 1;
                                jiav.name = '理财师';
                                break;
                            case "302":
                                jiav.vtype = 2;
                                jiav.name = '非理财师';
                                break;
                            case "303":
                                jiav.vtype = 3;
                                jiav.name = '企业';
                                break;
                            default:
                                break;
                        }
                    }

                    switch (jiavarr[1]) {
                        case "0":
                            jiav.state = 0; //审核通过
                            break;
                        case "1":
                            jiav.state = 11; //审核未通过
                            break;
                        case "2":
                            jiav.state = 12; //审核中
                            break;
                        case "3":
                            jiav.state = 13; //加v用户修改审核
                            break;
                        case "8":
                            jiav.state = 18; //加v用户修改审核
                            break;
                        case "9":
                            jiav.state = 19; //加v用户修改审核
                            break;
                        default:
                            break;
                    }

                    //console.info(jiav);

                }
            }

            return {
                id: cookie.get('uidal').substring(0, 16),
                nick: cookie.get('uidal').substring(16),
                jiav: jiav
            };
        }
        return null;
    },
    /**
     * 退出登录
     * @param  {function} 退出之后回调
     */
    logOut: function (callback) {
        var date = new Date();
        document.cookie = "pi=;path=/;domain=eastmoney.com;expires=" + date.toGMTString();
        document.cookie = "ct=;path=/;domain=eastmoney.com;expires=" + date.toGMTString();
        document.cookie = "ut=;path=/;domain=eastmoney.com;expires=" + date.toGMTString();
        document.cookie = "uidal=;path=/;domain=eastmoney.com;expires=" + date.toGMTString();
        if (callback) {
            callback();
        }
    },
    isLogin: function () {
        if (this.get()) {
            return true;
        }
        else {
            return false;
        }
    },
    gotoLogin: function () {
        var loginurl = 'https://passport2.eastmoney.com/pub/login?backurl=' + encodeURIComponent(self.location.href)
        self.location = loginurl
        // window.open(loginurl)
    }
};

var _ctoken = cookie.get("ct");
var _utoken = cookie.get("ut");
var _GubaApiH = hex_md5("ctoken=" + _ctoken + "utoken=" + _utoken + "_519d77b29be442f8");
var _deviceid = "0d2798cab1716439a343c9965c20c59d";

/**
 * 格式化点赞收藏数
 * type: 0- ;1+ ;2不加不减
 */
var formatZanNum = function(count, type) {
    var num = parseInt(count) ? parseInt(count) : 0;
    var back = "";
    if (type == 2) {
        temp = num
    } else {
        temp = type ? num + 1 : num - 1;
    }
    back = temp > 99 ? "99+": temp > 0 ? temp: "";
    return back;
};

// 热搜
var hotSearchScroll = {
    init: function() {
        this.senter = null;
        this.time = 50;
        this.animation()

    },
    seter: function() {
        var _self = this;
        _self.senter = setInterval(function() {
            if (_self.lw >= _self.spanWidth) {
                _self.lw = 0
            } else {
                _self.lw++;
            }
            _self.newHtml.css({
                'right': _self.lw
            });

        },
		_self.time)
    },
    animation: function() {
        var _self = this,
		aWidth = 0;;
        _self._content = $('#hotnews');
        _self.aHtml = _self._content.html();
        $('a', _self._content).each(function() {
            aWidth += $(this).outerWidth() + 10;
        });
        _self.newHtml = $('<div style="width:' + aWidth * 2 + 'px"><span class="span">' + _self.aHtml + '</span><span>' + _self.aHtml + '</span></div>');
        _self._content.html(_self.newHtml);
        _self.lw = _self.newHtml.position().left;
        _self.spanWidth = $('.span', _self._content).outerWidth();

        _self.seter();
        _self._content.hover(function() {
            window.clearInterval(_self.senter)
        },
		function() {
		    _self.seter();
		})

    }
};

var quoteTree = {
    HuShen: { //沪深
        BigName: "沪深股市",
        Link: "http://quote.eastmoney.com/center/",
        Interface: config.push + "api/qt/ulist.np/get?ut=13697a1cc677c8bfa9a496437bfef419&fields=f1,f2,f3,f4,f12,f13,f14&secids=1.000001,0.399001,0.399006"
    },
    HK: { //港股
        BigName: "港股行情",
        Link: "http://quote.eastmoney.com/center/ggsc.html",
        Interface: config.push + "api/qt/ulist.np/get?ut=13697a1cc677c8bfa9a496437bfef419&fields=f1,f2,f3,f4,f12,f13,f14&secids=100.HSI",
        Interface2: config.push + "api/qt/kamt/get?fields1=f1,f2,f3,f4&fields2=f51,f52&ut=13697a1cc677c8bfa9a496437bfef419"
    },
    Gold: { //黄金
        BigName: "黄金行情",
        Link: "http://quote.eastmoney.com/center/hjsc.html",
        Interface: config.push + "api/qt/ulist.np/get?ut=13697a1cc677c8bfa9a496437bfef419&fields=f1,f2,f3,f4,f12,f13,f14&secids=101.GC00Y,101.SI00Y,113.aum,113.agm"
    },
    Futures: { //期货
        BigName: "期货行情",
        Link: "http://quote.eastmoney.com/center/futures.html",
        //Interface: config.push + "api/qt/clist/get?pn=1&pz=3&po=1&np=1&fltt=2&invt=2&fid=f3&fs=m:113+s:1,m:114+s:1,m:115+s:1,m:142+s:1&fields=f1,f2,f3,f4,f12,f13,f14,f152&ut=13697a1cc677c8bfa9a496437bfef419"
        Interface: config.push + "api/qt/clist/get?pn=1&pz=3&po=1&np=1&fid=f3&fs=m:113+s:1,m:114+s:1,m:115+s:1,m:142+s:1&fields=f1,f2,f3,f4,f12,f13,f14,f152&ut=13697a1cc677c8bfa9a496437bfef419"
    },
    Global: { //全球
        BigName: "全球指数",
        Link: "http://quote.eastmoney.com/center/qqzs.html",
        Interface: config.push + "api/qt/ulist.np/get?ut=13697a1cc677c8bfa9a496437bfef419&fields=f1,f2,f3,f4,f12,f13,f14&secids=1.000001,100.HSI,100.DJIA,100.N225,100.FTSE,101.GC00Y,102.CL00Y,100.UDI"
    },
    Option: { //期权
        BigName: "期权行情",
        Link: "http://quote.eastmoney.com/center/qqsc.html",
        //指数
        Interface: config.push + "api/qt/clist/get?pn=1&pz=1&po=1&np=1&fs=i:1.510050&fields=f1,f2,f3,f4,f12,f13,f14&ut=13697a1cc677c8bfa9a496437bfef419",
        //认购
        Interface2: config.push + "api/qt/clist/get?pn=1&pz=2&po=1&np=1&fltt=1&invt=2&fid=f6&fs=m:10+t:173&fields=f1,f2,f3,f4,f5,f12,f13,f14&ut=13697a1cc677c8bfa9a496437bfef419",
        //认沽
        Interface3: config.push + "api/qt/clist/get?pn=1&pz=2&po=1&np=1&fltt=1&invt=2&fid=f6&fs=m:10+t:174&fields=f1,f2,f3,f4,f5,f12,f13,f14&ut=13697a1cc677c8bfa9a496437bfef419"
    },
    Forex: { //外汇
        BigName: "外汇行情",
        Link: "http://quote.eastmoney.com/center/whsc.html",
        Interface: config.push + "api/qt/clist/get?pn=1&pz=4&po=1&np=1&fs=i:100.UDI,i:121.USDCNYI,i:121.HKDCNYI&fields=f1,f2,f3,f4,f12,f13,f14&ut=13697a1cc677c8bfa9a496437bfef419"
    }
};

var CurrTree = quoteTree.HuShen;
//window.CurrTree = CurrTree;
switch (_YM) {
    case "hk":
        //港股
        CurrTree = quoteTree.HK;
        break;
    case "gold":
        //黄金
        CurrTree = quoteTree.Gold;
        break;
    case "futures":
        //期货
        CurrTree = quoteTree.Futures;
        break;
    case "global":
        //全球
        CurrTree = quoteTree.Global;
        break;
    case "option":
        //期权
        CurrTree = quoteTree.Option;
        break;
    case "forex":
        //外汇
        CurrTree = quoteTree.Forex;
        break;
    default:
        break;
}

// 指数
var zsQuote = {
    init: function() {
        var that = this;
        that.initHTMLDom();
        that.formatData();
        setInterval(function() {
            that.formatData();
        },
		60 * 1000);
    },
    initHTMLDom: function() {
        $(".quotemodel .mtitle .tit").html(CurrTree.BigName);
        $(".quotemodel .mtitle .tit").attr("href", CurrTree.Link);
        $(".quotemodel .mtitle .more").attr("href", CurrTree.Link);
    },
    getQuoteData: function(_interface, _dom) {
        var that = this;
        return $.ajax({
            url: _interface,
            method: "GET",
            dataType: "jsonp",
            jsonp: "cb",
            success: function(json) {
                that.QuoteCB(json, _dom);
            }
        })
    },
    getZJLData: function(_interface, _dom) {
        var that = this;
        return $.ajax({
            url: _interface,
            method: "GET",
            dataType: "jsonp",
            jsonp: "cb",
            success: function(json) {
                that.ZJLCB(json, _dom);
            }
        })
    },
    QuoteCB: function(back, _dom) {
        var that = this;
        if (back.data && back.data.diff != "") {
            var arr = [];
            for (var _index in back.data.diff) {
                var item = back.data.diff[_index];

                arr.push({
                    zs: item.f2 / Math.pow(10, item.f1),
                    price: item.f4 / Math.pow(10, item.f1),
                    percent: item.f3 / 100,
                    name: item.f14,
                    mc: item.f13 + "." + item.f12,
                    f13: item.f13,
                    f12: item.f12
                })
            }

            that.renderDom(arr, _dom);
        }
    },
    getZDFInfo: function(str) {
        if (str === "" || str == "-") {
            return {
                _class: "",
                _data: "-"
            };
        } else {
            var dZdf = parseFloat(str);
            if (dZdf > 0) {
                return {
                    _class: "red",
                    _data: dZdf.toFixed(2) + "%"
                };
            } else if (dZdf < 0) {
                return {
                    _class: "green",
                    _data: dZdf.toFixed(2) + "%"
                };
            } else {
                return {
                    _class: "",
                    _data: dZdf.toFixed(2) + "%"
                };
            }
        }
    },
    getGSHNum: function(str, fix, num) {
        if (str === "" || str == "-") {
            return "-";
        } else {
            var result;
            var intStr = Math.abs(parseInt(str));
            if (intStr.toString().length > 12) {
                result = (parseFloat(str) / 1000000000000).toFixed(num) + '万亿' + fix;
            } else if (intStr.toString().length > 8) {
                result = (parseFloat(str) / 100000000).toFixed(num) + '亿' + fix;
            } else if (intStr.toString().length > 4) {
                result = (parseFloat(str) / 10000).toFixed(num) + '万' + fix;
            } else {
                if (parseFloat(str) === parseInt(str)) {
                    result = parseFloat(str) + fix;
                } else {
                    result = parseFloat(str).toFixed(num) + fix;
                }
            }
            return result;
        }
    },
    getHSGTStatus: function(_hsgtstatus) {
        switch (_hsgtstatus) {
            case 1:
                return "有额度";
            case 2:
                return "无额度";
            case 3:
                return "收盘";
            case 4:
                return "休市";
            default:
                return "-";
        }
    },
    ZJLCB: function(back, _dom) {
        var that = this;
        try {
            if (back && back.rc == 0 && back.data) {
                //hk2sh沪股通
                var hgtLR = that.getGSHNum(parseFloat(back.data.hk2sh.dayNetAmtIn) * 10000, "", 2);
                $("#hgtInflow").html(hgtLR);
                var hgtInfo = that.getZDFInfo(back.data.hk2sh.dayNetAmtIn);
                if (hgtInfo._class != "") {
                    $("#hgtInflow").addClass(hgtInfo._class);
                    if (hgtInfo._class == "green") {
                        $("#hgtInflow").parent().find("span").eq(0).html("资金净流出");
                        $("#hgtInflow").html(hgtLR.replace("-", ""));
                    } else {
                        $("#hgtInflow").parent().find("span").eq(0).html("资金净流入");
                    }
                } else {
                    $("#hgtInflow").parent().find("span").eq(0).html("资金净流入");
                }
                $(".hgtstatus").html(that.getHSGTStatus(back.data.hk2sh.status));
                if (back.data.hk2sh.status == 4) {
                    $("#hgtInflow").parent().html("-");
                }

                //sh2hk港股通(沪)
                var ggthLR = that.getGSHNum(parseFloat(back.data.sh2hk.dayNetAmtIn) * 10000, "", 2);
                $("#ggthInflow").html(ggthLR);
                var ggthInfo = that.getZDFInfo(back.data.sh2hk.dayNetAmtIn);
                if (ggthInfo._class != "") {
                    $("#ggthInflow").addClass(ggthInfo._class);
                    if (ggthInfo._class == "green") {
                        $("#ggthInflow").parent().find("span").eq(0).html("资金净流出");
                        $("#ggthInflow").html(ggthLR.replace("-", ""));
                    } else {
                        $("#ggthInflow").parent().find("span").eq(0).html("资金净流入");
                    }
                } else {
                    $("#ggthInflow").parent().find("span").eq(0).html("资金净流入");
                }
                $(".ggthstatus").html(that.getHSGTStatus(back.data.sh2hk.status));
                if (back.data.sh2hk.status == 4) {
                    $("#ggthInflow").parent().html("-");
                }

                //hk2sz深股通
                var sgtLR = that.getGSHNum(parseFloat(back.data.hk2sz.dayNetAmtIn) * 10000, "", 2);
                $("#sgtInflow").html(sgtLR);
                var sgtInfo = that.getZDFInfo(back.data.hk2sz.dayNetAmtIn);
                if (sgtInfo._class != "") {
                    $("#sgtInflow").addClass(sgtInfo._class);
                    if (sgtInfo._class == "green") {
                        $("#sgtInflow").parent().find("span").eq(0).html("资金净流出");
                        $("#sgtInflow").html(sgtLR.replace("-", ""));
                    } else {
                        $("#sgtInflow").parent().find("span").eq(0).html("资金净流入");
                    }
                } else {
                    $("#sgtInflow").parent().find("span").eq(0).html("资金净流入");
                }
                $(".sgtstatus").html(that.getHSGTStatus(back.data.hk2sz.status));
                if (back.data.hk2sz.status == 4) {
                    $("#sgtInflow").parent().html("-");
                }

                //sz2hk港股通(深)
                var ggtsLR = that.getGSHNum(parseFloat(back.data.sz2hk.dayNetAmtIn) * 10000, "", 2);
                $("#ggtsInflow").html(ggtsLR);
                var ggtsInfo = that.getZDFInfo(back.data.sz2hk.dayNetAmtIn);
                if (ggtsInfo._class != "") {
                    $("#ggtsInflow").addClass(ggtsInfo._class);
                    if (ggtsInfo._class == "green") {
                        $("#ggtsInflow").parent().find("span").eq(0).html("资金净流出");
                        $("#ggtsInflow").html(ggtsLR.replace("-", ""));
                    } else {
                        $("#ggtsInflow").parent().find("span").eq(0).html("资金净流入");
                    }
                } else {
                    $("#ggtsInflow").parent().find("span").eq(0).html("资金净流入");
                }
                $(".ggtsstatus").html(that.getHSGTStatus(back.data.sz2hk.status));
                if (back.data.sz2hk.status == 4) {
                    $("#ggtsInflow").parent().html("-");
                }
            }
            _dom.show();
        } catch(error) {
            //console.log(error.message);
            _dom.hide();
            return false;
        }
    },
    formatData: function() {
        var that = this;
        that.getQuoteData(CurrTree.Interface, $("#quotedom"));
        if (_YM == "option") { //期权
            that.getQuoteData(CurrTree.Interface2, $("#quotedom2"));
            that.getQuoteData(CurrTree.Interface3, $("#quotedom3"));
        } else if (_YM == "hk") {
            that.getZJLData(CurrTree.Interface2, $("#quotedomzjl"));
        }
    },
    renderDom: function (zsinfos, _dom) {
        var that = this;
        if (zsinfos && zsinfos.length) {
            var _html = '';
            for (var i = 0; i < zsinfos.length; i++) {
                var szzs = ((zsinfos[i].zs === "" || zsinfos[i].zs == "-") ? "-": zsinfos[i].zs);
                var szprice = ((zsinfos[i].price === "" || zsinfos[i].price == "-") ? "-": zsinfos[i].price);
                var szpercent = ((zsinfos[i].percent === "" || zsinfos[i].percent == "-") ? "-": parseFloat(zsinfos[i].percent).toFixed(2) + "%");
                var szname = zsinfos[i].name;

                var _icon = "";
                var _color = "";
                if (zsinfos[i].percent > 0) {
                    _icon = "icon up";
                    _color = "red";
                } else if (zsinfos[i].percent < 0) {
                    _icon = "icon down";
                    _color = "green";
                } else {
                    _icon = "icon";
                    _color = "";
                }

                _html += '<div class="zsitem" data-mc="' + zsinfos[i].mc + '"' + ((window.QuoteshowDom == zsinfos[i].mc) ? ' style="height:180px"' : '') + '>';
                //_html += '<ul' + ((window.QuoteshowDom == zsinfos[i].mc) ? ' openimg="show"' : '') + '>';
                _html += '<ul>';
                if (zsinfos[i].mc == "121.USDCNYI" || zsinfos[i].mc == "121.HKDCNYI") {
                    _html += '<li class="zsname" style="font-size:12px;">' + szname + '</li>';
                } else if (szname.indexOf("ETF购") > 0) {
                    _html += '<li class="zsname" style="line-height: 20px;padding: 4px 0;">' + szname.substring(0, szname.indexOf("ETF购") + 4) + '<br>' + szname.substring(szname.indexOf("ETF购") + 4) + '</li>';
                } else if (szname.indexOf("ETF沽") > 0) {
                    _html += '<li class="zsname" style="line-height: 20px;padding: 4px 0;">' + szname.substring(0, szname.indexOf("ETF沽") + 4) + '<br>' + szname.substring(szname.indexOf("ETF沽") + 4) + '</li>';
                } else {
                    _html += '<li class="zsname">' + szname + '</li>';
                }
                _html += '<li class="zsprice"><span style="color:' + _color + ';">' + szzs + '</span><span style="color:' + _color + ';" class="' + _icon + '"></span></li>';
                _html += '<li class="zszde"><span style="color:' + _color + ';">' + szprice + '</span><span style="color:' + _color + ';" class="' + _icon + '"></span></li>';
                _html += '<li class="zszdf"><span style="color:' + _color + ';">' + szpercent + '</span><span style="color:' + _color + ';" class="' + _icon + '"></span></li>';
                _html += '</ul>';
                _html += '<div class="quoteimg">';
                _html += '<a href="http://quote.eastmoney.com/unify/r/' + zsinfos[i].mc + '" target="_blank">';
                _html += '<img src="//webquotepic.eastmoney.com/GetPic.aspx?nid=' + zsinfos[i].mc + '&imageType=rtop&token=e1fc716525030b5517f9968fe65eb25d&timespan=' + Math.random() + '">';
                _html += '</a>';
                _html += '</div>';
                _html += '</div>';
            }
            _dom.html(_html);

            if (window.QuoteshowDom == undefined && _dom.attr("id") == "quotedom") {//第一次进入
                $(".quotedom .zsitem").eq(0).css({ "height": "180px" });//设置第一个高度，让图片显示出来
                //$(".quotedom .zsitem ul").eq(0).attr("openimg", "show");//为第一个ul新增样式
                window.QuoteshowDom = $(".quotedom .zsitem").eq(0).data("mc");
            }
        }
    }
};

/**
 * 点赞+1
 */
var creatAddlab = function(e) {
    var $body = document.getElementsByTagName("body")[0];
    var $lab = document.createElement("b");
    var diff = 0,
	anim, x = e.pageX,
	y = e.pageY;
    var style = $lab.style;
    style.color = "#E94F06";
    style.zIndex = 9999;
    style.position = "absolute";
    style.select = "none";
    style.left = (x - 10) + "px";
    style.top = (y - 20) + "px";
    style.fontSize = "16px";
    style.textShadow = "";
    $lab.innerText = "+1";
    clearInterval(anim);
    setTimeout(function() {
        anim = setInterval(function() {
            if (++diff == 100) {
                clearInterval(anim);
                $body.removeChild($lab);
            };
            style.left = (x - 10) + "px";
            style.top = y - 20 - diff + "px";
            style.opacity = (100 - diff) / 100;
        },
		10);
    },
	50);
    $body.appendChild($lab);
};

// 点赞
var zanObj = {
    // 点赞操作 $(this),haszan, 
    zanFun: function(e, $dom, type, articleId) {
        var _this = $dom;

        var haszan = _this.hasClass("zan") ? false: true;
        var _apiurl = haszan ? "CancelLikeArticle": "LikeArticle";

        $.ajax({
            url: config.guba + "likeopt/jsonp/" + _apiurl + "?id=" + articleId + "&type=1&deviceid=" + _deviceid + "&version=2&product=eastmoney&plat=web&h=" + _GubaApiH + "&ctoken=" + _ctoken + "&utoken=" + _utoken,
            method: "GET",
            dataType: "jsonp",
            jsonpCallback: "cb" + parseInt(Math.random() * 10000 + ""),
            success: function(res) {
                if (res && res.rc === 1) {
                    var prezanum = $("#post_like_count").attr("realnum") ? $("#post_like_count").attr("realnum") : 0;

                    if (_this.hasClass("zan")) {
                        _this.removeClass("zan").addClass("zananimate");

                        var num = formatZanNum(prezanum, 1);//+1
                        $("#post_like_count").text(num);
                        $("#post_like_count").attr("realnum", parseInt(prezanum) + 1);

                        setTimeout(function() {
                            _this.removeClass("zananimate").addClass("has_zan");
                        },
						600);

                        creatAddlab(e);
                    }
                    else {//取消
                        var num = formatZanNum(prezanum, 0);//-1
                        $("#post_like_count").text(num);
                        $("#post_like_count").attr("realnum", parseInt(prezanum) - 1);
                        _this.removeClass("has_zan").addClass("zan");
                    };
                }
            }
        });
    }
};

// 收藏
var collectObj = {
    // 收藏与取消收藏
    collectFun: function(e, $dom, type, articleId) {
        var _this = $dom;

        var hascollect = _this.hasClass("shoucang") ? false: true;
        var _apiurl = hascollect ? "CancelCollectArticle": "CollectArticle";

        $.ajax({
            url: config.guba + "collectopt/jsonp/" + _apiurl + "?postid=" + articleId + "&h=" + _GubaApiH + "&type=1&version=80008000&product=guba&plat=wap&deviceid=" + _deviceid + "&ctoken=" + _ctoken + "&utoken=" + _utoken,
            method: "GET",
            dataType: "jsonp",
            jsonpCallback: "cb" + parseInt(Math.random() * 10000 + ""),
            success: function(res) {
                if (res && res.rc === 1) {
                    //收藏
                    if (_this.hasClass("shoucang")) {
                        _this.removeClass("shoucang").addClass("scanimate");
                        setTimeout(function () {
                            _this.removeClass("scanimate").addClass("has_shoucang");
                        }, 600);

                        //_this.removeClass("shoucang").addClass("has_shoucang");

                        //creatAddlab(e);
                    }
                        //取消收藏
                    else {
                        _this.removeClass("has_shoucang scanimate").addClass("shoucang");
                        //_this.removeClass("has_shoucang").addClass("shoucang");
                    }
                }
            }
        });
    }
};

var zxzwObj = {
    /**
     * 初始化事件 
     */
    init: function () {

        // 搜索框初始化
        try {
            var StockCodeBar = new suggest2017({
                inputid: 'StockCode_bar',
                placeholder: '输入股票代码、名字、简拼或关键字',
                shownewtips: true,
                onSubmit: 'search',
                newtipsoffset: {
                    left: 6,
                    top: -1
                }
            });
        } catch (e) {

        }

        //获取点赞 收藏 分享 评论数  及相关状态
        this.getNewsArticleBriefInfo();

        //初始化字体大小
        this.loadFontSize();

        // 指数行情
        zsQuote.init();

        //dom 绑定事件
        this.bindEvent();

        // 热搜
        this.getHotNews();

        //固顶
        this.gudingFun();

        //热点推荐
        this.initRDTJ();

        //初始化行情股票链接及自选股
        this.initQuoteLink();

        //评论区域
        this.initPinLun();

    },
    /**
     * 获取点赞 收藏 分享 评论数  及相关状态
      * post_like_count 点赞数  
      * like_state 点赞状态
      * collect_state 收藏状态
      * post_forward_count 分享数
      * post_comment_count 评论数
     */
    getNewsArticleBriefInfo: function () {
        $.ajax({
            url: config.guba + "abstract/api/PostShort/NewsArticleBriefInfo?postid=" + _NewsId + "&type=1&version=80008000&product=guba&plat=web&deviceid=" + _deviceid + "&ctoken=" + _ctoken + "&utoken=" + _utoken,
            method: "GET",
            dataType: "jsonp",
            jsonpCallback: "cb" + parseInt(Math.random() * 10000 + ""),
            success: function (res) {
                if (res && res.rc == 1 && res.re && res.re.length > 0) {
                    var infos = res.re[0];
                    var post_like_count = infos.post_like_count,
                    like_state = infos.like_state,
                    collect_state = infos.collect_state,
                    post_forward_count = infos.post_forward_count,
                    post_comment_count = infos.post_comment_count;

                    //点赞数量
                    if (!!post_like_count) {
                        $("#post_like_count").attr("realnum", post_like_count);
                        $("#post_like_count").text(formatZanNum(post_like_count, 2));
                    }
                    //已点赞
                    if (!!like_state) {
                        $("#sharebox").find(".articlezan").removeClass("zan").addClass("has_zan");
                    };
                    //已经收藏
                    if (!!collect_state) {
                        $("#sharebox").find(".articlesc").removeClass("shoucang").addClass("has_shoucang");
                    };

                    //分享数
                    if (!!post_forward_count) {
                        $("#post_forward_count").text(formatZanNum(post_forward_count, 2));
                    };

                    //评论数
                    if (!!post_comment_count) {
                        $("#post_comment_count").text(formatZanNum(post_comment_count, 2));
                    };

                }
            }
        });
    },
    //初始化行情股票链接及自选股
    initQuoteLink: function(){
        //正文页增加网页个股链接功能(非第一次出现的时候转换成a链接)
        $(".em_stock_key_common").each(function () {
            var _this = $(this);
            if (_this.attr("web") == "1") {//web=1的时候span标签变成a标签
                _this.after(_this.prop("outerHTML").replace("<span", "<a").replace("</span>", "</a>")).remove();
            }
        });

        var isIpad = navigator.userAgent.toLowerCase().match(/(ipad).*os\s([\d_]+)/);
        if (!isIpad) {//非ipad
            var pdtips = new window.pdtips({
                id: '#ContentBody'
            });

            var _tipZIndex = 100;

            $(".txtinfos > p,.txtinfos > h3,.txtinfos > h4,.txtinfos > table").on("mouseleave", function () {
                if ($(this).find(".quotebox").length > 0) {
                    $(this).find(".quotebox").remove();
                }
            });

            $(".txtinfos > p,.txtinfos > h3,.txtinfos > h4,.txtinfos > table").on("click", function () {
                if ($(".quotebox").length > 0) {
                    $(".quotebox").remove();
                }
            });

            //正文文字，需要跳转原生行情的标签属性转换
            $(".keytip[data-code],.em_stock_key_common[data-code]").each(function () {

                var _this = $(this);
                var _thisCode = _this.data("code").split(',');

                if (_thisCode.length == 2) {
                    _this.attr("data-market", _thisCode[0]);//新增市场属性
                    _this.attr("data-code", _thisCode[1]);//新增代码属性(会覆盖掉老的属性)

                    //console.log("=================", _this.attr("data-market") + "." + _this.attr("data-code") + "    " + _this.html());

                    var _isMouseOver = false;//当前移入元素及状态

                    _this.on("mouseout", function (e) {//触发隐藏行情[父元素移出]
                        _isMouseOver = false;
                        //setTimeout(function () {
                        //    if (!_isMouseOver) {//父元素移出0.5秒钟后焦点不在，就移除
                        //        if (_this.find(".quotebox").length > 0) {
                        //            _this.find(".quotebox").remove();
                        //        }
                        //    }
                        //}, 500);
                    });

                    _this.on("mouseover", function (e) {//触发显示行情[父元素移入]
                        var _thisitem = $(this);

                        //移入的时候，先删除其他股票的浮层
                        $(".quotebox").each(function () {
                            if ($(this).data("mc") != _thisitem.attr("data-market") + "." + _thisitem.attr("data-code")) {
                                $(this).remove();
                            }
                        });

                        _isMouseOver = true;

                        setTimeout(function () {
                            if (_isMouseOver) {//移入0.3秒后焦点还在
                                //var winHeight = $(window).height(),
                                //    winWidth = $(window).width() < 1000 ? 1000 : $(window).width();

                                //var _thisWidth = _thisitem.width();
                                //var _thisHeight = _thisitem.height();

                                //var e = e || window.event;
                                //var sh = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
                                //var xh = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;

                                //var topNav = 0;
                                //if ($('#fixMenuBar').length > 0) {
                                //    topNav = 33;
                                //}

                                //var left = (e.clientX + _thisWidth > winWidth) ? $(window).width() - _thisWidth + xh : e.clientX + xh;
                                ////left = (e.clientX - _thisWidth < 0) ? e.clientX + xh : e.clientX - _thisWidth + xh + 2;
                                //var top = (e.clientY - _thisHeight - topNav < 0) ? e.clientY + sh + 10 : e.clientY + sh - 35;

                                //console.log("left-top:", "left:" + left + "top:" + top);

                                var _id = 'quote' + (new Date()).getTime();

                                if (_thisitem.find(".quotebox").length <= 0) {
                                    var quoteboxHtml = '<div id="' + _id + '" class="quotebox" data-mc="' + _thisitem.attr("data-market") + "." + _thisitem.attr("data-code") + '" style="z-index:' + (_tipZIndex++) + '"></div>';
                                    _thisitem.append(quoteboxHtml);

                                    _thisitem.on("mouseover", ".quotebox", function () {//移入子浮层
                                        _isMouseOver = true;
                                    });

                                    _thisitem.on("mouseout", ".quotebox", function () {//触发隐藏行情[浮层移出]
                                        var _thisitem2 = $(this);
                                        _isMouseOver = false;

                                        setTimeout(function () {
                                            if (!_isMouseOver) {//0.5秒后焦点不在
                                                _thisitem2.remove();
                                            }
                                        }, 500);
                                    });

                                    var _interface = config.push + "api/qt/ulist.np/get?ut=13697a1cc677c8bfa9a496437bfef419&fields=f1,f2,f3,f4,f12,f13,f14&secids=" + _thisitem.attr("data-market") + "." + _thisitem.attr("data-code");
                                    $.ajax({
                                        url: _interface,
                                        type: "get",
                                        dataType: "jsonp",
                                        jsonp: "cb",
                                        success: function (json) {
                                            var item = json.data.diff[0];
                                            var dataQuote = {
                                                price: (item.f2 === "" || item.f2 === "-") ? "-" : parseFloat(item.f2 / Math.pow(10, item.f1)).toFixed(item.f1),
                                                zdf: item.f3 / 100,
                                                zde: (item.f4 === "" || item.f4 === "-") ? "-" : parseFloat(item.f4 / Math.pow(10, item.f1)).toFixed(item.f1),
                                                name: item.f14,
                                                mc: item.f13 + "." + item.f12,
                                                market: item.f13,
                                                code: item.f12
                                            };

                                            var _color = "";
                                            if (dataQuote.zdf > 0) {
                                                _color = "red";
                                            } else if (dataQuote.zdf < 0) {
                                                _color = "green";
                                            } else {
                                                _color = "";
                                            }

                                            dataQuote.zdf = ((dataQuote.zdf === "" || dataQuote.zdf == "-") ? "-" : parseFloat(dataQuote.zdf).toFixed(2) + "%");

                                            $("#" + _id).html(dataQuote.name + "：" + dataQuote.code + " <span class='zixuanprice " + _color + "'>" + dataQuote.price + "</span> <span class='zixuanzdf " + _color + "'>" + dataQuote.zdf + "</span> <span class='zixuan'></span>");

                                            initZXInfo($("#" + _id + " .zixuan"), dataQuote.mc);

                                        }
                                    });

                                }
                            }
                        },300);

                    });

                }
            });

        }

        /**
           * 初始化自选股相关信息
           * @param {*} dom jQueryDom 
           * @param {*} code 股票代码 0.300059
           */
        function initZXInfo(dom, code) {
            var apiurl = '//myfavor.eastmoney.com/v4/'; //正式环境
            var appkey = 'd41d8cd98f00b204e9800998ecf8427e';
            var params = "appkey=" + appkey;
            code = code.replace('.', '$');

            var fingerprint = cookie.get('qgqp_b_id') || '';

            if (userpassport.get() == null) {
                apiurl += 'anonymwebouter/';
                params += "&bid=" + fingerprint;
            }
            else {
                apiurl += 'webouter/';
            }

            //获取默认分组股票，检测是否加了自选
            $.ajax({
                url: apiurl + "gsaandcheck?" + params + "&cb=?",
                type: "get",
                dataType: "jsonp",
                data: {
                    sc: code
                },
                success: function (json) {
                    if (json.state == 0 && json.data) {
                        if (json.data.check) {
                            dom.addClass("zixuandel").html("-自选");
                        } else {
                            dom.removeClass("zixuandel").html("+自选");
                        }
                        dom.on("click", function () {
                            var _AddOrDelZXG = "";
                            var _type = "";
                            if ($(this).hasClass("zixuandel")) {//删自选
                                _AddOrDelZXG = apiurl + "dsz?" + params + "&cb=?";
                                _type = "del";
                            } else {//加自选
                                _AddOrDelZXG = apiurl + "asz?" + params + "&cb=?";
                                _type = "add";
                            }

                            $.ajax({
                                url: _AddOrDelZXG,
                                type: "get",
                                dataType: "jsonp",
                                data: {
                                    sc: code
                                },
                                success: function (back) {
                                    if (back.state == 0) {
                                        if (_type == "add") {//加自选成功，变成删自选
                                            dom.addClass("zixuandel").html("-自选");
                                        } else {//删自选成功，变成加自选
                                            dom.removeClass("zixuandel").html("+自选");
                                        }
                                    }
                                    else {
                                        console.log("back.message", back.message);
                                    }
                                }
                            });

                            return false;
                        });
                    }
                }
            });

        }
    },
    //初始化字体大小
    loadFontSize: function() {
        var size = cookie.get("EM_NewsContent_FontSize");
        if (size != null && size != "" && size != undefined) {
            switch (size) {
                case "12":
                    $(".txtinfos").removeClass("fontsize-big").addClass("fontsize-small");
                    $(".fsctrl").removeClass("bgmid bgbig").addClass("bgsmall");
                    $(".fsctrlbox .fs14").addClass("on").siblings().removeClass("on");
                    $(".abstract .txt").css({
                        "font-size": "12px",
                        "line-height": "28px"
                    });
                    break;
                case "15":
                    $(".txtinfos").removeClass("fontsize-big").removeClass("fontsize-small");
                    $(".fsctrl").removeClass("bgsmall bgbig").addClass("bgmid");
                    $(".fsctrlbox .fs16").addClass("on").siblings().removeClass("on");
                    $(".abstract .txt").css({
                        "font-size": "15px",
                        "line-height": "31px"
                    });
                    break;
                case "18":
                    $(".txtinfos").addClass("fontsize-big").removeClass("fontsize-small");
                    $(".fsctrl").removeClass("bgsmall bgmid").addClass("bgbig");
                    $(".fsctrlbox .fs18").addClass("on").siblings().removeClass("on");
                    $(".abstract .txt").css({
                        "font-size": "18px",
                        "line-height": "34px"
                    });
                    break;
                default:
                    $(".txtinfos").removeClass("fontsize-big").removeClass("fontsize-small");
                    $(".fsctrl").removeClass("bgsmall bgbig").addClass("bgmid");
                    $(".fsctrlbox .fs16").addClass("on").siblings().removeClass("on");
                    $(".abstract .txt").css({
                        "font-size": "15px",
                        "line-height": "31px"
                    });
                    break;
            }

        }
    },
    /**
     * 事件绑定 
     */
    bindEvent: function() {
        var that = this;
        // 字体控制
        $("#fsctrl").on("click", function(e) {
		    e.stopPropagation();
		    var _this = $(this);
		    if ($(e.target).prop("tagName") == "SPAN") {
		        var fstype = $(e.target).data("type");
		        switch (fstype) {
		            case "s":
		                $(".txtinfos").removeClass("fontsize-big").addClass("fontsize-small");
		                _this.removeClass("bgmid bgbig").addClass("bgsmall");
		                cookie.set("EM_NewsContent_FontSize", "12", 365, ".eastmoney.com");
		                $(".abstract .txt").css({
		                    "font-size": "12px",
		                    "line-height": "28px"
		                });
		                break;
		            case "m":
		                $(".txtinfos").removeClass("fontsize-big").removeClass("fontsize-small");
		                _this.removeClass("bgsmall bgbig").addClass("bgmid");
		                cookie.set("EM_NewsContent_FontSize", "15", 365, ".eastmoney.com");
		                $(".abstract .txt").css({
		                    "font-size": "15px",
		                    "line-height": "31px"
		                });
		                break;
		            case "l":
		                $(".txtinfos").addClass("fontsize-big").removeClass("fontsize-small");
		                _this.removeClass("bgsmall bgmid").addClass("bgbig");
		                cookie.set("EM_NewsContent_FontSize", "18", 365, ".eastmoney.com");
		                $(".abstract .txt").css({
		                    "font-size": "18px",
		                    "line-height": "34px"
		                });
		                break;
		        };
		        $(e.target).addClass("on").siblings().removeClass("on");
		    };

		    $(".fsctrlbox").toggle();

		    return false;
        });

        //前往评论区
        $(".gopinluntxt").on("click", function () {
            if ($("#topbox").hasClass("topboxfix")) {
                window.scrollTo(0, $("#gubaComment").offset().top - $("#topbox").height() - $(".top-nav-wrap").height());
            } else {
                window.scrollTo(0, $("#gubaComment").offset().top - $("#topbox").height() * 2 - $(".top-nav-wrap").height() * 2);
            }
            return false;
        });

        // 点赞
        $("#sharebox").on("click", ".articlezan", function(e) {
		    if (_ctoken == null || _utoken == null || _GubaApiH == null) {
		        location.href = "https://passport2.eastmoney.com/pub/login?backurl=" + encodeURIComponent(location.href);
		    } else {
		        zanObj.zanFun(e, $(this), "1", _NewsId);
		    }
		    return false;
		});

        //收藏
        $("#sharebox").on("click", ".articlesc", function(e) {
		    // var _this = $(this), hascollect = false;
		    if (_ctoken == null || _utoken == null || _GubaApiH == null) {
		        location.href = "https://passport2.eastmoney.com/pub/login?backurl=" + encodeURIComponent(location.href);
		    } else {
		        collectObj.collectFun(e, $(this), "1", _NewsId);
		    }
		    return false;
		});

        // 分享
        $("#emsharewrap").on("click", function(e) {
		    e.stopPropagation();

		    $(".qrimgbox").hide();
		    if ($(e.target).hasClass("shares")) {
		        $(".sharewrap").toggle();
		    }
		});

        //二维码
        $("#qrcode").on("click", ".qricon", function(e) {
		    e.stopPropagation();

		    $(".sharewrap").hide();
		    if ($(e.target).hasClass("qricon")) {
		        $(".qrimgbox").toggle();
		    }
		});

        //// 沪深指数点击切换事件
        //$(".zsitems").on("click", ".zsitem>ul", function() {
		//    var _thisdom = $(this);

		//    $("[openimg='show']").parent(".zsitem").animate({
		//            height: '48px'
		//        },
		//	300);
		//    if (window.QuoteshowDom == _thisdom.parent(".zsitem").data("mc")) {//当前点击的是打开的
		//        window.QuoteshowDom = "close";//不是当前的时候就不会打开
		//        _thisdom.attr("openimg", "");
		//    } else {
		//        _thisdom.parent(".zsitem").animate({
		//            height: '180px'
		//        },
		//	    300);
		//        _thisdom.attr("openimg", "show").parent(".zsitem").siblings().find("ul").attr("openimg", "");
		//        window.QuoteshowDom = _thisdom.parent(".zsitem").data("mc");
		//    }
        //});

        // 沪深指数鼠标滑过切换事件
        $(".zsitems").on("mouseover", ".zsitem>ul", function () {
            var _thisdom = $(this);

            _thisdom.parent(".zsitem").css({
                height: '180px'
            });
            _thisdom.attr("openimg", "show").parent(".zsitem").siblings().css({
                height: '48px'
            });
            window.QuoteshowDom = _thisdom.parent(".zsitem").data("mc");
        });

        $("html").on("click", function(e) {
		    //分享
		    var sharebox = $(e.target).parents("#emsharewrap");
		    if (!sharebox.length) {
		        $(".sharewrap").hide();
		    };
		    //二维码
		    var qrbox = $(e.target).parents("#qrcode");
		    if (!qrbox.length) {
		        $(".qrimgbox").hide();
		    };
		    //底部分享
		    var wxbox = $(e.target).parents("#sharebottom");
		    if (!wxbox.length) {
		        $(".wxshare").hide();
		    };
		    //底部关注
		    var gzbox = $(e.target).parents("#guanzhu");
		    if (!gzbox.length) {
		        $(".wxgzbox").hide();
		    };
		    //字体控制
		    var gzbox = $(e.target).parents("#fsctrl");
		    if (!gzbox.length) {
		        $(".fsctrlbox").hide();
		    };

		    //顶部微信分享二维码
		    var topwxbox = $(e.target).parents("#wxqrcodebox");
		    if (!topwxbox.length) {
		        $(".wxqrcodebox").hide();
		    };

		});

        // 头部微信分享事件重写
        $("#shareitems > .emshare2020_icon_weixin").unbind("click");
        var wxqrcodeboxstr = "<div id='wxqrcodebox' class='wxqrcodebox'><span class='arrowright'></span><div class='imgbox'><div class='qrimg' id='wapqrcode5'></div></div><p>使用微信扫一扫</p><p>分享文章到您的朋友圈</p></div>";
        $("#shareitems").append($(wxqrcodeboxstr));
        $("#shareitems").on("click", ".emshare2020_icon_weixin",function() {
            $("#shareitems").find("#wxqrcodebox").toggle();
        });

        if (typeof emshareFun != "undefined") {
            emshareFun.qrcode({
                width: 100,// 二维码宽度 可选 默认135
                colorDark: "#000000", //二维码颜色 可选 默认黑
                colorLight: "#ffffff",//背景色 可选 默认白
                logosrc: "https://g1.dfcfw.com/g4/202003/20200318140436.gif",// 二维码logo信息 可选[不建议加此参数] 默认有logo 值为"none"时无logo
                link: __WAPURL,
                domid: "wapqrcode5"
            });
        }

        // 底部微信分享事件重写
        $(".emshare2020_icon_weixin").unbind("click");
        $("#sharebottom").on("click", ".emshare2020_icon_weixin", function() {
            $("#sharebottom").find(".wxshare").toggle();
		});

        //底部微信关注
        $("#guanzhu").on("click", ".gz-wx", function(e) {
		    e.stopPropagation();
		    $(".wxgzbox").toggle();
        });

        document.onkeydown=function(ev)
        {
            var oEvent = ev || event;

            if (oEvent.keyCode == 33) {//pageup
                if (window.scrollY - document.documentElement.clientHeight <= 0) {
                    window.scrollTo(0, 0);
                } else {
                    window.scrollTo(0, window.scrollY - document.documentElement.clientHeight + $(".top-nav-wrap").height() + $(".topbox").height() + 30);
                }
                return false;
            } else if (oEvent.keyCode == 34) {//pagedown
                window.scrollTo(0, window.scrollY + document.documentElement.clientHeight - $(".top-nav-wrap").height() - $(".topbox").height() - 30)
                return false;
            }
        }

        $(".newstitledown").on("click", function () {//展开点击事件
            that.isDefaultShowTitle = "true";
            cookie.set("content_showtitle", "true", 365, ".eastmoney.com");
            that.hideDown();
        });

        $(".newstitleup").on("click", function () {//收起点击事件
            that.isDefaultShowTitle = "false";
            cookie.set("content_showtitle", "false", 365, ".eastmoney.com");
            that.showDown();
        });

    },
    // 热搜及滚动
    getHotNews: function() {
        $.ajax({
            type: 'GET',
            url: '//searchapi.eastmoney.com/api/PopularKey/get?token=B22D178B12A22102D9D8A0CE4D2AC824&count=20&cb=data',
            jsonpCallback: "data",
            dataType: "jsonp",
            success: function(res) {
                try {
                    var item = "",
					list = res.Data;
                    for (var i = 0; i < list.length; i++) {
                        item += '<a href="' + list[i].JumpAddress + '" tracker-eventcode="Web_pdzw_rstg" tracker-extinfo="source:newsright;">' + list[i].KeyPhrase + '</a>';
                    };
                    $("#hotnews").append($(item));

                    hotSearchScroll.init();
                } catch(error) {}
            }
        });
    },
    //焦点专题滚动区
    initRDTJ: function() {
        var that = this;
        $.ajax({
            type: 'GET',
            url: '//list.lvb.eastmoney.com/LVB/api/Roadshow/GubaBanner?device_id=123&version=1&plat=web&product=Guba&network=wifi&ctoken=&utoken=&callback=?',
            //jsonpCallback: "data",
            dataType: "jsonp",
            success: function(res) {
                if (res.result == 1) {
                    var _html = '';

                    for (var i in res.data.columns) {
                        var itemBig = res.data.columns[i];
                        for (var j in itemBig.column_data) {
                            var item = itemBig.column_data[j];

                            if (item.cover != "" && item.name != "") {
                                var _link = '';
                                if ("访谈" == itemBig.column_name || "课堂" == itemBig.column_name || "小视频" == itemBig.column_name) {
                                    _link = 'https://roadshow.eastmoney.com/zw/' + item.cfh_art_code;
                                } else {
                                    _link = 'https://roadshow.eastmoney.com/luyan/' + item.id;
                                }
                                _html += '<li>';
                                _html += '    <a target="_blank" href="' + _link + '" class="img" title="' + item.name + '">';
                                _html += '        <img alt="" src="' + item.cover.replace("http://","https://") + '" />';
                                _html += '        <div class="play"></div>';
                                _html += '    </a>';
                                _html += '    <a target="_blank" href="' + _link + '" class="title">' + item.name + '</a>';
                                _html += '</li>';
                            }
                        }
                    }
                    $("#scrollvides ul").html(_html);

                    $(".pic_swiper").slide({
                        titCell: ".hd ul",
                        mainCell: ".bd ul",
                        effect: "leftLoop",
                        autoPlay: true,
                        autoPage: true
                    });
                }
            }
        });

    },
    showDown: function () {
        $("#topboxbak").hide();
        $(".topbox").removeClass("topboxfix");

        $(".newstitledown").show();
    },
    hideDown: function () {
        $("#topboxbak").show();
        $(".topbox").addClass("topboxfix");

        $(".newstitledown").hide();
    },
    isDefaultShowTitle: cookie.get('content_showtitle') || "true",
    // 固顶:
    gudingFun: function () {
        var that = this;
        var sm = $("#topbox");
        var _gboffsettop = $("#gubaComment").offset().top;
        var _offtop = sm.offset().top;
        var _h = sm.height();
        function checkFixTitle() {
            that.isDefaultShowTitle = cookie.get('content_showtitle') || "true";
            if (document.documentElement.clientHeight >= 400) {
                var scrolltop = $(document).scrollTop();
                if (scrolltop > _offtop) {
                    if (that.isDefaultShowTitle == "true") {
                        $("#topboxbak").css({
                            "height": _h
                        });
                        that.hideDown();

                        if (scrolltop <= _offtop + _h) {
                            $(".newstitleup").hide();
                        } else {
                            $(".newstitleup").show();
                        }
                    } else {
                        if (scrolltop <= _offtop + _h) {
                            $(".newstitledown").hide();
                        } else {
                            that.showDown();
                        }
                    }
                } else {
                    $("#topboxbak").hide();
                    $(".topbox").removeClass("topboxfix");

                    $(".newstitledown").hide();
                }
            } else {
                $("#topboxbak").hide();
                $(".topbox").removeClass("topboxfix");

                $(".newstitledown").hide();
            }
        }
        
        $(window).scroll(checkFixTitle);
        $(window).resize(checkFixTitle);
    },
    //评论区域
    initPinLun: function () {
        try {
            if (_ISComment) {
                if (_CMSHJ == "test") {
                    window.editorAndList({
                        se: '#gubaComment', id: _NewsId, type: 1, 'topNavH': 30,
                        //uploadUrl: "/a/upload_callback/upload_callback",
                        env: 'test'
                    });
                } else {
                    window.editorAndList({
                        se: '#gubaComment', id: _NewsId, type: 1, 'topNavH': 30
                        //, uploadUrl: "/a/upload_callback/upload_callback"
                    });
                }
            }
        } catch (e) {

        }
    }
}

$(function () {

    $(".jubao").attr("href", $(".jubao").attr("href") + "&newsurl=" + encodeURIComponent(window.location.href));

    var __KHWZ = "主力资金加仓名单实时更新，APP内免费看&gt;&gt;"; //主动插入的开户文字
    var __KHLJ = '<p>　　<a target="_blank" href="https://zqhd.eastmoney.com/Html/aghd/pc/20170918/html/activity2.html">' + __KHWZ + '</a></p>'; //https://acttg.eastmoney.com/pub/webtg_hskh_act_gbzdtweb_01_01_01_0
    if ($("#ContentBody").html().indexOf(__KHWZ) < 0 && "1" == "1") { //不包含 __KHWZ，并且大于1000个字
        var _HQLength = $("#ContentBody .EmImageRemark").length;
        if (_HQLength > 0) { //如果有行情图
            try {
                $("#ContentBody .EmImageRemark").eq(_HQLength - 1).parent('p').after(__KHLJ); //有点绕，需求就是这样，【在最后一张行情图的父级p标签同级的后面加入次推广】
            } catch(e) {}
        } else if ($("#ContentBody .b-review").length > 0) { //没有行情图，但是有摘要
            $("#ContentBody .b-review").after(__KHLJ); //插在此元素之后（同级）
        } else if ($("#ContentBody .yuanbiaoti").length > 0) { //没有行情图，没有有摘要，但是有原标题
            $("#ContentBody .yuanbiaoti").after(__KHLJ); //插在此元素之后（同级）
        } else { //没有行情图，没有摘要，插在文章最前面
            $("#ContentBody").prepend(__KHLJ); //内部最前面加入此元素
        }

        if ($.trim($("#ContentBody").text()).length > 1000) { //大于1000字，才显示下面的文字链
            if ($("#ContentBody p.em_media").length > 0) { //底部有文章来源
                $("#ContentBody p.em_media").before(__KHLJ); //插在此元素之前（同级）
            } else if ($("#ContentBody p.res-edit").length > 0) { //有责任编辑
                $("#ContentBody p.res-edit").before(__KHLJ); //插在此元素之前（同级）
            } else { //没有底部来源，也没有责任编辑
                $("#ContentBody").append(__KHLJ); //内部末尾加入此元素
            }
        }
    }

    //资讯正文支持点击查看原图
    $("#ContentBody img").wrap(function() {
        if (this.hasAttribute("orginial_src")) {
            return '<a href="' + this.getAttribute("orginial_src") + '" target="_blank"></a>';
        }
        return '';
    });

    //正文页增加机会文章模块功能
    var _op_ids = [];
    $("#ContentBody .em_op_news").each(function() {
        var _this = $(this);
        var _op_id = _this.attr("op_id");
        _op_ids.push(_op_id);
        _this.addClass("em_op_news" + _op_id);
    });
    function _initOPHTML(json) {
        var _opHTML = '';
        if (json.links.length > 0) {
            _opHTML += '<div class="op_item">';
            _opHTML += '<div class="op_title" style="color:' + json.title_color + '">' + json.title + '</div>';
            _opHTML += '<ul>';
            for (var i = 0; i < json.links.length; i++) {
                _opHTML += '<li><a href="' + json.links[i].url + '">' + json.links[i].text + '</a></li>';
            }
            _opHTML += '</ul>';
            _opHTML += '</div>';
            return _opHTML;
        }
        return _opHTML;
    }
    if (_op_ids.length > 0) {
        $.ajax({
            //url: "//newsinfo.test.emapd.com/
            url: "//newsinfo.eastmoney.com/kuaixun/v2/api/content/op_modules?op_ids=" + _op_ids.toString() + "&callback=?",
            type: "get",
            dataType: "jsonp",
            data: {},
            success: function(json) {
                for (var i = 0; i < json.Result.length; i++) {
                    var _op_id = json.Result[i].op_id;
                    var _this = $("#ContentBody .em_op_news" + _op_id);
                    var _opHTML = _initOPHTML(json.Result[i]);
                    if (_opHTML.length > 0) {
                        _this.html(_opHTML);
                        _this.show();
                    }
                }
            }
        })
    }

    zxzwObj.init();
});
var videoid = "";
var apparr = new Array();
var _uid = getuid("uidal");
function getuid(t) { var e = document.cookie.match(new RegExp("(^| )" + t + "=([^;]*)(;|$)")); return null != e ? decodeURIComponent(e[2]) : null }
if (_uid && _uid.length >= 16) {
    _uid = _uid.substring(0, 16);
} else {
    _uid = "";
}

function initVideo(_videoId, _videoWidth, _videoHeight, _videoType, _videoValue, _videoIsPoster, _videoPoster) {
    var videoitem = emav(_videoId, {
        width: _videoWidth,//播放器区域宽度，单位像素，按需设置，可通过 CSS 控制播放器尺寸。
        height: _videoHeight,//播放器区域高度，单位像素，按需设置，可通过 CSS 控制播放器尺寸。
        controls: true,//是否显示播放器的控制栏，默认true
        poster: _videoPoster,//设置封面图片完整地址
        posterImage: _videoIsPoster,//是否显示封面
        autoplay: false,//是否自动播放，默认false
        loop: false,//是否循环播放，默认false
        muted: false,//是否静音播放，默认false
        preload: "auto",//是否需要预加载，有 3 个属性"auto"，"meta"，"none" ，移动端由于系统限制，设置 auto 无效。默认auto
        controlBar: {//设置控制栏属性的参数组合
            children: [
                "playToggle",
                "volumePanel"
            ],
            playToggle: true,//是否显示播放、暂停切换按钮
            volumePanel: true,//是否显示音量控制

            remainingTimeDisplay: false,//是否显示视频剩余时间
            currentTimeDisplay: true,//是否显示视频当前时间
            timeDivider: true,//是否显示时间分割符（/）
            durationDisplay: true,//是否显示视频时长

            progressControl: true,//是否显示播放进度条
            playbackRateMenuButton: true,
            fullscreenToggle: true//是否显示全屏按钮
        },
        showContextMenu: false,//是否显示右键菜单，默认false
        showBigPlayButtonOnPaused: true,//暂停时是否显示播放按钮，默认false
        bigPlayButton: true,//是否显示居中的播放按钮
        statistic: {
            activeTime: true,
            bd: {
                extinfo: {
                    "UID": _uid,
                    "bu": 2,//部门
                    "plat": 3,//平台：WEB 3 wap 4
                    "biz": "news"//业务线名称
                }
            }
        }
        //,env: "test"
    });
    videoitem.id__ = _videoId;

    switch (_videoType) {
        case "2": videoitem.src("#" + _videoValue); break;//直播
        default: videoitem.src(_videoValue); break;//录播或其他视频
    }

    videoitem.on('play', function (event) {
        videoid = videoitem.id__;
        jQuery.each(apparr, function (i, v) {
            if (v.id__ != videoitem.id__) {
                v.pause();
            }
        });
        jQuery(".emav").css({ "position": "", "right": 0, "bottom": 0, "width": "", "height": "", "z-index": 20001 });
        VideoSmall();
    });

    //videoitem.on('pause', function (event) {
    //    videoid = "";
    //});

    apparr.push(videoitem);
}

function AddClose(_id) {
    RemoveClose(_id);
    jQuery("#" + _id).append('<a href="javascript:;" class="closevideo closevideo' + _id + '" data-id="' + _id + '" target="_self" style="position: absolute;right: 12px;top: 12px;width: 12px;height: 12px;z-index:20002;cursor: pointer;color: #fff;background: url(//g1.dfcfw.com/g3/201904/20190403100952.png);" title="关闭"></a>');
}
function RemoveClose(_id) {
    jQuery(".closevideo" + _id).remove();
}

jQuery("#ContentBody").on("click", ".closevideo", function () {
    var _this = jQuery(this);
    var _dataid = _this.data("id");
    jQuery("#" + _dataid).css({ "position": "", "right": 0, "bottom": 0, "width": "", "height": "", "z-index": 20001 });
    jQuery("#" + _dataid + " .emav-fullscreen-control").css({ "display": "inline-block" });//关闭，切换到大窗口放出来全屏
    RemoveClose(_dataid);

    jQuery.each(apparr, function (i, v) {
        if (v.id__ == _dataid) {
            videoid = "";
            v.pause();
        }
    });
});

function VideoSmall() {
    if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g, "").replace("MSIE", "")) <= 9) {
        //小于等于IE9，不显示右下角画中画
    } else {
        var _scrolltop = jQuery(window).scrollTop();
        var _winHeight = document.documentElement.clientHeight || document.body.clientHeight;;
        jQuery(".middlevideobg").each(function () {
            var _this = jQuery(this);
            var _dataid = _this.data("id");
            if (videoid == _dataid) {
                if (_scrolltop > _this.offset().top + _this.height() || _scrolltop + _winHeight < _this.offset().top) {
                    jQuery("#" + _dataid).css({ "position": "fixed", "right": 0, "bottom": 0, "width": "300px", "height": "170px", "z-index": 20001 });//小窗口
                    jQuery("#" + _dataid + " .emav-fullscreen-control").css({ "display": "none" });
                    AddClose(_dataid);
                } else {
                    jQuery("#" + _dataid).css({ "position": "", "right": 0, "bottom": 0, "width": "", "height": "", "z-index": 20001 });//大窗口
                    jQuery("#" + _dataid + " .emav-fullscreen-control").css({ "display": "inline-block" });//大窗口放出来全屏
                    RemoveClose(_dataid);
                }
            } else {
                RemoveClose(_dataid);
            }
        });
    }
}

function initLangKeVideo() {
    jQuery(".em_lk_video").each(function (_index) {
        var _old = jQuery(this);
        var lk_des = _old.attr('lk_des');
        if (typeof lk_des !== typeof undefined && lk_des !== false && lk_des != "") {
            lk_des = unescape(lk_des);
            jQuery(this).after('<p style="text-align: center;font-size: 12px;color: #666;position: relative;top: -10px;">' + lk_des + '</p>');
        }
        jQuery(this).replaceWith('<div class="middlevideobg" data-id="av-player-ctx' + _index + '" data-value="' + _old.attr("lk_data") + '"><video id="av-player-ctx' + _index + '" class="emav" preload="auto"></video></div>');
    });

    jQuery(".middlevideobg").each(function () {
        var _this = jQuery(this);
        var _dataid = _this.data("id");
        var _datavalue = _this.data("value");
        if (typeof _datavalue !== typeof undefined && _datavalue !== false && _datavalue != "") {
            var _datavideoitem = _datavalue.split('#');
            if (_datavideoitem.length == 2) {
                initVideo(_dataid, 670, 425, _datavideoitem[0], _datavideoitem[1], false, "");
            } else {
                initVideo(_dataid, 670, 425, 99, _datavideoitem[0], false, "");
            }
        }
    });
}
initLangKeVideo();
jQuery(window).scroll(function () {
    VideoSmall();
});
jQuery(function () {
    !function EM_Vote($) {
        //格式化投票数
        function gshVoteNum(numb) {
            if (numb < 10000) {
                return numb;
            } else {
                return parseFloat(numb / 10000).toFixed(2) + "万";
            }
        }
        //投票比例
        function VoteZhanBi(sumVote, curVote) {
            if (sumVote == 0 || curVote == 0) {
                return 0;
            }
            return parseFloat(curVote / sumVote * 100).toFixed(2);
        }
        //占比条宽度计算
        function VoteZhanBiWidth(zhanBi,maxWidth) {
            if (zhanBi == 0 || maxWidth == 0) {
                return 0;
            }
            
            return parseFloat(zhanBi / 100 * maxWidth).toFixed(2);
        }
        // 获取cookie
        function getVoteCookie(key) {
            var cookieArray = document.cookie.split(";");
            for (var i = 0; i < cookieArray.length; i++) {
                var arr = cookieArray[i].split("=");
                if (arr[0].replace(" ", "") == key)
                    return unescape(arr[1]);
            }
            return "";
        }
        // 设置cookie
        function setVoteCookie(key, value, expires) {
            var date = new Date();
            var ms = expires * 60 * 60 * 1000;//参数传进来的单位是小时
            date.setTime(date.getTime() + ms);
            var str = key + "=" + escape(value);
            str += "; expires=" + date.toUTCString() + "; domain=" + location.host + ";";
            document.cookie = str;
        }
        
        var _isLockVote = [];//投票按钮是否处于锁定状态，放置连续点击投票按钮
        $("body").on("click", ".btn_vote", function () {//投票点击事件
            var _this = $(this);

            var _vote_id = _this.attr("vote_id");
            var _vote_title = _this.attr("vote_title");
            if (_vote_id == "") {
                return;
            }
            var _chooseIds = "";//Vi_Id单个的选项id；Vi_Vm_Id一道题1个id；选项一个id；Vi_Vg_Id一个投票一个id
            //Vi_Id单个的选项id；Vi_Vm_Id一道题1个id；选项一个id；Vi_Vg_Id一个投票一个id


            var _timu = [];//当前投票总的题目
            $('.vote_' + _vote_id + " .votetype_li").each(function () {
                var vivmid = $(this).attr("vivmid");
                if (_timu.indexOf(vivmid) < 0) {
                    _timu.push(vivmid);
                }
            });

            var _cookieValue = "";
            $('.vote_' + _vote_id + ' .votetype_radio input[type="radio"]:checked').each(function () {//遍历每一个名字为interest的复选框，其中选中的执行函数    
                var _viid = $(this).attr("viid");
                var _vivmid = $(this).attr("vivmid");
                var _vivgid = $(this).attr("vivgid");
                _cookieValue += _viid + "_" + _vivmid + "_" + _vivgid + ",";
                _chooseIds += _viid + ",";

                var _xb = _timu.indexOf(_vivmid);
                if (_xb >= 0) {
                    _timu.splice(_xb, 1);
                }

            });

            $('.vote_' + _vote_id + ' .votetype_checkbox input[type="checkbox"]:checked').each(function () {//遍历每一个名字为interest的复选框，其中选中的执行函数
                var _viid = $(this).attr("viid");
                var _vivmid = $(this).attr("vivmid");
                var _vivgid = $(this).attr("vivgid");
                _cookieValue += _viid + "_" + _vivmid + "_" + _vivgid + ",";
                _chooseIds += _viid + ",";

                var _xb = _timu.indexOf(_vivmid);
                if (_xb >= 0) {
                    _timu.splice(_xb, 1);
                }

            });
            //console.log(_cookieValue);
            _chooseIds = _chooseIds.trim(',');

            if (_timu.length > 0) {
                alert("您还有题目没有做完");
                return;
            }

            if (_chooseIds == "") {
                alert("请先选择答案");
                return;
            }

            if (_isLockVote.indexOf(_vote_id) >= 0) {
                return;
            }
            _isLockVote.push(_vote_id);

            _this.addClass("btn_disabled");

            setVoteCookie("vote_" + _vote_id, _cookieValue, 24);//有效期24小时

            $.ajax({
                url: "//cmsdataapi.eastmoney.com/api/Vote/VoteOperate?groupId=" + _vote_id + "&chooseIds=" + _chooseIds + "&cb=?",
                type: "get",
                dataType: "jsonp",
                data: {},
                success: function (json) {
                    lookVoteResult(_this);//去查看投票结果
                }
            });

        });

        $("body").on("change", '.votetype_checkbox input[type="checkbox"]', function () {
            var _this = $(this);
            var _vid = _this.attr("id");
            var _vname = _this.attr("name");
            var _maxcheck = _this.attr("maxcheck");
            var _checkLength = $('.votetype_checkbox input[name="' + _vname + '"]:checked').length;
            
            if (_checkLength > _maxcheck) {
                alert("最多只能选择【" + _maxcheck + "】个选项");
                _this.attr("checked", false);
            }
        });
        function lookVoteResult(_this) {//查看投票结果
            var _vote_id = _this.attr("vote_id");
            var _vote_title = _this.attr("vote_title");

            $.ajax({
                url: "//cmsdataapi.eastmoney.com/api/Vote/GetVoteGroupById?Id=" + _vote_id + "&cb=?",
                type: "get",
                dataType: "jsonp",
                data: {},
                success: function (json) {
                    var vote_item = getVoteCookie("vote_" + _vote_id);
                    _this.parents('.em_vote').html(initResultHTML(json, _vote_title, vote_item));
                    _this.parents('.em_vote').show();
                }
            });
        }

        $("body").on("click", ".btn_lookvote", function () {//查看投票结果点击事件
            var _vote_id = $(this).attr("vote_id");
            if (location.host == "pcarticle.eastmoney.com") {

            } else {
                window.open("http://poll.eastmoney.com/Html/Result" + _vote_id + ".html");
            }
            //lookVoteResult($(this));//去查看投票结果
        });

        $("body").on("click", ".btn_govote", function () {//去投票点击事件
            var _vote_id = $(this).attr("vote_id");
            initVote(_vote_id);
        });
        
        function initResultHTML(json, _vote_title, vote_item) {
            var _html = ''
            _html += '<div class="title"><i class="icon icon_title"></i>' + _vote_title + '</div>';
            var _isvote = false;//默认未投过票
            for (var i = 0; i < json.Result.Votes.length; i++) {
                var _item = json.Result.Votes[i];

                _html += '<h3 class="tit">' + _item.Vm_Title + '</h3>';
                _html += '<div class="content">';
                _html += '    <ul class="result_list">';

                var _isAll0Flag = true;//记录是否全部为0
                var _voteSum = 0;
                for (var j = 0; j < _item.Elements.length; j++) {
                    var __item = _item.Elements[j];
                    var _cookieValue = __item.Vi_Id + "_" + __item.Vi_Vm_Id + "_" + __item.Vi_Vg_Id + ",";
                    if (vote_item && vote_item.indexOf(_cookieValue) >= 0) {
                        _item.Elements[j].Vi_Count++;
                        _isvote = true;//投过票
                    }
                    if (_item.Elements[j].Vi_Count != 0) {
                        _isAll0Flag = false;
                    }
                    _voteSum += _item.Elements[j].Vi_Count;
                }

                for (var j = 0; j < _item.Elements.length; j++) {
                    var __item = _item.Elements[j];
                    var _Vi_Count = __item.Vi_Count;
                    _voteBiLi = VoteZhanBi(_voteSum, _Vi_Count);//占比

                    var _cookieValue = __item.Vi_Id + "_" + __item.Vi_Vm_Id + "_" + __item.Vi_Vg_Id + ",";
                    if (vote_item && vote_item.indexOf(_cookieValue) >= 0) {//本选项已投票
                        _html += '        <li class="active">';
                        _html += '            <div class="detail">';
                        _html += '                <div class="info">';
                        _html += '                    <span class="tit">' + __item.Vi_Title + '</span>';
                        _html += '                    <span class="res">（' + gshVoteNum(_Vi_Count) + '票）' + _voteBiLi + '%</span>';
                        _html += '                </div>';
                        _html += '                <div class="bar">';
                        _html += '                    <span class="inner" style="width:' + VoteZhanBiWidth(_voteBiLi, 420) + 'px"></span>';//总长420px
                        _html += '                </div>';
                        _html += '            </div>';
                        _html += '            <div class="tips"><i class="icon icon_wdtp"></i>我的投票</div>';
                        _html += '        </li>';
                    } else {//本选项未投票
                        _html += '        <li>';
                        _html += '            <div class="detail">';
                        _html += '                <div class="info">';
                        _html += '                    <span class="tit">' + __item.Vi_Title + '</span>';
                        _html += '                    <span class="res">（' + gshVoteNum(_Vi_Count) + '票）' + _voteBiLi + '%</span>';
                        _html += '                </div>';
                        _html += '                <div class="bar">';
                        _html += '                    <span class="inner" style="width:' + VoteZhanBiWidth(_voteBiLi, 420) + 'px"></span>';//总长420px
                        _html += '                </div>';
                        _html += '            </div>';
                        _html += '        </li>';
                    }
                }

                _html += '    </ul>';
                _html += '</div>';
            }

            _html += '<div class="btn_wrap">';
            if (_isvote) {
                _html += '    <button class="btn btn_disabled">已投票</button>';
                _html += '    <button class="btn btn_blue btn_lookvote" vote_id="' + json.Result.Vg_Id + '" vote_title="' + _vote_title + '">查看</button>';
            } else {
                if (json.Result.Vg_Enable == 1) {
                    _html += '    <button class="btn btn_blue btn_govote" vote_id="' + json.Result.Vg_Id + '">去投票</button>';
                } else {
                    _html += '    <button class="btn btn_disabled">该投票已结束</button>';
                    _html += '    <button class="btn btn_blue btn_lookvote" vote_id="' + json.Result.Vg_Id + '" vote_title="' + _vote_title + '">查看</button>';
                }
            }
            _html += '</div>';

            return _html;
        }
        function initHTML(json, _vote_title) {
            var _html = ''
            if (json && json.Success == 1 && json.Result) {
                if (json.Result.Vg_Title && json.Result.Vg_Title != "") {
                    _vote_title = json.Result.Vg_Title;
                }

                _html += '<div class="title"><i class="icon icon_title"></i>' + _vote_title + '</div>';

                for (var i = 0; i < json.Result.Votes.length; i++) {
                    var _item = json.Result.Votes[i];
                    _html += '<h3 class="tit">' + _item.Vm_Title + '</h3>';
                    _html += '<div class="content voteitem_' + json.Result.Vg_Id + '">';
                    _html += '    <ul class="problem_list vote_' + json.Result.Vg_Id + '">';

                    for (var j = 0; j < _item.Elements.length; j++) {
                        var radioOrCheckbox = "radio";//单选
                        if (_item.Vm_Type == 1) {//投票模式 1. 多选 0. 单选
                            radioOrCheckbox = "checkbox";//多选
                        }

                        var _Vm_MaxCheck = _item.Vm_MaxCheck;
                        if (_Vm_MaxCheck == 0) {
                            _Vm_MaxCheck = 99;
                        }

                        var __item = _item.Elements[j];
                        _html += '        <li class="votetype_' + radioOrCheckbox + ' votetype_li" vivmid="' + __item.Vi_Vm_Id + '">';
                        _html += '            <span class="choose-wrap">';
                        _html += '                <input type="' + radioOrCheckbox + '"  name="vote_item_' + json.Result.Vg_Id + '_' + i + '" id="vote_item_' + json.Result.Vg_Id + '_' + i + '_' + j + '" value="' + __item.Vi_Vm_Id + '_' + __item.Vi_Vg_Id + '" maxcheck="' + _Vm_MaxCheck + '" viid="' + __item.Vi_Id + '" vivmid="' + __item.Vi_Vm_Id + '" vivgid="' + __item.Vi_Vg_Id + '">';//Vi_Id单个的选项id；Vi_Vm_Id一道题1个id；选项一个id；Vi_Vg_Id一个投票一个id
                        _html += '                <span class="choose-inner"></span>';
                        _html += '            </span>';
                        _html += '            <label for="vote_item_' + json.Result.Vg_Id + '_' + i + '_' + j + '">' + __item.Vi_Title + '</label>';
                        _html += '        </li>';
                    }

                    _html += '    </ul>';
                    _html += '</div>';
                }
                
                _html += '<div class="btn_wrap">';
                _html += '    <button class="btn btn_orange btn_vote" vote_id="' + json.Result.Vg_Id + '" vote_title="' + _vote_title + '" >投票</button>';
                _html += '    <button class="btn btn_blue btn_lookvote" vote_id="' + json.Result.Vg_Id + '" vote_title="' + _vote_title + '">查看</button>';
                _html += '</div>';
            }
            return _html;
        }
        function initVote(item){
            $(".em_vote").each(function () {
                var _this = $(this);
                var _vote_id = _this.attr("vote_id");
                if (item == "all" || item == _vote_id) {
                    var _vote_title = _this.attr("vote_title");
                    _vote_title = unescape(_vote_title);//解码
                    //console.log(_vote_id);
                    //console.log(_vote_title);
                    //http://cmsdataapi.eastmoney.com/api/
                    //http://cmsdataapi.test.emapd.com/api/
                    $.ajax({
                        url: "//cmsdataapi.eastmoney.com/api/Vote/GetVoteGroupById?Id=" + _vote_id + "&cb=?",
                        type: "get",
                        dataType: "jsonp",
                        data: {},
                        success: function (json) {
                            var vote_item = getVoteCookie("vote_" + _vote_id);
                            if (vote_item || json.Result.Vg_Enable != 1) {//Vg_Enable 1为 允许
                                _this.html(initResultHTML(json, _vote_title, vote_item));
                            } else {
                                _this.html(initHTML(json, _vote_title));
                            }
                            _this.show();
                        }
                    });
                }
            });
        }
        initVote("all");
    }(jQuery)
})
!function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=8)}({3:function(t,e){!function(e){function n(t){var n=this;n._option=e.extend(!0,{id:"body",selectId:"selectTips",aline:!0,range:[1,20]},t),n.$container=e(n._option.id),n.init()}n.prototype.init=function(){var t=this;t.hasAppend=!1,t.elementLoad(),t.mouseup()},n.prototype.elementLoad=function(){var t=this;t.tipsHtml='<div id="'+t._option.selectId+'"><div class="search_btn"><img src="//g1.dfcfw.com/g2/201711/20171116142209.png" alt=""><span>搜索</span></div><div class="copy_btn">复制</div></div>',e("body").append(t.tipsHtml),t.$container.css("position","relative"),t.cssTxt="#selectTips{position:absolute;display:none;background:#fff;cursor: pointer;width:112px;overflow:hidden;height:24px;line-height:24px;border:1px solid #E7EAF1;box-shadow:1px 1px 5px rgba(0,0,0,.3)}#selectTips>div{float:left;width:50%;font-size:12px;text-align:center}#selectTips .search_btn{background-color:#ff4901;color:#fff}#selectTips img{vertical-align:middle;margin-right:4px;margin-top:-1px}",t.loadCss(t.cssTxt),t.$selectTips=e("#"+t._option.selectId),t.$search=e(".search_btn",t.$selectTips),t.$copy=e(".copy_btn",t.$selectTips)},n.prototype.loadCss=function(t){var e=document.createElement("style");e.type="text/css";try{e.appendChild(document.createTextNode(t))}catch(n){e.styleSheet.cssText=t}document.getElementsByTagName("head")[0].appendChild(e)},n.prototype.getSelectTxt=function(){var t="";return t=document.selection?t=document.selection.createRange().text:document.getSelection(),e.trim(t.toString())},n.prototype.mouseup=function(){var t,n,o,i,c=this,s=c.$selectTips.height(),p=c.$selectTips.width(),r=0;e("body").click(function(t){setTimeout(function(){e(t.target).parents(c._option.id).length<1&&"#"+t.target.id!=c._option.id&&c.$selectTips.hide()},100)}),c.$container.mouseup(function(l){c.txt=c.getSelectTxt();e(window).height();var d=e(window).width()<1e3?1e3:e(window).width();l=l||window.event,t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,n=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0,o=c._option.aline?l.clientX+p>d?e(window).width()-p+n:l.clientX+n:l.clientX-p<0?l.clientX+n:l.clientX-p+n+2,e("#fixMenuBar").length>0&&(r=33),i=l.clientY-s-r<0?l.clientY+t+10:l.clientY+t-35,c.txt&&c.txt.length>=c._option.range[0]&&c.txt.length<c._option.range[1]?(c.$selectTips.css({display:"block",left:o+"px",top:i+"px"}),c.$copy.attr("data-clipboard-text",c.txt)):c.$selectTips.hide()}),c.enents()},n.prototype.enents=function(){var t=this;t.$selectTips.on("click",".search_btn",function(){window.open("http://so.eastmoney.com/web/s?keyword="+encodeURIComponent(t.txt)),t.$selectTips.hide()}),window.ActiveXObject?t.$selectTips.on("click",".copy_btn",function(e){window.clipboardData.setData("Text",t.txt),t.$selectTips.hide()}):t.loadScript("//emres.dfcfw.com/common/js/clipboard.min.js",function(){new Clipboard(".copy_btn").on("success",function(e){t.$selectTips.hide()})})},n.prototype.loadScript=function(t,e){if(this.hasAppend)e&&e();else{var n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("src",t),n.setAttribute("charset","utf-8"),document.getElementsByTagName("head")[0].appendChild(n),n.onload=function(){e&&e()}}},t.exports=n}(jQuery)},8:function(t,e,n){var o=n(3);window.pdtips=o}});
//# sourceMappingURL=pdtips.js.map
