// JavaScript Document
function mostrarImg(actual, nueva) {      
   var elem = document.getElementById(actual);
   elem.src = nueva;
}

function mostrarDiv(divId){
	div = document.getElementById(divId);
	div.style.visibility = 'inherit';
	div.style.display = 'block';
}


function ocultarDiv(divId){
	div = document.getElementById(divId);
	div.style.visibility = 'hidden';
	div.style.display = 'none';
}

function toogleDiv(id) {
   var e = document.getElementById(id);
   if (e.style.display == 'block'){
		e.style.display = 'none';
		e.style.visibility = 'hidden';
   } else {
		e.style.display = 'block';
		e.style.visibility = 'inherit';
   }
}

function resaltar(elemento){
	var divElemento = document.getElementById(elemento);
	divElemento.style.color = '#F00';
}

function contenidoInput(elemento, contenido){
	document.getElementById(elemento).value = contenido;
}

function contenidoInputCheck(check, elemento, contenido){
	contenidoActual = document.getElementById(elemento).value;
	if (check.checked == true){
		document.getElementById(elemento).value = contenidoActual + contenido + ', ';
	} else {
		document.getElementById(elemento).value = contenidoActual.replace(contenido + ', ', '');
	}
	if (document.getElementById(elemento).value.indexOf(',') > 0){
		document.getElementById(elemento).value = document.getElementById(elemento).value.replace('Secciones secundarias', '');
	} else {
		document.getElementById(elemento).value = 'Secciones secundarias';
	}
}
