// $Header: /Ready Reckoner (2)/asproot/incost_calc/js/cross_scripting.js 1     9/12/02 17:57 Thentzsc $ 
//-------------------------------------------------------------------------------- 
// Document	: cross_scripting.js
// Purpose 	: Common interface that allows individual routines to test for 
//		  Object Detection and run appropriate routines for that browser. 
//		  NS6.2.3, NS7, IE5.x. 
// Project 	: Ready Reckoner 
// History 	: PA 03-Oct-2002 (Created)
// Author 	: pash 
//-------------------------------------------------------------------------------- 
// Revision History 
//-------------------------------------------------------------------------------- 
// $Revision: 1 $ 
// $Log: /Ready Reckoner (2)/asproot/incost_calc/js/cross_scripting.js $ 
//
//1     9/12/02 17:57 Thentzsc
//added from uat server due to corruption problems
//
//6     19/11/02 18:53 Pash
//
//5     13/11/02 11:05 Pash
//
//4     13/11/02 10:25 Pash
//
//3     11/11/02 19:34 Pash
//
//2     7/10/02 14:37 Pash
//
//1     4/10/02 11:19 Pash
//This file is duplicated in other areas because individual functionality
//besides common routines may apply.  It may in the future be combined. 
//--------------------------------------------------------------------------------

//--------------------------------------------------------------------------------
// Purpose		Interface for cross browser date validation on asp forms.
//	
// Parameters		strTxtbox - text box id / name to be validated
//
// Returns 		true,(Success)
//			false,(Fail)			
//
// History		PA 04-Oct-2002 v0.1 (Created) 
//
// Comment		Applies to Accident Cost calc, Incident Cost calc, 
//			Ill-health cost calc.
//--------------------------------------------------------------------------------
function other_dateVal(strTxtbox)
{
  if(valDate(document.getElementById(strTxtbox).value)!="")
  {
	document.getElementById(strTxtbox).value = ""; // not a valid date
  }
}

//--------------------------------------------------------------------------------
// Purpose		Detects if a Macintosh has loaded the page and if so
//			hides the print button
//	
// Parameters		strPrintid - name of the print button 
//
// Returns 		nothing			
//
// History		PA 02-Dec-2002 v0.1 (Created) 
//
// Comment		Works for only Mac running IE 
//--------------------------------------------------------------------------------
function detectMac()
{
	
	var strAppName = "Microsoft Internet Explorer";

	if(navigator.appVersion.indexOf("Macintosh")>0 && navigator.appName == strAppName)
	{
	  //hide the PC print buttons
	  document.getElementById("rowPC").style.display = "none";	
	  //display only the MAC buttons
	  document.getElementById("rowMAC").style.display = "";	  	  	  
	}
}

//--------------------------------------------------------------------------------
// Purpose		Shows all table <TR> contents just prior to submitting the
//			form. As NS6 can only grab table details if they are 
//			visible.
//	
// Parameters		strPrefix - prefix of the id
//			strStart  - start of iterations
//			strEnd	  - end of iterations.
//
// Returns 		nothing			
//
// History		PA 07-Oct-2002 v0.1 (Created) 
//
// Comment		none
//--------------------------------------------------------------------------------
function other_showallsects(strPrefix,strStart,strEnd)
{
var strItem;
	for (i=parseInt(strStart);i<parseInt(strEnd);i++)
	{
		strItem = strPrefix + i;
		document.getElementById(strItem).style.display = "";
	}

}

//--------------------------------------------------------------------------------
// Purpose		Hides all <TR> except one
//	
// Parameters		strPrefix - prefix of the id
//			strStart  - start of iterations
//			strEnd	  - end of iterations.
//			strShow	  - the one to keep shown.
//
// Returns 		nothing			
//
// History		PA 19-Nov-2002 v0.1 (Created) 
//
// Comment		none
//--------------------------------------------------------------------------------
function other_hidepartial(strPrefix,strStart,strEnd,strShow)
{
var strItem;
	for (i=parseInt(strStart);i<parseInt(strEnd);i++)
	{
		strItem = strPrefix + i;
		document.getElementById(strItem).style.display = "none";
	}
	//show this one
	document.getElementById(strPrefix+strShow).style.display = "";
	scrollTo(0,0);
}

