window.addEvent('domready', function() {



	//Creates map with controls and overlays

	if (GBrowserIsCompatible()) {

		var map = new GMap2(document.getElementById("map"));

		map.addControl(new GSmallMapControl());

		map.setCenter(new GLatLng(30.307641, -97.734685), 15);

		//map.addOverlay(createMarker(new GLatLng(30.27059,-97.748094), 1));
		// 30.307641, -97.734685

	}

	

	// Create custom MM marker and pop-up

	var icon = new GIcon();

	var point = new GLatLng(30.307641, -97.734685);

	icon.image = "/i/mark_pin.png";

	icon.shadow = "/i/mark_shadow.png";

	icon.iconSize = new GSize(55, 48);

	icon.shadowSize = new GSize(55, 48);

	icon.iconAnchor = new GPoint(20, 56);

	icon.infoWindowAnchor = new GPoint(20, 5);

	var marker = new GMarker(point, icon);

	map.addOverlay(marker);

	

	GEvent.addListener(marker, "click", function() {
		
		map.setCenter(new GLatLng(30.309578399746062, -97.73398876190186), 15);
		
		marker.openInfoWindowHtml("<table><tr><td><img src='/i/thb_office2.jpg' alt='' width='105' height='66' class='thb_map' /></td><td><strong>Milkshake</strong><br/>4203 Guadalupe<br/>Austin, TX 78751<br/><br/><a href='http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=&daddr=4203+Guadalupe+St,+Austin,+TX+78751&sll=30.307641, -97.734685&sspn=0.014560657176655667, 0.039610862731933594&ie=UTF8&z=17&om=1' target='_blank' title='Get Directions to Milkshake'>Get Directions</a></td></tr></table>");

	});



	//Set layer order (allows map drag) -- plays with MM_base.js

	$('navwrap').setStyle('z-index', '5');

	$('map').setStyle('z-index', '10');

	

	// Show Map

	$('lk_map').addEvent('click', function(e){

		e = new Event(e);

		$('map').setStyle('visibility', 'visible');

		$('lk_close').setStyle('visibility', 'visible');

		$('lk_close').setStyle('z-index', '100');

		e.stop();

	});



	// Hide Map

	$('lk_close').addEvent('click', function(){

		$('lk_close').setStyle('visibility', 'hidden');

		$('map').setStyle('visibility', 'hidden');

	});

	

	// Hide Logo

	$('logo').addEvent('mouseover', function(){

		$('navwrap').setStyle('z-index', '10');

		$('logo').setStyle('visibility', 'hidden');

		$('map').setStyle('z-index', '5');

	});



})