MiniMap = Class.create();
MiniMap.prototype = {
	initialize: function (div) {
		// Konstruktor, wird beim Erzeugen des Objekts aufgerufen
		this.div = div;
		// Objekt regions hat mehrere Unterobjekte
		this.regions = {
			// ganz SH
			0: {
				// alle klickbaren Flächen und deren Actions...
				areas: {
					0: {
						coords : "99,46,100,46,102,46,105,47,108,49,110,51,112,53,115,55,116,56,117,58,118,60,120,61,122,61,124,63,125,65,125,67,125,69,125,71,126,74,127,75,127,78,126,79,125,82,126,85,128,87,129,88,128,92,126,94,125,96,125,98,129,99,131,101,132,101,134,102,135,103,136,104,138,105,139,106,140,106,141,106,140,113,138,113,137,113,136,114,136,115,135,116,134,117,134,118,135,119,136,120,136,121,137,121,139,121,141,121,141,121,142,120,143,119,143,118,143,116,143,115,142,114,141,113,140,113,141,108,141,106,143,105,144,105,145,103,147,102,150,102,151,103,154,103,156,103,157,105,156,107,156,110,157,112,160,112,162,112,164,111,166,111,167,114,168,117,169,119,170,120,172,122,172,124,172,125,173,127,173,128,174,131,173,133,173,136,166,141,165,141,163,141,162,141,161,142,160,144,160,146,161,148,162,149,164,149,166,148,166,148,167,146,168,144,168,143,167,142,174,137,175,137,176,137,177,138,177,141,177,142,177,144,177,146,176,148,175,150,177,151,179,150,180,149,181,148,182,150,183,151,185,151,186,153,185,154,183,154,181,155,180,157,181,159,182,161,183,164,186,166,189,170,192,173,195,171,199,168,201,166,204,165,207,166,207,168,208,171,208,174,206,175,207,178,207,179,206,181,204,183,203,184,200,184,198,185,197,188,197,191,196,193,195,195,196,198,198,199,200,200,202,201,203,202,202,204,199,205,197,205,194,207,191,209,186,215,183,218,181,218,178,215,176,212,178,207,180,204,179,200,177,197,174,195,171,194,169,195,168,195,168,193,168,191,167,190,166,190,165,189,164,189,158,170,160,169,161,168,162,167,162,165,162,163,160,162,158,162,156,162,154,163,154,164,154,166,154,169,156,170,158,170,158,172,160,178,163,190,162,190,161,191,161,192,161,194,161,195,163,196,164,196,164,198,166,196,168,195,167,196,164,199,163,199,160,198,158,199,157,203,155,205,153,207,147,211,140,211,132,204,128,197,124,190,121,186,123,186,125,185,127,183,127,180,125,179,123,178,121,178,120,180,119,181,119,184,121,186,119,185,118,181,115,178,113,175,111,172,108,172,106,170,107,168,107,166,108,165,108,163,110,162,111,160,125,163,125,165,126,167,128,168,130,168,132,167,133,165,133,163,133,161,132,160,130,159,128,159,127,160,126,162,125,162,112,159,114,157,114,155,114,152,114,149,113,148,113,146,111,145,110,144,109,141,109,138,109,134,108,132,107,130,106,128,103,127,102,125,100,124,99,121,98,119,98,116,99,115,102,114,105,114,105,112,106,110,106,108,106,106,105,106,106,104,110,104,112,103,112,102,111,100,109,98,107,98,113,98,115,98,115,95,114,94,113,93,113,91,113,89,114,87,114,85,113,83,111,82,110,80,110,78,109,76,108,74,107,72,106,71,105,69,103,68,101,68,99,67,98,66,98,64,99,62,100,60,100,57,100,53,100,48,99,47",
						name: "Region Binnenland",
						clickAction: 4
					},
					1: {
						coords : "40,26,45,22,49,21,52,23,51,29,48,33,57,37,64,38,70,39,74,39,79,40,84,41,90,42,93,45,95,46,98,46,99,48,98,52,99,57,99,59,98,60,97,62,97,64,97,66,98,68,99,68,101,69,102,69,104,71,105,74,106,75,108,79,110,81,110,83,111,84,113,85,113,87,112,90,112,91,112,93,113,94,113,95,113,96,110,97,107,97,106,97,105,98,105,99,106,100,109,100,110,100,111,102,110,103,108,104,105,103,102,104,101,106,99,105,97,105,94,105,94,107,93,109,94,111,95,112,96,113,97,113,99,113,100,112,101,110,101,108,100,107,101,107,103,107,105,106,105,108,105,109,104,111,103,112,102,113,100,113,99,114,97,114,96,115,96,117,97,120,98,122,99,125,100,126,102,128,104,130,106,132,107,134,107,136,107,139,106,141,107,144,109,146,111,147,112,149,112,152,113,156,112,157,111,159,109,161,107,163,106,164,105,167,105,169,105,170,104,171,101,171,95,171,92,171,91,169,89,168,86,166,84,164,83,161,81,158,80,156,79,154,78,152,79,151,80,150,82,150,85,150,82,145,77,142,73,134,67,127,59,122,53,105,49,100,43,91,37,81,70,99,77,102,80,102,83,102,84,99,86,97,88,94,89,91,92,95,92,97,94,98,97,99,99,97,100,94,99,92,97,90,95,90,93,91,92,93,92,94,91,92,90,90,88,91,88,93,86,95,81,102,76,101,65,96,59,92,53,87,44,83,38,78,34,67,30,44,31,31,33,28,37,26,37,26",
						name: "Region Nordsee",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 1
					},
					2: {
						coords : "116,54,117,52,119,50,120,50,122,52,123,54,122,55,122,56,122,58,122,59,122,60,124,60,125,61,127,61,128,60,129,58,129,56,129,55,127,55,126,54,124,54,124,53,124,52,128,50,132,48,135,50,140,52,150,53,164,54,174,73,171,86,178,95,177,104,174,112,172,112,170,113,170,116,171,117,174,118,176,118,178,116,178,114,177,112,175,111,177,106,180,102,191,97,210,104,225,101,241,79,257,82,264,109,259,125,246,145,242,166,231,175,221,171,217,169,215,169,212,171,211,173,213,176,216,177,218,176,218,173,218,171,218,171,220,173,220,174,222,177,220,179,218,180,215,182,213,183,211,182,209,180,208,178,208,176,208,174,209,173,209,171,209,169,209,167,208,166,207,164,203,164,201,165,200,166,199,167,197,167,196,168,195,169,194,170,192,171,192,171,191,170,189,168,188,167,188,165,190,163,191,161,190,159,189,158,187,157,185,158,184,160,183,161,183,160,183,157,182,155,185,155,187,155,184,150,179,146,178,140,186,136,189,134,195,140,199,137,196,129,178,139,178,138,176,136,175,135,173,134,174,133,175,132,175,129,175,126,174,125,173,124,173,123,172,121,171,119,170,118,169,116,168,113,168,111,167,110,165,109,163,110,161,111,160,111,159,111,157,110,157,108,157,105,157,102,155,101,152,101,150,100,149,100,147,100,146,101,145,102,143,103,142,104,141,105,138,104,136,102,134,101,132,100,131,99,130,98,128,97,127,96,128,95,129,94,129,93,129,91,129,88,129,86,129,85,128,84,127,82,127,80,128,79,129,78,129,76,129,74,128,73,127,71,127,70,126,69,126,68,127,67,127,65,127,63,125,62,124,62,122,60,120,60,119,59,118,58,118,57,117,57,117,56,116,54",
						name: "Ostsee-Holstein",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 2
					},
					3: {
						coords : "223,177,224,181,226,186,233,188,238,196,237,200,237,209,232,211,229,212,220,204,221,202,220,199,218,198,216,198,214,199,213,201,213,204,215,206,216,206,218,206,220,205,227,211,228,213,226,226,215,235,202,235,186,226,181,220,184,218,186,216,187,214,189,212,191,211,193,210,195,209,196,207,197,205,201,205,203,205,204,204,205,202,205,200,203,199,201,199,199,198,198,197,197,195,198,193,199,191,199,189,199,188,200,186,203,186,205,185,206,183,208,181,210,183,212,184,216,184,217,182,219,180,221,180,222,178",
						name: "Herzogtum Lauenburg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 3
					},
					4: {
						coords : "213,173,213,173,213,174,214,175,215,176,216,176,217,176,218,171,216,171,216,170,214,169,214,170,213,172,213,173",
						name: "L%C3%BCbeck",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 5
					},
					5: {
						coords : "214,205,213,201,214,200,214,200,216,199,216,198,219,198,219,200,220,200,220,201,221,201,221,203,220,203,220,205,219,205,218,206,215,206,215,205,214,205",
						name: "M%C3%B6lln",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 6
					},
					6: {
						coords : "172,114,171,116,172,116,172,117,174,117,175,117,177,117,176,115,178,115,177,113,176,113,172,112,172,114",
						name: "Kiel",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 7
					},
					7: {
						coords : "120,180,121,180,121,179,123,180,123,179,125,179,125,180,125,180,126,183,125,184,124,185,121,185,121,183,119,183,120,180",
						name: "Gl%C3%BCckstadt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 8
					},
					8: {
						coords : "128,160,132,160,132,163,133,163,133,166,132,166,132,167,127,167,127,166,127,166,126,162,128,162,128,160",
						name: "Itzehoe",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 9
					},
					9: {
						coords : "162,190,167,190,167,195,166,195,166,195,163,196,163,195,163,195,163,194,162,194,161,192,162,192,162,190",
						name: "Norderstedt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 10
					},
					10: {
						coords : "185,162,185,159,186,159,186,158,189,158,189,159,190,159,190,164,189,163,189,164,185,164,185,164,184,164,185,162",
						name: "Bad Segeberg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 11
					},
					11: {
						coords : "155,162,156,162,156,163,160,163,161,165,161,165,161,167,161,168,160,168,159,169,156,169,156,168,155,167,155,167,154,164,156,164,155,162",
						name: "Bad Bramstedt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 12
					},
					12: {
						coords : "164,142,166,142,165,143,166,143,167,147,166,147,166,147,162,148,162,146,160,146,160,144,163,143,163,142,164,143,164,142",
						name: "Neum%C3%BCnster",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 13
					},
					13: {
						coords : "136,114,141,114,142,116,142,116,142,117,142,118,142,119,140,120,140,120,140,120,140,120,137,120,137,119,136,119,135,116,137,116,136,114",
						name: "Rendsburg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 14
					},
					14: {
						coords : "124,54,127,55,127,56,128,56,128,60,124,59,124,59,122,59,123,56,123,56,123,56,124,54",
						name: "Flensburg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 15
					},
					15: {
						coords : "190,134,194,138,198,136,195,131,190,134",
						name: "Pl%C3%B6n",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 16
					},
					16: {
						coords : "95,107,96,107,97,107,99,107,99,107,99,108,100,109,100,110,100,111,96,111,96,111,94,110,94,109,95,108",
						name: "Friedrichstadt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 17
					},
					17: {
						coords : "92,94,93,93,95,92,96,91,97,91,98,92,99,93,99,95,99,96,98,97,96,98,96,98,95,97,94,96,94,96,94,96,93,94",
						name: "Husum",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: 18
					}
				},
				src : "/tash/images/minimap/main.png",
				// das ist die externe ID, die der CallbackFunction mitgegeben wird...
				externalID: 0
			},
			// erste Region: Nordsee
			1: {
				areas: {
					0: {
						coords: "0,0,268,0,268,64,241,63,240,59,237,58,231,62,231,67,235,70,239,69,241,66,268,66,267,152,261,152,259,149,252,149,252,157,255,160,261,159,262,156,268,155,266,225,247,225,245,221,239,223,239,229,243,232,248,226,266,226,267,245,201,245,196,146,199,142,197,139,193,137,193,124,196,120,196,115,190,115,187,117,188,123,192,125,192,138,190,140,190,145,195,146,199,245,0,248,0,0",
						name: "zur%C3%BCck zur %C3%9Cbersicht",
						clickAction:0
					},
					1: {
						coords : "239,223,240,228,243,230,245,229,246,228,246,225,246,224,245,223,244,222,242,222,240,222,239,223",
						name: "Itzehoe",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					2: {
						coords : "253,150,252,157,255,158,261,159,261,155,261,153,259,151,258,150,253,150",
						name: "Rendsburg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					3: {
						coords : "190,140,190,145,196,145,196,143,197,142,197,140,196,139,196,138,192,138,192,140,190,140",
						name: "Friedrichstadt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					4: {
						coords : "188,118,188,121,190,124,192,123,195,121,195,117,195,115,193,115,191,115,188,118",
						name: "Husum",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					5: {
						coords : "232,62,232,67,239,68,241,65,241,61,238,60,236,59,233,61,232,62",
						name: "Flensburg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					}
				},
				src : "/tash/images/minimap/nts.png",
				// das ist die externe ID, die der CallbackFunction mitgegeben wird...
				externalID: 1
			},
			// zweite Region: OHT
			2: {
				areas: {
					0: {
						coords: "0,20,25,22,28,18,37,21,36,28,31,28,52,121,58,122,58,127,109,125,110,120,115,118,120,121,117,127,110,125,99,170,101,174,146,161,145,157,151,153,155,156,155,161,148,162,138,198,142,201,142,204,182,220,186,218,191,220,190,225,187,228,182,225,182,222,141,206,135,206,91,211,88,216,83,212,29,237,30,240,26,243,22,239,24,235,27,235,28,236,37,211,34,210,34,205,39,202,42,206,41,209,39,211,30,235,83,211,85,207,90,208,90,210,134,204,136,200,146,162,101,176,97,178,93,177,94,172,97,171,108,126,59,128,55,131,50,129,50,122,29,28,24,23,0,21,0,246,270,246,270,35,271,0,0,0,0,20",
						name: "zur%C3%BCck zur %C3%9Cbersicht",
						clickAction:0
					},
					1: {
						coords : "23,237,23,240,25,241,28,240,29,238,27,236,25,236,23,237",
						name: "Gl%C3%BCckstadt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					2: {
						coords : "35,206,35,210,40,210,42,207,40,205,38,204,36,205,35,206",
						name: "Itzehoe",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					3: {
						coords : "84,210,84,213,87,214,90,212,90,209,87,208,84,209,84,210",
						name: "Bad Bremstedt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					4: {
						coords : "182,220,183,224,187,227,189,224,189,220,187,220,184,220,182,220",
						name: "L%C3%BCbesck",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					5: {
						coords : "135,202,135,205,140,206,141,203,141,200,136,201,135,202",
						name: "Bad Segeberg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					6: {
						coords : "146,157,147,161,150,161,153,161,154,160,154,157,153,155,151,154,149,155,146,157",
						name: "Pl%C3%B6n",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					7: {
						coords : "94,173,94,177,97,177,100,175,100,173,99,172,96,172,94,173",
						name: "Neum%C3%BCnster",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					8: {
						coords : "110,123,111,120,114,118,117,119,118,122,118,124,116,126,112,126,111,124,110,123",
						name: "Kiel",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					9: {
						coords : "51,123,57,123,57,128,52,129,50,127,51,123",
						name: "Rendsburg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					10: {
						coords : "26,22,25,24,29,28,35,27,35,21,28,20,26,22",
						name: "Flensburg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					}
				},
				src : "/tash/images/minimap/oht.png",
				// das ist die externe ID, die der CallbackFunction mitgegeben wird...
				externalID: 3
			},
			// vierte Region: Lauenburg
			3: {
				areas: {
					0: {
						coords: "1,1,145,0,153,103,149,105,149,111,156,112,160,109,158,105,154,104,146,0,267,0,266,244,0,245,1,1",
						name: "zur%C3%BCck zur %C3%9Cbersicht",
						clickAction:0
					},
					1: {
						coords : "150,107,150,110,151,111,156,111,158,110,158,108,157,106,156,105,155,105,153,104,151,105,150,107",
						name: "M%C3%B6lln",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					2: {
						coords : "1,1,2,1,2,2,1,2,1,1",
						name: "",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					3: {
						coords : "1,1,2,1,2,2,1,2,1,1",
						name: "",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					}
				},
				src : "/tash/images/minimap/lauenburg.png",
				// das ist die externe ID, die der CallbackFunction mitgegeben wird...
				externalID: 4
			},
			// dritte Region: Binnenland
			4: {
				areas: {
					0: {
						coords: "0,0,101,0,99,22,104,24,107,17,101,14,101,1,266,-2,266,125,204,127,203,125,196,125,174,100,174,96,169,94,166,99,125,101,124,98,118,98,118,102,69,92,67,88,64,87,63,75,66,72,66,69,59,66,57,69,57,73,61,75,62,75,63,87,60,89,60,93,62,96,66,95,68,92,78,94,117,103,120,106,122,106,124,105,125,102,166,100,168,103,171,103,174,101,195,125,194,130,160,139,157,136,154,136,151,140,153,144,156,145,159,144,160,141,177,136,186,160,184,163,185,167,188,168,191,167,194,164,191,161,188,160,178,135,195,131,198,133,202,131,204,129,222,127,227,175,223,178,224,182,226,184,230,183,232,181,231,178,228,175,223,127,266,126,266,244,232,244,231,226,235,224,235,220,234,217,230,216,227,216,226,220,226,223,228,224,229,225,230,230,231,244,157,244,158,213,161,210,161,207,160,205,158,204,155,204,153,206,153,209,155,211,157,212,156,244,100,244,99,197,101,196,102,193,102,191,144,173,147,175,149,174,152,171,151,168,149,166,145,166,144,169,143,171,115,184,110,171,112,169,112,165,110,164,108,163,105,164,105,169,106,171,109,172,113,185,102,190,99,188,96,189,94,192,96,196,98,197,99,244,0,244,0,0",
						name: "zur%C3%BCck zur %C3%9Cbersicht",
						clickAction:0
					},
					1: {
						coords : "99,15,99,22,101,23,105,22,105,20,105,19,106,17,104,16,102,16,102,14,100,14,99,15",
						name: "Flensburg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					2: {
						coords : "153,206,153,209,155,209,154,210,160,211,160,210,161,209,161,207,160,206,160,206,159,205,158,205,154,205,154,206,154,207,153,206",
						name: "Norderstedt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					3: {
						coords : "95,191,96,196,97,196,100,197,101,196,101,195,102,191,101,190,100,189,97,190,96,191,95,191",
						name: "Gl%C3%BCckstadt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					4: {
						coords : "105,165,105,170,107,170,109,171,110,170,111,169,111,166,111,165,111,165,109,164,108,163,108,163,107,164,106,165,106,165,105,165",
						name: "Itzehoe",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					5: {
						coords : "228,217,234,218,234,222,234,224,230,224,227,222,226,219,227,218,228,217",
						name: "M%C3%B6ln",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					6: {
						coords : "226,177,229,177,230,178,231,180,230,182,229,182,225,182,224,182,224,180,224,178,225,178,226,177",
						name: "L%C3%BCbeck",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					7: {
						coords : "146,166,149,167,150,168,151,171,151,173,150,174,148,174,148,175,147,174,145,173,144,172,143,171,144,169,144,169,145,167,145,167,146,166",
						name: "Bad Bramstedt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					8: {
						coords : "187,161,189,161,192,163,192,164,191,166,189,167,187,166,184,165,185,163,187,161",
						name: "Bad Segeberg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					9: {
						coords : "154,136,156,136,158,138,159,140,159,142,157,144,154,144,153,142,153,139,153,138,154,136",
						name: "Neum%C3%BCnster",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					10: {
						coords : "195,124,203,125,202,130,199,131,196,131,195,128,195,126,195,124",
						name: "Pl%C3%B6n",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					11: {
						coords : "167,99,167,96,169,95,170,94,171,96,173,95,174,96,174,100,173,101,171,103,168,102,167,100,167,99",
						name: "Kiel",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					12: {
						coords : "118,100,119,104,121,106,122,106,124,104,125,102,124,99,123,98,120,98,118,100",
						name: "Rendsburg",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					13: {
						coords : "60,89,61,88,63,87,65,88,67,89,67,91,67,92,66,94,63,94,62,93,60,92,60,89",
						name: "Friedrichstadt",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					},
					14: {
						coords : "57,70,58,69,59,67,62,68,64,69,65,70,65,72,63,74,62,75,61,74,59,73,58,73,58,73,57,70",
						name: "Husum",
						// wenn click action, dann hier regionsnummer, ansonsten -1
						clickAction: -1
					}
				},
				src : "/tash/images/minimap/binnenland.png",
				// das ist die externe ID, die der CallbackFunction mitgegeben wird...
				externalID: 2
			}
		};

		this.img = null;
		this.map = null;

		this.clickObserver = this.observeClicks.bindAsEventListener(this);

		this.externalClickObserver = null;
	},
	draw: function(region) {
		// draw zeichnet die karte neu mit der entsprechenden Regionsansicht (aus this.regions)

		// wenn es noch kein img gibt, dann erzeuge es
		if (this.img === null) {
			this.img = document.createElement("img");
			this.div.appendChild(this.img);
		}

		// default to whole SH
		if (arguments.length === 0){
			region = 0;
		}

		// Bildquelle auf aktuelle Region setzen
		this.img.src = this.regions[region].src;

		// Salesguide-spezifische Angaben für das Bild
		this.img.height = "240";
		this.img.width = "265";

		this.drawMap(region);
	},
	drawMap: function(region) {
		if (this.map === null) {
			this.map = document.createElement("map");
			this.map.id = "regionsMap";
			this.map.name = "regionsMap";
			this.div.appendChild(this.map);
		}

		// Referenz von Bild auf map
		this.img.useMap = "#regionsMap";

		var aRegion = this.regions[region];

		// solange noch alte area tags da sind, löschen...
		while (this.map.hasChildNodes()) {
			this.map.removeChild(this.map.firstChild);
		}

		var areaCounter = 0;
		while(aRegion.areas[areaCounter] != null) {
			var anArea = aRegion.areas[areaCounter];
			var anAreaTag = document.createElement("area");
			anAreaTag.shape = "POLY";
			anAreaTag.coords = anArea.coords;
			anAreaTag.title = decodeURIComponent(anArea.name);
			anAreaTag.href = "#";
			anAreaTag.id = anArea.clickAction;

			this.map.appendChild(anAreaTag);

			Event.observe(anAreaTag,"click",this.clickObserver,true);

			areaCounter ++;
		}
	},
	observeClicks: function(e) {
		// code from quirksmode.org
		var targ;
		if (!e) var e = window.event;
		if (e.target) targ = e.target;
		else if (e.srcElement) targ = e.srcElement;
		if (targ && targ.nodeType == 3) // defeat Safari bug
			targ = targ.parentNode;
		// til here...

		if (targ) {
			if (this.externalClickObserver != null) {
				// default to "Stadt"
				var extID = -1;
				if (targ.id != -1) extID  = this.regions[targ.id].externalID;

				this.externalClickObserver(extID);
			}
			if (targ.id != -1) this.draw(targ.id);
		}
	},
	addExternalClickObserver: function(callback) {
		this.externalClickObserver = callback;
	},
	dispose: function() {
		while(this.div.hasChildNodes()) {
			this.div.removeChild(this.div.firstChild);
		}
		this.img = null;
		this.map = null;
		this.div = null;
	}
}