/* Copyright (C) 2002-2008 by Home of the Brave
   Web http://home.of.the.brave.de
   E-Mail info@brave.de */
/* $Revision: 1.13 $ $Date: 2008/06/20 14:53:17 $ */

/* owner: Simon.Leidig@brave.de */

var FlashDetector = {
	MaxVersion:	7,
	Version:	0,
	IE:			(navigator.userAgent.indexOf('MSIE')				>=  0) &&
				(navigator.userAgent.toLowerCase().indexOf('opera')	== -1) &&
				(navigator.appVersion.indexOf('Mac')				== -1),
	embed: function (version,flash,alt,name) {
		if (FlashDetector.Version >= version) {
			document.write(flash);
			if (name && FlashDetector.IE) document.write(
				'<script type="text/vbscript" language="VBScript">\n' +
					'on error resume next\n' +
					'Sub '+name+'_FSCommand( ByVal cmd, ByVal args )\n' +
						'Call '+name+'_DoFSCommand(cmd,args)\n' +
					'end Sub\n' +
				'</script>'
			);
		} else document.write(alt);
	}
};
var FlashCallbacks = {
	Hooks: {},
	set: function (movie,cmd,func) {
		var mh = FlashCallbacks.Hooks[movie];
		if (!mh) {
			mh = {};
			window[movie+'_DoFSCommand'] = function (c,args) {
				var f = mh[c]; if (f) f(args);
			}
		}
		mh[cmd] = func;
	}
}
if (FlashDetector.IE) {
	document.write(
		'<script type="text/vbscript" language="VBScript">\n' +
			'on error resume next\n' +
			'For i = FlashDetector.MaxVersion to 0 Step -1\n' +
				'fo = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash."+CStr(i)))\n' +
				'If fo Then\n' +
					'FlashDetector.Version = i\n' +
					'Exit For\n' +
				'end If\n' +
			'Next\n' +
		'</script>'
	);
} else if (
	navigator.mimeTypes &&
	navigator.mimeTypes['application/x-shockwave-flash'] &&
	navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin
) {
	var d = navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin.description;
	FlashDetector.Version = parseInt(d.substring(d.indexOf('.') - 1));
}

