// JavaScript Document



	

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
/*
	lift();		//the stack is pushed up and 'a' is assigned to the X register
			
	numberArray[0].stringValue = a;
	numberArray[0].stringValue += "";	//converts value to string
			
	document.stackForm.rowX.value = numberArray[0].stringValue;		//assigns the digit to the X register
	numberArray[0].decimalValue = parseFloat(numberArray[0].stringValue);	//converts the string value to float
																			//and assigns the value to the decimal 
				
	numberArray[0].shiftUp = "no";	//any subsequent digits in the X register do not cause the stack to shift
	numberArray[0].singleOp = "no";	//
	*/

//function is called from main.html when  the '_|_' button is hit
//this assigns the whole part of a fraction
function wholePart()
{
	document.faceForm.numer.disabled = true;	//a number must be now entered to enable this
												//this was previously enabled to allow for fractions w/o whole parts
	document.faceForm.whole.disabled = true;	//a number must be now entered to enable this
												//this was previously enabled to allow for fractions w/o whole parts	
	
	document.faceForm.plusMinus.disabled = true;//while 'working' with fractions can't use +/-
												
	disable_Delete_Insert();					//disable delete and insert buttons - not compatible with fractions
	
	//if takes care of the work as first_digit(a) in enterDigits.js since no first digit has been entered
	if(numberArray[0].shiftUp == "yes" || numberArray[0].singleOp == "yes")
	{
		lift();		//the stack is pushed up and 'a' is assigned to the X register
		
		reset_sciNot();
		
		numberArray[0].shiftUp = "no";	//any subsequent digits in the X register do not cause the stack to shift

		numberArray[0].decimalValue = 0;
	}
	
	//if ensures that whole part is not a decimal
	if(numberArray[0].decimalValue % 1 != 0)
	{
		alert('synax error\n' + numberArray[0].decimalValue + ' is not an integer');
	}//end if
	else
	{
		numberArray[0].wholePart = numberArray[0].decimalValue;	//whole part is number thus far entered
		numberArray[0].stringValue = numberArray[0].decimalValue + '_| ';	//'_| ' is a separator between the whole
																			//part and fraction part
																			
		numberArray[0].flag = 'wholePartDone';	//this is used for subsequent_digit_fraction(a) in enterDigits.js
	
		document.stackForm.rowX.value = numberArray[0].stringValue;	//displays the string value
	
		numberArray[0].type = 'fraction';	//number type is now fraction
	}//end else
	

}//end function


/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


//function is called from main.html when  the 'den' button is hit
//this assigns the numerator part of a fraction
function numeratorPart()
{
	//the default for numberArray[0].flag is 'none' - this if is called if no whole part was assigned
	if(numberArray[0].flag == 'none')
	{
		/*
		var temp = numberArray[0].decimalValue;
		
		lift();		//the stack is pushed up and 'a' is assigned to the X register
		
		reset_sciNot();
		
		numberArray[0].shiftUp = "no";	//any subsequent digits in the X register do not cause the stack to shift
		
		numberArray[0].flag = 'noWholeNumber';
		
		numberArray[0].numerator = temp;	//temp is assigned to the numerator
		*/
		
// the following was added on 25 oct when the above was commented out
//please work

		document.faceForm.plusMinus.disabled = true;//while 'working' with fractions can't use +/-
		
		if(numberArray[0].decimalValue % 1 != 0)
		{
			alert('synax error\n' + numberArray[0].decimalValue + ' is not an integer');
		}//end if
		else
		{
			numberArray[0].numerator = numberArray[0].decimalValue;	//assigns current number as a denominator
		
			numberArray[0].stringValue = numberArray[0].decimalValue;
			numberArray[0].stringValue += '';
		
			numberArray[0].decimalValue = 0;
			
			numberArray[0].flag = 'numeratorPartDone';

			numberArray[0].stringValue += '/';	
	
			document.stackForm.rowX.value = numberArray[0].stringValue;
	
			numberArray[0].type = 'fraction';
			
			document.faceForm.numer.disabled = true;	//a number must be now entered to enable this
												//this was previously enabled to allow for fractions w/o whole parts
			document.faceForm.whole.disabled = true;	//a number must be now entered to enable this
												//this was previously enabled to allow for fractions w/o whole parts	
												
			disable_Delete_Insert();					//disable delete and insert buttons - not compatible with fractions
	
		}//end else
	}//end if
	else
	{
		numberArray[0].flag = 'numeratorPartDone';

		numberArray[0].stringValue += '/';	
	
		document.stackForm.rowX.value = numberArray[0].stringValue;
	
		numberArray[0].type = 'fraction';
		
		document.faceForm.numer.disabled = true;	//a number must be now entered to enable this
												//this was previously enabled to allow for fractions w/o whole parts
		document.faceForm.whole.disabled = true;	//a number must be now entered to enable this
												//this was previously enabled to allow for fractions w/o whole parts	
												
		disable_Delete_Insert();					//disable delete and insert buttons - not compatible with fractions
	
	}//end else
}//end function


/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


function radicalPart()
{
	
}


/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/


function piPart()
{
	
}