<%
Sub GenJs(tbname)
	dim rs,js,fname
	set rs=conn.execute("select id,title from "&tbname)
	while not rs.eof
		js=js&"document.write('<option value="""&rs(0)&""">"&rs(1)&"</option>');"
		rs.movenext
	wend
	rs.close
	set rs=nothing
	'create js file
	fname=tbname
	fname=replace(fname,"t_","")
	fname=replace(fname,"t_2","")
	Set fs=Server.CreateObject("Scripting.FileSystemObject")	
	Set file_w = fs.CreateTextFile(server.mappath("/js/"&fname&".js"),true)	
	file_w.WriteLine(js)
	file_w.close
	set file_w=nothing
	set fs=nothing
end Sub
%>