/*********************************************************************************
**																				**
**	Cookie Functions															**
**																				**
*********************************************************************************/
function setCookie(cookieName, cookieValue, cookieMonths) {
	
	var nowDate = new Date();
	nowDate.setMonth(nowDate.getMonth() + cookieMonths);
	
	document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + nowDate.toGMTString() + ";Path=/;";
}

function getCookie(cookieName) {
	var cookieValue = document.cookie;
	var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");
	if (cookieStartsAt == -1) cookieStartsAt = cookieValue.indexOf(cookieName + "=");
	if (cookieStartsAt == -1) cookieValue = null;
	else {
		cookieStartsAt = cookieValue.indexOf("=", cookieStartsAt) + 1;
		var cookieEndsAt = cookieValue.indexOf(";", cookieStartsAt);
		if (cookieEndsAt == -1) cookieEndsAt = cookieValue.length;
		cookieValue = unescape(cookieValue.substring(cookieStartsAt, cookieEndsAt));
	}
	return cookieValue;
}

function deleteCookie(cookieName) {
	setCookie(cookieName, "", -1);
}