<!-- BEGIN body_calculate.tpl -->
<script type="text/javascript">
// <![CDATA[
<!--
// Affiche le nombre trouver
// @param Nbr le nombre a verifier
function Disp(Nbr) {
document.forms["MainForm"].calcResult.value = Nbr;
} // end of function Disp
// clear the claculate
function ClearCalc() {
A = ''; B = ''; C = "blank"; Disp("");
} // end of function ClearCalc
// annule the claculate
function CECalc() {
B = ''; C = "yes"; Disp("");
} // end of function CECalc
// recherche le nombre
// @param Nbr le nombre a verifier
function Proceed(Nbr) {
if (Nbr == ".") {
Number = document.forms["MainForm"].calcResult.value;
if (Number.indexOf(".") != -1) { Nbr = ''; }
}
if (C == "yes") {
B += Nbr; Disp(B);
}
else {
if(C == "blank") {
A = Nbr; B = ''; C = "no";
}
else {
A += Nbr;
}
Disp(A);
}
} // end of function Proceed
// Additionne les chiffres
// @param xy les chiffres a additionner
function btnAdd(xy) {
if (xy == 1) btnSubmit();
if (B != "") { A = parseFloat(A) + parseFloat(B); }
C = "yes"; Operand = '+'; Disp(A);
} // end of function btnAdd
// Soustrait les chiffres
// @param xy les chiffres a soustraire
function btnSub(xy) {
if (xy == 1) btnSubmit();
if (B != "") { A = parseFloat(A) - parseFloat(B); }
C = "yes"; Operand = '-'; Disp(A);
} // end of function btnSub
// Multiplie les chiffres
// @param xy les chiffres a multiplier
function btnMul(xy) {
if (xy == 1) btnSubmit();
if (B != "") { A = parseFloat(A) * parseFloat(B); }
C = "yes"; Operand = '*'; Disp(A);
} // end of function btnMul
// Divise les chiffres
// @param xy les chiffres a diviser
function btnDiv(xy) {
if (xy == 1) btnSubmit();
if (B != "") { A = parseFloat(A) / parseFloat(B); }
C = "yes"; Operand = '/'; Disp(A);
} // end of function btnDiv
// Change le signe (- + / *)
function btnChangeSign() {
A = parseFloat(-A); C = "no"; Disp(A);
} // end of function btnChangeSign
// Le bouton submit
function btnSubmit() {
if (Operand == '+') btnAdd(0);
if (Operand == '-') btnSub(0);
if (Operand == '*') btnMul(0);
if (Operand == '/') btnDiv(0);
B = ''; Operand = '';
} // end of function btnSubmit
// Convertie de l'Euro à la monnaie
// @param xy le chiffre a verifier
function EuToFr(xy) {
Disp(Math.round(100 * (A * "{__EUROS}"))/100);
} // end of function EuToFr
// Convertie de la monnaie à l'Euro
// @param xy le chiffre a verifier
function FrToEu(xy) {
Disp(Math.round(100 * (A / "{__EUROS}"))/100);
} // end of function FrToEu
//-->
// ]]>
</script>
<form action="{SELF}" method="post" id="MainForm">
<table class="calcBody" cellpadding="1" cellspacing="1">
<tr>
<td class="clDotNetHeader" colspan="4">{CALCUL_IMG_ALT} : <br /> {IMG_TXT_EUROS} - {_MONNAIE}</td>
</tr>
<tr class="top">
<td colspan="4"><input name="calcResult" type="text" size="26" class="calcInput" readonly="readonly" onfocus="this.blur()" /></td>
</tr>
<tr class="topCenter">
<td><input name="calc7" type="button" value="CE" class="calcButton" onclick="CECalc();" /></td>
<td><input name="calcReset" type="reset" value="C" class="calcButton" onclick="ClearCalc();" /></td>
<td><a href="javascript:void(0)" onclick="FrToEu(1);"><img src="?flag=0" height="22" width="22" alt="{IMG_ALT_EUROS}" title="{IMG_ALT_EUROS}" /></a></td>
<td><a href="javascript:void(0)" onclick="EuToFr(1);"><img src="?flag={CHOIX_IMAGES_CAL}" alt="{_MONNAIE} - {IMG_ALT_OTHER}" title="{_MONNAIE} - {IMG_ALT_OTHER}" height="22" width="22" /></a></td>
</tr>
<tr class="top">
<td><input name="calc7" type="button" value="7" class="calcButton" onclick="Proceed('7');" /></td>
<td><input name="calc8" type="button" value="8" class="calcButton" onclick="Proceed('8');" /></td>
<td><input name="calc9" type="button" value="9" class="calcButton" onclick="Proceed('9');" /></td>
<td><input name="calcDiv" type="button" value="/" class="calcButton" onclick="btnDiv(1);" /></td>
</tr>
<tr class="top">
<td><input name="calc4" type="button" value="4" class="calcButton" onclick="Proceed('4');" /></td>
<td><input name="calc5" type="button" value="5" class="calcButton" onclick="Proceed('5');" /></td>
<td><input name="calc6" type="button" value="6" class="calcButton" onclick="Proceed('6');" /></td>
<td><input name="calcMul" type="button" value="*" class="calcButton" onclick="btnMul(1);" /></td>
</tr>
<tr class="top">
<td><input name="calc1" type="button" value="1" class="calcButton" onclick="Proceed('1');" /></td>
<td><input name="calc2" type="button" value="2" class="calcButton" onclick="Proceed('2');" /></td>
<td><input name="calc3" type="button" value="3" class="calcButton" onclick="Proceed('3');" /></td>
<td><input name="calcSub" type="button" value="-" class="calcButton" onclick="btnSub(1);" /></td>
</tr>
<tr class="top">
<td><input name="calc0" type="button" value="0" class="calcButton" onclick="Proceed('0');" /></td>
<td><input name="calcChangeSign" type="button" value="+/-" class="calcButton" onclick="btnChangeSign(1);" /></td>
<td><input name="calcDot" type="button" value="," class="calcButton" onclick="Proceed('.');" /></td>
<td><input name="calcAdd" type="button" value="+" class="calcButton" onclick="btnAdd(1);" /></td>
</tr>
<tr class="top">
<td colspan="4"><input name="calcSubmit" type="button" value=" = " class="calcSubmit" onclick="btnSubmit(1);" /></td>
</tr>
</table></form>
<!-- END body_calculate.tpl -->