window.addEvent('domready', function() {
   
   
   var beats = ["/content/radio/60901.mp3",
   				"/content/radio/FirstCrash.mp3",
   				"/content/radio/LIFE.mp3",
   				"/content/radio/PacBlood.mp3",
   				"/content/radio/SeentYew.mp3",
   				"/content/radio/SillyHuman.mp3"]
   
   var hide = new Fx.Tween('text01', {
    duration: '0',
    transition: 'quad:in:out',
    property: 'opacity'
	});
	
	var hideLogo = new Fx.Tween('theLogo', {
    duration: '0',
    transition: 'quad:in:out',
    property: 'opacity'
	});
	
	var reveal = new Fx.Tween('text01', {
    duration: '5000',
    transition: 'quad:in:out',
    property: 'opacity'
	});
	
	var revealLogo = new Fx.Tween('theLogo', {
    duration: '12000',
    property: 'opacity',
    onComplete: function() {
	       reveal.start(0, .95);
	   }
	});
   
   hide.start(1,0);
   hideLogo.start(1,0);
   
   revealLogo.start(0, 1);
   
   	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) 
	{
   		
	}
   
   $("#radio").jPlayer({
			ready: function (event) {
				$(this).jPlayer("setMedia", {
					mp3:beats[Math.floor(Math.random()*beats.length)]
				}).jPlayer("play");
			},
			swfPath: "js",
			supplied: "mp3",
			wmode: "window"
	});
	
	$("#radio").bind($.jPlayer.event.timeupdate, function(event)
	{ // Add a listener to report the time play began
  		//$("#time").text("Current Time is " + event.jPlayer.status.currentTime);
  		
  		var convertedTime = ($.jPlayer.convertTime(event.jPlayer.status.currentTime))
  		
  		$("#time").text(convertedTime);
  		
  		if(convertedTime == "00:05")
  		{
  			//revealLogo.start(0, 1);
  		}
  		
	});
});
