var Cookies =
{
	Init: function()
	{
		var pAllCookies = document.cookie.split('; ');
		for (var i=0; i<pAllCookies.length; i++)
		{
			var pCookiePair = pAllCookies[i].split('=');
			this[pCookiePair[0]] = pCookiePair[1];
		}
	},

	Create: function(strName, strValue, iDays)
	{
		var strExpires = "";
		if (iDays)
		{
			var pDate = new Date();
			pDate.setTime(pDate.getTime() + (iDays*24*60*60*1000));
			strExpires = "; expires=" + pDate.toGMTString();
		}
		document.cookie = strName + "=" + strValue + strExpires +"; path=/";
		this[strName] = strValue;
	},

	Erase: function(strName)
	{
		this.Create(strName, '', -1);
		this[strName] = undefined;
	}
};

Cookies.Init();