    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);


    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);

    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

    var is_webtv = (agt.indexOf("webtv") != -1);

    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1));
    var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));

    // *** JAVASCRIPT VERSION CHECK ***
    var is_js;
    if (is_nav2 || is_ie3) is_js = 1.0;
    else if (is_nav3) is_js = 1.1;
    else if (is_opera5up) is_js = 1.3;
    else if (is_opera) is_js = 1.1;
    else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
    else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
    else if (is_hotjava3up) is_js = 1.4;
    else if (is_nav6 || is_gecko) is_js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (is_nav6up) is_js = 1.5;
    // NOTE: ie5up on mac is 1.4
    else if (is_ie5up) is_js = 1.3

    // HACK: no idea for other browsers; always check for JS version with > or >=
    else is_js = 0.0;

    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

    // is this a 16 bit compiled version?
    var is_win16 = ((agt.indexOf("win16")!=-1) ||
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
               (agt.indexOf("windows 16-bit")!=-1) );

    var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));

    var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
    var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1));

    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    var is_win32 = (is_win95 || is_winnt || is_win98 ||
                    ((is_major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

    var is_os2   = ((agt.indexOf("os/2")!=-1) ||
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||
                    (agt.indexOf("ibm-webexplorer")!=-1));

    var is_mac    = (agt.indexOf("mac")!=-1);
    // hack ie5 js version for mac
    if (is_mac && is_ie5up) is_js = 1.4;
    var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) ||
                               (agt.indexOf("68000")!=-1)));
    var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) ||
                                (agt.indexOf("powerpc")!=-1)));

    var is_sun   = (agt.indexOf("sunos")!=-1);
    var is_sun4  = (agt.indexOf("sunos 4")!=-1);
    var is_sun5  = (agt.indexOf("sunos 5")!=-1);
    var is_suni86= (is_sun && (agt.indexOf("i86")!=-1));
    var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
    var is_irix5 = (agt.indexOf("irix 5") !=-1);
    var is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    var is_hpux  = (agt.indexOf("hp-ux")!=-1);
    var is_hpux9 = (is_hpux && (agt.indexOf("09.")!=-1));
    var is_hpux10= (is_hpux && (agt.indexOf("10.")!=-1));
    var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
    var is_aix1  = (agt.indexOf("aix 1") !=-1);
    var is_aix2  = (agt.indexOf("aix 2") !=-1);
    var is_aix3  = (agt.indexOf("aix 3") !=-1);
    var is_aix4  = (agt.indexOf("aix 4") !=-1);
    var is_linux = (agt.indexOf("inux")!=-1);
    var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    var is_unixware = (agt.indexOf("unix_system_v")!=-1);
    var is_mpras    = (agt.indexOf("ncr")!=-1);
    var is_reliant  = (agt.indexOf("reliantunix")!=-1);
    var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
    var is_sinix = (agt.indexOf("sinix")!=-1);
    var is_freebsd = (agt.indexOf("freebsd")!=-1);
    var is_bsd = (agt.indexOf("bsd")!=-1);
    var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux ||
                 is_sco ||is_unixware || is_mpras || is_reliant ||
                 is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);

    var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));


var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
//
// Browser Detection
//
var isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
var IEmac = ((document.all)&&(isMac)) ? true : false;
var IE4plus = (document.all) ? true : false;
//var IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
var IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
//var ver4 = (isNS4 || IE4plus) ? true : false;

// General Javascript that will be used on every page.


function getRef(strId) {
	if (isDOM) return document.getElementById(strId);
	if (isIE4) return document.all[strId];
	if (isNS4)
	{
		var objRef = new Object;
		if (document.layers[strId])
			objRef = document.layers[strId];
		else {
			mess = show_props(document.layers, 'menuform');
		//alert('name=' + document.layers.menuForm.);
			alert('looking for '+ strId + 'layers have' + mess);
		}
		//objRef = document.forms['form1'].;
		//alert("looking for " + strId);
		//objRef = crawlLayers(document.layers, "", strId);
		//alert(showProps(document.layers.overDiv.above.above,"layer0.overdiv.above.above"));
		//if (document.forms["menuForm"])
		//	alert(showProps(document.forms["menuForm"],"form"+i));
		//output = "";
		//if (strId == "menu0item1")
		//	obj = document.layers["menu0item1"];
		//else
		//	obj = document.layers[strId];
	}
	//alert(obj.tagName);
	return objRef;
}

