<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <link rel="stylesheet" href="${ctx}/js/plugin/layerui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctx}/css/plugin/bootstrap/bootstrap.css">
    <link rel="stylesheet" href="${ctx}/css/plugin/fontAwesome/font-awesome.min.css">
    <link rel="stylesheet" href="${ctx}/css/basic.css">
    <title>暂降域显示</title>
    <style>
        .col-md-12{
            padding-right: 0 !important;
            padding-left: 0 !important;
        }
        .layui-layer-title{
            height: 0 !important;
        }
        .layui-layer-setwin{
            top: 10px !important;
        }
        .container-fluid{
            padding-right: 0 !important;
            padding-left: 0 !important;
        }

        .buttons{
            position: absolute;
            right: 10px;
            top:10px;
            z-index: 999;
        }

        body{
            overflow: hidden;
        }

        .dataTables_wrapper.no-footer .dataTables_scrollBody::-webkit-scrollbar-thumb{
            border-radius: 5px;
            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
            background: darkgrey;	/*为突出效果，设置红色*/
        }


        .dataTables_wrapper.no-footer .dataTables_scrollBody::-webkit-scrollbar-track{
            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
            border-radius: 0;
            background: navajowhite;/*为突出效果，设置蓝色*/
        }

        .dataTables_wrapper.no-footer .dataTables_scrollBody::-webkit-scrollbar{
            height:4px;	/*横向滚动条时*/
            width:4px;/*纵向滚动条时*/
        }

        *::-webkit-scrollbar {width:7px; height:10px; background-color:transparent;} /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
        *::-webkit-scrollbar-track {background-color:#4C608E;  } /*定义滚动条轨道 内阴影+圆角*/
        *::-webkit-scrollbar-thumb {background-color:#AABBE0; border-radius:6px;} /*定义滑块 内阴影+圆角*/
        .scrollbarHide::-webkit-scrollbar{display: none}
        .scrollbarShow::-webkit-scrollbar{display: block}
    </style>
</head>
<body >
<div class="container-fluid">
    <div class="buttons">
        <%--编辑按钮--%>
        <button type="button" class="btn themeBGColor" id="edit">编辑</button>
        <button type="button" class="btn themeBGColor" id="review">重置</button>
        <button type="button" class="btn themeBGColor" id="default">默认</button>
    </div>
    <div id="suspended" style="height: 700px;width: 40%;float:left">

        <div class="col-sm-12 col-md-12 pdl30 pdr30 " id="table" >
            <table id="sensitivePoint" class="table table-striped table-bordered dataTable no-footer" style="margin-bottom: 0">
                <thead>
                <tr>
                    <th>暂降敏感点名称</th>
                    <th>暂降幅值</th>
                    <th>暂降域故障类型</th>
                    <th>发生时刻</th>
                    <th>操作</th>
                </tr>
                </thead>
            </table>
        </div>

    </div>
    <div class="col-md-12" id="svgDiv" style="display: flex;justify-content: center;align-items: center;width: 60%;float: left">
    </div>
</div>
<script src="${ctx}/js/plugin/jquery.min.js"></script>
<script src="${ctx}/js/plugin/bootstrap/jquery.dataTables.min.js"></script>
<script src="${ctx}/js/plugin/bootstrap/dataTables.bootstrap.min.js"></script>
<script src="${ctx}/js/plugin/bootstrap/dataTables.buttons.min.js"></script>
<script src="${ctx}/js/plugin/bootstrap/bootstrap.min.js"></script>
<script src="${ctx}/js/plugin/layerui/layer.js"></script>
<script src="${ctx}/js/plugin/xss/xss.js"></script>
<script src="${ctx}/js/color.js"></script>
<script src="${ctx}/jspJS/utils/loading.js"></script>
<script src="${ctx}/jspJS/utils/judgeAjaxStatus.js"></script>
<script>
    let svgIndex = 'sagDomain';
    let id;
    let picHeight = $(window).height();
    //点击编辑按钮，调整svg编辑界面，绘制svg图
    $("#edit").on('click',function (){
        layer.open({
            type: 2,
            title: '编辑暂降域',
            maxmin: false,
            area: ['100%', '100%'],
            content: 'sagdomainedit?svgIndex='+svgIndex,
            scrollbar: false,
            end:function (){
                loadSvg(svgIndex);
                getSensitivePointData();
            }
        });
    });

    //点击编辑按钮，调整svg编辑界面，绘制svg图
    $("#review").on('click',function (){
        loadSvg(svgIndex);
    });

    //展示默认的svg图
    $("#default").on('click',function (){
        loadSvg('sagDomain');
        svgIndex = 'sagDomain';
    });

    $(function () {
        getSensitivePointData();
        loadSvg(svgIndex);
    })

    //加载svg数据
    function loadSvg(svgIndex) {
        let $svgDiv = $("#svgDiv");
        $.ajax({
            url: '/pqs9200/svg/loadSvg',
            type: 'post',
            data: {
                index: svgIndex,
                type: '.svg'
            },
            dataType: 'json',
            success: function (data) {
                if (data.code === 200) {
                    //这里获取svgDom
                    $svgDiv.html(decodeURIComponent(data.body));
                    let height = $(window).height() - 10;
                    let iHeight = height;
                    let iWidth = $svgDiv.width();
                    $svgDiv.css("height", height);
                    $svgDiv.css("font-size", "12px");
                    $svgDiv.css("text-align", "left");
                    $svgDiv.css("line-height", 0);
                    $("svg").attr("height", iHeight);
                    $("svg").attr("width", iWidth);
                    let scriptZoomIn = document.createElement('script');
                    scriptZoomIn.setAttribute('name', 'tuyescript');
                    scriptZoomIn.setAttribute('type', 'text/ecmascript');
                    scriptZoomIn.innerText = 'function AD(CJ,BG){this.CJ=CJ;this.BQ="";this.CA="";this.BS=[];this.BG=BG;this.lasttime=0;this.timeinterval=1000;this.CS=CJ.parentNode;this.BQ=CJ.getAttribute("tuyea70");this.tuyea71=CJ.getAttribute("tuyea71");this.CE=CJ.getAttribute("tuyea72");this.BR=CJ.getAttribute("tuyea73");this.BM=CJ.getAttribute("tuyea74");this.BL=CJ.getAttribute("tuyea75");this.BD=CJ.getAttribute("tuyea76");this.tuyea11=CJ.getAttribute("tuyea77");this.arrfillper=[];this.arrfillclr=[];var arrfillval=this.tuyea11.split(";");for(var i=0; i < arrfillval.length;++i){var maparr=arrfillval[i].split(":");if(maparr.length==2){this.arrfillper.push(parseFloat(maparr[0]));this.arrfillclr.push(maparr[1]);}}if(this.arrfillper.length==0){this.arrfillper.push(parseFloat("1"));this.arrfillclr.push("#0000FF");}this.CU=new Bbox();this.CU.CL(this.CS);this.BT=new Array();if(this.BD=="tuyea56"|| this.BD=="tuyea58"){this.BT.push(this.CU.CX());this.BT.push(this.CU.CW());}else{this.BT.push(this.CU.CX()+this.CU.CI());this.BT.push(this.CU.CW()+this.CU.BV());}this.clonenode=this.CJ.cloneNode(true);this.clonenode.setAttribute("name","fillpercentclonenode");this.CJ.parentNode.appendChild(this.clonenode);var defsnode=document.createElementNS("http://www.w3.org/2000/svg", "defs");document.documentElement.appendChild(defsnode);this.clipPathNode=document.createElementNS("http://www.w3.org/2000/svg", "clipPath");defsnode.appendChild(this.clipPathNode);this.clipPathNode.setAttribute("clipPathUnits", "userSpaceOnUse");this.cliprect=document.createElementNS("http://www.w3.org/2000/svg", "rect");this.clipPathNode.appendChild(this.cliprect);this.cliprect.setAttribute("x", this.CU.CX());this.cliprect.setAttribute("y", this.CU.CW());this.cliprect.setAttribute("width", this.CU.CI());this.cliprect.setAttribute("height", this.CU.BV());var index=0;var clipid="animateclip";while(true){var element=document.getElementById(clipid);if(element==undefined ||element==null){break;}clipid="animateclip" + index;index +=1;}this.clipPathNode.setAttribute("id", clipid);this.clonenode.setAttribute("clip-path", "url(#" + clipid + ")");var  mat=new CQ();var strmatrix=mat.CD(this.CS);var strrematrix=mat.CO(strmatrix);this.clipPathNode.setAttribute("transform", strrematrix);};AD.prototype.SetColor=function(scalevalue){for(var i=0; i < this.arrfillper.length; ++i){if(parseFloat(scalevalue) < this.arrfillper[i]){this.clonenode.setAttribute("fill",this.arrfillclr[i]);break;}}};AD.prototype.CV=function(curtime){if((curtime - this.lasttime) < this.timeinterval){return;}this.lasttime=curtime;var val=window.eval(this.CA);var scalevalue=val*(this.BM-this.BL)/(this.CE-this.BR)+parseFloat(this.BL);var mat=new CQ();var strtoorimatrix="translate(-"+this.BT[0] +",-"+this.BT[1]+")";var strfromorimatrix="translate("+this.BT[0] +","+this.BT[1]+")";var strscale="";if(scalevalue <=0.01){scalevalue=0.01;}if(this.tuyea71=="hor"){strscale="scale(" + scalevalue + ",1)";}else if(this.tuyea71=="ver"){strscale="scale(1," + scalevalue + ")";}this.SetColor(scalevalue);var strnewmatrix=strfromorimatrix + strscale + strtoorimatrix;var newmatarr=mat.BB(strnewmatrix);strnewmatrix=mat.BN(newmatarr);this.cliprect.setAttribute("transform",strnewmatrix);};function AR(CJ,BG){this.CJ=CJ;this.BQ="";this.CA="";this.BS=[];this.BG=BG;this.CS=CJ.parentNode;this.lasttime=0;this.timeinterval=1000;this.BQ=CJ.getAttribute("tuyea50");this.dvalue=CJ.getAttribute("tuyea51");this.rvalue=CJ.getAttribute("tuyea52");this.dangle=CJ.getAttribute("tuyea53");this.rangle=CJ.getAttribute("tuyea54");this.BD=CJ.getAttribute("tuyea55");this.CU=new Bbox();this.CU.CL(this.CS);var  width=this.CU.CI();var  height=this.CU.BV();this.BT=new Array();if(this.BD=="tuyea60"){this.BT.push(this.CU.CX());this.BT.push(this.CU.CW());}else if(this.BD=="tuyea63"){this.BT.push(this.CU.CX());this.BT.push(this.CU.CW()+this.CU.BV()/2);}else if(this.BD=="tuyea66"){this.BT.push(this.CU.CX());this.BT.push(this.CU.CW()+this.CU.BV());}else if(this.BD=="tuyea61"){this.BT.push(this.CU.CX()+this.CU.CI()/2);this.BT.push(this.CU.CW());}else if(this.BD=="tuyea62"){this.BT.push(this.CU.CX()+this.CU.CI());this.BT.push(this.CU.CW());}else if(this.BD=="tuyea65"){this.BT.push(this.CU.CX()+this.CU.CI());this.BT.push(this.CU.CW()+this.CU.BV()/2);}else if(this.BD=="tuyea68"){this.BT.push(this.CU.CX()+this.CU.CI());this.BT.push(this.CU.CW()+this.CU.BV());}else if(this.BD=="tuyea64"){this.BT.push(this.CU.CX()+this.CU.CI()/2);this.BT.push(this.CU.CW()+this.CU.BV()/2);}else if(this.BD=="tuyea67"){this.BT.push(this.CU.CX()+this.CU.CI()/2);this.BT.push(this.CU.CW()+this.CU.BV());}else{this.BT.push(this.CU.CX()+this.CU.CI()/2);this.BT.push(this.CU.CW()+this.CU.BV());}this.mat=new CQ();var oldallmatrix=this.mat.CD(this.CS);this.oldallreversematrix=this.mat.CO(oldallmatrix);this.oldtransform=this.CS.getAttribute("transform");if(this.oldtransform==null || this.oldtransform==undefined){this.oldtransform="";}this.lastrotate="";};AR.prototype.CV=function(curtime){if((curtime - this.lasttime) < this.timeinterval){return;}this.lasttime=curtime;var val=window.eval(this.CA);var anglerange=parseInt(this.rangle)+parseInt(this.dangle);var valrange=parseFloat(this.dvalue)-parseFloat(this.rvalue);if(valrange==0)return;var rotatevalue=(val-this.rvalue)*(anglerange*1.0/valrange)-parseInt(this.rangle);var newallmat=this.mat.CD(this.CS);var allchangemat=this.mat.BB(newallmat+this.oldallreversematrix);var newrefpoint=this.mat.BY(allchangemat,this.BT);var strtoorimatrix="translate(-"+newrefpoint[0] +",-"+newrefpoint[1]+")";var strfromorimatrix="translate("+newrefpoint[0] +","+newrefpoint[1]+")";var strrotate="rotate(" + rotatevalue + ")";var lstmat="";if(this.lastrotate !=""){lstmat=this.mat.CO(this.lastrotate);}this.parentmat=this.mat.CD(this.CS.parentNode);this.parentremat=this.mat.CO(this.parentmat);var strnewmatrix=this.parentremat+ strfromorimatrix+strrotate + lstmat + strtoorimatrix + newallmat;var newmatarr=this.mat.BB(strnewmatrix);strnewmatrix=this.mat.BN(newmatarr);this.CS.setAttribute("transform",strnewmatrix);this.lastrotate=strrotate;};function AG(CJ,BG){this.CJ=CJ;this.BQ="";this.CA="";this.BS=[];this.BG=BG;this.CS=CJ.parentNode;this.lasttime=0;this.timeinterval=1000;if(this.BG=="tuyea37"){this.BQ=CJ.getAttribute("tuyea38");this.CE=CJ.getAttribute("tuyea39");this.BR=CJ.getAttribute("tuyea40");this.maxposition=CJ.getAttribute("tuyea41");this.minposition=CJ.getAttribute("tuyea42");}else{this.BQ=CJ.getAttribute("tuyea44");this.CE=CJ.getAttribute("tuyea45");this.BR=CJ.getAttribute("tuyea46");this.maxposition=CJ.getAttribute("tuyea47");this.minposition=CJ.getAttribute("tuyea48");}this.lasttranslate="";this.CU=new Bbox();this.CU.CL(this.CS);var  width=this.CU.CI();var  height=this.CU.BV();};AG.prototype.CV=function(curtime){if((curtime - this.lasttime) < this.timeinterval){return;}this.lasttime=curtime;var val=window.eval(this.CA);if(val > parseInt(this.CE))val=parseInt(this.CE);if(val < parseInt(this.BR))val=parseInt(this.BR);val=val - parseInt(this.BR);var maxposition=parseInt(this.maxposition);var minposition=parseInt(this.minposition);var symbol="-";if(maxposition < minposition){var tempposition=maxposition;maxposition=minposition;minposition=tempposition;symbol="";}var translatevalue=val*(maxposition-minposition)/(this.CE-this.BR) + minposition;var mat=new CQ();var nodemat=this.CS.getAttribute("transform");var strtranslate="";if(this.BG=="tuyea37"){strtranslate="translate(" + symbol + translatevalue + ",0)";}else{strtranslate="translate(0," + symbol + translatevalue + ")";}var lstmat="";if(this.lasttranslate !=""){lstmat=mat.CO(this.lasttranslate);}if(nodemat==undefined){nodemat="";}var newallmat=mat.CD(this.CS);var parentmat=mat.CD(this.CS.parentNode);var parentremat=mat.CO(this.parentmat);var strnewmatrix=parentremat+ strtranslate + lstmat + newallmat;var newmatarr=mat.BB(strnewmatrix);strnewmatrix=mat.BN(newmatarr);this.CS.setAttribute("transform",strnewmatrix);this.lasttranslate=strtranslate;};function BE(CJ,BG){this.CJ=CJ;this.BQ="";this.CA="";this.BS=[];this.BG=BG;this.CS=CJ.parentNode;this.lasttime=0;this.timeinterval=1000;this.CE=CJ.getAttribute("tuyea32");this.BR=CJ.getAttribute("tuyea33");this.BM=CJ.getAttribute("tuyea34");this.BL=CJ.getAttribute("tuyea35");this.BD=CJ.getAttribute("tuyea36");this.BQ=CJ.getAttribute("tuyea30");this.tuyea31=CJ.getAttribute("tuyea31");this.CU=new Bbox();this.CU.CL(this.CS);var  width=this.CU.CI();var  height=this.CU.BV();this.BT=new Array();if(this.BD=="tuyea56"|| this.BD=="tuyea58"){this.BT.push(this.CU.CX());this.BT.push(this.CU.CW());}else if(this.BD=="tuyea57" || this.BD=="tuyea59"){this.BT.push(this.CU.CX()+this.CU.CI());this.BT.push(this.CU.CW()+this.CU.BV());}else{this.BT.push(this.CU.CX()+this.CU.CI()/2);this.BT.push(this.CU.CW()+this.CU.BV()/2);}this.mat=new CQ();var oldallmatrix=this.mat.CD(this.CJ);this.oldallrematrix=this.mat.CO(oldallmatrix);this.lastscale="";};BE.prototype.CV=function(curtime){if((curtime - this.lasttime) < this.timeinterval){return;}this.lasttime=curtime;var val=window.eval(this.CA);var scalevalue=val*(this.BM-this.BL)/(this.CE-this.BR)+parseFloat(this.BL);var nodemat=this.CS.getAttribute("transform");var newallmat=this.mat.CD(this.CJ);var allchangemat=this.mat.BB(newallmat+this.oldallrematrix);var newrefpoint=this.mat.BY(allchangemat,this.BT);var strtoorimatrix="translate(-"+newrefpoint[0] +",-"+newrefpoint[1]+")";var strfromorimatrix="translate("+newrefpoint[0] +","+newrefpoint[1]+")";var strscale="";if(scalevalue <=0.01){scalevalue=0.01;}if(this.tuyea31=="hor"){strscale="scale(" + scalevalue + ",1)";}else if(this.tuyea31=="ver"){strscale="scale(1," + scalevalue + ")";}else if(this.tuyea31=="inflate"){strscale="scale(" + scalevalue +"," + scalevalue + ")";}var lstmat="";if(this.lastscale !=""){lstmat=this.mat.CO(this.lastscale);}if(nodemat==undefined || nodemat==null){nodemat="";}var strnewmatrix=strfromorimatrix + strscale + lstmat + strtoorimatrix + nodemat ;var newmatarr=this.mat.BB(strnewmatrix);strnewmatrix=this.mat.BN(newmatarr);this.CS.setAttribute("transform",strnewmatrix);this.lastscale=strscale;};function AX(CJ,BG){this.CJ=CJ;this.BQ="";this.CA="";this.BS=[];this.BG=BG;this.lasttime=0;this.timeinterval=1000;this.tuyea25=undefined;this.tuyea26=undefined;this.tuyea27=undefined;this.tuyea28=undefined;this.BQ=CJ.getAttribute("tuyea24");this.tuyea25=CJ.getAttribute("tuyea25");this.tuyea26=CJ.getAttribute("tuyea26");this.tuyea27=CJ.getAttribute("tuyea27");this.tuyea28=CJ.getAttribute("tuyea28");this.oldstroke=CJ.getAttribute("stroke");this.oldfill=CJ.getAttribute("fill");if(this.oldstroke==undefined){this.oldstroke="none";if(this.tuyea25 !=undefined && this.tuyea25=="visible"){CJ.setAttribute("stroke","none");}}if(this.oldfill==undefined){this.oldfill="none";if(this.tuyea25 !=undefined && this.tuyea25=="visible"){CJ.setAttribute("fill","none");}}if(this.tuyea26==undefined){this.tuyea26=this.oldstroke;}if(this.tuyea27==undefined){this.tuyea27=this.oldfill;}};AX.prototype.CV=function(curtime){var flashinterval=this.timeinterval;if(this.tuyea28=="slow"){flashinterval=this.timeinterval;}else if(this.tuyea28=="fast"){flashinterval=this.timeinterval/4;}else{flashinterval=this.timeinterval/2;}if((curtime - this.lasttime) < flashinterval){return;}this.lasttime=curtime;var val=true;val=window.eval(this.CA);if(val){if(this.tuyea25 !=undefined && this.tuyea25=="visible"){var currstroke=this.CJ.getAttribute("stroke");var currfill=this.CJ.getAttribute("fill");if(currstroke==this.oldstroke){this.CJ.setAttribute("stroke",this.tuyea26);}else{this.CJ.setAttribute("stroke",this.oldstroke);}if(currfill==this.oldfill){this.CJ.setAttribute("fill",this.tuyea27);}else{this.CJ.setAttribute("fill",this.oldfill);}}else{var currvisible=this.CJ.getAttribute("visibility");var reversestate="visible";if (currvisible==undefined || currvisible=="visible"){reversestate="hidden";}this.CJ.setAttribute("visibility", reversestate);}}else{this.CJ.setAttribute("visibility","visible");this.CJ.setAttribute("stroke",this.oldstroke);this.CJ.setAttribute("fill",this.oldfill);}};function AJ(CJ,BG){this.CJ=CJ;this.BQ="";this.CA="";this.BS=[];this.BG=BG;this.lasttime=0;this.timeinterval=1000;this.BQ=CJ.getAttribute("tuyea21");this.tuyea22=CJ.getAttribute("tuyea22");};AJ.prototype.CV=function(curtime){if((curtime - this.lasttime) < this.timeinterval){return;}this.lasttime=curtime;var val=true;val=window.eval(this.CA);if(val==true){this.CJ.setAttribute("visibility", this.tuyea22);}else{var reversestate="visible";if (this.tuyea22=="visible"){reversestate="hidden";}this.CJ.setAttribute("visibility", reversestate);}};function AU(CJ,BG){this.CJ=CJ;this.BQ="";this.CA="";this.BS=[];this.BG=BG;this.lasttime=0;this.timeinterval=1000;this.tuyea14=CJ.getAttribute("tuyea14");this.BQ=CJ.getAttribute("tuyea13");this.intDataValueArray=[];this.intDataStringArray=[];this.rangeDatadecimal=2;this.tuyea18="";this.tuyea19=undefined;if(this.tuyea14=="" || this.tuyea14==undefined){this.tuyea14="int";}if(this.tuyea14=="int"){var intdatavalcfg=CJ.getAttribute("tuyea15");var intdatastrcfg=CJ.getAttribute("tuyea16");if(intdatavalcfg !=undefined){this.intDataValueArray=intdatavalcfg.split(",");}if(intdatastrcfg !=undefined){this.intDataStringArray=intdatastrcfg.split(",");}}else if(this.tuyea14=="float"){var  decimal=CJ.getAttribute("tuyea17");if(decimal !=undefined){this.rangeDatadecimal=decimal;}var prefix=CJ.getAttribute("tuyea18");if(prefix !=undefined){this.tuyea18=prefix;}this.tuyea19=CJ.getAttribute("tuyea19");}else if(this.tuyea14=="string"){var prefix=CJ.getAttribute("tuyea18");if(prefix !=undefined){this.tuyea18=prefix;}this.tuyea19=CJ.getAttribute("tuyea19");}};AU.prototype.CV=function(curtime){if((curtime - this.lasttime) < this.timeinterval){return;}this.lasttime=curtime;if(this.tuyea14=="int"){var val=window.eval(this.CA);if(this.intDataValueArray.length==this.intDataStringArray.length){for(var i=0;i < this.intDataValueArray.length; ++i){if(val==this.intDataValueArray[i]){val=this.intDataStringArray[i];break;}}}this.CJ.firstChild.data=val;}else if(this.tuyea14=="float"){var val=window.eval(this.CA);val=val.toFixed(this.rangeDatadecimal);if(this.tuyea19 !=undefined && this.tuyea19 > 0){if(val.length > this.tuyea19){val=val.substring(0, this.tuyea19);}}this.CJ.firstChild.data=val + this.tuyea18;}else if(this.tuyea14=="string"){var val=this.CA;if(this.tuyea19 !=undefined && this.tuyea19 > 0){if(val.length > this.tuyea19){val=val.substring(0, this.tuyea19);}}this.CJ.firstChild.data=val + this.tuyea18;}};function AY(CJ,BG){this.CJ=CJ;this.BQ="";this.CA="";this.BS=[];this.orginalcolor="none";this.datatype="tuyea90";this.valueArray=[];this.colorArray=[];this.BG=BG;this.colorattr="stroke";this.lasttime=0;this.timeinterval=1000;if(this.BG=="" || this.BG==undefined){this.BG="tuyea2";}var valuecfg="";var colorcfg="";if(BG=="tuyea2"){this.BQ=CJ.getAttribute("tuyea3");this.Init(CJ,"stroke"),this.datatype=CJ.getAttribute("tuyea4");valuecfg=CJ.getAttribute("tuyea5");colorcfg=CJ.getAttribute("tuyea6");}else if(BG=="tuyea7"){this.colorattr="fill";this.BQ=CJ.getAttribute("tuyea8");this.Init(CJ,"fill"),this.datatype=CJ.getAttribute("tuyea9");valuecfg=CJ.getAttribute("tuyea10");colorcfg=CJ.getAttribute("tuyea11");}if(valuecfg !=undefined){this.valueArray=valuecfg.split(",");}if(colorcfg !=undefined){this.colorArray=colorcfg.split(",");}};AY.prototype.Init=function(objnode,type){if(objnode.nodeType==1){if(objnode.tagName=="line"|| objnode.tagName=="rect"|| objnode.tagName=="circle"|| objnode.tagName=="ellipse"|| objnode.tagName=="path"|| objnode.tagName=="text"|| objnode.tagName=="polyline"|| objnode.tagName=="polygon"|| objnode.tagName=="g"){var strcolor=objnode.getAttribute(type);objnode.setAttribute("oldcolor",strcolor);for (var i=0; i < objnode.childNodes.length; ++i){var child=objnode.childNodes.item(i);if(child.nodeType==1){this.Init(child,type);}}}}};AY.prototype.SetColor=function(obj,newcolor,usedold){if(obj.nodeType==1){if(obj.tagName=="line"|| obj.tagName=="rect"|| obj.tagName=="circle"|| obj.tagName=="ellipse"|| obj.tagName=="path"|| obj.tagName=="text"|| obj.tagName=="polyline"|| obj.tagName=="polygon"|| obj.tagName=="g"){var strcolor=newcolor;if(usedold){strcolor=obj.getAttribute("oldcolor");}obj.setAttribute(this.colorattr,strcolor);for (var i=0; i < obj.childNodes.length; ++i){var child=obj.childNodes.item(i);if(child.nodeType==1){this.SetColor(child,newcolor,usedold);}}}}};AY.prototype.CV=function(curtime){if((curtime - this.lasttime) < this.timeinterval){return;}if(this.valueArray.length==0)return;this.lasttime=curtime;var val=window.eval(this.CA);this.SetColor(this.CJ,"",1);if(this.datatype=="tuyea89"){if(this.valueArray.length==this.colorArray.length){for(var index in this.valueArray){if(val==this.valueArray[index]){this.SetColor(this.CJ,this.colorArray[index],0);}}}}else if(this.datatype=="tuyea90"){if(this.valueArray.length==this.colorArray.length){for(var i=0; i < this.valueArray.length; ++i){if(val <=this.valueArray[i]){this.SetColor(this.CJ,this.colorArray[i],0);}}}}};function AO(showg,CJ,BG){this.CJ=CJ;this.BQ="";this.CA="";this.BS=[];this.BG=BG;this.lasttime=0;this.timeinterval=1000;this.g=showg;this.TextArray=[];this.BQ=CJ.getAttribute("tuyea79");this.tuyea80=CJ.getAttribute("tuyea80");if(this.BQ==null || this.BQ==undefined){this.BQ="";}if(this.tuyea80==null || this.tuyea80==undefined){this.tuyea80="";}this.index=0;var box=new Bbox();box.CL(CJ);this.tuyea56X=box.DB+3;this.tuyea56Y=box.DA+(box.DC-box.DA)/2;this.bkrect=document.createElementNS("http://www.w3.org/2000/svg","rect");this.bkrect.setAttribute("x", this.tuyea56X);this.bkrect.setAttribute("y", this.tuyea56Y);this.bkrect.setAttribute("stroke","#FCFCFC");this.bkrect.setAttribute("stroke-opacity","1");this.bkrect.setAttribute("fill","#F2F2F2");this.bkrect.setAttribute("fill-opacity","0.6");this.bkrect.setAttribute("height",1);this.bkrect.setAttribute("width",1);this.g.appendChild(this.bkrect);var str=this.BQ;var arrExp=str.split(\';\');var arrName=this.tuyea80.split(\';\');var dy=20+ this.tuyea56Y;var txtMaxWidth=0;var txtMaxHeight=arrName.length*30;this.bkrect.setAttribute("height",txtMaxHeight);if(arrExp.length==arrName.length){for(var i=0; i < arrExp.length; ++i){var txt=document.createElementNS("http://www.w3.org/2000/svg", "text");txt.setAttribute("stroke","#0000FF");txt.setAttribute("stroke-opacity","0");txt.setAttribute("fill","#0000FF");txt.setAttribute("fill-opacity","1");txt.setAttribute("x", this.tuyea56X);txt.setAttribute("y", dy);dy +=20;txt.setAttribute("showtitle",arrName[i]);var text_node=document.createTextNode(arrName[i]);txt.appendChild(text_node);this.g.appendChild(txt);var txtbbox=txt.getBBox();if(txtbbox !=null && txtbbox !=undefined){if(txtbbox.width > txtMaxWidth){txtMaxWidth=txtbbox.width;}}this.TextArray.push(txt);}for (var i=0; i < this.TextArray.length; ++i){var txt=this.TextArray[i];var txtbbox=txt.getBBox();txt.setAttribute("x", this.tuyea56X+txtMaxWidth-txtbbox.width);txt.firstChild.data="";}ManagerInst.pushAnimate(this);}};AO.prototype.destory=function(){ManagerInst.removeNode(this.BG);};AO.prototype.CV=function(curtime){var textobj=this.tooltiptext;var strAfter=this.CA;var arrVal=strAfter.split(\';\');var txtMaxWidth=0;for (var i=0; i < this.TextArray.length; ++i){var txt=this.TextArray[i];if(txt){var title=txt.getAttribute("showtitle");if(arrVal.length > i && arrVal[i].length > 0){txt.firstChild.data=title + arrVal[i];}else{txt.firstChild.data=title;}var txtbbox=txt.getBBox();if(txtbbox !=null && txtbbox !=undefined){if((txtbbox.width+(txtbbox.x-this.tuyea56X)) > txtMaxWidth){txtMaxWidth=txtbbox.width+(txtbbox.x-this.tuyea56X);}}}}var bkrcwidth=this.bkrect.getAttribute("width");if(parseInt(bkrcwidth) < txtMaxWidth){this.bkrect.setAttribute("width",txtMaxWidth);}};function AM(config,ManagerInst){this.BQ="";this.CA="";this.initval="";this.lasttime=0;this.timeinterval=200;this.BS=[];this.condition=2;this.initvalue=0;this.addvalue=1;this.CE=100;this.restore=1;this.localvar="";this.localval=this.initvalue;this.bchange=false;if(config !=undefined && config !=null){var localArr=config.split(\',\');if(localArr !=undefined && localArr.length==7){this.BQ=localArr[0];this.localvar=localArr[1];this.condition=parseInt(localArr[2]);this.initvalue=parseInt(localArr[3]);this.addvalue=parseInt(localArr[4]);this.CE=parseInt(localArr[5]);this.restore=parseInt(localArr[6]);}}};AM.prototype.MakeData=function(curtime,ManagerInst){if((curtime - this.lasttime) < this.timeinterval){return;}this.lasttime=curtime;if(this.initval==""){this.initval=this.CA;}else if(this.initval !=this.CA){this.bchange=true;this.initval=this.CA;this.localval=this.initvalue;}var val=window.eval(this.CA);if(((this.condition==2) && this.bchange) || (this.condition==val)){this.localval +=this.addvalue;}if((this.restore==1) && (this.localval > this.CE)){this.localval=this.initvalue;this.bchange=false;}if(this.localval > this.CE){this.localval=this.CE;}ManagerInst.BK[this.localvar]=this.localval;};function CN(ManagerInst){return function(){ManagerInst.currenttime +=50;if((ManagerInst.currenttime-ManagerInst.serverlastdatatime) >=ManagerInst.datatimeinterval){ManagerInst.serverlastdatatime=ManagerInst.currenttime;RequestServerData(ManagerInst);}if(ManagerInst.readydata){if((ManagerInst.currenttime - ManagerInst.locallastdatatime) >=ManagerInst.localtimeinterval){ManagerInst.locallastdatatime=ManagerInst.currenttime;MakeLocalData(ManagerInst);}}ManagerInst.ReplaceAllExpress();ManagerInst.AP();if(ManagerInst.currenttime > 10000000){ManagerInst.resettime();}mousetimer();timecall();}};function MakeLocalData(ManagerInst){for(i=0;i < ManagerInst.AMInsts.length; ++i){ManagerInst.AMInsts[i].MakeData(ManagerInst.currenttime,ManagerInst);}};function RequestServerData(ManagerInst){if(ManagerInst.DataAnimateInsts.length==0){return;}var obj=ManagerInst;var CH={};CH["url"]=\'getdata.php\'+"?cookie=mycookie";var bneedrequest=false;if(obj.CK=="" || obj.CK==undefined){var subParam={params:[]};for(var temp in obj.BK){if(ManagerInst.LocalvarArr[temp]==undefined || ManagerInst.LocalvarArr[temp]==null){subParam["params"].push(temp);CH["data"]=subParam;bneedrequest=true;}}}else{var subParam={orderid:[]};subParam["orderid"].push(obj.CK);CH["data"]=subParam;bneedrequest=true;}if(bneedrequest){CH["success"]=function(http){BC(obj,http);};CH["error"]=function(http){};obj.BH.request(CH);}};function AnimateManager(){this.DataAnimateInsts=[];this.AMInsts=[];this.BK=[];this.AL=[];this.BH=new BJ();this.CK="";this.datatimeinterval=1000;this.localtimeinterval=1000;this.BK["hour"]="";this.LocalvarArr=[];this.LocalvarArr["localnull"]="0";this.LocalvarArr["localaddup"]="0";this.LocalvarArr["localuser1"]="0";this.LocalvarArr["localuser2"]="0";this.LocalvarArr["localuser3"]="0";this.LocalvarArr["localuser4"]="0";this.LocalvarArr["localuser5"]="0";this.LocalvarArr["localuser6"]="0";this.LocalvarArr["localuser7"]="0";this.LocalvarArr["localuser8"]="0";this.BK["localnull"]="0";this.BK["localaddup"]="5";this.BK["localuser1"]="0";this.BK["localuser2"]="0";this.BK["localuser3"]="0";this.BK["localuser4"]="0";this.BK["localuser5"]="0";this.BK["localuser6"]="0";this.BK["localuser7"]="0";this.BK["localuser8"]="0";var root=document.documentElement;var serverfreshtime=root.getAttribute("serverfreshtime");if(serverfreshtime >=50){this.datatimeinterval=serverfreshtime;}var localfreshtime=root.getAttribute("localfreshtime");if(localfreshtime >=50){this.localtimeinterval=localfreshtime;}var localstr=root.getAttribute("localvar");if(localstr==null || localstr==undefined){localstr="";}localstr="1,localaddup,1,0,1,1000000,1;" + localstr;var localArr=localstr.split(\';\');for(i=0; i < localArr.length; ++i){if(localArr[i].length > 0){var localInst=new AM(localArr[i],this);this.BI(localInst);localInst.timeinterval=this.localtimeinterval;this.AMInsts.push(localInst);}}this.currenttime=1000000;this.serverlastdatatime=10000;this.locallastdatatime=10000;this.readydata=false;this.AN=true;};AnimateManager.prototype.Init=function(){var root=document.documentElement;var CT=[];var kinds=[];this.AF(root,CT,kinds);this.BUs(CT,kinds);window.setInterval(CN(this),50);};AnimateManager.prototype.resettime=function(){this.currenttime=1000000;this.serverlastdatatime=10000;this.locallastdatatime=10000;for(var key in this.DataAnimateInsts){this.DataAnimateInsts[key].lasttime=0;}for(var key in this.AMInsts){this.AMInsts[key].lasttime=0;}};AnimateManager.prototype.AF=function(CJ,CT,kinds){if(CJ==null || CJ.nodeType !=1)return;var attrkind=CJ.getAttribute("tuyea1");if(attrkind !=undefined && attrkind !=""){CT.push(CJ);kinds.push(attrkind);}for (var i=0; i < CJ.childNodes.length; ++i){var child=CJ.childNodes.item(i);this.AF(child,CT,kinds);}};AnimateManager.prototype.BI=function(AnimateInst){if(AnimateInst.BQ==undefined){return;}AnimateInst.timeinterval=this.datatimeinterval;var  start=0;var  end=0;do{start=AnimateInst.BQ.indexOf("{",start);end=AnimateInst.BQ.indexOf("}",start);if(start >=0 && end > start){var exp=AnimateInst.BQ.substring(start+1,end);if(this.LocalvarArr[exp] !=undefined){AnimateInst.timeinterval=this.localtimeinterval;}AnimateInst.BS.push(exp);if(this.BK[exp]==null ||this.BK[exp]==undefined){this.BK[exp]="";}start=end;}}while(start >=0)};AnimateManager.prototype.AW=function(CJ,BG){var gnode=document.createElementNS("http://www.w3.org/2000/svg", "g");gnode.setAttribute("tuyea1",BG);CJ.parentNode.insertBefore(gnode,CJ);CJ.parentNode.removeChild(CJ);gnode.appendChild(CJ);var strmatrix=CJ.getAttribute("transform");if(strmatrix !=undefined && strmatrix !=null){gnode.setAttribute("transform",strmatrix);CJ.setAttribute("transform","matrix(1,0,0,1,0,0)");}};AnimateManager.prototype.removeNode=function(strkind){for(var key in this.DataAnimateInsts){if(this.DataAnimateInsts[key].BG==strkind){this.DataAnimateInsts.splice(key, 1);break;}}};AnimateManager.prototype.pushAnimate=function(newInst){if(newInst !=null){this.BI(newInst);this.DataAnimateInsts.push(newInst);}};AnimateManager.prototype.BU=function(node,strkind){var newInst=null;if ("tuyea2"==strkind || "tuyea7"==strkind){newInst=new AY(node,strkind);}else if("tuyea12"==strkind){newInst=new AU(node,strkind);}else if("tuyea20"==strkind){newInst=new AJ(node,strkind);}else if("tuyea23"==strkind){newInst=new AX(node,strkind);}else if("tuyea29"==strkind){newInst=new BE(node,strkind);}else if("tuyea37"==strkind || "tuyea43"==strkind){newInst=new AG(node,strkind);}else if("tuyea49"==strkind){newInst=new AR(node,strkind);}else if("tuyea69"==strkind){newInst=new AD(node,strkind);}if(newInst !=null){this.pushAnimate(newInst);}};AnimateManager.prototype.BUs=function(CT,kinds){for(var i=0; i < CT.length; ++i){this.AW(CT[i],kinds[i]);var animatestrkind=kinds[i];var attrkinds=animatestrkind.split(",");for (j in attrkinds){var strkind=attrkinds[j];this.BU(CT[i],strkind);}}};AnimateManager.prototype.AH=function(AnimateInst){AnimateInst.CA=AnimateInst.BQ;for(var Index in AnimateInst.BS){var varstr=AnimateInst.BS[Index];var value=this.BK[varstr];while (AnimateInst.CA.indexOf("{" + varstr + "}") !=-1){AnimateInst.CA=AnimateInst.CA.replace("{" + varstr + "}", value);}}};AnimateManager.prototype.ReplaceAllExpress=function(){if(!this.readydata)return;for(var key in this.DataAnimateInsts){this.AH(this.DataAnimateInsts[key]);}for(var key in this.AMInsts){this.AH(this.AMInsts[key]);}};AnimateManager.prototype.AP=function(){if(!this.readydata)return;for(var key in this.DataAnimateInsts){this.DataAnimateInsts[key].CV(this.currenttime);}};function BC(ManagerInst,http){if(http.responseText==null || http.responseText==undefined)return;var data=JSON.parse(http.responseText);if (window.eval(data["total"]) > 0){var rowdatas=data["rows"];for (var i in rowdatas){var id=rowdatas[i]["id"];var exp=rowdatas[i]["exp"];var value=rowdatas[i]["v"];var quality=rowdatas[i]["q"];var time=window.eval(rowdatas[i]["t"]) / 1000;if((exp=="" || exp==undefined) && id !=undefined){exp=ManagerInst.AL[id];}if(exp=="" || exp==undefined){exp=id;}ManagerInst.BK[exp]=value;}ManagerInst.CK=ManagerInst.BK["orderid"];ManagerInst.readydata=true;if(this.AN){ManagerInst.ReplaceAllExpress();ManagerInst.AP(true);this.AN=false;}}};function BJ(){this.xmlHttp=null;this.type="POST";this.async=true;this.url="getdata.php?cookie=mycookie";this.timeout=5000;this.data={};this.success=null;this.error=null;BJ.prototype.destroy=function(){if(this.xmlHttp!=null){this.xmlHttp.onreadystatechange=null;this.xmlHttp.ontimeout=null;}};BJ.prototype.request=function(CH){if(this.xmlHttp==null){this.xmlHttp=this.CXmlHttp();}if(CH.hasOwnProperty("url")){this.url=CH["url"];}if(CH.hasOwnProperty("data")){this.data=CH["data"];}if(CH.hasOwnProperty("success")){this.success=CH["success"];}if(CH.hasOwnProperty("error")){this.error=CH["error"];}var obj=this;this.xmlHttp.open(this.type,this.url,this.async);if(this.async){this.xmlHttp.timeout=this.timeout;if(CH.hasOwnProperty("success")){this.xmlHttp.onreadystatechange=function(){if(obj.xmlHttp.readyState==4 && obj.xmlHttp.status==200){if(typeof obj.success=="function"){obj.success(this);}}}}this.xmlHttp.ontimeout=function(){if(typeof obj.error=="function"){obj.error(obj.xmlHttp);}}}var type=Object.prototype.toString.call(this.data).toLowerCase();if(typeof(this.data)=="object" && type=="[object object]" && !this.data.length){this.xmlHttp.setRequestHeader("Content-Type","text/xml;charset=utf-8");this.xmlHttp.send(JSON.stringify(this.data));if(!this.async){if(typeof this.success=="function"){this.success(this.xmlHttp);}}}};};BJ.prototype.CXmlHttp=function(){try{if (window.XMLHttpRequest){var req=new XMLHttpRequest();if (req.readyState==null){req.readyState=1;req.addEventListener("load",function() {req.readyState=4;if (typeof req.onreadystatechange=="function")req.onreadystatechange();},false);}return req;}if (window.ActiveXObject){return new ActiveXObject(SOAPClient._CXmlHttpProgID());}}catch (ex) { }throw new Error("Your browser doesn\'5t support xmlhttp objects!");};function Bbox(){this.CY=0;this.DA=0;this.DB=0;this.DC=0;this.matrix=new CQ();this.flag=true;};Bbox.prototype.CX=function(){return this.CY;};Bbox.prototype.CW=function(){return this.DA;};Bbox.prototype.CI=function(){return this.DB-this.CY;};Bbox.prototype.BV=function(){return this.DC-this.DA;};Bbox.prototype.CR=function(obj){if (this.flag) {this.CY=obj[0];this.DA=obj[1];this.DB=obj[0];this.DC=obj[1];this.flag=false;}else {this.CY=Math.min(this.CY, obj[0]);this.DA=Math.min(this.DA, obj[1]);this.DB=Math.max(this.DB, obj[0]);this.DC=Math.max(this.DC, obj[1]);}};Bbox.prototype.CL=function(obj){var tagName=obj.tagName;var transform=this.matrix.BB(this.matrix.AE(obj)  + obj.getAttribute("transform"));var BO=new Array();if (tagName=="ellipse") {var cx=new Number(obj.getAttribute("cx"));var cy=new Number(obj.getAttribute("cy"));var rx=new Number(obj.getAttribute("rx"));var ry=new Number(obj.getAttribute("ry"));var pointsArrayE=new Array();var pointsArray=this.AA(cx - rx, cy, rx, ry, 0, 1, 1, cx + rx, cy);var tempPointsArray=this.AA(cx - rx, cy, rx, ry, 0, 1, 0, cx + rx, cy);for (temp in tempPointsArray) {pointsArray.push(tempPointsArray[temp]);}for (var i=0; i < pointsArray.length; i +=8) {BO[0]=pointsArray[i];BO[1]=pointsArray[i + 1];BO=this.matrix.BY(transform, BO);this.CR(BO);pointsArrayE[0]=BO[0];pointsArrayE[1]=BO[1];BO[0]=pointsArray[i + 2];BO[1]=pointsArray[i + 3];BO=this.matrix.BY(transform, BO);pointsArrayE[2]=BO[0];pointsArrayE[3]=BO[1];BO[0]=pointsArray[i + 4];BO[1]=pointsArray[i + 5];BO=this.matrix.BY(transform, BO);pointsArrayE[4]=BO[0];pointsArrayE[5]=BO[1];BO[0]=pointsArray[i + 6];BO[1]=pointsArray[i + 7];BO=this.matrix.BY(transform, BO);this.CR(BO);pointsArrayE[6]=BO[0];pointsArrayE[7]=BO[1];this.caclSancibeisaier(pointsArrayE);}}else if (tagName=="polyline" || tagName=="polygon") {var pointsArray=obj.getAttribute("points").replace(/ /g, ",").split(",");for (var i=0; i < pointsArray.length; i +=2) {BO[0]=pointsArray[i];BO[1]=pointsArray[i + 1];BO=this.matrix.BY(transform, BO);this.CR(BO);}}else if (tagName=="path") {var pointsArray=obj.getAttribute("d").split(" ");var controlArray=new Array();var AV=new Array();AV.push(0);AV.push(0);controlArray=this.AI(controlArray, 0, 0, 0);for (var i=0; i < pointsArray.length; i++) {pointsArray[i]=pointsArray[i].replace("z", "");pointsArray[i]=pointsArray[i].replace("Z", "");}for (var i=0; i < pointsArray.length;) {if (pointsArray[i].indexOf("M") !=-1 || pointsArray[i].indexOf("L") !=-1) {AV[0]=new Number(pointsArray[i].substring(1));AV[1]=new Number(pointsArray[i + 1]);BO=this.matrix.BY(transform, AV);this.CR(BO);controlArray=this.AI(controlArray, "0", BO[0], BO[1]);i +=2;}else if (pointsArray[i].indexOf("m") !=-1 || pointsArray[i].indexOf("l") !=-1) {AV[0]=AV[0] + new Number(pointsArray[i].substring(1));AV[1]=AV[1] + new Number(pointsArray[i + 1]);BO=this.matrix.BY(transform, AV);this.CR(BO);controlArray=this.AI(controlArray, "0", BO[0], BO[1]);i +=2;}else if (pointsArray[i].indexOf("H") !=-1) {AV[0]=new Number(pointsArray[i].substring(1));BO=this.matrix.BY(transform, AV);this.CR(BO);controlArray=this.AI(controlArray, "0", BO[0], BO[1]);i +=1;}else if (pointsArray[i].indexOf("h") !=-1) {AV[0]=AV[0] + new Number(pointsArray[i].substring(1));BO=this.matrix.BY(transform, AV);this.CR(BO);controlArray=this.AI(controlArray, "0", BO[0], BO[1]);i +=1;}else if (pointsArray[i].indexOf("V") !=-1) {AV[1]=new Number(pointsArray[i].substring(1));BO=this.matrix.BY(transform, AV);this.CR(BO);controlArray=this.AI(controlArray, "0", BO[0], BO[1]);i +=1;}else if (pointsArray[i].indexOf("v") !=-1) {AV[1]=AV[1] + new Number(pointsArray[i].substring(1));BO=this.matrix.BY(transform, AV);this.CR(BO);controlArray=this.AI(controlArray, "0", BO[0], BO[1]);i +=1;}else if (pointsArray[i].indexOf("Q") !=-1) {var pointsArrayQ=new Array();BO=this.matrix.BY(transform, AV);pointsArrayQ.push(BO[0]);pointsArrayQ.push(BO[1]);AV[0]=new Number(pointsArray[i].substring(1));AV[1]=new Number(pointsArray[i + 1]);BO=this.matrix.BY(transform, AV);pointsArrayQ.push(BO[0]);pointsArrayQ.push(BO[1]);controlArray=this.AI(controlArray, "1", BO[0], BO[1]);AV[0]=new Number(pointsArray[i + 2]);AV[1]=new Number(pointsArray[i + 3]);BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArrayQ.push(BO[0]);pointsArrayQ.push(BO[1]);this.AB(pointsArrayQ);i +=4;}else if (pointsArray[i].indexOf("q") !=-1) {var pointsArrayq=new Array();var tempX=AV[0];var tempY=AV[1];BO=this.matrix.BY(transform, AV);pointsArrayq.push(BO[0]);pointsArrayq.push(BO[1]);AV[0]=new Number(pointsArray[i].substring(1)) + tempX;AV[1]=new Number(pointsArray[i + 1]) + tempY;BO=this.matrix.BY(transform, AV);pointsArrayq.push(BO[0]);pointsArrayq.push(BO[1]);controlArray=this.AI(controlArray, "1", BO[0], BO[1]);AV[0]=new Number(pointsArray[i + 2]) + tempX;AV[1]=new Number(pointsArray[i + 3]) + tempY;BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArrayq.push(BO[0]);pointsArrayq.push(BO[1]);this.AB(pointsArrayq);i +=4;}else if (pointsArray[i].indexOf("T") !=-1) {var pointsArrayT=new Array();BO=this.matrix.BY(transform, AV);pointsArrayT.push(BO[0]);pointsArrayT.push(BO[1]);if ("1"==controlArray[0]) {pointsArrayT.push(2 * pointsArrayT[0] - controlArray[1]);pointsArrayT.push(2 * pointsArrayT[1] - controlArray[2]);}else {pointsArrayT.push(pointsArrayT[0]);pointsArrayT.push(pointsArrayT[1]);}controlArray=this.AI(controlArray, "1", pointsArrayT[2], pointsArrayT[3]);AV[0]=new Number(pointsArray[i].substring(1));AV[1]=new Number(pointsArray[i + 1]);BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArrayT.push(BO[0]);pointsArrayT.push(BO[1]);this.AB(pointsArrayT);i +=2;}else if (pointsArray[i].indexOf("t") !=-1) {var pointsArrayt=new Array();var tempX=AV[0];var tempY=AV[1];BO=this.matrix.BY(transform, AV);pointsArrayt.push(BO[0]);pointsArrayt.push(BO[1]);if ("1"==controlArray[0]) {pointsArrayt.push(2 * pointsArrayt[0] - controlArray[1]);pointsArrayt.push(2 * pointsArrayt[1] - controlArray[2]);}else {pointsArrayt.push(pointsArrayt[0]);pointsArrayt.push(pointsArrayt[1]);}controlArray=this.AI(controlArray, "1", pointsArrayt[2], pointsArrayt[3]);AV[0]=new Number(pointsArray[i].substring(1)) + tempX;AV[1]=new Number(pointsArray[i + 1]) + tempY;BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArrayt.push(BO[0]);pointsArrayt.push(BO[1]);this.AB(pointsArrayt);i +=2;}else if (pointsArray[i].indexOf("C") !=-1) {var pointsArrayC=new Array();BO=this.matrix.BY(transform, AV);pointsArrayC.push(BO[0]);pointsArrayC.push(BO[1]);AV[0]=new Number(pointsArray[i].substring(1));AV[1]=new Number(pointsArray[i + 1]);BO=this.matrix.BY(transform, AV);pointsArrayC.push(BO[0]);pointsArrayC.push(BO[1]);AV[0]=new Number(pointsArray[i + 2]);AV[1]=new Number(pointsArray[i + 3]);BO=this.matrix.BY(transform, AV);controlArray=this.AI(controlArray, "1", BO[0], BO[1]);pointsArrayC.push(BO[0]);pointsArrayC.push(BO[1]);AV[0]=new Number(pointsArray[i + 4]);AV[1]=new Number(pointsArray[i + 5]);BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArrayC.push(BO[0]);pointsArrayC.push(BO[1]);this.caclSancibeisaier(pointsArrayC);i +=6;}else if (pointsArray[i].indexOf("c") !=-1) {var pointsArrayc=new Array();var tempX=AV[0];var tempY=AV[1];BO=this.matrix.BY(transform, AV);pointsArrayc.push(BO[0]);pointsArrayc.push(BO[1]);AV[0]=new Number(pointsArray[i].substring(1)) + tempX;AV[1]=new Number(pointsArray[i + 1]) + tempY;BO=this.matrix.BY(transform, AV);pointsArrayc.push(BO[0]);pointsArrayc.push(BO[1]);AV[0]=new Number(pointsArray[i + 2]) + tempX;AV[1]=new Number(pointsArray[i + 3]) + tempY;BO=this.matrix.BY(transform, AV);controlArray=this.AI(controlArray, "1", BO[0], BO[1]);pointsArrayc.push(BO[0]);pointsArrayc.push(BO[1]);AV[0]=new Number(pointsArray[i + 4]) + tempX;AV[1]=new Number(pointsArray[i + 5]) + tempY;BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArrayc.push(BO[0]);pointsArrayc.push(BO[1]);this.caclSancibeisaier(pointsArrayc);i +=6;}else if (pointsArray[i].indexOf("S") !=-1) {var BA=new Array();BO=this.matrix.BY(transform, AV);BA.push(BO[0]);BA.push(BO[1]);if ("1"==controlArray[0]) {BA.push(2 * BA[0] - controlArray[1]);BA.push(2 * BA[1] - controlArray[2]);}else {BA.push(BA[0]);BA.push(BA[1]);}AV[0]=new Number(pointsArray[i].substring(1));AV[1]=new Number(pointsArray[i + 1]);BO=this.matrix.BY(transform, AV);BA.push(BO[0]);BA.push(BO[1]);controlArray=this.AI(controlArray, "1", BA[2], BA[3]);AV[0]=new Number(pointsArray[i + 2]);AV[1]=new Number(pointsArray[i + 3]);BO=this.matrix.BY(transform, AV);this.CR(BO);BA.push(BO[0]);BA.push(BO[1]);this.caclSancibeisaier(BA);i +=4;}else if (pointsArray[i].indexOf("s") !=-1) {var pointsArrays=new Array();var tempX=AV[0];var tempY=AV[1];BO=this.matrix.BY(transform, AV);pointsArrays.push(BO[0]);pointsArrays.push(BO[1]);if ("1"==controlArray[0]) {pointsArrays.push(2 * pointsArrays[0] - controlArray[1]);pointsArrays.push(2 * pointsArrays[1] - controlArray[2]);}else {pointsArrays.push(pointsArrayt[0]);pointsArrays.push(pointsArrayt[1]);}AV[0]=new Number(pointsArray[i].substring(1)) + tempX;AV[1]=new Number(pointsArray[i + 1]) + tempY;BO=this.matrix.BY(transform, AV);pointsArrays.push(BO[0]);pointsArrays.push(BO[1]);controlArray=this.AI(controlArray, "1", pointsArrays[0], pointsArrays[1]);AV[0]=new Number(pointsArray[i + 2]) + tempX;AV[1]=new Number(pointsArray[i + 3]) + tempY;BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArrays.push(BO[0]);pointsArrays.push(BO[1]);this.caclSancibeisaier(pointsArrays);i +=4;}else if (pointsArray[i].indexOf("A") !=-1) {var pointsArrayA=new Array();tempPointsArray=this.AA(AV[0], AV[1], new Number(pointsArray[i].substring(1)), new Number(pointsArray[i + 1]), new Number(pointsArray[i + 2]), new Number(pointsArray[i + 3]), new Number(pointsArray[i + 4]), new Number(pointsArray[i + 5]), new Number(pointsArray[i + 6]));for (var j=0; j < tempPointsArray.length; j +=8) {AV[0]=tempPointsArray[j];AV[1]=tempPointsArray[j + 1];BO[2]=1;BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArrayA[0]=BO[0];pointsArrayA[1]=BO[1];AV[0]=tempPointsArray[j + 2];AV[1]=tempPointsArray[j + 3];BO=this.matrix.BY(transform, AV);pointsArrayA[2]=BO[0];pointsArrayA[3]=BO[1];AV[0]=tempPointsArray[j + 4];AV[1]=tempPointsArray[j + 5];BO=this.matrix.BY(transform, AV);pointsArrayA[4]=BO[0];pointsArrayA[5]=BO[1];controlArray=this.AI(controlArray, "1", BO[0], BO[1]);AV[0]=tempPointsArray[j + 6];AV[1]=tempPointsArray[j + 7];BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArrayA[6]=BO[0];pointsArrayA[7]=BO[1];this.caclSancibeisaier(pointsArrayA);}i +=7;}else if (pointsArray[i].indexOf("a") !=-1) {var pointsArraya=new Array();tempPointsArray=this.AA(AV[0], AV[1], new Number(pointsArray[i].substring(1)), new Number(pointsArray[i + 1]), new Number(pointsArray[i + 2]), new Number(pointsArray[i + 3]), new Number(pointsArray[i + 4]), new Number(pointsArray[i + 5])+AV[0], new Number(pointsArray[i + 6])+AV[1]);for (var  j=0; j < tempPointsArray.length; j +=8) {AV[0]=tempPointsArray[j];AV[1]=tempPointsArray[j + 1];BO[2]=1;BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArraya[0]=BO[0];pointsArraya[1]=BO[1];AV[0]=tempPointsArray[j + 2];AV[1]=tempPointsArray[j + 3];BO=this.matrix.BY(transform, AV);pointsArraya[2]=BO[0];pointsArraya[3]=BO[1];AV[0]=tempPointsArray[j + 4];AV[1]=tempPointsArray[j + 5];BO=this.matrix.BY(transform, AV);pointsArraya[4]=BO[0];pointsArraya[5]=BO[1];controlArray=this.AI(controlArray, "1", BO[0], BO[1]);AV[0]=tempPointsArray[j + 6];AV[1]=tempPointsArray[j + 7];BO=this.matrix.BY(transform, AV);this.CR(BO);pointsArraya[6]=BO[0];pointsArraya[7]=BO[1];this.caclSancibeisaier(pointsArraya);}i +=7;}else {i++;}}}else if(tagName=="g"){for (var i=0; i < obj.childNodes.length; ++i){var child=obj.childNodes.item(i);if(child.nodeType==1){this.CL(child);}}}else if(tagName=="line" || tagName=="rect" || tagName=="circle"||tagName=="text"||tagName=="image"){var Bbox=obj.getBBox();BO[0]=Bbox.x;BO[1]=Bbox.y;BO=this.matrix.BY(transform, BO);this.CR(BO);BO[0]=Bbox.x + Bbox.width;BO[1]=Bbox.y;BO=this.matrix.BY(transform, BO);this.CR(BO);BO[0]=Bbox.x + Bbox.width;BO[1]=Bbox.y + Bbox.height;BO=this.matrix.BY(transform, BO);this.CR(BO);BO[0]=Bbox.x;BO[1]=Bbox.y + Bbox.height;BO=this.matrix.BY(transform, BO);this.CR(BO);}};Bbox.prototype.AI=function(obj1, obj2, obj3, obj4){obj1[0]=obj2;obj1[1]=obj3;obj1[2]=obj4;return obj1;};Bbox.prototype.AB=function(obj){var array=new Array();var arrayT=new Array();if (obj[1] + obj[5] !=2 * obj[3]) {arrayT.push((obj[1] - obj[3]) / (obj[1] + obj[5] - 2 * obj[3]));}if (obj[0] + obj[2] !=2 * obj[4]) {arrayT.push((obj[0] - obj[2]) / (obj[0] + obj[4] - 2 * obj[2]));}for (var i in arrayT) {if (0 <=arrayT[i] && arrayT[i] <=1) {array[0]=Math.pow(1 - arrayT[i], 2) * obj[0] + 2 * arrayT[i] * (1 - arrayT[i]) * obj[2] + Math.pow(arrayT[i], 2) * obj[4];array[1]=Math.pow(1 - arrayT[i], 2) * obj[1] + 2 * arrayT[i] * (1 - arrayT[i]) * obj[3] + Math.pow(arrayT[i], 2) * obj[5];this.CR(array);}}};Bbox.prototype.caclSancibeisaier=function(obj){var array=new Array();var arrayT=new Array();if (obj[1] + 3 * obj[5] !=obj[7] + 3 * obj[3]) {var t1=obj[1] - 2 * obj[3] + obj[5];var t2=Math.sqrt(Math.pow(obj[3], 2) - obj[1] * obj[5] - obj[3] * obj[5] + Math.pow(obj[5], 2) + obj[1] * obj[7] - obj[3] * obj[7]);var t3=obj[1] + 3 * obj[5] - obj[7] - 3 * obj[3];arrayT.push((t1 - t2) / t3);arrayT.push((t1 + t2) / t3);}if (obj[0] + 3 * obj[4] !=obj[6] + 3 * obj[2]) {var t1=obj[0] - 2 * obj[2] + obj[4];var t2=Math.sqrt(Math.pow(obj[2], 2) - obj[0] * obj[4] - obj[2] * obj[4] + Math.pow(obj[4], 2) + obj[0] * obj[6] - obj[2] * obj[6]);var t3=obj[0] + 3 * obj[4] - obj[6] - 3 * obj[2];arrayT.push((t1 - t2) / t3);arrayT.push((t1 + t2) / t3);}for (var i in arrayT) {if (0 <=arrayT[i] && arrayT[i] <=1) {array[0]=Math.pow(1 - arrayT[i], 3) * obj[0] + 3 * arrayT[i] * Math.pow(1 - arrayT[i], 2) * obj[2] + 3 * Math.pow(arrayT[i], 2) * (1 - arrayT[i]) * obj[4] + Math.pow(arrayT[i], 3) * obj[6];array[1]=Math.pow(1 - arrayT[i], 3) * obj[1] + 3 * arrayT[i] * Math.pow(1 - arrayT[i], 2) * obj[3] + 3 * Math.pow(arrayT[i], 2) * (1 - arrayT[i]) * obj[5] + Math.pow(arrayT[i], 3) * obj[7];this.CR(array);}}};Bbox.prototype.calculateVecToRangle=function(ux, uy, vx, vy){var ta=Math.atan2(uy, ux);var tb=Math.atan2(vy, vx);if (tb >=ta) {return tb - ta;}return Math.PI * 2 - (ta - tb);};Bbox.prototype.AA=function(startx, starty, radiusX, radiusY, angle, size, sweep, endx, endy){var arrayReturn=new Array();if (radiusX==0 && radiusY==0) {return arrayReturn;}var RadiansPerDegree=Math.PI / 180.0;var DoublePI=Math.PI * 2;var sinPhi=Math.sin(angle * RadiansPerDegree);var cosPhi=Math.cos(angle * RadiansPerDegree);var x1dash=cosPhi * (startx - endx) / 2.0 + sinPhi * (starty - endy) / 2.0;var y1dash=-sinPhi * (startx - endx) / 2.0 + cosPhi * (starty - endy) / 2.0;var root=0;var numerator=radiusX * radiusX * radiusY * radiusY - radiusX * radiusX * y1dash * y1dash - radiusY * radiusY * x1dash * x1dash;var rx=radiusX;var ry=radiusY;if (numerator < 0) {var s=Math.sqrt(1.0 - numerator / (radiusX * radiusX * radiusY * radiusY));rx *=s;ry *=s;root=0;}else {root=((size==1 && sweep==1) || (size==0 && sweep==0) ? -1.0 : 1.0) * Math.sqrt(numerator / (radiusX * radiusX * y1dash * y1dash + radiusY * radiusY * x1dash * x1dash));}var cxdash=root * rx * y1dash / ry;var cydash=-root * ry * x1dash / rx;var cx=cosPhi * cxdash - sinPhi * cydash + (startx + endx) / 2.0;var cy=sinPhi * cxdash + cosPhi * cydash + (starty + endy) / 2.0;var theta1=this.calculateVecToRangle(1.0, 0.0, (x1dash - cxdash) / rx, (y1dash - cydash) / ry);var dtheta=this.calculateVecToRangle((x1dash - cxdash) / rx, (y1dash - cydash) / ry, (-x1dash - cxdash) / rx, (-y1dash - cydash) / ry);if (sweep==0 && dtheta > 0) {dtheta -=2.0 * Math.PI;}else if (sweep==1 && dtheta < 0) {dtheta +=2.0 * Math.PI;}var segments=Math.ceil(Math.abs(dtheta / (Math.PI / 2.0)));var delta=dtheta / segments;var t=8.0 / 3.0 * Math.sin(delta / 4.0) * Math.sin(delta / 4.0) / Math.sin(delta / 2.0);var startX=startx;var startY=starty;for (var i=0; i < segments; ++i) {var cosTheta1=Math.cos(theta1);var sinTheta1=Math.sin(theta1);var theta2=theta1 + delta;var cosTheta2=Math.cos(theta2);var sinTheta2=Math.sin(theta2);var endpointX=cosPhi * rx * cosTheta2 - sinPhi * ry * sinTheta2 + cx;var endpointY=sinPhi * rx * cosTheta2 + cosPhi * ry * sinTheta2 + cy;var dx1=t * (-cosPhi * rx * sinTheta1 - sinPhi * ry * cosTheta1);var dy1=t * (-sinPhi * rx * sinTheta1 + cosPhi * ry * cosTheta1);var dxe=t * (cosPhi * rx * sinTheta2 + sinPhi * ry * cosTheta2);var dye=t * (sinPhi * rx * sinTheta2 - cosPhi * ry * cosTheta2);arrayReturn.push(startX);arrayReturn.push(startY);arrayReturn.push(startX + dx1);arrayReturn.push(startY + dy1);arrayReturn.push(endpointX + dxe);arrayReturn.push(endpointY + dye);arrayReturn.push(endpointX);arrayReturn.push(endpointY);theta1=theta2;startX=endpointX;startY=endpointY;}return arrayReturn;};function CQ(){this.array=new Array();this.array.push(1);this.array.push(0);this.array.push(0);this.array.push(1);this.array.push(0);this.array.push(0);};CQ.prototype.BY=function(mat, pt){var matData;if (mat instanceof Array){matData=mat;}else{matData=this.BB(mat);}var retpt=new Array();retpt.push(eval(matData[0] * pt[0] + matData[2] * pt[1] + matData[4]));retpt.push(eval(matData[1] * pt[0] + matData[3] * pt[1] + matData[5]));return retpt;};CQ.prototype.BN=function(matArr){var str="matrix(" + matArr[0]+ "," + matArr[1]+ "," + matArr[2]+ "," + matArr[3]+ "," + matArr[4]+ "," + matArr[5]+ ")";return str;};CQ.prototype.caclCQ=function(matData1,matData2){var BX=new Array();BX.push(matData1[0]*matData2[0] + matData1[2]*matData2[1]);BX.push(matData1[1]*matData2[0] + matData1[3]*matData2[1]);BX.push(matData1[0]*matData2[2] + matData1[2]*matData2[3]);BX.push(matData1[1]*matData2[2] + matData1[3]*matData2[3]);BX.push(matData1[0]*matData2[4] + matData1[2]*matData2[5] + matData1[4]);BX.push(matData1[1]*matData2[4] + matData1[3]*matData2[5] + matData1[5]);return BX;};CQ.prototype.BB=function(BW){if(BW==null || BW==undefined || BW=="")return this.array;BW=BW.replace(/ /g, ",");var startIndex=0;var endIndex=0;var tempStr="";var transformReturn=new Array();var tempArray=new Array();transformReturn[0]=1;transformReturn[1]=0;transformReturn[2]=0;transformReturn[3]=1;transformReturn[4]=0;transformReturn[5]=0;tempArray[0]=1;tempArray[1]=0;tempArray[2]=0;tempArray[3]=1;tempArray[4]=0;tempArray[5]=0;while (BW.indexOf("(", startIndex) !=-1){tempArray[0]=1;tempArray[1]=0;tempArray[2]=0;tempArray[3]=1;tempArray[4]=0;tempArray[5]=0;endIndex=BW.indexOf("(", startIndex);tempStr=BW.substring(startIndex, endIndex);if ("translate"==tempStr){tempArray[4]=BW.substring(endIndex + 1, BW.indexOf(",", endIndex));tempArray[5]=BW.substring(BW.indexOf(",", endIndex) + 1, BW.indexOf(")", endIndex));}else if ("scale"==tempStr){if (BW.indexOf(",", endIndex)==-1 || BW.indexOf(")", endIndex) < BW.indexOf(",", endIndex)){tempArray[0]=BW.substring(endIndex + 1, BW.indexOf(")", endIndex));tempArray[3]=tempArray[0];}else{tempArray[0]=BW.substring(endIndex + 1, BW.indexOf(",", endIndex));tempArray[3]=BW.substring(BW.indexOf(",", endIndex) + 1, BW.indexOf(")", endIndex));}}else if ("rotate"==tempStr){var tempValue=BW.substring(endIndex + 1, BW.indexOf(")", endIndex)) * Math.PI / 180;tempArray[0]=Math.cos(tempValue);tempArray[1]=Math.sin(tempValue);tempArray[2]=-Math.sin(tempValue);tempArray[3]=Math.cos(tempValue);}else if ("skewX"==tempStr){tempArray[2]=Math.tan(BW.substring(endIndex + 1, BW.indexOf(")", endIndex)) * Math.PI / 180);}else if ("skewY"==tempStr){tempArray[1]=Math.tan(BW.substring(endIndex + 1, BW.indexOf(")", endIndex)) * Math.PI / 180);}else if ("matrix"==tempStr){var tempStr=BW.substring(endIndex + 1, BW.indexOf(")", endIndex)).split(",");tempArray[0]=tempStr[0];tempArray[1]=tempStr[1];tempArray[2]=tempStr[2];tempArray[3]=tempStr[3];tempArray[4]=tempStr[4];tempArray[5]=tempStr[5];}startIndex=BW.indexOf(")", endIndex) + 1;transformReturn=this.caclCQ(transformReturn, tempArray);}return transformReturn;};CQ.prototype.AE=function(svgnode){var tempTransform="";var tempNode=svgnode.parentNode;var tempTagName=tempNode.tagName;while ("undefined" !=typeof(tempNode.tagName)){var attrmatrix=tempNode.getAttribute("transform");if(attrmatrix !=undefined){tempTransform=tempNode.getAttribute("transform") + tempTransform;}tempNode=tempNode.parentNode;tempTagName=tempNode.tagName;}var matarr=this.BB(tempTransform);return this.BN(matarr);};CQ.prototype.CD=function(svgnode){var returnStr=this.AE(svgnode);var nodemat=svgnode.getAttribute("transform");if(nodemat !=undefined){returnStr +=nodemat;}var matarr=this.BB(returnStr);return this.BN(matarr);};CQ.prototype.CO=function(BW){if(BW==undefined || BW==null){return "matrix(1,0,0,1,0,0)";}var matArr=this.BB(BW);var d=1.0 / (matArr[0]*matArr[3] - matArr[1]*matArr[2]);var tempArray=new Array();tempArray[0]=matArr[3]*d;tempArray[1]=-matArr[1]*d;tempArray[2]=-matArr[2]*d;tempArray[3]=matArr[0]*d;tempArray[4]=-matArr[4]*tempArray[0] - matArr[5]*tempArray[2];tempArray[5]=-matArr[4]*tempArray[1] - matArr[5]*tempArray[3];return this.BN(tempArray);};function CF(svgNode){this.bmousedown=false;this.bcanmove=false;this.ptmousedownX=0;this.ptmousedownY=0;this.ptmousemove=0;this.svgNode=svgNode;CF.instances.push(this);CF.prototype.InitCF=function(){this.addEventListener();};CF.prototype.addEventListener=function(){if (!CF.hasEvent){CF.hasEvent=true;document.onmousedown=CF.OnMouseDown;document.onmousemove=CF.OnMouseMove;document.onmouseup=CF.OnMouseUp;document.onmousewheel=CF.OnMouseWheel;}};CF.OnMouseDown=function(event){event.preventDefault && event.preventDefault();event.returnValue=false;event.stopPropagation && event.stopPropagation();var Inst=CF.getInstance(event);if (Inst !=null){Inst.ptmousedownX=event.clientX;Inst.ptmousedownY=event.clientY;Inst.bmousedown=true;Inst.bcanmove=false;}};CF.OnMouseMove=function(event){event.preventDefault && event.preventDefault();event.returnValue=false;event.stopPropagation && event.stopPropagation();var Inst=CF.getInstance(event);if (Inst !=null){var xdis=event.clientX - Inst.ptmousedownX;var ydis=event.clientY - Inst.ptmousedownY;if (Inst.bmousedown){if (xdis > 5 || xdis < -5 || ydis > 5 || ydis < -5){Inst.bcanmove=true;}}if (Inst.bcanmove){Inst.ptmousedownX=event.clientX;Inst.ptmousedownY=event.clientY;var width=Inst.svgNode.getAttribute("width");var height=Inst.svgNode.getAttribute("height");var viewBox=Inst.svgNode.getAttribute("viewBox");var params=viewBox.split(" ");var viewX=params[0];var viewY=params[1];var viewWidth=params[2];var viewHeight=params[3];var widthrate=viewWidth / width;var heightrate=viewHeight / height;var rate=widthrate;if (widthrate < heightrate)rate=heightrate;viewX=viewX * 1 - rate * xdis;viewY=viewY * 1 - rate * ydis;var newviewBox=viewX + " " + viewY + " " + viewWidth + " " + viewHeight;Inst.svgNode.setAttribute("viewBox", newviewBox);}}};CF.OnMouseUp=function(event){event.preventDefault && event.preventDefault();event.returnValue=false;event.stopPropagation && event.stopPropagation();var Inst=CF.getInstance(event);if (Inst !=null){Inst.bmousedown=false;Inst.bcanmove=false;}};CF.OnMouseWheel=function(event){event.preventDefault && event.preventDefault();event.returnValue=false;event.stopPropagation && event.stopPropagation();var Inst=CF.getInstance(event);if (Inst !=null) {var Delta=-1 * event.wheelDelta / 120;var width=Inst.svgNode.getAttribute("width");var height=Inst.svgNode.getAttribute("height");var viewBox=Inst.svgNode.getAttribute("viewBox");var params=viewBox.split(" ");var viewX=params[0];var viewY=params[1];var viewWidth=params[2];var viewHeight=params[3];var widthrate=viewWidth / width;var heightrate=viewHeight / height;var rate=widthrate;if (widthrate < heightrate)rate=heightrate;if (rate > 8 && Delta > 0) {Delta=0;}if (rate < 0.2 && Delta < 0) {Delta=0;}viewWidth=width * (widthrate * (1 + 0.2 * Delta));viewHeight=height * (heightrate * (1 + 0.2 * Delta));var xdis=event.clientX * widthrate * 0.2 * Delta;var ydis=event.clientY * heightrate * 0.2 * Delta;var viewX=params[0] * 1 - xdis;var viewY=params[1] * 1 - ydis;var newviewBox=viewX + " " + viewY + " " + viewWidth + " " + viewHeight;Inst.svgNode.setAttribute("viewBox", newviewBox);}};CF.getInstance=function(event){var obj=event.target;while (obj !=null && obj.nodeName !="svg"){obj=obj.parentNode;}for (var i in CF.instances){if (CF.instances[i].svgNode==obj){return CF.instances[i];}}return null;};};CF.instances=[];CF.hasEvent=false;doc_svg=document.getElementsByTagName("svg").item(0);var canmousezoom=doc_svg.getAttribute("canmousezoom");if(canmousezoom !="0"){var moveinst=new CF(doc_svg);moveinst.InitCF();};var CB=null;var tooltipobj=null;var menuobj=null;var curobj=null;var controltime=1000;function mousetimer(){controltime +=50;if(controltime > 1000){controltime=1000;}};function CG(ptx,pty){var root=document.documentElement;var width=root.getAttribute("width");var height=root.getAttribute("height");var viewBox=root.getAttribute("viewBox");var params=viewBox.split(" ");var viewX=params[0];var viewY=params[1];var viewWidth=params[2];var viewHeight=params[3];var widthrate=viewWidth / width;var heightrate=viewHeight / height;var rate=widthrate;if (widthrate < heightrate)rate=heightrate;var mat=new CQ();var pt=new Array;pt[0]=ptx;pt[1]=pty;var matstr="translate("+viewX+","+viewY+")scale("+rate+")";var newpt=mat.BY(matstr,pt);return newpt;};function AK(){if(CB !=null){if(tooltipobj !=null){tooltipobj.destory();tooltipobj=null;}var root=document.documentElement;root.removeChild(CB);CB=null;menuobj=null;curobj=null;root.removeEventListener(\'mousemove\', mousemovelistener, false);}};function mousemovelistener(event){if(CB !=null){var bbox=CB.getBBox();var newpt=CG(event.clientX,event.clientY);var newX=newpt[0];var newY=newpt[1];if(newX < bbox.x || newX > (bbox.x+bbox.width) || newY < bbox.y ||newY > (bbox.y+bbox.height)){AK();}}};function addlistener(){if(CB !=null){var root=document.documentElement;root.addEventListener(\'mousemove\', mousemovelistener, false);}};function gethoverobject(obj){var retobj=null;while (obj){var val=obj.getAttribute("onmousemove");if(val=="svgmousemove(evt)"){retobj=obj;break;}obj=obj.parentNode;}return retobj;};function svgcreatehoverobj(obj){if(CB !=null)return;var root=document.documentElement;var box=new Bbox();box.CL(obj);CB=document.createElementNS("http://www.w3.org/2000/svg", "g");CC=document.createElementNS("http://www.w3.org/2000/svg", "rect");CC.setAttribute("stroke", "#E5C364");CC.setAttribute("stroke-width","2");CC.setAttribute("fill-opacity","0");CC.setAttribute("visibility","visible");CC.setAttribute("x",box.CY);CC.setAttribute("y",box.DA);CC.setAttribute("width",box.DB-box.CY);CC.setAttribute("height",box.DC-box.DA);CB.appendChild(CC);CB.setAttribute("visibility","visible");var tuyea85=obj.getAttribute("tuyea85");if (tuyea85 !="" && tuyea85 !=null){CC.setAttribute("tuyea85", tuyea85);}var tuyea81=obj.getAttribute("tuyea81");if(tuyea81 !="" && tuyea81 !=null){CC.setAttribute("tuyea81",tuyea81);}var tuyea82=obj.getAttribute("tuyea82");if(tuyea82 !="" && tuyea82 !=null){CC.setAttribute("tuyea82",tuyea82);}var tuyea83=obj.getAttribute("tuyea83");if(tuyea83 !="" && tuyea83 !=null){CC.setAttribute("tuyea83",tuyea83);}var tuyea84=obj.getAttribute("tuyea84");if (tuyea84 !="" && tuyea84 !=null){CC.setAttribute("tuyea84", tuyea84);}var tuyea86=obj.getAttribute("tuyea86");if(tuyea86 !="" && tuyea86 !=null){CC.setAttribute("tuyea86", tuyea86);}var tuyea87=obj.getAttribute("tuyea87");if(tuyea87 !="" && tuyea87 !=null){CC.setAttribute("tuyea87", tuyea87);}var tuyea88=obj.getAttribute("tuyea88");if(tuyea88 !="" && tuyea88 !=null){CC.setAttribute("tuyea88", tuyea88);}CC.setAttribute("onclick", "svgclickevent(evt)");framea=document.createElementNS("http://www.w3.org/2000/svg", "a");framea.setAttribute("xlink:href","");CB.setAttribute("style","cursor:pointer");CB.appendChild(framea);root.appendChild(CB);addlistener();return CB;};function menuitemhover(evt){if(evt.target.tagName=="text"){var itemname=evt.target.getAttribute("name");var parentNode=evt.target.parentNode;for(var i=0; i < parentNode.childNodes.length; ++i){if(parentNode.childNodes[i].tagName=="rect"){if(parentNode.childNodes[i].getAttribute("name")==itemname){parentNode.childNodes[i].setAttribute("fill","#91C9F7");}}}}else{evt.target.setAttribute("fill","#91C9F7");}};function menuitemouseout(evt){if(evt.target.tagName=="text"){var itemname=evt.target.getAttribute("name");var parentNode=evt.target.parentNode;for(var i=0; i < parentNode.childNodes.length; ++i){if(parentNode.childNodes[i].tagName=="rect"){if(parentNode.childNodes[i].getAttribute("name")==itemname){parentNode.childNodes[i].setAttribute("fill","#F2F2F2");}}}}else{evt.target.setAttribute("fill","#F2F2F2");}};function AT(obj,clientX,clientY){if(CB==null){svgcreatehoverobj(obj);}var box=new Bbox();box.CL(obj);CC=document.createElementNS("http://www.w3.org/2000/svg", "rect");CC.setAttribute("stroke", "#CCCCCC");CC.setAttribute("fill", "#F2F2F2");CC.setAttribute("stroke-width","1");CC.setAttribute("fill-opacity","1");CC.setAttribute("visibility","visible");menuobj=CC;var newpt=CG(clientX,clientY);var newX=newpt[0];var newY=newpt[1];CC.setAttribute("x",newX);CC.setAttribute("y",newY);CC.setAttribute("width",20);CC.setAttribute("height",20);CB.appendChild(CC);var tuyea81s=obj.getAttribute("tuyea81");var tuyea82s=obj.getAttribute("tuyea82");var tuyea83=obj.getAttribute("tuyea83");if(tuyea81s !=null && tuyea81s !=undefined){var arrbkrc=new Array();var newwidth=20;var arrtuyea81=tuyea81s.split(\';\');var arrtuyea82=tuyea82s.split(\';\');var arropenmode=tuyea83.split(\';\');if(arrtuyea81.length !=arrtuyea82.length)return;for(var i=0; i < arrtuyea81.length; ++i){var backrect=document.createElementNS("http://www.w3.org/2000/svg", "rect");backrect.setAttribute("fill","#F2F2F2");backrect.setAttribute("fill-opacity","1");backrect.setAttribute("name",i);backrect.setAttribute("onmouseover","menuitemhover(evt)");backrect.setAttribute("onmouseout","menuitemouseout(evt)");backrect.setAttribute("onclick","svgclickevent(evt)");backrect.setAttribute("tuyea84",arrtuyea82[i]);backrect.setAttribute("openfilemode",arropenmode[i]);CB.appendChild(backrect);var txt=document.createElementNS("http://www.w3.org/2000/svg", "text");txt.setAttribute("name",i);txt.setAttribute("x", newX+10);txt.setAttribute("y", newY+20*(i+1));txt.setAttribute("fill","#000000");txt.setAttribute("stroke","#FF0000");txt.setAttribute("stroke-opacity","0");txt.setAttribute("fill-opacity","1");txt.setAttribute("onmouseover","menuitemhover(evt)");txt.setAttribute("onmouseout","menuitemouseout(evt)");txt.setAttribute("onclick","svgclickevent(evt)");txt.setAttribute("tuyea84",arrtuyea82[i]);txt.setAttribute("openfilemode",arropenmode[i]);txt.textContent=arrtuyea81[i];var root=document.documentElement;root.appendChild(txt);var bbox=txt.getBBox();if(newwidth < bbox.width){newwidth=bbox.width;}root.removeChild(txt);CB.appendChild(txt);backrect.setAttribute("x",bbox.x-5);backrect.setAttribute("y",bbox.y);backrect.setAttribute("width",bbox.width);backrect.setAttribute("height",bbox.height);arrbkrc.push(backrect);CC.setAttribute("height",10+20*(i+1));CC.setAttribute("width",newwidth+20);}for(var i=0; i  <arrbkrc.length;++i){arrbkrc[i].setAttribute("width",newwidth+10);}}CB.setAttribute("visibility","visible");CB.setAttribute("linknode","linknode");};function svgmousemove(evt){var obj=gethoverobject(evt.target);if(obj==curobj){return;}curobj=obj;var CB=svgcreatehoverobj(obj);var tuyea79=evt.target.getAttribute("tuyea79");if(tuyea79 !=null && tuyea79 !=undefined && tuyea79 !=""){tooltipobj=new AO(CB,evt.target,"tuyea78");}};function AQ(obj){var BH=new BJ();var CH={};CH["url"]=\'getdata.php\'+"?cookie=mycookie";var subParam={control:[]};var ctrlvar=obj.getAttribute("tuyea86");var type=obj.getAttribute("tuyea87");var val=obj.getAttribute("tuyea88");if(ctrlvar==null || ctrlvar==undefined){ctrlvar="{undefined}";}if(type==null || type==undefined){type="SWITCH";}if(val==null || val==undefined){val="0";}var start=ctrlvar.indexOf("{",start);var end=ctrlvar.indexOf("}",start);if(start >=0 && end > start){ctrlvar=ctrlvar.substring(start+1,end);}subParam["control"].push(type);subParam["control"].push(ctrlvar);subParam["control"].push(val);CH["data"]=subParam;CH["success"]=function(http){};CH["error"]=function(http){};BH.request(CH);};function svgclickevent(evt){var filename=evt.target.getAttribute("tuyea84");var tuyea85=evt.target.getAttribute("tuyea85");if (tuyea85==null || tuyea85=="")return;var url=filename;var obj=evt.target;var clientX=evt.clientX;var clientY=evt.clientY;if (tuyea85=="replace"){AK();window.location=url;}else if(tuyea85=="popup"){AK();window.open(url,"","width=512,height=360,toolbar=no,menubar=no,resizable=no,location=no, status=no,scrollbars=no");}else if(tuyea85=="menu"){if(menuobj==null){AT(obj,clientX,clientY);}}else if(tuyea85=="control"){if(controltime >=200){controltime=0;AQ(obj);}}};window.addEventListener("OnMouseWheel",{passive: true })';
                    $("svg").append(scriptZoomIn);
                    let color = $("svg").css('background-color');
                    $svgDiv.css('background-color', color);
                } else {
                    $svgDiv.css("font-size", "30px");
                    $svgDiv.css("text-align", "center");
                    let height = $(window).height() - 10;
                    let iHeight = height;
                    $svgDiv.css("height", iHeight);
                    $svgDiv.css("line-height", iHeight);
                    $svgDiv.html(decodeURIComponent(data.message));
                }
            }
        })
    }

    //获取暂降敏感点数据
    function getSensitivePointData() {
        $.ajax({
            url: '/pqs9200/svg/getAllCalucateInfo',
            type: 'post',
            dataType: 'json',
            success: function (data) {
                init(data.body);
            }
        })
    }


    //渲染表格
    function init(data) {
        $("#sensitivePoint").DataTable({
            data: data,
            autoWidth: false,
            order: [],
            columnDefs: [{
                "width": "20%",
                "targets": 0
            }, {
                "width": "12%",
                "targets": 1
            }, {
                "width": "12%",
                "targets": 2
            }, {
                "width": "28%",
                "targets": 3
            }, {
                "width": "28%",
                "targets": 4
            }],
            paging: false,
            lengthChange: false,
            searching: false,
            destroy: true,
            scrollY: picHeight-35,
            info: false,
            pageLength: 100,
            language: {
                url: '/pqs9200/json/chine.json',
            },
            columns: [{
                data: 'cellName'
            }, {
                data: 'amplitude',
            }, {
                data: 'descentType'
            }, {
                data: 'timeId'
            }],
            columnDefs : [ {
                //操作按钮目标列
                "targets" : 4,
                "data" : null,
                "render" : function(data, type, row) {
                    id = '"' + row.calucateIndex + '"';
                    let html = "<a href='javascript:void(0);'   onclick='showSensitivePoint("+ id + ")' class='btn btn-default btn-xs'  ><i class='fa fa-search'></i> 查看</a>"
                    html += "<a href='javascript:void(0);'   onclick='deleteSensitivePoint("+ id + ")'  class='delete btn btn-default btn-xs'><i class='fa fa-times'></i> 删除</a>"
                    return html;
                }
            } ],
        })
    }

    //展示暂降敏感点svg图
    function showSensitivePoint(id) {
        svgIndex = id;
        loadSvg(id);
    }

    //删除暂降敏感点svg图
    function deleteSensitivePoint(id) {
        let openIndex;
        openIndex = layer.confirm('确定删除？', function (index) {
            $.ajax({
                type: "POST",
                url: "/pqs9200/svg/deleteCalucateInfo",
                dataType: "json",
                data: {
                    index: id
                },
                success: function (data) {
                    if (data.code === 200){
                        layer.msg('删除成功', {icon: 6, time: 3000});
                        layer.close(openIndex);
                        getSensitivePointData();
                        svgIndex = 'sagDomain';
                        loadSvg(svgIndex);
                    } else {
                        layer.msg('删除失败', {icon: 5, time: 3000});
                        layer.close(openIndex);
                    }
                }
            });

        })
    }

</script>
</body>
</html>