	jQuery(document).ready(function(){

		jQuery("A").each(function(index, element){
		
			var _el = jQuery(element);
			var _href = _el.attr("href");
			if(_href.indexOf('.mp3') >= 0 && !_el.hasClass("media"))
				_el.addClass("media");
		
		});
		
		
		jQuery(".media").each(function(index, element){
			// Change the Media Class and insert the 1pixelout image
			// The click on the image will load the audio
			var _el = jQuery(element);
			_el.removeClass("media");
			_el.replaceWith('<div class="' + _el.attr("class") + '" style="height:24px; width:200px; background:#FFFFFF;"><a class="linkedaudiomedia" href="' + _el.attr("href") + '"><img border="0" src="/resources/flash/1pixelout.png" /></a></div><div class="' + _el.attr("class") + '">' + _el.html() + '</div>');
			
		});

		jQuery(".linkedaudiomedia").click(function(){
			var _href = jQuery(this).attr("href");

				jQuery(this).media({
					height: 24,
					width: 200,
					autoplay:1,
					src:"/resources/flash/1pixelout.swf",
					flashvars: { soundFile: _href, autostart:"yes" }
					});
				//	debugger;
				pageTracker._trackEvent("Audio", "Play", window.location.pathname + ' - ' + _href);
				//_gaq.push(['_trackEvent', 'Audio', 'Play', window.location.pathname + ' - ' + _href]);
			return false;
		});
			
	});


