// Create a JavaScript object
$.mainObject = {
	// Initialize the main object
	init: function() {
		// Enable map marker info window pop ups
		$('div.mapLocation a.marker').bind('mouseenter', function() {
			// Close other windows first
			$('div.infoWindow').hide();


			// For IE6
			$(this).next().next().next().show();
			
			// Open this window
			$(this).next().show();
		});
		
		// Close the info window when leaving it
		$('div.mapLocation div.infoWindow').bind('mouseleave', function() {
			// Hide the info window
			$(this).hide();
		});

		// Handle a focus on an input with a default text
		$('input.default').bind('focus', function() {
			// Check if the value is the original value, if so clear it
			if ($(this).val() == $(this).attr('title'))
			$(this).val('');
		});

		// Handle a blur on an input with a default text
		$('input.default').bind('blur', function() {
			// Check if the value is empty, if so replace it with the default
			if ($.trim($(this).val()) == '')
			$(this).val($(this).attr('title'));
		});

		// Enable drop down menus for the main navigation on mouseover
		$('#mainNavigation li.hasSubNavigation').hover(
			function() {
				$(this).addClass('showSubNavigation');
			},
			function() {
				$(this).removeClass('showSubNavigation');
			}
		);
		
		// Style the Google maps info windows
	}
};

// Initialize the main object, which handles all website initialization
$(document).ready(function() {
	// Initialize the main object
	$.mainObject.init();
});
