
	isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
	NS4 = (document.layers) ? true : false;
	IEmac = ((document.all)&&(isMac)) ? true : false;
	IE4plus = (document.all) ? true : false;
	IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
	IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
	ver4 = (NS4 || IE4plus) ? true : false;
	NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1) ? true:false;

	// Body onload utility (supports multiple onload functions)
	var gSafeOnload = new Array();
	function SafeAddOnload(f)
	{
		if (IEmac && IE4)  // IE 4.5 blows out on testing window.onload
		{
			window.onload = SafeOnload;
			gSafeOnload[gSafeOnload.length] = f;
		}
		else if  (window.onload)
		{
			if (window.onload != SafeOnload)
			{
				gSafeOnload[0] = window.onload;
				window.onload = SafeOnload;
			}		
			gSafeOnload[gSafeOnload.length] = f;
		}
		else
			window.onload = f;
	}

	function SafeOnload()
	{
		for (var i=0;i<gSafeOnload.length;i++)
			gSafeOnload[i]();
	}


	function openWin(type)
	{
		switch (type) {
			case 'help':
				myUrl = currentUrl.replace(/\/[a-z0-9_]+\.html/i, "/help.html");
				myUrl = baseHref + myUrl + '?field_id=' + openWin.arguments[1];
				window.open (myUrl, 'help', "status=1"); 
			break;
		}
	}

	function windowOpen(url, name, features)
	{
		oWindow = window.open(url, name, features);
		oWindow.focus();
	}

	function doId(action, id) {

		if (action == 'delete') {
			if (confirm(sConfirmDelete)) {
				document.forms.fdata.submit();
			}
		}
		else {
			currentUrl = currentUrl.replace(/\/[a-z0-9_]+\.html/i, "/" + action + ".html");
			if (id) {
				rIU('id', id);
			}
			else if (currentQuery) {
				document.location = baseHref + currentUrl + '?' + currentQuery;
			}
			else {
				document.location = baseHref + currentUrl;
			}
		}
   	}
	

	function rIU(param, val)
	{
		var query = currentQuery;
		if (query == '') {
			query = param + '=' + val;
		}
		else {
			var ereg = new RegExp();
			ereg.compile(param + '=[a-z0-9_+\ \.]+', 'i');
			if (query.match(ereg)) {
				query = query.replace(ereg, param + '=' + val);
			}
			else {
				query += '&' + param + '=' + val;
			}
		}
		document.location = baseHref + currentUrl + '?' + query;
	}


	function bgClr(obj, color) {
		obj.style.backgroundColor = color;
	}


	function styleMe(obj, classname) {
		obj.className = classname;
	}

	function activateTab(tab_id) {
		if (typeof(tab_id) != 'string') tab_id = lang;
		var allFieldsets = document.getElementsByTagName('fieldset');
		for (var i = 0; i < allFieldsets.length; i++) {
			with (allFieldsets.item(i)) {
				if (id == tab_id) {
					style.display = 'block';
				}
			}
		}
		for (var i = 0; i < allFieldsets.length; i++) {
			with (allFieldsets.item(i)) {
				if (id && id != tab_id) {
					style.display = 'none';
				}
			}
		}
	}

	function showTip(sToolTip)
	{
		var oToolTip = document.getElementById('tooltip');
		oToolTip.innerHTML = sToolTip;
		var nTop = 150;
		var nTop = Math.floor((document.body.offsetHeight - oToolTip.offsetHeight) / 3);
		var nLeft = Math.floor((document.body.offsetWidth - oToolTip.offsetWidth) / 2);
		oToolTip.style.top = nTop + 'px';
		oToolTip.style.left = nLeft + 'px';
		oToolTip.style.visibility = "visible";
	}


	function hideTip() {
		var oToolTip = document.getElementById('tooltip');
		oToolTip.style.visibility = "hidden";
	}
