function WriteWindowsMediaVideo(path, width, height, autostart)
{
    if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1) //Chrome
    {
        document.write("<OBJECT ID=\"MediaPlayer\" WIDTH=\"" + width + "\" HEIGHT=\"" + height + "\" CLASSID=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" STANDBY=\"Loading Windows Media Player components...\" TYPE=\"application/x-oleobject\">" +
                            "<PARAM NAME=\"FileName\" VALUE=\"" + path + "\">" +
                            "<PARAM name=\"autostart\"; VALUE=\"" + autostart + "\">" +
                            "<PARAM name=\"ShowControls\" VALUE=\"true\">" +
                            "<param name=\"ShowStatusBar\" value=\"false\">" +
                            "<PARAM name=\"ShowDisplay\" VALUE=\"false\">" +
                            "<EMBED TYPE=\"application/x-mplayer2\" SRC=\"" + path + "\" NAME=\"MediaPlayer\" WIDTH=\"" + width + "\" HEIGHT=\"" + height + "\" ShowControls=\"1\" ShowStatusBar=\"0\" ShowDisplay=\"0\" autostart=\"" + autostart + "\"></EMBED>" +
                       "</OBJECT>")
    }
    else
    {
	    document.write("<OBJECT id=\"VIDEO\" width=\"" + width + "\" height=\"" + height + "\" style=\"\" CLASSID=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" type=\"application/x-oleobject\">" +
						    "<PARAM NAME=\"URL\" VALUE=\"" + path + "\">" +
						    "<PARAM NAME=\"SendPlayStateChangeEvents\" VALUE=\"True\">" +
						    "<PARAM NAME=\"AutoStart\" VALUE=\"" + autostart + "\">" +
						    "<PARAM name=\"uiMode\" value=\"full\">" +
						    "<PARAM name=\"PlayCount\" value=\"1\">" +
						    "<PARAM name=\"Controller\" value=\"True\">" + 
						    "<EMBED SRC=\"" + path + "\" WIDTH=\"" + width + "\" HEIGHT=\"" + height + "\" AUTOPLAY=\"false\" CONTROLLER=\"true\" PLUGINSPAGE=\"http://www.microsoft.com/windows/windowsmedia/player/download/\"></EMBED>" +
				       "</OBJECT>")
    }
}

function WriteWindowsMediaVideoForPopup(container, path, width, height)
{
    if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1) //Chrome
    {
        container.innerHTML = "<OBJECT ID=\"MediaPlayer\" WIDTH=\"" + width + "\" HEIGHT=\"" + height + "\" CLASSID=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" STANDBY=\"Loading Windows Media Player components...\" TYPE=\"application/x-oleobject\">" +
                            "<PARAM NAME=\"FileName\" VALUE=\"" + path + "\">" +
                            "<PARAM name=\"autostart\"; VALUE=\"True\">" +
                            "<PARAM name=\"ShowControls\" VALUE=\"true\">" +
                            "<param name=\"ShowStatusBar\" value=\"false\">" +
                            "<PARAM name=\"ShowDisplay\" VALUE=\"false\">" +
                            "<EMBED TYPE=\"application/x-mplayer2\" SRC=\"" + path + "\" NAME=\"MediaPlayer\" WIDTH=\"" + width + "\" HEIGHT=\"" + height + "\" ShowControls=\"1\" ShowStatusBar=\"0\" ShowDisplay=\"0\" autostart=\"true\"></EMBED>" +
                       "</OBJECT>";
    }
    else
    {
	    container.innerHTML = "<OBJECT id=\"VIDEO\" width=\"" + width + "\" height=\"" + height + "\" style=\"\" CLASSID=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" type=\"application/x-oleobject\">" +
						    "<PARAM NAME=\"URL\" VALUE=\"" + path + "\">" +
						    "<PARAM NAME=\"SendPlayStateChangeEvents\" VALUE=\"True\">" +
						    "<PARAM NAME=\"AutoStart\" VALUE=\"True\">" +
						    "<PARAM name=\"uiMode\" value=\"full\">" +
						    "<PARAM name=\"PlayCount\" value=\"1\">" +
						    "<PARAM name=\"Controller\" value=\"True\">" + 
						    "<EMBED SRC=\"" + path + "\" WIDTH=\"" + width + "\" HEIGHT=\"" + height + "\" AUTOPLAY=\"false\" CONTROLLER=\"true\" PLUGINSPAGE=\"http://www.microsoft.com/windows/windowsmedia/player/download/\"></EMBED>" +
				            "</OBJECT>";
    }
}
