<!--#include file="../../p_inc/Include_func.asp"-->
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<script>
function SignCheck(cbox){ 
	var obj = document.getElementsByTagName("input"); 
	for (var i=0; i < obj.length; i++) { 
		if(obj[i].type == "radio" && obj[i].className=="s2") { 
			obj[i].checked = false; 
		} 
		cbox.checked = true; 	
	} 
} 
</script>
<%
response.contenttype="text/html;charset=gb2312"
str2=N_Fso.ReadAllTextFile(Add_Root_Dir("/Ztool/search/self.txt"))
str3=str2
str=GetContent(str3,"<备选引擎>","</备选引擎>",0)
str3=str2
google_txt=GetContent(str3,"<google>","</google>",0)
qtCms_search_xiala_display=GetContent(str3,"<是否显示下拉>","</是否显示下拉>",0)
qtCms_search_hand_d=GetContent(str3,"<是否手写>","</是否手写>",0)

t3=Trim(request("t3")) '

IF t3="ok" Then
	oqtCms_search_xiala_display=Bint(Request("qtCms_search_xiala_display"))
	oqtCms_search_hand_d=Bint(Request("qtCms_search_hand_d"))
	kStr=""
	hStr=""
	other_str1=""
	other_str2=""
	hStr=hStr&"//技术支持 By qingtian  QQ:314048526  官方：www.qingtian.net"&vbcrlf
	hStr=hStr&"var qtCms_search_default_s=""0"""&vbcrlf
	hStr=hStr&"var qtCms_search_bar=["	
	os0=Request("s0") '名字集合
	os2=Request("s2") '默认显示
	os0_a=Split(os0,",")
	Dim MyArray(20)
	Dim MyArray2(20)	
	For ii=0 To UBound(os0_a)
		os0_f1=Trim(os0_a(ii))
		os1_f1=Trim(Request("s1_"&ii))
		os2_f1=Trim(Request("s2_"&ii))
		os3_f1=Trim(Request("s3_"&ii))
		os4_f1=Trim(Request("s4_"&ii))
		os5_f1=Trim(Request("s5_"&ii))
		IF os2_f1="" Then os2_f1="0"
		IF Clng(os4_f1)=UBound(os0_a) Then	
			p1=os0_f1&","&os1_f1&","&os2_f1&","&os3_f1&","&os4_f1
			p2="["""&os0_f1&""","""&os1_f1&""","""&os2_f1&""","""&os3_f1&"""]"
			'kStr=kStr&p1
			'hStr=hStr&p2
		Else
			p1=os0_f1&","&os1_f1&","&os2_f1&","&os3_f1&","&os4_f1&"{$}"
			p2="["""&os0_f1&""","""&os1_f1&""","""&os2_f1&""","""&os3_f1&"""],"			
			'kStr=kStr&p1
			'hStr=hStr&p2
		End IF
		MyArray(os4_f1)=p1
		MyArray2(os4_f1)=p2
		IF os5_f1="1" And os3_f1="1" Then 'google
			other_str1=other_str1&"<google>1</google>"&vbcrlf
			other_str2=other_str2&"var qtCms_search_btn_google=""google||"&G_moban&""" //其他站点需要集成搜索引擎技术支持请联系晴天:QQ314048526"&vbcrlf
		End IF		
	Next
	For pi=0 To 20
		kStr=kStr&MyArray(pi)
		hStr=hStr&MyArray2(pi)
	Next
	hStr=hStr&"]"&vbcrlf
	hStr=hStr&"var qtCms_search_xiala_display="""&oqtCms_search_xiala_display&""""&vbcrlf
	hStr=hStr&"var qtCms_search_hand_d="""&oqtCms_search_hand_d&""""&vbcrlf
	
	kStr="<备选引擎>"&kStr&"</备选引擎>"&vbcrlf
	
	kStr=kStr&other_str1
	hStr=hStr&other_str2
	
	kStr=kStr&"<是否显示下拉>"&oqtCms_search_xiala_display&"</是否显示下拉>"&vbcrlf
	kStr=kStr&"<是否手写>"&oqtCms_search_hand_d&"</是否手写>"&vbcrlf
	
	N_Fso.CreateFolderFile Add_Root_Dir("/Ztool/search/self.txt"),kStr
	N_Fso.CreateFolderFile Add_Root_Dir("/template/"&G_moban&"/js/qTcms_const.js"),hStr
'var qtCms_search_bar=[
'					  ["百度","1","0"],
'					  ["谷歌","1","0"],
'					  ["奇虎","1","0"],
'					  ["购物","1","0"],
'					  ["搜狗","1","0"],
'					  ["站内","1","0"]
'					  ]	
	
	Response.Redirect "2.asp"
End IF

IF t3<>"ok"  Then
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0"  align=center class="tableBorder">
<form action="?t3=ok" method="post" name="form1">
	<tr> 
		<th class="tableHeaderText" height=25 colspan="2">前台搜索引擎自定义功能</th>
	</tr>	
	<tr> 
		<td height=10 colspan="2"></td>
	</tr>	
	<TR>
		<TD CLASS='InnerHead' STYLE='padding-left:20px;text-align:left'>&nbsp;自定义选择</TD>
		<TD CLASS='InnerMain'><TABLE width="700" border="0" cellpadding="1" cellspacing="1" bgcolor="#cccccc">
		<%
			pStr=""
			ki=-1
			str_a=Split(str,"{$}")
			For ii=0 To Ubound(str_a)
				str_1=Trim(str_a(ii))
				IF str_1<>"" Then
					str_1_a=Split(str_1,",")
					str_2_1=str_1_a(0) '名字
					str_2_2=str_1_a(1) '是否显示(1显示0隐藏)
					str_2_3=str_1_a(2) '默认显示(数字为1的那个)
					str_2_4=str_1_a(3) '搜索引擎的索引
					str_2_5=str_1_a(4) '排序
					
					IF Instr(str_2_1,"||")>0 Then
						str_2_1_a=Split(str_2_1,"||")
						str_2_1_1=str_2_1_a(0) '原来名字
						str_2_1_2=Trim(str_2_1_a(1)) '自定义名字
						
					Else
						str_2_1_1=str_2_1
						str_2_1_2=str_2_1
						
					End IF
					
					str_2_1_1=Replace(str_2_1_1,"""","") '原来名字
					str_2_1_2=Replace(str_2_1_2,"""","") '自定义名字				
					str_2_2=Replace(str_2_2,"""","") '是否显示(1显示0隐藏)
					str_2_3=Replace(str_2_3,"""","") '默认显示(数字为1的那个)
					str_2_4=Replace(str_2_4,"""","") '搜索引擎的索引
					str_2_5=Replace(str_2_5,"""","") '排序
					
					IF str_2_2="1" Then
						oBg=" bgcolor=""#cee7ff"""
						och2=" checked"
						och3=""
					Else
						oBg=" bgcolor=""#FFFFFF"""
						och2=""
						och3=" checked"
					End IF
					
					IF str_2_3="1" Then
						och=" checked"
					Else
						och=""
					End IF
					
					pStr=pStr&"<TR"&oBg&">"&vbcrlf
					pStr=pStr&"<TD>"&str_2_1_1&"</TD>"&vbcrlf
					pStr=pStr&"<TD>自定义名字 <input type=""text"" name=""s0"" size=""8"" value="""&str_2_1_2&""" /></TD>"&vbcrlf
					pStr=pStr&"<TD><input type=""radio"" name=""s1_"&ii&""""&och2&" value=""1"" /> 显示 <input type=""radio"" name=""s1_"&ii&""""&och3&" value=""0"" /> 隐藏</TD>"&vbcrlf
					pStr=pStr&"<TD><input type=""radio"" name=""s2_"&ii&""""&och&" value=""1""  class=""s2"" onclick=SignCheck(this) /> 默认显示</TD>"&vbcrlf
					pStr=pStr&"<TD><input type=""hidden"" name=""s3_"&ii&""" size=""4"" value="""&str_2_4&""" />编号 <input type=""text"" name=""s4_"&ii&""" size=""4"" value="""&str_2_5&""" /></TD>"&vbcrlf
					IF str_2_4="1" Then 'google
						IF google_txt="1" THen
							google_och=" checked"
						Else
							google_och=""
						End IF
						
						pStr=pStr&"<TD><input type=""checkbox"" name=""s5_"&ii&""""&google_och&" value=""1"" />使用原始搜索代码</TD>"&vbcrlf
					Else
						pStr=pStr&"<TD><input type=""checkbox"" name=""s5_"&ii&""""&och2&" value=""0"" style=""display:none"" /></TD>"&vbcrlf
					End IF
					pStr=pStr&"</TR>"&vbcrlf
					ki=ki+1
				End IF
			Next
			Response.Write pStr
		%>
				
			</TABLE></TD>
	</TR>	
	<tr>
		<td></td>
		<td class=forumRowHighlight>		
		<input type="checkbox" name="qtCms_search_xiala_display" value="1" <%IF qtCms_search_xiala_display="1" Then Response.Write "checked"%> />搜索时下拉框是否智能提示
		<input type="checkbox" name="qtCms_search_hand_d" value="1" <%IF qtCms_search_hand_d="1" Then Response.Write "checked"%> />是否显示手写功能(部分模板可能不兼容)
		</td>
	</tr>	
	<tr>
		<td></td>
		<td class=forumRowHighlight>		
		<input type="submit" value="更新保存" id=submit name=submit> 
		<font color="#FF0000">特别注意：编号最大只能是<%=ki%>，一定要连续，不能重复，编号越小显示越前面</font>
		</td>
	</tr>		
</form>	
</table>
<%
End IF
%>