// $Id: IMcalculator.js 22 2008-10-15 10:25:00Z pascal $
// AK Calculator v1.0 - Copyright (c) 2004 AKwebtools.com
// This script is designed and implemented by Kiet Ho
// This copyright notice MUST stay intact for use (see license.txt).
//
// Calculatrice gratuite sous licence FreeBSD. 
// Améliorée par Tom_Pascal dans le cadre d'une utilisation exclusive
// au sein du site http://www.ilemaths.net

	var newWin_doc = null;
	var newWin = null;
	var nextnumber = 0;
	var decimal = 0;
	var currentOperator = null;
	var number_1 = 0;
	var isConstant = 0;
	var memory = 0;
	var radian = false;
	
	function onRadiobutton(num){
		
		if (num == 1) {
			radian = false;
		} else {
			radian = true;
		}
	}
	
	function getAngleValue(){
		if (radian){
			return parseFloat(newWin_doc.getElementById('displaybox').value);			
		} else {
			return ((parseFloat(newWin_doc.getElementById('displaybox').value) * Math.PI) / 180);
		}
	}
	
	function displayAngleValue(num){
		if (radian){
			return num;			
		} else {
			return ((num * 180) / Math.PI);
		}
	}
	
	
	function reset(){
		nextnumber = 0;
		decimal = 0;
		currentOperator = null;
		number_1 = 0;
		newWin_doc.getElementById('displaybox').value = '0';
	}
	
	function compute(){
		switch(currentOperator) {
			case 'div':
				newWin_doc.getElementById('displaybox').value = number_1 / parseFloat(newWin_doc.getElementById('displaybox').value);
				currentOperator = null;
				break;
			case 'mul':
				newWin_doc.getElementById('displaybox').value = number_1 * parseFloat(newWin_doc.getElementById('displaybox').value);
				currentOperator = null;
				break;
			case 'sub':
				newWin_doc.getElementById('displaybox').value = number_1 - parseFloat(newWin_doc.getElementById('displaybox').value);
				currentOperator = null;
				break;
			case 'add':
				newWin_doc.getElementById('displaybox').value = number_1 + parseFloat(newWin_doc.getElementById('displaybox').value);
				currentOperator = null;
				break;
			case 'xy':
				newWin_doc.getElementById('displaybox').value = Math.pow(number_1, parseFloat(newWin_doc.getElementById('displaybox').value));
				currentOperator = null;
				break;			
		}
	}
	
	function unary_computer(op) {
		switch(op) {
			case '%':
				newWin_doc.getElementById('displaybox').value = (number_1 * parseFloat(newWin_doc.getElementById('displaybox').value))/100;
				break;	
			case 'sqrt':
				newWin_doc.getElementById('displaybox').value = Math.pow(parseFloat(newWin_doc.getElementById('displaybox').value), (1/2));
				break;
			case 'cbrt':
				newWin_doc.getElementById('displaybox').value = Math.pow(parseFloat(newWin_doc.getElementById('displaybox').value), (1/3));
				break;
			case '1x':
				newWin_doc.getElementById('displaybox').value = 1 / parseFloat(newWin_doc.getElementById('displaybox').value);
				break;
			case 'n!':
				var m = parseFloat(newWin_doc.getElementById('displaybox').value);
				var result = 1;
				for (var n=1; n <= m; n++)
				{
					result = result * n;
				}
				newWin_doc.getElementById('displaybox').value = result;
				break;
			case 'ex':
				newWin_doc.getElementById('displaybox').value = Math.pow(Math.E, parseFloat(newWin_doc.getElementById('displaybox').value));
				break;
			case 'x2':
				newWin_doc.getElementById('displaybox').value = Math.pow(parseFloat(newWin_doc.getElementById('displaybox').value), 2);
				break;
			case 'x3':
				newWin_doc.getElementById('displaybox').value = Math.pow(parseFloat(newWin_doc.getElementById('displaybox').value), 3);
				break;
			case 'ln':
				newWin_doc.getElementById('displaybox').value = Math.log(parseFloat(newWin_doc.getElementById('displaybox').value));
				break;
			case 'log':
				newWin_doc.getElementById('displaybox').value = Math.log(parseFloat(newWin_doc.getElementById('displaybox').value))/Math.log(10);
				break;
			case 'sin':
				newWin_doc.getElementById('displaybox').value = Math.sin(getAngleValue());
				break;
			case 'cos':
				newWin_doc.getElementById('displaybox').value = Math.cos(getAngleValue());
				break;
			case 'tan':
				newWin_doc.getElementById('displaybox').value = Math.tan(getAngleValue());
				break;
			case 'asin':
				newWin_doc.getElementById('displaybox').value = displayAngleValue(Math.asin(parseFloat(newWin_doc.getElementById('displaybox').value)));
				break;
			case 'acos':
				newWin_doc.getElementById('displaybox').value = displayAngleValue(Math.acos(parseFloat(newWin_doc.getElementById('displaybox').value)));
				break;
			case 'atan':
				newWin_doc.getElementById('displaybox').value = displayAngleValue(Math.atan(parseFloat(newWin_doc.getElementById('displaybox').value)));
				break;
		}
	}
	

	function buttonaction(inputValue){
		newWin_doc.getElementById('displaybox').value = parseFloat(newWin_doc.getElementById('displaybox').value);
	
		var value = parseFloat(inputValue);
		if (nextnumber == 1 && number_1 != 0)
		{
			newWin_doc.getElementById('displaybox').value = '0';
			nextnumber = 0;
		}
		if (decimal == 1) {
			newWin_doc.getElementById('displaybox').value = newWin_doc.getElementById('displaybox').value + '.';
			decimal = 2;			
		}
		switch (inputValue) {
			case '0':
				if (isConstant == 1) 
				{
					newWin_doc.getElementById('displaybox').value = '0';
					isConstant = 0;
				}
				if (newWin_doc.getElementById('displaybox').value != '0') {
					newWin_doc.getElementById('displaybox').value = newWin_doc.getElementById('displaybox').value + inputValue;
				}
				break;
			case '1':		
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':
				if (isConstant == 1) 
				{
					newWin_doc.getElementById('displaybox').value = '0';
					isConstant = 0;
				}
				newWin_doc.getElementById('displaybox').value = parseFloat(newWin_doc.getElementById('displaybox').value + inputValue);
				break;			
			case '.':	
				if (decimal == 0) {
					decimal = 1;
				}
				break;
			case '+-':
				newWin_doc.getElementById('displaybox').value = parseFloat(newWin_doc.getElementById('displaybox').value) * (-1);
				decimal = 0;
				break;				
			case 'div':
				compute();
				number_1 = parseFloat(newWin_doc.getElementById('displaybox').value);
				currentOperator = 'div';
				nextnumber = 1;
				decimal = 0;
				break;
			case 'mul':
				compute();
				number_1 = parseFloat(newWin_doc.getElementById('displaybox').value);
				currentOperator = 'mul';
				nextnumber = 1;
				decimal = 0;
				break;
			case 'sub':
				compute();
				number_1 = parseFloat(newWin_doc.getElementById('displaybox').value);
				currentOperator = 'sub';
				nextnumber = 1;
				decimal = 0;
				break;
			case 'xy':
				compute();
				number_1 = parseFloat(newWin_doc.getElementById('displaybox').value);
				currentOperator = 'xy';
				nextnumber = 1;
				decimal = 0;
				break;
			case 'add':
				compute();
				number_1 = parseFloat(newWin_doc.getElementById('displaybox').value);
				currentOperator = 'add';
				nextnumber = 1;
				decimal = 0;
				break;
			case 'n!':
				unary_computer('n!');
				isConstant = 1;
				decimal = 0;
				break;
			case 'ex':
				unary_computer('ex');
				isConstant = 1;
				decimal = 0;
				break;
			case 'x2':
				unary_computer('x2');
				isConstant = 1;
				decimal = 0;
				break;
			case 'x3':
				unary_computer('x3');
				isConstant = 1;
				decimal = 0;
				break;
			case 'ln':
				unary_computer('ln');
				isConstant = 1;
				decimal = 0;
				break;
			case 'log':
				unary_computer('log');
				isConstant = 1;
				decimal = 0;
				break;
			case '1x':
				unary_computer('1x');
				isConstant = 1;
				decimal = 0;
				break;
			case 'sin':
				unary_computer('sin');
				isConstant = 1;
				decimal = 0;
				break;
			case 'cos':
				unary_computer('cos');
				isConstant = 1;
				decimal = 0;
				break;
			case 'tan':
				unary_computer('tan');
				isConstant = 1;
				decimal = 0;
				break;	
			case 'asin':
				unary_computer('asin');
				isConstant = 1;
				decimal = 0;
				break;
			case 'acos':
				unary_computer('acos');
				isConstant = 1;
				decimal = 0;
				break;
			case 'atan':
				unary_computer('atan');
				isConstant = 1;
				decimal = 0;
				break;			
			case 'sqrt':
				unary_computer('sqrt');
				isConstant = 1;
				decimal = 0;
				break;
			case 'cbrt':
				unary_computer('cbrt');
				isConstant = 1;
				decimal = 0;
				break;
			case '%':
				unary_computer('%');
				isConstant = 1;
				decimal = 0;
				break;
			case 'pi':
				newWin_doc.getElementById('displaybox').value = Math.PI;
				isConstant = 1;
				decimal = 0;
				break;
			case 'ms':
				memory = parseFloat(newWin_doc.getElementById('displaybox').value);
				newWin_doc.getElementById('memstatus').value = "  M   ";
				isConstant = 1;
				break;
			case 'mr':
				newWin_doc.getElementById('displaybox').value = memory;
				isConstant = 1;
				break;
			case 'mc':
				memory = 0;
				newWin_doc.getElementById('memstatus').value = "";
				isConstant = 1;
				break;
			case 'm+':
				memory = memory + parseFloat(newWin_doc.getElementById('displaybox').value);
				newWin_doc.getElementById('memstatus').value = "  M   ";
				isConstant = 1;
				break;
			case 'm-':
				memory = memory - parseFloat(newWin_doc.getElementById('displaybox').value);
				newWin_doc.getElementById('memstatus').value = "  M   ";
				isConstant = 1;
				break;
			case '=':
				compute();
				number_1 = 0;
				isConstant = 1; 
				currentOperator = null;
				decimal = 0;
				break;
			case 'ac':
				reset();
				break;
			case 'ce':
				newWin_doc.getElementById('displaybox').value = '0';
				decimal = 0;
				break;
			case 'bs':
				if (isConstant == 0) {
					var tmp = newWin_doc.getElementById('displaybox').value;				
					tmp = tmp.substring(0, (tmp.length-1));
					if (tmp.length <= 0) {tmp = '0';}
					newWin_doc.getElementById('displaybox').value = parseFloat(tmp);
				}
				break;
			default:
				newWin_doc.getElementById('displaybox').value = "Invalide";
		}
		if (newWin_doc.getElementById('displaybox').value == 'NaN') {
			newWin_doc.getElementById('displaybox').value = "Entree invalide pour la fonction";
		}
		if (newWin_doc.getElementById('displaybox').value.indexOf('.') < 0) {
			newWin_doc.getElementById('displaybox').value = newWin_doc.getElementById('displaybox').value + '.';
		}
	}

	
