/*
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//	Copyright (C) 2007 Cro-Cec, Inc. dba Digital Solutions.
//	A complete description of Digital Solutionsâ€™ copyright notice can be found online at: 
//	http://www.digitalsolutionslc.com/copyright_notice.php 
//		
//	Digital Solutions is a premier marketing and web development company in Las Cruces, New Mexico. 
//	We offer professional web design including flash and database web sites, graphic design, marketing materials, 
//	and video production. 
//
//	If you enjoyed this website and are looking for custom web development, give us a call at (505) 523-7661.
//		
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
*/
//<![CDATA[ 
var map_front = null;				 
var location_num_front = [];
var location_name_front = []; 	
var location_longitude_front = []; 	
var location_latitude_front = [];
var location_contact_front = [];
var location_phone_front = [];
var location_city_front = [];
var location_state_front = [];
var i_marker_front = 0;				
var MyMarkers_front =[];				
var marker_front =[];
var markers_front =[];	
var point_front = [];
var start_lat;
var start_long;
var current_id_front;
 
function loadMap(start_lat,start_long) 
{ 
	if (GBrowserIsCompatible()) 
	{
		
		map_front = new GMap2(document.getElementById("location_map")); 
		map_front.addControl(new GLargeMapControl());
		map_front.addControl(new GMapTypeControl()); 
		map_front.setCenter(new GLatLng(start_long, start_lat), 4 );
		//map_front.setMapType(G_HYBRID_MAP);		
		//map_front.disableDoubleClickZoom();
		map_front.addControl(new GScaleControl());
        map_front.addControl(new GOverviewMapControl()); 
	 
		var url_front = 'includes/js/google_maps/generate_xml_map_results.php';
		GDownloadUrl(url_front, function(data) 
		{
			var xml_front = GXml.parse(data);
			markers_front = xml_front.documentElement.getElementsByTagName("marker_front");
			
			var current_id_front;
			//alert(markers_front.length);
			
			for (i_marker_front = 0; i_marker_front < markers_front.length; i_marker_front++) 
			{
				
				current_id_front								= markers_front[i_marker_front].getAttribute("location_num_front");
				//location_description_front[current_id_front]	= "";
				//location_num_front[current_id_front] 			= markers_front[i_marker_front].getAttribute("location_num_front");
				location_name_front[current_id_front] 			= markers_front[i_marker_front].getAttribute("location_name_front");
				location_longitude_front[current_id_front]		= markers_front[i_marker_front].getAttribute("location_longitude_front");
				location_latitude_front[current_id_front] 		= markers_front[i_marker_front].getAttribute("location_latitude_front"); 
				location_contact_front[current_id_front]		= markers_front[i_marker_front].getAttribute("location_contact_front");
				location_phone_front[current_id_front] 			= markers_front[i_marker_front].getAttribute("location_phone_front");
				location_city_front[current_id_front] 			= markers_front[i_marker_front].getAttribute("location_city_front");
				location_state_front[current_id_front] 			= markers_front[i_marker_front].getAttribute("location_state_front");
				
				//alert(location_name_front[current_id_front]);
				
				point_front[current_id_front] 		= new GLatLng(location_latitude_front[current_id_front],location_longitude_front[current_id_front]);
				MyMarkers_front[current_id_front]	= createMarker(point_front[current_id_front], location_name_front[current_id_front], current_id_front, location_contact_front[current_id_front], location_phone_front[current_id_front], location_city_front[current_id_front], location_state_front[current_id_front]);
				
				map_front.addOverlay(MyMarkers_front[current_id_front]);
			}
		});
	}
}
function createMarker(point_front, location_name_front, location_num_front, location_contact_front, location_phone_front, location_city_front, location_state_front) 
{	
	var marker_front = new GMarker(point_front);
  	var html_front = "<font color='#000000'><b>" + location_name_front + "</b><br/>"+location_city_front+", "+location_state_front+"</font><br/><br/>"+location_contact_front+"<br/>"+location_phone_front;
  	
	GEvent.addListener(marker_front, 'click', function() 
	{
    	marker_front.openInfoWindowHtml(html_front);
  	});
  	 
	return marker_front;
	
}


