// included JavaScript functions for making media launch buttons
function popup(pres,image,w,h,mode) {
  thestring="./flashtv/popup.php?pres="+pres+"&image="+image+"&w="+w+"&h="+h+"&mode="+mode;
  theparams="directories=no,toolbar=no,location=no,height="+h+",width="+w+",scrollbars=no,left=10,top=10";
  newwindow=window.open(thestring, "Slide", theparams);
  if (window.focus) {
    newwindow.focus();
  }
}
function drawQuickTimeButton (width,height,url,objectCode) {
  // normal QuickTime button
  document.write('<object classid="'+objectCode+'" border="0" width="'+width+'" height="'+height+'">');
  document.write('<param name="SRC" value="'+url+'">');
  document.write('<param name="autoplay" value="false">');
  document.write('<param name="loop" value="false">');
  document.write('<param name="playeveryframe" value="false">');
  document.write('<param name="controller" value="false">');
  document.write('<param name="cache" value="false">');
  document.write('<embed src="'+url+'" width="'+width+'" height="'+height+'" autoplay="false" controller="false" cache="false" pluginspage="http://www.apple.com/quicktime/download/" loop="false" playeveryframe="false"></embed>');
  document.write('</object>');
}
function drawNewQuickTimeButton (width,height,url,targeturl,objectCode) {
  // normal QuickTime button
  document.write('<object classid="'+objectCode+'" border="0" width="'+width+'" height="'+height+'">');
  document.write('<param name="SRC" value="'+url+'">');
  document.write('<param name="autoplay" value="false">');
  document.write('<param name="loop" value="false">');
  document.write('<param name="playeveryframe" value="false">');
  document.write('<param name="controller" value="false">');
  document.write('<param name="cache" value="false">');
  document.write('<param name="href" value="'+targeturl+'">');
  document.write('<param name="target" value="QuickTimePlayer">');
  document.write('<param name="type" value="video/quicktime">');
  document.write('<embed src="'+url+'" width="'+width+'" height="'+height+'" autoplay="false" controller="false" cache="false" pluginspage="http://www.apple.com/quicktime/download/" loop="false" playeveryframe="false" href="'+targeturl+'" target="QuickTimePlayer" type="video/quicktime"></embed>');
  document.write('</object>');
}
function drawQuickTimeXButton (width,height,url,html,targeturl,objectCode) {
  // QuickTime button to support QuickTIme X changes which don't work with the .mov button that is
  // scripted (wired Sprites) instead this uses an image (ideally a .gif) loaded into the QuickTime plugin
  // Should work fine for all other users (older QT and Windows/Mac OS)
  document.write('<object classid="'+objectCode+'" border="0" width="'+width+'" height="'+height+'">');
  document.write('<param name="src" value="'+url+'">');
  document.write('<param name="qtsrc" value="'+html+'">');
  document.write('<param name="qtsrcdontusebrowser" value="true">');
  document.write('<param name="autoplay" value="false">');
  document.write('<param name="loop" value="false">');
  document.write('<param name="playeveryframe" value="false">');
  document.write('<param name="controller" value="false">');
  document.write('<param name="cache" value="false">');
  document.write('<param name="href" value="'+targeturl+'">');
  document.write('<param name="target" value="QuickTimePlayer">');
  document.write('<param name="type" value="video/quicktime">');
  document.write('<embed src="'+url+'" qtsrc="'+html+'" qtsrcdontusebrowser="true" width="'+width+'" height="'+height+'" autoplay="false" controller="false" cache="false" pluginspage="http://www.apple.com/quicktime/download/" loop="false" playeveryframe="false" href="'+targeturl+'" target="QuickTimePlayer" type="video/quicktime"></embed>');
  //document.write('<embed src="'+html+'" width="'+width+'" height="'+height+'" autoplay="false" controller="false" cache="false" pluginspage="http://www.apple.com/quicktime/download/" loop="false" playeveryframe="false" href="'+targeturl+'" target="QuickTimePlayer" type="video/quicktime"></embed>');
  document.write('</object>');
}
function drawXOButton (width,height,url,objectCode) {
  // special XO button
  document.write('<object classid="'+objectCode+'" border="0" width="'+width+'" height="'+height+'">');
  document.write('<param name="SRC" value="'+url+'">');
  document.write('<param name="autoplay" value="true">');
  document.write('<param name="loop" value="false">');
  document.write('<param name="playeveryframe" value="false">');
  document.write('<param name="controller" value="false">');
  document.write('<param name="cache" value="false">');
  document.write('<embed src="'+url+'" width="'+width+'" height="'+height+'" autoplay="true" controller="false" cache="false" pluginspage="http://www.apple.com/quicktime/download/" loop="false" playeveryframe="false"></embed>');
  document.write('</object>');
}
function drawQuickTimeEmbedded (width,height,url,objectCode,controller,html) {
  // button to launch QuickTime player in popup window
  document.write('<A HREF="javascript:openQTwindow('+width+','+height+',\''+url+'\','+controller+');"><img src="'+html+'" width="120" height="36" border="0" ALT="QuickTime" TITLE="Click to launch replay"></A>');
}
function drawiPodQuickTimeButton (width,height,url,targeturl) {
  document.write('<a href="'+targeturl+'"><image src="images/replayimages/3.gif" width="'+width+'" height="'+height+'"></a>');
  //document.write('<video src="'+targeturl+'"><image src="images/replayimages/3.gif" width="'+width+'" height="'+height+'"></video>');
  //document.write('<embed scr="images/replayimages/10.mov" width="'+width+'" height="'+height+'" controller="false" cache="false" href="'+targeturl+'" type=video/x-m4v></embed>');
  /*
  document.write('<object classid="'+objectCode+'" border="0" width="'+width+'" height="'+height+'">');
  document.write('<param name="SRC" value="'+url+'">');
  document.write('<param name="autoplay" value="false">');
  document.write('<param name="loop" value="false">');
  document.write('<param name="playeveryframe" value="false">');
  document.write('<param name="controller" value="false">');
  document.write('<param name="cache" value="false">');
  document.write('<param name="href" value="'+targeturl+'">');
  document.write('<param name="target" value="QuickTimePlayer">');
  document.write('<param name="type" value="video/quicktime">');
  document.write('<embed src="'+url+'" width="'+width+'" height="'+height+'" autoplay="false" controller="false" cache="false" pluginspage="http://www.apple.com/quicktime/download/" loop="false" playeveryframe="false" href="'+targeturl+'" target="QuickTimePlayer" type="video/quicktime"></embed>');
  document.write('</object>');
  */
}
function drawLinuxQuickTimeButton (width,height,url,html) {
  // button to allow Linux Clients to access MPEG4 streaming Media links - added BH 20110216
  // not well tested but at least gives Linux users a chance to playback streams
  document.write('<A HREF="'+url+'"><IMG SRC="'+html+'" WIDTH="'+width+'" HEIGHT="'+height+'" BORDER="0" ALT="MPEG4 Streaming Media" TITLE="Click to launch replay"></A>');
}

