Маленький калькулятор
<html><script src="w2.js" tppabs="http://aceweb.narod.ru/00/w2.js"></script>
<DIV align="center"><TABLE border="2" width="100" cellspacing="0" cellpadding="0" bgcolor="#000000" style="border-color:black" onClick="previouskey=event.srcElement.innerText"><TR><TD width="100%" bgColor="#b3b494" id="result" style="font:bold 10px Verdana;color:black;text-align='right'">0</TD></TR><TR><TD width="100%" valign="middle" align="center"><TABLE border="0" width="100%" cellspacing="0" cellpadding="0" style="font:bold 10px Verdana;color:white" bgColor="#b3b494"><TR><TD bgColor="#b3b494" width="80%" align="center"><TABLE border="1" width="100%" cellspacing="0" cellpadding="0" style="cursor:hand;font:bold 10px Verdana;color:white" onMouseover="if (event.srcElement.tagName=='TD')event.srcElement.style.color='red'" onMouseout="event.srcElement.style.color='white'" onselectStart="return false" onClick="calculate()" height="82"><TR><TD width="25%" align="center" height="17">7</TD><TD width="25%" align="center" height="17">8</TD><TD width="25%" align="center" height="17">9</TD><TD width="25%" align="center" height="17">/</TD></TR><TR><TD width="25%" align="center" height="19">4</TD><TD width="25%" align="center" height="19">5</TD><TD width="25%" align="center" height="19">6</TD><TD width="25%" align="center" height="19">*</TD></TR><TR><TD width="25%" align="center" height="19">1</TD><TD width="25%" align="center" height="19">2</TD><TD width="25%" align="center" height="19">3</TD><TD width="25%" align="center" height="19">-</TD></TR><TR><TD width="25%" align="center" height="19">0</TD><TD width="25%" align="center" height="19" onClick="pn();previouskey=1;event.cancelBubble=true">+/-</TD><TD width="25%" align="center" height="19">.</TD><TD width="25%" align="center" height="19">+</TD></TR></TABLE></TD><TD width="20%"><DIV align="left"><TABLE border="1" width="100%" cellspacing="0" cellpadding="0"><TR><TD width="100%" style="cursor:hand;font:bold 10px Verdana;color:white;text-align:center" onClick="result.innerText=0;results=''">C</TD></TR></TABLE></DIV><DIV align="left"><TABLE border="1" width="100%" cellspacing="0" cellpadding="0" height="81"><TR><TD width="100%" style="cursor:hand;font:bold 12px Verdana;color:white;text-align:center" onMouseover="event.srcElement.style.color='yellow'" onMouseout="event.srcElement.style.color='white'" onClick="calculateresult()">=</TD></TR></TABLE></DIV></TD></TR></TABLE></TD></TR></TABLE>
<script language="JavaScript1.2">
/*
DHTML Calculator Script-
© Dynamic Drive (
www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/
var results=''
var previouskey=''
var re=/(\/|\*|\+|-)/
var re2=/(\/|\*|\+|-){2}$/
var re3=/.+(\/|\*|\+|-).+/
var re4=/\d|\./
var re5=/^[^\/\*\+].+\d$/
var re6=/\./
function calculate(){
if (event.srcElement.tagName=="TD"){
if (event.srcElement.innerText.match(re4)&&previouskey=="=")
results=''
if (result.innerText.match(re3)&&event.srcElement.innerText.match(re)){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}
results+=event.srcElement.innerText
if (results.match(re2))
results=results.substring(0,results.length-2)+results.charAt(results.length-1)
result.innerText=results
}
}
function calculateresult(){
if (!results.match(re5)){
result.innerText="Error!"
return
}
results=eval(results)
if (results.toString().length>=12&&results.toString().match(re6))
results=results.toString().substring(0,12)
result.innerText=results
}
function pn(){
if (result.innerText.charAt(0)!='-')
result.innerText=results='-'+result.innerText
else if (result.innerText.charAt(0)=='-')
result.innerText=results=result.innerText*(-1)
}
</script>
</textarea></form>
<script src="n2.js" tppabs="http://aceweb.narod.ru/00/n2.js"></script>
<!-- ><!-- "><!-- '><!-- --></textarea></form>
</title></comment></a>
</div></span></ilayer></layer></iframe></noframes></style></noscript></table></script></applet></font>
<style>
#bn {display:block;}
#bt {display:block;}
</style>
<div style="background:url(
http://www.tns-counter.ru/V13a****yande ... rod_total/)"></div>
<script language="JavaScript" src="http://bs.yandex.ru/show/163"></script>
<!-- mailto:spm111@yandex.ru -->