function SetTips(id, h, clID, opID){
	var scr = document.getElementById(id), parent = scr.parentNode, lis = scr.getElementsByTagName("li"), height = h * lis.length, temp = 0, time = null, st = null, clBtn = document.getElementById(clID), op = document.getElementById(opID);
	op.onclick = function(){ CK.DeleteCookie("ebook_tips"); op.style.display = "none"; parent.parentNode.style.display = "block"; return false; }
	clBtn.onclick = function(){ CK.SetCookie("ebook_tips", "s", 1); parent.parentNode.style.display = "none";  op.style.display = "block"; return false; }
	if(CK.GetCookie("ebook_tips")){
		parent.parentNode.style.display = "none";
		op.style.display = "block";
		return;
	}
	scr.innerHTML += scr.innerHTML;
	function scrollBegin(){
		if(++temp > h){ time = setTimeout(setScroll, 3000); return;}
		if(++parent.scrollTop >= height) parent.scrollTop = 0;
		time = setTimeout(scrollBegin, 0);
	}
	function setScroll(){
		temp = 0;
		scrollBegin();
	}setScroll();
	parent.onmouseover = function(){ clearTimeout(time); }
	parent.onmouseout = scrollBegin;
}

function SetSearch(txtId, dropId, btnId){
	var input = document.getElementById(txtId), drop = document.getElementById(dropId), btn = document.getElementById(btnId), url;
	btn.onclick = function(){
		if(input.value.length < 1){ alert("请输入搜索关键字！"); return false; }
		switch(drop.value){
			case 1: url = "http://ebook.91.com/Zines/ZineSearch.aspx?Rank=PublishDateDesc&pagesize=10&searchKey="; break;
			case 2: url = "http://ebook.91.com/Books/BookSearch.aspx?pagesize=10&searchKey="; break;
			default: url = "http://ebook.91.com/Common/Search.aspx?Rank=PublishDateDesc&pagesize=10&searchKey="; break;
		}
		window.location.href = url + encodeURIComponent(input.value);
	}
}

