﻿//Load Google Maps API
var googlemap;
var googlemapDiv;
var googleMarkerManager;
var cctvMarkerManager;
var dmsMarkerManager;
var eventMarkerManager;
var toolTipOverlay;

function initGoogleMap(googlemapDiv, lat, lng, zoom, cctvElem, dmsElem, eventElem) {
    googlemapDiv = document.getElementById(googlemapDiv);
    if (GBrowserIsCompatible()) {   
        googlemap = new GMap2(googlemapDiv);
        googlemap.addControl(new GLargeMapControl());
	    googlemap.addControl(new GMapTypeControl(), 
	               new GControlPosition(G_ANCHOR_TOP_LEFT, 
	               new GSize(100,10)));
	    googlemap.addControl(new GScaleControl());
        googlemap.setCenter(new GLatLng(lat, lng), zoom);
        googlemap.addControl(new LegendControl());
        //googlemap.addControl(new LocationControl());
        toolTipOverlay = new ToolTipOverlay(googlemapDiv);
        googlemap.addOverlay(toolTipOverlay);
        googleMarkerManager = new MarkerManager(googlemap);
        cctvMarkerManager = new MarkerManager(googlemap);
        dmsMarkerManager = new MarkerManager(googlemap);
        eventMarkerManager = new MarkerManager(googlemap);
        window.onunload = GUnload;
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(
            function (sender, args) { 
                refreshCctv(cctvElem); 
                refreshDms(dmsElem);
                refreshEvents(eventElem);
            }
        );
        /*
        GEvent.addListener(googlemap, 'moveend', function() {
	        var cPnt = googlemap.getCenter();
		    window.status = 'lat:' + cPnt.lat() + ', lng:' + cPnt.lng();
	    });*/
    }
}



function popup(target)
{ 
    open(target, 'ChildWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=775,height=550');
}

function openCctvWindow(id) 
{
    popup("traffic_camera/camview.aspx?camLoc=" + id.substring(3, 6) + "&function=1");
}

function openDmsWindow(id, title) 
{
    popup("dynamic_message/dynView.aspx?dmsLoc=" + id);
}

function openEventWindow(id) 
{
    popup("http://www.smartsunguide.com/singleevent.aspx?selected=" + id);
}

function getCctvToolTip(name, value)
{
    return "<div style=\"width:226px\"><font size=-2>" +
        "<a href=\"javascript:displayTopWindow(\\'http://www.smartsunguide.com/tmc/PM9000Display.pl?cam=" + 
        name + "&function=1" + "\\',\\'CCTVChild\\', 450, 400);\">" +
        value +
        "<br><iframe width=220 height=160 scrolling=no marginheight=0 marginwidth=0 src=http://www.smartsunguide.com/tmc/PM9000Display.pl?function=7&cam=" +
        name +
        "></a></font></div>";
}


function getDmsToolTip(iID, value, msg2)
{
    var val = "";
    try { 
    val = "<div style=\"width:200px\">" +
        "<div style=\"font-size:smaller;margin-right:10px\"" +
        "  onclick=\"javascript:displayTopWindow(\'http://www.smartsunguide.com/SMART/SMART_ViewDMS.aspx?selected=" +
        iID + "&title=" + value.replace("\'", "\\'") +
        "\', \'DMSChild\', 700, 350);\">" +
        "<a href=\"javascript:displayTopWindow(\'http://www.smartsunguide.com/SMART/SMART_ViewDMS.aspx?selected=" +
        iID + "&title=" + value.replace("\'", "\\'") +
        "\', \'DMSChild\', 700, 350);\">" +
        "" + value +
        "</a>" +
        "</div>" + 
        "<div class=dmsToolTipDiv>" +
        "" + msg2 +
        "  </div>" +
        "</div>";
        }
    catch (ex) { return ex; }
    return val;
}


