//LOGIS GIS 57050 Duluth St, Golden Valley, MN
//Keith Anderson GIS Analyst - September 2008
//
//
//Javscript functionality for PIMA Web, a public crime mapping application

function youJSFunction()
{
alert("my check box")
}

var map = null;
var doingsearch = false;
var pinid=0;
var layerid=1;
     
function DrawPoly(id,points,width,color)
     {
     poly = new VEPolyline(id,points);
     poly.SetWidth(width);
     poly.SetColor(color);
     map.AddPolyline(poly);
     }
     
function DeleteCityBoundary()         
     {            
     map.DeleteAllPolylines();                
     }
     
function CityExtent(latlong)
     {
     map.SetCenter(latlong);
     map.SetZoomLevel(12);
     }    
     
function DeleteLayer(layerid)
    {            
     map.DeleteLayer(layerid);         
    }         

function DeleteShapeLayer(layer)
         {
            map.DeleteShapeLayer(layer);
            ShapeLayerInfo();
         }

function DeleteAllLayersNew()
      {         
      //alert(1);
      map.DeleteAllShapeLayers();         
      layer = null; 
      
      //if (document.getElementById('chkRoad').checked == true);  
      //{
      //alert(2);
      //document.getElementById('chkRoad').checked=false;
      //document.getElementById('chkPark').checked=false;
      //document.getElementById('chkAnimal').checked=false;
      //document.getElementById('chkDist').checked=false;
      document.getElementById('chkBurg').checked=false;
      document.getElementById('chkArson').checked=false;
      document.getElementById('chkTheft').checked=false;
      document.getElementById('chkVehicle').checked=false;
      document.getElementById('chkDamage').checked=false;
      document.getElementById('chkRob').checked=false;

      //alert(3);
      //}   
      }
      
               
function OnPIMALoad()
     { 
       map = new VEMap('mymapcontroldiv');
        
       //map.LoadMap();
       map.LoadMap(new VELatLong(44.82154, -93.17161), 12 ,'r',false);
       LoadCityBoundary();
       CityExtent(new VELatLong(44.82154, -93.17161));
       map.AttachEvent("onchangeview", function(e) {
        
        if (doingsearch==true){

         var ll = map.GetCenter();
        
         var pin = new VEPushpin(pinid, ll,
         //'http://www.myfavoriteplaceonearth.com/images/target.gif','Center of map','');
          'http://gis.logis.org/Eagan/PIMAWeb6/Images/pinBlack.gif','Zoom to Address','');
         map.AddPushpin(pin);
         pinid++;
         
         doingsearch=false;
         document.getElementById('resultarea').innerHTML = "&nbsp; Lat/Long: " + ll.toString();
        } 
       }); 
     }
     
function SearchClick() 
    {
       var whereterm = document.getElementById('txtFind').value;
       doingsearch = true;
       map.Find('', whereterm,1);
    }
    
    
function AddXMLLayer(type, theURL, theLayerSource)
     {
        var veLayerSpec = new VELayerSpecification();

        veLayerSpec.Type = type;
        veLayerSpec.ID = layerid;
        //veLayerSpec.LayerSource = txtSource.value;
        veLayerSpec.LayerSource = "http://gis.logis.org/Eagan/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Eagan/PIMAWeb" + theURL;
        veLayerSpec.Method = 'get';
        //veLayerSpec.FnCallback = onFeedLoad;
        map.AddLayer(veLayerSpec);
        layerid++;
        //Map.AttachEvent("onchangeview", function_name);
        //CityExtent(new VELatLong(44.938557, -93.472366));
     }
     
function AddXMLLayerBurglariesxx(type, theURL, theLayerSource)
     {
        var veLayerSpec = new VELayerSpecification();

        veLayerSpec.Type = type;
        veLayerSpec.ID = 1;
        //veLayerSpec.LayerSource = txtSource.value;
        veLayerSpec.LayerSource = "http://gis.logis.org/Eagan/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Eagan/PIMAWeb" + theURL;
        veLayerSpec.Method = 'get';
        //veLayerSpec.FnCallback = onFeedLoad;
        map.AddLayer(veLayerSpec);
        layerid++;
        //Map.AttachEvent("onchangeview", function_name);
        //CityExtent(new VELatLong(44.938557, -93.472366));
     }
     
function AddMyLayerBurglaries(type)
         {
         
            //test.value = txtSource.value;
            var l = new VEShapeLayer();
            var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb6/XML/EA_Burglary.xml", l);
            map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
           
         }


