var
	_playMovie = false,		// used to be true
	_navigator = navigator,
	_platform = _navigator.platform.toLowerCase (),
	_userAgent = _navigator.userAgent.toLowerCase (),
	MAC = MACX = false
;

if (_platform.indexOf ('mac') != -1) {
	MAC = true;
	MACX = _userAgent.indexOf ('mac os x') != -1;
	if (!MACX) {
		var _macIeVersionMatch = _userAgent.match (new RegExp ('msie\\s*(\\d+\\.\\d*|\\d+)'));
		MACX =
			_macIeVersionMatch != null &&
			typeof _macIeVersionMatch [1] != 'undefined' &&
			_macIeVersionMatch [1] >= '5.2'
		;
	}
}

if (
	(MAC && !MACX) ||
	(MAC && _userAgent.indexOf ('safari') != -1) ||
	(_userAgent.indexOf ('win95') != -1 || _userAgent.indexOf ('windows 95') != -1)
)
	_playMovie = false
;

function embedMovie (_VideoID,_ClientUserEmailID,_RecipientID,_width,_height,_alternateImageUrl,_ShowErrorText,_RedirectURL) {
	var _html = '';
	if (_playMovie) {
		_html =
			'<applet' +
				' code="vmd.player.nushu.MiNXPlayer"' +
				' codebase="http://www.vmdirect.com/dvmuser/DVMPlayer/"' +
				' archive="DVMneoPlayer1.jar"' +
				' width="176"' +
				' height="144"' +
				' name="dvmplayer"' +
				' MAYSCRIPT' +
			'>' +
				'<param name="Cabbase" value="DVMneoPlayer1.cab">' +
				'<param name="SampleURL" value="http://www.vmdirect.com/dvmuser/images/player_testconn.jpg">' +
				'<param name="BaseHref" value="http://www.vmdirect.com/dvmuser">' +
				'<param name="EndImage" value="http://www.vmdirect.com/sbm/l/i/s/alori/8a81b284-f8d668e6-00f8-d94cd96c-219b/switch2dean-endimage.jpg">' +
				'<param name="UserId" value="">' +
				'<param name="VideoID" value="' + _VideoID + '">' +
				'<param name="ClientUserEmailId" value="' + _ClientUserEmailID + '">' +
				'<param name="RecipientId" value="' + _RecipientID + '">' +
				'<param name="DateSent" value="200310">' +
			'</applet>' +
			'&nbsp;</P>' +
			'<font size=-2>DesktopJavaVideo provided by <a href="http://www.vmailit.com/dean/" target="_blank">Vmailit</a> powered by <a href="http://www.vmailit.net" target="_blank"><i>VM</i>direct</a>.'
		;
	} else {
		if (_RedirectURL == "") {
		_html =
			'<img' +
			' src="images/' + _alternateImageUrl + '"' +
			' width="' + _width + '"' +
			' height="' + _height + '"' +
			'>'
		;
		} else {
		_html =
			'<a href="' + _RedirectURL + '">' +
			'<img' +
			' src="images/' + _alternateImageUrl + '"' +
			' width="' + _width + '"' +
			' height="' + _height + '"' +
			'></a>'
		;
		}
		if (_ShowErrorText) {
			_html = _html + '<P><SPAN STYLE="font-size: 7.2pt; font-weight: normal;">To view the movie, click on a QuickTime or Windows Media link to the right.</SPAN>' ;
//			_html = _html + '<P><SPAN STYLE="font-size: 7.2pt; font-weight: normal;">Java Video is not compatible with this browser. Play the QuickTime or Windows Media movie instead.</SPAN>' ;
		}
	}
	document.write (_html);
}

