function FlashEmbed(swf,id,width,height,color,quality,version,redirectUrl){
	this.params = new Object();
	this.attributes = new Object();
	if(color) this.addParam('bgcolor', color);
	if(quality) this.addParam('quality', quality);
	this.setAttribute('src', swf);
	this.setAttribute('id', id ? id : '');
	this.setAttribute('width', width ? width : '100');
	this.setAttribute('height', height ? height : '100');
	if(version){
		this.reqVersion = version.toString().split(version.indexOf(",") > -1 ? "," : ":");
		var i = this.reqVersion.length;
		while(i--){
			this.reqVersion[i] = parseInt(this.reqVersion[i]) || 0;
		}
	}
	if(redirectUrl){
		this.redirectUrl = redirectUrl;
	}
}
var p = FlashEmbed.prototype;
p.addParam = function(name, value){
	this.params[name] = value;
};
p.setAttribute = function(name, value){
	this.attributes[name] = value;
};
p.output = function(){
	if(this.reqVersion){
		if(!this.playerVersionIsValid()){
			if(this.redirectUrl) {
				document.location.replace(this.redirectUrl);
			}
			return false;
		}
	}
	var swf = "";
	if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { //Netscape
			swf += '<embed type="application/x-shockwave-flash"';
			swf += ' name="'+ this.attributes['id'] + '"';
			for (var key in this.attributes){
				swf += ' ' + key + '="' + this.attributes[key] + '"';
			}
			for (var key in this.params){
				swf += ' ' + key + '="' + this.params[key] + '"';
			}
			swf += '/>';
	} else { //IE
			swf += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
			for (var key in this.attributes){
				if(key != 'src'){
					swf += ' ' + key + '="' + this.attributes[key] + '"';
				}
			}
			swf += '>';
			swf += '<param name="movie" value="' + this.attributes['src'] + '" />';
			for (var key in this.params){
				swf += '<param name="'+ key +'" value="'+ this.params[key] + '" />';
			}
			swf += "</object>";
	}
	document.write(swf);
	return true
};
p.playerVersionIsValid = function(){
	var version = [0,0,0];
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			version = x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".");
		}
	}else{
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			for (var i=3; axo!=null; i++) {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
				version = [i,0,0];
			}
		}catch(e){}
		if (version[0] == this.reqVersion[0]){
			//minor version:
			if ((this.reqVersion[1] != 0 || this.reqVersion[2] != 0) || version[0] != 6) {//skip version 6, cause of IE bug
				try{
					version = axo.GetVariable("$version").split(" ")[1].split(",");
				}catch(e){}
			}
		}
	}
	var i = -1;
	while(++i < version.length){
		version[i] = parseInt(version[i]) || 0;
		if(version[i] < this.reqVersion[i]) return false;
		if(version[i] > this.reqVersion[i]) return true;
	}
	return true;
}
delete p;