// Bouncy function for the tooltip plugin
$.easing.bouncy=function(x,t,b,c,d){var s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;}
$.tools.tooltip.addEffect("bouncy",function(done){this.getTip().animate({top:'+=15'},500,'bouncy',done).show();},function(done){this.getTip().animate({top:'-=15'},500,'bouncy',function(){$(this).hide();done.call();});});

$(document).ready(function(){
	// $("ul#bandPhotos").carousel( { slideEasing: "easeOutBounce" } );
	// $("ul#banner").jBanner({height:250,width:960,caption:false,padding:0,speed:2000,delay:5000});
	$('.playerPopup').popupWindow({height:300,width:375,top:50,left:50,toolbar:0,scrollbars:0,menubar:0});
    $('.slideshow').cycle({speed:5000});
	$('.popupLink').colorbox({width:"620", inline:true, href:"#popupBox"});
	$('label').inFieldLabels();
    $("ul#availableOnline li a[title]").tooltip({tip: '#demotip', effect: 'bouncy'});

	// Ajax XML Parser
	// http://webhole.net/2009/12/16/how-to-read-xml-with-javascript/

	function parse(document){
		$(document).find('show').each(function(){
			$("ul#sidebarTourDates").append(
				'<li>'
				+ $(this).find('Date').text() +
				' - '
				+ $(this).find('venueName').text() +
				' - '
				+ $(this).find('city').text() +', ' + $(this).find('State').text() +
				'</li>'
			);
		});
	}
	$.ajax({
		type: 'GET',
		url: 'http://www.birdsofwales.com/wp-content/themes/bow3.0/pastShows.php', // name of file you want to parse
		success: parse,
		// error: function(){alert("Error: Something went wrong");}
	});
});
	