window.iTimeoutID = 0;
function FirefoxEvent() {
	Event.prototype.__defineGetter__("srcElement", eventSrcElement)
}
function windowEvent() {
	return windowEventConstructor()
}
function eventSrcElement() {
	return this.target
}
function windowEventConstructor() {
	if (document.all) {
		return window.event
	}
	var A = windowEventConstructor.caller;
	while (A != null) {
		var B = A.arguments[0];
		if (B) {
			var C = B.constructor;
			if (C.toString().indexOf("Event") != -1) {
				return B
			}
		}
		A = A.caller
	}
	return null
}
if (window.addEventListener) {
	FirefoxEvent()
}
String.prototype.trim = function() {
	return this.replace(/(^\s*)|(\s*$)/g, "")
};
function showLogonWindow(B) {
	var E = document.getElementById("LayerLogon");
	E.style.position = "absolute";
	E.style.display = "block";
	var A = B;
	var D = B.clientHeight;
	var C = B.offsetWidth - B.clientWidth;
	while (A.offsetParent) {
		D += A.offsetTop;
		C += A.offsetLeft;
		A = A.offsetParent
	}
	E.style.top = (D - 100) + "px";
	if (document.all) {
		E.style.left = (C - 140) + "px"
	} else {
		E.style.left = (C - 140) + "px"
	}
}
function hiddenLogonWindow() {
	var A = document.getElementById("LayerLogon");
	A.style.display = "none"
}
function clearChangeTabPage() {
	window.clearTimeout(window.iTimeoutID)
}
function SetCookie(J, D) {
	var K = new Date();
	var E = window.location.host;
	var F = /jrj.com.cn|jrj.com/;
	E = F.exec(E);
	var C = SetCookie.arguments;
	var A = SetCookie.arguments.length;
	var X = (A > 2) ? C[2] : null;
	var G = (A > 3) ? C[3] : null;
	var B = (A > 4) ? E : null;
	var I = (A > 5) ? C[5] : false;
	if (X != null && X >= 0) {
		K.setTime(K.getTime() + 7 * 24 * 60 * 60 * 1000)
	}
	document.cookie = J
			+ "="
			+ escape(D)
			+ ((X == null || X < 0) ? ((X == -1) ? "; expires=-1" : "")
					: ("; expires=" + K.toGMTString()))
			+ ((G == null) ? "" : ("; path=" + G))
			+ ((B == null) ? "" : ("; domain=" + B))
			+ ((I == true) ? "; secure" : "")
}
function GetCookie(B) {
	var A = B + "=";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(A);
		if (offset != -1) {
			offset += A.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) {
				end = document.cookie.length
			}
			return unescape(document.cookie.substring(offset, end))
		} else {
			return ""
		}
	}
}
function ClearCookie() {
	try {
		SetCookie("UserName", "", -1, "/", true, false);
		SetCookie("UserID", "", -1, "/", true, false);
		SetCookie("Ticket", "", -1, "/", true, false)
	} catch (A) {
	}
}
function delalert() {
	return confirm("是否隐藏？")
}
function delaction(C, B) {
	if (confirm("是否删除？")) {
		var D = "/postdel.jspa?id=" + C + "&forumid=" + B + "&status=3";
		var A = document.getElementById("postformiframe");
		A.src = D
	}
}
function setTop(D, B, A) {
	if (confirm("\u662f\u5426" + (A == 1 ? "取消" : "设为")
			+ "置顶帖？")) {
		var E = "/topicdotop.jspa?forumid=" + D + "&topicid=" + B;
		var C = document.getElementById("postformiframe");
		C.src = E
	}
}
function setTopTopic(D, B, A) {
	if (confirm("\u662f\u5426" + (A == 2 ? "取消" : "设为")
			+ "总置顶帖？")) {
		var E = "/dotoptopic.jspa?forumid=" + D + "&topicid=" + B;
		var C = document.getElementById("postformiframe");
		C.src = E
	}
}
function setAValue(D, B) {
	var E = document.getElementById("avalue");
	if (E.value.length == 0 || !aValueIsNumber(E.value)) {
		alert("请输入正确的A值");
		E.focus()
	} else {
		if (confirm("是否将此帖的A值修改为："
				+ E.value + "？")) {
			var A = "/dochangeavalue.jspa?forumid=" + D + "&id=" + B
					+ "&aValue=" + E.value;
			var C = document.getElementById("postformiframe");
			C.src = A
		}
	}
}
function aValueIsNumber(A) {
	if (A == null) {
		return false
	}
	var B = new RegExp("^-?[0-9]d*$");
	return B.test(A)
}
function setElite(D, B, A) {
	if (confirm("是否" + (A == 1 ? "取消" : "设为")
			+ "精华帖？")) {
		var E = "/topicdoelite.jspa?forumid=" + D + "&topicid=" + B;
		var C = document.getElementById("postformiframe");
		C.src = E
	}
}
function SetBgColor(B) {
	var A = GetCookie("IstockViewBgColor");
	var C = document.getElementById("replyContainer");
	var D = document.getElementById("replyContainer2");
	if (B.toUpperCase() == "INIT") {
		C.style.backgroundColor = (A == "") ? "#FFFFFF" : A;
		D.style.backgroundColor = (A == "") ? "#FFFFFF" : A
	} else {
		if (B == A) {
			C.style.backgroundColor = A;
			reply2Container.style.backgroundColor = A
		} else {
			C.style.backgroundColor = B;
			D.style.backgroundColor = B;
			SetCookie("IstockViewBgColor", B)
		}
	}
}
function SetFontSize(B) {
	var A = document.getElementById("replayContent");
	A.style.fontSize = B
}
function setHomePage(A) {
	if (window.netscape) {
		try {
			netscape.security.PrivilegeManager
					.enablePrivilege("UniversalXPConnect");
			var C = Components.classes["@mozilla.org/preferences-service;1"]
					.getService(Components.interfaces.nsIPrefBranch);
			C.setCharPref("browser.startup.homepage", A)
		} catch (B) {
			alert("请在浏览器地址栏输入\r“about:config”并回车然后\r将[signed.applets.codebase_principal_support]设置为'true'。")
		}
	} else {
		document.body.style.behavior = "url(#default#homepage)";
		document.body.setHomePage(A)
	}
}
function addfavorite(B, A) {
	if (document.all) {
		window.external.addFavorite(B, A)
	} else {
		if (window.sidebar) {
			window.sidebar.addPanel(A, B, "")
		}
	}
}
function copyLink() {
	var A = location.href;
	copyToClipboard(A);
	alert("该文章地址已复制到粘帖板中，您可以通过QQ,MSN推荐给好友")
}
function copyToClipboard(E) {
	if (window.clipboardData) {
		window.clipboardData.clearData();
		window.clipboardData.setData("Text", E)
	} else {
		if (navigator.userAgent.indexOf("Opera") != -1) {
			window.location = E
		} else {
			if (window.netscape) {
				try {
					netscape.security.PrivilegeManager
							.enablePrivilege("UniversalXPConnect")
				} catch (A) {
					alert("你使用的FF浏览器,复制功能被浏览器拒绝！\r请在浏览器地址栏输入'about:config'并回车\r然后将'signed.applets.codebase_principal_support'设置为'true'")
				}
				var G = Components.classes["@mozilla.org/widget/clipboard;1"]
						.createInstance(Components.interfaces.nsIClipboard);
				if (!G) {
					return
				}
				var F = Components.classes["@mozilla.org/widget/transferable;1"]
						.createInstance(Components.interfaces.nsITransferable);
				if (!F) {
					return
				}
				F.addDataFlavor("text/unicode");
				var B = new Object();
				var D = new Object();
				var B = Components.classes["@mozilla.org/supports-string;1"]
						.createInstance(Components.interfaces.nsISupportsString);
				var C = E;
				B.data = C;
				F.setTransferData("text/unicode", B, C.length * 2);
				var Q = Components.interfaces.nsIClipboard;
				if (!G) {
					return false
				}
				G.setData(F, null, Q.kGlobalClipboard)
			}
		}
	}
}
function hqzhishu(A) {
	AjaxRequest.get( {
		url : "/quote/htmdata/html/" + A + ".htm",
		onSuccess : function(B) {
			ShowStockDataSTKResponse(B)
		}
	})
}
function ShowStockDataSTKResponse(A) {
	var C = A.responseText;
	if (C == "") {
		C = ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"
	}
	va = C.split(",");
	var B = document.getElementById("marketvalue");
	if (va[5] < 0) {
		B.innerHTML = va[3] + "&nbsp;" + va[5] + "&nbsp;" + va[6] + "%";
		B.className = "emgreen"
	} else {
		if (va[5] == 0) {
			B.innerHTML = va[3] + "&nbsp;" + va[5] + "&nbsp;" + va[6] + "%";
			B.className = "emblack"
		} else {
			B.innerHTML = va[3] + "&nbsp;+" + va[5] + "&nbsp;+" + va[6] + "%";
			B.className = "emred"
		}
	}
}
function winopen(A, F, C, E, B, D) {
	window.open(A, E, "height=" + C + ",width=" + F
			+ ",status=no,toolbar=no,menubar=no,location=no,scrollbars=" + B
			+ ",resizable=" + D)
}
function intval(A) {
	A = parseInt(A);
	return isNaN(A) ? 0 : A
}
function getPos(C) {
	var F = 0;
	var G = 0;
	var E = intval(C.style.width);
	var A = intval(C.style.height);
	var B = C.offsetWidth;
	var D = C.offsetHeight;
	while (C.offsetParent) {
		F += C.offsetLeft
				+ (C.currentStyle ? intval(C.currentStyle.borderLeftWidth) : 0);
		G += C.offsetTop
				+ (C.currentStyle ? intval(C.currentStyle.borderTopWidth) : 0);
		C = C.offsetParent
	}
	F += C.offsetLeft
			+ (C.currentStyle ? intval(C.currentStyle.borderLeftWidth) : 0);
	G += C.offsetTop
			+ (C.currentStyle ? intval(C.currentStyle.borderTopWidth) : 0);
	return {
		x : F,
		y : G,
		w : E,
		h : A,
		wb : B,
		hb : D
	}
}
function getScroll() {
	var B, A, D, C;
	if (document.documentElement && document.documentElement.scrollTop) {
		B = document.documentElement.scrollTop;
		A = document.documentElement.scrollLeft;
		D = document.documentElement.scrollWidth;
		C = document.documentElement.scrollHeight
	} else {
		if (document.body) {
			B = document.body.scrollTop;
			A = document.body.scrollLeft;
			D = document.body.scrollWidth;
			C = document.body.scrollHeight
		}
	}
	return {
		t : B,
		l : A,
		w : D,
		h : C
	}
}
function scroller(D, B) {
	if (typeof D != "object") {
		D = document.getElementById(D)
	}
	if (!D) {
		return
	}
	var C = this;
	C.el = D;
	C.p = getPos(D);
	C.s = getScroll();
	C.clear = function() {
		window.clearInterval(C.timer);
		C.timer = null
	};
	C.t = (new Date).getTime();
	C.step = function() {
		var F = (new Date).getTime();
		var E = (F - C.t) / B;
		if (F >= B + C.t) {
			C.clear();
			window.setTimeout(function() {
				C.scroll(C.p.y, C.p.x)
			}, 13)
		} else {
			st = ((-Math.cos(E * Math.PI) / 2) + 0.5) * (C.p.y - C.s.t) + C.s.t;
			sl = ((-Math.cos(E * Math.PI) / 2) + 0.5) * (C.p.x - C.s.l) + C.s.l;
			C.scroll(st, sl)
		}
	};
	C.scroll = function(E, F) {
		window.scrollTo(F, E)
	};
	C.timer = window.setInterval(function() {
		C.step()
	}, 13);
	var A = document.getElementById("Title");
	if (A && A.type.toLowerCase() != "hidden") {
		A.focus()
	}
}
function objscroller(F, C, E) {
	if (typeof F != "object") {
		F = document.getElementById(F)
	}
	if (!F) {
		return
	}
	var D = this;
	D.el = F;
	D.p = getPos(F);
	D.s = getScroll();
	D.clear = function() {
		window.clearInterval(D.timer);
		D.timer = null
	};
	D.t = (new Date).getTime();
	D.step = function() {
		var I = (new Date).getTime();
		var G = (I - D.t) / C;
		if (I >= C + D.t) {
			D.clear();
			window.setTimeout(function() {
				D.scroll(D.p.y, D.p.x)
			}, 13)
		} else {
			st = ((-Math.cos(G * Math.PI) / 2) + 0.5) * (D.p.y - D.s.t) + D.s.t;
			sl = ((-Math.cos(G * Math.PI) / 2) + 0.5) * (D.p.x - D.s.l) + D.s.l;
			D.scroll(st, sl)
		}
	};
	D.scroll = function(G, I) {
		window.scrollTo(I, G)
	};
	D.timer = window.setInterval(function() {
		D.step()
	}, 13);
	var A = document.getElementById(E);
	if (A) {
		try {
			A.focus()
		} catch (B) {
		}
	}
}
function scrollerpost(D, A) {
	if (typeof D != "object") {
		D = document.getElementById(D)
	}
	if (!D) {
		return
	}
	var B = this;
	B.el = D;
	B.p = getPos(D);
	B.s = getScroll();
	B.clear = function() {
		window.clearInterval(B.timer);
		B.timer = null
	};
	B.t = (new Date).getTime();
	B.step = function() {
		var F = (new Date).getTime();
		var E = (F - B.t) / A;
		if (F >= A + B.t) {
			B.clear();
			window.setTimeout(function() {
				B.scroll(B.p.y, B.p.x)
			}, 13)
		} else {
			st = ((-Math.cos(E * Math.PI) / 2) + 0.5) * (B.p.y - B.s.t) + B.s.t;
			sl = ((-Math.cos(E * Math.PI) / 2) + 0.5) * (B.p.x - B.s.l) + B.s.l;
			B.scroll(st, sl)
		}
	};
	B.scroll = function(E, F) {
		window.scrollTo(F, E)
	};
	B.timer = window.setInterval(function() {
		B.step()
	}, 13);
	if (document.all) {
		var C = frames.oblog_Composition
	} else {
		var C = document.getElementById("oblog_Composition").contentWindow
	}
	C.document.body.focus()
}
function returnpage() {
	var D = document.getElementById("pagevalue");
	var C = D.value;
	if (isNaN(parseInt(C))) {
		return false
	}
	if (parseInt(C) < 1) {
		return false
	}
	if (parseInt(C) > D.getAttribute("total")) {
		return false
	}
	var B = /(_\d*)/ig;
	var E = D.getAttribute("preUrl");
	var A = E.replace(B, "_" + parseInt(C));
	window.location.href = A
}
function checkUserProperty(A, B) {
	var E = GetCookie("UserName");
	var F = GetCookie("UserID");
	var C = GetCookie("Ticket");
	if (E.trim() == "" || F.trim() == "" || C.trim() == "") {
		alert("\u62b1\u6b49\uff0c\u60a8\u8fd8\u672a\u767b\u5f55\uff01");
		var D = document.getElementsByName("property");
		D[0].checked = true;
		return false
	}
	if (A > B) {
		alert("\u5bf9\u4e0d\u8d77\uff0c\u60a8\u7684\u79ef\u5206\u4e0d\u8db3\uff0c\u65e0\u6cd5\u4f7f\u7528\u6b64\u9053\u5177\u3002");
		var D = document.getElementsByName("property");
		D[0].checked = true;
		return false
	}
}
function isToPayTopic(B, A, C) {
	if (A.trim() == C.trim()) {
		return true
	}
	return confirm("\u8be5\u64cd\u4f5c\u5c06\u6263\u9664" + B
			+ "\u79ef\u5206\uff0c\u786e\u5b9a\u5417?")
}
var _9time = new Date().setHours(9, 0, 0);
var _11time = new Date().setHours(11, 31, 0);
var _13time = new Date().setHours(12, 59, 0);
var _15time = new Date().setHours(15, 1, 0);
var ctime;
function ShowSHQuote() {
	var A = "/quote/htmdata/html/sh_000001.htm";
	AjaxRequest.get( {
		url : A,
		onSuccess : function(B) {
			ShowSHQuoteResponse(B)
		}
	});
	ctime = new Date().getTime();
	if ((ctime > _9time && ctime < _11time)
			|| (ctime > _13time && ctime < _15time)) {
		window.setTimeout(ShowSHQuote, 30000)
	}
}
function ShowSHQuoteResponse(B) {
	var A = B.responseText;
	if (A == "") {
		A = ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"
	}
	va = A.split(",");
	var C = document.getElementById("result1");
	if (va[6] < 0) {
		C.innerHTML = "<strong onclick=\"window.open('http://share.jrj.com.cn/stocks/index/sh000001/index.shtml');\">\u4e0a\u8bc1\u6307\u6570&nbsp;&nbsp;</strong><font class='down'>"
				+ va[3]
				+ "</font><b class='down down_ext'>"
				+ va[6].replace("-", "")
				+ "%</b>\u6210\u4ea4\u603b\u989d"
				+ ((va[9] / 10000) + "").replace(/([0-9]+[.][0-9]{0,2}).*/,
						"$1") + "\u4ebf\u5143"
	} else {
		C.innerHTML = "<strong onclick=\"window.open('http://share.jrj.com.cn/stocks/index/sh000001/index.shtml');\">\u4e0a\u8bc1\u6307\u6570&nbsp;&nbsp;</strong><font class='up'>"
				+ va[3]
				+ "</font><b class='up up_ext'>"
				+ va[6]
				+ "%</b>\u6210\u4ea4\u603b\u989d"
				+ ((va[9] / 10000) + "").replace(/([0-9]+[.][0-9]{0,2}).*/,
						"$1") + "\u4ebf\u5143"
	}
}
function ShowSZQuote() {
	var A = "/quote/htmdata/html/sz_399001.htm";
	AjaxRequest.get( {
		url : A,
		onSuccess : function(B) {
			ShowSZQuoteResponse(B)
		}
	});
	ctime = new Date().getTime();
	if ((ctime > _9time && ctime < _11time)
			|| (ctime > _13time && ctime < _15time)) {
		window.setTimeout(ShowSZQuote, 30000)
	}
}
function ShowSZQuoteResponse(B) {
	var A = B.responseText;
	if (A == "") {
		A = ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"
	}
	va = A.split(",");
	var C = document.getElementById("result2");
	if (va[6] < 0) {
		C.innerHTML = "<strong onclick=\"window.open('http://share.jrj.com.cn/stocks/index/sz399001/index.shtml');\">\u6df1\u5733\u6307\u6570&nbsp;&nbsp;</strong><font class='down'>"
				+ va[3]
				+ "</font><b class='down down_ext'>"
				+ va[6].replace("-", "")
				+ "%</b>\u6210\u4ea4\u603b\u989d"
				+ ((va[9] / 10000) + "").replace(/([0-9]+[.][0-9]{0,2}).*/,
						"$1") + "\u4ebf\u5143"
	} else {
		C.innerHTML = "<strong onclick=\"window.open('http://share.jrj.com.cn/stocks/index/sz399001/index.shtml');\">\u6df1\u5733\u6307\u6570&nbsp;&nbsp;</strong><font class='up'>"
				+ va[3]
				+ "</font><b class='up up_ext'>"
				+ va[6]
				+ "%</b>\u6210\u4ea4\u603b\u989d"
				+ ((va[9] / 10000) + "").replace(/([0-9]+[.][0-9]{0,2}).*/,
						"$1") + "\u4ebf\u5143"
	}
}
function ShowImg(B, A) {
	window
			.open(
					"http://quote.jrj.com.cn/htmdata/gifindex.asp?code=" + B
							+ "&market=" + A,
					"",
					"height=270,width=434,status=no,toolbar=no,menubar=no,location=no,resizable=no",
					"replace")
}
function showNextLastTopic(B, A) {
	var C = "/nextlasttopic.jspa?topicid=" + A + "&forumid=" + B;
	AjaxRequest.get( {
		url : C,
		onSuccess : function(D) {
			showNextLastTopicResponse(D)
		}
	})
}
function showNextLastTopicResponse(B) {
	var A = B.responseText;
	document.getElementById("nextlast").innerHTML = A
}
function setReturnUrl() {
	SetCookie("JRJ.ISTOCK.RETURNURL", window.location.href, -2, "/", true,
			false)
}
var search_type_val = 1;
var stocksTop = null;
function topStockSelect(C, F, D) {
	if (stocksTop == null) {
		stocksTop = new stockList("stocksTop", "stockLayer");
		stocksTop.Click = topStockClick;
		stocksTop.Func = topKeySelect
	}
	if (search_type_val != 1 && search_type_val != 2) {
		return
	}
	stocksTop.showList(C, F, D)
}
function topStockClick(D, E) {
	if (search_type_val != 1 && search_type_val != 2) {
		return
	}
	var F = document.getElementById("search_content");
	F.value = E.trim();
	stocksTop.hiddenList()
}
function topKeySelect() {
	var B = document.getElementById("search_content");
	B.value = stocksTop.defaultStock[1].trim()
}
function changeSearchButton(K) {
	var L = document.getElementById("topsearchForm");
	var N = document.getElementById("search_content_code");
	var G = '<input name="search_content" type="text" class="text" id="search_content" value="\u8bf7\u8f93\u5165\u80a1\u7968\u4ee3\u7801\u3001\u62fc\u97f3\u3001\u7b80\u79f0\u3001\u5427\u540d" onclick="this.value=\'\'" onkeyup="topStockSelect(event,this.value,this)" autocomplete="off"/>';
	var I = '<input name="search_content" type="text" class="text" id="search_content" value="\u8bf7\u8f93\u5165\u5173\u952e\u8bcd" onclick="this.value=\'\'" autocomplete="off"/>';
	var J = '<input name="search_content" type="text" class="text" id="search_content" value="\u8bf7\u8f93\u5165\u80a1\u7968\u4ee3\u7801\u3001\u540d\u79f0\u548c\u7b80\u79f0" onclick="this.value=\'\'" onkeyup="topStockSelect(event,this.value,this)" autocomplete="off"/>';
	if (K == 2) {
		L.action = "/fsearch.jspa";
		N.innerHTML = G
	} else {
		if (K == 4) {
			L.action = "/includes/jsp/tophqsearch.jsp";
			N.innerHTML = J
		} else {
//			L.action = "http://isearch.jrj.com.cn/istock/tsearch.jspa";
			L.action = "http://istock.jrj.com.cn/remen/search.jspa";
			N.innerHTML = I
		}
	}
}
function checkSearchForm() {
	var C = document.getElementById("search_content");
	var D = document.getElementsByName("search_type");
	if (C.value.trim() == ""
			|| C.value == "\u8bf7\u8f93\u5165\u80a1\u7968\u4ee3\u7801\u3001\u62fc\u97f3\u3001\u7b80\u79f0\u3001\u5427\u540d"
			|| C.value == "\u8bf7\u8f93\u5165\u5173\u952e\u8bcd"
			|| C.value == "\u8bf7\u8f93\u5165\u80a1\u7968\u4ee3\u7801\u3001\u540d\u79f0\u548c\u7b80\u79f0") {
		alert("\u8bf7\u8f93\u5165\u641c\u7d22\u5185\u5bb9\uff01");
		return false
	}
	for (i = 0; i < D.length; i++) {
		if (D[i].checked && D[i].value == 2 && C.value.length > 20) {
			alert("\u4e0d\u80fd\u8d85\u8fc720\u4e2a\u5b57\u7b26\uff01");
			return false
		}
	}
	if (typeof (stocksTop) != "undefined" && stocksTop != null) {
		stocksTop.hiddenList()
	}
	for ( var E = 0; E < stocksArray.length; E++) {
		if (C.value.trim() == stocksArray[E].name) {
			_addLastestShareToCookie(stocksArray[E].code)
		}
	}
	return true
}
function SlideBox(G, I, J) {
	if (typeof (G) == "string") {
		G = document.getElementById(G)
	}
	this.container = G;
	this.frequency = I;
	this.direction = J;
	this.films = [];
	var K = this.container.getElementsByTagName("div");
	for ( var F = 0; F < K.length; F++) {
		if (K[F].className == "slideFilm") {
			K[F].onmouseover = function(A) {
				return function() {
					A._mouseover()
				}
			}(this);
			K[F].onmouseout = function(A) {
				return function() {
					A._mouseout()
				}
			}(this);
			this.films[this.films.length] = K[F]
		}
	}
	this._playTimeoutId = null;
	this._slideTimeoutId = null;
	this._slidable = true;
	this._loop()
}
SlideBox.prototype = {
	_loop : function() {
		var B = this;
		this._playTimeoutId = setTimeout(function() {
			B._slide()
		}, this.frequency)
	},
	_slide : function() {
		var C = this;
		var D = function() {
			if (!C._slidable) {
				return
			}
			var B = C.container;
			if (C.direction == "top") {
				if (B.scrollTop < B.offsetHeight - 2) {
					B.scrollTop += 2
				} else {
					clearInterval(C._slideTimeoutId);
					C._loop();
					var A = B.getElementsByTagName("div")[0];
					B.appendChild(A);
					B.scrollTop = 0
				}
			} else {
				if (C.direction == "left") {
					if (B.scrollLeft < B.offsetWidth - 2) {
						B.scrollLeft += 2
					} else {
						clearInterval(C._slideTimeoutId);
						C._loop();
						var A = B.getElementsByTagName("div")[0];
						B.appendChild(A);
						B.scrollLeft = 0
					}
				}
			}
		};
		this._slideTimeoutId = setInterval(D, 10)
	},
	_mouseover : function() {
		this._slidable = false
	},
	_mouseout : function() {
		this._slidable = true
	}
};
function subUrl(B) {
	var A = "http://istock.jrj.com.cn/redirect.jsp?url=" + escape(B);
	window.open(A)
}
function close_zjfwg_context() {
	var A = document.getElementById("_zjfwg_context");
	A.style.display = "none"
}
function open_zjfwg_context() {
	var A = document.getElementById("_zjfwg_context");
	A.style.display = "block"
}
function close_zjfwg() {
	setTimeout("callbackZjfwgHq()", 2000);
	setTimeout("close_zjfwg_context()", 5000)
}
function loadScript(I, F, G) {
	var E = document.createElement("script");
	E.setAttribute("language", "javascript");
	if (G) {
		E.setAttribute("charset", G)
	}
	E.setAttribute("src", I);
	document.body.insertBefore(E, document.body.firstChild);
	if (document.all) {
		E.onreadystatechange = function() {
			if (this.readyState == 4 || this.readyState == "complete"
					|| this.readyState == "loaded") {
				if (F) {
					F()
				}
				E.onreadystatechange = null;
				document.body.removeChild(E)
			}
		}
	} else {
		E.onload = function() {
			if (F) {
				F()
			}
			E.onreadystatechange = null;
			document.body.removeChild(E)
		}
	}
}
function subStringByCase(G, F) {
	if (!G || !F) {
		return ""
	}
	var K = 0;
	var I = 0;
	var J = "";
	for (I = 0; I < G.length; I++) {
		if (G.charCodeAt(I) > 128) {
			K += 2
		} else {
			K++
		}
		if (K > F) {
			return J
		}
		J += G.charAt(I)
	}
	return G
}
function trimString(B) {
	return B.replace(/^\s+|\s+$/g, "")
}
document
		.write('<div id="showDIV" class="showDIV" style="display:none"><p>正在提交,请耐心等待!</p><p><img src="http://i0.jrjimg.cn/istock/loading.gif" /></p><div id="panel"></div></div>');
