function SetCookie (Name, Value, Expires, Path) {
	document.cookie = Name + "=" + Value +
		((Expires == null) ? "" : ("; expires=" + Expires)) +
		((Path == null) ? "" : ("; path=" + Path));
	}

function GetCookie(Name) {
	var Key= Name + "=";
	var Length= Key.length;
	var CLength= document.cookie.length;
	var I= 0;
	var J;
	var Last;
	while (I < CLength) {
		J= I + Length;
		if (document.cookie.substring(I, J) == Key) {
			Last= document.cookie.indexOf(";", J);
		  if (Last == -1) Last= document.cookie.length;
		  return unescape(document.cookie.substring(J, Last));
			}
		I= document.cookie.indexOf(" ", I) + 1;
    if (I == 0) break;
    }
  return null;
	}  
