// superclass
Icon.prototype = new GIcon;

// object constructor
function Icon(color) {
    this.superclass = GIcon;
    this.superclass();
    this.shadow = "images/markers/large_shadow.png";
    this.iconSize = new GSize(20, 34);
    this.shadowSize = new GSize(37, 34);
    this.iconAnchor = new GPoint(9, 34);
    this.infoWindowAnchor = new GPoint(5, 1);
    this.infoShadowAnchor = new GPoint(18, 25);
    this.image = "images/markers/" + color + "4.png";
}

// generator
function makeIcon(color) {
   if (color === "blue") return blueIcon;
   if (color === "indigo") return indigoIcon;
   if (color === "purple") return purpleIcon;
   if (color === "magenta") return magentaIcon;
   if (color === "red") return redIcon;
   if (color === "gray") return grayIcon;
}

// subclasses
BlueIcon.prototype = new Icon;
function BlueIcon() {
    this.superclass = Icon;
    this.superclass("blue");
}

IndigoIcon.prototype = new Icon;
function IndigoIcon() {
    this.superclass = Icon;
    this.superclass("indigo");
}

PurpleIcon.prototype = new Icon;
function PurpleIcon() {
    this.superclass = Icon;
    this.superclass("purple");
}

MagentaIcon.prototype = new Icon;
function MagentaIcon() {
    this.superclass = Icon;
    this.superclass("magenta");
}

RedIcon.prototype = new Icon;
function RedIcon() {
    this.superclass = Icon;
    this.superclass("red");
}

GrayIcon.prototype = new Icon;
function GrayIcon() {
    this.superclass = Icon;
    this.superclass("gray");
}