var W = screen.width;
var H = screen.height;
function M(A) {
	return document.getElementById(A)
}
function MC(A) {
	return document.createElement(A)
}
function isIE() {
	return (document.all && window.ActiveXObject && !window.opera) ? true
			: false
}
function getBodySize() {
	var bodySize = [];
	with (document.documentElement) {
		bodySize[0] = (scrollWidth > clientWidth) ? scrollWidth : clientWidth;
		bodySize[1] = (scrollHeight > clientHeight) ? scrollHeight
				: clientHeight
	}
	return bodySize
}
function popCoverDiv() {
	if (M("cover_div")) {
		M("cover_div").style.display = "block"
	} else {
		var coverDiv = MC("div");
		document.body.appendChild(coverDiv);
		coverDiv.id = "cover_div";
		with (coverDiv.style) {
			position = "absolute";
			background = "#CCCCCC";
			left = "0px";
			top = "0px";
			var bodySize = getBodySize();
			width = bodySize[0] + "px";
			height = bodySize[1] + "px";
			zIndex = 0;
			if (isIE()) {
				filter = "Alpha(Opacity=60)"
			} else {
				opacity = 0.6
			}
		}
	}
}
function showshowDIV() {
	var A = M("showDIV");
	A.style.display = "block"
}
function change(D) {
	var C = M("showDIV");
	C.style.display = "block";
	C.style.position = "absolute";
	var A = getBodySize();
	C.style.left = (A[0] - 550) / 2 + "px";
	var B = document.getElementById(D);
	C.style.top = getPos(B).y + 30 + "px"
}
function showD() {
	change("addtopic");
	showshowDIV();
	popCoverDiv();
	void (0)
}
function close() {
	M("showDIV").style.display = "none";
	M("cover_div").style.display = "none";
	void (0)
}
function AjaxRequest() {
	var A = new Object();
	A.timeout = null;
	A.generateUniqueUrl = true;
	A.url = window.location.href;
	A.method = "GET";
	A.async = true;
	A.username = null;
	A.password = null;
	A.parameters = new Object();
	A.requestIndex = AjaxRequest.numAjaxRequests++;
	A.responseReceived = false;
	A.groupName = null;
	A.queryString = "";
	A.responseText = null;
	A.responseXML = null;
	A.status = null;
	A.statusText = null;
	A.aborted = false;
	A.xmlHttpRequest = null;
	A.onTimeout = null;
	A.onLoading = null;
	A.onLoaded = null;
	A.onInteractive = null;
	A.onComplete = null;
	A.onSuccess = null;
	A.onError = null;
	A.onGroupBegin = null;
	A.onGroupEnd = null;
	A.xmlHttpRequest = AjaxRequest.getXmlHttpRequest();
	if (A.xmlHttpRequest == null) {
		return null
	}
	A.xmlHttpRequest.onreadystatechange = function() {
		if (A == null || A.xmlHttpRequest == null) {
			return
		}
		if (A.xmlHttpRequest.readyState == 1) {
			A.onLoadingInternal(A)
		}
		if (A.xmlHttpRequest.readyState == 2) {
			A.onLoadedInternal(A)
		}
		if (A.xmlHttpRequest.readyState == 3) {
			A.onInteractiveInternal(A)
		}
		if (A.xmlHttpRequest.readyState == 4) {
			A.onCompleteInternal(A)
		}
	};
	A.onLoadingInternalHandled = false;
	A.onLoadedInternalHandled = false;
	A.onInteractiveInternalHandled = false;
	A.onCompleteInternalHandled = false;
	A.onLoadingInternal = function() {
		if (A.onLoadingInternalHandled) {
			return
		}
		AjaxRequest.numActiveAjaxRequests++;
		if (AjaxRequest.numActiveAjaxRequests == 1
				&& typeof (window.AjaxRequestBegin) == "function") {
			AjaxRequestBegin()
		}
		if (A.groupName != null) {
			if (typeof (AjaxRequest.numActiveAjaxGroupRequests[A.groupName]) == "undefined") {
				AjaxRequest.numActiveAjaxGroupRequests[A.groupName] = 0
			}
			AjaxRequest.numActiveAjaxGroupRequests[A.groupName]++;
			if (AjaxRequest.numActiveAjaxGroupRequests[A.groupName] == 1
					&& typeof (A.onGroupBegin) == "function") {
				A.onGroupBegin(A.groupName)
			}
		}
		if (typeof (A.onLoading) == "function") {
			A.onLoading(A)
		}
		A.onLoadingInternalHandled = true
	};
	A.onLoadedInternal = function() {
		if (A.onLoadedInternalHandled) {
			return
		}
		if (typeof (A.onLoaded) == "function") {
			A.onLoaded(A)
		}
		A.onLoadedInternalHandled = true
	};
	A.onInteractiveInternal = function() {
		if (A.onInteractiveInternalHandled) {
			return
		}
		if (typeof (A.onInteractive) == "function") {
			A.onInteractive(A)
		}
		A.onInteractiveInternalHandled = true
	};
	A.onCompleteInternal = function() {
		if (A.onCompleteInternalHandled || A.aborted) {
			return
		}
		A.onCompleteInternalHandled = true;
		AjaxRequest.numActiveAjaxRequests--;
		if (AjaxRequest.numActiveAjaxRequests == 0
				&& typeof (window.AjaxRequestEnd) == "function") {
			AjaxRequestEnd(A.groupName)
		}
		if (A.groupName != null) {
			AjaxRequest.numActiveAjaxGroupRequests[A.groupName]--;
			if (AjaxRequest.numActiveAjaxGroupRequests[A.groupName] == 0
					&& typeof (A.onGroupEnd) == "function") {
				A.onGroupEnd(A.groupName)
			}
		}
		A.responseReceived = true;
		A.status = A.xmlHttpRequest.status;
		A.statusText = A.xmlHttpRequest.statusText;
		A.responseText = A.xmlHttpRequest.responseText;
		A.responseXML = A.xmlHttpRequest.responseXML;
		if (typeof (A.onComplete) == "function") {
			A.onComplete(A)
		}
		if (A.xmlHttpRequest.status == 200
				&& typeof (A.onSuccess) == "function") {
			A.onSuccess(A)
		} else {
			if (typeof (A.onError) == "function") {
				A.onError(A)
			}
		}
		delete A.xmlHttpRequest.onreadystatechange;
		A.xmlHttpRequest = null
	};
	A.onTimeoutInternal = function() {
		if (A != null && A.xmlHttpRequest != null
				&& !A.onCompleteInternalHandled) {
			A.aborted = true;
			A.xmlHttpRequest.abort();
			AjaxRequest.numActiveAjaxRequests--;
			if (AjaxRequest.numActiveAjaxRequests == 0
					&& typeof (window.AjaxRequestEnd) == "function") {
				AjaxRequestEnd(A.groupName)
			}
			if (A.groupName != null) {
				AjaxRequest.numActiveAjaxGroupRequests[A.groupName]--;
				if (AjaxRequest.numActiveAjaxGroupRequests[A.groupName] == 0
						&& typeof (A.onGroupEnd) == "function") {
					A.onGroupEnd(A.groupName)
				}
			}
			if (typeof (A.onTimeout) == "function") {
				A.onTimeout(A)
			}
			delete A.xmlHttpRequest.onreadystatechange;
			A.xmlHttpRequest = null
		}
	};
	A.process = function() {
		if (A.xmlHttpRequest != null) {
			if (A.generateUniqueUrl && A.method == "GET") {
				A.parameters.AjaxRequestUniqueId = new Date().getTime() + ""
						+ A.requestIndex
			}
			var C = null;
			for ( var B in A.parameters) {
				if (A.queryString.length > 0) {
					A.queryString += "&"
				}
				A.queryString += encodeURIComponent(B) + "="
						+ encodeURIComponent(A.parameters[B])
			}
			if (A.method == "GET") {
				if (A.queryString.length > 0) {
					A.url += ((A.url.indexOf("?") > -1) ? "&" : "?")
							+ A.queryString
				}
			}
			A.xmlHttpRequest.open(A.method, A.url, A.async, A.username,
					A.password);
			if (A.method == "POST") {
				if (typeof (A.xmlHttpRequest.setRequestHeader) != "undefined") {
					A.xmlHttpRequest.setRequestHeader("Content-type",
							"application/x-www-form-urlencoded")
				}
				C = A.queryString
			}
			if (A.timeout > 0) {
				setTimeout(A.onTimeoutInternal, A.timeout)
			}
			A.xmlHttpRequest.send(C)
		}
	};
	A.handleArguments = function(B) {
		for ( var C in B) {
			if (typeof (A[C]) == "undefined") {
				A.parameters[C] = B[C]
			} else {
				A[C] = B[C]
			}
		}
	};
	A.getAllResponseHeaders = function() {
		if (A.xmlHttpRequest != null) {
			if (A.responseReceived) {
				return A.xmlHttpRequest.getAllResponseHeaders()
			}
			alert("Cannot getAllResponseHeaders because a response has not yet been received")
		}
	};
	A.getResponseHeader = function(B) {
		if (A.xmlHttpRequest != null) {
			if (A.responseReceived) {
				return A.xmlHttpRequest.getResponseHeader(B)
			}
			alert("Cannot getResponseHeader because a response has not yet been received")
		}
	};
	return A
}
AjaxRequest.getXmlHttpRequest = function() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest()
	} else {
		if (window.ActiveXObject) {
			try {
				return new ActiveXObject("Msxml2.XMLHTTP")
			} catch (A) {
				try {
					return new ActiveXObject("Microsoft.XMLHTTP")
				} catch (A) {
					return null
				}
			}
		} else {
			return null
		}
	}
};
AjaxRequest.get = function(A) {
	AjaxRequest.doRequest("GET", A)
};
AjaxRequest.doRequest = function(C, A) {
	if (typeof (A) != "undefined" && A != null) {
		var B = new AjaxRequest();
		B.method = C;
		B.handleArguments(A);
		B.process()
	}
};
AjaxRequest.isActive = function() {
	return (AjaxRequest.numActiveAjaxRequests > 0)
};
AjaxRequest.post = function(A) {
	AjaxRequest.doRequest("POST", A)
};
var _search=null;
function changeSearchType(D) {
	if (D == 2) {
		ctx = [];
		ctx.push('<form id="_search_form" onsubmit="return _search.checkSubmit();">');
		ctx.push('<p><em><input id="_istock_search" class="text" type="text">');
		ctx.push('</em><input id="_search_btn" type="button" value="爱股搜索"/>');
		ctx.push('<input type="hidden" name="url">');
		ctx.push('<input id="_search_form_submitBtn" style="width: 0px;height: 0px;padding: 0px;border: 0px;" type="submit" >');
		ctx.push('</p></form>');
		document.getElementById("istock_search_con").innerHTML = ctx.join("");	
		var patterns = new Array(
		           new JRJ.ui.Pattern("hk.s","http://istock.jrj.com.cn/list,hk[code].html"),
		        new JRJ.ui.Pattern("cn.s","http://istock.jrj.com.cn/list,[code].html")
			   );
		_search = new JRJ.ui.SearchBox("_istock_search","_search_btn",null,null,patterns);
		_search.param = "&item=10&type=cn_s|hk_s";
		_search.forceForm = "_search_form";
	} else {
		if (D == 4) {
			ctx = [];
			ctx.push('<form id="_search_form" onsubmit="return _search.checkSubmit();">');
			ctx.push('<p><em><input id="_istock_search" class="text" type="text">');
			ctx.push('</em><input id="_search_btn" type="button" value="爱股搜索"/>');
			ctx.push('<input type="hidden" name="url">');
			ctx.push('<input id="_search_form_submitBtn" style="width: 0px;height: 0px;padding: 0px;border: 0px;" type="submit" >');
			ctx.push('</p></form>');
			document.getElementById("istock_search_con").innerHTML = ctx.join("");	
			_search = new JRJ.ui.SearchBox("_istock_search","_search_btn");
			_search.forceForm = "_search_form";
		} else {
			ctx = [];
			ctx.push('<form name="topsearchForm" id="topsearchForm" action="http://isearch.jrj.com.cn/istock/tsearch.jspa" method="get" onsubmit="return checkSearchForm()">');
			ctx.push('<p><input name="search_type" value="3" type="hidden"/><em><input name="search_content" type="text" class="text" id="search_content" value="请输入关键词" onclick="this.value=\'\'" autocomplete="off"/>');
			ctx.push('</em><input id="_search_btn" type="submit" value="爱股搜索"/></p>');
			ctx.push('</form>');
			document.getElementById("istock_search_con").innerHTML = ctx.join("");
		}
	}
}

