(function() {
	if (!$s) {
		return
	}
	var N = 543 + 10,
	L = 650 - 3,
	A = 430,
	H = 85,
	E = 10,
	F = 20,
	D = 690 - 15,
	K = this;
	var Q, S, C;
	function T() {
		Q = $s.$c("div");
		Q.style.background = "none";
		Q.style.height = "700px";
		Q.style.width = "700px";
		Q.style.margin = 0;
		Q.style.padding = 0;
		Q.style.display = "none";
		Q.style.position = "absolute";
		Q.style.top = 0;
		Q.style.left = "718px";
		Q.style.zIndex = 100000;
		S = $s.$c("div");
		S.style.background = "#9C9C9C";
		S.style.margin = 0;
		S.style.padding = 0;
		S.style.display = "none";
		S.style.position = "absolute";
		S.style.left = "721px";
		S.style.zIndex = 99999;
		C = $s.$c("div");
		C.style.background = "#A5C6EC";
		C.style.height = "2px";
		C.style.width = "400px";
		C.style.margin = 0;
		C.style.padding = 0;
		C.style.display = "none";
		C.style.position = "absolute";
		C.style.overflow = "hidden";
		C.style.zIndex = 100000;
		var W = ['<div id="preview_mycontent" style="overflow:hidden;margin:0;padding:0;background:#A5C6EC;">', '<div id="preview_cmain" style="margin:8px;padding:0;border:2px solid #234063;background:#fff;">', '<h2 style="height:30px;line-height:30px;background:#E8F3FF;position:relative;margin:0;overflow:hidden;padding-right:60px;">', '<a id="preview_title" href="#" target="_blank" style="zoom:1;overflow:hidden;outline:none;margin-left:8px;color:0000CC;font-size:16px;font-weight:bold;"></a>', '<a id="preview_close" href="javascript:void(null);" style="position:absolute;right:8px;top:4px;width:40px;height:20px;line-height:20px;text-align:center;font-size:13px;font-weight:normal;color:#ffffff;letter-spacing:-1px; text-decoration:none;background:#9EB9EC;">关&nbsp;闭</a>', "</h2>", '<iframe id="preview_iframe" src="about:blank" width=100% height=432 frameborder=0 scrolling=auto border=0 allowtransparency="true" ></iframe>', '<div class="popfooter" style="margin:0;padding:0;height:26px;line-height:26px;overflow:hidden;background:#eeeeee;border-top:1px solid #d9d9d9;"><a href="#" style="zoom:1;outline:none;font-size:12px;color:#818181;float:right;margin-right:10px" target=_blank>预览功能反馈</a><a href="#" target=_blank  style="float:right;zoom:1;outline:none;margin-left:15px; margin-right:10px;font-size:12px;color:#818181;">免责声明</a></div>', "</div>", "</div>"];
		Q.innerHTML = W.join("");
		setTimeout(I, 1);
		window.sogou_preview_swap = R
	}
	function I() {
		$s.$("preview_close").onclick = $s.stopEvent(function() {
			O();
			return false
		});
		Q.onclick = $s.stopEvent(function() {
			return true
		});
		$s.bind(document.body, "click", O);
		if ($s.$("preview_copy")) {
			$s.$("preview_copy").onclick = function() {
				var X = $s.$("preview_iframe").contentWindow.document;
				var W = X.getElementById("embeddiv").getElementsByTagName("div");
				if (W.length > 0) {
					var Y = W[0].innerHTML;
					var Z = /<FONT (.+?)>(.+?)<\/FONT>/ig;
					Y = Y.replace(Z, "$2");
					Z = /<BR>/ig;
					Y = Y.replace(Z, "\r\n").replace(/&amp;/g, "&").replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&nbsp;/g, " ");
					window.clipboardData.setData("Text", Y)
				}
			}
		}
	}
	$s.extend(T);
	var M = null;
	function R(X, W) {
		if (M != X) {
			V(X, W)
		} else {
			O(X, W)
		}
	}
	function B() {
		var W = document.documentElement.clientWidth - N;
		if (W > L) {
			W = L
		} else {
			if (W < A) {
				W = A
			}
		}
		return W - 25
	}
	function P(Z) {
		var W = $s.getScrollTop();
		Z += F;
		var Y = W + E;
		if (W < H) {
			Y = H + E
		}
		if (Y > Z) {
			Y = Z
		}
		var X = W + document.documentElement.clientHeight - E;
		if (X < Z) {
			X = Z
		}
		return [Y, X]
	}
	var J = false;
	function V(W, a) {
		J = true;
		setTimeout(function() {
			J = false
		},
		50);
		U("previewOn_" + a);
		var d = $s.$(M);
		if (d) {
			d.style.color = "#666666";
			d.style.background = "#ffffff"
		}
		M = W;
		d = $s.$(W);
		if (!d) {
			return false
		}
		var X = d.getAttribute("url");
		var h = d.getAttribute("sogou_preview_title");
		var Z = d.getAttribute("sogou_preview_link");
		if (X) {
			G(W, X, h, Z)
		}
		var g = $s.pos(d);
		var b = P(g[1]);
		var f = b[0],
		i = b[1] - b[0],
		Y = B();
		Q.style.top = f + "px";
		Q.style.width = Y + "px";
		Q.style.height = i + "px";
		S.style.top = (f + 3) + "px";
		S.style.width = Y + "px";
		S.style.height = (i - 4) + "px";
		var c = 3;
		if ($s.ua.ie) {
			c = 7
		}
		if ($s.ua.safari || $s.ua.firefox) {
			c = 8
		}
		C.style.top = (g[1] + c + 7) + "px";
		C.style.left = (g[0] + 45) + "px";
		var j = D - g[0];
		if (j < 0) {
			C.style.width = 0
		} else {
			C.style.width = j + "px"
		}
		$s.$("preview_mycontent").style.height = (i - 4) + "px";
		$s.$("preview_cmain").style.height = (i - 22) + "px";
		$s.$("preview_iframe").style.height = (i - 79) + "px";
		d.style.color = "";
		d.style.background = "url(/images/fadajin.png) no-repeat -1px -3px #FFF";
		Q.style.display = "block";
		S.style.display = "block";
		C.style.display = "block";
		return false
	}
	function O(Y, X) {
		if (J) {
			J = false;
			return
		}
		var W = $s.$(M);
		if (W) {
			W.style.background = "url(/images/fadajin.png) no-repeat -1px -3px #FFF";
		}
		M = null;
		Q.style.display = "none";
		S.style.display = "none";
		C.style.display = "none";
		U("previewOff_" + (X || ""))
	}
	function G(X, Y, Z, W) {
		$s.$("preview_iframe").src = Y;
		$s.$("preview_title").innerHTML = Z;
		$s.$("preview_title").href = W
	}
	function U(W) {
		if (typeof uigsPB != "undefined") {
			uigsPB(W)
		}
	}
})();