function Property(id, name, x, y)
{
	this.id = id;
	this.name = name;
	this.x = x;
	this.y = y;
}

var Properties = new Array()

Properties.push(new Property(1,'104 Brown St.',114,64))
Properties.push(new Property(2,'106-108 Brown St.',114,66))
Properties.push(new Property(3,'111 Brown St.',106,64))
Properties.push(new Property(4,'112 Brown St.',114,72))
Properties.push(new Property(5,'115 Brown St.',106,70))
Properties.push(new Property(6,'116 Brown St.',114,76))
Properties.push(new Property(7,'117 Brown St.',106,73))
Properties.push(new Property(8,'121-123 Brown St.',106,79))
Properties.push(new Property(9,'122 Brown St.',114,81))
Properties.push(new Property(10,'125 Brown St.',106,85))
Properties.push(new Property(11,'128 Brown St.',114,87))
Properties.push(new Property(12,'129 Brown St.',106,92))
Properties.push(new Property(13,'131 Brown St.',106,95))
Properties.push(new Property(14,'137-139 Brown St.',106,104))
Properties.push(new Property(15,'141-151 Brown St.',106,110))
Properties.push(new Property(16,'200 Brown St.',114,118))
Properties.push(new Property(17,'201 Brown St.',106,118))
Properties.push(new Property(18,'208 Brown St.',114,123))
Properties.push(new Property(19,'21 Brown St.',106,49))
Properties.push(new Property(20,'212 Brown St.',114,126))
Properties.push(new Property(21,'216-218 Brown St.',114,128))
Properties.push(new Property(22,'22 Brown St.',114,40))
Properties.push(new Property(23,'25 Brown St.',106,52))
Properties.push(new Property(24,'26 Brown St.',114,45))
Properties.push(new Property(25,'27 Brown St.',106,54))
Properties.push(new Property(26,'29 Brown St.',106,56))
Properties.push(new Property(27,'30 Brown St.',114,51))
Properties.push(new Property(28,'300 Brown St.',114,140))
Properties.push(new Property(29,'34 Brown St.',114,56))
Properties.push(new Property(30,'107 Cass St.',196,105))
Properties.push(new Property(31,'11 Cass St.',175,105))
Properties.push(new Property(32,'113 Cass St.',201,105))
Properties.push(new Property(33,'5 Cass St.',164,105))
Properties.push(new Property(34,'112 Clay St.',191,89))
Properties.push(new Property(35,'117-119 Clay St.',183,98))
Properties.push(new Property(36,'120 Clay St.',191,105))
Properties.push(new Property(37,'125 Clay St.',183,105))
Properties.push(new Property(38,'19 Clay St.',183,68))
Properties.push(new Property(39,'22 Clay St.',191,72))
Properties.push(new Property(40,'16-20 Clay St.',191,66))
Properties.push(new Property(41,'9 Clay St.',183,59))
Properties.push(new Property(42,'101-103 Green St.',91,110))
Properties.push(new Property(43,'102-104 Green St.',89,118))
Properties.push(new Property(44,'105-107 Green St.',95,110))
Properties.push(new Property(45,'108 Green St.',94,118))
Properties.push(new Property(46,'109-111 Green St.',100,110))
Properties.push(new Property(47,'110 Green St.',96,118))
Properties.push(new Property(48,'113-115 Green St.',104,110))
Properties.push(new Property(49,'114 Green St.',99,118))
Properties.push(new Property(50,'118 Green St.',102,118))
Properties.push(new Property(51,'208 Green St.',121,118))
Properties.push(new Property(52,'212 Green St.',124,118))
Properties.push(new Property(53,'214 Green St.',126,118))
Properties.push(new Property(54,'216-218 Green St.',128,118))
Properties.push(new Property(55,'22 Green St.',29,118))
Properties.push(new Property(56,'222-224 Green St.',133,118))
Properties.push(new Property(57,'227 Green St.',133,110))
Properties.push(new Property(58,'228-230 Green St.',138,118))
Properties.push(new Property(59,'231 Green St.',137,110))
Properties.push(new Property(60,'232 Green St.',142,118))
Properties.push(new Property(61,'235 Green St.',140,110))
Properties.push(new Property(62,'239 Green St.',144,110))
Properties.push(new Property(63,'240-242 Green St.',149,118))
Properties.push(new Property(64,'243 Green St.',147,110))
Properties.push(new Property(65,'244 Green St.',152,118))
Properties.push(new Property(66,'247 Green St.',151,110))
Properties.push(new Property(67,'248 Green St.',156,118))
Properties.push(new Property(68,'251 Green St.',154,110))
Properties.push(new Property(69,'29 Green St.',48,110))
Properties.push(new Property(70,'31-33 Green St.',49,110))
Properties.push(new Property(71,'34 Green St.',41,118))
Properties.push(new Property(72,'37 Green St.',54,110))
Properties.push(new Property(73,'38 Green St.',44,118))
Properties.push(new Property(74,'40 Green St.',46,118))
Properties.push(new Property(75,'41-43 Green St.',57,110))
Properties.push(new Property(76,'45 Green St.',60,110))
Properties.push(new Property(77,'42-46 Green St.',48,118))
Properties.push(new Property(78,'47 Green St.',61,110))
Properties.push(new Property(79,'50 Green St.',56,118))
Properties.push(new Property(80,'52 Green St.',58,118))
Properties.push(new Property(81,'53 Green St.',66,110))
Properties.push(new Property(82,'59 Green St.',71,110))
Properties.push(new Property(83,'62-64 Green St.',68,118))
Properties.push(new Property(84,'65 Green St.',75,110))
Properties.push(new Property(85,'67 Green St.',77,110))
Properties.push(new Property(86,'68 Green St.',73,118))
Properties.push(new Property(87,'71-73 Green St.',80,110))
Properties.push(new Property(88,'74 Green St.',79,118))
Properties.push(new Property(89,'75-77 Green St.',83,110))
Properties.push(new Property(90,'80 Green St.',85,118))
Properties.push(new Property(91,'13-15 Hess St.',115,87))
Properties.push(new Property(92,'19 Hess St.',123,87))
Properties.push(new Property(93,'21-23 Hess St.',126,87))
Properties.push(new Property(94,'22-24 Hess St.',130,95))
Properties.push(new Property(95,'26-28 Hess St.',134,95))
Properties.push(new Property(96,'27 Hess St.',134,87))
Properties.push(new Property(97,'30 Hess St.',139,95))
Properties.push(new Property(98,'33 Hess St.',141,87))
Properties.push(new Property(99,'34-36 Hess St.',143,95))
Properties.push(new Property(100,'37 Hess St.',147,87))
Properties.push(new Property(101,'38 Hess St.',147,95))
Properties.push(new Property(102,'41 Hess St.',152,87))
Properties.push(new Property(103,'42 Hess St.',152,95))
Properties.push(new Property(104,'46 Hess St.',156,95))
Properties.push(new Property(105,'124 Jackson St.',164,64))
Properties.push(new Property(106,'126 Jackson St.',164,66))
Properties.push(new Property(107,'131 Jackson St.',156,67))
Properties.push(new Property(108,'132 Jackson St.',164,71))
Properties.push(new Property(109,'135 Jackson St.',156,73))
Properties.push(new Property(110,'139-141 Jackson St.',156,79))
Properties.push(new Property(111,'205 Jackson St.',156,82))
Properties.push(new Property(112,'207-209 Jackson St.',156,87))
Properties.push(new Property(113,'208-210 Jackson St.',164,87))
Properties.push(new Property(114,'315-317 Jackson St.',156,132))
Properties.push(new Property(115,'401 Jackson St.',156,140))
Properties.push(new Property(116,'411 Jackson St.',156,148))
Properties.push(new Property(117,'413 Jackson St.',156,150))
Properties.push(new Property(118,'105 Jones St.',114,132))
Properties.push(new Property(119,'110 Jones St.',117,140))
Properties.push(new Property(120,'112-114 Jones St.',119,140))
Properties.push(new Property(121,'115 Jones St.',123,132))
Properties.push(new Property(122,'118 Jones St.',124,140))
Properties.push(new Property(123,'119 Jones St.',126,132))
Properties.push(new Property(124,'122-124 Jones St.',127,140))
Properties.push(new Property(125,'123 Jones St.',130,132))
Properties.push(new Property(126,'127-129 Jones St.',134,132))
Properties.push(new Property(127,'128 Jones St.',132,140))
Properties.push(new Property(128,'131 Jones St.',137,132))
Properties.push(new Property(129,'134 Jones St.',138,140))
Properties.push(new Property(130,'135 Jones St.',141,132))
Properties.push(new Property(131,'136 Jones St.',139,140))
Properties.push(new Property(132,'137 Jones St.',142,132))
Properties.push(new Property(133,'139-141 Jones St.',144,132))
Properties.push(new Property(134,'140 Jones St.',143,140))
Properties.push(new Property(135,'143 Jones St.',148,132))
Properties.push(new Property(136,'144 Jones St.',146,140))
Properties.push(new Property(137,'148 Jones St.',150,140))
Properties.push(new Property(138,'149 Jones St.',153,132))
Properties.push(new Property(139,'152 Jones St.',153,140))
Properties.push(new Property(140,'85 Jones St.',102,132))
Properties.push(new Property(141,'89 Jones St.',106,132))
Properties.push(new Property(142,'300 S. Patterson Blvd.',44,70))
Properties.push(new Property(143,'306 S. Patterson Blvd.',43,72))
Properties.push(new Property(144,'310 S. Patterson Blvd.',43,73))
Properties.push(new Property(145,'322 S. Patterson Blvd.',41,76))
Properties.push(new Property(146,'338 S. Patterson Blvd.',39,81))
Properties.push(new Property(147,'354 S. Patterson Blvd.',37,86))
Properties.push(new Property(148,'360 S. Patterson Blvd.',36,88))
Properties.push(new Property(149,'368 S. Patterson Blvd.',35,90))
Properties.push(new Property(150,'201 E. Sixth St.',50,56))
Properties.push(new Property(151,'207-211 E. Sixth St.',52,56))
Properties.push(new Property(152,'222-224 E. Sixth St.',55,64))
Properties.push(new Property(153,'225 E. Sixth St.',59,56))
Properties.push(new Property(154,'226 E. Sixth St.',69,64))
Properties.push(new Property(155,'230-232 E. Sixth St.',83,64))
Properties.push(new Property(156,'299-301 E. Sixth St.',87,56))
Properties.push(new Property(157,'310 E. Sixth St.',95,64))
Properties.push(new Property(158,'314 E. Sixth St.',100,64))
Properties.push(new Property(159,'318 E. Sixth St.',106,64))
Properties.push(new Property(160,'412 E. Sixth St.',120,64))
Properties.push(new Property(161,'414-418 E. Sixth St.',122,64))
Properties.push(new Property(162,'419 E. Sixth St.',124,56))
Properties.push(new Property(163,'423-425 E. Sixth St.',129,56))
Properties.push(new Property(164,'426 E. Sixth St.',134,64))
Properties.push(new Property(165,'429 E. Sixth St.',136,56))
Properties.push(new Property(166,'430 E. Sixth St.',138,64))
Properties.push(new Property(167,'431 E. Sixth St.',139,56))
Properties.push(new Property(168,'432 E. Sixth St.',140,64))
Properties.push(new Property(169,'433 E. Sixth St.',141,56))
Properties.push(new Property(170,'434 E. Sixth St.',142,64))
Properties.push(new Property(171,'435 E. Sixth St.',144,56))
Properties.push(new Property(172,'436-438 E. Sixth St.',144,64))
Properties.push(new Property(173,'437 E. Sixth St.',146,56))
Properties.push(new Property(174,'439 E. Sixth St.',149,56))
Properties.push(new Property(175,'443 E. Sixth St.',154,56))
Properties.push(new Property(176,'445-447 E. Sixth St.',156,56))
Properties.push(new Property(177,'448 E. Sixth St.',156,64))
Properties.push(new Property(178,'11 Tecumseh St.',83,70))
Properties.push(new Property(179,'12 Tecumseh St.',91,72))
Properties.push(new Property(180,'15 Tecumseh St.',83,74))
Properties.push(new Property(181,'16-18 Tecumseh St.',91,76))
Properties.push(new Property(182,'17 Tecumseh St.',83,77))
Properties.push(new Property(183,'19-23 Tecumseh St.',83,79))
Properties.push(new Property(184,'20-22 Tecumseh St.',91,80))
Properties.push(new Property(185,'24 Tecumseh St.',91,84))
Properties.push(new Property(186,'25 Tecumseh St.',83,85))
Properties.push(new Property(187,'28 Tecumseh St.',91,89))
Properties.push(new Property(188,'29 Tecumseh St.',83,90))
Properties.push(new Property(189,'31-33 Tecumseh St.',83,92))
Properties.push(new Property(190,'34 Tecumseh St.',91,95))
Properties.push(new Property(191,'35 Tecumseh St.',83,96))
Properties.push(new Property(192,'36 Tecumseh St.',91,97))
Properties.push(new Property(193,'40-42 Tecumseh St.',91,101))
Properties.push(new Property(194,'41 Tecumseh st.',83,103))
Properties.push(new Property(195,'45 Tecumseh St.',83,107))
Properties.push(new Property(196,'46 Tecumseh St.',91,107))
Properties.push(new Property(197,'8 Tecumseh St.',91,68))
Properties.push(new Property(198,'9 Tecumseh St.',83,68))
Properties.push(new Property(199,'1 Van Buren St.',164,75))
Properties.push(new Property(200,'103-105 Van Buren St.',191,75))
Properties.push(new Property(201,'104 Van Buren St.',191,83))
Properties.push(new Property(202,'109 Van Buren St.',197,75))
Properties.push(new Property(203,'110 Van Buren St.',198,83))
Properties.push(new Property(204,'111 Van Buren St.',198,75))
Properties.push(new Property(205,'12 Van Buren St.',171,83))
Properties.push(new Property(206,'14-20 Van Buren St.',173,83))
Properties.push(new Property(207,'15 Van Buren St.',174,75))
Properties.push(new Property(208,'2 Van Buren St.',164,83))
Properties.push(new Property(209,'21 Van Buren St.',179,75))
Properties.push(new Property(210,'22 Van Buren St.',179,83))
Properties.push(new Property(211,'23 Van Buren St.',180,75))
Properties.push(new Property(212,'27 Van Buren St.',183,75))
Properties.push(new Property(213,'28 Van Buren St.',183,83))
Properties.push(new Property(214,'8 Van Buren St.',168,83))
Properties.push(new Property(215,'8-12 Clay St.',191,59))
Properties.push(new Property(216,'204 Green St.',117,118))
Properties.push(new Property(217,'223 Green St.',130,110))
Properties.push(new Property(218,'120 Jackson St.',164,60))
Properties.push(new Property(219,'216-218 Jackson St.',164,100))
Properties.push(new Property(220,'4 Tecumseh St.',91,64))
Properties.push(new Property(221,'9 Brown St.',106,38))
Properties.push(new Property(222,'11 Brown St.',106,40))
Properties.push(new Property(223,'13 Brown St.',106,42))
Properties.push(new Property(224,'54-56 Green St.',60,118))
Properties.push(new Property(225,'119 Cass St.',206,105))
Properties.push(new Property(226,'1 Green St.',26,110))
Properties.push(new Property(227,'132 Cass St.',229,114))
Properties.push(new Property(229,'120 Brown St.',114,79))
Properties.push(new Property(231,'15 Brown St.',106,43))
Properties.push(new Property(233,'324 Brown St.',114,465))
Properties.push(new Property(234,'124 Brown St.',114,83))
Properties.push(new Property(236,'334 Brown St.',114,600))
Properties.push(new Property(238,'115 Cass St.',203,105))
Properties.push(new Property(239,'128 Cass St.',220,114))
Properties.push(new Property(240,'130 Cass St.',224,114))
Properties.push(new Property(242,'26-28 Green St.',33,118))
Properties.push(new Property(243,'30 Green St.',37,118))
Properties.push(new Property(244,'236 Green St.',145,118))
Properties.push(new Property(245,'208 Jones St.',216,140))
Properties.push(new Property(246,'324 Jones St.',214,140))
Properties.push(new Property(247,'328-330 Jones St.',217,140))
Properties.push(new Property(248,'332 Jones St.',221,140))
Properties.push(new Property(249,'336 Jones St.',224,140))
Properties.push(new Property(250,'318 S. Patterson Blvd.',42,75))
Properties.push(new Property(251,'332-344 Patterson Blvd.',40,79))
Properties.push(new Property(252,'305 E. Sixth St.',90,56))
Properties.push(new Property(253,'309 E. Sixth St.',96,56))
Properties.push(new Property(254,'114 Van Buren St.',203,83))
Properties.push(new Property(255,'122 Van Buren St.',213,83))
Properties.push(new Property(256,'117 Van Buren St.',204,75))
Properties.push(new Property(257,'20-22 Trimbach Ln.',139,74))
Properties.push(new Property(258,'200 E. Fifth St.',68,21))

