document.assessIDForClass = function ( nameID )
//for( nameID in document.all )
{
	if( typeof(document.getObj) == 'undefined')
		return;
	
	if( nameID.substr(0, 6) == "button" || nameID.substr(0, 6) == "camera" || nameID.substr(0, 6) == "toggle")
	{
		if( nameID.substr(0, 6) == "button")
		{
			document.getObj(nameID).className = "styleButtonUp";
			document.getObj(nameID).onmousedown = function ()	{	this.className="styleButtonDown"; }
			document.getObj(nameID).onmouseup = function ()	{	this.className="styleButtonUp";	}
			document.getObj(nameID).onmouseout = function ()	{	this.className="styleButtonUp";	status="Done";}
		}
		else if( nameID.substr(0, 6) == "camera" )
		{
			document.getObj(nameID).className = "styleCameraUp";
			document.getObj(nameID).onmousedown = function ()	{	this.className="styleCameraDown"; }
			document.getObj(nameID).onmouseup = function ()	{	this.className="styleCameraUp";	}
			document.getObj(nameID).onmouseout = function ()	{	this.className="styleCameraUp";	status="Done";}
		}
		else if( nameID.substr(0, 6) == "toggle" )
		{
			document.getObj(nameID).className = "styleToggleUp";
			document.getObj(nameID).onmousedown = function ()	{	this.className="styleToggleDown"; }
			document.getObj(nameID).onmouseup = function ()	{	this.className="styleToggleUp";	}
			document.getObj(nameID).onmouseout = function ()	{	this.className="styleToggleUp";	status="Done";}
		}
		if( isNaN(parseInt(nameID.substr(6))) )
		{
			document.getObj(nameID).onmouseover = function ()
			{
				stringTemp =	"if( typeof(arrayObjManager) == 'object' )";
				stringTemp +=	"	if( typeof(arrayObjManager.getManagerByName('" + this.id + "')) != 'undefined' ) ";
				stringTemp +=	"		arrayObjManager.getManagerByName('" + this.id + "').associateID('" + this.id + "');";
				vmp1.sendJS(stringTemp);
				status = this.innerText;
			}

			if( nameID.substr(0, 6) == "button" || nameID.substr(0, 6) == "camera" )
			{
				document.getObj(nameID).onclick = function ()	
				{
					if( !this.enabled )
						return;
					stringTemp =	"if( typeof(arrayObjManager) == 'object' )";
					stringTemp +=	"	if( typeof(arrayObjManager.getManagerByName('" + this.id + "')) != 'undefined' ) ";
					stringTemp +=	"		arrayObjManager.getManagerByName('" + this.id + "').onClick();";
					vmp1.sendJS(stringTemp);
				}
			}
			else
			{
				document.getObj(nameID).onclick = function ()
				{
					if( !this.enabled )
						return;
					stringTemp =	"if( typeof(arrayObjManager) == 'object' )";
					stringTemp +=	"	if( typeof(arrayObjManager.getManagerByName('" + this.id + "')) != 'undefined' ) ";
					stringTemp +=	"		arrayObjManager.getManagerByName('" + this.id + "').toggleState();";
					vmp1.sendJS(stringTemp);
				}
			}
		} else
		{
			document.getObj(nameID).onmouseover = function () 
			{	
				stringTemp =	"if( typeof(arrayObjManager) == 'object' )";
				stringTemp +=	"	if( typeof(arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "')) != 'undefined' ) ";
				stringTemp +=	"		if( arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "').length != 0 ) ";
				stringTemp +=	"			if( typeof(arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "')[" + parseInt(this.id.substr(6)) + "]) != 'undefined' ) ";
				stringTemp +=	"				arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "')[" + parseInt(this.id.substr(6)) + "].associateID('" + this.id + "');";
				vmp1.sendJS(stringTemp);
				status = this.innerText;
			}

			if( nameID.substr(0, 6) == "button" || nameID.substr(0, 6) == "camera" )
			{
				document.getObj(nameID).onclick = function ()	
				{	
					stringTemp =	"if( typeof(arrayObjManager) == 'object' )";
					stringTemp +=	"		if( typeof(arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "')) != 'undefined' ) ";
					stringTemp +=	"			if( arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "').length != 0 ) ";
					stringTemp +=	"				if( typeof(arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "')[" + parseInt(this.id.substr(6)) + "]) != 'undefined' ) ";
					stringTemp +=	"					arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "')[" + parseInt(this.id.substr(6)) + "].onClick();";
					vmp1.sendJS(stringTemp);
				}
			}
			else
			{
				document.getObj(nameID).onclick = function ()
				{
					if( !this.enabled )
						return;
					stringTemp =	"if( typeof(arrayObjManager) == 'object' )";
					stringTemp +=	"	if( typeof(arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "')) != 'undefined' ) ";
					stringTemp +=	"		if( arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "').length != 0 ) ";
					stringTemp +=	"			if( typeof(arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "')[" + parseInt(this.id.substr(6)) + "]) != 'undefined' ) ";
					stringTemp +=	"				arrayObjManager.getManagersByType('" + this.id.substr(0,6) + "')[" + parseInt(this.id.substr(6)) + "].toggleState();";
					vmp1.sendJS(stringTemp);
				}
			}
		}
		document.getObj(nameID).enabled = true;
		return;
	}
	if(nameID.substr(0,8) == "movieAVI" )
	{
		document.getObj(nameID).className = "styleMovieAVIUp";
		document.getObj(nameID).onmouseover = function ()	{	status="AVI format movie file"; }
		document.getObj(nameID).onmousedown = function ()	{	this.className="styleMovieAVIDown"; }
		document.getObj(nameID).onmouseup = function ()	{	this.className="styleMovieAVIUp";	}
		document.getObj(nameID).onmouseout = function ()	{	this.className="styleMovieAVIUp"; status="Done"; }
		document.getObj(nameID).onclick = function ()	
		{	
			wndMovie = window.open(this.src, "wndMovie");
			wndMovie.focus();
		}
		return;
	}
	if(nameID.substr(0,8) == "movieMOV" )
	{
		document.getObj(nameID).className = "styleMovieMOVUp";
		document.getObj(nameID).onmouseover = function ()	{	status="MOV format movie file"; }
		document.getObj(nameID).onmousedown = function ()	{	this.className="styleMovieMOVDown"; }
		document.getObj(nameID).onmouseup = function ()	{	this.className="styleMovieMOVUp";	}
		document.getObj(nameID).onmouseout = function ()	{	this.className="styleMovieMOVUp"; status="Done";	}
		document.getObj(nameID).onclick = function ()	
		{	
			wndMovie = window.open(this.src, "wndMovie", "width=500,height=310");
			wndMovie.focus();
		}
		return;
	}
	if(nameID.substr(0,6) == "screen" )
	{
		document.getObj(nameID).className = "styleScreenUp";
		document.getObj(nameID).onmouseover = function ()	{	status = "Popup photo"; }
		document.getObj(nameID).onmousedown = function ()	{	this.className="styleScreenDown"; }
		document.getObj(nameID).onmouseup = function ()	{	this.className="styleScreenUp";	}
		document.getObj(nameID).onmouseout = function ()	{	this.className="styleScreenUp";	status="Done";}
		document.getObj(nameID).innerHTML = "<img src='" + (typeof(document.getObj(nameID).base)=='undefined'?'':document.getObj(nameID).base) + "tn" + document.getObj(nameID).src + "'>";
		document.getObj(nameID).onclick = function ()	
		{	
			wndScreen = window.open("", "wndScreen", "alwaysRaised");
			wndScreen.document.open();
			wndScreen.document.writeln("<html><head><title>" + this.src + "</title></head><body topmargin=0 leftmargin=0><img src='" + (typeof(document.getObj(nameID).base)=='undefined'?'':document.getObj(nameID).base) + this.src + "' onload='window.resizeTo(this.width+4, this.height+20)'></body></html>");
			wndScreen.focus();
		}
		return;
	}
	if(nameID.substr(0,5) == "hyper" )
	{
		document.getObj(nameID).className = "styleHyperUp";
		document.getObj(nameID).onmouseover = function ()	{	status="Link to " + this.innerText; }
		document.getObj(nameID).onmousedown = function ()	{	this.className="styleHyperDown"; }
		document.getObj(nameID).onmouseup = function ()	{	this.className="styleHyperUp";	}
		document.getObj(nameID).onmouseout = function ()	{	this.className="stylehyperUp";	status="Done";}
		document.getObj(nameID).onclick = function ()	
		{	
			wndHyper = window.open(this.src, "wndHyper");
			wndHyper.focus();
		}
		return;
	}
	if(nameID == "header1" )
	{
		document.getObj(nameID).onmouseover = function ()	
		{
			status = "Return to Digital Space Commons.";
		}
		document.getObj(nameID).onmousedown = function ()	
		{
			this.style.background = "url(skin/skin_1x1d.jpg)";
		}
		document.getObj(nameID).onmouseup = function ()
		{
			this.style.background = "url(skin/skin_1x1.jpg)";
		}
		document.getObj(nameID).onmouseout = function ()
		{
			this.style.background = "url(skin/skin_1x1.jpg)";
			status="Done";
		}
		document.getObj(nameID).onclick = function ()	
		{	
			wndHeader1 = window.open("http://www.digitalspace.com", "wndHeader1");
			wndHeader1.focus();
		}
		return;
	}
	if( nameID == "closeWindow" )
	{
		document.getObj(nameID).onmouseover = function ()	
		{
			status = "Close this window. Press the Alt key if the window appears to lock up.";
		}
		document.getObj(nameID).onmousedown = function ()	
		{
			this.className="styleButtonDown";
		}
		document.getObj(nameID).onmouseup = function ()
		{
			this.className="styleButtonUp";
		}
		document.getObj(nameID).onmouseout = function ()
		{
			this.className="styleButtonUp";
			status="Done";
		}
		document.getObj(nameID).onclick = function ()	
		{	
			if(typeof(wndControlPanel) != 'undefined')
				if( !wndControlPanel.closed )
					wndControlPanel.close();
			window.close();
		}
		return;
	}
	if( nameID == "controlPanel" )
	{
		document.getObj(nameID).onmouseover = function ()	
		{
			status = "Show extra buttons.";
		}
		document.getObj(nameID).onmousedown = function ()	
		{
			this.className="styleButtonDown";
		}
		document.getObj(nameID).onmouseup = function ()
		{
			this.className="styleButtonUp";
		}
		document.getObj(nameID).onmouseout = function ()
		{
			this.className="styleButtonUp";
			status="Done";
		}
		document.getObj(nameID).onclick = function ()	
		{	
			window.showControlPanel();
		}
		return;
	}
	if( nameID.substr(0,13)  == "sliderControl" )
	{
		document.getObj(nameID).className = "styleSlider";
	}
	if( nameID.substr(0,7) == "heading" )
		document.getObj(nameID).className = "styleHeading";
	if( nameID.substr(0,7) == "counter" )
		document.getObj(nameID).className = "styleCounter";
	if( nameID.substr(0, 8) == "progress" && nameID.substr(nameID.length-6) != "_front")
	{
		document.getObj(nameID).className = "styleProgressBack";
		document.getObj(nameID).innerHTML = "<div id='" +nameID+ "_front' class='styleProgressFront' style='width:0;'>" + document.getObj(nameID).innerHTML + "</div>";
		document.getObj(nameID).remoteChange = function( fValue )
		{
			document.getObj(this.id+"_front").style.width = (fValue * 100) + "%";
		}
	}
	if( nameID == "progressLoading")
	{
		document.getObj(nameID).className = "styleLoadProgressBack";
		document.getObj(nameID).innerHTML = "<div id='" +nameID+ "_front' class='styleLoadProgressFront' style='width:0;'>" + document.getObj(nameID).innerHTML + "</div>";
		document.getObj(nameID).remoteChange = function( fValue )
		{
			document.getObj(this.id+"_front").style.width = (fValue * 100) + "%";
		}
	}
}