function getEventToolTip(iID, value, msg2)
{
    var val = "";
    var closestCamera = "";
    var closestCameraRequest = "";
    var windowHeight = "500";
    try { 
        val =  "<div style=\"width:225px;font-size:smaller\"> " +
               "<span onclick=\"javascript:displayTopWindow(\'SMART/SMART_singleEventList.aspx?selected=" + iID + closestCameraRequest + "\', \'EventChild\', 770, " + windowHeight + ");\">" + 
               "<a href=\"javascript:displayTopWindow(\'SMART/SMART_singleEventList.aspx?selected=" + iID + closestCameraRequest + "\', \'EventChild\', 770, " + windowHeight + ");\">" + 
               "" + iID + 
               "</a>" +
               "</span>" +
               "-" + value +
        	   "<br>" + closestCamera +
        	   "</div>";
        }
    catch (ex) { return ex; }
    return val;
}
/*
function refreshCctv(elem)
{
    var elemCtl = document.getElementById(elem);
    markeroptions = { icon: cctvIcon };
    googleMarkerManager.clearMarkers();
    try {
        var data = eval('(' + elemCtl.value + ')');
        for (i=0; i<data.length; i++) {
            var marker = new GMarker(new GLatLng(data[i].lat, data[i].lng), markeroptions);
            marker.itemId = data[i].id;
            marker.desc = data[i].desc;
            GEvent.addListener(marker, "click", function() { 
                openCctvWindow(this.itemId) 
            } );
            GEvent.addListener(marker, "mouseover", function() { 
                var toolTipValue = getCctvToolTip(this.itemId, this.desc);
                //document.getElementById("toolTipDiv").innerHTML  = getCctvToolTip(this.itemId, this.desc);
                //document.getElementById("toolTipDiv").style.left = '300' + 'px';
                //document.getElementById("toolTipDiv").style.top  = '300' + 'px';
                //document.getElementById("toolTipDiv").style.display = 'block';
                //this.openInfoWindowHtml(getCctvToolTip(this.itemId, this.desc)); 
                toolTipOverlay.show(toolTipValue, this.getLatLng());
            } );
            GEvent.addListener(marker, "mouseout", function() {  
                toolTipOverlay.hide();
                //document.getElementById("toolTipDiv").style.display = 'none';
                //this.closeInfoWindow(); 
            } );
            googleMarkerManager.addMarker(marker, 9);
        }
    }
    catch (ex) {}
}
*/

function refreshCctv(elem) {
    var elemCtl = document.getElementById(elem);
    try {
        cctvMarkerManager.clearMarkers();
        var data = eval('(' + elemCtl.value + ')');
        for (i=0; i<data.length; i++) {
            var marker = new CctvMarker(data[i]);
            cctvMarkerManager.addMarker(marker, 9);
        }
    }
    catch (ex) {}
}


function refreshDms(elem) {
    var elemCtl = document.getElementById(elem);
    try {
        dmsMarkerManager.clearMarkers();
        var data = eval('(' + elemCtl.value + ')');
        for (i=0; i<data.length; i++) {
            var marker = new DmsMarker(data[i]);
            dmsMarkerManager.addMarker(marker, 9);
        }
    }
    catch (ex) {}
}

function refreshEvents(elem) {
    var elemCtl = document.getElementById(elem);
    try {
        eventMarkerManager.clearMarkers();
        var data = eval('(' + elemCtl.value + ')');
        for (i=0; i<data.length; i++) {
            var marker = new EventMarker(data[i]);
            eventMarkerManager.addMarker(marker, 9);
        }
    }
    catch (ex) {}
}

//lookups for efficiency reasons
var getOffsetFactor = new Array();
getOffsetFactor[19] = 0;
getOffsetFactor[18] = 0;
getOffsetFactor[17] = 0;
getOffsetFactor[16] = 0.03125;
getOffsetFactor[15] = 0.0625; 
getOffsetFactor[14] = 0.125;
getOffsetFactor[13] = 0.25;
getOffsetFactor[12] = 0.5;
getOffsetFactor[11] = 1;
getOffsetFactor[10] = 2;
getOffsetFactor[9] = 0;
getOffsetFactor[8] = 0;
getOffsetFactor[7] = 0;
getOffsetFactor[6] = 0;
getOffsetFactor[5] = 0;
getOffsetFactor[4] = 0;
getOffsetFactor[3] = 0;
getOffsetFactor[2] = 0;
getOffsetFactor[1] = 0;
getOffsetFactor[0] = 0;

