/*
 * Populate booking forms from the contents of the
 * page submitting to them, using a hidden form field.
 *
 *  @author Daniel Wood
 */
$(document).ready (function (){
	populateFormField();
});
 
function populateFormField() {
	// Grab the page heading - this will do as event name
	var eventText = $("h1").eq(0).html();
	eventText += " - ";
	
	// Grab the date off the end of the current page location
	var filename = location.href;
    eventText += filename.substring(filename.lastIndexOf("/")+1, filename.lastIndexOf("/")+11);
	

	// Add to hidden form field
	$('input#event').val(eventText);
	
}