(function(b){var c={},f=true,m=function(){for(var a=0;b("#sound_"+a).length;)a++;return"sound_"+a},k=function(a){a&&typeof this.swf_stop=="function"&&this.swf_stop();f&&typeof this.swf_play=="function"&&this.swf_play()},l=function(){typeof this.swf_stop=="function"&&this.swf_stop()},h=function(a){b("#"+a).remove();c[a]=null};b.extend({flashSound:function(a,j){var g=b.extend({},b.flashSound.defaults,j);if(a.constructor==String){var e=g.id?g.id:m();c[e]&&h.call(null,c[e].obj);var d=document.createElement("div"); document.body.appendChild(d);d.innerHTML='<object sap-type="object" sap="object" id="'+e+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/" height="0" width="0"><param name="movie" value="'+g.swf+'" /><param name="FlashVars" value="url='+a+'" /><param name="allowScriptAccess" value="always" /><param name="loop" value="false" /><param name="quality" value="low" /><embed name="'+e+'" src="'+g.swf+'" FlashVars="url='+a+'" type="application/x-shockwave-flash" allowScriptAccess="always" quality="low" loop="false" pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="0" width="0" /></object>'; d=navigator.appName.indexOf("Microsoft")!=-1?d.firstChild:b(d).find("embed").get(0);c[e]={obj:d,play:function(n){k.call(d,n)},stop:function(){l.call(d)},remove:function(){h.call(null,e)}};return c[e]}}});b.flashSound.play=function(a,j){if(c[a])return k.call(c[a].obj,j)};b.flashSound.stop=function(a){if(c[a])return l.call(c[a].obj)};b.flashSound.remove=function(a){if(c[a])return h.call(null,a)};b.flashSound.enable=function(){f=true};b.flashSound.disable=function(){f=false;for(i in c)c[i]&&c[i].stop&& c[i].stop()};b.flashSound.setEnabled=function(a){a?b.flashSound.enable():b.flashSound.disable()};b.flashSound.isEnabled=function(){return f};b.flashSound.toggle=function(a){typeof a=="boolean"?b.flashSound.setEnabled(a):b.flashSound.setEnabled(!f)};b.flashSound.defaults={id:null,swf:"flashSound.swf"}})(jQuery);

