//Site-wide scripts

var IE_Version = getInternetExplorerVersion();

var isIE = IE_Version>=0;
var isWin = navigator.appVersion.indexOf("Windows")!=-1;
var isModernIE = isWin && (IE_Version>=5.5);
var isMacIE = isIE && !isWin;

function getInternetExplorerVersion() {
	var rv = -1;
	if (navigator.appName == 'Microsoft Internet Explorer') {
		var ua = navigator.userAgent;
		var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
		if (re.exec(ua) != null)
		rv = parseFloat( RegExp.$1 );
	}
	return rv;
}
function checkBrowser() {
	if(isMacIE) {
		alert("WARNING!\nInternet Explorer 5 for Mac is not compatible with this site.\nPlease use an alternative such as Safari or Firefox.");
		return false;
	} else {
		if(isIE && isWin && !isModernIE) {
			alert("WARNING!\n\nPlease use Internet Explorer 5.5 or higher or an alternative such as Firefox.");
			var abortPlugin = true;
			return false;
		}
	}
	return true;
}

window.onload = checkBrowser;

function doPopup(command) {
	if(command=='reset') {
		return false;
	} else {
		location.href=command;
		return true;
	}
}
