//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(13);
     }    
     
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.6571429,-93.1634331), 13 ,'r',false);
       LoadCityBoundary();
       //LoadCityBoundaryII();
       CityExtent(new VELatLong(44.6571429,-93.1634331));
       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/Farmington/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/Farmington/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Farmington/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/Farmington/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Farmington/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/Farmington/PIMAWeb6/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/PIMAWeb/XML/FA_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/Farmington/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/FA_Burglary.xml", l);
            map.ImportShapeLayerData(veLayerSpec);

        //veLayerSpec.Type = type;
        //veLayerSpec.ID = 1;
        ////veLayerSpec.LayerSource = txtSource.value;
        //veLayerSpec.LayerSource = "http://gis.logis.org/Farmington/PIMAWeb" + theLayerSource;
        //veLayerSpec.IconUrl = "http://gis.logis.org/Farmington/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/Farmington/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Farmington/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/Farmington/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Farmington/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/Farmington/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Farmington/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/Farmington/PIMAWeb" + theLayerSource;
        veLayerSpec.IconUrl = "http://gis.logis.org/Farmington/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.670468474,-93.1564995546),
new VELatLong(44.6668494081,-93.1565099189),
new VELatLong(44.666852186,-93.1527848582),
new VELatLong(44.6668470824,-93.1495830131),
new VELatLong(44.6668425089,-93.1467576442),
new VELatLong(44.6596339046,-93.1467694336),
new VELatLong(44.6596389186,-93.1474227085),
new VELatLong(44.6596487759,-93.1487100819),
new VELatLong(44.6596641603,-93.1518505316),
new VELatLong(44.656077176,-93.1518629985),
new VELatLong(44.6524901889,-93.15187546),
new VELatLong(44.6524509532,-93.146799077),
new VELatLong(44.6488291926,-93.1468140337),
new VELatLong(44.6488128517,-93.144158342),
new VELatLong(44.6452001248,-93.1452195526),
new VELatLong(44.6451860236,-93.1419155201),
new VELatLong(44.6455964406,-93.1419139274),
new VELatLong(44.6455929125,-93.1411440136),
new VELatLong(44.6455913268,-93.1407982431),
new VELatLong(44.6457284628,-93.1407983133),
new VELatLong(44.6457261894,-93.1403027051),
new VELatLong(44.6457233645,-93.1396880051),
new VELatLong(44.645721948,-93.1393806551),
new VELatLong(44.645719121,-93.1387659472),
new VELatLong(44.6457177048,-93.1384585973),
new VELatLong(44.6451692617,-93.138458337),
new VELatLong(44.6451688761,-93.1383805789),
new VELatLong(44.6451680916,-93.1382278214),
new VELatLong(44.6459004053,-93.1382281696),
new VELatLong(44.6458959723,-93.1372679868),
new VELatLong(44.6458939133,-93.1368300512),
new VELatLong(44.6458932477,-93.1366884925),
new VELatLong(44.6457535198,-93.1366941326),
new VELatLong(44.6457467824,-93.1352340158),
new VELatLong(44.6464571456,-93.135234274),
new VELatLong(44.6464576089,-93.1353354256),
new VELatLong(44.6465536089,-93.1353354669),
new VELatLong(44.6465551318,-93.1365456805),
new VELatLong(44.6470853022,-93.1366625771),
new VELatLong(44.6492581145,-93.1366825054),
new VELatLong(44.6492701614,-93.135790112),
new VELatLong(44.6493611583,-93.1350706128),
new VELatLong(44.6495402693,-93.1343839727),
new VELatLong(44.6498014919,-93.1337513426),
new VELatLong(44.6502901134,-93.1329926339),
new VELatLong(44.651391421,-93.1318045762),
new VELatLong(44.6515390654,-93.1316452999),
new VELatLong(44.6523522681,-93.1306608196),
new VELatLong(44.6523408177,-93.1272234092),
new VELatLong(44.6523391648,-93.1267302499),
new VELatLong(44.6523389164,-93.1266475886),
new VELatLong(44.6523384886,-93.1265207917),
new VELatLong(44.6495329348,-93.1265292591),
new VELatLong(44.6490519854,-93.1265309299),
new VELatLong(44.6487261107,-93.1265319281),
new VELatLong(44.6474309043,-93.1265359225),
new VELatLong(44.6472780605,-93.1273048079),
new VELatLong(44.6459016622,-93.1273090313),
new VELatLong(44.6460627839,-93.126540107),
new VELatLong(44.6451127207,-93.1262517287),
new VELatLong(44.6439731019,-93.1265513773),
new VELatLong(44.6439597989,-93.1237354325),
new VELatLong(44.6450102637,-93.1237277286),
new VELatLong(44.6451007667,-93.1237270621),
new VELatLong(44.6450739073,-93.1180909865),
new VELatLong(44.6449834294,-93.1180916496),
new VELatLong(44.6414541331,-93.1181178756),
new VELatLong(44.6378343141,-93.1181447738),
new VELatLong(44.6378466668,-93.1215122003),
new VELatLong(44.6378602698,-93.1252513704),
new VELatLong(44.6342395615,-93.125277826),
new VELatLong(44.6342239506,-93.1215384971),
new VELatLong(44.6323840051,-93.1215518542),
new VELatLong(44.6323960379,-93.1248167424),
new VELatLong(44.6306191037,-93.1248295348),
new VELatLong(44.630633383,-93.1281857911),
new VELatLong(44.6305406851,-93.1281848901),
new VELatLong(44.6291226275,-93.1281830067),
new VELatLong(44.6291253432,-93.1266499805),
new VELatLong(44.626966554,-93.1266691179),
new VELatLong(44.6240340468,-93.1266398525),
new VELatLong(44.6242886191,-93.1278753951),
new VELatLong(44.6243001354,-93.1302911208),
new VELatLong(44.6233424164,-93.1304167423),
new VELatLong(44.6243013393,-93.1305446033),
new VELatLong(44.6243070727,-93.1317520713),
new VELatLong(44.6233487922,-93.1317564593),
new VELatLong(44.6233567413,-93.1334310185),
new VELatLong(44.6233647459,-93.1351228443),
new VELatLong(44.624685671,-93.1351060505),
new VELatLong(44.6246879798,-93.1355961027),
new VELatLong(44.625131913,-93.1355955038),
new VELatLong(44.6255844757,-93.135594907),
new VELatLong(44.6255900427,-93.1367781026),
new VELatLong(44.6249839532,-93.1367794776),
new VELatLong(44.624576357,-93.1367802892),
new VELatLong(44.6245778627,-93.1369933682),
new VELatLong(44.624583403,-93.137755317),
new VELatLong(44.6245283801,-93.1377554807),
new VELatLong(44.6245353208,-93.1387403821),
new VELatLong(44.6242490489,-93.1387382493),
new VELatLong(44.6242532393,-93.1376327514),
new VELatLong(44.6236498302,-93.1376331025),
new VELatLong(44.6236563215,-93.1385547826),
new VELatLong(44.6233847919,-93.1385549388),
new VELatLong(44.6233930796,-93.1397330148),
new VELatLong(44.6234266896,-93.1445270919),
new VELatLong(44.6253336767,-93.1445339719),
new VELatLong(44.6253210983,-93.1419240526),
new VELatLong(44.6288849337,-93.141928603),
new VELatLong(44.6300622535,-93.1419375064),
new VELatLong(44.6300784194,-93.14364985),
new VELatLong(44.6307042295,-93.1436558846),
new VELatLong(44.6307122858,-93.1453574181),
new VELatLong(44.6307194612,-93.1470613602),
new VELatLong(44.6307259142,-93.1484385765),
new VELatLong(44.6307253116,-93.1495435838),
new VELatLong(44.6307446079,-93.1521743696),
new VELatLong(44.6269165738,-93.1521434859),
new VELatLong(44.6269730453,-93.1520385596),
new VELatLong(44.6270308165,-93.1519350302),
new VELatLong(44.6270898706,-93.1518329256),
new VELatLong(44.6271501855,-93.1517322815),
new VELatLong(44.6272117473,-93.1516331256),
new VELatLong(44.6272745366,-93.1515354897),
new VELatLong(44.6273385312,-93.1514394017),
new VELatLong(44.6274037144,-93.1513448932),
new VELatLong(44.6274700639,-93.1512519921),
new VELatLong(44.6275375632,-93.1511607262),
new VELatLong(44.62760619,-93.1510711234),
new VELatLong(44.6276759191,-93.1509832115),
new VELatLong(44.6277467368,-93.1508970183),
new VELatLong(44.627818618,-93.1508125638),
new VELatLong(44.6278915375,-93.1507298838),
new VELatLong(44.6279654787,-93.1506489983),
new VELatLong(44.6280404166,-93.150569931),
new VELatLong(44.6281163288,-93.1504927022),
new VELatLong(44.6281931902,-93.1504173475),
new VELatLong(44.6282709813,-93.150343879),
new VELatLong(44.6283496743,-93.1502723208),
new VELatLong(44.6284292467,-93.1502027007),
new VELatLong(44.6285096764,-93.1501350308),
new VELatLong(44.6286542279,-93.1500199858),
new VELatLong(44.6234753665,-93.15152147),
new VELatLong(44.6234795728,-93.1521292484),
new VELatLong(44.6234743899,-93.1570690248),
new VELatLong(44.6253268097,-93.1570533798),
new VELatLong(44.6307604175,-93.1571810615),
new VELatLong(44.6307608658,-93.1666746752),
new VELatLong(44.6307606508,-93.1743596721),
new VELatLong(44.6307605895,-93.1756221552),
new VELatLong(44.6307605163,-93.1762230321),
new VELatLong(44.6307605019,-93.1766637858),
new VELatLong(44.6306625613,-93.1770001082),
new VELatLong(44.6307604968,-93.177226834),
new VELatLong(44.6307675791,-93.1865344235),
new VELatLong(44.6307680979,-93.1872564019),
new VELatLong(44.6307681172,-93.1872828605),
new VELatLong(44.6307340238,-93.1974176905),
new VELatLong(44.6307337388,-93.1975461373),
new VELatLong(44.6307290358,-93.1991837964),
new VELatLong(44.6307048323,-93.2076200676),
new VELatLong(44.6307172496,-93.2076198558),
new VELatLong(44.6379667373,-93.2074951872),
new VELatLong(44.6422444136,-93.2074216129),
new VELatLong(44.6451528294,-93.2073715847),
new VELatLong(44.6524045926,-93.2072912209),
new VELatLong(44.6596430198,-93.2070516083),
new VELatLong(44.6653735388,-93.2071697553),
new VELatLong(44.6667812773,-93.2071987818),
new VELatLong(44.6740620017,-93.2072233233),
new VELatLong(44.6808600536,-93.2071133075),
new VELatLong(44.6812772426,-93.207113679),
new VELatLong(44.6885247924,-93.2071201635),
new VELatLong(44.688530247,-93.1972231195),
new VELatLong(44.6885302793,-93.1970962263),
new VELatLong(44.6885482853,-93.1869309215),
new VELatLong(44.6885484454,-93.1868948931),
new VELatLong(44.6885855785,-93.1816608608),
new VELatLong(44.6886202286,-93.1768033317),
new VELatLong(44.6886201108,-93.1767732491),
new VELatLong(44.6886063807,-93.172527203),
new VELatLong(44.6885963735,-93.1694206154),
new VELatLong(44.6885877306,-93.1667382946),
new VELatLong(44.6885871517,-93.1665582778),
new VELatLong(44.6885538037,-93.1563836566),
new VELatLong(44.6814145286,-93.1564852205),
new VELatLong(44.6813630725,-93.1564859529),
new VELatLong(44.6742183674,-93.1564891352),
new VELatLong(44.6740875465,-93.1564893462),
new VELatLong(44.670468474,-93.1564995546)],3,new VEColor(255,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;
        }
     }
   }
