var incidentIconHigh = new GIcon();
incidentIconHigh.image = "images/event.png";
incidentIconHigh.iconSize = new GSize(16, 16);
incidentIconHigh.iconAnchor = new GPoint(9, 9);
incidentIconHigh.infoWindowAnchor = new GPoint(9, 9);

var incidentIconMedHigh = new GIcon();
incidentIconMedHigh.image = "images/event_medium.png";
incidentIconMedHigh.iconSize = new GSize(24, 24);
incidentIconMedHigh.iconAnchor = new GPoint(12, 12);
incidentIconMedHigh.infoWindowAnchor = new GPoint(12, 12);

var incidentIconLargeHigh = new GIcon();
incidentIconLargeHigh.image = "images/event_large.png";
incidentIconLargeHigh.iconSize = new GSize(32,32);
incidentIconLargeHigh.iconAnchor = new GPoint(15, 15);
incidentIconLargeHigh.infoWindowAnchor = new GPoint(15, 15);

var incidentIconLow = new GIcon();
incidentIconLow.image = "images/blue_event.png";
incidentIconLow.iconSize = new GSize(16, 16);
incidentIconLow.iconAnchor = new GPoint(9, 9);
incidentIconLow.infoWindowAnchor = new GPoint(9, 9);

var incidentIconMedLow = new GIcon();
incidentIconMedLow.image = "images/blue_event_medium.png";
incidentIconMedLow.iconSize = new GSize(24, 24);
incidentIconMedLow.iconAnchor = new GPoint(12, 12);
incidentIconMedLow.infoWindowAnchor = new GPoint(12, 12);

var incidentIconLargeLow = new GIcon();
incidentIconLargeLow.image = "images/blue_event_large.png";
incidentIconLargeLow.iconSize = new GSize(32,32);
incidentIconLargeLow.iconAnchor = new GPoint(15, 15);
incidentIconLargeLow.infoWindowAnchor = new GPoint(15, 15);



var incidentImport = 40;


var incidentIconClass = Class.create(mapIconClass,{
    iconSmall: incidentIconLow,
    iconMedium: incidentIconMedLow,
    iconLarge: incidentIconLargeLow,
    prefix: "<b>Advisory Text : </b>",
    suffix: "",
    zIndex: incidentImport,
    initialize: function ($super, obj){
       Object.extend(this, obj);
       this.title = this.advisoryText;
       this.determineIcon();
       $super(this);
    },
    update: function ($super, newObj) {
       if(this.advisoryText != newObj.advisoryText){
           this.advisoryText = newObj.advisoryText;
           this.title = newObj.advisoryText;
       } else {
           newObj.title = newObj.advisoryText;
       } 
       $super(newObj);
    },
    determineIcon: function (){
        if(this.impact > 2){
           this.iconSmall = incidentIconHigh;
           this.iconMedium = incidentIconMedHigh;
           this.iconLarge = incidentIconLargeHigh;
       } else {
           this.iconSmall = incidentIconLow;
           this.iconMedium = incidentIconMedLow;
           this.iconLarge = incidentIconLargeLow;
       }
    }
});


