
window.onload = init;

function init() {
	toggleMusical(0);
}

function toggleMusical(index) {

	displayNone();
	
	switch (index) {
		case 0:
			document.getElementById("monsters").style.display = "block";
			document.getElementById("p_arrow0").style.display = "block";
			document.getElementById("musical_header").innerHTML = "Monsters";
			getSongsByProject(4);
			break;
		case 1:
			document.getElementById("happy").style.display = "block";
			document.getElementById("p_arrow1").style.display = "block";
			document.getElementById("musical_header").innerHTML = "Happy";
			getSongsByProject(5);
			break;
		case 2:
			document.getElementById("under_the_influence").style.display = "block";
			document.getElementById("p_arrow2").style.display = "block";
			document.getElementById("musical_header").innerHTML = "Under the Influence";
			getSongsByProject(6);
			break;
	}
	$("#right_col").slideDown("slow");
}

function displayNone() {
	document.getElementById("right_col").style.display = "none";
	document.getElementById("monsters").style.display = "none";
	document.getElementById("happy").style.display = "none";
	document.getElementById("under_the_influence").style.display = "none";
	
	document.getElementById("p_arrow0").style.display = "none";
	document.getElementById("p_arrow1").style.display = "none";
	document.getElementById("p_arrow2").style.display = "none";	
}

function getSongsByProject(projectID) {

	var ajaxSongs = new AjaxObject();
	var url = "./ajaxproxy.php?request=5&index=" + projectID;
	
	ajaxSongs.request(url, "", this.getSongsByProjectCallback);

}

function getSongsByProjectCallback(xml) {
	allSongs = [];
	buildSongList(xml, allSongs);
	loadingOff();
	initializeThickBox();
}


