var KMC; if(!KMC) KMC={}; if(!KMC.ui) KMC.ui={};
/*
$(function() {
	$('#nav>div>ul>li').hover(function(e){
		this.visible = $('.subnav:visible');
		$('.subnav').hide();
		$(e.target).parents('li').find('.subnav').show();
	},
	function(e){
		$(this.visible).show();
	});
});

*/

KMC.ui.Map = function(address) {
	var map = new GMap2(document.getElementById("map"));
	var geocoder = new GClientGeocoder();
	
	(function showAddress(address) {
	  geocoder.getLatLng(
	    address,
	    function(point) {
	      if (!point) {
	        alert(address + " not found");
	      } else {
					map.addControl(new GLargeMapControl());
	        map.setCenter(point, 13);
	        var marker = new GMarker(point);
	        map.addOverlay(marker);
					GEvent.addListener(marker, "click", function() {
						marker.openInfoWindowHtml("<h3>Kickapoo Mud Creek</h3>" + "<p>" + address + "</p>");
					});
	        
	      }
	    }
	  );
	})(address);
}

$(function(){
	$('a[href^=http]:not("[href^=' + document.domain + ']"):not(":has(\'img\')")').click(function(e){
		e.preventDefault();
		window.open(e.target.href);
	});
});
