function confirmAction_logout() {
return confirm("Are you sure you want to logout of the ARA Vault?\n\nPress OK to logout, or Cancel to cancel")
}

function confirmAction_company_delete() {
return confirm("Are you sure you want to delete this Company from the Vault?\n\nPress OK to delete, or Cancel to cancel")
}

function confirmAction_user_delete() {
return confirm("Are you sure you want to delete this user from the Vault?\n\nWarning: All messages to and from user will also be deleted!\n\nPress OK to delete, or Cancel to cancel")
}

function confirmAction_company_delete_no() {
return alert("There are users linked to this company, you cannot delete a company with linked users\n\nRemove all linked users then try again")
}


function confirmAction_message_delete_forever() {
return confirm("Are you sure you want to permanently remove the selected message(s)?")
}

function confirmAction_message_empty_trash() {
return confirm("Are you sure you want to empty the Trash folder?\n\nPress OK to permanently remove all messages in Trash, or Cancel to cancel")
}

function validate_company_add_form()
{
    valid = true;

    if ( document.company_add_form.company_name.value == "" )
    {
        alert ( "ARA Vault Company Addition Error:\n\n- Please Enter a Company Name" );
        valid = false;
        document.company_add_form.company_name.focus();
    }
    
    return valid;
}


function validate_company_edit_form()
{
    valid = true;

    if ( document.company_edit_form.company_name.value == "" )
    {
        alert ( "ARA Vault Company Edit Error:\n\n- Please Enter a Company Name" );
        valid = false;
        document.company_edit_form.company_name.focus();
    }
    
    return valid;
}



function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}


function checkAll(field) {
	for (i = 0; i < field.length; i++)
	field[i].checked = true;
}

function checkAllNo(field) {
	for (i = 0; i < field.length; i++)
	field[i].checked = false;
}

function checkAllBefore(field) {
flg = 0;

for (i = 0; i < field.length; i++) {
if(field[i].checked==true){
flg=1;

    if (!document.compose_message.message_subject.value == "" && !document.compose_message.message_body.value == "")
    {
animatedcollapse.show('upload_loading');
    }


break;
}else{
flg = 0;
}
}

if(flg == 0){
alert("No Recipient(s) Selected for Your Message");
return false;
}
}




function onSubmitUpload(form){
document.getElementById("sub").disabled = true;
document.getElementById("sub").value = 'Please wait...'; form.submit(); }


