switchContent=function(id){
	$("#content .section[id!='"+id+"']").hide();
	id='#content #'+id;
	$(id).show();
	if($(id).height()<300){
		$(id).height(300);
	}
}

freeDownload=function(){
	$('#download').trigger("click");
}

$(document).ready(function(){
	$("#nav a").click(function(){	
		if(this.href.toLowerCase().indexOf("javascript")>-1){
			$("#nav a[id!='"+this.id+"']").removeClass("active");
			$(this).addClass("active");
			switchContent(this.id+"-section");
		}
	});
	//
	$("#nav #news a").click();
	//
	$('#photos-section a').lightBox();
	$('#video-section a').lightBox();
	//$('#signup').lightBox();
	$('#download').lightBox();

	
	$.ajax({
	  url: "includes/site_tours.xml",
	  cache: false,
	  success: function(data){
	  	
		var html='<table cellspacing="0">';
		for(var i=0; i<$(data).find('artist_tours artist event').length; i++){
			var event=$(data).find('artist_tours artist event');
			html+="<tr>";
			html+='<td class="date">'+event.eq(i).attr("date")+'</td>';  
			if(event.eq(i).attr("country")=="USA"){
				html+='<td class="loc">'+event.eq(i).attr("city")+", "+event.eq(i).attr("state")+'</td>';
			}else{
				html+='<td class="loc">'+event.eq(i).attr("city")+", "+event.eq(i).attr("country")+'</td>';
			}
			html+='<td class="venue">'+event.eq(i).attr("name")+'</td>';  
			if(event.eq(i).attr("url")!=""){
				html+='<td class="url"><a href="'+event.eq(i).attr("url")+'" target="_blank">BUY</a></td>';  
			}else{
				html+='<td></td>';  

			}
			html+="</tr>"
		};
		html+="</table>"
		$('#tour-section').html(html);
	  }
	});
	
});