//公共功能模块
function Fun(){
	Fun.IEVerPattern = /MSIE( )(\d+(\.\d+)?)/;
	Fun.$ie = (document.all) ? true : false; //判断是否IE
	Fun.$IEVer = (Fun.IEVerPattern.test(window.navigator.userAgent)) ? parseFloat(RegExp.$2) : null; //获取IE版本号
	Fun.$id = function(id){ return document.getElementById(id); } //获取ID对象值：（对象ID名）
	//获取tag对象名集合：（对象Tag标签名）[父对象限定]
	Fun.$tag = function(tagName, parent){ return (parent) ? parent.getElementsByTagName(tagName) : document.getElementsByTagName(tagName) ; }
	//获取Class样式名对象集合：（class样式名），[Tag标签限定]，[父对象限定]
	Fun.$cl = function(cl, objName, parentNodeObj){
		var retnode = [], myclass = new RegExp('\\b' + cl + '\\b'), elem = (parentNodeObj == null) ? document.getElementsByTagName(objName) : parentNodeObj.getElementsByTagName(objName), classes;
		for (var j = 0; j < elem.length; j++) { classes = elem[j].className; if (myclass.test(classes)) retnode.push(elem[j]); }
		return retnode;
	}
	//设置链接文本：（待设置的文本），[链接目标地址]，[链接目标窗口]，[样式]
	Fun.$link = function(txt, url, target, style){ return (url) ? "<a href=\"" + url + "\" " + ((style) ? "style=\"" + style + "\"" : "") + ((target) ? " target=\"" + target + "\"" : "") + ">" + txt + "<\/a>" : txt; }
	//设置对象集合事件：（待设置的对象集合），[鼠标覆盖事件]，[鼠标移开事件]，[鼠标点击事件]，
	Fun.$action = function(objArray, mouseoverHandle, mouseoutHandle, mouseclickHandle){
		if(!objArray || objArray.length < 1) return;
		for(var i = 0; i < objArray.length; i++){
			if(mouseoverHandle) objArray[i].onmouseover = mouseoverHandle;
			if(mouseoutHandle) objArray[i].onmouseout = mouseoutHandle;
			if(mouseclickHandle) objArray[i].onclick = mouseclickHandle;
		}
	}
	//设置目标相对浮动：（对比源对象），（待设置目标对象），[左偏移量]，[上偏移量]
	Fun.$position = function(obj, targetObj, leftOffset, topOffset){
		var temp = obj.offsetParent, left = obj.offsetLeft, top = obj.offsetTop;
		while(temp){ left += temp.offsetLeft; top += temp.offsetTop; temp = temp.offsetParent; }
		targetObj.style.left = (left + leftOffset) + "px";targetObj.style.top = (top + topOffset) + "px";
	}
	//获取URL参数函数（参数名）
	Fun.$url = function(name){
		var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"), r = window.location.search.substr(1).match(reg);
		if (r != null) return unescape(r[2]); return null;
	}
	//获取URL参数函数（参数位置）
	Fun.$staticurl = function(pos){
			var pathArray = window.location.href.split("/"),url = pathArray[pathArray.length - 1], arr = url.split(',');
			if(arr.length-1 >= pos) return arr[pos];
			return null;
	}
	//设置添加收藏效果：（收藏地址），（收藏标题）
	Fun.$fav = function(url, title){ try{ (Fun.$ie) ? window.external.addFavorite(url, title) : window.sidebar.addPanel(url, title); }catch(e){ alert("收藏失败！请手动操作"); } }
	//设置设为首页效果：（触发源对象），（首页地址）
	Fun.$home = function(obj, url){ try{ obj.style.behavior = "url(#default#homepage)"; obj.setHomePage(url); }catch(e){ if(window.netscape) try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }catch(e){ alert("您的浏览器不支持此功能！"); } } }
	//获取地址栏中域名：（域名参数）
	Fun.$domain = function(url){ return (url.indexOf("http") > -1) ? url.split("/")[2] : url.split("/")[0]; }
	//ajax处理：（ajax地址），（获取方式），（回调函数），[编码方式]
	Fun.$ajax = function(url, type, ajaxHandle, charset){
		if(type){
			var xmlHttp;
			try{ xmlHttp = new XMLHttpRequest(); }catch (e){ try{ xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }catch (e){ try{ xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }catch (e){ alert("您的浏览器不支持AJAX！"); return false; } } }
			if(Fun.$ie) xmlHttp.onreadystatechange = ajaxHandle;
			if(!Fun.$ie) xmlHttp.onload = ajaxHandle;
			xmlHttp.open(type, url, false);
			xmlHttp.setRequestHeader( "Content-Type", "text/html;charset=" + charset );
			xmlHttp.send(null);
		}else{
			var xmlHttp = document.createElement("script"); xmlHttp.type = "text\/javascript";
			xmlHttp.charset = charset; xmlHttp.src = url;
			if(Fun.$ie) xmlHttp.onreadystatechange = ajaxHandle;
			if(!Fun.$ie) xmlHttp.onload = ajaxHandle;
			Fun.$tag("head")[0].appendChild(xmlHttp);
			setTimeout(function(){ Fun.$tag("head")[0].removeChild(xmlHttp); }, 5000);
		}
	}
	//取不重复随机数：（数据集合），（取的长度）
	Fun.$getRandom = function(array, len){ for (var r = [], i = 0; i < len; i++){ r.push(array.splice(Math.floor(Math.random() * array.length), 1)); } return r; }
}Fun();


function SetTopLogin(con1ID, con2ID, loginID, nameID, logoutID){
	var con1 = Fun.$id(con1ID), con2 = Fun.$id(con2ID), login = Fun.$id(loginID), name = Fun.$id(nameID), head = Fun.$tag("head")[0], out = Fun.$id(logoutID);
	Fun.$ajax("http://ebook.91.com/ActionHandler.ashx?act=get_login_data&dataName=loginData&madom=" + Math.random(), null, function(){
		if(document.all && this.readyState != "loaded") return;
		try{
			if(loginData.isLogin == 0){
				login.href = loginData.loginUrl + "&ReturnUrl=" + encodeURIComponent(window.location.href);
				con1.style.display = "block";
				con2.style.display = "none";
			}else{
				con2.style.display = "block";
				con1.style.display = "none";
				name.innerHTML = decodeURI(loginData.userName) + " ";
				out.href = "http://ebook.91.com/LoginCheck.ashx?logout=true&ReturnUrl=" + encodeURIComponent(window.location.href);
			}
		} catch(e){  }
	}, "gb2312");
}

