function GetId(id){
	if(ie4)	return document.all[id];
	else return document.getElementById(id);
};
	
function _jrfhhg(_A__,result){
	window.location.href=window.location;
};

var O=0;
function _f__(){
	var _x__=_l__();
	if(_x__==false){
		O++;if(O>20){
			O=0;
			_k__();
		}
		setTimeout('_f__()',500);
	}
	else{
		window.location.href=window.location;
	}
};

function _g__(){
	var _r__=TNTDoCommand(GetId("doCommandEdit").value);
	if(_r__)GetId("returnval").innerHTML='Return Value = "'+_r__+'"';
	else GetId("returnval").innerHTML="";
};

function _e__(_o_Yr3g,_w__){
	if(!_w__)_w__=2000;
	var currentCamera=TNTDoCommand('CameraCtrl.GetCurrent()');
	var _s__=TNTDoCommand('Objects('+currentCamera+').GetParentNodeIndex()');
	var desParentNodeIdx=TNTDoCommand('Objects('+_o_Yr3g+').GetParentNodeIndex()');
	if(_s__==desParentNodeIdx)TNTDoCommand('CameraCtrl.Match("'+_o_Yr3g+'",'+_w__+')');
	else TNTDoCommand('CameraCtrl.SetCurrent("'+_o_Yr3g+'")');
};

var movemode=0;
function OnMouseEnter(_q__){
	if(movemode==1){
		if(!moving){
			TNTDoCommand('Objects('+_q__+').SetSelected(1)');
			//TNTDoCommand('Objects('+_q__+').SetVisible(1)');
		}
	}
};

function OnMouseExit(_q__){
	if(movemode==1){
		TNTDoCommand('SceneGraph.Objects('+_q__+').SetSelected(0)');
		//TNTDoCommand('SceneGraph.Objects('+_q__+').SetVisible(0)');
	}
};

var moving=false;
function OnMoveStart(){
	moving=true;
	TNTDoCommand('CameraCtrl.SetIgnoreInput(1)');
};

function OnMoveEnd(){
	moving=false;
	TNTDoCommand('CameraCtrl.SetIgnoreInput(0)');
};

function _c_mmf4(on,cameraout){
	if(on){
		_a__(3);
		_e__('Camera01',500);
		TNTDoCommand('SceneGraph.Objects("Cylinder*").SetMouseOverEvent(1)');
		TNTDoCommand('SceneGraph.Objects("Cylinder*").SetOcclusion(1)');
		TNTDoCommand('Selection.SetMoveDirectionX(0)');
		TNTDoCommand('Selection.SetMoveDirectionY(0)');
		//TNTDoCommand('Selection.SetMoveDirectionZ(0)');
		TNTDoCommand('Selection.SetLeftMode(1)');
		TNTDoCommand('Selection.SetRightMode(5)');
		movemode=1;
	}
	else{
		TNTDoCommand('SceneGraph.Objects("Cylinder*").SetMouseOverEvent(0)');
		TNTDoCommand('SceneGraph.Objects("Cylinder*").SetOcclusion(0)');
		TNTDoCommand('CameraCtrl.SetIgnoreInput(0)');
		_a__(3);
		_e__('Camera01',500);movemode=0;
	}
};

function _a__(nbr){
	var _C__=0;
	var _E__=0;
	for(i=1;i<=nbr;i++){
		_C__+=parseInt(TNTDoCommand("SceneGraph.Objects('*"+i+"').GetPositionWorldX()"));
		_E__+=parseInt(TNTDoCommand("SceneGraph.Objects('*"+i+"').GetPositionWorldY()"));
	}
	_C__/=nbr;
	_E__/=nbr;
	TNTDoCommand("SceneGraph.Objects('Dummy02').SetPositionWorld("+_C__+","+_E__+",0)'");
} 

