jQuery( function()
{
	jQuery('#map_button').attr('href', '/static/map/ #map_content').colorbox({
		onComplete: function() { jQuery('img#map_image').maphilight(); }
	});
	jQuery('#standalone-map-page img#map_image').maphilight();
	
	jQuery('a.make-enquiry').bind('click', function(e)
	{
		e.preventDefault();
		
		if ( jQuery('#enquiry-box').length == 0 )
		{
			// Add an empty div to the DOM, but hide it;
			//	then we can animate the content once it's loaded
			var $container = jQuery('<div />')
				.hide()
				.insertAfter( $(this) );
			$container.load( 
					'/static/enquiry_form/ #enquiry-box',
					function()
					{
						jQuery('#enquiry-box').hide();
						$container.show();
						jQuery('#enquiry-box').slideDown();
					}
				);
		}
		else
		{
			jQuery('#enquiry-box').slideToggle();
		}
	});
} );

