window.onload = function() {
	document.getElementById("sessionButton").onclick = window.close;

	// Check Querystring, if we have failed because the user is not a member of the classic group then prompt
	var strQuery = window.location.search;
	var ParamArgs = GetParamArgs(strQuery);
	if (ParamArgs.ClassicUser == "False") alert("You are not authorised to access this site.");

	if (window.dialogArguments != null) {
		session.style.display = 'block';
		login.style.display = 'none';
		window.dialogHeight = '240px';
		window.dialogWidth = '450px';
	}
	else { if ((location.pathname == '/public/default.asp') || (location.pathname == '/content/public/login/default.asp')) { logon.Username.focus() } }
}

function GetParamArgs(strQuery) {
	var args = new Object();
	var query = strQuery.substring(1);
	var pairs = query.split("&");
	for (var iParamCount = 0; iParamCount < pairs.length; iParamCount++) {
		var pos = pairs[iParamCount].indexOf('=');
		if (pos == -1) continue;
		var argname = pairs[iParamCount].substring(0,pos);
		var value = pairs[iParamCount].substring(pos+1);
		args[argname] = unescape(value);
	}
	return args;
}

function niceAlert(sMessage, sTitle) {
var argList = new Array(sMessage, "", 33, sTitle);
return showModalDialog("MBox.htm", argList,"dialogWidth: 340px; dialogHeight: 220px; center: yes; border: thin; help: no; statusbar: no;") }