用javascript在client端create、open、edit、save文件完全代码

来源:互联网 发布:mac 显示图片尺寸 编辑:程序博客网 时间:2024/05/22 12:55

 <%@ Page Language="C#" MasterPageFile="~/FMA.master" AutoEventWireup="true" CodeFile="Fixed_Point_Mapping.aspx.cs" Inherits="Fixed_Point_Mapping" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPHMainZone" Runat="Server">
    <table width="20">
        <tr>
            <td style="vertical-align: top; width: 23px;">
                <div style="width: 20px; height: 250px">
                </div>
                <table id="tblInputIndex" style="border-top-width: thin; border-left-width: thin; border-bottom-width: thin; border-right-width: thin">
                    <tr id="trInputIndex">
                        <td style="width: 100px; height: 24px;">
                            NO.</td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div1" style="width: 20px; height: 20px">
                                1</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div2" style="width: 20px; height: 20px">
                                2</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div3" style="width: 20px; height: 20px">
                            3</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div4" style="width: 20px; height: 20px">
                             4</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div5" style="width: 20px; height: 20px">
                             5</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div6" style="width: 20px; height: 20px">
                             6</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div7" style="width: 20px; height: 20px">
                             7</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px">
                            <div id="div8" style="width: 20px; height: 20px">
                             8</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div9" style="width: 20px; height: 20px">
                             9</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div10" style="width: 20px; height: 20px">
                             10</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div11" style="width: 20px; height: 20px">
                             11</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div12" style="width: 20px; height: 20px">
                             12</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div13" style="width: 20px; height: 20px">
                             13</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div14" style="width: 20px; height: 20px">
                             14</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div15" style="width: 20px; height: 20px">
                             15</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div16" style="width: 20px; height: 20px">
                             16</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div17" style="width: 20px; height: 20px">
                             17</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div18" style="width: 20px; height: 20px">
                             18</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div19" style="width: 20px; height: 20px">
                             19</div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; height: 24px;">
                            <div id="div20" style="width: 20px; height: 20px">
                             20</div>
                        </td>
                    </tr>
                </table>
            </td>
            <td style="width: 100px">

    <table>
        <tr>
            <td colspan="5" style="text-align: center; height: 72px;">
                <asp:Label ID="lblReportName" runat="server" BackColor="Transparent" Font-Bold="True"
                    Font-Size="20pt" ForeColor="Red" Text="Fixed Points Mapping"></asp:Label>
                <div style="width: 100px; height: 20px; font-size: 12pt;">
                </div>
            </td>
        </tr>
        <tr style="font-size: 12pt">
            <td>
                Product Type:</td>
            <td colspan="3">
                <asp:DropDownList ID="ddlProductType" runat="server" Width="300px">
                    <asp:ListItem Selected="True">Please Select Product Type</asp:ListItem>
                    <asp:ListItem Value="1200*1300">1200*1300</asp:ListItem>
                    <asp:ListItem>1100*1300</asp:ListItem>
                </asp:DropDownList></td>
            <td>
            </td>
        </tr>
        <tr style="font-size: 12pt">
            <td>
                Product:</td>
            <td colspan="3">
                <asp:UpdatePanel id="upProID" runat="server" UpdateMode="Conditional">
                    <contenttemplate>
<asp:DropDownList id="ddlProductId" runat="server" Width="300px" AutoPostBack="True" OnSelectedIndexChanged="ddlProductId_SelectedIndexChanged" onchange="createClientFile(clientFilePath,this.value,serverSVGFilePath,fileSVGType,speToTFT);createClientFile(clientFilePath,this.value,serverSVGFilePath,fileSVGType,speToCF);createClientFile(clientFilePath,this.value,serverXMLFilePath,fileXMLType,speToOrigin);showSVGChart('DivSvgContainerTFT',fileSVGClientPath);showSVGChart('DivSvgContainerCF',fileSVGCFClientPath)" OnDataBinding="ddlProductId_DataBinding"><asp:ListItem Value="0"></asp:ListItem>
<asp:ListItem>1</asp:ListItem>
</asp:DropDownList>
</contenttemplate>
                </asp:UpdatePanel>
            </td>
            <td>
            </td>
        </tr>
        <tr style="font-size: 12pt">
            <td>
                Mapping By:</td>
            <td colspan="3">
                <asp:RadioButtonList ID="rblChartType" runat="server" onclick="chartType(this.id)"
                    RepeatDirection="Horizontal">
                    <asp:ListItem>Fixed Point Mapping</asp:ListItem>
                    <asp:ListItem>Fixed Line Mapping</asp:ListItem>
                </asp:RadioButtonList></td>
            <td>
            </td>
        </tr>
        <tr style="font-size: 12pt">
            <td>
                Mapping By:</td>
            <td colspan="3">
                <asp:RadioButtonList ID="rblMappingBy" runat="server" onclick="mappingBy(this.id)"
                    RepeatDirection="Horizontal" Width="284px">
                    <asp:ListItem>TFT</asp:ListItem>
                    <asp:ListItem>CF</asp:ListItem>
                </asp:RadioButtonList></td>
            <td>
            </td>
        </tr>
        <tr style="font-size: 12pt">
            <td style="border-right: black 1px solid; border-top: black 1px solid; vertical-align: top; border-left: black 1px solid; border-bottom: black 1px solid; text-align: right;" colspan="2">
                <table style="text-align: center; height: 25px;" id="tblTFTFixPoint">
                    <tr>
                        <td colspan="3" style="width: 194px; height: 24px">
                            Panel Point</td>
                        <td colspan="2" style="width: 194px; height: 24px">
                            Combine/TFT</td>
                    </tr>
                    <tr>
                        <td colspan="3" style="width: 194px; height: 24px">
                            Fix Point(Point,mm)</td>
                        <td colspan="2" style="width: 194px; height: 24px">
                            Fix Point(mm)</td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px">
                            Loc</td>
                        <td style="width: 194px; height: 24px;">
                            X</td>
                        <td style="width: 194px; height: 24px">
                            Y</td>
                        <td style="width: 194px; height: 24px;">
                            X</td>
                        <td style="width: 194px; height: 24px" >
                            Y</td>
                    </tr>
                    <tr id="trTFTFixPoint">
                        <td style="width: 194px; height: 24px">
                            <input id="Text1" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text4','Text101');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text4','Text5');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text101','Text102')" /></td>
                        <td style="width: 194px; height: 24px">
                            <input id="Text2" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text4','Text101');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text4','Text5');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text101','Text102')"/></td>
                        <td style="width: 194px; height: 24px">
                            <input id="Text3" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text4','Text101');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text4','Text5');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text101','Text102')" /></td>
                        <td style="width: 194px; height: 24px">
                            <input id="Text4" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px">
                            <input id="Text5" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px">
                            <input id="Text6" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text9','Text103');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text9','Text10');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text103','Text104')"/></td>
                        <td style="width: 194px; height: 24px;">
                            <input id="Text7" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text9','Text103');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text9','Text10');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text103','Text104')"/></td>
                        <td style="width: 194px; height: 24px">
                            <input id="Text8" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text9','Text103');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text9','Text10');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text103','Text104')"/></td>
                        <td style="width: 194px; height: 24px;">
                            <input id="Text9" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px">
                            <input id="Text10" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px"><input id="Text11" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text14','Text105');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text14','Text15');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text105','Text106')"/></td>
                        <td style="width: 194px; height: 24px;"><input id="Text12" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text14','Text105');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text14','Text15');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text105','Text106')"/></td>
                        <td style="width: 194px; height: 24px"><input id="Text13" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text14','Text105');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text14','Text15');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text105','Text106')"/></td>
                        <td style="width: 194px; height: 24px;"><input id="Text14" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px"><input id="Text15" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px" ><input id="Text16" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text19','Text107');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text19','Text20');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text107','Text108')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text17" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text19','Text107');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text19','Text20');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text107','Text108')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text18" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text19','Text107');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text19','Text20');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text107','Text108')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text19" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px" ><input id="Text20" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px"><input id="Text21" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text24','Text109');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text24','Text25');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text109','Text110')"/></td>
                        <td style="width: 194px; height: 24px;"><input id="Text22" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text24','Text109');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text24','Text25');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text109','Text110')"/></td>
                        <td style="width: 194px; height: 24px"><input id="Text23" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text24','Text109');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text24','Text25');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text109','Text110')"/></td>
                        <td style="width: 194px; height: 24px;"><input id="Text24" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px" ><input id="Text25" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px"><input id="Text26" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text29','Text111');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text29','Text30');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text111','Text112')"/></td>
                        <td style="width: 194px; height: 24px;"><input id="Text27" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text29','Text111');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text29','Text30');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text111','Text112')"/></td>
                        <td style="width: 194px; height: 24px"><input id="Text28" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text29','Text111');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text29','Text30');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text111','Text112')"/></td>
                        <td style="width: 194px; height: 24px;"><input id="Text29" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px" ><input id="Text30" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px"><input id="Text31" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text34','Text113');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text34','Text35');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text113','Text114')" /></td>
                        <td style="width: 194px; height: 24px;"><input id="Text32" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text34','Text113');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text34','Text35');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text113','Text114')"/></td>
                        <td style="width: 194px; height: 24px"><input id="Text33" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text34','Text113');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text34','Text35');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text113','Text114')"/></td>
                        <td style="width: 194px; height: 24px;"><input id="Text34" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px" ><input id="Text35" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px"><input id="Text36" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text39','Text115');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text39','Text40');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text115','Text116')" /></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text37" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text39','Text115');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text39','Text40');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text115','Text116')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text38" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text39','Text115');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text39','Text40');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text115','Text116')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text39" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px"  ><input id="Text40" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px" ><input id="Text41" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text44','Text117');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text44','Text45');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text117','Text118')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text42" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text44','Text117');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text44','Text45');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text117','Text118')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text43" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text44','Text117');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text44','Text45');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text117','Text118')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text44" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px"  ><input id="Text45" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px"  ><input id="Text46" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text49','Text119');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text49','Text50');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text119','Text120')"/></td>
                        <td style="width: 194px; height: 24px;"  ><input id="Text47" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text49','Text119');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text49','Text50');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text119','Text120')"/></td>
                        <td style="width: 194px; height: 24px"  ><input id="Text48" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text49','Text119');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text49','Text50');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text119','Text120')"/></td>
                        <td style="width: 194px; height: 24px;"  ><input id="Text49" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px"  ><input id="Text50" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px" ><input id="Text51" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text54','Text121');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text54','Text55');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text121','Text122')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text52" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text54','Text121');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text54','Text55');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text121','Text122')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text53" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text54','Text121');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text54','Text55');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text121','Text122')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text54" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px" ><input id="Text55" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px" ><input id="Text56" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text59','Text123');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text59','Text60');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text123','Text124')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text57" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text59','Text123');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text59','Text60');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text123','Text124')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text58" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text59','Text123');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text59','Text60');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text123','Text124')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text59" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px"  ><input id="Text60" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px" ><input id="Text61" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text64','Text125');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text64','Text65');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text125','Text126')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text62" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text64','Text125');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text64','Text65');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text125','Text126')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text63" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text64','Text125');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text64','Text65');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text125','Text126')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text64" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px"  ><input id="Text65" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px" ><input id="Text66" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text69','Text127');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text69','Text70');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text127','Text128')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text67" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text69','Text127');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text69','Text70');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text127','Text128')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text68" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text69','Text127');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text69','Text70');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text127','Text128')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text69" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px"  ><input id="Text70" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px" ><input id="Text71" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text74','Text129');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text74','Text75');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text129','Text130')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text72" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text74','Text129');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text74','Text75');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text129','Text130')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text73" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text74','Text129');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text74','Text75');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text129','Text130')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text74" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px"  ><input id="Text75" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px" ><input id="Text76" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text79','Text131');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text79','Text80');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text131','Text132')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text77" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text79','Text131');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text79','Text80');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text131','Text132')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text78" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text79','Text131');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text79','Text80');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text131','Text132')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text79" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px" ><input id="Text80" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px" ><input id="Text81" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text84','Text133');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text84','Text85');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text133','Text134')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text82" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text84','Text133');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text84','Text85');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text133','Text134')"/></td>
                        <td style="width: 194px; height: 24px" ><input id="Text83" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text84','Text133');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text84','Text85');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text133','Text134')"/></td>
                        <td style="width: 194px; height: 24px;" ><input id="Text84" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px"  ><input id="Text85" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px">
                            <input id="Text86" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text89','Text135');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text89','Text90');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text135','Text136')"/></td>
                        <td style="width: 194px; height: 24px;">
                            <input id="Text87" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text89','Text135');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text89','Text90');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text135','Text136')"/></td>
                        <td style="width: 194px; height: 24px">
                            <input id="Text88" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text89','Text135');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text89','Text90');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text135','Text136')"/></td>
                        <td style="width: 194px; height: 24px;">
                            <input id="Text89" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px" >
                            <input id="Text90" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px">
                            <input id="Text91" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text94','Text137');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text94','Text95');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text137','Text138')" /></td>
                        <td style="width: 194px; height: 24px;">
                            <input id="Text92" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text94','Text137');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text94','Text95');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text137','Text138')"/></td>
                        <td style="width: 194px; height: 24px">
                            <input id="Text93" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text94','Text137');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text94','Text95');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text137','Text138')"/></td>
                        <td style="width: 194px; height: 24px;">
                            <input id="Text94" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px" >
                            <input id="Text95" size="5" type="text" /></td>
                    </tr>
                    <tr>
                        <td style="width: 194px; height: 24px">
                            <input id="Text96" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text99','Text139');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text99','Text100');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text139','Text140')"/></td>
                        <td style="width: 194px; height: 24px;">
                            <input id="Text97" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text99','Text139');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text99','Text100');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text139','Text140')"/></td>
                        <td style="width: 194px; height: 24px">
                            <input id="Text98" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text99','Text139');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text99','Text100');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text139','Text140')"/></td>
                        <td style="width: 194px; height: 24px;">
                            <input id="Text99" size="5" type="text" /></td>
                        <td style="width: 194px; height: 24px" >
                            <input id="Text100" size="5" type="text" /></td>
                    </tr>
                </table>
                &nbsp;
                <input id="ButtonMore" type="button" value="More..." language="javascript" onclick="return ButtonMore_onclick()" /></td>
            <td style="vertical-align: top; border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid;">
                <div style="width: 100px; height: 100px" id="Div1"> </div><div style="width: 100px; height: 100px" id="DivSvgContainerTFT">
                </div>
                            </td>
            <td style="border-right: black 1px solid; border-top: black 1px solid; vertical-align: top; border-left: black 1px solid; border-bottom: black 1px solid;">
            <table style="text-align: center" id="tblCFFixPoint">
                <tr>
                    <td colspan="2" style="height: 24px">
                        Combine/CF</td>
                </tr>
                <tr>
                    <td colspan="2" style="height: 24px">
                        Fix Point(mm)</td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        X</td>
                    <td style="height: 24px" >
                        Y</td>
                </tr>
                <tr id="trCFFixPoint">
                    <td style="height: 24px">
                        <input id="Text101" size="5" type="text" /></td>
                    <td style="height: 24px">
                        <input id="Text102" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        <input id="Text103" size="5" type="text" /></td>
                    <td style="height: 24px">
                        <input id="Text104" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        <input id="Text105" size="5" type="text" /></td>
                    <td style="height: 24px" >
                        <input id="Text106" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text107" size="5" type="text" /></td>
                    <td style="height: 24px" >
                        <input id="Text108" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 22px">
                        <input id="Text109" size="5" type="text" /></td>
                    <td style="height: 22px" >
                        <input id="Text110" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        <input id="Text111" size="5" type="text" /></td>
                    <td style="height: 24px" >
                        <input id="Text112" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        <input id="Text113" size="5" type="text" /></td>
                    <td style="height: 24px" >
                        <input id="Text114" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text115" size="5" type="text" /></td>
                    <td style="height: 24px"  >
                        <input id="Text116" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text117" size="5" type="text" /></td>
                    <td style="height: 24px"  >
                        <input id="Text118" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px"  >
                        <input id="Text119" size="5" type="text" /></td>
                    <td style="height: 24px" >
                        <input id="Text120" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text121" size="5" type="text" /></td>
                    <td style="height: 24px"  >
                        <input id="Text122" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text123" size="5" type="text" /></td>
                    <td style="height: 24px"  >
                        <input id="Text124" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text125" size="5" type="text" /></td>
                    <td style="height: 24px"  >
                        <input id="Text126" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text127" size="5" type="text" /></td>
                    <td style="height: 24px"  >
                        <input id="Text128" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text129" size="5" type="text" /></td>
                    <td style="height: 24px"  >
                        <input id="Text130" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text131" size="5" type="text" /></td>
                    <td style="height: 24px" >
                        <input id="Text132" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px" >
                        <input id="Text133" size="5" type="text" /></td>
                    <td style="height: 24px"  >
                        <input id="Text134" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        <input id="Text135" size="5" type="text" /></td>
                    <td style="height: 24px" >
                        <input id="Text136" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        <input id="Text137" size="5" type="text" /></td>
                    <td style="height: 24px" >
                        <input id="Text138" size="5" type="text" /></td>
                </tr>
                <tr>
                    <td style="height: 24px">
                        <input id="Text139" size="5" type="text" /></td>
                    <td style="height: 24px" >
                        <input id="Text140" size="5" type="text" /></td>
                </tr>
            </table>
            </td>
            <td style="vertical-align: top; border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid;" id="svgContainerCF"><div style="height: 100px">
            </div><div style="width: 100px; height: 100px" id="divSvgContainerCF">
            </div>
            </td>
        </tr>
        <tr style="font-size: 12pt">
            <td colspan="5">
                Range(mm):
                <input id="txtRange" style="width: 50px" type="text" /></td>
        </tr>
        <tr style="font-size: 12pt">
            <td colspan="5" style="text-align: right; vertical-align: top;">
                &nbsp;<asp:UpdatePanel id="UpdatePanel1" runat="server" UpdateMode="Conditional">
                    <contenttemplate>
                <asp:Button ID="btnEQPUnitMapping" runat="server" Text="EQP Unit Mapping" OnClientClick="mappingContInRange()" />
