// JavaScript Document

$(document).ready(function(){
  initNav();
  //resizecontent();
  var t=setInterval("resizecontent();",1000);
});


function initNav(){
	var id = "";
	$(".navbutton").hover(function(){
		id = $(this).attr("id");
		$(this).addClass(id + "-over");
		$(this).removeClass(id);
	},function(){
		id = $(this).attr("id");
		$(this).addClass(id);
		$(this).removeClass(id + "-over");
	});
	
	$(".navbutton").click(function(){
		var id = $(this).attr("id");
		var url = "index.php";
		switch(id){
			case "nav-1-home":
			
			break;
			case "nav-2-releases":
				url += "?cat=4";
			break;
			case "nav-3-artists":
				url += "?cat=5";
			break;
			case "nav-4-downloads":
				url += "?cat=3";
			break;
			case "nav-5-studio":
				url += "?page_id=15";
			break;
			case "nav-6-contact-us":
				url += "?page_id=17";
			break;
			
		}
		window.location.href = url;
								   
	});
}

function resizecontent(){
	 var txtheight = $("#textlayer").height();
	txtheight = txtheight - 601;
	if(txtheight < 16){
		txtheight = 16;
	}
	console.log(txtheight);
	$("#middlesection").height(txtheight);
};
