<%@ 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">
				
	.style3 { font-size: 24px; color: #669900; }
	.Button{width:75px;height:20px;border:solid 1px;border-color:#ffffff #666666 #666666 #ffffff;margin:3px 0;}
	.SmallButton{width:35px;height:20px;border:solid 1px;border-color:#ffffff #666666 #666666 #ffffff;margin:3px 0;}
	.style7 {font-size: 14px}
	--></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-top: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>
						<p>
							<input name="n7" type="button" class="SmallButton" id="n7" onClick="JS3('7')" value="7">
							<input name="n8" type="button" class="SmallButton" id="n8" onClick="JS3('8')" value="8">
							<input name="n9" type="button" class="SmallButton" id="n9" onClick="JS3('9')" value="9">
							<input name="ys1" type="button" class="SmallButton" id="ys1" onClick="JS3('+')" value="+">
							<input name="ys3" type="button" class="SmallButton" id="ys3" onClick="JS3('*')" value="*">
							<INPUT class="Button" id="dy" onclick="JS2()" type="button" value="=">
							<input name="n4" type="button" class="SmallButton" id="n4" onClick="JS3('4')" value="4">
							<input name="n5" type="button" class="SmallButton" id="n5" onClick="JS3('5')" value="5">
							<input name="n6" type="button" class="SmallButton" id="n6" onClick="JS3('6')" value="6">
							<input name="ys2" type="button" class="SmallButton" id="ys2" onClick="JS3('-')" value="-">
							<input name="ys4" type="button" class="SmallButton" id="ys4" onClick="JS3('/')" value="/">
							<input name="a" type="button" class="SmallButton" id="a" onClick="JS3('(')" value="(">
							<input name="Submit" type="button" class="SmallButton" onClick="Str()" value="<<">
							<input name="n1" type="button" class="SmallButton" id="n1" onClick="JS3('1')" value="1">
							<input name="n2" type="button" class="SmallButton" id="n2" onClick="JS3('2')" value="2">
							<input name="n3" type="button" class="SmallButton" id="n3" onClick="JS3('3')" value="3">
							<input name="n0" type="button" class="SmallButton" id="n0" onClick="JS3('0')" value="0">
							<input name="n" type="button" class="SmallButton" id="n" onClick="JS3('.')" value=".">
							<input name="b" type="button" class="SmallButton" id="b" onClick="JS3(')')" value=")">
							<input type="reset" name="Submit" runat="server" value = "清空" class="SmallButton">
						</p>
					</form>

				</td>
			</tr>

		</table>
	</body>
</html>
