function CalcKeyCode(aChar) {
  var character = aChar.substring(0,1);
  var code = aChar.charCodeAt(0);
  return code;
}


function checkNumber(val) {
  var strPass = val.value;
  var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);

  if (cCode < 48 || cCode > 57 ) {
    var myNumber = val.value.substring(0, (strLength) - 1);
    val.value = myNumber;
  }
  else {
  }
  return false;
}


function check_guess_one(val) {
var strPass = val.value;
var strLength = strPass.length;

if (document.forms.fsp.guess_one.value == "1")
	{

	}

else
	{
	var wvar = val.value.substring(0, (strLength) - 1);
	val.value = wvar;
	}

return false;
}

function check_guess_one_frp(val) {
var strPass = val.value;
var strLength = strPass.length;

if (document.forms.frp.guess_one.value == "1")
	{

	}

else
	{
	var wvar = val.value.substring(0, (strLength) - 1);
	val.value = wvar;
	}

return false;
}

function check_guess_one_flp(val) {
var strPass = val.value;
var strLength = strPass.length;

if (document.forms.flp.guess_one.value == "1")
	{

	}

else
	{
	var wvar = val.value.substring(0, (strLength) - 1);
	val.value = wvar;
	}

return false;
}


function check_guess_one_flep(val) {
var strPass = val.value;
var strLength = strPass.length;

if (document.forms.flep.guess_one.value == "1")
	{

	}

else
	{
	var wvar = val.value.substring(0, (strLength) - 1);
	val.value = wvar;
	}

return false;
}



function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}


