// Check that the browser is Firefox, Opera, IE7+, or Safari
function checkBrowser()
{
	// Check if we checked already
	if (getCookie("browserChecked") == null)
	{
		// Check browser (Firefox, Opera, IE7+, Safari)
		if (typeof document.body.style.maxHeight == "undefined")
			alert("This site was designed for Firefox or Internet Explorer 7+.\nYour browser may not correctly display this site.");
		setCookie("browserChecked", "T");
	}
}

function setCookie(name, value, daysTilExpires)
{
	// Create expires date
	if (daysTilExpires != null)
	{
		var date = new Date();
		date.setDate(date.getDate + daysTilExpires)
	}
	
	// Set cookie
	document.cookie = name + "=" + escape(value) + ((daysTilExpires == null) ? "" : ";expires=" + date.toGMTString()) + ";path=";
}

function getCookie(name)
{
	// Check if there are any cookies
	if (document.cookie.length > 0)
	{
		// Check for start of cookie
		var start = document.cookie.indexOf(name + "=");
		if (start != -1)
		{
			// Get end of cookie
			var end = document.cookie.indexOf(";", start);
			if (end == -1)
				end = document.cookie.length;
			var str = document.cookie.substr(start + name.length + 1, end);
			return unescape(str);
		}
	}
	
	return null;
}
