// Set base URL (if not already loaded from cms34.js.php)
if (typeof baseUrl == "undefined") {
	var baseUrl = '';
	var relBaseUrl = '';
	if (location.href.indexOf('/admin') != -1) {
		baseUrl = location.href.substring(0,location.href.indexOf('/admin'));
		relBaseUrl = location.pathname.substring(0,location.pathname.indexOf('/admin'));
	}
	// Next two methods are highly unreliable -- need to be fixed
	else if (location.href.lastIndexOf('/') == location.href.length-1) {
		baseUrl = location.href.substring(0,location.href.length-1);
		relBaseUrl = location.pathname.substring(0,location.pathname.length-1);
	}
	else {
		baseUrl = location.href;
		relBaseUrl = location.pathname;
	}
}

function confirmClick(url,dialog) {
	if (!dialog) {
		dialog = 'Are you sure? Unsaved changes on this page will be lost.';
	}
	if (confirm(dialog)) {
		location.href = url;
	}
	return false;
}
