// dadaIMC: $Id: library.js,v 1.1 2003/09/29 16:52:29 spud Exp $
// license: GNU LGPL
// copyright 2001-2002: dada typo and contributors
function isEmpty(s) { return ((s == null) || (s.length == 0)) }
function isWhitespace (s) {
	if (isEmpty(s)) return true;
	if (s == "\t") return true;
	if (s == "\n") return true;
	if (s == "\r") return true;
	return false;
}
function hasWhitespace(s) {
	var i;
	var whitespace = " \t\n\r";
	for (i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if (whitespace.indexOf(c) != -1) return true;
	}
	return false;
}
function get_subdir(form) {
	var fname = form.filename.value;
	var num = 0;
	for (var x = 0; x < fname.length; x++) {
		num += fname.charCodeAt(x);
	}
	var total = num % 13 + 1;
	window.alert("Subdirectory for " + fname + " should be "  + total);
	return false;
}
function toggleDetails() {
	obj = document.getElementById('details');
	if (obj.style.display == 'block') {
		obj.style.display = 'none';
	} else {
		obj.style.display = 'block';
	}
}