if (doucment.getElementById("AFIS1"))
{
   alert("ok");
}
else
{
   alert("error");
}