window.onload = function(){get_blog_entry();};

function get_blog_entry() {
	var show_how_many = 1;
	
	new Ajax.Request('inc/get_blog_content.php', {
		method: 'post',
		onExecption: function() {
			alert('Exception occured.');
		},
		onFailure: function() {
			alert('Failure occurred.');
		},
		onComplete: function(r){
			
			var newDom = r.responseXML;
			
			var items = newDom.getElementsByTagName('item');
			
			for (x=0;x<show_how_many;x++) {
				d = new Date(items[x].getElementsByTagName('pubDate')[0].firstChild.nodeValue);
				
				$('blog_entry').innerHTML = '<p><strong>' + items[x].getElementsByTagName('title')[0].firstChild.nodeValue + '</strong><br />' + d.getMonth()+'/'+d.getDate()+'/'+d.getFullYear() + '</p><p>' + items[x].getElementsByTagName('content:encoded')[0].firstChild.nodeValue + '</p><p><a href="http://lastcall.jackolanternliquors.com/" target="_blank">Read more of Kathy\'s Blog!</a></p>';
			}
			
		}
	});
}
