document.unFocusFlash = new Object();
function unFocusFlash() {
	this.src = false;
	this.width = false;
	this.height = false;
	this.quality = false;
	this.scale = false;
	this.align = false;
	this.salign = false;
	this.wmode = false;
	this.bgcolor = false;
	this.id = false;
	this.version = 7;
	this.swliveconnect = true;
	this.play = true;
	this.loop = true;
	this.menu = true;
	this.base = false;
	this.flashvars = '';
	this.allowScriptAccess = 'sameDomain';
	this.useActiveX = false;
	if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1
		&& navigator.userAgent.indexOf("Windows 3.1") == -1 && navigator.userAgent.indexOf('Opera') == -1) {
			this.useActiveX = true;
	}
	this.document = window.document;
	this.flashRef = false;
	this.title = document.title;
}
if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1) && navigator.userAgent.indexOf('Opera') == -1) {
	document.writeln('<scr' + 'ipt language="VBScript" type="text/vbscript"\>');
	document.writeln('Function vb_detect_flash (version)');
	document.writeln('on error resume next');
	document.writeln('vb_detect_flash = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & version))');
	document.writeln('End Function');
	document.write('</scr' + 'ipt\>');
}
function detect_flash(version) {
	if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1) && navigator.userAgent.indexOf('Opera') == -1) {
		return vb_detect_flash(version);
	} else if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) {
		if (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
			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];
			}
			return MM_PluginVersion >= version;
		}
	}
	return false;
}
unFocusFlash.prototype.detect = function() {
	return detect_flash(this.version);
}
unFocusFlash.prototype.output_flash = function() {
	var props, propsBool, params, paramsBool, i, flashRef;
	if (this.useActiveX) {
		this.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		this.document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+',0,0,0"');
		props = new Array('width','height','id','name','align');
		propsBool = '';
		params = new Array('quality','scale','salign','wmode','allowScriptAccess','base','bgcolor');
		paramsBool = new Array('play','loop','menu','swliveconnect');
	} else {
		this.document.write('<embed');
		props = new Array('width','height','id','name','align','quality','scale','salign','wmode','bgcolor','base','allowscriptaccess');
		propsBool = new Array('play','loop','menu','swliveconnect');
		params = '';
		paramsBool = '';
	}
	for (i=0; i<props.length; i++) {
		if (this[props[i]]) this.document.write(' '+props[i]+'='+this[props[i]]);
	}
	for (i=0; i<propsBool.length; i++) {
		this.document.write(' '+propsBool[i]+'='+((this[propsBool[i]])?'true':'false'));
	}
	if (this.useActiveX) {
		if (this.useScrollWheel) this.document.write(' onmousewheel="document.unFocusFlash[\''+this.id+'\'].wheel_event();"');
		this.document.write(' onfocus="document.title=document.unFocusFlash[\''+this.id+'\'].title;"');
		this.document.writeln('>');
	}
	for (i=0; i<params.length; i++) {
		if (this[params[i]]) this.document.writeln('<param name="'+params[i]+'" value="'+ this[params[i]] +'">');
	}
	for (i=0; i<paramsBool.length; i++) {
		if (this[paramsBool[i]]) {
			this.document.writeln('<param name="'+paramsBool[i]+'" value="true">');
		} else {
			this.document.writeln('<param name="'+paramsBool[i]+'" value="false">');
		}
	}
	if (this.useActiveX) {
		this.document.write('<param name="movie" value="'+ this.src);
		if (this.flashvars) {
			this.document.writeln('?'+this.flashvars+'">');
			this.document.write('<param name="flashvars" value="'+this.flashvars);
		}
		this.document.writeln('">');
		this.document.writeln('</obj'+'ect>');
		this.flashRef = document.all[document.all.length-1];
	} else {
		this.document.write(' src="'+ this.src);
		if (this.flashvars) this.document.write('?'+this.flashvars+'" flashvars="'+this.flashvars);
		this.document.writeln('" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'+'</embe'+'d>');
		if (document.getElementById) this.flashRef = this.document.getElementById(this.id);
		else this.flashRef = document[this.id];
	}
	this.document.unFocusFlash[this.id] = this;
}
unFocusFlash.prototype.DoFSCommand = function(command, args) {
	return true;
}
unFocusFlash.prototype.FS_handler = function(command, args) {
	if (command == 'UnfocusFlashSetTitle') {
		this.title = args;
		if (document.title) document.title = args;
	} else {
		this.DoFSCommand(command, args);
	}
}
unFocusFlash.prototype.output_fscommand = function() {
	if (this.useActiveX) {
		this.document.writeln('<'+'scr'+'ipt  language="VBScript" type="text/vbscript"'+'>');
		this.document.writeln('on error resume next');
		this.document.writeln('Sub '+ this.id +'_FSCommand(ByVal command, ByVal args)');
		this.document.writeln('  call '+this.id+'_DoFSCommand(command, args)');
		this.document.writeln('end sub');
		this.document.writeln('</'+'scr'+'ipt'+'>');
	}
	this.document.writeln('<'+'scr'+'ipt language="JavaScript" type="text/javascript"'+'>');
	this.document.writeln('function '+this.id+'_DoFSCommand(command, args) {');
	this.document.writeln('	document.unFocusFlash["'+this.id+'"].FS_handler(command, args);');
	this.document.writeln('}');
	this.document.writeln('</'+'scr'+'ipt'+'>');
}
unFocusFlash.prototype.output = function() {
	if (this.swliveconnect) this.output_fscommand();
	this.output_flash();
}
unFocusFlash.prototype.wheel_event = function() {
	this.flashRef.SetVariable('UnfocusFlashWheelEvent', event.wheelDelta);
}