function prepareOriginalPoem(xmlPoem) {
	
	var linearray=xmlPoem.getElementsByTagName("line");
	var originalPoem = document.getElementById("origpoem");
	
	for (e=0;e<linearray.length;e++) {
		
		try {
			line=xmlPoem.getElementsByTagName("line")[e].childNodes[0].nodeValue;
		}
		catch(err) {
			line = null;
		}
			
		if (line != null ) {
			var newLine = document.createElement("p");
			var newLineTerms = document.createElement("div");
			var lineNode = document.createTextNode(line);
			var linePlus=line.replace(/\s+/g,"+");
			newLineTerms.setAttribute("id", 'lineterm'+e);
			newLine.appendChild(lineNode);
			idLine = newLineTerms.getAttribute("id");
			originalPoem.appendChild(newLine);
		}
	}
}

function requestOriginal (poem, stanzaId, status) {
	
	//DOM parse text - Code for IE
	if (window.ActiveXObject) {
		var doc=new ActiveXObject("Microsoft.XMLDOM");
		doc.async="false";
		doc.loadXML(poem);
	}
	//DOM parse text - Code for Mozilla, Firefox, Opera, etc.
	else {
		var parser=new DOMParser();
		var doc=parser.parseFromString(poem,"text/xml");
	}
	
	xmlPoem=doc.documentElement;
	
	//Remove loading image
	if (document.getElementById("loading")) {
		var loadingImage = document.getElementById("loading");
		loadingImage.parentNode.removeChild(loadingImage);
	}
	
	prepareDigiPoem(xmlPoem, stanzaId, status);
	
}

