<head>
	<title>Geo Map</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<style TYPE="text/css">
	body {
		font-size: 75%;
		font-family: Verdana, Arial, Helvetica,sans-serif, "MS sans serif";
		margin: 0 0 0 0.8%;
		padding: 0;
		width: 100%;
	}
	#center_content {
		float: left;
		width: 67%;
		background: #fff;
		margin-top: -12px;
	}
	h2 {
		color: #444;
		padding: 5px 0 0 5px;
		font-size: 1.1em;
		font-weight: normal;
	}
	#portalmap {
	width: 30%;
	font-size: 90%;
	float: left;
	padding: 1px;
	background: #fff;
	border: 1px solid #ccc;
	margin: 0 0 0 10px;
	white-space: normal;
	}
	.portalmap_portlet {
	padding: 10px;
	margin: 0;
	background: #f3f3f3;
	line-height: 1.5;
	}
	.portalmap_portlet_title p{
		border-bottom:2px solid #BBBBBB;
		font-size:1.3em;
		font-weight:bold;
		margin:0 0 1em;
		padding:0.3em 0;
	}
	.map_filters {
	margin: 0;
	padding: 0;
	}
	.map_filters div {
	margin: 0.5em 0 0 0;
	padding: 0;
	}
	.map_filters ul {
	margin: 0.7em 0 0.7em 0.3em;
	padding: 0;
	list-style: none;
	font-size: 95%;
	}
	.map_filters ul ul {
	padding: 0 0 0 2em;
	}
	.map-button {
	color: #fff;
	font-size: 90%;
	border: 1px solid white;
	background-color: #336699;
	padding: 0.3em 0.2em;
	}
	#map{
	width: 100%;
	height:80%;
	}
	</style>
	<!--[if IE]>
	<style type="text/css">
		#map{
			height:400px;
			}
	</style>
	<![endif]-->

