function initEvents() {
	$("#cubes a").click(function() {
		var visibleDiv = $("#whiteexpand .cubeContent:visible");
		var relatedDiv = $("#whiteexpand .cubeContent").filter("[rel="+ $(this).attr("id") +"]");

		$("#cubes a").removeClass("activeCube");
		$(this).addClass("activeCube");
		
		//there is already a div showing
		if(visibleDiv.length) {
			if( visibleDiv.attr("rel") != $(this).attr("id") ) {
				visibleDiv.slideUp(800, function(){
					setTimeout(function(){ relatedDiv.slideDown(800);}, 200);
				});
			} else {
				visibleDiv.slideUp(800);
				$("#cubes a").removeClass("activeCube");
			}
		} else {
			relatedDiv.slideDown();			
		}
		return false;		
	});
}

function initStyling() {
	//initally hide all 
	$("#whiteexpand > div").hide();
}	

$(document).ready(function(){
	
	initStyling();
	
	initEvents();
	
});

