String.prototype.format = function() {
	var s = this;
	for (var i = 0, j = arguments.length; i < j; i++)
		s = s.replace("{" + (i) + "}", arguments[i]);
	return(s);
}

var Cookie = {
	Set : function () {
		var name = arguments[0], value = escape(arguments[1]),
			days = (arguments.length > 2) ? arguments[2] : 365,
			path = (arguments.length > 3) ? arguments[3] : "/";
		with(new Date()) {
			setDate(getDate() + days);
			days = toUTCString();
		}
		document.cookie = "{0}={1};expires={2};path={3}".format(name, value, days, path);
	},
	Get : function () {
		var returnValue = document.cookie.match(new RegExp("[\b\^;]?" + arguments[0] + "=([^;]*)(?=;|\b|$)","i"));
		return returnValue ? unescape(returnValue[1]) : returnValue;
	},

	Delete : function () {
		var name = arguments[0];
		document.cookie = name + "=1 ; expires=Fri, 31 Dec 1900 23:59:59 GMT;";
	}
}