for( nameID in document.all )
	document.assessIDForClass( nameID );

window.arrayToggle = new Array();
function addToggleControl( ID, innerText)
{
	window.arrayToggle.push([ID, innerText]);
}

function window.showControlPanel ()
{
	window.wndControlPanel = open("", "wndControlPanel"/*,"width=100"*/);
	window.wndControlPanel.document.open();
	window.wndControlPanel.document.writeln('<html><head><title>Control Panel</title>');
	window.wndControlPanel.document.writeln('<LINK REL=StyleSheet HREF="skin/skin.css" type="text/css">');
	window.wndControlPanel.document.writeln('<script language="javascript" type="text/javascript" src="dm3dhwww.js"><\/script>' );
	window.wndControlPanel.document.writeln('<script src="skin/SliderControl.js"><\/script>');
	window.wndControlPanel.document.writeln('<script>vmp1 = window.opener.vmp1;<\/script>');
	window.wndControlPanel.document.writeln('<link REL=StyleSheet HREF="skin/SliderControl.css" type="text/css"></head>');
	window.wndControlPanel.document.writeln('<body style="background:#A5B5FF;"><table border="0" cellpadding="0" cellspacing="0" width="80" align=center><tr>');
	for( i = 0; i < arrayToggle.length; i++ )
	{
		window.wndControlPanel.document.writeln('<td id=toggle' + arrayToggle[i][0] + ' style=styleToggle><img src="skin/skin_led0.jpg" align=left>' + arrayToggle[i][1] + '</td></tr>');
	}
	if( typeof(window.addExtraControlButtons) == 'function' )
		window.addExtraControlButtons(window.wndControlPanel.document);

	window.wndControlPanel.document.writeln('</table></body><script language="javascript" src="skin/dm3dskin.js"><\/script>');
	window.wndControlPanel.document.writeln('<script>window.resizeTo(100, 479);window.moveTo(' + (document.getObj('rside1').offsetLeft+window.screenLeft+5) + ',' + (document.getObj('rside1').offsetTop+window.screenTop+5) + ')<\/script></html>');

	window.wndControlPanel.focus();
}

new Image().src="skin/skin_b1d.jpg";
new Image().src="skin/skin_b2d.jpg";
new Image().src="skin/skin_b3d.jpg";
new Image().src="skin/skin_linkd.jpg";

window.resizeTo(830, 775);

//document.dump(document);
