// Scripts to run on the home page only.

$(document).ready(function() {	
	
	// Changes the text in the "date" classed span to the correct format date (no time).
	$('#whatsNew div.item span.date').each(function() {
	
		var whatsNewDate = $(this).text() // Get the date text.
		var whatsNewFixedDate = whatsNewDate.indexOf(' '); // Find the index of the first space in the date.
		$(this).text(whatsNewDate.substring(0,whatsNewFixedDate)); // FIX IT!
	
	});

	// We are dynamically inserting the images into the content because they
	// are simply for presentation and we do not want to clutter up the HTML.
	
	// "What's New" block:
	var whatsNewCorners = '' +
		'<img src="/whatsnew-topleft.gif" alt="" id="whatsNewTopLeft" />' + 
		'<img src="/whatsnew-bottomleft.gif" alt="" id="whatsNewBottomLeft" />';
	$('#whatsNewContainer').append(whatsNewCorners);
	
	// "The Hog Blog" block:
	var hogBlogCorners = '' +
		'<img src="/hogblog-topleft.gif" alt="" id="hogBlogTopLeft" />' +
		'<img src="/hogblog-topright.gif" alt="" id="hogBlogTopRight" />' +
		'<img src="/hogblog-bottomleft.gif" alt="" id="hogBlogBottomLeft" />' +
		'<img src="/hogblog-bottomright.gif" alt="" id="hogBlogBottomRight" />';
	$('#hogBlog').append(hogBlogCorners);
	
});