function DmsMarker(data) {
    this.data = data;
    this.currentZoom = googlemap.getZoom();
    var latOffset = this.data.olat * getOffsetFactor[this.currentZoom];
    var lngOffset = this.data.olng * getOffsetFactor[this.currentZoom];    
    this.latLng = new GLatLng(this.data.lat + latOffset, this.data.lng + lngOffset);
    var args = new Array(2);
    switch (data.type) {
        case "nb":
            this.icon = { icon: dmsNbIcon };
            break;
        case "sb":
            this.icon = { icon: dmsSbIcon };
            break;
        case "eb":
            this.icon = { icon: dmsEbIcon };
            break;
        case "wb":
            this.icon = { icon: dmsWbIcon };
            break;
        case "nb_fl":
            this.icon = { icon: dmsNbFlIcon };
            break;
        case "sb_fl":
            this.icon = { icon: dmsSbFlIcon };
            break;
        case "eb_fl":
            this.icon = { icon: dmsEbFlIcon };
            break;
        case "wb_fl":
            this.icon = { icon: dmsWbFlIcon };
            break;
        default:
            this.icon = { icon: dmsNbIcon };
    }
    args[0] = this.latLng;
    args[1] = this.icon;
    GMarker.apply(this, args);
    GEvent.addListener(this, "click", function() { 
        openDmsWindow(this.data.uniqueid, this.data.desc) 
    } );
    GEvent.addListener(this, "mouseover", function() {
        var toolTipValue = getDmsToolTip(this.data.itemId, this.data.desc, this.data.msg);
        toolTipOverlay.show(toolTipValue, this.latLng);
    } );
    GEvent.addListener(this, "mouseout", function() { 
        toolTipOverlay.hide();
    } );
}

var tempPos = new GLatLng(0, 0);

DmsMarker.prototype = new GMarker(tempPos);

DmsMarker.prototype.redraw = function(force)
{
    if (this.currentZoom && this.currentZoom != googlemap.getZoom()) {
        this.currentZoom = googlemap.getZoom();
        window.status = getOffsetFactor[this.currentZoom];
        this.calculateLatLng();
        this.setLatLng(this.latLng);
    }
}

DmsMarker.prototype.calculateLatLng = function() {
    var latOffset = this.data.olat * getOffsetFactor[this.currentZoom];
    var lngOffset = this.data.olng * getOffsetFactor[this.currentZoom];    
    this.latLng = new GLatLng(this.data.lat + latOffset, this.data.lng + lngOffset);
}

function CctvMarker(data) {
    this.data = data;
    this.currentZoom = googlemap.getZoom();
    var latOffset = this.data.olat * getOffsetFactor[this.currentZoom];
    var lngOffset = this.data.olng * getOffsetFactor[this.currentZoom];    
    this.latLng = new GLatLng(this.data.lat + latOffset, this.data.lng + lngOffset);
    var args = new Array(2);
    this.icon = { icon: cctvIcon };
    args[0] = this.latLng;
    args[1] = this.icon;
    GMarker.apply(this, args);
    GEvent.addListener(this, "click", function() { 
        openCctvWindow(this.data.id) 
    } );
    GEvent.addListener(this, "mouseover", function() {
        var toolTipValue = getCctvToolTip(this.data.id, this.data.desc);
        toolTipOverlay.show(toolTipValue, this.latLng);
    } );
    GEvent.addListener(this, "mouseout", function() { 
        toolTipOverlay.hide();
    } );
}

CctvMarker.prototype = new GMarker(tempPos);

