/******************************************************************************
	Title 			: DM3D Standard Script Header (dm3dhead.js)
	Programmer 		: Peter Newman
	Creation Date	: 30 Jan 2003
	Attached to 	: HTML Page

	DM3D Studio's Ply Ltd.
	P.O. Doc 278
	Maffra 3860, Victoria, Australia
	enquiry@dm3ds.com

NOTE:	This file contains some standard functions that we have found useful
		in a wide variety of situations.
		This file is for use in a webpage.

*******************************************************************************/

if( typeof(document.getObj) == 'undefined' )	// Prevent redefintion
{
	// Thank you to: http://www.xs4all.nl/~ppk/js/dhtmloptions.html
	function document.getObj(name)
	{
		retVal = undefined;
		if (document.getElementById)
		{
			retVal = document.getElementById(name);
		}
		else if (document.all)
		{
			retVal = document.all[name];
		}
		else if (document.layers)
		{
			retVal = document.layers[name];
			retVal.style = document.layers[name];
		}
		return retVal;
	}
}
window.getObj = document.getObj;

if( typeof(document.dump) == 'undefined' )
{
	//dump the values of any one object (from Adobe Atmosphere WorldInit.js)
	function document.dump(v)
	{
		docOut = window.open("", "dumpOut").document;
		docOut.open("text/plain");
		docOut.writeln("\nDump of an " + typeof(v) + ":");

		if (typeof(v) == "object")
		{
			for (i in v)
			{
				if (typeof(v[i]) == "function")
				{
					docOut.writeln("    " + i + ": FUNCTION");
				}
				else
				{
					docOut.writeln("    " + i + ": " + v[i]);
				}
			}
		}
		else
		{
			docOut.writeln("    Value: " + v);
		}
	}
}
window.dump=document.dump;

if( typeof(window.chatprint) == 'undefined' )
{
	//dump the values of any one object (from Adobe Atmosphere WorldInit.js)
	function window.chatprint(v)
	{
		docOut = window.open("", "chatOut").document;
		docOut.writeln(v + "<BR>");
	}
}

/*if( typeof( MTSPlugin.prototype.repeatSendJS ) == 'undefined' )
{
	function MTSPlugin.prototype.repeatSendJS( stringCommand, stringTestValue )
	{
		status="repeatSendJS( '" + stringCommand + "', '" + stringTestValue + "');";
		this.sendJS( "repeatSendJS( '" + stringCommand + "', '" + stringTestValue + "');");
	}
}*/
