      var map = null;
	  var latlong = null;
	  var DTHpoints = null;
	  var cityLimits = null;
      
	  function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

	        
      function GetMap()
      {
         //Houston Map
		 map = new VEMap('myMap');
		 DTHlatLong = new VELatLong(30.072728,-95.435820);
         map.LoadMap(DTHlatLong);
		 map.HideDashboard();
		 map.SetZoomLevel(12);
		 var icon = '<div><img src="../images/stories/maps/icon.png"/></div>';
		 var infobox = "<div>18750 Interstate 45 N.<br />"
				+"Spring, TX 77373<br />"
				+"Office: 281-355-1591<br />"
				+"Fax: 281-355-1594</div>";

		 
		 //Add Pushpin for Information Center
		 shape = new VEShape (VEShapeType.Pushpin, DTHlatLong);
		 shape.SetTitle('<bold>Information Center</bold>');
		 shape.SetDescription(infobox);
		 shape.SetCustomIcon(icon);
		 map.AddShape(shape);
		 
		 //Add map Overlay
		 
		var DTHpoints = [
		 		new VELatLong(30.70641975748972,-95.570068359375),
		 		new VELatLong(31.083517709507184,-95.9600830078125),
				new VELatLong(31.015278981711265,-96.11663818359375),
				new VELatLong(30.737114341627027,-96.46820068359375),
				new VELatLong(30.60954979719084,-96.5423583984375),
				new VELatLong(30.4297295750316,-96.37481689453125),
				new VELatLong(30.147502278499242,-96.4105224609375),
				new VELatLong(29.96683228373106,-96.50115966796875),
				new VELatLong(29.88351825335318,-96.50115966796875),
				new VELatLong(29.869228848968312,-96.5478515625),
				new VELatLong(29.68566667011872,-96.536865234375),
				new VELatLong(29.178543264303005,-96.2786865234375),
				new VELatLong(29.31514119318728,-96.1138916015625),
				new VELatLong(29.26483685902403,-95.95184326171875),
				new VELatLong(29.192930577727757,-95.91064453125),
				new VELatLong(29.03215782622282,-95.5755615234375),
				new VELatLong(28.950475674848007,-95.3778076171875),
				new VELatLong(29.048966726566885,-95.152587890625),
				new VELatLong(29.305561325527698,-94.7735595703125),
				new VELatLong(29.556734316910855,-94.38079833984375),
				new VELatLong(29.8239655668307,-94.4000244140625),
				new VELatLong(29.826348356278117,-94.6966552734375),
				new VELatLong(30.05483122485245,-94.79278564453125),
				new VELatLong(30.441570071519468,-94.7735595703125),
				new VELatLong(30.713503990354965,-94.9603271484375),
				new VELatLong(30.741835717889792,-95.2294921875),
				new VELatLong(30.70641975748972,-95.570068359375)
		];
		var cityLimits = new VEShape(VEShapeType.Polyline, DTHpoints);
		cityLimits.SetLineColor(new VEColor(0,150,100,0.5));
		cityLimits.SetLineWidth(5);
		cityLimits.HideIcon();
		//map.SetMapView(DTHpoints);
		map.AddShape(cityLimits);
		
		//San Antonio Map
		map = new VEMap('SanAntonio');
		 DTHlatLong = new VELatLong(29.665645,-98.448336);
         map.LoadMap(DTHlatLong);
		 map.HideDashboard();
		 map.SetZoomLevel(11);
		 var icon = '<div><img src="../images/stories/maps/icon.png"/></div>';
		 var infobox = "<div>24170 Highway 281 N.<br />"
		  				+"San Antonio, TX 78258<br />"
						+"Office: 830-980-5558<br />"
						+"Fax: 830-980-5553</div>";


		 //Add Pushpin for Information Center
		 shape = new VEShape (VEShapeType.Pushpin, DTHlatLong);
		 shape.SetTitle('<bold>Information Center</bold>');
		 shape.SetDescription(infobox);
		 shape.SetCustomIcon(icon);
		 map.AddShape(shape);

		var DTHpoints = [
		 		new VELatLong(30.27330042806996,-98.8714599609375),
				new VELatLong(30.04532159026885,-99.140625),
				new VELatLong(29.835878945929952,-99.283447265625),
				new VELatLong(29.72145191669099,-99.07470703125),
				new VELatLong(29.348663646523626,-99.1571044921875),
				new VELatLong(29.13776825498331,-98.89892578125),
				new VELatLong(28.96489485992114,-98.492431640625),
				new VELatLong(29.13776825498331,-98.1683349609375),
				new VELatLong(29.23847708592805,-97.9595947265625),
				new VELatLong(29.568679425235132,-97.9705810546875),
				new VELatLong(29.864465259258,-97.943115234375),
				new VELatLong(30.083354648756124,-97.8497314453125),
				new VELatLong(30.230594564932193,-97.8387451171875),
				new VELatLong(30.192618218499273,-98.3880615234375),
				new VELatLong(30.268556249047726,-98.404541015625),
				new VELatLong(30.27330042806996,-98.8714599609375)		 		
		];
		
		var cityLimits = new VEShape(VEShapeType.Polyline, DTHpoints);
		cityLimits.SetLineColor(new VEColor(0,150,100,0.5));
		cityLimits.SetLineWidth(5);
		cityLimits.HideIcon();
		//map.SetMapView(DTHpoints);
		map.AddShape(cityLimits);

      }   
	  
	addLoadEvent(function() {
  	GetMap();
	})