$(document).ready(function() {
	$('#works span, #preload').hide();
	// read load id
	removePreIDRegex = /.*id=/;
	var loadID = document.location.href.replace(removePreIDRegex, '#');
	if (loadID) { embed(loadID); }
	// read project ids and attach handler 
	$('#works A').not('.sitelink').click(function(event) {
		event.preventDefault();
		var divID=$(this).attr("href").replace(removePreIDRegex, '#');
		embed(divID);
	});
});
function embed(divId) {
	$('#ntvcontainer').html($(divId).html());
	$('#works span').hide();
	$(divId+'material').show();	
}