if (typeof(Perch) == 'undefined') {
	Perch		= {};
	Perch.UI	= {};
}

Perch.UI.Audio = function() {
	
	var init	= function() {
		$('body').addClass('js');
		replace_audio();
	};

	var replace_audio = function() {

		if (typeof(AudioPlayer)!== 'undefined') {
			
			
			AudioPlayer.setup("/assets/audio-player/player.swf", {  
			        width: 290,  
			        initialvolume: 100,  
			        transparentpagebg: "yes",  
			        left: "000000",  
			        lefticon: "FFFFFF"  
			    });
			

			$('a.audio').each(function(i, o){
				var me = $(o);
				me.attr('id', 'autoaudio_'+i);

				AudioPlayer.embed('autoaudio_'+i, {  
				    soundFile: me.attr('href'),  
				    autostart: "no"  
				});
			
			
			});
		}
	};
	

	return {
		init: init
	};

}();

jQuery(function($) {Perch.UI.Audio.init();});