// QTplugin.js
// mitch@lecture123.com 20061021
//
// need this javascript magic in order for MSIE to load the QuickTime
// plugin player without prompting the user to activate the controls
//
// usage: QTplugin(src, height, width)
//
// two "tricks" are required:
//
// 1. instructions on using <object>...<embed> for MSIE
// http://developer.apple.com/documentation/QuickTime/Conceptual/QTScripting_HTML/QTScripting_HTML_Document/chapter_1000_section_2.html
//
// 2. instructions on how to put this javascript code in a separate file
//    to activate the controls in the plugin automatically without any
//    user interaction. this eliminates the plugin popup in MSIE
//    "Press SPACEBAR or ETNER to activate and use this control"
// http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp


function QTplugin(src, height, width)
{
  document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"')
  document.write(' codebase="http://www.apple.com/qtactivex/qtplugin.cab"');
  document.write(' height="' + height + '"');
  document.write(' width="'  + width  + '">');

  document.write('<param name="src" value="' + src + '">');
  document.write('<param name="controller" value="true">');
  document.write('<param name="loop" value="false">');
  document.write('<param name="autoplay" value="true">');
  document.write('<param name="kioskmode" value="true">');

  document.write('<embed src="' + src + '"');
  document.write(' height="' + height + '"');
  document.write(' width="'  + width  + '"');
  document.write(' type="video/quicktime"');
  document.write(' pluginpage="http://www.apple.com/quicktime/download/"');
  document.write(' controller="true"');
  document.write(' loop="false"');
  document.write(' autoplay="true"');
  document.write(' kioskmode="true"/>');
  document.write('</object>');
}
