window.onload = init;

var todos = true;
var inicial = false;
var anterior = null;
var to = document.getElementsByTagName("a");

function init() {
	if (todos != false)
	{
		to[2].style.color		= "white";
		to[2].style.background	= "black";
	}
	todos = false;
	for (var k=0; k < to.length; k++) {
		to[k].onclick = estilo;
		to[k].ref = k;
	}	
}

function estilo() {
	if (anterior != null)
	{
		anterior.style.color		= "black";
		anterior.style.background	= "white";
	}
	
	if (inicial != false)
	{
	to[2].style.color		= "black";
	to[2].style.background	= "white";
	}
	
	if (todos != true)
	{
		to[2].style.color		= "black";
		to[2].style.background	= "white";
	}
	
	anterior = this;
	inicial = true;
	this.style.color		= "white";
	this.style.background	= "black";
	this.blur();
}