function Exception(a,b){if(a){this.name=a;}if(b){this.message=b;}}Exception.prototype.setName=function(a){this.name=a;};Exception.prototype.getName=function(){return this.name;};Exception.prototype.setMessage=function(a){this.message=a;};Exception.prototype.getMessage=function(){return this.message;};
function FSFlashTag(c,b,a){this.src=c;this.width=b;this.height=a;this.version="7,0,14,0";this.id=null;this.bgcolor=null;this.flashVars=null;this.salign=null;this.scale=null;this.wmode="transparent";this.wmodeFF=null;}FSFlashTag.prototype.setVersion=function(a){this.version=a;};FSFlashTag.prototype.setId=function(a){this.id=a;
};FSFlashTag.prototype.setBgcolor=function(a){this.bgcolor=a;};FSFlashTag.prototype.setSalign=function(a){this.salign=a;};FSFlashTag.prototype.setScale=function(a){this.scale=a;};FSFlashTag.prototype.setWmode=function(a){this.wmode=a;};FSFlashTag.prototype.setWmodeFF=function(a){this.wmodeFF=a;};FSFlashTag.prototype.setFlashvars=function(a){this.flashVars=a;
};FSFlashTag.prototype.toString=function(){var b=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;var a=new String();if(b){a+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';if(this.id!=null){a+='id="'+this.id+'" ';}a+='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
a+='width="'+this.width+'" ';a+='height="'+this.height+'">';a+='<param name="movie" value="'+this.src+'"/>';a+='<param name="quality" value="high"/>';if(this.bgcolor!=null){a+='<param name="bgcolor" value="#'+this.bgcolor+'"/>';}a+='<param name="allowScriptAccess" value="always"/>';if(this.wmode!=null){a+='<param name="wmode" value="'+this.wmode+'"/>';
}if(this.salign!=null){a+='<param name="salign" value="'+this.salign+'"/>';}if(this.scale!=null){a+='<param name="scale" value="'+this.scale+'"/>';}if(this.flashVars!=null){a+='<param name="flashvars" value="'+this.flashVars+'"/>';}a+="</object>";}else{a+='<embed src="'+this.src+'" ';a+='quality="high" ';
if(this.bgcolor!=null){a+='bgcolor="#'+this.bgcolor+'" ';}a+='width="'+this.width+'" ';a+='height="'+this.height+'" ';a+='allowScriptAccess="always" ';a+='type="application/x-shockwave-flash" ';if(this.wmodeFF!=null){a+='wmode="'+this.wmodeFF+'" ';}if(this.scale!=null){a+='scale="'+this.scale+'" ';}if(this.flashVars!=null){a+='flashvars="'+this.flashVars+'" ';
}if(this.id!=null){a+='name="'+this.id+'" ';a+='id="'+this.id+'" ';}if(this.salign!=null){a+='salign="'+this.salign+'" ';}a+='pluginspage="http://www.macromedia.com/go/getflashplayer">';a+="</embed>";}return a;};FSFlashTag.prototype.write=function(a){a.write(this.toString());};function FlashSerializer(a){this.useCdata=a;
}FlashSerializer.prototype.serialize=function(b){var a=new String();for(var d=0;d<b.length;++d){switch(typeof(b[d])){case"undefined":a+="t"+(d)+"=undf";break;case"string":a+="t"+(d)+"=str&d"+(d)+"="+escape(b[d]);break;case"number":a+="t"+(d)+"=num&d"+(d)+"="+escape(b[d]);break;case"boolean":a+="t"+(d)+"=bool&d"+(d)+"="+escape(b[d]);
break;case"object":if(b[d]==null){a+="t"+(d)+"=null";}else{if(b[d] instanceof Date){a+="t"+(d)+"=date&d"+(d)+"="+escape(b[d].getTime());}else{try{a+="t"+(d)+"=xser&d"+(d)+"="+escape(this._serializeXML(b[d]));}catch(c){throw new Exception("FlashSerializationException","The following error occurred during complex object serialization: "+c.getMessage());
}}}break;default:throw new Exception("FlashSerializationException","You can only serialize strings, numbers, booleans, dates, objects, arrays, nulls, and undefined.");}if(d!=(b.length-1)){a+="&";}}return a;};FlashSerializer.prototype._serializeXML=function(b){var a=new Object();a.xml="<fp>";this._serializeNode(b,a,null);
a.xml+="</fp>";return a.xml;};FlashSerializer.prototype._serializeNode=function(d,c,a){switch(typeof(d)){case"undefined":c.xml+="<undf"+this._addName(a)+"/>";break;case"string":c.xml+="<str"+this._addName(a)+">"+this._escapeXml(d)+"</str>";break;case"number":c.xml+="<num"+this._addName(a)+">"+d+"</num>";
break;case"boolean":c.xml+="<bool"+this._addName(a)+' val="'+d+'"/>';break;case"object":if(d==null){c.xml+="<null"+this._addName(a)+"/>";}else{if(d instanceof Date){c.xml+="<date"+this._addName(a)+">"+d.getTime()+"</date>";}else{if(d instanceof Array){c.xml+="<array"+this._addName(a)+">";for(var b=0;
b<d.length;++b){this._serializeNode(d[b],c,null);}c.xml+="</array>";}else{c.xml+="<obj"+this._addName(a)+">";for(var e in d){if(typeof(d[e])=="function"){continue;}this._serializeNode(d[e],c,e);}c.xml+="</obj>";}}}break;default:throw new Exception("FlashSerializationException","You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined");
break;}};FlashSerializer.prototype._addName=function(a){if(a!=null){return' name="'+a+'"';}return"";};FlashSerializer.prototype._escapeXml=function(a){if(this.useCdata){return"<![CDATA["+a+"]]>";}else{return a.replace(/&/g,"&amp;").replace(/</g,"&lt;");}};function FlashProxy(a,b){this.uid=a;this.proxySwfName=b;
this.flashSerializer=new FlashSerializer(false);}FlashProxy.prototype.call=function(){if(arguments.length==0){throw new Exception("Flash Proxy Exception","The first argument should be the function name followed by any number of additional arguments.");}var a="lcId="+escape(this.uid)+"&functionName="+escape(arguments[0]);
if(arguments.length>1){var c=new Array();for(var b=1;b<arguments.length;++b){c.push(arguments[b]);}a+=("&"+this.flashSerializer.serialize(c));}var d="_flash_proxy_"+this.uid;if(!document.getElementById(d)){var f=document.createElement("div");f.id=d;document.body.appendChild(f);}var e=document.getElementById(d);
var g=new FSFlashTag(this.proxySwfName,1,1);g.setVersion("6,0,65,0");g.setFlashvars(a);e.innerHTML=g.toString();};FlashProxy.callJS=function(){var functionToCall=eval(arguments[0]);var argArray=new Array();for(var i=1;i<arguments.length;++i){argArray.push(arguments[i]);}functionToCall.apply(functionToCall,argArray);
};
