var cache = new Object();

function getObject( objectName )
{
	var shortName = objectName;
	while( shortName.indexOf(' ') != -1 )
	{
		shortName = shortName.replace( ' ', '' );
	}
	var tmp = eval( 'cache.' + shortName );
//	alert( tmp );
	if( tmp == undefined )
	{
		tmp = getDocObject( document, objectName );
		eval( 'cache.' + shortName + ' = tmp' );
	}
	return( tmp );
}

function getDocObject( doc, objectName )
{
	var tmpObj;
	if( doc.getElementById )
	{
		tmpObj = doc.getElementById( objectName );
		if( tmpObj == null )
		{
			tmpObj = doc.getElementsByName( objectName )[0];
		}
	}
	else if( doc.all != undefined )
	{
		tmpObj = doc.all[objectName];
	}
	return( tmpObj );
}

function getFrameDoc( frameName )
{
	return( getDocFrameDoc( document, frameName ) );
}

function getDocFrameDoc( doc, frameName )
{
	var tmpObj;
	tmpObj = getDocFrame( doc, frameName );
	if( tmpObj.contentWindow )
	{
		tmpObj = tmpObj.contentWindow;
	}
	return( tmpObj );
}

function getFrame( frameName )
{
	return( getDocFrame( document, frameName ) )
}

function getDocFrame( doc, frameName )
{
	var tmpFrm;
	if( document.frames )
	{
		tmpFrm = document.frames[frameName];
	}
	else
	{
		tmpFrm = doc.getElementById( frameName );
	}
	return( tmpFrm );
}

function setFrameLocation( frameName, newPath )
{
	setFrameObjLocation( getFrame(frameName), newPath );
}

function setFrameObjLocation( theFrame, thePath )
{
	// If IE
	if( theFrame.location )
	{
		theFrame.location = thePath;
	}
	else // Netscape
	{
		theFrame.contentDocument.location.href = thePath;
	}
}
