function Cookies () {
	
	var oSettings = {
		iExpiryDays : 7
	};

	this.create = function(strName, strValue, iDays) {
		if(!iDays) {
			iDays = oSettings.iExpiryDays;
		}
		var date = new Date();
		date.setTime(date.getTime() + (iDays * 24 * 60 * 60 * 1000));
		strExpires = "; expires=" + date.toGMTString();

		document.cookie = strName + "=" + strValue + strExpires + "; path=/";

		return {
			"strName" : strName,
			"strValue" : strValue
		};
	};
	
	this.read = function(strName) {
		strNameEQ = strName + "=";
		arrCookies = document.cookie.split(";");
		for( i = 0; i < arrCookies.length; i++) {
			strCookie = arrCookies[i];
			while(strCookie.charAt(0) == " ") {
				strCookie = strCookie.substring(1, strCookie.length);
			}
			if(strCookie.indexOf(strNameEQ) == 0) {
				return strCookie.substring(strNameEQ.length, strCookie.length);
			} else {
			} 
		}
		return "";
	};
	
	this.erase = function(strName) {
		this.create(name, "", -1);
		return {
			"strName" : strName,
			"strValue" : null
		};
	};
}

