$(document).ready(function(){
	
	if(window.mxn && window.NewMind && window.NewMind.mapping) {
		
		if(window.NewMind.tourism && window.NewMind.tourism.settings) {
			window.NewMind.tourism.settings['mappingDefaultPolyOn'] = false;
		}
	}
	
	/*
	 * This doesn't actually do anything with the map it manipulates link and 
	 * forms and things to allow mapping stuff to happen
	 */	
	
	// hide the Search By Map link
	//$('#SearchByMap').hide(0);
	
	// add a "show results on map" checkbox to refine
	$('#refineByDefList')
		.append('<dd><div class="row"><span class="field"><input type="checkbox" id="autoshowmap" name="autoshowmap" value="1" class="checkbox" /><label for="autoshowmap" class="text" id="autoshowmapLabel">Tick here to show results on a map.</label></span></div></dd>')
		.find('#autoshowmap').each(function(){
			if(window.location.search.indexOf('autoshowmap') > -1) {
				this.checked = true;
			}
		});
	
	// what's nearby should auto show the map by default
	$('#whatsNearby form, #refineBy-whatsNearby form').append('<input type="hidden" id="autoshowmap" name="autoshowmap" value="1" />');
		
});