$(document).ready(function() {		
	// Navigation menu
	function mainmenu(){
		$('ul#navMenu li').hover(function(){
		$(this).find('ul:first').show();
		},function(){
		$(this).find('ul:first').hide();
		});
	}	
	mainmenu();
		
	// Zebra stripe tables
	$('table tr:nth-child(odd)').addClass('odd');
	
	// Mobile browser detection for image inline style removal
	var w = $(window).width();
	if (w<=600) {
		$('#mainContent img').removeAttr('style');
	}
	
	// Back button	
	$('#backBtn').click(function() {
		var urlparam = $('#backBtn').attr('rel');
		window.location = urlparam;
	});
	
	// Cancel button
	$('#cancelBtn').click(function() {
		var urlparam = $('#cancelBtn').attr('rel');
		var response = confirm('You are about to cancel your camper registration and clear the information you have entered.\nPlease confirm you would like to cancel.');
		if (response) {
			window.location = urlparam;
		}
		else {
			return false;
		}
	});
	
	// Delete confirm
	$('.delConfirm').click(function() {
		 var response = confirm('Are you sure you want to remove this session from your registration?\r\nThis action CANNOT be undone!');
		 if (response) { return true }
		 else { return false }
	});
	
});
