function confirmAction(message) {	
	var test = confirm (message);
	if (test) {
		return true;
	} else {
		return false;
	}
}


function confirmDeleteCategory(subcategory_id, parent_id) {	
	var test = confirm ("Are you sure that you want to delete this category?");
	if (test) {
		if (parent_id == undefined) {
			window.location="category.delete.php?category_id=" + subcategory_id;
		}
		else {
			window.location="category.delete.php?category_id=" + subcategory_id + "&parent_id=" + parent_id;
		}
	} else {
		return false;
	}
}


function confirmDeleteClient(client_id) {	
	var test = confirm ("Are you sure that you want to delete this client and all associated files?");
	if (test) {
		window.location="client.delete.php?client_id=" + client_id;
	} else {
		return false;
	}
}


function confirmDeleteUser(user_id) {	
	var test = confirm ("Are you sure that you want to delete this user?");
	if (test) {
		window.location='user.delete.php?user_id=' + user_id;
	} else {
		return false;
	}
}


function checkAddUser() {
	requiredVar = new Array("fname","lname","username","passwd","email");
	requiredExp = new Array("First Name","Last Name","Username","Password","Email Address");
	reqCount = requiredVar.length;
	omitcount = 0;
	omittedFields = "";
	
	for (i=0; i<reqCount; i++) {
		fieldname = requiredVar[i];
		if (!document.adduser[fieldname].value) {
			omitcount++;
			omittedFields += omitcount + ". " + requiredExp[i] + "\n";
		}
	}
	if (omitcount > 0) {
		alert("Please complete these required fields:\n" + omittedFields);
		return false;
	}
	else {
		return true;
	}
}