text: /**
   * dojox - A version of dojox.js framework that ported to running on skylarkjs.
   * @author Hudaokeji, Inc.
   * @version v0.9.0
   * @link https://github.com/skylark-integration/dojox/
   * @license MIT
   */
  !function(){window.svgns="http://www.w3.org/2000/svg",window.xlinkns="http://www.w3.org/1999/xlink",svgnsFake="urn:__fake__internal__namespace";var isOpera=!1,isSafari=!1,isMoz=!1,isIE=!1,isAIR=!1,isKhtml=!1,isFF=!1,isXHTML=!1;function _detectBrowsers(){var e=navigator,t=e.userAgent,n=e.appVersion,i=parseFloat(n);t.indexOf("Opera")>=0&&(isOpera=i);var s=Math.max(n.indexOf("WebKit"),n.indexOf("Safari"),0);s&&(isSafari=parseFloat(n.split("Version/")[1])||parseFloat(n.substr(s+7))>419.3?3:2),t.indexOf("AdobeAIR")>=0&&(isAIR=1),(n.indexOf("Konqueror")>=0||isSafari)&&(isKhtml=i),t.indexOf("Gecko")>=0&&!isKhtml&&(isMoz=i),isMoz&&(isFF=parseFloat(t.split("Firefox/")[1])||void 0),document.all&&!isOpera&&(isIE=parseFloat(n.split("MSIE ")[1])||void 0),document.documentMode?isStandardsMode=document.documentMode>5:isStandardsMode="CSS1Compat"==document.compatMode,"application/xhtml+xml"==document.contentType?isXHTML=!0:"undefined"!=typeof XMLDocument&&document.constructor==XMLDocument&&(isXHTML=!0)}function doDebugging(){for(var e=!1,t=document.getElementsByTagName("script"),n=0;n<t.length;n++)if(/svg(?:\-uncompressed)?\.js/.test(t[n].src)){var i=t[n].getAttribute("data-debug");e="true"===i||!0===i}return e}_detectBrowsers();var debug=doDebugging();if("undefined"==typeof console||!console.log){var queue=[];if(console={},debug){if(console.log=function(e){var t=null,n=!1;try{t=document.getElementsByTagName("body")[0]}catch(e){n=!0}if(isIE)try{document.documentElement.doScroll("left")}catch(e){n=!0}if(n)queue.push(e);else{for(var i;queue.length;){var s=queue.shift();(i=document.createElement("p")).appendChild(document.createTextNode(s)),t.appendChild(i)}(i=document.createElement("p")).appendChild(document.createTextNode(e)),t.appendChild(i)}},isIE){function flushQueue(){for(;queue.length;){var e=queue.shift();p=document.createElement("p"),p.appendChild(document.createTextNode(e)),document.body.appendChild(p)}}var debugInterval=window.setInterval(function(){"complete"==document.readyState&&(flushQueue(),window.clearTimeout(debugInterval))},50)}}else console.log=function(){}}function extend(e,t){for(var n in t)e.prototype[n]=t[n]}function mixin(e,t){for(var n in t)e[n]=t[n]}function xpath(e,t,n,i){if(t||(t=e.documentElement),"undefined"!=typeof XPathEvaluator){for(var s,r=new XPathEvaluator,o=e.createNSResolver(t),a=r.evaluate(n,t,o,0,null),d=createNodeList();s=a.iterateNext();)d.push(s);return d}if(e.setProperty("SelectionLanguage","XPath"),i){for(var h="",l={},_=0;_<i.length;_++){var u=i[_],c=i["_"+u];l["_"+u]||(h+="xmlns"==c?'xmlns="'+u+'" ':"xmlns:"+c+'="'+u+'" ',l["_"+u]=u)}e.setProperty("SelectionNamespaces",h)}null!==(d=t.selectNodes(n))&&void 0!==d||(d=createNodeList());var g=createNodeList();for(_=0;_<d.length;_++)g.push(d[_]);return g}var parseXMLCache={};function parseXML(e,t){void 0===t&&(t=!1);var n=parseXMLCache[t+e];if(n)return n.cloneNode(!0);if("undefined"!=typeof DOMParser){var i=new DOMParser;try{r=i.parseFromString(e,"application/xml")}catch(e){throw e}var s=r.documentElement;if("parsererror"==s.nodeName)throw new Error("There is a bug in your SVG: "+(new XMLSerializer).serializeToString(s))}else{for(var r,o=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.3.0"],a=0;a<o.length;a++)try{if(r=new ActiveXObject(o[a]))break}catch(e){}if(!r)throw new Error("Unable to instantiate XML parser");try{if(r.preserveWhiteSpace=t,r.resolveExternals=!1,r.validateOnParse=!1,r.setProperty("ProhibitDTD",!1),r.async="false",!r.loadXML(e)||0!==r.parseError.errorCode)throw new Error(r.parseError.reason)}catch(e){throw console.log(e.message),new Error("Unable to parse SVG: "+e.message)}}try{parseXMLCache[t+e]=r.cloneNode(!0)}catch(e){}return r}function xmlToStr(e,t){var n,i=e._nodeXML||e,s="";if(-1==(n=(n="undefined"!=typeof XMLSerializer?(new XMLSerializer).serializeToString(i):i.xml).replace(/urn\:__fake__internal__namespace/g,svgns)).indexOf("xmlns=")&&(s='xmlns="'+svgns+'" '),t)for(var r=0;r<t.length;r++){var o,a=t[r],d=t["_"+a];a==svgnsFake&&(a=svgns),o="xmlns"!=d?"xmlns:"+d+'="'+a+'"':'xmlns="'+a+'"',-1==n.indexOf(o)&&(s+=o+" ")}return n=n.replace(/<([^ ]+)/,"<$1 "+s+" ")}function hitch(e,t){return"string"==typeof t&&(t=e[t]),function(){return t.apply(e,arguments.length?arguments:[])}}var XHR_PROGIDS=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];function xhrObj(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if(ActiveXObject){var e,t=null;for(e=0;e<XHR_PROGIDS.length&&!t;++e)try{t=new ActiveXObject(XHR_PROGIDS[e])}catch(e){}if(!t)throw new Error("XMLHttpRequest object not available on this platform");return t}}var guidCounter=0;function guid(){return"_"+guidCounter++}function SVGWeb(){this._setXDomain(),this.libraryPath=this._getLibraryPath(),this.htcFilename=this._getHTCFilename(),isIE&&FlashHandler._prepareBehavior(this.libraryPath,this.htcFilename),this._interceptOnloadListeners(),this._initDOMContentLoaded()}function RenderConfig(){if(this._forceFlash())console.log("Forcing Flash SVG viewer for this browser");else if(this.hasNativeSVG())return this.supported=!0,void(this.use="native");var e=new FlashInfo;e.capable?e.isVersionOrAbove(9,0,0)?(this.supported=!0,this.use="flash"):(this.supported=!1,this.reason="Flash 9+ required"):(this.supported=!1,this.reason="Flash 9+ or a different browser required")}function FlashInfo(){this._detectVersion()}function FlashHandler(e){this.type=e.type,this._keyboardListeners=[],this._redrawManager=new _RedrawManager(this),"script"==this.type?(this.id=e.svgID,this._xml=e.xml,this._svgString=e.svgString,this._origSVG=e.origSVG,this._scriptNode=e.scriptNode):"object"==this.type&&(this.id=e.objID,this._objNode=e.objNode)}function NativeHandler(e){this.type=e.type,this._xml=e.xml,"object"==this.type?(this.id=e.objID,this._objNode=e.objNode):"script"==this.type&&(this.id=e.svgID,this._svgString=e.svgString,this._scriptNode=e.scriptNode)}function _RedrawManager(e){this._handler=e,this._batch=[],this._nextID=1,this._ids=[],this._timeoutIDs={}}function _DOMImplementation(){}function _Node(e,t,n,i,s,r,o){if(void 0!==e||void 0!==t){if(this.nodeName=e,this._nodeXML=s,this._handler=r,this._listeners={},this._detachedListeners=[],this.fake=!0,i==svgnsFake&&(i=svgns),this._attached=!0,this._handler||(this._attached=!1),t!=_Node.ELEMENT_NODE||this._nodeXML||this._handler){if(t==_Node.DOCUMENT_FRAGMENT_NODE){a='<?xml version="1.0"?>\n<__document__fragment></__document__fragment>';this._nodeXML=parseXML(a).documentElement}}else{var a='<?xml version="1.0"?>\n';i!=svgns||n?a+="<"+e+" xmlns:"+n+'="'+i+'"/>':a+="<"+e+' xmlns="'+svgnsFake+'"/>',this._nodeXML=parseXML(a).documentElement}t!=_Node.DOCUMENT_NODE&&this._nodeXML&&(this._nodeXML.getAttribute("__guid")||this._nodeXML.setAttribute("__guid",guid()),this._guid=this._nodeXML.getAttribute("__guid"),svgweb._guidLookup["_"+this._guid]=this),t==_Node.ELEMENT_NODE&&(-1!=e.indexOf(":")?this.localName=e.match(/^[^:]*:(.*)$/)[1]:this.localName=e),this.nodeType=t||_Node.ELEMENT_NODE,t==_Node.ELEMENT_NODE||t==_Node.DOCUMENT_NODE||t==_Node.DOCUMENT_FRAGMENT_NODE?(this.prefix=n,this.namespaceURI=i,this._nodeValue=null):t==_Node.TEXT_NODE&&(this._nodeValue=this._nodeXML.firstChild.nodeValue,this.prefix=null,this.namespaceURI=null,void 0===this._nodeValue&&(this._nodeValue=null)),this.ownerDocument=document,this._attached&&"object"==this._handler.type&&(this.ownerDocument=this._handler.document),void 0===o&&(o=!1),this._passThrough=o,isIE&&this._createEmptyMethods(),this._childNodes=this._createChildNodes(),t==_Node.TEXT_NODE&&this._nodeXML.setAttribute("__fakeTextNode",!0),isIE?isIE&&this.nodeType!=_Node.DOCUMENT_NODE&&this._createHTC():this._defineNodeAccessors()}}function _Element(e,t,n,i,s,r){void 0===e&&void 0===n&&void 0===i&&void 0===s||(_Node.apply(this,[e,_Node.ELEMENT_NODE,t,n,i,s,r]),this._attributes={},this._attributes._id="",this._importAttributes(this,this._nodeXML),isIE||this._defineAccessors(),this.namespaceURI==svgns&&(isIE&&this._attached&&"script"==this._handler.type&&"svg"==this.nodeName||(this.style=new _Style(this)),isIE&&this._attached&&"script"==this._handler.type&&"svg"==this.nodeName||isIE&&(this.style._ignoreStyleChanges=!1)))}function _DocumentFragment(e){_Node.apply(this,["#document-fragment",_Node.DOCUMENT_FRAGMENT_NODE,null,null,null,null]),this.ownerDocument=e}function _Style(e){this._element=e,this._setup()}function _SVGObject(e,t){this._handler=t,this._svgNode=e,this._scriptsToExec=[],this._htcLoaded=!1,this._swfLoaded=!1;for(var n=0;this._svgNode._onloadListeners&&n<this._svgNode._onloadListeners.length;n++){var i=function(e,t){return function(){t.apply(e.flash)}}(this._handler,this._svgNode._onloadListeners[n]);svgweb.addOnLoad(i)}isIE&&this._loadHTC(),this.url=this._svgNode.getAttribute("src"),this.url||(this.url=this._svgNode.getAttribute("data"));var s=hitch(this,function(e){this._handler._origSVG=e;var t=svgweb._cleanSVG(e,!0,!1);this._svgString=t.svg,this._xml=t.xml,this.document=new _Document(this._xml,this._handler),this._handler.document=this.document;this._xml.documentElement;this._savedParams=this._getPARAMs(this._svgNode),this._handler._inserter=new FlashInserter("object",this._xml.documentElement,this._svgNode,this._handler)});"data:"==this.url.substring(0,5)?s(this.url.substring(this.url.indexOf(",")+1)):this._fetchURL(this.url,s,hitch(this,this._fallback))}function _SVGWindow(e){this._handler=e,this.fake=!0,this.frameElement=this._handler.flash,this.location=this._createLocation(),this.alert=window.alert,this.top=this.parent=window,this._onloadListeners=[]}function FlashInserter(e,t,n,i){this._embedType=e,this._nodeXML=t,this._replaceMe=n,this._handler=i,this._parentNode=n.parentNode,"object"==this._embedType&&(this._explicitWidth=this._replaceMe.getAttribute("width"),this._explicitHeight=this._replaceMe.getAttribute("height")),this._setupFlash()}function _SVGSVGElement(e,t,n,i){if(_Element.apply(this,["svg",null,svgns,e,i,!0]),this._nodeXML=e,this._svgString=t,this._scriptNode=n,this._htcLoaded=!1,this._swfLoaded=!1,"script"==this._handler.type){var s=this._nodeXML.getAttribute("id");this._handler.document._nodeById["_"+s]=this}this._currentScale=1,this._currentTranslate=this._createCurrentTranslate(),isIE&&"script"==this._handler.type?(this._addRedrawMethods(),this.style=new _Style(this),this._readyStateListener=hitch(this,this._onHTCLoaded),this._htcNode.attachEvent("onreadystatechange",this._readyStateListener)):isIE&&"object"==this._handler.type&&this._addRedrawMethods(),"script"==this._handler.type&&(this._handler._inserter=new FlashInserter("script",this._nodeXML,this._scriptNode,this._handler))}function _Document(e,t){_Node.apply(this,["#document",_Node.DOCUMENT_NODE,null,null,e,t],svgns),this._xml=e,this._handler=t,this._nodeById={},this._namespaces=this._getNamespaces(),this.implementation=new _DOMImplementation,"script"==this._handler.type?this.defaultView=window:this._handler.type}function createNodeList(){var e=[];return e.item=function(e){return e>=this.length?null:this[e]},e}function createCharacterData(e){var t=void 0!==e?new String(e):new String;return t.data=t.toString(),t}function _SVGMatrix(e,t,n,i,s,r,o){this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this._handler=o}function _SVGLength(e){this.value=e}function _SVGAnimatedLength(e){this.baseVal=e,this.animVal=void 0}function _SVGTransform(e,t,n){this.type=e,this.matrix=t,this.angle=n}function _SVGPoint(e,t,n,i){void 0===n&&(n=!1),this._formalAccessors=n,this.x=e,this.y=t,n&&(this.setX=hitch(this,function(e){this.x=e,i("x",e)}),this.getX=hitch(this,function(){return this.x}),this.setY=hitch(this,function(e){this.y=e,i("y",e)}),this.getY=hitch(this,function(){return this.y}),this.setXY=hitch(this,function(e,t){this.x=e,this.y=t,i("xy",e,t)}))}function _SVGRect(e,t,n,i){this.x=e,this.y=t,this.width=n,this.height=i}extend(SVGWeb,{libraryPath:"./",config:null,pageLoaded:!1,handlers:[],totalLoaded:0,_guidLookup:[],_loadListeners:[],_removedNodes:[],addOnLoad:function(e,t,n){if(t){var i=n.frameElement;t&&"flash"==this.getHandlerType()?e.apply(n):i._svgHandler?i._svgHandler._onObjectLoad(e,n):(i._svgWindow=n,i._svgFunc=e)}else this._loadListeners.push(e);this.pageLoaded&&this._fireOnLoad()},getHandlerType:function(){return this.renderer==FlashHandler?"flash":this.renderer==NativeHandler?"native":void 0},appendChild:function(e,t){if("object"==e.nodeName.toLowerCase()&&"image/svg+xml"==e.getAttribute("type")){this.totalSVG++,this._svgObjects.push(e),"native"==this.getHandlerType()&&(e.onload=e.onsvgload,t.appendChild(e));var n=e;if("flash"==this.getHandlerType()){e.onsvgload&&e.addEventListener("SVGLoad",e.onsvgload,!1);for(var i=document._createElement("div"),s=0;s<e.attributes.length;s++){var r=e.attributes[s],o=r.nodeName,a=r.nodeValue;(a||"true"===a)&&i.setAttribute(o,a)}t.appendChild(i),i._onloadListeners=e._onloadListeners,n=i}var d=this._processSVGObject(n);e._objID=d}else if("svg"==e.nodeName.toLowerCase()){this.totalSVG++,e.onsvgload&&e.addEventListener("SVGLoad",e.onsvgload,!1),isIE&&e._fakeNode&&(e=e._fakeNode);var h=xmlToStr(e),l=document.createElement("script");l.type="image/svg+xml",isXHTML?l.appendChild(document.createTextNode(h)):l.text=h,this._svgScripts.push(l),t.appendChild(l),l._onloadListeners=e._detachedListeners||e._onloadListeners,this._processSVGScript(l)}},removeChild:function(e,t){var n,i,s=e.nodeName.toLowerCase();if("object"==s||"embed"==s||"svg"==s){this.totalSVG=0==this.totalSVG?0:this.totalSVG-1,this.totalLoaded=0==this.totalLoaded?0:this.totalLoaded-1,n=e.getAttribute("id"),i=this.handlers[n];for(var r=[],o=0;o<this.handlers.length;o++){var a=this.handlers[o];a!=i&&(r[a.id]=a,r.push(a))}this.handlers=r}if("object"==s||"embed"==s){if("flash"==this.getHandlerType()&&i.document&&i.document.defaultView){var d=i.document.defaultView;for(o=0;o<d._intervalIDs.length;o++)d.clearInterval(d._intervalIDs[o]);for(o=0;o<d._timeoutIDs.length;o++)d.clearTimeout(d._timeoutIDs[o]);for(o=0;o<i._keyboardListeners.length;o++){var h=i._keyboardListeners[o];isIE?document.detachEvent("onkeydown",h):(document.removeEventListener("keydown",h,!0),document.removeEventListener("keydown",h,!1))}}var l;l=void 0!==e._objID?e._objID:void 0!==e.contentDocument?e.contentDocument._handler.id:e._handler.id;for(o=0;o<svgweb._svgObjects.length;o++)if(svgweb._svgObjects[o]._objID===l){svgweb._svgObjects.splice(o,1);break}if(t.removeChild(e),"flash"==this.getHandlerType()){var _=document.getElementById("__htc_container");if(_)for(o=0;o<_.childNodes.length;o++){void 0!==(f=_.childNodes[o]).ownerDocument&&f.ownerDocument==i._svgObject.document&&(void 0!==f._fakeNode&&void 0!==f._fakeNode._htcNode&&(f._fakeNode._htcNode=null),f._fakeNode=null,f._handler=null,_.removeChild(f))}for(var u in svgweb._guidLookup){(f=svgweb._guidLookup[u])._fake&&f.ownerDocument===i.document&&delete svgweb._guidLookup[u]}i.flash.contentDocument=null,i.flash=null,i._xml=null,i.window&&(i.window._scope=null,i.window=null);var c=i._svgObject,g=c.document;g._nodeById=null,g._xml=null,g.defaultView=null,g.documentElement=null,g.rootElement=null,g.defaultView=null,g=null,c._svgNode=null,c._handler=null,d&&(d._setTimeout=null,d.setTimeout=null,d._setInterval=null,d.setInterval=null),i._svgObject=null,c=null,i=null,d=null}}else if("svg"==s){for(o=0;o<svgweb._svgScripts.length;o++)if(svgweb._svgScripts[o]==i._scriptNode){svgweb._svgScripts.splice(o,1);break}var p;if(isIE&&"flash"==this.getHandlerType()&&e._fakeNode&&(e=e._fakeNode),p="native"==this.getHandlerType()?e:e._handler.flash,isIE?window.setTimeout(function(e,t){return function(){e.removeChild(t),e=null,t=null}}(t,p),1):t.removeChild(p),"flash"==this.getHandlerType()){for(var u in e._setUnattached(),svgweb._guidLookup){var f;(f=svgweb._guidLookup[u])._fake&&f._getFakeNode()===i&&delete svgweb._guidLookup[u]}i._scriptNode=null,i.flash.documentElement=null,i.flash=null,i._xml=null,i=null}}},_initDOMContentLoaded:function(){var e=this;if(document.addEventListener)document.addEventListener("DOMContentLoaded",function(){e._onDOMContentLoaded()},!1);else{document.write('<script id="__ie__svg__onload" defer src=//0><\/script>'),document.getElementById("__ie__svg__onload").onreadystatechange=function(){"complete"==this.readyState&&e._onDOMContentLoaded()};var t=function(){window.onload&&(e._saveWindowOnload(),document.detachEvent("onreadystatechange",t))};document.attachEvent("onreadystatechange",t)}},_setXDomain:function(){for(var e=document.getElementsByTagName("script"),t=0;t<e.length;t++)if(/svg(?:\-uncompressed)?\.js/.test(e[t].src)&&/^https?/.test(e[t].src)){var n=e[t].src.replace(/svg(?:\-uncompressed)?\.js/,"");if(n.match(/https?\:\/\/[^\/]*/)[0]!=window.location.protocol.replace(/:|\//g,"")+"://"+window.location.host)return this.xDomainURL=n,void(this._isXDomain=!0)}this._isXDomain=!1},_getLibraryPath:function(){for(var e="./",t=document.getElementsByTagName("meta"),n=0;n<t.length;n++)"svg.config.data-path"==t[n].name&&t[n].content.length>0&&(e=t[n].content);var i=document.getElementsByTagName("script");for(n=0;n<i.length;n++)if(/svg(?:\-uncompressed)?\.js/.test(i[n].src)&&i[n].getAttribute("data-path")){e=i[n].getAttribute("data-path");break}return"/"!=e.charAt(e.length-1)&&(e+="/"),e},_getHTCFilename:function(){var e="svg.htc",t=window.location.toString();if(-1!=t.indexOf("svg.htcFilename=svg-htc.php"))return"svg-htc.php";if(-1!=t.indexOf("svg.htcFilename=svg-htc.jsp"))return"svg-htc.jsp";if(-1!=t.indexOf("svg.htcFilename=svg-htc.asp"))return"svg-htc.asp";for(var n=document.getElementsByTagName("script"),i=0;i<n.length;i++)if(/svg(?:\-uncompressed)?\.js/.test(n[i].src)&&n[i].getAttribute("data-htc-filename")){e=n[i].getAttribute("data-htc-filename");break}return e},_onDOMContentLoaded:function(){if(!arguments.callee.done){arguments.callee.done=!0,this._startTime=(new Date).getTime();var e=document.getElementById("__ie__svg__onload");if(e&&(e.parentNode.removeChild(e),e.onreadystatechange=null,e=null),this._saveWindowOnload(),this.config=new RenderConfig,isIE&&this._watchUnload(),this._svgScripts=this._getSVGScripts(),this._svgObjects=this._getSVGObjects(),this.totalSVG=this._svgScripts.length+this._svgObjects.length,this._cleanupSVGObjects(),this._handleHTMLTitleBug(),!this.config.supported)return this._displayNotSupported(this.config.reason),void this._fireOnLoad();if(this.renderer,"flash"==this.config.use?this.renderer=FlashHandler:"native"==this.config.use&&(this.renderer=NativeHandler),this.renderer._patchBrowserObjects(window,document),"flash"==this.config.use&&(this._createResizeListener(),this._attachResizeListener()),0!==this.totalSVG){for(var t=0;t<this._svgScripts.length;t++)this._processSVGScript(this._svgScripts[t]);for(t=0;t<this._svgObjects.length;t++){var n=this._processSVGObject(this._svgObjects[t]);this._svgObjects[t]._objID=n}}else this._fireOnLoad()}},_createResizeListener:function(){this._resizeFunc=isIE?function(e){return function(){e._onWindowResize()}}(this):hitch(this,function(){this._onWindowResize()})},_attachResizeListener:function(){isIE?window.attachEvent("onresize",this._resizeFunc):window.addEventListener("resize",this._resizeFunc,!1)},_detachResizeListener:function(){isIE?window.detachEvent("onresize",this._resizeFunc):window.removeEventListener("resize",this._resizeFunc,!1)},_onWindowResize:function(){if(this.pageLoaded){this._detachResizeListener();for(var e=0;e<this.handlers.length;e++){var t=this.handlers[e];if(t._inserter&&t.flash){var n=t._inserter._determineSize();t.flash.width=n.width,t.flash.height=n.height,t.sendToFlash("jsHandleResize",[n.pixelsWidth,n.pixelsHeight])}}this._attachResizeListener()}},_getSVGScripts:function(){for(var e=document.getElementsByTagName("script"),t=[],n=0;n<e.length;n++)"image/svg+xml"==e[n].type&&t.push(e[n]);return t},_getSVGObjects:function(){for(var e=document.getElementsByTagName("object"),t=[],n=0;n<e.length;n++)"image/svg+xml"==e[n].getAttribute("classid")?t.push(e[n]):"image/svg+xml"==e[n].getAttribute("type")&&t.push(e[n]);return t},_displayNotSupported:function(e){for(var t=0;t<this._svgObjects.length;t++){var n=this._svgObjects[t];if(!n.childNodes.length||1==n.childNodes.length&&3==n.childNodes[0].nodeType&&/^[ ]*$/m.test(n.childNodes[0].nodeValue)){var i=document.createElement("span");i.className="svg-noscript",i.appendChild(document.createTextNode(e)),n.parentNode.replaceChild(i,n)}}for(t=0;t<this._svgScripts.length;t++){var s=this._svgScripts[t],r=document.createElement("span");r.className="svg-noscript";for(var o=s.nextSibling;o&&1!=o.nodeType;)o=o.nextSibling;if(o&&"noscript"==o.nodeName.toLowerCase()){var a=o;r.innerHTML=a.innerHTML}else r.appendChild(document.createTextNode(e));s.parentNode.insertBefore(r,s)}},_fireOnLoad:function(){if(!(this.handlers.length<this._svgObjects.length)){for(var e=!0,t=0;t<this.handlers.length;t++){if(!this.handlers[t]._loaded){e=!1;break}}if(e&&(this.pageLoaded=!0,this._endTime=(new Date).getTime(),this._loadListeners.length)){var n=this;window.setTimeout(function(){var e=n._loadListeners;n._loadListeners=[],this.totalLoaded=0;for(var t=0;t<e.length;t++)try{e[t]()}catch(e){console.log("Error while firing onload: "+(e.message||e))}},1)}}},_cleanSVG:function(e,t,n){var i;/^\s*<\!\[CDATA\[/.test(e)&&(e=(e=e.replace(/^\s*<\!\[CDATA\[/,"")).replace(/\]\]>\s*/,"")),t&&(0==/\<\?xml/m.test(e)&&(e='<?xml version="1.0"?>\n'+e),0==/xmlns\=['"]http:\/\/www\.w3\.org\/2000\/svg['"]/.test(e)&&(e=e.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"')),0==/xmlns:[^=]+=['"]http:\/\/www\.w3\.org\/1999\/xlink['"]/.test(e)&&(e=e.replace("<svg",'<svg xmlns:xlink="http://www.w3.org/1999/xlink"'))),"<"!=e.charAt(0)&&(e=e.replace(/\s*<\?xml/,"<?xml")),RegExp.lastIndex=0;for(var s=/<!ENTITY\s+(\S+)\s+"([^"]*)"/g;null!=(i=s.exec(e));){var r=RegExp.$1,o=RegExp.$2;e=e.split("&"+r+";").join(o)}if(n&&(e=e.replace(/\>\s+\</gm,"><")),this.renderer==FlashHandler){var a=(e=(e=(e=(e=e.replace(/<!\-\-[\s\S]*?\-\->/g,"")).replace(/<svg/,"<SVGROOT")).replace(/<svg/g,"<NESTEDSVG")).replace(/<SVGROOT/,"<svg")).match(/<svg/)[0],d=e.split(/<svg/),h=-1!=d[1].indexOf("<![CDATA[");if(h){RegExp.lastIndex=0;var l=/<\!\[CDATA\[/g;i=l.exec(d[1]);var _=[];for(v=0;i&&RegExp.rightContext;){var u=l.lastIndex-"<![CDATA[".length,c=RegExp.rightContext,g=l.lastIndex+c.indexOf("]]>")+2,p=c.substring(0,c.indexOf("]]>"));p="<![CDATA["+p+"]]>",_.push(p);var f=d[1].substring(0,u),m=d[1].substring(g+1,d[1].length);d[1]=f+"__SVG_CDATA_TOKEN_"+v+m,i=l.exec(d[1]),v++}}if(d[1]=d[1].replace(/>([^>]+)</g,"><__text>$1</__text><"),h)for(var v=0;v<_.length;v++)d[1]=d[1].replace("__SVG_CDATA_TOKEN_"+v,_[v]);e=d[0]+a+d[1];for(v=2;v<d.length;v++)e+=d[v]}e=e.replace(/<NESTEDSVG/g,"<svg"),this.renderer==FlashHandler&&(e=(e=FlashHandler._encodeFlashData(e)).replace(/xmlns(\:[^=]*)?=['"]http\:\/\/www\.w3\.org\/2000\/svg['"]/g,"xmlns$1='"+svgnsFake+"'"));var N=this._addTracking(e,n);return e="undefined"!=typeof XMLSerializer?(new XMLSerializer).serializeToString(N):N.xml,this.renderer==FlashHandler&&(e=e.replace(new RegExp(svgnsFake,"g"),svgns)),{svg:e,xml:N}},_processSVGScript:function(e){var t;if(isXHTML){t="";for(var n=0;n<e.childNodes.length;n++)t+=e.childNodes[n].textContent}else t=e.innerHTML;var i=this._cleanSVG(t,!0,!0),s=i.svg,r=i.xml,o=r.documentElement.getAttribute("id"),a=r.documentElement.getAttribute("onload");if(a){var d=function(e,t){return function(){var n,i=svgweb.handlers[t];return n="flash"==svgweb.getHandlerType()?i.document.documentElement._getProxyNode():document.getElementById(t),e.apply(n)}}(a=new Function('var evt = { target: document.getElementById("'+o+'") ,currentTarget: document.getElementById("'+o+'") ,preventDefault: function() { this.returnValue=false; }};'+a),o);this._loadListeners.push(d)}var h=new this.renderer({type:"script",svgID:o,xml:r,svgString:s,origSVG:t,scriptNode:e});this.handlers[o]=h,this.handlers.push(h),h.start()},_processSVGObject:function(e){var t=e.getAttribute("id");t||(e.setAttribute("id",svgweb._generateID("__svg__random__","__object")),t=e.getAttribute("id"));var n=new this.renderer({type:"object",objID:t,objNode:e});return this.handlers[t]=n,this.handlers.push(n),n.start(),t},_generateID:function(e,t){return t||(t=""),e||(e=""),e+guid()+t},_addTracking:function(e,t){var n=parseXML(e,!t),i=n.documentElement;if(i&&!i.getAttribute("id")&&i.setAttribute("id",this._generateID("__svg__random__",null)),"flash"!=this.getHandlerType())return n;for(var s=i;s;){s.nodeType==_Node.ELEMENT_NODE&&s.setAttribute("__guid",guid()),s.nodeType!=_Node.ELEMENT_NODE||s.getAttribute("id")||s.setAttribute("id",svgweb._generateID("__svg__random__",null));var r=s.firstChild;if(r)s=r;else for(;s;){if(s!=i&&(r=s.nextSibling)){s=r;break}s==i?s=null:1==(s=s.parentNode).nodeType&&"SVG"!=s.nodeName.toUpperCase()||(s=null)}}return n},_handleDone:function(e,t,n){if(this.totalLoaded++,"script"==t&&n._scriptNode._onloadListeners){for(var i=0;i<n._scriptNode._onloadListeners.length;i++){var s=n._scriptNode._onloadListeners[i];if("flash"==svgweb.getHandlerType())s=s.listener;else-1!=n._svgRoot.addEventListener.toString().indexOf("[native code]")&&NativeHandler._patchAddEventListener(n._svgRoot);try{var r=document.getElementById(n.id);s.apply(r)}catch(e){console.log("Error while firing onload listener: "+e.message||e)}}n._scriptNode._onloadListeners=[]}this.totalLoaded>=this.totalSVG&&this._fireOnLoad()},_handleHTMLTitleBug:function(){var e=document.getElementsByTagName("head")[0],t=e.getElementsByTagName("title");0===t.length&&(t=document.createElement("title"),e.appendChild(t))},_fireFlashError:function(e){},_exportID:function(e){e.__defineGetter__("id",function(){return e.getAttribute("id")}),e.__defineSetter__("id",function(t){return e.setAttribute("id",t)})},_watchUnload:function(){window.attachEvent("onunload",function(e){window.detachEvent("onunload",arguments.callee),svgweb._fireUnload()})},_fireUnload:function(){if(isIE){for(var e=0;e<svgweb.handlers.length;e++)if("object"==svgweb.handlers[e].type){var t=svgweb.handlers[e].flash;t.parentNode&&svgweb.removeChild(t,t.parentNode)}else svgweb.handlers[e].document.documentElement=null;var n=document.getElementById("__htc_container");if(n){for(e=0;e<n.childNodes.length;e++){var i=n.childNodes[e];1==i.nodeType&&i.namespaceURI==svgns&&(i.detachEvent("onpropertychange",i._fakeNode.style._changeListener),i.style.item=null,i.style.setProperty=null,i.style.getPropertyValue=null),i._fakeNode&&(i._fakeNode._htcNode=null),i._fakeNode=null,i._handler=null}n.parentNode.removeChild(n),n=null}for(e=0;e<svgweb.handlers.length;e++){svgweb.handlers[e].flash=null}svgweb.handlers=null;for(e=0;e<svgweb._removedNodes.length;e++){var s=svgweb._removedNodes[e];s._fakeNode&&(s._fakeNode._htcNode=null),s._fakeNode=null,s._handler=null}svgweb._removedNodes=null,document.getElementById=document._getElementById,document._getElementById=null,document.getElementsByTagNameNS=document._getElementsByTagNameNS,document._getElementsByTagNameNS=null,document.createElementNS=document._createElementNS,document._createElementNS=null,document.createElement=document._createElement,document._createElement=null,document.createTextNode=document._createTextNode,document._createTextNode=null,document._importNodeFunc=null,document.createDocumentFragment=document._createDocumentFragment,document._createDocumentFragment=null,window.addEventListener=null,window._addEventListener=null,window.attachEvent=window._attachEvent,window._attachEvent=null,parseXMLCache=null}},_cleanupSVGObjects:function(){if("flash"==this.config.use&&this.config.hasNativeSVG())for(var e=0;e<this._svgObjects.length;e++){for(var t=this._svgObjects[e],n=document.createElement("div"),i=0;i<t.attributes.length;i++){var s=t.attributes[i];n.setAttribute(s.nodeName,s.nodeValue)}var r=t.innerHTML;n.innerHTML=r,t.parentNode.replaceChild(n,t),this._svgObjects[e]=n}for(e=0;e<this._svgObjects.length;e++)this._svgObjects[e].style.visibility="hidden"},_interceptOnloadListeners:function(){window.addEventListener?(window._addEventListener=window.addEventListener,window.addEventListener=function(e,t,n){if("svgload"!=e.toLowerCase())return window._addEventListener(e,t,n);svgweb.addOnLoad(t)}):window.addEventListener=function(e,t,n){"svgload"==e.toLowerCase()&&svgweb.addOnLoad(t)},isIE&&window.attachEvent&&(window._attachEvent=window.attachEvent,window.attachEvent=function(e,t){if("onsvgload"!=e.toLowerCase())return window._attachEvent(e,t);svgweb.addOnLoad(t)})},_saveWindowOnload:function(){var onsvgload=window.onsvgload;if(document.getElementsByTagName("body")){var body=document.getElementsByTagName("body")[0];body.getAttribute("onsvgload")&&(callbackStr=body.getAttribute("onsvgload"),onsvgload=function(callbackStr){return function(){eval(callbackStr)}}(callbackStr))}onsvgload&&(isIE?this._loadListeners.splice(0,0,onsvgload):this._loadListeners.push(onsvgload),window.onsvgload=onsvgload=null)}}),extend(RenderConfig,{supported:!1,reason:null,use:null,_forceFlash:function(){for(var e=!1,t=!1,n=document.getElementsByTagName("meta"),i=0;i<n.length;i++)"svg.render.forceflash"==n[i].name&&"true"==n[i].content.toLowerCase()&&(e=!0,t=!0);return-1!=window.location.search.indexOf("svg.render.forceflash=true")?e=!0:t&&-1!=window.location.search.indexOf("svg.render.forceflash=false")&&(e=!1),e},hasNativeSVG:function(){return!(!document.implementation||!document.implementation.hasFeature)&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}}),FlashInfo.prototype={version:-1,versionMajor:-1,versionMinor:-1,versionRevision:-1,capable:!1,isVersionOrAbove:function(e,t,n){return n=parseFloat("."+n),this.versionMajor>=e&&this.versionMinor>=t&&this.versionRevision>=n},_detectVersion:function(){for(var e,t=25;t>0;t--){var n;if(isIE)try{"object"==typeof(n=t>6?new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+t):new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))&&(6==t&&(n.AllowScriptAccess="always"),e=n.GetVariable("$version"))}catch(e){continue}else e=this._JSFlashInfo(t);if(-1==e)return void(this.capable=!1);if(0!==e){var i;if(isIE)i=e.split(" ")[1].split(",");else i=e.split(".");this.versionMajor=i[0],this.versionMinor=i[1],this.versionRevision=i[2];var s=this.versionMajor+"."+this.versionRevision;this.version=parseFloat(s),this.capable=!0;break}}},_JSFlashInfo:function(e){if(null!==navigator.plugins&&navigator.plugins.length>0&&(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"])){var t=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"",n=navigator.plugins["Shockwave Flash"+t].description.split(" "),i=n[2].split("."),s=i[0],r=i[1],o=(n[3]||n[4]).split("r");return s+"."+r+"."+(o[1]>0?o[1]:0)}return-1}},FlashHandler._unattachedDoc=parseXML('<?xml version="1.0"?>\n<svg xmlns="'+svgns+'"></svg>',!1),FlashHandler._prepareBehavior=function(e,t){for(var n=null,i=0;i<document.namespaces.length;i++)if("svg"==document.namespaces.item(i).name){n=document.namespaces.item(i);break}null===n&&(n=document.namespaces.add("svg",svgns)),n.doImport(e+t)},FlashHandler._getNode=function(e,t){var n,i=!1;if((n=svgweb._guidLookup["_"+e.getAttribute("__guid")])||"__text"!=e.nodeName||(i=!0),n||i||e.nodeType!=_Node.ELEMENT_NODE)if(n||e.nodeType!=_Node.TEXT_NODE&&!i){if(!n)throw new Error("Unknown node type given to _getNode: "+e.nodeType)}else n=new _Node("#text",_Node.TEXT_NODE,null,null,e,t,!1);else n=new _Element(e.nodeName,e.prefix,e.namespaceURI,e,t,!0);return n._getProxyNode()},FlashHandler._patchBrowserObjects=function(e,t){t._getElementById||(document._getElementById=document.getElementById,document.getElementById=FlashHandler._getElementById,document._getElementsByTagNameNS=document.getElementsByTagNameNS,document.getElementsByTagNameNS=FlashHandler._getElementsByTagNameNS,document._createElementNS=document.createElementNS,document.createElementNS=FlashHandler._createElementNS,document._createElement=document.createElement,document.createElement=FlashHandler._createElement,document._createTextNode=document.createTextNode,document.createTextNode=FlashHandler._createTextNode,document._importNodeFunc=FlashHandler._importNodeFunc,document._createDocumentFragment=document.createDocumentFragment,document.createDocumentFragment=FlashHandler._createDocumentFragment)},FlashHandler._getElementById=function(e){var t=document._getElementById(e);if(null!==t)return t;for(var n=0;n<svgweb.handlers.length;n++)if("script"==svgweb.handlers[n].type&&(t=svgweb.handlers[n].document.getElementById(e)),t)return t;return null},FlashHandler._getElementsByTagNameNS=function(e,t){var n=createNodeList();if(document._getElementsByTagNameNS)for(var i=document._getElementsByTagNameNS(e,t),s=0;s<i.length;s++)n.push(i[s]);for(var r=0;r<svgweb.handlers.length;r++)if("script"==svgweb.handlers[r].type)for(i=svgweb.handlers[r].document.getElementsByTagNameNS(e,t),s=0;s<i.length;s++)n.push(i[s]);return n},FlashHandler._createElementNS=function(e,t){if(null===e||"http://www.w3.org/1999/xhtml"==e)return isIE?document.createElement(t):document._createElementNS(e,t);var n,i=!1;if(e==svgns&&(e=svgnsFake,i=!0),!isIE){for(var s=0;!i&&s<svgweb.handlers.length;s++)if("script"==svgweb.handlers[s].type&&svgweb.handlers[s].document._namespaces["_"+e]){i=!0;break}if(!i)return document._createElementNS(e,t)}for(s=0;s<svgweb.handlers.length&&("script"!=svgweb.handlers[s].type||!(n=svgweb.handlers[s].document._namespaces["_"+e]));s++);return"xmlns"!=n&&n||(n=null),new _Element(t,n,e)._getProxyNode()},FlashHandler._createElement=function(e,t){if(!t)return document._createElement(e);if(t&&"object"==e.toLowerCase()){var n=document._createElement("object");n._onloadListeners=[];var i=n.addEventListener;return s=i,n.addEventListener=function(e,t,n){"svgload"==e.toLowerCase()?this._onloadListeners.push(t):i?s(e,t,n):this.attachEvent("on"+e,t)},n}var s},FlashHandler._createTextNode=function(e,t){if(t){var n,i=FlashHandler._unattachedDoc;(n=isIE?i.createElement("__text"):i.createElementNS(svgnsFake,"__text")).appendChild(i.createTextNode(e));var s=new _Node("#text",_Node.TEXT_NODE,null,null,n);return s._nodeValue=e,s.ownerDocument=document,s._getProxyNode()}return document._createTextNode(e)},FlashHandler._importNodeFunc=function(e,t,n){switch(t.nodeType){case 1:var i=e.createElement(t.nodeName);if(t.attributes&&t.attributes.length>0)for(var s=0;s<t.attributes.length;s++){var r=t.attributes[s].nodeName,o=t.getAttribute(r);i.setAttribute(r,o)}if(n&&t.childNodes&&t.childNodes.length>0)for(s=0;s<t.childNodes.length;s++)i.appendChild(document._importNodeFunc(e,t.childNodes[s],n));return i;case 3:return e.createTextNode(t.nodeValue)}},FlashHandler._createDocumentFragment=function(e){return e?new _DocumentFragment(document)._getProxyNode():document._createDocumentFragment()},FlashHandler._encodeFlashData=function(e){return e=(e=e.toString().replace(/\\/g,"\\\\")).replace(/&/g,"__SVG__AMPERSAND")},extend(FlashHandler,{flashID:null,flash:null,start:function(){"script"==this.type?this._handleScript():"object"==this.type&&this._handleObject()},_stringToMsg:function(e){if(null==e||"string"!=typeof e)return e;for(var t={},n=e.split(/__SVG__DELIMIT/g),i=0;i<n.length;i++){var s=n[i].indexOf(":"),r=n[i].substring(0,s),o=n[i].substring(s+1);"true"===o?o=!0:"false"===o?o=!1:"null"===o?o=null:"undefined"===o&&(o=void 0),t[r]=o}return t},debugMsg:function(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=[];for(var n in e)t.push(n+":"+e[n]);return"{"+(t=t.join(", "))+"}"},sendToFlash:function(e,t){var n=t.join("__SVG__DELIMIT");if(!this._redrawManager.isSuspended())return this.flash[e](n);this._redrawManager.batch(e,n)},onMessage:function(e){"event"!=(e=this._stringToMsg(e)).type?"log"!=e.type?"script"!=e.type?"viewsource"!=e.type?"viewsourceDynamic"!=e.type?"error"==e.type&&this._onFlashError(e):this._onViewSourceDynamic(e):this._onViewSource():this._onObjectScript(e):this._onLog(e):this._onEvent(e)},fireOnLoad:function(e,t){svgweb._handleDone(e,t,this)},_handleScript:function(){this.document=new _Document(this._xml,this),this.document.documentElement=new _SVGSVGElement(this._xml.documentElement,this._svgString,this._scriptNode,this)},_handleObject:function(){this._svgObject=new _SVGObject(this._objNode,this),this._objNode=null},_onLog:function(e){console.log("FLASH: "+e.logString)},_onEvent:function(e){"mouse"!=e.eventType.substr(0,5)&&"click"!=e.eventType?"onRenderingFinished"!=e.eventType?"onFlashLoaded"!=e.eventType||("script"==this.type?this.document.documentElement._onFlashLoaded(e):"object"==this.type&&this._svgObject._onFlashLoaded(e)):"script"==this.type?this.document.documentElement._onRenderingFinished(e):"object"==this.type&&this._svgObject._onRenderingFinished(e):this._onMouseEvent(e)},_onMouseEvent:function(e){var t=this._getElementByGuid(e.targetGUID),n=this._getElementByGuid(e.currentTargetGUID),i={target:t._getProxyNode(),currentTarget:n._getProxyNode(),type:e.eventType,clientX:new Number(e.stageX),clientY:new Number(e.stageY),screenX:new Number(e.stageX),screenY:new Number(e.stageY),altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,preventDefault:function(){this.returnValue=!1}},s=n._listeners[e.eventType];if(s)for(var r=0;r<s.length;r++){(0,s[r].listener)(i)}if(null!=e.scriptCode&&"object"==this.type){var o='var evt = { target: document.getElementById("'+t._getProxyNode().getAttribute("id")+'") ,\ncurrentTarget:document.getElementById("'+n._getProxyNode().getAttribute("id")+'") ,\ntype: "'+e.eventType+'",\nclientX: '+new Number(e.stageX)+",\nclientY: "+new Number(e.stageY)+",\nscreenX: "+new Number(e.stageX)+",\nscreenY: "+new Number(e.stageY)+",\naltKey: "+e.altKey+",\nctrlKey: "+e.ctrlKey+",\nshiftKey: "+e.shiftKey+",\npreventDefault: function() { this.returnValue=false; }\n};\n",a=";(function (evt) { "+e.scriptCode+"; }).call(evt.target, evt);\n";this.sandbox_eval(this._svgObject._sandboxedScript(o+a))}},_getElementByGuid:function(e){var t,n,i;return(i=svgweb._guidLookup["_"+e])?i:("script"==this.type?t=xpath(this._xml,null,'//*[@__guid="'+e+'"]'):"object"==this.type&&(t=xpath(this._svgObject._xml,null,'//*[@__guid="'+e+'"]')),t.length?(n=t[0],(i=FlashHandler._getNode(n,this))._passThrough=!0,i):null)},_onFlashError:function(e){throw this._onLog(e),svgweb._fireFlashError("FLASH: "+e.logString),new Error("FLASH: "+e.logString)},_onObjectScript:function(e){this._svgObject._scriptsToExec.push(e.script)},_onViewSource:function(){var e=this._origSVG;e||(e="SVG Source Not Available"),e=e.replace(/>/g,"&gt;").replace(/</g,"&lt;");var t=window.open("","_blank");t.document.write("<html><body><pre>"+e+"</pre></body></html>"),t.document.close()},_onViewSourceDynamic:function(e){-1==e.source.indexOf("<?xml")&&(e.source='<?xml version="1.0"?>\n'+e.source),e.source=e.source.replace(/<svg:([^ ]+) /g,"<$1 "),e.source=e.source.replace(/<\/svg:([^>]+)>/g,"</$1>"),e.source=e.source.replace(/\n\s*<__text[^\/]*\/>/gm,""),e.source=e.source.replace(/<__text[^>]*>([^<]*)<\/__text>/gm,"$1"),e.source=e.source.replace(/<__text[^>]*>/g,""),e.source=e.source.replace(/<\/__text>/g,""),e.source=e.source.replace(/\s*__guid="[^"]*"/g,""),e.source=e.source.replace(/ id="__svg__random__[^"]*"/g,""),e.source=e.source.replace(/>\n\n/g,">\n"),e.source=e.source.replace(/>/g,"&gt;"),e.source=e.source.replace(/</g,"&lt;");var t=window.open("","_blank");t.document.write("<body><pre>"+e.source+"</pre></body>"),t.document.close()}}),NativeHandler._patchBrowserObjects=function(e,t){if(!t._getElementById){t._getElementById=t.getElementById,t.getElementById=function(e){var n=t._getElementById(e);if(null!==n)return null===n.parentNode?null:n;if((n=xpath(t,null,'//*[@id="'+e+'"]')).length){var i=n[0];return null!==i.namespaceURI&&i.namespaceURI!=svgns&&"http://www.w3.org/1999/xhtml"!=i.namespaceURI&&svgweb._exportID(i),i}return null},t._getElementsByTagNameNS=t.getElementsByTagNameNS,t.getElementsByTagNameNS=function(e,n){var i,s=t._getElementsByTagNameNS(e,n);if(null!==s&&0!==s.length){if(null!==e&&"http://www.w3.org/1999/xhtml"!=e&&e!=svgns){for(var r=0;r<s.length;r++){var o=s[r];svgweb._exportID(o)}return s}return s}null!==s&&0!==s.length||(s=createNodeList());for(r=0;r<svgweb.handlers.length;r++){var a=svgweb.handlers[r];if("object"!=a.type){var d,h=a._namespaces["_"+e];if(h)if(d="xmlns"==h?"//*[namespace-uri()='"+svgns+"' and name()='"+n+"']":h?"//"+h+":"+n:"//"+n,null!==(i=xpath(t,a._svgRoot,d,a._namespaces))&&void 0!==i&&i.length>0){for(var l=0;l<i.length;l++){null!==(o=i[l]).namespaceURI&&o.namespaceURI!=svgns&&"http://www.w3.org/1999/xhtml"!=o.namespaceURI&&svgweb._exportID(o),s.push(o)}return s}}}return createNodeList()},t._createElementNS=t.createElementNS,t.createElementNS=function(e,n){if(e!=svgns||"svg"!=n)return t._createElementNS(e,n);var i=t._createElementNS(e,n);return i=NativeHandler._patchAddEventListener(i)},t._createElement=t.createElement,t.createElement=function(e,n){if(!n)return t._createElement(e);if(n&&"object"==e){var i=t._createElement(e);return i=NativeHandler._patchAddEventListener(i)}throw"Unknown createElement() call for SVG: "+e},NativeHandler._patchCloneNode(),isFF&&NativeHandler._patchStyleObject(e);var n=t.rootElement;n&&"svg"==n.localName&&n.namespaceURI==svgns&&NativeHandler._patchSvgFileAddEventListener(e,t)}},NativeHandler._patchCloneNode=function(){var e;(e="undefined"!=typeof SVGSVGElement?SVGSVGElement.prototype:document.createElementNS(svgns,"svg").__proto__)._cloneNode||(e._cloneNode=e.cloneNode,e.cloneNode=function(e){var t=this._cloneNode(e);return NativeHandler._patchAddEventListener(t),t})},NativeHandler._patchAddEventListener=function(e){return NativeHandler._objectAddEventListener||(NativeHandler._objectAddEventListener=e.addEventListener),e._addEventListener=NativeHandler._objectAddEventListener,e._onloadListeners=[],e.addEventListener=function(t,n,i){"svgload"==t.toLowerCase()?this._onloadListeners.push(n):e._addEventListener(t,n,i)},e},NativeHandler._patchStyleObject=function(e){for(var t=e.CSSStyleDeclaration,n=0;n<_Style._allStyles.length;n++){var i=_Style._allStyles[n];!function(e,n){t.prototype.__defineSetter__(e,function(e){return this.setProperty(n,e,null)}),t.prototype.__defineGetter__(e,function(){return this.getPropertyValue(n)})}(i,i.replace(/([A-Z])/g,"-$1").toLowerCase())}},NativeHandler._patchSvgFileAddEventListener=function(e,t){var n=e.addEventListener;e.addEventListener=function(e,i,s){"svgload"!=e.toLowerCase()?n(e,i,s):"complete"==t.readyState&&i()},e.__defineGetter__("onsvgload",function(){return this.__onsvgload}),e.__defineSetter__("onsvgload",function(e){this.__onsvgload=e,this.addEventListener("SVGLoad",e,!1)})},extend(NativeHandler,{start:function(){"object"==this.type?this._handleObject():"script"==this.type&&this._handleScript()},_handleScript:function(){this._namespaces=this._getNamespaces(),this._processSVGScript(this._xml,this._svgString,this._scriptNode),this._loaded=!0,svgweb._handleDone(this.id,"script",this)},_handleObject:function(){if(this._objNode.style.overflow="hidden",this._objNode.style.visibility="visible",this._objNode._svgWindow)this._onObjectLoad(this._objNode._svgFunc,this._objNode._svgWindow);else{this._objNode._svgHandler=this;var e=this,t=function(){if(e._objNode.contentDocument){var t=e._objNode.contentDocument.defaultView;e._onObjectLoad(e._objNode._svgFunc,t)}};this._objNode._addEventListener?this._objNode._addEventListener("load",t,!1):this._objNode.addEventListener("load",t,!1)}},_onObjectLoad:function(e,t){if(!this._loaded){this._loaded=!0;var n=t.document;NativeHandler._patchBrowserObjects(t,n);var i=n.rootElement;i&&this._patchCurrentTranslate(i),t.svgns=svgns,t.xlinkns=xlinkns,this._namespaces=this._getNamespaces(n),e&&e.apply(t);for(var s=0;this._objNode._onloadListeners&&s<this._objNode._onloadListeners.length;s++)(e=this._objNode._onloadListeners[s]).apply(this._objNode);svgweb._fireOnLoad()}},_processSVGScript:function(e,t,n){var i=document.importNode(e.documentElement,!0);n.parentNode.replaceChild(i,n),this._svgRoot=i,this._patchCurrentTranslate(this._svgRoot)},_getNamespaces:function(e){var t,n=[];t=e?e.documentElement.attributes:this._xml.documentElement.attributes;for(var i=0;i<t.length;i++){var s=t[i];if(/^xmlns:?(.*)$/.test(s.nodeName)){var r=s.nodeName.match(/^xmlns:?(.*)$/),o=r[1]?r[1]:"xmlns",a=s.nodeValue;n["_"+o]||(n["_"+o]=a,n["_"+a]=o,n.push(a))}}return n},_patchCurrentTranslate:function(e){var t;"undefined"!=typeof SVGRoot?t=e.currentTranslate:void 0!==e.currentTranslate.__proto__?t=e.currentTranslate.__proto__:"undefined"!=typeof SVGPoint&&(t=SVGPoint.prototype),t.setX=function(e){return this.x=e},t.getX=function(){return this.x},t.setY=function(e){return this.y=e},t.getY=function(){return this.y},t.setXY=function(e,t){this.x=e,this.y=t}}}),extend(_RedrawManager,{isSuspended:function(){return this._ids.length>0},batch:function(e,t){this._batch.push(e+":"+t)},suspendRedraw:function(e){if(void 0===e)throw"Not enough arguments to suspendRedraw";var t=this._nextID;this._nextID++;var n=this,i=window.setTimeout(function(){n.unsuspendRedraw(t),delete n._timeoutIDs["_"+t]},e);return this._ids.push(t),this._timeoutIDs["_"+t]=i,this._handler.flash.jsSuspendRedraw(),t},unsuspendRedraw:function(e){for(var t=-1,n=0;n<this._ids.length;n++)if(this._ids[n]==e){t=n;break}if(-1==t)throw"Unknown id passed to unsuspendRedraw: "+e;if(void 0!=this._timeoutIDs["_"+e]&&window.clearTimeout(this._timeoutIDs["_"+e]),this._ids.splice(t,1),delete this._timeoutIDs["_"+e],!this.isSuspended()){var i=this._batch.join("__SVG__METHOD__DELIMIT");this._batch=[];try{this._handler.flash.jsUnsuspendRedrawAll(i)}catch(e){console.log("unsuspendRedraw exception: "+e)}}},unsuspendRedrawAll:function(){for(var e=0;e<this._ids.length;e++)this.unsuspendRedraw(this._ids[e])},forceRedraw:function(){}}),extend(_DOMImplementation,{hasFeature:function(e,t){}}),mixin(_Node,{ELEMENT_NODE:1,TEXT_NODE:3,DOCUMENT_NODE:9,DOCUMENT_FRAGMENT_NODE:11}),extend(_Node,{_listeners:null,_detachedListeners:null,insertBefore:function(e,t){if(this.nodeType!=_Node.ELEMENT_NODE&&this.nodeType!=_Node.DOCUMENT_FRAGMENT_NODE)throw"Not supported";e.parentNode&&e.parentNode.removeChild(e),e=this._getFakeNode(e),t=this._getFakeNode(t);var n,i=e.nodeType==_Node.DOCUMENT_FRAGMENT_NODE;if(i&&(n=e._getChildNodes(!0)),i&&0==n.length)return e._reset(),e._getProxyNode();var s=this._findChild(t);if(null===s)throw new Error("Invalid child passed to insertBefore");var r=s.position,o=[];if(i)for(var a=0;a<n.length;a++)o.push(n[a]);else o.push(e);for(a=0;a<o.length;a++){var d=this._importNode(o[a],!1);this._nodeXML.insertBefore(d,t._nodeXML),this._processAppendedChildren(o[a],this,this._attached,this._passThrough)}if(this._attached&&this._passThrough){var h=FlashHandler._encodeFlashData(xmlToStr(e,this._handler.document._namespaces));this._handler.sendToFlash("jsInsertBefore",[t._guid,this._guid,r,h])}if(!isIE)for(a=0;a<o.length;a++)this._defineChildNodeAccessor(this._childNodes.length),this._childNodes.length++;return e.nodeType==_Node.DOCUMENT_FRAGMENT_NODE&&e._reset(),e._getProxyNode()},replaceChild:function(e,t){if(this.nodeType!=_Node.ELEMENT_NODE&&this.nodeType!=_Node.DOCUMENT_FRAGMENT_NODE)throw"Not supported";e.parentNode&&e.parentNode.removeChild(e),e=this._getFakeNode(e),t=this._getFakeNode(t);var n,i=e.nodeType==_Node.DOCUMENT_FRAGMENT_NODE;if(i&&(n=e._getChildNodes(!0)),i&&0==n.length)return e._reset(),e._getProxyNode();var s=this._findChild(t);if(null===s)throw new Error("Invalid child passed to replaceChild");var r=s.position;this.removeChild(t);var o=[];if(i)for(var a=0;a<n.length;a++)o.push(n[a]);else o.push(e);if(!isIE)for(a=0;a<o.length;a++)this._defineChildNodeAccessor(this._childNodes.length),this._childNodes.length++;var d=!1;r>=this._nodeXML.childNodes.length&&(d=!0);var h=r;for(a=0;a<o.length;a++){var l=this._importNode(o[a],!1);if(d)this._nodeXML.appendChild(l);else{var _=this._nodeXML.childNodes[h];this._nodeXML.insertBefore(l,_),h++}}if(this._attached&&this._passThrough){var u=FlashHandler._encodeFlashData(xmlToStr(e,this._handler.document._namespaces));this._handler.sendToFlash("jsAddChildAt",[this._guid,r,u])}return this._processAppendedChildren(e,this,this._attached,this._passThrough),t._setUnattached(),svgweb._removedNodes.push(t._getProxyNode()),e.nodeType==_Node.DOCUMENT_FRAGMENT_NODE&&e._reset(),t._getProxyNode()},removeChild:function(e){if(this.nodeType!=_Node.ELEMENT_NODE&&this.nodeType!=_Node.DOCUMENT_FRAGMENT_NODE)throw"Not supported";if(e.nodeType!=_Node.ELEMENT_NODE&&e.nodeType!=_Node.TEXT_NODE)throw"Not supported";e=this._getFakeNode(e);var t=this._findChild(e);if(null===t)throw new Error("Invalid child passed to removeChild");var n=t.position;if(this._nodeXML.removeChild(t.nodeXML),e.nodeType==_Node.ELEMENT_NODE){var i=e._getId();i&&this._attached&&(this._handler.document._nodeById["_"+i]=void 0)}return e._persistEventListeners(),isIE?this._childNodes.splice(n,1):(delete this._childNodes[this._childNodes.length-1],this._childNodes.length--),this._attached&&this._passThrough&&this._handler.sendToFlash("jsRemoveChild",[e._guid]),e._setUnattached(),svgweb._removedNodes.push(e._getProxyNode()),e._getProxyNode()},appendChild:function(e){if(this.nodeType!=_Node.ELEMENT_NODE&&this.nodeType!=_Node.DOCUMENT_FRAGMENT_NODE)throw"Not supported";e.parentNode&&e.parentNode.removeChild(e);var t,n=(e=this._getFakeNode(e)).nodeType==_Node.DOCUMENT_FRAGMENT_NODE;if(n&&(t=e._getChildNodes(!0)),n&&0==t.length)return e._reset(),e._getProxyNode();if(n)for(var i=0;i<t.length;i++)this._importNode(t[i]);else this._importNode(e);if(isIE)if(n)for(i=0;i<t.length;i++)this._childNodes.push(t[i]._htcNode);else this._childNodes.push(e._htcNode);else if(n)for(i=0;i<t.length;i++)this._defineChildNodeAccessor(this._childNodes.length),this._childNodes.length++;else this._defineChildNodeAccessor(this._childNodes.length),this._childNodes.length++;if(this._attached&&this._passThrough){var s=FlashHandler._encodeFlashData(xmlToStr(e,this._handler.document._namespaces));this._handler.sendToFlash("jsAppendChild",[this._guid,s])}return this._processAppendedChildren(e,this,this._attached,this._passThrough),e.nodeType==_Node.DOCUMENT_FRAGMENT_NODE&&e._reset(),e._getProxyNode()},hasChildNodes:function(){return this._getChildNodes().length>0},isSupported:function(e,t){return"2.0"==t&&("Core"==e||("Events"==e||"UIEvents"==e||"MouseEvents"==e||void 0))},hasAttributes:function(){if(this.nodeType==_Node.ELEMENT_NODE){for(var e in this._attributes)if(!/^_xmlns/i.test(e)&&("_id"!=e||!/^__svg__random__/.test(this._attributes[e]))&&("___guid"!=e||!/^__guid/.test(this._attributes[e]))&&("___fakeTextNode"!=e||!/^__fakeTextNode/.test(this._attributes[e]))&&/^_.*/.test(e)&&this._attributes.hasOwnProperty(e))return!0;return!1}return!1},addEventListener:function(e,t,n,i){if(this.nodeType!=_Node.ELEMENT_NODE&&this.nodeType!=_Node.TEXT_NODE)throw"Not supported";if(i||this._attached){if(void 0===this._listeners[e]&&(this._listeners[e]=[]),this._listeners[e].push({type:e,listener:t,useCapture:n}),this._listeners[e]["_"+t.toString()+":"+n]=t,"keydown"==e){var s=function(e){return function(t){t.preventDefault||(t.preventDefault=function(){this.returnValue=!1,t=null}),e(t)}}(t);return s.__type=e,s.__listener=t,s.__useCapture=n,this._handler._keyboardListeners.push(s),void this._addEvent(document,e,s)}this._handler.sendToFlash("jsAddEventListener",[this._guid,e])}else this._detachedListeners.push({type:e,listener:t,useCapture:n})},removeEventListener:function(e,t,n){if(this.nodeType!=_Node.ELEMENT_NODE&&this.nodeType!=_Node.TEXT_NODE)throw"Not supported";var i;this._attached?(null!==(i=this._findListener(this._listeners,e,t,n))&&(delete this._listeners[i],delete this._listeners[e]["_"+t.toString()+":"+n]),"keydown"==e&&null!==(i=this._findListener(this._keyboardListeners,e,t,n))&&delete this._keyboardListeners[i],this._handler.sendToFlash("jsRemoveEventListener",[this._guid,e])):null!==(i=this._findListener(this._detachedListeners,e,t,n))&&delete this._detachedListeners[i]},getScreenCTM:function(){var e=this._handler.sendToFlash("jsGetScreenCTM",[this._guid]);return e=this._handler._stringToMsg(e),new _SVGMatrix(new Number(e.a),new Number(e.b),new Number(e.c),new Number(e.d),new Number(e.e),new Number(e.f),this._handler)},getCTM:function(){return this.getScreenCTM()},cloneNode:function(e){var t;if(this.nodeType==_Node.ELEMENT_NODE&&this.namespaceURI!=svgns)t=new _Element(this.nodeName,this.prefix,this.namespaceURI);else if(this.nodeType==_Node.ELEMENT_NODE)t=document.createElementNS(this.namespaceURI,this.nodeName);else if(this.nodeType==_Node.TEXT_NODE)t=document.createTextNode(this._nodeValue,!0);else{if(this.nodeType!=_Node.DOCUMENT_FRAGMENT_NODE)throw"cloneNode not supported for nodeType: "+this.nodeType;t=document.createDocumentFragment(!0)}t=this._getFakeNode(t);for(var n=this._nodeXML.attributes,i=0;i<n.length;i++){var s=n.item(i),r=(s.name.match(/([^:]+):?(.*)/),s.namespaceURI);if(isSafari&&-1!=s.name.indexOf("xmlns"))t._nodeXML.setAttribute(s.name,s.nodeValue);else{var o,a=t._nodeXML.ownerDocument;(o=isIE?a.createNode(2,s.name,r):a.createAttributeNS(r,s.name)).nodeValue=s.nodeValue,isIE?t._nodeXML.setAttributeNode(o):t._nodeXML.setAttributeNodeNS(o)}}if(t._nodeXML.setAttribute("__guid",t._guid),isIE){var d=this._htcNode.style;for(i=0;i<d.length;i++){var h=d.item(i),l=d.getPropertyValue(h);t._htcNode.style.length++,t.style.length++,t.style._ignoreStyleChanges=!0,t._htcNode.style[h]=l,t.style._ignoreStyleChanges=!1}}if(t.nodeType==_Node.ELEMENT_NODE&&t._importAttributes(t,t._nodeXML),e&&(t.nodeType==_Node.ELEMENT_NODE||t.nodeType==_Node.DOCUMENT_FRAGMENT_NODE)){var _=this._getChildNodes();for(i=0;i<_.length;i++){var u=_[i].cloneNode(!0);t.appendChild(u)}}return t.ownerDocument=this.ownerDocument,t._getProxyNode()},toString:function(){return this.namespaceURI==svgns?"[_SVG"+this.localName.charAt(0).toUpperCase()+this.localName.substring(1)+"]":this.prefix?"["+this.prefix+":"+this.localName+"]":this.localName?"["+this.localName+"]":"["+this.nodeName+"]"},_addEvent:function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&(e["e"+t+n]=n,e[t+n]=function(e,t,n){return function(){e["e"+t+n](window.event)}}(e,t,n),e.attachEvent("on"+t,e[t+n]))},nodeName:null,nodeType:null,ownerDocument:null,namespaceURI:null,localName:null,prefix:null,_getParentNode:function(){if(this.nodeType==_Node.DOCUMENT_NODE||this.nodeType==_Node.DOCUMENT_FRAGMENT_NODE)return null;if("svg"==this.nodeName&&"script"==this._handler.type)return this._handler.flash.parentNode;if("svg"==this.nodeName&&"object"==this._handler.type)return this._handler.document;var e=this._nodeXML.parentNode;return null===e||e.nodeType==_Node.DOCUMENT_NODE?null:FlashHandler._getNode(e,this._handler)},_getFirstChild:function(){if(this.nodeType==_Node.TEXT_NODE)return null;var e=this._nodeXML.firstChild;if(null===e)return null;var t=FlashHandler._getNode(e,this._handler);return this._getFakeNode(t)._passThrough=this._passThrough,t},_getLastChild:function(){if(this.nodeType==_Node.TEXT_NODE)return null;var e=this._nodeXML.lastChild;if(null===e)return null;var t=FlashHandler._getNode(e,this._handler);return this._getFakeNode(t)._passThrough=this._passThrough,t},_getPreviousSibling:function(){if(this.nodeType==_Node.DOCUMENT_NODE||this.nodeType==_Node.DOCUMENT_FRAGMENT_NODE)return null;if("svg"==this.nodeName&&"script"==this._handler.type){var e=this._handler.flash.previousSibling;if(e&&1==e.nodeType&&e.className&&-1!=e.className.indexOf("embedssvg")){var t=e.getAttribute("id").replace("_flash","");return(i=svgweb.handlers[t].document.documentElement)._getProxyNode()}return e}var n=this._nodeXML.previousSibling;if(null===n||7==n.nodeType)return null;var i=FlashHandler._getNode(n,this._handler);return this._getFakeNode(i)._passThrough=this._passThrough,i},_getNextSibling:function(){if(this.nodeType==_Node.DOCUMENT_NODE||this.nodeType==_Node.DOCUMENT_FRAGMENT_NODE)return null;if("svg"==this.nodeName&&"script"==this._handler.type){var e=this._handler.flash.nextSibling;if(e&&1==e.nodeType&&e.className&&-1!=e.className.indexOf("embedssvg")){var t=e.getAttribute("id").replace("_flash","");return(i=this._handler.document._nodeById["_"+t])._getProxyNode()}return e}var n=this._nodeXML.nextSibling;if(null===n)return null;var i=FlashHandler._getNode(n,this._handler);return this._getFakeNode(i)._passThrough=this._passThrough,i},_passThrough:!1,_attached:!0,_fake:!0,_defineNodeAccessors:function(){var e;if(this.__defineGetter__("parentNode",hitch(this,this._getParentNode)),this.__defineGetter__("firstChild",hitch(this,this._getFirstChild)),this.__defineGetter__("lastChild",hitch(this,this._getLastChild)),this.__defineGetter__("previousSibling",hitch(this,this._getPreviousSibling)),this.__defineGetter__("nextSibling",hitch(this,this._getNextSibling)),this.__defineGetter__("childNodes",(e=this,function(){return e._childNodes})),"#text"==this.nodeName)this._childNodes.length=0;else{var t=this._nodeXML.childNodes;this._childNodes.length=t.length;for(var n=0;n<t.length;n++)this._defineChildNodeAccessor(n)}this.nodeType==_Node.TEXT_NODE?(this.__defineGetter__("data",function(e){return function(){return e._nodeValue}}(this)),this.__defineSetter__("data",function(e){return function(t){return e._setNodeValue(t)}}(this)),this.__defineGetter__("textContent",function(e){return function(){return e._nodeValue}}(this)),this.__defineSetter__("textContent",function(e){return function(t){return e._setNodeValue(t)}}(this))):this.__defineGetter__("textContent",function(){return""}),this.__defineGetter__("nodeValue",function(e){return function(){return e._nodeValue}}(this)),this.__defineSetter__("nodeValue",function(e){return function(t){return e._setNodeValue(t)}}(this))},_defineChildNodeAccessor:function(e){var t=this;this._childNodes.__defineGetter__(e,function(){var n=t._nodeXML.childNodes[e],i=FlashHandler._getNode(n,t._handler);return i._passThrough=t._passThrough,i})},_getChildNodes:function(e){if(!isIE)return this._childNodes;void 0===e&&(e=!1);var t=createNodeList();if("#text"==this.nodeName)return t;if(this._nodeXML.childNodes.length!=this._childNodes.length||e){for(var n=0;n<this._nodeXML.childNodes.length;n++){var i=this._nodeXML.childNodes[n],s=FlashHandler._getNode(i,this._handler);s._fakeNode._passThrough=this._passThrough,e&&(s=s._fakeNode),t.push(s)}return this._childNodes=t,t}return this._childNodes},_createHTC:function(){if(!this._htcContainer&&(this._htcContainer=document.getElementById("__htc_container"),!this._htcContainer)){var e=document.getElementsByTagName("body")[0],t=document.createElement("div");t.id="__htc_container",t.style.position="absolute",t.style.top="-5000px",t.style.left="-5000px",e.appendChild(t),this._htcContainer=t}var n=document.createElement("svg:"+this.nodeName);n._fakeNode=this,n._handler=this._handler,this._htcContainer.appendChild(n),this._htcNode=n},_setNodeValue:function(e){if(this.nodeType!=_Node.TEXT_NODE)return e;if(this._nodeValue=e,this._nodeXML.firstChild.nodeValue=e,this._attached&&this._passThrough){var t=FlashHandler._encodeFlashData(e),n=this._nodeXML.parentNode.getAttribute("__guid");this._handler.sendToFlash("jsSetText",[n,this._guid,t])}return e},_getFakeNode:function(e){return e||(e=this),isIE&&e._fakeNode&&(e=e._fakeNode),e},_processAppendedChildren:function(e,t,n,i){var s,r;for(e.nodeType==_Node.DOCUMENT_FRAGMENT_NODE?(s=this._getFakeNode(e._getFirstChild()),n&&i&&(r=this._handler._redrawManager.suspendRedraw(1e4))):s=e;s;){var o=s._nodeXML;s._handler=this._handler;var a=o.getAttribute("id");if(n&&s.nodeType==_Node.ELEMENT_NODE&&a&&(this._handler.document._nodeById["_"+a]=s),n&&("script"==this._handler.type?s.ownerDocument=document:"object"==this._handler.type&&(s.ownerDocument=this._handler.document)),n){for(var d=0;d<s._detachedListeners.length;d++){var h=s._detachedListeners[d];s.addEventListener(h.type,h.listener,h.useCapture,!0)}s._detachedListeners=[]}var l=s,_=s._getChildNodes(),u=_&&_.length>0?_[0]:null;for(u&&(s=u,isIE&&(s=s._fakeNode));!u&&s;){if(s!=e&&(u=s._getNextSibling())){s=u,isIE&&(s=s._fakeNode);break}s==e?s=null:((s=s._getParentNode())&&isIE&&(s=s._fakeNode),!s||1==s.nodeType&&"SVG"!=s.nodeName.toUpperCase()||(s=null))}l._attached=n,l._passThrough=i}e.nodeType==_Node.DOCUMENT_FRAGMENT_NODE&&n&&i&&this._handler._redrawManager.unsuspendRedraw(r)},_importNode:function(e,t){var n,i;return void 0===t&&(t=!0),i=void 0===(n=this._attached?this._handler.document._xml:this._nodeXML.ownerDocument).importNode?document._importNodeFunc(n,e._nodeXML,!0):n.importNode(e._nodeXML,!0),t&&this._nodeXML.appendChild(i),e._importChildXML(i),i},_importChildXML:function(e){this._nodeXML=e;for(var t=this._getChildNodes(),n=0;n<t.length;n++){var i=t[n];isIE&&i._fakeNode&&(i=i._fakeNode),i._nodeXML=this._nodeXML.childNodes[n],i._importChildXML(this._nodeXML.childNodes[n])}},_findChild:function(e,t){void 0===t&&(t=!1);for(var n={},i=0,s=0;s<this._nodeXML.childNodes.length;s++){var r=this._nodeXML.childNodes[s];if((r.nodeType==_Node.ELEMENT_NODE||r.nodeType==_Node.TEXT_NODE)&&((!t||!r.getAttribute("__fakeTextNode")&&r.nodeType!=_Node.TEXT_NODE)&&(r.nodeType==_Node.ELEMENT_NODE&&i++,r.nodeType==_Node.ELEMENT_NODE&&r.getAttribute("__guid")==e._guid)))return n.position=t?i:s,n.nodeXML=r,n}return null},_setUnattached:function(){for(var e=this._getChildNodes(),t=0;t<e.length;t++){var n=e[t];isIE&&(n=n._fakeNode),n._setUnattached()}this._attached=!1,this._passThrough=!1,this._handler=null},_getProxyNode:function(){return isIE?this._htcNode:this},_createChildNodes:function(){var e;return isIE?e=createNodeList():(e={}).item=function(e){return e>=this.length?null:this[e]},e},_getTextContent:function(){return this.nodeType==_Node.TEXT_NODE?this._nodeValue:""},_setTextContent:function(e){return this.nodeType==_Node.TEXT_NODE?this._setNodeValue(e):""},_getData:function(){return this.nodeType==_Node.TEXT_NODE?this._nodeValue:void 0},_setData:function(e){return this.nodeType==_Node.TEXT_NODE?this._setNodeValue(e):void 0},_createEmptyMethods:function(){this.nodeType==_Node.TEXT_NODE&&(this.getAttribute=this.getAttributeNS=this.setAttribute=this.setAttributeNS=this.removeAttribute=this.removeAttributeNS=this.hasAttribute=this.hasAttributeNS=this.getElementsByTagNameNS=this._getId=this._setId=this._getX=this._getY=this._getWidth=this._getHeight=this._getCurrentScale=this._setCurrentScale=this._getCurrentTranslate=this.createSVGRect=this.createSVGPoint=function(){})},_persistEventListeners:function(){for(var e in this._listeners)for(var t=0;t<this._listeners[e].length;t++){var n=this._listeners[e][t];this._detachedListeners.push({type:n.type,listener:n.listener,useCapture:n.useCapture})}this._listeners=[];var i=this._getChildNodes();for(t=0;t<i.length;t++){var s=i[t];s._fakeNode&&(s=s._fakeNode),s._persistEventListeners()}},_findListener:function(e,t,n,i){for(var s=0;s<e.length;s++){var r=e[s];if(r.listener==n&&r.type==t&&r.useCapture==i)return s}return null}}),_Element.prototype=new _Node,extend(_Element,{getAttribute:function(e){return this.getAttributeNS(null,e,!0)},getAttributeNS:function(e,t,n){var i;if(null==e&&"__guid"==t)return null;if(this._attached&&this._passThrough&&!this._handler._redrawManager.isSuspended())i=this._handler.sendToFlash("jsGetAttribute",[this._guid,!1,!1,e,t,!0]);else if(isIE){if(isIE)if(e)for(var s=0;s<this._nodeXML.attributes.length;s++){var r=this._nodeXML.attributes.item(s),o=new String(r.name).match(/[^:]*:?(.*)/)[1];if(r.namespaceURI&&r.namespaceURI==e&&o==t){i=r.nodeValue;break}}else i=this._nodeXML.getAttribute(t)}else i=this._nodeXML.getAttributeNS(e,t);return"null"!=e||"id"!=t||i?void 0===i||null===i||/^[ ]*$/.test(i)?n?null:"":i:""},removeAttribute:function(e){this.removeAttributeNS(null,e)},removeAttributeNS:function(e,t){if("id"==t&&this._attached&&this.namespaceURI==svgns){var n=this._handler.document,i=this._nodeXML.getAttribute("id");n._nodeById["_"+i]=void 0}var s;if(e)for(var r=0;r<this._nodeXML.attributes.length;r++){var o,a,d=this._nodeXML.attributes.item(r),h=new String(d.name).match(/([^:]+:)?(.*)/);if(-1!=d.name.indexOf(":")?(o=h[1],a=h[2]):a=h[1],d.namespaceURI&&d.namespaceURI==e&&a==t){s=d;break}}else s=this._nodeXML.getAttributeNode(t);if(s){this._nodeXML.removeAttributeNode(s);var l=t;e&&(l=o+":"+t),this._attributes["_"+l]=void 0,this._attached&&this._passThrough&&this._handler.sendToFlash("jsRemoveAttribute",[this._guid,e,t])}else console.log("No attribute node found for: "+t+" in the namespace: "+e)},setAttribute:function(e,t){this.setAttributeNS(null,e,t)},setAttributeNS:function(e,t,n){null!==n&&void 0!==n||(n="");var i=t;if(-1!=t.indexOf(":")&&(i=t.split(":")[1]),this._attached&&"id"==t){var s=this._handler.document,r=this._nodeXML.getAttribute("id");s._nodeById["_"+r]=void 0,(0===r||r)&&(s._nodeById["_"+n]=this)}if(isSafari&&"style"==i&&null!==this._nodeXML.parentNode&&"clipPath"==this._nodeXML.parentNode.nodeName){var o=this._nodeXML.nextSibling,a=this._nodeXML.parentNode;this._nodeXML.parentNode.removeChild(this._nodeXML),this._nodeXML.setAttribute("style",n),o?a.insertBefore(this._nodeXML,o):a.appendChild(this._nodeXML)}else if(e&&isIE){var d=this._nodeXML.ownerDocument.createNode(2,t,e);d.nodeValue=n,this._nodeXML.setAttributeNode(d)}else isIE?this._nodeXML.setAttribute(t,n):this._nodeXML.setAttributeNS(e,t,n);if(this._attributes["_"+t]=n,this._attached&&this._passThrough){var h=FlashHandler._encodeFlashData(n);this._handler.sendToFlash("jsSetAttribute",[this._guid,!1,e,i,h])}},hasAttribute:function(e){return this.hasAttributeNS(null,e)},hasAttributeNS:function(e,t){if(e||isIE){if(isIE){for(var n=null,i=0;i<this._nodeXML.attributes.length;i++){var s=this._nodeXML.attributes.item(i),r=new String(s.name).match(/(?:[^:]+:)?(.*)/)[1],o=s.namespaceURI;if(""==o&&(o=null),e==o&&r==t){n=s;break}}return null!=n}return this._nodeXML.hasAttributeNS(e,t)}return this._nodeXML.hasAttribute(t)},getElementsByTagNameNS:function(e,t){var n,i=createNodeList();if(""==e&&(e=null),e==svgns&&(e=svgnsFake),this._nodeXML.getElementsByTagNameNS)i=this._nodeXML.getElementsByTagNameNS(e,t);else{var s=null;this._attached&&(s=this._handler.document._namespaces);var r;if(e&&"*"!=e&&s&&void 0===s["_"+e])return createNodeList();if(r="*"==e&&"*"==t?"//*[ancestor::*[@__guid = '"+this._guid+"']]":"*"==e?"//*[namespace-uri()='*' and local-name()='"+t+"' and ancestor::*[@__guid = '"+this._guid+"']]":"*"==t?"//*[namespace-uri()='"+e+"' and ancestor::*[@__guid = '"+this._guid+"']]":"//"+t+"[ancestor::*[@__guid = '"+this._guid+"']]| //*[namespace-uri()='"+e+"' and local-name()='"+t+"' and ancestor::*[@__guid = '"+this._guid+"']]",null!==(n=xpath(this._nodeXML.ownerDocument,this._nodeXML,r,s))&&void 0!==n&&n.length>0)for(var o=0;o<n.length;o++)n[o]!==this._nodeXML&&i.push(n[o])}if("*"==e&&"*"==t){var a=[];for(o=0;o<i.length;o++)i[o].nodeType==_Node.ELEMENT_NODE&&"__text"!=i[o].nodeName&&a.push(i[o]);i=a}var d=createNodeList();for(o=0;o<i.length;o++){var h=FlashHandler._getNode(i[o],this._handler);h._passThrough=!0,d.push(h)}return d},style:null,_setClassName:function(e){},_getClassName:function(){},_setTransform:function(e){},_getTransform:function(){},_getViewBox:function(){},_getId:function(){return this._attributes._id?this._attributes._id:""},_setId:function(e){return this.setAttribute("id",e)},ownerSVGElement:null,_getX:function(){var e=this._trimMeasurement(this.getAttribute("x"));return new _SVGAnimatedLength(new _SVGLength(new Number(e)))},_getY:function(){var e=this._trimMeasurement(this.getAttribute("y"));return new _SVGAnimatedLength(new _SVGLength(new Number(e)))},_getWidth:function(){var e=this._trimMeasurement(this.getAttribute("width"));return new _SVGAnimatedLength(new _SVGLength(new Number(e)))},_getHeight:function(){var e=this._trimMeasurement(this.getAttribute("height"));return new _SVGAnimatedLength(new _SVGLength(new Number(e)))},_getCurrentScale:function(){return this._currentScale},_setCurrentScale:function(e){return e!==this._currentScale&&(this._currentScale=e,this._handler.sendToFlash("jsSetCurrentScale",[e])),e},_getCurrentTranslate:function(){return this._currentTranslate},createSVGPoint:function(){return new _SVGPoint(0,0)},createSVGRect:function(){return new _SVGRect(0,0,0,0)},_trimMeasurement:function(e){return null!==e&&(e=e.replace(/[a-z]/gi,"")),e},_getInnerHTML:function(){},_setInnerHTML:function(e){},_allEvents:["onfocusin","onfocusout","onactivate","onclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onload","onunload","onabort","onerror","onresize","onscroll","onzoom","onbegin","onend","onrepeat"],_handleEvent:function(e){},_prepareEvents:function(){},_attributes:null,_importAttributes:function(e,t){for(var n=0;n<t.attributes.length;n++){var i=t.attributes[n];this._attributes["_"+i.nodeName]=i.nodeValue}},_defineAccessors:function(){var e=this;"svg"!=this.nodeName&&"use"!=this.nodeName||(this.__defineGetter__("x",function(){return e._getX()}),this.__defineGetter__("y",function(){return e._getY()}),this.__defineGetter__("width",function(){return e._getWidth()}),this.__defineGetter__("height",function(){return e._getHeight()})),"svg"==this.nodeName&&(this.__defineGetter__("currentTranslate",function(){return e._getCurrentTranslate()}),this.__defineGetter__("currentScale",function(){return e._getCurrentScale()}),this.__defineSetter__("currentScale",function(t){return e._setCurrentScale(t)})),this.__defineGetter__("id",hitch(this,this._getId)),this.__defineSetter__("id",hitch(this,this._setId))},_defineAccessor:function(e,t){var n=this;if(this.__defineGetter__(e,function(){return n.getAttribute(e)}),t){this.__defineSetter__(e,function(t){return n.setAttribute(e,t)})}}}),_DocumentFragment.prototype=new _Node,extend(_DocumentFragment,{_reset:function(){for(;this._nodeXML.firstChild;)this._nodeXML.removeChild(this._nodeXML.firstChild);this._childNodes=this._createChildNodes(),isIE||this._defineNodeAccessors()}}),_Style._allStyles=["font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","direction","letterSpacing","textDecoration","unicodeBidi","wordSpacing","clip","color","cursor","display","overflow","visibility","clipPath","clipRule","mask","opacity","enableBackground","filter","floodColor","floodOpacity","lightingColor","stopColor","stopOpacity","pointerEvents","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","fill","fillOpacity","fillRule","imageRendering","marker","markerEnd","markerMid","markerStart","shapeRendering","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","textRendering","alignmentBaseline","baselineShift","dominantBaseline","glyphOrientationHorizontal","glyphOrientationVertical","kerning","textAnchor","writingMode"],_Style._allRootStyles=["border","verticalAlign","backgroundColor","top","right","bottom","left","position","width","height","margin","marginTop","marginBottom","marginRight","marginLeft","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","zIndex","overflowX","overflowY","float","clear"],extend(_Style,{_ignoreStyleChanges:!0,_setup:function(){if(this._normalizeStyle(),isIE){var e=this._element._htcNode.style,t=this._fromStyleString();for(i=0;i<t.length;i++){s=this._toCamelCase(t[i].styleName);var n=t[i].styleValue;e[s]=n}e.length=0,this.length=0,e.item=hitch(this,this.item),e.setProperty=hitch(this,this.setProperty),e.getPropertyValue=hitch(this,this.getPropertyValue),this._changeListener=hitch(this,this._onPropertyChange),this._element._htcNode.attachEvent("onpropertychange",this._changeListener)}else{for(var i=0;i<_Style._allStyles.length;i++){var s=_Style._allStyles[i];this._defineAccessor(s)}if("svg"==this._element.nodeName)for(var i=0;i<_Style._allRootStyles.length;i++){var s=_Style._allRootStyles[i];this._defineAccessor(s)}this.__defineGetter__("length",hitch(this,this._getLength))}},_defineAccessor:function(e){var t=this;this.__defineGetter__(e,function(){return t._getStyleAttribute(e)}),this.__defineSetter__(e,function(n){return t._setStyleAttribute(e,n)})},_setStyleAttribute:function(e,t){for(var n=this._fromCamelCase(e),i=this._fromStyleString(),s=!1,r=0;r<i.length;r++)if(i[r].styleName===n){i[r].styleValue=t,s=!0;break}s||i.push({styleName:n,styleValue:t});var o=this._toStyleString(i);if(this._element._nodeXML.setAttribute("style",o),this._element._attributes._style=o,isIE){var a=this._element._htcNode.style;s||(a.length++,this.length++),this._ignoreStyleChanges=!0,a[e]=t,this._ignoreStyleChanges=!1}if(this._element._attached&&this._element._passThrough){var d=FlashHandler._encodeFlashData(t);this._element._handler.sendToFlash("jsSetAttribute",[this._element._guid,!0,null,n,d])}},_getStyleAttribute:function(e){var t=this._fromCamelCase(e);if(this._element._attached&&this._element._passThrough&&!this._element._handler._redrawManager.isSuspended())return this._element._handler.sendToFlash("jsGetAttribute",[this._element._guid,!0,!1,null,t,!1]);for(var n=this._fromStyleString(),i=0;i<n.length;i++)if(n[i].styleName===t)return n[i].styleValue;return null},_fromStyleString:function(){var e,t=this._element._nodeXML.getAttribute("style");if(null===t||void 0===t)return[];-1==t.indexOf(";")?e=[t]:(e=t.split(/\s*;\s*/))[e.length-1]||(e=e.slice(0,e.length-1));for(var n=[],i=0;i<e.length;i++){var s=e[i].split(":");if(2==s.length){var r=s[0],o=s[1],a={styleName:r=r.replace(/^\s+/,""),styleValue:o=o.replace(/^\s+/,"")};n.push(a)}}return n},_toStyleString:function(e){for(var t="",n=0;n<e.length;n++)t+=e[n].styleName+": ",t+=e[n].styleValue+";",n!=e.length-1&&(t+=" ");return t},_fromCamelCase:function(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()},_toCamelCase:function(e){if(-1==e.indexOf("-"))return e;var t="",n=e.split("-");t+=n[0];for(var i=1;i<n.length;i++)t+=n[i].charAt(0).toUpperCase()+n[i].substring(1);return t},setProperty:function(e,t,n){var i=this._toCamelCase(e);return this._setStyleAttribute(i,t),t},getPropertyValue:function(e){var t=this._toCamelCase(e);return this._getStyleAttribute(t)},item:function(e){return this._fromStyleString()[e].styleName},_getLength:function(){return this._fromStyleString().length},_normalizeStyle:function(){if(this._element._nodeXML.getAttribute("style")&&/[A-Z]/.test(this._element._nodeXML.getAttribute("style"))){for(var e=this._fromStyleString(),t=0;t<e.length;t++)e[t].styleName=e[t].styleName.toLowerCase(),-1==e[t].styleValue.indexOf("url(")&&(e[t].styleValue=e[t].styleValue.toLowerCase());var n="";for(t=0;t<e.length;t++)n+=e[t].styleName+": "+e[t].styleValue+"; ";" "==n.charAt(n.length-1)&&(n=n.substring(0,n.length-1));var i=this._element._passThrough;this._element._passThrough=!1,this._element.setAttribute("style",n),this._element._passThrough=i}},_onPropertyChange:function(){if(!this._ignoreStyleChanges){var e=window.event.propertyName;if(e&&/^style\./.test(e)&&"style.length"!=e){var t=e.match(/^style\.(.*)$/)[1],n=this._element._htcNode.style[t];this._setStyleAttribute(t,n)}}}}),extend(_SVGObject,{_scriptsToExec:null,_utf8encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):i>127&&i<2048?(t+=escape(String.fromCharCode(i>>6|192)),t+=escape(String.fromCharCode(63&i|128))):(t+=escape(String.fromCharCode(i>>12|224)),t+=escape(String.fromCharCode(i>>6&63|128)),t+=escape(String.fromCharCode(63&i|128)))}return t},_fetchURL:function(e,t,n){var i=xhrObj();isIE&&(e=this._utf8encode(e),e+=-1==e.indexOf("?")?"?":"&",e+=(new Date).getTime()),i.onreadystatechange=function(){4==i.readyState&&(200==i.status?t(i.responseText):n(i.status+": "+i.statusText),i=null)},i.open("GET",e,!0),i.send(null)},_fallback:function(e){console.log("onError (fallback), error="+e)},_loadHTC:function(){this._dummyNode=document.createElement("svg:__force__load"),this._dummyNode._handler=this._handler,this._readyStateListener=hitch(this,this._onHTCLoaded),this._dummyNode.attachEvent("onreadystatechange",this._readyStateListener),document.getElementsByTagName("head")[0].appendChild(this._dummyNode)},_onFlashLoaded:function(e){if(this._handler.flash=document.getElementById(this._handler.flashID),this._savedParams.length){for(var t=0;t<this._savedParams.length;t++){var n=this._savedParams[t];this._handler.flash.appendChild(n),n=null}this._savedParams=null}this._handler.flash.top=this._handler.flash.parent=window,this._swfLoaded=!0,isIE&&!this._htcLoaded||this._onEverythingLoaded()},_onHTCLoaded:function(){var e=document.getElementsByTagName("head")[0];e.removeChild(this._dummyNode),this._dummyNode.detachEvent("onreadystatechange",this._readyStateListener),this._dummyNode=null,e=null,this._htcLoaded=!0,this._swfLoaded&&this._onEverythingLoaded()},_onEverythingLoaded:function(){var e=this._handler._inserter._determineSize();this._handler.sendToFlash("jsHandleLoad",[this._getRelativeTo("object"),this._getRelativeTo("page"),e.pixelsWidth,e.pixelsHeight,!1,this._svgString])},_onRenderingFinished:function(e){this._handler.flash.style.visibility="visible";var t=this._xml.documentElement,n=t.getAttribute("id"),i=new _SVGSVGElement(t,null,null,this._handler),s=this._handler.document;s.documentElement=i._getProxyNode(),s.rootElement=i._getProxyNode(),s._nodeById["_"+n]=i,isIE&&this._handler.flash.setAttribute("contentDocument",null),this._handler.flash.contentDocument=s,this._handler.window=new _SVGWindow(this._handler),s.defaultView=this._handler.window;var r=i.getAttribute("onload");r&&(r="(function(){"+('var evt = { target: document.getElementById("'+i.getAttribute("id")+'") ,currentTarget: document.getElementById("'+i.getAttribute("id")+'") ,preventDefault: function() { this.returnValue=false; }};')+r+"}).apply(document.documentElement);",this._scriptsToExec.push(r));for(var o="",a=0;a<this._scriptsToExec.length;a++)o+=this._scriptsToExec[a]+"\n";this._executeScript(o),this._handler._loaded=!0,this._handler.fireOnLoad(this._handler.id,"object")},_getRelativeTo:function(e){var t,n="";"object"==e?(t=this.url.replace(/[^:]*:\/\/[^\/]*/).match(/\/?[^\?\#]*/)[0])&&t.length>0&&-1!=t.indexOf("/")&&(n=t.replace(/\/([^\/]*)$/,"/")):(t=window.location.pathname.toString())&&t.length>0&&-1!=t.indexOf("/")&&(n=t.replace(/\/([^\/]*)$/,"/"));return n},_executeScript:function(e){var t=document.createElement("iframe");t.setAttribute("src","about:blank"),t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",document.getElementsByTagName("body")[0].appendChild(t);var n=t.contentDocument?t.contentDocument:t.contentWindow.document,i=t.contentWindow;this._handler.document.defaultView=i,e=(e=this._sandboxedScript(e))+";__svgHandler.sandbox_eval = "+(isIE?"window.eval;":"function(scriptCode) { return window.eval(scriptCode) };"),n.write("<script>"+e+"<\/script>"),n.close(),this._handler.window._fireOnload()},_sandboxedScript:function(e){return e=(e=(e=(e=(e=(e=(e='var __svgHandler = top.svgweb.handlers["'+this._handler.id+'"];\nwindow.svgns = "'+svgns+'";\nwindow.xlinkns = "'+xlinkns+'";\n'+"window._timeoutIDs = [];\nwindow._setTimeout = window.setTimeout;\nwindow.setTimeout = \n       (function() {\n          return function(f, ms) {\n            var timeID = window._setTimeout(f, ms);\n            window._timeoutIDs.push(timeID);\n            return timeID;\n          };\n        })();\nwindow._intervalIDs = [];\nwindow._setInterval = window.setInterval;\nwindow.setInterval = \n       (function() {\n          return function(f, ms) {\n            var timeID = window._setInterval(f, ms);\n            window._intervalIDs.push(timeID);\n            return timeID;\n          };\n        })();\n\n\n"+e).replace(/top\.document/g,"top.DOCUMENT")).replace(/top\.window/g,"top.WINDOW")).replace(/(^|[^A-Za-z0-9_])document(\.|'|"|\,| |\))/g,"$1__svgHandler.document$2")).replace(/window\.(location|addEventListener|onload|frameElement)/g,"__svgHandler.window.$1")).replace(/top\.DOCUMENT/g,"top.document")).replace(/top\.WINDOW/g,"top.window")},_getPARAMs:function(e){for(var t=[],n=0;n<e.childNodes.length;n++){var i=e.childNodes[n];"PARAM"==i.nodeName.toUpperCase()&&t.push(i.cloneNode(!1))}return t}}),extend(_SVGWindow,{addEventListener:function(e,t,n){"SVGLoad"==e.toLowerCase()&&this._onloadListeners.push(t)},_fireOnload:function(){for(var e=0;e<this._onloadListeners.length;e++)try{this._onloadListeners[e]()}catch(e){console.log("The following exception occurred from an SVG onload listener: "+(e.message||e))}if(this.onload)try{this.onload()}catch(e){console.log("The following exception occurred from an SVG onload listener: "+(e.message||e))}},_createLocation:function(e){var t,n={},i=this._handler._svgObject.url;if(t=e||window.location,/^data:/.test(i))return n.href=i,n.toString=function(){return this.href},n;if(/^http/.test(i));else if("/"==i.charAt(0))i=t.protocol+"//"+t.host+i;else if(-1==t.pathname.indexOf("/"))i=t.protocol+"//"+t.host+"/"+i;else{for(var s=t.pathname,r=s.length-1;r>=0&&"/"!=s.charAt(r);r--)s=s.substring(0,r);i=t.protocol+"//"+t.host+s+i}var o=i.match(/^(https?:)\/\/([^\/:]*):?([0-9]*)([^\?#]*)([^#]*)(#.*)?$/);n.protocol=o[1]?o[1]:t.href,":"!=n.protocol.charAt(n.protocol.length-1)&&(n.protocol+=":"),n.hostname=o[2],n.port="",o[3]&&(n.port=o[3]);var a=!0;return(n.protocol!=t.protocol||n.hostname!=t.hostname||n.port&&n.port!=t.port)&&(a=!1),a&&!n.port&&(n.port=t.port),n.port?n.host=n.hostname+":"+n.port:n.host=n.hostname,n.pathname=o[4]?o[4]:"",n.search=o[5]?o[5]:"",n.hash=o[6]?o[6]:"",n.href=n.protocol+"//"+n.host+n.pathname+n.search+n.hash,n.toString=function(){return this.protocol+"//"+this.host+this.pathname+this.search+this.hash},n}}),extend(FlashInserter,{_setupFlash:function(){var e,t=this._determineSize(),n=this._determineBackground(),i=this._determineStyle(),s=this._determineClassName(),r=this._determineCustomAttrs();"script"==this._embedType?(e=this._nodeXML.getAttribute("id"),this._handler.flashID=e+"_flash"):"object"==this._embedType&&(e=this._replaceMe.getAttribute("id"),this._handler.flashID=e);var o=this._createFlash(t,e,n,i,s,r);this._insertFlash(o)},_insertFlash:function(e){if(!isIE){var t;if(isXHTML)isXHTML&&(t=e);else{var n=document.createElement("div");n.innerHTML=e,t=n.childNodes[0],n.removeChild(t);for(var i=0;i<t.childNodes.length;i++){var s=t.childNodes[i];if("EMBED"==s.nodeName.toUpperCase()){t=s;break}}}return this._replaceMe.parentNode.replaceChild(t,this._replaceMe),t}var r=this;window.setTimeout(function(){r._replaceMe.outerHTML=e,r=null},1)},_determineSize:function(){var e=this._parentNode.clientWidth,t=this._parentNode.clientHeight;return 0==t&&(this.invalidParentHeight=!0),0==e&&(e=this._parentNode.offsetWidth),isSafari||(e-=this._getMargin(this._parentNode,"margin-left"),e-=this._getMargin(this._parentNode,"margin-right"),t-=this._getMargin(this._parentNode,"margin-top"),t-=this._getMargin(this._parentNode,"margin-bottom")),isStandardsMode?this._getStandardsSize(e,t):this._getQuirksSize(e,t)},_getQuirksSize:function(e,t){var n,i;if("script"==this._embedType)for(var s=this._parentNode;s&&s.style&&"div"!=s.nodeName.toLowerCase();){if("body"==s.nodeName.toLowerCase()){this._nodeXML.getAttribute("style")&&-1!=this._nodeXML.getAttribute("style").indexOf("fixed")?(t=window.innerHeight&&window.innerHeight>0?window.innerHeight:document.documentElement&&document.documentElement.clientHeight&&document.documentElement.clientHeight>0?document.documentElement.clientHeight:document.body.clientHeight,this.invalidParentHeight=!1):(this.invalidParentHeight=!0,t=0);break}s=s.parentNode}var r=this._explicitWidth,o=this._explicitHeight,a=this._nodeXML.getAttribute("width");a&&-1==a.indexOf("%")&&(a=parseInt(a).toString());var d=this._nodeXML.getAttribute("height");if(d&&-1==d.indexOf("%")&&(d=parseInt(d).toString()),r&&o)return n=-1!=r.indexOf("%")?e*parseInt(r)/100:r,-1!=o.indexOf("%")?t>0?i=t*parseInt(o)/100:(console.log("SVGWeb: unhandled resize scenario."),t=200):i=o,{width:r,height:i,pixelsWidth:n,pixelsHeight:i,clipMode:this._nodeXML.getAttribute("viewBox")?"neither":"both"};if(r)return n=-1!=r.indexOf("%")?e*parseInt(r)/100:r,this._nodeXML.getAttribute("viewBox")?(a&&-1==a.indexOf("%")&&d&&-1==d.indexOf("%")?o=n*(d/a):(l=(h=this._nodeXML.getAttribute("viewBox").split(/\s+|,/))[2],o=n*(h[3]/l)),{width:r,height:o,pixelsWidth:n,pixelsHeight:o,clipMode:"neither"}):{width:r,height:o=a&&-1==a.indexOf("%")&&d&&-1==d.indexOf("%")?n*(d/a):d&&-1==d.indexOf("%")?d:150,pixelsWidth:n,pixelsHeight:o,clipMode:"both"};if(o)return i=-1!=o.indexOf("%")?t*parseInt(o)/100:o,this._nodeXML.getAttribute("viewBox")?{width:r=a&&-1==a.indexOf("%")&&d&&-1==d.indexOf("%")?i*(a/d):i*((l=(h=this._nodeXML.getAttribute("viewBox").split(/\s+|,/))[2])/h[3]),height:o,pixelsWidth:r,pixelsHeight:i,clipMode:"neither"}:(n=a&&-1==a.indexOf("%")&&d&&-1==d.indexOf("%")?r=i*(a/d):-1!=(r=a||"100%").indexOf("%")?e*parseInt(r)/100:r,{width:r,height:o,pixelsWidth:n,pixelsHeight:i,clipMode:"both"});if(n=-1!=(r=a||"100%").indexOf("%")?e*parseInt(r)/100:r,d&&-1==d.indexOf("%"))return{width:r,height:o=d,pixelsWidth:n,pixelsHeight:o,clipMode:this._nodeXML.getAttribute("viewBox")?"neither":"both"};if(this._nodeXML.getAttribute("viewBox")){if("script"==this._embedType&&(null==d||-1!=d.indexOf("%"))&&!this.invalidParentHeight)return null==d&&(d="100%"),null==o&&(o="100%"),{width:r,height:i=t*parseInt(d)/100,pixelsWidth:n,pixelsHeight:i,clipMode:"neither"};var h,l=(h=this._nodeXML.getAttribute("viewBox").split(/\s+|,/))[2];return{width:r,height:o=n*(h[3]/l),pixelsWidth:n,pixelsHeight:o,clipMode:"neither"}}return{width:r,height:o=150,pixelsWidth:n,pixelsHeight:o,clipMode:"both"}},_getStandardsSize:function(e,t){var n,i,s=this._explicitWidth,r=this._explicitHeight,o=this._nodeXML.getAttribute("width");o&&-1==o.indexOf("%")&&(o=parseInt(o).toString());var a=this._nodeXML.getAttribute("height");return a&&-1==a.indexOf("%")&&(a=parseInt(a).toString()),s&&!r?this._getQuirksSize(e,t):s||r?!s&&r?(n=-1!=(s=o||"100%").indexOf("%")?e*parseInt(s)/100:s,-1==r.indexOf("%")?(i=r,o&&-1==o.indexOf("%")&&a&&-1==a.indexOf("%")?n=s=r*(o/a):this._nodeXML.getAttribute("viewBox")&&(viewBox=this._nodeXML.getAttribute("viewBox").split(/\s+|,/),boxWidth=viewBox[2],boxHeight=viewBox[3],n=s=i*(boxWidth/boxHeight)),{width:s,height:r,pixelsWidth:n,pixelsHeight:r,clipMode:this._nodeXML.getAttribute("viewBox")?"neither":"both"}):(a&&-1==a.indexOf("%")?i=a:this._nodeXML.getAttribute("viewBox")?(viewBox=this._nodeXML.getAttribute("viewBox").split(/\s+|,/),boxWidth=viewBox[2],boxHeight=viewBox[3],i=n*(boxHeight/boxWidth)):i=150,{width:s,height:i,pixelsWidth:n,pixelsHeight:i,clipMode:this._nodeXML.getAttribute("viewBox")?"neither":"both"})):s&&r?(n=-1!=s.indexOf("%")?e*parseInt(s)/100:s,-1==r.indexOf("%")?{width:s,height:r,pixelsWidth:n,pixelsHeight:r,clipMode:this._nodeXML.getAttribute("viewBox")?"neither":"both"}:o&&-1==o.indexOf("%")&&a&&-1==a.indexOf("%")?{width:s,height:i=n*(a/o),pixelsWidth:n,pixelsHeight:i,clipMode:"neither"}:this.invalidParentHeight?this._nodeXML.getAttribute("viewBox")?(viewBox=this._nodeXML.getAttribute("viewBox").split(/\s+|,/),boxWidth=viewBox[2],boxHeight=viewBox[3],{width:s,height:r=n*(boxHeight/boxWidth),pixelsWidth:n,pixelsHeight:r,clipMode:"neither"}):{width:s,height:i=a&&-1==a.indexOf("%")?a:150,pixelsWidth:n,pixelsHeight:i,clipMode:"both"}:{width:s,height:i=t*parseInt(r)/100,pixelsWidth:n,pixelsHeight:i,clipMode:"neither"}):void 0:this._getQuirksSize(e,t)},_getMargin:function(e,t){var n;return e.currentStyle?n=parseInt(e.currentStyle[t]):window.getComputedStyle&&(n=parseInt(document.defaultView.getComputedStyle(e,null).getPropertyValue(t))),n||0},_determineBackground:function(){var e=!1,t=null,n=this._nodeXML.getAttribute("style");if(n&&-1!=n.indexOf("background-color")){var i=n.match(/background\-color:\s*([^;]*)/);i&&(t=i[1])}return null===t&&(e=!0),{color:t,transparent:e}},_determineStyle:function(){var e=this._nodeXML.getAttribute("style");return e||(e=""),e.length>0&&";"!=e.charAt(e.length-1)&&(e+=";"),"script"==this._embedType&&-1==e.indexOf("display:")&&(e+="display: inline;"),"script"==this._embedType&&-1==e.indexOf("overflow:")&&(e+="overflow: hidden;"),e},_determineClassName:function(){var e=this._nodeXML.getAttribute("class");return e?e+" embedssvg":"embedssvg"},_determineCustomAttrs:function(){var e=[];if("object"==this._embedType)for(var t=this._replaceMe,n=document._createElement("object"),i=0;i<t.attributes.length;i++){var s=t.attributes[i],r=s.nodeName,o=s.nodeValue;(o||"true"===o)&&(n.getAttribute(r)||/^(id|name|width|height|data|class|style|codebase|type|_listeners|addEventListener|onload)$/.test(r)||e.push({attrName:r.toString(),attrValue:o.toString()}))}return e},_createFlash:function(e,t,n,i,s,r){var o,a="uniqueId="+encodeURIComponent(t)+"&sourceType=string&clipMode="+e.clipMode+"&debug=true&svgId="+encodeURIComponent(t);o=this._isXDomain?svgweb.xDomainURL+"svg.swf":svgweb.libraryPath+"svg.swf";var d,h=window.location.protocol;if(":"==h.charAt(h.length-1)&&(h=h.substring(0,h.length-1)),isXHTML){(d=document.createElement("embed")).setAttribute("src",o),d.setAttribute("quality","high"),n.color&&d.setAttribute("bgcolor",n.color),n.transparent&&d.setAttribute("wmode","transparent"),d.setAttribute("width",e.width),d.setAttribute("height",e.height),d.setAttribute("id",this._handler.flashID),d.setAttribute("name",this._handler.flashID),d.setAttribute("swLiveConnect","true"),d.setAttribute("allowScriptAccess","always"),d.setAttribute("type","application/x-shockwave-flash"),d.setAttribute("FlashVars",a),d.setAttribute("pluginspage",h+"://www.macromedia.com/go/getflashplayer"),d.setAttribute("style",i),d.setAttribute("className",s);for(var l=0;l<r.length;l++)d.setAttribute(r[l].attrName,r[l].attrValue)}else{var _="";for(l=0;l<r.length;l++)_+=" "+r[l].attrName+'="'+r[l].attrValue+'"';d='<object\n classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"\n codebase="'+h+'://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"\n width="'+e.width+'"\n height="'+e.height+'"\n id="'+this._handler.flashID+'"\n name="'+this._handler.flashID+'"\n style="'+i+'"\n class="'+s+'"\n '+_+'\n>\n <param name="allowScriptAccess" value="always"></param>\n <param name="movie" value="'+o+'"></param>\n <param name="quality" value="high"></param>\n <param name="FlashVars" value="'+a+'"></param>\n '+(n.color?'<param name="bgcolor" value="'+n.color+'"></param>\n ':"")+(n.transparent?'<param name="wmode" value="transparent"></param>\n ':"")+'<embed src="'+o+'" quality="high" '+(n.color?'bgcolor="'+n.color+'" \n':"")+(n.transparent?'wmode="transparent" \n':"")+'width="'+e.width+'" height="'+e.height+'" id="'+this._handler.flashID+'" name="'+this._handler.flashID+'" swLiveConnect="true" allowScriptAccess="always" type="application/x-shockwave-flash" FlashVars="'+a+'" pluginspage="'+h+'://www.macromedia.com/go/getflashplayer" style="'+i+'"\n class="'+s+'"\n '+_+"\n /></object>"}return d}}),_SVGSVGElement.prototype=new _Element,extend(_SVGSVGElement,{suspendRedraw:function(e){return this._handler._redrawManager.suspendRedraw(e)},unsuspendRedraw:function(e){this._handler._redrawManager.unsuspendRedraw(e)},unsuspendRedrawAll:function(){this._handler._redrawManager.unsuspendRedrawAll()},forceRedraw:function(){},nearestViewportElement:null,farthestViewportElement:null,getBBox:function(){},getTransformToElement:function(e){},_onHTCLoaded:function(){this._htcNode.detachEvent("onreadystatechange",this._readyStateListener),this.style._ignoreStyleChanges=!1,this._htcLoaded=!0,this._swfLoaded&&this._onEverythingLoaded()},_onFlashLoaded:function(e){this._handler.flash=document.getElementById(this._handler.flashID),this._swfLoaded=!0,isIE&&!this._htcLoaded||this._onEverythingLoaded()},_onEverythingLoaded:function(){var e=this._handler._inserter._determineSize();this._handler.sendToFlash("jsHandleLoad",[this._getRelativeTo("object"),this._getRelativeTo("page"),e.pixelsWidth,e.pixelsHeight,!0,this._svgString])},_onRenderingFinished:function(e){"script"==this._handler.type&&(this._handler.flash.documentElement=this._getProxyNode()),this._attached&&("script"==this._handler.type?this.ownerDocument=document:"object"==this._handler.type&&(this.ownerDocument=this._handler.document)),this._handler.document.rootElement=this._getProxyNode();var t=this._nodeXML.getAttribute("id");this._handler._loaded=!0,this._handler.fireOnLoad(t,"script")},_getRelativeTo:function(){var e="",t=window.location.pathname.toString();return t&&t.length>0&&-1!=t.indexOf("/")&&(e=t.replace(/\/([^\/]*)$/,"/")),e},_addRedrawMethods:function(){this._htcNode.suspendRedraw=function(e){return this._fakeNode.suspendRedraw(e)},this._htcNode.unsuspendRedraw=function(e){return this._fakeNode.unsuspendRedraw(e)},this._htcNode.unsuspendRedrawAll=function(){return this._fakeNode.unsuspendRedrawAll()},this._htcNode.forceRedraw=function(){return this._fakeNode.forceRedraw()}},_createCurrentTranslate:function(){return new _SVGPoint(0,0,!0,hitch(this,this._updateCurrentTranslate))},_updateCurrentTranslate:function(e,t,n){"xy"==e?this._handler.sendToFlash("jsSetCurrentTranslate",["xy",t,n]):this._handler.sendToFlash("jsSetCurrentTranslate",[e,t])}}),_Document.prototype=new _Node,extend(_Document,{_nodeById:null,implementation:null,documentElement:null,createElementNS:function(e,t){var n=this._namespaces["_"+e];return"xmlns"!=n&&n||(n=null),new _Element(t,n,e)._getProxyNode()},createTextNode:function(e){var t,n=FlashHandler._unattachedDoc;(t=isIE?n.createElement("__text"):n.createElementNS(svgnsFake,"__text")).appendChild(n.createTextNode(e));var i=new _Node("#text",_Node.TEXT_NODE,null,null,t,this._handler);return i._nodeValue=e,i.ownerDocument=this,i._getProxyNode()},createDocumentFragment:function(e){return new _DocumentFragment(this)._getProxyNode()},getElementById:function(e){var t,n,i=xpath(this._xml,null,'//*[@id="'+e+'"]');return i.length?(t=i[0],(n=FlashHandler._getNode(t,this._handler))._passThrough=!0,n):null},getElementsByTagNameNS:function(e,t){if("script"==this._handler.type&&!this._handler._loaded)return[];var n=this.rootElement.getElementsByTagNameNS(e,t);return e==svgns&&"svg"==t&&n.push(this.rootElement),n},_getNamespaces:function(){for(var e=[],t=this._xml.documentElement.attributes,n=0;n<t.length;n++){var i=t[n];if(/^xmlns:?(.*)$/.test(i.nodeName)){var s=i.nodeName.match(/^xmlns:?(.*)$/),r=s[1]?s[1]:"xmlns",o=i.nodeValue;e["_"+r]||(e["_"+r]=o,e["_"+o]=r,e.push(o))}}return e}}),extend(_SVGMatrix,{multiply:function(e){},inverse:function(){var e=this._handler.sendToFlash("jsMatrixInvert",[this.a,this.b,this.c,this.d,this.e,this.f]);return e=this._handler._stringToMsg(e),new _SVGMatrix(new Number(e.a),new Number(e.b),new Number(e.c),new Number(e.d),new Number(e.e),new Number(e.f),this._handler)},translate:function(e,t){},scale:function(e){},scaleNonUniform:function(e,t){},rotate:function(e){},rotateFromVector:function(e,t){},flipX:function(){},flipY:function(){},skewX:function(e){},skewY:function(e){}}),mixin(_SVGTransform,{SVG_TRANSFORM_UNKNOWN:0,SVG_TRANSFORM_MATRIX:1,SVG_TRANSFORM_TRANSLATE:2,SVG_TRANSFORM_SCALE:3,SVG_TRANSFORM_ROTATE:4,SVG_TRANSFORM_SKEWX:5,SVG_TRANSFORM_SKEWY:6}),extend(_SVGTransform,{type:null,matrix:null,angle:null,setMatrix:function(e){},setTranslate:function(e,t){},setScale:function(e,t){},setRotate:function(e,t,n){},setSkewX:function(e){},setSkewY:function(e){}}),extend(_SVGPoint,{matrixTransform:function(e){return new _SVGPoint(e.a*this.x+e.c*this.y+e.e,e.b*this.x+e.d*this.y+e.f,this._formalAccessors)}}),window.svgweb=new SVGWeb}();
  //# sourceMappingURL=../../../../../sourcemaps/gfx/tests/svgweb/svgweb/src/svg.js.map
  