﻿function getCookie(cookieName) {
	var cookieString = document.cookie;
	var start = cookieString.indexOf(cookieName + '=');
	if (start == -1)
		return null;
	start += cookieName.length + 1;
	var end = cookieString.indexOf(';', start);
	if (end == -1) {
		end = cookieString.indexOf('&', start);
		if (end == -1)return cookieString.substring(start);
	}
	return cookieString.substring(start, end);
}

function setCookie(value){
	document.cookie = document.cookie + "=0;"
	var expires = new Date();
	expires.setTime(expires.getTime() + 3 * 30 * 24 * 60 * 60 * 1000);
	document.cookie = value + 'expires=' + expires.toGMTString();
}