CctvMarker.prototype.redraw = function(force)
{
    if (this.currentZoom && this.currentZoom != googlemap.getZoom()) {
        this.currentZoom = googlemap.getZoom();
        window.status = getOffsetFactor[this.currentZoom];
        this.calculateLatLng();
        this.setLatLng(this.latLng);
    }
}

CctvMarker.prototype.calculateLatLng = function() {
    var latOffset = this.data.olat * getOffsetFactor[this.currentZoom];
    var lngOffset = this.data.olng * getOffsetFactor[this.currentZoom];    
    this.latLng = new GLatLng(this.data.lat + latOffset, this.data.lng + lngOffset);
}


function EventMarker(data) {
    this.data = data;
    this.currentZoom = googlemap.getZoom();
    var latOffset = this.data.olat * getOffsetFactor[this.currentZoom];
    var lngOffset = this.data.olng * getOffsetFactor[this.currentZoom];    
    this.latLng = new GLatLng(this.data.lat + latOffset, this.data.lng + lngOffset);
    var args = new Array(2);
    switch (data.type) {
        case "active":
            this.icon = { icon: activeEventIcon };
            break;
        case "construction":
            this.icon = { icon: constructionEventIcon };
            break;
        case "assist":
            this.icon = { icon: assistEventIcon };
            break;
        case "other":
            this.icon = { icon: otherEventIcon };
            break;
        case "active_blk":
            this.icon = { icon: activeEventBlkIcon };
            break;
        case "construction_blk":
            this.icon = { icon: constructionEventBlkIcon };
            break;
        case "assist_blk":
            this.icon = { icon: assistEventBlkIcon };
            break;
        case "other_blk":
            this.icon = { icon: otherEventBlkIcon };
            break;
        default:
            this.icon = { icon: otherEventIcon };
    }
    args[0] = this.latLng;
    args[1] = this.icon;
    GMarker.apply(this, args);
    GEvent.addListener(this, "click", function() { 
        openEventWindow(this.data.id) 
    } );
    GEvent.addListener(this, "mouseover", function() {
        var toolTipValue = getEventToolTip(this.data.id, this.data.desc);
        toolTipOverlay.show(toolTipValue, this.latLng);
    } );
    GEvent.addListener(this, "mouseout", function() { 
        toolTipOverlay.hide();
    } );
}

EventMarker.prototype = new GMarker(tempPos);

EventMarker.prototype.redraw = function(force)
{
    if (this.currentZoom && this.currentZoom != googlemap.getZoom()) {
        this.currentZoom = googlemap.getZoom();
        window.status = getOffsetFactor[this.currentZoom];
        this.calculateLatLng();
        this.setLatLng(this.latLng);
    }
}

