function formEnder(result,option,clear){
  const cssClass = result.Class;
  const msg = result.Msg;
  const status = result.Status;
  const continuePage = result.ContinuePage;
  const id = result.Id
  const newImg = result.Image;
  const imgName = result.ImageName;
  if (status == '1' && continuePage != null) {
    if (continuePage != null) {
      if (option == 'Login') {
        window.location = continuePage;
      } else {
        contentChanger(continuePage, id);
      }
    }
  } else {
    document.getElementById('Result').className = cssClass;
    document.getElementById('Result').innerHTML = msg;
    document.getElementById('Result').style.display = 'block';
  }
  if (status == 1){
    if(clear != 'No_Clear') {
      clearForm();						
    }
    if (newImg != null) {
      if(document.getElementById('List_Image_Area')){
        document.getElementById('List_Image_Area').style.display = 'block';
        if (document.getElementById('List_Image')) {
          document.getElementById('List_Image').src = newImg;
        }else{
          let imgContent = '';
          imgContent += '<img src="'+newImg+'" style="width:200px;" id="List_Image" name="List_Image"/>';              
          imgContent += '<div class="col-md-12">';
          imgContent += '<input type="checkbox" value="1" id="Delete" name="Delete" >';
          imgContent += '<span class="cbox">Check To Delete Image</span>';
          imgContent += '</div>'; 
          document.getElementById('List_Image_Area').innerHTML = imgContent;
        }
      }
    }else if(document.getElementById('List_Image_Area')){
      document.getElementById('List_Image_Area').innerHTML = '';
      document.getElementById('List_Image_Area').style.display = 'none';
    }
    switch(option){
      case "Edit_Service":
        if(document.getElementById('Image_Area')){
          if(newImg != ''){
            let newImage = '<img src="../images/services/thumbs/'+newImg+'"  id="Image" name="Image" style="width:200px;"/>';
            document.getElementById('Image_Area').innerHTML = newImage;
            if(document.getElementById('Original_Image')){
              document.getElementById('Original_Image').value = newImg;
            }
          }
        }
      break;
      case "Edit_Service_Category":
        if(document.getElementById('Image_Area')){
          if(newImg != ''){
            let newImage = '<img src="../images/services/thumbs/'+newImg+'"  id="Image" name="Image" style="width:200px;"/>';
            document.getElementById('Image_Area').innerHTML = newImage;
            if(document.getElementById('Original_Image')){
              document.getElementById('Original_Image').value = newImg;
            }
          }
        }
      break;      
      case "Edit_Event":
        if(document.getElementById('Image_Area')){
          if(newImg != ''){
            let newImage = '<img src="../images/events/thumbs/'+newImg+'"  id="Image" name="Image" style="width:200px;"/>';
            document.getElementById('Image_Area').innerHTML = newImage;
            if(document.getElementById('Original_Image')){
              document.getElementById('Original_Image').value = newImg;
            }
          }
        }
      break;  
      case "Edit_FAQ_Category":
        if(document.getElementById('Image_Area')){
          if(newImg != ''){
            let newImage = '<img src="../images/faqs/thumbs/'+newImg+'"  id="Image" name="Image" style="width:200px;"/>';
            document.getElementById('Image_Area').innerHTML = newImage;
            if(document.getElementById('Original_Image')){
              document.getElementById('Original_Image').value = newImg;
            }
          }
        }
      break;              
      case "Edit-Staff":
        if(imgName != '' && imgName != null){
          if(document.getElementById('Thumb_Img')){
            document.getElementById('Thumb_Img').src = '../images/staff/'+imgName;
          }else{          
            let newImg = '<img src="../images/staff/'+imgName+'" style="border-radius:10px;" id="Thumb_Img" name="Thumb_Img"/>';
            document.getElementById('Thumb_Img_Area').innerHTML = newImg;
          }
          document.getElementById('Img').value = imgName;
        }
      break;
      case "Edit_Resource_Category":
        if(document.getElementById('Image_Area')){
          if(newImg != ''){
            let newImage = '<img src="../images/resources/thumbs/'+newImg+'"  id="Image" name="Image" style="width:200px;"/>';
            document.getElementById('Image_Area').innerHTML = newImage;
            if(document.getElementById('Original_Image')){
              document.getElementById('Original_Image').value = newImg;
            }
          }
        }
      break;        
    }    
  }
}