var insert_swf = {
	check_flash : function (m) {
		if (navigator.plugins)  { 
			if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
				var desc = navigator.plugins["Shockwave Flash"].description
				if (parseInt(desc.substring(16)) >= m) { return true } else { return false }
			} 
			else if (navigator.appVersion.indexOf("MSIE")>-1) { 
				for(var i=m; i>0; i--){
					try {
						var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i)
						if ( i >= m ) { return true } else { return false }
					} catch(e) {}
				}
			}
		}
	},
	write_flash : function() {
		var output = '<object \n'
		output += '\tclassid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \n'
		output += '\tcodebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.flash_settings.version+',0,0,0" \n'
		output += '\twidth="'+this.flash_params.width+'" \n'
		output += '\theight="'+this.flash_params.height+'">\n'
			for (j in this.flash_params) {
				if (j != 'width' && j != 'height' ) {
					output += '\t\t<param name="'+j+'" value="'+ eval('this.flash_params.'+j) +'" />\n\n'
				}	
			}	
		output += '\t<embed \n'
		output += '\t\tpluginspage="http://www.macromedia.com/go/getflashplayer" \n'
		output += '\t\ttype="application/x-shockwave-flash" \n'
			for (i in this.flash_params) {
				output += '\t\t'+i+'="'+ eval('this.flash_params.'+i) +'" \n'
			}
		output += '\t>\n\n'	
		output += '</object>'
		document.getElementById(this.flash_settings.target).innerHTML = output
	},
	insert : function(settings,params) {
		this.flash_settings = settings
		this.flash_params = params
		if (this.check_flash(this.flash_settings.version) == true ) { this.write_flash() }
	}
}