function show_props(obj, obj_name) {
          var result = "";
          for (var i in obj)
                    result += obj_name + "." + i + " = " + obj[i] + "\n";
          return result;
}
function crawlLayers(layerArray, indent, strSearch)
{
	//document.layers['debug'].innerHTML += indent + layerArray.length + "<br/>"
	for (var i = 0; i < layerArray.length; i++)
	{
		//alert(layerArray[i].document.layers.length);
		if (layerArray[i].id == strSearch)
		{
			alert ("found it" + layerArray[i].id);
			return layerArray[i];
		}
		if (layerArray[i].document.layers.length)
		{
			var newLayerArray = layerArray[i].document.layers;
			return crawlLayers(newLayerArray, "  " + indent, searchstr);
		}
	}
	return null;
}

function getSty(id) {
	return (isNS4 ? getRef(id) : getRef(id).style);
}

function getGrossOffsetLeft(elem) {
	var offset = elem.offsetLeft;
	while (elem.offsetParent) {
		// correct for IE/Mac discrepancy between offset and style coordinates,
		// but not if the parent is HTML element (NN6)
		//offset += (elem.offsetParent.tagName != "HTML") ? parseInt(elem.style.left) - parseInt(elem.offsetLeft) : 0;
		elem = elem.offsetParent;
		offset += elem.offsetLeft;
	}
	return offset
}

function getGrossOffsetTop(elem) {
	var offset = elem.offsetTop;
	while (elem.offsetParent) {
		// correct for IE/Mac discrepancy between offset and style coordinates,
		// but not if the parent is HTML element (NN6)
		//offset += (elem.offsetParent.tagName != "HTML") ? parseInt(elem.style.top) - parseInt(elem.offsetTop) : 0
		elem = elem.offsetParent;
		offset += elem.offsetTop;
	}
	return offset
}

// if this type of select box changes, do an automatic transmit.
function changeSelect(selectObj, get_item, pHref, get_var)
{
	var selValue = selectObj.options[selectObj.options.selectedIndex].value;

	if (get_item != "")
		location.href = pHref + "?" + get_item + "&" + get_var + "=" + selValue;
	else
		if (selValue)
			location.href = pHref + "?" + get_var + "=" + selValue;
		else
			location.href = pHref;
}
function redirect(currObj, pHref, get_var)
{

	if (get_var)
		location.href = pHref + "?" + get_var ;
	else
		location.href = pHref;
}

function formLoaded()
{
	// write the menu HTML
	writeMenus();
	// If there is a tracker field position at end
	moveLast();
	return true;
}

function moveLast() {
	if (!document.body)
		return;
	var docRng = document.body.createTextRange();
	//var docStart = docRng.getBookmark();
	for (var i=0; i<document.forms.length; i++)
		{
		var currObj = document.forms[i];
		for (var j=0; j<currObj.elements.length; j++)
			{
			if (currObj.elements[j].name == "gotoLast")
				{
				var selectRng = currObj.elements[j].createTextRange();
				selectRng.move("textedit");
				selectRng.select();
				}
			}
		}
	//docRng.moveToBookmark(docStart);
	docRng.move("textedit",-1);
	docRng.collapse();
	docRng.select();
	return;
}

function keyPress(currObj, evt)
{
	// validate key presses
	if (IE4plus)
		var thisObj = evt.srcElement;
	else
		var thisObj = evt.target;
	var charCode = (evt.which) ? evt.which : event.keyCode;
	if (charCode > 57 && thisObj.name && thisObj.name.substr(0,2) == 'n_')
	{
		alert("Please only enter numbers");
		return false;
	}
	return true;
}

function keyUp(currObj, evt) {
	var keyCode = evt.keyCode;

	//alert("char is ="+evt.keyCode+"; charcode="+evt.charCode);
	if (keyCode == 13 && !isNS4 && getRef("defButton") )
	{
		getRef("defButton").click();
		return false;
	}
	//alert("document is:" + document.forms[1].name);
	if (document.timeform)
	{
		calcTotals(evt);
	}
}


function calcTotals(evt) {
	// Check that the recalc is not called too many times, or before the form has loaded.
	// Check to see that a src element has caused this event.
	//alert('recalc totals');
	if (!evt) return;
	// Only do this if there is a timeform on the page that has loaded.
	//if (!document.timeform) return;
	var elem = evt.srcElement;

	var form = document.timeform;

	// only do this event if the time field has changed.
	if (!elem.name) return;
	if (elem.name.substring(0,4) != 'n_hr') return;
	reCalcTotals(form);
}

