function chk()
{
	var c=document.getElementsByTagName("input");
	var typ=document.getElementById("zw:typeId").value;
	if(typ==1)
	
	{
	for (var i=0; i < c.length;i++)
	{
		
		if(c[i].type!="radio" && (c[i].id).indexOf("a")==-1){
				
				if(c[i].value==null || c[i].value=="")
				{
				
				 //alert("不能有空值！"+c[i].id+c[i].type);
				 alert("不能有空值！");
				 return false;
				}
			}
	}
	alert("提交成功！");
	return true;
	}
	
	if(typ==2){
	
	for (var i=0; i < c.length;i++)
	{
		// alert(c[i].type);
		if(c[i].type!="radio" && (c[i].id).indexOf("b")==-1){
				
				if(c[i].value==null || c[i].value=="")
				{
				// alert("不能有空值！"+c[i].id+c[i].type);
				 alert("不能有空值！");
				 return false;
				}
			}
	}
	alert("提交成功！");
	return true;
	}
	
}
function chkNum(v)
{
	if(isNaN(v.value))
	{
		 alert("号码必须是数字！");
		  v.value="";
		  v.focus();
		 return false;
	}
}
function chkemail(obj){
    var email=obj.value;
    var pattern=/^([a-zA-Z0-9])+@([a-zA-Z0-9])+\.([a-zA-Z0-9])+/;
    flag=pattern.test(email);
    if(flag) {
          
        return true;
    } else{
         alert("很抱歉，您所输入的邮箱有误，请确认后填写");
        obj.focus();
        obj.select();
        return false;
    }
} 

//类型切换
function change(t){
				if(t==1)
				{
					
					document.getElementById("zww1").style.display="block";
					document.getElementById("zww2").style.display="none";
					document.getElementById("zw:typeId").value=t;
				}
				if(t==2)
				{
					document.getElementById("zww2").style.display="block";
					document.getElementById("zww1").style.display="none";
					document.getElementById("zw:typeId").value=t;
				}
			}