EventMarker.prototype.calculateLatLng = function() {
    var latOffset = this.data.olat * getOffsetFactor[this.currentZoom];
    var lngOffset = this.data.olng * getOffsetFactor[this.currentZoom];    
    this.latLng = new GLatLng(this.data.lat + latOffset, this.data.lng + lngOffset);
}
/*function refreshDms(elem)
{
    var elemCtl = document.getElementById(elem);
    try {
        var data = eval('(' + elemCtl.value + ')');
        for (i=0; i<data.length; i++) {
            switch (data[i].type) {
                case "nb":
                    markeroptions = { icon: dmsNbIcon };
                    break;
                case "sb":
                    markeroptions = { icon: dmsSbIcon };
                    break;
                case "eb":
                    markeroptions = { icon: dmsEbIcon };
                    break;
                case "wb":
                    markeroptions = { icon: dmsWbIcon };
                    break;
                case "nb_fl":
                    markeroptions = { icon: dmsNbFlIcon };
                    break;
                case "sb_fl":
                    markeroptions = { icon: dmsSbFlIcon };
                    break;
                case "eb_fl":
                    markeroptions = { icon: dmsEbFlIcon };
                    break;
                case "wb_fl":
                    markeroptions = { icon: dmsWbFlIcon };
                    break;
                default:
                    markeroptions = { icon: dmsNbIcon };
            }
            var marker = new GMarker(new GLatLng(data[i].lat, data[i].lng), markeroptions);
            marker.itemId = data[i].id;
            marker.desc = data[i].desc;
            marker.msg = data[i].msg;
            GEvent.addListener(marker, "click", function() { 
                openCctvWindow(this.itemId) 
            } );
            GEvent.addListener(marker, "mouseover", function() {
                var toolTipValue = getDmsToolTip(this.itemId, this.desc, this.msg);
                //document.getElementById("toolTipDiv").innerHTML = getDmsToolTip(this.itemId, this.desc, this.msg);
                //document.getElementById("toolTipDiv").style.left = '300' + 'px';
                //document.getElementById("toolTipDiv").style.top  = '300' + 'px';
                //document.getElementById("toolTipDiv").style.display = 'block';
                toolTipOverlay.show(toolTipValue, this.getLatLng());
                //this.openInfoWindowHtml(getDmsToolTip(this.itemId, this.desc, this.msg)); 
            } );
            GEvent.addListener(marker, "mouseout", function() { 
                toolTipOverlay.hide();
                //document.getElementById("toolTipDiv").style.display = 'none';
                //this.closeInfoWindow(); 
            } );
            googleMarkerManager.addMarker(marker, 9);
        }
    }
    catch (ex) {}
}
*/



/*
* Legend Control Object
*/

function LegendControl() {}

LegendControl.prototype = new GControl();

LegendControl.prototype.initialize = function(map) 
{
    var container = document.getElementById('legendDiv');
    container.style.display = 'block';
    map.getContainer().appendChild(container);
    return container;
}

LegendControl.prototype.getDefaultPosition = function() 
{
    return new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(5, 40));
}


/*
* Location Control Object
*/

function LocationControl() {}

LocationControl.prototype = new GControl();

LocationControl.prototype.initialize = function(map) 
{
    var container = document.createElement("div");
    
    var locDiv = document.createElement("div");
    locDiv.className = 'LocDiv';
    locDiv.appendChild(document.createTextNode('Broward View'));
    GEvent.addDomListener(locDiv, "click", function() { 
        map.setCenter(new GLatLng(26.154, -80.252), 11); 
    });
    container.appendChild(locDiv);
    
    locDiv = document.createElement("div");
    locDiv.className = 'LocDiv';
    locDiv.appendChild(document.createTextNode('Palm Beach View'));
    GEvent.addDomListener(locDiv, "click", function() { 
        map.setCenter(new GLatLng(26.620, -80.223), 10); 
    });
    container.appendChild(locDiv);
    
    map.getContainer().appendChild(container);
    return container;
}

LocationControl.prototype.getDefaultPosition = function() 
{
    return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(5, 5));
}

LocationControl.prototype.createLocation = function(name, lat, lng, zoom)
{
    var locDiv = document.createElement("div");
    locDiv.appendChild(document.createTextNode(name));
    GEvent.addDomListener(locDiv, "click", function() { 
        map.setCenter(new GLatLng(lat, lng), zoom); 
    });
    return locDiv;
}


function ToolTipOverlay(myMapDiv) 
{
    this.mapDiv = myMapDiv;
}

ToolTipOverlay.prototype = new GOverlay();

ToolTipOverlay.prototype.initialize = function(map) 
{
    this.map = map;
    this.container = document.getElementById("toolTipDiv");
    //map.getContainer().appendChild(this.container);
}

ToolTipOverlay.prototype.remove = function()
{
    //this.container.parentNode.removeChild(this.container);
}

ToolTipOverlay.prototype.copy = function() {}

ToolTipOverlay.prototype.redraw = function(force) {
    //this.container.style.display = 'block';
    }

