//writen by Simon Balarabe
//this script attaches an event handler to anchor clicks, takes the href from the click and sends it to the server to get information to displated which then populates a modal window.
dojo.require("dijit.form.Button");
dojo.require("dijit.Dialog");
dojo.require("dojo.hash");
// Bring in our custom widget
dojo.require('custom.ModalBox');
dojo.require("dojox.NodeList.delegate");
dojo.addOnLoad(function() {
	dojo.query("a[href='#projects']").onclick(function(e){
		e.preventDefault(); // stop the event
		var fragment = new String(dojo.attr(this,'href')); //get the date
		fragment = fragment .slice(1); //remove the first part of the get string
		var diaglog = dojo.create("div"); //create the dom element for the overlay content
		diaglog.innerHTML = "<iframe src=\"projects.html\" width=\"100%\" height=\"100%\" scrolling=\"no\" frameBorder=\"0\"><p>Your browser does not support iframes.</p></iframe>";
		content = { content:  diaglog, width: 50, height: 70 }; //define what content and the dimensions of the overlayed box
		var widget = new custom.ModalBox(content); //create modal the overlay
	});
});