function which_guesses() {

	var g_a_1 = document.forms.fsp.eb_1_1_1.value;
		if (g_a_1 == "") {var g_a_1 = 0;}
		else {var g_a_1 = 1;}
	
	var g_a_2 = document.forms.fsp.eb_1_1_2.value;
		if (g_a_2 == "") {var g_a_2 = 0;}
		else {var g_a_2 = 1;}
	
			var g_a = g_a_1+g_a_2;
	
	
	var g_b_1 = document.forms.fsp.eb_2_1_1.value;
		if (g_b_1 == "") {var g_b_1 = 0;}
		else {var g_b_1 = 1;}
	
	var g_b_2 = document.forms.fsp.eb_2_1_2.value;
		if (g_b_2 == "") {var g_b_2 = 0;}
		else {var g_b_2 = 1;}
	
			var g_b = g_b_1+g_b_2;
	
	
	var g_c_1 = document.forms.fsp.eb_3_1_1.value;
		if (g_c_1 == "") {var g_c_1 = 0;}
		else {var g_c_1 = 1;}
	
	var g_c_2 = document.forms.fsp.eb_3_1_2.value;
		if (g_c_2 == "") {var g_c_2 = 0;}
		else {var g_c_2 = 1;}
	
			var g_c = g_c_1+g_c_2;

	
	var g_d_1 = document.forms.fsp.eb_4_1_1.value;
		if (g_d_1 == "") {var g_d_1 = 0;}
		else {var g_d_1 = 1;}
	
	var g_d_2 = document.forms.fsp.eb_4_1_2.value;
		if (g_d_2 == "") {var g_d_2 = 0;}
		else {var g_d_2 = 1;}
	
			var g_d = g_d_1+g_d_2;
	
	
	var g_e_1 = document.forms.fsp.eb_5_1_1.value;
		if (g_e_1 == "") {var g_e_1 = 0;}
		else {var g_e_1 = 1;}
	
	var g_e_2 = document.forms.fsp.eb_5_1_2.value;
		if (g_e_2 == "") {var g_e_2 = 0;}
		else {var g_e_2 = 1;}
	
			var g_e = g_e_1+g_e_2;
	
	
	var g_f_1 = document.forms.fsp.eb_6_1_1.value;
		if (g_f_1 == "") {var g_f_1 = 0;}
		else {var g_f_1 = 1;}
	
	var g_f_2 = document.forms.fsp.eb_6_1_2.value;
		if (g_f_2 == "") {var g_f_2 = 0;}
		else {var g_f_2 = 1;}
	
			var g_f = g_f_1+g_f_2;


//guess 2
	var g2_a_1 = document.forms.fsp.eb_1_2_1.value;
		if (g2_a_1 == "") {var g2_a_1 = 0;}
		else {var g2_a_1 = 1;}
	
	var g2_a_2 = document.forms.fsp.eb_1_2_2.value;
		if (g2_a_2 == "") {var g2_a_2 = 0;}
		else {var g2_a_2 = 1;}
	
			var g2_a = g2_a_1+g2_a_2;
	
	
	var g2_b_1 = document.forms.fsp.eb_2_2_1.value;
		if (g2_b_1 == "") {var g2_b_1 = 0;}
		else {var g2_b_1 = 1;}
	
	var g2_b_2 = document.forms.fsp.eb_2_2_2.value;
		if (g2_b_2 == "") {var g2_b_2 = 0;}
		else {var g2_b_2 = 1;}
	
			var g2_b = g2_b_1+g2_b_2;
	
	
	var g2_c_1 = document.forms.fsp.eb_3_2_1.value;
		if (g2_c_1 == "") {var g2_c_1 = 0;}
		else {var g2_c_1 = 1;}
	
	var g2_c_2 = document.forms.fsp.eb_3_2_2.value;
		if (g2_c_2 == "") {var g2_c_2 = 0;}
		else {var g2_c_2 = 1;}
	
			var g2_c = g2_c_1+g2_c_2;
	
	
	var g2_d_1 = document.forms.fsp.eb_4_2_1.value;
		if (g2_d_1 == "") {var g2_d_1 = 0;}
		else {var g2_d_1 = 1;}
	
	var g2_d_2 = document.forms.fsp.eb_4_2_2.value;
		if (g2_d_2 == "") {var g2_d_2 = 0;}
		else {var g2_d_2 = 1;}
	
			var g2_d = g2_d_1+g2_d_2;
	
	
	var g2_e_1 = document.forms.fsp.eb_5_2_1.value;
		if (g2_e_1 == "") {var g2_e_1 = 0;}
		else {var g2_e_1 = 1;}
	
	var g2_e_2 = document.forms.fsp.eb_5_2_2.value;
		if (g2_e_2 == "") {var g2_e_2 = 0;}
		else {var g2_e_2 = 1;}
	
			var g2_e = g2_e_1+g2_e_2;
	
	
	var g2_f_1 = document.forms.fsp.eb_6_2_1.value;
		if (g2_f_1 == "") {var g2_f_1 = 0;}
		else {var g2_f_1 = 1;}
	
	var g2_f_2 = document.forms.fsp.eb_6_2_2.value;
		if (g2_f_2 == "") {var g2_f_2 = 0;}
		else {var g2_f_2 = 1;}
	
			var g2_f = g2_f_1+g2_f_2;
	
	
	//guess 3
	var g3_a_1 = document.forms.fsp.eb_1_3_1.value;
		if (g3_a_1 == "") {var g3_a_1 = 0;}
		else {var g3_a_1 = 1;}
	
	var g3_a_2 = document.forms.fsp.eb_1_3_2.value;
		if (g3_a_2 == "") {var g3_a_2 = 0;}
		else {var g3_a_2 = 1;}
	
			var g3_a = g3_a_1+g3_a_2;
	
	
	var g3_b_1 = document.forms.fsp.eb_2_3_1.value;
		if (g3_b_1 == "") {var g3_b_1 = 0;}
		else {var g3_b_1 = 1;}
	
	var g3_b_2 = document.forms.fsp.eb_2_3_2.value;
		if (g3_b_2 == "") {var g3_b_2 = 0;}
		else {var g3_b_2 = 1;}
	
			var g3_b = g3_b_1+g3_b_2;
	
	
	var g3_c_1 = document.forms.fsp.eb_3_3_1.value;
		if (g3_c_1 == "") {var g3_c_1 = 0;}
		else {var g3_c_1 = 1;}
	
	var g3_c_2 = document.forms.fsp.eb_3_3_2.value;
		if (g3_c_2 == "") {var g3_c_2 = 0;}
		else {var g3_c_2 = 1;}
	
			var g3_c = g3_c_1+g3_c_2;
	
	
	var g3_d_1 = document.forms.fsp.eb_4_3_1.value;
		if (g3_d_1 == "") {var g3_d_1 = 0;}
		else {var g3_d_1 = 1;}
	
	var g3_d_2 = document.forms.fsp.eb_4_3_2.value;
		if (g3_d_2 == "") {var g3_d_2 = 0;}
		else {var g3_d_2 = 1;}
	
			var g3_d = g3_d_1+g3_d_2;
	
	
	var g3_e_1 = document.forms.fsp.eb_5_3_1.value;
		if (g3_e_1 == "") {var g3_e_1 = 0;}
		else {var g3_e_1 = 1;}
	
	var g3_e_2 = document.forms.fsp.eb_5_3_2.value;
		if (g3_e_2 == "") {var g3_e_2 = 0;}
		else {var g3_e_2 = 1;}
	
			var g3_e = g3_e_1+g3_e_2;
	
	
	var g3_f_1 = document.forms.fsp.eb_6_3_1.value;
		if (g3_f_1 == "") {var g3_f_1 = 0;}
		else {var g3_f_1 = 1;}
	
	var g3_f_2 = document.forms.fsp.eb_6_3_2.value;
		if (g3_f_2 == "") {var g3_f_2 = 0;}
		else {var g3_f_2 = 1;}
	
			var g3_f = g3_f_1+g3_f_2;
	
	//totals
	
	var tot_guess_one = g_a+g_b+g_c+g_d+g_e+g_f;
	
		if (tot_guess_one==12)
			{
			document.forms.fsp.guess_one.value = "1";
			inactive_button.style.display = "none";
			active_button.style.display = "block";
			}
		else
			{
			document.forms.fsp.guess_one.value = "";
			active_button.style.display = "none";
			inactive_button.style.display = "block";
			}


	var tot_guess = g_a+g_b+g_c+g_d+g_e+g_f + g2_a+g2_b+g2_c+g2_d+g2_e+g2_f + g3_a+g3_b+g3_c+g3_d+g3_e+g3_f;	


	var line_one = ((g_a+g2_a+g3_a)/2);
	var line_two = ((g_b+g2_b+g3_b)/2);
	var line_three = ((g_c+g2_c+g3_c)/2);
	var line_four = ((g_d+g2_d+g3_d)/2);
	var line_five = ((g_e+g2_e+g3_e)/2);
	var line_six = ((g_f+g2_f+g3_f)/2);

	document.forms.fsp.line_one.value = line_one;
	document.forms.fsp.line_two.value = line_two;
	document.forms.fsp.line_three.value = line_three;
	document.forms.fsp.line_four.value = line_four;
	document.forms.fsp.line_five.value = line_five;
	document.forms.fsp.line_six.value = line_six;

	document.forms.fsp.num_entries.value = parseInt(Left(line_one,1)) * parseInt(Left(line_two,1)) * parseInt(Left(line_three,1)) * parseInt(Left(line_four,1)) * parseInt(Left(line_five,1)) * parseInt(Left(line_six,1));

	document.forms.fsp.tot_cost.value = parseInt(Left(line_one,1)) * parseInt(Left(line_two,1)) * parseInt(Left(line_three,1)) * parseInt(Left(line_four,1)) * parseInt(Left(line_five,1)) * parseInt(Left(line_six,1));

	paid_bonus();

}


