
//find supported versions of windows media and flash players
version=[];revision=[];var $a='';wmpre=/windows media player (.*?)$/i;version['Windows Media']=-1;revision['Windows Media']='';
flashre=/flash (.*?)r(.*?$)/ig;version['Flash']=-1;revision['Flash']='';
if (!window.ActiveXObject){if (navigator.plugins){for (ee=0;ee<navigator.plugins.length;ee++){$a+=navigator.plugins[ee].name+" -- "+navigator.plugins[ee].description+"\n";
if (v=flashre.exec(navigator.plugins[ee].description)){version['Flash']=v[1];revision['Flash']=v[2];}if (v=wmpre.exec(navigator.plugins[ee].name)){version['Windows Media']=v[1];revision['Windows Media']=navigator.plugins[ee].description;}}}}else{flash_versions = 20;
if (window.ActiveXObject) {for (x = 2; x <= flash_versions; x++) {try {oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");if(oFlash) {version['Flash'] = x + '.0';}}catch(e) {}}}
function AXO(id){var error; var control = null;	try {if (window.ActiveXObject && navigator.userAgent.indexOf('Win') != -1) control = new ActiveXObject(id); }catch (error) {} return control;}
if (window.ActiveXObject || gkoaxwma){try {oWMP=new AXO('WMPlayer.OCX.7');if (oWMP){version['Windows Media']=parseFloat(oWMP.versionInfo);if (version['Windows Media'].toString().length <3){version['Windows Media']+='.0';}}} catch(e) {}}}

function getAudioObject(id,width,height,flashfilepath,wmfilepath,jpgfilepath,startposition,autostart){
if (version['Flash']!=-1){return '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="'+id+'" width="'+width+'" height="'+height+'"  align="middle"><param name="bgcolor" value="#000000" /><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+flashfilepath+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />'+'<embed src="'+flashfilepath+'"  width="'+width+'" height="'+height+'"  quality="high" bgcolor="#000000" name="'+id+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';}
else if (version['Windows Media']!=-1 && navigator.appName.indexOf("Microsoft Internet")!=-1)
{return '<object width="'+width+'" height="'+height+'" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="'+id+'"><param name="Filename" value="'+wmfilepath+'"><param name="AutoStart" value="'+autostart+'"><param name="ShowControls" value="True"><param name="ShowStatusBar" value="False"><param name="ShowDisplay" value="False"><param name="Loop" value="True">'+
		'<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" width="'+width+'" height="'+height+'"  src="'+wmfilepath+'" filename="'+wmfilepath+'" autostart="'+autostart+'" showcontrols="True" showstatusbar="False" showdisplay="False" loop="True"></embed></object>';}
else {return '<div style="font:8pt verdana;color:white">To hear sound install <br>Windows Media Player plug-in or Flash plug-in</div>';}}

function getObject(id,width,height,flashfilepath,wmfilepath,jpgfilepath,startposition){
if (version['Windows Media']!=-1 && navigator.appName.indexOf("Microsoft Internet")!=-1)
{return	'<OBJECT ID="oMediaPlayer" width="'+width+'" height="'+height+'" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"  CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject">'+'<PARAM NAME="AutoStart" VALUE="True"><PARAM NAME="FileName" VALUE="'+wmfilepath+'"><PARAM NAME="ShowControls" VALUE="False"><PARAM NAME="ShowStatusBar" VALUE="False"><PARAM NAME="Loop" VALUE="True"><PARAM NAME="currentPosition" VALUE="'+startposition+'">'+'<embed type="application/x-mplayer2 pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"  width="'+width+'" height="'+height+'" src="'+wmfilepath+'" filename="'+wmfilepath+'" autostart="True" showcontrols="False" showstatusbar="False" showdisplay="True" loop="True"></embed></object>';}
//use flash if windows media not available or not IE
else if (version['Flash']!=-1){return '<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="'+width+'" height="'+height+'" id="'+id+'" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+flashfilepath+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" />'+'<embed src="'+flashfilepath+'" quality="high" bgcolor="#000000" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';}
else {return '<img src="'+jpgfilepath+'">';}
}

