function cjcx(form)
{
//	alert("this is test");	
	var zkzh=getValue(form,"zkzh");	//准考证号
	var	kaocbm=getValue(form,"kaocbm");	//考试编码
	if(zkzh=="")
	{
		alert("请输入准考证号!")
		return false;

	}
	if(kaocbm=="")
	{
		alert("请输入考次编码！")
		return false;
	}
	return true;
}
function zkzs(form)
{
 	var byzh=getValue(form,"byzh");	//毕业证号
	var xsxm=getValue(form,"xsxm");	//学生姓名
	var sfzh=getValue(form,"sfzh");	//毕业专业
	if(byzh=="")
	{
		alert("请输入毕业证号！");
		return false;
	}
	if(xsxm=="")
	{

		alert("请输入学生姓名！");
		return false;
	}else
	{
		form.elements["xsxm"].value = praseName(xsxm);
		if(xsxm.length <= 1 || xsxm.length >= 6)
		{
			return window.confirm('确认姓名无误后继续查询?');
		}
	}
	if(sfzh=="")
	{
		alert("请输入身份证号！");
		return false;
	}
	return true;
}
function praseName(str)
{
	//将半角的空格转换为全角的空格
	var nbsp = "  ";
	if(str.length==3)
	{
		str=str.replace(" ", nbsp);
	}
	index = str.search("__");
	//李__, __李
	if(index != -1 && str.length == 3)
	{
		if(index == 0)
			str = str.substr(0,2) + nbsp + str.substr(2);
		else
			str = str.substr(0,1) + nbsp + str.substr(1);
	}
	if(str.length == 2)
	{
		str = str.substr(0,1) + nbsp + str.substr(1,1);
	}

	return str;
}
function zzzs(form)
{
 	return zkzs(form);
}
function zkkb(form)
{
	var kc=getValue(form,"kc");
	var zybm=getValue(form,"zybm");
	if(kc=="")
	{
		alert("请输入考次！");
		return false;
	}
	if(zybm=="")
	{
		alert("请输入专业编码！");
		return false;
	}
	return true;
}
function zwh(form)
{
	//var kc=getValue(form,"kc");
	var zkzh=getValue(form,"zkzh");
////	if(kc=="")
	//{
//		alert("请输入考次");
	//	return false;
	//}
	if(zkzh=="")
	{
		alert("请输入准考证号");
		return false;
	}
	return true;
}
function zkzy(form)
{
	//var zymc=getValue(form,"zymc");
	//var zybm=getValue(form,"zybm");
	//if(zymc=="" && zybm=="")
	//{
	//	alert("请输入专业类型或专业编码！");
	//	return false;
	//}
	//if(zybm == "")
//	{
	//	form.elements["zymc"].value="%"+zymc+"%"
	//	form.elements["type"].value="zkzyls"
	//}else
	//{
	//	form.elements["type"].value="zkzy"
	//}
//	return true;
    var zkzh = getValue(form,"zkzh");
	if(zkzh=="")
	{
		alert("请输入准考证号！");
		return false;
	}
	return true;
}
function cfcx(form)
{
	//var kc=getValue(form,"kc");
	var	zkzh=getValue(form,"zkzh");
	//var	kcbm=getValue(form,"kcbm");
	//if(kc=="")
	//{
//		alert("请输入考试！");
//		return false;
//	}
	if(zkzh=="")
	{
		alert("请输入准考证号！");
		return false;
	}
	return true;
}
function mkbl(form)
{
	return cfcx(form);
}
function grkj(form)
{
	var zkzh=getValue(form,"zkzh");
	var zybm=getValue(form,"zybm");
	if(zkzh=="")
	{
		alert("请输入准考证号！");
		return false;
	}
	if(zybm!="")
	{
		form.elements["type"].value="grkjall"
	}
	return true;
}
function validate(form)
{
	var type=getValue(form,"type");
	type=type+"(form)";
//	alert(type);
	return eval(type);
}
function getValue(form,field)
{
	var re;
	try{
	re=form.elements[field].value;
	}catch(e)
	{
		alert("get "+field+" with the form error"+e);
	}
	return re;
}
function isNum(input)
{
	var partten= /(^\d+)/;
	if(input.value=="")return;
	var num1 = partten.exec(input.value);
	if(num1 == null)
	{
		alert("只能输入数字!");
		input.value="";
		return;
	}
	if(input.value != num1[0])
	{
		alert("只能输入数字!");
		input.value=num1[0];
	}
}