function paid_bonus(which_box) {

	var wb = which_box;
	var t_cost = document.forms.fsp.tot_cost.value;
	var paid_c = document.forms.fsp.paid_credits.value;
	var bonus_c = document.forms.fsp.bonus_credits.value;

	if (wb == 1)
			{
			document.forms.fsp.bonus_credits.value = (t_cost-paid_c)
			}
	else if (wb = 2)
			{
			document.forms.fsp.paid_credits.value = (t_cost-bonus_c)
			}

	if (document.forms.fsp.bonus_credits.value == t_cost)
	{
	alert("You must use at least 1 paid credit");
	document.forms.fsp.paid_credits.value = 1;
	document.forms.fsp.bonus_credits.value = (t_cost-1);
	}

	if (document.forms.fsp.bonus_credits.value < 0)
	{
	document.forms.fsp.bonus_credits.value = 0;
	document.forms.fsp.paid_credits.value = t_cost;
	alert("The sum of paid and bonus credits must not exceed the total cost");
	}

	if (document.forms.fsp.paid_credits.value < 0)
	{
	document.forms.fsp.paid_credits.value = 1;
	document.forms.fsp.bonus_credits.value = (t_cost-1);
	alert("The sum of paid and bonus credits must not exceed the total cost");
	}

}


function paid_bonus_frp(which_box) {

	var wb = which_box;
	var t_cost = document.forms.frp.tot_cost.value;
	var paid_c = document.forms.frp.paid_credits.value;
	var bonus_c = document.forms.frp.bonus_credits.value;

	if (wb == 1)
			{
			document.forms.frp.bonus_credits.value = (t_cost-paid_c)
			}
	else if (wb = 2)
			{
			document.forms.frp.paid_credits.value = (t_cost-bonus_c)
			}

	if (document.forms.frp.bonus_credits.value == t_cost)
	{
	alert("You must use at least 1 paid credit");
	document.forms.frp.paid_credits.value = 1;
	document.forms.frp.bonus_credits.value = (t_cost-1);
	}

	if (document.forms.frp.bonus_credits.value < 0)
	{
	document.forms.frp.bonus_credits.value = 0;
	document.forms.frp.paid_credits.value = t_cost;
	alert("The sum of paid and bonus credits must not exceed the total cost");
	}

	if (document.forms.frp.paid_credits.value < 0)
	{
	document.forms.frp.paid_credits.value = 1;
	document.forms.frp.bonus_credits.value = (t_cost-1);
	alert("The sum of paid and bonus credits must not exceed the total cost");
	}

}