ToolTipOverlay.prototype.show = function(html, latLng) 
{
    this.html = html;
    this.latLng = latLng;
    this.map.getContainer().appendChild(this.container);
    
    this.container.innerHTML = this.html;
    //this.map.setCenter(this.map.getCenter());
    //var point = this.map.fromLatLngToDivPixel(this.latLng);
    //var containerPixel = new GPoint(point.x - 
    //    this.map.getContainer().offsetLeft, point.y - 
    //    this.map.getContainer().offsetTop);
        
    var northEastPnt = this.map.fromLatLngToDivPixel(this.map.getBounds().getNorthEast());
    var southWestPnt = this.map.fromLatLngToDivPixel(this.map.getBounds().getSouthWest());
    
      //var CDivPixel = this.map.fromLatLngToDivPixel(new GLatLng(
      //  this.map.getBounds().getNorthEast().lat(),
      //  this.map.getBounds().getSouthWest().lng()));
      var pointDivPixel = this.map.fromLatLngToDivPixel(latLng); 
      //var fromCenter = new GPoint(pointDivPixel.x - CDivPixel.x, pointDivPixel.y - CDivPixel.y); 
    var fromCenter = new GPoint(pointDivPixel.x - southWestPnt.x, pointDivPixel.y - northEastPnt.y); 

    //this.container.parentNode.removeChild(this.container);
    //var centerPoint = this.map.fromLatLngToDivPixel(this.map.getCenter());
    //window.status = point.x + '/' + point.y + ' ||| ' + containerPixel.x + '/' + containerPixel.y;
    
    this.container.style.left = fromCenter.x  - 250;
    var y = fromCenter.y + 10;
    
    //var mapHeight = parseInt(this.mapDiv.style.height);
    
    var mapHeight = southWestPnt.y - northEastPnt.y;
    
    if (y > mapHeight - 250) y = mapHeight - 250;
    
    this.container.style.top = y;
    
    //var mything = document.getElementById("toolTipDiv");
    //mything.innerHTML = html;
    //var point = this.map.fromLatLngToDivPixel(LatLng);
    //mything.style.left = point.x;
    //mything.style.top = point.y;
    //mything.style.display = 'block';
    //this.map.getContainer().appendChild(mything);
}

ToolTipOverlay.prototype.hide = function() {
    //var mything = document.getElementById("toolTipDiv");
    //mything.style.display = 'none';
    
    //this.container.style.display = 'none';
    this.container.parentNode.removeChild(this.container);
}

/*
*  Icon and Marker Types
*/

var cctvIcon = new GIcon(G_DEFAULT_ICON);
cctvIcon.image = "images/newicons/smart_cctv_available.gif";
cctvIcon.shadow = "images/newicons/smart_cctv_available.gif";
cctvIcon.iconSize = new GSize( 16, 10 );
cctvIcon.shadowSize = new GSize( 16, 10 );
cctvIcon.iconAnchor = new GPoint( 8, 5 );
cctvIcon.infoWindowAnchor = new GPoint( 8, 5 );

var dmsNbIcon = new GIcon(G_DEFAULT_ICON);
dmsNbIcon.image = "images/newicons/smart_dms_available_nb.gif";
dmsNbIcon.shadow = "images/newicons/smart_dms_available_nb.gif";
dmsNbIcon.iconSize = new GSize( 16, 10 );
dmsNbIcon.shadowSize = new GSize( 16, 10 );
dmsNbIcon.iconAnchor = new GPoint( 8, 5 );
dmsNbIcon.infoWindowAnchor = new GPoint( 8, 5 );

var dmsSbIcon = new GIcon(G_DEFAULT_ICON);
dmsSbIcon.image = "images/newicons/smart_dms_available_sb.gif";
dmsSbIcon.shadow = "images/newicons/smart_dms_available_sb.gif";
dmsSbIcon.iconSize = new GSize( 16, 10 );
dmsSbIcon.shadowSize = new GSize( 16, 10 );
dmsSbIcon.iconAnchor = new GPoint( 8, 5 );
dmsSbIcon.infoWindowAnchor = new GPoint( 8, 5 );

