function checkfm(form){
var uploadfile = form.uploadfile.value;
if(uploadfile!=""){
var types = ["jpg","gif","bmp","png","exe","doc","pdf","txt","xls","ppt","swf"];
var ext = uploadfile.substring(uploadfile.length-3).toLowerCase();
var sing = false;
for(var i=0; i<types.length;i++){
if (ext==types[i]){
sing = true;
}
}
if(!sing){
alert("只允许上传图片/flash动画/word文件/exe文件/pdf文件/TxT文件/xls文件/ppt文件");
return false;
}
}
return true;
}