function checkNull(o,s) {
		if(o.value == "") {
			alert("“" + s + "”" + "不能为空!");
			o.focus();
			return true;
		}else{
			return false;
		}
	}

function checkSelected(o,num,s) {
	//alert(num);
	var i = 0;
	for(var j = 0; j < o.length; j++)
		if(o[j].checked)
			i++;
	if(i <= num && i > 0) {
		return false;
	}else{
		var str = "";
		str = "请选择“" + s + "”";
		if(num > 1)
			str = str + "（最多" + num + "项）";
		alert(str);
		o[0].focus();
		return true;
	}
}

function checkInput(o,s,oOther,maxLength){
	if(o.value != undefined){
		if(checkNull(o,s)) return true;
	}else if(o.length > 0){
		if(o[0].type == "radio"){
			if(checkSelected(o,1,s)) return true;
		}else if(o[0].type == "checkbox"){
			if(isNaN(maxLength)){
				if(checkSelected(o,o.length,s)) return true;
			}else{
				if(checkSelected(o,maxLength,s)) return true;
			}
		}
		if(oOther != null && oOther.value != undefined)
			if(o[o.length-1].checked)
				if(checkNull(oOther,s+"其他")) return true;
	}else{
		alert("Parameter error:input tag not found");
		return true;
	}
	return false;
}
