$(document).ready(function(){
	url = document.location.hash;
	function parseUrl(){
		switch (url){
			case '#graphics': show = '#graphics';break;
			case '#contact' : show = '#contact';break;
			case '#other'   : show = '#other';break;
			default:show='#web';break;
		}
		$(show).show();
	}
	function replaceMail(id){
		var value = 'alex.mitchell@gumware.com';
		$('#'+ id).attr('href','mailto:'+value).html(value);
	}
	$('#navigation a').each(function(){
		$(this).click(function(e){
			show=$(this).attr('href');
			document.title='Gumware - '+$(this).attr('title');
			$('#navigation a').removeClass('selected');
			$(this).addClass('selected');
			$('#content>div').hide();
			$(show).show();
			this.blur();
		});
		if (($(this).attr('href')==url) || ($(this).attr('href')=='#web' && url=='')){
			$(this).addClass('selected');
			document.title='Gumware - '+$(this).attr('title');
		}
	});
	parseUrl();
	replaceMail('email');
});
