/*
 * rdai.map.js
 *
 * All code/functions/classes
 * Author(s): Matt Robenolt, Kevin Krpicak
 *
 * Copyright © 2010 RDA International & YDEK Productions LLC
 * http://rdai.com & http://ydekproductions.com
 * hey@ydekproductions.com
 *
 * $Id: rdai.map.js 59 2010-01-28 02:18:31Z matt $
 *
 * No, don't use this if you somehow get ahold of it.  We will hunt you down
 * and probably inflict massive amounts of pain on your family.
 */
rdai.map = {
	options: {
		zoom: 16,
		center: 0,
		disableDefaultUI: true,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	},
	
	latLng: new google.maps.LatLng(40.726538,-74.00868),
	
	icon: new google.maps.MarkerImage('images/icons/locator.png',
		new google.maps.Size(81, 31),
		new google.maps.Point(0, 0),
		new google.maps.Point(3, 31)
	),
	
	hasDrawn: false,
	
	draw: function(options)
	{
		if(rdai.map.hasDrawn) return;
		
		rdai.map.options.center = rdai.map.latLng; //setting center to default point
		
		rdai.map.options = $.extend({}, rdai.map.options, options); //merging options
		
		var map = new google.maps.Map(document.getElementById("map_canvas"), rdai.map.options);
		
		var marker = new google.maps.Marker({
		  	position: rdai.map.latLng, 
		  	map: map, 
		  	title: "RDA",
			icon: rdai.map.icon
		});
		
		rdai.map.hasDrawn = true;
	}
};
