1 function updatelinks(lon,lat,zoom,layers) {
4 node = document.getElementById("viewanchor");
6 var args = getArgs(node.href);
10 args["layers"] = layers;
11 node.href = setArgs(node.href, args);
14 node = document.getElementById("editanchor");
17 var args = new Object();
21 node.href = setArgs("/edit.html", args);
22 node.style.fontStyle = 'normal';
24 node.href = 'javascript:alert("zoom in to edit map");';
25 node.style.fontStyle = 'italic';
30 function getArgs(url) {
31 var args = new Object();
32 var querystart = url.indexOf("?");
34 if (querystart >= 0) {
35 var querystring = url.substring(querystart + 1);
36 var queryitems = querystring.split("&");
38 for (var i = 0; i < queryitems.length; i++) {
39 if (match = queryitems[i].match(/^(.*)=(.*)$/)) {
40 args[unescape(match[1])] = unescape(match[2]);
42 args[unescape(queryitems[i])] = null
50 function setArgs(url, args) {
51 var queryitems = new Array();
55 if (args[arg] == null) {
56 queryitems.push(escape(arg));
58 queryitems.push(escape(arg) + "=" + escape(args[arg]));
62 return url.replace(/\?.*$/, "") + "?" + queryitems.join("&");
65 function getStyle(el, property) {
68 if (el.currentStyle) {
69 style = el.currentStyle[property];
70 } else if( window.getComputedStyle ) {
71 style = document.defaultView.getComputedStyle(el,null).getPropertyValue(property);
73 style = el.style[property];