//设置Cookie
function CK(){
	CK.GetCookie = function(name){   
		var arg = name + "=", alen = arg.length, clen = document.cookie.length, i = 0, j = 0;
		while(i < clen){
			j = i + alen;
			if(document.cookie.substring(i, j) == arg) return CK.GetCookieVal(j);
			i = document.cookie.indexOf(" ", i) + 1;
			if(i == 0) break;
		}
		return null;
	}
	CK.GetCookieVal = function(offset) {   
		var endstr = document.cookie.indexOf (";", offset);
		if(endstr == -1) endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
	}
	CK.DeleteCookie = function(name) {   
		var exp = new Date(), cval = CK.GetCookie(name);
		exp.setTime(exp.getTime() - 1);
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
	}
	CK.SetCookie = function(name, value, days) {
		var path = "/", domain = null, secure = false, expires = new Date();
		CK.DeleteCookie(name);
		expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000));
		document.cookie = name + "=" + value + "; expires=" + expires.toGMTString() + ((domain == null) ? "" : ("; domain=" + domain)) + ((path == null) ? "" : ("; path=" + path)) +  ((secure == true) ? "; secure" : "");
	}
}CK();

//设置新闻字体大小效果
function SetNewsFont(){
	var links = document.getElementById("setFontLinks").getElementsByTagName("a"), con = document.getElementById("news_text"), style = ["16", "14", "12"];
	function mclick(){ con.style.fontSize = this.id + "px"; this.blur(); return false; }
	for(var i = 0; i < links.length; i++){ links[i].id = style[i]; links[i].onclick = mclick; };
}



