function updateusername()
{
	document.forms.theform.username.value = document.forms.theform.firstname.value[0] + document.forms.theform.lastname.value;
	document.forms.theform.username.value = document.forms.theform.username.value.toLowerCase();
}

function cell(d)
{
	if (document.getElementById)
		return document.getElementById(d);
	else
		return document.all[d];
}

function hover(c,status,select,bar)
{
	if (bar=='top')
	{
		if (status==1)
		{
			if (select==0)
			{
				cell(c).className = "hover";
			}
			else
			{
				cell(c).className = "hover1";
			}
		}
		else
		{
			if (select==0)
			{
				cell(c).className = "off";
			}
			else
			{
				cell(c).className = "select";
			}
		}
	}
	else
	{
		if (status==1)
		{
			if (select==0)
			{
				cell(c).className = "shover";
			}
			else
			{
				cell(c).className = "shover1";
			}
		}
		else
		{
			if (select==0)
			{
				cell(c).className = "soff";
			}
			else
			{
				cell(c).className = "sselect";
			}
		}
	}
}

function forward(url)
{
	window.location.href=url;
}

function setPointer(theRow, theAction, objectid, previous)
{
    var theCells = null;
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }
    var rowCellsCnt  = theCells.length;
    var c = null;
    if (theAction=='over')
    {
		for (c = 0; c < rowCellsCnt; c++)
		{
			theCells[c].className="listhover";
		}
	}
	else if (theAction=='out')
	{
		for (c = 0; c < rowCellsCnt; c++)
		{
			theCells[c].className=previous;
		}
	}
	else if (theAction=='click')
	{
		for (c = 0; c < rowCellsCnt; c++)
		{
			theCells[c].className="listclick";
		}
		document.getElementById('objectid').value=objectid;
		document.forms['form1'].submit();
	}
    return true;
}



var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;

d = document;
n = navigator;
na = n.appVersion;
nua = n.userAgent;
win = ( na.indexOf( 'Win' ) != -1 );
mac = ( na.indexOf( 'Mac' ) != -1 );
lin = ( nua.indexOf( 'Linux' ) != -1 );

if ( !d.layers ){
	dom = ( d.getElementById );
	op = ( nua.indexOf( 'Opera' ) != -1 );
	konq = ( nua.indexOf( 'Konqueror' ) != -1 );
	saf = ( nua.indexOf( 'Safari' ) != -1 );
	moz = ( nua.indexOf( 'Gecko' ) != -1 && !saf && !konq);
	ie = ( d.all && !op );
	ie4 = ( ie && !dom );
	ie5x = ( d.all && dom );
	ie5mac = ( mac && ie5x );
	ie5xwin = ( win && ie5x );
}

function browser_detect( ) {
	d = document;
	if ( ie5mac ) {
		 window.location="macie.php";
	}
}
