/*
	funciona u cambia imagenes
*/

/*
	Funcion que borra el elemento seleccionado de un select
	Argumento[0] Select 
*/
function borrarDeSelect(selectDe) {
	if (document.getElementById(selectDe).selectedIndex!=-1) {
		document.getElementById(selectDe).options[document.getElementById(selectDe).selectedIndex]=null;
	}
}

/****
	Muestra o oculta un span o div con ID.
	Solo para IE. Respeta el texto. Tablas completas.
*****/




/*
muestras el texto en las capas ocultas
*/
	
function cambiarFondo(nombreCapa,color)
{	
document.getElementById(nombreCapa).style.background=color;
}

function cambiarColorFuente(nombreCapa,color)
{
	document.getElementById(nombreCapa).style.color=color;
	document.getElementById(nombreCapa).style.textDecoration='underline';
}	

function subrayar(nombreCapa)
{
	document.getElementById(nombreCapa).style.textDecoration='underline';
}			


function mostrar(nombreCapa)
{
	document.getElementById(nombreCapa).style.visibility="visible";
}
function ocultar(nombreCapa)
{
	document.getElementById(nombreCapa).style.visibility="hidden";
}
		
function showHideData(id) {
	if (document.getElementById(id).style.display == '') 
		document.getElementById(id).style.display = 'none'
	else
	   document.getElementById(id).style.display = '';
}

function showData(id) {
	document.getElementById(id).style.display = '';
}

function hideData(id) {
	document.getElementById(id).style.display = 'none';
}

function confirma(mensaje,destino) {
	if ( confirm(mensaje) ) { 
		self.location =destino;
	}
}

function openWinClean(fichero,nombre,tam) {
	ventana=window.open(fichero,nombre,tam+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes");	
}
function openWinScroll(fichero,nombre,tam) {
	ventana=window.open(fichero,nombre,tam+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars,resizable=no,copyhistory=yes");	
}

function openWin(fichero,nombre,tam) {
	ventana=window.open(fichero,nombre,tam+",toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes");	
}

function irA(destino) {
	self.location =destino;
}

function esVacio(campo)
{   return ((campo == null) || (campo.length == 0))
}

//Campo vacio o lleno de espacios
function esBlanco(campo)
{
	var cadena = new String(campo.value);	
	if(esVacio(campo))
		return true;
	else
		for (var i=0;i<cadena.length;i++)
			if (cadena.charAt(i)!=" ") return false;
		return true;
}
