+ fo.addVariable('token','<%= session[:token] %>');
+ if (lat) { fo.addVariable('lat',lat); }
+ if (lon) { fo.addVariable('long',lon); }
+ <% if params['gpx'] %>fo.addVariable('gpx' ,'<%= h(params['gpx'] ) %>');<% end %>
+ <% if params['way'] %>fo.addVariable('way' ,'<%= h(params['way'] ) %>');<% end %>
+ <% if params['node'] %>fo.addVariable('node','<%= h(params['node']) %>');<% end %>
+ fo.write("map");
+ }
+
+ doSWF(<%= lat || 'null' %>,<%= lon || 'null' %>,<%= zoom %>);
+
+ function setPosition(lat, lon, zoom) {
+ doSWF(lat, lon, zoom);
+ }
+
+ function resizeContent() {
+ var content = $("content");
+ var rightMargin = parseInt(getStyle(content, "right"));
+ var bottomMargin = parseInt(getStyle(content, "bottom"));
+
+ content.style.width = document.documentElement.clientWidth - content.offsetLeft - rightMargin;
+ content.style.height = document.documentElement.clientHeight - content.offsetTop - bottomMargin;
+ }
+
+ function resizeMap() {
+ var sidebar_width = $("sidebar").offsetWidth;
+
+ if (sidebar_width > 0) {
+ sidebar_width = sidebar_width + 5
+ }
+
+ $("map").style.left = (sidebar_width) + "px";
+ $("map").style.width = ($("content").offsetWidth - sidebar_width) + "px";
+ $("map").style.height = ($("content").offsetHeight - 2) + "px";
+ }
+
+ function handleResize() {
+ if (brokenContentSize) {
+ resizeContent();
+ }
+
+ resizeMap();