function iCeb_submit(fn,strName)
{

	if(strName == "ask")
 {

		if(fn.key.value == "" || fn.key.value == "请输入查询词" || fn.key.value == "请输入问题标题") {

			fn.key.value = "请输入问题标题";

			fn.key.focus();

			return false;

		}

		fn.action = "Ask.asp";

		fn.title.value = fn.key.value;

		fn.submit();

		return false;

	} else if(strName == "iSCeb") {

		if(fn.key.value == "" || fn.key.value == "请输入查询词" || fn.key.value == "请输入问题标题")
 {

			fn.key.value = "请输入查询词";

			fn.key.focus();

			return false;

		}

		fn.action = "Search.asp";

		fn.submit();

		return false;

	}
 else {

		return false;

	}

}


function ckwords(obj)
{
	if(obj.value == "请输入查询词" || obj.value == "请输入问题标题")
 {
		obj.value = "";

		obj.focus();

		return false;

	}

}
function GetClsLoad(cId,Num) {
	if (window.XMLHttpRequest) {
		oBj = new XMLHttpRequest();
	} else if(window.ActiveXObject) {
		oBj = new ActiveXObject("Microsoft.XMLHTTP");
	}
	oBj.onreadystatechange = function(){
		if(oBj.readyState == 4){
			var StrShowCls = unescape(oBj.responseText);
			var StrShowClsArr = StrShowCls.split("|Ceb|");
			var StrShowClsIdArr = StrShowClsArr[0].split("|");
			var StrShowClsNameArr = StrShowClsArr[1].split("|");
			if (Num==1) {
				var sel = document.all.ShowiCls;
			} else if (Num==2) {
				document.all.ShowsCls.options.length = 0;
				document.all.ShowuCls.options.length = 0;
				var sel = document.all.ShoweCls;
			}
			if (Num!=3) {
				sel.options.length = 0; 
				for(var i = 0 ;i<StrShowClsIdArr.length;i++) {
					sel.options[sel.options.length] = new Option(StrShowClsNameArr[i],StrShowClsIdArr[i]);
				}
			}
		}
	}
	oBj.open("GET","XmlData.asp?Cls=" + cId,true);
	oBj.send(null);
}
function showFile()
{
	if(howgetFile['style']['display'] == "none")
	{
		howgetFile.style.display = 'block';
	} else {
		howgetFile.style.display = 'none';
	}
	return false;
}
function AskLogin(Num,uName,uPrice,uOther) {
	var AskLogin = '';
	if (Num==1) {
		if (uName=="guest") {
			AskLogin = AskLogin + '<fieldset style="border:1px dashed #d1e5b7;width=100%;">';
			AskLogin = AskLogin + '<legend class="f14 c0" style="background-color:#FFFFFF;"><img src="images/login_hf2.gif" border="0" ';
			AskLogin = AskLogin + 'align="absmiddle" hspace="5">会员请直接登录</legend><table border="0" class="f12" align="center">';
			AskLogin = AskLogin + '<tr><td height="5"></td></tr><tr><td align="right" nowrap><span class="f13">会员名：</span></td><td';
			AskLogin = AskLogin + '><input type="text" size="25" style="width:120px; height:22px;" maxlength="50" name="uName"></td><td ';
			AskLogin = AskLogin + ' align="right" nowrap><span class="f13">密码：</span></td><td width="90"><input type="password" size="25"';
			AskLogin = AskLogin + ' style="width:120px; height:22px;" maxlength="50" name="uPass"></td><td>&nbsp;<a href="Reg.asp" target="_blank"><fo';
			AskLogin = AskLogin + 'nt color="#668342">快速注册</font></a>　<a href="GetPass.asp" target="_blank"><font color="#668342">忘记密码</font>';
			AskLogin = AskLogin + '</a></td></tr><tr><td height="5"></td></tr></table></fieldset>';
		} else if (uName=="cebsys"){
			var OtherArr  = uOther.split(",");
			if (OtherArr[0]=="0"){
				AskLogin = AskLogin + '<table border="0" width="100%" cellpadding="0" cellspacing="1" style="margin-bottom:7px;" bgcolor="E5E5E5"><form name="login" ';
				AskLogin = AskLogin + 'method="post" action="Login.asp" onsubmit="return checkLogin();"><tr><td height="28"';
				AskLogin = AskLogin + ' align="center" style="padding-top:5px;"><b class="f12">欢迎登录</b></td></tr>';
				AskLogin = AskLogin + '<tr><td align="center" bgcolor="#FFFFFF"><table border="0" width="100%" cellpadding="0" ';
				AskLogin = AskLogin + 'cellspacing="0"><tr><td height="5"></td></tr><tr>';
				AskLogin = AskLogin + '<td width="55" height="18" align="right">会员名：</td><td width="104" align="center" background';
				AskLogin = AskLogin + '="images/input_login.gif"><input type="text" name="U_LoginName" maxlength="20" size="15" style="wi';
				AskLogin = AskLogin + 'dth:100px; height:15px; border:0px;" value="会员名" onclick="if(this.value==\'会员名\') this.value=\'\'">';
				AskLogin = AskLogin + '</td><td>&nbsp;</td></tr><tr><td height="8"></td></tr><tr><td height="18" align="right">密　码：</td><td ';
				AskLogin = AskLogin + 'align="center" background="images/input_login.gif"><input type="password" name="U_LoginPass" maxlength="16" ';
				AskLogin = AskLogin + 'size="15" style=" width:100px; height:15px; border:0px;"></td><td>&nbsp;</td></tr><tr><td height="5"></td>';
				AskLogin = AskLogin + '</tr><tr><td height="5"></td></tr><tr><td>&nbsp;</td><td colspan="2"><TABLE><TR><TD><input type=image src="';
				AskLogin = AskLogin + 'images/login_btn_green.gif" border="0"></TD><TD><span style="vertical-align:buttom"><a href="GetPass.asp" ';
				AskLogin = AskLogin + 'target="_blank" class="a05">忘记密码</a></span></TD></TR></TABLE> </td></tr><tr><td height="4"></td></tr><tr>';
				AskLogin = AskLogin + '<td height="1" colspan="9" background="images/line_g.gif"><img src="images/line_g.gif" border="0"></td></tr>';
				AskLogin = AskLogin + '<tr><td colspan="9" height="45" class="lh15"><span class="f10 c9">·</span>会员请直接登录<br><span class=';
				AskLogin = AskLogin + '"f10 c9">·</span><a href="Reg.asp" target="_blank">快速注册</a>，<b style="color:#f90;">获赠20积分</b></td>';
				AskLogin = AskLogin + '</tr><input type=hidden name=GetUrl value="' + OtherArr[1] + '"></form></table></td></tr>';
			}else{
				if (OtherArr[2]=="0") {
					if (OtherArr[3]==1) {UserFace = "Images/ryzsr_nan1.gif";} else {UserFace = "Images/ryzsr_nv1.gif";}
				} else {
					UserFace = OtherArr[2];
				}
				AskLogin = AskLogin + '<table width="177" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="E5E5E5"><tr><td height="2"> </td>';
				AskLogin = AskLogin + '</tr><tr></tr><tr><td height="22" align="center" class="unnamed2"><strong>欢迎登陆问答</strong></td></tr>';
				AskLogin = AskLogin + '<tr><td bgcolor="#FFFFFF"><table width="88%" height="136" border="0" align="center" cellpadding="0" cellspacing="0">';
				AskLogin = AskLogin + '<tr><td height="10"> </td></tr><tr><td>您好，<font color="336600">' + OtherArr[0] + '</font></td></tr><tr><td>级别：<font color="336600">'+ OtherArr[1] + '</font></td></tr><tr><td>得分：<font color="336600">' + uPrice + '</font></td></tr>';
				AskLogin = AskLogin + '<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="999999"><tr><td height="26" align="center" bgcolor="FFFFE1"><a href="#" onClick="javascript:open(\'Message.asp\',\'\',\'width=500,height=380\');return false" class="c3">我的消息<sc'+'ript>iCebMessage("'+OtherArr[4]+'");</sc'+'ript></a></td>';
				AskLogin = AskLogin + '</tr></table></td></tr><tr><td><img src="images/dotline.jpg" width="160" height="4"></td></tr><tr>';
				AskLogin = AskLogin + '<td align="center"><a href="MyCenter.asp?Ask=isc" class="unnamed2"><font color="00007F">我的提问</font></a>&nbsp;&nbsp;&nbsp;<a href="MyCenter.asp?Answer=isc" class="unnamed2"><font color="00007F">我的回答</font></a></td></tr></table></td></tr>';
			}
				AskLogin = AskLogin + '</table>';
		}
	} else if (Num==2) {
		if (uName!="guest") {
			AskLogin = AskLogin + '<u>' + uName + '</u> 可用分 <b><u>' + uPrice + '</u></b>';
		}
	}
	document.write(AskLogin);
}
function checkLogin() {
	if (document.all.U_LoginName.value == "" || document.all.U_LoginName.value == "会员名") {
		alert('会员名不能为空，请输入会员名');
		document.all.U_LoginName.value = ""
		document.all.U_LoginName.focus();
		return false;
	}
	if (document.all.U_LoginPass.value == "") {
		alert('密码不能为空，请输入密码');
		document.all.U_LoginPass.focus();
		return false;
	}
}
function iCebMessage(Num) {
	iCebMessage = '[<font color="#ff6600">' + Num + '</font>]';
	if (Num!=="0") {iCebMessage = iCebMessage + '<img border=0 src="images/email.gif" alt="新消息">';}
	document.write(iCebMessage);
}
function iCebRank(Num) {
	if (Num=="") {
		iCebRank = '<font color="#999999">尚未进入排名</font>';
	} else {
		iCebRank = '<font color="#999999">第 <b>' + Num + '</b> 名</font>';
	}
	document.write(iCebRank);
}
function iCebUserFace(FileNum,Sex) {
	if (FileNum=="0") {
		if (Sex==1) {iCebUserFace = "Images/ryzsr_nan1.gif";} else {iCebUserFace = "Images/ryzsr_nv1.gif";}
	} else {
		iCebUserFace = FileNum;
	}
	document.write('<a href="MyCenter.asp?MyInfo=isc" title="点击更新我的照片"><img src="' + iCebUserFace + '" border="0" width="107" height="127"></a>');
}
function iCeb_Show_Hidden(WdgId,Str) {
	if (Str == "1") { Sdl = "block" } else { Sdl = "none" }
	window.document.getElementById(WdgId).style.display = Sdl;
}
function ShowPage(TotalPage,PageIndex,url) {
	if (PageIndex<6) {
		PageLong=11-PageIndex;
	} else if (TotalPage-PageIndex<6) {
		PageLong=10-(TotalPage-PageIndex)
	} else {
		PageLong=5;
	}
	for (var i=1; i <= TotalPage; i++) {
		if (i < PageIndex+PageLong && i > PageIndex-PageLong) {
			if (PageIndex==i) {
				if (TotalPage!=1) {
					document.write("<font color=#ff0000 style='font-size: 16px'>"+ i +"</font>　");
				}
			} else {
				document.write("<a href='?"+url+"&Page="+i+"' class='f14'>["+ i +"]</a>　");
			}
		}
	}
}
function AdminCls(ClsId) {
	if (window.XMLHttpRequest) {
		oBj = new XMLHttpRequest();
	} else if(window.ActiveXObject) {
		oBj = new ActiveXObject("Microsoft.XMLHTTP");
	}
	oBj.onreadystatechange = function(){
		if(oBj.readyState == 4){
			var xmldata = oBj.responseText;
			if (xmldata==1) {
				alert('请先登入');
			} else if (xmldata==2) {
				alert('您的级别不够，申请版主需大师级以上才可以，多多努力哦');
			} else if (xmldata==3) {
				alert('您的申请已成功提交，我们将在48小时内处理，处理结果将以站内短信通知');
			}
		}
	}
	oBj.open("GET","ClsList.asp?AdminCid=" + ClsId,true);
	oBj.send(null);
}
function showDiv()
{

	ktdq.style.display = "block";

	st1 = window.setTimeout("hideDiv()",3000);

}


function hideDiv()
{

	ktdq.style.display = "none";

	window.clearTimeout(st1);

}
function CebErrors() {
	return true;
}
window.onerror = CebErrors;