// external_script.js
var bo_ns_id = 0;

function startIeFix(){
  if(isIE()){
      document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!--');
  }
}

function endIeFix(){
  if(isIE()){
      document.write('</div>');
      var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);    
      var theCode = theObject.innerHTML;    
      theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))    
      document.write(theCode);  
  }
}

function isIE(){
  // only for Win IE 6+  
  // But not in Windows 98, Me, NT 4.0, 2000  
  var strBrwsr= navigator.userAgent.toLowerCase();  
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
      if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
         return false;    
      }    
      
      if(strBrwsr.indexOf("win98") > -1 || 
         strBrwsr.indexOf("win 9x 4.90") > -1 || 
         strBrwsr.indexOf("winnt4.0") > -1 ||       
         strBrwsr.indexOf("windows nt 5.0") > -1)    
      {
	      return false;    
	  }    
	  return true;  
  }else{    
	  return false;  
  }
}

function CreateActivatedMediaControl(URL)
{
  document.write('<script type="text/javascript">startIeFix();</script>');
  document.write('<object id="Player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Loading Microsoft Windows Media Player components...">');
  document.write('<param name="url" value="' + URL + '">');
  document.write('<param name="uiMode" value="full">');
  document.write('<param name="AutoStart" value="-1">');
  document.write('<param name="rate" value="1">');
  document.write('<param name="balance" value="0">');
  document.write('<param name="currentPosition" value="0">');
  document.write('<param name="defaultFrame" value="">');
  document.write('<param name="playCount" value="1">');
  document.write('<param name="currentMarker" value="0">');
  document.write('<param name="invokeURLs" value="-1">');
  document.write('<param name="baseURL" value="">');
  document.write('<param name="volume" value="83">');
  document.write('<param name="mute" value="0">');
  document.write('<param name="stretchToFit" value="-1">');
  document.write('<param name="windowlessVideo" value="-1">');
  document.write('<param name="enabled" value="-1">');
  document.write('<param name="enableContextMenu" value="-1">');
  document.write('<param name="fullScreen" value="0">');
  document.write('<param name="SAMIStyle" value="">');
  document.write('<param name="SAMILang" value="">');
  document.write('<param name="SAMIFilename" value="">');
  document.write('<param name="captioningID" value="">');
  document.write('<param name="enableErrorDialogs" value="-1">');
  document.write('<param name="_cx" value="6350">');
  document.write('<param name="_cy" value="6482">');
//  document.write('Your browser does not support the ActiveX Windows Media Player.<br><br>If you\'re running a Firefox or Mozilla browser, get the plugin here:<br><a href="http://plugindoc.mozdev.org/windows-all.html#ActiveX" target="_blank">http://plugindoc.mozdev.org/windows-all.html#ActiveX</a>');
  document.write('<embed type="application/x-mplayer2" name="Player" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/" width="320" height="240" src="' + URL + '" showcontrols="0"></embed>');
  document.write('</object>');
  document.write('<script type="text/javascript">endIeFix();</script>');
}

function PlayMainPageVideo(URL)
{
  document.write('<script type="text/javascript">startIeFix();</script>');
  document.write('<object id="Player" width="292" height="218" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Loading Microsoft Windows Media Player components...">');
  document.write('<param name="url" value="' + URL + '">');
  document.write('<param name="uiMode" value="none">');
  document.write('<param name="AutoStart" value="-1">');
  document.write('<param name="rate" value="1">');
  document.write('<param name="balance" value="0">');
  document.write('<param name="currentPosition" value="0">');
  document.write('<param name="playCount" value="1">');
  document.write('<param name="currentMarker" value="0">');
  document.write('<param name="invokeURLs" value="-1">');
  document.write('<param name="volume" value="100">');
  document.write('<param name="mute" value="0">');
  document.write('<param name="stretchToFit" value="-1">');
  document.write('<param name="windowlessVideo" value="-1">');
  document.write('<param name="enabled" value="-1">');
  document.write('<param name="enableContextMenu" value="-1">');
  document.write('<param name="fullScreen" value="0">');
  document.write('<param name="enableErrorDialogs" value="-1">');
//  document.write('Your browser does not support the ActiveX Windows Media Player.<br><br>If you\'re running a Firefox or Mozilla browser, get the plugin here:<br><a href="http://plugindoc.mozdev.org/windows-all.html#ActiveX" target="_blank">http://plugindoc.mozdev.org/windows-all.html#ActiveX</a>');
  document.write('<embed type="application/x-mplayer2" name="Player" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/" width="292" height="218" src="' + URL + '" showcontrols="0"></embed>');
  document.write('</object>');
  document.write('<script type="text/javascript">endIeFix();</script>');
}

