| 134 | var isGecko = navigator.userAgent.indexOf('Gecko/') >= 0; |
| 135 | |
| 136 | function setAttrs(elem, attrs) { |
| 137 | if(isGecko) { |
| 138 | for (var aname in attrs) elem.setAttribute(aname, attrs[aname]); |
| 139 | } else { |
| 140 | for (var aname in attrs) { |
| 141 | var val = attrs[aname], prop = elem[aname]; |
| 142 | if(prop && prop.constructor === 'SVGLength') { |
| 143 | prop.baseVal.value = val; |
| 144 | } else { |
| 145 | elem.setAttribute(aname, val); |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | function mkElem(name, attrs, newparent) { |
| 152 | var elem = document.createElementNS(ns.svg, name); |