Sound={tracks:{},_enabled:!0,template:new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),enable:function(){Sound._enabled=!0},disable:function(){Sound._enabled=!1},play:function(c,d){if(Sound._enabled){var a=Object.extend({track:"global",url:c,replace:!1},d||{});a.replace&&this.tracks[a.track]&&($R(0,this.tracks[a.track].id).each(function(b){b=$("sound_"+a.track+"_"+b);b.Stop&&b.Stop();b.remove()}),this.tracks[a.track]=null);
this.tracks[a.track]?this.tracks[a.track].id++:this.tracks[a.track]={id:0};a.id=this.tracks[a.track].id;$$("body")[0].insert(Prototype.Browser.IE?new Element("bgsound",{id:"sound_"+a.track+"_"+a.id,src:a.url,loop:1,autostart:!0}):Sound.template.evaluate(a))}}};
if(Prototype.Browser.Gecko&&navigator.userAgent.indexOf("Win")>0)navigator.plugins&&$A(navigator.plugins).detect(function(c){return c.name.indexOf("QuickTime")!=-1})?Sound.template=new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>'):Sound.play=function(){};

