// Save Cookie
function setCookie(theName, theVal, tm) {
	if (theName != null && theVal != null) {
		var date = new Date();
		date.setTime(date.getTime() + tm);
		document.cookie = theName + "=" + escape(theVal) + "; expires=" + date.toGMTString();
		return true;
	}
	return false;
}

function deleteCookie(theName) {
	document.cookie = theName + "=;expires=Thu, 01-Jan-70 00:00:01 GMT";
	return true;
}

// Load Cookie
function getCookie(theName) {
	theName += "=";
	var theCookie = document.cookie + ";";
	var start = theCookie.indexOf(theName);
	if (start != -1) {
		var end = theCookie.indexOf(";", start);
		return unescape(theCookie.substring(start + theName.length, end));
	}
	return "";
}

