function AddToFav () { 
if (document.all)
window.external.AddFavorite(location.href, document.title);
else if (window.sidebar)
window.sidebar.addPanel(document.title, location.href, "")
else
alert("To add this site to your bookmarks click 'OK', and then press [Ctrl]+D.");
return false;
}

function SetHome() { document.body.style.behavior='url(#default#homepage)'; document.body.setHomePage('http://www.absolutcheats.com/'); return false; }

function open_pop(link,width,height) { window.open(link,'AbsolutCheats','width='+width+',height='+height+',resizable=yes,scrollbars=no'); return false; }

function setCookie(name, value, expires, path, domain, secure) {
	var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); document.cookie = curCookie;
	}

function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
		} else
		begin += 2;
		var end = document.cookie.indexOf(";", begin);
		if (end == -1) end = dc.length;
		return unescape(dc.substring(begin + prefix.length, end));
	}

function deleteCookie(name, path, domain) {
	if (getCookie(name)) {
		document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}

function hello_user() {
	var m_name = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
	var name = getCookie("name");
	var last = getCookie("last");
	var ses  = getCookie("ses");
	var now = new Date();
	var sad = now.getTime();

	if (!name) { 
		document.write ('<div class="title">Hello user!</div><div class="content"><ul class="columnlink"><li><a href="/scripts/login.php">Log In</a></li><li><a href="/register.php">Not a member? Sign up!</a></li></ul></div>');
		} else {
		if (!ses) {
			now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
			setCookie("ses", "1");
 			setCookie("last", sad, now);
			sad=(sad-last)/3600000;

			if (sad<now.getHours()) {
				last="earlier this day"
				} else if (sad<24+now.getHours()) {
					last= " yesterday"
					} else {
					last=parseInt(last);
					now = new Date(last);
					if (!m_name[now.getMonth()]) { 
						last="a long, long time ago...";
						} else {
						last="on " + m_name[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear();
						}
					}
			last = "You last visited this site " + last + ".<br><br>";

			} else {
			last = "";
			}
		document.write ('<div class="title">Hello '+name+'!</div><div class="content">' + last + '<ul class="columnlink"><li><a href="/mygames.php">View my games</a></li><li><a href="/mydetails.php">Change my details</a></li><li><a href="/scripts/logout.php">Log out</a></li></ul></div>');
		}
	}