function reCalcTotals(form) {
	var i = 0;
	var j = 0;
	var row = 0;
	var col = 0;
	var grand = 0;
	var lastrow = 0;
	var rowtot = new Array();
	var coltot = new Array();
	// Add up the columns and rows.
	//alert('no of elements=' + form.elements.length);
	for (i=0; i<form.elements.length; i++)
	{
		if (form.elements[i].name.substr(0,4) == 'n_hr')
		{
			rowcol = form.elements[i].name.substring(5, form.elements[i].name.length);
			separate = rowcol.indexOf("-");
			lenrow = separate;
			startcol = separate + 1;
			lencol = rowcol.length - separate - 1;
			row = parseInt(rowcol.substr(0,lenrow));
			col = parseInt(rowcol.substr(startcol,lencol));
			// find the highest row number for last row
			if (row > lastrow) lastrow = row;
			if (!rowtot[row]) rowtot[row] = 0;
			if (!coltot[col]) coltot[col] = 0;
			rowtot[row] += parseFloat('0' + form.elements[i].value);
			coltot[col] += parseFloat('0' + form.elements[i].value);
			//alert("rowtot[" + row + "]=" + rowtot[row]);
		}
	}
	// now run through all elements in the form looking for total columns and lines.
	for (i=0; i<form.elements.length; i++)
	{
		if (form.elements[i].name.substr(0,3) == 'tot')
		{
			rowcol = form.elements[i].name.substring(4, form.elements[i].name.length);
			separate = rowcol.indexOf("-");
			lenrow = separate;
			startcol = separate + 1;
			lencol = rowcol.length - separate - 1;
			row = parseInt(rowcol.substr(0,lenrow));
			col = parseInt(rowcol.substr(startcol,lencol));
			// Check to see if this is row total or col total
			if (col == '9')
			{
				form.elements[i].value = rowtot[row];
				if (row > lastrow)
				{
					form.elements[i].value = grand;
				}
				else {
					grand += rowtot[row];
				}
			}
			else {
				form.elements[i].value = coltot[col];
			}
		}
	}
}

// Used in admin screen for showing a working client clock.
function startclock()
{
	var thetime=new Date();

	var nhours=thetime.getHours();
	var nmins=thetime.getMinutes();
	var nsecn=thetime.getSeconds();
	var AorP=" ";

	if (nhours>=12)
	    AorP="P.M.";
	else
	    AorP="A.M.";

	if (nhours>=13)
	    nhours-=12;

	if (nhours==0)
	 nhours=12;

	if (nsecn<10)
	 nsecn="0"+nsecn;

	if (nmins<10)
	 nmins="0"+nmins;

	document.clockform.clockspot.value=nhours+": "+nmins+": "+nsecn+" "+AorP;

	setTimeout('startclock()',1000);

}

function showArea(pArea) {
	// If this is called for the filter box then just show/hide that
	// Otherwise we need to switch all areas off and just on the one.
	if (pArea == "areaFilter")
	{
		var hideObj = getRef("areaNoFilter");
		var showObj = getRef("areaFilter");
		hideObject(hideObj);
		showObject(showObj);
		return;
	}
	if (pArea == "areaNoFilter")
	{
		var hideObj = getRef("areaFilter");
		var showObj = getRef("areaNoFilter");
		hideObject(hideObj);
		showObject(showObj);
		return;
	}
	if (getRef("area0"))
	{
		var hideObj = getRef("area0");
		hideObject(hideObj);
	}
	if (getRef("area1"))
	{
		var hideObj = getRef("area1");
		hideObject(hideObj);
	}
	if (getRef("area2"))
	{
		var hideObj = getRef("area2");
		hideObject(hideObj);
	}
	if (getRef("area3"))
	{
		var hideObj = getRef("area3");
		hideObject(hideObj);
	}
	if (getRef("area4"))
	{
		var hideObj = getRef("area4");
		hideObject(hideObj);
	}
	if (getRef("area5"))
	{
		var hideObj = getRef("area5");
		hideObject(hideObj);
	}
	// None, block, inline or list-item
	showObject(getRef(pArea));
}

var selectArr = new Array();
function createProject(p1option)
{
	selectArr[p1option] = new Array();
}

function createTask(p1option, p2option, pvalue, ptask)
{
	selectArr[p1option][p2option] = new Array();
	selectArr[p1option][p2option][0] = pvalue;
	selectArr[p1option][p2option][1] = ptask;
}

