TOOLS = {
	getValue: function(id, defaultValue){
		value = document.getElementById(id).value;
		if (value == "") {
			value = defaultValue;
		}
		return value;
	},
	
	jemail: function(user, domain, text){
		if (text == '') {
			document.write('<a href="' + 'mailto:' + user + '@' + domain + '">' + user + '@' + domain + '</a>');
		}
		else {
			document.write('<a href="' + 'mailto:' + user + '@' + domain + '">' + text + '</a>');
		}
	},
	
	validateEmail: function(email){
		var rc = true;
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(email.value))) {
			email.value = "INVALID: " + email.value;
			email.focus();
			email.select();
			rc = false;
		}
		return rc;
	}
};
