// Set global browser boolean flags

var isIE	= document.all;
var isIE6	= isIE && document.implementation;
var isIE5	= isIE && window.print && !isIE6;
var isIEDOM2	= isIE5 || isIE6;
var isIE4	= isIE && !isIEDOM2 &&
         	  navigator.cookieEnabled;
var isIE3	= isIE && !isIE4 && !isIEDOM2;
var isNS	= navigator.mimeTypes && !isIE;
var isNS3	= isNS && !navigator.language;
var isNS4	= document.layers;
var isNS6	= document.getElementById && !isIE;
var isNS7	= isNS6;
var isNS71	= document.designMode;
var isNSDOM2	= isNS6;
var isDOM2	= isIEDOM2 || isNSDOM2;

// Generic function once body loads
function bodyOnLoad() {
	// Rearrange menus, if any set
	if (typeof document.hierarchyObjs != "undefined") {
		changeAllOnLoad(document.hierarchyObjs,document.hierarchyProps);
	}
}

function formOnSubmit(admin_action,admin_type,admin_name) {
	// Check the form submission
	if (!checkForm()) {
		return false;
	}

	/* var alertString="";
	// Alert the user that the details have been saved
	if (admin_action == 'add') {
		alertString = 'Thank you. This ' + admin_name + ' has been created.'
		alertString += "\n";
		alertString += 'You may now need to input the further details before ' + admin_name + ' is complete.';
		alert(alertString);
	} else {
		// alertString = 'Thank you. This ' + admin_name + ' has been updated.'
		// alert(alertString);
	} */

	return true;
}

function primaryPopup(url) {
	window.open(url,'primary','directories=no,height=160,width=240,location=false,menubar=false,resizable=false,status=false,toolbar=false');
}

function primaryCloseAndReload() {
	var elem = window.opener.document.getElementById("change-when-outlet-primary");
	if (elem != null) {
		elem.innerHTML = "Yes";
	}
	window.setTimeout('window.close()',3000);
}

function rpgGenericPopup(url,w,h,name,showScrollbars) {
	if (typeof name == "undefined") {
		name = "none";
	}
	if (typeof showScrollbars == "undefined") {
		showScrollbars = 0;
	}
	return window.open(url,name,'directories=no,height='+h+',width='+w+',location=false,menubar=false,resizable=false,status=false,toolbar=false,scrollbars='+showScrollbars);

}

function rpgGenericPopupReturnFalse(url,w,h,name,showScrollbars) {
	var devnull = rpgGenericPopup(url,w,h,name,showScrollbars);
	return false;
}
