
	function calculate(GEHA)
	{
	// grab variables
	var var_plan = document.calculator.planType.value;
	var var_duration = document.calculator.duration.value;
	var var_eligible = document.calculator.eligible.value;
	var var_eligible_spouse = document.calculator.eligible_spouse.value;
	var var_GEHA = GEHA;
	var var_self_plan = 3050;//updated from 2900 per marketing request 3197 by D. Kairys
	var var_family_plan = 6150;//updated from 5800 per marketing request 3197 by D. Kairys
	var var_GEHA_single = 720;
	var var_GEHA_family = 1440;
	var var_trip = 0;
	var var_max_allow = 0;
	var var_catchup= 0;  
//window.alert(var_GEHA);
	if (var_eligible == 1 || var_eligible_spouse == 1)
	{
	var var_catchup = 1000;  //updated from 900 per marketing request 3197.  Updated by D. Kairys on 09-09-09
	}
	if(var_plan == 1){
	var_deduct = 3050;//updated from 2900 per marketing request 3197 by D. Kairys
	}
	else{
	    var_deduct = 6150; //updated from 5900 per marketing request 3197 by D. Kairys
	}

	var_max_allow_contrib = var_deduct+var_catchup;
	var_max_allow_contrib = Math.round(var_max_allow_contrib*100)/100
	
	//window.alert("max = "+var_max_allow_contrib);

	if (var_GEHA == 1)
	{
//window.alert('in loop');
	if(var_plan == 1){
	var_takeoff = 720;
	}
	else{
	var_takeoff = 1440;
	}
//	var_geha_total = ((var_deduct / 12)*var_duration) - ((var_takeoff / 12)*var_duration)+var_catchup;
	var_geha_total = var_deduct - ((var_takeoff / 12)*var_duration)+var_catchup;
//var_geha_total = var_max_allow_contrib - var_takeoff;
	var_geha_total = Math.round(var_geha_total*100)/100
		document.all.status2.innerHTML = ("<strong>Your Maximum Member Contribution is $"+var_geha_total+"</strong>");

}

document.all.status1.innerHTML = ("<font color='FF0000'><strong>Your Maximum Allowable Contribution is $"+var_max_allow_contrib+"</strong></font>");


}

function oldcode(){	
	//calculations time
	//if(document.calculator.planType.value == 1){
	//single plan
//	var var_plan_amount = var_self_plan;
	//var var_GEHA_amount = (var_GEHA_single / 12)*var_duration;
	//}
	//if(document.calculator.planType.value == 2){
	//family plan
	//var var_plan_amount = var_family_plan;
	//var var_GEHA_amount = (var_GEHA_family / 12)*var_duration;
	//}
		
	//totals
	//if((var_eligible == 1) || (var_eligible_spouse == 1)){
	///var var_catch_up = (800/12) * var_duration;
	//var var_trip = 1;
	//}

	//if (((var_eligible == 1) && (var_eligible_spouse != 1)) || ((var_eligible_spouse == 1) && (var_eligible != 1)) && (var_trip == 0)){
	//var var_catch_up = (800/12) * var_duration;
	//}
	
	//if ((var_eligible == 0) && (var_eligible_spouse == 0)){
	//var_catch_up = 0;
	//}
	
	//var var_max_allow = ((var_plan_amount/12)*var_duration) + var_catch_up;
	
	//if (GEHA == 1){
		//var_max_allow = var_max_allow - var_GEHA_amount;
		//}
//	if (!var_max_allow){
		//var_max_allow = 0;
		//}
//	if (var_trip == 2){
		//var_confirm = window.confirm("Please review your values, you have errors");
		//return false;
		//} 
		
		
		//formatting issues
	//var var_fixed_catch = CurrencyFormatted(var_catch_up)
	//document.all.status1.innerHTML = ("<strong>You Maximum Allowable Contribution is $"+var_fixed_catch+"</strong>");
	//window.alert("You Maximum Allowable Contribution is $"+var_fixed_catch);
	//var var_fixed_max = CurrencyFormatted(var_max_allow)
	//if (var_GEHA == 1){
	//document.all.status1.innerHTML = "";
	//document.all.status2.innerHTML = ("<strong>You Maximum Allowable Contribution is $"+var_fixed_catch+"</strong>");
	//document.all.status3.innerHTML = ("<strong>You Maximum Member Contribution is $"+var_fixed_max+"</strong>");
	//window.alert("Your Maximum Member Contribution is $"+var_fixed_max);
		//}

}
/*function CurrencyFormatted(amount)
{
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
}

//function validate(element_numb)
//{
//	var var_element_numb = element_numb
		
		//switch(var_element_numb) 
		//{
		//	case 1:
			//	if(document.calculator.planType.value <= 0){
				//	window.alert("Please select something other than the default option");
				//}
	//			break;
		//	case 2:
		//		if(document.calculator.duration.value <= 0){
				//	window.alert("Please select something other than the default option");
			//	}
			//	break;
		//	case 3:
		//		if(document.calculator.eligible.value <= 0){
					//window.alert("Please select something other than the default option");
				//}
				//break;				
			//case 4:
		//		if(document.calculator.eligible_spouse.value <= 0){
				//	window.alert("Please select something other than the default option");
			//	}
		//		break;

	//	}
//}
*/


