function genericHandlerSPCPercentTable(THnd) {
	
	this.gspcTblHnd = THnd;
	
	_initialize = function() {
		
		console.log("@@@ genericHandlerSPCPercentTable:: init called");
	};
	
	this.doOnLoad = function(xxspctablepara, xxspctablecaption) {
		
		try {
			
			document.getElementById("xxspctablepara").innerHTML = xxspctablepara; //"This is the table instructions.";
			document.getElementById("xxspctablecaption").innerHTML = xxspctablecaption; //"This is the table caption.";
			
			this.gspcTblHnd.onSpcClearRowData(); // ensure the table is clear
			
			//
			// isNewRecord is returning null for a new record and false otherwise
			// will use the false state to detemine a saved record.
			//
			if (g_form.isNewRecord()==false) {
				// if any of the four summary variables are populated
				// populate the table row with the information.
				// This will only happen following submission of the form with data.
				var sv1 = g_form.getValue("SpcRow1Summary");
				//console.log("@@@ HR_SpcTable_onLoad Sv1= {" + sv1 + "}");
				if(sv1!="") {
					this.gspcTblHnd.setRowData(1, sv1);
				}
				var sv2 = g_form.getValue("SpcRow2Summary");
				if(sv2!="") {
					this.gspcTblHnd.setRowData(2, sv2);
				}
				var sv3 = g_form.getValue("SpcRow3Summary");
				if(sv3!="") {
					this.gspcTblHnd.setRowData(3, sv3);
				}
				var sv4 = g_form.getValue("SpcRow4Summary");
				if(sv4!="") {
					this.gspcTblHnd.setRowData(4, sv4);
				}
				//console.log("@@@ HR_SpcTable_onLoad Sv2= {" + sv2 + "}");
				//console.log("@@@ HR_SpcTable_onLoad Sv3= {" + sv3 + "}");
				//console.log("@@@ HR_SpcTable_onLoad Sv4= {" + sv4 + "}");
				
				// now the table is populated make it read-only (disabled)
				this.gspcTblHnd.setDisabledState(true);
			}
			
		} catch (err)
		{
			console.log("@@@ An error occurred in genericHandlerSPCPercentTable::doOnLoad, message="+err.message);
		}
		return;
	};
	
	this.doOnSubmit = function() {
		try {
			var errRep = "on the sub project code and percents table";
			var row;
			var error = false; // be positive.
			for(row=1; row<5; ++row)
				{
				if(!this.gspcTblHnd.isRowEmpty(row)) {
					if(this.gspcTblHnd.isRowValid(row)!=true) {
						// add to error report
						if(row==4) errRep += " and ";
							else  errRep += ", ";
							errRep += "Row "+row;
						error = true; // error found
					}
				}
			}
			errRep += " has errors. Incorrect forms can not be submitted.\n";
			
			if(error) // found validation error(s) on the table alert the user and return false
				{
				alert(errRep);
				//console.log("@@@ SPC table reports errors.");
				return false;
			}
			else // row 1 is the only row that must have data.
				{
				// if the table is visible then it needs at least row one completed
				//var tbl = g_form.getControl("TblName");
				//if (tbl.attributes.visability==)
				//	{
					// empty rows are valid so we need to check row 1 is not empty
					if(this.gspcTblHnd.isRowEmpty(1)==true) {
						// report row one needs completing
						alert("Row 1 on the Sub-project code and percents table, must contain a valid date, SPC and row percents(%) must added up to one hundred percent(100%), before the form can be submitted.");
						//console.log("@@@ table reports errors.");
						return false;
					}
					// row one has data and it is valid
					
					//
					//console.log("@@@ spcTBL:row1={" + this.gspcTblHnd.getRowData(1) + "}");
					//console.log("@@@ spcTBL:row2={" + this.gspcTblHnd.getRowData(2) + "}");
					//console.log("@@@ spcTBL:row3={" + this.gspcTblHnd.getRowData(3) + "}");
					//console.log("@@@ spcTBL:row4={" + this.gspcTblHnd.getRowData(4) + "}");
					
					// write the packed data to the summary variables for each row that contains data.
					g_form.setValue("SpcRow1Summary", this.gspcTblHnd.getRowData(1)); // required
					if (this.gspcTblHnd.isRowEmpty(2)!=true) g_form.setValue("SpcRow2Summary", this.gspcTblHnd.getRowData(2));
						if (this.gspcTblHnd.isRowEmpty(3)!=true) g_form.setValue("SpcRow3Summary", this.gspcTblHnd.getRowData(3));
						if (this.gspcTblHnd.isRowEmpty(4)!=true) g_form.setValue("SpcRow4Summary", this.gspcTblHnd.getRowData(4));
						
					//console.log("@@@ SpcSummaryRow1="  + g_form.getValue("SpcRow1Summary"));
					//console.log("@@@ SpcSummaryRow2="  + g_form.getValue("SpcRow2Summary"));
					//console.log("@@@ SpcSummaryRow3="  + g_form.getValue("SpcRow3Summary"));
					//console.log("@@@ SpcSummaryRow4="  + g_form.getValue("SpcRow4Summary"));
					//} // endif isvisible
				}
				
				return true; // valid form
			} catch (err)
			{
				console.log("@@@ An error occurred in genericHandlerSPCPercentTable::doOnSubmit, message="+err.message);
			}
			return;
		};
	
		this.type = 'genericHandlerSPCPercentTable';
		_initialize();
	}