function DeleteAllLayers()
{         
 map.DeleteAllShapeLayers();         
 layer = null;
}



var pinid = 0;


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////// Roads -Calls for Service
var Road = null;

function ToggleRoad()
{
//alert(1);
if(document.getElementById('chkRoad').checked==true)
    {
    //alert(2);
    AddLayerRoad(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerRoad();
    }
}

function AddLayerRoad(type)
{
    Road = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_RoadDR.xml", Road);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Road.SetTitle("Road");
}

function DeleteLayerRoad()      
{         
if(Road != null)         
    {            
    map.DeleteShapeLayer(Road);            
    Road = null;         
    }      
}
////////////////////

/////////////////// Park -Calls for Service
var Park = null;

function TogglePark()
{
//alert(1);
if(document.getElementById('chkPark').checked==true)
    {
    //alert(2);
    AddLayerPark(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerPark();
    }
}

function AddLayerPark(type)
{
    Park = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_Park.xml", Park);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Park.SetTitle("Park");
}

function DeleteLayerPark()      
{         
if(Park != null)         
    {            
    map.DeleteShapeLayer(Park);            
    Park = null;         
    }      
}
////////////////////

/////////////////// Animal -Calls for Service
var Animal = null;

function ToggleAnimal()
{
//alert(1);
if(document.getElementById('chkAnimal').checked==true)
    {
    //alert(2);
    AddLayerAnimal(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerAnimal();
    }
}

function AddLayerAnimal(type)
{
    Animal = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_Animal.xml", Animal);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Animal.SetTitle("Animal");
}

function DeleteLayerAnimal()      
{     
   
if(Animal != null)         
    {
    map.DeleteShapeLayer(Animal);            
    Animal = null;         
    }      
}
////////////////////

/////////////////// Disturbance -Calls for Service
var Dist = null;

function ToggleDist()
{
//alert(1);
if(document.getElementById('chkDist').checked==true)
    {
    //alert(2);
    AddLayerDist(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerDist();
    }
}

function AddLayerDist(type)
{
    Dist = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_Dist.xml", Dist);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Dist.SetTitle("Dist");
}

function DeleteLayerDist()      
{         
if(Dist != null)         
    {            
    map.DeleteShapeLayer(Dist);            
    Dist = null;         
    }      
}
////////////////////

/////////////////// Burglaries - Reports
var Burg = null;

function ToggleBurg()
{
//alert(1);
if(document.getElementById('chkBurg').checked==true)
    {
    //alert(2);
    AddLayerBurg(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerBurg();
    }
}

function AddLayerBurg(type)
{
    Burg = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_Burglary.xml", Burg);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Burg.SetTitle("Burg");
}

function DeleteLayerBurg()      
{         
if(Burg != null)         
    {            
    map.DeleteShapeLayer(Burg);            
    Burg = null;         
    }      
}
////////////////////

/////////////////// Damage - Reports
var Damage = null;

function ToggleDamage()
{
//alert(1);
if(document.getElementById('chkDamage').checked==true)
    {
    //alert(2);
    AddLayerDamage(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerDamage();
    }
}

function AddLayerDamage(type)
{
    Damage = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_CRIMINAL DAMAGE PROPERTY.xml", Damage);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Damage.SetTitle("Damage");
}

function DeleteLayerDamage()      
{         
if(Damage != null)         
    {            
    map.DeleteShapeLayer(Damage);            
    Damage = null;         
    }      
}
////////////////////

/////////////////// Arson - Reports
var Arson = null;

function ToggleArson()
{
//alert(1);
if(document.getElementById('chkArson').checked==true)
    {
    //alert(2);
    AddLayerArson(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerArson();
    }
}

function AddLayerArson(type)
{
    Arson = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_Arson.xml", Arson);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Arson.SetTitle("Damage");
}

function DeleteLayerArson()      
{         
if(Arson != null)         
    {            
    map.DeleteShapeLayer(Arson);            
    Arson = null;         
    }      
}
////////////////////

/////////////////// Theft - Reports
var Theft = null;

function ToggleTheft()
{
//alert(1);
if(document.getElementById('chkTheft').checked==true)
    {
    //alert(2);
    AddLayerTheft(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerTheft();
    }
}

function AddLayerTheft(type)
{
    Theft = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_Theft.xml", Theft);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Theft.SetTitle("Theft");
}

function DeleteLayerTheft()      
{         
if(Theft != null)         
    {            
    map.DeleteShapeLayer(Theft);            
    Theft = null;         
    }      
}
////////////////////

/////////////////// Vehicle - Reports
var Vehicle = null;

function ToggleVehicle()
{
//alert(1);
if(document.getElementById('chkVehicle').checked==true)
    {
    //alert(2);
    AddLayerVehicle(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerVehicle();
    }
}

function AddLayerVehicle(type)
{
    Vehicle = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_Theft Vehicle.xml", Vehicle);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Vehicle.SetTitle("Vehicle");
}

function DeleteLayerVehicle()      
{         
if(Vehicle != null)         
    {            
    map.DeleteShapeLayer(Vehicle);            
    Vehicle = null;         
    }      
}
////////////////////

/////////////////// Robbery - Reports
var Rob = null;

function ToggleRob()
{
//alert(1);
if(document.getElementById('chkRob').checked==true)
    {
    //alert(2);
    AddLayerRob(VEDataType.GeoRSS, true);
    }
else
    {
    //alert(3);
    DeleteLayerRob();
    }
}

function AddLayerRob(type)
{
    Rob = new VEShapeLayer();
    var veLayerSpec = new VEShapeSourceSpecification(type, "http://gis.logis.org/Eagan/PIMAWeb/XML/EA_Robbery.xml", Rob);
    map.ImportShapeLayerData(veLayerSpec, onFeedLoad);
    Rob.SetTitle("Rob");
}

function DeleteLayerRob()      
{         
if(Rob != null)         
    {            
    map.DeleteShapeLayer(Rob);            
    Rob = null;         
    }      
}
////////////////////

function onFeedLoad(layer)
         {
            var count = layer.GetShapeCount();
            for (var i = 0; i < count; i++)
            {
              var shape = layer.GetShapeByIndex(i);
              //test.value = shape.IconId;
              shape.SetCustomIcon("<img src='" + shape.IconId + "'/>");
            }

            //alert('RSS or Collection loaded. There are '+count+' items in this list.');
         }
         
         
//New Find Function for v6.1
function dosearch()
{
map.Find(null, document.getElementById('txtWhere').value, null, null, null, null, null, null, null, true, onfound);
}

function onfound(layer, resultsArray, places, hasMore, veErrorMessage)
{
if (places) 
    {
    var shape = new VEShape(VEShapeType.Pushpin, places[0].LatLong);
    //shape.SetTitle(infoTitle);
    shape.SetDescription(document.getElementById('txtWhere').value);
    var icon = "<img src='http://gis.logis.org/Eagan/PIMAWeb/Images/pinblack.gif'>";
    shape.SetCustomIcon(icon);                    
    map.AddShape(shape);
    }
}       
///////////

  
function AddXMLLayerBurglaries(type, theURL, theLayerSource)
     {
        //var veLayerSpec = new VELayerSpecification();
        
        
            var l = new VEShapeLayer();
            var veLayerSpec = new VEShapeSourceSpecification(type, "http://localhost/PIMAWeb/XML/EA_Burglary.xml", l);
            map.ImportShapeLayerData(veLayerSpec);

        //veLayerSpec.Type = type;
        //veLayerSpec.ID = 1;
        ////veLayerSpec.LayerSource = txtSource.value;
        //veLayerSpec.LayerSource = "http://gis.logis.org/Eagan/PIMAWeb" + theLayerSource;
        //veLayerSpec.IconUrl = "http://gis.logis.org/Eagan/PIMAWeb" + theURL;
        //veLayerSpec.Method = 'get';
        ////veLayerSpec.FnCallback = onFeedLoad;
        //map.AddLayer(veLayerSpec);
        //layerid++;
        ////Map.AttachEvent("onchangeview", function_name);
        ////CityExtent(new VELatLong(44.938557, -93.472366));
     }
function AddXMLLayerRobberies(type, theURL, theLayerSource)
     {
        var veLayerSpec = new VELayerSpecification();

        veLayerSpec.Type = type;
        veLayerSpec.ID = 2;
        //veLayerSpec.LayerSource = txtSource.value;
        veLayerSpec.LayerSource = "http://gis.logis.org/Eagan/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Eagan/PIMAWeb" + theURL;
        veLayerSpec.Method = 'get';
        //veLayerSpec.FnCallback = onFeedLoad;
        map.AddLayer(veLayerSpec);
        layerid++;
        //Map.AttachEvent("onchangeview", function_name);
        //CityExtent(new VELatLong(44.938557, -93.472366));
     }     
     
function AddXMLLayerArsons(type, theURL, theLayerSource)
     {
        var veLayerSpec = new VELayerSpecification();

        veLayerSpec.Type = type;
        veLayerSpec.ID = 3;
        //veLayerSpec.LayerSource = txtSource.value;
        veLayerSpec.LayerSource = "http://gis.logis.org/Eagan/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Eagan/PIMAWeb" + theURL;
        veLayerSpec.Method = 'get';
        //veLayerSpec.FnCallback = onFeedLoad;
        map.AddLayer(veLayerSpec);
        layerid++;
        //Map.AttachEvent("onchangeview", function_name);
        //CityExtent(new VELatLong(44.938557, -93.472366));
     }     
     
function AddXMLLayerThefts(type, theURL, theLayerSource)
     {
        var veLayerSpec = new VELayerSpecification();

        veLayerSpec.Type = type;
        veLayerSpec.ID = 4;
        //veLayerSpec.LayerSource = txtSource.value;
        veLayerSpec.LayerSource = "http://gis.logis.org/Eagan/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Eagan/PIMAWeb" + theURL;
        veLayerSpec.Method = 'get';
        //veLayerSpec.FnCallback = onFeedLoad;
        map.AddLayer(veLayerSpec);
        layerid++;
        //Map.AttachEvent("onchangeview", function_name);
        //CityExtent(new VELatLong(44.938557, -93.472366));
     }

function AddXMLLayerVehicleThefts(type, theURL, theLayerSource)
     {
        var veLayerSpec = new VELayerSpecification();

        veLayerSpec.Type = type;
        veLayerSpec.ID = 5;
        //veLayerSpec.LayerSource = txtSource.value;
        veLayerSpec.LayerSource = "http://gis.logis.org/Eagan/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Eagan/PIMAWeb" + theURL;
        veLayerSpec.Method = 'get';
        //veLayerSpec.FnCallback = onFeedLoad;
        map.AddLayer(veLayerSpec);
        layerid++;
        //Map.AttachEvent("onchangeview", function_name);
        //CityExtent(new VELatLong(44.938557, -93.472366));
     }
     
     
function DeletePin(id)         
     {              
         try            
         {                 
             if (id!=null)                
            {                
                map.DeletePushpin(id);                
            }                
             else                
            {                
                map.DeleteAllPushpins();                
            }            
         }            
          catch (err)            
         {                
             alert(err.message);            
         }         
     }   

function DeleteAllPins()
    {
	map.DeleteAllPushpins();
    }
     
function LoadCityBoundary()
     {
     DrawPoly('1',[new VELatLong(44.8612454,-93.1061333),
new VELatLong(44.8609421,-93.1061287),
new VELatLong(44.8601225,-93.1061164),
new VELatLong(44.859401,-93.1061056),
new VELatLong(44.8586892,-93.1060948),
new VELatLong(44.855073,-93.1060404),
new VELatLong(44.847874,-93.1061454),
new VELatLong(44.8425765,-93.1061507),
new VELatLong(44.8423427,-93.106151),
new VELatLong(44.8418538,-93.1061515),
new VELatLong(44.8417709,-93.1058241),
new VELatLong(44.8417002,-93.1058465),
new VELatLong(44.8412418,-93.1059915),
new VELatLong(44.8410385,-93.1060559),
new VELatLong(44.8408471,-93.1060561),
new VELatLong(44.8406138,-93.1060563),
new VELatLong(44.8406136,-93.1061527),
new VELatLong(44.8382477,-93.1061545),
new VELatLong(44.8372575,-93.1061551),
new VELatLong(44.8364382,-93.1061556),
new VELatLong(44.8356788,-93.1061557),
new VELatLong(44.8352084,-93.1061566),
new VELatLong(44.8352052,-93.1061566),
new VELatLong(44.8334273,-93.106158),
new VELatLong(44.8334251,-93.106158),
new VELatLong(44.8327353,-93.1061557),
new VELatLong(44.8279073,-93.1061395),
new VELatLong(44.8278793,-93.1058559),
new VELatLong(44.8275912,-93.106009),
new VELatLong(44.8272909,-93.1061283),
new VELatLong(44.8255725,-93.1061514),
new VELatLong(44.8226041,-93.1061453),
new VELatLong(44.8207264,-93.1061351),
new VELatLong(44.8201856,-93.1061539),
new VELatLong(44.8198485,-93.1058343),
new VELatLong(44.8196469,-93.1061574),
new VELatLong(44.8174407,-93.1061434),
new VELatLong(44.814421,-93.1061134),
new VELatLong(44.8117786,-93.1060874),
new VELatLong(44.8096167,-93.1061162),
new VELatLong(44.8077657,-93.1061036),
new VELatLong(44.807342,-93.1064317),
new VELatLong(44.8070192,-93.1066597),
new VELatLong(44.806676,-93.1067746),
new VELatLong(44.8063528,-93.1068326),
new VELatLong(44.8058679,-93.1068059),
new VELatLong(44.8055141,-93.1066936),
new VELatLong(44.8052209,-93.106567),
new VELatLong(44.8047055,-93.1064128),
new VELatLong(44.8041506,-93.1061916),
new VELatLong(44.8035732,-93.1059202),
new VELatLong(44.8027341,-93.1055828),
new VELatLong(44.801961,-93.1056425),
new VELatLong(44.8011135,-93.1059434),
new VELatLong(44.800725,-93.1062026),
new VELatLong(44.797359,-93.1062006),
new VELatLong(44.7970933,-93.1062008),
new VELatLong(44.7959484,-93.1062017),
new VELatLong(44.7901145,-93.1062082),
new VELatLong(44.7901149,-93.1063237),
new VELatLong(44.7901125,-93.1063237),
new VELatLong(44.7894852,-93.1063267),
new VELatLong(44.7892268,-93.1064634),
new VELatLong(44.7891725,-93.1062048),
new VELatLong(44.7881993,-93.1062014),
new VELatLong(44.7864682,-93.1061952),
new VELatLong(44.7845643,-93.1061886),
new VELatLong(44.7829057,-93.1061828),
new VELatLong(44.7828986,-93.1061828),
new VELatLong(44.7806421,-93.1061742),
new VELatLong(44.7756589,-93.1062902),
new VELatLong(44.7756641,-93.1080324),
new VELatLong(44.7756331,-93.1092793),
new VELatLong(44.7756869,-93.1112644),
new VELatLong(44.7756587,-93.1167544),
new VELatLong(44.7756631,-93.1169769),
new VELatLong(44.7756653,-93.1220257),
new VELatLong(44.7756654,-93.1220338),
new VELatLong(44.7756627,-93.1229291),
new VELatLong(44.77571,-93.1366448),
new VELatLong(44.77571,-93.1366529),
new VELatLong(44.7757443,-93.1469204),
new VELatLong(44.775713,-93.1471094),
new VELatLong(44.7757144,-93.1564258),
new VELatLong(44.7757116,-93.1570716),
new VELatLong(44.7756946,-93.1624903),
new VELatLong(44.7756807,-93.1667718),
new VELatLong(44.7756804,-93.166974),
new VELatLong(44.7756798,-93.1672375),
new VELatLong(44.7756793,-93.1673979),
new VELatLong(44.7756793,-93.1674113),
new VELatLong(44.7756525,-93.1768268),
new VELatLong(44.7756503,-93.1773999),
new VELatLong(44.7756582,-93.1869669),
new VELatLong(44.7756597,-93.1876964),
new VELatLong(44.7758796,-93.1970841),
new VELatLong(44.7758957,-93.1977716),
new VELatLong(44.7758707,-93.2045707),
new VELatLong(44.7758584,-93.2078656),
new VELatLong(44.7758584,-93.2079263),
new VELatLong(44.7758714,-93.2136104),
new VELatLong(44.7758783,-93.2166254),
new VELatLong(44.7758794,-93.2171177),
new VELatLong(44.7758797,-93.2172491),
new VELatLong(44.7758801,-93.2174181),
new VELatLong(44.7758816,-93.2180921),
new VELatLong(44.7758847,-93.2182032),
new VELatLong(44.7758842,-93.2182354),
new VELatLong(44.7758812,-93.2184393),
new VELatLong(44.7758805,-93.218482),
new VELatLong(44.7758502,-93.2205023),
new VELatLong(44.7758461,-93.2207808),
new VELatLong(44.775843,-93.2210094),
new VELatLong(44.7758363,-93.2215137),
new VELatLong(44.7758306,-93.2219421),
new VELatLong(44.7758,-93.2242524),
new VELatLong(44.7757518,-93.227869),
new VELatLong(44.7783348,-93.2278644),
new VELatLong(44.7830002,-93.2278563),
new VELatLong(44.7902541,-93.2278309),
new VELatLong(44.7959188,-93.2277965),
new VELatLong(44.7963892,-93.2277937),
new VELatLong(44.7974695,-93.2277871),
new VELatLong(44.7974757,-93.2277871),
new VELatLong(44.7984003,-93.2277814),
new VELatLong(44.8006693,-93.2277673),
new VELatLong(44.8047646,-93.2277417),
new VELatLong(44.8047979,-93.2277414),
new VELatLong(44.8064527,-93.2277178),
new VELatLong(44.8068512,-93.2277121),
new VELatLong(44.8077416,-93.2276995),
new VELatLong(44.8077432,-93.2276992),
new VELatLong(44.8121127,-93.2276372),
new VELatLong(44.8194586,-93.2275705),
new VELatLong(44.8217819,-93.2275452),
new VELatLong(44.8234874,-93.2275266),
new VELatLong(44.8243448,-93.2275172),
new VELatLong(44.8243695,-93.227517),
new VELatLong(44.8247968,-93.2275123),
new VELatLong(44.8249569,-93.2275106),
new VELatLong(44.8263531,-93.2274953),
new VELatLong(44.8290574,-93.2274868),
new VELatLong(44.82948,-93.2259962),
new VELatLong(44.8310238,-93.2205513),
new VELatLong(44.8320204,-93.2194147),
new VELatLong(44.8336423,-93.2204957),
new VELatLong(44.836213,-93.2220926),
new VELatLong(44.8382381,-93.2218129),
new VELatLong(44.8390134,-93.2202088),
new VELatLong(44.8390312,-93.217978),
new VELatLong(44.8389647,-93.2153657),
new VELatLong(44.8398263,-93.2114536),
new VELatLong(44.8417366,-93.2093497),
new VELatLong(44.8431544,-93.2081547),
new VELatLong(44.8435961,-93.2077825),
new VELatLong(44.8477177,-93.2059339),
new VELatLong(44.8479692,-93.2058211),
new VELatLong(44.8526137,-93.2032741),
new VELatLong(44.8552501,-93.2009376),
new VELatLong(44.8581307,-93.198327),
new VELatLong(44.8600818,-93.1973077),
new VELatLong(44.8617216,-93.1978437),
new VELatLong(44.8617818,-93.1978634),
new VELatLong(44.8618984,-93.1979015),
new VELatLong(44.8618104,-93.197335),
new VELatLong(44.861339,-93.1908652),
new VELatLong(44.8612429,-93.1881226),
new VELatLong(44.8612091,-93.1761889),
new VELatLong(44.8612066,-93.1758294),
new VELatLong(44.8611616,-93.1672784),
new VELatLong(44.861163,-93.1670551),
new VELatLong(44.8612192,-93.1546654),
new VELatLong(44.8613269,-93.1531238),
new VELatLong(44.8618941,-93.1504993),
new VELatLong(44.8618937,-93.1502921),
new VELatLong(44.8623411,-93.1491424),
new VELatLong(44.8626101,-93.1474398),
new VELatLong(44.862778,-93.1455868),
new VELatLong(44.8627795,-93.1452113),
new VELatLong(44.8626137,-93.1296421),
new VELatLong(44.8626293,-93.1294493),
new VELatLong(44.8624877,-93.1120583),
new VELatLong(44.8618957,-93.1080336),
        new VELatLong(44.8612454,-93.1061333)],3,new VEColor(0,0,0,1));
     }
     
     
function ResizeMap() //resize
{
  if (map != null)
  {  
    if( typeof( window.innerWidth ) == 'number' )
    {
    //Non-IE
    map.Resize(window.innerWidth,window.innerHeight);
    } 
    else if( document.documentElement && ( document.documentElement.clientWidth
       || document.documentElement.clientHeight ) )
    {
    //IE 6+ in 'standards compliant mode'
    map.Resize(document.documentElement.clientWidth
      ,document.documentElement.clientHeight);
    }
  }
}

function UnloadMap() //dispose map etc
{
  if (map != null)
  {
    map.Dispose();
  }
} 

function checkAll(check) {
   for (i=0;i<6;i++) {
     if (check) { 
        document.forms['signup'].chbx[i].checked=true;
        }
     else {
        document.forms['signup'].chbx[i].checked=false;
        }
     }
   }

