
dojo.require("dojo.NodeList-fx");

//varialbe used to house div content layer
var contentBox;

//sets up content variable and displays first layer
var start = function()
{
	contentBox = dojo.byId("content_cell");
	showHideLayers("overview", "en")
}

//intializes and loads dojo classes and runs function when done
dojo.addOnLoad(start);

//handles layer switching
function showHideLayers(section, language)
{
	dojo.xhrGet({
	    url: "/data/event_guide/"+language+"/"+section+".txt",
	    handleAs: "text",
	    load: function(data,args){
		// fade out the node we're modifying
		dojo.fadeOut({
		    node: contentBox,
		    onEnd: function(){
			// set the data, fade it back in
			contentBox.innerHTML = data; 
			dojo.fadeIn({ node: contentBox }).play();    
		    }
		}).play();
	    },
	    // if any error occurs, it goes here:
	    error: function(error,args){
		console.warn("error!",error);
		alert(error);
	    }
	});
	
}
