// Set Switch Project
function SwitchProject(id) {
	if (document.getElementById('pageswitch_1')) {
		if (document.getElementById('clicklist')) {
			countmax = (document.getElementById('clicklist').getElementsByTagName('LI').length);
		} else {
			countmax = (document.getElementById('box_left_bottom').getElementsByTagName('DIV').length);
		}
		for(var i = 1; i <= countmax; i++) {
			document.getElementById('pageswitch_'+i).style.display = 'none';
			document.getElementById('clicklist_'+i).className = '';
			if (document.getElementById('rightpic_'+i)) {
				document.getElementById('rightpic_'+i).style.display = 'none';
			}
			if (id) {
				document.getElementById('pageswitch_'+id).style.display = 'block'; // Clicked load
				document.getElementById('clicklist_'+id).className = 'clicklist_active';
				if (document.getElementById('rightpic_'+id)) {
					document.getElementById('rightpic_'+id).style.display = 'block';
				}
			} else if (!self.document.location.hash.substring(1)) {
				document.getElementById('pageswitch_1').style.display = 'block'; // Standard load
				document.getElementById('clicklist_1').className = 'clicklist_active';
				if (document.getElementById('rightpic_1')) {
					document.getElementById('rightpic_1').style.display = 'block';
				}
			} else {
				document.getElementById('pageswitch_'+self.document.location.hash.substring(1)).style.display = 'block'; // Anchor load
				document.getElementById('clicklist_'+self.document.location.hash.substring(1)).className = 'clicklist_active';
				if (document.getElementById('rightpic_'+self.document.location.hash.substring(1))) {
					document.getElementById('rightpic_'+self.document.location.hash.substring(1)).style.display = 'block';
				}
			}
		}
	}
}

// Add Functions
function start() {
	SwitchProject();
}

window.onload = start;
