function DevolverTexto(idElemento){
if (DOM){
	var Salida='';	
	if (document.all) {
		Salida = document.getElementById(idElemento).innerText;
		}
	else {
		for (var i=0; i<document.getElementById(idElemento).childNodes.length; i++) {
			Salida += document.getElementById(idElemento).childNodes.item(i).nodeValue;
			}
		}
	return Salida;
	}
}

function EscribirEnCapa(idElemento,Contenido){
if (DOM){
	if (document.all) {
		document.getElementById(idElemento).innerHTML=Contenido;
		}
	else {	
		var Rango = document.createRange();
		var Elemento = document.getElementById(idElemento);
		Rango.setStartBefore(Elemento);
		var htmlFrag = Rango.createContextualFragment(Contenido);
		while (Elemento.hasChildNodes()) Elemento.removeChild(Elemento.lastChild);
		Elemento.appendChild(htmlFrag);
		}
	}
}

function CrearCapa(idElemento,idClass,Eventos,Contenido){
if (DOM){
	if (document.all) {
		document.body.innerHTML+='<div id="'+idElemento+'" '+Eventos+'class="'+idClass+'">'+Contenido+'</div>';
		}
	else {	
		var Elemento = document.createElement('div'); 
		Elemento.id = idElemento; 
		if (idClass) Elemento.className = idClass; 
		document.body.appendChild(Elemento); 
		var Rango = document.createRange();
		Rango.setStartBefore(Elemento);
		var htmlFrag = Rango.createContextualFragment(Contenido);
		Elemento.appendChild(htmlFrag); 
		}
	}
}

function ColocarCapa(idElemento,iTop,iRight,iBottom,iLeft){
if (DOM){
	var Elemento = document.getElementById(idElemento);
	if (iTop) Elemento.style.top=iTop+'px'; 
	if (iRight) Elemento.style.right=iRight+'px'; 
	if (iBottom) Elemento.style.bottom=iBottom+'px'; 
	if (iLeft) Elemento.style.left=iLeft+'px'; 
	}
}

function DimensionarCapa(idElemento,iWidth,iHeight){
if (DOM){
	var Elemento = document.getElementById(idElemento);
	if (iWidth) Elemento.style.width=iWidth+'px'; 
	if (iHeight) Elemento.style.height=iHeight+'px'; 
	}
}

