
var BgSound=Class.create({initialize:function(){document.observe('dom:loaded',function(){document.observe('click',this.check.bind(this));}.bind(this));this.currentFile='';soundManager.waitForWindowLoad=true;soundManager.useFlashBlock=false;soundManager.flashVersion=9;soundManager.url="/swf/";soundManager.debugMode=false;this.curSound=null;soundManager.onload=function(){var i=0;$$('a.playsound').each(function(elem){var link=elem.href;elem.href="#";elem.writeAttribute('rel',"sound"+i);soundManager.createSound({id:"sound"+i++,loops:999,url:link});}.bind(this));}.bind(this)},start:function(sound){if(!sound){sound="sound1";}
if(this.currentSound==sound){return;}
soundManager.stopAll();soundManager.play(sound);},stop:function(){soundManager.stopAll();},check:function(event){var sElem=event.findElement('a.playsound');if(typeof(sElem)!="undefined"){this.start(sElem.readAttribute('rel'));var img=sElem.down('img');var ul=sElem.up('ul');var li=ul.down('li.active');var imgActive=li.down('img');imgActive.src=img.src;return event.stop();}
sElem=event.findElement('a.stopsound');if(typeof(sElem)!="undefined"){var img=sElem.down('img');var ul=sElem.up('ul');var li=ul.down('li.active');var imgActive=li.down('img');imgActive.src=img.src;this.stop();return event.stop();}}});
