/*
	File:		ReviewGroup.Js
	Purpose:    Client Side Validation for ReviewGroup.Cfm
	Author:     Michael Mercieca
	Created: 	August 10, 2000 
*/
function NextClick(nStated, nActual, nWarned, nMin,nMax,nGroupSize,nParticipationRule,bOkToGo)
	{
	var bGo =true;
	
	// GET MINIMUM AMOUNT REQUIRED TO QUOTE -- ROUND UP IF PERCENTAGE REMAINDER IS LESS THAN .50
	
	// DC: CHECK TO SEE THAT ENROLL EMP IS 75% OF TOT EMP
	if (bOkToGo == 0)
		{
		window.alert("You've entered an employee zip code that is not covered.\n Please correct the zip code to continue");
		 bGo=false;
		} 
	else
	if (nParticipationRule > 0)	
	  {
	  if(!checkParticipationEligibility(nGroupSize,nActual,nParticipationRule,nWarnPercent)) bGo=false;
	  }
	/*NEED TO CHANGE THIS TO HANDLE EITHER Total Emps Or Emps Insuring*/
	else if ((nActual < nMin) || (nActual > nMax))
		{
		if (nActual == 1) cText = "person";else cText = "people";
		window.alert("You're trying to get a quote for a group containing " + nActual + " " + cText
						+".\nThis site produces quotes for small businesses having " + nMin +"-" + nMax +" employees." 
						+"\nPlease modify the census as necessary.");
		 bGo=false;
		 }
	else if (!nWarned && (nStated != nActual))
		{
		if (!window.confirm("WARNING: You said you were insuring " + nStated + " employees, but you've entered information for "+
							nActual + " employees." 
							+"\nIf you wish to run a quote for " +nActual + " employees click 'OK'" 
							+"\nIf you entered information for the wrong number of employees, you can click 'Cancel' " 
							+"and correct the problem."))	 bGo =false;
		}
		
	if (bGo) document.forms[0].submit();
	}
		
	
	
/*function AddClick(group_cd)
	{
	nLast = document.forms[0].nLast.value;
	if (nLast >= 50)
		window.alert("Entering more employees will put you over the limit of 50."
		+"\nThis health insurance portal is for small businesses having 2-50 employees.");
	else
		changeAction('census.cfm?group_cd='+group_cd,0);
	
	}*/