function FlashTag(_1,_2,_3,_4){
if(arguments.length<4){
throw new Exception("RequiredParameterException","You must pass in a src, width, height, and version when creating a FlashTag.");
}
this.src=_1;
this.width=_2;
this.height=_3;
this.version=_4;
this.id=null;
this.flashVars=null;
this.flashVarsStr=null;
this.genericParam=new Object();
this.ie=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
FlashTag.prototype.setSource=function(_5){
this.src=_5;
};
FlashTag.prototype.setWidth=function(w){
this.width=width;
};
FlashTag.prototype.setHeight=function(h){
this.h=height;
};
FlashTag.prototype.setVersion=function(v){
this.version=v;
};
FlashTag.prototype.setId=function(id){
this.id=id;
};
FlashTag.prototype.setBgcolor=function(_a){
if(_a.charAt(0)!="#"){
_a="#"+_a;
}
this.genericParam["bgcolor"]=_a;
};
FlashTag.prototype.addFlashVars=function(_b){
this.flashVarsStr=_b;
};
FlashTag.prototype.addFlashVar=function(n,v){
if(this.flashVars==null){
this.flashVars=new Object();
}
this.flashVars[n]=v;
};
FlashTag.prototype.removeFlashVar=function(n){
if(this.flashVars!=null){
this.flashVars[n]=null;
}
};
FlashTag.prototype.setSwliveconnect=function(_f){
this.genericParam["swliveconnect"]=_f;
};
FlashTag.prototype.setPlay=function(p){
this.genericParam["play"]=p;
};
FlashTag.prototype.setLoop=function(l){
this.genericParam["loop"]=l;
};
FlashTag.prototype.setMenu=function(m){
this.genericParam["menu"]=m;
};
FlashTag.prototype.setQuality=function(q){
if(q!="low"&&q!="high"&&q!="autolow"&&q!="autohigh"&&q!="best"){
throw new Exception("UnsupportedValueException","Supported values are \"low\", \"high\", \"autolow\", \"autohigh\", and \"best\".");
}
this.genericParam["quality"]=q;
};
FlashTag.prototype.setScale=function(sc){
if(sc!="showall"&&sc!="noborder"&&sc!="exactfit"){
throw new Exception("UnsupportedValueException","Supported values are \"showall\", \"noborder\", and \"exactfit\".");
}
this.genericParam["scale"]=sc;
};
FlashTag.prototype.setAlign=function(a){
if(a!="l"&&a!="t"&&a!="r"&&a!="b"){
throw new Exception("UnsupportedValueException","Supported values are \"l\", \"t\", \"r\" and \"b\".");
}
this.genericParam["align"]=a;
};
FlashTag.prototype.setSalign=function(sa){
if(sa!="l"&&sa!="t"&&sa!="r"&&sa!="b"&&sa!="tl"&&sa!="tr"&&sa!="bl"&&sa!="br"){
throw new Exception("UnsupportedValueException","Supported values are \"l\", \"t\", \"r\", \"b\", \"tl\", \"tr\", \"bl\" and \"br\".");
}
this.genericParam["salign"]=sa;
};
FlashTag.prototype.setWmode=function(wm){
if(wm!="window"&&wm!="opaque"&&wm!="transparent"){
throw new Exception("UnsupportedValueException","Supported values are \"window\", \"opaque\", and \"transparent\".");
}
this.genericParam["wmode"]=wm;
};
FlashTag.prototype.setBase=function(_18){
this.genericParam["base"]=_18;
};
FlashTag.prototype.setAllowScriptAccess=function(sa){
if(sa!="never"&&sa!="always"){
throw new Exception("UnsupportedValueException","Supported values are \"never\" and \"always\".");
}
this.genericParam["allowScriptAccess"]=sa;
};
FlashTag.prototype.toString=function(){
var _1a=new String();
if(this.ie){
_1a+="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
if(this.id!=null){
_1a+="id=\""+this.id+"\" ";
}
_1a+="codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+this.version+"\" ";
_1a+="width=\""+this.width+"\" ";
_1a+="height=\""+this.height+"\">";
_1a+="<param name=\"movie\" value=\""+this.src+"\"/>";
for(var n in this.genericParam){
if(this.genericParam[n]!=null){
_1a+="<param name=\""+n+"\" value=\""+this.genericParam[n]+"\"/>";
}
}
if(this.flashVars!=null||this.flashVarsStr!=null){
var fv=this.getFlashVarsAsString();
if(fv.length>0){
_1a+="<param name=\"flashvars\" value=\""+fv+"\"/>";
}
}
_1a+="</object>";
}else{
_1a+="<embed src=\""+this.src+"\"";
_1a+=" width=\""+this.width+"\"";
_1a+=" height=\""+this.height+"\"";
_1a+=" type=\"application/x-shockwave-flash\"";
if(this.id!=null){
_1a+=" name=\""+this.id+"\"";
}
for(var n in this.genericParam){
if(this.genericParam[n]!=null){
_1a+=(" "+n+"=\""+this.genericParam[n]+"\"");
}
}
if(this.flashVars!=null||this.flashVarsStr!=null){
var fv=this.getFlashVarsAsString();
if(fv.length>0){
_1a+=" flashvars=\""+fv+"\"";
}
}
_1a+=" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">";
_1a+="</embed>";
}
return _1a;
};
FlashTag.prototype.write=function(doc){
doc.write(this.toString());
};
FlashTag.prototype.getFlashVarsAsString=function(){
var qs=new String();
for(var n in this.flashVars){
if(this.flashVars[n]!=null){
qs+=(escape(n)+"="+escape(this.flashVars[n])+"&");
}
}
if(this.flashVarsStr!=null){
return qs+this.flashVarsStr;
}
return qs.substring(0,qs.length-1);
};

