function checkPhoto(fnUpload)
{
var filename = fnUpload.value;
alert(filename);
var mime = filename.toLowerCase().substr(filename.lastIndexOf("."));
if(mime!=".jpg")
{
alert("Please select jpg format for photo upload");
fnUpload.outerHTML=fnUpload.outerHTML;
}
}