</head>
<body>
	<tal:block tal:define="geo_types python:request.get('geo_types', here.getSymbolsIds());
						   geo_query request/geo_query|nothing;
						   address request/address|nothing;
						   zoom request/zoom|nothing;
						   path python:'/'.join(here.getSite().getPhysicalPath()) + '/' + request.get('path', '');
						   map_override python:{};
						   ">
	<script tal:define="site here/getSite"
	        tal:attributes="src string:${site/absolute_url}/misc_/Naaya/jquery.js"></script>
	<tal:block condition="address"><tal:block define="dummy
	      python:map_override.setdefault('initial_address', address)"
	      /></tal:block>
	<tal:block content="structure python:here.setup_map_engine_html(
	                        request, **map_override)" />
	<script type="text/javascript" tal:attributes="src string:${here/absolute_url}/map_i18n_js"></script>
	<script type="text/javascript" src="misc_/NaayaCore/geomaptool.js"></script>
	<script tal:content="structure python:'var portal_map_url=%s;' % here.rstk['json_dumps'](here.absolute_url())"></script>
	<form action="." name="frmFilterMap" method="get" id="frmFilterMap">
		<div id="center_content" style="overflow-x: auto;">
			<h2 tal:content="here/title_or_id" />
			<noscript>
				<p i18n:translate="" style="color: #77b81f;">
					You must have Javascript turned on to access all the Geo Map features.
				</p>
			</noscript>
			<p id="js_links" style="display: none;" i18n:translate="">
				Displaying <strong id="record_counter" i18n:name="locations_number"></strong> location(s).
				You can also <a href="." id="view_as_list" target="_blank" i18n:translate="" i18n:name="view_locations_list">view these locations as a list</a>,
				<a href="." id="view_in_google_earth" target="_blank" i18n:translate="" i18n:name="view_in_google_earth">view them in Google Earth</a>
				or <a href="." id="download_georss" target="_blank" i18n:translate="" i18n:name="download_georss">download them in GeoRSS format</a>.
			</p>
			<div id="map"></div>
			<br clear="all" style="clear:both"/>
			<div style="display:none" id="map_markers"></div>
		</div>
		<div id="portalmap">
			<div class="portalmap_portlet">
				<div class="portalmap_portlet_title">
					<p i18n:translate="">Find address</p>
				</div>
				<div>
					<input type="text" id="address" name="address:ustring:utf8"
						readonly="readonly" tal:attributes="value request/address|string:"
						onkeypress="return handleKeyPress(this, event);" style="width: 100%" />
					<input type="button" name="address_button" id="address_button"
						value="Go" disabled="disabled" onclick="findAddress()"
						i18n:attributes="value"/>
				</div>
				<div class="portalmap_portlet_title">
					<p i18n:translate="">Filter</p>
				</div>
				<div class="map_filters">
					<div>
						<input type="text" id="geo_query" name="geo_query:ustring:utf8"
							tal:attributes="value request/geo_query|string:"
							onkeypress="return handleKeyPress(this, event);"
							style="width: 100%" />
						<input type="button" name="geo_query_button" id="geo_query_button"
						disabled="disabled" value="Go" onclick="startMapRefresh()"
						i18n:attributes="value"/>
						<noscript>
							<p><small i18n:translate="">eg: "water supply"</small></p>
						</noscript>
					</div>
					<small>
						<a href="javascript:toggleSelect();" title="Check all"
							i18n:translate="" i18n:attributes="title" id="checkall"
							style="display:none">Uncheck All
						</a>
					</small>
					<ul class="map_legend" id="filter_map" tal:condition="parentsList"
						tal:define="parentsList here/getParentsListOrdered">
						<tal:block repeat="item parentsList">
							<tal:block define="children python:here.getSymbolChildrenOrdered(item.id);">
							<li>
								<input type="checkbox" name="geo_types:list"
									class="map_hidden_checkbox" style="display: none;"
									tal:attributes="value item/id; id item/id; checked python:item.id in geo_types"
									onclick="javascript:toggleChildren(this)" />
								<img tal:condition="python:item.picture is not None"
									tal:attributes="src string:getSymbolPicture?id=${item/id}; alt item/title"
									width="16" height="16" />
								<label tal:attributes="for item/id">
									<span i18n:translate="" tal:content="item/title" />
								</label>
								<ul tal:condition="children" class="category_child">
									<li tal:repeat="child children">
										<input type="checkbox" name="geo_types:list"
											tal:attributes="value child/id; id child/id;
															checked python:child.id in geo_types"
											onclick="javascript: startMapRefresh()" />
										<img tal:condition="python:child.picture is not None"
											tal:attributes="src string:getSymbolPicture?id=${child/id}; alt child/title"
											width="16" height="16" />
										<label tal:attributes="for child/id">
											<span i18n:translate="" tal:content="child/title" />
										</label>
									</li>
								</ul>
							</li>
							</tal:block>
						</tal:block>
					</ul>
					<div>
						<input type="hidden" id="path" name="path"
							tal:attributes="value path" />
						<noscript>
							<input type="submit" name="list_locations:method"
							       value="List locations" class="map-button"
							       i18n:attributes="value" />
							<input type="submit" name="export_geo_rss:method"
							       value="Download GeoRSS" class="map-button"
							       i18n:attributes="value" />
						</noscript>
					</div>
				</div>
			</div>
		</div>
	</form>
	<form id="list_locations_form" action="list_locations" method="get" style="display:none">
		<input type="hidden" name="lat_min" />
		<input type="hidden" name="lat_max" />
		<input type="hidden" name="lon_min" />
		<input type="hidden" name="lon_max" />
		<input type="hidden" name="symbols" />
		<input type="hidden" name="geo_query" />
	</form>

	<script type="text/javascript">
		showPageElements();
		window.map_engine = naaya_map_engine.portal_map('map');
	</script>
	</tal:block>
</body>
