document.writeln("<SCRIPT language=JavaScript>");
document.writeln("var subcat = new Array();");
document.writeln("var subcat3 = new Array();");
document.writeln("var subcat4 = new Array();");
document.writeln("\/\/二级城市列表");
document.writeln("<% ");
document.writeln("sql=\"select * from sorts order by sortsorder \" ");
document.writeln("set subboard = conn.execute(sql) ");
document.writeln("i=0");
document.writeln("while not subboard.Eof ");
document.writeln("response.Write(\"subcat[\"&i&\"] = new Array(\'\"&subboard(\"sorts\")&\"\',\'\"&subboard(\"first\")&\"\',\'\"&subboard(\"categoryid\")&\"\',\'\"&subboard(\"sortsid\")&\"\');\" & vblf)");
document.writeln("i=i+1");
document.writeln("subboard.MoveNext ");
document.writeln("wend ");
document.writeln("%> ");
document.writeln("function changelocation(locationid)");
document.writeln("{");
document.writeln("document.myform.stype.length = 0; ");
document.writeln("	var locationid=locationid;");
document.writeln("	var i,long1;");
document.writeln("	var j = 0;");
document.writeln("	\/\/计算出最长的字符数");
document.writeln("	for (i=0;i < subcat.length; i++){");
document.writeln("		");
document.writeln("		if (subcat[i][2] == locationid){");
document.writeln("			if (j == 0){");
document.writeln("				long1 = subcat[i][1].length;");
document.writeln("				j = j+1;");
document.writeln("			}else{");
document.writeln("				if (long1 < parseInt(subcat[i][1].length))");
document.writeln("				{");
document.writeln("					long1 = subcat[i][1].length;");
document.writeln("				}");
document.writeln("			}");
document.writeln("		} ");
document.writeln("");
document.writeln("	}");
document.writeln("var h = 0;");
document.writeln("for (i=0;i < subcat.length; i++)");
document.writeln("{");
document.writeln("if (subcat[i][2] == locationid)");
document.writeln("{ ");
document.writeln("		var aa = subcat[i][1];");
document.writeln("		for(k=subcat[i][1].length;k<=long1;k++){");
document.writeln("			aa = aa + \" \";");
document.writeln("		}");
document.writeln("		aa = aa + subcat[i][0]; ");
document.writeln("document.myform.stype.options[document.myform.stype.length] = new Option(aa,subcat[i][3]);");
document.writeln("if(h == 0)");
document.writeln("{");
document.writeln("	document.myform.stype.options[0].selected=true;");
document.writeln("}");
document.writeln("h=h+1;");
document.writeln("");
document.writeln("} ");
document.writeln("}");
document.writeln("} ");
document.writeln("\/\/商业区域列表");
document.writeln("<% ");
document.writeln("sql3=\"select * from sorts3 order by sorts3order\" ");
document.writeln("set subboard3 = conn.execute(sql3) ");
document.writeln("i=0");
document.writeln("while not subboard3.Eof ");
document.writeln("response.Write(\"subcat3[\"&i&\"] = new Array(\'\"&subboard3(\"sorts3\")&\"\',\'\"&subboard3(\"sortsid\")&\"\',\'\"&subboard3(\"sorts3id\")&\"\');\" & vblf)");
document.writeln("i=i+1");
document.writeln("subboard3.MoveNext ");
document.writeln("wend ");
document.writeln("%> ");
document.writeln("function shangye(locationid)");
document.writeln("{");
document.writeln("document.myform.quyu.length = 0; ");
document.writeln("var locationid=locationid;");
document.writeln("document.myform.quyu.options[document.myform.quyu.length] = new Option(\"---- 不限 ----\",\"\");");
document.writeln("for (i=0;i < subcat3.length; i++)");
document.writeln("{");
document.writeln("var i;");
document.writeln("if (subcat3[i][1] == locationid)");
document.writeln("{ ");
document.writeln("document.myform.quyu.options[document.myform.quyu.length] = new Option(subcat3[i][0],subcat3[i][2]);");
document.writeln("} ");
document.writeln("}");
document.writeln("document.myform.qytype.value = 1;");
document.writeln("}");
document.writeln("\/\/行政区域列表");
document.writeln("<% ");
document.writeln("sql4=\"select * from sorts4 order by sorts4order\" ");
document.writeln("set subboard4 = conn.execute(sql4) ");
document.writeln("i=0");
document.writeln("while not subboard4.Eof ");
document.writeln("response.Write(\"subcat4[\"&i&\"] = new Array(\'\"&subboard4(\"sorts4\")&\"\',\'\"&subboard4(\"sortsid\")&\"\',\'\"&subboard4(\"sorts4id\")&\"\');\" & vblf)");
document.writeln("i=i+1");
document.writeln("subboard4.MoveNext ");
document.writeln("wend ");
document.writeln("%> ");
document.writeln("function xingzheng(locationid)");
document.writeln("{");
document.writeln("document.myform.quyu.length = 0; ");
document.writeln("var locationid=locationid;");
document.writeln("document.myform.quyu.options[document.myform.quyu.length] = new Option(\"-- 不限 --\",\"\");");
document.writeln("for (i=0;i < subcat4.length; i++)");
document.writeln("{");
document.writeln("var i;");
document.writeln("if (subcat4[i][1] == locationid)");
document.writeln("{ ");
document.writeln("document.myform.quyu.options[document.myform.quyu.length] = new Option(subcat4[i][0],subcat4[i][2]);");
document.writeln("} ");
document.writeln("}");
document.writeln("document.myform.qytype.value = 0;");
document.writeln("}");
document.writeln("<\/Script>")