var Page = {};
$(document).ready(function(){
	var so = new SWFObject("/assets/mp3/mp3-player/flashmp3player.swf", "player", "300", "105", "9"); 		
	so.addParam("quality", "high");
	so.addVariable("content_path","music"); /*Location of a folder with mp3 files (relative to php script).*/
	so.addVariable("color_path","/assets/mp3/mp3-player/default.xml"); /*Location of xml file with color settings.*/
	so.addVariable("script_path","/assets/mp3/mp3-player/flashmp3player.php"); /*Location of php script.*/
	so.write("mp3Player");
	
	/*Get Twitter Feed*/
	var TwitterFeed = function(){
    	$.getJSON("http://twitter.com/statuses/user_timeline/morobsonband.json?count=9&callback=?",function(json){
    		Page.Test = json;
    		$("#twitterFeed").append(document.createElement("ul"));
    		$.each(json,function(){
                var status = this.text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) { return '<a target="_blank" href="' + url + '">' + url + '</a>'; })
                .replace(/\B@([_a-z0-9]+)/ig, function( reply ) { return reply.charAt(0) + '<a href="http://www.twitter.com/' + reply.substring(1) + '">' + reply.substring(1) +'</a>'; });
                $("#twitterFeed ul").append("<li>"+status+"</li>");
    		});
    	});
        $.getJSON("/data/data.php",function(data){
        $("#tourScheduleTable tbody").empty();
              $(data).each(function(i){
                  if(i>0 && typeof this[0]!="undefined"){
                      $("#tourScheduleTable tbody").append('<tr>' + '<td class="date">' + this[0] + '</td>' + '<td class="loc">' + this[1] + '</td>' + '<td class="time">' + this[2] + '</td>' + '</tr>');
                  }
              });
        });
    };
    Page.TwitterFeed = new TwitterFeed();		
});

