Kidzbop.AudioPlayer=Class.create({loop:false,playing:false,initialize:function(){},setPlayer:function(flashPlayer){this.flashPlayer=flashPlayer;},onInit:function(){},onUpdate:function(){if(this.isPlaying=="false"){if(this.loop&&this.playing){this.playSong();}else{this.stop();}}},play:function(track){this.stop();this.playing=true;this.currentTrack=track;this.playSong();this.currentTrack.play();},playSong:function(){if(this.flashPlayer){this.flashPlayer.SetVariable("method:setUrl",this.currentTrack.url);this.flashPlayer.SetVariable("method:play","");this.flashPlayer.SetVariable("enabled","true");}},stop:function(){if(this.currentTrack!=null){this.currentTrack.stop();}
this.playing=false;if(this.flashPlayer){this.flashPlayer.SetVariable("method:stop","");}}});Kidzbop.Track=Class.create({initialize:function(url,albumName,trackName,playButton,stopButton){this.url=url;this.albumName=albumName;this.trackName=trackName;this.playButton=playButton;this.stopButton=stopButton;},play:function(){if(this.playButton){this.playButton.hide();var play_number=this.playButton.up('div.play_number');if(play_number){play_number.addClassName('show_play');}}
if(this.stopButton){this.stopButton.show();}
if(typeof(pageTracker)!='undefined'){pageTracker._trackEvent("Cd Albums",this.albumName,this.trackName+' play event');}},stop:function(){if(this.stopButton){this.stopButton.hide();}
if(this.playButton){this.playButton.show();var play_number=this.playButton.up('div.play_number');if(play_number){play_number.removeClassName('show_play');}}}});var audioPlayer=new Kidzbop.AudioPlayer();