<?php
header('content-type: application/javascript');
?>
function addToFileBasket(hashname,noreload) {  
  document.getElementById('actionMe').src = "/bin/updatefile.php?hashname=" + hashname;  
  alert("document added to queue for transfer");
  if(!noreload) {
    
    menuitem =  document.getElementById('untaggedDocs');
    menuitem.style.visibility= "visible";
    menuitem.style.display= "inline";
    //document.location.reload();
  }
}


function showArchived(newValue) {
  var archivable = [];
  archBox = document.getElementById('isArchived');  
  if(newValue in oc(['<?php echo(implode("','",$archivableStatus)); ?>'])) {
    archBox.style.visibility='visible'
    archBox.style.hidden='no'
  } else {
    archBox.style.visibility='hidden'
    archBox.style.hidden='yes'
  }
}

function oc(a) {
  var o = {};
  for(var i=0;i<a.length;i++)
  {
    o[a[i]]='';
  }
  return o;
}

function uploadDMS(catID,typeID) {
  parent.document.form.form_categoryid.value = catID;
  parent.document.form.form_filetypecategoryid.value = typeID;
  document.form.submit();    
  uploadNote = parent.document.getElementById('uploadBoxNote');
  uploadBox = parent.document.getElementById('uploadBox');
  if(catID > 0 && typeID > 0) {
    uploadBox.style.visibility='visible'
    uploadBox.style.display='block'
    uploadNote.style.visibility='hidden'    
    uploadNote.style.display='none'
  } else {
    uploadBox.style.visibility='hidden'
    uploadBox.style.display='none'
    uploadNote.style.visibility='visible'   
    uploadNote.style.display='block'
  }
}