function paid_bonus_flp(which_box) {

	var wb = which_box;
	var t_cost = document.forms.flp.tot_cost.value;
	var paid_c = document.forms.flp.paid_credits.value;
	var bonus_c = document.forms.flp.bonus_credits.value;

	if (wb == 1)
			{
			document.forms.flp.bonus_credits.value = (t_cost-paid_c)
			}
	else if (wb = 2)
			{
			document.forms.flp.paid_credits.value = (t_cost-bonus_c)
			}

	if (document.forms.flp.bonus_credits.value == t_cost)
	{
	alert("You must use at least 1 paid credit");
	document.forms.flp.paid_credits.value = 1;
	document.forms.flp.bonus_credits.value = (t_cost-1);
	}

	if (document.forms.flp.bonus_credits.value < 0)
	{
	document.forms.flp.bonus_credits.value = 0;
	document.forms.flp.paid_credits.value = t_cost;
	alert("The sum of paid and bonus credits must not exceed the total cost");
	}

	if (document.forms.flp.paid_credits.value < 0)
	{
	document.forms.flp.paid_credits.value = 1;
	document.forms.flp.bonus_credits.value = (t_cost-1);
	alert("The sum of paid and bonus credits must not exceed the total cost");
	}

}


function paid_bonus_flep(which_box) {

	var wb = which_box;
	var t_cost = document.forms.flep.tot_cost.value;
	var paid_c = document.forms.flep.paid_credits.value;
	var bonus_c = document.forms.flep.bonus_credits.value;

	if (wb == 1)
			{
			document.forms.flep.bonus_credits.value = (t_cost-paid_c)
			}
	else if (wb = 2)
			{
			document.forms.flep.paid_credits.value = (t_cost-bonus_c)
			}

	if (document.forms.flep.bonus_credits.value == t_cost)
	{
	alert("You must use at least 1 paid credit");
	document.forms.flep.paid_credits.value = 1;
	document.forms.flep.bonus_credits.value = (t_cost-1);
	}

	if (document.forms.flep.bonus_credits.value < 0)
	{
	document.forms.flep.bonus_credits.value = 0;
	document.forms.flep.paid_credits.value = t_cost;
	alert("The sum of paid and bonus credits must not exceed the total cost");
	}

	if (document.forms.flep.paid_credits.value < 0)
	{
	document.forms.flep.paid_credits.value = 1;
	document.forms.flep.bonus_credits.value = (t_cost-1);
	alert("The sum of paid and bonus credits must not exceed the total cost");
	}

}