/**2010.6.29*/
/**
 * 通用问股模块 
 * @author jianjun.wang@jrj.com.cn
 * @date 2010-6-8
 */
if(typeof(JRJ)=="undefined"){
	var JRJ = {};
}
if(typeof(JRJ.app)=="undefined"){
	JRJ.app = {};
}
(function($){	
	var defCongfig = {
		codeId : "app_askStock_code",
		mobileId : "app_askStock_mobile",		
		okId : "app_askStock_ok",
		postUrl : "http://aps.jrj.com.cn/Json/join.aspx",
		codePrompt:"股票代码",
		mobilePrompt:"手机号码"
	}	
	/**
   * @param actionId 问股活动id，需要向贾伟申请
	 * @param {object} config 参数
	   {<br/>
				codeId:(string)股票代码input id，默认为app_askStock_code,<br/>
				mobileId:(string)手机号码input id默认为app_askStock_mobile,<br/>
				okId:(string)提交按钮id，默认为app_askStock_ok,<br/>
				postUrl:(string)提交地址,<br/>
				codePrompt:(string)股票代码input提示，默认为“股票代码”,<br/>
				mobilePrompt:(string)手机号码input提示，默认为“手机号码”,<br/>
	   }
	 */
	JRJ.app.askStock = function(actionId,config){
		this.actionId = actionId;
		this.config = applyIf(config||{},defCongfig);
		this.codeInput = $("#"+this.config.codeId);
		this.mobileInput = $("#"+this.config.mobileId);
		this.okButton = $("#"+this.config.okId);
		this.init();
	}

  JRJ.app.askStock.prototype = {
		init : function(){
			var instance = this;
			instance.codeInput.focus(function(){
				if($.trim(instance.codeInput.val())==instance.config.codePrompt){
					instance.codeInput.val("")
				}				
			});
			instance.codeInput.blur(function(){
				if($.trim(instance.codeInput.val())==""){
					instance.codeInput.val(instance.config.codePrompt)
				}				
			});
			instance.mobileInput.focus(function(){
				if($.trim(instance.mobileInput.val())==instance.config.mobilePrompt){
					instance.mobileInput.val("")
				}				
			});
			instance.mobileInput.blur(function(){
				if($.trim(instance.mobileInput.val())==""){
					instance.mobileInput.val(instance.config.mobilePrompt)
				}				
			});
		  instance.okButton.click(function(){
				var code = instance.codeInput.val();
				var mobile = instance.mobileInput.val();
				var mobileRES = /^(((1[3,8][0-9]{1})|159|158|151|152|153|154|155|156|157|150)+\d{8})$/;
				var stockcodeRES = /^(((002|000|300|600)[\d]{3})|60[\d]{4})$/;
        if (!stockcodeRES.test(code)) {
          alert("请输入正确的股票代码");
          return false;
        }
        if (!mobileRES.test(mobile)) {
          alert("请输入正确的手机格式");
          return false;
        }				
				var json = '[{"actionid":"' + instance.actionId + '","stockcode1":"' + code +'","mobile":"' + mobile +'"}]';
				$.getJSON(instance.config.postUrl+"?json="+json+"&callback=?",function(data){					
					if(data&&data.result){
						var msg = "用户：您好！\n";
						msg += "您的信息已成功提交，我们会尽快回复！\n";
						msg += "如果您急需答复，请咨询：010－58325080\n";
						msg += "我们会通过快赢数据帮您查看机构真实增减仓信息，\n";
						msg += "如果您是老用户还可获得公司内部信息帮助。\n";
						alert(msg);					
					}
				});
			});
		}
	}	
	var applyIf = function(obj, config) {
  	if(obj && config && typeof config == 'object'){
      for(var p in config) {
				if (!obj.hasOwnProperty(p))
          obj[p] = config[p];
			}
  	}
  	return obj;
	};	
})(jQuery);

