$(document).ready(function(){
		$('#dialog').dialog({
			modal: true,
			autoOpen: false,
			show: 'blind',
			hide: 'blind',
			height: 500,
			width:700,
			buttons: {
				Close: function() {
					$(this).dialog('close');
				}
			}			
		});
		
		
		GetAjaxData("http://www.watermen.ca/data/schedule.xml");
		$('#opener').click(function() {
			$('#dialog').dialog('open');
			return false;
		});

		

		function GetAjaxData(URI){	
			var html="";
			var ticker="";
			$.ajax({
				type: "GET",
				url: URI,
				dataType: "xml",
				success: function(data){
					$(data).find("show").each(function() {
						html+="<b>" + $(this).find("date").text() + " " + $(this).find("time").text() + "</b><br />";
						html+=$(this).find("venue").text() + "<br />";
						html+=$(this).find("city").text() + "<br /><br />";		
						ticker+="<li><b><span style='color:#99C0FB;'>" + $(this).find("date").text() + " " + $(this).find("time").text() + "</span></b> " + $(this).find("venue").text() + " " + $(this).find("city").text() + " &nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;</li>";
					});					
					
					$('ul#ticker01').html(ticker);
					$("ul#ticker01").liScroll({travelocity: 0.05}); 
					$('#scrollingContent').html(html);
				},
				error: function(e){
					//alert("Unavailable");
				}
			});
		}		
		
		
	});
