var hash='';
setInterval('checkHash()',500);
document.addEventListener('mousemove',moveShihan,false);
function $(id){return document.getElementById(id);}

function showInfo(id){
	$('black').style.display='block';
	$(id).style.display='block';
}

function closeInfo(){
	location.hash='';
	$('black').style.display='none';
	$('featured').style.display='none';
	$('muestras').style.display='none';
	try{
		$('bujinkan').style.display='none';
		$('reglas').style.display='none';
		$('obligaciones').style.display='none';
		$('preguntas').style.display='none';
	}catch(e){}
	try{
		$('presentacion').style.display='none';
		$('historia').style.display='none';
		$('nueve-escuelas').style.display='none';
		$('bujinkan-nl').style.display='none';
		$('enlaces').style.display='none';
	}catch(e){}
}

function checkHash(){
	if(hash!=location.hash){
		hash=location.hash;
		if(hash.length>1) showInfo(hash.substr(1));
		else closeInfo();
	}
}

function moveShihan(e){
 if(e.pageX > screen.width/2-500 && e.pageX < screen.width/2+500){
  document.getElementById('shihan1').style.left=((screen.width/2)+(e.pageX/20)-300)+'px';
  document.getElementById('shihan2').style.left=((screen.width/2)+(e.pageX/20)-100)+'px';
 }
}

