function checkPhoto(){
var type="";
if(document.getElementById("newphoto").value!=''){
type=document.getElementById("newphoto").value.match(/^(.*)(\.)(.{1,8})$/)[3];
type=type.toUpperCase();
}
if(type!="JPEG" && type!="PNG" && type!="JPG" && type!="GIF"){
alert("上传图片类型错误");
return false;
}
}