//--------------------------------------------------------------------------------
// Purpose		Copies all sections to hidden fields with a postfix of
//			'_save' on submit.
//	
// Parameters		none
//
// Returns 		nothing			
//
// History		PA 12-Oct-2002 v0.1 (Created) 
//
// Comment		none
//--------------------------------------------------------------------------------
function copy_allsections()
{
	//alert(document.getElementById("txtDescrIncident_save").value + " " + document.getElementById("txtDealingOther_name_save").value + " " + document.getElementById("txtInvestigationOther_name_save").value + " " + document.getElementById("txtGettingBackOther_name_save").value  + " " + document.getElementById("txtBusinessCostsOther_name_save").value + " " + document.getElementById("txtActionSafeguardOther_name_save").value + " " + document.getElementById("txtSanctionsOther_name_save").value  + " " + document.getElementById("txtOther01_name_save").value  + " " + document.getElementById("txtOther02_name_save").value  + " " + document.getElementById("txtOther03_name_save").value  + " " + document.getElementById("txtOther04_name_save").value);

	copy_section1();
	copy_section2();
	copy_section3();
	copy_section4();
	copy_section5();
	copy_section6();
	copy_section7();
	copy_section8();
	copy_section9();	


}
//--------------------------------------------------------------------------------
// Purpose		Everytime the user presses the key to 
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 07-Nov-2002 v0.1 (Created) 
//
// Comment		The key press event is found in Editmasks.js
//--------------------------------------------------------------------------------
function NSKeypress_CutTextEVENT(e) 
{
var intLimit;
var intBSkey = 8; //Back space key
var intSysKey = 0; //Delete, Tab keys etc

	//get the name of the control causing the event
	var objSourceCtrl = e.target;
	
	switch(objSourceCtrl.id)
	{
	//Your info
	case "txtDescrIncident":
		intLimit = 1000;
	break;

	//Everything else is 255
	default:
		intLimit = 255;
	break;

	}

	switch(e.which)
	{
	case intBSkey:
	break;

	case intSysKey:
	break;
	
	default:
		//filter out the system keys.	
		var strText = document.getElementById(objSourceCtrl.id).value;
		if(strText.length == intLimit)	
		{ return false; } //no more characters
	break;
	}

}

