﻿function DrawWindowsMediaPlayer(application_path, file_code, width, height)
{
	var buf = new String();
	
	var intWidth = parseInt(width);
	if (isNaN(intWidth)) intWidth = 392;
	
	var intHeight = parseInt(height);
	if (isNaN(intHeight)) intHeight = 294;
	intHeight = intHeight + 45;
	
	buf = '<object id="MediaPlayer" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" width="' + intWidth + '" height="' + intHeight + '" runat="server">';
	buf += '<param name="FileName" value="' + application_path + '/Download.ashx?id=' + file_code + '">';
	buf += '<param name="autostart" value="true">';
	buf += '<param name="ShowControls" value="true">';
	buf += '<param name="ShowStatusBar" value="false">';
	buf += '<param name="ShowDisplay" value="false">';
	buf += '<embed type="application/x-mplayer2" src="' + application_path + '/Download.ashx?id=' + file_code + '" width="' + intWidth + '" height="' + intHeight + '" name="MediaPlayer" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>';
	buf += '</object>';
	
	document.write(buf);
}

function DrawFlashPlayer(application_path, file_code)
{
	var buf = new String();
	//width="192" height="190" 
	buf = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
	buf += 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ';
	buf += 'width="550" height="400" id="Untitled-1" align="middle"> ';
	buf += '<param name="allowScriptAccess" value="sameDomain" />';
	buf += '<param name="movie" value="' + application_path + '/Download.ashx?id=' + file_code + '" />';
	buf += '<param name="quality" value="high" />';
	buf += '<param name="bgcolor" value="#ffffff" />';
	buf += '<embed src="' + application_path + '/Download.ashx?id=' + file_code + '" quality="high" bgcolor="#ffffff" width="550" ';
	buf += '   height="400" name="mymovie" align="middle" allowScriptAccess="sameDomain" ';
	buf += '   type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />';
	buf += '</object>';

	document.write(buf);
}