function getElementPosition(elem)
{
	var offsetTrail = elem;
	var offsetLeft = 0;
	var offsetTop = 0;
	while (offsetTrail)
	{
		offsetLeft += offsetTrail.offsetLeft;
		offsetTop += offsetTrail.offsetTop;
		offsetTrail = offsetTrail.offsetParent;
	}
	if (navigator.userAgent.indexOf("Mac") != -1 && 
		typeof document.body.leftMargin != "undefined") {
		offsetLeft += document.body.leftMargin;
		offsetTop += document.body.topMargin;
	}
	return {left:offsetLeft, top:offsetTop};
}

function getMousePosition(evt)
{
	var x = -1;
	var y = -1;

	if(evt.offsetX)
	{
		x = evt.offsetX;
		y = evt.offsetY;
	}
	else if(evt.pageX)
	{
		var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
		if(elem != null)
		{
			var pos = getElementPosition(elem);
			x = evt.pageX - pos.left;
			y = evt.pageY - pos.top;
		}
	}
	return {left:x, top:y};
}

function OnMapMouseMove(evt)
{
	evt = (evt) ? evt : ((event) ? event : null);
	if(evt == null)
		return;

	var msg = document.getElementById('PropertyName');
	if(msg == null)
		return;

	var prop = getPropertyAt(evt);
	var pos = getMousePosition(evt);

	if(prop != null)
		msg.innerHTML = prop.name;
	else
		msg.innerHTML = '&nbsp;'; // pos.left + ',' + pos.top + '&nbsp;';

	return;
}

function OnMapClick(evt)
{
	evt = (evt) ? evt : ((event) ? event : null);
	if(evt == null)
		return;

	var prop = getPropertyAt(evt);

	if(prop != null)
		document.location = 'index.asp?PropertyID=' + prop.id;
}

function getPropertyAt(evt)
{
	var prop = null;
	var dist = 300.0;

	var pos = getMousePosition(evt);
	if(pos.left < 0)
		return;

	for(var i = 0; i < Properties.length; i++)
	{
		var dx = Math.abs(pos.left - Properties[i].x);
		var dy = Math.abs(pos.top - Properties[i].y);
		if(dx < 5 && dy < 5)
		{
			if(Math.sqrt(dx^2 + dy^2) < dist)
			{
				prop = Properties[i];
				dist = Math.sqrt(dx^2 + dy^2);
			}
		}
	}

	return prop;
}
