/* Launch a Flash6 movie */
function launchFlash2(src, extraParams, background, width, height, scale) {
  var params = getInitParams();
  if (extraParams != "") {
    params = params + "&" + extraParams;
  }
  document.open();
  document.writeln("<HTML><HEAD><TITLE>");
  document.writeln("Learning Seat: " + src);
  document.writeln("</TITLE></HEAD>");
  document.writeln("<BODY BGCOLOR=" + background + " TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>");
  document.writeln("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ");
  document.writeln("  codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ");
  document.writeln("  WIDTH=" + width + " HEIGHT=" + height + ">")
  document.writeln("  <PARAM NAME=movie VALUE=\"" + src + ".swf?" + params + "\">");
  document.writeln("  <PARAM NAME=menu VALUE=false> ");
  document.writeln("  <PARAM NAME=quality VALUE=high> ");
  document.writeln("  <PARAM NAME=bgcolor VALUE=" + background + ">" );
  if (scale != "") {
    document.writeln("  <PARAM NAME=scale VALUE=" + scale + ">" );
  }
  document.writeln("<EMBED src=\"" + src + ".swf?" + params + "\" menu=false quality=high ");
  document.writeln("  bgcolor=" + background);
  document.writeln("  WIDTH=" + width + " HEIGHT=" + height);
  if (scale != "") {
    document.writeln("  SCALE=" + scale);
  }
  document.writeln("  TYPE=\"application/x-shockwave-flash\" ");
  document.writeln("PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">");
  document.writeln("</EMBED>");
  document.writeln("</OBJECT>");
  document.writeln("</BODY>");
  document.writeln("</HTML>");
  document.close();
}

function launchFlash(src, background) {
  launchFlash2(src, "", background, "100%", "100%", "");
}

function launchFlashFrame(src) {
  document.open();
  document.writeln("<HTML><HEAD><TITLE>");
  document.writeln(src);
  document.writeln("</TITLE>");
  document.writeln("</HEAD>");
  document.writeln("<FRAMESET ROWS=\"100%,*\" framespacing=\"0\" frameborder=\"0\" scrolling=\"no\">");
  document.writeln("  <FRAME SRC=\"" + src + "_flash.html" + document.location.search + "\">");
  document.writeln("  <FRAME SRC=\"empty.html\">");
  document.writeln("</FRAMESET>");
  document.writeln("<NOFRAMES>");
  document.writeln("<BODY onload=\"window.close()\"></BODY>");
  document.writeln("</NOFRAMES>");
  document.writeln("</HTML>");
  document.close();
}

function maximiseWindow() {
  if (window.top.resizeTo) {
    window.top.moveTo(0,0);
    window.top.resizeTo(screen.availWidth, screen.availHeight);
  }
}
