/*

<script language="JavaScript" type="text/javascript">

	var s = new Swf("main.swf",100%,100%,"8,0,0,0");
	s.flashvars("&amp;A=B");
	s.write();

</script>

*/

function Swf(swf,w,h,v) {
    this._vars = null;
    this._swf = swf;
    this._w = w;
    this._h = h;
    this._v = v;
}
Swf.prototype.flashvars = function(str) {
    this._vars = str;
}
Swf.prototype.allowFullScreen = function(str) {
    this._allowFullScreen = str;
}
Swf.prototype.WMode = function(str) {
    this._wmode = str;
}
Swf.prototype.bgColor = function(str) {
    this._bgColor = str;
}
Swf.prototype.ID = function(str) {
    this._ID = str;
}
Swf.prototype.write = function() {
    var out = "";
    if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
        out += '<embed src="' + this._swf + '" width="' + this._w + '" height="' + this._h + '"';
        out += ' flashvars="'+this._vars+'"';
		if(this._wmode!="") { out +=' WMode="'+this._wmode+'"'; }
		if(this._allowFullScreen!="") { out +=' allowFullScreen="'+this._wmode+'"'; }
		if(this._bgColor!="") { out +=' bgcolor="'+this._bgColor+'"'; }
        out += ' quality="high" menu="false" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"';
        if(this._ID!="") { out += ' name="'+this._ID+'" />'; }
    } else {
        out += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
        out += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this._v+'"';
        out += ' width="'+this._w+'" height="'+this._h+'" id="'+this._id+'">';
        out += ' <param name="movie" value="'+this._swf+'" />';
	if(this._wmode!="") { out +=' <param name="WMode" value="'+this._wmode+'" />'; }
	if(this._allowFullScreen!="") { out +=' <param name="allowFullScreen" value="'+this._allowFullScreen+'" />'; }
	if(this._bgColor!="") { out +=' name="bgcolor" value="'+this._bgColor+'"'; }
        out += ' <param name="flashvars" value="'+this._vars+'" />'
        out += ' <param name="allowScriptAccess" value="sameDomain" />';
        out += ' <param name="quality" value="high" />';
        out += ' <param name="menu" value="false" />';
        out += '</object>';
    }
    document.write(out);
}