if (!sbweb.util.cookies) sbweb.util.cookies = function() {
	
	this.getExpDate = function(pDays, pHours, pMinutes) {
		var expDate = new Date();
		if (typeof pDays == "number" && typeof pHours == "number" && typeof pMinutes == "number") {
			expDate.setDate(expDate.getDate() + parseInt(pDays));
			expDate.setHours(expDate.getHours() + parseInt(pHours));
			expDate.setMinutes(expDate.getMinutes() + parseInt(pMinutes));
			return expDate.toGMTString();
		}
	}
		
	this.getCookieValue = function(pOffset) {
		var endstr = document.cookie.indexOf(";", pOffset);
		if (endstr == -1) {
			endstr = document.cookie.length;
		}
		return unescape(document.cookie.substring(pOffset, endstr));
	}
	
	return {
		
		getCookie : function(pName) {
			var arg = pName + "=";
			var alen = arg.length;
			var clen = document.cookie.length;
			var i = 0;
			while (i < clen) {
				var j = i + alen;
				if (document.cookie.substring(i,j) == arg) {
					return(getCookieValue(j));
				}
				i = document.cookie.indexOf(" ", i) + 1;
				if (i == 0) break;
			}
			return("");
		},
		
		setCookie : function(name, value, expires, path, domain, secure) {
			document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
		},
		
		deleteCookie : function(name, path, domain) {
			if (this.getCookie(name)) {
				document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
			}	
		}
	};
	
}();

