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