﻿function showMsg(obj,message)
{
    $(obj+"_msg").innerHTML=message;
    $(obj+"_msg").style.color="red";
    $(obj+"_msg").style.display="block";
}


function CheckImage()
{
    if($("uploadImage").value.IsImg())
    {
        showMsg("uploadImage","");
    }
    else
    {
        clearFileInput($("uploadImage"));
        $("uploadImage").className="txtFile";
        showMsg("uploadImage","Picture format error");        
    }
}

function submitUpload()
{
    if($("uploadImage").value.IsNullOrEmpty())
    {
        showMsg("uploadImage","Picture can not be empty!");
    }
    else
    {
        $("form1").submit();
    }
}

function Msg(obj, value, IsDisplay) {
    obj.innerHTML = value;
    if (IsDisplay)
        obj.style.display = "block";
    else
        obj.style.display = "none";
}

function HiddenMsg() {
    Msg($("txtLoginMsg"), "", false);
}