var dmsEbIcon = new GIcon(G_DEFAULT_ICON);
dmsEbIcon.image = "images/newicons/smart_dms_available_eb.gif";
dmsEbIcon.shadow = "images/newicons/smart_dms_available_eb.gif";
dmsEbIcon.iconSize = new GSize( 10, 16 );
dmsEbIcon.shadowSize = new GSize( 10, 16 );
dmsEbIcon.iconAnchor = new GPoint( 5, 8 );
dmsEbIcon.infoWindowAnchor = new GPoint( 5, 8 );

var dmsWbIcon = new GIcon(G_DEFAULT_ICON);
dmsWbIcon.image = "images/newicons/smart_dms_available_wb.gif";
dmsWbIcon.shadow = "images/newicons/smart_dms_available_wb.gif";
dmsWbIcon.iconSize = new GSize( 10, 16 );
dmsWbIcon.shadowSize = new GSize( 10, 16 );
dmsWbIcon.iconAnchor = new GPoint( 5, 8 );
dmsWbIcon.infoWindowAnchor = new GPoint( 5, 8 );

var dmsNbFlIcon = new GIcon(G_DEFAULT_ICON);
dmsNbFlIcon.image = "images/newicons/smart_dms_available_nb.ani.gif";
dmsNbFlIcon.shadow = "images/newicons/smart_dms_available_nb.ani.gif";
dmsNbFlIcon.iconSize = new GSize( 16, 10 );
dmsNbFlIcon.shadowSize = new GSize( 16, 10 );
dmsNbFlIcon.iconAnchor = new GPoint( 8, 5 );
dmsNbFlIcon.infoWindowAnchor = new GPoint( 8, 5 );

var dmsSbFlIcon = new GIcon(G_DEFAULT_ICON);
dmsSbFlIcon.image = "images/newicons/smart_dms_available_sb.ani.gif";
dmsSbFlIcon.shadow = "images/newicons/smart_dms_available_sb.ani.gif";
dmsSbFlIcon.iconSize = new GSize( 16, 10 );
dmsSbFlIcon.shadowSize = new GSize( 16, 10 );
dmsSbFlIcon.iconAnchor = new GPoint( 8, 5 );
dmsSbFlIcon.infoWindowAnchor = new GPoint( 8, 5 );

var dmsEbFlIcon = new GIcon(G_DEFAULT_ICON);
dmsEbFlIcon.image = "images/newicons/smart_dms_available_eb.ani.gif";
dmsEbFlIcon.shadow = "images/newicons/smart_dms_available_eb.ani.gif";
dmsEbFlIcon.iconSize = new GSize( 10, 16 );
dmsEbFlIcon.shadowSize = new GSize( 10, 16 );
dmsEbFlIcon.iconAnchor = new GPoint( 5, 8 );
dmsEbFlIcon.infoWindowAnchor = new GPoint( 5, 8 );

var dmsWbFlIcon = new GIcon(G_DEFAULT_ICON);
dmsWbFlIcon.image = "images/newicons/smart_dms_available_wb.ani.gif";
dmsWbFlIcon.shadow = "images/newicons/smart_dms_available_wb.ani.gif";
dmsWbFlIcon.iconSize = new GSize( 10, 16 );
dmsWbFlIcon.shadowSize = new GSize( 10, 16 );
dmsWbFlIcon.iconAnchor = new GPoint( 5, 8 );
dmsWbFlIcon.infoWindowAnchor = new GPoint( 5, 8 );

var activeEventIcon = new GIcon(G_DEFAULT_ICON);
activeEventIcon.image = "images/newicons/SMART_EventActive_noex.gif";
activeEventIcon.shadow = "images/newicons/SMART_EventActive_noex.gif";
activeEventIcon.iconSize = new GSize( 14, 14 );
activeEventIcon.shadowSize = new GSize( 14, 14 );
activeEventIcon.iconAnchor = new GPoint( 7, 7 );
activeEventIcon.infoWindowAnchor = new GPoint( 7, 7 );

