d = document

function j5_box(_left, _top, _right, _bottom, _width, _height, _id, _cssClassName, _innerHtml, _relativeTo)
{
	var _box_e = d.createElement('DIV');
	if (_cssClassName) _box_e.setAttribute('class', _cssClassName);
	if (_id) _box_e.setAttribute('id', _id);
	if(_left) _box_e.style.left = (_left - 8) + 'px';
	if(_top) _box_e.style.top = (_top - 6) + 'px';
	if(_right) _box_e.style.right = _right + 'px';
	if(_bottom) _box_e.style.bottom = _bottom + 'px';
	_box_e.style.width = _width + 'px';
	_box_e.style.height = _height + 'px';
	_box_e.innerHTML = _innerHtml;
	if (!_relativeTo) {
		_relativeTo = d.getElementsByTagName('BODY')[0];
	}
	_box_e.style.position = 'absolute';
	_relativeTo.appendChild(_box_e);
	return _box_e;
}

function j5_city(_left, _top, _name, _relativeTo, _outputBox)
{
	var _city_e = j5_box(_left, _top, null, null, 11, 11, null, 'j5_city', '<img src="/templates/j5_kmc_template/i/city.png" />', _relativeTo);
	// _city_e.style.border = 'solid 1px blue';
	_city_e.name = _name;

	add_handler(_city_e, 'mouseover', function(){
		_outputBox.innerHTML = _city_e.name;
		_city_e.getElementsByTagName('IMG')[0].src = '/templates/j5_kmc_template/i/city_active.png'
	});
	add_handler(_city_e, 'mouseout', function(){
		_outputBox.innerHTML = '';
		_city_e.getElementsByTagName('IMG')[0].src = '/templates/j5_kmc_template/i/city.png'
	});

	return _city_e;
}

function j5_map(_map_e, _outputBox)
{
	//alert(1)
	j5_city(476, 165, 'г. Сахалин', _map_e, _outputBox);
	j5_city(262, 212, 'г. Борск', _map_e, _outputBox);
	j5_city(212, 176, 'г. Стрежевой (Тюменская обл)', _map_e, _outputBox);
	j5_city(197, 164, 'г. Сургут', _map_e, _outputBox);
	j5_city(171, 172, 'г. Мортка (Тюменская область)', _map_e, _outputBox);
	j5_city(163, 184, 'г. Тюмень', _map_e, _outputBox);
	j5_city(155, 181, 'г. Каменск-Уральский', _map_e, _outputBox);
	j5_city(159, 176, 'с. Килачевское', _map_e, _outputBox);
	j5_city(152, 172, 'г. Верхняя Пышма', _map_e, _outputBox);
	j5_city(147, 179, 'г. Екатеринбург', _map_e, _outputBox);
	j5_city(145, 173, 'г. Первоуральск', _map_e, _outputBox);
	j5_city(146, 165, 'г. Нижний Тагил', _map_e, _outputBox);
	j5_city(151, 158, 'г. Краснотуринск', _map_e, _outputBox);
	j5_city(119, 180, 'г. Уфа', _map_e, _outputBox);
	j5_city(161, 111, 'г. Усинск', _map_e, _outputBox);
	j5_city(135, 212, 'г. Кустанай', _map_e, _outputBox);
	j5_city(99, 154, 'г. Йошкар-Ола', _map_e, _outputBox);
	j5_city(60, 173, 'г. Нижний Новгород', _map_e, _outputBox);
	j5_city(63, 139, 'г. Ступино (Московская область)', _map_e, _outputBox);
	j5_city(56, 132, 'г. Чехов', _map_e, _outputBox);
	j5_city(38, 233, 'г. Махачкала', _map_e, _outputBox);
	// Старый Уренгой

}