function im_calculatrice() {
	var space = "";
	newWin = window.open("", "Calculator", "width=285,height=273,status=no,resizable=no, scrollbars=no,top=200,left=300");
	newWin.opener = self;
	newWin_doc = newWin.document;
	if(navigator.appName == "Microsoft Internet Explorer"){space = "&nbsp;";}
	
newWin_doc.writeln('<html>');
newWin_doc.writeln('<head>');
	newWin_doc.writeln('<title>Calculatrice IleMaths</title>');
	newWin_doc.writeln('<style type="text/css">');
	newWin_doc.writeln('.bgstyle { background-color: buttonface; };');
	newWin_doc.writeln('.btn {margin: 0; padding: 0; };');
	newWin_doc.writeln('</style>');
	
newWin_doc.writeln('</head>');

newWin_doc.writeln('<body class="bgstyle" background="img/calc_fond.gif">');
newWin_doc.writeln('<table cellpadding="0" cellspacing="0" border="0">');
	if(navigator.appName == "Microsoft Internet Explorer"){
		newWin_doc.writeln('<tr><td><input id="displaybox" type="Text" size="39" value="0." style="text-align:right; background-color:#FFFFFF; color:#000000;border-color:#c0c0c0;" readonly="true"></td></tr>');
	} else {
		newWin_doc.writeln('<tr><td><input id="displaybox" type="Text" size="41" value="0." style="text-align:right; background-color:#FFFFFF; color:#000000;border-color:#c0c0c0;" readonly="true"></td></tr>');
	}
	newWin_doc.writeln('<tr><td align="center">');
		newWin_doc.writeln('<table width="80%"><tr><td width="50%" align="center">');
		newWin_doc.writeln('<input type="radio" name="angle" onClick="window.opener.onRadiobutton(1);"  checked> <font color="#9900cc" size="-2" face="Verdana">Degr&eacute;s</font>');
		newWin_doc.writeln('</td><td  width="50%" align="center">');
		newWin_doc.writeln('<input type="radio" name="angle" onClick="window.opener.onRadiobutton(2);"> <font color="#9900cc" size="-2" face="Verdana">Radians</font>&nbsp;');
		newWin_doc.writeln('</td></tr></table>');
	newWin_doc.writeln('</td></tr>');
	newWin_doc.writeln('<tr><td>');
		newWin_doc.writeln('<table width="100%" cellpadding="0" cellspacing="0"><tr>');
		newWin_doc.writeln('<td align="left" valign="bottom">');
		newWin_doc.writeln('<input id="memstatus" type="Text" value="" style="width: 30px; height: 27px; text-align:right; BACKGROUND:#FFFFFF; color:#000000;border-color:#c0c0c0;" readonly="true">');
		newWin_doc.writeln('</td>');
		newWin_doc.writeln('<td align="right">');
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 60px; height: 27px;" onclick="window.opener.buttonaction(\'bs\');"><font color="#009900" size="-2" face="Verdana"><strong>BS</strong></font></button>');
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 60px; height: 27px;" onclick="window.opener.buttonaction(\'ce\');"><font color="#009900" size="-2" face="Verdana"><strong>CE</strong></font></button>');
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 60px; height: 27px;" onclick="window.opener.buttonaction(\'ac\');"><font color="#009900" size="-2" face="Verdana"><strong>AC</strong></font></button>');
		newWin_doc.writeln('</td>');
		newWin_doc.writeln('</tr></table>');
	newWin_doc.writeln('</td></tr>	');
	newWin_doc.writeln('<tr><td></td></tr>');
	newWin_doc.writeln('<tr><td>');
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'log\');"><font color="#ff66ff" size="-2" face="Verdana"><strong>Log</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'ln\');"><font color="#ff66ff" size="-2" face="Verdana"><strong>Ln</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'7\');"><font color="#3366ff" size="-2" face="Verdana"><strong>7</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'8\');"><font color="#3366ff" size="-2" face="Verdana"><strong>8</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'9\');"><font color="#3366ff" size="-2" face="Verdana"><strong>9</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'div\');"><font color="#3366ff" size="-2" face="Verdana"><strong>/</strong></font></button>' + space);
		if(navigator.appName == "Microsoft Internet Explorer"){
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'sqrt\');"><font color="#009900" size="-2" face="Verdana"><strong><img src="img/calc_racine.gif"></strong></font></button>' + space);
		}else{
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'sqrt\');"><font color="#009900" size="-2" face="Verdana"><strong>V</strong></font></button>' + space);
		}
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'mc\');"><font color="#ff3300" size="-2" face="Verdana"><strong>MC</strong></font></button>');
		
	newWin_doc.writeln('</td></tr>');
	newWin_doc.writeln('<tr><td>');
		if(navigator.appName == "Microsoft Internet Explorer"){
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'xy\');"><font color="#ff66ff" size="-2" face="Verdana"><strong>x<sup>y</sup></strong></font></button>' + space);
		}else{
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'xy\');"><font color="#ff66ff" size="-2" face="Verdana"><strong>x^y</strong></font></button>' + space);
		}
		if(navigator.appName == "Microsoft Internet Explorer"){
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'ex\');"><font color="#ff66ff" size="-2" face="Verdana"><strong>e<sup>x</sup></strong></font></button>' + space);
		}else{
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'ex\');"><font color="#ff66ff" size="-2" face="Verdana"><strong>e^x</strong></font></button>' + space);
		}
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'4\');"><font color="#3366ff" size="-2" face="Verdana"><strong>4</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'5\');"><font color="#3366ff" size="-2" face="Verdana"><strong>5</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'6\');"><font color="#3366ff" size="-2" face="Verdana"><strong>6</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'mul\');"><font color="#3366ff" size="-2" face="Verdana"><strong>&times;</strong></font></button>' + space);
		if(navigator.appName == "Microsoft Internet Explorer"){
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'cbrt\');"><font color="#009900" size="-2" face="Verdana"><strong>&sup3;<img src="img/calc_racine.gif"></strong></font></button>' + space);
		}else{
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'cbrt\');"><font color="#009900" size="-2" face="Verdana"><strong>&sup3;V</strong></font></button>' + space);
		}
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'mr\');"><font color="#ff3300" size="-2" face="Verdana"><strong>MR</strong></font></button>');
		
	newWin_doc.writeln('</td></tr>');
	
	newWin_doc.writeln('<tr><td>');
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'x2\');"><font color="#ff66ff" size="-2" face="Verdana"><strong>x&sup2;</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'n!\');"><font color="#ff66ff" size="-2" face="Verdana"><strong>n!</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'1\');"><font color="#3366ff" size="-2" face="Verdana"><strong>1</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'2\');"><font color="#3366ff" size="-2" face="Verdana"><strong>2</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'3\');"><font color="#3366ff" size="-2" face="Verdana"><strong>3</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'sub\');"><font color="#3366ff" size="-2" face="Verdana"><strong>&ndash;</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'%\');"><font color="#009900" size="-2" face="Verdana"><strong>%</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'ms\');"><font color="#ff3300" size="-2" face="Verdana"><strong>MS</strong></font></button>');
		
	newWin_doc.writeln('</td></tr>');
	
	newWin_doc.writeln('<tr><td>');
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'x3\');"><font color="#ff66ff" size="-2" face="Verdana"><strong>x&sup3;</sup></strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'1x\');"><font color="#ff66ff" color="#ff66ff" size="-2" face="Verdana"><strong>1/x</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'0\');"><font color="#3366ff" size="-2" face="Verdana"><strong>0</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'+-\');"><font color="#3366ff" size="-2" face="Verdana"><strong>+/-</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'.\');"><font color="#3366ff" size="-2" face="Verdana"><strong>.</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'add\');"><font color="#3366ff" size="-2" face="Verdana"><strong>+</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'=\');"><font color="#3366ff" size="-2" face="Verdana"><strong>=</strong></font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'m+\');"><font color="#ff3300" size="-2" face="Verdana"><strong>M+</strong></font></button>');
		
	newWin_doc.writeln('</td></tr>');
	newWin_doc.writeln('<tr><td>');
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'sin\');"><font color="#9900cc" size="-2" face="Verdana">sin</font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'cos\');"><font color="#9900cc" color="#ff66ff" size="-2" face="Verdana">cos</font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'tan\');"><font color="#9900cc" size="-2" face="Verdana">tan</font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'asin\');"><font color="#9900cc" size="-2" face="Verdana">asin</font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'acos\');"><font color="#9900cc" size="-2" face="Verdana">acos</font></button>' + space);
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'atan\');"><font color="#9900cc" size="-2" face="Verdana">atan</font></button>' + space);
		if(navigator.appName == "Microsoft Internet Explorer"){
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'pi\');"><font color="#9900cc" size="-2" face="Verdana"><img src="img/calc_pi.gif"></font></button>' + space);
		}else{
			newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'pi\');"><font color="#9900cc" size="-2" face="Verdana">PI</font></button>' + space);
		}
		newWin_doc.writeln('<button id="bn7" tabindex="" class="btn" style="width: 30px; height: 30px;" onclick="window.opener.buttonaction(\'m-\');"><font color="#ff3300" size="-2" face="Verdana"><strong>M&ndash;</strong></font></button>');
		
	newWin_doc.writeln('</td></tr>');
	newWin_doc.writeln('<tr><td align="center" valign="bottom">');
	newWin_doc.writeln('<font size="-2" face="Verdana" color="#c0c0c0">Calculatrice IleMaths (par AKwebtools)</font>');		
	newWin_doc.writeln('</td></tr>');
newWin_doc.writeln('</table>');
newWin_doc.writeln('</body>');
newWin_doc.writeln('</html>');


if(navigator.appName != "Microsoft Internet Explorer")
  	{
		newWin_doc.close();
  	}
}