From: dhrname Date: Thu, 17 Jan 2013 14:45:09 +0000 (+0900) Subject: Build SIE 8 beta X-Git-Tag: v16beta~368 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d50fdd34675422c043b1dcff0f6ac601dd22aed7;p=sie%2Fsie.git Build SIE 8 beta --- diff --git a/org/sie-uncompressed.js b/org/sie-uncompressed.js index b5ea3d9..40b2efd 100644 --- a/org/sie-uncompressed.js +++ b/org/sie-uncompressed.js @@ -1,9130 +1,9124 @@ -/*SIE-SVG without Plugin under LGPL2.1 & GPL2.0 & Mozilla Public Lisence - *http://sie.sourceforge.jp/ - *Usage: - */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla SVG Cairo Renderer project. - * - * The Initial Developer of the Original Code is IBM Corporation. - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Parts of this file contain code derived from the following files(s) - * of the Mozilla SVG project (these parts are Copyright (C) by their - * respective copyright-holders): - * layout/svg/renderer/src/libart/nsSVGLibartBPathBuilder.cpp - * - * Contributor(s):DHRNAME revulo bellbind - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ -/*Function Object.create - *関数Object.createはオブジェクトを新規に作り出すときに使う。 - *SIEでスーパークラスに引数が指定されているときの対策として使う。 - *example: function SuperClass (ng) {ng.e();}; - *function SubClass () {}; - *SubClass.prototype = new SuperClass(); // Error - *SubClass.prototype = Object.create(SuperClass) // OK*/ -if (!Object._create) { - Object._create = function (/*Function*/ cl) { - var s = function () {}; - s.prototype = cl.prototype; - cl = void 0; - return new s; - }; -} -// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/dom.idl -/*W3CのDOMのIDLを参照にコードを起こしている - *変数やプロパティ、メソッドの名前の頭に、「_」がついているときはSIE独自のもの - */ -/* -#ifndef _DOM_IDL_ -#define _DOM_IDL_ - -#pragma prefix "w3c.org" -module dom -{ - - valuetype DOMString sequence; - - typedef unsigned long long DOMTimeStamp; - - interface DocumentType; - interface Document; - interface NodeList; - interface NamedNodeMap; - interface Element; -*/ -function DOMException(n){ - Error.apply(this, arguments); - this.code = n; - var s = [ - "", //数合わせのため - "Index Size Error", - "DOMString Size Error", - "Hierarchy Request Error", - "Wrong Document Error", - "Invalid Character Error", - "No Data Allowed Error", - "No Modification Allowed Error", - "Not Found Error", - "Not Supported Error", - "Inuse Attribute Error", - "Invalid State Error", - "Syntax Error", - "Invalid Modification Error", - "Namespace Error", - "Invalid Access Error" - ]; - this.message = s[n]; -/*DOMSTRING_SIZE_ERR -テキストの指定された範囲がDOMStringに合致しない。 2 -HIERARCHY_REQUEST_ERR -コードが属さない場所に挿入されている。 3 -INDEX_SIZE_ERR -インデクス若しくは大きさが負数,又は許された値よりも大きい。 1 -INUSE_ATTRIBUTE_ERR -他で既に使用されている属性を追加しようとしている。 10 -INVALID_ACCESS_ERR,DOM水準2で導入 -パラメタ又は操作が基礎になるオブジェクトによってサポートされていない。 15 -INVALID_CHARACTER_ERR -名前の中などで,妥当でない又は不正な文字が指定されている。文法に合った文字の定義についてはXML規定の 生成規則2 を,文法に合った名前文字については 生成規則5 を参照すること。5 -INVALID_MODIFICATION_ERR,DOM水準2で導入 -基礎となるオブジェクトの型を修正しようとしている。 13 -INVALID_STATE_ERR,DOM水準2で導入 -利用不可能又はもはや利用可能ではないオブジェクトを使用しようとしている。 11 -NAMESPACE_ERR,DOM水準2で導入 -名前空間に関して正しくない方法でオブジェクトを生成又は変更しようとしている。 14 -NOT_FOUND_ERR -ノードが存在しない文脈でそのノードを参照しようとしている。 8 -NOT_SUPPORTED_ERR -実装は,オブジェクト又は操作の要求された型をサポートしていない。9 -NO_DATA_ALLOWED_ERR -データをサポートしないノードに対してデータを指定している。 6 -NO_MODIFICATION_ALLOWED_ERR -修正が許されない場所でオブジェクトを修正しようとしている。 7 -SYNTAX_ERR,DOM水準2で導入 -妥当ではない又は不正な文字列が指定されている。 12 -WRONG_DOCUMENT_ERR -ノードを生成した文書以外の(そのノードをサポートしない)異なる文書で,ノードが使用されている。4 -*/ -}; -(function(t) { -/*マジックナンバーは軽量化のため原則コメントで記述するのみ -t.INDEX_SIZE_ERR = 1; -t.DOMSTRING_SIZE_ERR = 2; -t.HIERARCHY_REQUEST_ERR = 3; -t.WRONG_DOCUMENT_ERR = 4; -t.INVALID_CHARACTER_ERR = 5; -t.NO_DATA_ALLOWED_ERR = 6; -t.NO_MODIFICATION_ALLOWED_ERR = 7; -t.NOT_FOUND_ERR = 8; -t.NOT_SUPPORTED_ERR = 9; -t.INUSE_ATTRIBUTE_ERR = 10; -t.INVALID_STATE_ERR = 11; -t.SYNTAX_ERR = 12; -t.INVALID_MODIFICATION_ERR = 13; -t.NAMESPACE_ERR = 14; -t.INVALID_ACCESS_ERR = 15;*/ -t.prototype = new Error(); -})(DOMException); - -/*DOMImplementation - *DOMの基本的な機能をつかさどる - */ -DOMImplementation = { - /* hasFeature - *文字列によって、機能をサポートしているかどうかをチェックする。削除不可。 - */ - /*boolean*/ hasFeature : function(/*string*/ feature, version) { - switch (feature) { - case "CORE" : - case "XML" : - case "Events" : //DOM level2 Eventを参照 - case "StyleSheets" : //DOM level2 StyleSheetを参照 - case "org.w3c.svg.static" : //SVG1.1の仕様を参照 - case "org.w3c.dom.svg.static" : - return true; - default : - if (version === "2.0") { //DOM level2 Coreにおいて策定されたバージョン情報 - return true; - } else { - return false; - } - } - }, - - /* createDocumentType - *ドキュメントタイプを作るためのもの。削除可。 - */ - /*DocumentType*/ createDocumentType : function(/*string*/ qualifiedName, publicId, systemId) { - var s = new Node(); - s.publicId = publicId; - s.systemId = systemId; - return s; - }, - /* createDocument - * ドキュメントオブジェクトを作るためのもの。削除不可。 - */ - /*Document*/ createDocument : function( /*string*/ ns, qname, /*DocumentType*/ doctype) { - try { - var s; - if (ns) { - s = new (DOMImplementation[ns].Document); - this._doc_ && (s._document_ = this._doc_); //_document_プロパティはcreateElementNSメソッドやradialGradient要素やNAIBU._setPaintなどで使う - } else { - s = new Document(); - } - s.implementation = this; - s.doctype = doctype || null; - s.documentElement = s.createElementNS(ns,qname); //ルート要素を作る - return s; - } catch(e){} - }, - "http://www.w3.org/2000/xmlns": {} -}; - -/* Node - *ノード(節)はすべての雛形となる重要なものである。削除不可。 - */ - -function Node(){ - this.childNodes = []; - this._capter = []; //eventで利用 -} -/*軽量化のためにマジックナンバーはコメントで代替 - *(function(t) { -// NodeType -/*const unsigned short t.ELEMENT_NODE = 1; -/*const unsigned short t.ATTRIBUTE_NODE = 2; -/*const unsigned short t.TEXT_NODE = 3; -/*const unsigned short t.CDATA_SECTION_NODE = 4; -/*const unsigned short t.ENTITY_REFERENCE_NODE = 5; -/*const unsigned short t.ENTITY_NODE = 6; -/*const unsigned short t.PROCESSING_INSTRUCTION_NODE = 7; -/*const unsigned short t.COMMENT_NODE = 8; -/*const unsigned short t.DOCUMENT_NODE = 9; -/*const unsigned short t.DOCUMENT_TYPE_NODE = 10; -/*const unsigned short t.DOCUMENT_FRAGMENT_NODE = 11; -/*const unsigned short t.NOTATION_NODE = 12; -})(Node);*/ -Node.prototype = { - //以下は初期値として設定 - tar : null, - firstChild : null, - previousSibling : null, - nextSibling : null, - attributes : null, - namespaceURI : null, - localName : null, - lastChild : null, - prefix : null, - ownerDocument : null, - parentNode : null, -/*replaceChildメソッド - *指定したoldChildノードの代わりに、新たなnewChildノードを入れる。切り替え機能。 - */ -/*Node*/ replaceChild : function( /*Node*/ newChild, oldChild) { - this.insertBefore(newChild, oldChild); - var s = this.removeChild(oldChild); - return s; -}, -/*appendChildメソッド - *eleノードをリストの最後尾に追加する - */ -/*Node*/ appendChild : function( /*Node*/ ele) { - this.insertBefore(ele,null); - return ele; -}, -/*hasChildNodesメソッド - *子ノードがあるかどうか - */ -/*boolean*/ hasChildNodes : function() { - if (this.childNodes.length > 0) { - return true; - } else { - return false; - } -}, -/*cloneNodeメソッド - *ノードのコピーを作る。引数は、子ノードのコピーも作るかどうか。コピー機能。 - */ -/*Node*/ cloneNode : function( /*boolean*/ deep) { - var s; - if (this.hasOwnProperty("ownerDocument")) { - s = this.ownerDocument.importNode(this, deep); - } else { - s = new Node(); - } - return s; -}, -/*normalizeメソッド - *二つ以上の重複したテキストノードを一つにまとめる - */ -/*void*/ normalize : function() { - var tcn = this.childNodes; - try { - for (var i=tcn.length-1;i<0;--i) { - var tcni = tcn[i], tcnip = tcni.nextSibling; - if (tcnip) { - if (tcni.nodeType === /*Node.TEXT_NODE*/ 3 && tcnip.nodeType === /*Node.TEXT_NODE*/ 3) { - tcni.appendData(tcnip.data); //次ノードの文字列データを、現ノード文字列の後に付け加える - tcni.legnth = tcni.data.length; - this.removeChild(tcnip); //次ノードを排除 - } else { - tcni.normalize(); - } - } else { - tcni.normalize(); - } - } - } catch(e){}; -}, -/*isSupportedメソッド - *どんな機能をサポートしているかどうかをチェック - */ -/*boolean*/ isSupported : function( /*string*/ feature, version) { - return (this.ownerDocument.implementation.hasFeature(feature+"", version+"")); -}, -/*hasAttributesメソッド - *ノードが属性を持っているかどうか - */ -/*boolean*/ hasAttributes : function() { - if (this.attributes.length > 0) { - return true; - } else { - return false; - } -} -}; - - -Array.prototype.item = function( /*long*/ index) { - if (!this[index]) { - return null; - } - return (this[index]); -}; -/*ノードリストはArrayで代用。 - interface NodeList { - Node item(in unsigned long index); - readonly attribute unsigned long length; - }; -*/ - -/*NamedNodeMap - *ノードの集合。ノードリストと違って、順序が決まっていない。削除不可 - */ -function NamedNodeMap() { -} -/*_copyNode - *cloneNodeを行う際に、用いる。削除不可 - */ -Array.prototype._copyNode = function __nnmp_c( /*NamedNodeMap*/ children, /*boolean*/ deep) { - for (var i=0,cli=children.length;i this.length) { //値が負か、データの長さよりoffsetが長いとき、サイズエラーを起こす - throw (new DOMException(/*INDEX_SIZE_ERR*/ 1)); - } - if (offset + count > this.length) { //offsetとcountの和が文字全体の長さを超える場合、offsetから最後までのを取り出す - count = this.length - offset; - } - var s = this.data.substr(offset, count); - return s; - }; - /*void*/ cproto.replaceData = function( /*long*/ offset, /*long*/ count, /*string*/ arg) { - if (offset < 0 || count < 0 || offset > this.length) { //値が負か、データの長さよりoffsetが長いとき、サイズエラーを起こす - throw (new DOMException(/*INDEX_SIZE_ERR*/ 1)); - } - this.deleteData(offset, count); - this.insertData(offset, arg); - }; - cproto = void 0; -})(CharacterData.prototype); - -/*Attr - *属性ノード。削除不可。 - */ -function Attr() { -}; -Attr.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 -(function(aproto){ - aproto.nodeType = /*Node.ATTRIBUTE_NODE*/ 2; - aproto.nodeValue = null; - aproto.childNodes = []; - aproto._capter = []; //eventで利用 - aproto = void 0; -})(Attr.prototype); - -/*Element - *要素ノード。削除不可。 - */ -function Element() { - Node.apply(this); - this.attributes = new NamedNodeMap(); //属性を収納 -}; -Element.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 -(function(eproto){ - eproto.nodeType = /*Node.ELEMENT_NODE*/ 1; - eproto.nodeValue = null; - /* - *名前空間に対応していないメソッドは、軽量化のため、機能させないようにする。代わりに、**NSメソッドを利用すること - *(getAttributeとsetAttributeは普及しているので機能させる - */ - /*string*/ eproto.getAttribute = function( /*string*/ name) { - return (this.getAttributeNS(null, name)); - }; - /*void*/ eproto.setAttribute = function( /*string*/ name, /*string*/ value) { - this.setAttributeNS(null, name, value); - }; - /*void*/ eproto.removeAttribute = function( /*string*/ name) { - this.removeAttributeNS(null, name); - }; - /*Attr*/ eproto.getAttributeNode = function( /*string*/ name) { - }; - /*Attr*/ eproto.setAttributeNode = function( /*Attr*/ newAttr) { - }; - /*Attr*/ eproto.removeAttributeNode = function( /*Attr*/ oldAttr) { - var s = this.attributes.removeNamedItemNS(oldAttr.namespaceURI, oldAttr.localName); //attributesから該当するノードを排除 - return s; - }; - /*NodeList(Array)*/ eproto.getElementsByTagName = function( /*string*/ name) { - }; - /*string*/ eproto.getAttributeNS = function( /*string*/ namespaceURI, /*string*/ localName) { - var n = this.getAttributeNodeNS(namespaceURI, localName); //属性ノードを取得する - if (!n) { - return null; - } else { - return (n.nodeValue); - } - }; - /*void*/ eproto.setAttributeNS = function( /*string*/ namespaceURI, /*string*/ qualifiedName, /*string*/ value) { - var atn = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName); - /*元来、string型以外の型を許容すべきではないが、他のブラウザ(FirefoxやOpera)でエラーが出ないため許容する*/ - atn.nodeValue = value+""; - atn.value = value+""; - this.setAttributeNodeNS(atn); - }; - /*void*/ eproto.removeAttributeNS = function( /*string*/ namespaceURI, /*string*/ localName) { - }; - /*Attr*/ eproto.getAttributeNodeNS = function( /*string*/ namespaceURI, /*string*/ localName) { - var s = this.attributes.getNamedItemNS(namespaceURI,localName); - return s; - }; - /*NodeList(Array)*/ eproto.getElementsByTagNameNS = function( /*string*/ namespaceURI, /*string*/ localName) { - var s = [], n = 0; - var tno = this.childNodes; - for (var i=0,tcli = tno.length;iで表現される。削除不可。 - */ -function Comment() { -}; -Comment.prototype = Object._create(CharacterData); //文字データのプロトタイプチェーンを作って、継承 -Comment.prototype.nodeType = /*Node.COMMENT_NODE*/ 8; -Comment.prototype.nodeName = "#comment"; -/*CDATASection - *CDATA領域を示すノード。で表現される。削除不可。 - */ -function CDATASection() { - this.nodeType = /*Node.CDATA_SECTION_NODE*/ 4; - this.nodeName = "#cdata-section"; -}; -CDATASection.prototype = Object._create(Text); //テキストノードのプロトタイプチェーンを作って、継承 - -/*DocumentType - *DTD(文書型定義)の情報を取り扱うノード。DTDはで表現されうる。削除可 - */ -function DocumentType() { - Node.apply(this); - //以下のメンバは削除可 - this.name = ""; - this.entities = new NamedNodeMap(); //パラメタ実体を除く実体の集まり - this.notations = new NamedNodeMap(); //DTDで示した記法の集まり - this.publicId = ""; //外部サブセットの公開識別子 - this.systemId = ""; //上同のシステム識別子 - this.internalSubset = ""; //内部サブセットの内容(文字列) - this.nodeValue = null; - this.nodeType = /*Node.DOCUMENT_TYPE_NODE*/ 10; -}; -DocumentType.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 - -/*Notation - *DTDの記法の情報を取り扱うノード。か、処理命令で記法は表現されうる。削除可 - */ -function Notation() { - Node.apply(this); - this.publicId = this.systemId = this.nodeValue = null; - this.nodeType = /*Node.NOTATION_NODE*/ 12; -}; -Notation.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 - -/*注意 - *以下のノードは、もし、DOMを展開する前に、XMLプロセッサが実体参照の読み込みを行うのであれば、文書中に挿入される必要はない。 - */ -/*Entity - *解析対象(外)実体ノード。削除可 - */ -function Entity() { - Node.apply(this); - this.publicId = this.systemId = this.notationName = null; //解析対象外実体のための記法名。解析対象実体ではnull - this.nodeValue = null; - this.nodeType = /*Node.ENTITY_NODE*/ 6; -}; -Entity.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 - -/*EntityReference - *実態参照の代わりに挿入されるノード。削除可 - */ -function EntityReference() { - Node.apply(this); - this.nodeValue = null; - this.nodeType = /*Node.ENTITY_REFERENCE_NODE*/ 5; -}; -EntityReference.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 - -/*ProcessingInstruction - *処理命令ノード。スタイルシート処理命令で使うので、削除不可 - */ -function ProcessingInstruction() { - Node.apply(this); - this.nodeType = /*Node.PROCESSING_INSTRUCTION_NODE*/ 7; -}; -ProcessingInstruction.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 - -/*DocumentFragment - *複数のノードを移したりするのに便宜上、用いられる文書ノード。削除可 - */ -function DocumentFragment() { - this.nodeName = "#document-fragment"; - this.nodeValue = null; - this.nodeType = /*Node.DOCUMENT_FRAGMENT_NODE*/ 11; -}; -DocumentFragment.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 - -/*Document - *文書ノード。 - */ -function Document() { - Node.apply(this); - this.nodeName = "#document"; - this.nodeValue = null; - this.nodeType = /*Node.DOCUMENT_NODE*/ 9; - this._id = {}; //getElementByIdで使う -}; -Document.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 -(function(dproto, Text, Element, Attr, Comment) { - /* - *名前空間に対応していないメソッドは、軽量化のため、機能させないようにする。代わりに、**NSメソッドを利用すること。 - *また、createメソッドは工場メソッドである。クラス名をユーザから隠蔽するのに役に立つ。 - *突然、クラス名が変更されても、ライブラリを利用したユーザは、コードを書き換える必要がないなどのメリットがある。 - */ - /*Element*/ dproto.createElement = function( /*string*/ tagName) { - }; - /*createDocumentFragmentメソッド - *切り貼り用のドキュメントを作る。削除可 - */ - /*DocumentFragment*/ dproto.createDocumentFragment = function() { - var s = new DocumentFragment(); - s.ownerDocument = this; - return s; - }; - /*createTextNodeメソッド - *テキストのノードを作る - */ - /*Text*/ dproto.createTextNode = function( /*string*/ data) { - var s = new Text(); - s.data = s.nodeValue = data+""; - s.length = data.length; - s.ownerDocument = this; - return s; - }; - /*createCommentメソッド - *コメントノードを作る - */ - /*Comment*/ dproto.createComment = function( /*string*/ data) { - var s = new Comment(); - s.data = s.nodeValue = data; - s.length = data.length; - s.ownerDocument = this; - return s; - }; - /*createCDATASectionメソッド - *CDATA領域ノードを作る - */ - /*CDATASection*/ dproto.createCDATASection = function( /*string*/ data) { - var s = new CDATASection(); - s.data = s.nodeValue = data; - s.length = data.length; - s.ownerDocument = this; - return s; - }; - /*createProcessingInstructionメソッド - *処理命令ノードを作る - */ - /*ProcessingInstruction*/ dproto.createProcessingInstruction = function( /*string*/ target, /*string*/ data) { - var s = new ProcessingInstruction(); - s.target = s.nodeName = target; - s.data = s.nodeValue = data; - s.ownerDocument = this; - return s; - }; - /*createAttribute - *createAttributeNSを推奨 - */ - /*Attr*/ dproto.createAttribute = function( /*string*/ name) { - }; - /*createEntityReferenceメソッド - *実体参照ノードを作る - */ - /*EntityReference*/ dproto.createEntityReference = function( /*string*/ name) { - var s = new EntityReference(); - s.nodeName = name; - s.ownerDocument = this; - return s; - }; - /*getElementsByTagNameメソッド - *getElementsByTagNameNSを推奨 - */ - /*NodeList*/ dproto.getElementsByTagName = function( /*string*/ tagname) { - return this.getElementsByTagNameNS("*", tagname); - }; - /*importNodeメソッド - *自身のドキュメントノードに、他のドキュメントノードから作られたノードを取り込みたいときに用いる - */ - /*Node*/ dproto.importNode = function( /*Node*/ importedNode, /*boolean*/ deep) { - var s, - imn = importedNode.nodeType, - attr, att, fi, n, uri, ch; - /*以下の処理は引き渡されたimportedNodeがMSXMLによって解析された - *データであることを前提にしている - */ - if (imn === /*Node.ATTRIBUTE_NODE*/ 2) { - uri = importedNode.namespaceURI; - uri = (uri === "") ? null : uri; //空文字列はnullとして扱うようにする(MSXMLが空文字列を返す時の対策) - s = this.createAttributeNS(uri, importedNode.nodeName); - s.nodeValue = importedNode.nodeValue; - } else if (imn === /*Node.TEXT_NODE*/ 3) { - s = this.createTextNode(importedNode.data); - } else if (imn === /*Node.ELEMENT_NODE*/ 1) { - s = this.createElementNS(importedNode.namespaceURI, importedNode.nodeName); - attr = importedNode.attributes; - for (var i=0;attr[i];++i) { //NamedNodeMapを検索する - ch = attr[i]; - uri = ch.namespaceURI; - uri = (uri === "") ? null : uri; //空文字列はnullとして扱うようにする(MSXMLが空文字列を返す時の対策) - att = this.createAttributeNS(uri, ch.nodeName); - att.nodeValue = ch.nodeValue; - s.setAttributeNodeNS(att); - } - if (deep) { - fi = importedNode.firstChild; - while (fi) { //子ノードを検索して、子供がいれば、importNodeメソッドを再帰的に実行する - n = this.importNode(fi, true); - s.appendChild(n); - fi = fi.nextSibling; - } - } - i = void 0; - } else if (imn === /*Node.COMMENT_NODE*/ 8) { - s = this.createComment(importedNode.data); - } else if (imn === /*Node.DOCUMENT_FRAGMENT_NODE*/ 11) { - s = this.createDocumentFragment(); - if (deep) { - ch = importedNode.childNodes; - for (var i=0,chli=ch.length;i 1000) { - /*1秒を超えたらバッファにため込んで後で使う*/ - tob = td.implementation._buffer_ || []; - toli = tob.length; - tob[toli] = this; - tob[toli+1] = evt; - td.implementation._buffer_ = tob; - te = td = etime = etype = ebub = tob = toli = type = void 0; - return true; - } - } - evt.target = te; - evt.eventPhase = 1;//Event.CAPTURING_PHASE - //このノードからドキュメントノードにいたるまでの、DOMツリーのリストを作成しておく - td[ebptype] = null; - /*以下の処理では、documentElementのparentNodeが - *Documentノードではなく、nullになっていることを前提としている。 - *したがって、documentElementのparentNodeがもし、Documentノードのオブジェクトならば、以下を書き換えるべきである - */ - while (te.parentNode) { - te.parentNode[ecptype] = te; - te[ebptype] = te.parentNode; - te = te.parentNode; - } - td[ecptype] = te; - te[ebptype] = td; - /*最初に捕獲フェーズでDOMツリーを下っていき、イベントのターゲットについたら、 - *そこで、浮上フェーズとして折り返すように、反復処理をおこなう。 - */ - te = this; - while (td) { - evt.currentTarget = td; - if (td === te) { //イベントのターゲットに到着(折り返し地点) - type = 2;//Event.AT_TARGET; - } - evt.eventPhase = type; - tce = td._capter; //tceは登録しておいたリスナーのリスト - for (var j=0,tcli=tce.length;j this.length) { //offsetとcountの和が文字全体の長さを超える場合、offsetから最後までのを削除 - next = ""; - } - this.data = pre + next; - this.length = this.data.length; - /*ここから*/ - evt = this.ownerDocument.createEvent("MutationEvents"); - evt.initMutationEvent("DOMCharacterDataModified", true, false, null, pd, this.data, null, null); - this.parentNode.dispatchEvent(evt); - evt = pd = void 0; - /*ここまで追加*/ -}; - -/*_ceventプロパティはcreateEventメソッドで軽量化のために使う。*/ -Document.prototype._cevent = { - "MutationEvents" : MutationEvent, - "MouseEvents" : MouseEvent, - "UIEvents" : UIEvent -}; - - -// _EVENTS_IDL_ - -/* -// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/stylesheets.idl - -#ifndef _STYLESHEETS_IDL_ -#define _STYLESHEETS_IDL_ - -#include "dom.idl" - -#pragma prefix "dom.w3c.org" -module stylesheets -{ - - typedef dom::DOMString DOMString; - typedef dom::Node Node; -*/ - -/*StyleSheet - *スタイルシート文書を示す。削除不可。 - */ -function StyleSheet() { - this.type = "text/css"; - this.disabled = false; - /*Node*/ this.ownerNode = null; - /*StyleSheet*/ this.parentStyleSheet = null; - this.href = null; - this.title = ""; - /*MediaList*/ this.media = new MediaList(); -}; - -/*StyleSheetList - *このインターフェースはArrayで代用する -function StyleSheetList() { - readonly attribute unsigned long length; - StyleSheet item(in unsigned long index); - }; -*/ - -function MediaList() { - this.mediaText = ""; - this.length = 0; -}; -MediaList.prototype = { -/*string*/ item : function(/*long*/ index) { - return (this[index]); - }, -/*void*/ deleteMedium : function(/*string*/ oldMedium) { - for (var i=0,tli=this.length;i -1) { //プロパティ名に合致するCSSValueオブジェクトが見つかった場合 - ti._empercents = tl._fontSize; - i = tl = tli = tc = prop = propertyName = void 0; - return ti; - } - } - i = tl = tli = prop = propertyName = void 0; - return null; - }, - /*removePropertyメソッド - *プロパティを宣言内から除去 - */ -/*string*/ removeProperty : function( /*string*/ propertyName) { - var tg = this.getPropertyCSSValue(propertyName); - if (tg) { //見つかった場合 - this._list.splice(tg._num,1); //Arrayのspliceを利用して、リストからCSSValueオブジェクトを排除 - --this.length; - } - }, - /*getPropertyPriorityメソッド - *importantなどのpriorityを取得する - */ -/*string*/ getPropertyPriority : function( /*string*/ propertyName) { - var tg = this.getPropertyCSSValue(propertyName); - if (tg) { //見つかった場合 - return (tg._priority); - } else { - return ""; - } - }, - _isFillStroke : { - "fill" : 1, - "stroke" : 1 - }, - _isColor : { - "color" : 1 - }, - _isStop : { - "stop-color" : 1 - }, - _isRS : { - "r" : 1, - "#" : 1 - }, - /*setPropertyメソッド - *プロパティを宣言内で、明示的に設定。継承は無視する - */ -/*void*/ setProperty : function( /*string*/ propertyName, /*string*/ value, /*string*/ priority) { - var cssText = propertyName, - tg = null, - ti, paintType, v1, - uri = null, - color = null, - fill, stroke, stop; - if (!!this[propertyName]) { - tg = this.getPropertyCSSValue(propertyName); - } - cssText += ":"; - cssText += value; - if (this._isFillStroke[propertyName]) { - /*fill、strokeプロパティは別途、SVGPaintで処理(JavaScriptでは、型キャストを使えないため) - *CSSPrimitiveValueオブジェクトとSVGPaintオブジェクトを最後に置き換える - */ - if (tg) { //見つかった場合 - ti = tg; - } else { - ti = new SVGPaint(); - } - paintType = /*SVGPaint.SVG_PAINTTYPE_UNKNOWN*/ 0; - v1 = value.charAt(0); - if (this._isRS[v1] || ti._keywords[value]) { - paintType = /*SVGPaint.SVG_PAINTTYPE_RGBCOLOR*/ 1; - color = value; - } else if (value === "none") { - paintType = /*SVGPaint.SVG_PAINTTYPE_NONE*/ 101; - } else if (this._urlreg.test(value)) { //fill属性の値がurl(#id)ならば - paintType = /*SVGPaint.SVG_PAINTTYPE_URI*/ 107; - uri = RegExp.$1; - } else if (value === "currentColor") { - paintType = /*SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR*/ 102; - } - ti.setPaint(paintType, uri, color, null); - paintType = v1 = uri = color = void 0; - } else if (this._isStop[propertyName]) { - if (tg) { //見つかった場合 - ti = tg; - } else { - ti = new SVGColor(); - } - if (value === "currentColor") { - ti.colorType = /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3; - } else { - ti.colorType = /*SVGColor.SVG_COLORTYPE_RGBCOLOR*/ 1; - } - ti.setRGBColor(value); - } else { - if (tg) { //見つかった場合 - ti = tg; - } else { - ti = new CSSPrimitiveValue(); - } - } - ti._priority = priority; - ti.cssText = cssText; - if (!tg) { - //_numプロパティはremovePropertyメソッドで利用する - ti._num = this._list.length; - this._list[ti._num] = ti; - this[propertyName] = 1; - ++this.length; - } - if (value === "inherit") { - ti.cssValueType = /*CSSValue.CSS_INHERIT*/ 0; - } else if (propertyName === "opacity") { - this._list._opacity = +value; - } else if (propertyName === "font-size") { - if (/(%|em|ex)/.test(value)) { - tg = "_" +RegExp.$1; - ti[tg] = parseFloat(value); - } else { - this._em = this._ex = this["_%"] = null; - this._list._fontSize = parseFloat(value); - } - } - cssText = void 0; - }, - /*itemメソッド - *リストの位置にあるプロパティ名を取得する。宣言内のすべてのプロパティ名を取得するのに便利 - */ -/*string*/ item : function( /*long*/ index) { - if (index >= this.length) { //indexの位置にCSSValueが指定されていないとき - var s = ""; - } else { - var s = this._list[index].cssText.substring(0, this._list[index].cssText.indexOf(":")); - } - return s; - } -}; - -function CSSValue() { -}; -/* // UnitTypes -CSSValue.CSS_INHERIT = 0; -CSSValue.CSS_PRIMITIVE_VALUE = 1; -CSSValue.CSS_VALUE_LIST = 2; -CSSValue.CSS_CUSTOM = 3;*/ -CSSValue.prototype = { - cssText : "", - cssValueType : /*CSSValue.CSS_CUSTOM*/ 3, - _isDefault : 0 //デフォルトであるかどうか(独自のプロパティ) -}; - -function CSSPrimitiveValue() { -}; - -(function(t) { -/*t.CSS_UNKNOWN = 0; -t.CSS_NUMBER = 1; -t.CSS_PERCENTAGE = 2; -t.CSS_EMS = 3; -t.CSS_EXS = 4; -t.CSS_PX = 5; -t.CSS_CM = 6; -t.CSS_MM = 7; -t.CSS_IN = 8; -t.CSS_PT = 9; -t.CSS_PC = 10; -t.CSS_DEG = 11; -t.CSS_RAD = 12; -t.CSS_GRAD = 13; -t.CSS_MS = 14; -t.CSS_S = 15; -t.CSS_HZ = 16; -t.CSS_KHZ = 17; -t.CSS_DIMENSION = 18; -t.CSS_STRING = 19; -t.CSS_URI = 20; -t.CSS_IDENT = 21; -t.CSS_ATTR = 22; -t.CSS_COUNTER = 23; -t.CSS_RECT = 24; -t.CSS_RGBCOLOR = 25;*/ -t.prototype = Object._create(CSSValue); -})(CSSPrimitiveValue); - -(function(){ - this._n = [1, 0.01, 1, 1, 1, 35.43307, 3.543307, 90, 1.25, 15, 1, 180 / Math.PI, 90/100, 1, 1000, 1, 1000, 1]; //CSS_PX単位への変換値(なお、CSS_SはCSS_MSに、CSS_RADとCSS_GRADはCSS_DEGに、CSS_KHZはCSS_HZに統一) - this.cssValueType = /*CSSValue.CSS_PRIMITIVE_VALUE*/ 1; - this.primitiveType = /*CSSPrimitiveValue.CSS_UNKNOWN*/ 0; - this._value = null; - this._percent = 0; //単位に%が使われていた場合、このプロパティの数値を1%として使う - this._empercent = 0; - this._em = this._ex = this["_%"] = null; //emが単位の場合、getComputedStyleメソッドなどで使う - /*void*/ this.setFloatValue = function(/*short*/ unitType, /*float*/ floatValue) { - if ((/*CSSPrimitiveValue.CSS_UNKNOWN*/ 0 >= unitType) && (unitType >= /*CSSPrimitiveValue.CSS_STRING*/ 19)) { //浮動小数点数単位型をサポートしないCSS単位である場合 - throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); - } - this.primitiveType = unitType; - this._value = floatValue * this._n[unitType-1]; //値はあらかじめ、利用しやすいように変換しておく - }; - /*getFloatValueメソッド - *別の単位に変換可能。 - */ - this._regd = /[\d\.]+/; - /*float*/ this.getFloatValue = function(/*short*/ unitType) { - if ((/*CSSPrimitiveValue.CSS_UNKNOWN*/ 0 >= unitType) && (unitType >= /*CSSPrimitiveValue.CSS_STRING*/ 19)) { //浮動小数点数単位型をサポートしないCSS単位である場合 - throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); - } - if (this._value || (this._value === 0)) { //すでに、setFloatValueメソッドによって_valueプロパティが設定されていた場合 - return (this._value / this._n[unitType-1]); - } else { - var tc = this.cssText, - n = tc.slice(-1), - type = 0, - s = +(tc.match(this._regd)); - s = isNaN(s) ? 0 : s; - if (n >= "0" && n <= "9") { - type = /*CSSPrimitiveValue.CSS_NUMBER*/ 1; - if (unitType === 1) { - unitType = tc = n = type = void 0; - return s; - } - } else if (n === "%") { - s *= this._percent; - type = /*CSSPrimitiveValue.CSS_PERCENTAGE*/ 2; - } else if ((n === "m") && (tc.charAt(tc.length-2) === "e")) { - s *= this._empercent; - type = /*CSSPrimitiveValue.CSS_EMS*/ 3; - } else if ((n === "x") && (tc.charAt(tc.length-2) === "e")) { - type = /*CSSPrimitiveValue.CSS_EXS*/ 4; - } else if ((n === "x") && (tc.charAt(tc.length-2) === "p")) { - type = /*CSSPrimitiveValue.CSS_PX*/ 5; - } else if ((n === "m") && (tc.charAt(tc.length-2) === "c")) { - type = /*CSSPrimitiveValue.CSS_CM*/ 6; - } else if ((n === "m") && (tc.charAt(tc.length-2) === "m")) { - type = /*CSSPrimitiveValue.CSS_MM*/ 7; - } else if (n === "n") { - type = /*CSSPrimitiveValue.CSS_IN*/ 8; - } else if (n === "t") { - type = /*CSSPrimitiveValue.CSS_PT*/ 9; - } else if (n === "c") { - type = /*CSSPrimitiveValue.CSS_PC*/ 10; - } - s = s * this._n[type-1] / this._n[unitType-1]; - tc = n = type = unitType = void 0; - return s; - } - }; - /*void*/ this.setStringValue = function(/*short*/ stringType, /*string*/ stringValue) { - if (/*CSSPrimitiveValue.CSS_DIMENSION*/ 18 >= stringType && stringType >= /*CSSPrimitiveValue.CSS_COUNTER*/ 23) { //文字列型をサポートしないCSS単位である場合 - throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); - } - this._value = stringValue; - }; - /*string*/ this.getStringValue = function(/*short*/ stringType) { - if (/*CSSPrimitiveValue.CSS_DIMENSION*/ 18 >= stringType && stringType >= /*CSSPrimitiveValue.CSS_COUNTER*/ 23) { //文字列型をサポートしないCSS単位である場合 - throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); - } - return (this._value); - }; - /*Counter*/ this.getCounterValue = function() { - if (this.primitiveType !== /*CSSPrimitiveValue.CSS_COUNTER*/ 23) { //Counter型ではないとき - throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); - } - return (new Counter()); - }; - /*Rect*/ this.getRectValue = function() { - if (this.primitiveType !== /*CSSPrimitiveValue.CSS_RECT*/ 24) { //Rect型ではないとき - throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); - } - return (new Rect()); - }; - /*RGBColor*/ this.getRGBColorValue = function() { - if (this.primitiveType !== /*CSSPrimitiveValue.CSS_RGBCOLOR*/ 25) { //RGBColor型ではないとき - throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); - } - var s = new RGBColor(), - rgbColor = this.cssText, - n = SVGColor.prototype._keywords[rgbColor]; - if (rgbColor.indexOf("%", 5) > 0) { // %を含むrgb形式の場合 - rgbColor = rgbColor.replace(/[\d.]+%/g, function(t) { - return Math.round((2.55 * parseFloat(t))); - }); - } else if (rgbColor.indexOf("#") > -1) { //#を含む場合 - rgbColor = rgbColor.replace(/[\da-f][\da-f]/gi, function(s) { - return parseInt(s, 16); - }); - } - n = n || rgbColor.match(/\d+/g); - s.red.setFloatValue(/*CSSPrimitiveValue.CSS_NUMBER*/ 1, parseFloat(n[0])); - s.green.setFloatValue(/*CSSPrimitiveValue.CSS_NUMBER*/ 1, parseFloat(n[1])); - s.blue.setFloatValue(/*CSSPrimitiveValue.CSS_NUMBER*/ 1, parseFloat(n[2])); - n = rgbColor = void 0; - return (s); - }; -}).apply(CSSPrimitiveValue.prototype); -/*CSSValueList - *Arrayで代用する - */ -function CSSValueList() { - this.cssValueType = /*CSSValue.CSS_VALUE_LIST*/ 2; - this.length = 0; -}; -CSSValueList.prototype = Object._create(CSSValue); -/*CSSValue*/ CSSValueList.prototype.item = function( /*long*/ index) { - return (this[index]); -}; - -function RGBColor() { - var cs = CSSPrimitiveValue; - this.red = new cs(); - this.green = new cs(); - this.blue = new cs(); - cs = void 0; - this.red.primitiveType = this.green.primitiveType = this.blue.primitiveType = /*CSSPrimitiveValue.CSS_NUMBER*/ 1; -}; - -function Rect() { - var cs = CSSPrimitiveValue; - this.top = new cs(); - this.right = new cs(); - this.bottom = new cs(); - this.left = new cs(); - cs = void 0; -}; - -function Counter() { - this.identifier = this.listStyle = this.separator = ""; -}; - -function ElementCSSInlineStyle() { - var cs = CSSStyleDeclaration; - this.style = new cs(); - this._attributeStyle = new cs(); //プレゼンテーション属性の値を格納する - cs = void 0; -}; - -/*CSS2Properties - *削除不可 - *さらにSVG CSSを付け加えている - */ -var n = "none", - m = "normal", - a = "auto", - CSS2Properties = { - fill : "black", - stroke : n, - cursor : a, - visibility : "visible", - display : "inline-block", - opacity : "1", - fillOpacity : "1", - strokeWidth : "1", - strokeDasharray : n, - strokeDashoffset : "0", - strokeLinecap : "butt", - strokeLinejoin : "miter", - strokeMiterlimit : "4", - strokeOpacity : "1", - writingMode : "lr-tb", - fontFamily : "serif", - fontSize : "12", - color : "black", - fontSizeAdjust : n, - fontStretch : m, - fontStyle : m, - fontVariant : m, - fontWeight : m, - font : "inline", - -//# Gradient properties: - - stopColor : "black", - stopOpacity : "1", - textAnchor : "start", - azimuth : "center", - // raises(dom::DOMException) on setting - //簡略プロパティに関しては、初期値を再考せよ - clip : a, - direction : "ltr", - letterSpacing : m, - lineHeight : m, - overflow : "visible", - textAlign : "left", - textDecoration : n, - textIndent : "0", - textShadow : n, - textTransform : n, - unicodeBidi : m, - verticalAlign : "baseline", - whiteSpace : m, - wordSpacing : m, - zIndex : a, -// # - - mask : n, - markerEnd : n, - markerMid : n, - markerStart : n, - fillRule : "nonzero", - -//# Filter Effects properties: - - enableBackground : "accumulate", - filter : n, - floodColor : "black", - floodOpacity : "1", - lightingColor : "white", - -//# Interactivity properties: - - pointerEvents : "visiblePainted", - -//# Color and Painting properties: - - colorInterpolation : "sRGB", - colorInterpolationFilters : "linearRGB", - colorProfile : a, - colorRendering : a, - imageRendering : a, - marker : "", - shapeRendering : a, - textRendering : a, - -//# Text properties: - - alignmentBaseline : "", - baselineShift : "baseline", - dominantBaseline : a, - glyphOrientationHorizontal : "0deg", - glyphOrientationVertical : a, - kerning : a -}; -n = m = a = void 0; -CSS2Properties.visibility._n = 1; //初期値の設定(_setPaintで使う) - -function CSSStyleSheet() { - StyleSheet.apply(this); -/*CSSRule*/ this.ownerRule = null; -/*CSSRuleList*/ this.cssRules = []; -}; -CSSStyleSheet.prototype = Object._create(StyleSheet); -/*long*/ CSSStyleSheet.prototype.insertRule = function( /*string*/ rule, /*long*/ index) { - var s = new CSSStyleRule(), style = s.style, a, sc = rule.match(/\{[\s\S]+\}/), m; - s.parentStyleSheet = this; - style.cssText = rule; - //style値の解析; - sc = sc.replace(/^[^a-z\-]+/, "") - .replace(/\:\s+/g, ":") - .replace(/\s*;[^a-z\-]*/g, ";"); - a = sc.split(";"); - for (var i=0, ali=a.length;i -1)) { //スタイルシートのプロパティならば - tar._attributeStyle.setProperty(name, evt.newValue, ""); - } - if (evt.relatedNode.localName === "id") { //xml:idあるいはid属性ならば - tar.id = evt.newValue; - } else if ((name === "transform") && !!tar.transform) { - var tft = evt.newValue, - degR = tar._degReg, - coma = tft.match(tar._comaReg), //コマンド文字にマッチ translate - list = tft.match(tar._strReg), //カッコ内のリストにマッチ (10 20 30...) - a,b,c,d,e,f, - lis, - com, - deg, - rad, - degli, - s, - cm, - degz, - etod = evt.target.ownerDocument.documentElement, - ttb = tar.transform.baseVal; - //transform属性の値を、SVGTransformListであるtransformプロパティに結びつける - for (var j=0,cli=coma.length;j= "0" && m <= "9") { //軽量化のためにチェックを設ける - } else if (m === "%") { - if (tar._x1width[name]) { - tea.baseVal._percent = tvw * 0.01; - } else if (tar._y1height[name]) { - tea.baseVal._percent = tvh * 0.01; - } else { - tea.baseVal._percent = Math.sqrt((tvw*tvw + tvh*tvh) / 2) * 0.01; - } - type = /*SVGLength.SVG_LENGTHTYPE_PERCENTAGE*/ 2; - } else if (n === "em") { - type = /*SVGLength.SVG_LENGTHTYPE_EMS*/ 3; - } else if (n === "ex") { - type = /*SVGLength.SVG_LENGTHTYPE_EXS*/ 4; - } else if (n === "px") { - type = /*SVGLength.SVG_LENGTHTYPE_PX*/ 5; - } else if (n === "cm") { - type = /*SVGLength.SVG_LENGTHTYPE_CM*/ 6; - } else if (n === "mm") { - type = /*SVGLength.SVG_LENGTHTYPE_MM*/ 7; - } else if (n === "in") { - type = /*SVGLength.SVG_LENGTHTYPE_IN*/ 8; - } else if (n === "pt") { - type = /*SVGLength.SVG_LENGTHTYPE_PT*/ 9; - } else if (n === "pc") { - type = /*SVGLength.SVG_LENGTHTYPE_PC*/ 10; - } - s = _parseFloat(evt.newValue); - s = isNaN(s) ? 0 : s; - tea.baseVal.newValueSpecifiedUnits(type, s); - tea = tod = tvw = tvh = n = type = _parseFloat = s = void 0; - } - evt = _parseFloat = name = tar = null; - }, false); -}; -SVGElement.prototype = Object._create(Element); - -/*関数スコープを避けるため、グローバルスコープでevalさせる関数*/ -NAIBU.eval = function(code) { - eval(code); -}; - -(function(){ - /*以下の正規表現は属性のパーサの際に用いる*/ - this._degReg = /[\-\d\.e]+/g; - this._comaReg = /[A-Za-z]+(?=\s*\()/g; - this._strReg = /\([^\)]+\)/g; - this._syouReg = /^[^a-z\-]+/; - this._conReg = /\:\s+/g; - this._bouReg = /\s*;[^a-z\-]*/g; - /*_cacheMatrixプロパティはSVGMatrixのキャッシュとして、 - *getCTMメソッドで使う - */ - this._cacheMatrix = null; - /*以下のオブジェクトは単位がパーセント付きの属性の名前を示し、処理に使う*/ - this._x1width = { - "x" : 1, - "x1" : 1, - "x2" : 1, - "width" : 1, - "cx" : 1 - }; - this._y1height = { - "y" : 1, - "y1" : 1, - "y2" : 1, - "height" : 1, - "cy" : 1 - }; - /*String*/ this.id = null; //id属性の値 - /*String*/ this.xmlbase = null; //xml:base属性の値 - /*SVGSVGElement*/ this.ownerSVGElement; //ルート要素であるsvg要素 - /*readonly SVGElement*/ this.viewportElement; //ビューポートを形成する要素(多くはsvg要素) - /*readonly attribute SVGElement*/ this.nearestViewportElement = null; - /*readonly attribute SVGElement*/ this.farthestViewportElement = null; - - /*interface SVGLocatable*/ - /*SVGRect*/ this.getBBox = function(){ - var s = new SVGRect(), - data = this._tar.path.value, - vi = this.ownerDocument.documentElement.viewport, - el = vi.width, - et = vi.height, - er = 0, - eb = 0, - degis = data.match(/[0-9\-]+/g), - nx, - ny; - /*要素の境界領域を求める(四隅の座標を求める) - *etは境界領域の上からビューポート(例えばsvg要素)の上端までの距離であり、ebは境界領域の下からビューポートの下端までの距離 - *elは境界領域の左からビューポートの左端までの距離であり、erは境界領域の右からビューポートの右端までの距離 - */ - for (var i=0,degisli=degis.length;i nx ? nx : el; - et = et > ny ? ny : et; - er = er > nx ? er : nx; - eb = eb > ny ? eb : ny; - } - s.x = el; - s.y = et; - s.width = er - el; - s.height = eb - et; - nx = ny = data = degis =el = et = er = eb = vi = void 0; - return s; - }; - - /*getCTMメソッド - *CTMとは現在の利用座標系に対する変換行列 - *注意点として、SVG1.1とSVG Tiny1.2では内容が異なる。たとえば、 - *1.2ではgetCTMが言及されていない - *もし、要素の中心座標を取得したい人がいれば、transformプロパティのconsolidateメソッドを使うこと - */ - /*SVGMatrix*/ this.getCTM = function() { - var s, m; - if (!!this._cacheMatrix) { //キャッシュがあれば - s = this._cacheMatrix; - } else { - m = this.transform.baseVal.consolidate(); - if (m) { - m = m.matrix; - } else { - m = this.ownerDocument.documentElement.createSVGMatrix(); - } - if (this.parentNode && !!this.parentNode.getCTM) { - s = this.parentNode.getCTM().multiply(m); - } else { - s = m; - } - m = void 0; - this._cacheMatrix = s; //キャッシュをためて次回で使う - } - return s; - }; - - /*SVGMatrix*/ this.getScreenCTM = function(){ - if (!this.parentNode) { - return null; - } - var view = this.nearestViewportElement || this.ownerDocument.documentElement; - var s = view.getScreenCTM().multiply(this.getCTM()); - view = null; - return s; - }; - - /*getTransformToElementメソッド - *これは、あるelementへの変換行列を計算して返す - *たとえばある要素から別の要素への引越しをする際の変換行列を算出することが可能 - */ - /*SVGMatrix*/ this.getTransformToElement = function(/*SVGElement*/ element ){ - var s = this.getScreenCTM().inverse().multiply(element.getScreenCTM()); - return s; - }; -}).apply(SVGElement.prototype); - -function SVGAnimatedBoolean() { - /*boolean*/ this.animVal = this.baseVal = true; -}; - -function SVGAnimatedString() { - /*String*/ this.animVal = this.baseVal = ""; -}; - -function SVGStringList() { -}; -SVGStringList.prototype = Object._create(Array); -(function(){ - /*readonly unsigned long*/ this.numberOfItems = 0; - /*void*/ this.clear = function(){ - for (var i=0, tli=this.length;i= this.numberOfItems || index < 0) { - throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); - } else { - return (this[index]); - } - }; - /*DOMString*/ this.insertItemBefore = function(/*DOMString*/ newItem, /*unsigned long*/ index ){ - if (index >= this.numberOfItems) { - this.appendItem(newItem); - } else { - this.splice(index, 1, newItem, this.getItem[index]); - ++this.numberOfItems; - } - return newItem; - }; - /*DOMString*/ this.replaceItem = function(/*DOMString*/ newItem, /*unsigned long*/ index ){ - if (index >= this.numberOfItems || index < 0) { - throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); - } else { - this.splice(index, 1, newItem); - } - return newItem; - }; - //raises( DOMException, SVGException ); - /*DOMString*/ this.removeItem = function(/*unsigned long*/ index ){ - if (index >= this.numberOfItems || index < 0) { - throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); - } else { - this.splice(index, 1); - --this.numberOfItems; - } - return newItem; - }; - /*DOMString*/ this.appendItem = function(/*DOMString*/ newItem ){ - this[this.numberOfItems] = newItem; - ++this.numberOfItems; - }; -}).apply(SVGStringList.prototype); - -function SVGAnimatedEnumeration() { - /*unsigned short*/ this.baseVal = 0; - // raises DOMException on setting - /*readonly unsigned short*/ this.animVal = 0; -}; -function SVGAnimatedInteger() { - /*long*/ this.baseVal = 0; - // raises DOMException on setting - /*readonly long*/ this.animVal = 0; -}; -function SVGNumber() { - /*float*/ this.value = 0; - // raises DOMException on setting -}; -function SVGAnimatedNumber() { - /*float*/ this.baseVal = this.animVal = 0; -}; - -function SVGNumberList() { -}; -/*SVGUnmberListのメソッドはSVGPathSegListを参照*/ - -function SVGAnimatedNumberList() { - /*readonly SVGNumberList*/ this.animVal = this.baseVal = new SVGNumberList(); -}; -/*SVGLengthクラス - *長さを設定する(単位pxに統一する方便として使う) - *valueInSpecifiedUnitsプロパティはpxに統一する前の数値。valueプロパティはpxに統一した後の数値 - */ -function SVGLength() { -}; -/*(function(t) { - // Length Unit Types - /*const unsigned short t.SVG_LENGTHTYPE_UNKNOWN = 0; - /*const unsigned short t.SVG_LENGTHTYPE_NUMBER = 1; - /*const unsigned short t.SVG_LENGTHTYPE_PERCENTAGE = 2; - /*const unsigned short t.SVG_LENGTHTYPE_EMS = 3; - /*const unsigned short t.SVG_LENGTHTYPE_EXS = 4; - /*const unsigned short t.SVG_LENGTHTYPE_PX = 5; - /*const unsigned short t.SVG_LENGTHTYPE_CM = 6; - /*const unsigned short t.SVG_LENGTHTYPE_MM = 7; - /*const unsigned short t.SVG_LENGTHTYPE_IN = 8; - /*const unsigned short t.SVG_LENGTHTYPE_PT = 9; - /*const unsigned short t.SVG_LENGTHTYPE_PC = 10; -})(SVGLength);*/ - -SVGLength.prototype = { - /*readonly attribute unsigned short*/ unitType : /*SVGLength.SVG_LENGTHTYPE_UNKNOWN*/ 0, - /*attribute float*/ value : 0, //利用単位における値 - /*attribute float*/ valueInSpecifiedUnits : /*SVGLength.SVG_LENGTHTYPE_UNKNOWN*/ 0, //unitTypeにおける値 - /*attribute DOMString*/ valueAsString : "0", - _percent : 0.01, //単位に%が使われていた場合、このプロパティの数値を1%として使う - _fontSize : 12, //単位のemとexで使われるfont-sizeの値 -/*newValueSpedifiedUnitsメソッド - *新しくunitTypeにおける値を設定する - *例:2pxならば、x.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 2);となる - */ - newValueSpecifiedUnits : function (/*unsigned short*/ unitType, /*float*/ valueInSpecifiedUnits) { - var n = 1, - _s = ""; //nは各単位から利用単位への変換数値。_sは単位の文字列を表す - if (unitType === /*SVGLength.SVG_LENGTHTYPE_NUMBER*/ 1) { - } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_PX*/ 5) { - _s = "px"; - } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_PERCENTAGE*/ 2) { - n = this._percent; - _s = "%"; - } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_EMS*/ 3) { - n = this._fontSize; - _s = "em"; - } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_EXS*/ 4) { - n = this._fontSize * 0.5; - _s = "ex"; - } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_CM*/ 6) { - n = 35.43307; - _s = "cm"; - } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_MM*/ 7) { - n = 3.543307; - _s = "mm"; - } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_IN*/ 8) { - n = 90; - _s = "in"; - } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_PT*/ 9) { - n = 1.25; - _s = "pt"; - } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_PC*/ 10) { - n = 15; - _s = "pc"; - } else { - throw new DOMException(/*DOMException.NOT_SUPPORTED_ERR*/ 9); - } - this.unitType = unitType; - this.value = valueInSpecifiedUnits * n; - this.valueInSpecifiedUnits = valueInSpecifiedUnits; - this.valueAsString = valueInSpecifiedUnits + _s; - valueInSpecifiedUnits = unitType = n = _s = void 0; - }, -/*convertToSpecifiedUnitsメソッド - *valueプロパティを書き換えずに、単位だけを変換する - *例:2cmをmmに変換したい場合 - * x.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_CM, 2); - * x.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_MM); - * alert(x.valueAsString); //20mm - */ - convertToSpecifiedUnits : function (/*unsigned short*/ unitType) { - if (this.value === 0) { - this.newValueSpecifiedUnits(unitType, 0); - return; - } - var v = this.value; - this.newValueSpecifiedUnits(unitType, this.valueInSpecifiedUnits); - v = v / this.value * this.valueInSpecifiedUnits; - this.newValueSpecifiedUnits(unitType, v); - }, - /*_emToUnitメソッド - *emやexが単位に使われていたときに、@fontSizeの値を手がかりに、新たな値へとvalueを変換させる - *単位が%の場合は、新しいvalueへと変換させておく - */ - _emToUnit : function (/*float*/ fontSize) { - if ((this.unitType === /*SVGLength.SVG_LENGTHTYPE_EMS*/ 3) || (this.unitType === 4)) { - this._fontSize = fontSize; - this.newValueSpecifiedUnits(this.unitType, this.valueInSpecifiedUnits); - } - } -}; -function SVGAnimatedLength() { - /*readonly SVGLength*/ this.animVal; - this.baseVal = new SVGLength(); - this.baseVal.unitType = 1; -}; -function SVGLengthList() { -}; -/*SVGLengthListのメソッドはSVGPathSegListを参照*/ - -function SVGAnimatedLengthList() { - /*readonly SVGNumberList*/ this.animVal = this.baseVal = new SVGLengthList(); -}; -function SVGAngle() { -}; -SVGAngle.prototype = { - /*readonly attribute unsigned short*/ unitType : 0, - /*attribute float*/ value : 0, - // raises DOMException on setting - /*attribute float*/ valueInSpecifiedUnits : 0, - // raises DOMException on setting - /*attribute DOMString*/ valueAsString : "0", - // raises DOMException on setting - /*void*/ newValueSpecifiedUnits : function (/*in unsigned short*/ unitType, /*in float*/ valueInSpecifiedUnits ) { - var n = 1, - _s = ""; //nは各単位から度への変換数値。_sは単位の文字列を表す - if (unitType === /*SVGAngle.SVG_ANGLETYPE_UNSPECIFIED*/ 1) { - } else if (unitType === /*SVGAngle.SVG_ANGLETYPE_DEG*/ 2) { - _s = "deg"; - } else if (unitType === /*SVGAngle.SVG_ANGLETYPE_RAD*/ 3) { - n = Math.PI / 180; - _s = "rad"; - } else if (unitType === /*SVGAngle.SVG_ANGLETYPE_GRAD*/ 4) { - n = 9 / 10; - _s = "grad"; - } else { - throw new DOMException(/*DOMException.NOT_SUPPORTED_ERR*/ 9); - } - this.unitType = unitType; - this.value = valueInSpecifiedUnits * n; - this.valueInSpecifiedUnits = valueInSpecifiedUnits; - this.valueAsString = valueInSpecifiedUnits + _s; - n = _s = void 0; - //raises( DOMException ); - }, - /*void*/ convertToSpecifiedUnits : function (/*in unsigned short*/ unitType ) { - if (this.value === 0) { - this.newValueSpecifiedUnits(unitType, 0); - return; - } - var v = this.value; - this.newValueSpecifiedUnits(unitType, this.valueInSpecifiedUnits); - v = v / this.value * this.valueInSpecifiedUnits; - this.newValueSpecifiedUnits(unitType, v); - //raises( DOMException ); - } -}; -// Angle Unit Types -/*const unsigned short SVGAngle.SVG_ANGLETYPE_UNKNOWN = 0; -/*const unsigned short SVGAngle.SVG_ANGLETYPE_UNSPECIFIED = 1; -/*const unsigned short SVGAngle.SVG_ANGLETYPE_DEG = 2; -/*const unsigned short SVGAngle.SVG_ANGLETYPE_RAD = 3; -/*const unsigned short SVGAngle.SVG_ANGLETYPE_GRAD = 4;*/ -function SVGAnimatedAngle() { - /*readonly attribute SVGAngle*/ this.baseVal = new SVGAngle(); - /*readonly attribute SVGAngle*/ this.animVal = this.baseVal; -}; -function SVGColor() { - CSSValue.apply(this); - /*readonly css::RGBColor*/ this.rgbColor = new RGBColor(); -}; - - // Color Types -/*unsigned short SVGColor.SVG_COLORTYPE_UNKNOWN = 0; -/*unsigned short SVGColor.SVG_COLORTYPE_RGBCOLOR = 1; -/*unsigned short SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2; -/*unsigned short SVGColor.SVG_COLORTYPE_CURRENTCOLOR = 3;*/ -SVGColor.prototype = Object._create(CSSValue); //ノードのプロトタイプチェーンを作って、継承 - -(function(){ - /*readonly unsigned short*/ this.colorType = /*SVGColor.SVG_COLORTYPE_UNKNOWN*/ 0; - /*readonly SVGICCColor*/ this.iccColor = null; - this._regD = /\d+/g; - this._regDP = /[\d.]+%/g; - this._exceptionsvg = /*SVGException.SVG_INVALID_VALUE_ERR*/ 1; - /*void*/ this.setRGBColor = function(/*DOMString*/ rgbColor ){ - var s, - _parseInt, - r, g, b; - if (!rgbColor || (typeof rgbColor !== "string")) { - throw new SVGException(this._exceptionsvg); - } - s = this._keywords[rgbColor]; - if (s) { - } else if (rgbColor.indexOf("%", 5) > 0) { // %を含むrgb形式の場合 - rgbColor = rgbColor.replace(this._regDP, function(s) { - return Math.round((2.55 * parseFloat(s))); - }); - s = rgbColor.match(this._regD); - } else if (rgbColor.indexOf("#") === 0) { //#を含む場合 - s = []; - _parseInt = parseInt; - if (rgbColor.length < 5) { - r = rgbColor.charAt(1); - g = rgbColor.charAt(2); - b = rgbColor.charAt(3); - rgbColor = "#" + r + r + g + g + b + b; - } - s[0] = _parseInt(rgbColor.slice(1, 3), 16)+ ""; - s[1] = _parseInt(rgbColor.slice(3, 5), 16)+ ""; - s[2] = _parseInt(rgbColor.slice(5, 7), 16)+ ""; - r = g = b = void 0; - } else { - s = rgbColor.match(this._regD); - if (!s || (s.length < 3)) { //数値が含まれていなければ強制的に終了 - rgbColor = void 0; - throw new SVGException(this._exceptionsvg); - } - } - this.rgbColor.red.setFloatValue(/*CSSPrimitiveValue.CSS_NUMBER*/ 1, s[0]); - this.rgbColor.green.setFloatValue(1, s[1]); - this.rgbColor.blue.setFloatValue(1, s[2]); - rgbColor = s = _parseInt = void 0; -}; - -// raises( SVGException ); -/*void*/ this.setColor =function(/*unsigned short*/ colorType, /*DOMString*/ rgbColor, /*DOMString*/ iccColor ){ - this.colorType = colorType; - if ((colorType === /*SVGColor.SVG_COLORTYPE_RGBCOLOR*/ 1) && iccColor) { - throw new SVGException(this._exceptionsvg); - } else if (colorType === /*SVGColor.SVG_COLORTYPE_RGBCOLOR*/ 1) { - this.setRGBColor(rgbColor); - } else if (rgbColor && (colorType === /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3)) { - this.setRGBColor(rgbColor); - } else if ((colorType === /*SVGColor.SVG_COLORTYPE_UNKNOWN*/ 0) && (rgbColor || iccColor)) { - throw new SVGException(this._exceptionsvg); - } else if ((colorType === /*SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR*/ 2) && (rgbColor || !iccColor)) { - throw new SVGException(this._exceptionsvg); - } - colorType = rgbColor = void 0; -}; -// raises( SVGException ); -//色キーワード -this._keywords = { - aliceblue: [240,248,255], - antiquewhite: [250,235,215], - aqua: [0,255,255], - aquamarine: [127,255,212], - azure: [240,255,255], - beige: [245,245,220], - bisque: [255,228,196], - black: [0,0,0], - blanchedalmond:[255,235,205], - blue: [0,0,255], - blueviolet: [138,43,226], - brown: [165,42,42], - burlywood: [222,184,135], - cadetblue: [95,158,160], - chartreuse: [127,255,0], - chocolate: [210,105,30], - coral: [255,127,80], - cornflowerblue:[100,149,237], - cornsilk: [255,248,220], - crimson: [220,20,60], - cyan: [0,255,255], - darkblue: [0,0,139], - darkcyan: [0,139,139], - darkgoldenrod:[184,134,11], - darkgray: [169,169,169], - darkgreen: [0,100,0], - darkgrey: [169,169,169], - darkkhaki: [189,183,107], - darkmagenta: [139,0,139], - darkolivegreen:[85,107,47], - darkorange: [255,140,0], - darkorchid: [153,50,204], - darkred: [139,0,0], - darksalmon: [233,150,122], - darkseagreen: [143,188,143], - darkslateblue:[72,61,139], - darkslategray:[47,79,79], - darkslategrey:[47,79,79], - darkturquoise:[0,206,209], - darkviolet: [148,0,211], - deeppink: [255,20,147], - deepskyblue: [0,191,255], - dimgray: [105,105,105], - dimgrey: [105,105,105], - dodgerblue: [30,144,255], - firebrick: [178,34,34], - floralwhite: [255,250,240], - forestgreen: [34,139,34], - fuchsia: [255,0,255], - gainsboro: [220,220,220], - ghostwhite: [248,248,255], - gold: [255,215,0], - goldenrod: [218,165,32], - gray: [128,128,128], - grey: [128,128,128], - green: [0,128,0], - greenyellow: [173,255,47], - honeydew: [240,255,240], - hotpink: [255,105,180], - indianred: [205,92,92], - indigo: [75,0,130], - ivory: [255,255,240], - khaki: [240,230,140], - lavender: [230,230,250], - lavenderblush:[255,240,245], - lawngreen: [124,252,0], - lemonchiffon: [255,250,205], - lightblue: [173,216,230], - lightcoral: [240,128,128], - lightcyan: [224,255,255], - lightgoldenrodyellow:[250,250,210], - lightgray: [211,211,211], - lightgreen: [144,238,144], - lightgrey: [211,211,211], - lightpink: [255,182,193], - lightsalmon: [255,160,122], - lightseagree: [32,178,170], - lightskyblue: [135,206,250], - lightslategray:[119,136,153], - lightslategrey:[119,136,153], - lightsteelblue:[176,196,222], - lightyellow: [255,255,224], - lime: [0,255,0], - limegreen: [50,205,50], - linen: [250,240,230], - magenta: [255,0,255], - maroon: [128,0,0], - mediumaquamarine:[102,205,170], - mediumblue: [0,0,205], - mediumorchid: [186,85,211], - mediumpurple: [147,112,219], - mediumseagreen:[60,179,113], - mediumslateblue:[123,104,238], - mediumspringgreen:[0,250,154], - mediumturquoise:[72,209,204], - mediumvioletred:[199,21,133], - midnightblue: [25,25,112], - mintcream: [245,255,250], - mistyrose: [255,228,225], - moccasin: [255,228,181], - navajowhite: [255,222,173], - navy: [0,0,128], - oldlace: [253,245,230], - olive: [128,128,0], - olivedrab: [107,142,35], - orange: [255,165,0], - orangered: [255,69,0], - orchid: [218,112,214], - palegoldenrod: [238,232,170], - palegreen: [152,251,152], - paleturquoise: [175,238,238], - palevioletred: [219,112,147], - papayawhip: [255,239,213], - peachpuff: [255,218,185], - peru: [205,133,63], - pink: [255,192,203], - plum: [221,160,221], - powderblue: [176,224,230], - purple: [128,0,128], - red: [255,0,0], - rosybrown: [188,143,143], - royalblue: [65,105,225], - saddlebrown: [139,69,19], - salmon: [250,128,114], - sandybrown: [244,164,96], - seagreen: [46,139,87], - seashell: [255,245,238], - sienna: [160,82,45], - silver: [192,192,192], - skyblue: [135,206,235], - slateblue: [106,90,205], - slategray: [112,128,144], - slategrey: [112,128,144], - snow: [255,250,250], - springgreen: [0,255,127], - steelblue: [70,130,180], - tan: [210,180,140], - teal: [0,128,128], - thistle: [216,191,216], - tomato: [255,99,71], - turquoise: [64,224,208], - violet: [238,130,238], - wheat: [245,222,179], - white: [255,255,255], - whitesmoke: [245,245,245], - yellow: [255,255,0], - yellowgreen: [154,205,50] -}; -}).apply(SVGColor.prototype); - -function SVGRect() { - /*float*/ this.x = 0; - // raises DOMException on setting - /*float*/ this.y = 0; - // raises DOMException on setting - /*float*/ this.width = 0; - // raises DOMException on setting - /*float*/ this.height = 0; - // raises DOMException on setting -}; - -function SVGAnimatedRect() { - /*readonly SVGRect*/ this.animVal = this.baseVal = new SVGRect(); -}; - -/*SVGUnitTypes = { - // Unit Types - /*unsigned short SVG_UNIT_TYPE_UNKNOWN : 0, - /*unsigned short SVG_UNIT_TYPE_USERSPACEONUSE : 1, - /*unsigned short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX : 2 -};*/ -function SVGStylable() { - /*readonly attribute SVGAnimatedString*/ this.className = new SVGAnimatedString(); - /*readonly attribute css::CSSStyleDeclaration*/ this.style = new CSSStyleDeclaration(); - this._attributeStyle = new CSSStyleDeclaration(); //プレゼンテーション属性の値を格納する - //styleのcssTextプロパティを解析するリスナーを登録しておく -}; -/*getPresentationAttributeメソッド - *プレゼンテーション属性の値をCSSValueとして得る。これはCSSのスタイルの設定値を定めるときや、内部の動的処理に役立つ - */ -/*css::CSSValue*/ SVGElement.prototype.getPresentationAttribute = function( /*DOMString*/ name ){ - var s = this._attributeStyle.getPropertyCSSValue(name); - if (s) { - return s; - } else { - return null; - } -}; - -/*SVGURIReferenceオブジェクトはURI参照を用いる要素に適用される - *SIEでは、もっぱらXLink言語の処理を行う - */ -function SVGURIReference() { - /*readonly SVGAnimatedString*/ this.href = new SVGAnimatedString(); - this._instance = null; //埋め込みの場合に、読み込んだDOMツリーを結び付けておくプロパティ - this._text = ""; - this.addEventListener("DOMAttrModified", function(evt){ - if ((evt.relatedNode.namespaceURI === "http://www.w3.org/1999/xlink") && (evt.attrName === "xlink:href")) { - evt.target.href.baseVal = evt.newValue; - /*_svgload_limitedを+1とすることで、 - *SVGLoadイベントは発火されなくなる。1を引く必要がある - */ - evt.target.ownerDocument.documentElement._svgload_limited++; - } - evt = void 0; - }, false); - this.addEventListener("DOMNodeInserted", function(evt){ - var tar = evt.target; - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ - var tar = evt.target, - base = location.href, - href = tar.href.baseVal, - doc = tar.ownerDocument, - durl = doc.URL, - reg = /\.+\//g, - regg = /\/[^\/]+?(\/[^\/]*?)$/, - fe, show, egbase, ep, b, uri, xmlhttp, ui, id, ele, ev; - /*xlink:href属性とxml:base属性を手がかりに、 - *ハイパーリンクのURIを決定する処理を行う - */ - if (href !== "") { //xlink:href属性が指定されたとき - egbase = tar.xmlbase; - if (!egbase) { - ep = tar.parentNode; - b = null; - while (!b && ep) { - b = ep.xmlbase; - ep = ep.parentNode; - } - egbase = b; - } - fe = function(durl, base) { - if (href.indexOf(":") > -1) { //絶対URIの場合 - uri = href; - } else if (durl.indexOf(":") > -1) { - base = durl; - } else { - /*durlが相対URLの場合はdirecoryの名前を消す*/ - reg.lastIndex = 0; // execメソッドを使うため - while (reg.exec(durl)) { - base = base.replace(regg, "$1"); - } - base = base.replace(/\/[^\/]+?$/, "/"); //URIの最後尾にあるファイル名は消す。例: /n/sie.js -> /n/ - base = base + durl.replace(reg, ""); - } - return base; - }; - base = fe(durl, base); - if (egbase) { - base = fe(egbase, base); //xml:base属性の指定がある場合 - } - if (href.indexOf("#") === 0) { //href属性において#が一番につく場合 - uri = href; - } else if (!uri){ - base = base.replace(/\/[^\/]+?$/, "/"); - reg.lastIndex = 0; // execメソッドを使うため - while (reg.exec(href)) { - base = base.replace(regg, "$1"); - } - uri = base + href.replace(reg, ""); - } - show = tar.getAttributeNS("http://www.w3.org/1999/xlink", "show") || "embed"; - if (show === "replace") { - tar._tar.setAttribute("href", uri); - } else if (show === "new") { - tar._tar.setAttribute("target", "_blank"); - tar._tar.setAttribute("href", uri); - } else if (show === "embed") { - xmlhttp = NAIBU.xmlhttp; - ui = uri.indexOf("#"); - if (ui > -1) { - id = uri.slice(ui+1); - uri = uri.replace(/#.+$/, ""); - } else { - id = null; - } - if (href.indexOf("#") === 0) { //URIが#で始まるのであれば - ele = doc.getElementById(id); - tar._instance = ele; - ev = doc.createEvent("SVGEvents"); - ev.initEvent("S_Load", false, false); - tar.dispatchEvent(ev); - tar = xmlhttp = void 0; - } else if (uri.indexOf("data:") > -1) { - tar._tar.src = uri; - tar = xmlhttp = void 0; - } else if ((uri.indexOf("http:") > -1)){ - if ((tar.localName === "image") && (uri.indexOf(".svg") === -1)) { - tar._tar.src = uri; - } else { - /*ここの_svgload_limitedは、リンクを読み込んだ後でSVGLoadイベントを実行させるという遅延処理で必要*/ - tar.ownerDocument.documentElement._svgload_limited++; - xmlhttp.open("GET", uri, false); - xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - xmlhttp.onreadystatechange = function() { - if ((xmlhttp.readyState === 4) && (xmlhttp.status === 200)) { - var type = xmlhttp.getResponseHeader('Content-Type') || "text", - doc, str, ele, ev; - if ((type.indexOf("text") > -1) || (type.indexOf("xml") > -1) || (type.indexOf("script") > -1)) { //ファイルがtext形式である場合 - /*responseXMLを使うと、時々、空のデータを返すことがあるため(原因はcontent-typeが"text/xml"など特定のものでないと受け付けないため)、 - *ここでは、responseTextを用いる - */ - /*script要素とstyle要素は、 - *_textプロパティに読み込んだテキストを格納しておく - *それら以外は、_instanceプロパティにDOMツリーを格納しておく - */ - if (tar.localName !== "script" && tar.localName !== "style") { - doc = new ActiveXObject("MSXML2.DomDocument"); - str = xmlhttp.responseText.replace(/!DOCTYPE/,"!--").replace(/(dtd">|\]>)/,"-->"); - NAIBU.doc.async = false; - NAIBU.doc.validateOnParse = false; - NAIBU.doc.resolveExternals = false; - NAIBU.doc.preserveWhiteSpace = false; - doc.loadXML(str); - ele = doc.documentElement; - tar._instance = tar.ownerDocument.importNode(ele, true); - if (id) { - tar._instance = tar._instance.ownerDocument.getElementById(id); - } - } else { - tar._text = xmlhttp.responseText; - } - } else if (!!tar._tar) { - tar._tar.src = uri; - } - /*S_LoadイベントとはSIE独自のイベント。 - *XLink言語によって、リンク先のコンテンツが読み込まれた時点で発火する - */ - ev = tar.ownerDocument.createEvent("SVGEvents"); - ev.initEvent("S_Load", false, false); - tar.dispatchEvent(ev); - tar.ownerDocument.documentElement._svgload_limited--; - /*すべてのリンクが読み込みを終了した場合、SVGLoadイベントを発火*/ - if (tar.ownerDocument.documentElement._svgload_limited < 0) { - ev = tar.ownerDocument.createEvent("SVGEvents"); - ev.initEvent("SVGLoad", false, false); - tar.ownerDocument.documentElement.dispatchEvent(ev); - } - tar = type = doc = str = ev = void 0; - /*IEのメモリリーク対策として、空関数を入力*/ - xmlhttp.onreadystatechange = NAIBU.emptyFunction; - xmlhttp = void 0; - } - }; - xmlhttp.send(null); - } - } - } - tar.ownerDocument.documentElement._svgload_limited--; - } - evt = base = href = egbase = fe = ep = durl = b = reg = uri = ui = id = doc = ele = ev = show= void 0; - }, false); - tar = evt = void 0; - }, false); -}; -function SVGCSSRule() { - CSSRule.apply(this); - // Additional CSS RuleType to support ICC color specifications - /*const unsigned short*/ this.COLOR_PROFILE_RULE = 7; -}; -SVGCSSRule.prototype = Object._create(CSSRule); //ノードのプロトタイプチェーンを作って、継承 - -/*SVGDocument - *SVGの文書オブジェクト - */ -function SVGDocument(){ - Document.apply(this); - DocumentStyle.apply(this); - /*readonly DOMString*/ this.title = ""; - /*readonly DOMString*/ this.referrer = document.referrer; - /*readonly DOMString*/ this.domain = document.domain; - /*readonly DOMString*/ this.URL = document.location; - /*readonly SVGSVGElement*/ this.rootElement; -}; -SVGDocument.prototype = Object._create(Document); //ノードのプロトタイプチェーンを作って、継承 - -/*軽量化のために、頻繁に使われる処理をSVGDocumentの独自メソッドとしてまとめておく*/ -SVGDocument.prototype._domnodeEvent = function() { - var evtt = this.createEvent("MutationEvents"); - evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); - return evtt; -}; - -/*SVGSVGElement - *svg要素をあらわすオブジェクト - */ -function SVGSVGElement(_doc) { - SVGElement.apply(this, arguments); - _doc && (this._tar = _doc.createElement("v:group")); - _doc = void 0; - /*_svgload_limitedはSVGLoadイベントを発火させる判定基準。 - * Xlink言語が使われていない限り0であり、SVGLoadイベントが発火される*/ - this._svgload_limited = 0; -/* SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGLocatable, - SVGFitToViewBox, - SVGZoomAndPan, - events::EventTarget, - events::DocumentEvent, - css::ViewCSS, - css::DocumentCSS {*/ - /*以下のx,y,width,heightプロパティは - *それぞれ、svg要素の同名属性に対応。たとえば、xならば、x属性に対応している - *1000というのは、W3Cで触れていないため、独自の初期値を採用 - */ - var slen = SVGAnimatedLength; - /*readonly SVGAnimatedLength*/ this.x = new slen(); - /*readonly SVGAnimatedLength*/ this.y = new slen(); - /*readonly SVGAnimatedLength*/ this.width = new slen(); - /*readonly SVGAnimatedLength*/ this.height = new slen(); - slen = void 0; - /*DOMString*/ this.contentScriptType = "application/ecmascript"; //古い仕様では、text/ecmascript - /*DOMString*/ this.contentStyleType = "text/css"; - /*readonly SVGRect*/ this.viewport = this.createSVGRect(); - /*useCurrentViewプロパティ - * view要素やハイパーリンクなどで呼び出された場合、true。それ以外の通常表示はfalse。 - */ - /*boolean*/ this.useCurrentView = false; - /*currentViewプロパティ - * ズームやパンがされていない初期表示のviewBoxプロパティなどを示す。通常はDOM属性と連動 - */ - /*readonly SVGViewSpec*/ this.currentView = new SVGViewSpec(this); - /*もし、画像をズームやパンしたとき、どのような倍率になるかを - *以下のプロパティを使って次の行列で示すことができる - *2x3 行列 [a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y] - */ - /*float*/ this.currentScale = 1; - /*readonly SVGPoint*/ this.currentTranslate = this.createSVGPoint(); - /*以下は、SVGFitToViewBoxのインターフェースを用いる - *もし、ズームやパンがあれば、真っ先にこれらのプロパティを別のオブジェクトに変更すること - */ - /*readonly SVGAnimatedRect*/ this.viewBox = this.currentView.viewBox; - /*readonly SVGAnimatedPreserveAspectRatio*/ this.preserveAspectRatio = this.currentView.preserveAspectRatio; - /*unsigned short*/ this.zoomAndPan = /*SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE*/ 1; - this._tx = 0; - this._ty = 0; - /*int*/ this._currentTime = 0; - /*DOMAttrModifiedイベントを利用して、 - *随時、属性の値をDOMプロパティに変換しておくリスナー登録 - */ - this.addEventListener("DOMAttrModified", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - var tar = evt.target, - name = evt.attrName, - tv, ovb, par, tp, sa, mos; - if (name === "viewBox") { - tar._cacheScreenCTM = null; - tv = tar.viewBox.baseVal; - ovb = evt.newValue.replace(/^\s+|\s+$/g, "").split(/[\s,]+/); - tv.x = parseFloat(ovb[0]); - tv.y = parseFloat(ovb[1]); - tv.width = parseFloat(ovb[2]); - tv.height = parseFloat(ovb[3]); - tar.viewBox.baseVal._isUsed = 1; - } else if (name === "preserveAspectRatio") { - tar._cacheScreenCTM = null; - par = evt.newValue; - tp = tar.preserveAspectRatio.baseVal; - sa = 1; - mos = /*SVGPreserveAspectRatio.SVG_MEETORSLICE_UNKNOWN*/ 0; - if (!!par.match(/x(Min|Mid|Max)Y(Min|Mid|Max)(?:\s+(meet|slice))?/)) { - switch (RegExp.$1) { - case "Min": - sa += 1; - break; - case "Mid": - sa += 2; - break; - case "Max": - sa += 3; - break; - } - switch (RegExp.$2) { - case "Min": - break; - case "Mid": - sa += 3; - break; - case "Max": - sa += 6; - break; - } - if (RegExp.$3 === "slice") { - mos = /*SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE*/ 2; - } else { - mos = /*SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET*/ 1; - } - } - tp.align = sa; - tp.meetOrSlice = mos; - } else if (name === "width") { - /*viewportを更新する*/ - tar.viewport.width = tar.width.baseVal.value; - } else if (name === "height") { - tar.viewport.height = tar.height.baseVal.value; - } - evt = name = tv = ovb = par = tp = sa = mos = void 0; - }, false); - this.addEventListener("SVGLoad", function(evt){ - /*以下のDOMAttrModifiedは浮上フェーズのときに、再描画をするように - *処理を書いたもの。属性が書き換わるたびに、再描画される - */ - evt.target.addEventListener("DOMAttrModified", function(evt){ - var tar, - evtt, tce, slist; - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - tar = evt.target; - if (tar.parentNode) { - evtt = tar.ownerDocument._domnodeEvent(); - evtt.target = tar; - evtt.eventPhase = /*Event.AT_TARGET*/ 2; - tce = tar._capter; //tceは登録しておいたリスナーのリスト - for (var j=0,tcli=tce.length;j sw ? sw : w; - viewHeight = h > sh ? sh : h; - backrs = backr.currentStyle; - bfl = _parseFloat(backrs.left); - bft = _parseFloat(backrs.top); - bl = -tar._tx; //blやbtは、ずれを調整するのに使う - bt = -tar._ty; - if (bfl !== 0 && !isNaN(bfl)) { //内部の図形にずれが生じたとき(isNaNはIE8でautoがデフォルト値のため) - bl = bfl; - dcp.style.left = -bl+ "px"; - } - if (bft !== 0 && !isNaN(bfl)) { - bt = bft; - dcp.style.top = -bt+ "px"; - } - backright = bl + viewWidth + 1; - backdown = bt + viewHeight + 1; - trstyle.clip = "rect(" +bt+ "px " +backright+ "px " +backdown+ "px " +bl+ "px)"; - this._document = s; - if ("_svgload_limited" in s.documentElement) { - /*_svgload_limitedプロパティはXlink言語が使われていない限り、0である。 - *xlink:href属性が指定されるたびに+1となる。 - *0以外は、SVGLoadイベントが発火されない仕組みとなっている - * - *目的: - * Xlinkのリンク先のソースを読み込むまで、SVGLoadイベントを発火させないため - */ - s.documentElement._svgload_limited--; - if (s.documentElement._svgload_limited < 0) { - var evt = s.createEvent("SVGEvents"); - evt.initEvent("SVGLoad", false, false); - s.documentElement.dispatchEvent(evt); - } - } - //以下、テキストの位置を修正 - text = s.documentElement._tar.getElementsByTagName("div"); - for (var i=0, texti;text[i];++i) { - texti = text[i]; - if (texti.firstChild.nodeName !== "shape") { //radialGradient用のdiv要素でないならば - var tis = texti.style; - tis.left = _parseFloat(tis.left) - bl + "px"; - tis.top = _parseFloat(tis.top) - bt + "px"; - tis = void 0; - } - } - //ビューポートの位置をスクロールで調整 (なお、_txプロパティはSVGSVGElementのSIEコードを参照) - ifcw && ifcw.scroll(-s.documentElement._tx, -s.documentElement._ty); - s._isLoaded = 1; //_isLoadedプロパティはevents::dispatchEventメソッドで使う - s.defaultView._cache = s.defaultView._cache_ele = null; - oba = _doc = evt = ndoc = objei = tar = tview = objw = objh = n = att = sdt = sp = dcp = backr = sw = sh = style = fontSize = void 0; - trstyle = backrs = text = texti = i = bfl = bft = bl = bt = text = _parseFloat = w = h = viewWidth = viewHeight = backdown = backright = void 0; - /*IEのメモリリーク対策として、空関数を入力*/ - this.xmlhttp.onreadystatechange = NAIBU.emptyFunction; - if (this._next) { - ifcw && (ifr.contentWindow.screen.updateInterval = 0); - ifr = ifcw = s = void 0; - this._next._init(); - } else { - /*全要素の読み込みが終了した場合*/ - if (s.implementation._buffer_) { - screen.updateInterval = 0; - /*以下はバッファリングにためておいた要素とイベントを、後から実行する*/ - NAIBU._buff_num = 0; - NAIBU._buff = setInterval(function(){ - var n = NAIBU._buff_num, - dbuf = DOMImplementation._buffer_, - dbufli = dbuf ? dbuf.length : 0, //極端な負荷がかかると、dbufはnullになる可能性あり - s, evt; - if (dbufli === 0) { - clearInterval(NAIBU._buff); - } else { - for (var i=0;i<50;++i) { - s = dbuf[n]; - evt = dbuf[n+1]; - s.dispatchEvent(evt); - n += 2; - s = evt = void 0; - if (n >= dbufli) { - clearInterval(NAIBU._buff); - DOMImplementation._buffer_ = null; - NAIBU.Time.start(); - dbuf = n = dbufli = void 0; - return; - } - } - NAIBU._buff_num = n; - } - dbuf = n = dbufli = void 0; - }, 1); - ifr = ifcw = s = void 0; - } else { - ifr = ifcw = s = void 0; - NAIBU.Time.start(); - } - delete NAIBU.doc; - } - }, - /*SVGDocument*/ getSVGDocument : function() { - return (this._document); - } -}; -/*空関数(IEのメモリリーク対策)*/ -NAIBU.emptyFunction = function() {}; - -/*SVGStyleElement - *style要素をあらわすオブジェクト - */ -function SVGStyleElement(_doc) { - SVGElement.apply(this); - LinkStyle.apply(this); - /*LinkStyleに関しては、以下の仕様を参照のこと。なお、これはSVG DOMでは継承されていないので要注意。 - *CSS2 1. Document Object Model Style Sheets - * 1.3. Document Extensions - * Interface LinkStyle (introduced in DOM Level 2) - * http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-LinkStyle - */ - /*以下はそれぞれ、属性の値に対応している*/ - /*DOMString*/ this.xmlspace; - /*DOMString*/ this.type = "text/css"; - /*DOMString*/ this.media; - /*DOMString*/ this.title; - SVGURIReference.apply(this); - this.addEventListener("DOMAttrModified", function(evt){ - if (evt.attrName === "type") { - evt.target.type = evt.newValue; - } else if (evt.attrName === "title") { - evt.target.title = evt.newValue; - } - evt = void 0; - }, false); - this.addEventListener("S_Load", function(evt){ - var tar = evt.target, - sheet = tar.sheet, - styleText = tar._text, - tod = tar.ownerDocument, - style = _doc.createElement("style"), - ri, rsc, scri, rsi; - NAIBU._temp_doc = tod; - sheet = tod.styleSheets[tod.styleSheets.length] = DOMImplementation.createCSSStyleSheet(tar.title, tar.media); - sheet.ownerNode = tar; - /*以下は、IEのCSSパーサを使って、スタイルシートのルールを実装していく*/ - _doc.documentElement.firstChild.appendChild(style); - style.styleSheet.cssText = styleText; - for (var i=0, rules=style.styleSheet.rules, rli=rules.length;i -1) || (selector.indexOf("#" +tar.id) > -1) - || (tar.nodeName === selector)) { - ru[ru.length] = rules[i]; - } - tar._rules = ru; - } - tar = doc = rules = void 0; - }, true); - tar = evt = style = sheet = styleText = tod = i = rules = rli = void 0; - }, false); - this.addEventListener("DOMNodeInserted", function(evt){ - var tar = evt.target; - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - if (tar.nodeName === "#cdata-section") { - evt.currentTarget._text = tar.data; - } - return; - } - tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ - var tar = evt.target; - if ((evt.eventPhase === /*Event.AT_TARGET*/ 2) && !tar.getAttributeNodeNS("http://www.w3.org/1999/xlink", "xlink:href")) { - var evtt = tar.ownerDocument.createEvent("SVGEvents"); - evtt.initEvent("S_Load", false, false); - evt.currentTarget.dispatchEvent(evtt); - } - tar = evt = void 0; - }, false); - }, false); -}; -SVGStyleElement.prototype = Object._create(SVGElement); - -/*SVGPoint - *2次元座標の点(x,y)を表すオブジェクト - */ -function SVGPoint() { -}; -/*float*/SVGPoint.prototype.x = SVGPoint.prototype.y = 0; -SVGPoint.prototype.matrixTransform = function(/*SVGMatrix*/ matrix ) { - if (!isFinite(matrix.a) || !isFinite(matrix.b) || !isFinite(matrix.c) || !isFinite(matrix.d) || !isFinite(matrix.e) || !isFinite(matrix.f)) { - throw (new Error("Type Error: 引数の値がNumber型ではありません")); - } - var s = new SVGPoint(); - s.x = matrix.a * this.x + matrix.c * this.y + matrix.e; - s.y = matrix.b * this.x + matrix.d * this.y + matrix.f; - return s; -}; - -function SVGPointList() { -}; -/*SVGPointListのメソッドはSVGPathSegListを参照*/ - -/*SVGMatrix - *行列をあらわすオブジェクト。写像に用いる。以下のように表現できる - *[a c e] - *[b d f] - *[0 0 1] - */ -function SVGMatrix() { -}; -SVGMatrix.prototype = { - /*float*/ a : 1, - /*float*/ b : 0, - /*float*/ c : 0, - /*float*/ d : 1, - /*float*/ e : 0, - /*float*/ f : 0, - /*multiplyメソッド - *行列の積を求めて返す - */ - /*SVGMatrix*/ multiply : function(/*SVGMatrix*/ secondMatrix ) { - var s = new SVGMatrix(), - m = secondMatrix, - isf = isFinite, - t = this; - if (!isf(m.a) || !isf(m.b) || !isf(m.c) || !isf(m.d) || !isf(m.e) || !isf(m.f)) { - throw (new Error("Type Error: 引数の値がNumber型ではありません")); - } - s.a = t.a * m.a + t.c * m.b; - s.b = t.b * m.a + t.d * m.b; - s.c = t.a * m.c + t.c * m.d; - s.d = t.b * m.c + t.d * m.d; - s.e = t.a * m.e + t.c * m.f + t.e; - s.f = t.b * m.e + t.d * m.f + t.f; - m = t = secondMatrix = isf = void 0; - return s; - }, - /*inverseメソッド - *逆行列を返す - */ - /*SVGMatrix*/ inverse : function() { - var s = new SVGMatrix(), n = this._determinant(); - if (n !== 0) { - s.a = this.d / n; - s.b = -this.b / n; - s.c = -this.c / n; - s.d = this.a / n; - s.e = (this.c * this.f - this.d * this.e) / n; - s.f = (this.b * this.e - this.a * this.f) / n; - return s; - } else { - throw (new SVGException(/*SVGException.SVG_MATRIX_NOT_INVERTABLE*/ 2)); - } - }, - /*SVGMatrix*/ translate : function(/*float*/ x, /*float*/ y ) { - var m = new SVGMatrix(); - m.e = x; - m.f = y; - var s = this.multiply(m); - m = void 0; - return s; - }, - /*SVGMatrix*/ scale : function(/*float*/ scaleFactor ) { - var m = new SVGMatrix(); - m.a = scaleFactor; - m.d = scaleFactor; - var s = this.multiply(m); - m = void 0; - return s; - }, - /*SVGMatrix*/ scaleNonUniform : function(/*float*/ scaleFactorX, /*float*/ scaleFactorY ) { - var m = new SVGMatrix(); - m.a = scaleFactorX; - m.d = scaleFactorY; - var s = this.multiply(m); - m = void 0; - return s; - }, - /*SVGMatrix*/ rotate : function(/*float*/ angle ) { - var m = new SVGMatrix(), rad = angle / 180 * Math.PI; //ラジアン変換 - m.a = Math.cos(rad); - m.b = Math.sin(rad); - m.c = -m.b; - m.d = m.a; - var s = this.multiply(m); - m = rad = void 0; - return s; - }, - //座標(x, y)と原点の角度の分だけ、回転する - /*SVGMatrix*/ rotateFromVector : function(/*float*/ x, /*float*/ y ) { - if ((x === 0) || (y === 0) || !isFinite(x) || !isFinite(y)) { - throw (new SVGException(/*SVGException.SVG_INVALID_VALUE_ERR*/ 1)); - } - var m = new SVGMatrix(), rad = Math.atan2(y, x); - m.a = Math.cos(rad); - m.b = Math.sin(rad); - m.c = -m.b; - m.d = m.a; - var s = this.multiply(m); - m = rad = void 0; - return s; - }, - /*SVGMatrix*/ flipX : function() { - var m = new SVGMatrix(); - m.a = -m.a; - var s = this.multiply(m); - m = void 0; - return s; - }, - /*SVGMatrix*/ flipY : function() { - var m = new SVGMatrix(); - m.d = -m.d; - var s = this.multiply(m); - m = void 0; - return s; - }, - /*SVGMatrix*/ skewX : function(/*float*/ angle ){ - var m = new SVGMatrix(), rad = angle / 180 * Math.PI; //ラジアン変換 - m.c = Math.tan(rad); - var s = this.multiply(m); - m = void 0; - return s; - }, - /*SVGMatrix*/ skewY : function(/*float*/ angle ){ - var m = new SVGMatrix(), rad = angle / 180 * Math.PI; - m.b = Math.tan(rad); - var s = this.multiply(m); - m = void 0; - return s; - }, - //行列式 - /*float*/ _determinant : function() { - return (this.a * this.d - this.b * this.c); - } -}; - -function SVGTransform() { - /*readonly SVGMatrix*/ this.matrix = new SVGMatrix(); -}; - // Transform Types - /*unsigned short SVGTransform.SVG_TRANSFORM_UNKNOWN = 0; - /*unsigned short SVGTransform.SVG_TRANSFORM_MATRIX = 1; - /*unsigned short SVGTransform.SVG_TRANSFORM_TRANSLATE = 2; - /*unsigned short SVGTransform.SVG_TRANSFORM_SCALE = 3; - /*unsigned short SVGTransform.SVG_TRANSFORM_ROTATE = 4; - /*unsigned short SVGTransform.SVG_TRANSFORM_SKEWX = 5; - /*unsigned short SVGTransform.SVG_TRANSFORM_SKEWY = 6;*/ -SVGTransform.prototype = { - /*ダミーの単位行列。各メソッドで使う*/ - _matrix : (new SVGMatrix()), - /*readonly unsigned short*/ type : /*SVGTransform.SVG_TRANSFORM_UNKNOWN*/ 0, - /*readonly float*/ angle : 0, - /*void*/ setMatrix : function(/*SVGMatrix*/ matrix ) { - this.type = /*SVGTransform.SVG_TRANSFORM_MATRIX*/ 1; - this.matrix = this._matrix.multiply(matrix); - }, - /*void*/ setTranslate : function(/*float*/ tx, /*float*/ ty ) { - this.type = /*SVGTransform.SVG_TRANSFORM_TRANSLATE*/ 2; - this.matrix = this._matrix.translate(tx, ty); - }, - /*void*/ setScale : function(/*float*/ sx, /*float*/ sy ) { - this.type = /*SVGTransform.SVG_TRANSFORM_SCALE*/ 3; - this.matrix = this._matrix.scaleNonUniform(sx, sy); - }, - /*void*/ setRotate : function(/*float*/ angle, /*float*/ cx, /*float*/ cy ) { - this.angle = angle; - this.type = /*SVGTransform.SVG_TRANSFORM_ROTATE*/ 4; - this.matrix = this._matrix.rotate(angle); - this.matrix.e = (1-this.matrix.a)*cx - this.matrix.c*cy; - this.matrix.f = -this.matrix.b*cx + (1-this.matrix.d)*cy; - }, - /*void*/ setSkewX : function(/*float*/ angle ) { - this.angle = angle; - this.type = /*SVGTransform.SVG_TRANSFORM_SKEWX*/ 5; - this.matrix = this._matrix.skewX(angle); - }, - /*void*/ setSkewY : function(/*float*/ angle ) { - this.angle = angle; - this.type = /*SVGTransform.SVG_TRANSFORM_SKEWY*/ 6; - this.matrix = this._matrix.skewY(angle); - } -}; - -function SVGTransformList() { -}; -/*SVGTransformListのメソッドはSVGPathSegListを参照*/ - -/*SVGTransform*/ SVGTransformList.prototype.createSVGTransformFromMatrix = function(/*SVGMatrix*/ matrix ) { - var t = new SVGTransform(); - t.setMatrix(matrix); - return t; -}; -/*SVGTransform*/ SVGTransformList.prototype.consolidate = function() { - if(this.numberOfItems === 0) { - return null; - } else { - var s = this.getItem(0), m = s.matrix; - for (var i=1,nli=this.numberOfItems;i 0) { //コンマ区切りの文字列の場合 - strs = tsd.split(","); - for (var i = 0, sli = strs.length; i < sli; ++i) { - strs[i] = _math.ceil(+(strs[i]) / parseFloat(style.getPropertyValue("stroke-width"))); //精密ではないので注意 - } - strokedasharray = strs.join(" "); - if (strs.length % 2 === 1) { - strokedasharray += " " + strokedasharray; - } - } - strokeElement.setAttribute("dashstyle", strokedasharray); - tsd = strs = void 0; - } - el.appendChild(strokeElement); - strokeElement = tsd = void 0; - } else { - el.stroked = "false"; - } - if (el.style) { - cursor = style.getPropertyCSSValue("cursor"); - if (cursor && !cursor._isDefault) { //初期値でないならば - el.style.cursor = cursor.cssText.split(":")[1]; - } - vis = style.getPropertyCSSValue("visibility"); - if (vis && !vis._isDefault) { - el.style.visibility = vis.cssText.split(":")[1]; - } - disp = style.getPropertyCSSValue("display"); - if (disp && !disp._isDefault && (disp.cssText.indexOf("none") > -1)) { - el.style.display = "none"; - } else if (disp && !disp._isDefault && (disp.cssText.indexOf("inline-block") === -1)) { - el.style.display = "inline-block"; - } - } - tod = _doc = el = fill = stroke = sp = fp = style = cursor = tar = matrix = vis = disp = num = void 0; -}; - -function SVGPathElement(_doc) { - SVGElement.apply(this); - this._tar = _doc.createElement("v:shape"); - //interface SVGAnimatedPathData - var sp = SVGPathSegList; - /*readonly SVGPathSegList*/ this.pathSegList = new sp(); - this.animatedPathSegList = this.pathSegList; - /*readonly SVGPathSegList*/ this.normalizedPathSegList = new sp(); - sp = _doc = void 0; - this.animatedNormalizedPathSegList = this.normalizedPathSegList; - /*readonly SVGAnimatedNumber*/ this.pathLength = new SVGAnimatedNumber(); - //以下は、d属性に変更があった場合の処理 - this.addEventListener("DOMAttrModified", this._attrModi, false); - /*以下の処理は、このpath要素ノードがDOMツリーに追加されて初めて、 - *描画が開始されることを示す。つまり、appendChildで挿入されない限り、描画をしない。 - */ - this.addEventListener("DOMNodeInserted", this._nodeInsert, false); -}; -SVGPathElement.prototype = Object._create(SVGElement); -(function(_sproto) { -_sproto._attrModi = function(evt){ - var tar = evt.target; - if (evt.attrName === "d" && evt.newValue !== ""){ - /* d属性の値が空の場合は、描画を行わないようにする - * - *SVG1.1 「8.3.9 The grammar for path data」の項目にある最後の文章を参照 - */ - var tnl = tar.normalizedPathSegList, - tlist = tar.pathSegList; - if (tnl.numberOfItems > 0) { - tnl.clear(); - tlist.clear(); - } - /*d属性の値を正規表現を用いて、二次元配列Dに変換している。もし、d属性の値が"M 20 30 L20 40"ならば、 - *JSONにおける表現は以下のとおり - *D = [["M", 20, 30], ["L", 20 40]] - */ - var taco = tar._com, - sgs = taco.isSp, - dd = evt.newValue - .replace(taco.isRa, " -") - .replace(taco.isRb, " ") - .replace(taco.isRc, ",$1 ") - .replace(taco.isRd, ",$1 1") - .replace(taco.isRe, "") - .replace(/\.(\d+)\./g, ".$1 0.") - .replace(/[^\w\d\+\-\.\,\n\r\s].*/, "") - .split(","), - dli=dd.length, - isZ = taco._isZ, - isM = taco._isM, - isC = taco._isC, - isL = taco._isL, - tcc = tar.createSVGPathSegCurvetoCubicAbs, - tcll = tar.createSVGPathSegLinetoAbs, - flag, sflag; - for (var i=0;i 1 && (+flag >= 0)) { /*if no commawsp*/ - di.splice(j+3, 1, flag.charAt(0), flag.slice(1)); - ++dili; - } - sflag = di[j+4]; - if (sflag.length > 1 && (+sflag >= 0)) { - di.splice(j+4, 1, sflag.charAt(0), sflag.slice(1)); - ++dili; - } - flag = di[j+3]; - sflag = di[j+4]; - if (((+flag < 0) || (+flag > 1)) || ((+sflag < 0) || (+sflag > 1))) { - /*仕様では、フラグが0か1しか認められていない*/ - j += 6; - continue; - } - s = tar.createSVGPathSegArcAbs(+di[j+5], +di[j+6], +di[j], +di[j+1], +di[j+2], +flag, +sflag); - j += 6; - } else if (dii === "m") { - s = tar.createSVGPathSegMovetoRel(+di[j], +di[j+1]); - ++j; - } else if (dii === "l") { - s = tar.createSVGPathSegLinetoRel(+di[j], +di[j+1]); - ++j; - } else if (dii === "c") { - s = tar.createSVGPathSegCurvetoCubicRel(+di[j+4], +di[j+5], +di[j], +di[j+1], +di[j+2], +di[j+3]); - j += 5; - } else if (dii === "Q") { - s = tar.createSVGPathSegCurvetoQuadraticAbs(+di[j+2], +di[j+3], +di[j], +di[j+1]); - j += 3; - } else if (dii === "q") { - s = tar.createSVGPathSegCurvetoQuadraticRel(+di[j+2], +di[j+3], +di[j], +di[j+1]); - j += 3; - } else if (dii === "a") { - flag = di[j+3]; - if (flag.length > 1 && (+flag >= 0)) { /*if no commawsp*/ - di.splice(j+3, 1, flag.charAt(0), flag.slice(1)); - ++dili; - } - sflag = di[j+4]; - if (sflag.length > 1 && (+sflag >= 0)) { - di.splice(j+4, 1, sflag.charAt(0), sflag.slice(1)); - ++dili; - } - flag = di[j+3]; - sflag = di[j+4]; - if (((+flag < 0) || (+flag > 1)) || ((+sflag < 0) || (+sflag > 1))) { - /*仕様では、フラグが0か1しか認められていない*/ - j += 6; - continue; - } - s = tar.createSVGPathSegArcRel(+di[j+5], +di[j+6], +di[j], +di[j+1], +di[j+2], +flag, +sflag); - j += 6; - } else if (dii === "S") { - s = tar.createSVGPathSegCurvetoCubicSmoothAbs(+di[j+2], +di[j+3], +di[j], +di[j+1]); - j += 3; - } else if (dii === "s") { - s = tar.createSVGPathSegCurvetoCubicSmoothRel(+di[j+2], +di[j+3], +di[j], +di[j+1]); - j += 3; - } else if (dii === "T") { - s = tar.createSVGPathSegCurvetoQuadraticSmoothAbs(+di[j], +di[j+1]); - ++j; - } else if (dii === "t") { - s = tar.createSVGPathSegCurvetoQuadraticSmoothRel(+di[j], +di[j+1]); - ++j; - } else if (dii === "H") { - s = tar.createSVGPathSegLinetoHorizontalAbs(+di[j]); - } else if (dii === "h") { - s = tar.createSVGPathSegLinetoHorizontalRel(+di[j]); - } else if (dii === "V") { - s = tar.createSVGPathSegLinetoVerticalAbs(+di[j]); - } else if (dii === "v") { - s = tar.createSVGPathSegLinetoVerticalRel(+di[j]); - } else { - s = new SVGPathSeg(); - } - tlist.appendItem(s); - } - } - di = s = sgs = dd = void 0; - /*以下の処理は、pathSegListからnormalizedPathSegListへの - *変換をする処理。相対座標を絶対座標に変換して、M、L、Cコマンドに正規化していく - */ - var cx = 0, cy = 0, //現在セグメントの終了点の絶対座標を示す (相対座標を絶対座標に変換するときに使用) - xn = 0, yn = 0, //T,tコマンドで仮想的な座標を算出するのに用いる。第一コントロール点 - startx = 0, starty = 0; //M,mコマンドにおける始点座標(Z,zコマンドで用いる) - for (var j=0, tli=tlist.numberOfItems;j 1) { - r1 = _math.sqrt(lamda) * r1; - r2 = _math.sqrt(lamda) * r2; - sds = 0; - } else{ - var seif = 1; - if (ti.largeArcFlag === fS) { - seif = -1; - } - sds = seif * _math.sqrt((r1x*r2y - r1x*rydd - r2y*rxdd) / (r1x*rydd + r2y*rxdd)); - } - var txd = sds*r1*ryd / r2, - tyd = -1 * sds*r2*rxd / r1, - tx = cpsi*txd - spsi*tyd + (rx+cx)/2, - ty = spsi*txd + cpsi*tyd + (ry+cy)/2, - rad = _math.atan2((ryd-tyd)/r2, (rxd-txd)/r1) - _math.atan2(0, 1), - s1 = (rad >= 0) ? rad : 2 * _math.PI + rad, - rad = _math.atan2((-ryd-tyd)/r2, (-rxd-txd)/r1) - _math.atan2((ryd-tyd)/r2, (rxd-txd)/r1), - dr = (rad >= 0) ? rad : 2 * _math.PI + rad; - if (!fS && dr > 0) { - dr -= 2*_math.PI; - } else if (fS && dr < 0) { - dr += 2*_math.PI; - } - var sse = dr * 2 / _math.PI, - seg = _math.ceil(sse<0 ? -1*sse : sse), - segr = dr / seg, - t = 8/3 * _math.sin(segr/4) * _math.sin(segr/4) / _math.sin(segr/2), - cpsir1 = cpsi * r1, cpsir2 = cpsi * r2, - spsir1 = spsi * r1, spsir2 = spsi * r2, - mc = _math.cos(s1), - ms = _math.sin(s1), - x2 = rx - t * (cpsir1*ms + spsir2*mc), - y2 = ry - t * (spsir1*ms - cpsir2*mc); - for (var n = 0; n < seg; ++n) { - s1 += segr; - mc = _math.cos(s1); - ms = _math.sin(s1); - var x3 = cpsir1*mc - spsir2*ms + tx, - y3 = spsir1*mc + cpsir2*ms + ty, - dx = -t * (cpsir1*ms + spsir2*mc), - dy = -t * (spsir1*ms - cpsir2*mc); - tnl.appendItem(tcc(x3, y3, x2, y2, x3-dx, y3-dy)); - x2 = x3 + dx; - y2 = y3 + dy; - } - ti= cx= cy= rx= ry= tar= tnl = void 0; - })(ti, cx, cy, rx, ry, tar, tnl); - } else if (dii === "S") { - if (j !== 0) { - var tg = tnl.getItem(tnl.numberOfItems-1); - if (tg.pathSegTypeAsLetter === "C") { - var x1 = 2*tg.x - tg.x2, - y1 = 2*tg.y - tg.y2; - } else { //前のコマンドがCでなければ、現在の座標を第1コントロール点に用いる - var x1 = rx, - y1 = ry; - } - } else { - var x1 = rx, - y1 = ry; - } - tnl.appendItem(tcc(cx, cy, x1, y1, ti.x2, ti.y2)); - x1 = y1 = void 0; - } else if (dii === "s") { - if (j !== 0) { - var tg = tnl.getItem(tnl.numberOfItems-1); - if (tg.pathSegTypeAsLetter === "C") { - var x1 = 2*tg.x - tg.x2, - y1 = 2*tg.y - tg.y2; - } else { - var x1 = rx, - y1 = ry; - } - } else { - var x1 = rx, - y1 = ry; - } - tnl.appendItem(tcc(cx, cy, x1, y1, ti.x2+rx, ti.y2+ry)); - x1 = y1 = void 0; - } else if (dii === "T" || dii === "t") { - if (j !== 0) { - var tg = tlist.getItem(j-1); - if ("QqTt".indexOf(tg.pathSegTypeAsLetter) > -1) { - } else { - xn = rx, yn = ry; - } - } else { - xn = rx, yn = ry; - } - tnl.appendItem(tcc(cx, cy, (rx + 2*xn) / 3, (ry + 2*yn) / 3, (2*xn + cx) / 3, (2*yn + cy) / 3)); - xn = 2*cx - xn; - yn = 2*cy - yn; - xx1 = yy1 = void 0; - } else if (dii === "H" || dii === "h") { - tnl.appendItem(tcll(cx, ry)); - cy = ry; //勝手にti.yが0としているため - } else if (dii === "V" || dii === "v") { - tnl.appendItem(tcll(rx, cy)); - cx = rx; - } - } - } - } - evt = tar = taco = cx = cy = xn = yn = startx = starty = tnl = tlist = ti = dii = ts = isZ = isM = isL = isC = s = tcc = tcll = void 0; -}; -_sproto._nodeInsert = function(evt){ - var tar = evt.target; - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - var tnext = tar.nextSibling, - tpart = tar.parentNode._tar, - isLast = true; - if (tnext && tnext._tar && tpart && (tnext._tar.parentNode === tpart)) { - tpart.insertBefore(tar._tar, tnext._tar); - } else if (tnext && !tnext._tar && tpart) { - /*以下の処理は、_tarプロパティがない要素オブジェクトがあるため、それに対処するもの - *use要素や実体参照などは_tarプロパティがないことに注意 - */ - while (tnext) { - if (tnext._tar && (tnext._tar.parentNode === tpart)) { - tpart.insertBefore(tar._tar, tnext._tar); - isLast = false; - } - tnext = tnext.nextSibling; - } - if (isLast) { - tpart.appendChild(tar._tar); - } - } else if (!tnext && tpart) { - tpart.appendChild(tar._tar); - } - tnext = tpart = isLast = void 0; - tar.addEventListener("DOMNodeInsertedIntoDocument", tar._nodeInsertInto, false); - evt = tar = void 0; -}; -_sproto._nodeInsertInto = function(evt){ - /*以下の処理は、normalizedpathSegListとCTMに基づいて、 - *SVGのd属性をVMLに変換していく処理である。 - */ - var tar = evt.target, - matrix = tar.getScreenCTM(), - tlist = tar.normalizedPathSegList, - dat = [], - ma = matrix.a, mb = matrix.b, mc = matrix.c, md = matrix.d, me = matrix.e, mf = matrix.f, - cname = tar._com._nameCom, - isZ = tar._com._isZ, isC = tar._com._isC, - mr = _math.round; - for (var i=0, tli=tlist.numberOfItems;i twidth / 2) { - thrx.value = twidth / 2; - } - if (thry.value > theight / 2) { - thry.value = theight / 2; - } - var rxv = thrx.value, - ryv = thry.value, - rrx = rxv * 0.55228, - rry = ryv * 0.55228, - a = xw - rxv, - b = x + rxv, - c = y + ryv, - d = yh - ryv; - list = ["m",b,y, "l",a,y, "c",a+rrx,y,xw,c-rry,xw,c, "l",xw,d, "c",xw,d+rry,a+rrx,yh,a,yh, "l",b,yh, "c",b-rrx,yh,x,d+rry,x,d, "l",x,c, "c",x,c-rry,b-rrx,y,b,y]; - } else { - list = ["m",x,y, "l",x,yh, xw,yh, xw,y, "x e"]; - } - //以下は、配列listそのものをCTMで座標変換していく処理 - var par = tar.ownerDocument.documentElement, - ctm = tar.getScreenCTM(), - dat, p, pmt, - ele = tar._tar, - vi = tar.ownerDocument.documentElement, - w = vi.width.baseVal.value, - h = vi.height.baseVal.value, - mr = Math.round; - for (var i=0, lili=list.length;i 0)) { - /*何も設定されていない場合のみ、初期化を行う*/ - l.newValueSpecifiedUnits(/*SVGLength.SVG_LENGTHTYPE_NUMBER*/ 1, this.getSubStringLength(0, this.getNumberOfChars())); - } - l = void 0; - return (this.textLength.baseVal.value); -}; -/*getSubStringLengthメソッド - *charnum番目の文字からnchars+charnum-1番目までの文字列の長さを求めて返す - */ -/*float*/ t.prototype.getSubStringLength = function(/*unsigned long*/ charnum, /*unsigned long*/ nchars ) { - if (nchars === 0) { - return 0; - } - var tg = this.getNumberOfChars(); - if (tg < (nchars+charnum)) { - /*ncharsが文字列の長さよりも長くなってしまったときには、 - *文字列の末端までの長さを求めるとする(SVG1.1の仕様より) - */ - nchars = tg - charnum + 1; - } - var end = this.getEndPositionOfChar(nchars+charnum-1), st = this.getStartPositionOfChar(charnum); - if (this._isYokogaki) { - var s = end.x - st.x; - } else { - var s = end.y - st.y; - } - tg = end = st = void 0; - return s; -}; -/*SVGPoint*/ t.prototype.getStartPositionOfChar = function (/*unsigned long*/ charnum ) { - if (charnum > this.getNumberOfChars() || charnum < 0) { - throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); - } else { - var tar = this, - ti = tar.firstChild, - tp = tar.parentNode; - if (!!!tar._list) { - tar._list = []; - var chars = tar._chars, //現在、何文字目にあるのか - x = tar._stx, y = tar._sty, n = 0, //現在のテキスト位置と順番 - style = tar.ownerDocument.defaultView.getComputedStyle(tar, null), - isYokogaki = ((style.getPropertyValue("writing-mode")) === "lr-tb") ? true : false, - fontSize = parseFloat(style.getPropertyValue("font-size")), - tx = tar.x.baseVal, ty = tar.y.baseVal, tdx = tar.dx.baseVal, tdy = tar.dy.baseVal; - /*親要素の属性も参照しておく*/ - if (tp && ((tp.localName === "text") ||(tp.localName === "tspan"))) { - var ptx = tp.x.baseVal, - pty = tp.y.baseVal, - ptdx = tp.dx.baseVal, - ptdy = tp.dy.baseVal; - } else { - var ptx = pty = ptdx = ptdy = {numberOfItems : 0}; - } - var kern = "f ijltIr.,:;'-\"()", - akern = "1234567890abcdeghknopquvxyz", - tt, alm, tdc, tcca, p, almx, almy, tlist, tg; - if (isYokogaki && (tar.localName === "text")) { - y += fontSize * 0.2; - } else if (tar.localName === "text"){ - x -= fontSize * 0.5; - } - while (ti) { - if (ti.nodeType === /*Node.TEXT_NODE*/ 3) { - tt = ti._tars; - /*tspan(tref)要素のx属性で指定された座標の個数よりも、文字数が多い場合は、祖先(親)のx属性を - *使う。また、属性が指定されていないときも同様に祖先や親を使う。 - *もし、仮に祖先や親がx属性を指定されていなければ、現在のテキスト位置(変数xに格納している)を使う。 - *この処理はdx属性やdy、y属性でも同様とする - *参照資料SVG1.1 Text - *http://www.hcn.zaq.ne.jp/___/REC-SVG11-20030114/text.html - * - *注意:ここでは、tspan要素だけではなく、text要素にも適用しているが、本来はtspan要素のみに処理させること - */ - for (var i=0, tli=tt.length;i -1) { - alm = fontSize * 0.68; - } else if (tdc === "s"){ - alm = fontSize * 0.52; - } else if ((tdc === "C") || (tdc === "D") || (tdc === "M") || (tdc === "W") || (tdc === "G") || (tdc === "m")){ - alm = fontSize * 0.2; - } else if (akern.indexOf(tdc) > -1){ - alm = fontSize * 0.45; - } else { - alm = fontSize * 0.3; - } - tcca = tdc.charCodeAt(0); - if ((12288 <= tcca) && (tcca <= 65533)) { - alm = -fontSize * 0.01; - if ((tdc === "う") || (tdc === "く") || (tdc === "し") || (tdc === "ち")) { - alm += fontSize * 0.2; - } - } - } - tlist = tar._list; - tlist[tlist.length] = x; - tlist[tlist.length] = y; - tlist[tlist.length] = fontSize - alm; - if (isYokogaki) { - x += fontSize; - x -= alm; - } else { - y += fontSize; - } - ++n; - } - chars += tli; - if (ti.parentNode && (ti.parentNode.localName === "a")) { //a要素が親である場合は、tiを親に戻しておく - ti = ti.parentNode; - } - ti = ti.nextSibling; - } else if (((ti.localName === "tspan") || (ti.localName === "tref")) - && (ti.namespaceURI === "http://www.w3.org/2000/svg") && ti.firstChild) { - /*現在のテキスト位置(x,y)の分だけ、tspan (tref)要素をずらしておく。 - *さらに、現在のテキスト位置を更新する - */ - ti._stx = x; - ti._sty = y; - ti._chars = chars; - p = ti.getStartPositionOfChar(ti.getNumberOfChars()); - almx = 0; - almy = 0; - tlist = ti._list; - if (isYokogaki) { - almx = tlist[tlist.length-1]; - } else { - almy = tlist[tlist.length-1]; - } - x = tlist[tlist.length-3] + almx; - y = tlist[tlist.length-2] + almy; - tar._list = tar._list.concat(tlist); - tg = ti.getNumberOfChars(); - n += tg; - chars += tg; - ti = ti.nextSibling; - } else if ((ti.localName === "a") && (ti.namespaceURI === "http://www.w3.org/2000/svg") && ti.firstChild) { - /*a要素のテキストノードも処理する*/ - ti = ti.firstChild; - } else { - ti = ti.nextSibling; - } - } - tar._isYokogaki = isYokogaki; //getEndPositionOfCharメソッドなどで使う - } - tar = ti = tp = ptx = pty = tx = ty = chars = style = x = y = isYokogaki = kern = akern = tt = alm = tdc = tcca = p = almx = almy = tlist = tg = void 0; - var s = this.ownerDocument.documentElement.createSVGPoint(); - s.x = this._list[charnum*3]; - s.y = this._list[charnum*3 + 1]; - s = s.matrixTransform(this.getScreenCTM()); - return s; - } -}; -/*SVGPoint*/ t.prototype.getEndPositionOfChar = function(/*unsigned long*/ charnum ) { - if (charnum > this.getNumberOfChars() || charnum < 0) { - throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); - } else { - var s = this.getStartPositionOfChar(charnum); - //アドバンス値(すなわちフォントの大きさ)をCTMの行列式を用いて、算出する - var n = this._list[charnum*3 + 2] * Math.sqrt(Math.abs(this.getScreenCTM()._determinant())); - if (this._isYokogaki) { - s.x += n; - } else { - s.y += n; - } - return s; - } -}; -/*SVGRect*/ t.prototype.getExtentOfChar = function(/*unsigned long*/ charnum ) { - -}; -/*float*/ t.prototype.getRotationOfChar = function(/*unsigned long*/ charnum ) { - -}; -/*long*/ t.prototype.getCharNumAtPosition = function(/*SVGPoint*/ point ) { - -}; -/*void*/ t.prototype.selectSubString = function(/*unsigned long*/ charnum,/*unsigned long*/ nchars ) { - -}; -})(SVGTextContentElement); - -function SVGTextPositioningElement(_doc) { - SVGTextContentElement.apply(this, arguments); - var sl = SVGAnimatedLengthList; - /*readonly SVGAnimatedLengthList*/ this.x = new sl(); - /*readonly SVGAnimatedLengthList*/ this.y = new sl(); - /*readonly SVGAnimatedLengthList*/ this.dx = new sl(); - /*readonly SVGAnimatedLengthList*/ this.dy = new sl(); - sl = void 0; - /*readonly SVGAnimatedNumberList*/ this.rotate = new SVGAnimatedNumberList(); - this.addEventListener("DOMAttrModified", function(evt){ - var tar = evt.target, - name = evt.attrName, - tod = tar.ownerDocument.documentElement, - _parseFloat = parseFloat; - if ((name === "x") || (name === "y") || (name === "dx") || (name === "dy")) { - var enr = evt.newValue.replace(/^\s+|\s+$/g, "").split(/[\s,]+/), - teas = tar[name].baseVal; - for (var i=0, tli=enr.length;i= "0" && n <= "9") { - type = /*SVGLength.SVG_LENGTHTYPE_NUMBER*/ 1; - } else if (n === "%") { - if ((name === "x") || (name === "dx")) { - tea._percent *= tod.viewport.width; - } else if ((name === "y") || (name === "dy")) { - tea._percent *= tod.viewport.height; - } - type = /*SVGLength.SVG_LENGTHTYPE_PERCENTAGE*/ 2; - } else { - n = enr[i].slice(-2); - if (n === "em") { - var style = tar.ownerDocument.defaultView.getComputedStyle(tar, null); - tea._percent *= _parseFloat(style.getPropertyValue("font-size")); - style = void 0; - type = /*SVGLength.SVG_LENGTHTYPE_EMS*/ 3; - } else if (n === "ex") { - type = /*SVGLength.SVG_LENGTHTYPE_EXS*/ 4; - } else if (n === "px") { - type = /*SVGLength.SVG_LENGTHTYPE_PX*/ 5; - } else if (n === "cm") { - type = /*SVGLength.SVG_LENGTHTYPE_CM*/ 6; - } else if (n === "mm") { - type = /*SVGLength.SVG_LENGTHTYPE_MM*/ 7; - } else if (n === "in") { - type = /*SVGLength.SVG_LENGTHTYPE_IN*/ 8; - } else if (n === "pt") { - type = /*SVGLength.SVG_LENGTHTYPE_PT*/ 9; - } else if (n === "pc") { - type = /*SVGLength.SVG_LENGTHTYPE_PC*/ 10; - } - } - var s = _parseFloat(enr[i]); - s = isNaN(s) ? 0 : s; - tea.newValueSpecifiedUnits(type, s); - teas.appendItem(tea); - } - tar._list = null; - } - evt = tar = void 0; - }, false); - this.addEventListener("DOMNodeInserted", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - var tar = evt.target; - if (tar.nodeType !== /*Node.TEXT_NODE*/ 3) { - tar._list = void 0; - evt.currentTarget._list = null; - } - evt = tar = void 0; - } - }, false); - if (_doc) { - this._tar = _doc.createElement("v:group"); - this._doc = _doc; //_docプロパティは_texto関数内で使われる - } - this.addEventListener("DOMNodeInserted", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - var tar = evt.target, - tnext = tar.nextSibling, - tpart = tar.parentNode._tar, - isLast = true; - if (tnext && tnext._tar && tpart && (tnext._tar.parentNode === tpart)) { - tpart.insertBefore(tar._tar, tnext._tar); - } else if (tnext && !tnext._tar && tpart) { - /*以下の処理は、_tarプロパティがない要素オブジェクトがあるため、それに対処するもの - *use要素や実体参照などは_tarプロパティがないことに注意 - */ - while (tnext) { - if (tnext._tar && (tnext._tar.parentNode === tpart)) { - tpart.insertBefore(tar._tar, tnext._tar); - isLast = false; - } - tnext = tnext.nextSibling; - } - if (isLast) { - tpart.appendChild(tar._tar); - } - } else if (!tnext && tpart) { - tpart.appendChild(tar._tar); - } - tnext = tpart = isLast = void 0; - tar.addEventListener("DOMNodeInsertedIntoDocument", tar._texto, false); - evt = tar = void 0; - },false); -}; -SVGTextPositioningElement.prototype = Object._create(SVGTextContentElement); -SVGTextPositioningElement.prototype._texto = function(evt) { - var tar = evt.target, - ti = tar.firstChild, - ttp = tar._tar, - style = tar.ownerDocument.defaultView.getComputedStyle(tar, null), - deter = Math.sqrt(Math.abs(tar.getScreenCTM()._determinant())), - n = parseFloat(style.getPropertyValue("font-size")) * deter, - tod = tar.ownerDocument.documentElement, - ttpc = ttp, //ttpcはttpのキャッシュ - tlen = tar.getComputedTextLength(), - anchor = style.getPropertyValue("text-anchor"), - tedeco = style.getPropertyValue("text-decoration"), //text-decorationは継承しないので、個々に設定する - ttps = ttp.style, - ae = [], - lts = parseFloat(style.getPropertyValue("letter-spacing")), - wds = parseFloat(style.getPropertyValue("word-spacing")); - ttps.fontSize = n + "px"; //nは算出された文字の大きさ (CSSではなく、SVG独自のCTM方式による) - ttps.fontFamily = style.getPropertyValue("font-family"); - ttps.fontStyle = style.getPropertyValue("font-style"); - ttps.fontWeight = style.getPropertyValue("font-weight"); - if (isFinite(lts)) { - ttps.letterSpacing = lts * deter + "px"; - } - if (isFinite(parseFloat(wds))) { - ttps.wordSpacing = wds * deter + "px"; - } - /*ここでの変数jは前回ノードまでの総文字数*/ - for (var i=0, j=0, tli=tar.getNumberOfChars();i j) ? i - j : j - i; - var sty = ti._tars[ij].style, - p = tar.getStartPositionOfChar(i); - sty.position = "absolute"; - if (tar._isYokogaki) { - if (anchor === "middle") { - p.x -= tlen / 2; - } else if (anchor === "end") { - p.x -= tlen; - } - } else { - if (anchor === "middle") { - p.y -= tlen / 2; - } else if (anchor === "end") { - p.y -= tlen; - } - } - sty.left = p.x + "px"; - sty.top = p.y + "px"; - sty.width = "0px"; - sty.height = "0px"; - sty.marginTop = tar._isYokogaki ? -n-5+ "px" : "-5px"; - sty.lineHeight = n+10+ "px"; - sty.textDecoration = tedeco; - sty.display = "none"; - ttp.appendChild(ti._tars[ij]); - sty = p = void 0; - } - if (ti.nodeName === "#text") { - if ((ti.data.length+j) <= i+1) { //テキストノード内の文字をすべて処理し終えれば - j = j + ti.data.length; - if (ti.data === "") { - /*空文字列の場合、文字数をカウントせず、iを減らしておく*/ - --i; - } - if (ti.parentNode.localName === "a") { - ti = ti.parentNode; - ttp = ttpc; - } - ti = ti.nextSibling; - } - } else if (!!ti.getNumberOfChars) { - if ((ti.getNumberOfChars()+j) <= i+1) { - j = j + ti.getNumberOfChars(); - ti = ti.nextSibling; - } - } else if ((ti.localName === "a") && (ti.namespaceURI === "http://www.w3.org/2000/svg") && ti.firstChild) { - ttp = ti._tar; - ti = ti.firstChild; - ae[ae.length] = ti; - if (i === 0) { - --i; - } else { - /*前にテキストノードがある場合など、iが0以上であれば、カウントを前回のテキストノードまでリセットしておく*/ - i-=2; - } - } - } - } - var color = style.getPropertyValue("fill"), - cursor = style.getPropertyCSSValue("cursor"), - vis = style.getPropertyCSSValue("visibility"), - disp = style.getPropertyCSSValue("display"), - tts = tar._tar.style, - tft = tar.firstChild._tars, //空白のテキストノードの場合、tftがundefinedになる恐れがある - ttt = tft[0] ? tft[0].innerText.charAt(0) : [""], //あらかじめ初期化しておく - tfti; - if (color === "none"){ - tts.color = "transparent"; - } else if (color.indexOf("url") === -1) { - tts.color = color; - } else { - tts.color = "black"; - } - if (cursor && !cursor._isDefault) { //初期値でないならば - var tc = cursor.cssText; - tts.cursor = tc.split(":")[1]; - tc = void 0; - } - if ((tar.x.baseVal.numberOfItems === 1) && (tar.y.baseVal.numberOfItems === 1) - && tar._isYokogaki && (tar.firstChild.nodeName === "#text")) { - /*xとy属性が一つの値しか取らないとき、字詰めの処理をすべてブラウザに任せておく。 - *以下では、他のdiv要素のテキストをすべて、最初のdiv要素にまとめている - */ - for (var i=1, tli=tft.length;i -1)) { - di = "none"; - } else if (disp && !disp._isDefault) { - di = "block"; - } - var jt = tar._tar.firstChild, - j = 0; - while (jt) { - jt.style.display = di; - jt = jt.nextSibling; - } - while (ae[j]) { //要素内部にあるa要素の処理 - for (var l=0, tli=ae[j]._tars.length;l 102 && !uri)) { - throw new SVGException(/*SVGException.SVG_INVALID_VALUE_ERR*/ 1); - } - this.uri = uri; - this.paintType = paintType; - if (paintType === /*SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR*/ 102) { - paintType = /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3; - } - this.setColor(paintType, rgbColor, iccColor); //SVGColorのsetColorメソッドを用いる -}; -// raises( SVGException ); -t = void 0; -})(SVGPaint); - -function SVGMarkerElement(){ - SVGSVGElement.apply(this, [{createElement:function(){}}]); - this._tar = {style:{}}; //getScreenCTMメソッド対策 - var sl = SVGAnimatedLength; - /*readonly SVGAnimatedLength*/ this.refX = new sl(); - /*readonly SVGAnimatedLength*/ this.refY = new sl(); - /*readonly SVGAnimatedEnumeration*/ this.markerUnits = new SVGAnimatedEnumeration(); - this.markerUnits.baseVal = /*SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH*/ 2; - /*readonly SVGAnimatedLength*/ this.markerWidth = new sl(); - /*readonly SVGAnimatedLength*/ this.markerHeight = new sl(); - this.refX.baseVal.newValueSpecifiedUnits(1, 0); - this.refY.baseVal.newValueSpecifiedUnits(1, 0); - this.markerWidth.baseVal.newValueSpecifiedUnits(1, 3); - this.markerHeight.baseVal.newValueSpecifiedUnits(1, 3); - sl = void 0; - /*readonly SVGAnimatedEnumeration*/ this.orientType = new SVGAnimatedEnumeration(); - this.orientType.baseVal = /*SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE*/ 2; - /*readonly SVGAnimatedAngle*/ this.orientAngle = new SVGAnimatedAngle(); - //SVGFitToViewBoxのインターフェースはSVGSVGElementで代用 - this.addEventListener("DOMAttrModified", function(evt) { - var tar = evt.target, - en = evt.newValue, - angle; - if (evt.attrName === "orient") { - if (en === "auto") { - tar.setOrientToAuto(); - } else { - angle = tar.ownerDocument.documentElement.createSVGAngle(); - angle.newValueSpecifiedUnits(1, +en); - tar.setOrientToAngle(angle); - } - } else if (evt.attrName === "markerUnits") { - if (en === "strokeWidth") { - tar.markerUnits.baseVal = /*SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH*/ 2; - } else { - tar.markerUnits.baseVal = /*SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE*/ 1; - } - } - }, false); - this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { - /*注意: グローバル関数を書き換えているので注意を要する*/ - var ns = NAIBU._setPaint, - id = evt.target.getAttributeNS(null, "id"); - NAIBU._setPaint = (function(ns, id) { - return function(tar, ctm) { - ns(tar, ctm); - var td = tar.ownerDocument, - tde = td.documentElement, - style = td.defaultView.getComputedStyle(tar, ""), - ms = style.getPropertyValue("marker-start").slice(5, -1), - me = style.getPropertyValue("marker-end").slice(5, -1), - mid = style.getPropertyValue("marker-mid").slice(5, -1), - marker, - cmarker, - gmarker, - tr, - tn, - ttr, - sth, - ctm, - sstyle, - nstyle, - plist, - regAZ, - regm, - u, t, - lf = function (x, y) { - cmarker = marker.cloneNode(true); - gmarker = td.createElementNS("http://www.w3.org/2000/svg", "g"); - /*marker要素の子要素はすべて、g要素としてまとめておく*/ - while (cmarker.lastChild) { - gmarker.appendChild(cmarker.lastChild); - } - tr = gmarker.transform.baseVal; - ttr = tar.transform.baseVal.consolidate() || td.documentElement.createSVGMatrix(); - if (marker.markerUnits.baseVal === /*SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH*/ 2) { - sth = +style.getPropertyValue("stroke-width"); - } else { - /*参照要素の行列の積を適用*/ - sth = 1; - } - if (marker.hasAttributeNS(null, "viewBox")) { - marker.viewport.width = marker.markerWidth.baseVal.value; - marker.viewport.height = marker.markerHeight.baseVal.value; - /*applyを使って、marker要素のCTMを算出*/ - ctm = tde.getScreenCTM.apply(marker); - } else { - ctm = tde.createSVGMatrix(); - } - if (marker.orientType.baseVal === /*SVGMarkerElement.SVG_MARKER_ORIENT_AUTO*/ 1) { - angle = Math.atan2(plist[1].y-plist[0].y, plist[1].x-plist[0].x)*180/Math.PI; - } else { - angle = marker.orientAngle.baseVal.value; - } - tr.appendItem(tr.createSVGTransformFromMatrix(ttr.translate(x, y) - .rotate(angle) - .scale(sth) - .multiply(ctm) - .translate(-marker.refX.baseVal.value, -marker.refY.baseVal.value))); - sstyle = td.defaultView.getComputedStyle(marker, ""); - nstyle = gmarker.style; - regAZ = /([A-Z])/; - regm = /\-/; - for (var i in CSS2Properties) { - if (CSS2Properties.hasOwnProperty(i) && (i !== "_list")) { - i = i.replace(regAZ, "-"); - if (RegExp.$1) { - u = "-" +RegExp.$1.toLowerCase(); - } else { - u = "-"; - } - i = i.replace(regm, u); - nstyle.setProperty(i, sstyle.getPropertyValue(i), ""); - } - } - tar.parentNode.insertBefore(gmarker, tar.nextSibling); - }; - /*url(#id)で一致する文字列があるかどうか*/ - if (ms === id) { - marker = td.getElementById(ms); - if (tar.normalizedPathSegList || tar.points) { - tn = tar.normalizedPathSegList || tar.points; - plist = [tn.getItem(0), tn.getItem(1)]; - } else if (tar.x1) { - plist = [{x:tar.x1, y:tar.y1}, {x:tar.x2, y:tar.y2}]; - } - lf(plist[0].x, plist[0].y); - } - if (me === id) { - marker = td.getElementById(me); - if (tar.normalizedPathSegList || tar.points) { - tn = tar.normalizedPathSegList || tar.points; - plist = [tn.getItem(tn.numberOfItems-2), tn.getItem(tn.numberOfItems-1)]; - } else if (tar.x1) { - plist = [{x:tar.x1, y:tar.y1}, {x:tar.x2, y:tar.y2}]; - } - lf(plist[1].x, plist[1].y); - } - if (mid === id) { - marker = td.getElementById(mid); - } - td = tde = style = sstyle = nstyle = ms = me = mid = marker = cmarker = gmarker = ctm = sth = tr = tn = ttr = plist = regAZ = regm = u = t = lf = void 0; - }; - })(ns, id); - }, false); -}; -(function(t){ - // Marker Unit Types - /*unsigned short t.SVG_MARKERUNITS_UNKNOWN = 0; - /*unsigned short t.SVG_MARKERUNITS_USERSPACEONUSE = 1; - /*unsigned short t.SVG_MARKERUNITS_STROKEWIDTH = 2; - // Marker Orientation Types - /*unsigned short t.SVG_MARKER_ORIENT_UNKNOWN = 0; - /*unsigned short t.SVG_MARKER_ORIENT_AUTO = 1; - /*unsigned short t.SVG_MARKER_ORIENT_ANGLE = 2;*/ - t.prototype = Object._create(SVGSVGElement); - t.prototype.getScreenCTM = SVGElement.prototype.getScreenCTM; - /*void*/ t.prototype.setOrientToAuto = function() { - this.orientType.baseVal = /*t.SVG_MARKER_ORIENT_AUTO*/ 1; -}; -/*void*/ t.prototype.setOrientToAngle = function(/*SVGAngle*/ angle ) { - this.orientType.baseVal = /*t.SVG_MARKER_ORIENT_ANGLE*/ 2; - this.orientAngle.baseVal = angle; - -}; -})(SVGMarkerElement); -function SVGColorProfileElement() { - SVGElement.apply(this); - /*DOMString*/ this._local; - // raises DOMException on setting - // (NOTE: is prefixed by "_" - // as "local" is an IDL keyword. The - // prefix will be removed upon processing) - /*DOMString*/ this.name; - /*unsigned short*/ this.renderingIntent; - SVGURIReference.apply(this); -}; -SVGColorProfileElement.prototype = Object._create(SVGElement); - -function SVGColorProfileRule() { - SVGCSSRule.apply(this); - /*DOMString*/ this.src; - /*DOMString*/ this.name; - /*unsigned short*/ this.renderingIntent; -}; -SVGColorProfileRule.prototype = Object._create(SVGCSSRule); - -function SVGGradientElement() { - SVGElement.apply(this); - SVGURIReference.apply(this); - /*readonly SVGAnimatedEnumeration*/ this.gradientUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedTransformList*/ this.gradientTransform = new SVGAnimatedTransformList(); - /*readonly SVGAnimatedEnumeration*/ this.spreadMethod = new SVGAnimatedEnumeration(); - this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { - var grad = evt.target, - ele = evt._tar, - t = evt._style, //eleはv:fill要素やv:stroke要素のノード、tはラップした要素ノードのスタイルを収納 - grad2 = grad, - href, stops, length, - color = [], - colors = [], - opacity = [], - stop, sstyle, ci; - if (!ele || !grad) { //まだ、path要素などが設定されていない場合 - grad = ele = t = grad2 = href = stops = length = color = colors = opacity = void 0; - return; - } - if (grad._instance) { //xlink言語で呼び出されたノードが_instanceに収納されているならば - grad2 = grad._instance; - } - stops = grad2.getElementsByTagNameNS("http://www.w3.org/2000/svg", "stop"); - if (!stops) { - ele = t = href = grad = grad2 = stops = color = colors = opacity = void 0; - return; - } - length = stops.length; - for (var i = 0; i < length; ++i) { - stop = stops[i]; - sstyle = stop.ownerDocument.defaultView.getComputedStyle(stop, ""); - ci = sstyle.getPropertyCSSValue("stop-color"); - if (ci && (ci.colorType === /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3)) { - /*再度、設定。css.jsのsetPropertyを参照*/ - sstyle.setProperty("color", sstyle.getPropertyValue("color")); - } - color[i] = "rgb(" +ci.rgbColor.red.getFloatValue(1)+ "," +ci.rgbColor.green.getFloatValue(1)+ "," +ci.rgbColor.blue.getFloatValue(1)+ ")"; - colors[i] = stop.offset.baseVal + " " + color[i]; - opacity[i] = (sstyle.getPropertyValue("stop-opacity") || 1) * t.getPropertyValue("fill-opacity") * t.getPropertyValue("opacity"); - } - ele["method"] = "none"; - ele["color"] = color[0]; - ele["color2"] = color[length-1]; - ele["colors"] = colors.join(","); - // When colors attribute is used, the meanings of opacity and o:opacity2 are reversed. - ele["opacity"] = opacity[length-1]+ ""; - ele["o:opacity2"] = opacity[0]+ ""; - /*SVGRadialGradientElementインターフェースで利用する*/ - grad._color = color; - var gt = grad2.getAttributeNS(null, "gradientTransform"); - if (gt) { - grad.setAttributeNS(null, "transform", gt); - } - grad = grad2 = ele = stops = length = color = colors = opacity = evt = t = href = stop = sstyle = ci = void 0; - }, false); -}; -SVGGradientElement.prototype = Object._create(SVGElement); - // Spread Method Types - /*unsigned short SVGGradientElement.SVG_SPREADMETHOD_UNKNOWN = 0; - /*unsigned short SVGGradientElement.SVG_SPREADMETHOD_PAD = 1; - /*unsigned short SVGGradientElement.SVG_SPREADMETHOD_REFLECT = 2; - /*unsigned short SVGGradientElement.SVG_SPREADMETHOD_REPEAT = 3;*/ - -function SVGLinearGradientElement() { - SVGGradientElement.apply(this); - var sl = SVGAnimatedLength; - /*readonly SVGAnimatedLength*/ this.x1 = new sl(); - /*readonly SVGAnimatedLength*/ this.y1 = new sl(); - /*readonly SVGAnimatedLength*/ this.x2 = new sl(); - /*readonly SVGAnimatedLength*/ this.y2 = new sl(); - sl = void 0; - this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { - var grad = evt.target, ele = evt._tar, angle = 270; - if (!!!ele) { //まだ、path要素などが設定されていない場合 - return; - } - var style = grad.ownerDocument.defaultView.getComputedStyle(grad, ""); - var fontSize = parseFloat(style.getPropertyValue("font-size")); - grad.x1.baseVal._emToUnit(fontSize); - grad.y1.baseVal._emToUnit(fontSize); - grad.x2.baseVal._emToUnit(fontSize); - grad.y2.baseVal._emToUnit(fontSize); - angle = 270 - Math.atan2(grad.y2.baseVal.value-grad.y1.baseVal.value, grad.x2.baseVal.value-grad.x1.baseVal.value) * 180 / Math.PI; - if (angle >= 360) { - angle -= 360; - } - ele.setAttribute("type", "gradient"); - ele.setAttribute("angle", angle + ""); - evt = ele = grad = angle = style = fontSize = void 0; - }, false); -}; -SVGLinearGradientElement.prototype = Object._create(SVGGradientElement); - -function SVGRadialGradientElement(_doc) { - SVGGradientElement.apply(this); - var sl = SVGAnimatedLength; - /*readonly SVGAnimatedLength*/ this.cx = new sl(); - /*readonly SVGAnimatedLength*/ this.cy = new sl(); - /*readonly SVGAnimatedLength*/ this.r = new sl(); - /*readonly SVGAnimatedLength*/ this.fx = new sl(); - /*readonly SVGAnimatedLength*/ this.fy = new sl(); - sl = void 0; - this.cx.baseVal.value = this.cy.baseVal.value = this.r.baseVal.value = 0.5; - this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { - var grad = evt.target, - ele = evt._tar, - tar = evt._ttar; //eleはv:fill要素。tarはターゲットとになる要素 - if (!!!ele) { //まだ、path要素などが設定されていない場合 - return; - } - ele.setAttribute("type", "gradientTitle"); - ele.setAttribute("focus", "100%"); - ele.setAttribute("focusposition", "0.5 0.5"); - if (tar.localName === "rect") { - /*VMLでは、図の形状に沿って、円状のグラデーションを処理するようになっているため、 - *四角だとおかしな模様が出てしまう。以下はそれを避ける処理 - */ - var style = grad.ownerDocument.defaultView.getComputedStyle(tar, ""), - fontSize = parseFloat(style.getPropertyValue("font-size")); - grad.cx.baseVal._emToUnit(fontSize); - grad.cy.baseVal._emToUnit(fontSize); - grad.r.baseVal._emToUnit(fontSize); - grad.fx.baseVal._emToUnit(fontSize); - grad.fy.baseVal._emToUnit(fontSize); - var cx = grad.cx.baseVal.value, - cy = grad.cy.baseVal.value, - r = grad.r.baseVal.value, - mr = Math.round, - rx, ry; - rx = ry = r; - var tarrect = tar.getBBox(), - vi = tar.ownerDocument.documentElement.viewport, - el = mr(vi.width), - et = mr(vi.height), - er = 0, - eb = 0, - units = grad.getAttributeNS(null, "gradientUnits"); - if (!units || units === "objectBoundingBox") { - //%の場合は小数点に変換(10% -> 0.1) - cx = cx > 1 ? cx/100 : cx; - cy = cy > 1 ? cy/100 : cy; - r = r > 1 ? r/100 : r; - //要素の境界領域を求める(四隅の座標を求める) - var nx = tarrect.x, - ny = tarrect.y, - wid = tarrect.width, - hei = tarrect.height; - cx = cx*wid + nx; - cy = cy*hei + ny; - rx = r*wid; - ry = r*hei; - nx = ny = wid = hei = void 0; - } - var matrix = tar.getScreenCTM().multiply(grad.getCTM()); - el = cx - rx; - et = cy - ry; - er = cx + rx; - eb = cy + ry; - var rrx = rx * 0.55228, - rry = ry * 0.55228, - list = ["m", cx,et, "c", cx-rrx,et, el,cy-rry, el,cy, el,cy+rry, cx-rrx,eb, cx,eb, cx+rrx,eb, er,cy+rry, er,cy, er,cy-rry, cx+rrx,et, cx,et, "x e"]; - for (var i = 0, lili = list.length; i < lili;) { - if (isNaN(list[i])) { //コマンド文字は読み飛ばす - ++i; - continue; - } - var p = grad.ownerDocument.documentElement.createSVGPoint(); - p.x = parseFloat(list[i]); - p.y = parseFloat(list[i+1]); - var pmt = p.matrixTransform(matrix); - list[i] = mr(pmt.x); - i++; - list[i] = mr(pmt.y); - i++; - p = pmt = void 0; - } - var ellipse = list.join(" "), - outline = _doc.getElementById("_NAIBU_outline"), - background = _doc.createElement("div"), - bstyle = background.style; - bstyle.position = "absolute"; - bstyle.display = "inline-block"; - var w = vi.width, - h = vi.height; - bstyle.textAlign = "left"; - bstyle.top = "0px"; - bstyle.left = "0px"; - bstyle.width = w+ "px"; - bstyle.height = h+ "px"; - outline.appendChild(background); - bstyle.filter = "progid:DXImageTransform.Microsoft.Compositor"; - background.filters.item('DXImageTransform.Microsoft.Compositor').Function = 23; - var circle = '' +ele.outerHTML+ '', - data = tar._tar.path.value; - background.innerHTML = ''; - background.filters[0].apply(); - background.innerHTML = circle; - background.filters[0].play(); - tar._tar.parentNode.insertBefore(background, tar._tar); - tar._tar.filled = "false"; - ellipse = outline = background = style = fontSize = bstyle = circle = data = list = mr = gt = cx = cy = r = w = h = matrix = void 0; - } else if (!ele.parentNode){ - tar._tar.appendChild(ele); - } - evt = tar = ele = gard = void 0; - }, false); -}; -SVGRadialGradientElement.prototype = Object._create(SVGGradientElement); - -function SVGStopElement() { - SVGElement.apply(this); - /*readonly SVGAnimatedNumber*/ this.offset = new SVGAnimatedNumber(); - this.addEventListener("DOMAttrModified", function(evt) { - if (evt.attrName === "offset") { - evt.target.offset.baseVal = parseFloat(evt.newValue); - } - evt = void 0; - }, false); -}; -SVGStopElement.prototype = Object._create(SVGElement); - -function SVGPatternElement() { - SVGElement.apply(this); - var sl = SVGAnimatedLength; - /*readonly SVGAnimatedEnumeration*/ this.patternUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedEnumeration*/ this.patternContentUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedTransformList*/ this.patternTransform = new SVGAnimatedTransformList(); - /*readonly SVGAnimatedLength*/ this.x = new sl(); - /*readonly SVGAnimatedLength*/ this.y = new sl(); - /*readonly SVGAnimatedLength*/ this.width = new sl(); - /*readonly SVGAnimatedLength*/ this.height = new sl(); - sl = void 0; - SVGURIReference.apply(this); - //SVGFitToViewBoxのインターフェースを用いる - /*readonly SVGAnimatedRect*/ this.viewBox = new SVGAnimatedRect(); - /*readonly SVGAnimatedPreserveAspectRatio*/ this.preserveAspectRatio = new SVGAnimatedPreserveAspectRatio(); - /*unsigned short*/ this.zoomAndPan = /*SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE*/ 1; -}; -SVGPatternElement.prototype = Object._create(SVGElement); - -function SVGClipPathElement() { - SVGElement.apply(this); - /*readonly SVGAnimatedEnumeration*/ this.clipPathUnits = new SVGAnimatedEnumeration(); -}; -SVGClipPathElement.prototype = Object._create(SVGElement); - -function SVGMaskElement() { - SVGElement.apply(this); - var sl = SVGAnimatedLength; - /*readonly SVGAnimatedEnumeration*/ this.maskUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedEnumeration*/ this.maskContentUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedLength*/ this.x = new sl(); - /*readonly SVGAnimatedLength*/ this.y = new sl(); - /*readonly SVGAnimatedLength*/ this.width = new sl(); - /*readonly SVGAnimatedLength*/ this.height = new sl(); - sl = void 0; -}; -SVGMaskElement.prototype = Object._create(SVGElement); - -function SVGFilterElement() { - SVGElement.apply(this); - var sl = SVGAnimatedLength; - /*readonly SVGAnimatedEnumeration*/ this.filterUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedEnumeration*/ this.primitiveUnits = new SVGAnimatedEnumeration(); - /*readonly SVGAnimatedLength*/ this.x = new sl(); - /*readonly SVGAnimatedLength*/ this.y = new sl(); - /*readonly SVGAnimatedLength*/ this.width = new sl(); - /*readonly SVGAnimatedLength*/ this.height = new sl(); - sl = void 0; - /*readonly SVGAnimatedInteger*/ this.filterResX = new SVGAnimatedInteger(); - /*readonly SVGAnimatedInteger*/ this.filterResY = new SVGAnimatedInteger(); - SVGURIReference.apply(this); - //setFilterRes (/*unsigned long*/ filterResX,/*unsigned long*/ filterResY ); -}; -SVGFilterElement.prototype = Object._create(SVGElement); - -function SVGFilterPrimitiveStandardAttributes(ele) { - SVGStylable.apply(this, arguments); - this._tar = ele; - var sl = SVGAnimatedLength; - /*readonly SVGAnimatedLength*/ this.x = new sl(); - /*readonly SVGAnimatedLength*/ this.y = new sl(); - /*readonly SVGAnimatedLength*/ this.width = new sl(); - /*readonly SVGAnimatedLength*/ this.height = new sl(); - /*readonly SVGAnimatedString*/ this.result = new sl(); - sl = void 0; - }; -SVGFilterPrimitiveStandardAttributes.prototype = Object._create(SVGStylable); - -function SVGFEBlendElement() { - SVGElement.apply(this); - /*readonly SVGAnimatedString*/ this.in1 = new SVGAnimatedString(); - /*readonly SVGAnimatedString*/ this.in2 = new SVGAnimatedString(); - /*readonly SVGAnimatedEnumeration*/ this.mode = new SVGAnimatedEnumeration(); - this._fpsa = SVGFilterPrimitiveStandardAttributes(this); -}; -SVGFEBlendElement.prototype = Object._create(SVGElement); - // Blend Mode Types - /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_UNKNOWN = 0; - /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_NORMAL = 1; - /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_MULTIPLY = 2; - /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_SCREEN = 3; - /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_DARKEN = 4; - /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN = 5;*/ - -function SVGFEGaussianBlurElement() { - SVGElement.apply(this); - /*readonly SVGAnimatedString*/ this.in1 = new SVGAnimatedString(); - /*readonly SVGAnimatedNumber*/ this.stdDeviationX = new SVGAnimatedNumber(); - /*readonly SVGAnimatedNumber*/ this.stdDeviationY = new SVGAnimatedNumber(); - this._fpsa = SVGFilterPrimitiveStandardAttributes(this); -}; -SVGFEGaussianBlurElement.prototype = Object._create(SVGElement); -/*void*/ SVGFEGaussianBlurElement.prototype.setStdDeviation = function(/*float*/ stdDeviationX, /*float*/ stdDeviationY ) { - -}; - -function SVGCursorElement() { - SVGElement.apply(this); - /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); - /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); - SVGURIReference.apply(this); -}; -SVGCursorElement.prototype = Object._create(SVGElement); - -function SVGAElement(_doc) { - SVGElement.apply(this); - this._tar = _doc.createElement("a"); - _doc = void 0; - /*readonly SVGAnimatedString*/ this.target = new SVGAnimatedString(); - this.target.baseVal = "_self"; - this.addEventListener("DOMAttrModified", function(evt){ - var tar = evt.target; - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - if (evt.attrName === "target") { - tar.target.baseVal = evt.newValue; - } else if (evt.attrName === "xlink:title") { - tar._tar.setAttribute("title", evt.newValue); - } - evt = void 0; - }, false); - this.addEventListener("DOMNodeInserted", function(evt){ - var tar = evt.target; - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - if (tar.nextSibling) { - if (!!tar.parentNode._tar && !!tar.nextSibling._tar) { - tar.parentNode._tar.insertBefore(tar._tar, tar.nextSibling._tar); - } - } else if (!!tar.parentNode._tar){ - tar.parentNode._tar.appendChild(tar._tar); - } - var txts = tar._tar.style; - txts.cursor = "hand"; - txts.left = "0px"; - txts.top = "0px"; - txts.textDecoration = "none"; - txts = void 0; - var t = tar.target.baseVal; - var st = "replace"; - if (t === "_blank") { - st = "new"; - } - tar.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:show", st); - tar._tar.style.color = tar.ownerDocument.defaultView.getComputedStyle(tar, "").getPropertyValue("fill"); - tar = evt = void 0; - }, false); - this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ - var tar = evt.target; - if (!!tar._tar && (tar.nodeType === /*Node.ELEMENT_NODE*/ 1)) { - var txts = tar._tar.style; - txts.cursor = "hand"; - txts.textDecoration = "none"; - txts = void 0; - } - tar = evt = void 0; - return; //強制終了させる - }, true); - this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ - var tar = evt.target; - tar._tar.setAttribute("target", tar.target.baseVal); - if (tar.href.baseVal.indexOf(".svg") !== -1) { //もし、リンク先がSVGファイルならば - tar.addEventListener("click", function(evt){ - var tar = evt.target, - sd = document.body, - ob, nd; - sd.lastChild.innerHTML = ""; - if (tar.target.baseVal === "_self") { - nd = tar.ownerDocument._iframe; - nd.parentNode.insertBefore(sd.lastChild.firstChild, nd); - ob = nd.nextSibling; - if (ob && (ob.tagName === "OBJECT")) { - nd.previousSibling.setAttribute("width", ob.getAttribute("width")); - nd.previousSibling.setAttribute("height", ob.getAttribute("height")); - nd.parentNode.removeChild(ob); - } - ob = NAIBU._search([nd.previousSibling]); - nd.parentNode.removeChild(nd); - } else { - sd.appendChild(sd.lastChild.firstChild); - while (sd.firstChild !== sd.lastChild) { //オブジェクト要素以外を除去 - sd.removeChild(sd.firstChild); - } - ob = NAIBU._search([sd.lastChild]); - } - NAIBU.doc = new ActiveXObject("MSXML2.DomDocument"); - evt.preventDefault(); - ob._next = { - _init: (function (ob) { - return (function(){ - document.title = ob.getSVGDocument().title; - ob = void 0; - }); - })(ob) - }; - ob._init(); - sd = ob = nd = void 0; - }, false); - } - tar = void 0; - }, false); - SVGURIReference.apply(this); -}; -SVGAElement.prototype = Object._create(SVGElement); - -function SVGViewElement() { - SVGElement.apply(this); - /*readonly SVGStringList*/ this.viewTarget = new SVGStringList(); - //SVGFitToViewBoxのインターフェースを用いる - /*readonly SVGAnimatedRect*/ this.viewBox = new SVGAnimatedRect(); - /*readonly SVGAnimatedPreserveAspectRatio*/ this.preserveAspectRatio = new SVGAnimatedPreserveAspectRatio(); - /*unsigned short*/ this.zoomAndPan = /*SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE*/ 1; -}; -SVGViewElement.prototype = Object._create(SVGElement); - -function SVGScriptElement() { - SVGElement.apply(this); - /*DOMString*/ this.type; - SVGURIReference.apply(this); - this.addEventListener("DOMAttrModified", function(evt){ - if (evt.attrName === "type") { - evt.target.type = evt.newValue; - } - evt = void 0; - }, false); - this.addEventListener("S_Load", function(evt){ - var tar = evt.target, script = tar._text; - var tod = tar.ownerDocument; - NAIBU._temp_doc = tod; - script = script.replace(/function\s+(\w+)/g, "$1 = function"); - script = "(function(document){" +script+ "})(NAIBU._temp_doc);"; - try { - NAIBU.eval(script); - } catch (e) { //IE9では、documentがconstとして定数指定されているため、引数として指定できない - script = script.replace(/function\(document\){/, "function() {"); - NAIBU.eval(script); - } - tar = evt = script = void 0; - }, false); - this.addEventListener("DOMNodeInserted", function(evt){ - var tar = evt.target; - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - if (tar.nodeName === "#cdata-section") { - evt.currentTarget._text = tar.data; - } - return; - } - tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ - var tar = evt.target; - if (evt.eventPhase === /*Event.AT_TARGET*/ 2 && !tar.getAttributeNodeNS("http://www.w3.org/1999/xlink", "xlink:href")) { - var evtt = tar.ownerDocument.createEvent("SVGEvents"); - evtt.initEvent("S_Load", false, false); - evt.currentTarget.dispatchEvent(evtt); - } - tar = evt = void 0; - }, false); - }, false); -}; -SVGScriptElement.prototype = Object._create(SVGElement); - -function SVGEvent() { - Event.apply(this); -}; -SVGEvent.prototype = Object._create(Event); - -function SVGZoomEvent() { - UIEvent.apply(this); - /*readonly SVGRect*/ this.zoomRectScreen = new SVGRect(); - /*readonly float*/ this.previousScale = 1; - /*readonly SVGPoint*/ this.previousTranslate = new SVGPoint(); - /*readonly float*/ this.newScale = 1; - /*readonly SVGPoint*/ this.newTranslate = new SVGPoint(); -}; -SVGZoomEvent.prototype = Object._create(UIEvent); - -function SVGAnimationElement() { - SVGElement.apply(this); - /*SIEにおけるSVGElementでは、fill属性とStyleSheetを結びつける機構があるため、 - *styleのsetPropertyメソッドを無効化させておく必要がある - */ - this.style.setProperty = function(){}; - this._tar = null; - /*readonly SVGElement*/ this.targetElement; - /*それぞれのプロパティは、_を除いた属性に対応している*/ - this._begin = this._end = this._repeatCount = this._repeatDur = this._dur = this._resatrt = null; - this._currentFrame = 0; - /*_isRepeatと_numRepeatは繰り返し再生のときに使う。なお、後者は現在のリピート回数*/ - this._isRepeat = false; - this._numRepeat = 0; - /*_isStartプロパティは一度は起動したかどうか*/ - this._isStarted = false; - /*_startと_finishプロパティはミリ秒数のリストを収納する。 - *_startはアニメ開始時の秒数リスト。_finishはアニメ終了時の秒数のリスト。 - *なお、文書読み込み終了時(アニメ開始時刻)の秒数を0とする。 - *_startingプロパティは現在アニメーションでの開始時刻。getSartTimeメソッドで使う - */ - this._start = this._finish = this._starting = null; - /*_activeDurプロパティは現時点でのアニメーションの活動期間*/ - this._activeDur = 0; - this._from = this._to = this._values = this._by = null; - this._keyTimes = null; - this.addEventListener("beginEvent", function(evt) { - try { - var tar = evt.target, - begin = tar.getStartTime(), - durv = tar._dur, - dur = tar._getOffset(durv), - end = tar._finish, - endv= tar._end, - td = tar._repeatDur, - tc = tar._repeatCount, - ac = null; - if (end) { - for (var i=0, eli=end.length;i= begin) { - end = end[i]; - break; - } - } - } else { - /*イベント待ちの場合は、endの値を、indefiniteとみなす。参照: http://www.w3.org/TR/smil-animation/#ComputingActiveDur - * - * 3.3.4. Computing the active duration - * - * If the value of end cannot be resolved (e.g. when it is event-based), - * the value is considered to be "indefinite" for the purposes of evaluating the active duration. - * - */ - endv = null; - } - /*Activate Duration (活性持続時間と呼ぶことにする)を計算 - *計算方法は以下を参照のこと - *http://www.w3.org/TR/smil-animation/#ComputingActiveDur - *3.3.4. Computing the active duration - */ - if ((td === "indefinite") || (tc === "indefinite")) { - if (endv) { - ac = end - begin; - } else { - /*活性持続時間が不定(indefinite)なので、強制的にアニメを終了させる*/ - ac = null; - } - } else if (durv === "indefinite") { - if (!tc && !endv) { - /*活性持続時間が不定(indefinite)なので、強制的にアニメを終了させる*/ - ac = null; - } else if (tc && !endv) { - ac = tar._getOffset(td); - } else if (!tc && endv) { - ac = end - begin; - } else { - ac = (tar._getOffset(td) > (end - begin)) ? tar._getOffset(td) : (end - begin); - } - } else if (durv && !td && !tc && !endv) { - ac = dur; - } else if (durv && !td && tc && !endv) { - ac = dur * (+tc); - } else if (durv && td && !tc && !endv) { - ac = tar._getOffset(td); - } else if (durv && !td && !tc && endv) { - ac = (dur > (end - begin)) ? dur : (end - begin); - } else if (durv && td && tc && !endv) { - ac = (+tc*dur > tar._getOffset(td)) ? +tc*dur : tar._getOffset(td); - } else if (durv && td && tc && endv) { - ac = (+tc*dur > Math.min(+td, (end-begin))) ? +tc*dur : Math.min(tar._getOffset(td), (end - begin)); - } else if (durv && td && !tc && endv) { - ac = (tar._getOffset(td) > (end - begin)) ? tar._getOffset(td) : (end - begin); - } else if (durv && !td && tc && endv) { - ac = (+tc*dur > (end - begin)) ? +tc*dur : (end - begin); - } - } catch (e) { - tar.endElementAt(1); - throw new DOMException(/*DOMException.INVALID_STATE_ERR*/ 11); - } - if ((ac || (ac === 0)) && isFinite(ac)) { - /*endの値がすでにある場合は、二重指定を避ける*/ - endv || tar.endElementAt(ac); - tar._activeDur = ac; - } - tar = begin = dur = durv = end = endv= td = tc = ac = void 0; - }, false); - this.addEventListener("DOMAttrModified", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; - } - var tar = evt.target, - name = evt.attrName, - evtv = evt.newValue; - if (name === "begin") { - tar._begin = evtv.replace(/\s+/g, "").split(";"); //空白は取り除く - } else if (name === "end") { - tar._end = evtv.replace(/\s+/g, "").split(";"); - } else if (name === "dur") { - tar._dur = evtv; - } else if (name === "repeatCount") { - tar._repeatCount = evtv; - tar._isRepeat = true; - } else if (name === "repeatDur") { - tar._repeatCount = evtv; - tar._isRepeat = true; - } else if (name === "from") { - tar._from = evtv; - } else if (name === "to") { - tar._to = evtv; - } else if (name === "values") { - tar._values = evtv.split(";"); - } else if (name === "by") { - tar._by = evtv; - } else if (name === "keyTimes") { - var s = evtv.split(";"); - tar._keyTimes = []; //_keyTimesプロパティを初期化 - for (var i=0;iif none of the from, to, by or values attributes are specified, the animation will have no effect - *「3.2.2. Animation function values」より引用 - *http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues - */ - return tar; - } - /*begin属性とend属性を処理する*/ - var that = tar, - timing = function(val, name, offset) { - /*timing関数は時間のタイミングをidとeventと、clock-value(offset)に分割して処理していく - *まず、idを検出するためのsearcIdローカル関数を作る - */ - var searchId = function () { - var n = val.indexOf("."); - if ((n > 0) && (/[a-z]/i).test(val.charAt(n+1))) { //. (dot)の後がアルファベットならば - return (val.slice(0, n)); - } - n = nn = void 0; - return ""; - }, - id; - /* - *W3CのSMIl AnimationのTimingモデルは7パターンがあるので、場合分けする - */ - if (isFinite(parseFloat(val))) { //1) offset-valueの場合 - that[name](offset); - } else if (val.indexOf("repeat(") > -1) { //2) repeat-valueの場合 - var inte = parseFloat(val.slice(7)), - ds = (function(that, name, offset) { - return function (evt) { - if (inte === evt.target._numRepeat) { - that[name](offset); - } - }; - })(that, name, offset), - id = searchId(); - if (id) { - that.ownerDocument.getElementById(id).addEventListener("repeatEvent", ds); - } else { - that.addEventListener("repeatEvent", ds); - } - } else if (/\.(begin|end)/.test(val)) { //3) syncbase-valueの場合 - id = searchId(); - if (id) { - var ds = (function(that, name, offset) { - return function (evt) { - that[name](offset); - }; - })(that, name, offset), - ev = ""; - /\.(begin|end)/.test(val); //RegExp.$1のために、もう一度する必要がある - if (RegExp.$1 === "begin") { - ev = "beginEvent"; - } else if (RegExp.$1 === "end") { - ev = "endEvent"; - } - that.ownerDocument.getElementById(id).addEventListener(ev, ds, false); - } - } else if (val.indexOf("wallclock(") === 0) { //4) wallclock-valueの場合 - - } else if (val === "indefinite") { //5) indefiniteの場合 - } else if (val.indexOf("accesskey(") > -1) { //6) accesskey-valueの場合 - - } else { //7) event-valueの場合 - id = searchId(); - var ds = (function(that, name, offset) { - return function (evt) { - that[name](offset); - }; - })(that, name, offset); - if (id && val.match(/\.([a-z]+)/i)) { - that.ownerDocument.getElementById(id).addEventListener(RegExp.$1, ds); - } else if (val){ - that.targetElement.addEventListener(val.match(/^[a-z]+/i)[0], ds); - } - } - val = searchId = id = void 0; - }; - if (tar._begin) { - for (var i=0,tli=tar._begin.length;i 0)))) { - return; //restart属性の設定により、再起動させないようにする - } - if (this.getCurrentTime() > 0) { - /*アニメーションの最中で、beginEventが起きるときは、endEventが前もって起こされる。SVG1.1の仕様を参照 - * - * 19.4.2 Interface TimeEvent - * Note that if an element is restarted while it is currently playing, the element will raise an end event and another begin event, as the element restarts. - * - * http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent - * - */ - this.endElement(); - } - evt.initTimeEvent("beginEvent", ttd.defaultView, 0); - this.dispatchEvent(evt); - /*新しくリストの頭を更新して、別の値も実行させるようにする*/ - this._start && this._start.shift(); - this._isStarted = true; - ttd = evt = void 0; -}; -/*void*/ SVGAnimationElement.prototype.endElement = function() { - var ttd = this.ownerDocument, - evt = ttd.createEvent("TimeEvents"); - evt.initTimeEvent("endEvent", ttd.defaultView, 0); - this.dispatchEvent(evt); - this._finish && this._finish.shift(); - this._currentFrame = 0; -}; -/*void*/ SVGAnimationElement.prototype.beginElementAt = function(/*float*/ offset) { - var ntc = this.ownerDocument.documentElement.getCurrentTime(), - start = this._start || []; - for (var i=0,sli=start.length;i -1) { - s = val.slice(n[0]); - t = parseFloat(s); - } else if (n[1] > -1) { - s = val.slice(n[1]); - t = parseFloat(s); - } else { - s = val; - t = parseFloat(val); - } - if (isFinite(t)) { - if (/\d+\:(\d\d)\:([\d\.]+)$/.test(s)) { //Full-Clock-Valueの場合 - t = (t*3600 + parseInt(RegExp.$1, 10)*60 + parseFloat(RegExp.$2)) * 1000; - } else if (/\d\d\:([\d\.]+)$/.test(s)) { - t = (t*60 + parseFloat(RegExp.$1)) * 1000; - } else if (/(h|min|s)$/.test(s)) { - t *= this._unit[RegExp.$1]; - } - if (isFinite(t)) { - t *= 0.8; - return t; - } - } - return 0; -}; - -/*float*/ SVGAnimationElement.prototype.getStartTime = function(){ - if (this._starting || (this._starting === 0)) { - return (this._starting); - } else { - throw new DOMException(/*DOMException.INVALID_STATE_ERR*/ 11); - } -}; -/*getCurrentTimeメソッド - *現在の時間コンテナ内での時刻であり、 - *決して現在時刻ではない。要素のbeginイベントの発火したときが0sである。 - */ -/*float*/ SVGAnimationElement.prototype.getCurrentTime = function(){ - return (this._currentFrame * 125 * 0.8); -}; -/*float*/ SVGAnimationElement.prototype.getSimpleDuration = function(){ - if (!this._dur && !this._finish && (this._dur === "indefinite")) { - throw new DOMException(/*DOMException.NOT_SUPPORTED_ERR*/ 9); - } else { - return (this._getOffset(this._dur)); - } -}; - //raises( DOMException ); -NAIBU.Time = { - currentFrame : 0, - Max : 17000, - start : function() { - if (NAIBU.Clip.length > 0) { - screen.updateInterval = 42; //24fpsとして描画処理 - window.onscroll = function () { - screen.updateInterval = 0; - screen.updateInterval = 42; - }; - NAIBU.stop = setInterval( (function() { - try { - var ntc = NAIBU.Time.currentFrame, - nc = NAIBU.Clip, - s = ntc * 100; //フレーム数ntcをミリ秒数sに変換 (100 = 125 * 0.8) - if (ntc > NAIBU.Time.Max) { - clearInterval(NAIBU.stop); - } - nc[0] && nc[0].ownerDocument.documentElement.setCurrentTime(s); - for (var i=0,ncli=nc.length;i= nci.getSimpleDuration()*nci._numRepeat)) { - /*リピート処理*/ - var ttd = nci.ownerDocument, - evt = ttd.createEvent("TimeEvents"); - ++nci._numRepeat; - evt.initTimeEvent("repeatEvent", ttd.defaultView, nci._numRepeat); - nci.dispatchEvent(evt); - ttd = evt = void 0; - } - if (nci._finish && (nci.getCurrentTime() !== 0)) { - var fti = nci._finish[0]; - if ((fti || (fti === 0)) && (s1 <= fti) && (fti <= s)) { - nci.endElement(); - } - fti = void 0; - } - if (nci._frame) { - ++nci._currentFrame; - nci._frame(); - } - } - ++NAIBU.Time.currentFrame; - ntc = nc = s = nci = s1 = s2 = void 0; - } catch (e) { - } - }), - 1 - ); - } else { - window.onscroll = function () { - screen.updateInterval = 0; - window.onscroll = NAIBU.emptyFunction; - }; - } - } -}; -NAIBU.Clip = []; - -function SVGAnimateElement(){ - SVGAnimationElement.apply(this); - /*NAIBU.Clipについては、NAIBU.Timeで使う - *くわしくはNAIBU.Time.start関数のコードを参照 - */ - NAIBU.Clip[NAIBU.Clip.length] = this; - /*_valueListプロパティは、 - *機械が理解できる形で保管されているvalueの値の配列リスト - */ - this._valueList = []; - this._isDiscrete = false; - this.addEventListener("DOMAttrModified", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - if ((evt.attrName === "calcMode") && (evt.newValue === "discrete")) { - evt.target._isDiscrete = true; - } - }, false); - this.addEventListener("DOMNodeInserted", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - var tar = evt.target; - tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ - var tar = evt.target, - attrName = tar.getAttributeNS(null, "attributeName"), - ttr = tar.targetElement, - tta = ttr[attrName]; - /*tar.valuesのリスト: ["12px", "13px"] - *tar._valueList: [(new SVGPoint()), (new SVGPoint())] - * tar.valuesを機械が理解できるように変換したものがtar._valueList - *この_valueListプロパティはアニメの際に使うので、_valuesプロパティはアニメ中に使わないことに注意 - */ - var vi = ttr.cloneNode(false); - if (!tar._values[0]) { //to属性か、by属性が設定されている場合 - var ttrs = ttr.ownerDocument.defaultView.getComputedStyle(ttr, ""); - tar._values[0] = ttr.getAttributeNS(null, attrName) || ttrs.getPropertyValue(attrName); - if (!tar._values[1] && tar._values[2]) { //by属性のみが設定されている場合 - var v2 = parseFloat(tar._values[0]) + parseFloat(tar._values[2]), tanni = tar._values[0].match(/\D+/) || [""]; - tar._values[1] = v2 + tanni[0]; - tar._values.pop(); - v2 = tanni = void 0; - } - } - if (("animatedPoints" in ttr) && (attrName === "points")) { - ttr.animatedPoints = vi.points; - for (var i=0, tav=tar._values, tvli=tav.length;i -1) { //スタイルシートのプロパティならば - for (var i=0, tav=tar._values, tvli=tav.length;iアニメーションが起動している時,それは実際,DOMの中の属性値は変化しない。 - *http://www.jsa.or.jp/stdz/instac/syoukai/H13/H13annual_report/12/ngc-wg3/offline/smil_20_20020131/animation.html#animationNS-AnimationSandwichModel - */ - var evt = tar.ownerDocument._domnodeEvent(); - if (tar._keyTimes) { - var di = (tar._keyTimes[ii+1] - tar._keyTimes[ii]) * d; - var ti = tar._keyTimes[ii]; - } else { - var di = d / n; //keyTimesがなければ均等に時間を配分しておく - var ti = ii / n; - } - if (("animatedPoints" in ttr) && (attrName === "points")) { - var base = ttr.points; - ttr.points = ttr.animatedPoints; - ttr.dispatchEvent(evt); - ttr.animatedPoints = ttr.points; - ttr.points = base; - } else if (!!tta) { - var base = tta.baseVal, tanim = tta.animVal; - var v1 = tar._valueList[ii].value; - /*vを求める公式に関しては、SMIL2.0 Animation Moduleの単純アニメーション関数の項を参照 - * 3.4.2 Specifying the simple animation function f(t) - *http://www.w3.org/TR/2005/REC-SMIL2-20050107/animation.html#animationNS-SpecifyingAnimationFunction - */ - if (!tar._isDiscrete) { - var v2 = tar._valueList[ii+1].value, v = v1 + (v2-v1) * (tg-ti*d) / di; - } else { - var v = v1; - } - tanim.newValueSpecifiedUnits(base.unitType, v); - tta.baseVal = tanim; - tanim = void 0; - ttr.dispatchEvent(evt); - /*変化値はanimValプロパティに収納しておき、 - *変化する前の、元の値はbaseValプロパティに再び収納しておく - */ - tta.animVal = tta.baseVal; - tta.baseVal = base; - di = void 0; - } else if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば - var base = null; - var v1 = tar._valueList[ii].value, v2 = tar._valueList[ii+1].value; - if (!tar._isDiscrete) { - var v = v1 + (v2-v1) * (tg-ti*d) / di; - } else { - var v = v1; - } - } else if (("normalizedPathSegList" in ttr) && (attrName === "d")) { - var base = ttr.normalizedPathSegList; - ttr.normalizedPathSegList = ttr.animatedNormalizedPathSegList; - ttr.dispatchEvent(evt); - ttr.animatedNormalizedPathSegList = ttr.normalizedPathSegList; - ttr.normalizedPathSegList = base; - } - evt = tar = v1 = v2 = v = d = n = ii = tg = void 0; - }; - evt = vir = void 0; - }, false); - this.addEventListener("endEvent", function(evt) { - var tar = evt.target, - fill = tar.getAttributeNS(null, "fill"); - if (!fill || (fill === "remove")) { - var evt = tar.ownerDocument._domnodeEvent(); - tar.targetElement.dispatchEvent(evt); - evt = void 0; - tar._frame && tar._frame(); - } - delete tar._frame; - }, false); - this.addEventListener("repeatEvent", function(evt) { - var tar = evt.target; - }, false); -}; -SVGAnimateElement.prototype = Object._create(SVGAnimationElement); - -function SVGSetElement(){ - SVGAnimationElement.apply(this); - NAIBU.Clip[NAIBU.Clip.length] = this; - this._to = ""; - this.addEventListener("DOMAttrModified", function(evt) { - var tar = evt.target, name = evt.attrName; - if (name === "to") { - tar._to = evt.newValue; - } - tar = name = void 0; - }, false); - this.addEventListener("beginEvent", function(evt) { - var tar = evt.target; - tar._currentFrame = 1; //これがないと、NAIBU.stopの内部の処理の都合上、endEventが発動しない。 - if (tar.targetElement) { - var attrName = tar.getAttributeNS(null, "attributeName"), - newAttr = tar.targetElement.attributes.getNamedItemNS(null, attrName), - tta = tar.targetElement[attrName]; - if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば - /*前もって、スタイルシートの値を取得しておいて、endEventの際に使う*/ - tar._prestyle = tar.ownerDocument.defaultView.getComputedStyle(tar.targetElement, "").getPropertyValue(attrName); - var style = tar.ownerDocument.getOverrideStyle(tar.targetElement, ""); - style.setProperty(attrName, tar.getAttributeNS(null, "to"), null); - style = void 0; - } else if (!!tta) { - var base = tta.baseVal; - if (base instanceof SVGLength) { - tta.baseVal = tar.ownerDocument.documentElement.createSVGLength(); - } else if (base instanceof SVGRect) { - tta.baseVal = tar.ownerDocument.documentElement.createSVGRect(); - } - /*setAttrbute(NS)メソッドはDOM属性を書き換えるため利用しない。 - * - * 参照:アニメーションサンドイッチモデル - * >アニメーションが起動している時,それは実際,DOMの中の属性値は変化しない。 - *http://www.jsa.or.jp/stdz/instac/syoukai/H13/H13annual_report/12/ngc-wg3/offline/smil_20_20020131/animation.html#animationNS-AnimationSandwichModel - */ - var evt = tar.ownerDocument.createEvent("MutationEvents"); - evt.initMutationEvent("DOMAttrModified", true, false, newAttr, newAttr, tar._to, attrName, /*MutationEvent.MODIFICATION*/ 1); - tar.targetElement.dispatchEvent(evt); - evt = void 0; - /*変化値はanimValプロパティに収納しておき、 - *変化する前の、元の値はbaseValプロパティに再び収納しておく - */ - tta.animVal = tta.baseVal; - tta.baseVal = base; - } - } - evt = tar = attrName = void 0; - }, false); - this.addEventListener("endEvent", function(evt) { - var tar = evt.target, - fill = tar.getAttributeNS(null, "fill"); - if (!fill || (fill === "remove")) { - var attrName = tar.getAttributeNS(null, "attributeName"), - style = tar.ownerDocument.getOverrideStyle(tar.targetElement, ""); - if (tar._prestyle) { //スタイルシートの変更ならば - style.setProperty(attrName, tar._prestyle, null); - } else { - var evtt = tar.ownerDocument._domnodeEvent(); - tar.targetElement.dispatchEvent(evtt); - } - attrName = style = evtt = void 0; - } - tar = fill = void 0; - }, false); - this.addEventListener("repeatEvent", function(evt) { - var tar = evt.target, attrName = tar.getAttributeNS(null, "attributeName"), style = tar.ownerDocument.defaultView.getComputedStyle(tar.targetElement, ""); - }, false); -}; -SVGSetElement.prototype = new SVGAnimationElement(1); - -function SVGAnimateMotionElement(){ - SVGAnimationElement.apply(this); - NAIBU.Clip[NAIBU.Clip.length] = this; - this.addEventListener("DOMAttrModified", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; - } - var tar = evt.target, - name = evt.attrName; - if (name === "path") { - var d = tar.ownerDocument.createElementNS("http://www.w3.org/2000/svg", "path"); - d.setAttributeNS(null, "d", evt.newValue); - tar._path = d; - d = void 0; - } - }, false); - this.addEventListener("DOMNodeInserted", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - var tar = evt.target; - tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ - var vlist = [], - ti; - if (tar._values) { - for (var i=0, tav=tar._values, tvli=tav.length;i -1) { - NAIBU._noie_createFont(ti, _tar, true); - } - } - evt = tar = svg = curt = textElments = svgns = _tar = void 0; - }; - if (!fontFace.__isLinked || tar._isExternal) { - tar.ownerDocument.documentElement._svgload_limited = 0; - tar.ownerDocument.documentElement.addEventListener("SVGLoad", nefunc, false); - } - }, false); - }, false); -}; -SVGFontElement.prototype = Object._create(SVGElement); - -function SVGGlyphElement() /*: - SVGElement, - SVGStylable*/ { - SVGElement.apply(this); -}; -SVGGlyphElement.prototype = Object._create(SVGElement); - -function SVGMissingGlyphElement() /*: - SVGElement, - SVGStylable*/ { - SVGElement.apply(this); -}; -SVGMissingGlyphElement.prototype = Object._create(SVGElement); - -function SVGHKernElement() { - SVGElement.apply(this); -}; -SVGHKernElement.prototype = Object._create(SVGElement); - -function SVGVKernElement() { - SVGElement.apply(this); -}; -SVGVKernElement.prototype = Object._create(SVGElement); - -function SVGFontFaceElement() { - SVGElement.apply(this); - /*boolean(or number)*/ this._isLinked = 0; - this.addEventListener("DOMNodeInserted", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - if (evt.target.localName === "font-face-uri") { //外部リンクがあれば - evt.currentTarget._isLinked = 1; - } - return; //強制終了させる - } - }, false); -}; -SVGFontFaceElement.prototype = Object._create(SVGElement); - -function SVGFontFaceSrcElement() { - SVGElement.apply(this); -}; -SVGFontFaceSrcElement.prototype = Object._create(SVGElement); - -function SVGFontFaceUriElement() { - SVGElement.apply(this); - this.addEventListener("DOMNodeInserted", function(evt){ - if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { - return; //強制終了させる - } - evt.target.ownerDocument.documentElement._svgload_limited--; - evt.target.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:show", "embed"); - }, false); - this.addEventListener("S_Load", function(evt){ - var tar = evt.target, tpp = tar.parentNode.parentNode.parentNode; - if (tpp.localName === "defs") { - tpp = tar.parentNode.parentNode; //tppをfont-face要素としておく - } - tar._instance._isExternal = 1; - tpp.parentNode.appendChild(tar._instance); - evt = tar = tpp = void 0; - }, false); - SVGURIReference.apply(this); -}; -SVGFontFaceUriElement.prototype = Object._create(SVGElement); - -function SVGFontFaceFormatElement() { - SVGElement.apply(this); -}; -SVGFontFaceFormatElement.prototype = Object._create(SVGElement); - -function SVGFontFaceNameElement() { - SVGElement.apply(this); -}; -SVGFontFaceNameElement.prototype = Object._create(SVGElement); - -function SVGDefinitionSrcElement() { - SVGElement.apply(this); -}; -SVGDefinitionSrcElement.prototype = Object._create(SVGElement); - -function SVGMetadataElement() { - SVGElement.apply(this); -}; -SVGMetadataElement.prototype = Object._create(SVGElement); - -function SVGForeignObjectElement() /*: - SVGElement, - SVGTests, - SVGLangSpace, - SVGExternalResourcesRequired, - SVGStylable, - SVGTransformable, - events::EventTarget*/ { - SVGElement.apply(this); - var sl = SVGAnimatedLength; - /*readonly SVGAnimatedLength*/ this.x = new sl(); - /*readonly SVGAnimatedLength*/ this.y = new sl(); - /*readonly SVGAnimatedLength*/ this.width = new sl(); - /*readonly SVGAnimatedLength*/ this.height = new sl(); - sl = void 0; -}; -SVGForeignObjectElement.prototype = Object._create(SVGElement); - -//#endif _SVG_IDL_ -/*SVGの要素マッピング(DOMでは定められていないが、必須) - *本来であれば、SVGDocumentのcreateElementNSメソッドを上書きすることが望ましいが、 - *SIEでは軽量化のために、マッピングを用いた - */ -DOMImplementation["http://www.w3.org/2000/svg"] = { - Document: SVGDocument, - svg: SVGSVGElement, - g: SVGGElement, - path: NAIBU.SVGPathElement, - title: SVGTitleElement, - desc: SVGDescElement, - defs: SVGDefsElement, - linearGradient: SVGLinearGradientElement, - radialGradient: SVGRadialGradientElement, - stop: SVGStopElement, - rect: SVGRectElement, - circle: SVGCircleElement, - ellipse: SVGEllipseElement, - polyline: SVGPolylineElement, - polygon: SVGPolygonElement, - text: SVGTextElement, - tspan: SVGTSpanElement, - image: SVGImageElement, - line: SVGLineElement, - a: SVGAElement, - altGlyphDef: SVGAltGlyphDefElement, - altGlyph: SVGAltGlyphElement, - altGlyphItem: SVGAltGlyphItemElement, - animateColor: SVGAnimateColorElement, - animate: SVGAnimateElement, - animateMotion: SVGAnimateMotionElement, - animateTransform:SVGAnimateTransformElement, - clipPath: SVGClipPathElement, - colorProfile: SVGColorProfileElement, - cursor: SVGCursorElement, - definitionSrc: SVGDefinitionSrcElement, - feBlend: SVGFEBlendElement, - feGaussianBlur: SVGFEGaussianBlurElement, - filter: SVGFilterElement, - font: SVGFontElement, - "font-face": SVGFontFaceElement, - "font-face-format":SVGFontFaceFormatElement, - "font-face-name":SVGFontFaceNameElement, - "font-face-src": SVGFontFaceSrcElement, - "font-face-uri": SVGFontFaceUriElement, - foreignObject: SVGForeignObjectElement, - glyph: SVGGlyphElement, - glyphRef: SVGGlyphRefElement, - hkern: SVGHKernElement, - marker: SVGMarkerElement, - mask: SVGMaskElement, - metadata: SVGMetadataElement, - missingGlyph: SVGMissingGlyphElement, - mpath: SVGMPathElement, - script: SVGScriptElement, - set: SVGSetElement, - style: SVGStyleElement, - "switch": SVGSwitchElement, - "symbol": SVGSymbolElement, - textPath: SVGTextPathElement, - tref: SVGTRefElement, - use: SVGUseElement, - view: SVGViewElement, - vkern: SVGVKernElement, - pattern: SVGPatternElement -}; - -NAIBU._fontSearchURI = function(evt){ - var doc = evt.target.ownerDocument; - var tsrc = doc.getElementsByTagNameNS("http://www.w3.org/2000/svg", "font-face-uri"); - for (var i=0;i -1) { - NAIBU._noie_createFont(ti, font, false); - } - } - } - doc = data = void 0; -}; -NAIBU._noie_createFont = function(/*Element*/ ti, /*Element*/ font, /*boolean*/ isMSIE) { - var style = ti.ownerDocument.defaultView.getComputedStyle(ti, ''), - svgns = "http://www.w3.org/2000/svg", - //isTategakiは縦書きならば真 - isTategaki = ti.getAttributeNS(null, "writing-mode") || ti.parentNode.getAttributeNS(null, "writing-mode"), - horizOrVert = isTategaki ? "vert-adv-y" : "horiz-adv-x", - node = ti.firstChild, data, glyphs = font.getElementsByTagNameNS(svgns, "glyph"), - em = parseFloat(font.getElementsByTagNameNS(svgns, "font-face").item(0).getAttributeNS(null, "units-per-em") || 1000), - advX = parseFloat( (font.getAttributeNS(null, horizOrVert) || em) ), //字幅の設定 - dx = parseFloat(ti.getAttributeNS(null, "x") || 0), - dy = parseFloat(ti.getAttributeNS(null, "y") || 0), - fontSize = parseFloat(style.getPropertyValue("font-size")), - fe = fontSize / em, - ds = false, npdlist = ["fill", - "fill-opacity", - "stroke", - "stroke-width", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-dasharray", - "stroke-opacity", - "opacity", - "cursor"]; - if (glyphs.length > 60) { //fail safe - return; - } - if (/a/[-1] === 'a') { //Firefoxならば - ds = true; - } else if (isMSIE || isTategaki) { - ds = true; - } - if (ds){ - while(node) { - if (!glyphs) { - break; - } - data = node.data; - if (data !== void 0) { //dataがある場合 - var advanceX = [], glyphData = []; - for (var i=0,gli=glyphs.length;i -1) { - advanceX[index] = parseFloat(glyph.getAttributeNS(null, horizOrVert) || advX); //字幅を収納 - glyphData[index] = glyph.getAttributeNS(null, "d"); - index = data.indexOf(unicode, index+1); - } - } - } - for (var i=0,adv=0;i -1) { //句読点の場合 - var fms = fontSize / Math.SQRT2; - x += fms; - y -= fms; - fms = void 0; - } - matrix.e = x; - matrix.f = y; - } else { - matrix.e = dx + adv*fe; - matrix.f = dy; - } - path.setAttributeNS(null, "transform", "matrix(" +matrix.a+ "," +matrix.b+ "," +matrix.c+ "," +matrix.d+ "," +matrix.e+ "," +matrix.f+ ")"); - path.setAttributeNS(null, "d", glyphData[i]); - ti.parentNode.insertBefore(path, ti); - adv += advanceX[i]; - matrix = void 0; - } - } - adv = advanceX = glyphData = void 0; - } else if ("tspan|a".indexOf(node.localName) > -1){ - NAIBU._noie_createFont(node, font, isMSIE); - } - node = node.nextSibling; - } - if (isMSIE) { - var style = ti.ownerDocument.getOverrideStyle(ti, null); - style.setProperty("visibility", "hidden"); - style = void 0; - } else { - ti.setAttributeNS(null, "opacity", "0"); - } - } - data = isTategaki = horizOrVert = em = advX = dx = dy = fontSize = style = svgns = node = void 0; -}; - -/*以下は、getComputedStyleメソッドで使うために、CSS2Propertiesの_listプロパティに、 - *CSSprimitiveValueのリストを収納している。なお、その際に、writingModeなどはwriting-modeに変更している - */ -(function(){ - var s = new CSSStyleDeclaration(), - slis = s._list, - n = 0, - regAZ = /([A-Z])/, - regm = /\-/, - u, t; - for (var i in CSS2Properties) { - if(CSS2Properties.hasOwnProperty(i)) { - t = i.replace(regAZ, "-"); - if (!!RegExp.$1) { - u = "-" +RegExp.$1.toLowerCase(); - } else { - u = "-"; - } - t = t.replace(regm, u); - s.setProperty(t, CSS2Properties[i]); - slis[t] = slis[n]; //この処理はCSSモジュールのgetComputedStyleメソッドのため - slis[n]._isDefault = 1; - ++n; - i = t = u = void 0; - } - } - slis._opacity = 1; - slis._fontSize = 12; - CSS2Properties._list = slis; - Document.prototype.defaultView._defaultCSS = slis; - s = n = regAZ = regm = slis =null; -})(); - -NAIBU.addEvent = function(evt,lis){ - if (window.addEventListener) { - window.addEventListener(evt, lis, false); - } else if (window.attachEvent) { - window.attachEvent('on'+evt, lis); - } else { - window['on'+evt] = lis; - } - //Sieb用 - if (sieb_s) { - lis(); - } -}; - -function unsvgtovml() { - try { - if ("stop" in NAIBU) { - clearInterval(NAIBU.stop); - } - window.onscroll = NAIBU.emptyFunction; - window.detachEvent("onload", NAIBU._main); - NAIBU.freeArg(); - delete Object._create; - Document._destroy(); - Element = SVGElement = Attr = NamedNodeMap = CSS2Properties = CSSValue = CSSPrimitiveValue = NAIBU.xmlhttp = Node = Event = NAIBU = STLog = SVGColor = SVGPaint = void 0; - Array = ActiveXObject = void 0; - } catch(e) {} -} -/*_main関数 - *一番最初に起動するべき関数 - */ -NAIBU._main = function() { - var xmlhttp, //XMLHttpオブジェクトを生成 - _doc = document; //documentのエイリアスを作成 - try { - if (XMLHttpRequest) { - xmlhttp = false; - } else { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - if (!xmlhttp) { - try { - xmlhttp = new XMLHttpRequest(); - } catch (e) { - xmlhttp = false; - } - } - NAIBU.xmlhttp = xmlhttp; - var nd; - if (("namespaces" in _doc) && !_doc.namespaces["v"]) { - try { - NAIBU.doc = new ActiveXObject("MSXML2.DomDocument"); - } catch (e) { - - } - nd = NAIBU.doc; - _doc.namespaces.add("v","urn:schemas-microsoft-com:vml"); - _doc.namespaces.add("o","urn:schemas-microsoft-com:office:office"); - var st = _doc.createStyleSheet(), - vmlUrl = "behavior: url(#default#VML);display: inline-block;} "; //inline-blockはIEのバグ対策 - st.cssText = "v\\:rect{" +vmlUrl+ "v\\:image{" +vmlUrl+ "v\\:fill{" +vmlUrl+ "v\\:stroke{" +vmlUrl+ "o\\:opacity2{" +vmlUrl - + "dn\\:defs{display:none}" - + "v\\:group{text-indent:0px;position:relative;width:100%;height:100%;" +vmlUrl - + "v\\:shape{width:100%;height:100%;" +vmlUrl; - } - var ary = _doc.getElementsByTagName("script"); - //全script要素をチェックして、type属性がimage/svg+xmlならば、中身をSVGとして処理する - for (var i=0; ary[i]; ++i) { - var ai = ary[i], - hoge = ai.type; - if (ai.type === "image/svg+xml") { - var ait = ai.text; - if (sieb_s && ait.match(/<svg/)) { - //ソース内のタグを除去 - ait = ait.replace(/<.+?>/g, ""); - //エンティティを文字に戻す - ait = ait.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/&/g, "&"); - } - if (NAIBU.isMSIE) { - var gsd = new GetSVGDocument(ai); - gsd.xmlhttp = { - readyState : 4, - status : 200, - responseText : ait.replace(/\shref=/g, " target='_top' xlink:href=") - }; - gsd._ca(); - } else { - var base = location.href.replace(/\/[^\/]+?$/,"/"); //URIの最後尾にあるファイル名は消す。例: /n/sie.js -> /n/ - ait = ait.replace(/\shref=(['"a-z]+?):\/\//g, " target='_top' xlink:href=$1://").replace(/\shref=(.)/g, " target='_top' xlink:href=$1"+base); - var s = NAIBU.textToSVG(ait,ai.getAttribute("width"),ai.getAttribute("height")); - ai.parentNode.insertBefore(s,ai); - } - ai = ait = void 0; - } - hoge = void 0; - } - NAIBU.doc = nd; - nd = ary = void 0; - if (xmlhttp && NAIBU.isMSIE) { - if (!!_doc.createElementNS && !!_doc.createElementNS( "http://www.w3.org/2000/svg", "svg").createSVGRect) { //IE9ならば - } else { //IE6-8ならば - var ob = _doc.getElementsByTagName("object"), - s=[], - t = [], - _search = function(_ob) { - var ifr, obi, n, - w = "width", - h = "height"; - s || (s = []); //NAIBU._searchで呼ばれたときに必要 - _doc || (_doc = document); - for (var i=0;_ob[i];++i) { - obi = _ob[i]; - s[s.length] = new GetSVGDocument(obi); - ifr = _doc.createElement("iframe"); - ifr.style.cssText = obi.style.cssText; - ifr.style.background = "black"; - n = obi.getAttribute(w); - n && ifr.setAttribute(w, n); - n = obi.getAttribute(h); - n && ifr.setAttribute(h, n); - ifr.marginWidth = ifr.marginHeight = "0px"; //このマージン設定がないと、全体がずれてしまう - ifr.scrolling = "no"; - ifr.frameBorder = "0"; - /*iframe要素を使って、描画のプロセスを分離する - *したがって、_docはdocumentとは別のオブジェクトとなる - */ - obi.parentNode.insertBefore(ifr, obi); - } - i = obi = ifr = _ob = w = h = void 0; - return s[s.length-1]; - }; - _search(ob); - var img = _doc.getElementsByTagName("img"), - em = _doc.getElementsByTagName("embed"); - for (var i=0,j=0;img[i];++i) { - /*img要素の処理*/ - if (img[i].getAttribute("src").indexOf(".svg") > -1) { //拡張子があればSVG画像と判断 - t[j] = img[i]; - ++j; - } - } - _search(t); - _search(em); - NAIBU._search = _search; //a要素がクリックされたときに使う関数 - ob = em = t = img = _search = void 0; - for (var i=0;i 0) { - s[0]._init(); //初期化作業を開始 - } - s = void 0; - } - } else { - var ob = _doc.getElementsByTagName("object"); - for (var i=0;i -1 || navigator.userAgent.indexOf('Safari') > -1) { //WebKit系ならば - var data = 'data:image/svg+xml;charset=utf-8,' + NAIBU.unescapeUTF16(escape(source)); - var ob = document.createElement("object"); - ob.setAttribute("data",data); - ob.setAttribute("width",w); - ob.setAttribute("height",h); - ob.setAttribute("type","image/svg+xml"); - return ob; - } else { - var doc = (new DOMParser()).parseFromString(source, "text/xml"); - return (document.importNode(doc.documentElement, true)); - } -}; -NAIBU.addEvent("unload", unsvgtovml); -//IEならばtrue +/*SIE-SVG without Plugin under LGPL2.1 & GPL2.0 & Mozilla Public Lisence + *http://sie.sourceforge.jp/ + *Usage: + */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Mozilla SVG Cairo Renderer project. + * + * The Initial Developer of the Original Code is IBM Corporation. + * Portions created by the Initial Developer are Copyright (C) 2004 + * the Initial Developer. All Rights Reserved. + * + * Parts of this file contain code derived from the following files(s) + * of the Mozilla SVG project (these parts are Copyright (C) by their + * respective copyright-holders): + * layout/svg/renderer/src/libart/nsSVGLibartBPathBuilder.cpp + * + * Contributor(s):DHRNAME revulo bellbind + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ +/*Function Object.create + *関数Object.createはオブジェクトを新規に作り出すときに使う。 + *SIEでスーパークラスに引数が指定されているときの対策として使う。 + *example: function SuperClass (ng) {ng.e();}; + *function SubClass () {}; + *SubClass.prototype = new SuperClass(); // Error + *SubClass.prototype = Object.create(SuperClass) // OK*/ +if (!Object._create) { + Object._create = function (/*Function*/ cl) { + var s = function () {}; + s.prototype = cl.prototype; + cl = void 0; + return new s; + }; +} +// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/dom.idl +/*W3CのDOMのIDLを参照にコードを起こしている + *変数やプロパティ、メソッドの名前の頭に、「_」がついているときはSIE独自のもの + */ +/* +#ifndef _DOM_IDL_ +#define _DOM_IDL_ + +#pragma prefix "w3c.org" +module dom +{ + + valuetype DOMString sequence; + + typedef unsigned long long DOMTimeStamp; + + interface DocumentType; + interface Document; + interface NodeList; + interface NamedNodeMap; + interface Element; +*/ +function DOMException(n){ + Error.apply(this, arguments); + this.code = n; + var s = [ + "", //数合わせのため + "Index Size Error", + "DOMString Size Error", + "Hierarchy Request Error", + "Wrong Document Error", + "Invalid Character Error", + "No Data Allowed Error", + "No Modification Allowed Error", + "Not Found Error", + "Not Supported Error", + "Inuse Attribute Error", + "Invalid State Error", + "Syntax Error", + "Invalid Modification Error", + "Namespace Error", + "Invalid Access Error" + ]; + this.message = s[n]; +/*DOMSTRING_SIZE_ERR +テキストの指定された範囲がDOMStringに合致しない。 2 +HIERARCHY_REQUEST_ERR +コードが属さない場所に挿入されている。 3 +INDEX_SIZE_ERR +インデクス若しくは大きさが負数,又は許された値よりも大きい。 1 +INUSE_ATTRIBUTE_ERR +他で既に使用されている属性を追加しようとしている。 10 +INVALID_ACCESS_ERR,DOM水準2で導入 +パラメタ又は操作が基礎になるオブジェクトによってサポートされていない。 15 +INVALID_CHARACTER_ERR +名前の中などで,妥当でない又は不正な文字が指定されている。文法に合った文字の定義についてはXML規定の 生成規則2 を,文法に合った名前文字については 生成規則5 を参照すること。5 +INVALID_MODIFICATION_ERR,DOM水準2で導入 +基礎となるオブジェクトの型を修正しようとしている。 13 +INVALID_STATE_ERR,DOM水準2で導入 +利用不可能又はもはや利用可能ではないオブジェクトを使用しようとしている。 11 +NAMESPACE_ERR,DOM水準2で導入 +名前空間に関して正しくない方法でオブジェクトを生成又は変更しようとしている。 14 +NOT_FOUND_ERR +ノードが存在しない文脈でそのノードを参照しようとしている。 8 +NOT_SUPPORTED_ERR +実装は,オブジェクト又は操作の要求された型をサポートしていない。9 +NO_DATA_ALLOWED_ERR +データをサポートしないノードに対してデータを指定している。 6 +NO_MODIFICATION_ALLOWED_ERR +修正が許されない場所でオブジェクトを修正しようとしている。 7 +SYNTAX_ERR,DOM水準2で導入 +妥当ではない又は不正な文字列が指定されている。 12 +WRONG_DOCUMENT_ERR +ノードを生成した文書以外の(そのノードをサポートしない)異なる文書で,ノードが使用されている。4 +*/ +}; +(function(t) { +/*マジックナンバーは軽量化のため原則コメントで記述するのみ +t.INDEX_SIZE_ERR = 1; +t.DOMSTRING_SIZE_ERR = 2; +t.HIERARCHY_REQUEST_ERR = 3; +t.WRONG_DOCUMENT_ERR = 4; +t.INVALID_CHARACTER_ERR = 5; +t.NO_DATA_ALLOWED_ERR = 6; +t.NO_MODIFICATION_ALLOWED_ERR = 7; +t.NOT_FOUND_ERR = 8; +t.NOT_SUPPORTED_ERR = 9; +t.INUSE_ATTRIBUTE_ERR = 10; +t.INVALID_STATE_ERR = 11; +t.SYNTAX_ERR = 12; +t.INVALID_MODIFICATION_ERR = 13; +t.NAMESPACE_ERR = 14; +t.INVALID_ACCESS_ERR = 15;*/ +t.prototype = new Error(); +})(DOMException); + +/*DOMImplementation + *DOMの基本的な機能をつかさどる + */ +DOMImplementation = { + /* hasFeature + *文字列によって、機能をサポートしているかどうかをチェックする。削除不可。 + */ + /*boolean*/ hasFeature : function(/*string*/ feature, version) { + switch (feature) { + case "CORE" : + case "XML" : + case "Events" : //DOM level2 Eventを参照 + case "StyleSheets" : //DOM level2 StyleSheetを参照 + case "org.w3c.svg.static" : //SVG1.1の仕様を参照 + case "org.w3c.dom.svg.static" : + return true; + default : + if (version === "2.0") { //DOM level2 Coreにおいて策定されたバージョン情報 + return true; + } else { + return false; + } + } + }, + + /* createDocumentType + *ドキュメントタイプを作るためのもの。削除可。 + */ + /*DocumentType*/ createDocumentType : function(/*string*/ qualifiedName, publicId, systemId) { + var s = new Node(); + s.publicId = publicId; + s.systemId = systemId; + return s; + }, + /* createDocument + * ドキュメントオブジェクトを作るためのもの。削除不可。 + */ + /*Document*/ createDocument : function( /*string*/ ns, qname, /*DocumentType*/ doctype) { + try { + var s; + if (ns && DOMImplementation[ns] && DOMImplementation[ns].Document) { + s = new (DOMImplementation[ns].Document); + this._doc_ && (s._document_ = this._doc_); //_document_プロパティはcreateElementNSメソッドやradialGradient要素やNAIBU._setPaintなどで使う + } else { + s = new Document(); + } + s.implementation = this; + s.doctype = doctype || null; + s.documentElement = s.createElementNS(ns,qname); //ルート要素を作る + return s; + } catch(e){} + }, + "http://www.w3.org/2000/xmlns": {} +}; + +/* Node + *ノード(節)はすべての雛形となる重要なものである。削除不可。 + */ + +function Node(){ + this.childNodes = []; + this._capter = []; //eventで利用 +} +/*軽量化のためにマジックナンバーはコメントで代替 + *(function(t) { +// NodeType +/*const unsigned short t.ELEMENT_NODE = 1; +/*const unsigned short t.ATTRIBUTE_NODE = 2; +/*const unsigned short t.TEXT_NODE = 3; +/*const unsigned short t.CDATA_SECTION_NODE = 4; +/*const unsigned short t.ENTITY_REFERENCE_NODE = 5; +/*const unsigned short t.ENTITY_NODE = 6; +/*const unsigned short t.PROCESSING_INSTRUCTION_NODE = 7; +/*const unsigned short t.COMMENT_NODE = 8; +/*const unsigned short t.DOCUMENT_NODE = 9; +/*const unsigned short t.DOCUMENT_TYPE_NODE = 10; +/*const unsigned short t.DOCUMENT_FRAGMENT_NODE = 11; +/*const unsigned short t.NOTATION_NODE = 12; +})(Node);*/ +Node.prototype = { + //以下は初期値として設定 + tar : null, + firstChild : null, + previousSibling : null, + nextSibling : null, + attributes : null, + namespaceURI : null, + localName : null, + lastChild : null, + prefix : null, + ownerDocument : null, + parentNode : null, +/*replaceChildメソッド + *指定したoldChildノードの代わりに、新たなnewChildノードを入れる。切り替え機能。 + */ +/*Node*/ replaceChild : function( /*Node*/ newChild, oldChild) { + this.insertBefore(newChild, oldChild); + var s = this.removeChild(oldChild); + return s; +}, +/*appendChildメソッド + *eleノードをリストの最後尾に追加する + */ +/*Node*/ appendChild : function( /*Node*/ ele) { + this.insertBefore(ele,null); + return ele; +}, +/*hasChildNodesメソッド + *子ノードがあるかどうか + */ +/*boolean*/ hasChildNodes : function() { + if (this.childNodes.length > 0) { + return true; + } else { + return false; + } +}, +/*cloneNodeメソッド + *ノードのコピーを作る。引数は、子ノードのコピーも作るかどうか。コピー機能。 + */ +/*Node*/ cloneNode : function( /*boolean*/ deep) { + var s; + if (this.hasOwnProperty("ownerDocument")) { + s = this.ownerDocument.importNode(this, deep); + } else { + s = new Node(); + } + return s; +}, +/*normalizeメソッド + *二つ以上の重複したテキストノードを一つにまとめる + */ +/*void*/ normalize : function() { + var tcn = this.childNodes; + try { + for (var i=tcn.length-1;i<0;--i) { + var tcni = tcn[i], tcnip = tcni.nextSibling; + if (tcnip) { + if (tcni.nodeType === /*Node.TEXT_NODE*/ 3 && tcnip.nodeType === /*Node.TEXT_NODE*/ 3) { + tcni.appendData(tcnip.data); //次ノードの文字列データを、現ノード文字列の後に付け加える + tcni.legnth = tcni.data.length; + this.removeChild(tcnip); //次ノードを排除 + } else { + tcni.normalize(); + } + } else { + tcni.normalize(); + } + } + } catch(e){}; +}, +/*isSupportedメソッド + *どんな機能をサポートしているかどうかをチェック + */ +/*boolean*/ isSupported : function( /*string*/ feature, version) { + return (this.ownerDocument.implementation.hasFeature(feature+"", version+"")); +}, +/*hasAttributesメソッド + *ノードが属性を持っているかどうか + */ +/*boolean*/ hasAttributes : function() { + if (this.attributes.length > 0) { + return true; + } else { + return false; + } +} +}; + + +Array.prototype.item = function( /*long*/ index) { + if (!this[index]) { + return null; + } + return (this[index]); +}; +/*ノードリストはArrayで代用。 + interface NodeList { + Node item(in unsigned long index); + readonly attribute unsigned long length; + }; +*/ + +/*NamedNodeMap + *ノードの集合。ノードリストと違って、順序が決まっていない。削除不可 + */ +function NamedNodeMap() { +} +/*_copyNode + *cloneNodeを行う際に、用いる。削除不可 + */ +Array.prototype._copyNode = function __nnmp_c( /*NamedNodeMap*/ children, /*boolean*/ deep) { + for (var i=0,cli=children.length;i this.length) { //値が負か、データの長さよりoffsetが長いとき、サイズエラーを起こす + throw (new DOMException(/*INDEX_SIZE_ERR*/ 1)); + } + if (offset + count > this.length) { //offsetとcountの和が文字全体の長さを超える場合、offsetから最後までのを取り出す + count = this.length - offset; + } + var s = this.data.substr(offset, count); + return s; + }; + /*void*/ cproto.replaceData = function( /*long*/ offset, /*long*/ count, /*string*/ arg) { + if (offset < 0 || count < 0 || offset > this.length) { //値が負か、データの長さよりoffsetが長いとき、サイズエラーを起こす + throw (new DOMException(/*INDEX_SIZE_ERR*/ 1)); + } + this.deleteData(offset, count); + this.insertData(offset, arg); + }; + cproto = void 0; +})(CharacterData.prototype); + +/*Attr + *属性ノード。削除不可。 + */ +function Attr() { +}; +Attr.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 +(function(aproto){ + aproto.nodeType = /*Node.ATTRIBUTE_NODE*/ 2; + aproto.nodeValue = null; + aproto.childNodes = []; + aproto._capter = []; //eventで利用 + aproto = void 0; +})(Attr.prototype); + +/*Element + *要素ノード。削除不可。 + */ +function Element() { + Node.apply(this); + this.attributes = new NamedNodeMap(); //属性を収納 +}; +Element.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 +(function(eproto){ + eproto.nodeType = /*Node.ELEMENT_NODE*/ 1; + eproto.nodeValue = null; + /* + *名前空間に対応していないメソッドは、軽量化のため、機能させないようにする。代わりに、**NSメソッドを利用すること + *(getAttributeとsetAttributeは普及しているので機能させる + */ + /*string*/ eproto.getAttribute = function( /*string*/ name) { + return (this.getAttributeNS(null, name)); + }; + /*void*/ eproto.setAttribute = function( /*string*/ name, /*string*/ value) { + this.setAttributeNS(null, name, value); + }; + /*void*/ eproto.removeAttribute = function( /*string*/ name) { + this.removeAttributeNS(null, name); + }; + /*Attr*/ eproto.getAttributeNode = function( /*string*/ name) { + }; + /*Attr*/ eproto.setAttributeNode = function( /*Attr*/ newAttr) { + }; + /*Attr*/ eproto.removeAttributeNode = function( /*Attr*/ oldAttr) { + var s = this.attributes.removeNamedItemNS(oldAttr.namespaceURI, oldAttr.localName); //attributesから該当するノードを排除 + return s; + }; + /*NodeList(Array)*/ eproto.getElementsByTagName = function( /*string*/ name) { + }; + /*string*/ eproto.getAttributeNS = function( /*string*/ namespaceURI, /*string*/ localName) { + var n = this.getAttributeNodeNS(namespaceURI, localName); //属性ノードを取得する + if (!n) { + return null; + } else { + return (n.nodeValue); + } + }; + /*void*/ eproto.setAttributeNS = function( /*string*/ namespaceURI, /*string*/ qualifiedName, /*string*/ value) { + var atn = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName); + /*元来、string型以外の型を許容すべきではないが、他のブラウザ(FirefoxやOpera)でエラーが出ないため許容する*/ + atn.nodeValue = value+""; + atn.value = value+""; + this.setAttributeNodeNS(atn); + }; + /*void*/ eproto.removeAttributeNS = function( /*string*/ namespaceURI, /*string*/ localName) { + }; + /*Attr*/ eproto.getAttributeNodeNS = function( /*string*/ namespaceURI, /*string*/ localName) { + var s = this.attributes.getNamedItemNS(namespaceURI,localName); + return s; + }; + /*NodeList(Array)*/ eproto.getElementsByTagNameNS = function( /*string*/ namespaceURI, /*string*/ localName) { + var s = [], n = 0; + var tno = this.childNodes; + for (var i=0,tcli = tno.length;iで表現される。削除不可。 + */ +function Comment() { +}; +Comment.prototype = Object._create(CharacterData); //文字データのプロトタイプチェーンを作って、継承 +Comment.prototype.nodeType = /*Node.COMMENT_NODE*/ 8; +Comment.prototype.nodeName = "#comment"; +/*CDATASection + *CDATA領域を示すノード。で表現される。削除不可。 + */ +function CDATASection() { + this.nodeType = /*Node.CDATA_SECTION_NODE*/ 4; + this.nodeName = "#cdata-section"; +}; +CDATASection.prototype = Object._create(Text); //テキストノードのプロトタイプチェーンを作って、継承 + +/*DocumentType + *DTD(文書型定義)の情報を取り扱うノード。DTDはで表現されうる。削除可 + */ +function DocumentType() { + Node.apply(this); + //以下のメンバは削除可 + this.name = ""; + this.entities = new NamedNodeMap(); //パラメタ実体を除く実体の集まり + this.notations = new NamedNodeMap(); //DTDで示した記法の集まり + this.publicId = ""; //外部サブセットの公開識別子 + this.systemId = ""; //上同のシステム識別子 + this.internalSubset = ""; //内部サブセットの内容(文字列) + this.nodeValue = null; + this.nodeType = /*Node.DOCUMENT_TYPE_NODE*/ 10; +}; +DocumentType.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 + +/*Notation + *DTDの記法の情報を取り扱うノード。か、処理命令で記法は表現されうる。削除可 + */ +function Notation() { + Node.apply(this); + this.publicId = this.systemId = this.nodeValue = null; + this.nodeType = /*Node.NOTATION_NODE*/ 12; +}; +Notation.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 + +/*注意 + *以下のノードは、もし、DOMを展開する前に、XMLプロセッサが実体参照の読み込みを行うのであれば、文書中に挿入される必要はない。 + */ +/*Entity + *解析対象(外)実体ノード。削除可 + */ +function Entity() { + Node.apply(this); + this.publicId = this.systemId = this.notationName = null; //解析対象外実体のための記法名。解析対象実体ではnull + this.nodeValue = null; + this.nodeType = /*Node.ENTITY_NODE*/ 6; +}; +Entity.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 + +/*EntityReference + *実態参照の代わりに挿入されるノード。削除可 + */ +function EntityReference() { + Node.apply(this); + this.nodeValue = null; + this.nodeType = /*Node.ENTITY_REFERENCE_NODE*/ 5; +}; +EntityReference.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 + +/*ProcessingInstruction + *処理命令ノード。スタイルシート処理命令で使うので、削除不可 + */ +function ProcessingInstruction() { + Node.apply(this); + this.nodeType = /*Node.PROCESSING_INSTRUCTION_NODE*/ 7; +}; +ProcessingInstruction.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 + +/*DocumentFragment + *複数のノードを移したりするのに便宜上、用いられる文書ノード。削除可 + */ +function DocumentFragment() { + this.nodeName = "#document-fragment"; + this.nodeValue = null; + this.nodeType = /*Node.DOCUMENT_FRAGMENT_NODE*/ 11; +}; +DocumentFragment.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 + +/*Document + *文書ノード。 + */ +function Document() { + Node.apply(this); + this.nodeName = "#document"; + this.nodeValue = null; + this.nodeType = /*Node.DOCUMENT_NODE*/ 9; + this._id = {}; //getElementByIdで使う +}; +Document.prototype = Object._create(Node); //ノードのプロトタイプチェーンを作って、継承 +(function(dproto, Text, Element, Attr, Comment) { + /* + *名前空間に対応していないメソッドは、軽量化のため、機能させないようにする。代わりに、**NSメソッドを利用すること。 + *また、createメソッドは工場メソッドである。クラス名をユーザから隠蔽するのに役に立つ。 + *突然、クラス名が変更されても、ライブラリを利用したユーザは、コードを書き換える必要がないなどのメリットがある。 + */ + /*Element*/ dproto.createElement = function( /*string*/ tagName) { + }; + /*createDocumentFragmentメソッド + *切り貼り用のドキュメントを作る。削除可 + */ + /*DocumentFragment*/ dproto.createDocumentFragment = function() { + var s = new DocumentFragment(); + s.ownerDocument = this; + return s; + }; + /*createTextNodeメソッド + *テキストのノードを作る + */ + /*Text*/ dproto.createTextNode = function( /*string*/ data) { + var s = new Text(); + s.data = s.nodeValue = data+""; + s.length = data.length; + s.ownerDocument = this; + return s; + }; + /*createCommentメソッド + *コメントノードを作る + */ + /*Comment*/ dproto.createComment = function( /*string*/ data) { + var s = new Comment(); + s.data = s.nodeValue = data; + s.length = data.length; + s.ownerDocument = this; + return s; + }; + /*createCDATASectionメソッド + *CDATA領域ノードを作る + */ + /*CDATASection*/ dproto.createCDATASection = function( /*string*/ data) { + var s = new CDATASection(); + s.data = s.nodeValue = data; + s.length = data.length; + s.ownerDocument = this; + return s; + }; + /*createProcessingInstructionメソッド + *処理命令ノードを作る + */ + /*ProcessingInstruction*/ dproto.createProcessingInstruction = function( /*string*/ target, /*string*/ data) { + var s = new ProcessingInstruction(); + s.target = s.nodeName = target; + s.data = s.nodeValue = data; + s.ownerDocument = this; + return s; + }; + /*createAttribute + *createAttributeNSを推奨 + */ + /*Attr*/ dproto.createAttribute = function( /*string*/ name) { + }; + /*createEntityReferenceメソッド + *実体参照ノードを作る + */ + /*EntityReference*/ dproto.createEntityReference = function( /*string*/ name) { + var s = new EntityReference(); + s.nodeName = name; + s.ownerDocument = this; + return s; + }; + /*getElementsByTagNameメソッド + *getElementsByTagNameNSを推奨 + */ + /*NodeList*/ dproto.getElementsByTagName = function( /*string*/ tagname) { + return this.getElementsByTagNameNS("*", tagname); + }; + /*importNodeメソッド + *自身のドキュメントノードに、他のドキュメントノードから作られたノードを取り込みたいときに用いる + */ + /*Node*/ dproto.importNode = function( /*Node*/ importedNode, /*boolean*/ deep) { + var s, + imn = importedNode.nodeType, + attr, att, fi, n, uri, ch; + /*以下の処理は引き渡されたimportedNodeがMSXMLによって解析された + *データであることを前提にしている + */ + if (imn === /*Node.ATTRIBUTE_NODE*/ 2) { + uri = importedNode.namespaceURI; + uri = (uri === "") ? null : uri; //空文字列はnullとして扱うようにする(MSXMLが空文字列を返す時の対策) + s = this.createAttributeNS(uri, importedNode.nodeName); + s.nodeValue = importedNode.nodeValue; + } else if (imn === /*Node.TEXT_NODE*/ 3) { + s = this.createTextNode(importedNode.data); + } else if (imn === /*Node.ELEMENT_NODE*/ 1) { + s = this.createElementNS(importedNode.namespaceURI, importedNode.nodeName); + attr = importedNode.attributes; + for (var i=0;attr[i];++i) { //NamedNodeMapを検索する + ch = attr[i]; + uri = ch.namespaceURI; + uri = (uri === "") ? null : uri; //空文字列はnullとして扱うようにする(MSXMLが空文字列を返す時の対策) + att = this.createAttributeNS(uri, ch.nodeName); + att.nodeValue = ch.nodeValue; + s.setAttributeNodeNS(att); + } + if (deep) { + fi = importedNode.firstChild; + while (fi) { //子ノードを検索して、子供がいれば、importNodeメソッドを再帰的に実行する + n = this.importNode(fi, true); + s.appendChild(n); + fi = fi.nextSibling; + } + } + i = void 0; + } else if (imn === /*Node.COMMENT_NODE*/ 8) { + s = this.createComment(importedNode.data); + } else if (imn === /*Node.DOCUMENT_FRAGMENT_NODE*/ 11) { + s = this.createDocumentFragment(); + if (deep) { + ch = importedNode.childNodes; + for (var i=0,chli=ch.length;i 1000) { + /*1秒を超えたらバッファにため込んで後で使う*/ + tob = td.implementation._buffer_ || []; + toli = tob.length; + tob[toli] = this; + tob[toli+1] = evt; + td.implementation._buffer_ = tob; + te = td = etime = etype = ebub = tob = toli = type = void 0; + return true; + } + } + evt.target = te; + evt.eventPhase = 1;//Event.CAPTURING_PHASE + //このノードからドキュメントノードにいたるまでの、DOMツリーのリストを作成しておく + td[ebptype] = null; + /*以下の処理では、documentElementのparentNodeが + *Documentノードではなく、nullになっていることを前提としている。 + *したがって、documentElementのparentNodeがもし、Documentノードのオブジェクトならば、以下を書き換えるべきである + */ + while (te.parentNode) { + te.parentNode[ecptype] = te; + te[ebptype] = te.parentNode; + te = te.parentNode; + } + td[ecptype] = te; + te[ebptype] = td; + /*最初に捕獲フェーズでDOMツリーを下っていき、イベントのターゲットについたら、 + *そこで、浮上フェーズとして折り返すように、反復処理をおこなう。 + */ + te = this; + while (td) { + evt.currentTarget = td; + if (td === te) { //イベントのターゲットに到着(折り返し地点) + type = 2;//Event.AT_TARGET; + } + evt.eventPhase = type; + tce = td._capter; //tceは登録しておいたリスナーのリスト + for (var j=0,tcli=tce.length;j this.length) { //offsetとcountの和が文字全体の長さを超える場合、offsetから最後までのを削除 + next = ""; + } + this.data = pre + next; + this.length = this.data.length; + /*ここから*/ + evt = this.ownerDocument.createEvent("MutationEvents"); + evt.initMutationEvent("DOMCharacterDataModified", true, false, null, pd, this.data, null, null); + this.parentNode.dispatchEvent(evt); + evt = pd = void 0; + /*ここまで追加*/ +}; + +/*_ceventプロパティはcreateEventメソッドで軽量化のために使う。*/ +Document.prototype._cevent = { + "MutationEvents" : MutationEvent, + "MouseEvents" : MouseEvent, + "UIEvents" : UIEvent +}; + + +// _EVENTS_IDL_ + +/* +// File: http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/stylesheets.idl + +#ifndef _STYLESHEETS_IDL_ +#define _STYLESHEETS_IDL_ + +#include "dom.idl" + +#pragma prefix "dom.w3c.org" +module stylesheets +{ + + typedef dom::DOMString DOMString; + typedef dom::Node Node; +*/ + +/*StyleSheet + *スタイルシート文書を示す。削除不可。 + */ +function StyleSheet() { + this.type = "text/css"; + this.disabled = false; + /*Node*/ this.ownerNode = null; + /*StyleSheet*/ this.parentStyleSheet = null; + this.href = null; + this.title = ""; + /*MediaList*/ this.media = new MediaList(); +}; + +/*StyleSheetList + *このインターフェースはArrayで代用する +function StyleSheetList() { + readonly attribute unsigned long length; + StyleSheet item(in unsigned long index); + }; +*/ + +function MediaList() { + this.mediaText = ""; + this.length = 0; +}; +MediaList.prototype = { +/*string*/ item : function(/*long*/ index) { + return (this[index]); + }, +/*void*/ deleteMedium : function(/*string*/ oldMedium) { + for (var i=0,tli=this.length;i -1) { //プロパティ名に合致するCSSValueオブジェクトが見つかった場合 + ti._empercents = tl._fontSize; + i = tl = tli = tc = prop = propertyName = void 0; + return ti; + } + } + i = tl = tli = prop = propertyName = void 0; + return null; + }, + /*removePropertyメソッド + *プロパティを宣言内から除去 + */ +/*string*/ removeProperty : function( /*string*/ propertyName) { + var tg = this.getPropertyCSSValue(propertyName); + if (tg) { //見つかった場合 + this._list.splice(tg._num,1); //Arrayのspliceを利用して、リストからCSSValueオブジェクトを排除 + --this.length; + } + }, + /*getPropertyPriorityメソッド + *importantなどのpriorityを取得する + */ +/*string*/ getPropertyPriority : function( /*string*/ propertyName) { + var tg = this.getPropertyCSSValue(propertyName); + if (tg) { //見つかった場合 + return (tg._priority); + } else { + return ""; + } + }, + _isFillStroke : { + "fill" : 1, + "stroke" : 1 + }, + _isColor : { + "color" : 1 + }, + _isStop : { + "stop-color" : 1 + }, + _isRS : { + "r" : 1, + "#" : 1 + }, + /*setPropertyメソッド + *プロパティを宣言内で、明示的に設定。継承は無視する + */ +/*void*/ setProperty : function( /*string*/ propertyName, /*string*/ value, /*string*/ priority) { + var cssText = propertyName, + tg = null, + ti, paintType, v1, + uri = null, + color = null, + fill, stroke, stop; + if (!!this[propertyName]) { + tg = this.getPropertyCSSValue(propertyName); + } + cssText += ":"; + cssText += value; + if (this._isFillStroke[propertyName]) { + /*fill、strokeプロパティは別途、SVGPaintで処理(JavaScriptでは、型キャストを使えないため) + *CSSPrimitiveValueオブジェクトとSVGPaintオブジェクトを最後に置き換える + */ + if (tg) { //見つかった場合 + ti = tg; + } else { + ti = new SVGPaint(); + } + paintType = /*SVGPaint.SVG_PAINTTYPE_UNKNOWN*/ 0; + v1 = value.charAt(0); + if (this._isRS[v1] || ti._keywords[value]) { + paintType = /*SVGPaint.SVG_PAINTTYPE_RGBCOLOR*/ 1; + color = value; + } else if (value === "none") { + paintType = /*SVGPaint.SVG_PAINTTYPE_NONE*/ 101; + } else if (this._urlreg.test(value)) { //fill属性の値がurl(#id)ならば + paintType = /*SVGPaint.SVG_PAINTTYPE_URI*/ 107; + uri = RegExp.$1; + } else if (value === "currentColor") { + paintType = /*SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR*/ 102; + } + ti.setPaint(paintType, uri, color, null); + paintType = v1 = uri = color = void 0; + } else if (this._isStop[propertyName]) { + if (tg) { //見つかった場合 + ti = tg; + } else { + ti = new SVGColor(); + } + if (value === "currentColor") { + ti.colorType = /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3; + } else { + ti.colorType = /*SVGColor.SVG_COLORTYPE_RGBCOLOR*/ 1; + } + ti.setRGBColor(value); + } else { + if (tg) { //見つかった場合 + ti = tg; + } else { + ti = new CSSPrimitiveValue(); + } + } + ti._priority = priority; + ti.cssText = cssText; + if (!tg) { + //_numプロパティはremovePropertyメソッドで利用する + ti._num = this._list.length; + this._list[ti._num] = ti; + this[propertyName] = 1; + ++this.length; + } + if (value === "inherit") { + ti.cssValueType = /*CSSValue.CSS_INHERIT*/ 0; + } else if (propertyName === "opacity") { + this._list._opacity = +value; + } else if (propertyName === "font-size") { + if (/(%|em|ex)/.test(value)) { + tg = "_" +RegExp.$1; + ti[tg] = parseFloat(value); + } else { + this._em = this._ex = this["_%"] = null; + this._list._fontSize = parseFloat(value); + } + } + cssText = void 0; + }, + /*itemメソッド + *リストの位置にあるプロパティ名を取得する。宣言内のすべてのプロパティ名を取得するのに便利 + */ +/*string*/ item : function( /*long*/ index) { + if (index >= this.length) { //indexの位置にCSSValueが指定されていないとき + var s = ""; + } else { + var s = this._list[index].cssText.substring(0, this._list[index].cssText.indexOf(":")); + } + return s; + } +}; + +function CSSValue() { +}; +/* // UnitTypes +CSSValue.CSS_INHERIT = 0; +CSSValue.CSS_PRIMITIVE_VALUE = 1; +CSSValue.CSS_VALUE_LIST = 2; +CSSValue.CSS_CUSTOM = 3;*/ +CSSValue.prototype = { + cssText : "", + cssValueType : /*CSSValue.CSS_CUSTOM*/ 3, + _isDefault : 0 //デフォルトであるかどうか(独自のプロパティ) +}; + +function CSSPrimitiveValue() { +}; + +(function(t) { +/*t.CSS_UNKNOWN = 0; +t.CSS_NUMBER = 1; +t.CSS_PERCENTAGE = 2; +t.CSS_EMS = 3; +t.CSS_EXS = 4; +t.CSS_PX = 5; +t.CSS_CM = 6; +t.CSS_MM = 7; +t.CSS_IN = 8; +t.CSS_PT = 9; +t.CSS_PC = 10; +t.CSS_DEG = 11; +t.CSS_RAD = 12; +t.CSS_GRAD = 13; +t.CSS_MS = 14; +t.CSS_S = 15; +t.CSS_HZ = 16; +t.CSS_KHZ = 17; +t.CSS_DIMENSION = 18; +t.CSS_STRING = 19; +t.CSS_URI = 20; +t.CSS_IDENT = 21; +t.CSS_ATTR = 22; +t.CSS_COUNTER = 23; +t.CSS_RECT = 24; +t.CSS_RGBCOLOR = 25;*/ +t.prototype = Object._create(CSSValue); +})(CSSPrimitiveValue); + +(function(){ + this._n = [1, 0.01, 1, 1, 1, 35.43307, 3.543307, 90, 1.25, 15, 1, 180 / Math.PI, 90/100, 1, 1000, 1, 1000, 1]; //CSS_PX単位への変換値(なお、CSS_SはCSS_MSに、CSS_RADとCSS_GRADはCSS_DEGに、CSS_KHZはCSS_HZに統一) + this.cssValueType = /*CSSValue.CSS_PRIMITIVE_VALUE*/ 1; + this.primitiveType = /*CSSPrimitiveValue.CSS_UNKNOWN*/ 0; + this._value = null; + this._percent = 0; //単位に%が使われていた場合、このプロパティの数値を1%として使う + this._empercent = 0; + this._em = this._ex = this["_%"] = null; //emが単位の場合、getComputedStyleメソッドなどで使う + /*void*/ this.setFloatValue = function(/*short*/ unitType, /*float*/ floatValue) { + if ((/*CSSPrimitiveValue.CSS_UNKNOWN*/ 0 >= unitType) && (unitType >= /*CSSPrimitiveValue.CSS_STRING*/ 19)) { //浮動小数点数単位型をサポートしないCSS単位である場合 + throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); + } + this.primitiveType = unitType; + this._value = floatValue * this._n[unitType-1]; //値はあらかじめ、利用しやすいように変換しておく + }; + /*getFloatValueメソッド + *別の単位に変換可能。 + */ + this._regd = /[\d\.]+/; + /*float*/ this.getFloatValue = function(/*short*/ unitType) { + if ((/*CSSPrimitiveValue.CSS_UNKNOWN*/ 0 >= unitType) && (unitType >= /*CSSPrimitiveValue.CSS_STRING*/ 19)) { //浮動小数点数単位型をサポートしないCSS単位である場合 + throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); + } + if (this._value || (this._value === 0)) { //すでに、setFloatValueメソッドによって_valueプロパティが設定されていた場合 + return (this._value / this._n[unitType-1]); + } else { + var tc = this.cssText, + n = tc.slice(-1), + type = 0, + s = +(tc.match(this._regd)); + s = isNaN(s) ? 0 : s; + if (n >= "0" && n <= "9") { + type = /*CSSPrimitiveValue.CSS_NUMBER*/ 1; + if (unitType === 1) { + unitType = tc = n = type = void 0; + return s; + } + } else if (n === "%") { + s *= this._percent; + type = /*CSSPrimitiveValue.CSS_PERCENTAGE*/ 2; + } else if ((n === "m") && (tc.charAt(tc.length-2) === "e")) { + s *= this._empercent; + type = /*CSSPrimitiveValue.CSS_EMS*/ 3; + } else if ((n === "x") && (tc.charAt(tc.length-2) === "e")) { + type = /*CSSPrimitiveValue.CSS_EXS*/ 4; + } else if ((n === "x") && (tc.charAt(tc.length-2) === "p")) { + type = /*CSSPrimitiveValue.CSS_PX*/ 5; + } else if ((n === "m") && (tc.charAt(tc.length-2) === "c")) { + type = /*CSSPrimitiveValue.CSS_CM*/ 6; + } else if ((n === "m") && (tc.charAt(tc.length-2) === "m")) { + type = /*CSSPrimitiveValue.CSS_MM*/ 7; + } else if (n === "n") { + type = /*CSSPrimitiveValue.CSS_IN*/ 8; + } else if (n === "t") { + type = /*CSSPrimitiveValue.CSS_PT*/ 9; + } else if (n === "c") { + type = /*CSSPrimitiveValue.CSS_PC*/ 10; + } + s = s * this._n[type-1] / this._n[unitType-1]; + tc = n = type = unitType = void 0; + return s; + } + }; + /*void*/ this.setStringValue = function(/*short*/ stringType, /*string*/ stringValue) { + if (/*CSSPrimitiveValue.CSS_DIMENSION*/ 18 >= stringType && stringType >= /*CSSPrimitiveValue.CSS_COUNTER*/ 23) { //文字列型をサポートしないCSS単位である場合 + throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); + } + this._value = stringValue; + }; + /*string*/ this.getStringValue = function(/*short*/ stringType) { + if (/*CSSPrimitiveValue.CSS_DIMENSION*/ 18 >= stringType && stringType >= /*CSSPrimitiveValue.CSS_COUNTER*/ 23) { //文字列型をサポートしないCSS単位である場合 + throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); + } + return (this._value); + }; + /*Counter*/ this.getCounterValue = function() { + if (this.primitiveType !== /*CSSPrimitiveValue.CSS_COUNTER*/ 23) { //Counter型ではないとき + throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); + } + return (new Counter()); + }; + /*Rect*/ this.getRectValue = function() { + if (this.primitiveType !== /*CSSPrimitiveValue.CSS_RECT*/ 24) { //Rect型ではないとき + throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); + } + return (new Rect()); + }; + /*RGBColor*/ this.getRGBColorValue = function() { + if (this.primitiveType !== /*CSSPrimitiveValue.CSS_RGBCOLOR*/ 25) { //RGBColor型ではないとき + throw new DOMException(/*DOMException.INVALID_ACCESS_ERR*/ 15); + } + var s = new RGBColor(), + rgbColor = this.cssText, + n = SVGColor.prototype._keywords[rgbColor]; + if (rgbColor.indexOf("%", 5) > 0) { // %を含むrgb形式の場合 + rgbColor = rgbColor.replace(/[\d.]+%/g, function(t) { + return Math.round((2.55 * parseFloat(t))); + }); + } else if (rgbColor.indexOf("#") > -1) { //#を含む場合 + rgbColor = rgbColor.replace(/[\da-f][\da-f]/gi, function(s) { + return parseInt(s, 16); + }); + } + n = n || rgbColor.match(/\d+/g); + s.red.setFloatValue(/*CSSPrimitiveValue.CSS_NUMBER*/ 1, parseFloat(n[0])); + s.green.setFloatValue(/*CSSPrimitiveValue.CSS_NUMBER*/ 1, parseFloat(n[1])); + s.blue.setFloatValue(/*CSSPrimitiveValue.CSS_NUMBER*/ 1, parseFloat(n[2])); + n = rgbColor = void 0; + return (s); + }; +}).apply(CSSPrimitiveValue.prototype); +/*CSSValueList + *Arrayで代用する + */ +function CSSValueList() { + this.cssValueType = /*CSSValue.CSS_VALUE_LIST*/ 2; + this.length = 0; +}; +CSSValueList.prototype = Object._create(CSSValue); +/*CSSValue*/ CSSValueList.prototype.item = function( /*long*/ index) { + return (this[index]); +}; + +function RGBColor() { + var cs = CSSPrimitiveValue; + this.red = new cs(); + this.green = new cs(); + this.blue = new cs(); + cs = void 0; + this.red.primitiveType = this.green.primitiveType = this.blue.primitiveType = /*CSSPrimitiveValue.CSS_NUMBER*/ 1; +}; + +function Rect() { + var cs = CSSPrimitiveValue; + this.top = new cs(); + this.right = new cs(); + this.bottom = new cs(); + this.left = new cs(); + cs = void 0; +}; + +function Counter() { + this.identifier = this.listStyle = this.separator = ""; +}; + +function ElementCSSInlineStyle() { + var cs = CSSStyleDeclaration; + this.style = new cs(); + this._attributeStyle = new cs(); //プレゼンテーション属性の値を格納する + cs = void 0; +}; + +/*CSS2Properties + *削除不可 + *さらにSVG CSSを付け加えている + */ +var n = "none", + m = "normal", + a = "auto", + CSS2Properties = { + fill : "black", + stroke : n, + cursor : a, + visibility : "visible", + display : "inline-block", + opacity : "1", + fillOpacity : "1", + strokeWidth : "1", + strokeDasharray : n, + strokeDashoffset : "0", + strokeLinecap : "butt", + strokeLinejoin : "miter", + strokeMiterlimit : "4", + strokeOpacity : "1", + writingMode : "lr-tb", + fontFamily : "serif", + fontSize : "12", + color : "black", + fontSizeAdjust : n, + fontStretch : m, + fontStyle : m, + fontVariant : m, + fontWeight : m, + font : "inline", + +//# Gradient properties: + + stopColor : "black", + stopOpacity : "1", + textAnchor : "start", + azimuth : "center", + // raises(dom::DOMException) on setting + //簡略プロパティに関しては、初期値を再考せよ + clip : a, + direction : "ltr", + letterSpacing : m, + lineHeight : m, + overflow : "visible", + textAlign : "left", + textDecoration : n, + textIndent : "0", + textShadow : n, + textTransform : n, + unicodeBidi : m, + verticalAlign : "baseline", + whiteSpace : m, + wordSpacing : m, + zIndex : a, +// # + + mask : n, + markerEnd : n, + markerMid : n, + markerStart : n, + fillRule : "nonzero", + +//# Filter Effects properties: + + enableBackground : "accumulate", + filter : n, + floodColor : "black", + floodOpacity : "1", + lightingColor : "white", + +//# Interactivity properties: + + pointerEvents : "visiblePainted", + +//# Color and Painting properties: + + colorInterpolation : "sRGB", + colorInterpolationFilters : "linearRGB", + colorProfile : a, + colorRendering : a, + imageRendering : a, + marker : "", + shapeRendering : a, + textRendering : a, + +//# Text properties: + + alignmentBaseline : "", + baselineShift : "baseline", + dominantBaseline : a, + glyphOrientationHorizontal : "0deg", + glyphOrientationVertical : a, + kerning : a +}; +n = m = a = void 0; +CSS2Properties.visibility._n = 1; //初期値の設定(_setPaintで使う) + +function CSSStyleSheet() { + StyleSheet.apply(this); +/*CSSRule*/ this.ownerRule = null; +/*CSSRuleList*/ this.cssRules = []; +}; +CSSStyleSheet.prototype = Object._create(StyleSheet); +/*long*/ CSSStyleSheet.prototype.insertRule = function( /*string*/ rule, /*long*/ index) { + var s = new CSSStyleRule(), style = s.style, a, sc = rule.match(/\{[\s\S]+\}/), m; + s.parentStyleSheet = this; + style.cssText = rule; + //style値の解析; + sc = sc.replace(/^[^a-z\-]+/, "") + .replace(/\:\s+/g, ":") + .replace(/\s*;[^a-z\-]*/g, ";"); + a = sc.split(";"); + for (var i=0, ali=a.length;i -1)) { //スタイルシートのプロパティならば + tar._attributeStyle.setProperty(name, evt.newValue, ""); + } + if (evt.relatedNode.localName === "id") { //xml:idあるいはid属性ならば + tar.id = evt.newValue; + } else if ((name === "transform") && !!tar.transform) { + var tft = evt.newValue, + degR = tar._degReg, + coma = tft.match(tar._comaReg), //コマンド文字にマッチ translate + list = tft.match(tar._strReg), //カッコ内のリストにマッチ (10 20 30...) + a,b,c,d,e,f, + lis, + com, + deg, + rad, + degli, + s, + cm, + degz, + etod = evt.target.ownerDocument.documentElement, + ttb = tar.transform.baseVal; + //transform属性の値を、SVGTransformListであるtransformプロパティに結びつける + for (var j=0,cli=coma.length;j= "0" && m <= "9") { //軽量化のためにチェックを設ける + } else if (m === "%") { + if (tar._x1width[name]) { + tea.baseVal._percent = tvw * 0.01; + } else if (tar._y1height[name]) { + tea.baseVal._percent = tvh * 0.01; + } else { + tea.baseVal._percent = Math.sqrt((tvw*tvw + tvh*tvh) / 2) * 0.01; + } + type = /*SVGLength.SVG_LENGTHTYPE_PERCENTAGE*/ 2; + } else if (n === "em") { + type = /*SVGLength.SVG_LENGTHTYPE_EMS*/ 3; + } else if (n === "ex") { + type = /*SVGLength.SVG_LENGTHTYPE_EXS*/ 4; + } else if (n === "px") { + type = /*SVGLength.SVG_LENGTHTYPE_PX*/ 5; + } else if (n === "cm") { + type = /*SVGLength.SVG_LENGTHTYPE_CM*/ 6; + } else if (n === "mm") { + type = /*SVGLength.SVG_LENGTHTYPE_MM*/ 7; + } else if (n === "in") { + type = /*SVGLength.SVG_LENGTHTYPE_IN*/ 8; + } else if (n === "pt") { + type = /*SVGLength.SVG_LENGTHTYPE_PT*/ 9; + } else if (n === "pc") { + type = /*SVGLength.SVG_LENGTHTYPE_PC*/ 10; + } + s = _parseFloat(evt.newValue); + s = isNaN(s) ? 0 : s; + tea.baseVal.newValueSpecifiedUnits(type, s); + tea = tod = tvw = tvh = n = type = _parseFloat = s = void 0; + } + evt = _parseFloat = name = tar = null; + }, false); +}; +SVGElement.prototype = Object._create(Element); + +/*関数スコープを避けるため、グローバルスコープでevalさせる関数*/ +NAIBU.eval = function(code) { + var doc = document, + script = doc.createElement("script"); + script.text = code; + (doc.documentElement || doc.body).appendChild(script); +}; + +(function(){ + /*以下の正規表現は属性のパーサの際に用いる*/ + this._degReg = /[\-\d\.e]+/g; + this._comaReg = /[A-Za-z]+(?=\s*\()/g; + this._strReg = /\([^\)]+\)/g; + this._syouReg = /^[^a-z\-]+/; + this._conReg = /\:\s+/g; + this._bouReg = /\s*;[^a-z\-]*/g; + /*_cacheMatrixプロパティはSVGMatrixのキャッシュとして、 + *getCTMメソッドで使う + */ + this._cacheMatrix = null; + /*以下のオブジェクトは単位がパーセント付きの属性の名前を示し、処理に使う*/ + this._x1width = { + "x" : 1, + "x1" : 1, + "x2" : 1, + "width" : 1, + "cx" : 1 + }; + this._y1height = { + "y" : 1, + "y1" : 1, + "y2" : 1, + "height" : 1, + "cy" : 1 + }; + /*String*/ this.id = null; //id属性の値 + /*String*/ this.xmlbase = null; //xml:base属性の値 + /*SVGSVGElement*/ this.ownerSVGElement; //ルート要素であるsvg要素 + /*readonly SVGElement*/ this.viewportElement; //ビューポートを形成する要素(多くはsvg要素) + /*readonly attribute SVGElement*/ this.nearestViewportElement = null; + /*readonly attribute SVGElement*/ this.farthestViewportElement = null; + + /*interface SVGLocatable*/ + /*SVGRect*/ this.getBBox = function(){ + var s = new SVGRect(), + data = this._tar.path.value, + vi = this.ownerDocument.documentElement.viewport, + el = vi.width, + et = vi.height, + er = 0, + eb = 0, + degis = data.match(/[0-9\-]+/g), + nx, + ny; + /*要素の境界領域を求める(四隅の座標を求める) + *etは境界領域の上からビューポート(例えばsvg要素)の上端までの距離であり、ebは境界領域の下からビューポートの下端までの距離 + *elは境界領域の左からビューポートの左端までの距離であり、erは境界領域の右からビューポートの右端までの距離 + */ + for (var i=0,degisli=degis.length;i nx ? nx : el; + et = et > ny ? ny : et; + er = er > nx ? er : nx; + eb = eb > ny ? eb : ny; + } + s.x = el; + s.y = et; + s.width = er - el; + s.height = eb - et; + nx = ny = data = degis =el = et = er = eb = vi = void 0; + return s; + }; + + /*getCTMメソッド + *CTMとは現在の利用座標系に対する変換行列 + *注意点として、SVG1.1とSVG Tiny1.2では内容が異なる。たとえば、 + *1.2ではgetCTMが言及されていない + *もし、要素の中心座標を取得したい人がいれば、transformプロパティのconsolidateメソッドを使うこと + */ + /*SVGMatrix*/ this.getCTM = function() { + var s, m; + if (!!this._cacheMatrix) { //キャッシュがあれば + s = this._cacheMatrix; + } else { + m = this.transform.baseVal.consolidate(); + if (m) { + m = m.matrix; + } else { + m = this.ownerDocument.documentElement.createSVGMatrix(); + } + if (this.parentNode && !!this.parentNode.getCTM) { + s = this.parentNode.getCTM().multiply(m); + } else { + s = m; + } + m = void 0; + this._cacheMatrix = s; //キャッシュをためて次回で使う + } + return s; + }; + + /*SVGMatrix*/ this.getScreenCTM = function(){ + if (!this.parentNode) { + return null; + } + var view = this.nearestViewportElement || this.ownerDocument.documentElement; + var s = view.getScreenCTM().multiply(this.getCTM()); + view = null; + return s; + }; + + /*getTransformToElementメソッド + *これは、あるelementへの変換行列を計算して返す + *たとえばある要素から別の要素への引越しをする際の変換行列を算出することが可能 + */ + /*SVGMatrix*/ this.getTransformToElement = function(/*SVGElement*/ element ){ + var s = this.getScreenCTM().inverse().multiply(element.getScreenCTM()); + return s; + }; +}).apply(SVGElement.prototype); + +function SVGAnimatedBoolean() { + /*boolean*/ this.animVal = this.baseVal = true; +}; + +function SVGAnimatedString() { + /*String*/ this.animVal = this.baseVal = ""; +}; + +function SVGStringList() { +}; +SVGStringList.prototype = Object._create(Array); +(function(){ + /*readonly unsigned long*/ this.numberOfItems = 0; + /*void*/ this.clear = function(){ + for (var i=0, tli=this.length;i= this.numberOfItems || index < 0) { + throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); + } else { + return (this[index]); + } + }; + /*DOMString*/ this.insertItemBefore = function(/*DOMString*/ newItem, /*unsigned long*/ index ){ + if (index >= this.numberOfItems) { + this.appendItem(newItem); + } else { + this.splice(index, 1, newItem, this.getItem[index]); + ++this.numberOfItems; + } + return newItem; + }; + /*DOMString*/ this.replaceItem = function(/*DOMString*/ newItem, /*unsigned long*/ index ){ + if (index >= this.numberOfItems || index < 0) { + throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); + } else { + this.splice(index, 1, newItem); + } + return newItem; + }; + //raises( DOMException, SVGException ); + /*DOMString*/ this.removeItem = function(/*unsigned long*/ index ){ + if (index >= this.numberOfItems || index < 0) { + throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); + } else { + this.splice(index, 1); + --this.numberOfItems; + } + return newItem; + }; + /*DOMString*/ this.appendItem = function(/*DOMString*/ newItem ){ + this[this.numberOfItems] = newItem; + ++this.numberOfItems; + }; +}).apply(SVGStringList.prototype); + +function SVGAnimatedEnumeration() { + /*unsigned short*/ this.baseVal = 0; + // raises DOMException on setting + /*readonly unsigned short*/ this.animVal = 0; +}; +function SVGAnimatedInteger() { + /*long*/ this.baseVal = 0; + // raises DOMException on setting + /*readonly long*/ this.animVal = 0; +}; +function SVGNumber() { + /*float*/ this.value = 0; + // raises DOMException on setting +}; +function SVGAnimatedNumber() { + /*float*/ this.baseVal = this.animVal = 0; +}; + +function SVGNumberList() { +}; +/*SVGUnmberListのメソッドはSVGPathSegListを参照*/ + +function SVGAnimatedNumberList() { + /*readonly SVGNumberList*/ this.animVal = this.baseVal = new SVGNumberList(); +}; +/*SVGLengthクラス + *長さを設定する(単位pxに統一する方便として使う) + *valueInSpecifiedUnitsプロパティはpxに統一する前の数値。valueプロパティはpxに統一した後の数値 + */ +function SVGLength() { +}; +/*(function(t) { + // Length Unit Types + /*const unsigned short t.SVG_LENGTHTYPE_UNKNOWN = 0; + /*const unsigned short t.SVG_LENGTHTYPE_NUMBER = 1; + /*const unsigned short t.SVG_LENGTHTYPE_PERCENTAGE = 2; + /*const unsigned short t.SVG_LENGTHTYPE_EMS = 3; + /*const unsigned short t.SVG_LENGTHTYPE_EXS = 4; + /*const unsigned short t.SVG_LENGTHTYPE_PX = 5; + /*const unsigned short t.SVG_LENGTHTYPE_CM = 6; + /*const unsigned short t.SVG_LENGTHTYPE_MM = 7; + /*const unsigned short t.SVG_LENGTHTYPE_IN = 8; + /*const unsigned short t.SVG_LENGTHTYPE_PT = 9; + /*const unsigned short t.SVG_LENGTHTYPE_PC = 10; +})(SVGLength);*/ + +SVGLength.prototype = { + /*readonly attribute unsigned short*/ unitType : /*SVGLength.SVG_LENGTHTYPE_UNKNOWN*/ 0, + /*attribute float*/ value : 0, //利用単位における値 + /*attribute float*/ valueInSpecifiedUnits : /*SVGLength.SVG_LENGTHTYPE_UNKNOWN*/ 0, //unitTypeにおける値 + /*attribute DOMString*/ valueAsString : "0", + _percent : 0.01, //単位に%が使われていた場合、このプロパティの数値を1%として使う + _fontSize : 12, //単位のemとexで使われるfont-sizeの値 +/*newValueSpedifiedUnitsメソッド + *新しくunitTypeにおける値を設定する + *例:2pxならば、x.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 2);となる + */ + newValueSpecifiedUnits : function (/*unsigned short*/ unitType, /*float*/ valueInSpecifiedUnits) { + var n = 1, + _s = ""; //nは各単位から利用単位への変換数値。_sは単位の文字列を表す + if (unitType === /*SVGLength.SVG_LENGTHTYPE_NUMBER*/ 1) { + } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_PX*/ 5) { + _s = "px"; + } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_PERCENTAGE*/ 2) { + n = this._percent; + _s = "%"; + } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_EMS*/ 3) { + n = this._fontSize; + _s = "em"; + } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_EXS*/ 4) { + n = this._fontSize * 0.5; + _s = "ex"; + } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_CM*/ 6) { + n = 35.43307; + _s = "cm"; + } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_MM*/ 7) { + n = 3.543307; + _s = "mm"; + } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_IN*/ 8) { + n = 90; + _s = "in"; + } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_PT*/ 9) { + n = 1.25; + _s = "pt"; + } else if (unitType === /*SVGLength.SVG_LENGTHTYPE_PC*/ 10) { + n = 15; + _s = "pc"; + } else { + throw new DOMException(/*DOMException.NOT_SUPPORTED_ERR*/ 9); + } + this.unitType = unitType; + this.value = valueInSpecifiedUnits * n; + this.valueInSpecifiedUnits = valueInSpecifiedUnits; + this.valueAsString = valueInSpecifiedUnits + _s; + valueInSpecifiedUnits = unitType = n = _s = void 0; + }, +/*convertToSpecifiedUnitsメソッド + *valueプロパティを書き換えずに、単位だけを変換する + *例:2cmをmmに変換したい場合 + * x.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_CM, 2); + * x.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_MM); + * alert(x.valueAsString); //20mm + */ + convertToSpecifiedUnits : function (/*unsigned short*/ unitType) { + if (this.value === 0) { + this.newValueSpecifiedUnits(unitType, 0); + return; + } + var v = this.value; + this.newValueSpecifiedUnits(unitType, this.valueInSpecifiedUnits); + v = v / this.value * this.valueInSpecifiedUnits; + this.newValueSpecifiedUnits(unitType, v); + }, + /*_emToUnitメソッド + *emやexが単位に使われていたときに、@fontSizeの値を手がかりに、新たな値へとvalueを変換させる + *単位が%の場合は、新しいvalueへと変換させておく + */ + _emToUnit : function (/*float*/ fontSize) { + if ((this.unitType === /*SVGLength.SVG_LENGTHTYPE_EMS*/ 3) || (this.unitType === 4)) { + this._fontSize = fontSize; + this.newValueSpecifiedUnits(this.unitType, this.valueInSpecifiedUnits); + } + } +}; +function SVGAnimatedLength() { + /*readonly SVGLength*/ this.animVal; + this.baseVal = new SVGLength(); + this.baseVal.unitType = 1; +}; +function SVGLengthList() { +}; +/*SVGLengthListのメソッドはSVGPathSegListを参照*/ + +function SVGAnimatedLengthList() { + /*readonly SVGNumberList*/ this.animVal = this.baseVal = new SVGLengthList(); +}; +function SVGAngle() { +}; +SVGAngle.prototype = { + /*readonly attribute unsigned short*/ unitType : 0, + /*attribute float*/ value : 0, + // raises DOMException on setting + /*attribute float*/ valueInSpecifiedUnits : 0, + // raises DOMException on setting + /*attribute DOMString*/ valueAsString : "0", + // raises DOMException on setting + /*void*/ newValueSpecifiedUnits : function (/*in unsigned short*/ unitType, /*in float*/ valueInSpecifiedUnits ) { + var n = 1, + _s = ""; //nは各単位から度への変換数値。_sは単位の文字列を表す + if (unitType === /*SVGAngle.SVG_ANGLETYPE_UNSPECIFIED*/ 1) { + } else if (unitType === /*SVGAngle.SVG_ANGLETYPE_DEG*/ 2) { + _s = "deg"; + } else if (unitType === /*SVGAngle.SVG_ANGLETYPE_RAD*/ 3) { + n = Math.PI / 180; + _s = "rad"; + } else if (unitType === /*SVGAngle.SVG_ANGLETYPE_GRAD*/ 4) { + n = 9 / 10; + _s = "grad"; + } else { + throw new DOMException(/*DOMException.NOT_SUPPORTED_ERR*/ 9); + } + this.unitType = unitType; + this.value = valueInSpecifiedUnits * n; + this.valueInSpecifiedUnits = valueInSpecifiedUnits; + this.valueAsString = valueInSpecifiedUnits + _s; + n = _s = void 0; + //raises( DOMException ); + }, + /*void*/ convertToSpecifiedUnits : function (/*in unsigned short*/ unitType ) { + if (this.value === 0) { + this.newValueSpecifiedUnits(unitType, 0); + return; + } + var v = this.value; + this.newValueSpecifiedUnits(unitType, this.valueInSpecifiedUnits); + v = v / this.value * this.valueInSpecifiedUnits; + this.newValueSpecifiedUnits(unitType, v); + //raises( DOMException ); + } +}; +// Angle Unit Types +/*const unsigned short SVGAngle.SVG_ANGLETYPE_UNKNOWN = 0; +/*const unsigned short SVGAngle.SVG_ANGLETYPE_UNSPECIFIED = 1; +/*const unsigned short SVGAngle.SVG_ANGLETYPE_DEG = 2; +/*const unsigned short SVGAngle.SVG_ANGLETYPE_RAD = 3; +/*const unsigned short SVGAngle.SVG_ANGLETYPE_GRAD = 4;*/ +function SVGAnimatedAngle() { + /*readonly attribute SVGAngle*/ this.baseVal = new SVGAngle(); + /*readonly attribute SVGAngle*/ this.animVal = this.baseVal; +}; +function SVGColor() { + CSSValue.apply(this); + /*readonly css::RGBColor*/ this.rgbColor = new RGBColor(); +}; + + // Color Types +/*unsigned short SVGColor.SVG_COLORTYPE_UNKNOWN = 0; +/*unsigned short SVGColor.SVG_COLORTYPE_RGBCOLOR = 1; +/*unsigned short SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR = 2; +/*unsigned short SVGColor.SVG_COLORTYPE_CURRENTCOLOR = 3;*/ +SVGColor.prototype = Object._create(CSSValue); //ノードのプロトタイプチェーンを作って、継承 + +(function(){ + /*readonly unsigned short*/ this.colorType = /*SVGColor.SVG_COLORTYPE_UNKNOWN*/ 0; + /*readonly SVGICCColor*/ this.iccColor = null; + this._regD = /\d+/g; + this._regDP = /[\d.]+%/g; + this._exceptionsvg = /*SVGException.SVG_INVALID_VALUE_ERR*/ 1; + /*void*/ this.setRGBColor = function(/*DOMString*/ rgbColor ){ + var s, + _parseInt, + r, g, b; + if (!rgbColor || (typeof rgbColor !== "string")) { + throw new SVGException(this._exceptionsvg); + } + s = this._keywords[rgbColor]; + if (s) { + } else if (rgbColor.indexOf("%", 5) > 0) { // %を含むrgb形式の場合 + rgbColor = rgbColor.replace(this._regDP, function(s) { + return Math.round((2.55 * parseFloat(s))); + }); + s = rgbColor.match(this._regD); + } else if (rgbColor.indexOf("#") === 0) { //#を含む場合 + s = []; + _parseInt = parseInt; + if (rgbColor.length < 5) { + r = rgbColor.charAt(1); + g = rgbColor.charAt(2); + b = rgbColor.charAt(3); + rgbColor = "#" + r + r + g + g + b + b; + } + s[0] = _parseInt(rgbColor.slice(1, 3), 16)+ ""; + s[1] = _parseInt(rgbColor.slice(3, 5), 16)+ ""; + s[2] = _parseInt(rgbColor.slice(5, 7), 16)+ ""; + r = g = b = void 0; + } else { + s = rgbColor.match(this._regD); + if (!s || (s.length < 3)) { //数値が含まれていなければ強制的に終了 + rgbColor = void 0; + throw new SVGException(this._exceptionsvg); + } + } + rgbColor = this.rgbColor; + rgbColor.red.setFloatValue(/*CSSPrimitiveValue.CSS_NUMBER*/ 1, s[0]); + rgbColor.green.setFloatValue(1, s[1]); + rgbColor.blue.setFloatValue(1, s[2]); + rgbColor = s = _parseInt = void 0; +}; + +// raises( SVGException ); +/*void*/ this.setColor =function(/*unsigned short*/ colorType, /*DOMString*/ rgbColor, /*DOMString*/ iccColor ){ + this.colorType = colorType; + if ((colorType === /*SVGColor.SVG_COLORTYPE_RGBCOLOR*/ 1) && iccColor) { + throw new SVGException(this._exceptionsvg); + } else if (colorType === /*SVGColor.SVG_COLORTYPE_RGBCOLOR*/ 1) { + this.setRGBColor(rgbColor); + } else if (rgbColor && (colorType === /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3)) { + this.setRGBColor(rgbColor); + } else if ((colorType === /*SVGColor.SVG_COLORTYPE_UNKNOWN*/ 0) && (rgbColor || iccColor)) { + throw new SVGException(this._exceptionsvg); + } else if ((colorType === /*SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR*/ 2) && (rgbColor || !iccColor)) { + throw new SVGException(this._exceptionsvg); + } + colorType = rgbColor = void 0; +}; +// raises( SVGException ); +//色キーワード +this._keywords = { + aliceblue: [240,248,255], + antiquewhite: [250,235,215], + aqua: [0,255,255], + aquamarine: [127,255,212], + azure: [240,255,255], + beige: [245,245,220], + bisque: [255,228,196], + black: [0,0,0], + blanchedalmond:[255,235,205], + blue: [0,0,255], + blueviolet: [138,43,226], + brown: [165,42,42], + burlywood: [222,184,135], + cadetblue: [95,158,160], + chartreuse: [127,255,0], + chocolate: [210,105,30], + coral: [255,127,80], + cornflowerblue:[100,149,237], + cornsilk: [255,248,220], + crimson: [220,20,60], + cyan: [0,255,255], + darkblue: [0,0,139], + darkcyan: [0,139,139], + darkgoldenrod:[184,134,11], + darkgray: [169,169,169], + darkgreen: [0,100,0], + darkgrey: [169,169,169], + darkkhaki: [189,183,107], + darkmagenta: [139,0,139], + darkolivegreen:[85,107,47], + darkorange: [255,140,0], + darkorchid: [153,50,204], + darkred: [139,0,0], + darksalmon: [233,150,122], + darkseagreen: [143,188,143], + darkslateblue:[72,61,139], + darkslategray:[47,79,79], + darkslategrey:[47,79,79], + darkturquoise:[0,206,209], + darkviolet: [148,0,211], + deeppink: [255,20,147], + deepskyblue: [0,191,255], + dimgray: [105,105,105], + dimgrey: [105,105,105], + dodgerblue: [30,144,255], + firebrick: [178,34,34], + floralwhite: [255,250,240], + forestgreen: [34,139,34], + fuchsia: [255,0,255], + gainsboro: [220,220,220], + ghostwhite: [248,248,255], + gold: [255,215,0], + goldenrod: [218,165,32], + gray: [128,128,128], + grey: [128,128,128], + green: [0,128,0], + greenyellow: [173,255,47], + honeydew: [240,255,240], + hotpink: [255,105,180], + indianred: [205,92,92], + indigo: [75,0,130], + ivory: [255,255,240], + khaki: [240,230,140], + lavender: [230,230,250], + lavenderblush:[255,240,245], + lawngreen: [124,252,0], + lemonchiffon: [255,250,205], + lightblue: [173,216,230], + lightcoral: [240,128,128], + lightcyan: [224,255,255], + lightgoldenrodyellow:[250,250,210], + lightgray: [211,211,211], + lightgreen: [144,238,144], + lightgrey: [211,211,211], + lightpink: [255,182,193], + lightsalmon: [255,160,122], + lightseagree: [32,178,170], + lightskyblue: [135,206,250], + lightslategray:[119,136,153], + lightslategrey:[119,136,153], + lightsteelblue:[176,196,222], + lightyellow: [255,255,224], + lime: [0,255,0], + limegreen: [50,205,50], + linen: [250,240,230], + magenta: [255,0,255], + maroon: [128,0,0], + mediumaquamarine:[102,205,170], + mediumblue: [0,0,205], + mediumorchid: [186,85,211], + mediumpurple: [147,112,219], + mediumseagreen:[60,179,113], + mediumslateblue:[123,104,238], + mediumspringgreen:[0,250,154], + mediumturquoise:[72,209,204], + mediumvioletred:[199,21,133], + midnightblue: [25,25,112], + mintcream: [245,255,250], + mistyrose: [255,228,225], + moccasin: [255,228,181], + navajowhite: [255,222,173], + navy: [0,0,128], + oldlace: [253,245,230], + olive: [128,128,0], + olivedrab: [107,142,35], + orange: [255,165,0], + orangered: [255,69,0], + orchid: [218,112,214], + palegoldenrod: [238,232,170], + palegreen: [152,251,152], + paleturquoise: [175,238,238], + palevioletred: [219,112,147], + papayawhip: [255,239,213], + peachpuff: [255,218,185], + peru: [205,133,63], + pink: [255,192,203], + plum: [221,160,221], + powderblue: [176,224,230], + purple: [128,0,128], + red: [255,0,0], + rosybrown: [188,143,143], + royalblue: [65,105,225], + saddlebrown: [139,69,19], + salmon: [250,128,114], + sandybrown: [244,164,96], + seagreen: [46,139,87], + seashell: [255,245,238], + sienna: [160,82,45], + silver: [192,192,192], + skyblue: [135,206,235], + slateblue: [106,90,205], + slategray: [112,128,144], + slategrey: [112,128,144], + snow: [255,250,250], + springgreen: [0,255,127], + steelblue: [70,130,180], + tan: [210,180,140], + teal: [0,128,128], + thistle: [216,191,216], + tomato: [255,99,71], + turquoise: [64,224,208], + violet: [238,130,238], + wheat: [245,222,179], + white: [255,255,255], + whitesmoke: [245,245,245], + yellow: [255,255,0], + yellowgreen: [154,205,50] +}; +}).apply(SVGColor.prototype); + +function SVGRect() { + /*float*/ this.x = 0; + // raises DOMException on setting + /*float*/ this.y = 0; + // raises DOMException on setting + /*float*/ this.width = 0; + // raises DOMException on setting + /*float*/ this.height = 0; + // raises DOMException on setting +}; + +function SVGAnimatedRect() { + /*readonly SVGRect*/ this.animVal = this.baseVal = new SVGRect(); +}; + +/*SVGUnitTypes = { + // Unit Types + /*unsigned short SVG_UNIT_TYPE_UNKNOWN : 0, + /*unsigned short SVG_UNIT_TYPE_USERSPACEONUSE : 1, + /*unsigned short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX : 2 +};*/ +function SVGStylable() { + /*readonly attribute SVGAnimatedString*/ this.className = new SVGAnimatedString(); + /*readonly attribute css::CSSStyleDeclaration*/ this.style = new CSSStyleDeclaration(); + this._attributeStyle = new CSSStyleDeclaration(); //プレゼンテーション属性の値を格納する + //styleのcssTextプロパティを解析するリスナーを登録しておく +}; +/*getPresentationAttributeメソッド + *プレゼンテーション属性の値をCSSValueとして得る。これはCSSのスタイルの設定値を定めるときや、内部の動的処理に役立つ + */ +/*css::CSSValue*/ SVGElement.prototype.getPresentationAttribute = function( /*DOMString*/ name ){ + var s = this._attributeStyle.getPropertyCSSValue(name); + if (s) { + return s; + } else { + return null; + } +}; + +/*SVGURIReferenceオブジェクトはURI参照を用いる要素に適用される + *SIEでは、もっぱらXLink言語の処理を行う + */ +function SVGURIReference() { + /*readonly SVGAnimatedString*/ this.href = new SVGAnimatedString(); + this._instance = null; //埋め込みの場合に、読み込んだDOMツリーを結び付けておくプロパティ + this._text = ""; + this.addEventListener("DOMAttrModified", function(evt){ + if ((evt.relatedNode.namespaceURI === "http://www.w3.org/1999/xlink") && (evt.attrName === "xlink:href")) { + evt.target.href.baseVal = evt.newValue; + /*_svgload_limitedを+1とすることで、 + *SVGLoadイベントは発火されなくなる。1を引く必要がある + */ + evt.target.ownerDocument.documentElement._svgload_limited++; + } + evt = void 0; + }, false); + this.addEventListener("DOMNodeInserted", function(evt){ + var tar = evt.target; + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ + var tar = evt.target, + base = location.href, + href = tar.href.baseVal, + doc = tar.ownerDocument, + durl = doc.URL, + reg = /\.+\//g, + regg = /\/[^\/]+?(\/[^\/]*?)$/, + fe, show, egbase, ep, b, uri, xmlhttp, ui, id, ele, ev, Sfunc; + /*xlink:href属性とxml:base属性を手がかりに、 + *ハイパーリンクのURIを決定する処理を行う + */ + if (href !== "") { //xlink:href属性が指定されたとき + egbase = tar.xmlbase; + if (!egbase) { + ep = tar.parentNode; + b = null; + while (!b && ep) { + b = ep.xmlbase; + ep = ep.parentNode; + } + egbase = b; + } + fe = function(durl, base) { + if (href.indexOf(":") > -1) { //絶対URIの場合 + uri = href; + } else if (durl.indexOf(":") > -1) { + base = durl; + } else { + /*durlが相対URLの場合はdirecoryの名前を消す*/ + reg.lastIndex = 0; // execメソッドを使うため + while (reg.exec(durl)) { + base = base.replace(regg, "$1"); + } + base = base.replace(/\/[^\/]+?$/, "/"); //URIの最後尾にあるファイル名は消す。例: /n/sie.js -> /n/ + base = base + durl.replace(reg, ""); + } + return base; + }; + base = fe(durl, base); + if (egbase) { + base = fe(egbase, base); //xml:base属性の指定がある場合 + } + if (href.indexOf("#") === 0) { //href属性において#が一番につく場合 + uri = href; + } else if (!uri){ + base = base.replace(/\/[^\/]+?$/, "/"); + reg.lastIndex = 0; // execメソッドを使うため + while (reg.exec(href)) { + base = base.replace(regg, "$1"); + } + uri = base + href.replace(reg, ""); + } + show = tar.getAttributeNS("http://www.w3.org/1999/xlink", "show") || "embed"; + if (show === "replace") { + tar._tar.setAttribute("href", uri); + } else if (show === "new") { + tar._tar.setAttribute("target", "_blank"); + tar._tar.setAttribute("href", uri); + } else if (show === "embed") { + xmlhttp = NAIBU.xmlhttp; + ui = uri.indexOf("#"); + if (ui > -1) { + id = uri.slice(ui+1); + uri = uri.replace(/#.+$/, ""); + } else { + id = null; + } + if (href.indexOf("#") === 0) { //URIが#で始まるのであれば + ele = doc.getElementById(id); + tar._instance = ele; + Sfunc = SVGURIReference; + SVGURIReference = function(){}; + ev = doc.createEvent("SVGEvents"); + ev.initEvent("S_Load", false, false); + tar.dispatchEvent(ev); + SVGURIReference = Sfunc; + tar = xmlhttp = void 0; + } else if (uri.indexOf("data:") > -1) { + tar._tar.src = uri; + tar = xmlhttp = void 0; + } else if ((uri.indexOf("http:") > -1)){ + if ((tar.localName === "image") && (uri.indexOf(".svg") === -1)) { + tar._tar.src = uri; + } else { + /*ここの_svgload_limitedは、リンクを読み込んだ後でSVGLoadイベントを実行させるという遅延処理で必要*/ + tar.ownerDocument.documentElement._svgload_limited++; + xmlhttp.open("GET", uri, false); + xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + xmlhttp.onreadystatechange = function() { + if ((xmlhttp.readyState === 4) && (xmlhttp.status === 200)) { + var type = xmlhttp.getResponseHeader('Content-Type') || "text", + doc, str, ele, ev, ndoc, Sfunc; + if ((type.indexOf("text") > -1) || (type.indexOf("xml") > -1) || (type.indexOf("script") > -1)) { //ファイルがtext形式である場合 + /*responseXMLを使うと、時々、空のデータを返すことがあるため(原因はcontent-typeが"text/xml"など特定のものでないと受け付けないため)、 + *ここでは、responseTextを用いる + */ + /*script要素とstyle要素は、 + *_textプロパティに読み込んだテキストを格納しておく + *それら以外は、_instanceプロパティにDOMツリーを格納しておく + */ + if (tar.localName !== "script" && tar.localName !== "style") { + doc = new ActiveXObject("MSXML2.DomDocument"); + str = xmlhttp.responseText.replace(/!DOCTYPE/,"!--").replace(/(dtd">|\]>)/,"-->"); + ndoc = NAIBU.doc; + ndoc.async = ndoc.validateOnParse = ndoc.resolveExternals = ndoc.preserveWhiteSpace = false; + doc.loadXML(str); + ele = doc.documentElement; + Sfunc = SVGURIReference; + SVGURIReference = function(){}; + tar._instance = tar.ownerDocument.importNode(ele, true); + SVGURIReference = Sfunc; + if (id) { + tar._instance = tar._instance.ownerDocument.getElementById(id); + } + } else { + tar._text = xmlhttp.responseText; + } + } else if (!!tar._tar) { + tar._tar.src = uri; + } + /*S_LoadイベントとはSIE独自のイベント。 + *XLink言語によって、リンク先のコンテンツが読み込まれた時点で発火する + */ + ev = tar.ownerDocument.createEvent("SVGEvents"); + ev.initEvent("S_Load", false, false); + tar.dispatchEvent(ev); + tar.ownerDocument.documentElement._svgload_limited--; + /*すべてのリンクが読み込みを終了した場合、SVGLoadイベントを発火*/ + if (tar.ownerDocument.documentElement._svgload_limited < 0) { + ev = tar.ownerDocument.createEvent("SVGEvents"); + ev.initEvent("SVGLoad", false, false); + tar.ownerDocument.documentElement.dispatchEvent(ev); + } + tar = type = doc = str = ev = Sfunc = ndoc = void 0; + /*IEのメモリリーク対策として、空関数を入力*/ + xmlhttp.onreadystatechange = NAIBU.emptyFunction; + xmlhttp = void 0; + } + }; + xmlhttp.send(null); + } + } + } + tar.ownerDocument.documentElement._svgload_limited--; + } + evt = base = href = egbase = fe = ep = durl = b = reg = uri = ui = id = doc = ele = ev = show = Sfunc = void 0; + }, false); + tar = evt = void 0; + }, false); +}; +function SVGCSSRule() { + CSSRule.apply(this); + // Additional CSS RuleType to support ICC color specifications + /*const unsigned short*/ this.COLOR_PROFILE_RULE = 7; +}; +SVGCSSRule.prototype = Object._create(CSSRule); //ノードのプロトタイプチェーンを作って、継承 + +/*SVGDocument + *SVGの文書オブジェクト + */ +function SVGDocument(){ + Document.apply(this); + DocumentStyle.apply(this); + /*readonly DOMString*/ this.title = ""; + /*readonly DOMString*/ this.referrer = document.referrer; + /*readonly DOMString*/ this.domain = document.domain; + /*readonly DOMString*/ this.URL = document.location; + /*readonly SVGSVGElement*/ this.rootElement; +}; +SVGDocument.prototype = Object._create(Document); //ノードのプロトタイプチェーンを作って、継承 + +/*軽量化のために、頻繁に使われる処理をSVGDocumentの独自メソッドとしてまとめておく*/ +SVGDocument.prototype._domnodeEvent = function() { + var evtt = this.createEvent("MutationEvents"); + evtt.initMutationEvent("DOMNodeInsertedIntoDocument", false, false, null, null, null, null, null); + return evtt; +}; + +/*SVGSVGElement + *svg要素をあらわすオブジェクト + */ +function SVGSVGElement(_doc) { + SVGElement.apply(this, arguments); + _doc && (this._tar = _doc.createElement("v:group")); + _doc = void 0; + /*_svgload_limitedはSVGLoadイベントを発火させる判定基準。 + * Xlink言語が使われていない限り0であり、SVGLoadイベントが発火される*/ + this._svgload_limited = 0; +/* SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGLocatable, + SVGFitToViewBox, + SVGZoomAndPan, + events::EventTarget, + events::DocumentEvent, + css::ViewCSS, + css::DocumentCSS {*/ + /*以下のx,y,width,heightプロパティは + *それぞれ、svg要素の同名属性に対応。たとえば、xならば、x属性に対応している + *1000というのは、W3Cで触れていないため、独自の初期値を採用 + */ + var slen = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x = new slen(); + /*readonly SVGAnimatedLength*/ this.y = new slen(); + /*readonly SVGAnimatedLength*/ this.width = new slen(); + /*readonly SVGAnimatedLength*/ this.height = new slen(); + slen = void 0; + /*DOMString*/ this.contentScriptType = "application/ecmascript"; //古い仕様では、text/ecmascript + /*DOMString*/ this.contentStyleType = "text/css"; + /*readonly SVGRect*/ this.viewport = this.createSVGRect(); + /*useCurrentViewプロパティ + * view要素やハイパーリンクなどで呼び出された場合、true。それ以外の通常表示はfalse。 + */ + /*boolean*/ this.useCurrentView = false; + /*currentViewプロパティ + * ズームやパンがされていない初期表示のviewBoxプロパティなどを示す。通常はDOM属性と連動 + */ + /*readonly SVGViewSpec*/ this.currentView = new SVGViewSpec(this); + /*もし、画像をズームやパンしたとき、どのような倍率になるかを + *以下のプロパティを使って次の行列で示すことができる + *2x3 行列 [a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y] + */ + /*float*/ this.currentScale = 1; + /*readonly SVGPoint*/ this.currentTranslate = this.createSVGPoint(); + /*以下は、SVGFitToViewBoxのインターフェースを用いる + *もし、ズームやパンがあれば、真っ先にこれらのプロパティを別のオブジェクトに変更すること + */ + /*readonly SVGAnimatedRect*/ this.viewBox = this.currentView.viewBox; + /*readonly SVGAnimatedPreserveAspectRatio*/ this.preserveAspectRatio = this.currentView.preserveAspectRatio; + /*unsigned short*/ this.zoomAndPan = /*SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE*/ 1; + this._tx = 0; + this._ty = 0; + /*int*/ this._currentTime = 0; + /*DOMAttrModifiedイベントを利用して、 + *随時、属性の値をDOMプロパティに変換しておくリスナー登録 + */ + this.addEventListener("DOMAttrModified", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + var tar = evt.target, + name = evt.attrName, + tv, ovb, par, tp, sa, mos; + if (name === "viewBox") { + tar._cacheScreenCTM = null; + tv = tar.viewBox.baseVal; + ovb = evt.newValue.replace(/^\s+|\s+$/g, "").split(/[\s,]+/); + tv.x = parseFloat(ovb[0]); + tv.y = parseFloat(ovb[1]); + tv.width = parseFloat(ovb[2]); + tv.height = parseFloat(ovb[3]); + tar.viewBox.baseVal._isUsed = 1; + } else if (name === "preserveAspectRatio") { + tar._cacheScreenCTM = null; + par = evt.newValue; + tp = tar.preserveAspectRatio.baseVal; + sa = 1; + mos = /*SVGPreserveAspectRatio.SVG_MEETORSLICE_UNKNOWN*/ 0; + if (!!par.match(/x(Min|Mid|Max)Y(Min|Mid|Max)(?:\s+(meet|slice))?/)) { + switch (RegExp.$1) { + case "Min": + sa += 1; + break; + case "Mid": + sa += 2; + break; + case "Max": + sa += 3; + break; + } + switch (RegExp.$2) { + case "Min": + break; + case "Mid": + sa += 3; + break; + case "Max": + sa += 6; + break; + } + if (RegExp.$3 === "slice") { + mos = /*SVGPreserveAspectRatio.SVG_MEETORSLICE_SLICE*/ 2; + } else { + mos = /*SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET*/ 1; + } + } + tp.align = sa; + tp.meetOrSlice = mos; + } else if (name === "width") { + /*viewportを更新する*/ + tar.viewport.width = tar.width.baseVal.value; + } else if (name === "height") { + tar.viewport.height = tar.height.baseVal.value; + } + evt = name = tv = ovb = par = tp = sa = mos = void 0; + }, false); + this.addEventListener("SVGLoad", function(evt){ + /*以下のDOMAttrModifiedは浮上フェーズのときに、再描画をするように + *処理を書いたもの。属性が書き換わるたびに、再描画される + */ + evt.target.addEventListener("DOMAttrModified", function(evt){ + var tar, + evtt, tce, slist; + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + tar = evt.target; + if (tar.parentNode) { + evtt = tar.ownerDocument._domnodeEvent(); + evtt.target = tar; + evtt.eventPhase = /*Event.AT_TARGET*/ 2; + tce = tar._capter; //tceは登録しておいたリスナーのリスト + for (var j=0,tcli=tce.length;j sw ? sw : w; + viewHeight = h > sh ? sh : h; + backrs = backr.currentStyle; + bfl = _parseFloat(backrs.left); + bft = _parseFloat(backrs.top); + bl = -tar._tx; //blやbtは、ずれを調整するのに使う + bt = -tar._ty; + if (bfl !== 0 && !isNaN(bfl)) { //内部の図形にずれが生じたとき(isNaNはIE8でautoがデフォルト値のため) + bl = bfl; + dcp.style.left = -bl+ "px"; + } + if (bft !== 0 && !isNaN(bfl)) { + bt = bft; + dcp.style.top = -bt+ "px"; + } + backright = bl + viewWidth + 1; + backdown = bt + viewHeight + 1; + trstyle.clip = "rect(" +bt+ "px " +backright+ "px " +backdown+ "px " +bl+ "px)"; + this._document = s; + svgload = function() { + if ("_svgload_limited" in s.documentElement) { + /*_svgload_limitedプロパティはXlink言語が使われていない限り、0である。 + *xlink:href属性が指定されるたびに+1となる。 + *0以外は、SVGLoadイベントが発火されない仕組みとなっている + * + *目的: + * Xlinkのリンク先のソースを読み込むまで、SVGLoadイベントを発火させないため + */ + s.documentElement._svgload_limited--; + if (s.documentElement._svgload_limited < 0) { + var evt = s.createEvent("SVGEvents"); + evt.initEvent("SVGLoad", false, false); + s.documentElement.dispatchEvent(evt); + evt = void 0; + } + } + }; + //以下、テキストの位置を修正 + trstyle.visibility = "hidden"; + text = s.documentElement._tar.getElementsByTagName("div"); + for (var i=0, texti;text[i];++i) { + texti = text[i]; + if (texti.firstChild.nodeName !== "shape") { //radialGradient用のdiv要素でないならば + var tis = texti.style; + tis.left = _parseFloat(tis.left) - bl + "px"; + tis.top = _parseFloat(tis.top) - bt + "px"; + tis = void 0; + } + } + //ビューポートの位置をスクロールで調整 (なお、_txプロパティはSVGSVGElementのSIEコードを参照) + ifcw && ifcw.scroll(-s.documentElement._tx, -s.documentElement._ty); + trstyle.visibility = "visible"; + s._isLoaded = 1; //_isLoadedプロパティはevents::dispatchEventメソッドで使う + s.defaultView._cache = s.defaultView._cache_ele = null; + oba = _doc = evt = ndoc = objei = tar = tview = objw = objh = sdt = sp = dcp = backr = sw = sh = style = fontSize = void 0; + trstyle = backrs = text = texti = i = bfl = bft = bl = bt = text = _parseFloat = w = h = viewWidth = viewHeight = backdown = backright = void 0; + /*IEのメモリリーク対策として、空関数を入力*/ + this.xmlhttp.onreadystatechange = NAIBU.emptyFunction; + if (this._next) { + svgload(); + ifcw && (ifr.contentWindow.screen.updateInterval = 0); + svgload = ifr = ifcw = s = void 0; + this._next._init(); + } else { + /*全要素の読み込みが終了した場合*/ + if (s.implementation._buffer_) { + screen.updateInterval = 0; + /*以下はバッファリングにためておいた要素とイベントを、後から実行する*/ + NAIBU._buff_num = 0; + NAIBU._buff = setInterval(function(){ + var n = NAIBU._buff_num, + dbuf = DOMImplementation._buffer_, + dbufli = dbuf ? dbuf.length : 0, //極端な負荷がかかると、dbufはnullになる可能性あり + ts, evt; + if (dbufli === 0) { + clearInterval(NAIBU._buff); + svgload(); + svgload = s = dbuf = n = void 0; + } else { + for (var i=0;i<50;++i) { + ts = dbuf[n]; + evt = dbuf[n+1]; + ts.dispatchEvent(evt); + n += 2; + ts = evt = void 0; + if (n >= dbufli) { + clearInterval(NAIBU._buff); + svgload(); + DOMImplementation._buffer_ = null; + NAIBU.Time.start(); + svgload = s = dbuf = n = dbufli = void 0; + return; + } + } + NAIBU._buff_num = n; + } + dbuf = n = dbufli = void 0; + }, 1); + ifr = ifcw = void 0; + } else { + svgload(); + svgload = ifr = ifcw = s = void 0; + NAIBU.Time.start(); + } + delete NAIBU.doc; + } + }, + /*SVGDocument*/ getSVGDocument : function() { + return (this._document); + } +}; +/*空関数(IEのメモリリーク対策)*/ +NAIBU.emptyFunction = function() {}; + +/*SVGStyleElement + *style要素をあらわすオブジェクト + */ +function SVGStyleElement(_doc) { + SVGElement.apply(this); + LinkStyle.apply(this); + /*LinkStyleに関しては、以下の仕様を参照のこと。なお、これはSVG DOMでは継承されていないので要注意。 + *CSS2 1. Document Object Model Style Sheets + * 1.3. Document Extensions + * Interface LinkStyle (introduced in DOM Level 2) + * http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-LinkStyle + */ + /*以下はそれぞれ、属性の値に対応している*/ + /*DOMString*/ this.xmlspace; + /*DOMString*/ this.type = "text/css"; + /*DOMString*/ this.media; + /*DOMString*/ this.title; + SVGURIReference.apply(this); + this.addEventListener("DOMAttrModified", function(evt){ + if (evt.attrName === "type") { + evt.target.type = evt.newValue; + } else if (evt.attrName === "title") { + evt.target.title = evt.newValue; + } + evt = void 0; + }, false); + this.addEventListener("S_Load", function(evt){ + var tar = evt.target, + sheet = tar.sheet, + styleText = tar._text, + tod = tar.ownerDocument, + style = _doc.createElement("style"), + ri, rsc, scri, rsi; + NAIBU._temp_doc = tod; + sheet = tod.styleSheets[tod.styleSheets.length] = DOMImplementation.createCSSStyleSheet(tar.title, tar.media); + sheet.ownerNode = tar; + /*以下は、IEのCSSパーサを使って、スタイルシートのルールを実装していく*/ + _doc.documentElement.firstChild.appendChild(style); + style.styleSheet.cssText = styleText; + for (var i=0, rules=style.styleSheet.rules, rli=rules.length;i -1) || (selector.indexOf("#" +tar.id) > -1) + || (tar.nodeName === selector)) { + ru[ru.length] = rules[i]; + } + tar._rules = ru; + } + tar = doc = rules = void 0; + }, true); + tar = evt = style = sheet = styleText = tod = i = rules = rli = void 0; + }, false); + this.addEventListener("DOMNodeInserted", function(evt){ + var tar = evt.target; + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + if (tar.nodeName === "#cdata-section") { + evt.currentTarget._text = tar.data; + } + return; + } + tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ + var tar = evt.target; + if ((evt.eventPhase === /*Event.AT_TARGET*/ 2) && !tar.getAttributeNodeNS("http://www.w3.org/1999/xlink", "xlink:href")) { + var evtt = tar.ownerDocument.createEvent("SVGEvents"); + evtt.initEvent("S_Load", false, false); + evt.currentTarget.dispatchEvent(evtt); + } + tar = evt = void 0; + }, false); + }, false); +}; +SVGStyleElement.prototype = Object._create(SVGElement); + +/*SVGPoint + *2次元座標の点(x,y)を表すオブジェクト + */ +function SVGPoint() { +}; +/*float*/SVGPoint.prototype.x = SVGPoint.prototype.y = 0; +SVGPoint.prototype.matrixTransform = function(/*SVGMatrix*/ matrix ) { + if (!isFinite(matrix.a) || !isFinite(matrix.b) || !isFinite(matrix.c) || !isFinite(matrix.d) || !isFinite(matrix.e) || !isFinite(matrix.f)) { + throw (new Error("Type Error: 引数の値がNumber型ではありません")); + } + var s = new SVGPoint(); + s.x = matrix.a * this.x + matrix.c * this.y + matrix.e; + s.y = matrix.b * this.x + matrix.d * this.y + matrix.f; + return s; +}; + +function SVGPointList() { +}; +/*SVGPointListのメソッドはSVGPathSegListを参照*/ + +/*SVGMatrix + *行列をあらわすオブジェクト。写像に用いる。以下のように表現できる + *[a c e] + *[b d f] + *[0 0 1] + */ +function SVGMatrix() { +}; +SVGMatrix.prototype = { + /*float*/ a : 1, + /*float*/ b : 0, + /*float*/ c : 0, + /*float*/ d : 1, + /*float*/ e : 0, + /*float*/ f : 0, + /*multiplyメソッド + *行列の積を求めて返す + */ + /*SVGMatrix*/ multiply : function(/*SVGMatrix*/ secondMatrix ) { + var s = new SVGMatrix(), + m = secondMatrix, + isf = isFinite, + t = this; + if (!isf(m.a) || !isf(m.b) || !isf(m.c) || !isf(m.d) || !isf(m.e) || !isf(m.f)) { + throw (new Error("Type Error: 引数の値がNumber型ではありません")); + } + s.a = t.a * m.a + t.c * m.b; + s.b = t.b * m.a + t.d * m.b; + s.c = t.a * m.c + t.c * m.d; + s.d = t.b * m.c + t.d * m.d; + s.e = t.a * m.e + t.c * m.f + t.e; + s.f = t.b * m.e + t.d * m.f + t.f; + m = t = secondMatrix = isf = void 0; + return s; + }, + /*inverseメソッド + *逆行列を返す + */ + /*SVGMatrix*/ inverse : function() { + var s = new SVGMatrix(), n = this._determinant(); + if (n !== 0) { + s.a = this.d / n; + s.b = -this.b / n; + s.c = -this.c / n; + s.d = this.a / n; + s.e = (this.c * this.f - this.d * this.e) / n; + s.f = (this.b * this.e - this.a * this.f) / n; + return s; + } else { + throw (new SVGException(/*SVGException.SVG_MATRIX_NOT_INVERTABLE*/ 2)); + } + }, + /*SVGMatrix*/ translate : function(/*float*/ x, /*float*/ y ) { + var m = new SVGMatrix(); + m.e = x; + m.f = y; + var s = this.multiply(m); + m = void 0; + return s; + }, + /*SVGMatrix*/ scale : function(/*float*/ scaleFactor ) { + var m = new SVGMatrix(); + m.a = scaleFactor; + m.d = scaleFactor; + var s = this.multiply(m); + m = void 0; + return s; + }, + /*SVGMatrix*/ scaleNonUniform : function(/*float*/ scaleFactorX, /*float*/ scaleFactorY ) { + var m = new SVGMatrix(); + m.a = scaleFactorX; + m.d = scaleFactorY; + var s = this.multiply(m); + m = void 0; + return s; + }, + /*SVGMatrix*/ rotate : function(/*float*/ angle ) { + var m = new SVGMatrix(), rad = angle / 180 * Math.PI; //ラジアン変換 + m.a = Math.cos(rad); + m.b = Math.sin(rad); + m.c = -m.b; + m.d = m.a; + var s = this.multiply(m); + m = rad = void 0; + return s; + }, + //座標(x, y)と原点の角度の分だけ、回転する + /*SVGMatrix*/ rotateFromVector : function(/*float*/ x, /*float*/ y ) { + if ((x === 0) || (y === 0) || !isFinite(x) || !isFinite(y)) { + throw (new SVGException(/*SVGException.SVG_INVALID_VALUE_ERR*/ 1)); + } + var m = new SVGMatrix(), rad = Math.atan2(y, x); + m.a = Math.cos(rad); + m.b = Math.sin(rad); + m.c = -m.b; + m.d = m.a; + var s = this.multiply(m); + m = rad = void 0; + return s; + }, + /*SVGMatrix*/ flipX : function() { + var m = new SVGMatrix(); + m.a = -m.a; + var s = this.multiply(m); + m = void 0; + return s; + }, + /*SVGMatrix*/ flipY : function() { + var m = new SVGMatrix(); + m.d = -m.d; + var s = this.multiply(m); + m = void 0; + return s; + }, + /*SVGMatrix*/ skewX : function(/*float*/ angle ){ + var m = new SVGMatrix(), rad = angle / 180 * Math.PI; //ラジアン変換 + m.c = Math.tan(rad); + var s = this.multiply(m); + m = void 0; + return s; + }, + /*SVGMatrix*/ skewY : function(/*float*/ angle ){ + var m = new SVGMatrix(), rad = angle / 180 * Math.PI; + m.b = Math.tan(rad); + var s = this.multiply(m); + m = void 0; + return s; + }, + //行列式 + /*float*/ _determinant : function() { + return (this.a * this.d - this.b * this.c); + } +}; + +function SVGTransform() { + /*readonly SVGMatrix*/ this.matrix = new SVGMatrix(); +}; + // Transform Types + /*unsigned short SVGTransform.SVG_TRANSFORM_UNKNOWN = 0; + /*unsigned short SVGTransform.SVG_TRANSFORM_MATRIX = 1; + /*unsigned short SVGTransform.SVG_TRANSFORM_TRANSLATE = 2; + /*unsigned short SVGTransform.SVG_TRANSFORM_SCALE = 3; + /*unsigned short SVGTransform.SVG_TRANSFORM_ROTATE = 4; + /*unsigned short SVGTransform.SVG_TRANSFORM_SKEWX = 5; + /*unsigned short SVGTransform.SVG_TRANSFORM_SKEWY = 6;*/ +SVGTransform.prototype = { + /*ダミーの単位行列。各メソッドで使う*/ + _matrix : (new SVGMatrix()), + /*readonly unsigned short*/ type : /*SVGTransform.SVG_TRANSFORM_UNKNOWN*/ 0, + /*readonly float*/ angle : 0, + /*void*/ setMatrix : function(/*SVGMatrix*/ matrix ) { + this.type = /*SVGTransform.SVG_TRANSFORM_MATRIX*/ 1; + this.matrix = this._matrix.multiply(matrix); + }, + /*void*/ setTranslate : function(/*float*/ tx, /*float*/ ty ) { + this.type = /*SVGTransform.SVG_TRANSFORM_TRANSLATE*/ 2; + this.matrix = this._matrix.translate(tx, ty); + }, + /*void*/ setScale : function(/*float*/ sx, /*float*/ sy ) { + this.type = /*SVGTransform.SVG_TRANSFORM_SCALE*/ 3; + this.matrix = this._matrix.scaleNonUniform(sx, sy); + }, + /*void*/ setRotate : function(/*float*/ angle, /*float*/ cx, /*float*/ cy ) { + this.angle = angle; + this.type = /*SVGTransform.SVG_TRANSFORM_ROTATE*/ 4; + this.matrix = this._matrix.rotate(angle); + this.matrix.e = (1-this.matrix.a)*cx - this.matrix.c*cy; + this.matrix.f = -this.matrix.b*cx + (1-this.matrix.d)*cy; + }, + /*void*/ setSkewX : function(/*float*/ angle ) { + this.angle = angle; + this.type = /*SVGTransform.SVG_TRANSFORM_SKEWX*/ 5; + this.matrix = this._matrix.skewX(angle); + }, + /*void*/ setSkewY : function(/*float*/ angle ) { + this.angle = angle; + this.type = /*SVGTransform.SVG_TRANSFORM_SKEWY*/ 6; + this.matrix = this._matrix.skewY(angle); + } +}; + +function SVGTransformList() { +}; +/*SVGTransformListのメソッドはSVGPathSegListを参照*/ + +/*SVGTransform*/ SVGTransformList.prototype.createSVGTransformFromMatrix = function(/*SVGMatrix*/ matrix ) { + var t = new SVGTransform(); + t.setMatrix(matrix); + return t; +}; +/*SVGTransform*/ SVGTransformList.prototype.consolidate = function() { + if(this.numberOfItems === 0) { + return null; + } else { + var s = this.getItem(0), m = s.matrix; + for (var i=1,nli=this.numberOfItems;i 0) { //コンマ区切りの文字列の場合 + strs = tsd.split(","); + for (var i = 0, sli = strs.length; i < sli; ++i) { + strs[i] = _math.ceil(+(strs[i]) / parseFloat(style.getPropertyValue("stroke-width"))); //精密ではないので注意 + } + strokedasharray = strs.join(" "); + if (strs.length % 2 === 1) { + strokedasharray += " " + strokedasharray; + } + } + strokeElement.setAttribute("dashstyle", strokedasharray); + tsd = strs = void 0; + } + el.appendChild(strokeElement); + strokeElement = tsd = void 0; + } else { + el.stroked = "false"; + } + if (el.style) { + cursor = style.getPropertyCSSValue("cursor"); + if (cursor && !cursor._isDefault) { //初期値でないならば + el.style.cursor = cursor.cssText.split(":")[1]; + } + vis = style.getPropertyCSSValue("visibility"); + if (vis && !vis._isDefault) { + el.style.visibility = vis.cssText.split(":")[1]; + } + disp = style.getPropertyCSSValue("display"); + if (disp && !disp._isDefault && (disp.cssText.indexOf("none") > -1)) { + el.style.display = "none"; + } else if (disp && !disp._isDefault && (disp.cssText.indexOf("inline-block") === -1)) { + el.style.display = "inline-block"; + } + } + tod = _doc = el = fill = stroke = sp = fp = style = cursor = tar = matrix = vis = disp = num = void 0; +}; + +function SVGPathElement(_doc) { + SVGElement.apply(this); + this._tar = _doc.createElement("v:shape"); + //interface SVGAnimatedPathData + var sp = SVGPathSegList; + /*readonly SVGPathSegList*/ this.pathSegList = new sp(); + this.animatedPathSegList = this.pathSegList; + /*readonly SVGPathSegList*/ this.normalizedPathSegList = new sp(); + sp = _doc = void 0; + this.animatedNormalizedPathSegList = this.normalizedPathSegList; + /*readonly SVGAnimatedNumber*/ this.pathLength = new SVGAnimatedNumber(); + //以下は、d属性に変更があった場合の処理 + this.addEventListener("DOMAttrModified", this._attrModi, false); + /*以下の処理は、このpath要素ノードがDOMツリーに追加されて初めて、 + *描画が開始されることを示す。つまり、appendChildで挿入されない限り、描画をしない。 + */ + this.addEventListener("DOMNodeInserted", this._nodeInsert, false); +}; +SVGPathElement.prototype = Object._create(SVGElement); +(function(_sproto) { +_sproto._attrModi = function(evt){ + var tar = evt.target; + if (evt.attrName === "d" && evt.newValue !== ""){ + /* d属性の値が空の場合は、描画を行わないようにする + * + *SVG1.1 「8.3.9 The grammar for path data」の項目にある最後の文章を参照 + */ + var tnl = tar.normalizedPathSegList, + tlist = tar.pathSegList; + if (tnl.numberOfItems > 0) { + tnl.clear(); + tlist.clear(); + } + /*d属性の値を正規表現を用いて、二次元配列Dに変換している。もし、d属性の値が"M 20 30 L20 40"ならば、 + *JSONにおける表現は以下のとおり + *D = [["M", 20, 30], ["L", 20 40]] + */ + var taco = tar._com, + sgs = taco.isSp, + dd = evt.newValue + .replace(taco.isRa, " -") + .replace(taco.isRb, " ") + .replace(taco.isRc, ",$1 ") + .replace(taco.isRd, ",$1 1") + .replace(taco.isRe, "") + .replace(/\.(\d+)\./g, ".$1 0.") + .replace(/[^\w\d\+\-\.\,\n\r\s].*/, "") + .split(","), + dli=dd.length, + isZ = taco._isZ, + isM = taco._isM, + isC = taco._isC, + isL = taco._isL, + tcc = tar.createSVGPathSegCurvetoCubicAbs, + tcll = tar.createSVGPathSegLinetoAbs, + flag, sflag; + for (var i=0;i 1 && (+flag >= 0)) { /*if no commawsp*/ + di.splice(j+3, 1, flag.charAt(0), flag.slice(1)); + ++dili; + } + sflag = di[j+4]; + if (sflag.length > 1 && (+sflag >= 0)) { + di.splice(j+4, 1, sflag.charAt(0), sflag.slice(1)); + ++dili; + } + flag = di[j+3]; + sflag = di[j+4]; + if (((+flag < 0) || (+flag > 1)) || ((+sflag < 0) || (+sflag > 1))) { + /*仕様では、フラグが0か1しか認められていない*/ + j += 6; + continue; + } + s = tar.createSVGPathSegArcAbs(+di[j+5], +di[j+6], +di[j], +di[j+1], +di[j+2], +flag, +sflag); + j += 6; + } else if (dii === "m") { + s = tar.createSVGPathSegMovetoRel(+di[j], +di[j+1]); + ++j; + } else if (dii === "l") { + s = tar.createSVGPathSegLinetoRel(+di[j], +di[j+1]); + ++j; + } else if (dii === "c") { + s = tar.createSVGPathSegCurvetoCubicRel(+di[j+4], +di[j+5], +di[j], +di[j+1], +di[j+2], +di[j+3]); + j += 5; + } else if (dii === "Q") { + s = tar.createSVGPathSegCurvetoQuadraticAbs(+di[j+2], +di[j+3], +di[j], +di[j+1]); + j += 3; + } else if (dii === "q") { + s = tar.createSVGPathSegCurvetoQuadraticRel(+di[j+2], +di[j+3], +di[j], +di[j+1]); + j += 3; + } else if (dii === "a") { + flag = di[j+3]; + if (flag.length > 1 && (+flag >= 0)) { /*if no commawsp*/ + di.splice(j+3, 1, flag.charAt(0), flag.slice(1)); + ++dili; + } + sflag = di[j+4]; + if (sflag.length > 1 && (+sflag >= 0)) { + di.splice(j+4, 1, sflag.charAt(0), sflag.slice(1)); + ++dili; + } + flag = di[j+3]; + sflag = di[j+4]; + if (((+flag < 0) || (+flag > 1)) || ((+sflag < 0) || (+sflag > 1))) { + /*仕様では、フラグが0か1しか認められていない*/ + j += 6; + continue; + } + s = tar.createSVGPathSegArcRel(+di[j+5], +di[j+6], +di[j], +di[j+1], +di[j+2], +flag, +sflag); + j += 6; + } else if (dii === "S") { + s = tar.createSVGPathSegCurvetoCubicSmoothAbs(+di[j+2], +di[j+3], +di[j], +di[j+1]); + j += 3; + } else if (dii === "s") { + s = tar.createSVGPathSegCurvetoCubicSmoothRel(+di[j+2], +di[j+3], +di[j], +di[j+1]); + j += 3; + } else if (dii === "T") { + s = tar.createSVGPathSegCurvetoQuadraticSmoothAbs(+di[j], +di[j+1]); + ++j; + } else if (dii === "t") { + s = tar.createSVGPathSegCurvetoQuadraticSmoothRel(+di[j], +di[j+1]); + ++j; + } else if (dii === "H") { + s = tar.createSVGPathSegLinetoHorizontalAbs(+di[j]); + } else if (dii === "h") { + s = tar.createSVGPathSegLinetoHorizontalRel(+di[j]); + } else if (dii === "V") { + s = tar.createSVGPathSegLinetoVerticalAbs(+di[j]); + } else if (dii === "v") { + s = tar.createSVGPathSegLinetoVerticalRel(+di[j]); + } else { + s = new SVGPathSeg(); + } + tlist.appendItem(s); + } + } + di = s = sgs = dd = void 0; + /*以下の処理は、pathSegListからnormalizedPathSegListへの + *変換をする処理。相対座標を絶対座標に変換して、M、L、Cコマンドに正規化していく + */ + var cx = 0, cy = 0, //現在セグメントの終了点の絶対座標を示す (相対座標を絶対座標に変換するときに使用) + xn = 0, yn = 0, //T,tコマンドで仮想的な座標を算出するのに用いる。第一コントロール点 + startx = 0, starty = 0; //M,mコマンドにおける始点座標(Z,zコマンドで用いる) + for (var j=0, tli=tlist.numberOfItems;j 1) { + r1 = _math.sqrt(lamda) * r1; + r2 = _math.sqrt(lamda) * r2; + sds = 0; + } else{ + var seif = 1; + if (ti.largeArcFlag === fS) { + seif = -1; + } + sds = seif * _math.sqrt((r1x*r2y - r1x*rydd - r2y*rxdd) / (r1x*rydd + r2y*rxdd)); + } + var txd = sds*r1*ryd / r2, + tyd = -1 * sds*r2*rxd / r1, + tx = cpsi*txd - spsi*tyd + (rx+cx)/2, + ty = spsi*txd + cpsi*tyd + (ry+cy)/2, + rad = _math.atan2((ryd-tyd)/r2, (rxd-txd)/r1) - _math.atan2(0, 1), + s1 = (rad >= 0) ? rad : 2 * _math.PI + rad, + rad = _math.atan2((-ryd-tyd)/r2, (-rxd-txd)/r1) - _math.atan2((ryd-tyd)/r2, (rxd-txd)/r1), + dr = (rad >= 0) ? rad : 2 * _math.PI + rad; + if (!fS && dr > 0) { + dr -= 2*_math.PI; + } else if (fS && dr < 0) { + dr += 2*_math.PI; + } + var sse = dr * 2 / _math.PI, + seg = _math.ceil(sse<0 ? -1*sse : sse), + segr = dr / seg, + t = 8/3 * _math.sin(segr/4) * _math.sin(segr/4) / _math.sin(segr/2), + cpsir1 = cpsi * r1, cpsir2 = cpsi * r2, + spsir1 = spsi * r1, spsir2 = spsi * r2, + mc = _math.cos(s1), + ms = _math.sin(s1), + x2 = rx - t * (cpsir1*ms + spsir2*mc), + y2 = ry - t * (spsir1*ms - cpsir2*mc); + for (var n = 0; n < seg; ++n) { + s1 += segr; + mc = _math.cos(s1); + ms = _math.sin(s1); + var x3 = cpsir1*mc - spsir2*ms + tx, + y3 = spsir1*mc + cpsir2*ms + ty, + dx = -t * (cpsir1*ms + spsir2*mc), + dy = -t * (spsir1*ms - cpsir2*mc); + tnl.appendItem(tcc(x3, y3, x2, y2, x3-dx, y3-dy)); + x2 = x3 + dx; + y2 = y3 + dy; + } + ti= cx= cy= rx= ry= tar= tnl = void 0; + })(ti, cx, cy, rx, ry, tar, tnl); + } else if (dii === "S") { + if (j !== 0) { + var tg = tnl.getItem(tnl.numberOfItems-1); + if (tg.pathSegTypeAsLetter === "C") { + var x1 = 2*tg.x - tg.x2, + y1 = 2*tg.y - tg.y2; + } else { //前のコマンドがCでなければ、現在の座標を第1コントロール点に用いる + var x1 = rx, + y1 = ry; + } + } else { + var x1 = rx, + y1 = ry; + } + tnl.appendItem(tcc(cx, cy, x1, y1, ti.x2, ti.y2)); + x1 = y1 = void 0; + } else if (dii === "s") { + if (j !== 0) { + var tg = tnl.getItem(tnl.numberOfItems-1); + if (tg.pathSegTypeAsLetter === "C") { + var x1 = 2*tg.x - tg.x2, + y1 = 2*tg.y - tg.y2; + } else { + var x1 = rx, + y1 = ry; + } + } else { + var x1 = rx, + y1 = ry; + } + tnl.appendItem(tcc(cx, cy, x1, y1, ti.x2+rx, ti.y2+ry)); + x1 = y1 = void 0; + } else if (dii === "T" || dii === "t") { + if (j !== 0) { + var tg = tlist.getItem(j-1); + if ("QqTt".indexOf(tg.pathSegTypeAsLetter) > -1) { + } else { + xn = rx, yn = ry; + } + } else { + xn = rx, yn = ry; + } + tnl.appendItem(tcc(cx, cy, (rx + 2*xn) / 3, (ry + 2*yn) / 3, (2*xn + cx) / 3, (2*yn + cy) / 3)); + xn = 2*cx - xn; + yn = 2*cy - yn; + xx1 = yy1 = void 0; + } else if (dii === "H" || dii === "h") { + tnl.appendItem(tcll(cx, ry)); + cy = ry; //勝手にti.yが0としているため + } else if (dii === "V" || dii === "v") { + tnl.appendItem(tcll(rx, cy)); + cx = rx; + } + } + } + } + evt = tar = taco = cx = cy = xn = yn = startx = starty = tnl = tlist = ti = dii = ts = isZ = isM = isL = isC = s = tcc = tcll = void 0; +}; +_sproto._nodeInsert = function(evt){ + var tar = evt.target; + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + var tnext = tar.nextSibling, + tpart = tar.parentNode._tar, + isLast = true; + if (tnext && tnext._tar && tpart && (tnext._tar.parentNode === tpart)) { + tpart.insertBefore(tar._tar, tnext._tar); + } else if (tnext && !tnext._tar && tpart) { + /*以下の処理は、_tarプロパティがない要素オブジェクトがあるため、それに対処するもの + *use要素や実体参照などは_tarプロパティがないことに注意 + */ + while (tnext) { + if (tnext._tar && (tnext._tar.parentNode === tpart)) { + tpart.insertBefore(tar._tar, tnext._tar); + isLast = false; + } + tnext = tnext.nextSibling; + } + if (isLast) { + tpart.appendChild(tar._tar); + } + } else if (!tnext && tpart) { + tpart.appendChild(tar._tar); + } + tnext = tpart = isLast = void 0; + tar.addEventListener("DOMNodeInsertedIntoDocument", tar._nodeInsertInto, false); + evt = tar = void 0; +}; +_sproto._nodeInsertInto = function(evt){ + /*以下の処理は、normalizedpathSegListとCTMに基づいて、 + *SVGのd属性をVMLに変換していく処理である。 + */ + var tar = evt.target, + matrix = tar.getScreenCTM(), + tlist = tar.normalizedPathSegList, + dat = [], + ma = matrix.a, mb = matrix.b, mc = matrix.c, md = matrix.d, me = matrix.e, mf = matrix.f, + cname = tar._com._nameCom, + isZ = tar._com._isZ, isC = tar._com._isC, + mr = _math.round; + for (var i=0, tli=tlist.numberOfItems;i twidth / 2) { + thrx.value = twidth / 2; + } + if (thry.value > theight / 2) { + thry.value = theight / 2; + } + var rxv = thrx.value, + ryv = thry.value, + rrx = rxv * 0.55228, + rry = ryv * 0.55228, + a = xw - rxv, + b = x + rxv, + c = y + ryv, + d = yh - ryv; + list = ["m",b,y, "l",a,y, "c",a+rrx,y,xw,c-rry,xw,c, "l",xw,d, "c",xw,d+rry,a+rrx,yh,a,yh, "l",b,yh, "c",b-rrx,yh,x,d+rry,x,d, "l",x,c, "c",x,c-rry,b-rrx,y,b,y]; + } else { + list = ["m",x,y, "l",x,yh, xw,yh, xw,y, "x e"]; + } + //以下は、配列listそのものをCTMで座標変換していく処理 + var par = tar.ownerDocument.documentElement, + ctm = tar.getScreenCTM(), + dat, p, pmt, + ele = tar._tar, + vi = tar.ownerDocument.documentElement, + w = vi.width.baseVal.value, + h = vi.height.baseVal.value, + mr = Math.round; + for (var i=0, lili=list.length;i 0)) { + /*何も設定されていない場合のみ、初期化を行う*/ + l.newValueSpecifiedUnits(/*SVGLength.SVG_LENGTHTYPE_NUMBER*/ 1, this.getSubStringLength(0, this.getNumberOfChars())); + } + l = void 0; + return (this.textLength.baseVal.value); +}; +/*getSubStringLengthメソッド + *charnum番目の文字からnchars+charnum-1番目までの文字列の長さを求めて返す + */ +/*float*/ t.prototype.getSubStringLength = function(/*unsigned long*/ charnum, /*unsigned long*/ nchars ) { + if (nchars === 0) { + return 0; + } + var tg = this.getNumberOfChars(); + if (tg < (nchars+charnum)) { + /*ncharsが文字列の長さよりも長くなってしまったときには、 + *文字列の末端までの長さを求めるとする(SVG1.1の仕様より) + */ + nchars = tg - charnum + 1; + } + var end = this.getEndPositionOfChar(nchars+charnum-1), st = this.getStartPositionOfChar(charnum); + if (this._isYokogaki) { + var s = end.x - st.x; + } else { + var s = end.y - st.y; + } + tg = end = st = void 0; + return s; +}; +/*SVGPoint*/ t.prototype.getStartPositionOfChar = function (/*unsigned long*/ charnum ) { + if (charnum > this.getNumberOfChars() || charnum < 0) { + throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); + } else { + var tar = this, + ti = tar.firstChild, + tp = tar.parentNode; + if (!!!tar._list) { + tar._list = []; + var chars = tar._chars, //現在、何文字目にあるのか + x = tar._stx, y = tar._sty, n = 0, //現在のテキスト位置と順番 + style = tar.ownerDocument.defaultView.getComputedStyle(tar, null), + isYokogaki = ((style.getPropertyValue("writing-mode")) === "lr-tb") ? true : false, + fontSize = parseFloat(style.getPropertyValue("font-size")), + tx = tar.x.baseVal, ty = tar.y.baseVal, tdx = tar.dx.baseVal, tdy = tar.dy.baseVal; + /*親要素の属性も参照しておく*/ + if (tp && ((tp.localName === "text") ||(tp.localName === "tspan"))) { + var ptx = tp.x.baseVal, + pty = tp.y.baseVal, + ptdx = tp.dx.baseVal, + ptdy = tp.dy.baseVal; + } else { + var ptx = pty = ptdx = ptdy = {numberOfItems : 0}; + } + var kern = "f ijltIr.,:;'-\"()", + akern = "1234567890abcdeghknopquvxyz", + tt, alm, tdc, tcca, p, almx, almy, tlist, tg; + if (isYokogaki && (tar.localName === "text")) { + y += fontSize * 0.2; + } else if (tar.localName === "text"){ + x -= fontSize * 0.5; + } + while (ti) { + if (ti.nodeType === /*Node.TEXT_NODE*/ 3) { + tt = ti._tars; + /*tspan(tref)要素のx属性で指定された座標の個数よりも、文字数が多い場合は、祖先(親)のx属性を + *使う。また、属性が指定されていないときも同様に祖先や親を使う。 + *もし、仮に祖先や親がx属性を指定されていなければ、現在のテキスト位置(変数xに格納している)を使う。 + *この処理はdx属性やdy、y属性でも同様とする + *参照資料SVG1.1 Text + *http://www.hcn.zaq.ne.jp/___/REC-SVG11-20030114/text.html + * + *注意:ここでは、tspan要素だけではなく、text要素にも適用しているが、本来はtspan要素のみに処理させること + */ + for (var i=0, tli=tt.length;i -1) { + alm = fontSize * 0.68; + } else if (tdc === "s"){ + alm = fontSize * 0.52; + } else if ((tdc === "C") || (tdc === "D") || (tdc === "M") || (tdc === "W") || (tdc === "G") || (tdc === "m")){ + alm = fontSize * 0.2; + } else if (akern.indexOf(tdc) > -1){ + alm = fontSize * 0.45; + } else { + alm = fontSize * 0.3; + } + tcca = tdc.charCodeAt(0); + if ((12288 <= tcca) && (tcca <= 65533)) { + alm = -fontSize * 0.01; + if ((tdc === "う") || (tdc === "く") || (tdc === "し") || (tdc === "ち")) { + alm += fontSize * 0.2; + } + } + } + tlist = tar._list; + tlist[tlist.length] = x; + tlist[tlist.length] = y; + tlist[tlist.length] = fontSize - alm; + if (isYokogaki) { + x += fontSize; + x -= alm; + } else { + y += fontSize; + } + ++n; + } + chars += tli; + if (ti.parentNode && (ti.parentNode.localName === "a")) { //a要素が親である場合は、tiを親に戻しておく + ti = ti.parentNode; + } + ti = ti.nextSibling; + } else if (((ti.localName === "tspan") || (ti.localName === "tref")) + && (ti.namespaceURI === "http://www.w3.org/2000/svg") && ti.firstChild) { + /*現在のテキスト位置(x,y)の分だけ、tspan (tref)要素をずらしておく。 + *さらに、現在のテキスト位置を更新する + */ + ti._stx = x; + ti._sty = y; + ti._chars = chars; + p = ti.getStartPositionOfChar(ti.getNumberOfChars()); + almx = 0; + almy = 0; + tlist = ti._list; + if (isYokogaki) { + almx = tlist[tlist.length-1]; + } else { + almy = tlist[tlist.length-1]; + } + x = tlist[tlist.length-3] + almx; + y = tlist[tlist.length-2] + almy; + tar._list = tar._list.concat(tlist); + tg = ti.getNumberOfChars(); + n += tg; + chars += tg; + ti = ti.nextSibling; + } else if ((ti.localName === "a") && (ti.namespaceURI === "http://www.w3.org/2000/svg") && ti.firstChild) { + /*a要素のテキストノードも処理する*/ + ti = ti.firstChild; + } else { + ti = ti.nextSibling; + } + } + tar._isYokogaki = isYokogaki; //getEndPositionOfCharメソッドなどで使う + } + tar = ti = tp = ptx = pty = tx = ty = chars = style = x = y = isYokogaki = kern = akern = tt = alm = tdc = tcca = p = almx = almy = tlist = tg = void 0; + var s = this.ownerDocument.documentElement.createSVGPoint(); + s.x = this._list[charnum*3]; + s.y = this._list[charnum*3 + 1]; + s = s.matrixTransform(this.getScreenCTM()); + return s; + } +}; +/*SVGPoint*/ t.prototype.getEndPositionOfChar = function(/*unsigned long*/ charnum ) { + if (charnum > this.getNumberOfChars() || charnum < 0) { + throw (new DOMException(/*DOMException.INDEX_SIZE_ERR*/ 1)); + } else { + var s = this.getStartPositionOfChar(charnum); + //アドバンス値(すなわちフォントの大きさ)をCTMの行列式を用いて、算出する + var n = this._list[charnum*3 + 2] * Math.sqrt(Math.abs(this.getScreenCTM()._determinant())); + if (this._isYokogaki) { + s.x += n; + } else { + s.y += n; + } + return s; + } +}; +/*SVGRect*/ t.prototype.getExtentOfChar = function(/*unsigned long*/ charnum ) { + +}; +/*float*/ t.prototype.getRotationOfChar = function(/*unsigned long*/ charnum ) { + +}; +/*long*/ t.prototype.getCharNumAtPosition = function(/*SVGPoint*/ point ) { + +}; +/*void*/ t.prototype.selectSubString = function(/*unsigned long*/ charnum,/*unsigned long*/ nchars ) { + +}; +})(SVGTextContentElement); + +function SVGTextPositioningElement(_doc) { + SVGTextContentElement.apply(this, arguments); + var sl = SVGAnimatedLengthList; + /*readonly SVGAnimatedLengthList*/ this.x = new sl(); + /*readonly SVGAnimatedLengthList*/ this.y = new sl(); + /*readonly SVGAnimatedLengthList*/ this.dx = new sl(); + /*readonly SVGAnimatedLengthList*/ this.dy = new sl(); + sl = void 0; + /*readonly SVGAnimatedNumberList*/ this.rotate = new SVGAnimatedNumberList(); + this.addEventListener("DOMAttrModified", function(evt){ + var tar = evt.target, + name = evt.attrName, + tod = tar.ownerDocument.documentElement, + _parseFloat = parseFloat; + if ((name === "x") || (name === "y") || (name === "dx") || (name === "dy")) { + var enr = evt.newValue.replace(/^\s+|\s+$/g, "").split(/[\s,]+/), + teas = tar[name].baseVal; + for (var i=0, tli=enr.length;i= "0" && n <= "9") { + type = /*SVGLength.SVG_LENGTHTYPE_NUMBER*/ 1; + } else if (n === "%") { + if ((name === "x") || (name === "dx")) { + tea._percent *= tod.viewport.width; + } else if ((name === "y") || (name === "dy")) { + tea._percent *= tod.viewport.height; + } + type = /*SVGLength.SVG_LENGTHTYPE_PERCENTAGE*/ 2; + } else { + n = enr[i].slice(-2); + if (n === "em") { + var style = tar.ownerDocument.defaultView.getComputedStyle(tar, null); + tea._percent *= _parseFloat(style.getPropertyValue("font-size")); + style = void 0; + type = /*SVGLength.SVG_LENGTHTYPE_EMS*/ 3; + } else if (n === "ex") { + type = /*SVGLength.SVG_LENGTHTYPE_EXS*/ 4; + } else if (n === "px") { + type = /*SVGLength.SVG_LENGTHTYPE_PX*/ 5; + } else if (n === "cm") { + type = /*SVGLength.SVG_LENGTHTYPE_CM*/ 6; + } else if (n === "mm") { + type = /*SVGLength.SVG_LENGTHTYPE_MM*/ 7; + } else if (n === "in") { + type = /*SVGLength.SVG_LENGTHTYPE_IN*/ 8; + } else if (n === "pt") { + type = /*SVGLength.SVG_LENGTHTYPE_PT*/ 9; + } else if (n === "pc") { + type = /*SVGLength.SVG_LENGTHTYPE_PC*/ 10; + } + } + var s = _parseFloat(enr[i]); + s = isNaN(s) ? 0 : s; + tea.newValueSpecifiedUnits(type, s); + teas.appendItem(tea); + } + tar._list = null; + } + evt = tar = void 0; + }, false); + this.addEventListener("DOMNodeInserted", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + var tar = evt.target; + if (tar.nodeType !== /*Node.TEXT_NODE*/ 3) { + tar._list = void 0; + evt.currentTarget._list = null; + } + evt = tar = void 0; + } + }, false); + if (_doc) { + this._tar = _doc.createElement("v:group"); + this._doc = _doc; //_docプロパティは_texto関数内で使われる + } + this.addEventListener("DOMNodeInserted", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + var tar = evt.target, + tnext = tar.nextSibling, + tpart = tar.parentNode._tar, + isLast = true; + if (tnext && tnext._tar && tpart && (tnext._tar.parentNode === tpart)) { + tpart.insertBefore(tar._tar, tnext._tar); + } else if (tnext && !tnext._tar && tpart) { + /*以下の処理は、_tarプロパティがない要素オブジェクトがあるため、それに対処するもの + *use要素や実体参照などは_tarプロパティがないことに注意 + */ + while (tnext) { + if (tnext._tar && (tnext._tar.parentNode === tpart)) { + tpart.insertBefore(tar._tar, tnext._tar); + isLast = false; + } + tnext = tnext.nextSibling; + } + if (isLast) { + tpart.appendChild(tar._tar); + } + } else if (!tnext && tpart) { + tpart.appendChild(tar._tar); + } + tnext = tpart = isLast = void 0; + tar.addEventListener("DOMNodeInsertedIntoDocument", tar._texto, false); + evt = tar = void 0; + },false); +}; +SVGTextPositioningElement.prototype = Object._create(SVGTextContentElement); +SVGTextPositioningElement.prototype._texto = function(evt) { + var tar = evt.target, + ti = tar.firstChild, + ttp = tar._tar, + style = tar.ownerDocument.defaultView.getComputedStyle(tar, null), + deter = Math.sqrt(Math.abs(tar.getScreenCTM()._determinant())), + n = parseFloat(style.getPropertyValue("font-size")) * deter, + tod = tar.ownerDocument.documentElement, + ttpc = ttp, //ttpcはttpのキャッシュ + tlen = tar.getComputedTextLength(), + anchor = style.getPropertyValue("text-anchor"), + tedeco = style.getPropertyValue("text-decoration"), //text-decorationは継承しないので、個々に設定する + ttps = ttp.style, + ae = [], + lts = parseFloat(style.getPropertyValue("letter-spacing")), + wds = parseFloat(style.getPropertyValue("word-spacing")); + ttps.fontSize = n + "px"; //nは算出された文字の大きさ (CSSではなく、SVG独自のCTM方式による) + ttps.fontFamily = style.getPropertyValue("font-family"); + ttps.fontStyle = style.getPropertyValue("font-style"); + ttps.fontWeight = style.getPropertyValue("font-weight"); + if (isFinite(lts)) { + ttps.letterSpacing = lts * deter + "px"; + } + if (isFinite(parseFloat(wds))) { + ttps.wordSpacing = wds * deter + "px"; + } + /*ここでの変数jは前回ノードまでの総文字数*/ + for (var i=0, j=0, tli=tar.getNumberOfChars();i j) ? i - j : j - i; + var sty = ti._tars[ij].style, + p = tar.getStartPositionOfChar(i); + sty.position = "absolute"; + if (tar._isYokogaki) { + if (anchor === "middle") { + p.x -= tlen / 2; + } else if (anchor === "end") { + p.x -= tlen; + } + } else { + if (anchor === "middle") { + p.y -= tlen / 2; + } else if (anchor === "end") { + p.y -= tlen; + } + } + sty.left = p.x + "px"; + sty.top = p.y + "px"; + sty.width = "0px"; + sty.height = "0px"; + sty.marginTop = tar._isYokogaki ? -n-5+ "px" : "-5px"; + sty.lineHeight = n+10+ "px"; + sty.textDecoration = tedeco; + sty.display = "none"; + ttp.appendChild(ti._tars[ij]); + sty = p = void 0; + } + if (ti.nodeName === "#text") { + if ((ti.data.length+j) <= i+1) { //テキストノード内の文字をすべて処理し終えれば + j = j + ti.data.length; + if (ti.data === "") { + /*空文字列の場合、文字数をカウントせず、iを減らしておく*/ + --i; + } + if (ti.parentNode.localName === "a") { + ti = ti.parentNode; + ttp = ttpc; + } + ti = ti.nextSibling; + } + } else if (!!ti.getNumberOfChars) { + if ((ti.getNumberOfChars()+j) <= i+1) { + j = j + ti.getNumberOfChars(); + ti = ti.nextSibling; + } + } else if ((ti.localName === "a") && (ti.namespaceURI === "http://www.w3.org/2000/svg") && ti.firstChild) { + ttp = ti._tar; + ti = ti.firstChild; + ae[ae.length] = ti; + if (i === 0) { + --i; + } else { + /*前にテキストノードがある場合など、iが0以上であれば、カウントを前回のテキストノードまでリセットしておく*/ + i-=2; + } + } + } + } + var color = style.getPropertyValue("fill"), + cursor = style.getPropertyCSSValue("cursor"), + vis = style.getPropertyCSSValue("visibility"), + disp = style.getPropertyCSSValue("display"), + tts = tar._tar.style, + tft = tar.firstChild._tars, //空白のテキストノードの場合、tftがundefinedになる恐れがある + ttt = tft[0] ? tft[0].innerText.charAt(0) : [""], //あらかじめ初期化しておく + tfti; + if (color === "none"){ + tts.color = "transparent"; + } else if (color.indexOf("url") === -1) { + tts.color = color; + } else { + tts.color = "black"; + } + if (cursor && !cursor._isDefault) { //初期値でないならば + var tc = cursor.cssText; + tts.cursor = tc.split(":")[1]; + tc = void 0; + } + if ((tar.x.baseVal.numberOfItems === 1) && (tar.y.baseVal.numberOfItems === 1) + && tar._isYokogaki && (tar.firstChild.nodeName === "#text")) { + /*xとy属性が一つの値しか取らないとき、字詰めの処理をすべてブラウザに任せておく。 + *以下では、他のdiv要素のテキストをすべて、最初のdiv要素にまとめている + */ + for (var i=1, tli=tft.length;i -1)) { + di = "none"; + } else if (disp && !disp._isDefault) { + di = "block"; + } + var jt = tar._tar.firstChild, + j = 0; + while (jt) { + jt.style.display = di; + jt = jt.nextSibling; + } + while (ae[j]) { //要素内部にあるa要素の処理 + for (var l=0, tli=ae[j]._tars.length;l 102 && !uri)) { + throw new SVGException(/*SVGException.SVG_INVALID_VALUE_ERR*/ 1); + } + this.uri = uri; + this.paintType = paintType; + if (paintType === /*SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR*/ 102) { + paintType = /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3; + } + this.setColor(paintType, rgbColor, iccColor); //SVGColorのsetColorメソッドを用いる +}; +// raises( SVGException ); +t = void 0; +})(SVGPaint); + +function SVGMarkerElement(){ + SVGSVGElement.apply(this, [{createElement:function(){}}]); + this._tar = {style:{}}; //getScreenCTMメソッド対策 + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.refX = new sl(); + /*readonly SVGAnimatedLength*/ this.refY = new sl(); + /*readonly SVGAnimatedEnumeration*/ this.markerUnits = new SVGAnimatedEnumeration(); + this.markerUnits.baseVal = /*SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH*/ 2; + /*readonly SVGAnimatedLength*/ this.markerWidth = new sl(); + /*readonly SVGAnimatedLength*/ this.markerHeight = new sl(); + this.refX.baseVal.newValueSpecifiedUnits(1, 0); + this.refY.baseVal.newValueSpecifiedUnits(1, 0); + this.markerWidth.baseVal.newValueSpecifiedUnits(1, 3); + this.markerHeight.baseVal.newValueSpecifiedUnits(1, 3); + sl = void 0; + /*readonly SVGAnimatedEnumeration*/ this.orientType = new SVGAnimatedEnumeration(); + this.orientType.baseVal = /*SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE*/ 2; + /*readonly SVGAnimatedAngle*/ this.orientAngle = new SVGAnimatedAngle(); + //SVGFitToViewBoxのインターフェースはSVGSVGElementで代用 + this.addEventListener("DOMAttrModified", function(evt) { + var tar = evt.target, + en = evt.newValue, + angle; + if (evt.attrName === "orient") { + if (en === "auto") { + tar.setOrientToAuto(); + } else { + angle = tar.ownerDocument.documentElement.createSVGAngle(); + angle.newValueSpecifiedUnits(1, +en); + tar.setOrientToAngle(angle); + } + } else if (evt.attrName === "markerUnits") { + if (en === "strokeWidth") { + tar.markerUnits.baseVal = /*SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH*/ 2; + } else { + tar.markerUnits.baseVal = /*SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE*/ 1; + } + } + }, false); + this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { + /*注意: グローバル関数を書き換えているので注意を要する*/ + var ns = NAIBU._setPaint, + id = evt.target.getAttributeNS(null, "id"); + NAIBU._setPaint = (function(ns, id) { + return function(tar, ctm) { + ns(tar, ctm); + var td = tar.ownerDocument, + tde = td.documentElement, + style = td.defaultView.getComputedStyle(tar, ""), + ms = style.getPropertyValue("marker-start").slice(5, -1), + me = style.getPropertyValue("marker-end").slice(5, -1), + mid = style.getPropertyValue("marker-mid").slice(5, -1), + marker, + cmarker, + gmarker, + tr, + tn, + ttr, + sth, + ctm, + sstyle, + nstyle, + plist, + regAZ, + regm, + u, t, + lf = function (x, y) { + cmarker = marker.cloneNode(true); + gmarker = td.createElementNS("http://www.w3.org/2000/svg", "g"); + /*marker要素の子要素はすべて、g要素としてまとめておく*/ + while (cmarker.lastChild) { + gmarker.appendChild(cmarker.lastChild); + } + tr = gmarker.transform.baseVal; + ttr = tar.transform.baseVal.consolidate() || td.documentElement.createSVGMatrix(); + if (marker.markerUnits.baseVal === /*SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH*/ 2) { + sth = +style.getPropertyValue("stroke-width"); + } else { + /*参照要素の行列の積を適用*/ + sth = 1; + } + if (marker.hasAttributeNS(null, "viewBox")) { + marker.viewport.width = marker.markerWidth.baseVal.value; + marker.viewport.height = marker.markerHeight.baseVal.value; + /*applyを使って、marker要素のCTMを算出*/ + ctm = tde.getScreenCTM.apply(marker); + } else { + ctm = tde.createSVGMatrix(); + } + if (marker.orientType.baseVal === /*SVGMarkerElement.SVG_MARKER_ORIENT_AUTO*/ 1) { + angle = Math.atan2(plist[1].y-plist[0].y, plist[1].x-plist[0].x)*180/Math.PI; + } else { + angle = marker.orientAngle.baseVal.value; + } + tr.appendItem(tr.createSVGTransformFromMatrix(ttr.translate(x, y) + .rotate(angle) + .scale(sth) + .multiply(ctm) + .translate(-marker.refX.baseVal.value, -marker.refY.baseVal.value))); + sstyle = td.defaultView.getComputedStyle(marker, ""); + nstyle = gmarker.style; + regAZ = /([A-Z])/; + regm = /\-/; + for (var i in CSS2Properties) { + if (CSS2Properties.hasOwnProperty(i) && (i !== "_list")) { + i = i.replace(regAZ, "-"); + if (RegExp.$1) { + u = "-" +RegExp.$1.toLowerCase(); + } else { + u = "-"; + } + i = i.replace(regm, u); + nstyle.setProperty(i, sstyle.getPropertyValue(i), ""); + } + } + tar.parentNode.insertBefore(gmarker, tar.nextSibling); + }; + /*url(#id)で一致する文字列があるかどうか*/ + if (ms === id) { + marker = td.getElementById(ms); + if (tar.normalizedPathSegList || tar.points) { + tn = tar.normalizedPathSegList || tar.points; + plist = [tn.getItem(0), tn.getItem(1)]; + } else if (tar.x1) { + plist = [{x:tar.x1, y:tar.y1}, {x:tar.x2, y:tar.y2}]; + } + lf(plist[0].x, plist[0].y); + } + if (me === id) { + marker = td.getElementById(me); + if (tar.normalizedPathSegList || tar.points) { + tn = tar.normalizedPathSegList || tar.points; + plist = [tn.getItem(tn.numberOfItems-2), tn.getItem(tn.numberOfItems-1)]; + } else if (tar.x1) { + plist = [{x:tar.x1, y:tar.y1}, {x:tar.x2, y:tar.y2}]; + } + lf(plist[1].x, plist[1].y); + } + if (mid === id) { + marker = td.getElementById(mid); + } + td = tde = style = sstyle = nstyle = ms = me = mid = marker = cmarker = gmarker = ctm = sth = tr = tn = ttr = plist = regAZ = regm = u = t = lf = void 0; + }; + })(ns, id); + }, false); +}; +(function(t){ + // Marker Unit Types + /*unsigned short t.SVG_MARKERUNITS_UNKNOWN = 0; + /*unsigned short t.SVG_MARKERUNITS_USERSPACEONUSE = 1; + /*unsigned short t.SVG_MARKERUNITS_STROKEWIDTH = 2; + // Marker Orientation Types + /*unsigned short t.SVG_MARKER_ORIENT_UNKNOWN = 0; + /*unsigned short t.SVG_MARKER_ORIENT_AUTO = 1; + /*unsigned short t.SVG_MARKER_ORIENT_ANGLE = 2;*/ + t.prototype = Object._create(SVGSVGElement); + t.prototype.getScreenCTM = SVGElement.prototype.getScreenCTM; + /*void*/ t.prototype.setOrientToAuto = function() { + this.orientType.baseVal = /*t.SVG_MARKER_ORIENT_AUTO*/ 1; +}; +/*void*/ t.prototype.setOrientToAngle = function(/*SVGAngle*/ angle ) { + this.orientType.baseVal = /*t.SVG_MARKER_ORIENT_ANGLE*/ 2; + this.orientAngle.baseVal = angle; + +}; +})(SVGMarkerElement); +function SVGColorProfileElement() { + SVGElement.apply(this); + /*DOMString*/ this._local; + // raises DOMException on setting + // (NOTE: is prefixed by "_" + // as "local" is an IDL keyword. The + // prefix will be removed upon processing) + /*DOMString*/ this.name; + /*unsigned short*/ this.renderingIntent; + SVGURIReference.apply(this); +}; +SVGColorProfileElement.prototype = Object._create(SVGElement); + +function SVGColorProfileRule() { + SVGCSSRule.apply(this); + /*DOMString*/ this.src; + /*DOMString*/ this.name; + /*unsigned short*/ this.renderingIntent; +}; +SVGColorProfileRule.prototype = Object._create(SVGCSSRule); + +function SVGGradientElement() { + SVGElement.apply(this); + SVGURIReference.apply(this); + /*readonly SVGAnimatedEnumeration*/ this.gradientUnits = new SVGAnimatedEnumeration(); + /*readonly SVGAnimatedTransformList*/ this.gradientTransform = new SVGAnimatedTransformList(); + /*readonly SVGAnimatedEnumeration*/ this.spreadMethod = new SVGAnimatedEnumeration(); + this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { + var grad = evt.target, + ele = evt._tar, + t = evt._style, //eleはv:fill要素やv:stroke要素のノード、tはラップした要素ノードのスタイルを収納 + grad2 = grad, + href, stops, length, + color = [], + colors = [], + opacity = [], + stop, sstyle, ci; + if (!ele || !grad) { //まだ、path要素などが設定されていない場合 + grad = ele = t = grad2 = href = stops = length = color = colors = opacity = void 0; + return; + } + if (grad._instance) { //xlink言語で呼び出されたノードが_instanceに収納されているならば + grad2 = grad._instance; + } + stops = grad2.getElementsByTagNameNS("http://www.w3.org/2000/svg", "stop"); + if (!stops) { + ele = t = href = grad = grad2 = stops = color = colors = opacity = void 0; + return; + } + length = stops.length; + for (var i = 0; i < length; ++i) { + stop = stops[i]; + sstyle = stop.ownerDocument.defaultView.getComputedStyle(stop, ""); + ci = sstyle.getPropertyCSSValue("stop-color"); + if (ci && (ci.colorType === /*SVGColor.SVG_COLORTYPE_CURRENTCOLOR*/ 3)) { + /*再度、設定。css.jsのsetPropertyを参照*/ + sstyle.setProperty("color", sstyle.getPropertyValue("color")); + } + color[i] = "rgb(" +ci.rgbColor.red.getFloatValue(1)+ "," +ci.rgbColor.green.getFloatValue(1)+ "," +ci.rgbColor.blue.getFloatValue(1)+ ")"; + colors[i] = stop.offset.baseVal + " " + color[i]; + opacity[i] = (sstyle.getPropertyValue("stop-opacity") || 1) * t.getPropertyValue("fill-opacity") * t.getPropertyValue("opacity"); + } + ele["method"] = "none"; + ele["color"] = color[0]; + ele["color2"] = color[length-1]; + ele["colors"] = colors.join(","); + // When colors attribute is used, the meanings of opacity and o:opacity2 are reversed. + ele["opacity"] = opacity[length-1]+ ""; + ele["o:opacity2"] = opacity[0]+ ""; + /*SVGRadialGradientElementインターフェースで利用する*/ + grad._color = color; + var gt = grad2.getAttributeNS(null, "gradientTransform"); + if (gt) { + grad.setAttributeNS(null, "transform", gt); + } + grad = grad2 = ele = stops = length = color = colors = opacity = evt = t = href = stop = sstyle = ci = void 0; + }, false); +}; +SVGGradientElement.prototype = Object._create(SVGElement); + // Spread Method Types + /*unsigned short SVGGradientElement.SVG_SPREADMETHOD_UNKNOWN = 0; + /*unsigned short SVGGradientElement.SVG_SPREADMETHOD_PAD = 1; + /*unsigned short SVGGradientElement.SVG_SPREADMETHOD_REFLECT = 2; + /*unsigned short SVGGradientElement.SVG_SPREADMETHOD_REPEAT = 3;*/ + +function SVGLinearGradientElement() { + SVGGradientElement.apply(this); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x1 = new sl(); + /*readonly SVGAnimatedLength*/ this.y1 = new sl(); + /*readonly SVGAnimatedLength*/ this.x2 = new sl(); + /*readonly SVGAnimatedLength*/ this.y2 = new sl(); + sl = void 0; + this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { + var grad = evt.target, ele = evt._tar, angle = 270; + if (!!!ele) { //まだ、path要素などが設定されていない場合 + return; + } + var style = grad.ownerDocument.defaultView.getComputedStyle(grad, ""); + var fontSize = parseFloat(style.getPropertyValue("font-size")); + grad.x1.baseVal._emToUnit(fontSize); + grad.y1.baseVal._emToUnit(fontSize); + grad.x2.baseVal._emToUnit(fontSize); + grad.y2.baseVal._emToUnit(fontSize); + angle = 270 - Math.atan2(grad.y2.baseVal.value-grad.y1.baseVal.value, grad.x2.baseVal.value-grad.x1.baseVal.value) * 180 / Math.PI; + if (angle >= 360) { + angle -= 360; + } + ele.setAttribute("type", "gradient"); + ele.setAttribute("angle", angle + ""); + evt = ele = grad = angle = style = fontSize = void 0; + }, false); +}; +SVGLinearGradientElement.prototype = Object._create(SVGGradientElement); + +function SVGRadialGradientElement(_doc) { + SVGGradientElement.apply(this); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.cx = new sl(); + /*readonly SVGAnimatedLength*/ this.cy = new sl(); + /*readonly SVGAnimatedLength*/ this.r = new sl(); + /*readonly SVGAnimatedLength*/ this.fx = new sl(); + /*readonly SVGAnimatedLength*/ this.fy = new sl(); + sl = void 0; + this.cx.baseVal.value = this.cy.baseVal.value = this.r.baseVal.value = 0.5; + this.addEventListener("DOMNodeInsertedIntoDocument", function(evt) { + var grad = evt.target, + ele = evt._tar, + tar = evt._ttar; //eleはv:fill要素。tarはターゲットとになる要素 + if (!!!ele) { //まだ、path要素などが設定されていない場合 + return; + } + ele.setAttribute("type", "gradientTitle"); + ele.setAttribute("focus", "100%"); + ele.setAttribute("focusposition", "0.5 0.5"); + if (tar.localName === "rect") { + /*VMLでは、図の形状に沿って、円状のグラデーションを処理するようになっているため、 + *四角だとおかしな模様が出てしまう。以下はそれを避ける処理 + */ + var style = grad.ownerDocument.defaultView.getComputedStyle(tar, ""), + fontSize = parseFloat(style.getPropertyValue("font-size")); + grad.cx.baseVal._emToUnit(fontSize); + grad.cy.baseVal._emToUnit(fontSize); + grad.r.baseVal._emToUnit(fontSize); + grad.fx.baseVal._emToUnit(fontSize); + grad.fy.baseVal._emToUnit(fontSize); + var cx = grad.cx.baseVal.value, + cy = grad.cy.baseVal.value, + r = grad.r.baseVal.value, + mr = Math.round, + rx, ry; + rx = ry = r; + var tarrect = tar.getBBox(), + vi = tar.ownerDocument.documentElement.viewport, + el = mr(vi.width), + et = mr(vi.height), + er = 0, + eb = 0, + units = grad.getAttributeNS(null, "gradientUnits"); + if (!units || units === "objectBoundingBox") { + //%の場合は小数点に変換(10% -> 0.1) + cx = cx > 1 ? cx/100 : cx; + cy = cy > 1 ? cy/100 : cy; + r = r > 1 ? r/100 : r; + //要素の境界領域を求める(四隅の座標を求める) + var nx = tarrect.x, + ny = tarrect.y, + wid = tarrect.width, + hei = tarrect.height; + cx = cx*wid + nx; + cy = cy*hei + ny; + rx = r*wid; + ry = r*hei; + nx = ny = wid = hei = void 0; + } + var matrix = tar.getScreenCTM().multiply(grad.getCTM()); + el = cx - rx; + et = cy - ry; + er = cx + rx; + eb = cy + ry; + var rrx = rx * 0.55228, + rry = ry * 0.55228, + list = ["m", cx,et, "c", cx-rrx,et, el,cy-rry, el,cy, el,cy+rry, cx-rrx,eb, cx,eb, cx+rrx,eb, er,cy+rry, er,cy, er,cy-rry, cx+rrx,et, cx,et, "x e"]; + for (var i = 0, lili = list.length; i < lili;) { + if (isNaN(list[i])) { //コマンド文字は読み飛ばす + ++i; + continue; + } + var p = grad.ownerDocument.documentElement.createSVGPoint(); + p.x = parseFloat(list[i]); + p.y = parseFloat(list[i+1]); + var pmt = p.matrixTransform(matrix); + list[i] = mr(pmt.x); + i++; + list[i] = mr(pmt.y); + i++; + p = pmt = void 0; + } + var ellipse = list.join(" "), + outline = _doc.getElementById("_NAIBU_outline"), + background = _doc.createElement("div"), + bstyle = background.style; + bstyle.position = "absolute"; + bstyle.display = "inline-block"; + var w = vi.width, + h = vi.height; + bstyle.textAlign = "left"; + bstyle.top = "0px"; + bstyle.left = "0px"; + bstyle.width = w+ "px"; + bstyle.height = h+ "px"; + outline.appendChild(background); + bstyle.filter = "progid:DXImageTransform.Microsoft.Compositor"; + background.filters.item('DXImageTransform.Microsoft.Compositor').Function = 23; + var circle = '' +ele.outerHTML+ '', + data = tar._tar.path.value; + background.innerHTML = ''; + background.filters[0].apply(); + background.innerHTML = circle; + background.filters[0].play(); + tar._tar.parentNode.insertBefore(background, tar._tar); + tar._tar.filled = "false"; + ellipse = outline = background = style = fontSize = bstyle = circle = data = list = mr = gt = cx = cy = r = w = h = matrix = void 0; + } else if (!ele.parentNode){ + tar._tar.appendChild(ele); + } + evt = tar = ele = gard = void 0; + }, false); +}; +SVGRadialGradientElement.prototype = Object._create(SVGGradientElement); + +function SVGStopElement() { + SVGElement.apply(this); + /*readonly SVGAnimatedNumber*/ this.offset = new SVGAnimatedNumber(); + this.addEventListener("DOMAttrModified", function(evt) { + if (evt.attrName === "offset") { + evt.target.offset.baseVal = parseFloat(evt.newValue); + } + evt = void 0; + }, false); +}; +SVGStopElement.prototype = Object._create(SVGElement); + +function SVGPatternElement() { + SVGElement.apply(this); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedEnumeration*/ this.patternUnits = new SVGAnimatedEnumeration(); + /*readonly SVGAnimatedEnumeration*/ this.patternContentUnits = new SVGAnimatedEnumeration(); + /*readonly SVGAnimatedTransformList*/ this.patternTransform = new SVGAnimatedTransformList(); + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new sl(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + sl = void 0; + SVGURIReference.apply(this); + //SVGFitToViewBoxのインターフェースを用いる + /*readonly SVGAnimatedRect*/ this.viewBox = new SVGAnimatedRect(); + /*readonly SVGAnimatedPreserveAspectRatio*/ this.preserveAspectRatio = new SVGAnimatedPreserveAspectRatio(); + /*unsigned short*/ this.zoomAndPan = /*SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE*/ 1; +}; +SVGPatternElement.prototype = Object._create(SVGElement); + +function SVGClipPathElement() { + SVGElement.apply(this); + /*readonly SVGAnimatedEnumeration*/ this.clipPathUnits = new SVGAnimatedEnumeration(); +}; +SVGClipPathElement.prototype = Object._create(SVGElement); + +function SVGMaskElement() { + SVGElement.apply(this); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedEnumeration*/ this.maskUnits = new SVGAnimatedEnumeration(); + /*readonly SVGAnimatedEnumeration*/ this.maskContentUnits = new SVGAnimatedEnumeration(); + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new sl(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + sl = void 0; +}; +SVGMaskElement.prototype = Object._create(SVGElement); + +function SVGFilterElement() { + SVGElement.apply(this); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedEnumeration*/ this.filterUnits = new SVGAnimatedEnumeration(); + /*readonly SVGAnimatedEnumeration*/ this.primitiveUnits = new SVGAnimatedEnumeration(); + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new sl(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + sl = void 0; + /*readonly SVGAnimatedInteger*/ this.filterResX = new SVGAnimatedInteger(); + /*readonly SVGAnimatedInteger*/ this.filterResY = new SVGAnimatedInteger(); + SVGURIReference.apply(this); + //setFilterRes (/*unsigned long*/ filterResX,/*unsigned long*/ filterResY ); +}; +SVGFilterElement.prototype = Object._create(SVGElement); + +function SVGFilterPrimitiveStandardAttributes(ele) { + SVGStylable.apply(this, arguments); + this._tar = ele; + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new sl(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + /*readonly SVGAnimatedString*/ this.result = new sl(); + sl = void 0; + }; +SVGFilterPrimitiveStandardAttributes.prototype = Object._create(SVGStylable); + +function SVGFEBlendElement() { + SVGElement.apply(this); + /*readonly SVGAnimatedString*/ this.in1 = new SVGAnimatedString(); + /*readonly SVGAnimatedString*/ this.in2 = new SVGAnimatedString(); + /*readonly SVGAnimatedEnumeration*/ this.mode = new SVGAnimatedEnumeration(); + this._fpsa = SVGFilterPrimitiveStandardAttributes(this); +}; +SVGFEBlendElement.prototype = Object._create(SVGElement); + // Blend Mode Types + /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_UNKNOWN = 0; + /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_NORMAL = 1; + /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_MULTIPLY = 2; + /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_SCREEN = 3; + /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_DARKEN = 4; + /*unsigned short SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN = 5;*/ + +function SVGFEGaussianBlurElement() { + SVGElement.apply(this); + /*readonly SVGAnimatedString*/ this.in1 = new SVGAnimatedString(); + /*readonly SVGAnimatedNumber*/ this.stdDeviationX = new SVGAnimatedNumber(); + /*readonly SVGAnimatedNumber*/ this.stdDeviationY = new SVGAnimatedNumber(); + this._fpsa = SVGFilterPrimitiveStandardAttributes(this); +}; +SVGFEGaussianBlurElement.prototype = Object._create(SVGElement); +/*void*/ SVGFEGaussianBlurElement.prototype.setStdDeviation = function(/*float*/ stdDeviationX, /*float*/ stdDeviationY ) { + +}; + +function SVGCursorElement() { + SVGElement.apply(this); + /*readonly SVGAnimatedLength*/ this.x = new SVGAnimatedLength(); + /*readonly SVGAnimatedLength*/ this.y = new SVGAnimatedLength(); + SVGURIReference.apply(this); +}; +SVGCursorElement.prototype = Object._create(SVGElement); + +function SVGAElement(_doc) { + SVGElement.apply(this); + this._tar = _doc.createElement("a"); + _doc = void 0; + /*readonly SVGAnimatedString*/ this.target = new SVGAnimatedString(); + this.target.baseVal = "_self"; + this.addEventListener("DOMAttrModified", function(evt){ + var tar = evt.target; + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + if (evt.attrName === "target") { + tar.target.baseVal = evt.newValue; + } else if (evt.attrName === "xlink:title") { + tar._tar.setAttribute("title", evt.newValue); + } + evt = void 0; + }, false); + this.addEventListener("DOMNodeInserted", function(evt){ + var tar = evt.target; + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + if (tar.nextSibling) { + if (!!tar.parentNode._tar && !!tar.nextSibling._tar) { + tar.parentNode._tar.insertBefore(tar._tar, tar.nextSibling._tar); + } + } else if (!!tar.parentNode._tar){ + tar.parentNode._tar.appendChild(tar._tar); + } + var txts = tar._tar.style; + txts.cursor = "hand"; + txts.left = "0px"; + txts.top = "0px"; + txts.textDecoration = "none"; + txts = void 0; + var t = tar.target.baseVal; + var st = "replace"; + if (t === "_blank") { + st = "new"; + } + tar.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:show", st); + tar._tar.style.color = tar.ownerDocument.defaultView.getComputedStyle(tar, "").getPropertyValue("fill"); + tar = evt = void 0; + }, false); + this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ + var tar = evt.target; + if (!!tar._tar && (tar.nodeType === /*Node.ELEMENT_NODE*/ 1)) { + var txts = tar._tar.style; + txts.cursor = "hand"; + txts.textDecoration = "none"; + txts = void 0; + } + tar = evt = void 0; + return; //強制終了させる + }, true); + this.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ + var tar = evt.target; + tar._tar.setAttribute("target", tar.target.baseVal); + if (tar.href.baseVal.indexOf(".svg") !== -1) { //もし、リンク先がSVGファイルならば + tar.addEventListener("click", function(evt){ + var tar = evt.target, + sd = document.body, + ob, nd; + sd.lastChild.innerHTML = ""; + if (tar.target.baseVal === "_self") { + nd = tar.ownerDocument._iframe; + nd.parentNode.insertBefore(sd.lastChild.firstChild, nd); + ob = nd.nextSibling; + if (ob && (ob.tagName === "OBJECT")) { + nd.previousSibling.setAttribute("width", ob.getAttribute("width")); + nd.previousSibling.setAttribute("height", ob.getAttribute("height")); + nd.parentNode.removeChild(ob); + } + ob = NAIBU._search([nd.previousSibling]); + nd.parentNode.removeChild(nd); + } else { + sd.appendChild(sd.lastChild.firstChild); + while (sd.firstChild !== sd.lastChild) { //オブジェクト要素以外を除去 + sd.removeChild(sd.firstChild); + } + ob = NAIBU._search([sd.lastChild]); + } + NAIBU.doc = new ActiveXObject("MSXML2.DomDocument"); + evt.preventDefault(); + ob._next = { + _init: (function (ob) { + return (function(){ + document.title = ob.getSVGDocument().title; + ob = void 0; + }); + })(ob) + }; + ob._init(); + sd = ob = nd = void 0; + }, false); + } + tar = void 0; + }, false); + SVGURIReference.apply(this); +}; +SVGAElement.prototype = Object._create(SVGElement); + +function SVGViewElement() { + SVGElement.apply(this); + /*readonly SVGStringList*/ this.viewTarget = new SVGStringList(); + //SVGFitToViewBoxのインターフェースを用いる + /*readonly SVGAnimatedRect*/ this.viewBox = new SVGAnimatedRect(); + /*readonly SVGAnimatedPreserveAspectRatio*/ this.preserveAspectRatio = new SVGAnimatedPreserveAspectRatio(); + /*unsigned short*/ this.zoomAndPan = /*SVGZoomAndPan.SVG_ZOOMANDPAN_DISABLE*/ 1; +}; +SVGViewElement.prototype = Object._create(SVGElement); + +function SVGScriptElement() { + SVGElement.apply(this); + /*DOMString*/ this.type; + SVGURIReference.apply(this); + this.addEventListener("DOMAttrModified", function(evt){ + if (evt.attrName === "type") { + evt.target.type = evt.newValue; + } + evt = void 0; + }, false); + this.addEventListener("S_Load", function(evt){ + var tar = evt.target, script = tar._text; + var tod = tar.ownerDocument; + NAIBU._temp_doc = tod; + script = "with({document:NAIBU._temp_doc}){" +script+ "\n};"; + try { + NAIBU.eval(script); + } catch (e) { //IE9では、documentがconstとして定数指定されているため、引数として指定できない + script = script.replace(/with\(\{document\){/, "with({doc) {"); + NAIBU.eval(script); + } + tar = evt = script = void 0; + }, false); + this.addEventListener("DOMNodeInserted", function(evt){ + var tar = evt.target; + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + if (tar.nodeName === "#cdata-section") { + evt.currentTarget._text = tar.data; + evt = tar.ownerDocument.createEvent("SVGEvents"); + evt.initEvent("S_Load", false, false); + evt.currentTarget.dispatchEvent(evt); + } + evt= tar = void 0; + return; + } + tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ + var tar = evt.target; + if (evt.eventPhase === /*Event.AT_TARGET*/ 2 && !tar.getAttributeNodeNS("http://www.w3.org/1999/xlink", "xlink:href")) { + var evtt = tar.ownerDocument.createEvent("SVGEvents"); + evtt.initEvent("S_Load", false, false); + evt.currentTarget.dispatchEvent(evtt); + } + tar = evt = evtt = void 0; + }, false); + }, false); +}; +SVGScriptElement.prototype = Object._create(SVGElement); + +function SVGEvent() { + Event.apply(this); +}; +SVGEvent.prototype = Object._create(Event); + +function SVGZoomEvent() { + UIEvent.apply(this); + /*readonly SVGRect*/ this.zoomRectScreen = new SVGRect(); + /*readonly float*/ this.previousScale = 1; + /*readonly SVGPoint*/ this.previousTranslate = new SVGPoint(); + /*readonly float*/ this.newScale = 1; + /*readonly SVGPoint*/ this.newTranslate = new SVGPoint(); +}; +SVGZoomEvent.prototype = Object._create(UIEvent); + +function SVGAnimationElement() { + SVGElement.apply(this); + /*SIEにおけるSVGElementでは、fill属性とStyleSheetを結びつける機構があるため、 + *styleのsetPropertyメソッドを無効化させておく必要がある + */ + this.style.setProperty = function(){}; + this._tar = null; + /*readonly SVGElement*/ this.targetElement; + /*それぞれのプロパティは、_を除いた属性に対応している*/ + this._begin = this._end = this._repeatCount = this._repeatDur = this._dur = this._resatrt = null; + this._currentFrame = 0; + /*_isRepeatと_numRepeatは繰り返し再生のときに使う。なお、後者は現在のリピート回数*/ + this._isRepeat = false; + this._numRepeat = 0; + /*_isStartプロパティは一度は起動したかどうか*/ + this._isStarted = false; + /*_startと_finishプロパティはミリ秒数のリストを収納する。 + *_startはアニメ開始時の秒数リスト。_finishはアニメ終了時の秒数のリスト。 + *なお、文書読み込み終了時(アニメ開始時刻)の秒数を0とする。 + *_startingプロパティは現在アニメーションでの開始時刻。getSartTimeメソッドで使う + */ + this._start = this._finish = this._starting = null; + /*_activeDurプロパティは現時点でのアニメーションの活動期間*/ + this._activeDur = 0; + this._from = this._to = this._values = this._by = null; + this._keyTimes = null; + this.addEventListener("beginEvent", function(evt) { + try { + var tar = evt.target, + begin = tar.getStartTime(), + durv = tar._dur, + dur = tar._getOffset(durv), + end = tar._finish, + endv= tar._end, + td = tar._repeatDur, + tc = tar._repeatCount, + ac = null; + if (end) { + for (var i=0, eli=end.length;i= begin) { + end = end[i]; + break; + } + } + } else { + /*イベント待ちの場合は、endの値を、indefiniteとみなす。参照: http://www.w3.org/TR/smil-animation/#ComputingActiveDur + * + * 3.3.4. Computing the active duration + * + * If the value of end cannot be resolved (e.g. when it is event-based), + * the value is considered to be "indefinite" for the purposes of evaluating the active duration. + * + */ + endv = null; + } + /*Activate Duration (活性持続時間と呼ぶことにする)を計算 + *計算方法は以下を参照のこと + *http://www.w3.org/TR/smil-animation/#ComputingActiveDur + *3.3.4. Computing the active duration + */ + if ((td === "indefinite") || (tc === "indefinite")) { + if (endv) { + ac = end - begin; + } else { + /*活性持続時間が不定(indefinite)なので、強制的にアニメを終了させる*/ + ac = null; + } + } else if (durv === "indefinite") { + if (!tc && !endv) { + /*活性持続時間が不定(indefinite)なので、強制的にアニメを終了させる*/ + ac = null; + } else if (tc && !endv) { + ac = tar._getOffset(td); + } else if (!tc && endv) { + ac = end - begin; + } else { + ac = (tar._getOffset(td) > (end - begin)) ? tar._getOffset(td) : (end - begin); + } + } else if (durv && !td && !tc && !endv) { + ac = dur; + } else if (durv && !td && tc && !endv) { + ac = dur * (+tc); + } else if (durv && td && !tc && !endv) { + ac = tar._getOffset(td); + } else if (durv && !td && !tc && endv) { + ac = (dur > (end - begin)) ? dur : (end - begin); + } else if (durv && td && tc && !endv) { + ac = (+tc*dur > tar._getOffset(td)) ? +tc*dur : tar._getOffset(td); + } else if (durv && td && tc && endv) { + ac = (+tc*dur > Math.min(+td, (end-begin))) ? +tc*dur : Math.min(tar._getOffset(td), (end - begin)); + } else if (durv && td && !tc && endv) { + ac = (tar._getOffset(td) > (end - begin)) ? tar._getOffset(td) : (end - begin); + } else if (durv && !td && tc && endv) { + ac = (+tc*dur > (end - begin)) ? +tc*dur : (end - begin); + } + } catch (e) { + tar.endElementAt(1); + throw new DOMException(/*DOMException.INVALID_STATE_ERR*/ 11); + } + if ((ac || (ac === 0)) && isFinite(ac)) { + /*endの値がすでにある場合は、二重指定を避ける*/ + endv || tar.endElementAt(ac); + tar._activeDur = ac; + } + tar = begin = dur = durv = end = endv= td = tc = ac = void 0; + }, false); + this.addEventListener("DOMAttrModified", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; + } + var tar = evt.target, + name = evt.attrName, + evtv = evt.newValue; + if (name === "begin") { + tar._begin = evtv.replace(/\s+/g, "").split(";"); //空白は取り除く + } else if (name === "end") { + tar._end = evtv.replace(/\s+/g, "").split(";"); + } else if (name === "dur") { + tar._dur = evtv; + } else if (name === "repeatCount") { + tar._repeatCount = evtv; + tar._isRepeat = true; + } else if (name === "repeatDur") { + tar._repeatCount = evtv; + tar._isRepeat = true; + } else if (name === "from") { + tar._from = evtv; + } else if (name === "to") { + tar._to = evtv; + } else if (name === "values") { + tar._values = evtv.split(";"); + } else if (name === "by") { + tar._by = evtv; + } else if (name === "keyTimes") { + var s = evtv.split(";"); + tar._keyTimes = []; //_keyTimesプロパティを初期化 + for (var i=0;iif none of the from, to, by or values attributes are specified, the animation will have no effect + *「3.2.2. Animation function values」より引用 + *http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues + */ + return tar; + } + /*begin属性とend属性を処理する*/ + var that = tar, + timing = function(val, name, offset) { + /*timing関数は時間のタイミングをidとeventと、clock-value(offset)に分割して処理していく + *まず、idを検出するためのsearcIdローカル関数を作る + */ + var searchId = function () { + var n = val.indexOf("."); + if ((n > 0) && (/[a-z]/i).test(val.charAt(n+1))) { //. (dot)の後がアルファベットならば + return (val.slice(0, n)); + } + n = nn = void 0; + return ""; + }, + id; + /* + *W3CのSMIl AnimationのTimingモデルは7パターンがあるので、場合分けする + */ + if (isFinite(parseFloat(val))) { //1) offset-valueの場合 + that[name](offset); + } else if (val.indexOf("repeat(") > -1) { //2) repeat-valueの場合 + var inte = parseFloat(val.slice(7)), + ds = (function(that, name, offset) { + return function (evt) { + if (inte === evt.target._numRepeat) { + that[name](offset); + } + }; + })(that, name, offset), + id = searchId(); + if (id) { + that.ownerDocument.getElementById(id).addEventListener("repeatEvent", ds); + } else { + that.addEventListener("repeatEvent", ds); + } + } else if (/\.(begin|end)/.test(val)) { //3) syncbase-valueの場合 + id = searchId(); + if (id) { + var ds = (function(that, name, offset) { + return function (evt) { + that[name](offset); + }; + })(that, name, offset), + ev = ""; + /\.(begin|end)/.test(val); //RegExp.$1のために、もう一度する必要がある + if (RegExp.$1 === "begin") { + ev = "beginEvent"; + } else if (RegExp.$1 === "end") { + ev = "endEvent"; + } + that.ownerDocument.getElementById(id).addEventListener(ev, ds, false); + } + } else if (val.indexOf("wallclock(") === 0) { //4) wallclock-valueの場合 + + } else if (val === "indefinite") { //5) indefiniteの場合 + } else if (val.indexOf("accesskey(") > -1) { //6) accesskey-valueの場合 + + } else { //7) event-valueの場合 + id = searchId(); + var ds = (function(that, name, offset) { + return function (evt) { + that[name](offset); + }; + })(that, name, offset); + if (id && val.match(/\.([a-z]+)/i)) { + that.ownerDocument.getElementById(id).addEventListener(RegExp.$1, ds); + } else if (val){ + that.targetElement.addEventListener(val.match(/^[a-z]+/i)[0], ds); + } + } + val = searchId = id = void 0; + }; + if (tar._begin) { + for (var i=0,tli=tar._begin.length;i 0)))) { + return; //restart属性の設定により、再起動させないようにする + } + if (this.getCurrentTime() > 0) { + /*アニメーションの最中で、beginEventが起きるときは、endEventが前もって起こされる。SVG1.1の仕様を参照 + * + * 19.4.2 Interface TimeEvent + * Note that if an element is restarted while it is currently playing, the element will raise an end event and another begin event, as the element restarts. + * + * http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent + * + */ + this.endElement(); + } + evt.initTimeEvent("beginEvent", ttd.defaultView, 0); + this.dispatchEvent(evt); + /*新しくリストの頭を更新して、別の値も実行させるようにする*/ + this._start && this._start.shift(); + this._isStarted = true; + ttd = evt = void 0; +}; +/*void*/ SVGAnimationElement.prototype.endElement = function() { + var ttd = this.ownerDocument, + evt = ttd.createEvent("TimeEvents"); + evt.initTimeEvent("endEvent", ttd.defaultView, 0); + this.dispatchEvent(evt); + this._finish && this._finish.shift(); + this._currentFrame = 0; +}; +/*void*/ SVGAnimationElement.prototype.beginElementAt = function(/*float*/ offset) { + var ntc = this.ownerDocument.documentElement.getCurrentTime(), + start = this._start || []; + for (var i=0,sli=start.length;i -1) { + s = val.slice(n[0]); + t = parseFloat(s); + } else if (n[1] > -1) { + s = val.slice(n[1]); + t = parseFloat(s); + } else { + s = val; + t = parseFloat(val); + } + if (isFinite(t)) { + if (/\d+\:(\d\d)\:([\d\.]+)$/.test(s)) { //Full-Clock-Valueの場合 + t = (t*3600 + parseInt(RegExp.$1, 10)*60 + parseFloat(RegExp.$2)) * 1000; + } else if (/\d\d\:([\d\.]+)$/.test(s)) { + t = (t*60 + parseFloat(RegExp.$1)) * 1000; + } else if (/(h|min|s)$/.test(s)) { + t *= this._unit[RegExp.$1]; + } + if (isFinite(t)) { + t *= 0.8; + return t; + } + } + return 0; +}; + +/*float*/ SVGAnimationElement.prototype.getStartTime = function(){ + if (this._starting || (this._starting === 0)) { + return (this._starting); + } else { + throw new DOMException(/*DOMException.INVALID_STATE_ERR*/ 11); + } +}; +/*getCurrentTimeメソッド + *現在の時間コンテナ内での時刻であり、 + *決して現在時刻ではない。要素のbeginイベントの発火したときが0sである。 + */ +/*float*/ SVGAnimationElement.prototype.getCurrentTime = function(){ + return (this._currentFrame * 125 * 0.8); +}; +/*float*/ SVGAnimationElement.prototype.getSimpleDuration = function(){ + if (!this._dur && !this._finish && (this._dur === "indefinite")) { + throw new DOMException(/*DOMException.NOT_SUPPORTED_ERR*/ 9); + } else { + return (this._getOffset(this._dur)); + } +}; + //raises( DOMException ); +NAIBU.Time = { + currentFrame : 0, + Max : 17000, + start : function() { + if (NAIBU.Clip.length > 0) { + screen.updateInterval = 42; //24fpsとして描画処理 + window.onscroll = function () { + screen.updateInterval = 0; + screen.updateInterval = 42; + }; + NAIBU.stop = setInterval( (function() { + try { + var ntc = NAIBU.Time.currentFrame, + nc = NAIBU.Clip, + s = ntc * 100; //フレーム数ntcをミリ秒数sに変換 (100 = 125 * 0.8) + if (ntc > NAIBU.Time.Max) { + clearInterval(NAIBU.stop); + } + nc[0] && nc[0].ownerDocument.documentElement.setCurrentTime(s); + for (var i=0,ncli=nc.length;i= nci.getSimpleDuration()*nci._numRepeat)) { + /*リピート処理*/ + var ttd = nci.ownerDocument, + evt = ttd.createEvent("TimeEvents"); + ++nci._numRepeat; + evt.initTimeEvent("repeatEvent", ttd.defaultView, nci._numRepeat); + nci.dispatchEvent(evt); + ttd = evt = void 0; + } + if (nci._finish && (nci.getCurrentTime() !== 0)) { + var fti = nci._finish[0]; + if ((fti || (fti === 0)) && (s1 <= fti) && (fti <= s)) { + nci.endElement(); + } + fti = void 0; + } + if (nci._frame) { + ++nci._currentFrame; + nci._frame(); + } + } + ++NAIBU.Time.currentFrame; + ntc = nc = s = nci = s1 = s2 = void 0; + } catch (e) { + } + }), + 1 + ); + } else { + window.onscroll = function () { + screen.updateInterval = 0; + window.onscroll = NAIBU.emptyFunction; + }; + } + } +}; +NAIBU.Clip = []; + +function SVGAnimateElement(){ + SVGAnimationElement.apply(this); + /*NAIBU.Clipについては、NAIBU.Timeで使う + *くわしくはNAIBU.Time.start関数のコードを参照 + */ + NAIBU.Clip[NAIBU.Clip.length] = this; + /*_valueListプロパティは、 + *機械が理解できる形で保管されているvalueの値の配列リスト + */ + this._valueList = []; + this._isDiscrete = false; + this.addEventListener("DOMAttrModified", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + if ((evt.attrName === "calcMode") && (evt.newValue === "discrete")) { + evt.target._isDiscrete = true; + } + }, false); + this.addEventListener("DOMNodeInserted", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + var tar = evt.target; + tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ + var tar = evt.target, + attrName = tar.getAttributeNS(null, "attributeName"), + ttr = tar.targetElement, + tta = ttr[attrName]; + /*tar.valuesのリスト: ["12px", "13px"] + *tar._valueList: [(new SVGPoint()), (new SVGPoint())] + * tar.valuesを機械が理解できるように変換したものがtar._valueList + *この_valueListプロパティはアニメの際に使うので、_valuesプロパティはアニメ中に使わないことに注意 + */ + var vi = ttr.cloneNode(false); + if (!tar._values[0]) { //to属性か、by属性が設定されている場合 + var ttrs = ttr.ownerDocument.defaultView.getComputedStyle(ttr, ""); + tar._values[0] = ttr.getAttributeNS(null, attrName) || ttrs.getPropertyValue(attrName); + if (!tar._values[1] && tar._values[2]) { //by属性のみが設定されている場合 + var v2 = parseFloat(tar._values[0]) + parseFloat(tar._values[2]), tanni = tar._values[0].match(/\D+/) || [""]; + tar._values[1] = v2 + tanni[0]; + tar._values.pop(); + v2 = tanni = void 0; + } + } + if (("animatedPoints" in ttr) && (attrName === "points")) { + ttr.animatedPoints = vi.points; + for (var i=0, tav=tar._values, tvli=tav.length;i -1) { //スタイルシートのプロパティならば + for (var i=0, tav=tar._values, tvli=tav.length;iアニメーションが起動している時,それは実際,DOMの中の属性値は変化しない。 + *http://www.jsa.or.jp/stdz/instac/syoukai/H13/H13annual_report/12/ngc-wg3/offline/smil_20_20020131/animation.html#animationNS-AnimationSandwichModel + */ + var evt = tar.ownerDocument._domnodeEvent(); + if (tar._keyTimes) { + var di = (tar._keyTimes[ii+1] - tar._keyTimes[ii]) * d; + var ti = tar._keyTimes[ii]; + } else { + var di = d / n; //keyTimesがなければ均等に時間を配分しておく + var ti = ii / n; + } + if (("animatedPoints" in ttr) && (attrName === "points")) { + var base = ttr.points; + ttr.points = ttr.animatedPoints; + ttr.dispatchEvent(evt); + ttr.animatedPoints = ttr.points; + ttr.points = base; + } else if (!!tta) { + var base = tta.baseVal, tanim = tta.animVal; + var v1 = tar._valueList[ii].value; + /*vを求める公式に関しては、SMIL2.0 Animation Moduleの単純アニメーション関数の項を参照 + * 3.4.2 Specifying the simple animation function f(t) + *http://www.w3.org/TR/2005/REC-SMIL2-20050107/animation.html#animationNS-SpecifyingAnimationFunction + */ + if (!tar._isDiscrete) { + var v2 = tar._valueList[ii+1].value, v = v1 + (v2-v1) * (tg-ti*d) / di; + } else { + var v = v1; + } + tanim.newValueSpecifiedUnits(base.unitType, v); + tta.baseVal = tanim; + tanim = void 0; + ttr.dispatchEvent(evt); + /*変化値はanimValプロパティに収納しておき、 + *変化する前の、元の値はbaseValプロパティに再び収納しておく + */ + tta.animVal = tta.baseVal; + tta.baseVal = base; + di = void 0; + } else if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば + var base = null; + var v1 = tar._valueList[ii].value, v2 = tar._valueList[ii+1].value; + if (!tar._isDiscrete) { + var v = v1 + (v2-v1) * (tg-ti*d) / di; + } else { + var v = v1; + } + } else if (("normalizedPathSegList" in ttr) && (attrName === "d")) { + var base = ttr.normalizedPathSegList; + ttr.normalizedPathSegList = ttr.animatedNormalizedPathSegList; + ttr.dispatchEvent(evt); + ttr.animatedNormalizedPathSegList = ttr.normalizedPathSegList; + ttr.normalizedPathSegList = base; + } + evt = tar = v1 = v2 = v = d = n = ii = tg = void 0; + }; + evt = vir = void 0; + }, false); + this.addEventListener("endEvent", function(evt) { + var tar = evt.target, + fill = tar.getAttributeNS(null, "fill"); + if (!fill || (fill === "remove")) { + var evt = tar.ownerDocument._domnodeEvent(); + tar.targetElement.dispatchEvent(evt); + evt = void 0; + tar._frame && tar._frame(); + } + delete tar._frame; + }, false); + this.addEventListener("repeatEvent", function(evt) { + var tar = evt.target; + }, false); +}; +SVGAnimateElement.prototype = Object._create(SVGAnimationElement); + +function SVGSetElement(){ + SVGAnimationElement.apply(this); + NAIBU.Clip[NAIBU.Clip.length] = this; + this._to = ""; + this.addEventListener("DOMAttrModified", function(evt) { + var tar = evt.target, name = evt.attrName; + if (name === "to") { + tar._to = evt.newValue; + } + tar = name = void 0; + }, false); + this.addEventListener("beginEvent", function(evt) { + var tar = evt.target; + tar._currentFrame = 1; //これがないと、NAIBU.stopの内部の処理の都合上、endEventが発動しない。 + if (tar.targetElement) { + var attrName = tar.getAttributeNS(null, "attributeName"), + newAttr = tar.targetElement.attributes.getNamedItemNS(null, attrName), + tta = tar.targetElement[attrName]; + if (!!CSS2Properties[attrName] || attrName.indexOf("-") > -1) { //スタイルシートのプロパティならば + /*前もって、スタイルシートの値を取得しておいて、endEventの際に使う*/ + tar._prestyle = tar.ownerDocument.defaultView.getComputedStyle(tar.targetElement, "").getPropertyValue(attrName); + var style = tar.ownerDocument.getOverrideStyle(tar.targetElement, ""); + style.setProperty(attrName, tar.getAttributeNS(null, "to"), null); + style = void 0; + } else if (!!tta) { + var base = tta.baseVal; + if (base instanceof SVGLength) { + tta.baseVal = tar.ownerDocument.documentElement.createSVGLength(); + } else if (base instanceof SVGRect) { + tta.baseVal = tar.ownerDocument.documentElement.createSVGRect(); + } + /*setAttrbute(NS)メソッドはDOM属性を書き換えるため利用しない。 + * + * 参照:アニメーションサンドイッチモデル + * >アニメーションが起動している時,それは実際,DOMの中の属性値は変化しない。 + *http://www.jsa.or.jp/stdz/instac/syoukai/H13/H13annual_report/12/ngc-wg3/offline/smil_20_20020131/animation.html#animationNS-AnimationSandwichModel + */ + var evt = tar.ownerDocument.createEvent("MutationEvents"); + evt.initMutationEvent("DOMAttrModified", true, false, newAttr, newAttr, tar._to, attrName, /*MutationEvent.MODIFICATION*/ 1); + tar.targetElement.dispatchEvent(evt); + evt = void 0; + /*変化値はanimValプロパティに収納しておき、 + *変化する前の、元の値はbaseValプロパティに再び収納しておく + */ + tta.animVal = tta.baseVal; + tta.baseVal = base; + } + } + evt = tar = attrName = void 0; + }, false); + this.addEventListener("endEvent", function(evt) { + var tar = evt.target, + fill = tar.getAttributeNS(null, "fill"); + if (!fill || (fill === "remove")) { + var attrName = tar.getAttributeNS(null, "attributeName"), + style = tar.ownerDocument.getOverrideStyle(tar.targetElement, ""); + if (tar._prestyle) { //スタイルシートの変更ならば + style.setProperty(attrName, tar._prestyle, null); + } else { + var evtt = tar.ownerDocument._domnodeEvent(); + tar.targetElement.dispatchEvent(evtt); + } + attrName = style = evtt = void 0; + } + tar = fill = void 0; + }, false); + this.addEventListener("repeatEvent", function(evt) { + var tar = evt.target, attrName = tar.getAttributeNS(null, "attributeName"), style = tar.ownerDocument.defaultView.getComputedStyle(tar.targetElement, ""); + }, false); +}; +SVGSetElement.prototype = new SVGAnimationElement(1); + +function SVGAnimateMotionElement(){ + SVGAnimationElement.apply(this); + NAIBU.Clip[NAIBU.Clip.length] = this; + this.addEventListener("DOMAttrModified", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; + } + var tar = evt.target, + name = evt.attrName; + if (name === "path") { + var d = tar.ownerDocument.createElementNS("http://www.w3.org/2000/svg", "path"); + d.setAttributeNS(null, "d", evt.newValue); + tar._path = d; + d = void 0; + } + }, false); + this.addEventListener("DOMNodeInserted", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + var tar = evt.target; + tar.addEventListener("DOMNodeInsertedIntoDocument", function(evt){ + var vlist = [], + ti; + if (tar._values) { + for (var i=0, tav=tar._values, tvli=tav.length;i -1) { + NAIBU._noie_createFont(ti, _tar, true); + } + } + evt = tar = svg = curt = textElments = svgns = _tar = void 0; + }; + if (!fontFace.__isLinked || tar._isExternal) { + tar.ownerDocument.documentElement._svgload_limited = 0; + tar.ownerDocument.documentElement.addEventListener("SVGLoad", nefunc, false); + } + }, false); + }, false); +}; +SVGFontElement.prototype = Object._create(SVGElement); + +function SVGGlyphElement() /*: + SVGElement, + SVGStylable*/ { + SVGElement.apply(this); +}; +SVGGlyphElement.prototype = Object._create(SVGElement); + +function SVGMissingGlyphElement() /*: + SVGElement, + SVGStylable*/ { + SVGElement.apply(this); +}; +SVGMissingGlyphElement.prototype = Object._create(SVGElement); + +function SVGHKernElement() { + SVGElement.apply(this); +}; +SVGHKernElement.prototype = Object._create(SVGElement); + +function SVGVKernElement() { + SVGElement.apply(this); +}; +SVGVKernElement.prototype = Object._create(SVGElement); + +function SVGFontFaceElement() { + SVGElement.apply(this); + /*boolean(or number)*/ this._isLinked = 0; + this.addEventListener("DOMNodeInserted", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + if (evt.target.localName === "font-face-uri") { //外部リンクがあれば + evt.currentTarget._isLinked = 1; + } + return; //強制終了させる + } + }, false); +}; +SVGFontFaceElement.prototype = Object._create(SVGElement); + +function SVGFontFaceSrcElement() { + SVGElement.apply(this); +}; +SVGFontFaceSrcElement.prototype = Object._create(SVGElement); + +function SVGFontFaceUriElement() { + SVGElement.apply(this); + this.addEventListener("DOMNodeInserted", function(evt){ + if (evt.eventPhase === /*Event.BUBBLING_PHASE*/ 3) { + return; //強制終了させる + } + evt.target.ownerDocument.documentElement._svgload_limited--; + evt.target.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:show", "embed"); + }, false); + this.addEventListener("S_Load", function(evt){ + var tar = evt.target, tpp = tar.parentNode.parentNode.parentNode; + if (tpp.localName === "defs") { + tpp = tar.parentNode.parentNode; //tppをfont-face要素としておく + } + tar._instance._isExternal = 1; + tpp.parentNode.appendChild(tar._instance); + evt = tar = tpp = void 0; + }, false); + SVGURIReference.apply(this); +}; +SVGFontFaceUriElement.prototype = Object._create(SVGElement); + +function SVGFontFaceFormatElement() { + SVGElement.apply(this); +}; +SVGFontFaceFormatElement.prototype = Object._create(SVGElement); + +function SVGFontFaceNameElement() { + SVGElement.apply(this); +}; +SVGFontFaceNameElement.prototype = Object._create(SVGElement); + +function SVGDefinitionSrcElement() { + SVGElement.apply(this); +}; +SVGDefinitionSrcElement.prototype = Object._create(SVGElement); + +function SVGMetadataElement() { + SVGElement.apply(this); +}; +SVGMetadataElement.prototype = Object._create(SVGElement); + +function SVGForeignObjectElement() /*: + SVGElement, + SVGTests, + SVGLangSpace, + SVGExternalResourcesRequired, + SVGStylable, + SVGTransformable, + events::EventTarget*/ { + SVGElement.apply(this); + var sl = SVGAnimatedLength; + /*readonly SVGAnimatedLength*/ this.x = new sl(); + /*readonly SVGAnimatedLength*/ this.y = new sl(); + /*readonly SVGAnimatedLength*/ this.width = new sl(); + /*readonly SVGAnimatedLength*/ this.height = new sl(); + sl = void 0; +}; +SVGForeignObjectElement.prototype = Object._create(SVGElement); + +//#endif _SVG_IDL_ +/*SVGの要素マッピング(DOMでは定められていないが、必須) + *本来であれば、SVGDocumentのcreateElementNSメソッドを上書きすることが望ましいが、 + *SIEでは軽量化のために、マッピングを用いた + */ +DOMImplementation["http://www.w3.org/2000/svg"] = { + Document: SVGDocument, + svg: SVGSVGElement, + g: SVGGElement, + path: NAIBU.SVGPathElement, + title: SVGTitleElement, + desc: SVGDescElement, + defs: SVGDefsElement, + linearGradient: SVGLinearGradientElement, + radialGradient: SVGRadialGradientElement, + stop: SVGStopElement, + rect: SVGRectElement, + circle: SVGCircleElement, + ellipse: SVGEllipseElement, + polyline: SVGPolylineElement, + polygon: SVGPolygonElement, + text: SVGTextElement, + tspan: SVGTSpanElement, + image: SVGImageElement, + line: SVGLineElement, + a: SVGAElement, + altGlyphDef: SVGAltGlyphDefElement, + altGlyph: SVGAltGlyphElement, + altGlyphItem: SVGAltGlyphItemElement, + animateColor: SVGAnimateColorElement, + animate: SVGAnimateElement, + animateMotion: SVGAnimateMotionElement, + animateTransform:SVGAnimateTransformElement, + clipPath: SVGClipPathElement, + colorProfile: SVGColorProfileElement, + cursor: SVGCursorElement, + definitionSrc: SVGDefinitionSrcElement, + feBlend: SVGFEBlendElement, + feGaussianBlur: SVGFEGaussianBlurElement, + filter: SVGFilterElement, + font: SVGFontElement, + "font-face": SVGFontFaceElement, + "font-face-format":SVGFontFaceFormatElement, + "font-face-name":SVGFontFaceNameElement, + "font-face-src": SVGFontFaceSrcElement, + "font-face-uri": SVGFontFaceUriElement, + foreignObject: SVGForeignObjectElement, + glyph: SVGGlyphElement, + glyphRef: SVGGlyphRefElement, + hkern: SVGHKernElement, + marker: SVGMarkerElement, + mask: SVGMaskElement, + metadata: SVGMetadataElement, + missingGlyph: SVGMissingGlyphElement, + mpath: SVGMPathElement, + script: SVGScriptElement, + set: SVGSetElement, + style: SVGStyleElement, + "switch": SVGSwitchElement, + "symbol": SVGSymbolElement, + textPath: SVGTextPathElement, + tref: SVGTRefElement, + use: SVGUseElement, + view: SVGViewElement, + vkern: SVGVKernElement, + pattern: SVGPatternElement +}; + +NAIBU._fontSearchURI = function(evt){ + var doc = evt.target.ownerDocument; + var tsrc = doc.getElementsByTagNameNS("http://www.w3.org/2000/svg", "font-face-uri"); + for (var i=0;i -1) { + NAIBU._noie_createFont(ti, font, false); + } + } + } + doc = data = void 0; +}; +NAIBU._noie_createFont = function(/*Element*/ ti, /*Element*/ font, /*boolean*/ isMSIE) { + var style = ti.ownerDocument.defaultView.getComputedStyle(ti, ''), + svgns = "http://www.w3.org/2000/svg", + //isTategakiは縦書きならば真 + isTategaki = ti.getAttributeNS(null, "writing-mode") || ti.parentNode.getAttributeNS(null, "writing-mode"), + horizOrVert = isTategaki ? "vert-adv-y" : "horiz-adv-x", + node = ti.firstChild, data, glyphs = font.getElementsByTagNameNS(svgns, "glyph"), + em = parseFloat(font.getElementsByTagNameNS(svgns, "font-face").item(0).getAttributeNS(null, "units-per-em") || 1000), + advX = parseFloat( (font.getAttributeNS(null, horizOrVert) || em) ), //字幅の設定 + dx = parseFloat(ti.getAttributeNS(null, "x") || 0), + dy = parseFloat(ti.getAttributeNS(null, "y") || 0), + fontSize = parseFloat(style.getPropertyValue("font-size")), + fe = fontSize / em, + ds = false, npdlist = ["fill", + "fill-opacity", + "stroke", + "stroke-width", + "stroke-linecap", + "stroke-linejoin", + "stroke-miterlimit", + "stroke-dasharray", + "stroke-opacity", + "opacity", + "cursor"]; + if (glyphs.length > 60) { //fail safe + return; + } + if (/a/[-1] === 'a') { //Firefoxならば + ds = true; + } else if (isMSIE || isTategaki) { + ds = true; + } + if (ds){ + while(node) { + if (!glyphs) { + break; + } + data = node.data; + if (data !== void 0) { //dataがある場合 + var advanceX = [], glyphData = []; + for (var i=0,gli=glyphs.length;i -1) { + advanceX[index] = parseFloat(glyph.getAttributeNS(null, horizOrVert) || advX); //字幅を収納 + glyphData[index] = glyph.getAttributeNS(null, "d"); + index = data.indexOf(unicode, index+1); + } + } + } + for (var i=0,adv=0;i -1) { //句読点の場合 + var fms = fontSize / Math.SQRT2; + x += fms; + y -= fms; + fms = void 0; + } + matrix.e = x; + matrix.f = y; + } else { + matrix.e = dx + adv*fe; + matrix.f = dy; + } + path.setAttributeNS(null, "transform", "matrix(" +matrix.a+ "," +matrix.b+ "," +matrix.c+ "," +matrix.d+ "," +matrix.e+ "," +matrix.f+ ")"); + path.setAttributeNS(null, "d", glyphData[i]); + ti.parentNode.insertBefore(path, ti); + adv += advanceX[i]; + matrix = void 0; + } + } + adv = advanceX = glyphData = void 0; + } else if ("tspan|a".indexOf(node.localName) > -1){ + NAIBU._noie_createFont(node, font, isMSIE); + } + node = node.nextSibling; + } + if (isMSIE) { + var style = ti.ownerDocument.getOverrideStyle(ti, null); + style.setProperty("visibility", "hidden"); + style = void 0; + } else { + ti.setAttributeNS(null, "opacity", "0"); + } + } + data = isTategaki = horizOrVert = em = advX = dx = dy = fontSize = style = svgns = node = void 0; +}; + +/*以下は、getComputedStyleメソッドで使うために、CSS2Propertiesの_listプロパティに、 + *CSSprimitiveValueのリストを収納している。なお、その際に、writingModeなどはwriting-modeに変更している + */ +(function(){ + var s = new CSSStyleDeclaration(), + slis = s._list, + n = 0, + regAZ = /([A-Z])/, + regm = /\-/, + u, t; + for (var i in CSS2Properties) { + if(CSS2Properties.hasOwnProperty(i)) { + t = i.replace(regAZ, "-"); + if (!!RegExp.$1) { + u = "-" +RegExp.$1.toLowerCase(); + } else { + u = "-"; + } + t = t.replace(regm, u); + s.setProperty(t, CSS2Properties[i]); + slis[t] = slis[n]; //この処理はCSSモジュールのgetComputedStyleメソッドのため + slis[n]._isDefault = 1; + ++n; + i = t = u = void 0; + } + } + slis._opacity = 1; + slis._fontSize = 12; + CSS2Properties._list = slis; + Document.prototype.defaultView._defaultCSS = slis; + s = n = regAZ = regm = slis =null; +})(); + +NAIBU.addEvent = function(evt,lis){ + if (window.addEventListener) { + window.addEventListener(evt, lis, false); + } else if (window.attachEvent) { + window.attachEvent('on'+evt, lis); + } else { + window['on'+evt] = lis; + } + //Sieb用 + if (sieb_s) { + lis(); + } +}; + +function unsvgtovml() { + try { + if ("stop" in NAIBU) { + clearInterval(NAIBU.stop); + } + window.onscroll = NAIBU.emptyFunction; + window.detachEvent("onload", NAIBU._main); + NAIBU.freeArg(); + delete Object._create; + Document._destroy(); + Element = SVGElement = Attr = NamedNodeMap = CSS2Properties = CSSValue = CSSPrimitiveValue = NAIBU.xmlhttp = Node = Event = NAIBU = STLog = SVGColor = SVGPaint = void 0; + Array = ActiveXObject = void 0; + } catch(e) {} +} +/*_main関数 + *一番最初に起動するべき関数 + */ +NAIBU._main = function() { + var xmlhttp, //XMLHttpオブジェクトを生成 + _doc = document; //documentのエイリアスを作成 + try { + if (XMLHttpRequest) { + xmlhttp = false; + } else { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + if (!xmlhttp) { + try { + xmlhttp = new XMLHttpRequest(); + } catch (e) { + xmlhttp = false; + } + } + NAIBU.xmlhttp = xmlhttp; + var nd, + docn = _doc.namespaces; + if (docn && !docn["v"]) { + try { + NAIBU.doc = new ActiveXObject("MSXML2.DomDocument"); + } catch (e) { + + } + nd = NAIBU.doc; + docn.add("v","urn:schemas-microsoft-com:vml"); + docn.add("o","urn:schemas-microsoft-com:office:office"); + var st = _doc.createStyleSheet(), + vmlUrl = "behavior: url(#default#VML);display: inline-block;} "; //inline-blockはIEのバグ対策 + st.cssText = "v\\:rect{" +vmlUrl+ "v\\:image{" +vmlUrl+ "v\\:fill{" +vmlUrl+ "v\\:stroke{" +vmlUrl+ "o\\:opacity2{" +vmlUrl + + "dn\\:defs{display:none}" + + "v\\:group{text-indent:0px;position:relative;width:100%;height:100%;" +vmlUrl + + "v\\:shape{width:100%;height:100%;" +vmlUrl; + } + var ary = _doc.getElementsByTagName("script"); + //全script要素をチェックして、type属性がimage/svg+xmlならば、中身をSVGとして処理する + for (var i=0; ary[i]; ++i) { + var ai = ary[i], + hoge = ai.type; + if (ai.type === "image/svg+xml") { + var ait = ai.text; + if (sieb_s && ait.match(/<svg/)) { + //ソース内のタグを除去 + ait = ait.replace(/<.+?>/g, ""); + //エンティティを文字に戻す + ait = ait.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/&/g, "&"); + } + if (NAIBU.isMSIE) { + var gsd = new GetSVGDocument(ai); + gsd.xmlhttp = { + readyState : 4, + status : 200, + responseText : ait.replace(/\shref=/g, " target='_top' xlink:href=") + }; + gsd._ca(); + } else { + var base = location.href.replace(/\/[^\/]+?$/,"/"); //URIの最後尾にあるファイル名は消す。例: /n/sie.js -> /n/ + ait = ait.replace(/\shref=(['"a-z]+?):\/\//g, " target='_top' xlink:href=$1://").replace(/\shref=(.)/g, " target='_top' xlink:href=$1"+base); + var s = NAIBU.textToSVG(ait,ai.getAttribute("width"),ai.getAttribute("height")); + ai.parentNode.insertBefore(s,ai); + } + ai = ait = void 0; + } + hoge = void 0; + } + NAIBU.doc = nd; + nd = docn = ary = void 0; + if (xmlhttp && NAIBU.isMSIE) { + if (!!_doc.createElementNS && !!_doc.createElementNS( "http://www.w3.org/2000/svg", "svg").createSVGRect) { //IE9ならば + } else { //IE6-8ならば + var ob = _doc.getElementsByTagName("object"), + s=[], + t = [], + _search = function(_ob) { + var ifr, obi, n, + w = "width", + h = "height"; + s || (s = []); //NAIBU._searchで呼ばれたときに必要 + _doc || (_doc = document); + for (var i=0;_ob[i];++i) { + obi = _ob[i]; + s[s.length] = new GetSVGDocument(obi); + ifr = _doc.createElement("iframe"); + ifr.style.cssText = obi.style.cssText; + ifr.style.background = "black"; + n = obi.getAttribute(w); + n && ifr.setAttribute(w, n); + n = obi.getAttribute(h); + n && ifr.setAttribute(h, n); + ifr.marginWidth = ifr.marginHeight = "0px"; //このマージン設定がないと、全体がずれてしまう + ifr.scrolling = "no"; + ifr.frameBorder = "0"; + /*iframe要素を使って、描画のプロセスを分離する + *したがって、_docはdocumentとは別のオブジェクトとなる + */ + obi.parentNode.insertBefore(ifr, obi); + } + i = obi = ifr = _ob = w = h = void 0; + return s[s.length-1]; + }; + _search(ob); + var img = _doc.getElementsByTagName("img"), + em = _doc.getElementsByTagName("embed"); + for (var i=0,j=0;img[i];++i) { + /*img要素の処理*/ + if (img[i].getAttribute("src").indexOf(".svg") > -1) { //拡張子があればSVG画像と判断 + t[j] = img[i]; + ++j; + } + } + _search(t); + _search(em); + NAIBU._search = _search; //a要素がクリックされたときに使う関数 + ob = em = t = img = _search = void 0; + for (var i=0;i 0) { + s[0]._init(); //初期化作業を開始 + } + s = void 0; + } + } else { + var ob = _doc.getElementsByTagName("object"); + for (var i=0;i -1 || navigator.userAgent.indexOf('Safari') > -1) { //WebKit系ならば + var data = 'data:image/svg+xml;charset=utf-8,' + NAIBU.unescapeUTF16(escape(source)); + var ob = document.createElement("object"); + ob.setAttribute("data",data); + ob.setAttribute("width",w); + ob.setAttribute("height",h); + ob.setAttribute("type","image/svg+xml"); + return ob; + } else { + var doc = (new DOMParser()).parseFromString(source, "text/xml"); + return (document.importNode(doc.documentElement, true)); + } +}; +NAIBU.addEvent("unload", unsvgtovml); +//IEならばtrue NAIBU.isMSIE = /*@cc_on!@*/false; \ No newline at end of file diff --git a/sie.js b/sie.js index 51359c0..ccbc09c 100644 --- a/sie.js +++ b/sie.js @@ -1,56 +1,56 @@ -/*SIE-SVG without Plugin under LGPL2.1 & GPL2.0 & Mozilla Public Lisence - *http://sie.sourceforge.jp/ - *Usage: - */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is the Mozilla SVG Cairo Renderer project. - * - * The Initial Developer of the Original Code is IBM Corporation. - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Parts of this file contain code derived from the following files(s) - * of the Mozilla SVG project (these parts are Copyright (C) by their - * respective copyright-holders): - * layout/svg/renderer/src/libart/nsSVGLibartBPathBuilder.cpp - * - * Contributor(s):DHRNAME revulo bellbind - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -/* - * Copyright (c) 2000 World Wide Web Consortium, - * (Massachusetts Institute of Technology, Institut National de - * Recherche en Informatique et en Automatique, Keio University). All - * Rights Reserved. This program is distributed under the W3C's Software - * Intellectual Property License. This program is distributed in the - * hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. - * See W3C License http://www.w3.org/Consortium/Legal/ for more details. - */ -if(!Object._create){Object._create=function(b){var c=function(){};c.prototype=b.prototype;b=void 0;return new c}}function DOMException(c){Error.apply(this,arguments);this.code=c;var b=["","Index Size Error","DOMString Size Error","Hierarchy Request Error","Wrong Document Error","Invalid Character Error","No Data Allowed Error","No Modification Allowed Error","Not Found Error","Not Supported Error","Inuse Attribute Error","Invalid State Error","Syntax Error","Invalid Modification Error","Namespace Error","Invalid Access Error"];this.message=b[c]}(function(b){b.prototype=new Error()})(DOMException);DOMImplementation={hasFeature:function(c,b){switch(c){case"CORE":case"XML":case"Events":case"StyleSheets":case"org.w3c.svg.static":case"org.w3c.dom.svg.static":return true;default:if(b==="2.0"){return true}else{return false}}},createDocumentType:function(d,e,b){var c=new Node();c.publicId=e;c.systemId=b;return c},createDocument:function(d,g,b){try{var c;if(d){c=new (DOMImplementation[d].Document);this._doc_&&(c._document_=this._doc_)}else{c=new Document()}c.implementation=this;c.doctype=b||null;c.documentElement=c.createElementNS(d,g);return c}catch(f){}},"http://www.w3.org/2000/xmlns":{}};function Node(){this.childNodes=[];this._capter=[]}Node.prototype={tar:null,firstChild:null,previousSibling:null,nextSibling:null,attributes:null,namespaceURI:null,localName:null,lastChild:null,prefix:null,ownerDocument:null,parentNode:null,replaceChild:function(b,d){this.insertBefore(b,d);var c=this.removeChild(d);return c},appendChild:function(b){this.insertBefore(b,null);return b},hasChildNodes:function(){if(this.childNodes.length>0){return true}else{return false}},cloneNode:function(b){var c;if(this.hasOwnProperty("ownerDocument")){c=this.ownerDocument.importNode(this,b)}else{c=new Node()}return c},normalize:function(){var g=this.childNodes;try{for(var c=g.length-1;c<0;--c){var f=g[c],b=f.nextSibling;if(b){if(f.nodeType===3&&b.nodeType===3){f.appendData(b.data);f.legnth=f.data.length;this.removeChild(b)}else{f.normalize()}}else{f.normalize()}}}catch(d){}},isSupported:function(c,b){return(this.ownerDocument.implementation.hasFeature(c+"",b+""))},hasAttributes:function(){if(this.attributes.length>0){return true}else{return false}}};Array.prototype.item=function(b){if(!this[b]){return null}return(this[b])};function NamedNodeMap(){}Array.prototype._copyNode=function __nnmp_c(e,c){for(var d=0,b=e.length;dthis.length){throw (new DOMException(1))}if(e+d>this.length){d=this.length-e}var c=this.data.substr(e,d);return c};b.replaceData=function(e,d,c){if(e<0||d<0||e>this.length){throw (new DOMException(1))}this.deleteData(e,d);this.insertData(e,c)};b=void 0})(CharacterData.prototype);function Attr(){}Attr.prototype=Object._create(Node);(function(b){b.nodeType=2;b.nodeValue=null;b.childNodes=[];b._capter=[];b=void 0})(Attr.prototype);function Element(){Node.apply(this);this.attributes=new NamedNodeMap()}Element.prototype=Object._create(Node);(function(b){b.nodeType=1;b.nodeValue=null;b.getAttribute=function(c){return(this.getAttributeNS(null,c))};b.setAttribute=function(c,d){this.setAttributeNS(null,c,d)};b.removeAttribute=function(c){this.removeAttributeNS(null,c)};b.getAttributeNode=function(c){};b.setAttributeNode=function(c){};b.removeAttributeNode=function(c){var d=this.attributes.removeNamedItemNS(c.namespaceURI,c.localName);return d};b.getElementsByTagName=function(c){};b.getAttributeNS=function(d,c){var e=this.getAttributeNodeNS(d,c);if(!e){return null}else{return(e.nodeValue)}};b.setAttributeNS=function(c,f,d){var e=this.ownerDocument.createAttributeNS(c,f);e.nodeValue=d+"";e.value=d+"";this.setAttributeNodeNS(e)};b.removeAttributeNS=function(d,c){};b.getAttributeNodeNS=function(d,c){var e=this.attributes.getNamedItemNS(d,c);return e};b.getElementsByTagNameNS=function(f,k){var v=[],g=0;var c=this.childNodes;for(var o=0,e=c.length;o1000){f=e.implementation._buffer_||[];p=f.length;f[p]=this;f[p+1]=q;e.implementation._buffer_=f;d=e=k=s=t=f=p=o=void 0;return true}}}q.target=d;q.eventPhase=1;e[r]=null;while(d.parentNode){d.parentNode[c]=d;d[r]=d.parentNode;d=d.parentNode}e[c]=d;d[r]=e;d=this;while(e){q.currentTarget=e;if(e===d){o=2}q.eventPhase=o;i=e._capter;for(var g=0,b=i.length;gthis.length){next=""}this.data=pre+next;this.length=this.data.length;evt=this.ownerDocument.createEvent("MutationEvents");evt.initMutationEvent("DOMCharacterDataModified",true,false,null,b,this.data,null,null);this.parentNode.dispatchEvent(evt);evt=b=void 0};Document.prototype._cevent={MutationEvents:MutationEvent,MouseEvents:MouseEvent,UIEvents:UIEvent};function StyleSheet(){this.type="text/css";this.disabled=false;this.ownerNode=null;this.parentStyleSheet=null;this.href=null;this.title="";this.media=new MediaList()}function MediaList(){this.mediaText="";this.length=0}MediaList.prototype={item:function(b){return(this[b])},deleteMedium:function(b){for(var c=0,d=this.length;c-1){f._empercents=c._fontSize;e=c=g=b=j=d=void 0;return f}}e=c=g=j=d=void 0;return null},removeProperty:function(b){var c=this.getPropertyCSSValue(b);if(c){this._list.splice(c._num,1);--this.length}},getPropertyPriority:function(b){var c=this.getPropertyCSSValue(b);if(c){return(c._priority)}else{return""}},_isFillStroke:{fill:1,stroke:1},_isColor:{color:1},_isStop:{"stop-color":1},_isRS:{r:1,"#":1},setProperty:function(g,o,k){var e=g,c=null,b,j,l,d=null,f=null,q,p,i;if(!!this[g]){c=this.getPropertyCSSValue(g)}e+=":";e+=o;if(this._isFillStroke[g]){if(c){b=c}else{b=new SVGPaint()}j=0;l=o.charAt(0);if(this._isRS[l]||b._keywords[o]){j=1;f=o}else{if(o==="none"){j=101}else{if(this._urlreg.test(o)){j=107;d=RegExp.$1}else{if(o==="currentColor"){j=102}}}}b.setPaint(j,d,f,null);j=l=d=f=void 0}else{if(this._isStop[g]){if(c){b=c}else{b=new SVGColor()}if(o==="currentColor"){b.colorType=3}else{b.colorType=1}b.setRGBColor(o)}else{if(c){b=c}else{b=new CSSPrimitiveValue()}}}b._priority=k;b.cssText=e;if(!c){b._num=this._list.length;this._list[b._num]=b;this[g]=1;++this.length}if(o==="inherit"){b.cssValueType=0}else{if(g==="opacity"){this._list._opacity=+o}else{if(g==="font-size"){if(/(%|em|ex)/.test(o)){c="_"+RegExp.$1;b[c]=parseFloat(o)}else{this._em=this._ex=this["_%"]=null;this._list._fontSize=parseFloat(o)}}}}e=void 0},item:function(b){if(b>=this.length){var c=""}else{var c=this._list[b].cssText.substring(0,this._list[b].cssText.indexOf(":"))}return c}};function CSSValue(){}CSSValue.prototype={cssText:"",cssValueType:3,_isDefault:0};function CSSPrimitiveValue(){}(function(b){b.prototype=Object._create(CSSValue)})(CSSPrimitiveValue);(function(){this._n=[1,0.01,1,1,1,35.43307,3.543307,90,1.25,15,1,180/Math.PI,90/100,1,1000,1,1000,1];this.cssValueType=1;this.primitiveType=0;this._value=null;this._percent=0;this._empercent=0;this._em=this._ex=this["_%"]=null;this.setFloatValue=function(b,c){if((0>=b)&&(b>=19)){throw new DOMException(15)}this.primitiveType=b;this._value=c*this._n[b-1]};this._regd=/[\d\.]+/;this.getFloatValue=function(c){if((0>=c)&&(c>=19)){throw new DOMException(15)}if(this._value||(this._value===0)){return(this._value/this._n[c-1])}else{var b=this.cssText,f=b.slice(-1),e=0,d=+(b.match(this._regd));d=isNaN(d)?0:d;if(f>="0"&&f<="9"){e=1;if(c===1){c=b=f=e=void 0;return d}}else{if(f==="%"){d*=this._percent;e=2}else{if((f==="m")&&(b.charAt(b.length-2)==="e")){d*=this._empercent;e=3}else{if((f==="x")&&(b.charAt(b.length-2)==="e")){e=4}else{if((f==="x")&&(b.charAt(b.length-2)==="p")){e=5}else{if((f==="m")&&(b.charAt(b.length-2)==="c")){e=6}else{if((f==="m")&&(b.charAt(b.length-2)==="m")){e=7}else{if(f==="n"){e=8}else{if(f==="t"){e=9}else{if(f==="c"){e=10}}}}}}}}}}d=d*this._n[e-1]/this._n[c-1];b=f=e=c=void 0;return d}};this.setStringValue=function(c,b){if(18>=c&&c>=23){throw new DOMException(15)}this._value=b};this.getStringValue=function(b){if(18>=b&&b>=23){throw new DOMException(15)}return(this._value)};this.getCounterValue=function(){if(this.primitiveType!==23){throw new DOMException(15)}return(new Counter())};this.getRectValue=function(){if(this.primitiveType!==24){throw new DOMException(15)}return(new Rect())};this.getRGBColorValue=function(){if(this.primitiveType!==25){throw new DOMException(15)}var b=new RGBColor(),c=this.cssText,d=SVGColor.prototype._keywords[c];if(c.indexOf("%",5)>0){c=c.replace(/[\d.]+%/g,function(e){return Math.round((2.55*parseFloat(e)))})}else{if(c.indexOf("#")>-1){c=c.replace(/[\da-f][\da-f]/gi,function(e){return parseInt(e,16)})}}d=d||c.match(/\d+/g);b.red.setFloatValue(1,parseFloat(d[0]));b.green.setFloatValue(1,parseFloat(d[1]));b.blue.setFloatValue(1,parseFloat(d[2]));d=c=void 0;return(b)}}).apply(CSSPrimitiveValue.prototype);function CSSValueList(){this.cssValueType=2;this.length=0}CSSValueList.prototype=Object._create(CSSValue);CSSValueList.prototype.item=function(b){return(this[b])};function RGBColor(){var b=CSSPrimitiveValue;this.red=new b();this.green=new b();this.blue=new b();b=void 0;this.red.primitiveType=this.green.primitiveType=this.blue.primitiveType=1}function Rect(){var b=CSSPrimitiveValue;this.top=new b();this.right=new b();this.bottom=new b();this.left=new b();b=void 0}function Counter(){this.identifier=this.listStyle=this.separator=""}function ElementCSSInlineStyle(){var b=CSSStyleDeclaration;this.style=new b();this._attributeStyle=new b();b=void 0}var n="none",m="normal",a="auto",CSS2Properties={fill:"black",stroke:n,cursor:a,visibility:"visible",display:"inline-block",opacity:"1",fillOpacity:"1",strokeWidth:"1",strokeDasharray:n,strokeDashoffset:"0",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"4",strokeOpacity:"1",writingMode:"lr-tb",fontFamily:"serif",fontSize:"12",color:"black",fontSizeAdjust:n,fontStretch:m,fontStyle:m,fontVariant:m,fontWeight:m,font:"inline",stopColor:"black",stopOpacity:"1",textAnchor:"start",azimuth:"center",clip:a,direction:"ltr",letterSpacing:m,lineHeight:m,overflow:"visible",textAlign:"left",textDecoration:n,textIndent:"0",textShadow:n,textTransform:n,unicodeBidi:m,verticalAlign:"baseline",whiteSpace:m,wordSpacing:m,zIndex:a,mask:n,markerEnd:n,markerMid:n,markerStart:n,fillRule:"nonzero",enableBackground:"accumulate",filter:n,floodColor:"black",floodOpacity:"1",lightingColor:"white",pointerEvents:"visiblePainted",colorInterpolation:"sRGB",colorInterpolationFilters:"linearRGB",colorProfile:a,colorRendering:a,imageRendering:a,marker:"",shapeRendering:a,textRendering:a,alignmentBaseline:"",baselineShift:"baseline",dominantBaseline:a,glyphOrientationHorizontal:"0deg",glyphOrientationVertical:a,kerning:a};n=m=a=void 0;CSS2Properties.visibility._n=1;function CSSStyleSheet(){StyleSheet.apply(this);this.ownerRule=null;this.cssRules=[]}CSSStyleSheet.prototype=Object._create(StyleSheet);CSSStyleSheet.prototype.insertRule=function(g,e){var l=new CSSStyleRule(),b=l.style,j,f=g.match(/\{[\s\S]+\}/),c;l.parentStyleSheet=this;b.cssText=g;f=f.replace(/^[^a-z\-]+/,"").replace(/\:\s+/g,":").replace(/\s*;[^a-z\-]*/g,";");j=f.split(";");for(var d=0,k=j.length;d-1)){tar._attributeStyle.setProperty(name,evt.newValue,"")}if(evt.relatedNode.localName==="id"){tar.id=evt.newValue}else{if((name==="transform")&&!!tar.transform){var tft=evt.newValue,degR=tar._degReg,coma=tft.match(tar._comaReg),list=tft.match(tar._strReg),a,b,c,d,e,f,lis,com,deg,rad,degli,s,cm,degz,etod=evt.target.ownerDocument.documentElement,ttb=tar.transform.baseVal;for(var j=0,cli=coma.length;j="0"&&m<="9"){}else{if(m==="%"){if(tar._x1width[name]){tea.baseVal._percent=tvw*0.01}else{if(tar._y1height[name]){tea.baseVal._percent=tvh*0.01}else{tea.baseVal._percent=Math.sqrt((tvw*tvw+tvh*tvh)/2)*0.01}}type=2}else{if(n==="em"){type=3}else{if(n==="ex"){type=4}else{if(n==="px"){type=5}else{if(n==="cm"){type=6}else{if(n==="mm"){type=7}else{if(n==="in"){type=8}else{if(n==="pt"){type=9}else{if(n==="pc"){type=10}}}}}}}}}}s=_parseFloat(evt.newValue);s=isNaN(s)?0:s;tea.baseVal.newValueSpecifiedUnits(type,s);tea=tod=tvw=tvh=n=type=_parseFloat=s=void 0}}}}}}}evt=_parseFloat=name=tar=null},false)}SVGElement.prototype=Object._create(Element);NAIBU.eval=function(code){eval(code)};(function(){this._degReg=/[\-\d\.e]+/g;this._comaReg=/[A-Za-z]+(?=\s*\()/g;this._strReg=/\([^\)]+\)/g;this._syouReg=/^[^a-z\-]+/;this._conReg=/\:\s+/g;this._bouReg=/\s*;[^a-z\-]*/g;this._cacheMatrix=null;this._x1width={x:1,x1:1,x2:1,width:1,cx:1};this._y1height={y:1,y1:1,y2:1,height:1,cy:1};this.id=null;this.xmlbase=null;this.ownerSVGElement;this.viewportElement;this.nearestViewportElement=null;this.farthestViewportElement=null;this.getBBox=function(){var q=new SVGRect(),e=this._tar.path.value,c=this.ownerDocument.documentElement.viewport,b=c.width,l=c.height,p=0,j=0,o=e.match(/[0-9\-]+/g),g,f;for(var d=0,k=o.length;dg?g:b;l=l>f?f:l;p=p>g?p:g;j=j>f?j:f}q.x=b;q.y=l;q.width=p-b;q.height=j-l;g=f=e=o=b=l=p=j=c=void 0;return q};this.getCTM=function(){var c,b;if(!!this._cacheMatrix){c=this._cacheMatrix}else{b=this.transform.baseVal.consolidate();if(b){b=b.matrix}else{b=this.ownerDocument.documentElement.createSVGMatrix()}if(this.parentNode&&!!this.parentNode.getCTM){c=this.parentNode.getCTM().multiply(b)}else{c=b}b=void 0;this._cacheMatrix=c}return c};this.getScreenCTM=function(){if(!this.parentNode){return null}var b=this.nearestViewportElement||this.ownerDocument.documentElement;var c=b.getScreenCTM().multiply(this.getCTM());b=null;return c};this.getTransformToElement=function(b){var c=this.getScreenCTM().inverse().multiply(b.getScreenCTM());return c}}).apply(SVGElement.prototype);function SVGAnimatedBoolean(){this.animVal=this.baseVal=true}function SVGAnimatedString(){this.animVal=this.baseVal=""}function SVGStringList(){}SVGStringList.prototype=Object._create(Array);(function(){this.numberOfItems=0;this.clear=function(){for(var b=0,c=this.length;b=this.numberOfItems||b<0){throw (new DOMException(1))}else{return(this[b])}};this.insertItemBefore=function(c,b){if(b>=this.numberOfItems){this.appendItem(c)}else{this.splice(b,1,c,this.getItem[b]);++this.numberOfItems}return c};this.replaceItem=function(c,b){if(b>=this.numberOfItems||b<0){throw (new DOMException(1))}else{this.splice(b,1,c)}return c};this.removeItem=function(b){if(b>=this.numberOfItems||b<0){throw (new DOMException(1))}else{this.splice(b,1);--this.numberOfItems}return newItem};this.appendItem=function(b){this[this.numberOfItems]=b;++this.numberOfItems}}).apply(SVGStringList.prototype);function SVGAnimatedEnumeration(){this.baseVal=0;this.animVal=0}function SVGAnimatedInteger(){this.baseVal=0;this.animVal=0}function SVGNumber(){this.value=0}function SVGAnimatedNumber(){this.baseVal=this.animVal=0}function SVGNumberList(){}function SVGAnimatedNumberList(){this.animVal=this.baseVal=new SVGNumberList()}function SVGLength(){}SVGLength.prototype={unitType:0,value:0,valueInSpecifiedUnits:0,valueAsString:"0",_percent:0.01,_fontSize:12,newValueSpecifiedUnits:function(b,d){var e=1,c="";if(b===1){}else{if(b===5){c="px"}else{if(b===2){e=this._percent;c="%"}else{if(b===3){e=this._fontSize;c="em"}else{if(b===4){e=this._fontSize*0.5;c="ex"}else{if(b===6){e=35.43307;c="cm"}else{if(b===7){e=3.543307;c="mm"}else{if(b===8){e=90;c="in"}else{if(b===9){e=1.25;c="pt"}else{if(b===10){e=15;c="pc"}else{throw new DOMException(9)}}}}}}}}}}this.unitType=b;this.value=d*e;this.valueInSpecifiedUnits=d;this.valueAsString=d+c;d=b=e=c=void 0},convertToSpecifiedUnits:function(c){if(this.value===0){this.newValueSpecifiedUnits(c,0);return}var b=this.value;this.newValueSpecifiedUnits(c,this.valueInSpecifiedUnits);b=b/this.value*this.valueInSpecifiedUnits;this.newValueSpecifiedUnits(c,b)},_emToUnit:function(b){if((this.unitType===3)||(this.unitType===4)){this._fontSize=b;this.newValueSpecifiedUnits(this.unitType,this.valueInSpecifiedUnits)}}};function SVGAnimatedLength(){this.animVal;this.baseVal=new SVGLength();this.baseVal.unitType=1}function SVGLengthList(){}function SVGAnimatedLengthList(){this.animVal=this.baseVal=new SVGLengthList()}function SVGAngle(){}SVGAngle.prototype={unitType:0,value:0,valueInSpecifiedUnits:0,valueAsString:"0",newValueSpecifiedUnits:function(b,d){var e=1,c="";if(b===1){}else{if(b===2){c="deg"}else{if(b===3){e=Math.PI/180;c="rad"}else{if(b===4){e=9/10;c="grad"}else{throw new DOMException(9)}}}}this.unitType=b;this.value=d*e;this.valueInSpecifiedUnits=d;this.valueAsString=d+c;e=c=void 0},convertToSpecifiedUnits:function(c){if(this.value===0){this.newValueSpecifiedUnits(c,0);return}var b=this.value;this.newValueSpecifiedUnits(c,this.valueInSpecifiedUnits);b=b/this.value*this.valueInSpecifiedUnits;this.newValueSpecifiedUnits(c,b)}};function SVGAnimatedAngle(){this.baseVal=new SVGAngle();this.animVal=this.baseVal}function SVGColor(){CSSValue.apply(this);this.rgbColor=new RGBColor()}SVGColor.prototype=Object._create(CSSValue);(function(){this.colorType=0;this.iccColor=null;this._regD=/\d+/g;this._regDP=/[\d.]+%/g;this._exceptionsvg=1;this.setRGBColor=function(j){var e,d,i,f,c;if(!j||(typeof j!=="string")){throw new SVGException(this._exceptionsvg)}e=this._keywords[j];if(e){}else{if(j.indexOf("%",5)>0){j=j.replace(this._regDP,function(b){return Math.round((2.55*parseFloat(b)))});e=j.match(this._regD)}else{if(j.indexOf("#")===0){e=[];d=parseInt;if(j.length<5){i=j.charAt(1);f=j.charAt(2);c=j.charAt(3);j="#"+i+i+f+f+c+c}e[0]=d(j.slice(1,3),16)+"";e[1]=d(j.slice(3,5),16)+"";e[2]=d(j.slice(5,7),16)+"";i=f=c=void 0}else{e=j.match(this._regD);if(!e||(e.length<3)){j=void 0;throw new SVGException(this._exceptionsvg)}}}}this.rgbColor.red.setFloatValue(1,e[0]);this.rgbColor.green.setFloatValue(1,e[1]);this.rgbColor.blue.setFloatValue(1,e[2]);j=e=d=void 0};this.setColor=function(b,c,d){this.colorType=b;if((b===1)&&d){throw new SVGException(this._exceptionsvg)}else{if(b===1){this.setRGBColor(c)}else{if(c&&(b===3)){this.setRGBColor(c)}else{if((b===0)&&(c||d)){throw new SVGException(this._exceptionsvg)}else{if((b===2)&&(c||!d)){throw new SVGException(this._exceptionsvg)}}}}}b=c=void 0};this._keywords={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagree:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}).apply(SVGColor.prototype);function SVGRect(){this.x=0;this.y=0;this.width=0;this.height=0}function SVGAnimatedRect(){this.animVal=this.baseVal=new SVGRect()}function SVGStylable(){this.className=new SVGAnimatedString();this.style=new CSSStyleDeclaration();this._attributeStyle=new CSSStyleDeclaration()}SVGElement.prototype.getPresentationAttribute=function(b){var c=this._attributeStyle.getPropertyCSSValue(b);if(c){return c}else{return null}};function SVGURIReference(){this.href=new SVGAnimatedString();this._instance=null;this._text="";this.addEventListener("DOMAttrModified",function(b){if((b.relatedNode.namespaceURI==="http://www.w3.org/1999/xlink")&&(b.attrName==="xlink:href")){b.target.href.baseVal=b.newValue;b.target.ownerDocument.documentElement._svgload_limited++}b=void 0},false);this.addEventListener("DOMNodeInserted",function(c){var b=c.target;if(c.eventPhase===3){return}b.addEventListener("DOMNodeInsertedIntoDocument",function(k){var r=k.target,g=location.href,s=r.href.baseVal,A=r.ownerDocument,d=A.URL,f=/\.+\//g,q=/\/[^\/]+?(\/[^\/]*?)$/,l,u,e,z,v,i,B,o,p,j,t;if(s!==""){e=r.xmlbase;if(!e){z=r.parentNode;v=null;while(!v&&z){v=z.xmlbase;z=z.parentNode}e=v}l=function(C,D){if(s.indexOf(":")>-1){i=s}else{if(C.indexOf(":")>-1){D=C}else{f.lastIndex=0;while(f.exec(C)){D=D.replace(q,"$1")}D=D.replace(/\/[^\/]+?$/,"/");D=D+C.replace(f,"")}}return D};g=l(d,g);if(e){g=l(e,g)}if(s.indexOf("#")===0){i=s}else{if(!i){g=g.replace(/\/[^\/]+?$/,"/");f.lastIndex=0;while(f.exec(s)){g=g.replace(q,"$1")}i=g+s.replace(f,"")}}u=r.getAttributeNS("http://www.w3.org/1999/xlink","show")||"embed";if(u==="replace"){r._tar.setAttribute("href",i)}else{if(u==="new"){r._tar.setAttribute("target","_blank");r._tar.setAttribute("href",i)}else{if(u==="embed"){B=NAIBU.xmlhttp;o=i.indexOf("#");if(o>-1){p=i.slice(o+1);i=i.replace(/#.+$/,"")}else{p=null}if(s.indexOf("#")===0){j=A.getElementById(p);r._instance=j;t=A.createEvent("SVGEvents");t.initEvent("S_Load",false,false);r.dispatchEvent(t);r=B=void 0}else{if(i.indexOf("data:")>-1){r._tar.src=i;r=B=void 0}else{if((i.indexOf("http:")>-1)){if((r.localName==="image")&&(i.indexOf(".svg")===-1)){r._tar.src=i}else{r.ownerDocument.documentElement._svgload_limited++;B.open("GET",i,false);B.setRequestHeader("X-Requested-With","XMLHttpRequest");B.onreadystatechange=function(){if((B.readyState===4)&&(B.status===200)){var C=B.getResponseHeader("Content-Type")||"text",F,G,E,D;if((C.indexOf("text")>-1)||(C.indexOf("xml")>-1)||(C.indexOf("script")>-1)){if(r.localName!=="script"&&r.localName!=="style"){F=new ActiveXObject("MSXML2.DomDocument");G=B.responseText.replace(/!DOCTYPE/,"!--").replace(/(dtd">|\]>)/,"-->");NAIBU.doc.async=false;NAIBU.doc.validateOnParse=false;NAIBU.doc.resolveExternals=false;NAIBU.doc.preserveWhiteSpace=false;F.loadXML(G);E=F.documentElement;r._instance=r.ownerDocument.importNode(E,true);if(p){r._instance=r._instance.ownerDocument.getElementById(p)}}else{r._text=B.responseText}}else{if(!!r._tar){r._tar.src=i}}D=r.ownerDocument.createEvent("SVGEvents");D.initEvent("S_Load",false,false);r.dispatchEvent(D);r.ownerDocument.documentElement._svgload_limited--;if(r.ownerDocument.documentElement._svgload_limited<0){D=r.ownerDocument.createEvent("SVGEvents");D.initEvent("SVGLoad",false,false);r.ownerDocument.documentElement.dispatchEvent(D)}r=C=F=G=D=void 0;B.onreadystatechange=NAIBU.emptyFunction;B=void 0}};B.send(null)}}}}}}}r.ownerDocument.documentElement._svgload_limited--}k=g=s=e=l=z=d=v=f=i=o=p=A=j=t=u=void 0},false);b=c=void 0},false)}function SVGCSSRule(){CSSRule.apply(this);this.COLOR_PROFILE_RULE=7}SVGCSSRule.prototype=Object._create(CSSRule);function SVGDocument(){Document.apply(this);DocumentStyle.apply(this);this.title="";this.referrer=document.referrer;this.domain=document.domain;this.URL=document.location;this.rootElement}SVGDocument.prototype=Object._create(Document);SVGDocument.prototype._domnodeEvent=function(){var b=this.createEvent("MutationEvents");b.initMutationEvent("DOMNodeInsertedIntoDocument",false,false,null,null,null,null,null);return b};function SVGSVGElement(c){SVGElement.apply(this,arguments);c&&(this._tar=c.createElement("v:group"));c=void 0;this._svgload_limited=0;var b=SVGAnimatedLength;this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0;this.contentScriptType="application/ecmascript";this.contentStyleType="text/css";this.viewport=this.createSVGRect();this.useCurrentView=false;this.currentView=new SVGViewSpec(this);this.currentScale=1;this.currentTranslate=this.createSVGPoint();this.viewBox=this.currentView.viewBox;this.preserveAspectRatio=this.currentView.preserveAspectRatio;this.zoomAndPan=1;this._tx=0;this._ty=0;this._currentTime=0;this.addEventListener("DOMAttrModified",function(o){if(o.eventPhase===3){return}var g=o.target,e=o.attrName,f,l,i,j,k,d;if(e==="viewBox"){g._cacheScreenCTM=null;f=g.viewBox.baseVal;l=o.newValue.replace(/^\s+|\s+$/g,"").split(/[\s,]+/);f.x=parseFloat(l[0]);f.y=parseFloat(l[1]);f.width=parseFloat(l[2]);f.height=parseFloat(l[3]);g.viewBox.baseVal._isUsed=1}else{if(e==="preserveAspectRatio"){g._cacheScreenCTM=null;i=o.newValue;j=g.preserveAspectRatio.baseVal;k=1;d=0;if(!!i.match(/x(Min|Mid|Max)Y(Min|Mid|Max)(?:\s+(meet|slice))?/)){switch(RegExp.$1){case"Min":k+=1;break;case"Mid":k+=2;break;case"Max":k+=3;break}switch(RegExp.$2){case"Min":break;case"Mid":k+=3;break;case"Max":k+=6;break}if(RegExp.$3==="slice"){d=2}else{d=1}}j.align=k;j.meetOrSlice=d}else{if(e==="width"){g.viewport.width=g.width.baseVal.value}else{if(e==="height"){g.viewport.height=g.height.baseVal.value}}}}o=e=f=l=i=j=k=d=void 0},false);this.addEventListener("SVGLoad",function(d){d.target.addEventListener("DOMAttrModified",function(q){var l,r,f,o;if(q.eventPhase===3){l=q.target;if(l.parentNode){r=l.ownerDocument._domnodeEvent();r.target=l;r.eventPhase=2;f=l._capter;for(var g=0,e=f.length;gj?j:N;ad=Z>z?z:Z;W=B.currentStyle;l=V(W.left);f=V(W.top);X=-L._tx;bt=-L._ty;if(l!==0&&!isNaN(l)){X=l;ac.style.left=-X+"px"}if(f!==0&&!isNaN(l)){bt=f;ac.style.top=-bt+"px"}J=X+ab+1;aa=bt+ad+1;ae.clip="rect("+bt+"px "+J+"px "+aa+"px "+X+"px)";this._document=P;if("_svgload_limited" in P.documentElement){P.documentElement._svgload_limited--;if(P.documentElement._svgload_limited<0){var G=P.createEvent("SVGEvents");G.initEvent("SVGLoad",false,false);P.documentElement.dispatchEvent(G)}}F=P.documentElement._tar.getElementsByTagName("div");for(var Y=0,U;F[Y];++Y){U=F[Y];if(U.firstChild.nodeName!=="shape"){var c=U.style;c.left=V(c.left)-X+"px";c.top=V(c.top)-bt+"px";c=void 0}}M&&M.scroll(-P.documentElement._tx,-P.documentElement._ty);P._isLoaded=1;P.defaultView._cache=P.defaultView._cache_ele=null;e=g=G=q=C=L=r=A=D=T=K=S=p=ac=B=j=z=R=u=void 0;ae=W=F=U=Y=l=f=X=bt=F=V=N=Z=ab=ad=aa=J=void 0;this.xmlhttp.onreadystatechange=NAIBU.emptyFunction;if(this._next){M&&(v.contentWindow.screen.updateInterval=0);v=M=P=void 0;this._next._init()}else{if(P.implementation._buffer_){screen.updateInterval=0;NAIBU._buff_num=0;NAIBU._buff=setInterval(function(){var al=NAIBU._buff_num,af=DOMImplementation._buffer_,ak=af?af.length:0,aj,ag;if(ak===0){clearInterval(NAIBU._buff)}else{for(var ah=0;ah<50;++ah){aj=af[al];ag=af[al+1];aj.dispatchEvent(ag);al+=2;aj=ag=void 0;if(al>=ak){clearInterval(NAIBU._buff);DOMImplementation._buffer_=null;NAIBU.Time.start();af=al=ak=void 0;return}}NAIBU._buff_num=al}af=al=ak=void 0},1);v=M=P=void 0}else{v=M=P=void 0;NAIBU.Time.start()}delete NAIBU.doc}},getSVGDocument:function(){return(this._document)}};NAIBU.emptyFunction=function(){};function SVGStyleElement(b){SVGElement.apply(this);LinkStyle.apply(this);this.xmlspace;this.type="text/css";this.media;this.title;SVGURIReference.apply(this);this.addEventListener("DOMAttrModified",function(c){if(c.attrName==="type"){c.target.type=c.newValue}else{if(c.attrName==="title"){c.target.title=c.newValue}}c=void 0},false);this.addEventListener("S_Load",function(u){var q=u.target,s=q.sheet,c=q._text,g=q.ownerDocument,d=b.createElement("style"),t,p,k,f;NAIBU._temp_doc=g;s=g.styleSheets[g.styleSheets.length]=DOMImplementation.createCSSStyleSheet(q.title,q.media);s.ownerNode=q;b.documentElement.firstChild.appendChild(d);d.styleSheet.cssText=c;for(var o=0,v=d.styleSheet.rules,r=v.length;o-1)||(z.indexOf("#"+C.id)>-1)||(C.nodeName===z)){j[j.length]=G[A]}C._rules=j}C=E=G=void 0},true);q=u=d=s=c=g=o=v=r=void 0},false);this.addEventListener("DOMNodeInserted",function(d){var c=d.target;if(d.eventPhase===3){if(c.nodeName==="#cdata-section"){d.currentTarget._text=c.data}return}c.addEventListener("DOMNodeInsertedIntoDocument",function(g){var f=g.target;if((g.eventPhase===2)&&!f.getAttributeNodeNS("http://www.w3.org/1999/xlink","xlink:href")){var e=f.ownerDocument.createEvent("SVGEvents");e.initEvent("S_Load",false,false);g.currentTarget.dispatchEvent(e)}f=g=void 0},false)},false)}SVGStyleElement.prototype=Object._create(SVGElement);function SVGPoint(){}SVGPoint.prototype.x=SVGPoint.prototype.y=0;SVGPoint.prototype.matrixTransform=function(b){if(!isFinite(b.a)||!isFinite(b.b)||!isFinite(b.c)||!isFinite(b.d)||!isFinite(b.e)||!isFinite(b.f)){throw (new Error("Type Error: 引数の値がNumber型ではありません"))}var c=new SVGPoint();c.x=b.a*this.x+b.c*this.y+b.e;c.y=b.b*this.x+b.d*this.y+b.f;return c};function SVGPointList(){}function SVGMatrix(){}SVGMatrix.prototype={a:1,b:0,c:0,d:1,e:0,f:0,multiply:function(c){var f=new SVGMatrix(),b=c,e=isFinite,d=this;if(!e(b.a)||!e(b.b)||!e(b.c)||!e(b.d)||!e(b.e)||!e(b.f)){throw (new Error("Type Error: 引数の値がNumber型ではありません"))}f.a=d.a*b.a+d.c*b.b;f.b=d.b*b.a+d.d*b.b;f.c=d.a*b.c+d.c*b.d;f.d=d.b*b.c+d.d*b.d;f.e=d.a*b.e+d.c*b.f+d.e;f.f=d.b*b.e+d.d*b.f+d.f;b=d=c=e=void 0;return f},inverse:function(){var b=new SVGMatrix(),c=this._determinant();if(c!==0){b.a=this.d/c;b.b=-this.b/c;b.c=-this.c/c;b.d=this.a/c;b.e=(this.c*this.f-this.d*this.e)/c;b.f=(this.b*this.e-this.a*this.f)/c;return b}else{throw (new SVGException(2))}},translate:function(c,e){var b=new SVGMatrix();b.e=c;b.f=e;var d=this.multiply(b);b=void 0;return d},scale:function(d){var b=new SVGMatrix();b.a=d;b.d=d;var c=this.multiply(b);b=void 0;return c},scaleNonUniform:function(c,e){var b=new SVGMatrix();b.a=c;b.d=e;var d=this.multiply(b);b=void 0;return d},rotate:function(e){var c=new SVGMatrix(),b=e/180*Math.PI;c.a=Math.cos(b);c.b=Math.sin(b);c.c=-c.b;c.d=c.a;var d=this.multiply(c);c=b=void 0;return d},rotateFromVector:function(d,f){if((d===0)||(f===0)||!isFinite(d)||!isFinite(f)){throw (new SVGException(1))}var c=new SVGMatrix(),b=Math.atan2(f,d);c.a=Math.cos(b);c.b=Math.sin(b);c.c=-c.b;c.d=c.a;var e=this.multiply(c);c=b=void 0;return e},flipX:function(){var b=new SVGMatrix();b.a=-b.a;var c=this.multiply(b);b=void 0;return c},flipY:function(){var b=new SVGMatrix();b.d=-b.d;var c=this.multiply(b);b=void 0;return c},skewX:function(e){var c=new SVGMatrix(),b=e/180*Math.PI;c.c=Math.tan(b);var d=this.multiply(c);c=void 0;return d},skewY:function(e){var c=new SVGMatrix(),b=e/180*Math.PI;c.b=Math.tan(b);var d=this.multiply(c);c=void 0;return d},_determinant:function(){return(this.a*this.d-this.b*this.c)}};function SVGTransform(){this.matrix=new SVGMatrix()}SVGTransform.prototype={_matrix:(new SVGMatrix()),type:0,angle:0,setMatrix:function(b){this.type=1;this.matrix=this._matrix.multiply(b)},setTranslate:function(c,b){this.type=2;this.matrix=this._matrix.translate(c,b)},setScale:function(c,b){this.type=3;this.matrix=this._matrix.scaleNonUniform(c,b)},setRotate:function(c,b,d){this.angle=c;this.type=4;this.matrix=this._matrix.rotate(c);this.matrix.e=(1-this.matrix.a)*b-this.matrix.c*d;this.matrix.f=-this.matrix.b*b+(1-this.matrix.d)*d},setSkewX:function(b){this.angle=b;this.type=5;this.matrix=this._matrix.skewX(b)},setSkewY:function(b){this.angle=b;this.type=6;this.matrix=this._matrix.skewY(b)}};function SVGTransformList(){}SVGTransformList.prototype.createSVGTransformFromMatrix=function(b){var c=new SVGTransform();c.setMatrix(b);return c};SVGTransformList.prototype.consolidate=function(){if(this.numberOfItems===0){return null}else{var e=this.getItem(0),c=e.matrix;for(var d=1,b=this.numberOfItems;d0){E=k.split(",");for(var L=0,g=E.length;L-1)){e.style.display="none"}else{if(H&&!H._isDefault&&(H.cssText.indexOf("inline-block")===-1)){e.style.display="inline-block"}}}Q=j=e=I=u=N=s=P=p=M=K=C=H=v=void 0};function b(f){SVGElement.apply(this);this._tar=f.createElement("v:shape");var e=SVGPathSegList;this.pathSegList=new e();this.animatedPathSegList=this.pathSegList;this.normalizedPathSegList=new e();e=f=void 0;this.animatedNormalizedPathSegList=this.normalizedPathSegList;this.pathLength=new SVGAnimatedNumber();this.addEventListener("DOMAttrModified",this._attrModi,false);this.addEventListener("DOMNodeInserted",this._nodeInsert,false)}b.prototype=Object._create(SVGElement);(function(e){e._attrModi=function(K){var P=K.target;if(K.attrName==="d"&&K.newValue!==""){var H=P.normalizedPathSegList,O=P.pathSegList;if(H.numberOfItems>0){H.clear();O.clear()}var V=P._com,S=V.isSp,v=K.newValue.replace(V.isRa," -").replace(V.isRb," ").replace(V.isRc,",$1 ").replace(V.isRd,",$1 1").replace(V.isRe,"").replace(/\.(\d+)\./g,".$1 0.").replace(/[^\w\d\+\-\.\,\n\r\s].*/,"").split(","),l=v.length,B=V._isZ,E=V._isM,L=V._isC,F=V._isL,r=P.createSVGPathSegCurvetoCubicAbs,Q=P.createSVGPathSegLinetoAbs,M,q;for(var U=0;U1&&(+M>=0)){u.splice(T+3,1,M.charAt(0),M.slice(1));++J}q=u[T+4];if(q.length>1&&(+q>=0)){u.splice(T+4,1,q.charAt(0),q.slice(1));++J}M=u[T+3];q=u[T+4];if(((+M<0)||(+M>1))||((+q<0)||(+q>1))){T+=6;continue}R=P.createSVGPathSegArcAbs(+u[T+5],+u[T+6],+u[T],+u[T+1],+u[T+2],+M,+q);T+=6}else{if(g==="m"){R=P.createSVGPathSegMovetoRel(+u[T],+u[T+1]);++T}else{if(g==="l"){R=P.createSVGPathSegLinetoRel(+u[T],+u[T+1]);++T}else{if(g==="c"){R=P.createSVGPathSegCurvetoCubicRel(+u[T+4],+u[T+5],+u[T],+u[T+1],+u[T+2],+u[T+3]);T+=5}else{if(g==="Q"){R=P.createSVGPathSegCurvetoQuadraticAbs(+u[T+2],+u[T+3],+u[T],+u[T+1]);T+=3}else{if(g==="q"){R=P.createSVGPathSegCurvetoQuadraticRel(+u[T+2],+u[T+3],+u[T],+u[T+1]);T+=3}else{if(g==="a"){M=u[T+3];if(M.length>1&&(+M>=0)){u.splice(T+3,1,M.charAt(0),M.slice(1));++J}q=u[T+4];if(q.length>1&&(+q>=0)){u.splice(T+4,1,q.charAt(0),q.slice(1));++J}M=u[T+3];q=u[T+4];if(((+M<0)||(+M>1))||((+q<0)||(+q>1))){T+=6;continue}R=P.createSVGPathSegArcRel(+u[T+5],+u[T+6],+u[T],+u[T+1],+u[T+2],+M,+q);T+=6}else{if(g==="S"){R=P.createSVGPathSegCurvetoCubicSmoothAbs(+u[T+2],+u[T+3],+u[T],+u[T+1]);T+=3}else{if(g==="s"){R=P.createSVGPathSegCurvetoCubicSmoothRel(+u[T+2],+u[T+3],+u[T],+u[T+1]);T+=3}else{if(g==="T"){R=P.createSVGPathSegCurvetoQuadraticSmoothAbs(+u[T],+u[T+1]);++T}else{if(g==="t"){R=P.createSVGPathSegCurvetoQuadraticSmoothRel(+u[T],+u[T+1]);++T}else{if(g==="H"){R=P.createSVGPathSegLinetoHorizontalAbs(+u[T])}else{if(g==="h"){R=P.createSVGPathSegLinetoHorizontalRel(+u[T])}else{if(g==="V"){R=P.createSVGPathSegLinetoVerticalAbs(+u[T])}else{if(g==="v"){R=P.createSVGPathSegLinetoVerticalRel(+u[T])}else{R=new SVGPathSeg()}}}}}}}}}}}}}}}}}}}O.appendItem(R)}}u=R=S=v=void 0;var D=0,C=0,N=0,A=0,p=0,o=0;for(var T=0,t=O.numberOfItems;T1){an=c.sqrt(aS)*an;am=c.sqrt(aS)*am;aL=0}else{var ag=1;if(Z.largeArcFlag===aK){ag=-1}aL=ag*c.sqrt((aA*ah-aA*ae-ah*ak)/(aA*ae+ah*ak))}var aq=aL*an*al/am,s=-1*aL*am*aB/an,aN=Y*aq-aC*s+(az+aw)/2,aM=aC*aq+Y*s+(ax+av)/2,ab=c.atan2((al-s)/am,(aB-aq)/an)-c.atan2(0,1),aP=(ab>=0)?ab:2*c.PI+ab,ab=c.atan2((-al-s)/am,(-aB-aq)/an)-c.atan2((al-s)/am,(aB-aq)/an),af=(ab>=0)?ab:2*c.PI+ab;if(!aK&&af>0){af-=2*c.PI}else{if(aK&&af<0){af+=2*c.PI}}var ac=af*2/c.PI,aD=c.ceil(ac<0?-1*ac:ac),aE=af/aD,aI=8/3*c.sin(aE/4)*c.sin(aE/4)/c.sin(aE/2),aH=Y*an,aG=Y*am,j=aC*an,i=aC*am,ar=c.cos(aP),aj=c.sin(aP),ap=az-aI*(aH*aj+i*ar),aR=ax-aI*(j*aj-aG*ar);for(var aJ=0;aJ-1){}else{N=I,A=G}}else{N=I,A=G}H.appendItem(r(D,C,(I+2*N)/3,(G+2*A)/3,(2*N+D)/3,(2*A+C)/3));N=2*D-N;A=2*C-A;xx1=yy1=void 0}else{if(g==="H"||g==="h"){H.appendItem(Q(D,G));C=G}else{if(g==="V"||g==="v"){H.appendItem(Q(I,C));D=I}}}}}}}}}}}}}}}}}}K=P=V=D=C=N=A=p=o=H=O=f=g=W=B=E=F=L=R=r=Q=void 0};e._nodeInsert=function(g){var f=g.target;if(g.eventPhase===3){return}var k=f.nextSibling,i=f.parentNode._tar,j=true;if(k&&k._tar&&i&&(k._tar.parentNode===i)){i.insertBefore(f._tar,k._tar)}else{if(k&&!k._tar&&i){while(k){if(k._tar&&(k._tar.parentNode===i)){i.insertBefore(f._tar,k._tar);j=false}k=k.nextSibling}if(j){i.appendChild(f._tar)}}else{if(!k&&i){i.appendChild(f._tar)}}}k=i=j=void 0;f.addEventListener("DOMNodeInsertedIntoDocument",f._nodeInsertInto,false);g=f=void 0};e._nodeInsertInto=function(r){var z=r.target,v=z.getScreenCTM(),p=z.normalizedPathSegList,D=[],j=v.a,g=v.b,K=v.c,J=v.d,I=v.e,H=v.f,k=z._com._nameCom,o=z._com._isZ,B=z._com._isC,s=c.round;for(var A=0,u=p.numberOfItems;AT/2){k.value=T/2}if(j.value>l/2){j.value=l/2}var v=k.value,J=j.value,t=v*0.55228,s=J*0.55228,W=u-v,S=A+v,R=z+J,Q=X-J;O=["m",S,z,"l",W,z,"c",W+t,z,u,R-s,u,R,"l",u,Q,"c",u,Q+s,W+t,X,W,X,"l",S,X,"c",S-t,X,A,Q+s,A,Q,"l",A,R,"c",A,R-s,S-t,z,S,z]}else{O=["m",A,z,"l",A,X,u,X,u,z,"x e"]}var D=L.ownerDocument.documentElement,V=L.getScreenCTM(),P,G,F,C=L._tar,U=L.ownerDocument.documentElement,B=U.width.baseVal.value,M=U.height.baseVal.value,H=Math.round;for(var K=0,I=O.length;K0)){c.newValueSpecifiedUnits(1,this.getSubStringLength(0,this.getNumberOfChars()))}c=void 0;return(this.textLength.baseVal.value)};b.prototype.getSubStringLength=function(e,i){if(i===0){return 0}var g=this.getNumberOfChars();if(g<(i+e)){i=g-e+1}var c=this.getEndPositionOfChar(i+e-1),d=this.getStartPositionOfChar(e);if(this._isYokogaki){var f=c.x-d.x}else{var f=c.y-d.y}g=c=d=void 0;return f};b.prototype.getStartPositionOfChar=function(d){if(d>this.getNumberOfChars()||d<0){throw (new DOMException(1))}else{var M=this,l=M.firstChild,g=M.parentNode;if(!!!M._list){M._list=[];var C=M._chars,A=M._stx,z=M._sty,F=0,N=M.ownerDocument.defaultView.getComputedStyle(M,null),t=((N.getPropertyValue("writing-mode"))==="lr-tb")?true:false,k=parseFloat(N.getPropertyValue("font-size")),R=M.x.baseVal,Q=M.y.baseVal,G=M.dx.baseVal,E=M.dy.baseVal;if(g&&((g.localName==="text")||(g.localName==="tspan"))){var P=g.x.baseVal,O=g.y.baseVal,u=g.dx.baseVal,r=g.dy.baseVal}else{var P=O=u=r={numberOfItems:0}}var o="f ijltIr.,:;'-\"()",j="1234567890abcdeghknopquvxyz",c,f,e,H,D,K,J,v,q;if(t&&(M.localName==="text")){z+=k*0.2}else{if(M.localName==="text"){A-=k*0.5}}while(l){if(l.nodeType===3){c=l._tars;for(var L=0,I=c.length;L-1){f=k*0.68}else{if(e==="s"){f=k*0.52}else{if((e==="C")||(e==="D")||(e==="M")||(e==="W")||(e==="G")||(e==="m")){f=k*0.2}else{if(j.indexOf(e)>-1){f=k*0.45}else{f=k*0.3}}}}H=e.charCodeAt(0);if((12288<=H)&&(H<=65533)){f=-k*0.01;if((e==="う")||(e==="く")||(e==="し")||(e==="ち")){f+=k*0.2}}}v=M._list;v[v.length]=A;v[v.length]=z;v[v.length]=k-f;if(t){A+=k;A-=f}else{z+=k}++F}C+=I;if(l.parentNode&&(l.parentNode.localName==="a")){l=l.parentNode}l=l.nextSibling}else{if(((l.localName==="tspan")||(l.localName==="tref"))&&(l.namespaceURI==="http://www.w3.org/2000/svg")&&l.firstChild){l._stx=A;l._sty=z;l._chars=C;D=l.getStartPositionOfChar(l.getNumberOfChars());K=0;J=0;v=l._list;if(t){K=v[v.length-1]}else{J=v[v.length-1]}A=v[v.length-3]+K;z=v[v.length-2]+J;M._list=M._list.concat(v);q=l.getNumberOfChars();F+=q;C+=q;l=l.nextSibling}else{if((l.localName==="a")&&(l.namespaceURI==="http://www.w3.org/2000/svg")&&l.firstChild){l=l.firstChild}else{l=l.nextSibling}}}}M._isYokogaki=t}M=l=g=P=O=R=Q=C=N=A=z=t=o=j=c=f=e=H=D=K=J=v=q=void 0;var B=this.ownerDocument.documentElement.createSVGPoint();B.x=this._list[d*3];B.y=this._list[d*3+1];B=B.matrixTransform(this.getScreenCTM());return B}};b.prototype.getEndPositionOfChar=function(c){if(c>this.getNumberOfChars()||c<0){throw (new DOMException(1))}else{var d=this.getStartPositionOfChar(c);var e=this._list[c*3+2]*Math.sqrt(Math.abs(this.getScreenCTM()._determinant()));if(this._isYokogaki){d.x+=e}else{d.y+=e}return d}};b.prototype.getExtentOfChar=function(c){};b.prototype.getRotationOfChar=function(c){};b.prototype.getCharNumAtPosition=function(c){};b.prototype.selectSubString=function(c,d){}})(SVGTextContentElement);function SVGTextPositioningElement(c){SVGTextContentElement.apply(this,arguments);var b=SVGAnimatedLengthList;this.x=new b();this.y=new b();this.dx=new b();this.dy=new b();b=void 0;this.rotate=new SVGAnimatedNumberList();this.addEventListener("DOMAttrModified",function(t){var o=t.target,f=t.attrName,k=o.ownerDocument.documentElement,j=parseFloat;if((f==="x")||(f==="y")||(f==="dx")||(f==="dy")){var q=t.newValue.replace(/^\s+|\s+$/g,"").split(/[\s,]+/),u=o[f].baseVal;for(var l=0,e=q.length;l="0"&&g<="9"){p=1}else{if(g==="%"){if((f==="x")||(f==="dx")){r._percent*=k.viewport.width}else{if((f==="y")||(f==="dy")){r._percent*=k.viewport.height}}p=2}else{g=q[l].slice(-2);if(g==="em"){var d=o.ownerDocument.defaultView.getComputedStyle(o,null);r._percent*=j(d.getPropertyValue("font-size"));d=void 0;p=3}else{if(g==="ex"){p=4}else{if(g==="px"){p=5}else{if(g==="cm"){p=6}else{if(g==="mm"){p=7}else{if(g==="in"){p=8}else{if(g==="pt"){p=9}else{if(g==="pc"){p=10}}}}}}}}}}var v=j(q[l]);v=isNaN(v)?0:v;r.newValueSpecifiedUnits(p,v);u.appendItem(r)}o._list=null}t=o=void 0},false);this.addEventListener("DOMNodeInserted",function(e){if(e.eventPhase===3){var d=e.target;if(d.nodeType!==3){d._list=void 0;e.currentTarget._list=null}e=d=void 0}},false);if(c){this._tar=c.createElement("v:group");this._doc=c}this.addEventListener("DOMNodeInserted",function(e){if(e.eventPhase===3){return}var d=e.target,i=d.nextSibling,f=d.parentNode._tar,g=true;if(i&&i._tar&&f&&(i._tar.parentNode===f)){f.insertBefore(d._tar,i._tar)}else{if(i&&!i._tar&&f){while(i){if(i._tar&&(i._tar.parentNode===f)){f.insertBefore(d._tar,i._tar);g=false}i=i.nextSibling}if(g){f.appendChild(d._tar)}}else{if(!i&&f){f.appendChild(d._tar)}}}i=f=g=void 0;d.addEventListener("DOMNodeInsertedIntoDocument",d._texto,false);e=d=void 0},false)}SVGTextPositioningElement.prototype=Object._create(SVGTextContentElement);SVGTextPositioningElement.prototype._texto=function(I){var L=I.target,b=L.firstChild,F=L._tar,N=L.ownerDocument.defaultView.getComputedStyle(L,null),D=Math.sqrt(Math.abs(L.getScreenCTM()._determinant())),O=parseFloat(N.getPropertyValue("font-size"))*D,u=L.ownerDocument.documentElement,J=F,V=L.getComputedTextLength(),f=N.getPropertyValue("text-anchor"),d=N.getPropertyValue("text-decoration"),B=F.style,t=[],A=parseFloat(N.getPropertyValue("letter-spacing")),v=parseFloat(N.getPropertyValue("word-spacing"));B.fontSize=O+"px";B.fontFamily=N.getPropertyValue("font-family");B.fontStyle=N.getPropertyValue("font-style");B.fontWeight=N.getPropertyValue("font-weight");if(isFinite(A)){B.letterSpacing=A*D+"px"}if(isFinite(parseFloat(v))){B.wordSpacing=v*D+"px"}for(var U=0,T=0,r=L.getNumberOfChars();UT)?U-T:T-U;var H=b._tars[K].style,M=L.getStartPositionOfChar(U);H.position="absolute";if(L._isYokogaki){if(f==="middle"){M.x-=V/2}else{if(f==="end"){M.x-=V}}}else{if(f==="middle"){M.y-=V/2}else{if(f==="end"){M.y-=V}}}H.left=M.x+"px";H.top=M.y+"px";H.width="0px";H.height="0px";H.marginTop=L._isYokogaki?-O-5+"px":"-5px";H.lineHeight=O+10+"px";H.textDecoration=d;H.display="none";F.appendChild(b._tars[K]);H=M=void 0}if(b.nodeName==="#text"){if((b.data.length+T)<=U+1){T=T+b.data.length;if(b.data===""){--U}if(b.parentNode.localName==="a"){b=b.parentNode;F=J}b=b.nextSibling}}else{if(!!b.getNumberOfChars){if((b.getNumberOfChars()+T)<=U+1){T=T+b.getNumberOfChars();b=b.nextSibling}}else{if((b.localName==="a")&&(b.namespaceURI==="http://www.w3.org/2000/svg")&&b.firstChild){F=b._tar;b=b.firstChild;t[t.length]=b;if(U===0){--U}else{U-=2}}}}}}var G=N.getPropertyValue("fill"),g=N.getPropertyCSSValue("cursor"),R=N.getPropertyCSSValue("visibility"),q=N.getPropertyCSSValue("display"),E=L._tar.style,c=L.firstChild._tars,C=c[0]?c[0].innerText.charAt(0):[""],P;if(G==="none"){E.color="transparent"}else{if(G.indexOf("url")===-1){E.color=G}else{E.color="black"}}if(g&&!g._isDefault){var e=g.cssText;E.cursor=e.split(":")[1];e=void 0}if((L.x.baseVal.numberOfItems===1)&&(L.y.baseVal.numberOfItems===1)&&L._isYokogaki&&(L.firstChild.nodeName==="#text")){for(var U=1,r=c.length;U-1)){s="none"}else{if(q&&!q._isDefault){s="block"}}var o=L._tar.firstChild,T=0;while(o){o.style.display=s;o=o.nextSibling}while(t[T]){for(var Q=0,r=t[T]._tars.length;Q102&&!e)){throw new SVGException(1)}this.uri=e;this.paintType=c;if(c===102){c=3}this.setColor(c,d,f)};b=void 0})(SVGPaint);function SVGMarkerElement(){SVGSVGElement.apply(this,[{createElement:function(){}}]);this._tar={style:{}};var b=SVGAnimatedLength;this.refX=new b();this.refY=new b();this.markerUnits=new SVGAnimatedEnumeration();this.markerUnits.baseVal=2;this.markerWidth=new b();this.markerHeight=new b();this.refX.baseVal.newValueSpecifiedUnits(1,0);this.refY.baseVal.newValueSpecifiedUnits(1,0);this.markerWidth.baseVal.newValueSpecifiedUnits(1,3);this.markerHeight.baseVal.newValueSpecifiedUnits(1,3);b=void 0;this.orientType=new SVGAnimatedEnumeration();this.orientType.baseVal=2;this.orientAngle=new SVGAnimatedAngle();this.addEventListener("DOMAttrModified",function(d){var c=d.target,e=d.newValue,f;if(d.attrName==="orient"){if(e==="auto"){c.setOrientToAuto()}else{f=c.ownerDocument.documentElement.createSVGAngle();f.newValueSpecifiedUnits(1,+e);c.setOrientToAngle(f)}}else{if(d.attrName==="markerUnits"){if(e==="strokeWidth"){c.markerUnits.baseVal=2}else{c.markerUnits.baseVal=1}}}},false);this.addEventListener("DOMNodeInsertedIntoDocument",function(c){var d=NAIBU._setPaint,e=c.target.getAttributeNS(null,"id");NAIBU._setPaint=(function(f,g){return function(E,J){f(E,J);var r=E.ownerDocument,j=r.documentElement,F=r.defaultView.getComputedStyle(E,""),D=F.getPropertyValue("marker-start").slice(5,-1),L=F.getPropertyValue("marker-end").slice(5,-1),H=F.getPropertyValue("marker-mid").slice(5,-1),q,s,l,i,k,o,G,J,I,p,K,A,C,v,z,B=function(t,M){s=q.cloneNode(true);l=r.createElementNS("http://www.w3.org/2000/svg","g");while(s.lastChild){l.appendChild(s.lastChild)}i=l.transform.baseVal;o=E.transform.baseVal.consolidate()||r.documentElement.createSVGMatrix();if(q.markerUnits.baseVal===2){G=+F.getPropertyValue("stroke-width")}else{G=1}if(q.hasAttributeNS(null,"viewBox")){q.viewport.width=q.markerWidth.baseVal.value;q.viewport.height=q.markerHeight.baseVal.value;J=j.getScreenCTM.apply(q)}else{J=j.createSVGMatrix()}if(q.orientType.baseVal===1){angle=Math.atan2(K[1].y-K[0].y,K[1].x-K[0].x)*180/Math.PI}else{angle=q.orientAngle.baseVal.value}i.appendItem(i.createSVGTransformFromMatrix(o.translate(t,M).rotate(angle).scale(G).multiply(J).translate(-q.refX.baseVal.value,-q.refY.baseVal.value)));I=r.defaultView.getComputedStyle(q,"");p=l.style;A=/([A-Z])/;C=/\-/;for(var u in CSS2Properties){if(CSS2Properties.hasOwnProperty(u)&&(u!=="_list")){u=u.replace(A,"-");if(RegExp.$1){v="-"+RegExp.$1.toLowerCase()}else{v="-"}u=u.replace(C,v);p.setProperty(u,I.getPropertyValue(u),"")}}E.parentNode.insertBefore(l,E.nextSibling)};if(D===g){q=r.getElementById(D);if(E.normalizedPathSegList||E.points){k=E.normalizedPathSegList||E.points;K=[k.getItem(0),k.getItem(1)]}else{if(E.x1){K=[{x:E.x1,y:E.y1},{x:E.x2,y:E.y2}]}}B(K[0].x,K[0].y)}if(L===g){q=r.getElementById(L);if(E.normalizedPathSegList||E.points){k=E.normalizedPathSegList||E.points;K=[k.getItem(k.numberOfItems-2),k.getItem(k.numberOfItems-1)]}else{if(E.x1){K=[{x:E.x1,y:E.y1},{x:E.x2,y:E.y2}]}}B(K[1].x,K[1].y)}if(H===g){q=r.getElementById(H)}r=j=F=I=p=D=L=H=q=s=l=J=G=i=k=o=K=A=C=v=z=B=void 0}})(d,e)},false)}(function(b){b.prototype=Object._create(SVGSVGElement);b.prototype.getScreenCTM=SVGElement.prototype.getScreenCTM;b.prototype.setOrientToAuto=function(){this.orientType.baseVal=1};b.prototype.setOrientToAngle=function(c){this.orientType.baseVal=2;this.orientAngle.baseVal=c}})(SVGMarkerElement);function SVGColorProfileElement(){SVGElement.apply(this);this._local;this.name;this.renderingIntent;SVGURIReference.apply(this)}SVGColorProfileElement.prototype=Object._create(SVGElement);function SVGColorProfileRule(){SVGCSSRule.apply(this);this.src;this.name;this.renderingIntent}SVGColorProfileRule.prototype=Object._create(SVGCSSRule);function SVGGradientElement(){SVGElement.apply(this);SVGURIReference.apply(this);this.gradientUnits=new SVGAnimatedEnumeration();this.gradientTransform=new SVGAnimatedTransformList();this.spreadMethod=new SVGAnimatedEnumeration();this.addEventListener("DOMNodeInsertedIntoDocument",function(q){var p=q.target,v=q._tar,s=q._style,k=p,c,r,e,g=[],b=[],l=[],o,f,u;if(!v||!p){p=v=s=k=c=r=e=g=b=l=void 0;return}if(p._instance){k=p._instance}r=k.getElementsByTagNameNS("http://www.w3.org/2000/svg","stop");if(!r){v=s=c=p=k=r=g=b=l=void 0;return}e=r.length;for(var j=0;j=360){g-=360}f.setAttribute("type","gradient");f.setAttribute("angle",g+"");c=f=i=g=d=e=void 0},false)}SVGLinearGradientElement.prototype=Object._create(SVGGradientElement);function SVGRadialGradientElement(c){SVGGradientElement.apply(this);var b=SVGAnimatedLength;this.cx=new b();this.cy=new b();this.r=new b();this.fx=new b();this.fy=new b();b=void 0;this.cx.baseVal.value=this.cy.baseVal.value=this.r.baseVal.value=0.5;this.addEventListener("DOMNodeInsertedIntoDocument",function(C){var o=C.target,Y=C._tar,E=C._ttar;if(!!!Y){return}Y.setAttribute("type","gradientTitle");Y.setAttribute("focus","100%");Y.setAttribute("focusposition","0.5 0.5");if(E.localName==="rect"){var M=o.ownerDocument.defaultView.getComputedStyle(E,""),l=parseFloat(M.getPropertyValue("font-size"));o.cx.baseVal._emToUnit(l);o.cy.baseVal._emToUnit(l);o.r.baseVal._emToUnit(l);o.fx.baseVal._emToUnit(l);o.fy.baseVal._emToUnit(l);var z=o.cx.baseVal.value,u=o.cy.baseVal.value,I=o.r.baseVal.value,f=Math.round,B,A;B=A=I;var G=E.getBBox(),s=E.ownerDocument.documentElement.viewport,U=f(s.width),J=f(s.height),O=0,d=0,V=o.getAttributeNS(null,"gradientUnits");if(!V||V==="objectBoundingBox"){z=z>1?z/100:z;u=u>1?u/100:u;I=I>1?I/100:I;var P=G.x,L=G.y,T=G.width,R=G.height;z=z*T+P;u=u*R+L;B=I*T;A=I*R;P=L=T=R=void 0}var D=E.getScreenCTM().multiply(o.getCTM());U=z-B;J=u-A;O=z+B;d=u+A;var k=B*0.55228,j=A*0.55228,v=["m",z,J,"c",z-k,J,U,u-j,U,u,U,u+j,z-k,d,z,d,z+k,d,O,u+j,O,u,O,u-j,z+k,J,z,J,"x e"];for(var Q=0,N=v.length;Q'+Y.outerHTML+"",W=E._tar.path.value;F.innerHTML='';F.filters[0].apply();F.innerHTML=q;F.filters[0].play();E._tar.parentNode.insertBefore(F,E._tar);E._tar.filled="false";X=e=F=M=l=t=q=W=v=f=gt=z=u=I=H=S=D=void 0}else{if(!Y.parentNode){E._tar.appendChild(Y)}}C=E=Y=gard=void 0},false)}SVGRadialGradientElement.prototype=Object._create(SVGGradientElement);function SVGStopElement(){SVGElement.apply(this);this.offset=new SVGAnimatedNumber();this.addEventListener("DOMAttrModified",function(b){if(b.attrName==="offset"){b.target.offset.baseVal=parseFloat(b.newValue)}b=void 0},false)}SVGStopElement.prototype=Object._create(SVGElement);function SVGPatternElement(){SVGElement.apply(this);var b=SVGAnimatedLength;this.patternUnits=new SVGAnimatedEnumeration();this.patternContentUnits=new SVGAnimatedEnumeration();this.patternTransform=new SVGAnimatedTransformList();this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0;SVGURIReference.apply(this);this.viewBox=new SVGAnimatedRect();this.preserveAspectRatio=new SVGAnimatedPreserveAspectRatio();this.zoomAndPan=1}SVGPatternElement.prototype=Object._create(SVGElement);function SVGClipPathElement(){SVGElement.apply(this);this.clipPathUnits=new SVGAnimatedEnumeration()}SVGClipPathElement.prototype=Object._create(SVGElement);function SVGMaskElement(){SVGElement.apply(this);var b=SVGAnimatedLength;this.maskUnits=new SVGAnimatedEnumeration();this.maskContentUnits=new SVGAnimatedEnumeration();this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0}SVGMaskElement.prototype=Object._create(SVGElement);function SVGFilterElement(){SVGElement.apply(this);var b=SVGAnimatedLength;this.filterUnits=new SVGAnimatedEnumeration();this.primitiveUnits=new SVGAnimatedEnumeration();this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0;this.filterResX=new SVGAnimatedInteger();this.filterResY=new SVGAnimatedInteger();SVGURIReference.apply(this)}SVGFilterElement.prototype=Object._create(SVGElement);function SVGFilterPrimitiveStandardAttributes(c){SVGStylable.apply(this,arguments);this._tar=c;var b=SVGAnimatedLength;this.x=new b();this.y=new b();this.width=new b();this.height=new b();this.result=new b();b=void 0}SVGFilterPrimitiveStandardAttributes.prototype=Object._create(SVGStylable);function SVGFEBlendElement(){SVGElement.apply(this);this.in1=new SVGAnimatedString();this.in2=new SVGAnimatedString();this.mode=new SVGAnimatedEnumeration();this._fpsa=SVGFilterPrimitiveStandardAttributes(this)}SVGFEBlendElement.prototype=Object._create(SVGElement);function SVGFEGaussianBlurElement(){SVGElement.apply(this);this.in1=new SVGAnimatedString();this.stdDeviationX=new SVGAnimatedNumber();this.stdDeviationY=new SVGAnimatedNumber();this._fpsa=SVGFilterPrimitiveStandardAttributes(this)}SVGFEGaussianBlurElement.prototype=Object._create(SVGElement);SVGFEGaussianBlurElement.prototype.setStdDeviation=function(c,b){};function SVGCursorElement(){SVGElement.apply(this);this.x=new SVGAnimatedLength();this.y=new SVGAnimatedLength();SVGURIReference.apply(this)}SVGCursorElement.prototype=Object._create(SVGElement);function SVGAElement(b){SVGElement.apply(this);this._tar=b.createElement("a");b=void 0;this.target=new SVGAnimatedString();this.target.baseVal="_self";this.addEventListener("DOMAttrModified",function(d){var c=d.target;if(d.eventPhase===3){return}if(d.attrName==="target"){c.target.baseVal=d.newValue}else{if(d.attrName==="xlink:title"){c._tar.setAttribute("title",d.newValue)}}d=void 0},false);this.addEventListener("DOMNodeInserted",function(d){var c=d.target;if(d.eventPhase===3){return}if(c.nextSibling){if(!!c.parentNode._tar&&!!c.nextSibling._tar){c.parentNode._tar.insertBefore(c._tar,c.nextSibling._tar)}}else{if(!!c.parentNode._tar){c.parentNode._tar.appendChild(c._tar)}}var f=c._tar.style;f.cursor="hand";f.left="0px";f.top="0px";f.textDecoration="none";f=void 0;var g=c.target.baseVal;var e="replace";if(g==="_blank"){e="new"}c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:show",e);c._tar.style.color=c.ownerDocument.defaultView.getComputedStyle(c,"").getPropertyValue("fill");c=d=void 0},false);this.addEventListener("DOMNodeInsertedIntoDocument",function(d){var c=d.target;if(!!c._tar&&(c.nodeType===1)){var e=c._tar.style;e.cursor="hand";e.textDecoration="none";e=void 0}c=d=void 0;return},true);this.addEventListener("DOMNodeInsertedIntoDocument",function(d){var c=d.target;c._tar.setAttribute("target",c.target.baseVal);if(c.href.baseVal.indexOf(".svg")!==-1){c.addEventListener("click",function(f){var e=f.target,i=document.body,g,j;i.lastChild.innerHTML="";if(e.target.baseVal==="_self"){j=e.ownerDocument._iframe;j.parentNode.insertBefore(i.lastChild.firstChild,j);g=j.nextSibling;if(g&&(g.tagName==="OBJECT")){j.previousSibling.setAttribute("width",g.getAttribute("width"));j.previousSibling.setAttribute("height",g.getAttribute("height"));j.parentNode.removeChild(g)}g=NAIBU._search([j.previousSibling]);j.parentNode.removeChild(j)}else{i.appendChild(i.lastChild.firstChild);while(i.firstChild!==i.lastChild){i.removeChild(i.firstChild)}g=NAIBU._search([i.lastChild])}NAIBU.doc=new ActiveXObject("MSXML2.DomDocument");f.preventDefault();g._next={_init:(function(k){return(function(){document.title=k.getSVGDocument().title;k=void 0})})(g)};g._init();i=g=j=void 0},false)}c=void 0},false);SVGURIReference.apply(this)}SVGAElement.prototype=Object._create(SVGElement);function SVGViewElement(){SVGElement.apply(this);this.viewTarget=new SVGStringList();this.viewBox=new SVGAnimatedRect();this.preserveAspectRatio=new SVGAnimatedPreserveAspectRatio();this.zoomAndPan=1}SVGViewElement.prototype=Object._create(SVGElement);function SVGScriptElement(){SVGElement.apply(this);this.type;SVGURIReference.apply(this);this.addEventListener("DOMAttrModified",function(evt){if(evt.attrName==="type"){evt.target.type=evt.newValue}evt=void 0},false);this.addEventListener("S_Load",function(evt){var tar=evt.target,script=tar._text;var tod=tar.ownerDocument;NAIBU._temp_doc=tod;script=script.replace(/function\s+(\w+)/g,"$1 = function");script="(function(document){"+script+"})(NAIBU._temp_doc);";try{NAIBU.eval(script)}catch(e){script=script.replace(/function\(document\){/,"function() {");NAIBU.eval(script)}tar=evt=script=void 0},false);this.addEventListener("DOMNodeInserted",function(evt){var tar=evt.target;if(evt.eventPhase===3){if(tar.nodeName==="#cdata-section"){evt.currentTarget._text=tar.data}return}tar.addEventListener("DOMNodeInsertedIntoDocument",function(evt){var tar=evt.target;if(evt.eventPhase===2&&!tar.getAttributeNodeNS("http://www.w3.org/1999/xlink","xlink:href")){var evtt=tar.ownerDocument.createEvent("SVGEvents");evtt.initEvent("S_Load",false,false);evt.currentTarget.dispatchEvent(evtt)}tar=evt=void 0},false)},false)}SVGScriptElement.prototype=Object._create(SVGElement);function SVGEvent(){Event.apply(this)}SVGEvent.prototype=Object._create(Event);function SVGZoomEvent(){UIEvent.apply(this);this.zoomRectScreen=new SVGRect();this.previousScale=1;this.previousTranslate=new SVGPoint();this.newScale=1;this.newTranslate=new SVGPoint()}SVGZoomEvent.prototype=Object._create(UIEvent);function SVGAnimationElement(){SVGElement.apply(this);this.style.setProperty=function(){};this._tar=null;this.targetElement;this._begin=this._end=this._repeatCount=this._repeatDur=this._dur=this._resatrt=null;this._currentFrame=0;this._isRepeat=false;this._numRepeat=0;this._isStarted=false;this._start=this._finish=this._starting=null;this._activeDur=0;this._from=this._to=this._values=this._by=null;this._keyTimes=null;this.addEventListener("beginEvent",function(r){try{var k=r.target,c=k.getStartTime(),l=k._dur,b=k._getOffset(l),g=k._finish,p=k._end,d=k._repeatDur,f=k._repeatCount,s=null;if(g){for(var j=0,q=g.length;j=c){g=g[j];break}}}else{p=null}if((d==="indefinite")||(f==="indefinite")){if(p){s=g-c}else{s=null}}else{if(l==="indefinite"){if(!f&&!p){s=null}else{if(f&&!p){s=k._getOffset(d)}else{if(!f&&p){s=g-c}else{s=(k._getOffset(d)>(g-c))?k._getOffset(d):(g-c)}}}}else{if(l&&!d&&!f&&!p){s=b}else{if(l&&!d&&f&&!p){s=b*(+f)}else{if(l&&d&&!f&&!p){s=k._getOffset(d)}else{if(l&&!d&&!f&&p){s=(b>(g-c))?b:(g-c)}else{if(l&&d&&f&&!p){s=(+f*b>k._getOffset(d))?+f*b:k._getOffset(d)}else{if(l&&d&&f&&p){s=(+f*b>Math.min(+d,(g-c)))?+f*b:Math.min(k._getOffset(d),(g-c))}else{if(l&&d&&!f&&p){s=(k._getOffset(d)>(g-c))?k._getOffset(d):(g-c)}else{if(l&&!d&&f&&p){s=(+f*b>(g-c))?+f*b:(g-c)}}}}}}}}}}}catch(o){k.endElementAt(1);throw new DOMException(11)}if((s||(s===0))&&isFinite(s)){p||k.endElementAt(s);k._activeDur=s}k=c=b=l=g=p=d=f=s=void 0},false);this.addEventListener("DOMAttrModified",function(c){if(c.eventPhase===3){return}var b=c.target,d=c.attrName,g=c.newValue;if(d==="begin"){b._begin=g.replace(/\s+/g,"").split(";")}else{if(d==="end"){b._end=g.replace(/\s+/g,"").split(";")}else{if(d==="dur"){b._dur=g}else{if(d==="repeatCount"){b._repeatCount=g;b._isRepeat=true}else{if(d==="repeatDur"){b._repeatCount=g;b._isRepeat=true}else{if(d==="from"){b._from=g}else{if(d==="to"){b._to=g}else{if(d==="values"){b._values=g.split(";")}else{if(d==="by"){b._by=g}else{if(d==="keyTimes"){var f=g.split(";");b._keyTimes=[];for(var e=0;e0)&&(/[a-z]/i).test(u.charAt(z+1))){return(u.slice(0,z))}z=nn=void 0;return""},v;if(isFinite(parseFloat(u))){k[p](t)}else{if(u.indexOf("repeat(")>-1){var i=parseFloat(u.slice(7)),r=(function(A,z,B){return function(C){if(i===C.target._numRepeat){A[z](B)}}})(k,p,t),v=s();if(v){k.ownerDocument.getElementById(v).addEventListener("repeatEvent",r)}else{k.addEventListener("repeatEvent",r)}}else{if(/\.(begin|end)/.test(u)){v=s();if(v){var r=(function(A,z,B){return function(C){A[z](B)}})(k,p,t),q="";/\.(begin|end)/.test(u);if(RegExp.$1==="begin"){q="beginEvent"}else{if(RegExp.$1==="end"){q="endEvent"}}k.ownerDocument.getElementById(v).addEventListener(q,r,false)}}else{if(u.indexOf("wallclock(")===0){}else{if(u==="indefinite"){}else{if(u.indexOf("accesskey(")>-1){}else{v=s();var r=(function(A,z,B){return function(C){A[z](B)}})(k,p,t);if(v&&u.match(/\.([a-z]+)/i)){k.ownerDocument.getElementById(v).addEventListener(RegExp.$1,r)}else{if(u){k.targetElement.addEventListener(u.match(/^[a-z]+/i)[0],r)}}}}}}}}u=s=v=void 0};if(d._begin){for(var g=0,l=d._begin.length;g0)))){return}if(this.getCurrentTime()>0){this.endElement()}b.initTimeEvent("beginEvent",c.defaultView,0);this.dispatchEvent(b);this._start&&this._start.shift();this._isStarted=true;c=b=void 0};SVGAnimationElement.prototype.endElement=function(){var c=this.ownerDocument,b=c.createEvent("TimeEvents");b.initTimeEvent("endEvent",c.defaultView,0);this.dispatchEvent(b);this._finish&&this._finish.shift();this._currentFrame=0};SVGAnimationElement.prototype.beginElementAt=function(e){var b=this.ownerDocument.documentElement.getCurrentTime(),f=this._start||[];for(var d=0,c=f.length;d-1){c=d.slice(e[0]);b=parseFloat(c)}else{if(e[1]>-1){c=d.slice(e[1]);b=parseFloat(c)}else{c=d;b=parseFloat(d)}}if(isFinite(b)){if(/\d+\:(\d\d)\:([\d\.]+)$/.test(c)){b=(b*3600+parseInt(RegExp.$1,10)*60+parseFloat(RegExp.$2))*1000}else{if(/\d\d\:([\d\.]+)$/.test(c)){b=(b*60+parseFloat(RegExp.$1))*1000}else{if(/(h|min|s)$/.test(c)){b*=this._unit[RegExp.$1]}}}if(isFinite(b)){b*=0.8;return b}}return 0};SVGAnimationElement.prototype.getStartTime=function(){if(this._starting||(this._starting===0)){return(this._starting)}else{throw new DOMException(11)}};SVGAnimationElement.prototype.getCurrentTime=function(){return(this._currentFrame*125*0.8)};SVGAnimationElement.prototype.getSimpleDuration=function(){if(!this._dur&&!this._finish&&(this._dur==="indefinite")){throw new DOMException(9)}else{return(this._getOffset(this._dur))}};NAIBU.Time={currentFrame:0,Max:17000,start:function(){if(NAIBU.Clip.length>0){screen.updateInterval=42;window.onscroll=function(){screen.updateInterval=0;screen.updateInterval=42};NAIBU.stop=setInterval((function(){try{var d=NAIBU.Time.currentFrame,f=NAIBU.Clip,t=d*100;if(d>NAIBU.Time.Max){clearInterval(NAIBU.stop)}f[0]&&f[0].ownerDocument.documentElement.setCurrentTime(t);for(var g=0,l=f.length;g=r.getSimpleDuration()*r._numRepeat)){var j=r.ownerDocument,p=j.createEvent("TimeEvents");++r._numRepeat;p.initTimeEvent("repeatEvent",j.defaultView,r._numRepeat);r.dispatchEvent(p);j=p=void 0}if(r._finish&&(r.getCurrentTime()!==0)){var c=r._finish[0];if((c||(c===0))&&(q<=c)&&(c<=t)){r.endElement()}c=void 0}if(r._frame){++r._currentFrame;r._frame()}}++NAIBU.Time.currentFrame;d=f=t=r=q=o=void 0}catch(k){}}),1)}else{window.onscroll=function(){screen.updateInterval=0;window.onscroll=NAIBU.emptyFunction}}}};NAIBU.Clip=[];function SVGAnimateElement(){SVGAnimationElement.apply(this);NAIBU.Clip[NAIBU.Clip.length]=this;this._valueList=[];this._isDiscrete=false;this.addEventListener("DOMAttrModified",function(b){if(b.eventPhase===3){return}if((b.attrName==="calcMode")&&(b.newValue==="discrete")){b.target._isDiscrete=true}},false);this.addEventListener("DOMNodeInserted",function(c){if(c.eventPhase===3){return}var b=c.target;b.addEventListener("DOMNodeInsertedIntoDocument",function(s){var l=s.target,q=l.getAttributeNS(null,"attributeName"),t=l.targetElement,o=t[q];var j=t.cloneNode(false);if(!l._values[0]){var f=t.ownerDocument.defaultView.getComputedStyle(t,"");l._values[0]=t.getAttributeNS(null,q)||f.getPropertyValue(q);if(!l._values[1]&&l._values[2]){var r=parseFloat(l._values[0])+parseFloat(l._values[2]),p=l._values[0].match(/\D+/)||[""];l._values[1]=r+p[0];l._values.pop();r=p=void 0}}if(("animatedPoints" in t)&&(q==="points")){t.animatedPoints=j.points;for(var k=0,g=l._values,e=g.length;k-1){for(var k=0,g=l._values,e=g.length;k-1){var j=null;var t=p._valueList[A].value,s=p._valueList[A+1].value;if(!p._isDiscrete){var u=t+(s-t)*(k-i*q)/r}else{var u=t}}else{if(("normalizedPathSegList" in f)&&(e==="d")){var j=f.normalizedPathSegList;f.normalizedPathSegList=f.animatedNormalizedPathSegList;f.dispatchEvent(z);f.animatedNormalizedPathSegList=f.normalizedPathSegList;f.normalizedPathSegList=j}}}}z=p=t=s=u=q=l=A=k=void 0};d=vir=void 0},false);this.addEventListener("endEvent",function(c){var b=c.target,d=b.getAttributeNS(null,"fill");if(!d||(d==="remove")){var c=b.ownerDocument._domnodeEvent();b.targetElement.dispatchEvent(c);c=void 0;b._frame&&b._frame()}delete b._frame},false);this.addEventListener("repeatEvent",function(c){var b=c.target},false)}SVGAnimateElement.prototype=Object._create(SVGAnimationElement);function SVGSetElement(){SVGAnimationElement.apply(this);NAIBU.Clip[NAIBU.Clip.length]=this;this._to="";this.addEventListener("DOMAttrModified",function(c){var b=c.target,d=c.attrName;if(d==="to"){b._to=c.newValue}b=d=void 0},false);this.addEventListener("beginEvent",function(d){var c=d.target;c._currentFrame=1;if(c.targetElement){var e=c.getAttributeNS(null,"attributeName"),i=c.targetElement.attributes.getNamedItemNS(null,e),b=c.targetElement[e];if(!!CSS2Properties[e]||e.indexOf("-")>-1){c._prestyle=c.ownerDocument.defaultView.getComputedStyle(c.targetElement,"").getPropertyValue(e);var f=c.ownerDocument.getOverrideStyle(c.targetElement,"");f.setProperty(e,c.getAttributeNS(null,"to"),null);f=void 0}else{if(!!b){var g=b.baseVal;if(g instanceof SVGLength){b.baseVal=c.ownerDocument.documentElement.createSVGLength()}else{if(g instanceof SVGRect){b.baseVal=c.ownerDocument.documentElement.createSVGRect()}}var d=c.ownerDocument.createEvent("MutationEvents");d.initMutationEvent("DOMAttrModified",true,false,i,i,c._to,e,1);c.targetElement.dispatchEvent(d);d=void 0;b.animVal=b.baseVal;b.baseVal=g}}}d=c=e=void 0},false);this.addEventListener("endEvent",function(d){var c=d.target,g=c.getAttributeNS(null,"fill");if(!g||(g==="remove")){var e=c.getAttributeNS(null,"attributeName"),f=c.ownerDocument.getOverrideStyle(c.targetElement,"");if(c._prestyle){f.setProperty(e,c._prestyle,null)}else{var b=c.ownerDocument._domnodeEvent();c.targetElement.dispatchEvent(b)}e=f=b=void 0}c=g=void 0},false);this.addEventListener("repeatEvent",function(c){var b=c.target,d=b.getAttributeNS(null,"attributeName"),e=b.ownerDocument.defaultView.getComputedStyle(b.targetElement,"")},false)}SVGSetElement.prototype=new SVGAnimationElement(1);function SVGAnimateMotionElement(){SVGAnimationElement.apply(this);NAIBU.Clip[NAIBU.Clip.length]=this;this.addEventListener("DOMAttrModified",function(c){if(c.eventPhase===3){return}var b=c.target,e=c.attrName;if(e==="path"){var f=b.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d",c.newValue);b._path=f;f=void 0}},false);this.addEventListener("DOMNodeInserted",function(c){if(c.eventPhase===3){return}var b=c.target;b.addEventListener("DOMNodeInsertedIntoDocument",function(e){var d=[],j;if(b._values){for(var f=0,k=b._values,g=k.length;f-1){NAIBU._noie_createFont(l,s,true)}}t=d=q=curt=textElments=f=s=void 0};if(!i.__isLinked||d._isExternal){d.ownerDocument.documentElement._svgload_limited=0;d.ownerDocument.documentElement.addEventListener("SVGLoad",g,false)}},false)},false)}SVGFontElement.prototype=Object._create(SVGElement);function SVGGlyphElement(){SVGElement.apply(this)}SVGGlyphElement.prototype=Object._create(SVGElement);function SVGMissingGlyphElement(){SVGElement.apply(this)}SVGMissingGlyphElement.prototype=Object._create(SVGElement);function SVGHKernElement(){SVGElement.apply(this)}SVGHKernElement.prototype=Object._create(SVGElement);function SVGVKernElement(){SVGElement.apply(this)}SVGVKernElement.prototype=Object._create(SVGElement);function SVGFontFaceElement(){SVGElement.apply(this);this._isLinked=0;this.addEventListener("DOMNodeInserted",function(b){if(b.eventPhase===3){if(b.target.localName==="font-face-uri"){b.currentTarget._isLinked=1}return}},false)}SVGFontFaceElement.prototype=Object._create(SVGElement);function SVGFontFaceSrcElement(){SVGElement.apply(this)}SVGFontFaceSrcElement.prototype=Object._create(SVGElement);function SVGFontFaceUriElement(){SVGElement.apply(this);this.addEventListener("DOMNodeInserted",function(b){if(b.eventPhase===3){return}b.target.ownerDocument.documentElement._svgload_limited--;b.target.setAttributeNS("http://www.w3.org/1999/xlink","xlink:show","embed")},false);this.addEventListener("S_Load",function(c){var b=c.target,d=b.parentNode.parentNode.parentNode;if(d.localName==="defs"){d=b.parentNode.parentNode}b._instance._isExternal=1;d.parentNode.appendChild(b._instance);c=b=d=void 0},false);SVGURIReference.apply(this)}SVGFontFaceUriElement.prototype=Object._create(SVGElement);function SVGFontFaceFormatElement(){SVGElement.apply(this)}SVGFontFaceFormatElement.prototype=Object._create(SVGElement);function SVGFontFaceNameElement(){SVGElement.apply(this)}SVGFontFaceNameElement.prototype=Object._create(SVGElement);function SVGDefinitionSrcElement(){SVGElement.apply(this)}SVGDefinitionSrcElement.prototype=Object._create(SVGElement);function SVGMetadataElement(){SVGElement.apply(this)}SVGMetadataElement.prototype=Object._create(SVGElement);function SVGForeignObjectElement(){SVGElement.apply(this);var b=SVGAnimatedLength;this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0}SVGForeignObjectElement.prototype=Object._create(SVGElement);DOMImplementation["http://www.w3.org/2000/svg"]={Document:SVGDocument,svg:SVGSVGElement,g:SVGGElement,path:NAIBU.SVGPathElement,title:SVGTitleElement,desc:SVGDescElement,defs:SVGDefsElement,linearGradient:SVGLinearGradientElement,radialGradient:SVGRadialGradientElement,stop:SVGStopElement,rect:SVGRectElement,circle:SVGCircleElement,ellipse:SVGEllipseElement,polyline:SVGPolylineElement,polygon:SVGPolygonElement,text:SVGTextElement,tspan:SVGTSpanElement,image:SVGImageElement,line:SVGLineElement,a:SVGAElement,altGlyphDef:SVGAltGlyphDefElement,altGlyph:SVGAltGlyphElement,altGlyphItem:SVGAltGlyphItemElement,animateColor:SVGAnimateColorElement,animate:SVGAnimateElement,animateMotion:SVGAnimateMotionElement,animateTransform:SVGAnimateTransformElement,clipPath:SVGClipPathElement,colorProfile:SVGColorProfileElement,cursor:SVGCursorElement,definitionSrc:SVGDefinitionSrcElement,feBlend:SVGFEBlendElement,feGaussianBlur:SVGFEGaussianBlurElement,filter:SVGFilterElement,font:SVGFontElement,"font-face":SVGFontFaceElement,"font-face-format":SVGFontFaceFormatElement,"font-face-name":SVGFontFaceNameElement,"font-face-src":SVGFontFaceSrcElement,"font-face-uri":SVGFontFaceUriElement,foreignObject:SVGForeignObjectElement,glyph:SVGGlyphElement,glyphRef:SVGGlyphRefElement,hkern:SVGHKernElement,marker:SVGMarkerElement,mask:SVGMaskElement,metadata:SVGMetadataElement,missingGlyph:SVGMissingGlyphElement,mpath:SVGMPathElement,script:SVGScriptElement,set:SVGSetElement,style:SVGStyleElement,"switch":SVGSwitchElement,symbol:SVGSymbolElement,textPath:SVGTextPathElement,tref:SVGTRefElement,use:SVGUseElement,view:SVGViewElement,vkern:SVGVKernElement,pattern:SVGPatternElement};NAIBU._fontSearchURI=function(b){var g=b.target.ownerDocument;var c=g.getElementsByTagNameNS("http://www.w3.org/2000/svg","font-face-uri");for(var e=0;e-1){NAIBU._noie_createFont(c,e,false)}}}o=j=void 0};NAIBU._noie_createFont=function(b,P,l){var I=b.ownerDocument.defaultView.getComputedStyle(b,""),Q="http://www.w3.org/2000/svg",J=b.getAttributeNS(null,"writing-mode")||b.parentNode.getAttributeNS(null,"writing-mode"),p=J?"vert-adv-y":"horiz-adv-x",z=b.firstChild,R,k=P.getElementsByTagNameNS(Q,"glyph"),N=parseFloat(P.getElementsByTagNameNS(Q,"font-face").item(0).getAttributeNS(null,"units-per-em")||1000),H=parseFloat((P.getAttributeNS(null,p)||N)),e=parseFloat(b.getAttributeNS(null,"x")||0),d=parseFloat(b.getAttributeNS(null,"y")||0),q=parseFloat(I.getPropertyValue("font-size")),B=q/N,g=false,f=["fill","fill-opacity","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-opacity","opacity","cursor"];if(k.length>60){return}if(/a/[-1]==="a"){g=true}else{if(l||J){g=true}}if(g){while(z){if(!k){break}R=z.data;if(R!==void 0){var T=[],F=[];for(var L=0,C=k.length;L-1){T[A]=parseFloat(u.getAttributeNS(null,p)||H);F[A]=u.getAttributeNS(null,"d");A=R.indexOf(s,A+1)}}}for(var L=0,M=0;L-1){var r=q/Math.SQRT2;E+=r;D-=r;r=void 0}v.e=E;v.f=D}else{v.e=e+M*B;v.f=d}G.setAttributeNS(null,"transform","matrix("+v.a+","+v.b+","+v.c+","+v.d+","+v.e+","+v.f+")");G.setAttributeNS(null,"d",F[L]);b.parentNode.insertBefore(G,b);M+=T[L];v=void 0}}M=T=F=void 0}else{if("tspan|a".indexOf(z.localName)>-1){NAIBU._noie_createFont(z,P,l)}}z=z.nextSibling}if(l){var I=b.ownerDocument.getOverrideStyle(b,null);I.setProperty("visibility","hidden");I=void 0}else{b.setAttributeNS(null,"opacity","0")}}R=J=p=N=H=e=d=q=I=Q=z=void 0};(function(){var e=new CSSStyleDeclaration(),k=e._list,j=0,f=/([A-Z])/,g=/\-/,b,d;for(var c in CSS2Properties){if(CSS2Properties.hasOwnProperty(c)){d=c.replace(f,"-");if(!!RegExp.$1){b="-"+RegExp.$1.toLowerCase()}else{b="-"}d=d.replace(g,b);e.setProperty(d,CSS2Properties[c]);k[d]=k[j];k[j]._isDefault=1;++j;c=d=b=void 0}}k._opacity=1;k._fontSize=12;CSS2Properties._list=k;Document.prototype.defaultView._defaultCSS=k;e=j=f=g=k=null})();NAIBU.addEvent=function(b,c){if(window.addEventListener){window.addEventListener(b,c,false)}else{if(window.attachEvent){window.attachEvent("on"+b,c)}else{window["on"+b]=c}}if(sieb_s){c()}};function unsvgtovml(){try{if("stop" in NAIBU){clearInterval(NAIBU.stop)}window.onscroll=NAIBU.emptyFunction;window.detachEvent("onload",NAIBU._main);NAIBU.freeArg();delete Object._create;Document._destroy();Element=SVGElement=Attr=NamedNodeMap=CSS2Properties=CSSValue=CSSPrimitiveValue=NAIBU.xmlhttp=Node=Event=NAIBU=STLog=SVGColor=SVGPaint=void 0;Array=ActiveXObject=void 0}catch(b){}}NAIBU._main=function(){var G,c=document;try{if(XMLHttpRequest){G=false}else{G=new ActiveXObject("Msxml2.XMLHTTP")}}catch(B){try{G=new ActiveXObject("Microsoft.XMLHTTP")}catch(k){G=false}}if(!G){try{G=new XMLHttpRequest()}catch(B){G=false}}NAIBU.xmlhttp=G;var f;if(("namespaces" in c)&&!c.namespaces.v){try{NAIBU.doc=new ActiveXObject("MSXML2.DomDocument")}catch(B){}f=NAIBU.doc;c.namespaces.add("v","urn:schemas-microsoft-com:vml");c.namespaces.add("o","urn:schemas-microsoft-com:office:office");var p=c.createStyleSheet(),g="behavior: url(#default#VML);display: inline-block;} ";p.cssText="v\\:rect{"+g+"v\\:image{"+g+"v\\:fill{"+g+"v\\:stroke{"+g+"o\\:opacity2{"+g+"dn\\:defs{display:none}v\\:group{text-indent:0px;position:relative;width:100%;height:100%;"+g+"v\\:shape{width:100%;height:100%;"+g}var C=c.getElementsByTagName("script");for(var u=0;C[u];++u){var v=C[u],z=v.type;if(v.type==="image/svg+xml"){var D=v.text;if(sieb_s&&D.match(/<svg/)){D=D.replace(/<.+?>/g,"");D=D.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}if(NAIBU.isMSIE){var H=new GetSVGDocument(v);H.xmlhttp={readyState:4,status:200,responseText:D.replace(/\shref=/g," target='_top' xlink:href=")};H._ca()}else{var d=location.href.replace(/\/[^\/]+?$/,"/");D=D.replace(/\shref=(['"a-z]+?):\/\//g," target='_top' xlink:href=$1://").replace(/\shref=(.)/g," target='_top' xlink:href=$1"+d);var o=NAIBU.textToSVG(D,v.getAttribute("width"),v.getAttribute("height"));v.parentNode.insertBefore(o,v)}v=D=void 0}z=void 0}NAIBU.doc=f;f=C=void 0;if(G&&NAIBU.isMSIE){if(!!c.createElementNS&&!!c.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect){}else{var q=c.getElementsByTagName("object"),o=[],l=[],A=function(t){var J,E,I,e="width",s="height";o||(o=[]);c||(c=document);for(var j=0;t[j];++j){E=t[j];o[o.length]=new GetSVGDocument(E);J=c.createElement("iframe");J.style.cssText=E.style.cssText;J.style.background="black";I=E.getAttribute(e);I&&J.setAttribute(e,I);I=E.getAttribute(s);I&&J.setAttribute(s,I);J.marginWidth=J.marginHeight="0px";J.scrolling="no";J.frameBorder="0";E.parentNode.insertBefore(J,E)}j=E=J=t=e=s=void 0;return o[o.length-1]};A(q);var F=c.getElementsByTagName("img"),b=c.getElementsByTagName("embed");for(var u=0,r=0;F[u];++u){if(F[u].getAttribute("src").indexOf(".svg")>-1){l[r]=F[u];++r}}A(l);A(b);NAIBU._search=A;q=b=l=F=A=void 0;for(var u=0;u0){o[0]._init()}o=void 0}}else{var q=c.getElementsByTagName("object");for(var u=0;u-1||navigator.userAgent.indexOf("Safari")>-1){var e="data:image/svg+xml;charset=utf-8,"+NAIBU.unescapeUTF16(escape(f));var c=document.createElement("object");c.setAttribute("data",e);c.setAttribute("width",b);c.setAttribute("height",d);c.setAttribute("type","image/svg+xml");return c}else{var g=(new DOMParser()).parseFromString(f,"text/xml");return(document.importNode(g.documentElement,true))}};NAIBU.addEvent("unload",unsvgtovml); +/*SIE-SVG without Plugin under LGPL2.1 & GPL2.0 & Mozilla Public Lisence + *http://sie.sourceforge.jp/ + *Usage: + */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Mozilla SVG Cairo Renderer project. + * + * The Initial Developer of the Original Code is IBM Corporation. + * Portions created by the Initial Developer are Copyright (C) 2004 + * the Initial Developer. All Rights Reserved. + * + * Parts of this file contain code derived from the following files(s) + * of the Mozilla SVG project (these parts are Copyright (C) by their + * respective copyright-holders): + * layout/svg/renderer/src/libart/nsSVGLibartBPathBuilder.cpp + * + * Contributor(s):DHRNAME revulo bellbind + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +/* + * Copyright (c) 2000 World Wide Web Consortium, + * (Massachusetts Institute of Technology, Institut National de + * Recherche en Informatique et en Automatique, Keio University). All + * Rights Reserved. This program is distributed under the W3C's Software + * Intellectual Property License. This program is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. + * See W3C License http://www.w3.org/Consortium/Legal/ for more details. + */ +if(!Object._create){Object._create=function(b){var c=function(){};c.prototype=b.prototype;b=void 0;return new c}}function DOMException(c){Error.apply(this,arguments);this.code=c;var b=["","Index Size Error","DOMString Size Error","Hierarchy Request Error","Wrong Document Error","Invalid Character Error","No Data Allowed Error","No Modification Allowed Error","Not Found Error","Not Supported Error","Inuse Attribute Error","Invalid State Error","Syntax Error","Invalid Modification Error","Namespace Error","Invalid Access Error"];this.message=b[c]}(function(b){b.prototype=new Error()})(DOMException);DOMImplementation={hasFeature:function(c,b){switch(c){case"CORE":case"XML":case"Events":case"StyleSheets":case"org.w3c.svg.static":case"org.w3c.dom.svg.static":return true;default:if(b==="2.0"){return true}else{return false}}},createDocumentType:function(d,e,b){var c=new Node();c.publicId=e;c.systemId=b;return c},createDocument:function(d,g,b){try{var c;if(d&&DOMImplementation[d]&&DOMImplementation[d].Document){c=new (DOMImplementation[d].Document);this._doc_&&(c._document_=this._doc_)}else{c=new Document()}c.implementation=this;c.doctype=b||null;c.documentElement=c.createElementNS(d,g);return c}catch(f){}},"http://www.w3.org/2000/xmlns":{}};function Node(){this.childNodes=[];this._capter=[]}Node.prototype={tar:null,firstChild:null,previousSibling:null,nextSibling:null,attributes:null,namespaceURI:null,localName:null,lastChild:null,prefix:null,ownerDocument:null,parentNode:null,replaceChild:function(b,d){this.insertBefore(b,d);var c=this.removeChild(d);return c},appendChild:function(b){this.insertBefore(b,null);return b},hasChildNodes:function(){if(this.childNodes.length>0){return true}else{return false}},cloneNode:function(b){var c;if(this.hasOwnProperty("ownerDocument")){c=this.ownerDocument.importNode(this,b)}else{c=new Node()}return c},normalize:function(){var g=this.childNodes;try{for(var c=g.length-1;c<0;--c){var f=g[c],b=f.nextSibling;if(b){if(f.nodeType===3&&b.nodeType===3){f.appendData(b.data);f.legnth=f.data.length;this.removeChild(b)}else{f.normalize()}}else{f.normalize()}}}catch(d){}},isSupported:function(c,b){return(this.ownerDocument.implementation.hasFeature(c+"",b+""))},hasAttributes:function(){if(this.attributes.length>0){return true}else{return false}}};Array.prototype.item=function(b){if(!this[b]){return null}return(this[b])};function NamedNodeMap(){}Array.prototype._copyNode=function __nnmp_c(e,c){for(var d=0,b=e.length;dthis.length){throw (new DOMException(1))}if(e+d>this.length){d=this.length-e}var c=this.data.substr(e,d);return c};b.replaceData=function(e,d,c){if(e<0||d<0||e>this.length){throw (new DOMException(1))}this.deleteData(e,d);this.insertData(e,c)};b=void 0})(CharacterData.prototype);function Attr(){}Attr.prototype=Object._create(Node);(function(b){b.nodeType=2;b.nodeValue=null;b.childNodes=[];b._capter=[];b=void 0})(Attr.prototype);function Element(){Node.apply(this);this.attributes=new NamedNodeMap()}Element.prototype=Object._create(Node);(function(b){b.nodeType=1;b.nodeValue=null;b.getAttribute=function(c){return(this.getAttributeNS(null,c))};b.setAttribute=function(c,d){this.setAttributeNS(null,c,d)};b.removeAttribute=function(c){this.removeAttributeNS(null,c)};b.getAttributeNode=function(c){};b.setAttributeNode=function(c){};b.removeAttributeNode=function(c){var d=this.attributes.removeNamedItemNS(c.namespaceURI,c.localName);return d};b.getElementsByTagName=function(c){};b.getAttributeNS=function(d,c){var e=this.getAttributeNodeNS(d,c);if(!e){return null}else{return(e.nodeValue)}};b.setAttributeNS=function(c,f,d){var e=this.ownerDocument.createAttributeNS(c,f);e.nodeValue=d+"";e.value=d+"";this.setAttributeNodeNS(e)};b.removeAttributeNS=function(d,c){};b.getAttributeNodeNS=function(d,c){var e=this.attributes.getNamedItemNS(d,c);return e};b.getElementsByTagNameNS=function(f,k){var v=[],g=0;var c=this.childNodes;for(var o=0,e=c.length;o1000){f=e.implementation._buffer_||[];p=f.length;f[p]=this;f[p+1]=q;e.implementation._buffer_=f;d=e=k=s=t=f=p=o=void 0;return true}}}q.target=d;q.eventPhase=1;e[r]=null;while(d.parentNode){d.parentNode[c]=d;d[r]=d.parentNode;d=d.parentNode}e[c]=d;d[r]=e;d=this;while(e){q.currentTarget=e;if(e===d){o=2}q.eventPhase=o;i=e._capter;for(var g=0,b=i.length;gthis.length){next=""}this.data=pre+next;this.length=this.data.length;evt=this.ownerDocument.createEvent("MutationEvents");evt.initMutationEvent("DOMCharacterDataModified",true,false,null,b,this.data,null,null);this.parentNode.dispatchEvent(evt);evt=b=void 0};Document.prototype._cevent={MutationEvents:MutationEvent,MouseEvents:MouseEvent,UIEvents:UIEvent};function StyleSheet(){this.type="text/css";this.disabled=false;this.ownerNode=null;this.parentStyleSheet=null;this.href=null;this.title="";this.media=new MediaList()}function MediaList(){this.mediaText="";this.length=0}MediaList.prototype={item:function(b){return(this[b])},deleteMedium:function(b){for(var c=0,d=this.length;c-1){f._empercents=c._fontSize;e=c=g=b=j=d=void 0;return f}}e=c=g=j=d=void 0;return null},removeProperty:function(b){var c=this.getPropertyCSSValue(b);if(c){this._list.splice(c._num,1);--this.length}},getPropertyPriority:function(b){var c=this.getPropertyCSSValue(b);if(c){return(c._priority)}else{return""}},_isFillStroke:{fill:1,stroke:1},_isColor:{color:1},_isStop:{"stop-color":1},_isRS:{r:1,"#":1},setProperty:function(g,o,k){var e=g,c=null,b,j,l,d=null,f=null,q,p,i;if(!!this[g]){c=this.getPropertyCSSValue(g)}e+=":";e+=o;if(this._isFillStroke[g]){if(c){b=c}else{b=new SVGPaint()}j=0;l=o.charAt(0);if(this._isRS[l]||b._keywords[o]){j=1;f=o}else{if(o==="none"){j=101}else{if(this._urlreg.test(o)){j=107;d=RegExp.$1}else{if(o==="currentColor"){j=102}}}}b.setPaint(j,d,f,null);j=l=d=f=void 0}else{if(this._isStop[g]){if(c){b=c}else{b=new SVGColor()}if(o==="currentColor"){b.colorType=3}else{b.colorType=1}b.setRGBColor(o)}else{if(c){b=c}else{b=new CSSPrimitiveValue()}}}b._priority=k;b.cssText=e;if(!c){b._num=this._list.length;this._list[b._num]=b;this[g]=1;++this.length}if(o==="inherit"){b.cssValueType=0}else{if(g==="opacity"){this._list._opacity=+o}else{if(g==="font-size"){if(/(%|em|ex)/.test(o)){c="_"+RegExp.$1;b[c]=parseFloat(o)}else{this._em=this._ex=this["_%"]=null;this._list._fontSize=parseFloat(o)}}}}e=void 0},item:function(b){if(b>=this.length){var c=""}else{var c=this._list[b].cssText.substring(0,this._list[b].cssText.indexOf(":"))}return c}};function CSSValue(){}CSSValue.prototype={cssText:"",cssValueType:3,_isDefault:0};function CSSPrimitiveValue(){}(function(b){b.prototype=Object._create(CSSValue)})(CSSPrimitiveValue);(function(){this._n=[1,0.01,1,1,1,35.43307,3.543307,90,1.25,15,1,180/Math.PI,90/100,1,1000,1,1000,1];this.cssValueType=1;this.primitiveType=0;this._value=null;this._percent=0;this._empercent=0;this._em=this._ex=this["_%"]=null;this.setFloatValue=function(b,c){if((0>=b)&&(b>=19)){throw new DOMException(15)}this.primitiveType=b;this._value=c*this._n[b-1]};this._regd=/[\d\.]+/;this.getFloatValue=function(c){if((0>=c)&&(c>=19)){throw new DOMException(15)}if(this._value||(this._value===0)){return(this._value/this._n[c-1])}else{var b=this.cssText,f=b.slice(-1),e=0,d=+(b.match(this._regd));d=isNaN(d)?0:d;if(f>="0"&&f<="9"){e=1;if(c===1){c=b=f=e=void 0;return d}}else{if(f==="%"){d*=this._percent;e=2}else{if((f==="m")&&(b.charAt(b.length-2)==="e")){d*=this._empercent;e=3}else{if((f==="x")&&(b.charAt(b.length-2)==="e")){e=4}else{if((f==="x")&&(b.charAt(b.length-2)==="p")){e=5}else{if((f==="m")&&(b.charAt(b.length-2)==="c")){e=6}else{if((f==="m")&&(b.charAt(b.length-2)==="m")){e=7}else{if(f==="n"){e=8}else{if(f==="t"){e=9}else{if(f==="c"){e=10}}}}}}}}}}d=d*this._n[e-1]/this._n[c-1];b=f=e=c=void 0;return d}};this.setStringValue=function(c,b){if(18>=c&&c>=23){throw new DOMException(15)}this._value=b};this.getStringValue=function(b){if(18>=b&&b>=23){throw new DOMException(15)}return(this._value)};this.getCounterValue=function(){if(this.primitiveType!==23){throw new DOMException(15)}return(new Counter())};this.getRectValue=function(){if(this.primitiveType!==24){throw new DOMException(15)}return(new Rect())};this.getRGBColorValue=function(){if(this.primitiveType!==25){throw new DOMException(15)}var b=new RGBColor(),c=this.cssText,d=SVGColor.prototype._keywords[c];if(c.indexOf("%",5)>0){c=c.replace(/[\d.]+%/g,function(e){return Math.round((2.55*parseFloat(e)))})}else{if(c.indexOf("#")>-1){c=c.replace(/[\da-f][\da-f]/gi,function(e){return parseInt(e,16)})}}d=d||c.match(/\d+/g);b.red.setFloatValue(1,parseFloat(d[0]));b.green.setFloatValue(1,parseFloat(d[1]));b.blue.setFloatValue(1,parseFloat(d[2]));d=c=void 0;return(b)}}).apply(CSSPrimitiveValue.prototype);function CSSValueList(){this.cssValueType=2;this.length=0}CSSValueList.prototype=Object._create(CSSValue);CSSValueList.prototype.item=function(b){return(this[b])};function RGBColor(){var b=CSSPrimitiveValue;this.red=new b();this.green=new b();this.blue=new b();b=void 0;this.red.primitiveType=this.green.primitiveType=this.blue.primitiveType=1}function Rect(){var b=CSSPrimitiveValue;this.top=new b();this.right=new b();this.bottom=new b();this.left=new b();b=void 0}function Counter(){this.identifier=this.listStyle=this.separator=""}function ElementCSSInlineStyle(){var b=CSSStyleDeclaration;this.style=new b();this._attributeStyle=new b();b=void 0}var n="none",m="normal",a="auto",CSS2Properties={fill:"black",stroke:n,cursor:a,visibility:"visible",display:"inline-block",opacity:"1",fillOpacity:"1",strokeWidth:"1",strokeDasharray:n,strokeDashoffset:"0",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"4",strokeOpacity:"1",writingMode:"lr-tb",fontFamily:"serif",fontSize:"12",color:"black",fontSizeAdjust:n,fontStretch:m,fontStyle:m,fontVariant:m,fontWeight:m,font:"inline",stopColor:"black",stopOpacity:"1",textAnchor:"start",azimuth:"center",clip:a,direction:"ltr",letterSpacing:m,lineHeight:m,overflow:"visible",textAlign:"left",textDecoration:n,textIndent:"0",textShadow:n,textTransform:n,unicodeBidi:m,verticalAlign:"baseline",whiteSpace:m,wordSpacing:m,zIndex:a,mask:n,markerEnd:n,markerMid:n,markerStart:n,fillRule:"nonzero",enableBackground:"accumulate",filter:n,floodColor:"black",floodOpacity:"1",lightingColor:"white",pointerEvents:"visiblePainted",colorInterpolation:"sRGB",colorInterpolationFilters:"linearRGB",colorProfile:a,colorRendering:a,imageRendering:a,marker:"",shapeRendering:a,textRendering:a,alignmentBaseline:"",baselineShift:"baseline",dominantBaseline:a,glyphOrientationHorizontal:"0deg",glyphOrientationVertical:a,kerning:a};n=m=a=void 0;CSS2Properties.visibility._n=1;function CSSStyleSheet(){StyleSheet.apply(this);this.ownerRule=null;this.cssRules=[]}CSSStyleSheet.prototype=Object._create(StyleSheet);CSSStyleSheet.prototype.insertRule=function(g,e){var l=new CSSStyleRule(),b=l.style,j,f=g.match(/\{[\s\S]+\}/),c;l.parentStyleSheet=this;b.cssText=g;f=f.replace(/^[^a-z\-]+/,"").replace(/\:\s+/g,":").replace(/\s*;[^a-z\-]*/g,";");j=f.split(";");for(var d=0,k=j.length;d-1)){tar._attributeStyle.setProperty(name,evt.newValue,"")}if(evt.relatedNode.localName==="id"){tar.id=evt.newValue}else{if((name==="transform")&&!!tar.transform){var tft=evt.newValue,degR=tar._degReg,coma=tft.match(tar._comaReg),list=tft.match(tar._strReg),a,b,c,d,e,f,lis,com,deg,rad,degli,s,cm,degz,etod=evt.target.ownerDocument.documentElement,ttb=tar.transform.baseVal;for(var j=0,cli=coma.length;j="0"&&m<="9"){}else{if(m==="%"){if(tar._x1width[name]){tea.baseVal._percent=tvw*0.01}else{if(tar._y1height[name]){tea.baseVal._percent=tvh*0.01}else{tea.baseVal._percent=Math.sqrt((tvw*tvw+tvh*tvh)/2)*0.01}}type=2}else{if(n==="em"){type=3}else{if(n==="ex"){type=4}else{if(n==="px"){type=5}else{if(n==="cm"){type=6}else{if(n==="mm"){type=7}else{if(n==="in"){type=8}else{if(n==="pt"){type=9}else{if(n==="pc"){type=10}}}}}}}}}}s=_parseFloat(evt.newValue);s=isNaN(s)?0:s;tea.baseVal.newValueSpecifiedUnits(type,s);tea=tod=tvw=tvh=n=type=_parseFloat=s=void 0}}}}}}}evt=_parseFloat=name=tar=null},false)}SVGElement.prototype=Object._create(Element);NAIBU.eval=function(c){var d=document,b=d.createElement("script");b.text=c;(d.documentElement||d.body).appendChild(b)};(function(){this._degReg=/[\-\d\.e]+/g;this._comaReg=/[A-Za-z]+(?=\s*\()/g;this._strReg=/\([^\)]+\)/g;this._syouReg=/^[^a-z\-]+/;this._conReg=/\:\s+/g;this._bouReg=/\s*;[^a-z\-]*/g;this._cacheMatrix=null;this._x1width={x:1,x1:1,x2:1,width:1,cx:1};this._y1height={y:1,y1:1,y2:1,height:1,cy:1};this.id=null;this.xmlbase=null;this.ownerSVGElement;this.viewportElement;this.nearestViewportElement=null;this.farthestViewportElement=null;this.getBBox=function(){var q=new SVGRect(),e=this._tar.path.value,c=this.ownerDocument.documentElement.viewport,b=c.width,l=c.height,p=0,j=0,o=e.match(/[0-9\-]+/g),g,f;for(var d=0,k=o.length;dg?g:b;l=l>f?f:l;p=p>g?p:g;j=j>f?j:f}q.x=b;q.y=l;q.width=p-b;q.height=j-l;g=f=e=o=b=l=p=j=c=void 0;return q};this.getCTM=function(){var c,b;if(!!this._cacheMatrix){c=this._cacheMatrix}else{b=this.transform.baseVal.consolidate();if(b){b=b.matrix}else{b=this.ownerDocument.documentElement.createSVGMatrix()}if(this.parentNode&&!!this.parentNode.getCTM){c=this.parentNode.getCTM().multiply(b)}else{c=b}b=void 0;this._cacheMatrix=c}return c};this.getScreenCTM=function(){if(!this.parentNode){return null}var b=this.nearestViewportElement||this.ownerDocument.documentElement;var c=b.getScreenCTM().multiply(this.getCTM());b=null;return c};this.getTransformToElement=function(b){var c=this.getScreenCTM().inverse().multiply(b.getScreenCTM());return c}}).apply(SVGElement.prototype);function SVGAnimatedBoolean(){this.animVal=this.baseVal=true}function SVGAnimatedString(){this.animVal=this.baseVal=""}function SVGStringList(){}SVGStringList.prototype=Object._create(Array);(function(){this.numberOfItems=0;this.clear=function(){for(var b=0,c=this.length;b=this.numberOfItems||b<0){throw (new DOMException(1))}else{return(this[b])}};this.insertItemBefore=function(c,b){if(b>=this.numberOfItems){this.appendItem(c)}else{this.splice(b,1,c,this.getItem[b]);++this.numberOfItems}return c};this.replaceItem=function(c,b){if(b>=this.numberOfItems||b<0){throw (new DOMException(1))}else{this.splice(b,1,c)}return c};this.removeItem=function(b){if(b>=this.numberOfItems||b<0){throw (new DOMException(1))}else{this.splice(b,1);--this.numberOfItems}return newItem};this.appendItem=function(b){this[this.numberOfItems]=b;++this.numberOfItems}}).apply(SVGStringList.prototype);function SVGAnimatedEnumeration(){this.baseVal=0;this.animVal=0}function SVGAnimatedInteger(){this.baseVal=0;this.animVal=0}function SVGNumber(){this.value=0}function SVGAnimatedNumber(){this.baseVal=this.animVal=0}function SVGNumberList(){}function SVGAnimatedNumberList(){this.animVal=this.baseVal=new SVGNumberList()}function SVGLength(){}SVGLength.prototype={unitType:0,value:0,valueInSpecifiedUnits:0,valueAsString:"0",_percent:0.01,_fontSize:12,newValueSpecifiedUnits:function(b,d){var e=1,c="";if(b===1){}else{if(b===5){c="px"}else{if(b===2){e=this._percent;c="%"}else{if(b===3){e=this._fontSize;c="em"}else{if(b===4){e=this._fontSize*0.5;c="ex"}else{if(b===6){e=35.43307;c="cm"}else{if(b===7){e=3.543307;c="mm"}else{if(b===8){e=90;c="in"}else{if(b===9){e=1.25;c="pt"}else{if(b===10){e=15;c="pc"}else{throw new DOMException(9)}}}}}}}}}}this.unitType=b;this.value=d*e;this.valueInSpecifiedUnits=d;this.valueAsString=d+c;d=b=e=c=void 0},convertToSpecifiedUnits:function(c){if(this.value===0){this.newValueSpecifiedUnits(c,0);return}var b=this.value;this.newValueSpecifiedUnits(c,this.valueInSpecifiedUnits);b=b/this.value*this.valueInSpecifiedUnits;this.newValueSpecifiedUnits(c,b)},_emToUnit:function(b){if((this.unitType===3)||(this.unitType===4)){this._fontSize=b;this.newValueSpecifiedUnits(this.unitType,this.valueInSpecifiedUnits)}}};function SVGAnimatedLength(){this.animVal;this.baseVal=new SVGLength();this.baseVal.unitType=1}function SVGLengthList(){}function SVGAnimatedLengthList(){this.animVal=this.baseVal=new SVGLengthList()}function SVGAngle(){}SVGAngle.prototype={unitType:0,value:0,valueInSpecifiedUnits:0,valueAsString:"0",newValueSpecifiedUnits:function(b,d){var e=1,c="";if(b===1){}else{if(b===2){c="deg"}else{if(b===3){e=Math.PI/180;c="rad"}else{if(b===4){e=9/10;c="grad"}else{throw new DOMException(9)}}}}this.unitType=b;this.value=d*e;this.valueInSpecifiedUnits=d;this.valueAsString=d+c;e=c=void 0},convertToSpecifiedUnits:function(c){if(this.value===0){this.newValueSpecifiedUnits(c,0);return}var b=this.value;this.newValueSpecifiedUnits(c,this.valueInSpecifiedUnits);b=b/this.value*this.valueInSpecifiedUnits;this.newValueSpecifiedUnits(c,b)}};function SVGAnimatedAngle(){this.baseVal=new SVGAngle();this.animVal=this.baseVal}function SVGColor(){CSSValue.apply(this);this.rgbColor=new RGBColor()}SVGColor.prototype=Object._create(CSSValue);(function(){this.colorType=0;this.iccColor=null;this._regD=/\d+/g;this._regDP=/[\d.]+%/g;this._exceptionsvg=1;this.setRGBColor=function(j){var e,d,i,f,c;if(!j||(typeof j!=="string")){throw new SVGException(this._exceptionsvg)}e=this._keywords[j];if(e){}else{if(j.indexOf("%",5)>0){j=j.replace(this._regDP,function(b){return Math.round((2.55*parseFloat(b)))});e=j.match(this._regD)}else{if(j.indexOf("#")===0){e=[];d=parseInt;if(j.length<5){i=j.charAt(1);f=j.charAt(2);c=j.charAt(3);j="#"+i+i+f+f+c+c}e[0]=d(j.slice(1,3),16)+"";e[1]=d(j.slice(3,5),16)+"";e[2]=d(j.slice(5,7),16)+"";i=f=c=void 0}else{e=j.match(this._regD);if(!e||(e.length<3)){j=void 0;throw new SVGException(this._exceptionsvg)}}}}j=this.rgbColor;j.red.setFloatValue(1,e[0]);j.green.setFloatValue(1,e[1]);j.blue.setFloatValue(1,e[2]);j=e=d=void 0};this.setColor=function(b,c,d){this.colorType=b;if((b===1)&&d){throw new SVGException(this._exceptionsvg)}else{if(b===1){this.setRGBColor(c)}else{if(c&&(b===3)){this.setRGBColor(c)}else{if((b===0)&&(c||d)){throw new SVGException(this._exceptionsvg)}else{if((b===2)&&(c||!d)){throw new SVGException(this._exceptionsvg)}}}}}b=c=void 0};this._keywords={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagree:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}).apply(SVGColor.prototype);function SVGRect(){this.x=0;this.y=0;this.width=0;this.height=0}function SVGAnimatedRect(){this.animVal=this.baseVal=new SVGRect()}function SVGStylable(){this.className=new SVGAnimatedString();this.style=new CSSStyleDeclaration();this._attributeStyle=new CSSStyleDeclaration()}SVGElement.prototype.getPresentationAttribute=function(b){var c=this._attributeStyle.getPropertyCSSValue(b);if(c){return c}else{return null}};function SVGURIReference(){this.href=new SVGAnimatedString();this._instance=null;this._text="";this.addEventListener("DOMAttrModified",function(b){if((b.relatedNode.namespaceURI==="http://www.w3.org/1999/xlink")&&(b.attrName==="xlink:href")){b.target.href.baseVal=b.newValue;b.target.ownerDocument.documentElement._svgload_limited++}b=void 0},false);this.addEventListener("DOMNodeInserted",function(c){var b=c.target;if(c.eventPhase===3){return}b.addEventListener("DOMNodeInsertedIntoDocument",function(l){var s=l.target,g=location.href,t=s.href.baseVal,B=s.ownerDocument,d=B.URL,f=/\.+\//g,r=/\/[^\/]+?(\/[^\/]*?)$/,o,v,e,A,z,i,C,p,q,k,u,j;if(t!==""){e=s.xmlbase;if(!e){A=s.parentNode;z=null;while(!z&&A){z=A.xmlbase;A=A.parentNode}e=z}o=function(D,E){if(t.indexOf(":")>-1){i=t}else{if(D.indexOf(":")>-1){E=D}else{f.lastIndex=0;while(f.exec(D)){E=E.replace(r,"$1")}E=E.replace(/\/[^\/]+?$/,"/");E=E+D.replace(f,"")}}return E};g=o(d,g);if(e){g=o(e,g)}if(t.indexOf("#")===0){i=t}else{if(!i){g=g.replace(/\/[^\/]+?$/,"/");f.lastIndex=0;while(f.exec(t)){g=g.replace(r,"$1")}i=g+t.replace(f,"")}}v=s.getAttributeNS("http://www.w3.org/1999/xlink","show")||"embed";if(v==="replace"){s._tar.setAttribute("href",i)}else{if(v==="new"){s._tar.setAttribute("target","_blank");s._tar.setAttribute("href",i)}else{if(v==="embed"){C=NAIBU.xmlhttp;p=i.indexOf("#");if(p>-1){q=i.slice(p+1);i=i.replace(/#.+$/,"")}else{q=null}if(t.indexOf("#")===0){k=B.getElementById(q);s._instance=k;j=SVGURIReference;SVGURIReference=function(){};u=B.createEvent("SVGEvents");u.initEvent("S_Load",false,false);s.dispatchEvent(u);SVGURIReference=j;s=C=void 0}else{if(i.indexOf("data:")>-1){s._tar.src=i;s=C=void 0}else{if((i.indexOf("http:")>-1)){if((s.localName==="image")&&(i.indexOf(".svg")===-1)){s._tar.src=i}else{s.ownerDocument.documentElement._svgload_limited++;C.open("GET",i,false);C.setRequestHeader("X-Requested-With","XMLHttpRequest");C.onreadystatechange=function(){if((C.readyState===4)&&(C.status===200)){var D=C.getResponseHeader("Content-Type")||"text",H,J,F,E,G,I;if((D.indexOf("text")>-1)||(D.indexOf("xml")>-1)||(D.indexOf("script")>-1)){if(s.localName!=="script"&&s.localName!=="style"){H=new ActiveXObject("MSXML2.DomDocument");J=C.responseText.replace(/!DOCTYPE/,"!--").replace(/(dtd">|\]>)/,"-->");G=NAIBU.doc;G.async=G.validateOnParse=G.resolveExternals=G.preserveWhiteSpace=false;H.loadXML(J);F=H.documentElement;I=SVGURIReference;SVGURIReference=function(){};s._instance=s.ownerDocument.importNode(F,true);SVGURIReference=I;if(q){s._instance=s._instance.ownerDocument.getElementById(q)}}else{s._text=C.responseText}}else{if(!!s._tar){s._tar.src=i}}E=s.ownerDocument.createEvent("SVGEvents");E.initEvent("S_Load",false,false);s.dispatchEvent(E);s.ownerDocument.documentElement._svgload_limited--;if(s.ownerDocument.documentElement._svgload_limited<0){E=s.ownerDocument.createEvent("SVGEvents");E.initEvent("SVGLoad",false,false);s.ownerDocument.documentElement.dispatchEvent(E)}s=D=H=J=E=I=G=void 0;C.onreadystatechange=NAIBU.emptyFunction;C=void 0}};C.send(null)}}}}}}}s.ownerDocument.documentElement._svgload_limited--}l=g=t=e=o=A=d=z=f=i=p=q=B=k=u=v=j=void 0},false);b=c=void 0},false)}function SVGCSSRule(){CSSRule.apply(this);this.COLOR_PROFILE_RULE=7}SVGCSSRule.prototype=Object._create(CSSRule);function SVGDocument(){Document.apply(this);DocumentStyle.apply(this);this.title="";this.referrer=document.referrer;this.domain=document.domain;this.URL=document.location;this.rootElement}SVGDocument.prototype=Object._create(Document);SVGDocument.prototype._domnodeEvent=function(){var b=this.createEvent("MutationEvents");b.initMutationEvent("DOMNodeInsertedIntoDocument",false,false,null,null,null,null,null);return b};function SVGSVGElement(c){SVGElement.apply(this,arguments);c&&(this._tar=c.createElement("v:group"));c=void 0;this._svgload_limited=0;var b=SVGAnimatedLength;this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0;this.contentScriptType="application/ecmascript";this.contentStyleType="text/css";this.viewport=this.createSVGRect();this.useCurrentView=false;this.currentView=new SVGViewSpec(this);this.currentScale=1;this.currentTranslate=this.createSVGPoint();this.viewBox=this.currentView.viewBox;this.preserveAspectRatio=this.currentView.preserveAspectRatio;this.zoomAndPan=1;this._tx=0;this._ty=0;this._currentTime=0;this.addEventListener("DOMAttrModified",function(o){if(o.eventPhase===3){return}var g=o.target,e=o.attrName,f,l,i,j,k,d;if(e==="viewBox"){g._cacheScreenCTM=null;f=g.viewBox.baseVal;l=o.newValue.replace(/^\s+|\s+$/g,"").split(/[\s,]+/);f.x=parseFloat(l[0]);f.y=parseFloat(l[1]);f.width=parseFloat(l[2]);f.height=parseFloat(l[3]);g.viewBox.baseVal._isUsed=1}else{if(e==="preserveAspectRatio"){g._cacheScreenCTM=null;i=o.newValue;j=g.preserveAspectRatio.baseVal;k=1;d=0;if(!!i.match(/x(Min|Mid|Max)Y(Min|Mid|Max)(?:\s+(meet|slice))?/)){switch(RegExp.$1){case"Min":k+=1;break;case"Mid":k+=2;break;case"Max":k+=3;break}switch(RegExp.$2){case"Min":break;case"Mid":k+=3;break;case"Max":k+=6;break}if(RegExp.$3==="slice"){d=2}else{d=1}}j.align=k;j.meetOrSlice=d}else{if(e==="width"){g.viewport.width=g.width.baseVal.value}else{if(e==="height"){g.viewport.height=g.height.baseVal.value}}}}o=e=f=l=i=j=k=d=void 0},false);this.addEventListener("SVGLoad",function(d){d.target.addEventListener("DOMAttrModified",function(q){var l,r,f,o;if(q.eventPhase===3){l=q.target;if(l.parentNode){r=l.ownerDocument._domnodeEvent();r.target=l;r.eventPhase=2;f=l._capter;for(var g=0,e=f.length;gg?g:L;ab=X>v?v:X;U=A.currentStyle;k=T(U.left);e=T(U.top);V=-I._tx;bt=-I._ty;if(k!==0&&!isNaN(k)){V=k;aa.style.left=-V+"px"}if(e!==0&&!isNaN(k)){bt=e;aa.style.top=-bt+"px"}H=V+Z+1;Y=bt+ab+1;ac.clip="rect("+bt+"px "+H+"px "+Y+"px "+V+"px)";this._document=O;N=function(){if("_svgload_limited" in O.documentElement){O.documentElement._svgload_limited--;if(O.documentElement._svgload_limited<0){var i=O.createEvent("SVGEvents");i.initEvent("SVGLoad",false,false);O.documentElement.dispatchEvent(i);i=void 0}}};ac.visibility="hidden";E=O.documentElement._tar.getElementsByTagName("div");for(var W=0,S;E[W];++W){S=E[W];if(S.firstChild.nodeName!=="shape"){var c=S.style;c.left=T(c.left)-V+"px";c.top=T(c.top)-bt+"px";c=void 0}}K&&K.scroll(-O.documentElement._tx,-O.documentElement._ty);ac.visibility="visible";O._isLoaded=1;O.defaultView._cache=O.defaultView._cache_ele=null;d=f=evt=p=B=I=q=z=C=R=o=aa=A=g=v=Q=t=void 0;ac=U=E=S=W=k=e=V=bt=E=T=L=X=Z=ab=Y=H=void 0;this.xmlhttp.onreadystatechange=NAIBU.emptyFunction;if(this._next){N();K&&(u.contentWindow.screen.updateInterval=0);N=u=K=O=void 0;this._next._init()}else{if(O.implementation._buffer_){screen.updateInterval=0;NAIBU._buff_num=0;NAIBU._buff=setInterval(function(){var ah=NAIBU._buff_num,s=DOMImplementation._buffer_,ag=s?s.length:0,af,ad;if(ag===0){clearInterval(NAIBU._buff);N();N=O=s=ah=void 0}else{for(var ae=0;ae<50;++ae){af=s[ah];ad=s[ah+1];af.dispatchEvent(ad);ah+=2;af=ad=void 0;if(ah>=ag){clearInterval(NAIBU._buff);N();DOMImplementation._buffer_=null;NAIBU.Time.start();N=O=s=ah=ag=void 0;return}}NAIBU._buff_num=ah}s=ah=ag=void 0},1);u=K=void 0}else{N();N=u=K=O=void 0;NAIBU.Time.start()}delete NAIBU.doc}},getSVGDocument:function(){return(this._document)}};NAIBU.emptyFunction=function(){};function SVGStyleElement(b){SVGElement.apply(this);LinkStyle.apply(this);this.xmlspace;this.type="text/css";this.media;this.title;SVGURIReference.apply(this);this.addEventListener("DOMAttrModified",function(c){if(c.attrName==="type"){c.target.type=c.newValue}else{if(c.attrName==="title"){c.target.title=c.newValue}}c=void 0},false);this.addEventListener("S_Load",function(u){var q=u.target,s=q.sheet,c=q._text,g=q.ownerDocument,d=b.createElement("style"),t,p,k,f;NAIBU._temp_doc=g;s=g.styleSheets[g.styleSheets.length]=DOMImplementation.createCSSStyleSheet(q.title,q.media);s.ownerNode=q;b.documentElement.firstChild.appendChild(d);d.styleSheet.cssText=c;for(var o=0,v=d.styleSheet.rules,r=v.length;o-1)||(z.indexOf("#"+C.id)>-1)||(C.nodeName===z)){j[j.length]=G[A]}C._rules=j}C=E=G=void 0},true);q=u=d=s=c=g=o=v=r=void 0},false);this.addEventListener("DOMNodeInserted",function(d){var c=d.target;if(d.eventPhase===3){if(c.nodeName==="#cdata-section"){d.currentTarget._text=c.data}return}c.addEventListener("DOMNodeInsertedIntoDocument",function(g){var f=g.target;if((g.eventPhase===2)&&!f.getAttributeNodeNS("http://www.w3.org/1999/xlink","xlink:href")){var e=f.ownerDocument.createEvent("SVGEvents");e.initEvent("S_Load",false,false);g.currentTarget.dispatchEvent(e)}f=g=void 0},false)},false)}SVGStyleElement.prototype=Object._create(SVGElement);function SVGPoint(){}SVGPoint.prototype.x=SVGPoint.prototype.y=0;SVGPoint.prototype.matrixTransform=function(b){if(!isFinite(b.a)||!isFinite(b.b)||!isFinite(b.c)||!isFinite(b.d)||!isFinite(b.e)||!isFinite(b.f)){throw (new Error("Type Error: 引数の値がNumber型ではありません"))}var c=new SVGPoint();c.x=b.a*this.x+b.c*this.y+b.e;c.y=b.b*this.x+b.d*this.y+b.f;return c};function SVGPointList(){}function SVGMatrix(){}SVGMatrix.prototype={a:1,b:0,c:0,d:1,e:0,f:0,multiply:function(c){var f=new SVGMatrix(),b=c,e=isFinite,d=this;if(!e(b.a)||!e(b.b)||!e(b.c)||!e(b.d)||!e(b.e)||!e(b.f)){throw (new Error("Type Error: 引数の値がNumber型ではありません"))}f.a=d.a*b.a+d.c*b.b;f.b=d.b*b.a+d.d*b.b;f.c=d.a*b.c+d.c*b.d;f.d=d.b*b.c+d.d*b.d;f.e=d.a*b.e+d.c*b.f+d.e;f.f=d.b*b.e+d.d*b.f+d.f;b=d=c=e=void 0;return f},inverse:function(){var b=new SVGMatrix(),c=this._determinant();if(c!==0){b.a=this.d/c;b.b=-this.b/c;b.c=-this.c/c;b.d=this.a/c;b.e=(this.c*this.f-this.d*this.e)/c;b.f=(this.b*this.e-this.a*this.f)/c;return b}else{throw (new SVGException(2))}},translate:function(c,e){var b=new SVGMatrix();b.e=c;b.f=e;var d=this.multiply(b);b=void 0;return d},scale:function(d){var b=new SVGMatrix();b.a=d;b.d=d;var c=this.multiply(b);b=void 0;return c},scaleNonUniform:function(c,e){var b=new SVGMatrix();b.a=c;b.d=e;var d=this.multiply(b);b=void 0;return d},rotate:function(e){var c=new SVGMatrix(),b=e/180*Math.PI;c.a=Math.cos(b);c.b=Math.sin(b);c.c=-c.b;c.d=c.a;var d=this.multiply(c);c=b=void 0;return d},rotateFromVector:function(d,f){if((d===0)||(f===0)||!isFinite(d)||!isFinite(f)){throw (new SVGException(1))}var c=new SVGMatrix(),b=Math.atan2(f,d);c.a=Math.cos(b);c.b=Math.sin(b);c.c=-c.b;c.d=c.a;var e=this.multiply(c);c=b=void 0;return e},flipX:function(){var b=new SVGMatrix();b.a=-b.a;var c=this.multiply(b);b=void 0;return c},flipY:function(){var b=new SVGMatrix();b.d=-b.d;var c=this.multiply(b);b=void 0;return c},skewX:function(e){var c=new SVGMatrix(),b=e/180*Math.PI;c.c=Math.tan(b);var d=this.multiply(c);c=void 0;return d},skewY:function(e){var c=new SVGMatrix(),b=e/180*Math.PI;c.b=Math.tan(b);var d=this.multiply(c);c=void 0;return d},_determinant:function(){return(this.a*this.d-this.b*this.c)}};function SVGTransform(){this.matrix=new SVGMatrix()}SVGTransform.prototype={_matrix:(new SVGMatrix()),type:0,angle:0,setMatrix:function(b){this.type=1;this.matrix=this._matrix.multiply(b)},setTranslate:function(c,b){this.type=2;this.matrix=this._matrix.translate(c,b)},setScale:function(c,b){this.type=3;this.matrix=this._matrix.scaleNonUniform(c,b)},setRotate:function(c,b,d){this.angle=c;this.type=4;this.matrix=this._matrix.rotate(c);this.matrix.e=(1-this.matrix.a)*b-this.matrix.c*d;this.matrix.f=-this.matrix.b*b+(1-this.matrix.d)*d},setSkewX:function(b){this.angle=b;this.type=5;this.matrix=this._matrix.skewX(b)},setSkewY:function(b){this.angle=b;this.type=6;this.matrix=this._matrix.skewY(b)}};function SVGTransformList(){}SVGTransformList.prototype.createSVGTransformFromMatrix=function(b){var c=new SVGTransform();c.setMatrix(b);return c};SVGTransformList.prototype.consolidate=function(){if(this.numberOfItems===0){return null}else{var e=this.getItem(0),c=e.matrix;for(var d=1,b=this.numberOfItems;d0){E=k.split(",");for(var M=0,g=E.length;M-1)){e.style.display="none"}else{if(I&&!I._isDefault&&(I.cssText.indexOf("inline-block")===-1)){e.style.display="inline-block"}}}R=j=e=J=u=O=s=Q=p=N=L=C=I=v=void 0};function b(f){SVGElement.apply(this);this._tar=f.createElement("v:shape");var e=SVGPathSegList;this.pathSegList=new e();this.animatedPathSegList=this.pathSegList;this.normalizedPathSegList=new e();e=f=void 0;this.animatedNormalizedPathSegList=this.normalizedPathSegList;this.pathLength=new SVGAnimatedNumber();this.addEventListener("DOMAttrModified",this._attrModi,false);this.addEventListener("DOMNodeInserted",this._nodeInsert,false)}b.prototype=Object._create(SVGElement);(function(e){e._attrModi=function(K){var P=K.target;if(K.attrName==="d"&&K.newValue!==""){var H=P.normalizedPathSegList,O=P.pathSegList;if(H.numberOfItems>0){H.clear();O.clear()}var V=P._com,S=V.isSp,v=K.newValue.replace(V.isRa," -").replace(V.isRb," ").replace(V.isRc,",$1 ").replace(V.isRd,",$1 1").replace(V.isRe,"").replace(/\.(\d+)\./g,".$1 0.").replace(/[^\w\d\+\-\.\,\n\r\s].*/,"").split(","),l=v.length,B=V._isZ,E=V._isM,L=V._isC,F=V._isL,r=P.createSVGPathSegCurvetoCubicAbs,Q=P.createSVGPathSegLinetoAbs,M,q;for(var U=0;U1&&(+M>=0)){u.splice(T+3,1,M.charAt(0),M.slice(1));++J}q=u[T+4];if(q.length>1&&(+q>=0)){u.splice(T+4,1,q.charAt(0),q.slice(1));++J}M=u[T+3];q=u[T+4];if(((+M<0)||(+M>1))||((+q<0)||(+q>1))){T+=6;continue}R=P.createSVGPathSegArcAbs(+u[T+5],+u[T+6],+u[T],+u[T+1],+u[T+2],+M,+q);T+=6}else{if(g==="m"){R=P.createSVGPathSegMovetoRel(+u[T],+u[T+1]);++T}else{if(g==="l"){R=P.createSVGPathSegLinetoRel(+u[T],+u[T+1]);++T}else{if(g==="c"){R=P.createSVGPathSegCurvetoCubicRel(+u[T+4],+u[T+5],+u[T],+u[T+1],+u[T+2],+u[T+3]);T+=5}else{if(g==="Q"){R=P.createSVGPathSegCurvetoQuadraticAbs(+u[T+2],+u[T+3],+u[T],+u[T+1]);T+=3}else{if(g==="q"){R=P.createSVGPathSegCurvetoQuadraticRel(+u[T+2],+u[T+3],+u[T],+u[T+1]);T+=3}else{if(g==="a"){M=u[T+3];if(M.length>1&&(+M>=0)){u.splice(T+3,1,M.charAt(0),M.slice(1));++J}q=u[T+4];if(q.length>1&&(+q>=0)){u.splice(T+4,1,q.charAt(0),q.slice(1));++J}M=u[T+3];q=u[T+4];if(((+M<0)||(+M>1))||((+q<0)||(+q>1))){T+=6;continue}R=P.createSVGPathSegArcRel(+u[T+5],+u[T+6],+u[T],+u[T+1],+u[T+2],+M,+q);T+=6}else{if(g==="S"){R=P.createSVGPathSegCurvetoCubicSmoothAbs(+u[T+2],+u[T+3],+u[T],+u[T+1]);T+=3}else{if(g==="s"){R=P.createSVGPathSegCurvetoCubicSmoothRel(+u[T+2],+u[T+3],+u[T],+u[T+1]);T+=3}else{if(g==="T"){R=P.createSVGPathSegCurvetoQuadraticSmoothAbs(+u[T],+u[T+1]);++T}else{if(g==="t"){R=P.createSVGPathSegCurvetoQuadraticSmoothRel(+u[T],+u[T+1]);++T}else{if(g==="H"){R=P.createSVGPathSegLinetoHorizontalAbs(+u[T])}else{if(g==="h"){R=P.createSVGPathSegLinetoHorizontalRel(+u[T])}else{if(g==="V"){R=P.createSVGPathSegLinetoVerticalAbs(+u[T])}else{if(g==="v"){R=P.createSVGPathSegLinetoVerticalRel(+u[T])}else{R=new SVGPathSeg()}}}}}}}}}}}}}}}}}}}O.appendItem(R)}}u=R=S=v=void 0;var D=0,C=0,N=0,A=0,p=0,o=0;for(var T=0,t=O.numberOfItems;T1){an=c.sqrt(aS)*an;am=c.sqrt(aS)*am;aL=0}else{var ag=1;if(Z.largeArcFlag===aK){ag=-1}aL=ag*c.sqrt((aA*ah-aA*ae-ah*ak)/(aA*ae+ah*ak))}var aq=aL*an*al/am,s=-1*aL*am*aB/an,aN=Y*aq-aC*s+(az+aw)/2,aM=aC*aq+Y*s+(ax+av)/2,ab=c.atan2((al-s)/am,(aB-aq)/an)-c.atan2(0,1),aP=(ab>=0)?ab:2*c.PI+ab,ab=c.atan2((-al-s)/am,(-aB-aq)/an)-c.atan2((al-s)/am,(aB-aq)/an),af=(ab>=0)?ab:2*c.PI+ab;if(!aK&&af>0){af-=2*c.PI}else{if(aK&&af<0){af+=2*c.PI}}var ac=af*2/c.PI,aD=c.ceil(ac<0?-1*ac:ac),aE=af/aD,aI=8/3*c.sin(aE/4)*c.sin(aE/4)/c.sin(aE/2),aH=Y*an,aG=Y*am,j=aC*an,i=aC*am,ar=c.cos(aP),aj=c.sin(aP),ap=az-aI*(aH*aj+i*ar),aR=ax-aI*(j*aj-aG*ar);for(var aJ=0;aJ-1){}else{N=I,A=G}}else{N=I,A=G}H.appendItem(r(D,C,(I+2*N)/3,(G+2*A)/3,(2*N+D)/3,(2*A+C)/3));N=2*D-N;A=2*C-A;xx1=yy1=void 0}else{if(g==="H"||g==="h"){H.appendItem(Q(D,G));C=G}else{if(g==="V"||g==="v"){H.appendItem(Q(I,C));D=I}}}}}}}}}}}}}}}}}}K=P=V=D=C=N=A=p=o=H=O=f=g=W=B=E=F=L=R=r=Q=void 0};e._nodeInsert=function(g){var f=g.target;if(g.eventPhase===3){return}var k=f.nextSibling,i=f.parentNode._tar,j=true;if(k&&k._tar&&i&&(k._tar.parentNode===i)){i.insertBefore(f._tar,k._tar)}else{if(k&&!k._tar&&i){while(k){if(k._tar&&(k._tar.parentNode===i)){i.insertBefore(f._tar,k._tar);j=false}k=k.nextSibling}if(j){i.appendChild(f._tar)}}else{if(!k&&i){i.appendChild(f._tar)}}}k=i=j=void 0;f.addEventListener("DOMNodeInsertedIntoDocument",f._nodeInsertInto,false);g=f=void 0};e._nodeInsertInto=function(r){var z=r.target,v=z.getScreenCTM(),p=z.normalizedPathSegList,D=[],j=v.a,g=v.b,K=v.c,J=v.d,I=v.e,H=v.f,k=z._com._nameCom,o=z._com._isZ,B=z._com._isC,s=c.round;for(var A=0,u=p.numberOfItems;AT/2){k.value=T/2}if(j.value>l/2){j.value=l/2}var v=k.value,J=j.value,t=v*0.55228,s=J*0.55228,W=u-v,S=A+v,R=z+J,Q=X-J;O=["m",S,z,"l",W,z,"c",W+t,z,u,R-s,u,R,"l",u,Q,"c",u,Q+s,W+t,X,W,X,"l",S,X,"c",S-t,X,A,Q+s,A,Q,"l",A,R,"c",A,R-s,S-t,z,S,z]}else{O=["m",A,z,"l",A,X,u,X,u,z,"x e"]}var D=L.ownerDocument.documentElement,V=L.getScreenCTM(),P,G,F,C=L._tar,U=L.ownerDocument.documentElement,B=U.width.baseVal.value,M=U.height.baseVal.value,H=Math.round;for(var K=0,I=O.length;K0)){c.newValueSpecifiedUnits(1,this.getSubStringLength(0,this.getNumberOfChars()))}c=void 0;return(this.textLength.baseVal.value)};b.prototype.getSubStringLength=function(e,i){if(i===0){return 0}var g=this.getNumberOfChars();if(g<(i+e)){i=g-e+1}var c=this.getEndPositionOfChar(i+e-1),d=this.getStartPositionOfChar(e);if(this._isYokogaki){var f=c.x-d.x}else{var f=c.y-d.y}g=c=d=void 0;return f};b.prototype.getStartPositionOfChar=function(d){if(d>this.getNumberOfChars()||d<0){throw (new DOMException(1))}else{var M=this,l=M.firstChild,g=M.parentNode;if(!!!M._list){M._list=[];var C=M._chars,A=M._stx,z=M._sty,F=0,N=M.ownerDocument.defaultView.getComputedStyle(M,null),t=((N.getPropertyValue("writing-mode"))==="lr-tb")?true:false,k=parseFloat(N.getPropertyValue("font-size")),R=M.x.baseVal,Q=M.y.baseVal,G=M.dx.baseVal,E=M.dy.baseVal;if(g&&((g.localName==="text")||(g.localName==="tspan"))){var P=g.x.baseVal,O=g.y.baseVal,u=g.dx.baseVal,r=g.dy.baseVal}else{var P=O=u=r={numberOfItems:0}}var o="f ijltIr.,:;'-\"()",j="1234567890abcdeghknopquvxyz",c,f,e,H,D,K,J,v,q;if(t&&(M.localName==="text")){z+=k*0.2}else{if(M.localName==="text"){A-=k*0.5}}while(l){if(l.nodeType===3){c=l._tars;for(var L=0,I=c.length;L-1){f=k*0.68}else{if(e==="s"){f=k*0.52}else{if((e==="C")||(e==="D")||(e==="M")||(e==="W")||(e==="G")||(e==="m")){f=k*0.2}else{if(j.indexOf(e)>-1){f=k*0.45}else{f=k*0.3}}}}H=e.charCodeAt(0);if((12288<=H)&&(H<=65533)){f=-k*0.01;if((e==="う")||(e==="く")||(e==="し")||(e==="ち")){f+=k*0.2}}}v=M._list;v[v.length]=A;v[v.length]=z;v[v.length]=k-f;if(t){A+=k;A-=f}else{z+=k}++F}C+=I;if(l.parentNode&&(l.parentNode.localName==="a")){l=l.parentNode}l=l.nextSibling}else{if(((l.localName==="tspan")||(l.localName==="tref"))&&(l.namespaceURI==="http://www.w3.org/2000/svg")&&l.firstChild){l._stx=A;l._sty=z;l._chars=C;D=l.getStartPositionOfChar(l.getNumberOfChars());K=0;J=0;v=l._list;if(t){K=v[v.length-1]}else{J=v[v.length-1]}A=v[v.length-3]+K;z=v[v.length-2]+J;M._list=M._list.concat(v);q=l.getNumberOfChars();F+=q;C+=q;l=l.nextSibling}else{if((l.localName==="a")&&(l.namespaceURI==="http://www.w3.org/2000/svg")&&l.firstChild){l=l.firstChild}else{l=l.nextSibling}}}}M._isYokogaki=t}M=l=g=P=O=R=Q=C=N=A=z=t=o=j=c=f=e=H=D=K=J=v=q=void 0;var B=this.ownerDocument.documentElement.createSVGPoint();B.x=this._list[d*3];B.y=this._list[d*3+1];B=B.matrixTransform(this.getScreenCTM());return B}};b.prototype.getEndPositionOfChar=function(c){if(c>this.getNumberOfChars()||c<0){throw (new DOMException(1))}else{var d=this.getStartPositionOfChar(c);var e=this._list[c*3+2]*Math.sqrt(Math.abs(this.getScreenCTM()._determinant()));if(this._isYokogaki){d.x+=e}else{d.y+=e}return d}};b.prototype.getExtentOfChar=function(c){};b.prototype.getRotationOfChar=function(c){};b.prototype.getCharNumAtPosition=function(c){};b.prototype.selectSubString=function(c,d){}})(SVGTextContentElement);function SVGTextPositioningElement(c){SVGTextContentElement.apply(this,arguments);var b=SVGAnimatedLengthList;this.x=new b();this.y=new b();this.dx=new b();this.dy=new b();b=void 0;this.rotate=new SVGAnimatedNumberList();this.addEventListener("DOMAttrModified",function(t){var o=t.target,f=t.attrName,k=o.ownerDocument.documentElement,j=parseFloat;if((f==="x")||(f==="y")||(f==="dx")||(f==="dy")){var q=t.newValue.replace(/^\s+|\s+$/g,"").split(/[\s,]+/),u=o[f].baseVal;for(var l=0,e=q.length;l="0"&&g<="9"){p=1}else{if(g==="%"){if((f==="x")||(f==="dx")){r._percent*=k.viewport.width}else{if((f==="y")||(f==="dy")){r._percent*=k.viewport.height}}p=2}else{g=q[l].slice(-2);if(g==="em"){var d=o.ownerDocument.defaultView.getComputedStyle(o,null);r._percent*=j(d.getPropertyValue("font-size"));d=void 0;p=3}else{if(g==="ex"){p=4}else{if(g==="px"){p=5}else{if(g==="cm"){p=6}else{if(g==="mm"){p=7}else{if(g==="in"){p=8}else{if(g==="pt"){p=9}else{if(g==="pc"){p=10}}}}}}}}}}var v=j(q[l]);v=isNaN(v)?0:v;r.newValueSpecifiedUnits(p,v);u.appendItem(r)}o._list=null}t=o=void 0},false);this.addEventListener("DOMNodeInserted",function(e){if(e.eventPhase===3){var d=e.target;if(d.nodeType!==3){d._list=void 0;e.currentTarget._list=null}e=d=void 0}},false);if(c){this._tar=c.createElement("v:group");this._doc=c}this.addEventListener("DOMNodeInserted",function(e){if(e.eventPhase===3){return}var d=e.target,i=d.nextSibling,f=d.parentNode._tar,g=true;if(i&&i._tar&&f&&(i._tar.parentNode===f)){f.insertBefore(d._tar,i._tar)}else{if(i&&!i._tar&&f){while(i){if(i._tar&&(i._tar.parentNode===f)){f.insertBefore(d._tar,i._tar);g=false}i=i.nextSibling}if(g){f.appendChild(d._tar)}}else{if(!i&&f){f.appendChild(d._tar)}}}i=f=g=void 0;d.addEventListener("DOMNodeInsertedIntoDocument",d._texto,false);e=d=void 0},false)}SVGTextPositioningElement.prototype=Object._create(SVGTextContentElement);SVGTextPositioningElement.prototype._texto=function(I){var L=I.target,b=L.firstChild,F=L._tar,N=L.ownerDocument.defaultView.getComputedStyle(L,null),D=Math.sqrt(Math.abs(L.getScreenCTM()._determinant())),O=parseFloat(N.getPropertyValue("font-size"))*D,u=L.ownerDocument.documentElement,J=F,V=L.getComputedTextLength(),f=N.getPropertyValue("text-anchor"),d=N.getPropertyValue("text-decoration"),B=F.style,t=[],A=parseFloat(N.getPropertyValue("letter-spacing")),v=parseFloat(N.getPropertyValue("word-spacing"));B.fontSize=O+"px";B.fontFamily=N.getPropertyValue("font-family");B.fontStyle=N.getPropertyValue("font-style");B.fontWeight=N.getPropertyValue("font-weight");if(isFinite(A)){B.letterSpacing=A*D+"px"}if(isFinite(parseFloat(v))){B.wordSpacing=v*D+"px"}for(var U=0,T=0,r=L.getNumberOfChars();UT)?U-T:T-U;var H=b._tars[K].style,M=L.getStartPositionOfChar(U);H.position="absolute";if(L._isYokogaki){if(f==="middle"){M.x-=V/2}else{if(f==="end"){M.x-=V}}}else{if(f==="middle"){M.y-=V/2}else{if(f==="end"){M.y-=V}}}H.left=M.x+"px";H.top=M.y+"px";H.width="0px";H.height="0px";H.marginTop=L._isYokogaki?-O-5+"px":"-5px";H.lineHeight=O+10+"px";H.textDecoration=d;H.display="none";F.appendChild(b._tars[K]);H=M=void 0}if(b.nodeName==="#text"){if((b.data.length+T)<=U+1){T=T+b.data.length;if(b.data===""){--U}if(b.parentNode.localName==="a"){b=b.parentNode;F=J}b=b.nextSibling}}else{if(!!b.getNumberOfChars){if((b.getNumberOfChars()+T)<=U+1){T=T+b.getNumberOfChars();b=b.nextSibling}}else{if((b.localName==="a")&&(b.namespaceURI==="http://www.w3.org/2000/svg")&&b.firstChild){F=b._tar;b=b.firstChild;t[t.length]=b;if(U===0){--U}else{U-=2}}}}}}var G=N.getPropertyValue("fill"),g=N.getPropertyCSSValue("cursor"),R=N.getPropertyCSSValue("visibility"),q=N.getPropertyCSSValue("display"),E=L._tar.style,c=L.firstChild._tars,C=c[0]?c[0].innerText.charAt(0):[""],P;if(G==="none"){E.color="transparent"}else{if(G.indexOf("url")===-1){E.color=G}else{E.color="black"}}if(g&&!g._isDefault){var e=g.cssText;E.cursor=e.split(":")[1];e=void 0}if((L.x.baseVal.numberOfItems===1)&&(L.y.baseVal.numberOfItems===1)&&L._isYokogaki&&(L.firstChild.nodeName==="#text")){for(var U=1,r=c.length;U-1)){s="none"}else{if(q&&!q._isDefault){s="block"}}var o=L._tar.firstChild,T=0;while(o){o.style.display=s;o=o.nextSibling}while(t[T]){for(var Q=0,r=t[T]._tars.length;Q102&&!e)){throw new SVGException(1)}this.uri=e;this.paintType=c;if(c===102){c=3}this.setColor(c,d,f)};b=void 0})(SVGPaint);function SVGMarkerElement(){SVGSVGElement.apply(this,[{createElement:function(){}}]);this._tar={style:{}};var b=SVGAnimatedLength;this.refX=new b();this.refY=new b();this.markerUnits=new SVGAnimatedEnumeration();this.markerUnits.baseVal=2;this.markerWidth=new b();this.markerHeight=new b();this.refX.baseVal.newValueSpecifiedUnits(1,0);this.refY.baseVal.newValueSpecifiedUnits(1,0);this.markerWidth.baseVal.newValueSpecifiedUnits(1,3);this.markerHeight.baseVal.newValueSpecifiedUnits(1,3);b=void 0;this.orientType=new SVGAnimatedEnumeration();this.orientType.baseVal=2;this.orientAngle=new SVGAnimatedAngle();this.addEventListener("DOMAttrModified",function(d){var c=d.target,e=d.newValue,f;if(d.attrName==="orient"){if(e==="auto"){c.setOrientToAuto()}else{f=c.ownerDocument.documentElement.createSVGAngle();f.newValueSpecifiedUnits(1,+e);c.setOrientToAngle(f)}}else{if(d.attrName==="markerUnits"){if(e==="strokeWidth"){c.markerUnits.baseVal=2}else{c.markerUnits.baseVal=1}}}},false);this.addEventListener("DOMNodeInsertedIntoDocument",function(c){var d=NAIBU._setPaint,e=c.target.getAttributeNS(null,"id");NAIBU._setPaint=(function(f,g){return function(E,J){f(E,J);var r=E.ownerDocument,j=r.documentElement,F=r.defaultView.getComputedStyle(E,""),D=F.getPropertyValue("marker-start").slice(5,-1),L=F.getPropertyValue("marker-end").slice(5,-1),H=F.getPropertyValue("marker-mid").slice(5,-1),q,s,l,i,k,o,G,J,I,p,K,A,C,v,z,B=function(t,M){s=q.cloneNode(true);l=r.createElementNS("http://www.w3.org/2000/svg","g");while(s.lastChild){l.appendChild(s.lastChild)}i=l.transform.baseVal;o=E.transform.baseVal.consolidate()||r.documentElement.createSVGMatrix();if(q.markerUnits.baseVal===2){G=+F.getPropertyValue("stroke-width")}else{G=1}if(q.hasAttributeNS(null,"viewBox")){q.viewport.width=q.markerWidth.baseVal.value;q.viewport.height=q.markerHeight.baseVal.value;J=j.getScreenCTM.apply(q)}else{J=j.createSVGMatrix()}if(q.orientType.baseVal===1){angle=Math.atan2(K[1].y-K[0].y,K[1].x-K[0].x)*180/Math.PI}else{angle=q.orientAngle.baseVal.value}i.appendItem(i.createSVGTransformFromMatrix(o.translate(t,M).rotate(angle).scale(G).multiply(J).translate(-q.refX.baseVal.value,-q.refY.baseVal.value)));I=r.defaultView.getComputedStyle(q,"");p=l.style;A=/([A-Z])/;C=/\-/;for(var u in CSS2Properties){if(CSS2Properties.hasOwnProperty(u)&&(u!=="_list")){u=u.replace(A,"-");if(RegExp.$1){v="-"+RegExp.$1.toLowerCase()}else{v="-"}u=u.replace(C,v);p.setProperty(u,I.getPropertyValue(u),"")}}E.parentNode.insertBefore(l,E.nextSibling)};if(D===g){q=r.getElementById(D);if(E.normalizedPathSegList||E.points){k=E.normalizedPathSegList||E.points;K=[k.getItem(0),k.getItem(1)]}else{if(E.x1){K=[{x:E.x1,y:E.y1},{x:E.x2,y:E.y2}]}}B(K[0].x,K[0].y)}if(L===g){q=r.getElementById(L);if(E.normalizedPathSegList||E.points){k=E.normalizedPathSegList||E.points;K=[k.getItem(k.numberOfItems-2),k.getItem(k.numberOfItems-1)]}else{if(E.x1){K=[{x:E.x1,y:E.y1},{x:E.x2,y:E.y2}]}}B(K[1].x,K[1].y)}if(H===g){q=r.getElementById(H)}r=j=F=I=p=D=L=H=q=s=l=J=G=i=k=o=K=A=C=v=z=B=void 0}})(d,e)},false)}(function(b){b.prototype=Object._create(SVGSVGElement);b.prototype.getScreenCTM=SVGElement.prototype.getScreenCTM;b.prototype.setOrientToAuto=function(){this.orientType.baseVal=1};b.prototype.setOrientToAngle=function(c){this.orientType.baseVal=2;this.orientAngle.baseVal=c}})(SVGMarkerElement);function SVGColorProfileElement(){SVGElement.apply(this);this._local;this.name;this.renderingIntent;SVGURIReference.apply(this)}SVGColorProfileElement.prototype=Object._create(SVGElement);function SVGColorProfileRule(){SVGCSSRule.apply(this);this.src;this.name;this.renderingIntent}SVGColorProfileRule.prototype=Object._create(SVGCSSRule);function SVGGradientElement(){SVGElement.apply(this);SVGURIReference.apply(this);this.gradientUnits=new SVGAnimatedEnumeration();this.gradientTransform=new SVGAnimatedTransformList();this.spreadMethod=new SVGAnimatedEnumeration();this.addEventListener("DOMNodeInsertedIntoDocument",function(q){var p=q.target,v=q._tar,s=q._style,k=p,c,r,e,g=[],b=[],l=[],o,f,u;if(!v||!p){p=v=s=k=c=r=e=g=b=l=void 0;return}if(p._instance){k=p._instance}r=k.getElementsByTagNameNS("http://www.w3.org/2000/svg","stop");if(!r){v=s=c=p=k=r=g=b=l=void 0;return}e=r.length;for(var j=0;j=360){g-=360}f.setAttribute("type","gradient");f.setAttribute("angle",g+"");c=f=i=g=d=e=void 0},false)}SVGLinearGradientElement.prototype=Object._create(SVGGradientElement);function SVGRadialGradientElement(c){SVGGradientElement.apply(this);var b=SVGAnimatedLength;this.cx=new b();this.cy=new b();this.r=new b();this.fx=new b();this.fy=new b();b=void 0;this.cx.baseVal.value=this.cy.baseVal.value=this.r.baseVal.value=0.5;this.addEventListener("DOMNodeInsertedIntoDocument",function(C){var o=C.target,Y=C._tar,E=C._ttar;if(!!!Y){return}Y.setAttribute("type","gradientTitle");Y.setAttribute("focus","100%");Y.setAttribute("focusposition","0.5 0.5");if(E.localName==="rect"){var M=o.ownerDocument.defaultView.getComputedStyle(E,""),l=parseFloat(M.getPropertyValue("font-size"));o.cx.baseVal._emToUnit(l);o.cy.baseVal._emToUnit(l);o.r.baseVal._emToUnit(l);o.fx.baseVal._emToUnit(l);o.fy.baseVal._emToUnit(l);var z=o.cx.baseVal.value,u=o.cy.baseVal.value,I=o.r.baseVal.value,f=Math.round,B,A;B=A=I;var G=E.getBBox(),s=E.ownerDocument.documentElement.viewport,U=f(s.width),J=f(s.height),O=0,d=0,V=o.getAttributeNS(null,"gradientUnits");if(!V||V==="objectBoundingBox"){z=z>1?z/100:z;u=u>1?u/100:u;I=I>1?I/100:I;var P=G.x,L=G.y,T=G.width,R=G.height;z=z*T+P;u=u*R+L;B=I*T;A=I*R;P=L=T=R=void 0}var D=E.getScreenCTM().multiply(o.getCTM());U=z-B;J=u-A;O=z+B;d=u+A;var k=B*0.55228,j=A*0.55228,v=["m",z,J,"c",z-k,J,U,u-j,U,u,U,u+j,z-k,d,z,d,z+k,d,O,u+j,O,u,O,u-j,z+k,J,z,J,"x e"];for(var Q=0,N=v.length;Q'+Y.outerHTML+"",W=E._tar.path.value;F.innerHTML='';F.filters[0].apply();F.innerHTML=q;F.filters[0].play();E._tar.parentNode.insertBefore(F,E._tar);E._tar.filled="false";X=e=F=M=l=t=q=W=v=f=gt=z=u=I=H=S=D=void 0}else{if(!Y.parentNode){E._tar.appendChild(Y)}}C=E=Y=gard=void 0},false)}SVGRadialGradientElement.prototype=Object._create(SVGGradientElement);function SVGStopElement(){SVGElement.apply(this);this.offset=new SVGAnimatedNumber();this.addEventListener("DOMAttrModified",function(b){if(b.attrName==="offset"){b.target.offset.baseVal=parseFloat(b.newValue)}b=void 0},false)}SVGStopElement.prototype=Object._create(SVGElement);function SVGPatternElement(){SVGElement.apply(this);var b=SVGAnimatedLength;this.patternUnits=new SVGAnimatedEnumeration();this.patternContentUnits=new SVGAnimatedEnumeration();this.patternTransform=new SVGAnimatedTransformList();this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0;SVGURIReference.apply(this);this.viewBox=new SVGAnimatedRect();this.preserveAspectRatio=new SVGAnimatedPreserveAspectRatio();this.zoomAndPan=1}SVGPatternElement.prototype=Object._create(SVGElement);function SVGClipPathElement(){SVGElement.apply(this);this.clipPathUnits=new SVGAnimatedEnumeration()}SVGClipPathElement.prototype=Object._create(SVGElement);function SVGMaskElement(){SVGElement.apply(this);var b=SVGAnimatedLength;this.maskUnits=new SVGAnimatedEnumeration();this.maskContentUnits=new SVGAnimatedEnumeration();this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0}SVGMaskElement.prototype=Object._create(SVGElement);function SVGFilterElement(){SVGElement.apply(this);var b=SVGAnimatedLength;this.filterUnits=new SVGAnimatedEnumeration();this.primitiveUnits=new SVGAnimatedEnumeration();this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0;this.filterResX=new SVGAnimatedInteger();this.filterResY=new SVGAnimatedInteger();SVGURIReference.apply(this)}SVGFilterElement.prototype=Object._create(SVGElement);function SVGFilterPrimitiveStandardAttributes(c){SVGStylable.apply(this,arguments);this._tar=c;var b=SVGAnimatedLength;this.x=new b();this.y=new b();this.width=new b();this.height=new b();this.result=new b();b=void 0}SVGFilterPrimitiveStandardAttributes.prototype=Object._create(SVGStylable);function SVGFEBlendElement(){SVGElement.apply(this);this.in1=new SVGAnimatedString();this.in2=new SVGAnimatedString();this.mode=new SVGAnimatedEnumeration();this._fpsa=SVGFilterPrimitiveStandardAttributes(this)}SVGFEBlendElement.prototype=Object._create(SVGElement);function SVGFEGaussianBlurElement(){SVGElement.apply(this);this.in1=new SVGAnimatedString();this.stdDeviationX=new SVGAnimatedNumber();this.stdDeviationY=new SVGAnimatedNumber();this._fpsa=SVGFilterPrimitiveStandardAttributes(this)}SVGFEGaussianBlurElement.prototype=Object._create(SVGElement);SVGFEGaussianBlurElement.prototype.setStdDeviation=function(c,b){};function SVGCursorElement(){SVGElement.apply(this);this.x=new SVGAnimatedLength();this.y=new SVGAnimatedLength();SVGURIReference.apply(this)}SVGCursorElement.prototype=Object._create(SVGElement);function SVGAElement(b){SVGElement.apply(this);this._tar=b.createElement("a");b=void 0;this.target=new SVGAnimatedString();this.target.baseVal="_self";this.addEventListener("DOMAttrModified",function(d){var c=d.target;if(d.eventPhase===3){return}if(d.attrName==="target"){c.target.baseVal=d.newValue}else{if(d.attrName==="xlink:title"){c._tar.setAttribute("title",d.newValue)}}d=void 0},false);this.addEventListener("DOMNodeInserted",function(d){var c=d.target;if(d.eventPhase===3){return}if(c.nextSibling){if(!!c.parentNode._tar&&!!c.nextSibling._tar){c.parentNode._tar.insertBefore(c._tar,c.nextSibling._tar)}}else{if(!!c.parentNode._tar){c.parentNode._tar.appendChild(c._tar)}}var f=c._tar.style;f.cursor="hand";f.left="0px";f.top="0px";f.textDecoration="none";f=void 0;var g=c.target.baseVal;var e="replace";if(g==="_blank"){e="new"}c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:show",e);c._tar.style.color=c.ownerDocument.defaultView.getComputedStyle(c,"").getPropertyValue("fill");c=d=void 0},false);this.addEventListener("DOMNodeInsertedIntoDocument",function(d){var c=d.target;if(!!c._tar&&(c.nodeType===1)){var e=c._tar.style;e.cursor="hand";e.textDecoration="none";e=void 0}c=d=void 0;return},true);this.addEventListener("DOMNodeInsertedIntoDocument",function(d){var c=d.target;c._tar.setAttribute("target",c.target.baseVal);if(c.href.baseVal.indexOf(".svg")!==-1){c.addEventListener("click",function(f){var e=f.target,i=document.body,g,j;i.lastChild.innerHTML="";if(e.target.baseVal==="_self"){j=e.ownerDocument._iframe;j.parentNode.insertBefore(i.lastChild.firstChild,j);g=j.nextSibling;if(g&&(g.tagName==="OBJECT")){j.previousSibling.setAttribute("width",g.getAttribute("width"));j.previousSibling.setAttribute("height",g.getAttribute("height"));j.parentNode.removeChild(g)}g=NAIBU._search([j.previousSibling]);j.parentNode.removeChild(j)}else{i.appendChild(i.lastChild.firstChild);while(i.firstChild!==i.lastChild){i.removeChild(i.firstChild)}g=NAIBU._search([i.lastChild])}NAIBU.doc=new ActiveXObject("MSXML2.DomDocument");f.preventDefault();g._next={_init:(function(k){return(function(){document.title=k.getSVGDocument().title;k=void 0})})(g)};g._init();i=g=j=void 0},false)}c=void 0},false);SVGURIReference.apply(this)}SVGAElement.prototype=Object._create(SVGElement);function SVGViewElement(){SVGElement.apply(this);this.viewTarget=new SVGStringList();this.viewBox=new SVGAnimatedRect();this.preserveAspectRatio=new SVGAnimatedPreserveAspectRatio();this.zoomAndPan=1}SVGViewElement.prototype=Object._create(SVGElement);function SVGScriptElement(){SVGElement.apply(this);this.type;SVGURIReference.apply(this);this.addEventListener("DOMAttrModified",function(evt){if(evt.attrName==="type"){evt.target.type=evt.newValue}evt=void 0},false);this.addEventListener("S_Load",function(evt){var tar=evt.target,script=tar._text;var tod=tar.ownerDocument;NAIBU._temp_doc=tod;script="with({document:NAIBU._temp_doc}){"+script+"\n};";try{NAIBU.eval(script)}catch(e){script=script.replace(/with\(\{document\){/,"with({doc) {");NAIBU.eval(script)}tar=evt=script=void 0},false);this.addEventListener("DOMNodeInserted",function(evt){var tar=evt.target;if(evt.eventPhase===3){if(tar.nodeName==="#cdata-section"){evt.currentTarget._text=tar.data;evt=tar.ownerDocument.createEvent("SVGEvents");evt.initEvent("S_Load",false,false);evt.currentTarget.dispatchEvent(evt)}evt=tar=void 0;return}tar.addEventListener("DOMNodeInsertedIntoDocument",function(evt){var tar=evt.target;if(evt.eventPhase===2&&!tar.getAttributeNodeNS("http://www.w3.org/1999/xlink","xlink:href")){var evtt=tar.ownerDocument.createEvent("SVGEvents");evtt.initEvent("S_Load",false,false);evt.currentTarget.dispatchEvent(evtt)}tar=evt=evtt=void 0},false)},false)}SVGScriptElement.prototype=Object._create(SVGElement);function SVGEvent(){Event.apply(this)}SVGEvent.prototype=Object._create(Event);function SVGZoomEvent(){UIEvent.apply(this);this.zoomRectScreen=new SVGRect();this.previousScale=1;this.previousTranslate=new SVGPoint();this.newScale=1;this.newTranslate=new SVGPoint()}SVGZoomEvent.prototype=Object._create(UIEvent);function SVGAnimationElement(){SVGElement.apply(this);this.style.setProperty=function(){};this._tar=null;this.targetElement;this._begin=this._end=this._repeatCount=this._repeatDur=this._dur=this._resatrt=null;this._currentFrame=0;this._isRepeat=false;this._numRepeat=0;this._isStarted=false;this._start=this._finish=this._starting=null;this._activeDur=0;this._from=this._to=this._values=this._by=null;this._keyTimes=null;this.addEventListener("beginEvent",function(r){try{var k=r.target,c=k.getStartTime(),l=k._dur,b=k._getOffset(l),g=k._finish,p=k._end,d=k._repeatDur,f=k._repeatCount,s=null;if(g){for(var j=0,q=g.length;j=c){g=g[j];break}}}else{p=null}if((d==="indefinite")||(f==="indefinite")){if(p){s=g-c}else{s=null}}else{if(l==="indefinite"){if(!f&&!p){s=null}else{if(f&&!p){s=k._getOffset(d)}else{if(!f&&p){s=g-c}else{s=(k._getOffset(d)>(g-c))?k._getOffset(d):(g-c)}}}}else{if(l&&!d&&!f&&!p){s=b}else{if(l&&!d&&f&&!p){s=b*(+f)}else{if(l&&d&&!f&&!p){s=k._getOffset(d)}else{if(l&&!d&&!f&&p){s=(b>(g-c))?b:(g-c)}else{if(l&&d&&f&&!p){s=(+f*b>k._getOffset(d))?+f*b:k._getOffset(d)}else{if(l&&d&&f&&p){s=(+f*b>Math.min(+d,(g-c)))?+f*b:Math.min(k._getOffset(d),(g-c))}else{if(l&&d&&!f&&p){s=(k._getOffset(d)>(g-c))?k._getOffset(d):(g-c)}else{if(l&&!d&&f&&p){s=(+f*b>(g-c))?+f*b:(g-c)}}}}}}}}}}}catch(o){k.endElementAt(1);throw new DOMException(11)}if((s||(s===0))&&isFinite(s)){p||k.endElementAt(s);k._activeDur=s}k=c=b=l=g=p=d=f=s=void 0},false);this.addEventListener("DOMAttrModified",function(c){if(c.eventPhase===3){return}var b=c.target,d=c.attrName,g=c.newValue;if(d==="begin"){b._begin=g.replace(/\s+/g,"").split(";")}else{if(d==="end"){b._end=g.replace(/\s+/g,"").split(";")}else{if(d==="dur"){b._dur=g}else{if(d==="repeatCount"){b._repeatCount=g;b._isRepeat=true}else{if(d==="repeatDur"){b._repeatCount=g;b._isRepeat=true}else{if(d==="from"){b._from=g}else{if(d==="to"){b._to=g}else{if(d==="values"){b._values=g.split(";")}else{if(d==="by"){b._by=g}else{if(d==="keyTimes"){var f=g.split(";");b._keyTimes=[];for(var e=0;e0)&&(/[a-z]/i).test(u.charAt(z+1))){return(u.slice(0,z))}z=nn=void 0;return""},v;if(isFinite(parseFloat(u))){k[p](t)}else{if(u.indexOf("repeat(")>-1){var i=parseFloat(u.slice(7)),r=(function(A,z,B){return function(C){if(i===C.target._numRepeat){A[z](B)}}})(k,p,t),v=s();if(v){k.ownerDocument.getElementById(v).addEventListener("repeatEvent",r)}else{k.addEventListener("repeatEvent",r)}}else{if(/\.(begin|end)/.test(u)){v=s();if(v){var r=(function(A,z,B){return function(C){A[z](B)}})(k,p,t),q="";/\.(begin|end)/.test(u);if(RegExp.$1==="begin"){q="beginEvent"}else{if(RegExp.$1==="end"){q="endEvent"}}k.ownerDocument.getElementById(v).addEventListener(q,r,false)}}else{if(u.indexOf("wallclock(")===0){}else{if(u==="indefinite"){}else{if(u.indexOf("accesskey(")>-1){}else{v=s();var r=(function(A,z,B){return function(C){A[z](B)}})(k,p,t);if(v&&u.match(/\.([a-z]+)/i)){k.ownerDocument.getElementById(v).addEventListener(RegExp.$1,r)}else{if(u){k.targetElement.addEventListener(u.match(/^[a-z]+/i)[0],r)}}}}}}}}u=s=v=void 0};if(d._begin){for(var g=0,l=d._begin.length;g0)))){return}if(this.getCurrentTime()>0){this.endElement()}b.initTimeEvent("beginEvent",c.defaultView,0);this.dispatchEvent(b);this._start&&this._start.shift();this._isStarted=true;c=b=void 0};SVGAnimationElement.prototype.endElement=function(){var c=this.ownerDocument,b=c.createEvent("TimeEvents");b.initTimeEvent("endEvent",c.defaultView,0);this.dispatchEvent(b);this._finish&&this._finish.shift();this._currentFrame=0};SVGAnimationElement.prototype.beginElementAt=function(e){var b=this.ownerDocument.documentElement.getCurrentTime(),f=this._start||[];for(var d=0,c=f.length;d-1){c=d.slice(e[0]);b=parseFloat(c)}else{if(e[1]>-1){c=d.slice(e[1]);b=parseFloat(c)}else{c=d;b=parseFloat(d)}}if(isFinite(b)){if(/\d+\:(\d\d)\:([\d\.]+)$/.test(c)){b=(b*3600+parseInt(RegExp.$1,10)*60+parseFloat(RegExp.$2))*1000}else{if(/\d\d\:([\d\.]+)$/.test(c)){b=(b*60+parseFloat(RegExp.$1))*1000}else{if(/(h|min|s)$/.test(c)){b*=this._unit[RegExp.$1]}}}if(isFinite(b)){b*=0.8;return b}}return 0};SVGAnimationElement.prototype.getStartTime=function(){if(this._starting||(this._starting===0)){return(this._starting)}else{throw new DOMException(11)}};SVGAnimationElement.prototype.getCurrentTime=function(){return(this._currentFrame*125*0.8)};SVGAnimationElement.prototype.getSimpleDuration=function(){if(!this._dur&&!this._finish&&(this._dur==="indefinite")){throw new DOMException(9)}else{return(this._getOffset(this._dur))}};NAIBU.Time={currentFrame:0,Max:17000,start:function(){if(NAIBU.Clip.length>0){screen.updateInterval=42;window.onscroll=function(){screen.updateInterval=0;screen.updateInterval=42};NAIBU.stop=setInterval((function(){try{var d=NAIBU.Time.currentFrame,f=NAIBU.Clip,t=d*100;if(d>NAIBU.Time.Max){clearInterval(NAIBU.stop)}f[0]&&f[0].ownerDocument.documentElement.setCurrentTime(t);for(var g=0,l=f.length;g=r.getSimpleDuration()*r._numRepeat)){var j=r.ownerDocument,p=j.createEvent("TimeEvents");++r._numRepeat;p.initTimeEvent("repeatEvent",j.defaultView,r._numRepeat);r.dispatchEvent(p);j=p=void 0}if(r._finish&&(r.getCurrentTime()!==0)){var c=r._finish[0];if((c||(c===0))&&(q<=c)&&(c<=t)){r.endElement()}c=void 0}if(r._frame){++r._currentFrame;r._frame()}}++NAIBU.Time.currentFrame;d=f=t=r=q=o=void 0}catch(k){}}),1)}else{window.onscroll=function(){screen.updateInterval=0;window.onscroll=NAIBU.emptyFunction}}}};NAIBU.Clip=[];function SVGAnimateElement(){SVGAnimationElement.apply(this);NAIBU.Clip[NAIBU.Clip.length]=this;this._valueList=[];this._isDiscrete=false;this.addEventListener("DOMAttrModified",function(b){if(b.eventPhase===3){return}if((b.attrName==="calcMode")&&(b.newValue==="discrete")){b.target._isDiscrete=true}},false);this.addEventListener("DOMNodeInserted",function(c){if(c.eventPhase===3){return}var b=c.target;b.addEventListener("DOMNodeInsertedIntoDocument",function(s){var l=s.target,q=l.getAttributeNS(null,"attributeName"),t=l.targetElement,o=t[q];var j=t.cloneNode(false);if(!l._values[0]){var f=t.ownerDocument.defaultView.getComputedStyle(t,"");l._values[0]=t.getAttributeNS(null,q)||f.getPropertyValue(q);if(!l._values[1]&&l._values[2]){var r=parseFloat(l._values[0])+parseFloat(l._values[2]),p=l._values[0].match(/\D+/)||[""];l._values[1]=r+p[0];l._values.pop();r=p=void 0}}if(("animatedPoints" in t)&&(q==="points")){t.animatedPoints=j.points;for(var k=0,g=l._values,e=g.length;k-1){for(var k=0,g=l._values,e=g.length;k-1){var j=null;var t=p._valueList[A].value,s=p._valueList[A+1].value;if(!p._isDiscrete){var u=t+(s-t)*(k-i*q)/r}else{var u=t}}else{if(("normalizedPathSegList" in f)&&(e==="d")){var j=f.normalizedPathSegList;f.normalizedPathSegList=f.animatedNormalizedPathSegList;f.dispatchEvent(z);f.animatedNormalizedPathSegList=f.normalizedPathSegList;f.normalizedPathSegList=j}}}}z=p=t=s=u=q=l=A=k=void 0};d=vir=void 0},false);this.addEventListener("endEvent",function(c){var b=c.target,d=b.getAttributeNS(null,"fill");if(!d||(d==="remove")){var c=b.ownerDocument._domnodeEvent();b.targetElement.dispatchEvent(c);c=void 0;b._frame&&b._frame()}delete b._frame},false);this.addEventListener("repeatEvent",function(c){var b=c.target},false)}SVGAnimateElement.prototype=Object._create(SVGAnimationElement);function SVGSetElement(){SVGAnimationElement.apply(this);NAIBU.Clip[NAIBU.Clip.length]=this;this._to="";this.addEventListener("DOMAttrModified",function(c){var b=c.target,d=c.attrName;if(d==="to"){b._to=c.newValue}b=d=void 0},false);this.addEventListener("beginEvent",function(d){var c=d.target;c._currentFrame=1;if(c.targetElement){var e=c.getAttributeNS(null,"attributeName"),i=c.targetElement.attributes.getNamedItemNS(null,e),b=c.targetElement[e];if(!!CSS2Properties[e]||e.indexOf("-")>-1){c._prestyle=c.ownerDocument.defaultView.getComputedStyle(c.targetElement,"").getPropertyValue(e);var f=c.ownerDocument.getOverrideStyle(c.targetElement,"");f.setProperty(e,c.getAttributeNS(null,"to"),null);f=void 0}else{if(!!b){var g=b.baseVal;if(g instanceof SVGLength){b.baseVal=c.ownerDocument.documentElement.createSVGLength()}else{if(g instanceof SVGRect){b.baseVal=c.ownerDocument.documentElement.createSVGRect()}}var d=c.ownerDocument.createEvent("MutationEvents");d.initMutationEvent("DOMAttrModified",true,false,i,i,c._to,e,1);c.targetElement.dispatchEvent(d);d=void 0;b.animVal=b.baseVal;b.baseVal=g}}}d=c=e=void 0},false);this.addEventListener("endEvent",function(d){var c=d.target,g=c.getAttributeNS(null,"fill");if(!g||(g==="remove")){var e=c.getAttributeNS(null,"attributeName"),f=c.ownerDocument.getOverrideStyle(c.targetElement,"");if(c._prestyle){f.setProperty(e,c._prestyle,null)}else{var b=c.ownerDocument._domnodeEvent();c.targetElement.dispatchEvent(b)}e=f=b=void 0}c=g=void 0},false);this.addEventListener("repeatEvent",function(c){var b=c.target,d=b.getAttributeNS(null,"attributeName"),e=b.ownerDocument.defaultView.getComputedStyle(b.targetElement,"")},false)}SVGSetElement.prototype=new SVGAnimationElement(1);function SVGAnimateMotionElement(){SVGAnimationElement.apply(this);NAIBU.Clip[NAIBU.Clip.length]=this;this.addEventListener("DOMAttrModified",function(c){if(c.eventPhase===3){return}var b=c.target,e=c.attrName;if(e==="path"){var f=b.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");f.setAttributeNS(null,"d",c.newValue);b._path=f;f=void 0}},false);this.addEventListener("DOMNodeInserted",function(c){if(c.eventPhase===3){return}var b=c.target;b.addEventListener("DOMNodeInsertedIntoDocument",function(e){var d=[],j;if(b._values){for(var f=0,k=b._values,g=k.length;f-1){NAIBU._noie_createFont(l,s,true)}}t=d=q=curt=textElments=f=s=void 0};if(!i.__isLinked||d._isExternal){d.ownerDocument.documentElement._svgload_limited=0;d.ownerDocument.documentElement.addEventListener("SVGLoad",g,false)}},false)},false)}SVGFontElement.prototype=Object._create(SVGElement);function SVGGlyphElement(){SVGElement.apply(this)}SVGGlyphElement.prototype=Object._create(SVGElement);function SVGMissingGlyphElement(){SVGElement.apply(this)}SVGMissingGlyphElement.prototype=Object._create(SVGElement);function SVGHKernElement(){SVGElement.apply(this)}SVGHKernElement.prototype=Object._create(SVGElement);function SVGVKernElement(){SVGElement.apply(this)}SVGVKernElement.prototype=Object._create(SVGElement);function SVGFontFaceElement(){SVGElement.apply(this);this._isLinked=0;this.addEventListener("DOMNodeInserted",function(b){if(b.eventPhase===3){if(b.target.localName==="font-face-uri"){b.currentTarget._isLinked=1}return}},false)}SVGFontFaceElement.prototype=Object._create(SVGElement);function SVGFontFaceSrcElement(){SVGElement.apply(this)}SVGFontFaceSrcElement.prototype=Object._create(SVGElement);function SVGFontFaceUriElement(){SVGElement.apply(this);this.addEventListener("DOMNodeInserted",function(b){if(b.eventPhase===3){return}b.target.ownerDocument.documentElement._svgload_limited--;b.target.setAttributeNS("http://www.w3.org/1999/xlink","xlink:show","embed")},false);this.addEventListener("S_Load",function(c){var b=c.target,d=b.parentNode.parentNode.parentNode;if(d.localName==="defs"){d=b.parentNode.parentNode}b._instance._isExternal=1;d.parentNode.appendChild(b._instance);c=b=d=void 0},false);SVGURIReference.apply(this)}SVGFontFaceUriElement.prototype=Object._create(SVGElement);function SVGFontFaceFormatElement(){SVGElement.apply(this)}SVGFontFaceFormatElement.prototype=Object._create(SVGElement);function SVGFontFaceNameElement(){SVGElement.apply(this)}SVGFontFaceNameElement.prototype=Object._create(SVGElement);function SVGDefinitionSrcElement(){SVGElement.apply(this)}SVGDefinitionSrcElement.prototype=Object._create(SVGElement);function SVGMetadataElement(){SVGElement.apply(this)}SVGMetadataElement.prototype=Object._create(SVGElement);function SVGForeignObjectElement(){SVGElement.apply(this);var b=SVGAnimatedLength;this.x=new b();this.y=new b();this.width=new b();this.height=new b();b=void 0}SVGForeignObjectElement.prototype=Object._create(SVGElement);DOMImplementation["http://www.w3.org/2000/svg"]={Document:SVGDocument,svg:SVGSVGElement,g:SVGGElement,path:NAIBU.SVGPathElement,title:SVGTitleElement,desc:SVGDescElement,defs:SVGDefsElement,linearGradient:SVGLinearGradientElement,radialGradient:SVGRadialGradientElement,stop:SVGStopElement,rect:SVGRectElement,circle:SVGCircleElement,ellipse:SVGEllipseElement,polyline:SVGPolylineElement,polygon:SVGPolygonElement,text:SVGTextElement,tspan:SVGTSpanElement,image:SVGImageElement,line:SVGLineElement,a:SVGAElement,altGlyphDef:SVGAltGlyphDefElement,altGlyph:SVGAltGlyphElement,altGlyphItem:SVGAltGlyphItemElement,animateColor:SVGAnimateColorElement,animate:SVGAnimateElement,animateMotion:SVGAnimateMotionElement,animateTransform:SVGAnimateTransformElement,clipPath:SVGClipPathElement,colorProfile:SVGColorProfileElement,cursor:SVGCursorElement,definitionSrc:SVGDefinitionSrcElement,feBlend:SVGFEBlendElement,feGaussianBlur:SVGFEGaussianBlurElement,filter:SVGFilterElement,font:SVGFontElement,"font-face":SVGFontFaceElement,"font-face-format":SVGFontFaceFormatElement,"font-face-name":SVGFontFaceNameElement,"font-face-src":SVGFontFaceSrcElement,"font-face-uri":SVGFontFaceUriElement,foreignObject:SVGForeignObjectElement,glyph:SVGGlyphElement,glyphRef:SVGGlyphRefElement,hkern:SVGHKernElement,marker:SVGMarkerElement,mask:SVGMaskElement,metadata:SVGMetadataElement,missingGlyph:SVGMissingGlyphElement,mpath:SVGMPathElement,script:SVGScriptElement,set:SVGSetElement,style:SVGStyleElement,"switch":SVGSwitchElement,symbol:SVGSymbolElement,textPath:SVGTextPathElement,tref:SVGTRefElement,use:SVGUseElement,view:SVGViewElement,vkern:SVGVKernElement,pattern:SVGPatternElement};NAIBU._fontSearchURI=function(b){var g=b.target.ownerDocument;var c=g.getElementsByTagNameNS("http://www.w3.org/2000/svg","font-face-uri");for(var e=0;e-1){NAIBU._noie_createFont(c,e,false)}}}o=j=void 0};NAIBU._noie_createFont=function(b,P,l){var I=b.ownerDocument.defaultView.getComputedStyle(b,""),Q="http://www.w3.org/2000/svg",J=b.getAttributeNS(null,"writing-mode")||b.parentNode.getAttributeNS(null,"writing-mode"),p=J?"vert-adv-y":"horiz-adv-x",z=b.firstChild,R,k=P.getElementsByTagNameNS(Q,"glyph"),N=parseFloat(P.getElementsByTagNameNS(Q,"font-face").item(0).getAttributeNS(null,"units-per-em")||1000),H=parseFloat((P.getAttributeNS(null,p)||N)),e=parseFloat(b.getAttributeNS(null,"x")||0),d=parseFloat(b.getAttributeNS(null,"y")||0),q=parseFloat(I.getPropertyValue("font-size")),B=q/N,g=false,f=["fill","fill-opacity","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-opacity","opacity","cursor"];if(k.length>60){return}if(/a/[-1]==="a"){g=true}else{if(l||J){g=true}}if(g){while(z){if(!k){break}R=z.data;if(R!==void 0){var T=[],F=[];for(var L=0,C=k.length;L-1){T[A]=parseFloat(u.getAttributeNS(null,p)||H);F[A]=u.getAttributeNS(null,"d");A=R.indexOf(s,A+1)}}}for(var L=0,M=0;L-1){var r=q/Math.SQRT2;E+=r;D-=r;r=void 0}v.e=E;v.f=D}else{v.e=e+M*B;v.f=d}G.setAttributeNS(null,"transform","matrix("+v.a+","+v.b+","+v.c+","+v.d+","+v.e+","+v.f+")");G.setAttributeNS(null,"d",F[L]);b.parentNode.insertBefore(G,b);M+=T[L];v=void 0}}M=T=F=void 0}else{if("tspan|a".indexOf(z.localName)>-1){NAIBU._noie_createFont(z,P,l)}}z=z.nextSibling}if(l){var I=b.ownerDocument.getOverrideStyle(b,null);I.setProperty("visibility","hidden");I=void 0}else{b.setAttributeNS(null,"opacity","0")}}R=J=p=N=H=e=d=q=I=Q=z=void 0};(function(){var e=new CSSStyleDeclaration(),k=e._list,j=0,f=/([A-Z])/,g=/\-/,b,d;for(var c in CSS2Properties){if(CSS2Properties.hasOwnProperty(c)){d=c.replace(f,"-");if(!!RegExp.$1){b="-"+RegExp.$1.toLowerCase()}else{b="-"}d=d.replace(g,b);e.setProperty(d,CSS2Properties[c]);k[d]=k[j];k[j]._isDefault=1;++j;c=d=b=void 0}}k._opacity=1;k._fontSize=12;CSS2Properties._list=k;Document.prototype.defaultView._defaultCSS=k;e=j=f=g=k=null})();NAIBU.addEvent=function(b,c){if(window.addEventListener){window.addEventListener(b,c,false)}else{if(window.attachEvent){window.attachEvent("on"+b,c)}else{window["on"+b]=c}}if(sieb_s){c()}};function unsvgtovml(){try{if("stop" in NAIBU){clearInterval(NAIBU.stop)}window.onscroll=NAIBU.emptyFunction;window.detachEvent("onload",NAIBU._main);NAIBU.freeArg();delete Object._create;Document._destroy();Element=SVGElement=Attr=NamedNodeMap=CSS2Properties=CSSValue=CSSPrimitiveValue=NAIBU.xmlhttp=Node=Event=NAIBU=STLog=SVGColor=SVGPaint=void 0;Array=ActiveXObject=void 0}catch(b){}}NAIBU._main=function(){var H,c=document;try{if(XMLHttpRequest){H=false}else{H=new ActiveXObject("Msxml2.XMLHTTP")}}catch(C){try{H=new ActiveXObject("Microsoft.XMLHTTP")}catch(l){H=false}}if(!H){try{H=new XMLHttpRequest()}catch(C){H=false}}NAIBU.xmlhttp=H;var f,p=c.namespaces;if(p&&!p.v){try{NAIBU.doc=new ActiveXObject("MSXML2.DomDocument")}catch(C){}f=NAIBU.doc;p.add("v","urn:schemas-microsoft-com:vml");p.add("o","urn:schemas-microsoft-com:office:office");var q=c.createStyleSheet(),g="behavior: url(#default#VML);display: inline-block;} ";q.cssText="v\\:rect{"+g+"v\\:image{"+g+"v\\:fill{"+g+"v\\:stroke{"+g+"o\\:opacity2{"+g+"dn\\:defs{display:none}v\\:group{text-indent:0px;position:relative;width:100%;height:100%;"+g+"v\\:shape{width:100%;height:100%;"+g}var D=c.getElementsByTagName("script");for(var v=0;D[v];++v){var z=D[v],A=z.type;if(z.type==="image/svg+xml"){var F=z.text;if(sieb_s&&F.match(/<svg/)){F=F.replace(/<.+?>/g,"");F=F.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}if(NAIBU.isMSIE){var I=new GetSVGDocument(z);I.xmlhttp={readyState:4,status:200,responseText:F.replace(/\shref=/g," target='_top' xlink:href=")};I._ca()}else{var d=location.href.replace(/\/[^\/]+?$/,"/");F=F.replace(/\shref=(['"a-z]+?):\/\//g," target='_top' xlink:href=$1://").replace(/\shref=(.)/g," target='_top' xlink:href=$1"+d);var o=NAIBU.textToSVG(F,z.getAttribute("width"),z.getAttribute("height"));z.parentNode.insertBefore(o,z)}z=F=void 0}A=void 0}NAIBU.doc=f;f=p=D=void 0;if(H&&NAIBU.isMSIE){if(!!c.createElementNS&&!!c.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect){}else{var r=c.getElementsByTagName("object"),o=[],k=[],B=function(t){var K,E,J,e="width",s="height";o||(o=[]);c||(c=document);for(var j=0;t[j];++j){E=t[j];o[o.length]=new GetSVGDocument(E);K=c.createElement("iframe");K.style.cssText=E.style.cssText;K.style.background="black";J=E.getAttribute(e);J&&K.setAttribute(e,J);J=E.getAttribute(s);J&&K.setAttribute(s,J);K.marginWidth=K.marginHeight="0px";K.scrolling="no";K.frameBorder="0";E.parentNode.insertBefore(K,E)}j=E=K=t=e=s=void 0;return o[o.length-1]};B(r);var G=c.getElementsByTagName("img"),b=c.getElementsByTagName("embed");for(var v=0,u=0;G[v];++v){if(G[v].getAttribute("src").indexOf(".svg")>-1){k[u]=G[v];++u}}B(k);B(b);NAIBU._search=B;r=b=k=G=B=void 0;for(var v=0;v0){o[0]._init()}o=void 0}}else{var r=c.getElementsByTagName("object");for(var v=0;v-1||navigator.userAgent.indexOf("Safari")>-1){var e="data:image/svg+xml;charset=utf-8,"+NAIBU.unescapeUTF16(escape(f));var c=document.createElement("object");c.setAttribute("data",e);c.setAttribute("width",b);c.setAttribute("height",d);c.setAttribute("type","image/svg+xml");return c}else{var g=(new DOMParser()).parseFromString(f,"text/xml");return(document.importNode(g.documentElement,true))}};NAIBU.addEvent("unload",unsvgtovml); NAIBU.isMSIE=/*@cc_on!@*/false; \ No newline at end of file