function importXML(xml)
{
	if (document.implementation && document.implementation.createDocument)
	{
	//Firefox
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = createTable;
	}
	else if (window.ActiveXObject)
	//ie
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4) createTableIE()
		};
 	}
	else
	{
		alert('Your browser can\'t handle this script');
		return;
	}
	xmlDoc.load(xml);
}
function createTableIE()
{
	var x = xmlDoc.getElementsByTagName('comentario');
	var referenciaModulo = document.getElementById('comm')
	
	var cantidadComentarios = x.length
	for(var e = 0; e< cantidadComentarios; e++){
	
	var autor_txt = document.createTextNode(x[e].childNodes[0].firstChild.nodeValue);
	var fecha_txt = document.createTextNode(" "+x[e].childNodes[1].firstChild.nodeValue);
	var comentario_txt =document.createTextNode(x[e].childNodes[2].firstChild.nodeValue);
	
	//creamos el div
	var divComentario = document.createElement('div');
	var autorComentario= document.createElement('cite')
	//creamos el cite
	var spanComentario = document.createElement('span')
	//creamos el span
	//cerramos el cite
	//creamos el blockquote
	var pComentario = document.createElement('p')
	//creamos el p
	//divComentario.setAttribute('id',"divComentario");
	//Otorgamos el valor a cada variable

	//Las aņadimos en la lista de jerarquia de cada variable.
	//divComentario.appendChild(comentario_txt)	
	
	autorComentario.appendChild(autor_txt)
	spanComentario.appendChild(fecha_txt)
	pComentario.appendChild(comentario_txt)
	
	divComentario.appendChild(autorComentario)
	divComentario.appendChild(spanComentario)
	divComentario.appendChild(pComentario)
	
	referenciaModulo.appendChild(divComentario)
	}
	// escondemos el contenedor principal hasta que todo este listo
	//divAnillo.style.visibility = 'hidden';
	
	//var contenedorTexto = document.createElement('a')
	//var texto = document.createTextNode(x[i].childNodes[0].nodeValue);
	
	//divAnillo1.innerHTML="Mostrar/Ocultar";
	//addEvent(divAnillo1, "click", escondeMenuAnillo);
	//Entrada de texto
	
	/*
	contenedorTexto.appendChild(texto)
	divAnillo1.appendChild(contenedorTexto)
	divAnillo.appendChild(divAnillo1);
	referenciaModulo.appendChild(divAnillo)
	*/
	
	if(cantidadComentarios==0){
	mostrarForm()
	}
}
function createTable()
{
	var x = xmlDoc.getElementsByTagName('comentario');
	var referenciaModulo = document.getElementById('comm')
	
	var cantidadComentarios = x.length

	for(var e = 0; e< cantidadComentarios; e++){
	var autor_txt = document.createTextNode(x[e].childNodes[1].firstChild.nodeValue);
	var fecha_txt = document.createTextNode(" "+x[e].childNodes[3].firstChild.nodeValue);
	var comentario_txt = document.createTextNode(x[e].childNodes[5].firstChild.nodeValue);
	
	//creamos el div
	var divComentario = document.createElement('div');
	
	var autorComentario= document.createElement('cite')
	//creamos el cite
	var spanComentario = document.createElement('span')
	//creamos el span
	//cerramos el cite
	//creamos el blockquote
	var pComentario = document.createElement('p')
	//creamos el p
	//divComentario.setAttribute('id',"divComentario");
	//Otorgamos el valor a cada variable

	//Las aņadimos en la lista de jerarquia de cada variable.
	//divComentario.appendChild(comentario_txt)	
	
	autorComentario.appendChild(autor_txt)
	spanComentario.appendChild(fecha_txt)
	pComentario.appendChild(comentario_txt)
	
	divComentario.appendChild(autorComentario)
	divComentario.appendChild(spanComentario)
	divComentario.appendChild(pComentario)
	
	referenciaModulo.appendChild(divComentario)
	}
	// escondemos el contenedor principal hasta que todo este listo
	//divAnillo.style.visibility = 'hidden';
	
	//var contenedorTexto = document.createElement('a')
	//var texto = document.createTextNode(x[i].childNodes[0].nodeValue);
	
	//divAnillo1.innerHTML="Mostrar/Ocultar";
	//addEvent(divAnillo1, "click", escondeMenuAnillo);
	//Entrada de texto

	/*
	contenedorTexto.appendChild(texto)
	divAnillo1.appendChild(contenedorTexto)
	divAnillo.appendChild(divAnillo1);
	referenciaModulo.appendChild(divAnillo)
	*/
		
	if(cantidadComentarios==0){
	mostrarForm()
	}
}
function mostrar(nombreCapa){
document.getElementById(nombreCapa).style.display="block";
}
function ocultar(nombreCapa){
document.getElementById(nombreCapa).style.display="none";
} 
function mostrarForm(){
document.getElementById('Formulario').style.display="block";
document.getElementById('comm').style.display="none";
document.getElementById('botonPublicar').style.display="none";

}
function mostrarForm2(){
document.getElementById('Formulario').style.display="none";
document.getElementById('comm').style.display="block";
document.getElementById('botonPublicar').style.display="block";
}
