// JavaScript Document
var prevArtid=0;


$(document).ready(function() {
						   
	$("#songlist li").click(function() {
		var artid = $(this).attr("artid");
		var content = $("div[artid='"+artid+"']").html();
		if (prevArtid == artid) {
			$("#lyrics .chosen-content").toggle("slow");
		} else {
			$("#lyrics .chosen-content").hide("slow", function() {
				$("#lyrics .chosen-content").html(content);
				$("#lyrics .chosen-content").show("slow");
			});
		}
		prevArtid = artid;
	});
	
	
	$("#showlist li").click(function() {
		var artid = $(this).attr("artid");
		var content = $("div[artid='"+artid+"']").html();
		if (prevArtid == artid) {
			$("#shows .chosen-content").toggle("slow");
		} else {
			$("#shows .chosen-content").hide("slow", function() {
				$("#shows .chosen-content").html(content);
				$("#shows .chosen-content").show("slow");
			});
		}
		prevArtid = artid;
		checkResizeableImage();
	});
	
	$("#press ul li[artid]").click(function() {
		showContent($(this), "#press .chosen-content");
		
	});
	
	$("#press ul li[catid]").click(function() {
		subList($(this));
	});
	
	/*
	$('ul.accordeon li').click(function() {
		//alert ($(this));
		alert ($(this).attr("artid"));
	}); 
	*/
	
	$('ul.accordeon li[artid]').click(function() {
		//alert ($(this));
		showContent($(this), "#videos .chosen-content");
		//alert ($(this).attr("artid"));
	}); 
	
	
});


function showContent(aThis, aContentBox) {
	var artid = $(aThis).attr("artid");
	//alert (artid);
	var content = $("div[artid='"+artid+"']").html();
	if (prevArtid == artid) {
		$(aContentBox).toggle("slow");
	} else {
		$(aContentBox).hide("slow", function() {
			$(aContentBox).html(content);
			$(aContentBox).show("slow");
		});
	}
	prevArtid = artid;
	checkResizeableImage();
}



function subList(aThis) {
	var catid = $(aThis).attr("catid");
	//alert (catid);
	$("ul#cat-"+catid).toggle("fast");
}






