/*
* All rights reserved.
* copyright (c) 2005 Chris Lacy
*/

function IconFactory() {};
IconFactory.baseIcon = null;

function IconFactory_createIconFromColorString(color) {

	var iconImageUrl = "http://labs.google.com/ridefinder/images/mm_20_" + color + ".png";
	var icon = null;
	if(IconFactory.baseIcon == null) {
		icon = new GIcon();
		icon.image = iconImageUrl;
		icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
		icon.iconSize = new GSize(12,20);
		icon.shadowSize = new GSize(22,20);
		icon.iconAnchor = new GPoint(6,20);
		icon.infoWindowAnchor = new GPoint(5,1);
		IconFactory.baseIcon = icon;
	}
	else {
		icon = new GIcon(IconFactory.baseIcon);
		icon.image = iconImageUrl;
	}
	
	return icon;
}
IconFactory.createIconFromColorString = IconFactory_createIconFromColorString;

function IconFactory_createIconFromColorContainer(colorContainer) {
	return IconFactory.createIconFromColorString(colorContainer.getColorString());
}
IconFactory.createIconFromColorContainer = IconFactory_createIconFromColorContainer;