var fv = document.upload.proImg.value
if (fv.substring(fv.length-4, fv.length) != ".jpg" && fv.substring(fv.length-4, fv.length) !=".gif" && fv.substring(fv.length-4, fv.length) != ".JPG" && fv.substring(fv.length-4, fv.length) !=".GIF")
{
alert("只能选择.jpg或者.gif格式的图片,请重新选择!")
document.getElementById("proImg").outerHTML="<input name=proImg type=file class=textfield>";
document.upload.proImg.focus()
                            document.upload.proImg.click()
return false
}