function setSelect(pfirstObj, psecondObjId)
{
	var selectObj = getRef(psecondObjId);
	var ind = pfirstObj.selectedIndex;
	// zeroize existing list
	selectObj.options.length = 0;
	if (selectArr[ind])
		for (count = 0; count < selectArr[ind].length; count++)
		{
			selectObj.options[count] = new Option(selectArr[ind][count][1], selectArr[ind][count][0]);
		}
}

function selectAll()
{
	for(j=0; j<document.form1.elements.length; j++)
	{
		// if a multiple select box then select all items in the box so they are sent with the form
		var currObj = document.form1.elements[j];
			if (currObj.tagName == 'SELECT' && currObj.multiple == true)
				for (i=0; i<currObj.length; i++)
					currObj.options[i].selected = true;
	}
}

function addList(pFromObjId, pToObjId)
{
	var fromObj = getRef(pFromObjId);
	var toObj = getRef(pToObjId);

	// no point if nothing selected in from list
	if (fromObj.selectedIndex < 0)
		return;

	// see if already added
	//alert(fromObj.options[fromObj.selectedIndex].value);
	for (i=0; i<toObj.options.length; i++)
	{
		if (toObj.options[i].value == fromObj.options[fromObj.selectedIndex].value)
		{
			alert('You have already selected ' + toObj.options[i].text);
			return;
		}
	}
	// if not already there add it in
	if (fromObj.selectedIndex == -1)
	{
		alert('Please select an item on left');
		return;
	}
	{
		newindex = toObj.options.length;
		toObj.options[newindex] = new Option(fromObj.options[fromObj.selectedIndex].text);
		toObj.options[newindex].value = fromObj.options[fromObj.selectedIndex].value;
	}
}

function removeList(pToObjId)
{
	var toObj = getRef(pToObjId);
	if (toObj.selectedIndex > -1)
		toObj.options[toObj.selectedIndex] = null;
}

// Generic Layer Object Functions

// Make an object visible
function showObject(obj)
{
	if (isDOM)
		obj.style.display = "inline";
	else if (isNS4)
		obj.visibility = "show";
	else if (IE4plus)
		obj.visibility = "visible";
}

// Hides an object
function hideObject(obj)
{
	if (isDOM)
		obj.style.display = "none";
	else if (isNS4)
		obj.visibility = "hide";
	else if (IE4plus)
		obj.visibility = "hidden";
}

// Move a layer
function moveTo(obj,xL,yL)
{
	obj.style.left = xL;
	obj.style.top = yL;
}


//
// MouseTip Methods
//

function MouseTip_ShowNew()
{
	this.WriteLayer();
	this.Show();
}

function MouseTip_Hide()
{
	if ( (isNS4) || (IE4plus) && this.over)
	{
		this.snow = 0;
		hideObject(this.over);
	}
}

function MouseTip_Show()
{
	if ( (isNS4) || (IE4plus) )
	{
		if (this.snow == 0 )
		{
			if (this.dir == 2)
			{ // Center
				moveTo(this.over,this.x+MouseTip.offsetX-(MouseTip.width/2),this.y+MouseTip.offsetY);
			}
			if (this.dir == 1)
			{ // Right
				//moveTo(this.over,this.x+MouseTip.offsetX,this.y+MouseTip.offsetY);
				moveTo(this.over, document.body.clientWidth / 1.4,this.y+MouseTip.offsetY);
			}
			if (this.dir == 0)
			{ // Left
				moveTo(this.over,this.x-MouseTip.offsetX-MouseTip.width,this.y+MouseTip.offsetY);
			}
			showObject(this.over);
			this.snow = 1;
		}
	}
}


// Writes to a layer
function MouseTip_WriteLayer()
{
        if (isNS4)
        {
                var lyr = eval(MouseTip.divPath).document;
                lyr.write(this.txt);
                lyr.close();
        }
        else if (IE4plus && document.all["overDiv"])
			document.all["overDiv"].innerHTML = this.txt;
}

function MouseTip_AddTip(type, tipTitle, tipText, tipPlace)
{
	var tip = new Object();
	tip.type = type;
	tip.title = tipTitle;
	tip.text = tipText;
	tip.place = tipPlace;
	MouseTip.tips[MouseTip.tips.length] = tip;
}

function MouseTip_GetTip(type)
{
	var tip = null;

	for (i=0; i < MouseTip.tips.length; i++)
	{
		if (MouseTip.tips[i].type==type)
		{
			tip = MouseTip.tips[i];
			break;
		}
	}
	return tip;
}

