flashReplace={requiredVersion:8,flashObjects:new Array(),installedVersion:0,done:false,init:function(){if(navigator.plugins&&navigator.mimeTypes.length){if(navigator.plugins["Shockwave Flash"]&&navigator.plugins["Shockwave Flash"].description)flashReplace.installedVersion=navigator.plugins["Shockwave Flash"].description.replace(/([a-zA-Z]|\s)+/,"").split(".")[0];}else{try{flashReplace.installedVersion=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").split(" ")[1].split(",")[0];}catch(e){flashReplace.installedVersion=0;};};if(flashReplace.installedVersion>=flashReplace.requiredVersion)flashReplace.replaceAll();},add:function(element,swf,type){flashReplace.flashObjects[flashReplace.flashObjects.length]=[element,swf,type];if(flashReplace.done&&id(element))flashReplace.replaceOne(element,swf,id(element),type);},rgb:function(red,green,blue){var hexChars="0123456789ABCDEF";var hexColor=""
for(var i=0;i<arguments.length;i++){hexColor+=hexChars.charAt((arguments[i]- arguments[i]%16)/16)+ hexChars.charAt(arguments[i]%16);};return"#"+ hexColor;},replaceAll:function(){for(var i in flashReplace.flashObjects){var swfId=flashReplace.flashObjects[i][0];var swf=flashReplace.flashObjects[i][1];var element=id(swfId);if(element){flashReplace.replaceOne(swfId,swf,element,flashReplace.flashObjects[i][2]);};};flashReplace.done=true;},replaceOne:function(swfId,swf,element,isText){var swfNode;var width=element.offsetWidth||"auto";var height=element.offsetHeight||"auto";if(isText){if(element.currentStyle){var color=element.currentStyle["color"];}else if(document.defaultView&&document.defaultView.getComputedStyle){var color=document.defaultView.getComputedStyle(element,"").getPropertyValue("color");};if(color.indexOf("#")==-1)color=eval("flashReplace."+ color);swf+="?txt="+ element.innerHTML+"&textcolor="+ color+"&w="+ width+"&h="+ height;};if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length&&/gecko/.test(navigator.userAgent.toLowerCase())){swfNode=document.createElement("embed");swfNode.setAttribute("type","application/x-shockwave-flash");swfNode.setAttribute("src",swf);swfNode.setAttribute("width",width);swfNode.setAttribute("height",height);swfNode.setAttribute("id","swf"+ swfId);swfNode.setAttribute("name","swf"+ swfId);swfNode.setAttribute("wmode","transparent");while(element.hasChildNodes()){element.removeChild(element.firstChild);};element.appendChild(swfNode);}else{swfNode='<object id="swf'+ swfId+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ width+'" height="'+ height+'"><param name="movie" value="'+ swf+'" /><param name="wmode" value="transparent" /></object>';element.innerHTML=swfNode;};}};addDOMLoadEvent(flashReplace.init);
