// JavaScript Document
			

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&                                                                                  &&
  &&                                                                                  &&
  &&                    basic math operations                                         &&
  &&                                                                                  &&
  &&                                                                                  &&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


//function is called from every operation
//actually its not called at all
function operation(numb)
{
	drop();
	numberArray[0].enterFlag = 'no';
	numberArray[0].shiftUp = "yes";
	numb +="";

	numberArray[0].decimalValue = numb;
	numberArray[0].stringValue = numberArray[0].decimalValue + '';
	
	document.stackForm.rowX.value = numberArray[0].stringValue;
	
	disable_Delete_Insert();	//the insert and delete buttons are disabled until digits are entered
	disableFractoids();			//fraction buttons are disabled until number is entered
	
	if(numberArray[0].decimalValue % 1 == 0)
	{
		numberArray[0].type = 'whole';
	}
//	reset_sciNot();		//apparently not needed
}


  /*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


//function checks to see the type of numbers in the X register and Y register
//and then selects the appropriate type of addition - default is decimal_addition()
//function is called from main.html
////11 oct 2009 06:05
function operationAddition()
{
	//analyze_type is found in combos.js
	var operands_type = analyze_type();
	
	switch(operands_type)
	{
		case 'fraction': fraction_addition();
		break;
		default: decimal_addition();
	}//end switch
}
						
						
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
  
  
function decimal_addition()
{
	numberArray[0].decimalValue = numberArray[1].decimalValue + numberArray[0].decimalValue;
	
	operations_2nd_level();
	drop();
}//end function
  

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


function fraction_addition()
{
	addFraction();


	document.stackForm.rowX.value = numberArray[0].stringValue;

	reset_2nd_level_functions();
	drop();
}//end function
  

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


//function checks to see the type of numbers in the X register and Y register
//and then selects the appropriate type of subtraction - default is fraction_subtraction()
//function is called from main.html
////11 oct 2009 06:05
function operationSubtraction()
{
	//analyze_type is found in combos.js
	var operands_type = analyze_type();
	
	switch(operands_type)
	{
		case 'fraction': fraction_subtraction();
		break;
		default: decimal_subtraction();
	}//end switch
}
						
						
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
  
  
function decimal_subtraction()
{
	numberArray[0].decimalValue = numberArray[1].decimalValue - numberArray[0].decimalValue;
	
	operations_2nd_level();
	drop();
}//end function
  
  
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


function fraction_subtraction()
{
	alert(numberArray[0].decimalValue);
}//end function
  

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


//function checks to see the type of numbers in the X register and Y register
//and then selects the appropriate type of multiplication - default is decimal_multiplication()
//function is called from main.html
////11 oct 2009 06:05
function operationMultiplication()
{
	//analyze_type is found in combos.js
	var operands_type = analyze_type();
	
	switch(operands_type)
	{
		case 'fraction': fraction_multiplication();
		break;
		default: decimal_multiplication();
	}//end switch
}
						
						
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
  
  
function decimal_multiplication()
{
	numberArray[0].decimalValue = numberArray[1].decimalValue * numberArray[0].decimalValue;
	
	operations_2nd_level();
	drop();
}//end function
  

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


function fraction_multiplication()
{
	alert('function not written');
}//end function
  

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


//function checks to see the type of numbers in the X register and Y register
//and then selects the appropriate type of division - default is operationDivision()
//function is called from main.html
////11 oct 2009 06:05
function operationDivision()
{
	//analyze_type is found in combos.js
	var operands_type = analyze_type();
	
	switch(operands_type)
	{
		case 'fraction': fraction_division();
		break;
		default: decimal_division();
	}//end switch
}
						
						
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
  
  
function decimal_division()
{
	numberArray[0].decimalValue = numberArray[1].decimalValue / numberArray[0].decimalValue;
	
	operations_2nd_level();
	drop();
}//end function
  

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


function fraction_division()
{
	alert('function not written');
}//end function
  

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
  
						
