gl_agent = navigator.userAgent.toLowerCase();
gl_is_ie     = ((gl_agent.indexOf("msie") != -1) && (gl_agent.indexOf("opera") == -1));
gl_is_mozilla = (gl_agent.indexOf("mozilla") != -1);
gl_is_opera  = (gl_agent.indexOf("opera") != -1);
gl_is_mac    = (gl_agent.indexOf("mac") != -1);
gl_is_mac_ie = (gl_is_ie && gl_is_mac);
gl_is_win_ie = (gl_is_ie && !gl_is_mac);
gl_is_gecko  = (navigator.product == "Gecko");


var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById)
{
	isID = 1; isDHTML = 1;
} else {
	if (document.all)
	{
		isAll = 1;
		isDHTML = 1;
	} else {
		browserVersion = parseInt(navigator.appVersion);
		if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4))
		{
			isLayers = 1;
			isDHTML = 1;
		}
	}
}


function findDOM(objectID, withStyle)
{
	if (withStyle == 1)
	{
		if (isID)
		{
			return(document.getElementById(objectID).style);
		} else {
			if (isAll)
			{
				return(document.all[objectID].style);
			} else {
				if (isLayers) {return(document.layers[objectID]);}
			}
		}
	} else {
		if (isID)
		{
			return(document.getElementById(objectId));
		} else {
			if (isAll) {return(document.layers[objectID]);}
		}
	}
}

function changeStyle(objectID,styleName,newVal)
{
	var dom = findDOM(objectID,1);
	dom[styleName] = newVal;
}

function GetStyle(objectID,styleName)
{
	var dom = findDOM(objectID,1);
	return dom[styleName];
}


function win_open(url, win_name, WWidth, WHeight)
{
	window.open(url, win_name, 'scrollbars=yes,resizable=yes,top=10,left=10,width=' + WWidth + ',height=' + WHeight + ',toolbar=yes,location=yes,status=yes');
	return false;
}

function win_open_minimum(url, win_name, WWidth, WHeight)
{
	window.open(url, win_name, 'scrollbars=yes,resizable=yes,top=10,left=10,width=' + (WWidth + 20) + ',height=' + (WHeight + 0) + ',toolbar=no,location=no,status=no');
	return false;
}

function set_focus_on_load()
{
	setTimeout(function () { if (gl_form_obj.date) gl_form_obj.date.focus();}, 10);
}