function RunAudio(filename, width, height)
{
    if(!width) width = 330; // default control width and height
    if(!height) height = 25;

	document.write('<embed width="' + width + '" height="' + height + '" name="audio file" src="' + filename + '" type="audio/wav" autostart="true" controls="smallconsole">\n');
	document.write('</embed>\n');
}

function RunFlash(filename, width, height, loop, bgcolor)
{
    if(!width) width = 725; // default control width and height
    if(!height) height = 468;
    if(!bgcolor) bgcolor = '#333366';
    if(!loop) loop='false'; // default is no looping

	document.write('<classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="' + width + '" HEIGHT="' + height + '">\n');
	document.write('<param NAME=movie VALUE="' + filename + '" />\n');
	document.write('<param NAME=loop VALUE=' + loop + ' />\n');
	document.write('<param NAME=quality VALUE=high />\n');
	document.write('<param NAME=salign VALUE=T />\n');
	document.write('<param NAME=bgcolor VALUE=' + bgcolor + ' />\n');
	document.write('<embed src="' + filename + '" loop=' + loop + ' quality=high salign=T bgcolor="' + bgcolor + '" WIDTH="' + width + '" HEIGHT="' + height + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">\n');
	document.write('</object>\n');
}

function RunVideo(filename, width, height)
{
    var mimetype = "video/mpeg"; // default Mime-Type

    if(!width) width = 320; // default control width and height
    if(!height) height = 256;

    // code to detect Windows and Windows Media Player goes here
    if(window.ActiveXObject && navigator.userAgent.indexOf('Windows') != -1)
      mimetype = "application/x-mplayer2"; // force use of media player on Windows to avoid QuickTime

	document.write('<embed width="' + width + '" height="' + height + '" name="video file" src="' + filename + '" type="' + mimetype + '" autoplay="true" controller="true" cache="true">\n');
	document.write('</embed>\n');
}

