<%@ Page CodeBehind="Jsq.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="SWTraining.Tools.Jsq"
    Title="运算式计算器" %>

<%@ Import Namespace="SWTraining" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <link id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
    <base target="_self" />
    <style type="text/css">
        .Button
        {
            width: 75px;
            margin: 0px;
        }
        .SmallButton
        {
            width: 35px;
            margin: 0px;
        }
        -- ></style>
    <script>

        function JS2() {
            form1.da2.value = eval(form1.gs.value);
        }

        function JS3(txt) {
            form1.gs.value += txt;
        }

        function Str() {
            form1.gs.value = form1.gs.value.substring(0, eval(form1.gs.value.length - 1));
        }
        //function Clear()
        //{
        //da2.innerHTML = "";
        //}

    </script>
</head>
<body onkeydown="if (event.keyCode==116){reload.click()};" style="margin:0px; padding:0px">
    <a id="reload" href="Jsq.aspx" style="display: none">reload...</a>
    <table border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td align="center" class="style3" style="width: 283px; height: 22px">
                <font color="#0000ff" size="3">运算式计算器</font>
            </td>
        </tr>
        <tr>
            <td align="left" style="width: 283px; height: 86px">
                <form name="form1" method="post" action="">
                <p>
                    公式：<input name="gs" type="text" id="gs" style="width: 205px"><br />
                    结果：<input id="da2" type="text" style="width: 205px">
                </p>
                <table>
                    <tr>
                        <td>
                            <label class="lab_buttom">
                                <input name="n7" type="button" class="SmallButton" id="n7" onclick="JS3('7')" value="7"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="n8" type="button" class="SmallButton" id="n8" onclick="JS3('8')" value="8"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="n9" type="button" class="SmallButton" id="n9" onclick="JS3('9')" value="9"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="ys1" type="button" class="SmallButton" id="ys1" onclick="JS3('+')" value="+"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="ys3" type="button" class="SmallButton" id="ys3" onclick="JS3('*')" value="*"></label>
                        </td>
                        <td colspan="2">
                            <label class="lab_buttom">
                                <input class="Button" id="dy" onclick="JS2()" type="button" value="="></label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="lab_buttom">
                                <input name="n4" type="button" class="SmallButton" id="n4" onclick="JS3('4')" value="4"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="n5" type="button" class="SmallButton" id="n5" onclick="JS3('5')" value="5"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="n6" type="button" class="SmallButton" id="n6" onclick="JS3('6')" value="6"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="ys2" type="button" class="SmallButton" id="ys2" onclick="JS3('-')" value="-"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="ys4" type="button" class="SmallButton" id="ys4" onclick="JS3('/')" value="/"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="a" type="button" class="SmallButton" id="a" onclick="JS3('(')" value="("></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="Submit" type="button" class="SmallButton" onclick="Str()" value="<<"></label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="lab_buttom">
                                <input name="n1" type="button" class="SmallButton" id="n1" onclick="JS3('1')" value="1"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="n2" type="button" class="SmallButton" id="n2" onclick="JS3('2')" value="2"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="n3" type="button" class="SmallButton" id="n3" onclick="JS3('3')" value="3"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="n0" type="button" class="SmallButton" id="n0" onclick="JS3('0')" value="0"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="n" type="button" class="SmallButton" id="n" onclick="JS3('.')" value="."></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input name="b" type="button" class="SmallButton" id="b" onclick="JS3(')')" value=")"></label>
                        </td>
                        <td>
                            <label class="lab_buttom">
                                <input id="Reset1" type="reset" name="Submit" runat="server" value="清空" class="SmallButton"></label>
                        </td>
                    </tr>
                </table>
                </form>
            </td>
        </tr>
    </table>
</body>
</html>
