window.addEvent('domready', function(){
	// prepare the map container and links
	var mapContainer = $('map-container');
	mapContainer.fx = new Fx.Styles(mapContainer, {duration: 500, transition: Fx.Transitions.sineOut});
	mapContainer.fxClose = new Fx.Styles(mapContainer, {duration: 250, onComplete: function(){
		mapContainer.setStyles({'display':'none'});
	}});

	// create the info slide
	new NS.Slide('brochureOpen','brochureClose','firstcall');

	// repair tracker login
	$('logIn').addEvent('click', function(){
		new NS.Pop('http://www.myrepairtracker.com', {width: 760, height: 700, header:'Track Your Repairs'});
	});

	// open map
	$('mapOpen').addEvent('click', function(){
		var coords = {
			'name': 'John Eagle Collision Center'
			,'addr': '6125 Peeler St.'
			,'city': 'Dallas'
			,'state': 'TX'
			,'zip': '75235'
			,'phone': '800.406.2344'
			,'lat': 32.8301
			,'lng': -96.8317
			,'zoom': 16
		};
		mapContainer.setStyles({'visibility':'hidden','display':'block'});
		mapContainer.fx.custom({'opacity':[0,1],'top': [-mapContainer.offsetHeight, 0]});
		showGMap('map', coords);
	});

	// close map
	$('mapClose').addEvent('click',function(){
		mapContainer.fx.custom({'opacity':[1,0],'top':[-mapContainer.offsetHeight]});
	});
});