function which_guesses_frp() {


	//var selObj = document.getElementById('eb_1_1_1');
	//selObj.selectedIndex = num;
	//alert (selObj.selectedIndex);

	var g_a = document.forms.frp.eb_1_1_1.value;
		if (g_a == "") {var g_a = 0;}
		else {var g_a = 1;}


	var g_b = document.forms.frp.eb_2_1_1.value;
		if (g_b == "") {var g_b = 0;}
		else {var g_b = 1;}


	var g_c = document.forms.frp.eb_3_1_1.value;
		if (g_c == "") {var g_c = 0;}
		else {var g_c = 1;}


	var g_d = document.forms.frp.eb_4_1_1.value;
		if (g_d == "") {var g_d = 0;}
		else {var g_d = 1;}


	var g_e = document.forms.frp.eb_5_1_1.value;
		if (g_e == "") {var g_e = 0;}
		else {var g_e = 1;}


	var g_f = document.forms.frp.eb_6_1_1.value;
		if (g_f == "") {var g_f = 0;}
		else {var g_f = 1;}


//guess 2
	var g2_a = document.forms.frp.eb_1_2_1.value;
		if (g2_a == "") {var g2_a = 0;}
		else {var g2_a = 1;}
	

	var g2_b = document.forms.frp.eb_2_2_1.value;
		if (g2_b == "") {var g2_b = 0;}
		else {var g2_b = 1;}


	var g2_c = document.forms.frp.eb_3_2_1.value;
		if (g2_c == "") {var g2_c = 0;}
		else {var g2_c = 1;}


	var g2_d = document.forms.frp.eb_4_2_1.value;
		if (g2_d == "") {var g2_d = 0;}
		else {var g2_d = 1;}


	var g2_e = document.forms.frp.eb_5_2_1.value;
		if (g2_e == "") {var g2_e = 0;}
		else {var g2_e = 1;}


	var g2_f = document.forms.frp.eb_6_2_1.value;
		if (g2_f == "") {var g2_f = 0;}
		else {var g2_f = 1;}


	//guess 3
	var g3_a = document.forms.frp.eb_1_3_1.value;
		if (g3_a == "") {var g3_a = 0;}
		else {var g3_a = 1;}


	var g3_b = document.forms.frp.eb_2_3_1.value;
		if (g3_b == "") {var g3_b = 0;}
		else {var g3_b = 1;}


	var g3_c = document.forms.frp.eb_3_3_1.value;
		if (g3_c == "") {var g3_c = 0;}
		else {var g3_c = 1;}


	var g3_d = document.forms.frp.eb_4_3_1.value;
		if (g3_d == "") {var g3_d = 0;}
		else {var g3_d = 1;}


	var g3_e = document.forms.frp.eb_5_3_1.value;
		if (g3_e == "") {var g3_e = 0;}
		else {var g3_e = 1;}


	var g3_f = document.forms.frp.eb_6_3_1.value;
		if (g3_f == "") {var g3_f = 0;}
		else {var g3_f = 1;}


	//totals
	
	var tot_guess_one = g_a+g_b+g_c+g_d+g_e+g_f;
	
		if (tot_guess_one==6)
			{
			document.forms.frp.guess_one.value = "1";
			inactive_button.style.display = "none";
			active_button.style.display = "block";
			}
		else
			{
			document.forms.frp.guess_one.value = "";
			active_button.style.display = "none";
			inactive_button.style.display = "block";
			}


	var tot_guess = g_a+g_b+g_c+g_d+g_e+g_f + g2_a+g2_b+g2_c+g2_d+g2_e+g2_f + g3_a+g3_b+g3_c+g3_d+g3_e+g3_f;	


	var line_one = (g_a+g2_a+g3_a);
	var line_two = (g_b+g2_b+g3_b);
	var line_three = (g_c+g2_c+g3_c);
	var line_four = (g_d+g2_d+g3_d);
	var line_five = (g_e+g2_e+g3_e);
	var line_six = (g_f+g2_f+g3_f);

	document.forms.frp.line_one.value = line_one;
	document.forms.frp.line_two.value = line_two;
	document.forms.frp.line_three.value = line_three;
	document.forms.frp.line_four.value = line_four;
	document.forms.frp.line_five.value = line_five;
	document.forms.frp.line_six.value = line_six;

	document.forms.frp.num_entries.value = parseInt(Left(line_one,1)) * parseInt(Left(line_two,1)) * parseInt(Left(line_three,1)) * parseInt(Left(line_four,1)) * parseInt(Left(line_five,1)) * parseInt(Left(line_six,1));

	document.forms.frp.tot_cost.value = parseInt(Left(line_one,1)) * parseInt(Left(line_two,1)) * parseInt(Left(line_three,1)) * parseInt(Left(line_four,1)) * parseInt(Left(line_five,1)) * parseInt(Left(line_six,1));

	paid_bonus_frp();

}


