utilities = {
	externallinks : function () {
		if (!document.getElementsByTagName) {return;}
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
				{anchor.target = "_blank";}
		}
	},
	goUrl : function(url) {
		if (url == 'back') {
			history.go(-1);
		} else {
			document.location = url;
		}
	},
	PopupPic : function (dir, img) {
		window.open("/assets/images/openpic.asp?dir=" + unescape(dir) + "&img=" + img, "", "resizable=no,scrollbars=no,height=200,width=200");
		return false;
	},
	confirmSubmit : function() {
		var str = "This action is not reversible, are you sure you wish to continue?";
		if (arguments[1] !== null) {str += "\n" + arguments[1];}
		var agree = window.confirm(str);
		if (agree) {
			if (arguments[0] !== null) {
				this.goUrl(arguments[0]);
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
};