var Comment = function(){
	this.Base = { code:"comment_", faceImgUrl:"http://img2.91huo.cn/pz91/images/smile/", imgUrl:"http://img2.91huo.cn/zn.sj/images/pc/1005/", defaultName:"志友", emptyWord:"暂无任何评论！", pageNum:10, extName:"com" };
	this.AjaxUrl = {
		listUrl:"http://pz.91." + this.Base.extName + "/port/getcomment_info.php?comment=_%urlpath%_&num=" + this.Base.pageNum,
		diggUrl:"http://pz.91." + this.Base.extName + "/ajax/getajaxinfo.php?UseScript=1&Work=digg&path=_%urlpath%_&template=3&page=" + this.Base.pageNum,
		buryUrl:"http://pz.91." + this.Base.extName + "/ajax/getajaxinfo.php?UseScript=1&Work=bury&path=_%urlpath%_&template=3&page=" + this.Base.pageNum,
		subUrl:"http://pz.91." + this.Base.extName + "/port/comment_action.php",
		backUrl:"http://zx.ebook.91.com/include/all/ocommentsend.htm?action=reload",
		codeUrl:"http://pz.91." + this.Base.extName + "/port/vericode_act.php?act=check×tamp=",
		codeImgUrl:"http://pz.91." + this.Base.extName + "/port/vericode_act.php?act=get×tamp=",
		commentUrl:""
	};
	
	
	this.GG = { name:"开啦第54期", img:"http://img7.91huo.cn/sj/2010/08/08/5f7a785f68746.jpg", url:"http://v2.g2.91.com/XStudio_G2_JS/NDGG/Transfer/GetBillItemUrl.aspx?BillMatterID=5243&TargetUrl=http://ebook.91.com/Zines/ZineDetail.aspx?journalid=4032", target:"_blank" };
	
	this.Login = { loginTitle:"登录", loginInfo:"后发表的评论将留下您的昵称哦", loginUrl:"https://reg.91.com/NDUser_Login.aspx?SiteFlag=130&action=uniformlogin&backurl=" + window.location.href, logoutTitle:"退出登录", logoutUrl:"http://mobile.91.com/Services/Logout.ashx?backUrl=" + window.location.href,  target:"_self", ajaxUrl:"http://mobile.91.com/Services/GetUserName.ashx?radom=" + Math.random() };
	
	this.Faces = [
		{ name:"91游", faces:[ { name:"哈哈大笑", code:1 }, { name:"微微一笑", code:2 }, { name:"鼓掌", code:3 }, { name:"不说话", code:4 }, { name:"喜欢", code:5 }, { name:"汗一个", code:6 }, { name:"困了", code:7 }, { name:"疑问", code:8 }, { name:"不好意思", code:9 }, { name:"大吃一惊", code:10 }, { name:"叫喊", code:11 }, { name:"不高兴", code:13 }, { name:"害羞", code:14 }, { name:"不是介个样子滴", code:15 }, { name:"同意", code:16 }, { name:"晕", code:17 }, { name:"寒", code:18 }, { name:"气愤", code:19 }, { name:"撒娇", code:20 }, { name:"装酷", code:21 }, { name:"仰慕", code:22 }, { name:"头晕", code:23 }, { name:"大哭", code:24 }, { name:"大笑", code:25 }, { name:"偷笑", code:26 }, { name:"嗯嗯", code:27 }, { name:"幻想", code:28 } ] },
		{ name:"土匪鸡", faces:[ { name:"翻脸", code:1072 }, { name:"吃惊", code:1073 }, { name:"晕倒", code:1074 }, { name:"没钱", code:1075 }, { name:"单挑", code:1076 }, { name:"不知道", code:1077 }, { name:"有的是钱", code:1078 }, { name:"来啊", code:1079 }, { name:"弹吉他", code:1080 }, { name:"真好吃", code:1081 }, { name:"闪人", code:1083 }, { name:"耍", code:1084 }, { name:"双截棍", code:1085 }, { name:"救命啊", code:1086 }, { name:"转晕了", code:1087 } ] },
		{ name:"乌龟GG", faces:[ { name:"开心", code:1059 }, { name:"吃惊", code:1060 }, { name:"打劫啊", code:1061 }, { name:"可怕啊", code:1062 }, { name:"抄袭", code:1063 }, { name:"伤心", code:1065 }, { name:"爬累了", code:1066 }, { name:"爬过", code:1067 }, { name:"上学", code:1068 }, { name:"哇---", code:1069 }, { name:"吓---", code:1071 } ] },
		{ name:"小僵尸", faces:[ { name:"吹符", code:1088 }, { name:"发呆", code:1089 }, { name:"睡觉", code:1090 }, { name:"吐舌头", code:1091 }, { name:"乌云", code:1092 }, { name:"闭嘴", code:1093 }, { name:"发火", code:1094 }, { name:"耍宝", code:1095 }, { name:"炸弹", code:1096 }, { name:"一队路过", code:1097 }, { name:"着火", code:1098 } ] },
		{ name:"乡村熊", faces:[ { name:"鬼脸", code:1043 }, { name:"奸笑", code:1044 }, { name:"呕吐", code:1045 }, { name:"飘过", code:1046 }, { name:"掐脸", code:1047 }, { name:"装酷", code:1057 } ] }
	];
	
	this.CommentInfos = [
		"此评论来自ebook.91.com，可能是系统自动发送，与本人一点关系都没有，谢绝各种形式的跨省追捕。",
		"在逐行逐句地看完此书后，我的心久久不能压抑的喜悦，震动了整个生命！怎会有如此精妙绝伦的好书？",
		"这是一本难得的好书！",
		"正在看，细细品味后再来评论。",
		"他写到了你灵魂深处！"
	];
	
	this.Model = "<div class=\"" + this.Base.code + "list\"><div class=\"" + this.Base.code + "list_info\"><p><img src=\"" + this.Base.imgUrl + this.Base.code + "user.jpg\" alt=\"\" \/><\/p><h2>_%username%_<\/h2><\/div><div class=\"" + this.Base.code + "list_con\"><div class=\"" + this.Base.code + "list_title\">发表于：_%addTime%_<\/div><div class=\"" + this.Base.code + "list_conc\">_%content%_<\/div><div class=\"" + this.Base.code + "list_footer\"><div class=\"" + this.Base.code + "list_quote\"><a href=\"javascript:;\" id=\"_%infoid%_\" class=\"" + this.Base.code + "link3\">引用<\/a><\/div><div class=\"" + this.Base.code + "list_link\"><a href=\"javascript:;\" id=\"_%infoid%_\" class=\"" + this.Base.code + "link1\">支持（<span>_%digg%_<\/span>）<\/a><a href=\"javascript:;\" id=\"_%infoid%_\" class=\"" + this.Base.code + "link2\">反对（<span>_%bury%_<\/span>）<\/a><\/div><\/div><\/div><\/div>";
	/**********************************************************************************************************************/
	var temp1 = "", temp2 = "", focusDigg, focusBury, cutPage = 1, Base = this.Base, Ajax = this.AjaxUrl, Login = this.Login, Model = this.Model;
	this.info = "<iframe style=\"display:none;\" height=\"100\" width=\"100%\" frameborder=\"0\" src=\"http://zx.sj.91.com/template/comment/ocommentsend.htm\" name=\"" + this.Base.code + "frm\" id=\"" + this.Base.code + "frm\"><\/iframe><div class=\"" + this.Base.code + "float\"><div class=\"" + this.Base.code + "txt_list\" id=\"" + this.Base.code + "txt_list\">";
	for(var i = 0; i < this.CommentInfos.length; i++) this.info += "<a href=\"javascript:;\">" + this.CommentInfos[i] + "</a>";
	for(var i = 0; i < this.Faces.length; i++){
		temp1 += "<li id=\"" + i + "\">" + this.Faces[i].name + "</li>";
		temp2 += "<div class=\"" + this.Base.code + "face_list\">";
		for(var k = 0; k < this.Faces[i].faces.length; k++) temp2 += "<img src=\"" + this.Base.faceImgUrl + this.Faces[i].faces[k].code + ".gif\" alt=\"" + this.Faces[i].faces[k].name + "\" title=\"" + this.Faces[i].faces[k].name + "\" class=\"" + this.Faces[i].faces[k].code + "\" \/>";
		temp2 += "<\/div>";
	}
	this.info += "<\/div><\/div><div class=\"" + this.Base.code + "float\"><div class=\"" + this.Base.code + "face\" id=\"" + this.Base.code + "face\"><ul class=\"" + this.Base.code + "face_nav\" id=\"" + this.Base.code + "face_nav\">" + temp1 + "<\/ul>" + temp2 + "<\/div><\/div><div class=\"" + this.Base.code + "parent\"><form action=\"" + this.AjaxUrl.subUrl + "\" method=\"post\" name=\"" + this.Base.code + "Form\" target=\"" + this.Base.code + "frm\" id=\"" + this.Base.code + "Form\"><input name=\"comment\" type=\"hidden\" id=\"comment\" value=\"\"  \/><input name=\"title\" type=\"hidden\" value=\"" + document.title + "\" \/><input name=\"url\" type=\"hidden\" value=\"" + window.location.href + "\" \/><input type=\"hidden\" name=\"defind\" id=\"" + this.Base.code + "defind\" \/><input type=\"hidden\" name=\"backUrl\" value=\"" + this.AjaxUrl.backUrl + "\" \/><div class=\"" + this.Base.code + "area\"><div class=\"" + this.Base.code + "area_title\"><span>内容：<\/span><span style=\"margin-top:134px;\">昵称：<\/span><span style=\"margin-top:18px;display:none;\" id=\"" + this.Base.code + "codeSpan\">验证码：<\/span><\/div><div class=\"" + this.Base.code + "area_line\"><div class=\"" + this.Base.code + "area_con\"><div class=\"" + this.Base.code + "area_con_t\"><ul id=\"" + this.Base.code + "nav\"><li class=\"" + this.Base.code + "area_con_t1\">插入快速评论<\/li><li class=\"" + this.Base.code + "area_con_t2\">插入表情</li><\/ul><\/div><textarea name=\"content\" id=\"" + this.Base.code + "textarea\"><\/textarea><\/div><\/div><div class=\"comment_area_line\"><input type=\"text\" name=\"name\" value=\"" + this.Base.defaultName + "\" id=\"" + this.Base.code + "nameInput\" \/><div style=\"float:left;\" id=\"" + this.Base.code + "nameInfo\">" + Fun.$link(this.Login.loginTitle, this.Login.loginUrl, this.Login.target) + " " + this.Login.loginInfo + "<\/div><div class=\"" + this.Base.code + "sub\"><a href=\"http://sj.bbs.91.com/board/26-462.html\" target=\"_blank\" class=\"link1\">错误反馈\</a><a href=\"javascript:;\" id=\"" + this.Base.code + "submitBtn\">发表评论\</a><\/div></div><div class=\"comment_area_line\"  style=\"display:none;\"><input type=\"text\" name=\"vericode\" id=\"" + this.Base.code + "vericode\" \/><img src=\"about:blank\" alt=\"\" id=\"" + this.Base.code + "codeImg\" \/><a style=\"float:left;\" href=\"javascript:;\" id=\"" + this.Base.code + "code_link\">看不清？点此刷新<\/a><\/div><\/div><\/form><\/div>";
	this.listInfo = "<div class=\"" + this.Base.code + "parent\"><div class=\"" + this.Base.code + "list_top\"><h2 id=\"" + this.Base.code + "cnum\">正在获取数据……<\/h2><div><span>查看：<\/span><input type=\"radio\" name=\"" + this.Base.code + "listType\" id=\"" + this.Base.code + "type1\" value=\"1\" checked=\"checked\" \/><label for=\"" + this.Base.code + "type1\">最新发表<\/label><input type=\"radio\" name=\"" + this.Base.code + "listType\" id=\"" + this.Base.code + "type2\" value=\"2\" \/><label for=\"" + this.Base.code + "type2\">最早发表<\/label><input type=\"radio\" name=\"" + this.Base.code + "listType\" value=\"3\" id=\"" + this.Base.code + "type3\" \/><label for=\"" + this.Base.code + "type3\">支持最多<\/label><input type=\"radio\" name=\"" + this.Base.code + "listType\" value=\"4\" id=\"" + this.Base.code + "type4\" \/><label for=\"" + this.Base.code + "type4\">反对最多<\/label><\/div><\/div><div class=\"" + this.Base.code + "pager\"><\/div><div class=\"" + this.Base.code + "line\" id=\"" + this.Base.code + "listCon\">正在获取数据……<\/div><div class=\"" + this.Base.code + "pager\"><\/div><\/div>";
	function getRadioValue(){ var radios = document.getElementsByName(Base.code + "listType"); for(var i = 0; i < radios.length; i++) if(radios[i].checked){ return radios[i].value; break; } }
	function Insert(Model, Ajax, Base, doc, top, url){ var ajaxCon = new Fun.$ajax(AjaxUrl.listUrl + "&orderby=" + getRadioValue() + "&currpage=" + cutPage, null, function(){
		if(Fun.$ie && this.readyState != "loaded"){ return; }else{
			try{
				var sinfo = "";
				if(conList.length < 1){ doc.innerHTML = Base.emptyWord; if(top) top.innerHTML = ""; return; }
				if(top) top.innerHTML = "已有<span>" + total_con + "<\/span>条评论 <a href=\"" + Ajax.commentUrl + "\" target=\"_blank\">查看所有评论<\/a>";
				for(var i = 0; i < conList.length; i++){
					sinfo += Model.replace(/_%username%_/g, userList[i]).replace(/_%addTime%_/g, timeList[i]).replace(/_%content%_/g, conList[i]).replace(/_%infoid%_/g, infoidList[i]).replace(/_%digg%_/g, diggList[i]).replace(/_%bury%_/g, buryList[i]);
				}
				doc.innerHTML = sinfo;
				pager(total_con, cutPage, Base.pageNum, Fun.$cl(Base.code + "pager", "div"));
				var parent = Fun.$id(Base.code + "parent"), link1 = Fun.$cl(Base.code + "link1", "a", parent), link2 = Fun.$cl(Base.code + "link2", "a", parent), link3 = Fun.$cl(Base.code + "link3", "a", parent), textarea = Fun.$id(Base.code + "textarea");
				if(link1 && link1.length > 0) Fun.$action(link1, null, null, function(){ focusDigg = this; SetAjax(AjaxUrl.diggUrl, this, url); this.blur(); return false; });
				if(link2 && link2.length > 0) Fun.$action(link2, null, null, function(){ focusBury = this; SetAjax(AjaxUrl.buryUrl, this, url); this.blur(); return false; });
				if(textarea && link3 && link3.length > 0) Fun.$action(link3, null, null, function(){ Fun.$id(Base.code + "defind").value = this.id; textarea.value = "[quote=" + this.id + "]"; textarea.focus(); this.blur(); return false; });
			}catch(e){ doc.innerHTML = "加载评论失败！"; }
		}
	}, "gb2312");}
	function isDiggBury(num){
		var str;
		switch(num){
			case "-1":str = "很抱歉，此评论属于旧版，不支持此操作！"; break;
			case "2": str = "很抱歉，您已经发表过了！"; break;
			case "3": str = "参数错误，请重试！"; break;
			case "1": str = "操作成功，感谢您的参与！"; break;
		}
		return str;
	}
	this.responseDiggInfo = function(num){ num = num.split("*")[0]; if(focusDigg && num == "1") focusDigg.innerHTML = "支持（<span>" +  (parseInt(focusDigg.innerHTML.replace(/[^\d]/gi, "")) + 1) + "<\/span>）"; if(num != "1") alert(isDiggBury(num)); }
	this.responseBuryInfo = function(num){ num = num.split("*")[0]; if(focusBury && num == "1") focusBury.innerHTML = "反对（<span>" +  (parseInt(focusBury.innerHTML.replace(/[^\d]/gi, "")) + 1) + "<\/span>）"; if(num != "1") alert(isDiggBury(num)); }
	function getPathByUrl(path){
		if(path.length == 0) return;
		re = new RegExp("/html/([0-9]{4}/[0-9]{2}/[0-9]{2})/([0-9]{1,})/index\.htm*", "gi");
		re.compile("/html/([0-9]{4}/[0-9]{1,2}/[0-9]{2})/([0-9]{1,})/index\.htm*", "gi");
		arr = re.exec(path);
		re = null;
		return (arr == null || arr == "") ? null : arr;
	}
	function pager(total, currentPage, displayNum, objs){
		var baseNum = 6, totalPage = Math.ceil(total / displayNum), str = "", href = "", links;
		str += "<div>" + ((currentPage == 1) ? "" : "<a href=\"javascript:;\" id=\"1\">首页<\/a><a href=\"javascript:;\" id=\"" + (currentPage - 1) + "\">上页<\/a>");
		for (i = ((currentPage - baseNum) > 0 ? currentPage - baseNum : 1); i <= ((currentPage + baseNum) < totalPage ? currentPage + baseNum : totalPage); i++) str += (currentPage == i) ? "<span>" + i + "<\/span>" : "<a href=\"javascript:;\" id=\"" + i + "\">" + i + "<\/a>";
		str += ((currentPage < totalPage) ? "<a href=\"javascript:;\" id=\"" + (parseInt(currentPage) + 1) + "\">下页<\/a>" : "") + ((totalPage != currentPage) ? "<a href=\"javascript:;\" id=\"" + totalPage + "\">尾页<\/a><\/div>" : "");
		if(totalPage > 1) for(var i = 0; i < objs.length; i++){
			objs[i].innerHTML = str;
			Fun.$action(Fun.$tag("a", objs[i]), null, null, function(){ cutPage = this.id; Insert(Model, Ajax, Base, Fun.$id(Base.code + "listCon"), Fun.$id(Base.code + "cnum"), Ajax.commentUrl); this.blur(); return false; });
		}
	}
	function SetAjax(aUrl, obj, url){ Fun.$ajax(aUrl + "&id=" + obj.id + "&rid=" + getPathByUrl(url)[2] + "&time="+new Date().getTime(), null, null); }
	this.Form = function(url, hasGG, GGData){
		document.writeln(this.info);
		Fun.$id("comment").value = url;
		this.AjaxUrl.commentUrl = url;
		var parent = Fun.$id(this.Base.code + "parent"), btns = Fun.$tag("li", Fun.$id(this.Base.code + "nav")), floats = Fun.$cl(this.Base.code + "float", "div", parent), temp, time, textarea = Fun.$id(this.Base.code + "textarea"), faceTabs = Fun.$tag("li", Fun.$id(this.Base.code + "face_nav")), faceCons = Fun.$cl(this.Base.code + "face_list", "div", Fun.$id(this.Base.code + "face")), tempTab = faceTabs[0], tempCon = faceCons[0], nameInput = Fun.$id(this.Base.code + "nameInput"), AjaxUrl = this.AjaxUrl, Base = this.Base, form = Fun.$id(this.Base.code + "Form"), Base = this.Base, CommentInfos = this.CommentInfos, initStr = Fun.$getRandom(this.CommentInfos, 1)[0], isOver = false, conTitle = Fun.$cl(this.Base.code + "area_title", "div", parent)[0], line = Fun.$cl(this.Base.code + "area", "div", parent)[0], nameInfo = Fun.$id(this.Base.code + "nameInfo"), code_img = Fun.$id(this.Base.code + "codeImg"), code_input = Fun.$id(this.Base.code + "vericode"), code_span = Fun.$id(this.Base.code + "codeSpan"), code_con = code_input.parentNode, code_link = Fun.$id(this.Base.code + "code_link");
		if(hasGG){
			if(GGData){ this.GG.img = GGData.img; this.GG.name = GGData.name; this.GG.url = GGData.url; this.GG.target = GGData.target; }
			line.style.paddingLeft = "285px";
			conTitle.style.marginLeft = "-285px"; conTitle.innerHTML = ""; conTitle.style.width = "285px";
			conTitle.innerHTML = Fun.$link("<img src=\"" + this.GG.img + "\" alt=\"" + this.GG.name + "\" title=\"" + this.GG.name + "\" \/>", this.GG.url, this.GG.target);
		}
		function referCode(){ code_img.src = AjaxUrl.codeImgUrl + (new Date()).getTime(); this.blur(); return false; }
		this.needVericode = function(){ referCode(); code_con.style.display = "block"; code_span.style.display = "block"; code_link.onclick = referCode; }
		function SetShow(a, b, position){ isOver = true; clearTimeout(time); Fun.$position(a, b, 1, 34); b.style.display = "block"; a.style.backgroundPosition = position; }
		function SetHidden(a, b, position){ isOver = false; b.style.display = "none"; a.style.backgroundPosition = position;}
		function SetFocus(a, b){ tempTab.style.backgroundColor = "transparent"; tempCon.style.display = "none"; tempTab = a, tempCon = b; a.style.backgroundColor = "#fff"; b.style.display = "block"; }SetFocus(tempTab, tempCon);
		nameInput.onfocus = function(){ if(this.value == Base.defaultName) this.value = ""; }
		nameInput.onblur = function(){ if(this.value.length < 1) this.value = Base.defaultName; }
		textarea.value = initStr;
		textarea.onfocus = function(){ if(this.value == initStr) this.value = ""; }
		textarea.onblur = function(){ if(this.value.length < 1 && !isOver){ initStr = Fun.$getRandom(CommentInfos, 1)[0]; this.value = initStr; }}
		Fun.$action(btns, function(){ SetShow(this, (this == btns[0]) ? floats[0] : floats[1], (this == btns[0]) ? "left -68px" : "left -136px"); }, function(){ SetHidden(this, (this == btns[0]) ? floats[0] : floats[1], (this == btns[0]) ? "left -34px" : "left -102px"); });
		Fun.$action(floats, function(){ SetShow((this == floats[0]) ? btns[0] : btns[1], this, (this == floats[0]) ? "left -68px" : "left -136px"); }, function(){ SetHidden((this == floats[0]) ? btns[0] : btns[1], this, (this == floats[0]) ? "left -34px" : "left -102px"); });
		Fun.$action(Fun.$tag("a", Fun.$id(this.Base.code + "txt_list")), null, null, function(){ textarea.value += this.innerHTML; floats[0].style.display = "none"; return false; });
		Fun.$action(faceTabs, function(){ SetFocus(this, faceCons[parseInt(this.id)]); });
		Fun.$action(Fun.$tag("img", Fun.$id(this.Base.code + "face")), null, null, function(){ textarea.value += "[f=" + this.className + "]"; });
		Fun.$action([Fun.$id(this.Base.code + "submitBtn")], null, null, function(){
			if(textarea.value.length < 1){ alert("请输入您的评论内容！"); textarea.focus(); return false; }
			if(nameInput.value.length < 1){ alert("请输入您的昵称！"); nameInput.focus(); return false; }
			form.submit();
			return false;
		});
		Fun.$ajax(Login.ajaxUrl, null, function(){ if(Fun.$ie && this.readyState != "loaded"){ return; }else{
			try{
				nameInput.value = userInfo.name;
				nameInfo.innerHTML = Fun.$link(Login.logoutTitle, Login.logoutUrl);
			}catch(e){ return; }
		} }, "utf-8");
		Fun.$ajax(AjaxUrl.codeUrl, null, function(){}, "gb2312");
	}
	this.List = function(url){
		document.writeln(this.listInfo);
		this.AjaxUrl.listUrl = this.AjaxUrl.listUrl.replace(/_%urlpath%_/g, url);
		this.AjaxUrl.diggUrl = this.AjaxUrl.diggUrl.replace(/_%urlpath%_/g, url);
		this.AjaxUrl.buryUrl = this.AjaxUrl.buryUrl.replace(/_%urlpath%_/g, url);
		var numInfo = Fun.$id(this.Base.code + "cnum"), radios = document.getElementsByName(this.Base.code + "listType"), list = Fun.$id(this.Base.code + "listCon"), Model = this.Model, Base = this.Base, Ajax = this.AjaxUrl;
		Fun.$action(radios, null, null, function(){ Insert(Model, Ajax, Base, list, numInfo, url); });
		Insert(this.Model, this.AjaxUrl, this.Base, list, numInfo, url);
	}
	this.ReloadCommentInfo = function(){ Insert(this.Model, this.AjaxUrl, this.Base, Fun.$id(this.Base.code + "listCon"), Fun.$id(this.Base.code + "cnum"), this.AjaxUrl.commentUrl); Fun.$id(this.Base.code + "textarea").value = ""; }
	return this;
}();