function PlayVideo(URL)
{
  document.write('<script type="text/javascript">startIeFix();</script>');
  document.write('<object id="Player" width="320" height="240" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Loading Microsoft Windows Media Player components...">');
  document.write('<param name="url" value="' + URL + '">');
  document.write('<param name="uiMode" value="mini">');
  document.write('<param name="AutoStart" value="-1">');
  document.write('<param name="rate" value="1">');
  document.write('<param name="balance" value="0">');
  document.write('<param name="currentPosition" value="0">');
  document.write('<param name="playCount" value="1">');
  document.write('<param name="currentMarker" value="0">');
  document.write('<param name="invokeURLs" value="-1">');
  document.write('<param name="volume" value="100">');
  document.write('<param name="mute" value="0">');
  document.write('<param name="stretchToFit" value="-1">');
  document.write('<param name="windowlessVideo" value="-1">');
  document.write('<param name="enabled" value="-1">');
  document.write('<param name="enableContextMenu" value="-1">');
  document.write('<param name="fullScreen" value="0">');
  document.write('<param name="enableErrorDialogs" value="-1">');
  document.write('Your browser does not support the ActiveX Windows Media Player.<br><br>If you\'re running a Firefox or Mozilla browser, get the plugin here:<br><a href="http://plugindoc.mozdev.org/windows-all.html#ActiveX" target="_blank">http://plugindoc.mozdev.org/windows-all.html#ActiveX</a>');
  document.write('<embed type="application/x-mplayer2" name="Player" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/" width="320" height="240" src="' + URL + '" showcontrols="0"></embed>');
  document.write('</object>');
  document.write('<script type="text/javascript">endIeFix();</script>');
}

function PlaySound(URL)
{
//  document.write('<script type="text/javascript">startIeFix();</script>');
//  document.write('<object id="Player" width="0" height="0" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
////  document.write('<object id="Player" width="0" height="0" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Loading Microsoft Windows Media Player components..." codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject">');
////  document.write('<object id="Player" width="0" height="0" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Microsoft Windows Media Player components..." codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject">');
//  document.write('<param name="url" value="' + URL + '">');
//  document.write('<param name="FileName" value="' + URL + '">');
//  document.write('<param name="uiMode" value="invisible">');
//  document.write('<param name="AutoStart" value="-1">');
//  document.write('<param name="rate" value="1">');
//  document.write('<param name="balance" value="0">');
//  document.write('<param name="currentPosition" value="0">');
//  document.write('<param name="playCount" value="1">');
//  document.write('<param name="currentMarker" value="0">');
//  document.write('<param name="invokeURLs" value="-1">');
//  document.write('<param name="volume" value="100">');
//  document.write('<param name="mute" value="0">');
//  document.write('<param name="stretchToFit" value="-1">');
//  document.write('<param name="windowlessVideo" value="-1">');
//  document.write('<param name="enabled" value="-1">');
//  document.write('<param name="enableContextMenu" value="-1">');
//  document.write('<param name="fullScreen" value="0">');
//  document.write('<param name="enableErrorDialogs" value="-1">');
  document.write('<embed type="application/x-mplayer2" name="Player" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="0" height="0" src="' + URL + '" filename="' + URL + '" showcontrols="0" autostart="1"></embed>');
//  document.write('</object>');
//  document.write('<!-- --><script type="text/javascript">endIeFix();</script>');

}

function PlaySoundShowPlayer(URL)
{
  document.write('<script type="text/javascript">startIeFix();</script>');
  document.write('<object id="Player" width="0" height="0" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" standby="Loading Microsoft Windows Media Player components...">');
  document.write('<param name="url" value="' + URL + '">');
  document.write('<param name="uiMode" value="mini">');
  document.write('<param name="AutoStart" value="-1">');
  document.write('<param name="rate" value="1">');
  document.write('<param name="balance" value="0">');
  document.write('<param name="currentPosition" value="0">');
  document.write('<param name="playCount" value="1">');
  document.write('<param name="currentMarker" value="0">');
  document.write('<param name="invokeURLs" value="-1">');
  document.write('<param name="volume" value="100">');
  document.write('<param name="mute" value="0">');
  document.write('<param name="stretchToFit" value="-1">');
  document.write('<param name="windowlessVideo" value="-1">');
  document.write('<param name="enabled" value="-1">');
  document.write('<param name="enableContextMenu" value="-1">');
  document.write('<param name="fullScreen" value="0">');
  document.write('<param name="enableErrorDialogs" value="-1">');
  document.write('<embed type="application/x-mplayer2" name="Player" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/" width="0" height="0" src="' + URL + '" showcontrols="0"></embed>');
  document.write('</object>');
  document.write('<!-- --><script type="text/javascript">endIeFix();</script>');
}

