<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>Violet Online</title>
  <style>html, body {height: 100%; margin: 0; padding: 0;}</style>
</head>
<script type="text/javascript" language="JavaScript">
<!--//

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var g_Flash = null;
var g_cbData = "";

function InitViolet() {
  //g_Flash = isInternetExplorer ? LectorEditorOnline : document.LectorEditorOnline;
	g_Flash = document.getElementById('LectorEditorOnline');
}

function GetClipboardItem() {
  var cbData = window.clipboardData? window.clipboardData.getData('Text'): g_cbData;
  g_Flash.SetVariable("clipboardData", cbData);
  g_Flash.SetVariable("command", "Get Text");
}

function SetClipboardItem(args) {
  if (window.clipboardData) window.clipboardData.setData('Text', args);
  else g_cbData = args;
  g_Flash.SetVariable("command", "Set OK");
}

function SetWindowTitle(fileName) {
  if (fileName == "") document.title = "Violet Online";
  else {
    var docName = fileName.substring(0, fileName.length - 4);
    document.title = "Violet Online - " + docName;
  }
}

function SetWindowState() {
  var full = (g_Flash.width == "100%");
  g_Flash.width  = full? "800": "100%";
  g_Flash.height = full? "580": "100%";
}

// Handle all the FSCommand messages in a Flash movie.
function LectorEditorOnline_DoFSCommand(command, args) {
  switch (command) {
    case "Set Title": SetWindowTitle(args); break;
    case "Get Clipboard": GetClipboardItem(); break;
    case "Set Clipboard": SetClipboardItem(args); break;
    case "Set State": SetWindowState(); break;
    case "Quit": window.open('','_self').close(); break;
    case "trace": alert(args); break;
  }
}

// Hook for Internet Explorer.
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 LectorEditorOnline_FSCommand(ByVal command, ByVal args)\n');
  document.write('  Call LectorEditorOnline_DoFSCommand(command, args)\n');
  document.write('End Sub\n');
  document.write('</script\>\n');
}

//-->
</script>
<?php $langParam = $_REQUEST['language']? '&language='.$_REQUEST['language']: '' ?>
<?php $flashVars = 'online=true&applicationId=Violet Online' ?>
<?php $flashVars.= '&commonLibList=sxIOE3.xml,sxIOE4.xml,sxIOE5.xml,tnIOE3.xml,tnIOE4.xml,tnIOE5.xml' ?>
<?php $flashVars.= '&youtubeUrl=Service/fake_youtube.php'.$langParam.'&command=Init OK' ?>
<body bgcolor="#ffffff" onload="InitViolet()">
  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="LectorEditorOnline">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="Lecture/LectureEditor.swf" />
    <param name="flashVars" value="<?php echo $flashVars ?>">
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="Lecture/LectureEditor.swf" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="LectorEditorOnline" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashVars="<?php echo $flashVars ?>"/>
  </object>
</body>