//--------------------------------------------------------------------------------
// Purpose		Attaches keypress events to textboxes and renames classes for
//			textboxes when it detects Netscape
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 07-Nov-2002 v0.1 (Created) 
//
// Comment		The key press event is found in Editmasks.js
//--------------------------------------------------------------------------------
function NS_Startup() 
{

	// - Your info
	document.getElementById("txtDescrIncident").onkeypress = NSKeypress_CutTextEVENT;

	// - Dealing with Incident
	//row 1
	document.getElementById("txtFirstAid_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtFirstAid_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtFirstAid_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 2
	document.getElementById("txtTaking_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtTaking_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtTaking_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 3
	document.getElementById("txtMaking_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtMaking_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtMaking_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 4
	document.getElementById("txtFireFighting_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtFireFighting_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtFireFighting_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 5
	document.getElementById("txtImmediateDowntime_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtImmediateDowntime_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtImmediateDowntime_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 6
	document.getElementById("txtDealingOther_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtDealingOther_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtDealingOther_cost").onkeypress = NSkeypress_valdecEVENT;

	// - Dealing with Incident, change classes
	document.getElementById("txtFirstAid_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtFirstAid_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtFirstAid_cost").setAttribute("class","calcTxtInput2a");
	//row 2
	document.getElementById("txtTaking_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtTaking_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtTaking_cost").setAttribute("class","calcTxtInput2a");
	//row 3
	document.getElementById("txtMaking_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtMaking_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtMaking_cost").setAttribute("class","calcTxtInput2a");
	//row 4
	document.getElementById("txtFireFighting_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtFireFighting_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtFireFighting_cost").setAttribute("class","calcTxtInput2a");
	//row 5
	document.getElementById("txtImmediateDowntime_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtImmediateDowntime_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtImmediateDowntime_cost").setAttribute("class","calcTxtInput2a");	
	//row 6
	document.getElementById("txtDealingOther_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtDealingOther_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtDealingOther_cost").setAttribute("class","calcTxtInput2a");	

	// - Investigation of Incident
	//row 1
	document.getElementById("txtStaffTimeInvestigate_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtStaffTimeInvestigate_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtStaffTimeInvestigate_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 2
	document.getElementById("txtMeetings_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtMeetings_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtMeetings_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 3
	document.getElementById("txtTimeSpentHSE_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtTimeSpentHSE_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtTimeSpentHSE_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 4
	document.getElementById("txtConsultantFees_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtConsultantFees_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtConsultantFees_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 5
	document.getElementById("txtInvestigationOther_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtInvestigationOther_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtInvestigationOther_cost").onkeypress = NSkeypress_valdecEVENT;

	// - Investigation of Incident, change classes
	document.getElementById("txtStaffTimeInvestigate_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtStaffTimeInvestigate_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtStaffTimeInvestigate_cost").setAttribute("class","calcTxtInput2a");
	//row 2
	document.getElementById("txtMeetings_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtMeetings_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtMeetings_cost").setAttribute("class","calcTxtInput2a");
	//row 3
	document.getElementById("txtTimeSpentHSE_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtTimeSpentHSE_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtTimeSpentHSE_cost").setAttribute("class","calcTxtInput2a");
	//row 4
	document.getElementById("txtConsultantFees_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtConsultantFees_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtConsultantFees_cost").setAttribute("class","calcTxtInput2a");
	//row 5
	document.getElementById("txtInvestigationOther_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtInvestigationOther_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtInvestigationOther_cost").setAttribute("class","calcTxtInput2a");	

	// - Getting back to business
	//row 1
	document.getElementById("txtAssesing_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtAssesing_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtAssesing_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 2
	document.getElementById("txtRecovering_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtRecovering_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtRecovering_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 3
	document.getElementById("txtCleaningUp_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 4
	document.getElementById("txtBringing_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtBringing_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtBringing_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 5
	document.getElementById("txtRepairing_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 6
	document.getElementById("txtHiringPurchasing_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 7
	document.getElementById("txtGettingBackOther_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtGettingBackOther_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtGettingBackOther_cost").onkeypress = NSkeypress_valdecEVENT;	

	// - Getting back to business, change classes
	document.getElementById("txtAssesing_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtAssesing_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtAssesing_cost").setAttribute("class","calcTxtInput2a");
	//row 2
	document.getElementById("txtRecovering_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtRecovering_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtRecovering_cost").setAttribute("class","calcTxtInput2a");	
	//row 3
	document.getElementById("txtCleaningUp_cost").setAttribute("class","calcTxtInput2a");
	//row 4
	document.getElementById("txtBringing_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtBringing_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtBringing_cost").setAttribute("class","calcTxtInput2a");	
	//row 5
	document.getElementById("txtRepairing_cost").setAttribute("class","calcTxtInput2a");
	//row 6
	document.getElementById("txtHiringPurchasing_cost").setAttribute("class","calcTxtInput2a");
	//row 7
	document.getElementById("txtGettingBackOther_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtGettingBackOther_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtGettingBackOther_cost").setAttribute("class","calcTxtInput2a");

	// - Business Costs
	//row 1
	document.getElementById("txtSalaryCostsInjPersons_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtSalaryCostsInjPersons_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtSalaryCostsInjPersons_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 2
	document.getElementById("txtSalaryCostsReplacement_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtSalaryCostsReplacement_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtSalaryCostsReplacement_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 3
	document.getElementById("txtLostTime_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtLostTime_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtLostTime_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 4
	document.getElementById("txtOvertime_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOvertime_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOvertime_cost").onkeypress = NSkeypress_valdecEVENT;	
	//row 5
	document.getElementById("txtRecruitment_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 6
	document.getElementById("txtContractPenalties_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 7
	document.getElementById("txtCancelledOrders_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 8
	document.getElementById("txtBusinessCostsOther_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtBusinessCostsOther_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtBusinessCostsOther_cost").onkeypress = NSkeypress_valdecEVENT;	

	// - Business Costs
	//row 1
	document.getElementById("txtSalaryCostsInjPersons_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtSalaryCostsInjPersons_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtSalaryCostsInjPersons_cost").setAttribute("class","calcTxtInput2a");
	//row 2
	document.getElementById("txtSalaryCostsReplacement_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtSalaryCostsReplacement_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtSalaryCostsReplacement_cost").setAttribute("class","calcTxtInput2a");
	//row 3
	document.getElementById("txtLostTime_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtLostTime_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtLostTime_cost").setAttribute("class","calcTxtInput2a");
	//row 4
	document.getElementById("txtOvertime_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOvertime_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOvertime_cost").setAttribute("class","calcTxtInput2a");
	//row 5
	document.getElementById("txtRecruitment_cost").setAttribute("class","calcTxtInput2a");
	//row 6
	document.getElementById("txtContractPenalties_cost").setAttribute("class","calcTxtInput2a");
	//row 7
	document.getElementById("txtCancelledOrders_cost").setAttribute("class","calcTxtInput2a");
	//row 8
	document.getElementById("txtBusinessCostsOther_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtBusinessCostsOther_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtBusinessCostsOther_cost").setAttribute("class","calcTxtInput2a");	

	// - Action to safeguard
	//row 1
	document.getElementById("txtReassuring_cost").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtProvidingAlt_cost").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtActionSafeguardOther_time").onkeypress = NSkeypress_valdecEVENT;
	//row 2
	document.getElementById("txtActionSafeguardOther_rate").onkeypress = NSkeypress_valdecEVENT;
	//row 3
	document.getElementById("txtActionSafeguardOther_cost").onkeypress = NSkeypress_valdecEVENT;

	// - Action to safeguard
	//row 1
	document.getElementById("txtReassuring_cost").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtProvidingAlt_cost").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtActionSafeguardOther_time").setAttribute("class","calcTxtInput2a");
	//row 2
	document.getElementById("txtActionSafeguardOther_rate").setAttribute("class","calcTxtInput2a");
	//row 3
	document.getElementById("txtActionSafeguardOther_cost").setAttribute("class","calcTxtInput2a");

	// - Sanctions and Penalties
	//row 1
	document.getElementById("txtCompensation_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 2
	document.getElementById("txtSolicitors_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 3
	document.getElementById("txtStaffTimeLegal_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtStaffTimeLegal_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtStaffTimeLegal_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 4
	document.getElementById("txtFinesCosts_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 5
	document.getElementById("txtInsurancePremiums_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 6
	document.getElementById("txtSanctionsOther_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtSanctionsOther_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtSanctionsOther_cost").onkeypress = NSkeypress_valdecEVENT;

	// - Sanctions and Penalties
	//row 1
	document.getElementById("txtCompensation_cost").setAttribute("class","calcTxtInput2a");
	//row 2
	document.getElementById("txtSolicitors_cost").setAttribute("class","calcTxtInput2a");
	//row 3
	document.getElementById("txtStaffTimeLegal_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtStaffTimeLegal_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtStaffTimeLegal_cost").setAttribute("class","calcTxtInput2a");
	//row 4
	document.getElementById("txtFinesCosts_cost").setAttribute("class","calcTxtInput2a");
	//row 5
	document.getElementById("txtInsurancePremiums_cost").setAttribute("class","calcTxtInput2a");
	//row 6
	document.getElementById("txtSanctionsOther_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtSanctionsOther_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtSanctionsOther_cost").setAttribute("class","calcTxtInput2a");

	// - Sanctions and Penalties
	//row 1
	document.getElementById("txtOther01_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOther01_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOther01_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 2
	document.getElementById("txtOther02_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOther02_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOther02_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 3
	document.getElementById("txtOther03_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOther03_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOther03_cost").onkeypress = NSkeypress_valdecEVENT;
	//row 4
	document.getElementById("txtOther04_time").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOther04_rate").onkeypress = NSkeypress_valdecEVENT;
	document.getElementById("txtOther04_cost").onkeypress = NSkeypress_valdecEVENT;

	// - Sanctions and Penalties
	//row 1
	document.getElementById("txtOther01_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOther01_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOther01_cost").setAttribute("class","calcTxtInput2a");
	//row 2
	document.getElementById("txtOther02_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOther02_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOther02_cost").setAttribute("class","calcTxtInput2a");
	//row 3
	document.getElementById("txtOther03_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOther03_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOther03_cost").setAttribute("class","calcTxtInput2a");
	//row 4
	document.getElementById("txtOther04_time").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOther04_rate").setAttribute("class","calcTxtInput2a");
	document.getElementById("txtOther04_cost").setAttribute("class","calcTxtInput2a");


}

//--------------------------------------------------------------------------------
// Purpose		Data is copied from the 'your information' section and 
//			saved to a set of fields at the end of the page each time 
//			the user submits the document.
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 11-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function copy_section1()
{
	//copy all contents from your information into fields
	document.getElementById("txtNameCmpny_save").value = document.getElementById("txtNameCmpny").value;
	document.getElementById("txtIncidentDate_save").value = document.getElementById("txtIncidentDate").value;
	document.getElementById("txtIncidentTime_save").value = document.getElementById("txtIncidentTime").value;
	document.getElementById("txtPlaceIncident_save").value = document.getElementById("txtPlaceIncident").value;
	document.getElementById("txtNamePerson_save").value = document.getElementById("txtNamePerson").value;
	document.getElementById("txtNamePersCmpltdFrm_save").value = document.getElementById("txtNamePersCmpltdFrm").value;
	document.getElementById("txtPosition_save").value = document.getElementById("txtPosition").value;
	//document.getElementById("txtDescrIncident_save").value = document.getElementById("txtDescrIncident").value;
}

//--------------------------------------------------------------------------------
// Purpose		Data is copied from the 'Dealing with incident' section 
//			and saved to a set of fields at the end of the page each 
//			time the user submits the document.
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 11-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function copy_section2()
{
	//copy all contents from your information into fields
	document.getElementById("txtFirstAid_time_save").value = document.getElementById("txtFirstAid_time").value;
	document.getElementById("txtFirstAid_rate_save").value = document.getElementById("txtFirstAid_rate").value;
	document.getElementById("txtFirstAid_cost_save").value = document.getElementById("txtFirstAid_cost").value;
	document.getElementById("cbxFirstAid_guess_save").value = document.getElementById("cbxFirstAid_guess").checked;

	document.getElementById("txtTaking_time_save").value = document.getElementById("txtTaking_time").value;
	document.getElementById("txtTaking_rate_save").value = document.getElementById("txtTaking_rate").value;
	document.getElementById("txtTaking_cost_save").value = document.getElementById("txtTaking_cost").value;
	document.getElementById("cbxTaking_guess_save").value = document.getElementById("cbxTaking_guess").checked;
	
	document.getElementById("txtMaking_time_save").value = document.getElementById("txtMaking_time").value;
	document.getElementById("txtMaking_rate_save").value = document.getElementById("txtMaking_rate").value;
	document.getElementById("txtMaking_cost_save").value = document.getElementById("txtMaking_cost").value;
	document.getElementById("cbxMaking_guess_save").value = document.getElementById("cbxMaking_guess").checked;
	
	document.getElementById("txtFireFighting_time_save").value = document.getElementById("txtFireFighting_time").value;
	document.getElementById("txtFireFighting_rate_save").value = document.getElementById("txtFireFighting_rate").value;
	document.getElementById("txtFireFighting_cost_save").value = document.getElementById("txtFireFighting_cost").value;
	document.getElementById("cbxFireFighting_guess_save").value = document.getElementById("cbxFireFighting_guess").checked;
	
	document.getElementById("txtImmediateDowntime_time_save").value = document.getElementById("txtImmediateDowntime_time").value;
	document.getElementById("txtImmediateDowntime_rate_save").value = document.getElementById("txtImmediateDowntime_rate").value;
	document.getElementById("txtImmediateDowntime_cost_save").value = document.getElementById("txtImmediateDowntime_cost").value;
	document.getElementById("cbxImmediateDowntime_guess_save").value = document.getElementById("cbxImmediateDowntime_guess").checked;
	
	//document.getElementById("txtDealingOther_name_save").value = document.getElementById("txtDealingOther_name").value;
	document.getElementById("txtDealingOther_time_save").value = document.getElementById("txtDealingOther_time").value;
	document.getElementById("txtDealingOther_rate_save").value = document.getElementById("txtDealingOther_rate").value;
	document.getElementById("txtDealingOther_cost_save").value = document.getElementById("txtDealingOther_cost").value;
	document.getElementById("cbxDealingOther_guess_save").value = document.getElementById("cbxDealingOther_guess").checked;
}
//--------------------------------------------------------------------------------
// Purpose		Data is copied from the 'investigation of incident' section 
//			and saved to a set of fields at the end of the page each 
//			time the user submits the document.
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 11-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function copy_section3()
{
	//copy all contents from your information into fields
	document.getElementById("txtStaffTimeInvestigate_time_save").value = document.getElementById("txtStaffTimeInvestigate_time").value;
	document.getElementById("txtStaffTimeInvestigate_rate_save").value = document.getElementById("txtStaffTimeInvestigate_rate").value;
	document.getElementById("txtStaffTimeInvestigate_cost_save").value = document.getElementById("txtStaffTimeInvestigate_cost").value;
	document.getElementById("cbxStaffTimeInvestigate_guess_save").value = document.getElementById("cbxStaffTimeInvestigate_guess").checked;

	document.getElementById("txtMeetings_time_save").value = document.getElementById("txtMeetings_time").value;
	document.getElementById("txtMeetings_rate_save").value = document.getElementById("txtMeetings_rate").value;
	document.getElementById("txtMeetings_cost_save").value = document.getElementById("txtMeetings_cost").value;
	document.getElementById("cbxMeetings_guess_save").value = document.getElementById("cbxMeetings_guess").checked;
	
	document.getElementById("txtTimeSpentHSE_time_save").value = document.getElementById("txtTimeSpentHSE_time").value;
	document.getElementById("txtTimeSpentHSE_rate_save").value = document.getElementById("txtTimeSpentHSE_rate").value;
	document.getElementById("txtTimeSpentHSE_cost_save").value = document.getElementById("txtTimeSpentHSE_cost").value;
	document.getElementById("cbxTimeSpentHSE_guess_save").value = document.getElementById("cbxTimeSpentHSE_guess").checked;
	
	document.getElementById("txtConsultantFees_time_save").value = document.getElementById("txtConsultantFees_time").value;
	document.getElementById("txtConsultantFees_rate_save").value = document.getElementById("txtConsultantFees_rate").value;
	document.getElementById("txtConsultantFees_cost_save").value = document.getElementById("txtConsultantFees_cost").value;
	document.getElementById("cbxConsultantFees_guess_save").value = document.getElementById("cbxConsultantFees_guess").checked;
	
	//document.getElementById("txtInvestigationOther_name_save").value = document.getElementById("txtInvestigationOther_name").value;
	document.getElementById("txtInvestigationOther_time_save").value = document.getElementById("txtInvestigationOther_time").value;
	document.getElementById("txtInvestigationOther_rate_save").value = document.getElementById("txtInvestigationOther_rate").value;
	document.getElementById("txtInvestigationOther_cost_save").value = document.getElementById("txtInvestigationOther_cost").value;
	document.getElementById("cbxInvestigationOther_guess_save").value = document.getElementById("cbxInvestigationOther_guess").checked;
	
}
//--------------------------------------------------------------------------------
// Purpose		Data is copied from the 'getting back to business' section 
//			and saved to a set of fields at the end of the page each 
//			time the user submits the document.
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 11-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function copy_section4()
{
	//copy all contents from your information into fields
	document.getElementById("txtAssesing_time_save").value = document.getElementById("txtAssesing_time").value;
	document.getElementById("txtAssesing_rate_save").value = document.getElementById("txtAssesing_rate").value;
	document.getElementById("txtAssesing_cost_save").value = document.getElementById("txtAssesing_cost").value;
	document.getElementById("cbxAssesing_guess_save").value = document.getElementById("cbxAssesing_guess").checked;

	document.getElementById("txtRecovering_time_save").value = document.getElementById("txtRecovering_time").value;
	document.getElementById("txtRecovering_rate_save").value = document.getElementById("txtRecovering_rate").value;
	document.getElementById("txtRecovering_cost_save").value = document.getElementById("txtRecovering_cost").value;
	document.getElementById("cbxRecovering_guess_save").value = document.getElementById("cbxRecovering_guess").checked;
	
	document.getElementById("txtCleaningUp_cost_save").value = document.getElementById("txtCleaningUp_cost").value;
	document.getElementById("cbxCleaningUp_guess_save").value = document.getElementById("cbxCleaningUp_guess").checked;
	
	document.getElementById("txtBringing_time_save").value = document.getElementById("txtBringing_time").value;
	document.getElementById("txtBringing_rate_save").value = document.getElementById("txtBringing_rate").value;
	document.getElementById("txtBringing_cost_save").value = document.getElementById("txtBringing_cost").value;
	document.getElementById("cbxBringing_guess_save").value = document.getElementById("cbxBringing_guess").checked;
	
	document.getElementById("txtRepairing_cost_save").value = document.getElementById("txtRepairing_cost").value;
	document.getElementById("cbxRepairing_guess_save").value = document.getElementById("cbxRepairing_guess").checked;

	document.getElementById("txtHiringPurchasing_cost_save").value = document.getElementById("txtHiringPurchasing_cost").value;
	document.getElementById("cbxHiringPurchasing_guess_save").value = document.getElementById("cbxHiringPurchasing_guess").checked;

	//document.getElementById("txtGettingBackOther_name_save").value = document.getElementById("txtGettingBackOther_name").value;
	document.getElementById("txtGettingBackOther_time_save").value = document.getElementById("txtGettingBackOther_time").value;
	document.getElementById("txtGettingBackOther_rate_save").value = document.getElementById("txtGettingBackOther_rate").value;
	document.getElementById("txtGettingBackOther_cost_save").value = document.getElementById("txtGettingBackOther_cost").value;
	document.getElementById("cbxGettingBackOther_guess_save").value = document.getElementById("cbxGettingBackOther_guess").checked;
	
}

//--------------------------------------------------------------------------------
// Purpose		Data is copied from the 'Business costs' section 
//			and saved to a set of fields at the end of the page each 
//			time the user submits the document.
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 11-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function copy_section5()
{
	//copy all contents from your information into fields
	document.getElementById("txtSalaryCostsInjPersons_time_save").value = document.getElementById("txtSalaryCostsInjPersons_time").value;
	document.getElementById("txtSalaryCostsInjPersons_rate_save").value = document.getElementById("txtSalaryCostsInjPersons_rate").value;
	document.getElementById("txtSalaryCostsInjPersons_cost_save").value = document.getElementById("txtSalaryCostsInjPersons_cost").value;
	document.getElementById("cbxSalaryCostsInjPersons_guess_save").value = document.getElementById("cbxSalaryCostsInjPersons_guess").checked;

	document.getElementById("txtSalaryCostsReplacement_time_save").value = document.getElementById("txtSalaryCostsReplacement_time").value;
	document.getElementById("txtSalaryCostsReplacement_rate_save").value = document.getElementById("txtSalaryCostsReplacement_rate").value;
	document.getElementById("txtSalaryCostsReplacement_cost_save").value = document.getElementById("txtSalaryCostsReplacement_cost").value;
	document.getElementById("cbxSalaryCostsReplacement_guess_save").value = document.getElementById("cbxSalaryCostsReplacement_guess").checked;
	
	document.getElementById("txtLostTime_time_save").value = document.getElementById("txtLostTime_time").value;
	document.getElementById("txtLostTime_rate_save").value = document.getElementById("txtLostTime_rate").value;
	document.getElementById("txtLostTime_cost_save").value = document.getElementById("txtLostTime_cost").value;
	document.getElementById("cbxLostTime_guess_save").value = document.getElementById("cbxLostTime_guess").checked;

	document.getElementById("txtOvertime_time_save").value = document.getElementById("txtOvertime_time").value;
	document.getElementById("txtOvertime_rate_save").value = document.getElementById("txtOvertime_rate").value;
	document.getElementById("txtOvertime_cost_save").value = document.getElementById("txtOvertime_cost").value;
	document.getElementById("cbxOvertime_guess_save").value = document.getElementById("cbxOvertime_guess").checked;
	
	document.getElementById("txtRecruitment_cost_save").value = document.getElementById("txtRecruitment_cost").value;
	document.getElementById("cbxRecruitment_guess_save").value = document.getElementById("cbxRecruitment_guess").checked;

	document.getElementById("txtContractPenalties_cost_save").value = document.getElementById("txtContractPenalties_cost").value;
	document.getElementById("cbxContractPenalties_guess_save").value = document.getElementById("cbxContractPenalties_guess").checked;

	document.getElementById("txtCancelledOrders_cost_save").value = document.getElementById("txtCancelledOrders_cost").value;
	document.getElementById("cbxCancelledOrders_guess_save").value = document.getElementById("cbxCancelledOrders_guess").checked;

	//document.getElementById("txtBusinessCostsOther_name_save").value = document.getElementById("txtBusinessCostsOther_name").value;
	document.getElementById("txtBusinessCostsOther_time_save").value = document.getElementById("txtBusinessCostsOther_time").value;
	document.getElementById("txtBusinessCostsOther_rate_save").value = document.getElementById("txtBusinessCostsOther_rate").value;
	document.getElementById("txtBusinessCostsOther_cost_save").value = document.getElementById("txtBusinessCostsOther_cost").value;
	document.getElementById("cbxBusinessCostsOther_guess_save").value = document.getElementById("cbxBusinessCostsOther_guess").checked;
	
}
//--------------------------------------------------------------------------------
// Purpose		Data is copied from the 'Action to safeguard' section 
//			and saved to a set of fields at the end of the page each 
//			time the user submits the document.
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 11-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function copy_section6()
{
	//copy all contents from your information into fields

	document.getElementById("txtReassuring_cost_save").value = document.getElementById("txtReassuring_cost").value;
	document.getElementById("cbxReassuring_guess_save").value = document.getElementById("cbxReassuring_guess").checked;

	document.getElementById("txtProvidingAlt_cost_save").value = document.getElementById("txtProvidingAlt_cost").value;
	document.getElementById("cbxProvidingAlt_guess_save").value = document.getElementById("cbxProvidingAlt_guess").checked;

	//document.getElementById("txtActionSafeguardOther_name_save").value = document.getElementById("txtActionSafeguardOther_name").value;
	document.getElementById("txtActionSafeguardOther_time_save").value = document.getElementById("txtActionSafeguardOther_time").value;
	document.getElementById("txtActionSafeguardOther_rate_save").value = document.getElementById("txtActionSafeguardOther_rate").value;
	document.getElementById("txtActionSafeguardOther_cost_save").value = document.getElementById("txtActionSafeguardOther_cost").value;
	document.getElementById("cbxActionSafeguardOther_guess_save").value = document.getElementById("cbxActionSafeguardOther_guess").checked;
	
}
//--------------------------------------------------------------------------------
// Purpose		Data is copied from the 'Sanction and penalties' section 
//			and saved to a set of fields at the end of the page each 
//			time the user submits the document.
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 11-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function copy_section7()
{
	//copy all contents from your information into fields

	document.getElementById("txtCompensation_cost_save").value = document.getElementById("txtCompensation_cost").value;
	document.getElementById("cbxCompensation_guess_save").value = document.getElementById("cbxCompensation_guess").checked;

	document.getElementById("txtSolicitors_cost_save").value = document.getElementById("txtSolicitors_cost").value;
	document.getElementById("cbxSolicitors_guess_save").value = document.getElementById("cbxSolicitors_guess").checked;

	document.getElementById("txtStaffTimeLegal_time_save").value = document.getElementById("txtStaffTimeLegal_time").value;
	document.getElementById("txtStaffTimeLegal_rate_save").value = document.getElementById("txtStaffTimeLegal_rate").value;
	document.getElementById("txtStaffTimeLegal_cost_save").value = document.getElementById("txtStaffTimeLegal_cost").value;
	document.getElementById("cbxStaffTimeLegal_guess_save").value = document.getElementById("cbxStaffTimeLegal_guess").checked;

	document.getElementById("txtFinesCosts_cost_save").value = document.getElementById("txtFinesCosts_cost").value;
	document.getElementById("cbxFinesCosts_guess_save").value = document.getElementById("cbxFinesCosts_guess").checked;

	document.getElementById("txtInsurancePremiums_cost_save").value = document.getElementById("txtInsurancePremiums_cost").value;
	document.getElementById("cbxInsurancePremiums_guess_save").value = document.getElementById("cbxInsurancePremiums_guess").checked;

	//document.getElementById("txtSanctionsOther_name_save").value = document.getElementById("txtSanctionsOther_name").value;
	document.getElementById("txtSanctionsOther_time_save").value = document.getElementById("txtSanctionsOther_time").value;
	document.getElementById("txtSanctionsOther_rate_save").value = document.getElementById("txtSanctionsOther_rate").value;
	document.getElementById("txtSanctionsOther_cost_save").value = document.getElementById("txtSanctionsOther_cost").value;
	document.getElementById("cbxSanctionsOther_guess_save").value = document.getElementById("cbxSanctionsOther_guess").checked;
	
}

//--------------------------------------------------------------------------------
// Purpose		Data is copied from the 'Other' section 
//			and saved to a set of fields at the end of the page each 
//			time the user submits the document.
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 11-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function copy_section8()
{
	//copy all contents from your information into fields

	//document.getElementById("txtOther01_name_save").value = document.getElementById("txtOther01_name").value;
	document.getElementById("txtOther01_time_save").value = document.getElementById("txtOther01_time").value;
	document.getElementById("txtOther01_rate_save").value = document.getElementById("txtOther01_rate").value;
	document.getElementById("txtOther01_cost_save").value = document.getElementById("txtOther01_cost").value;
	document.getElementById("cbxOther01_guess_save").value = document.getElementById("cbxOther01_guess").checked;

	//document.getElementById("txtOther02_name_save").value = document.getElementById("txtOther02_name").value;
	document.getElementById("txtOther02_time_save").value = document.getElementById("txtOther02_time").value;
	document.getElementById("txtOther02_rate_save").value = document.getElementById("txtOther02_rate").value;
	document.getElementById("txtOther02_cost_save").value = document.getElementById("txtOther02_cost").value;
	document.getElementById("cbxOther02_guess_save").value = document.getElementById("cbxOther02_guess").checked;

	//document.getElementById("txtOther03_name_save").value = document.getElementById("txtOther03_name").value;
	document.getElementById("txtOther03_time_save").value = document.getElementById("txtOther03_time").value;
	document.getElementById("txtOther03_rate_save").value = document.getElementById("txtOther03_rate").value;
	document.getElementById("txtOther03_cost_save").value = document.getElementById("txtOther03_cost").value;
	document.getElementById("cbxOther03_guess_save").value = document.getElementById("cbxOther03_guess").checked;

	//document.getElementById("txtOther04_name_save").value = document.getElementById("txtOther04_name").value;
	document.getElementById("txtOther04_time_save").value = document.getElementById("txtOther04_time").value;
	document.getElementById("txtOther04_rate_save").value = document.getElementById("txtOther04_rate").value;
	document.getElementById("txtOther04_cost_save").value = document.getElementById("txtOther04_cost").value;
	document.getElementById("cbxOther04_guess_save").value = document.getElementById("cbxOther04_guess").checked;
	
}


//--------------------------------------------------------------------------------
// Purpose		Data is copied from the 'Totals' section 
//			and saved to a set of fields at the end of the page each 
//			time the user submits the document.
//	
// Parameters		None
//
// Returns 		nothing			
//
// History		PA 12-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function copy_section9()
{
	document.getElementById("txtTotalDys_time_save").value = document.getElementById("txtTotalDys_time").value;
	document.getElementById("txtTotalHrs_time_save").value = document.getElementById("txtTotalHrs_time").value;
	document.getElementById("txtTotal_cost_save").value = document.getElementById("txtTotal_cost").value;
}

//--------------------------------------------------------------------------------
// Purpose		Data is saved to a hidden field with a postfix of '_save'
//	
// Parameters		objthis - Control
//
// Returns 		nothing			
//
// History		PA 12-Nov-2002 v0.1 (Created) 
//
// Comment		Applies to I.E /NS.6/NS.7
//--------------------------------------------------------------------------------
function save_value(objthis)
{
	document.getElementById(objthis.id+'_save').value = document.getElementById(objthis.id).value; 
}
