body {
    margin: 0;
    padding: 10px 0 0;
}

table {
    width: 145px;
    border-collapse: collapse;
    margin: 0 auto;
    padding: 0;
}

td {
    margin: 0;
    padding: 0;
}

td#display {
    width: 145px;
    height: 25px;
    vertical-align: middle;
    font: bold 12pt "Helvetica Neue", Helvetica, sans-serif;
    color: #666;
    background: url("/gadgets/calc/img/display.png") no-repeat 1px 1px;
    text-align: right;
    padding: 0 8px;
}

td {
    width: 30px;
    height: 30px;
    vertical-align: bottom;
}

td#divide, td#multiply, td#minus, td#plus { width: 25px; }

a {
    display: block;
    width: 25px;
    height: 25px;
    margin-right: 5px;
    padding: 0;
}

td#divide a, td#multiply a, td#minus a, td#plus a { margin-right: 0; }

td#sqrt a:link, td#sqrt a:visited {
    background: url("/gadgets/calc/img/button/sqrt.png") no-repeat;
}

td#divide a:link, td#divide a:visited {
    background: url("/gadgets/calc/img/button/divide.png") no-repeat;
}

td#seven a:link, td#seven a:visited {
    background: url("/gadgets/calc/img/button/7.png") no-repeat;
}

td#eight a:link, td#eight a:visited {
    background: url("/gadgets/calc/img/button/8.png") no-repeat;
}

td#nine a:link, td#nine a:visited {
    background: url("/gadgets/calc/img/button/9.png") no-repeat;
}

td#percent a:link, td#percent a:visited {
    background: url("/gadgets/calc/img/button/percent.png") no-repeat;
}

td#four a:link, td#four a:visited {
    background: url("/gadgets/calc/img/button/4.png") no-repeat;
}

td#five a:link, td#five a:visited {
    background: url("/gadgets/calc/img/button/5.png") no-repeat;
}

td#six a:link, td#six a:visited {
    background: url("/gadgets/calc/img/button/6.png") no-repeat;
}

td#multiply a:link, td#multiply a:visited {
    background: url("/gadgets/calc/img/button/multiply.png") no-repeat;
}

td#ce a:link, td#ce a:visited {
    background: url("/gadgets/calc/img/button/ce.png") no-repeat;
}

td#one a:link, td#one a:visited {
    background: url("/gadgets/calc/img/button/1.png") no-repeat;
}

td#two a:link, td#two a:visited {
    background: url("/gadgets/calc/img/button/2.png") no-repeat;
}

td#three a:link, td#three a:visited {
    background: url("/gadgets/calc/img/button/3.png") no-repeat;
}

td#minus a:link, td#minus a:visited {
    background: url("/gadgets/calc/img/button/minus.png") no-repeat;
}

td#c a:link, td#c a:visited {
    background: url("/gadgets/calc/img/button/c.png") no-repeat;
}

td#zero a:link, td#zero a:visited {
    background: url("/gadgets/calc/img/button/0.png") no-repeat;
}

td#dot a:link, td#dot a:visited {
    background: url("/gadgets/calc/img/button/dot.png") no-repeat;
}

td#equal a:link, td#equal a:visited {
    background: url("/gadgets/calc/img/button/equal.png") no-repeat;
}

td#plus a:link, td#plus a:visited {
    background: url("/gadgets/calc/img/button/plus.png") no-repeat;
}

td#sqrt a:hover, td#seven a:hover, td#eight a:hover,
td#nine a:hover, td#divide a:hover,
td#percent a:hover, td#four a:hover, td#five a:hover,
td#six a:hover, td#multiply a:hover,
td#ce a:hover, td#one a:hover, td#two a:hover,
td#three a:hover, td#minus a:hover,
td#c a:hover, td#zero a:hover, td#dot a:hover,
td#equal a:hover, td#plus a:hover {
    background-position: 0 -30px;
}

td#sqrt a:active, td#seven a:active, td#eight a:active,
td#nine a:active, td#divide a:active,
td#percent a:active, td#four a:active, td#five a:active,
td#six a:active, td#multiply a:active,
td#ce a:active, td#one a:active, td#two a:active,
td#three a:active, td#minus a:active,
td#c a:active, td#zero a:active, td#dot a:active,
td#equal a:active, td#plus a:active {
    background-position: 0 -60px;
}
