function BotonMultiple() {}

BotonMultiple.sobre = function( nombre, i ) {
	if ( activa[nombre] != i ) {
		var posicion = 0;
		for ( j = 0; j < i; j++ )
			posicion -= document.getElementById( nombre + "_" + j ).offsetWidth;
		if ( i == 2 )
			posicion--;
		document.getElementById( nombre + "_" + i ).style.backgroundPosition = posicion + 'px';
		document.getElementById( nombre + "_" + i ).style.backgroundImage = 'url(' + img_sobre[ nombre ][i].src +  ')';
	}
	else
		BotonMultiple.abajo( nombre, i );
}

BotonMultiple.abajo = function( nombre, i ) {
	document.getElementById( nombre ).style.backgroundImage = 'url(' + img_abajo[ nombre ][i].src +  ')';
	for ( i = 0; i < 3; i++ )
		document.getElementById( nombre + "_" + i ).style.backgroundImage = '';
}

BotonMultiple.activar = function( nombre, i ) {
	document.getElementById( nombre + "_" + activa[nombre] ).style.fontWeight = "";
	document.getElementById( nombre + "_" + activa[nombre] ).style.textDecoration = "";
	document.getElementById( nombre + "_" + i ).style.fontWeight = "900";
	document.getElementById( nombre + "_" + i ).style.textDecoration = "none";
	BotonMultiple.abajo( nombre, i );
	activa[nombre] = i;
}

BotonMultiple.fuera = function( nombre, i ) {
//	BotonMultiple.abajo( nombre, activa[nombre] );
	for ( i = 0; i < 3; i++ )
		document.getElementById( nombre + "_" + i ).style.backgroundImage = '';
}


BotonMultiple.alinearTodos = function() {
	var anclas = document.getElementsByTagName( 'a' );
	var i = 0;
	for ( i = 0; i < anclas.length; i++ ) {
		if ( anclas[i].className == 'botonMultipleAncla' )
			BotonMultiple.alinearUno( anclas[i] );
	}
}

BotonMultiple.alinearUno = function( boton ) {
	var padre = boton;
	var hijo = document.getElementById( 'capa_' + boton.id );
	if ( padre && hijo )
		hijo.style.top = ( ( parseInt( padre.style.height ) - hijo.offsetHeight ) / 2 ) + 'px';
}