/*
 * 验证是否登录，弹出登陆框
 */
function istock_check_login(){
	if(!_checkLogin()){
		var a=new JRJLoginDialog("istock","","false","http://istock.jrj.com.cn/login.jspa","http://istock.jrj.com.cn/login.jspa");
		a.show();
		return false;
	}
	return true;
}

function istock_loginDialog(){
	var a=new JRJLoginDialog("istock","","false","http://istock.jrj.com.cn/login.jspa","http://istock.jrj.com.cn/login.jspa");
	a.show();
}

//081029-TabJs-lin
function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  if(i==cursel){
	  addClass(menu,"hover");
	  con.style.display="block"; 
  }
  else{
	  removeClass(menu,"hover");
	  con.style.display="none";	
  }
 }
}

function addClass(ele,xclass)
{
  if(!xclass) return false;
  if(ele.className!="") 
  {
    var re = new RegExp("\\b"+xclass+"\\b\\s*", "");
    ele.className = ele.className.replace(re, "");
    ele.className = xclass+" "+ele.className;
  }
  else ele.className = xclass;
}

function removeClass(ele,xclass)
{
  if(!xclass) return false;
  if(ele.className!="") 
  {
    var re = new RegExp("\\b"+xclass+"\\b\\s*", "");
    ele.className = ele.className.replace(re, "");
  }
}