</contenttemplate>
                </asp:UpdatePanel></td>
        </tr>
        <tr style="font-size: 12pt">
            <td colspan="5" style="height: 23px; text-align: left">
                <cc1:tabcontainer id="TabContainer1" runat="server" activetabindex="0"><cc1:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1"><ContentTemplate>
&nbsp;<DIV style="OVERFLOW: auto; WIDTH: 800px; HEIGHT: 200px" id="divEQPUnitMappingResult1"><TABLE id="tblEQPUnitMappintResult1" width=800 border=1><TBODY><TR id="tblEQPUnitMappingResult1Tr"><TD style="WIDTH: 100px; TEXT-ALIGN: center">NO.</TD>
    <td style="width: 100px; text-align: center">
        Shop</td>
    <TD style="WIDTH: 100px; TEXT-ALIGN: center">Line</TD><TD style="WIDTH: 100px; TEXT-ALIGN: center">EQP</TD><TD style="WIDTH: 100px; TEXT-ALIGN: center">Type</TD><TD style="WIDTH: 100px; TEXT-ALIGN: center">与异常点距离(mm)</TD></TR></TBODY></TABLE></DIV><DIV style="WIDTH: 700px; HEIGHT: 20px"></DIV>&nbsp;&nbsp; <DIV style="OVERFLOW: auto; WIDTH: 800px; HEIGHT: 200px" id="divEQPUnitMappingResult2"><TABLE id="tblEQPUnitMappintResult2" width=800 border=1><TBODY><TR id="tblEQPUnitMappingResult2Tr">
        <td style="width: 100px; text-align: center">
            Shop</td>
        <TD style="WIDTH: 100px; TEXT-ALIGN: center">Line</TD><TD style="WIDTH: 100px; TEXT-ALIGN: center">EQP</TD><TD style="WIDTH: 100px; TEXT-ALIGN: center">Type</TD><TD style="WIDTH: 100px; TEXT-ALIGN: center">与异常点距离(mm)</TD><TD style="WIDTH: 100px; TEXT-ALIGN: center">命中点数</TD><TD style="WIDTH: 100px; TEXT-ALIGN: center">命中率(%)</TD></TR></TBODY></TABLE></DIV>
</ContentTemplate>
<HeaderTemplate>
EQP Unit Mapping Result
</HeaderTemplate>
</cc1:TabPanel>
</cc1:tabcontainer>
            </td>
        </tr>
    </table>
            </td>
        </tr>
    </table>

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
<! METADATA TYPE="typelib" FILE="C:WinNTSystem32scrrun.dll">