function MouseTip(type,dir,x,y)
{
	this.x = x;
	this.y = y;
	this.snow = 0;
	this.dir = dir;
	this.over = getRef('overDiv');

	this.ShowNew = MouseTip_ShowNew;
	this.Hide = MouseTip_Hide;
	this.Show = MouseTip_Show;
	this.WriteLayer = MouseTip_WriteLayer;

	var tip = MouseTip.GetTip(type);
	if (tip) {
	this.txt = '<table WIDTH=' + MouseTip.width + ' BORDER=0 CELLPADDING=' + MouseTip.borderWidth +
		' CELLSPACING=0 BGCOLOR="' + MouseTip.borderColor + '"><tr><td>' +
		'<table WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="' + MouseTip.bgColor +
		'"><tr><td><img src="../images/quest.gif"></td>' +
		'<TD><strong>' + tip.title + '</strong>' +
		tip.text + '</td></tr></table></td></tr></table><p></p>';
	}
}


MouseTip.current = null;
MouseTip.tips = new Array();
MouseTip.bgColor = "#CCCCFF";
MouseTip.borderColor = "#42316B";
MouseTip.width = 200
MouseTip.borderWidth = 1;
MouseTip.offsetX = 10;
MouseTip.offsetY = 10;
MouseTip.divPath = "document.overDiv";

MouseTip.AddTip = MouseTip_AddTip;
MouseTip.GetTip = MouseTip_GetTip;


function ShowMouseTip(obj,triggerEvent)
{
	if (triggerEvent.srcElement) {
		var type = triggerEvent.srcElement.name;
		if ( (isNS4) || (IE4plus) )
		{
			var x = 0;
			var y = 0;
			if (isNS4) {x=triggerEvent.pageX; y=triggerEvent.pageY;}
			//if (IE4plus) {x=triggerEvent.clientX+document.body.scrollLeft; y=triggerEvent.clientY+document.body.scrollTop;}
			if (IE4plus) {x=getGrossOffsetLeft(triggerEvent.srcElement)+triggerEvent.srcElement.clientWidth; y=getGrossOffsetTop(triggerEvent.srcElement)-20;}
	//alert(triggerEvent.srcElement.clientWidth);
			if (tip = MouseTip_GetTip(type))
				{
				if (tip.place == "status")
					window.status = tip.text;
				else {
					MouseTip.current = new MouseTip(type,1,x,y);
					MouseTip.current.ShowNew();
				}
			}
		}
	}
}

function HideMouseTip(currObj, triggerEvent)
{
	if (triggerEvent.srcElement) {
		var name = triggerEvent.srcElement.name;
		if (MouseTip.current)
			MouseTip.current.Hide();
	}
}

function setHomePage()
{
	var thisurl = document.URL;
	if (document.all && document.getElementById)
		spanHomePage.setHomePage(thisurl);
	else if (document.layers && navigator.javaEnabled())
	{
		netscape.security.PrivilegeManager.enablePrivilege('UniversalPreferencesWrite');
		navigator.preference('browser.startup.homepage', thisurl);
	}
}

function addToFavourite()
{
	window.external.AddFavorite(document.URL,"Multi-Project");
}

function openPopOver( pUrl, pName, pWidth, pHeight, pScrollbars ) {

	if (!pScrollbars) pScrollbars = "no"

	str = "resizable=no,titlebar=no,title=no,dependant=yes,alwaysRaised=yes,hotkeys=no,";
	str += "scrollbars=" + pScrollbars + ",";
	str += "width=" + pWidth + ",";
	str += "height=" + pHeight + ",";

	if (window.screen)
	{
		var xc = ( screen.availWidth - 10 - pWidth ) / 2;
		var yc = ( screen.availHeight - 30 - pHeight ) / 2;

		str += "left=" + xc + ",screenX=" + xc + ",";
		str += "top=" + yc + ",screenY=" + yc;
	}
	window.open(pUrl, pName, str);
}

function closePopOver(pAction)
{
	var new_location;
	new_location = "" + opener.location; // Convert from URL to string.
	if (new_location.indexOf("&action") > 0)
		new_location = new_location.substring(0,new_location.indexOf("&action"));
	if (pAction != 'cancel') // Only recall master page if not cancelled.
		opener.location = new_location + "&action=" + pAction + "&target=" + getRef('sel001').value;
	window.close();
}