var activeEventBlkIcon = new GIcon(G_DEFAULT_ICON);
activeEventBlkIcon.image = "images/newicons/SMART_EventActive.ani.gif";
activeEventBlkIcon.shadow = "images/newicons/SMART_EventActive.ani.gif";
activeEventBlkIcon.iconSize = new GSize( 14, 14 );
activeEventBlkIcon.shadowSize = new GSize( 14, 14 );
activeEventBlkIcon.iconAnchor = new GPoint( 7, 7 );
activeEventBlkIcon.infoWindowAnchor = new GPoint( 7, 7 );

var constructionEventIcon = new GIcon(G_DEFAULT_ICON);
constructionEventIcon.image = "images/newicons/SMART_ConstructionCone.gif";
constructionEventIcon.shadow = "images/newicons/SMART_ConstructionCone.gif";
constructionEventIcon.iconSize = new GSize( 15, 15 );
constructionEventIcon.shadowSize = new GSize( 15, 15 );
constructionEventIcon.iconAnchor = new GPoint( 8, 8 );
constructionEventIcon.infoWindowAnchor = new GPoint( 8, 8 );

var constructionEventBlkIcon = new GIcon(G_DEFAULT_ICON);
constructionEventBlkIcon.image = "images/newicons/SMART_ConstructionCone.anim.gif";
constructionEventBlkIcon.shadow = "images/newicons/SMART_ConstructionCone.anim.gif";
constructionEventBlkIcon.iconSize = new GSize( 15, 15 );
constructionEventBlkIcon.shadowSize = new GSize( 15, 15 );
constructionEventBlkIcon.iconAnchor = new GPoint( 8, 8 );
constructionEventBlkIcon.infoWindowAnchor = new GPoint( 8, 8 );

var assistEventIcon = new GIcon(G_DEFAULT_ICON);
assistEventIcon.image = "images/newicons/SMART_Wrecker.gif";
assistEventIcon.shadow = "images/newicons/SMART_Wrecker.gif";
assistEventIcon.iconSize = new GSize( 16, 10 );
assistEventIcon.shadowSize = new GSize( 16, 10 );
assistEventIcon.iconAnchor = new GPoint( 8, 5 );
assistEventIcon.infoWindowAnchor = new GPoint( 8, 5 );

var assistEventBlkIcon = new GIcon(G_DEFAULT_ICON);
assistEventBlkIcon.image = "images/newicons/SMART_Wrecker.anim.gif";
assistEventBlkIcon.shadow = "images/newicons/SMART_Wrecker.anim.gif";
assistEventBlkIcon.iconSize = new GSize( 16, 10 );
assistEventBlkIcon.shadowSize = new GSize( 16, 10 );
assistEventBlkIcon.iconAnchor = new GPoint( 8, 5 );
assistEventBlkIcon.infoWindowAnchor = new GPoint( 8, 5 );

var otherEventIcon = new GIcon(G_DEFAULT_ICON);
otherEventIcon.image = "images/newicons/SMART_EventOther.gif";
otherEventIcon.shadow = "images/newicons/SMART_EventOther.gif";
otherEventIcon.iconSize = new GSize( 13, 14 );
otherEventIcon.shadowSize = new GSize( 13, 14 );
otherEventIcon.iconAnchor = new GPoint( 7, 7 );
otherEventIcon.infoWindowAnchor = new GPoint( 7, 7 );

var otherEventBlkIcon = new GIcon(G_DEFAULT_ICON);
otherEventBlkIcon.image = "images/newicons/SMART_EventOther.ani.gif";
otherEventBlkIcon.shadow = "images/newicons/SMART_EventOther.ani.gif";
otherEventBlkIcon.iconSize = new GSize( 13, 14 );
otherEventBlkIcon.shadowSize = new GSize( 13, 14 );
otherEventBlkIcon.iconAnchor = new GPoint( 7, 7 );
otherEventBlkIcon.infoWindowAnchor = new GPoint( 7, 7 );
