function editThisArticle(blogID) {
    document.menuForm.action = 'index.php?blogID=' + blogID + '&action=edit';
    //document.articleForm.artMode.value = 'edit';
    document.menuForm.submit();
}

function addNewArticle(){
  document.menuForm.action = 'index.php?blogID=&action=add';
  document.menuForm.submit();
}

function cancelEdit(articleID) {
    document.menuForm.action = 'index.php?blogID=' + articleID ;
    document.menuForm.submit();
}


function addBlog(){
  document.submitForm.action.value = 'addBlog';
  document.submitForm.submit();
}

function updateBlog(blogID){
  document.submitForm.action.value = 'updateBlog';
  document.submitForm.blogID.value = blogID;
  document.submitForm.submit();
}

function closeBlog(blogID){
  if (confirm("Are you sure you want to close off this blog?")){
    document.submitForm.action.value = 'closeBlog';
    document.submitForm.blogID.value = blogID;
    document.submitForm.submit();
  }
}

function approveBlog(blogID){
  if (confirm("do you want to approve article for general viewing?")){
    document.submitForm.action.value = 'approve';
    document.submitForm.blogID.value = blogID;
    document.submitForm.submit();
    }
}

function deleteBlog(blogID){
  if (confirm("Are you certain you wish to delete this article?\nThis will completely remove from the database.\nIf you just wish to close the blog, Approve the changes and then select 'Close Off Blog'")){
    document.submitForm.action.value = 'delete';
    document.submitForm.blogID.value = blogID;
    document.submitForm.submit();
    }
}
