function SG_getFileName( sPathName )
{

/*
* Returns the filename of the current file
**/

	var sFileName = "";

	var sSeperator     = ( sPathName.lastIndexOf( "/" ) > 1 ) ? "/": "\\";
	var iFileNameStart = sPathName.lastIndexOf( sSeperator );
	sFileName          = sPathName.substr( iFileNameStart + 1 );
	sFileName          = sFileName.replace( /\.htm(l)?/, "" );

	return sFileName;

}

function SG_swapImage( oImage, sPath, sName )
{

	var sFileName  = SG_getFileName( location.pathname );
	var aFileData  = sName.split( /_/ );
	var bSwapImage = true;

	if ( aFileData.length > 1 )
	{
		if ( aFileData[0] == sFileName ) { bSwapImage = false; }
	} else {
		if ( sName.replace( /\.jpg/, "" ) == sFileName ) { bSwapImage = false; }
	}

	if ( bSwapImage ) { oImage.src = sPath + sName; }

}

function SG_navImageControl( )
{
	var oImage = document.getElementById( SG_getFileName( location.pathname ) );
	if ( oImage != null ) { oImage.src = oImage.src.replace( /\.jpg/, "_over.jpg" ); }
}

function setMailTo( sUser, sHost, sExt )
{
  location.href = 'mailto:' + sUser + '@' + sHost + '.' + sExt;
}