// JavaScript Document

function getPoemXML(id){	
	    $.ajax({
			type: 'GET',
			//url: 'http://poemflow.com/flows/'+id+'.xml',
			url: '/flows/'+id+'.xml',
			dataType: 'xml',
			encoding:'UTF-8',
			success: readPoemXML
	    });
}

function readPoemXML(xml) {
   $(xml).find("flow").each(function() {
		$("#title").html($(this).find("title").text());  
		$("#author").html($(this).find("author:first").text());
		$("#date").html($(this).find("publishedDate").text());
		$("#poemtext").html($(this).find("ttvHTMLText").text());
		$('p.h:empty').css("margin-bottom", "30px");
  });
}
