// JavaScript Document

numberArray = new Array();	//array that stores the data in the registers	


/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&                                                                                  &&
  &&                                                                                  &&
  &&                                   Load her up                                    &&
  &&                                                                                  &&
  &&                                                                                  &&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
 
//singleOp I don't think is ever used - it is 'reset' to 'no' and initially set to 'no' but actually never used
//in enterDigits.js it is checked but at no spot that I can find is it actually set to 'yes'
//once this program is done test it by deleting all references to it
//it is reset in enable_disable_reset.js
  
//function is called when page is loaded
function loadPage()
{
	loadArray();
	document.stackForm.rowX.value = numberArray[0].decimalValue;	//preset the registers to 0
	document.stackForm.rowY.value = numberArray[1].decimalValue;
	document.stackForm.rowZ.value = numberArray[2].decimalValue;
	document.stackForm.rowT.value = numberArray[3].decimalValue;
	document.stackForm.rowH.value = numberArray[4].decimalValue;
	document.stackForm.rowI.value = numberArray[5].decimalValue;
	document.stackForm.rowJ.value = numberArray[6].decimalValue;
	
	document.faceForm.angle[0].checked = true;	//radians is the default
	
	numberArray[0].enterFlag = 'no';	//reset global variables to default values 
	numberArray[0].shiftUp = "yes";	
	numberArray[0].singleOp = "no";
	numberArray[0].insertFlag = "no";
	numberArray[0].deleteFlag = 'no';
	disable_Delete_Insert();
	disableFractoids();	//disables fraction buttons
}//end function
	
	
/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
  
  
//this function loads the array 
function loadArray()
{
	var i = 0;

	for(i = 0; i < 7; i++)
	{
		number = new numberType();
		numberArray[i] = number;
	}
}			


/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
  
  
//declares objects of type verb
function numberType() 
	{
		this.flag = 'none';		//
		this.enterFlag = 'no';	//
		this.insertFlag = 'no';	//
		this.deleteFlag = 'no';	//
		this.cursorPosition = -1;
		this.shiftUp = "yes";
		this.singleOp = "no";	//when an entry is being keyed this is 'yes' for the first digit
								//and then switched off

		this.coefficient = 1;	//coefficient for scientific notation
		this.exponent = '';		//exponent for scientific notation
		this.type = 'decimal';	//decimal number or fraction
		this.numerator = '';		//numerator for fraction
		this.denominator = '';	//denominator for fraction
		this.wholePart = 0;		//whole part for fraction
		this.decimalValue = 0;	//decimal value of number		
		this.stringValue = 0;	//string value 
	}
	

/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/