<script language="javascript" type="text/javascript">
{
var btnClickCnt=0;
var fileName=null;
var targerFilePath=null;
var xmlFilePath=null;
var filePath=null;
var serverSVGFilePath="SVGFile/";
var serverXMLFilePath="XMLFile/";
var clientFilePath="y://public//TMP//";
var clientFilePath1="y:////public////TMP////";
var fileSVGType=".svg";
var fileXMLType=".xml";
var speToTFT="TFT";
var speToCF="CF";
var speToOrigin="Origin";
var speToCFOrigin="CFOrigin";
var speToProContact="Contact";
var fileSVGClientPath=null;
var fileSVGClientPath1=null;
var fileSVGCFClientPath=null;
var fileSVGCFClientPath1=null;
var fileXMLClientPath=null;
var fileXMLCFClientPath=null;
var fileXMLProCotRefPath=null;
var chartTypeValue=null;
var chartTypePoint="Fixed Point Mapping";
var chartTypeLine="Fixed Line Mapping";
var mappingByValue=null;
var mappingByValueTFT="TFT";
var mappingByValueCF="CF";

function ButtonMore_onclick()
{
    btnClickCnt++;
    var tblTFTFixPoint=document.getElementById("tblTFTFixPoint");
    var trTFTFixPoint=document.getElementById("trTFTFixPoint");
    var tblCFFixPoint=document.getElementById ("tblCFFixPoint");
    var trCFFixPoint=document.getElementById("trCFFixPoint");
    var tblInputIndex=document.getElementById("tblInputIndex");
    var trInputIndex=document.getElementById("trInputIndex");
    CreateTable(140*btnClickCnt,tblTFTFixPoint,trTFTFixPoint);
    CreateTable(140*btnClickCnt+100,tblCFFixPoint,trCFFixPoint);
    CreateTableWithDiv(20*btnClickCnt,tblInputIndex,trInputIndex);
}
function CreateTableWithDiv(idStart,table,tr)
{
    table.setAttribute("border",1);
    var id=idStart;
    var rowIndex=-1;
    for(var i=0;i<20;i++)
    {
        var tr1=table.insertRow(table.rows.length);
        rowIndex++;
        for(var j=0;j<tr.cells.length;j++)
        {
            id++;
            var cell=tr1.insertCell();
            cell.setAttribute("border",1);
            cell.setAttribute("height",24);
            //cell.align="center";
            var divId="div"+id;
            var divValue=divId.substring(3);
            cell.innerHTML="<div id='"+divId+"' style='width: 20px; height: 20px'>"+divValue+"</div>";
        }
    }
}
function ReadControlValueInTable(table)
{
    var valueArr=new Array();
    for(var i=3;i<table.rows.length;i++)
    {
         //alert(i);
        var row=table.rows[i];
        for(var j=0;j<1;j++)
        {
            var id=row.cells[j].firstChild.id;
            var idSerice=id.substring(4);
            var text=document.getElementById(id);
            if(text.value.length>0)
            {
                var xId=null;
                var yId=null;
                var chartType=null;
                var asixType=null;
                var txtX="Text"+(Number(idSerice)+1);
                var txtY="Text"+(Number(idSerice)+2);
                var txtXValue=(document.getElementById(txtX)).value;
                var txtYValue=(document.getElementById(txtY)).value;
                if(txtXValue=="-" ||txtYValue=="-")
                {
                    chartType=chartTypeLine;
                    if(txtXValue=="-" && txtYValue!="-")
                    {
                        asixType="X";
                    }
                    else
                    {
                        asixType="Y";
                    }
                }
                else
                {
                    chartType=chartTypePoint;
                }
                if(mappingByValue==mappingByValueTFT)
                {
                    xId="Text"+(Number(idSerice)+3);
                    yId="Text"+(Number(idSerice)+4);
                }
                else if(mappingByValue==mappingByValueCF)
                {
                    xId="Text"+(Number(idSerice)+99-(i-3)*3+1);
                    yId="Text"+(Number(idSerice)+99-(i-3)*3+2);
                }
                var rowNo=i-3+1;
                var xValue=(document.getElementById(xId)).value;
                var yValue=(document.getElementById(yId)).value;
                var valueList={};
                valueList.num=rowNo;
                valueList.chartType=chartType;
                valueList.asixType=asixType;
                valueList.xValue=xValue;
                valueList.yValue=yValue;
                valueArr.push(valueList);
            }
        }
    }
    return valueArr;
}
function CreateTable(idStart,table,tr)
{
    table.setAttribute("border",1);
    var id=idStart;
    var txtId=null;
    var rowIndex=-1;
    for(var i=0;i<20;i++)
    {
        var tr1=table.insertRow(table.rows.length);
        rowIndex++;
        for(var j=0;j<tr.cells.length;j++)
        {
            id++;
            var cell=tr1.insertCell();
            cell.setAttribute("border",1);
            cell.setAttribute("width",24);
            cell.align="center";
            //cell.style.background="#7596C6";
            //cell.height=21;
            //cell.width=50;
            var txtId="Text"+id;
            var str=txtId.slice(-1);
           
            //alert(txtPar1+txtPar2+txtPar3+txtPar4);
            if(str=="1" || str=="6")
            {
                //cell.innerHTML="<input type='text' id='"+txtId+"' size='5'>";
                var txtPar1="Text"+(id+3);
                var txtPar2="Text"+(id+99-3*rowIndex+1);
                var txtPar3="Text"+(id+4);
                var txtPar4="Text"+(id+99-3*rowIndex+2);
                cell.innerHTML="<input type='text' id='"+txtId+"' size='5'  onblur=valueParser('"+speToTFT+"','"+speToCF+"',this.id,'"+txtPar1+"','"+txtPar2+"');drawSvgChart('"+speToTFT+"','"+fileSVGClientPath1+"',this.id,'"+txtPar1+"','"+txtPar3+"');drawSvgChart('"+speToCF+"','"+fileSVGCFClientPath1+"',this.id,'"+txtPar2+"','"+txtPar4+"')>";
                //<input id="Text1" size="5" type="text" onblur="valueParser(speToTFT,speToCF,this.id,'Text4','Text101');drawSvgChart('TFT',fileSVGClientPath,this.id,'Text4','Text5');drawSvgChart('CF',fileSVGCFClientPath,this.id,'Text101','Text102')" /></td>
            }
            else if(str=="2" || str=="7")
            {
                //用轉換式mapping Text的onblur()事件的控件
                var txtPar1="Text"+(id+2);
                var txtPar2="Text"+(id+99-3*rowIndex);
                var txtPar3="Text"+(id+3);
                var txtPar4="Text"+(id+99-3*rowIndex+1);
                cell.innerHTML="<input type='text' id='"+txtId+"' size='5'  onblur=valueParser('"+speToTFT+"','"+speToCF+"',this.id,'"+txtPar1+"','"+txtPar2+"');drawSvgChart('"+speToTFT+"','"+fileSVGClientPath1+"',this.id,'"+txtPar1+"','"+txtPar3+"');drawSvgChart('"+speToCF+"','"+fileSVGCFClientPath1+"',this.id,'"+txtPar2+"','"+txtPar4+"')>";
            }
            else if(str=="3" || str=="8")
            {
                var txtPar1="Text"+(id+1);
                var txtPar2="Text"+(id+99-3*rowIndex-1);
                var txtPar3="Text"+(id+2);
                var txtPar4="Text"+(id+99-3*rowIndex);
                cell.innerHTML="<input type='text' id='"+txtId+"' size='5'  onblur=valueParser('"+speToTFT+"','"+speToCF+"',this.id,'"+txtPar1+"','"+txtPar2+"');drawSvgChart('"+speToTFT+"','"+fileSVGClientPath1+"',this.id,'"+txtPar1+"','"+txtPar3+"');drawSvgChart('"+speToCF+"','"+fileSVGCFClientPath1+"',this.id,'"+txtPar2+"','"+txtPar4+"')>";
            }
            else
            {
                cell.innerHTML="<input type='text' id='"+txtId+"' size='5'>";
            }
        }
    }
    //for test
    //alert(txtId);
}
function test()
{
  
}
function valueParser(flagTFT,flagCF,txtSource,txtPar1,txtPar2)
{
    //alert(chartTypeValue);
    var controlOriginId=null;
    var controlIdX=null;
    var controlIdY=null;
    var controlOrigin=null;
    var controlX=null;
    var controlY=null;
    var controlXValue=null;
    var controlYValue=null;
    var leftBotXTFT=null;
    var leftBotYTFT=null;
    var leftBotXCF=null;
    var leftBotYCF=null;
    var txtId=txtSource.slice(-1);
    var IdText=txtSource.substring(0,4);
    var IdSer=txtSource.substring(4);
    var txtPar1Control=document.getElementById(txtPar1);
    var txtPar2Control=document.getElementById(txtPar2);
    var oXmlFileDomForDraw=loadClientFile(fileXMLClientPath);
    var flag=0;
    var isNumFlag=isNum(document.getElementById(txtSource).value,txtSource);
    //var isNumFlag=true;
    if(isNumFlag)
    {
        if(txtId=="1" ||txtId=="6")
        {
            controlOriginId=txtSource;
            controlOrigin=document.getElementById(controlOriginId);
                //alert("suscess");
                //alert(controlOrigin);
            if(controlOrigin!=null)
            {
                var location=controlOrigin.value;
                if(location!="")
                {
                //alert(location);
                    var xmlContent=oXmlFileDomForDraw.xml;
                    //alert(xmlContent);
                    var oChip_Pos=oXmlFileDomForDraw.getElementsByTagName("CHIP_POS");
                   // alert(oChip_Pos.length);
                    for(var i=0;i<oChip_Pos.length;i++)
                    {
                        if(oChip_Pos[i].nodeTypedValue==location)
                        {
                            var pro_category=oChip_Pos[i].nextSibling.nodeTypedValue;
                            //alert(pro_category);
                            if(pro_category==flagTFT)
                            {
                                leftBotXTFT=oChip_Pos[i].nextSibling.nextSibling.nodeTypedValue;
                                leftBotYTFT =oChip_Pos[i].nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                flag++;
                                //break;
                            }
                            else if(pro_category==flagCF)
                            {
                                leftBotXCF=oChip_Pos[i].nextSibling.nextSibling.nodeTypedValue;
                                leftBotYCF=oChip_Pos[i].nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                flag++;
                            }
                            if(flag>=2)
                            {
                                break;
                            }
                        }
                     }
                     controlIdX=IdText+(Number(IdSer)+1);
                     controlIdY=IdText+(Number(IdSer)+2);
                     controlX=document.getElementById(controlIdX);
                     controlY=document.getElementById(controlIdY);
                     controlXValue=controlX.value;
                     controlYValue=controlY.value;        
                    if(controlX!=null && controlY!=null)
                    {
                        var txtPar1Id=txtPar1.slice(-1);
                        var controlTFT=null;
                        var controlCF=null;
                        if(txtPar1Id=="4" ||txtPar1Id=="9")
                        {
                            controlTFT=document.getElementById(txtPar1.substring(0,4)+(Number(txtPar1.substring(4))+1));
                            controlCF=document.getElementById(txtPar2.substring(0,4)+(Number(txtPar2.substring(4))+1));
                            if(controlXValue!="" && controlYValue!="")
                            {
                                //point的坐标为ControlX/ControlY的value
                                //alert("1");
                                if(controlXValue=="-" && controlYValue!="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT)+Number(controlYValue);
                                    txtPar2Control.value=Number(leftBotXCF)+Number(controlYValue);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                                else if(controlXValue!="-" && controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT)+Number(controlXValue);
                                    controlCF.value=Number(leftBotYCF)+Number(controlXValue);
                                }
                                else if(controlXValue!="-" && controlYValue!="-")
                                {
                                   
                                    txtPar1Control.value=Number(leftBotXTFT)+Number(controlYValue);
                                    txtPar2Control.value=Number(leftBotXCF)+Number(controlYValue);
                                    controlTFT.value=Number(leftBotYTFT)+Number(controlXValue);
                                    controlCF.value=Number(leftBotYCF)+Number(controlXValue);
                                }
                            }
                            else if(controlXValue!="" && controlYValue=="")
                            {
                                //Point的坐标为ControlX和ControlOrigin的value
                                if(controlXValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT)+Number(controlXValue);
                                    controlCF.value=Number(leftBotYCF)+Number(controlXValue);
                                }
                            }
                            else if(controlXValue=="" && controlYValue!="")
                            {
                                //Point的坐标为ControlY和ControlOrigin的Value
                                //alert("3");
                                if(controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotXTFT)+Number(controlYValue);
                                    txtPar2Control.value=Number(leftBotXCF)+Number(controlYValue);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                            }
                            else
                            {
                                //  Point的坐标为ControlOrigin的Value
                                //alert("4");
                                txtPar1Control.value=Number(leftBotXTFT);
                                txtPar2Control.value=Number(leftBotXCF);
                                controlTFT.value=Number(leftBotYTFT);
                                controlCF.value=Number(leftBotYCF);
                            }
                        }
                        else if(txtPar1Id=="5" || txtPar1Id=="0")
                        {
                            controlTFT=document.getElementById(txtPar1.substring(0,4)+(Number(txtPar1.substring(4))-1));
                            controlCF=document.getElementById(txtPar2.substring(0,4)+(Number(txtPar2.substring(4))-1));
                            if(controlXValue!="" && controlYValue!="")
                            {
                                //point的坐标为ControlX/ControlY的value
                                //alert("1");
                                if(controlXValue=="-" && controlYValue!="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT)+Number(controlYValue);
                                    controlCF.value=Number(leftBotXCF)+Number(controlYValue);
                                }
                                else if(controlXValue!="-" && controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT)+Number(controlXValue);
                                    txtPar2Control.value=Number(leftBotYCF)+Number(controlXValue);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                                else if(controlXValue!="-" && controlYValue!="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT)+Number(controlXValue);
                                    txtPar2Control.value=Number(leftBotYCF)+Number(controlXValue);
                                    controlTFT.value=Number(leftBotXTFT)+Number(controlYValue);
                                    controlCF.value=Number(leftBotXCF)+Number(controlYValue);
                                }
                            }
                            else if(controlXValue!="" && controlYValue=="")
                            {
                                //Point的坐标为ControlX和ControlOrigin的value
                                //alert("2");
                                if(controlXValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotYTFT)+Number(controlXValue);
                                    txtPar2Control.value=Number(leftBotYCF)+Number(controlXValue);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                            }
                            else if(controlXValue=="" && controlYValue!="")
                            {
                                //Point的坐标为ControlY和ControlOrigin的Value
                                //alert("3");
                                if(controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT)+Number(controlYValue);
                                    controlCF.value=Number(leftBotXCF)+Number(controlYValue);
                                }
                            }
                            else
                            {
                                //  Point的坐标为ControlOrigin的Value
                                //alert("4");
                                txtPar1Control.value=Number(leftBotYTFT);
                                txtPar2Control.value=Number(leftBotYCF);
                                controlTFT.value=Number(leftBotXTFT);
                                controlCF.value=Number(leftBotXCF);  
                            }
                        }
                    }
                }
            }
        }
        else if(txtId=="2" || txtId=="7")
        {
            controlOriginId=IdText+(Number(IdSer)-1);
            controlOrigin=document.getElementById(controlOriginId);
                //alert("suscess");
                //alert(controlOrigin);
            if(controlOrigin!=null)
            {
                var location=controlOrigin.value;
                if(location!="")
                {
                //alert(location);
                    var xmlContent=oXmlFileDomForDraw.xml;
                    //alert(xmlContent);
                    var oChip_Pos=oXmlFileDomForDraw.getElementsByTagName("CHIP_POS");
                    //alert(oChip_Pos.length);
                    for(var i=0;i<oChip_Pos.length;i++)
                    {
                        if(oChip_Pos[i].nodeTypedValue==location)
                        {
                            var pro_category=oChip_Pos[i].nextSibling.nodeTypedValue;
                            //alert(pro_category);
                            if(pro_category==flagTFT)
                            {
                                leftBotXTFT=oChip_Pos[i].nextSibling.nextSibling.nodeTypedValue;
                                leftBotYTFT =oChip_Pos[i].nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                flag++;
                                //break;
                            }
                            else if(pro_category==flagCF)
                            {
                                leftBotXCF=oChip_Pos[i].nextSibling.nextSibling.nodeTypedValue;
                                leftBotYCF=oChip_Pos[i].nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                flag ++;
                            }
                            if(flag>=2)
                            {
                                break;
                            }
                        }
                     }
                     controlIdX=txtSource;
                     controlIdY=IdText+(Number(IdSer)+1);
                     controlX=document.getElementById(controlIdX);
                     controlY=document.getElementById(controlIdY);
                     controlXValue=controlX.value;
                     controlYValue=controlY.value;        
                   if(controlX!=null && controlY!=null)
                    {
                        var txtPar1Id=txtPar1.slice(-1);
                        var controlTFT=null;
                        var controlCF=null;
                        if(txtPar1Id=="4" ||txtPar1Id=="9")
                        {
                            controlTFT=document.getElementById(txtPar1.substring(0,4)+(Number(txtPar1.substring(4))+1));
                            controlCF=document.getElementById(txtPar2.substring(0,4)+(Number(txtPar2.substring(4))+1));
                            if(controlXValue!="" && controlYValue!="")
                            {
                                //point的坐标为ControlX/ControlY的value
                                //alert("1");
                                if(controlXValue=="-" && controlYValue!="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT)+Number(controlYValue);
                                    txtPar2Control.value=Number(leftBotXCF)+Number(controlYValue);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                                else if(controlXValue!="-" && controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT)+Number(controlXValue);
                                    controlCF.value=Number(leftBotYCF)+Number(controlXValue);
                                }
                                else if(controlXValue!="-" && controlYValue!="-")
                                {
                                   
                                    txtPar1Control.value=Number(leftBotXTFT)+Number(controlYValue);
                                    txtPar2Control.value=Number(leftBotXCF)+Number(controlYValue);
                                    controlTFT.value=Number(leftBotYTFT)+Number(controlXValue);
                                    controlCF.value=Number(leftBotYCF)+Number(controlXValue);
                                }
                            }
                            else if(controlXValue!="" && controlYValue=="")
                            {
                                //Point的坐标为ControlX和ControlOrigin的value
                                if(controlXValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT)+Number(controlXValue);
                                    controlCF.value=Number(leftBotYCF)+Number(controlXValue);
                                }
                            }
                            else if(controlXValue=="" && controlYValue!="")
                            {
                                //Point的坐标为ControlY和ControlOrigin的Value
                                //alert("3");
                                if(controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotXTFT)+Number(controlYValue);
                                    txtPar2Control.value=Number(leftBotXCF)+Number(controlYValue);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                            }
                            else
                            {
                                //  Point的坐标为ControlOrigin的Value
                                //alert("4");
                                txtPar1Control.value=Number(leftBotXTFT);
                                txtPar2Control.value=Number(leftBotXCF);
                                controlTFT.value=Number(leftBotYTFT);
                                controlCF.value=Number(leftBotYCF);
                            }
                        }
                        else if(txtPar1Id=="5" || txtPar1Id=="0")
                        {
                            controlTFT=document.getElementById(txtPar1.substring(0,4)+(Number(txtPar1.substring(4))-1));
                            controlCF=document.getElementById(txtPar2.substring(0,4)+(Number(txtPar2.substring(4))-1));
                            if(controlXValue!="" && controlYValue!="")
                            {
                                //point的坐标为ControlX/ControlY的value
                                //alert("1");
                                if(controlXValue=="-" && controlYValue!="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT)+Number(controlYValue);
                                    controlCF.value=Number(leftBotXCF)+Number(controlYValue);
                                }
                                else if(controlXValue!="-" && controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT)+Number(controlXValue);
                                    txtPar2Control.value=Number(leftBotYCF)+Number(controlXValue);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                                else if(controlXValue!="-" && controlYValue!="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT)+Number(controlXValue);
                                    txtPar2Control.value=Number(leftBotYCF)+Number(controlXValue);
                                    controlTFT.value=Number(leftBotXTFT)+Number(controlYValue);
                                    controlCF.value=Number(leftBotXCF)+Number(controlYValue);
                                }
                            }
                            else if(controlXValue!="" && controlYValue=="")
                            {
                                //Point的坐标为ControlX和ControlOrigin的value
                                //alert("2");
                                if(controlXValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotYTFT)+Number(controlXValue);
                                    txtPar2Control.value=Number(leftBotYCF)+Number(controlXValue);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                            }
                            else if(controlXValue=="" && controlYValue!="")
                            {
                                //Point的坐标为ControlY和ControlOrigin的Value
                                //alert("3");
                                if(controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT)+Number(controlYValue);
                                    controlCF.value=Number(leftBotXCF)+Number(controlYValue);
                                }
                            }
                            else
                            {
                                //  Point的坐标为ControlOrigin的Value
                                //alert("4");
                                txtPar1Control.value=Number(leftBotYTFT);
                                txtPar2Control.value=Number(leftBotYCF);
                                controlTFT.value=Number(leftBotXTFT);
                                controlCF.value=Number(leftBotXCF);  
                            }
                        }
                    }
                }
            }
        }
        else if(txtId=="3" ||txtId=="8")
        {
            controlOriginId=IdText+(Number(IdSer)-2);
            controlOrigin=document.getElementById(controlOriginId);
                //alert("suscess");
                //alert(controlOrigin);
            if(controlOrigin!=null)
            {
                var location=controlOrigin.value;
                if(location!="")
                {
                //alert(location);
                    var xmlContent=oXmlFileDomForDraw.xml;
                    //alert(xmlContent);
                    var oChip_Pos=oXmlFileDomForDraw.getElementsByTagName("CHIP_POS");
                    //alert(oChip_Pos.length);
                    for(var i=0;i<oChip_Pos.length;i++)
                    {
                        if(oChip_Pos[i].nodeTypedValue==location)
                        {
                            var pro_category=oChip_Pos[i].nextSibling.nodeTypedValue;
                            //alert(pro_category);
                            if(pro_category==flagTFT)
                            {
                                leftBotXTFT=oChip_Pos[i].nextSibling.nextSibling.nodeTypedValue;
                                leftBotYTFT =oChip_Pos[i].nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                flag++;
                                //break;
                            }
                            else if(pro_category==flagCF)
                            {
                                leftBotXCF=oChip_Pos[i].nextSibling.nextSibling.nodeTypedValue;
                                leftBotYCF=oChip_Pos[i].nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                flag ++;
                            }
                            if(flag>=2)
                            {
                                break;
                            }
                        }
                     }
                     controlIdX=IdText+(Number(IdSer)-1);
                     controlIdY=txtSource;
                     controlX=document.getElementById(controlIdX);
                     controlY=document.getElementById(controlIdY);
                     controlXValue=controlX.value;
                     controlYValue=controlY.value;        
                    if(controlX!=null && controlY!=null)
                    {
                        var txtPar1Id=txtPar1.slice(-1);
                        var controlTFT=null;
                        var controlCF=null;
                        if(txtPar1Id=="4" ||txtPar1Id=="9")
                        {
                            controlTFT=document.getElementById(txtPar1.substring(0,4)+(Number(txtPar1.substring(4))+1));
                            controlCF=document.getElementById(txtPar2.substring(0,4)+(Number(txtPar2.substring(4))+1));
                            if(controlXValue!="" && controlYValue!="")
                            {
                                //point的坐标为ControlX/ControlY的value
                                //alert("1");
                                if(controlXValue=="-" && controlYValue!="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT)+Number(controlYValue);
                                    txtPar2Control.value=Number(leftBotXCF)+Number(controlYValue);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                                else if(controlXValue!="-" && controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT)+Number(controlXValue);
                                    controlCF.value=Number(leftBotYCF)+Number(controlXValue);
                                }
                                else if(controlXValue!="-" && controlYValue!="-")
                                {
                                   
                                    txtPar1Control.value=Number(leftBotXTFT)+Number(controlYValue);
                                    txtPar2Control.value=Number(leftBotXCF)+Number(controlYValue);
                                    controlTFT.value=Number(leftBotYTFT)+Number(controlXValue);
                                    controlCF.value=Number(leftBotYCF)+Number(controlXValue);
                                }
                            }
                            else if(controlXValue!="" && controlYValue=="")
                            {
                                //Point的坐标为ControlX和ControlOrigin的value
                                if(controlXValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT)+Number(controlXValue);
                                    controlCF.value=Number(leftBotYCF)+Number(controlXValue);
                                }
                            }
                            else if(controlXValue=="" && controlYValue!="")
                            {
                                //Point的坐标为ControlY和ControlOrigin的Value
                                //alert("3");
                                if(controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotXTFT);
                                    txtPar2Control.value=Number(leftBotXCF);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotXTFT)+Number(controlYValue);
                                    txtPar2Control.value=Number(leftBotXCF)+Number(controlYValue);
                                    controlTFT.value=Number(leftBotYTFT);
                                    controlCF.value=Number(leftBotYCF);
                                }
                            }
                            else
                            {
                                //  Point的坐标为ControlOrigin的Value
                                //alert("4");
                                txtPar1Control.value=Number(leftBotXTFT);
                                txtPar2Control.value=Number(leftBotXCF);
                                controlTFT.value=Number(leftBotYTFT);
                                controlCF.value=Number(leftBotYCF);
                            }
                        }
                        else if(txtPar1Id=="5" || txtPar1Id=="0")
                        {
                            controlTFT=document.getElementById(txtPar1.substring(0,4)+(Number(txtPar1.substring(4))-1));
                            controlCF=document.getElementById(txtPar2.substring(0,4)+(Number(txtPar2.substring(4))-1));
                            if(controlXValue!="" && controlYValue!="")
                            {
                                //point的坐标为ControlX/ControlY的value
                                //alert("1");
                                if(controlXValue=="-" && controlYValue!="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT)+Number(controlYValue);
                                    controlCF.value=Number(leftBotXCF)+Number(controlYValue);
                                }
                                else if(controlXValue!="-" && controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT)+Number(controlXValue);
                                    txtPar2Control.value=Number(leftBotYCF)+Number(controlXValue);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                                else if(controlXValue!="-" && controlYValue!="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT)+Number(controlXValue);
                                    txtPar2Control.value=Number(leftBotYCF)+Number(controlXValue);
                                    controlTFT.value=Number(leftBotXTFT)+Number(controlYValue);
                                    controlCF.value=Number(leftBotXCF)+Number(controlYValue);
                                }
                            }
                            else if(controlXValue!="" && controlYValue=="")
                            {
                                //Point的坐标为ControlX和ControlOrigin的value
                                //alert("2");
                                if(controlXValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotYTFT)+Number(controlXValue);
                                    txtPar2Control.value=Number(leftBotYCF)+Number(controlXValue);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                            }
                            else if(controlXValue=="" && controlYValue!="")
                            {
                                //Point的坐标为ControlY和ControlOrigin的Value
                                //alert("3");
                                if(controlYValue=="-")
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT);
                                    controlCF.value=Number(leftBotXCF);
                                }
                                else
                                {
                                    txtPar1Control.value=Number(leftBotYTFT);
                                    txtPar2Control.value=Number(leftBotYCF);
                                    controlTFT.value=Number(leftBotXTFT)+Number(controlYValue);
                                    controlCF.value=Number(leftBotXCF)+Number(controlYValue);
                                }
                            }
                            else
                            {
                                //  Point的坐标为ControlOrigin的Value
                                //alert("4");
                                txtPar1Control.value=Number(leftBotYTFT);
                                txtPar2Control.value=Number(leftBotYCF);
                                controlTFT.value=Number(leftBotXTFT);
                                controlCF.value=Number(leftBotXCF);  
                            }
                        }
                    }
                }
            }
        }
    }
}
function isNum(inputStr,controlId)
{
    var i=0;
    var dotCnt=0;
    var NaNCnt=0;
    var strLen=inputStr.toString().length;
    var loopCount=0;
    var idSer=controlId.slice(-1);
    var control=document.getElementById(controlId);
    if(idSer=="1" || idSer=="6")
    {
        if(strLen>2)
        {
            control.value="";
            alert("請正確填寫Panel在Sheet中的Location!");
            return false;
        }
        else
        {
            for(i=0;i<strLen;i++)
            {
                var oneChar=inputStr.toString().substring(i,i+1);
                if(oneChar<="9" && oneChar>="1")
                {
                    loopCount++;
                }
                else
                {
                    control.value="";
                    alert("請正確填寫Panel在Sheet中的Location!");
                    return false;
                }
            }
            if(loopCount==strLen)
            {
                return true;
            }
        }
    }
    else
    {
        if(chartTypeValue==chartTypePoint)
        {
            for(i=0;i<strLen;i++)
            {
                var oneChar=inputStr.toString().substring(i,i+1);
                if(oneChar<="9" && oneChar>="0" || oneChar==".")
                {
                    if(oneChar==".")
                    {
                        dotCnt++;
                        if(i==0 || i==strLen-1)
                        {
                            alert("請依照格式填寫數據:你現在是在做Fixed Point Mapping!所以填入的X,Y坐標只能為合法數字!");
                            control.value="";
                            return false;
                            break;
                        }
                    }
                }
                else
                {
                    NaNCnt++;
                    alert("請依照格式填寫數據:你現在是在做Fixed Point Mapping!所以填入的X,Y坐標只能為合法數字!");
                    control.value="";
                    return false;
                    break;
                }
            }
            if(i==strLen && dotCnt<2 &&NaNCnt<1)
            {
                return true;
            }
            else
            {
                control.value="";
                return false;
            }
        }
        else if(chartTypeValue==chartTypeLine)
        {
            for(i=0;i<strLen;i++)
            {
                var oneChar=inputStr.toString().substring(i,i+1);
                if(oneChar<="9" && oneChar>="0" ||oneChar=="."|| oneChar=="-")
                {
                    if(oneChar=="-")
                    {
                        if(strLen>1)
                        {
                            alert("請依照格式填寫數據:你現在是在做Fixed Line Mapping!所以填入的X,Y坐標中只能有一個坐標為數字,另一個為'-'");
                            control.value="";
                            return false;
                            break;
                        }
                    }
                    else if(oneChar==".")
                    {
                        dotCnt++;
                        if(dotCnt>1 || i==0 ||i==strLen-1)
                        {
                            alert("請依照格式填寫數據:你現在是在做Fixed Line Mapping!所以填入的X,Y坐標中只能有一個坐標為數字,另一個為'-'");
                            control.value="";
                            return false;
                            break;
                        }
                    }
                }
                else
                {
                    NaNCnt++;
                    alert("請依照格式填寫數據:你現在是在做Fixed Line Mapping!所以填入的X,Y坐標中只能有一個坐標為數字,另一個為'-'");
                    control.value="";
                    return false;
                    break;
                }
            }
            if(i==strLen && dotCnt<2 &&NaNCnt<1)
            {
                return true;
            }
            else
            {
                control.value="";
                return false;
            }
        }
    }
}
function getSvgFile()
{
    var lblFileName=document.getElementById("lblFileName");
    var lblSourceFilePath=document.getElementById("lblSourceFilePath");
    fileName=lblFileName.value;
    sourceFilePath=lblSourceFilePath.text;
    PageMethods.drawPoint(fileName,sourceFilePath,200,200,3,red);
//    var test=PageMethods.test("tst");
//    var fileAttr=new Array();
//    fileAttr=PageMethods.getFile("18.95 layout.svg");
//    fileName=fileAttr[0];
//    targerFilePaht=fileAttr[1];
    //PageMethods.test();
    //doc=evt.getTarget().getOwnerDocument();
}
function createXMLDOM()
{
    if(ActiveXObject)
    {
        var arrSignatures=["MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","Microsoft.XmlDom"];
        for(var i=0;i<arrSignatures.length;i++)
        {
            try
            {
                var oXmlDom=new ActiveXObject(arrSignatures[i]);
                return oXmlDom;
            }
            catch(oError)
            {
            }
        }
        throw new Error ("MSXML is not installed on your system.");
    }
    else if(document.implemention && document.implemention.createDocument)
    {
        var oXmlDom=document.implemention.createDocument("","",null);
        return oXmlDom;
    }
    else
    {
        throw new Error("Your browser doesn't support an XML Dom object.");
    }
}
function loadXmlFso()
{
    var oXmlDom=new createXMLDOM();
    var fso=new ActiveXObject('Scripting.FileSystemObject');
    //fso.CopyFile("D://WebSite//FMA_SVN//XMLFile//18.95 layout.svg","D://WebSite//FMA_SVN//XMLFile//Test.svg",true);
    //var file=fso.OpenTextFile("D://WebSite//FMA_SVN//XMLFile//18.95 layout.svg",8,true);
    var file=fso.GetFile("D://WebSite//FMA_SVN//SVGFile//18.95 layout.svg");
    file.Copy("D://WebSite//FMA_SVN//TempFile//Test1.svg",true);
    var fileTemp=fso.GetFile("D://WebSite//FMA_SVN//TempFile//Test1.svg");
    var fileStream=fileTemp.OpenAsTextStream(1,-2);
    var fileContent=fileStream.ReadAll();
    alert(fileContent);
    oXmlDom=fileContent;
    //alert(oXmlDom);
    //alert(dd);
    //fileStream.WriteLine("tttttttttt");
    //alert(cc);
   
    var oP=oXmlDom.createElement("p");
    var oText=oXmlDom.createTextNode("testcrus");
    oP.appendChild(oText );
    var oNode=oXmlDom.getElementsByTagName("defs")[0];
    oNode.appendChild(oP);
   
    alert(oXmlDom);
    alert(fileStream);

    fileStream.Close();
    alert("test222");
}
function loadXml(Path)
{
    //alert(Path);
    var sourceFilePath="SVGFile/"+Path+".svg";
    var xmlFilePath="XMLFile/"+Path+".xml";
    //alert(sourceFilePath);
    var oSvgDom=new createXMLDOM();
    var oXmlDom=new createXMLDOM();
    oSvgDom.async=false;
    oXmlDom.async=false;
    oSvgDom.onreadystatechange=function()
    {
        if(oSvgDom.readyState==4)
        {
        }
    };
    oXmlDom.onreadystatechange=function()
    {
        if(oXmlDom.readyState==4)
        {
        }
    };
    oSvgDom.load(sourceFilePath);
    oXmlDom.load(xmlFilePath);
////    update xml by DOM
//    var ttt=oXmlDom.firstChild.xml;
//    var oP=oXmlDom.createElement("p");
//    var oText=oXmlDom.createTextNode("test");
//    oP.appendChild(oText );
//    var oNode=oXmlDom.getElementsByTagName("defs")[0];
//    oNode.appendChild(oP);
    var oSvgDomContent=oSvgDom.xml;
    var oXmlDomContent=oXmlDom.xml;
    ////注意:寫在客戶端文件時候,需要在Client瀏覽器中首先把web site 設置為信任web,并且把信任網站的custum level Reset為最初始值,并且把initialize and script ActiveX controls not marks as safe 設置為Enable
    var fso=new ActiveXObject('Scripting.FileSystemObject');
    var tmpSerice=Math.random()*100000000;
    //alert(tmpSerice);
    var filePath="y://public//fma_svg_tmp//"+tmpSerice+".svg";
    var xmlFilePath="y://public//fma_svg_tmp//"+tmpSerice+".xml";
    var file=fso.CreateTextFile(filePath,true,true);
    var xmlFile=fso.CreateTextFile(xmlFilePath,true,true);
    //var tempFile=fso.GetFile("D://WebSite//FMA_SVN//TempFile//Test3.svg");
    //var fileStream=tempFile.OpenAsTextStream();
    //file=fso.OpenTextFile("D://WebSite//FMA_SVN//TempFile//Test1.svg",2,true);
    file.WriteLine(oSvgDomContent);
    xmlFile.WriteLine(oXmlDomContent);
    file.Close();
    xmlFile.Close();
    var svgContainerTFT=document.getElementById("DivSvgContainerTFT");
    var svgContainerCF=document.getElementById("DivSvgContainerCF");
    if(svgContainerTFT!=null)
    {
        svgContainerTFT.innerHTML= "<iframe src= /'"+filePath+"/' frameBorder='1' width='600' height='650'>" + "<embed src=/'"+filePath+"/' name='SVG Chart' type='image/svg+xml'/>" + "</iframe>";
    }
    if(svgContainerCF!=null)
    {
        svgContainerCF.innerHTML= "<iframe src= /'"+filePath+"/' frameBorder='1' width='600' height='650'>" + "<embed src=/'"+filePath+"/' name='SVG Chart' type='image/svg+xml'/>" + "</iframe>";
    }
}
function loadFile(fileName,filePath,fileType,fileSpec)
{
    var fileServerPath=filePath+fileName+fileSpec+fileType;
    var oFileDom=new createXMLDOM();
    oFileDom.async=false;
    oFileDom.onreadystatechange=function()
    {
         if(oFileDom.readyState==4)
        {
        }
    };
    oFileDom.load(fileServerPath);
    return oFileDom;
}
function loadClientFile(filePath)
{
    if(filePath!=null)
    {
        var oFileDom=new createXMLDOM();
        oFileDom.async=false;
        oFileDom.onreadystatechange=function()
        {
             if(oFileDom.readyState==4)
            {
            }
        };
        oFileDom.load(filePath);
        return oFileDom;
    }
}
function createClientFile(fileCliPath,fileName,fileSerPath,fileType,fileSpec)
{
    var oFileDom=loadFile(fileName,fileSerPath,fileType,fileSpec);
    var fileContent=oFileDom.xml;
    ////注意:寫在客戶端文件時候,需要在Client瀏覽器中首先把web site 設置為信任web,并且把信任網站的custum level Reset為最初始值,并且把initialize and script ActiveX controls not marks as safe 設置為Enable
    var fso=new ActiveXObject('Scripting.FileSystemObject');
    var tmpSerice=Math.random()*10000000000;
    if(fileType==fileSVGType && fileSpec==speToTFT)
    {
        fileSVGClientPath=fileCliPath+fileName+fileSpec+tmpSerice+fileType;
        fileSVGClientPath1=clientFilePath1+fileName+fileSpec+tmpSerice+fileType;
        var clientFile=fso.CreateTextFile(fileSVGClientPath,true,true);
        clientFile.WriteLine(fileContent);
        clientFile.Close();
        return fileSVGClientPath;
    }
    else if(fileType==fileSVGType && fileSpec==speToCF)
    {
        fileSVGCFClientPath=fileCliPath+fileName+fileSpec+tmpSerice+fileType;
        fileSVGCFClientPath1=clientFilePath1+fileName+fileSpec+tmpSerice+fileType;
        var clientFile=fso.CreateTextFile(fileSVGCFClientPath,true,true);
        clientFile.WriteLine(fileContent);
        clientFile.Close();
        return fileSVGCFClientPath;
    }
    else if(fileType==fileXMLType && fileSpec==speToOrigin)
    {
        fileXMLClientPath=fileCliPath+fileName+speToOrigin+tmpSerice+fileType;
        var clientFile=fso.CreateTextFile(fileXMLClientPath,true,true);
        clientFile.WriteLine(fileContent);
        clientFile.Close();
        return fileXMLClientPath;
    }
    else if (fileType==fileXMLType && fileSpec==speToProContact)
    {
        fileXMLProCotRefPath==fileCliPath+fileName+speToOrigin+tmpSerice+fileType;
        var clientFile=fso.CreateTextFile(fileXMLProCotRefPath,true,true);
        clientFile.WriteLine(fileContent);
        clientFile.Close();
        return fileXMLProCotRefPath;
    }
    else if(fileType=fileXMLType && fileSpec==speToCFOrigin)
    {
        fileXMLCFClientPath=fileCliPath+fileName+speToCFOrigin+tmpSerice+fileType;
        var clientFile=fso.CreateTextFile(fileXMLCFClientPath,true,true);
        clientFile.WriteLine(fileContent);
        clientFile.Close();
        return fileXMLCFClientPath;
    }
}
function showSVGChart(controlId,filePath)
{
    //var svgFileClientPath=createClientFile(fileCliPath,fileName,fileSerPath,fileType);
    var Control=document.getElementById(controlId);
    if(Control!=null)
    {
        Control.innerHTML="<iframe src= /'"+filePath+"/' frameBorder='1' width='600' height='650'>" + "<embed src=/'"+filePath+"/' name='SVG Chart' type='image/svg+xml'/>" + "</iframe>";
    }
}
function drawSvgChart(flag,filePath,controlId,controlIdX,controlIdY)
{
    //alert(chartTypeValue);
    var oLeftBotX=null;
    var oLeftBotY=null;
    var oRightTopX=null;
    var oRightTopY=null;
    if(filePath==null || fileXMLClientPath==null)
    {
        alert("請先選擇Product!");
    }
    else
    {
        //var isNumFlag=isNum(document.getElementById(controlId).value,controlId);
        var isNumFlag=true;
        if(isNumFlag)
        {
            var controlIdOrigin=null;
            var controlOrigin=null;
            //X Ref Control
            var controlX=null;
            //Y Ref Control
            var controlY=null;
            // X Ref Control Value
            var controlXValue=null;
            // Y Ref Control Value
            var controlYValue=null;
            //TFT SVG File
            var oSVGFileDomForDraw=loadClientFile(filePath);
            //CF SVG File
            //var oSVGFileCFDomForDraw=loadClientFile(fileSVGCFClientPath);
            //TFT/CF Origin Points Datas
            var oXmlFileDomForDraw=loadClientFile(fileXMLClientPath);
            var IdFlag=controlId.slice(-1);
            var IdText=controlId.substring(0,4);
            var IdSer=controlId.substring(4);
            //alert(IdFlag);
            if(IdFlag=="1" ||IdFlag=="6")
            {
                controlIdOrigin=controlId;
                var controlOrigin=document.getElementById(controlIdOrigin);
                //alert(controlOrigin);
                if(controlOrigin!=null)
                {
                    var location=controlOrigin.value;
                    var controlXInput=document.getElementById(IdText+(Number(IdSer)+1));
                    var controlYInput=document.getElementById(IdText+(Number(IdSer)+2));
                    var controlXInputValue;
                    var controlYInputValue;
                    if(controlXInput!=null && controlYInput!=null)
                    {
                        controlXInputValue=controlXInput.value;
                        controlYInputValue=controlYInput.value;
                    }
                    if(location!="")
                    {
                    //alert(location);
                        var xmlContent=oXmlFileDomForDraw.xml;
                        //alert(xmlContent);
                        var oChip_Pos=oXmlFileDomForDraw.getElementsByTagName("CHIP_POS");
                        for(var i=0;i<oChip_Pos.length;i++)
                        {
                            if(oChip_Pos[i].nodeTypedValue==location)
                            {
                                var pro_category=oChip_Pos[i].nextSibling.nodeTypedValue;
                                if(pro_category==flag)
                                {
                                    oLeftBotX=oChip_Pos[i].nextSibling.nextSibling.nodeTypedValue;
                                    oLeftBotY =oChip_Pos[i].nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                    oRightTopX=oChip_Pos[i].nextSibling.nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                    oRightTopY=oChip_Pos[i].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                    break;
                                }
                            }
                         }
                        controlX=document.getElementById(controlIdX);
                        controlY=document.getElementById(controlIdY);
                        if(chartTypeValue==chartTypePoint)
                        {
                            if(controlX!=null && controlY!=null)
                            {
                                controlXValue=controlX.value;
                                controlYValue=controlY.value;                        
                                if(controlXValue!="" && controlYValue!="")
                                {
                                    //point的坐标为ControlX/ControlY的value
                                    //alert("1");
                                    drawPoint(filePath,(Number(controlXValue)+600)/2,(650-Number(controlYValue))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                }
                                else if(controlXValue!="" && controlYValue=="")
                                {
                                    drawPoint(filePath,(Number(controlXValue)+600)/2,(650-Number(oLeftBotY))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                }
                                else if(controlXValue=="" && controlYValue!="")
                                {
                                    drawPoint(filePath,(Number(oLeftBotX)+600)/2,(650-Number(controlYValue))/2,controlIdOrigin ,controlIdX,controlIdY);
                                }
                                else
                                {
                                    drawPoint(filePath,(Number(oLeftBotX)+600)/2,(650-Number(oLeftBotY))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                }
                             }
                          }
                        else if(chartTypeValue==chartTypeLine)
                        {
                            if(controlX!=null && controlY!=null)
                            {
                                controlXValue=controlX.value;
                                controlYValue=controlY.value;     
                            }
                            if(controlXInputValue!="" && controlYInputValue!="")
                            {
                                if(controlXInputValue!="-" && controlYInputValue=="-")
                                {
                                    drawLine(filePath,(Number(oLeftBotX)+600)/2,(650-Number(controlYValue))/2,(Number(oRightTopX)+600)/2,(650-Number(controlYValue))/2,controlIdOrigin ,controlIdX,controlIdY);
                                }
                                else if(controlXInputValue=="-" && controlYInputValue!="-")
                                {
                                    drawLine(filePath,(Number(controlXValue)+600)/2,(650-Number(oLeftBotY))/2,(Number(controlXValue)+600)/2,(650-Number(oRightTopY))/2,controlIdOrigin ,controlIdX,controlIdY);
                                }
                                else
                                {
                                    return;
                                    alert("輸入數據格式不正確!");
                                }
                            }
                            else if(controlXInputValue!="" && controlYInputValue=="")
                            {
                                if(controlXInputValue=="-" &&controlYInputValue=="")
                                {
                                    drawLine(filePath,(Number(oLeftBotX)+600)/2,(650-Number(oLeftBotY))/2,(Number(oLeftBotX)+600)/2,(650-Number(oRightTopY))/2,controlIdOrigin,controlIdX,controlIdY);
                                }
                                else
                                {
                                    return;
                                }
                            }
                            else if(controlXInputValue=="" && controlYInputValue!="")
                            {
                                if(controlXInputValue=="" && controlYInputValue=="-")
                                {
                                    drawLine(filePath,(Number(oLeftBotX)+600)/2,(650-Number(oLeftBotY))/2,(Number(oRightTopX)+600)/2,(650-Number(oLeftBotY))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                }
                                else
                                {
                                    return;
                                }
                            }
                            else
                            {
                                return;
                            }
                        }
                        if(flag=="TFT")
                        {
                            showSVGChart("DivSvgContainerTFT",filePath);
                        }
                        else if(flag=="CF")
                        {
                            showSVGChart("DivSvgContainerCF",filePath);
                        }
                    }
                }
            }
            else if(IdFlag=="2" ||IdFlag=="7")
            {
                controlIdOrigin=IdText+(Number(IdSer)-1);
                var controlOrigin=document.getElementById(controlIdOrigin);
                //alert("suscess");
                //alert(controlOrigin);
                if(controlOrigin!=null)
                {
                    var location=controlOrigin.value;
                    var controlXInput=document.getElementById(IdText+(Number(IdSer)));
                    var controlYInput=document.getElementById(IdText+(Number(IdSer)+1));
                    var controlXInputValue;
                    var controlYInputValue;
                    if(controlXInput!=null && controlYInput!=null)
                    {
                        controlXInputValue=controlXInput.value;
                        controlYInputValue=controlYInput.value;
                    }
                    if(location!="")
                    {
                    //alert(location);
                        var xmlContent=oXmlFileDomForDraw.xml;
                        //alert(xmlContent);
                        var oChip_Pos=oXmlFileDomForDraw.getElementsByTagName("CHIP_POS");
                        //alert(oChip_Pos.length);
                        for(var i=0;i<oChip_Pos.length;i++)
                        {
                            if(oChip_Pos[i].nodeTypedValue==location)
                            {
                                var pro_category=oChip_Pos[i].nextSibling.nodeTypedValue;
                                //alert(pro_category);
                                if(pro_category==flag)
                                {
                                    oLeftBotX=oChip_Pos[i].nextSibling.nextSibling.nodeTypedValue;
                                    oLeftBotY =oChip_Pos[i].nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                    oRightTopX=oChip_Pos[i].nextSibling.nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                    oRightTopY=oChip_Pos[i].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                    break;
                                }
                            }
                         }
                        controlX=document.getElementById(controlIdX);
                        controlY=document.getElementById(controlIdY);
                        if(chartTypeValue==chartTypePoint)
                        {
                            if(controlX!=null && controlY!=null)
                            {
                                controlXValue=controlX.value;
                                controlYValue=controlY.value;
                                if(controlXValue!="" && controlYValue!="")
                                {
                                    drawPoint(filePath,(Number(controlXValue)+600)/2,(650-Number(controlYValue))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                }
                                else if(controlXValue!="" && controlYValue=="")
                                {
                                    drawPoint(filePath,(Number(controlXValue)+600)/2,(650-Number(oLeftBotY))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                }
                                else if(controlXValue=="" && controlYValue!="")
                                {
                                    drawPoint(filePath,(Number(oLeftBotX)+600)/2,(650-Number(controlYValue))/2,controlIdOrigin ,controlIdX,controlIdY);
                                }
                                else
                                {
                                    drawPoint(filePath,(Number(oLeftBotX)+600)/2,(650-Number(oLeftBotY))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                }
                            }
                        }
                        else if(chartTypeValue==chartTypeLine)
                        {
                            if(controlX!=null && controlY!=null)
                            {
                                controlXValue=controlX.value;
                                controlYValue=controlY.value;     
                            }
                            if(controlXInputValue!="" && controlYInputValue!="")
                            {
                                if(controlXInputValue!="-" && controlYInputValue=="-")
                                {
                                    drawLine(filePath,(Number(oLeftBotX)+600)/2,(650-Number(controlYValue))/2,(Number(oRightTopX)+600)/2,(650-Number(controlYValue))/2,controlIdOrigin ,controlIdX,controlIdY);
                                }
                                else if(controlXInputValue=="-" && controlYInputValue!="-")
                                {
                                    drawLine(filePath,(Number(controlXValue)+600)/2,(650-Number(oLeftBotY))/2,(Number(controlXValue)+600)/2,(650-Number(oRightTopY))/2,controlIdOrigin ,controlIdX,controlIdY);

                                }
                                else
                                {
                                    return;
                                    alert("輸入數據格式不正確!");
                                }
                            }
                            else if(controlXInputValue!="" && controlYInputValue=="")
                            {
                                if(controlXInputValue=="-" &&controlYInputValue=="")
                                {
                                    drawLine(filePath,(Number(oLeftBotX)+600)/2,(650-Number(oLeftBotY))/2,(Number(oLeftBotX)+600)/2,(650-Number(oRightTopY))/2,controlIdOrigin,controlIdX,controlIdY);
                                }
                                else
                                {
                                    return;
                                }
                            }
                            else if(controlXInputValue=="" && controlYInputValue!="")
                            {
                                if(controlXInputValue=="" && controlYInputValue=="-")
                                {
                                    drawLine(filePath,(Number(oLeftBotX)+600)/2,(650-Number(oLeftBotY))/2,(Number(oRightTopX)+600)/2,(650-Number(oLeftBotY))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                }
                                else
                                {
                                    return;
                                }
                            }
                            else
                            {
                                return;
                            }
                        }
                        if(flag=="TFT")
                        {
                            showSVGChart("DivSvgContainerTFT",filePath);
                        }
                        else if(flag=="CF")
                        {
                            showSVGChart("DivSvgContainerCF",filePath);
                        }
                    }
                }
                }
                else if(IdFlag=="3"||IdFlag=="8")
                {
                    controlIdOrigin=IdText+(Number(IdSer)-2);
                    //alert(controlIdOrigin);
                    var controlOrigin=document.getElementById(controlIdOrigin)
                    //alert(controlOrigin);
                    if(controlOrigin!=null)
                    {
                        var controlXInput=document.getElementById(IdText+(Number(IdSer)-1));
                        var controlYInput=document.getElementById(IdText+(Number(IdSer)));
                        var controlXInputValue;
                        var controlYInputValue;
                        if(controlXInput!=null && controlYInput!=null)
                        {
                            controlXInputValue=controlXInput.value;
                            controlYInputValue=controlYInput.value;
                        }
                        var location=controlOrigin.value;
                        if(location!="")
                        {
                        //alert(location);
                            var xmlContent=oXmlFileDomForDraw.xml;
                            //alert(xmlContent);
                            var oChip_Pos=oXmlFileDomForDraw.getElementsByTagName("CHIP_POS");
                            //alert(oChip_Pos.length);
                            for(var i=0;i<oChip_Pos.length;i++)
                            {
                                if(oChip_Pos[i].nodeTypedValue==location)
                                {
                                    var pro_category=oChip_Pos[i].nextSibling.nodeTypedValue;
                                    //alert(pro_category);
                                    if(pro_category==flag)
                                    {
                                        oLeftBotX=oChip_Pos[i].nextSibling.nextSibling.nodeTypedValue;
                                        oLeftBotY =oChip_Pos[i].nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                        oRightTopX=oChip_Pos[i].nextSibling.nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                        oRightTopY=oChip_Pos[i].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nodeTypedValue;
                                        break;
                                    }
                                }
                             }
                            controlX=document.getElementById(controlIdX);
                            controlY=document.getElementById(controlIdY);
                                if(chartTypeValue==chartTypePoint)
                                {
                                    if(controlX!=null && controlY!=null)
                                    {
                                        controlXValue=controlX.value;
                                        controlYValue=controlY.value;                        
                                        if(controlXValue!="" && controlYValue!="")
                                        {
                                            //point的坐标为ControlX/ControlY的value
                                            //alert("1");
                                            drawPoint(filePath,(Number(controlXValue)+600)/2,(650-Number(controlYValue))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                        }
                                        else if(controlXValue!="" && controlYValue=="")
                                        {
                                            drawPoint(filePath,(Number(controlXValue)+600)/2,(650-Number(oLeftBotY))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                        }
                                        else if(controlXValue=="" && controlYValue!="")
                                        {
                                            drawPoint(filePath,(Number(oLeftBotX)+600)/2,(650-Number(controlYValue))/2,controlIdOrigin ,controlIdX,controlIdY);
                                        }
                                        else
                                        {
                                            drawPoint(filePath,(Number(oLeftBotX)+600)/2,(650-Number(oLeftBotY))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                        }
                                     }
                                  }
                                else if(chartTypeValue==chartTypeLine)
                                {
                                    if(controlX!=null && controlY!=null)
                                    {
                                        controlXValue=controlX.value;
                                        controlYValue=controlY.value;     
                                    }
                                    if(controlXInputValue!="" && controlYInputValue!="")
                                    {
                                        if(controlXInputValue!="-" && controlYInputValue=="-")
                                        {
                                            drawLine(filePath,(Number(oLeftBotX)+600)/2,(650-Number(controlYValue))/2,(Number(oRightTopX)+600)/2,(650-Number(controlYValue))/2,controlIdOrigin ,controlIdX,controlIdY);
                                        }
                                        else if(controlXInputValue=="-" && controlYInputValue!="-")
                                        {
                                            drawLine(filePath,(Number(controlXValue)+600)/2,(650-Number(oLeftBotY))/2,(Number(controlXValue)+600)/2,(650-Number(oRightTopY))/2,controlIdOrigin ,controlIdX,controlIdY);
                                        }
                                        else
                                        {
                                            return;
                                            alert("輸入數據格式不正確!");
                                        }
                                    }
                                    else if(controlXInputValue!="" && controlYInputValue=="")
                                    {
                                        if(controlXInputValue=="-" &&controlYInputValue=="")
                                        {
                                            drawLine(filePath,(Number(oLeftBotX)+600)/2,(650-Number(oLeftBotY))/2,(Number(oLeftBotX)+600)/2,(650-Number(oRightTopY))/2,controlIdOrigin,controlIdX,controlIdY);
                                        }
                                        else
                                        {
                                            return;
                                        }
                                    }
                                    else if(controlXInputValue=="" && controlYInputValue!="")
                                    {
                                        if(controlXInputValue=="" && controlYInputValue=="-")
                                        {
                                            drawLine(filePath,(Number(oLeftBotX)+600)/2,(650-Number(oLeftBotY))/2,(Number(oRightTopX)+600)/2,(650-Number(oLeftBotY))/2,controlIdOrigin ,controlIdX ,controlIdY);
                                        }
                                        else
                                        {
                                            return;
                                        }
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                                if(flag=="TFT")
                                {
                                    showSVGChart("DivSvgContainerTFT",filePath);
                                }
                                else if(flag=="CF")
                                {
                                    showSVGChart("DivSvgContainerCF",filePath);
                                }
                            //}
                        }
                    }
                }
            }
    }
}
function drawLine(filePath,X1Value,Y1Value,X2Value,Y2Value,controlId1,controlId2,controlId3)
{
    var oSVGDom=loadClientFile(filePath);
    var oDefNode=oSVGDom.getElementsByTagName("g")[1];
    //if(oDefNode!=null)
    //{
        var lineId=controlId1+controlId2+controlId3;
        var nodePath="svg/g/line[@id="+"/'"+lineId+"/'"+"]";
        var oLineId=oSVGDom.selectSingleNode(nodePath);
        if(oLineId==null)
        {
            //<line x1="420" y1="0" x2="450" y2="30" stroke="red" stroke-width="2" />
            var oLine=oSVGDom.createElement("line");
            oLine.setAttribute("id",lineId);
            oLine.setAttribute("x1",X1Value);
            oLine.setAttribute("y1",Y1Value);
            oLine.setAttribute("x2",X2Value);
            oLine.setAttribute("y2",Y2Value);
            oLine.setAttribute("stroke","red");
            oLine.setAttribute("stroke-width","2");
            oDefNode.appendChild(oLine);
        }
        else
        {
            oLineId.setAttribute("x1",X1Value);
            oLineId.setAttribute("y1",Y1Value);
            oLineId.setAttribute("x2",X2Value);
            oLineId.setAttribute("y2",Y2Value);
        }
    //}
    var oSVGContent=oSVGDom.xml;
    oSVGDom.save(filePath);
}
function drawPoint(filePath,XValue,YValue,ControlId1,ControlId2,ControlId3)
{
    var oSVGDom=loadClientFile(filePath);
    //alert(oSVGDom.xml);
    //set the location of node inserted into dom
    var oDefNode=oSVGDom.getElementsByTagName("g")[1];
    //if(oDefNode!=null)
    //{
        var pointId=ControlId1+ControlId2+ControlId3;
        //alert(pointId);
        var nodePath="svg/g/circle[@id="+"/'"+pointId+"/'"+"]";
        var oPointId=oSVGDom.selectSingleNode(nodePath);
        //confirm the exist of oPointId(if exist then update,else add new )
        if(oPointId==null)
        {
            var oCircle=oSVGDom.createElement("circle");
            oCircle.setAttribute("id",pointId);
            oCircle.setAttribute("cx",XValue);
            oCircle.setAttribute("cy",YValue);
            oCircle.setAttribute("r","3");
            oCircle.setAttribute("fill","red");
            //var oIdAttr=document.createAttribute("id");
            //oIdAttr.value=pointId;
            //oCircle.setAttributeNode(oIdAttr);
            oDefNode.appendChild(oCircle);
        }
        else
        {  
            oPointId.setAttribute("cx",XValue);
            oPointId.setAttribute("cy",YValue);
           
        }
        var oSVGContent=oSVGDom.xml;
       oSVGDom.save(filePath);
    //}
}
function writeXml(txtId,Path)
{
    var oXmlDom=new createXMLDOM();
    oXmlDom.async=false;
    oXmlDom.onreadystatechange=function()
    {
        if(oXmlDom.readyState==4)
        {
        }
    };
    oXmlDom.load(Path);
   
}
//add option for client select
function addOption()
{
var productSel=document.getElementById("SelectProduct");
var oOption=document.createElement("option");
oOption.appendChild(document.createTextNode("option"+0));
oOption.setAttribute("value",1);
productSel.appendChild(oOption);
var oOption=document.createElement("option");
oOption.appendChild(document.createTextNode("option"+1));
oOption.setAttribute("value",2);
productSel.appendChild(oOption);
var oOption=document.createElement("option");
oOption.appendChild(document.createTextNode("option"+2));
oOption.setAttribute("value",5);
productSel.appendChild(oOption);
}
function chartType(controlId)
{
  var rblChartType=document.getElementById(controlId);
  var cnt=rblChartType.rows.length;
  for(var i=0;i<cnt;i++)
  {
    for(var j=0;j<rblChartType.rows[i].cells.length;j++)
    {
        if(rblChartType.rows[i].cells[j].firstChild!="undefine")
        {
            if(rblChartType.rows[i].cells[j].firstChild.checked==true)
            {
                chartTypeValue=rblChartType.rows[i].cells[j].firstChild.value;
            }
        }
    }
  }
}
function mappingBy(controlId)
{
    var rblMappingBy=document.getElementById(controlId);
    var cnt=rblMappingBy.rows.length;
    for(var i=0;i<cnt;i++)
    {
        for(var j=0;j<rblMappingBy.rows[i].cells.length;j++)
        {
            if(rblMappingBy.rows[i].cells[j].firstChild!="undefine")
            {
                if(rblMappingBy.rows[i].cells[j].firstChild.checked==true)
                {
                    mappingByValue=rblMappingBy.rows[i].cells[j].firstChild.value;
                }
            }
        }
    }
}
function checkChartType()
{
    var rblChartTypeClientId="ctl00_CPHMainZone_rblChartType";
    var rblChartType=document.getElementById(controlId);
    var cnt=rblChartType.rows.length;
    var rblCheckCount=0;
    for(var i=0;i<cnt;i++)
    {
        for(var j=0;j<rblChartType.rows[i].cells.length;j++)
        {
            if(rblChartType.rows[i].cells[j].firstChild!="undefine")
            {
                if(rblChartType.rows[i].cells[j].firstChild.checked==true)
                {
                    rblCheckCount++;
                }
            }
        }
    }
    if(rblCheckCount<=0)
    {
        return false;
        alert("你必須選擇一種Mapping方式!");
    }
    else
    {
        return true;
    }
}
function mappingContInRange()
{
    var valueArr=new Array();
    var table=document.getElementById("tblTFTFixPoint");
    valueArr=ReadControlValueInTable(table);
//    var arr=new Array();
//    var ob={};
//    for(var i=0;i<1;i++)
//    {
//        ob.num=99;
//        ob.xValue=11;
//        ob.yValue=12;
//        ob.chartType="Point";
//        ob.asixType="X"; 
//        arr.push(ob);    
//    }
   var textRange=document.getElementById("txtRange");
   var range=Number(textRange.value);
   Fixed_Point_Line_Mapping.returnMapData(valueArr,range,getValue);
}
function getValue(valueArr)
{
    var arr=new Array();
    arr=valueArr;
    var table1=document.getElementById("tblEQPUnitMappintResult1");
    var table2=document.getElementById("tblEQPUnitMappintResult2");
    var table1RowsCnt=table1.rows.length;
    var table2RowsCnt=table2.rows.length;
    for(var j=1;j<table1RowsCnt;j++)
    {
        table1.deleteRow(table1.rows.length-1);
    }
    for(var h=1;h<table2RowsCnt;h++)
    {
        table2.deleteRow(table2.rows.length-1);
    }
    var obj={};
    var objArr=new Array();
    //var tr1=document.getElementById("tblEQPUnitMappingResult1Tr");
    for(var i=0;i<arr.length;i++)
    {
        var row=table1.insertRow(table1.rows.length);
        var cell1=row.insertCell(row.cells.length);
        var cell2=row.insertCell(row.cells.length);
        var cell3=row.insertCell(row.cells.length);
        var cell4=row.insertCell(row.cells.length);
        var cell5=row.insertCell(row.cells.length);
        var cell6=row.insertCell(row.cells.length);
        cell1.innerText=arr[i].num;
        cell2.innerText=arr[i].shop;
        cell3.innerText=arr[i].line;
        cell4.innerText=arr[i].eqp;
        cell5.innerText=arr[i].unit;
        cell6.innerText=arr[i].distance;      
    }
    if(table1.rows.length>1)
    {
        objArr.push(rows[1].cell[1].innerText+"-"+rows[1].cell[2].innerText+"-"+rows[1].cell[3].innerText+"-"+rows[1].cell[4].innerText);
        for(var k=0;k<objArr.length;k++)
        {
            for(var g=1;g<table1.rows.length;g++)
            {  
                var row=table1.rows[g];
                var eqp_contact_id=row.cell[1].innerText+"-"+row.cell[2].innerText+"-"+row.cell[3].innerText+"-"+row.cell[4].innerText;
            }
        }
    }
}
}
</script>
</asp:Content>

 

原创粉丝点击