
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

windowtitle = '';
videoname = '';
xMax = 0;
yMax = 0;
xOffset = 0;
yOffset = 0;

function centerWindow() {
  if (document.all) {
    xMax = screen.width;
    yMax = screen.height;
  } else {
    if (document.layers) {
      xMax = window.outerWidth;
      yMax = window.outerHeight;
    } else {
      xMax = 640;
      yMax=480;
    }
  }
  xOffset = (xMax - 320)/2;
  yOffset = (yMax - 261)/2;
}

function showmov(wintl,vidnme) {
  if (typeof vidwin != 'undefined') vidwin.close();
  centerWindow();
  vidwin = window.open('about:blank','','height=236,width=320,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
  windowtitle = wintl;
  videoname = vidnme;
  setTimeout('displaymov()',500)
}

function displaymov() {
  doc = vidwin.document;
  doc.open('text/html');
  doc.write('<HTML>\n<HEAD>\n<TITLE>' + windowtitle + '<\/TITLE>\n<\/HEAD>\n');
  doc.write('<BODY bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">\n');
  doc.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"\n');
  doc.write('        width="320" height="236"\n');
  doc.write('        codebase="http://www.apple.com/qtactivex/qtplugin.cab">\n');
  doc.write('<param name="src" value="' + videoname  + '">\n');
  doc.write('<param name="autoplay" value="true">\n');
  doc.write('<param name="controller" value="true">\n');
  doc.write('<param name="loop" value="false">\n');
  doc.write('<param name="bgcolor" value="#C3C3C3">\n');
  doc.write('<embed src="' + videoname + '" pluginspage="http://www.apple.com/quicktime/download/"\n');
  doc.write('       height="236" width="320" autoplay="true" loop="false" controller="true">\n');
  doc.write('</embed></object>\n<\/BODY>\n<\/HTML>');
  doc.close();
}

function showwmv(wintl,vidnme) {
  if (typeof vidwin != 'undefined') vidwin.close();
  centerWindow();
  vidwin = window.open('about:blank','','height=286,width=320,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
  windowtitle = wintl;
  videoname = vidnme;
  setTimeout('displaywmv()',500)
}

function displaywmv() {
  doc = vidwin.document;
  doc.open('text/html');
  doc.write('<HTML>\n<HEAD>\n<TITLE>' + windowtitle + '<\/TITLE>\n<\/HEAD>\n');
  doc.write('<BODY bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">\n');
  doc.write('<object id="MediaPlayer" width=320 height=286	classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"\n');
  doc.write('        standby="Loading Microsoft® Windows® Media Player components..."\n');
  doc.write('        type="application/x-oleobject"\n');
  doc.write('        codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">\n');
  doc.write('<param name="filename" value="' + videoname  + '">\n');
  doc.write('<param name="AutoStart" value="true">\n');
  doc.write('<param name="ShowControls" value="true">\n');
  doc.write('<param name="ShowStatusBar" value="false">\n');
  doc.write('<param name="Autorewind" value="true">\n');
  doc.write('<param name="ShowDisplay" value="false">\n');
  doc.write('<embed src="' + videoname + '" width=320 height=286\n');
  doc.write('       type="application/x-mplayer2" name=MediaPlayer\n');
  doc.write('       autostart=1 showcontrols=1 showstatusbar=0 autorewind=1 showdisplay=0>\n');
  doc.write('</embed></object>\n<\/BODY>\n<\/HTML>');
  doc.close();
}
