function Servicio() {}

Servicio.activo = new Array();

Servicio.apagar = function( etiquetaPadre, etiquetaGeneral, etiquetaSeleccionada ) {
	if ( Servicio.activo[etiquetaGeneral] != etiquetaSeleccionada ) {
		document.getElementById( etiquetaSeleccionada ).style.backgroundColor= '';
		document.getElementById( etiquetaSeleccionada ).style.textDecoration = 'underline';
	}
}

Servicio.encender = function( etiquetaPadre, etiquetaGeneral, etiquetaSeleccionada, colorFondo ) {
	if ( Servicio.activo[etiquetaGeneral] != etiquetaSeleccionada ) {
		document.getElementById( etiquetaSeleccionada ).style.backgroundColor= colorFondo;
		document.getElementById( etiquetaSeleccionada ).style.textDecoration = 'none';
	}
}

Servicio.activar = function( etiquetaPadre, etiquetaGeneral, etiquetaSeleccionada, colorFondo ) {
	var anterior = "";
	if ( Servicio.activo[etiquetaGeneral] != etiquetaSeleccionada ) {
		document.getElementById( 'capa_' + Servicio.activo[etiquetaGeneral] ).style.height = '0px';
		anterior = Servicio.activo[etiquetaGeneral];
		Servicio.encender( etiquetaPadre, etiquetaGeneral, etiquetaSeleccionada, colorFondo );
		Servicio.activo[etiquetaGeneral] = etiquetaSeleccionada;
		document.getElementById( 'capa_' + Servicio.activo[etiquetaGeneral] ).style.height = 
											( document.getElementById( 'cuerpo_' + Servicio.activo[etiquetaGeneral] ).offsetHeight + 20 ) + 'px';
		document.getElementById( 'imagen_' + etiquetaGeneral ).src = 'imagenes/servicios/' + etiquetaPadre + '/' + etiquetaGeneral + '/' +
			etiquetaSeleccionada + '.jpg';
		document.getElementById( etiquetaSeleccionada ).style.textDecoration = 'none';
//		document.getElementById( "servicios_" + etiquetaPadre ).style.height = Math.max( 649, document.getElementById( 
		Servicio.apagar( etiquetaPadre, etiquetaGeneral, anterior );
	}
}