function which_guesses_flp() {


	//var selObj = document.getElementById('eb_1_1_1');
	//selObj.selectedIndex = num;
	//alert (selObj.selectedIndex);

	var g_a = document.forms.flp.eb_1_1_1.value;
		if (g_a == "") {var g_a = 0;}
		else {var g_a = 1;}


	var g_b = document.forms.flp.eb_2_1_1.value;
		if (g_b == "") {var g_b = 0;}
		else {var g_b = 1;}


	var g_c = document.forms.flp.eb_3_1_1.value;
		if (g_c == "") {var g_c = 0;}
		else {var g_c = 1;}


	var g_d = document.forms.flp.eb_4_1_1.value;
		if (g_d == "") {var g_d = 0;}
		else {var g_d = 1;}


	var g_e = document.forms.flp.eb_5_1_1.value;
		if (g_e == "") {var g_e = 0;}
		else {var g_e = 1;}


	var g_f = document.forms.flp.eb_6_1_1.value;
		if (g_f == "") {var g_f = 0;}
		else {var g_f = 1;}


//guess 2
	var g2_a = document.forms.flp.eb_1_2_1.value;
		if (g2_a == "") {var g2_a = 0;}
		else {var g2_a = 1;}
	

	var g2_b = document.forms.flp.eb_2_2_1.value;
		if (g2_b == "") {var g2_b = 0;}
		else {var g2_b = 1;}


	var g2_c = document.forms.flp.eb_3_2_1.value;
		if (g2_c == "") {var g2_c = 0;}
		else {var g2_c = 1;}


	var g2_d = document.forms.flp.eb_4_2_1.value;
		if (g2_d == "") {var g2_d = 0;}
		else {var g2_d = 1;}


	var g2_e = document.forms.flp.eb_5_2_1.value;
		if (g2_e == "") {var g2_e = 0;}
		else {var g2_e = 1;}


	var g2_f = document.forms.flp.eb_6_2_1.value;
		if (g2_f == "") {var g2_f = 0;}
		else {var g2_f = 1;}


	//guess 3
	var g3_a = document.forms.flp.eb_1_3_1.value;
		if (g3_a == "") {var g3_a = 0;}
		else {var g3_a = 1;}


	var g3_b = document.forms.flp.eb_2_3_1.value;
		if (g3_b == "") {var g3_b = 0;}
		else {var g3_b = 1;}


	var g3_c = document.forms.flp.eb_3_3_1.value;
		if (g3_c == "") {var g3_c = 0;}
		else {var g3_c = 1;}


	var g3_d = document.forms.flp.eb_4_3_1.value;
		if (g3_d == "") {var g3_d = 0;}
		else {var g3_d = 1;}


	var g3_e = document.forms.flp.eb_5_3_1.value;
		if (g3_e == "") {var g3_e = 0;}
		else {var g3_e = 1;}


	var g3_f = document.forms.flp.eb_6_3_1.value;
		if (g3_f == "") {var g3_f = 0;}
		else {var g3_f = 1;}


	//totals
	
	var tot_guess_one = g_a+g_b+g_c+g_d+g_e+g_f;
	
		if (tot_guess_one==6)
			{
			document.forms.flp.guess_one.value = "1";
			inactive_button.style.display = "none";
			active_button.style.display = "block";
			}
		else
			{
			document.forms.flp.guess_one.value = "";
			active_button.style.display = "none";
			inactive_button.style.display = "block";
			}


	var tot_guess = g_a+g_b+g_c+g_d+g_e+g_f + g2_a+g2_b+g2_c+g2_d+g2_e+g2_f + g3_a+g3_b+g3_c+g3_d+g3_e+g3_f;	


	var line_one = (g_a+g2_a+g3_a);
	var line_two = (g_b+g2_b+g3_b);
	var line_three = (g_c+g2_c+g3_c);
	var line_four = (g_d+g2_d+g3_d);
	var line_five = (g_e+g2_e+g3_e);
	var line_six = (g_f+g2_f+g3_f);

	document.forms.flp.line_one.value = line_one;
	document.forms.flp.line_two.value = line_two;
	document.forms.flp.line_three.value = line_three;
	document.forms.flp.line_four.value = line_four;
	document.forms.flp.line_five.value = line_five;
	document.forms.flp.line_six.value = line_six;

	document.forms.flp.num_entries.value = parseInt(Left(line_one,1)) * parseInt(Left(line_two,1)) * parseInt(Left(line_three,1)) * parseInt(Left(line_four,1)) * parseInt(Left(line_five,1)) * parseInt(Left(line_six,1));

	document.forms.flp.tot_cost.value = parseInt(Left(line_one,1)) * parseInt(Left(line_two,1)) * parseInt(Left(line_three,1)) * parseInt(Left(line_four,1)) * parseInt(Left(line_five,1)) * parseInt(Left(line_six,1));

	paid_bonus_flp();

}





