<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head >
<script type="text/javascript" src="apiwrapper.js"></script>

<script type="text/javascript">
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1){
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub MainPreloader_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call MainPreloader_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
}

function enableTTS(){
  if (navigator.appName.indexOf("Microsoft") != -1){
    VoiceObj = new ActiveXObject("Sapi.SpVoice");
  }
}

function MainPreloader_DoFSCommand(command, args){
  if (command == "messageBox"){
    alert(args);
    return true;
  }

  if (command == "speak"){
    VoiceObj.Speak(args, 3); //params = 3: 1 for asynch and 2 for purge existing (see below)
  }

  if (command == "resize"){ 
    document.getElementById("sco").style.width = args.substr(0, args.indexOf(","))+"px";
    document.getElementById("sco").style.height = args.substr(args.indexOf(",") + 1, args.length)+"px";
  }

  if (command == "fullscreen"){
    document.getElementById("sco").style.width = "100%";
    document.getElementById("sco").style.height = "100%";
  }

  if (command == "stopTTS"){
    VoiceObj.Speak('', 2); //params 2 to purge existing voices
  }
}
</script>
<title>SCO Example</title>
<body onload = "initialise();" onunload = "finish();" style="margin:0; width:100%; height:100%; min-height:100%;">
 
<div style="min-height:100%; width:100%; height:100%;">

<script type="text/javascript" language="JavaScript">

function launchwin(winurl,winname,winfeatures){
    //This launches a new window and then
    //focuses it if window.focus() is supported.
    newwin = window.open(winurl,winname,winfeatures);
}

function getLocation(){
  var loc = document.location.toString();
  loc = loc.substr(0, loc.lastIndexOf('/') + 1);
  return loc;
}
var FileLocation = getLocation();

rloFile = 'learningobject.rlo';
rloWidth = 800;
rloHeight = 800;
scorm = 'true';
browser = 'ie';
</script>

<script type="text/javascript" src = "flash.js"></script>

<script name="APIWRapperFunctions" type="text/javascript">

var MainPreloader = document.getElementById("MainPreloader");

function initialise(){
    //find and returns the API starting with this window
   doLMSInitialize()
}

function getValue(elementName){
  var result = String(doLMSGetValue(elementName));
  return result;
}

function setValue(elementName, value){
  alert("Hola, estoy en setValue");
  var result = doLMSSetValue(elementName, value);
  return result;
}

function finish(){
    doLMSFinish();
}

</script>

</div>
</body>
</html>