// load X3D standard emcpdomgs examples 10/21/2006

var windowObjectReference = null; 

var CurrentX3dScene = 'start'; 

var sceneFile = new Array(
"RedSphereBlueBox.x3d", "RedSphereBlueBox.x3dv",
"Instancing.x3d", "Instancing.x3dv",
"Prototype.x3d", "Prototype.x3dv",
"Scripting.x3d", "Scripting.x3dv",
"GeometricProperties.x3d", "GeometricProperties.x3dv",
"PrototypesPlus.x3d", "PrototypesPlus.x3dv",
"DirectionalLight.x3d", "DirectionalLight.x3dv",
"PointSet.x3d", "PointSet.x3dv",
"LevelOfDetail.x3d", "LevelOfDetail.x3dv",
"ColorInterpolator.x3d", "ColorInterpolator.x3dv",
"ClickToAnimate.x3d", "ClickToAnimate.x3dv",
"AlarmClock.x3d", "AlarmClock.x3dv",
"ShuttlesAndPendulums.x3d", "ShuttlesAndPendulums.x3dv",
"Robot.x3d", "Robot.x3dv",
"Chopper.x3d", "Chopper.x3dv",
"GuidedTour.x3d", "GuidedTour.x3dv",
"Elevator.x3d", "Elevator.x3d",
"ExecutionModel.x3d", "ExecutionModel.x3dv"
)

var sceneMessage = new Array(
"RedSphereBlueBox.x3d", "RedSphereBlueBox.x3dv",
"Instancing.x3d", "Instancing.x3dv",
"Prototype.x3d", "Prototype.x3dv",
"Scripting.x3d", "Scripting.x3dv",
"GeometricProperties.x3d", "GeometricProperties.x3dv",
"PrototypesPlus.x3d", "PrototypesPlus.x3dv",
"DirectionalLight.x3d", "DirectionalLight.x3dv",
"PointSet.x3d", "PointSet.x3dv",
"LevelOfDetail.x3d", "LevelOfDetail.x3dv",
"ColorInterpolator.x3d", "ColorInterpolator.x3dv",
"ClickToAnimate.x3d", "ClickToAnimate.x3dv",
"AlarmClock.x3d", "AlarmClock.x3dv",
"ShuttlesAndPendulums.x3d", "ShuttlesAndPendulums.x3dv",
"Robot.x3d", "Robot.x3dv",
"Chopper.x3d", "Chopper.x3dv",
"GuidedTour.x3d", "GuidedTour.x3dv",
"Elevator.x3d", "Elevator.x3d",
"ExecutionModel.x3d", "ExecutionModel.x3dv"
)

function updatex3dContent(scene,txt) { 
  var model = 'model'
  CurrentX3dScene = scene;
// var directory = 'x3djoe/';
// var file = directory + txt + sceneFile[scene];
  if (scene % 2) 
    (model = 'model/x3d+xml');
    else
    (model = 'model/x3d+vrml');
 var file = txt + sceneFile[scene];
 if (window.ActiveXObject)
 {
  document.getElementById('x3dscene').src = file; // IE
 }
 else
 {
  document.getElementById('x3dscene').data = file; // Ff
 }
 var fileTitle = ' <strong><em>'+ txt + sceneFile[scene] +'</em></strong>';
 document.getElementById('x3dtitle').innerHTML = 'Now Showing: ' + fileTitle + '';
}



function x3dContent(scene) {
if (window.ActiveXObject)
{
// browser supports ActiveX/IE API and specifies FluxPlayer
  document.write('<object id="x3dscene" class="x3dexample" type="model/x3d+xml"');
  document.write('classid="clsid:918B202D-8E8F-4649-A70B-E9B178FEDC58"');
  document.write('codebase="http://mediamachines.com/download/SetupFluxPlayer.exe">');
  document.write('<param name="src" value="' + scene + '">');
  document.write('<param name="DASHBOARD" value="0">');
  document.write('<div>Got .X3D?</div>');
  document.write('</object>');
}
else
{
// browser supports Firefox/Netscape Plugin API.
  document.write('<object id="x3dscene" class="x3dexample" type="model/x3d+xml"');
  document.write(' codebase="http://mediamachines.com/download/SetupFluxPlayer.exe">');
  document.write('<param name="src" value="' + scene + '">');
  document.write('<param name="DASHBOARD" value="0">');
  document.write('<div>Got .X3D?</div>');
  document.write('</object>');
}
}
 
function x3dContentTitle(scene) {
  document.write('<div ID="x3dtitle">Now Showing: <strong><em>' + scene + '</em></strong></div>');
}

function LoadLogoObjx3dv() {
  document.write('<small>..&lt;=&gt;...</small><br>');
  document.write('<object ID="objx3dv" class="logoUsingx3d" type="model/vrml">');
  document.write('<param name="src" value="Logo2x3d/Logo.x3dv">');
  document.write('<param name="DASHBOARD" value="FALSE">');
  document.write('<param name="PrimitiveQuality" value="HIGH">');
  document.write('<param name="antialias" value="TRUE">');
  document.write('<PARAM name="RightMouseMenu" value="FULL">');
  document.write('<strong><em>Got X3D?</em></strong>');
  document.write('</object><br>');
}

function clickTo() {
  document.write('<strong><em>Click Numbered Button to Interact with: </em></strong>');
}

function overTitle(scene) {
 var fileTitle = ' <strong><em>'+ sceneFile[scene] +'</em></strong>';
 document.getElementById('x3dNext').innerHTML='<strong><em>Click Numbered Button to Interact with: ' + fileTitle + '</em></strong>';
}

function offTitle() {
 document.getElementById('x3dNext').innerHTML='<strong><em>Click Numbered Button to Interact with: </em></strong>';
}

function messagex3dExample() {
//  var x3dMessage='emptyofmessage';
//  if (CurrentX3dScene == 'start') 
//    (x3dMessage = 'Yes, a real VRML .wrl file');
//    else
//    (x3dMessage = sceneMessage[CurrentX3dScene]);
//
// document.getElementById('x3dNext').innerHTML = x3dMessage;
}

function offTitle2() {
 document.getElementById('x3dNext').innerHTML='<strong><em>Click Numbered Button to Interact with: </em></strong>';
}

function newWindowx3dContent() {
 var winparams = 'width=475,height=340,resizable=yes';
 windowObjectReference = window.open('zglass9.wrl','stdx3dExample',winparams);
}

function showDefaultLinks() {
 document.getElementById("newX3dDefault").style.display="none";
 document.getElementById("standardLinks").style.display="block";
}

function Windowx3dContent(scene,txt) { 
 var file = 'x3dstd/' + txt + sceneFile[scene];
 var winparams = 'width=475,height=340,resizable=yes';
 windowObjectReference = window.open(file,'stdx3dExample',winparams);
}





