   // This is only needed for Netscape browsers.
    function flashGetHref() { return location.href; }
    function flashPutHref(href) { location.href = href; }
    function flashGetTitle() { return document.title; }
    function flashPutTitle(title) { document.title = title; }

	var MM_contentVersion = 6;
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		if (plugin) {
				var words = navigator.plugins["Shockwave Flash"].description.split(" ");
				for (var i = 0; i < words.length; ++i)
				{
				if (isNaN(parseInt(words[i])))
				continue;
				var MM_PluginVersion = words[i]; 
				}
			var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
		}
		else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
			document.write('<scr' + 'ipt language=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
			document.write('on error resume next \n');
			document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
			document.write('</scr' + 'ipt\> \n');
		}
		if (MM_FlashCanPlay) {

			url = 'animation/get_animation.php';
			new Ajax.Request(url, {
				method: 'post',
				asynchronous: false,
				onFailure: function () {
					// Error!
				}.bind(this),
				onComplete: function(response) {
					// Responsed!
					var result = eval('(' + response.responseText + ')');
					if (result && result['status'] == 'success') {
						// Found!
						id				= result["animation_id"];
						moviename		= result["file"];
						flashimagepath	= result["thumbnail"];

						drawContents(id, moviename, flashimagepath);

					} else {
						// Error
						msg	= result["msg"];
					}
				}.bind(this)
			});

		}else{
			document.write('<img src="img/noplugin.jpg" width="600" height="260" alt="" />');
		}


function drawContents(id, moviename, flashimagepath)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
	document.write(' width="600" height="260" id="top" align="">');
	document.write(' <param name=movie value="animation/slo.swf?moviename=');
	document.write(id);
	document.write('/');
	document.write(moviename);
	document.write('&flashimagepath=animation/');
	document.write(id);
	document.write('/');
	document.write(flashimagepath);
	document.write('"> ');
	document.write(' <param name=quality value=high> <PARAM NAME=wmode VALUE=transparent>  <PARAM NAME=bgcolor VALUE=#000000>  '); 
	document.write(' <EMBED src="animation/slo.swf?moviename=');
	document.write(id);
	document.write('/');
	document.write(moviename);
	document.write('&flashimagepath=animation/');
	document.write(id);
	document.write('/');
	document.write(flashimagepath);
	document.write('" quality=high wmode=transparent bgcolor=#000000  WIDTH="600" HEIGHT="260" NAME="top" ALIGN="" ');
	document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write(' </embed>');
	document.write(' </object>');
}

