function showmovie(mfile,mwidth,mheight,mtitle)
  {
  var filename = '';
  var extension = '';
  
  mfile = mfile.replace(/^\s|\s$/g, ""); //trims string

  if (/\.\w+$/.test(mfile))
    {
    if (mfile.match(/([^\/\\]+)\.(\w+)$/) )
      {
      filename=RegExp.$1;
      extension=RegExp.$2
      }
    else
      {
      alert('No filename given to show movie');
      }
    }
  else
    {
    if (mfile.match(/([^\/\\]+)$/) )
      {
      filename=RegExp.$1;
      extension= null;
      }
    else
      {
      alert('No filename given to show movie');
      }
    }
    
  mheight=mheight+15;
  
  if (mtitle==undefined)
    {
    mtitle='<font color="#bbbbbb">'+filename+'.'+extension+'</font>';
    }
  
  if (extension.toLowerCase()=='mov')
    {
    document.write('<table bgcolor="#dddddd">');
    document.write('<tr><td>'+mtitle+'</td></tr><tr><td>');
    document.write("<OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='"+mwidth+"' ");
    document.write("height='"+mheight+"' codebase='http://www.apple.com/qtactivex/qtplugin.cab'>");
    document.write("<param name='src' value='"+mfile+"'>");
    document.write("<param name='autoplay' value='true'>");
    document.write("<param name='controller' value='true'>");
    document.write("<param name='loop' value='false'>");
    document.write("<EMBED src='/path/to/media.file' width='"+mwidth+"' height='"+mheight+"' autoplay='true' ");
    document.write("controller='true' loop='false' pluginspage='http://www.apple.com/quicktime/download/'>");
    document.write("</EMBED>");
    document.write("</OBJECT>");
    document.write('</td></tr></table>');
    }
  else if (extension.toLowerCase()=='avi' || extension.toLowerCase()=='wmv' || extension.toLowerCase()=='mpg')
    {
    document.write('<table bgcolor="#dddddd"><tr><td>');
    document.write("<OBJECT classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 width='"+mwidth+"' ");
    document.write("height='"+mheight+"' 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'>");
    document.write("<param name='fileName' value='"+mfile+"'>");
    document.write("<param name='autoStart' value='true'>");
    document.write("<param name='showControls' value='true'>");
    document.write("<param name='loop' value='false'>");
    document.write("<EMBED src='/path/to/media.file' width='"+mwidth+"' height='"+mheight+"' autostart='true' ");
    document.write("showcontrols='true' loop='false' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'>");
    document.write("</EMBED>");
    document.write("</OBJECT>");
    document.write('</td></tr></table>');
    }
  }

