var Utils = {
	included_js: new Array(),
	includeOnce: function(js_file) {
		if(this.included_js.indexOf(js_file) != -1) {
			return; // only include files once
		}
		document.write('<script type="text/javascript" src="' + js_file + '"></script>');
		this.included_js.push(js_file);
	}
}

Number.prototype.toRad = function() {  // convert degrees to radians
	return this * Math.PI / 180;
}

String.prototype.evalHTML = function() {
	var el = new Element("div");
	el.update(this);
	return el.firstDescendant();
}

String.prototype.isPostalCode = function() {
	return this.match(/[A-Z]\d[A-Z]\s?\d[A-Z]\d/i);
}

String.prototype.nl2br = function() {
	return this.replace(/\n/g, "<br />");
}	
