//ID函数定义
var $=function(id) {
	return document.getElementById(id);
}

//分站跳转
function gotoCity(){
	var CityId = document.getElementById("CityId").value;
	var url = window.location.href;
	window.location.href="index.asp?CityId="+CityId;	
}

//查询
function searchList(){
	var Cid = document.getElementById("Class").value;
	var KeyWord = document.getElementById("KeyWord").value;
	if(KeyWord.length==0){
		alert("请输入关键字。");
		return;
	}
	if(Cid==8){
		window.location.href="list_pic.asp?action=KeyWord&KeyWord="+KeyWord+"&Cid="+Cid;
	}
	else{
		window.location.href="list_txt.asp?action=KeyWord&KeyWord="+KeyWord+"&Cid="+Cid;		
	}
}

//检查问卷提交
function checkSurvey(){
	var Qnum = $("Qnum").value;
	for(var i=1;i<=Qnum;i++){
		var isSelect = true;
		var Obj = document.getElementsByName("AStr"+i);
		var QType = $("QType"+i).value;
		if(QType==0){
			for(var n=0;n<Obj.length;n++){
				if(Obj[n].checked){
					isSelect = false;
				}
			}
		}
		else{
			for(var n=0;n<Obj.length;n++){
				if(Obj[n].checked){
					isSelect = false;
				}
			}				
		}
		if(isSelect){
			alert("请检查问题是否全部选择。");
			return false;
		}
	}
	if(isSelect){
		return true;
	}
}
