//0 - msie
//1 - mozilla firefox (which can include old netscape nav)
//2 - opera
//3 - chrome

function detectAgent ()
{
var ret = 0;
var ua = navigator.userAgent;

	if (ua.indexOf('Firefox') >= 0)
	{
		ret = 1;
		return ret;
	}
	
	if (ua.indexOf('Opera') >= 0)
	{
		ret = 2;
		return ret;
	}
	
	if (ua.indexOf('Chrome') >= 0)
	{
		ret = 3;
		return ret;
	}
	
	if (ua.indexOf('Safari') >= 0)
	{
		ret = 4;
		return ret;
	}
	
	if (ua.indexOf('MSIE') >= 0)
	{
		ret = 0;
		return ret;
	}
	
	return ret;
}

function good (ptr)
{
	return ((typeof(ptr) != 'undefined') && (ptr != undefined) && (ptr != null));
}

function stillLoading ()
{
	if (g_bLoaded) return false;
	alert('The page is still loading. Please wait.');
	return true;
}

