/** @ignore */
String.prototype.REGEXP_FORMAT_METHOD = /\{(?:([\w_-]+)(?:\:([\w_-]+))?)\}/gim;
/**	@id compono_stringFormat */
String.prototype.format = function(args){
	var a=args||arguments;
	return this.replace(this.REGEXP_FORMAT_METHOD, function(str,parentesis1,parentesis2,index,allstr){
		var x = a[parentesis1];
		switch(parentesis2){
			case "Q":
				var v="",s="";for(var i in x){v+=s+i+"="+x[i];s="&"};x=v;
				break;
		}
		return x||"";
	});
};

function Flash(id,src,width,height,vars,allowScriptAccess,wmode,scale,salign){
	this.id=id||"Flash";
	this.src=src;
	this.width=width;
	this.height=height;
	this.vars=vars;
	this.wmode=wmode||"transparent";
	this.allowScriptAccess=allowScriptAccess||"always";
	this.scale=scale||"noscale";
	this.salign=salign||"LT";
}

Flash.prototype={
	toString:function(){return "Flash " + this.id;},
	swf:"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"{width}\" height=\"{height}\" id=\"{id}\"><param name=\"allowScriptAccess\" value=\"{allowScriptAccess}\" /><param name=\"movie\" value=\"{src}?{vars:Q}\" /><param name=\"wmode\" value=\"{wmode}\" /><param name=\"scale\" value=\"{scale}\" /><param name=\"salign\" value=\"{salign}\" /><param name=\"quality\" value=\"high\" /><embed src=\"{src}?{vars:Q}\" quality=\"high\" width=\"{width}\" height=\"{height}\" wmode=\"{wmode}\" name=\"{id}\" allowScriptAccess=\"{allowScriptAccess}\" type=\"application/x-shockwave-flash\" pluginspage=\"//www.macromedia.com/go/getflashplayer\" scale=\"{scale}\" salign=\"{salign}\" /></object>",
	render:function(c){
		var s = this.swf.format(this);
		if(c){
			if(typeof(c)=="string")c=document.getElementById(c);
			c.innerHTML = s;
		}
		return s;
	}
}