function which_guesses_flep() {


	//var selObj = document.getElementById('eb_1_1_1');
	//selObj.selectedIndex = num;
	//alert (selObj.selectedIndex);

	var g_a = document.forms.flep.eb_1_1_1.value;
		if (g_a == "") {var g_a = 0;}
		else {var g_a = 1;}


	var g_b = document.forms.flep.eb_2_1_1.value;
		if (g_b == "") {var g_b = 0;}
		else {var g_b = 1;}


	var g_c = document.forms.flep.eb_3_1_1.value;
		if (g_c == "") {var g_c = 0;}
		else {var g_c = 1;}


	var g_d = document.forms.flep.eb_4_1_1.value;
		if (g_d == "") {var g_d = 0;}
		else {var g_d = 1;}


	var g_e = document.forms.flep.eb_5_1_1.value;
		if (g_e == "") {var g_e = 0;}
		else {var g_e = 1;}


	var g_f = document.forms.flep.eb_6_1_1.value;
		if (g_f == "") {var g_f = 0;}
		else {var g_f = 1;}


//guess 2
	var g2_a = document.forms.flep.eb_1_2_1.value;
		if (g2_a == "") {var g2_a = 0;}
		else {var g2_a = 1;}
	

	var g2_b = document.forms.flep.eb_2_2_1.value;
		if (g2_b == "") {var g2_b = 0;}
		else {var g2_b = 1;}


	var g2_c = document.forms.flep.eb_3_2_1.value;
		if (g2_c == "") {var g2_c = 0;}
		else {var g2_c = 1;}


	var g2_d = document.forms.flep.eb_4_2_1.value;
		if (g2_d == "") {var g2_d = 0;}
		else {var g2_d = 1;}


	var g2_e = document.forms.flep.eb_5_2_1.value;
		if (g2_e == "") {var g2_e = 0;}
		else {var g2_e = 1;}


	var g2_f = document.forms.flep.eb_6_2_1.value;
		if (g2_f == "") {var g2_f = 0;}
		else {var g2_f = 1;}


	//guess 3
	var g3_a = document.forms.flep.eb_1_3_1.value;
		if (g3_a == "") {var g3_a = 0;}
		else {var g3_a = 1;}


	var g3_b = document.forms.flep.eb_2_3_1.value;
		if (g3_b == "") {var g3_b = 0;}
		else {var g3_b = 1;}


	var g3_c = document.forms.flep.eb_3_3_1.value;
		if (g3_c == "") {var g3_c = 0;}
		else {var g3_c = 1;}


	var g3_d = document.forms.flep.eb_4_3_1.value;
		if (g3_d == "") {var g3_d = 0;}
		else {var g3_d = 1;}


	var g3_e = document.forms.flep.eb_5_3_1.value;
		if (g3_e == "") {var g3_e = 0;}
		else {var g3_e = 1;}


	var g3_f = document.forms.flep.eb_6_3_1.value;
		if (g3_f == "") {var g3_f = 0;}
		else {var g3_f = 1;}


	//totals
	
	var tot_guess_one = g_a+g_b+g_c+g_d+g_e+g_f;
	
		if (tot_guess_one==6)
			{
			document.forms.flep.guess_one.value = "1";
			inactive_button.style.display = "none";
			active_button.style.display = "block";
			}
		else
			{
			document.forms.flep.guess_one.value = "";
			active_button.style.display = "none";
			inactive_button.style.display = "block";
			}


	var tot_guess = g_a+g_b+g_c+g_d+g_e+g_f + g2_a+g2_b+g2_c+g2_d+g2_e+g2_f + g3_a+g3_b+g3_c+g3_d+g3_e+g3_f;	


	var line_one = (g_a+g2_a+g3_a);
	var line_two = (g_b+g2_b+g3_b);
	var line_three = (g_c+g2_c+g3_c);
	var line_four = (g_d+g2_d+g3_d);
	var line_five = (g_e+g2_e+g3_e);
	var line_six = (g_f+g2_f+g3_f);

	document.forms.flep.line_one.value = line_one;
	document.forms.flep.line_two.value = line_two;
	document.forms.flep.line_three.value = line_three;
	document.forms.flep.line_four.value = line_four;
	document.forms.flep.line_five.value = line_five;
	document.forms.flep.line_six.value = line_six;

	document.forms.flep.num_entries.value = parseInt(Left(line_one,1)) * parseInt(Left(line_two,1)) * parseInt(Left(line_three,1)) * parseInt(Left(line_four,1)) * parseInt(Left(line_five,1)) * parseInt(Left(line_six,1));

	document.forms.flep.tot_cost.value = parseInt(Left(line_one,1)) * parseInt(Left(line_two,1)) * parseInt(Left(line_three,1)) * parseInt(Left(line_four,1)) * parseInt(Left(line_five,1)) * parseInt(Left(line_six,1));

	paid_bonus_flep();

}