
var Es_IE = navigator.userAgent.toLowerCase ().indexOf ('msie') > 0;


function Clase (Etiqueta, Valor)
{
	var Aux = document.getElementById (Etiqueta);

	if (Aux) Aux.className = Valor;
}


function Display (Etiqueta, Valor)
{
	var Aux = document.getElementById (Etiqueta);
	
	if (Aux) Aux.style.display = Valor;
}


function DisplayTable ()
{
	if (Es_IE) return ('block')
	else return ('table');
}


function DisplayTD ()
{
	if (Es_IE) return ('block')
	else return ('table-cell');
}


function DisplayTR ()
{
	if (Es_IE) return ('block')
	else return ('table-row');
}


function EliminarHijos (Padre)
{
	var i;
	
	if (Padre.hasChildNodes())
	{	for (i = Padre.childNodes.length - 1; i >= 0; i--)
			 Padre.removeChild (Padre.childNodes [i]);
	}
}


function EtiquetaTexto (id, Texto)
{
	var Etiqueta = document.getElementById (id);
	
	if (Etiqueta) Etiqueta.firstChild.nodeValue = Texto;
}


function FlashById (Ident)
{
	if (isSafari) return (document.getElementById (Ident));

	if (document.embeds [Ident]) return (document.embeds [Ident]);
	return (document.getElementById (Ident));
}


function ImageSrc (Imagen, Valor)
{
	if (document.images [Imagen])	document.images [Imagen].src = Valor;
}


function InHTML (Etiqueta, Valor)
{
	var Aux = document.getElementById (Etiqueta);

	if (Aux) Aux.innerHTML = Valor;
}


function OptionSelect (oSelect, Valor, Texto)
{
	var Nodo;
	
	Nodo = document.createElement ('option');
	Nodo.value = Valor;
	Nodo.innerHTML = Texto;
	oSelect.appendChild (Nodo);
}


function OptionSelectVacio (Select)
{
	var Nodo;
	
	Nodo = document.createElement ('option');
	Nodo.value = '0';
	Nodo.appendChild (document.createTextNode (''));
	Select.appendChild (Nodo);
}


//=======================================================================================
//=======================================================================================
//=======================================================================================
//=======================================================================================



function Color (Etiqueta, Valor)
{
	var Aux = document.getElementById (Etiqueta);
	
	if (Aux) Aux.style.color = Valor;
}


 
function Visible (Etiqueta, Visible)
{
	var Aux = document.getElementById (Etiqueta);
	
	if (Aux) Aux.style.visibility = Visible ? 'visible' : 'hidden';
}


function PosicionAbsoluta (Etiqueta)
{
	var oAux  = document.getElementById (Etiqueta);
	var iLeft = 0;
	var iTop  = 0;
	
	if (oAux && oAux.offsetParent)
	{	iLeft = oAux.offsetLeft;
		iTop  = oAux.offsetTop;
		while (oAux = oAux.offsetParent)
		{	iLeft += oAux.offsetLeft;
			iTop  += oAux.offsetTop;
		}
	}
	return [iLeft, iTop];
}





