<!--

/*function for starting input form again */
function reloadTryAgain(){
	document.frmAccidentCalc.action = "acccosts_calc.asp";
	document.frmAccidentCalc.submit(); 
}

//-----------------------------------------------------
// Purpose    Clears contents of specific types of 
//	      controls on a given form.
//	      Exceptions are : hidden fields, buttons
//	      ,select-one, select-multi listboxes and 
//	      dropdowns.	
// Parameters strFormname, form to analyse
//	      aExclFields, array of items not to be 
//	      cleared.
// Returns    nothing
// History    PA 03-SEP-2002 created
//-----------------------------------------------------
function resetctrls(strFormname,aExclFields)
{
	var objctrls = document.getElementById(strFormname).elements;
	var i;
	var blnInList;

	for (i = 1; i<=objctrls.length; i++)
	{
	        //check for the exception list
		blnInList = TestInList(objctrls[i-1].name,aExclFields);

		//if the field is not in the exception list then clear the
		//contents of the control.

 		if(blnInList==false)
		{ 
	 	      switch(objctrls[i-1].type)
			{
			case "radio":
				objctrls[i-1].checked=false;
			break;

			case "checkbox":
				objctrls[i-1].checked=false;
			break;

			case "text":
				objctrls[i-1].value = "";
			break;

			case "textarea":
				objctrls[i-1].value = "";
			break;

			default:
		      }
		}			
	}
} 

//-----------------------------------------------------
// Purpose    Clears partial fields from the form
//	      does not clear the organisation details
//	      at the top.
// Parameters strFormname, form to clear
// Returns    nothing
// History    PA 03-SEP-2002 created
//-----------------------------------------------------
function resetpartial(strFormname)
{	
	var aExclFields = new Array();
	
	//List of field names
	aExclFields[0] = "txtNameOrg";
	aExclFields[1] = "txtNamePersCmpltdFrm";
	aExclFields[2] = "txtPosition";
	aExclFields[3] = "txtFormDate";

	resetctrls(strFormname,aExclFields);
}

//-----------------------------------------------------
// Purpose    Tests if a fieldname is inside the 
//	      exception array.	
// Parameters strCtrlName, name of HTML control
//	      aExclFields, array of Ctrl Names NOT to 
//	      be cleared.
// Returns    true : don't clear the contents
//	      false : continue with the rest of the 
//	      script.
// History    PA 03-SEP-2002 created
//-----------------------------------------------------
function TestInList(strCtrlName,aExclFields)
{
	var blnFound = false;
	
	if(aExclFields.length > 0)
	{
		for (i = 1; i<=aExclFields.length; i++)
		{	
			if(strCtrlName==aExclFields[i-1])
			{
				blnFound = true;
				break;
			}
		}
	}
	return(blnFound);
}

/*function for starting input form again */
function resetFormPart1(){
	document.frmAccidentCalc.txtNameOrg.value = '';
	document.frmAccidentCalc.txtNamePersCmpltdFrm.value = '';
	document.frmAccidentCalc.txtPosition.value = '';
	document.frmAccidentCalc.txtFormDate.value = '';
	document.frmAccidentCalc.txtNoofEmployees.value = '';
	document.frmAccidentCalc.txtInsPremium.value = '';
	document.frmAccidentCalc.txtTurnover.value = '';
	document.frmAccidentCalc.txtProfitMargin.value = '';
	document.frmAccidentCalc.radio1a.checked = false;
	document.frmAccidentCalc.radio2a.checked = false;
	document.frmAccidentCalc.radio1b.checked = false;
	document.frmAccidentCalc.radio2b.checked = false;
	document.frmAccidentCalc.radio1c.checked = false;
	document.frmAccidentCalc.radio2c.checked = false;		
}

/*function for starting input form again */
function resetFormPart2(){

	//reset all selected entries to the begining
	document.getElementById("selIndustrySector").selectedIndex = 0;
	document.getElementById("selManuSector").selectedIndex = 0;
	document.getElementById("selLocation").selectedIndex = 0;
	//show the appropriate controls
	showDropDown('hide');
	showRadioButtons('hide');
	showLocation('show');
}

function submitFormP2() {
	document.frmAccidentCalc.action = "acccosts_calc_report.asp";
	document.frmAccidentCalc.submit(); 
	return false
}

/*not currently used
function submit_form_infull(org,name,posn,formdate,insprem,turnover,profit) {
	//document.frmAccidentCalc.action = "acccosts_calc_report.asp";
	document.frmAccidentCalc.txtNameOrg.value = org;
	document.frmAccidentCalc.txtNamePersCmpltdFrm.value = name;
	document.frmAccidentCalc.txtPosition.value = posn;
	document.frmAccidentCalc.txtFormDate.value = formdate;			
	document.frmAccidentCalc.txtInsPremium.value = insprem;
	document.frmAccidentCalc.txtTurnover.value = turnover;
	document.frmAccidentCalc.txtProfitMargin.value = profit;
	document.frmAccidentCalc.submit(); 
	return false
}
*/
//-->