var from = 'welcome';

function go(to) {
	to = ((to.href.indexOf('#') == -1)) ? 'welcome' : to.href.substring(to.href.indexOf('#') + 1);
	to = (check(to)) ? to : 'welcome';

	l0 = document.getElementById(from.substring(0,2));
	l1 = document.getElementById(to.substring(0,2));
	dep = document.getElementById(from);
	arr = document.getElementById(to);

	dep.style.display = 'none';
	l0.className = '';

	arr.style.display = 'block';
	l1.className = 'clicked';

	from = to;
}

function check(sub) {
	val = new Array(
		'welcome',
		'writing',
		'photos',
		'design',
		'links',
		'sites',
		'contact');

	x = (val.toString().indexOf(sub) != -1) ? true : false;

	return x;
}