// schillmania
function SoundManager() {
  var self=this; this.swf=null; this.unsupported=0;
  this.FlashObject=function(url) { var me=this; this.o=null; this.loaded=false;
    this.isLoaded=function() { if (me.loaded) return true; if (!me.o) return false;
      me.loaded=((typeof(me.o.readyState)!='undefined' && me.o.readyState == 4) || (typeof(me.o.PercentLoaded)!='undefined' && me.o.PercentLoaded() == 100));
      return me.loaded; }
    this.mC=document.createElement('div'); this.mC.className='movieContainer';
    with (this.mC.style) { position='absolute'; left='-256px'; width='64px'; height='64px'; }
    var html=['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"><param name="movie" value="'+url+'"><param name="quality" value="high"></object>','<embed src="'+url+'" width="1" height="1" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>'];
    if (navigator.appName.toLowerCase().indexOf('microsoft')+1) {
      this.mC.innerHTML=html[0]; this.o=this.mC.getElementsByTagName('object')[0]; }
    else { this.mC.innerHTML=html[1]; this.o=this.mC.getElementsByTagName('embed')[0]; }
    document.getElementsByTagName('div')[0].appendChild(this.mC); }
  this.checkMovie=function() { if (!self.swf) return false;
    return (self.swf.isLoaded())?self.swf:false; }
  this.checkLoad=function(soundID) {
    var movie=self.checkMovie(); if (!movie) return false;
    try { self.setVariable(soundID,'loopCount',1,movie); movie.o.TCallLabel('/'+soundID,'start'); }
    catch(e) { return false; }
    movie.o.TCallLabel('/'+soundID,'stop'); return true;
  }
  this.play=function(soundID,loopCount) { if (self.unsupported) return false;
    var movie=self.checkMovie(); if (!movie) return false;
    if (typeof(movie.o.TCallLabel)=='undefined') return false;
    try { self.setVariable(soundID,'loopCount',loopCount||1,movie); movie.o.TCallLabel('/'+soundID,'start'); } catch(e) {}}
  this.stop=function(soundID) { if (self.unsupported) return false;
    var movie=self.checkMovie(0); if (!movie) return false; try { movie.o.TCallLabel('/'+soundID,'stop'); } catch(e) {}}
  this.setVariable=function(soundID,property,value,oMovie) { if (!oMovie) return false;
    try { oMovie.o.SetVariable('/'+soundID+':'+property,value); } catch(e) {}}
  this.setVariableExec=function(soundID,fromMethodName,oMovie) { try { oMovie.o.TCallLabel('/'+soundID,'setVariable'); } catch(e) {}}
  this.callMethodExec=function(soundID,fromMethodName,oMovie) { try { oMovie.o.TCallLabel('/'+soundID,'callMethod'); } catch(e) {}}
  this.callMethod=function(soundID,methodName,methodParam) { var movie=self.checkMovie(0); if (!movie) return false;
    self.setVariable(soundID,'jsProperty',methodName,movie);
    self.setVariable(soundID,'jsPropertyValue',methodParam,movie);
    self.callMethodExec(soundID,methodName,movie); }
  this.setPan=function(soundID,pan) { self.callMethod(soundID,'setPan',pan); }
  this.setVolume=function(soundID,volume) { self.callMethod(soundID,'setVolume',volume); }
  if (navigator.appName.toLowerCase().indexOf('internet explorer')+1 && navigator.appVersion.toLowerCase().indexOf('mac')+1)
    this.unsupported=1;
  if (!this.unsupported) { self.swf=new self.FlashObject('aud/sm1.swf'); }
}
var soundManager=null;
function soundManagerInit() { soundManager=new SoundManager(); }