function drawHTMLlink (width,height,url,html) {
  // button to open URL in popup window of given width and height
  document.write('<A HREF="javascript:openHTMLwindow('+width+','+height+',\''+url+'\');"><img src="'+html+'" width="120" height="36" border="0" ALT="Media" TITLE="Click to launch replay"></A>');
}
function drawWindowsButton (width,height,url,html) {
  // button to launch Windows Media player
  document.write('<A HREF="'+url+'"><IMG SRC="'+html+'" WIDTH="'+width+'" HEIGHT="'+height+'" BORDER="0" ALT="Windows Media" TITLE="Click to launch replay"></A>');
}
function drawRealButton (width,height,url,html) {
  document.write('<A HREF="'+url+'"><IMG SRC="'+html+'" WIDTH="'+width+'" HEIGHT="'+height+'" BORDER="0" ALT="Real Media" TITLE="Click to launch replay"></A>');
}
function drawFlashTVButton (width,height,url) {
  document.write('<A HREF="javascript:popup('+url+',\'flashtv.php\','+width+','+height+',\'flv\');" CLASS="linktype1"><IMG SRC="images/replayimages/XOlightbutton.gif" WIDTH="80" HEIGHT="80" BORDER="0" ALT="Click to view a XO Lite Presentation"></A>');
}
function mediaData() { }
// initialise arrays for new method of media button display
mediaData.prototype.name="";
mediaData.prototype.width=0;
mediaData.prototype.height=0;
mediaData.prototype.url="";
mediaData.prototype.targeturl="";
mediaData.prototype.objectCode="";
mediaData.prototype.version="";
mediaData.prototype.newRow=false;
mediaData.prototype.pres=-1;
mediaData.prototype.controller=false;
mediaData.prototype.html="";
mediaData.prototype.download="";
//
var buttonArray=new Array();
function missingMedia(name) {
  document.write('<TD WIDTH=\"75%\" COLSPAN=\"3\">You need to install QuickTime to view this presentation.</TD>');
}
