// JavaScript Document
function  to_bet3(f1, f2, f3) {
if (f1>1&&f2>1&&f3>1) {
//alert('to_bet3')
        var sxema=document.getElementById('sxema').innerHTML;
        switch (sxema) {
	case "b_b_b5_" :
	     var profit=to_bet5_(f1, f2, f3);
	break;
	case "b_b_b5_1x" :
	     var profit=to_bet5_1x(f1, f2, f3);
	break;
	case "b_b_b50_" :
	     var profit=to_bet50_(f1, f2, f3);
	break;
	case "b_b_b50pl" :
	     var profit=to_bet50pl(f1, f2, f3);
	break;
	case "b_b_b5pl" :
	     var profit=to_bet5pl(f1, f2, f3);
	break;
	case "b_b_b5pl1x" :
	     var profit=to_bet5pl1x(f1, f2, f3);
	break;
	case "b_b_b5_5pl0" :
	     var profit=to_bet5_5pl0(f1, f2, f3);
	break;
	case "b_b_b0" :
	     var profit=to_bet0(f1, f2, f3);
	break;
	case "b_b_b01x" :
	     var profit=to_bet01x(f1, f2, f3);
	break;
	case "b_b_b3" :
	     var profit=to_bet33(f1, f2, f3);
	break;
	case "b_b_b32x" :
	     var profit=to_bet32x(f1, f2, f3);
	break;
	case "b_b_b5_x_5" :
	     var profit=to_bet5_x_5(f1, f2, f3);
	break;
	}
	return true;
}
else return false;
}
function  to_bet () {
//alert('to_bet')
	var f1=RoundX(document.getElementById('kb1_0').innerHTML);
	var f2=RoundX(document.getElementById('kb2_0').innerHTML);
	var f3=RoundX(document.getElementById('kb3_0').innerHTML);

	var f01=RoundX(document.main.to_kb1.value);
	var f02=RoundX(document.main.to_kb2.value);
	var f03=RoundX(document.main.to_kb3.value);
	var l01=RoundX(document.main.to_kl1.value);
	var l02=RoundX(document.main.to_kl2.value);
	var l03=RoundX(document.main.to_kl3.value);


	if (isNaN(f01) || f01<=1 ) {
              f01=f1;
              l01=1/(1-1/f1);
        }
        else {
              l01=1/(1-1/f01);
        }
        


        document.main.to_kb1.value=RoundX(f01);
        document.main.to_kl1.value=RoundX(l01);

	if (isNaN(f02) || f02<=1 ) {
              f02=f2;
              l02=1/(1-1/f2);
        }
        else {
              l02=1/(1-1/f02);
        }

           document.main.to_kb2.value=RoundX(f02);
           document.main.to_kl2.value=RoundX(l02);
           
	if (isNaN(f03) || f03<=1 ) {
              f03=f3;
              l03=1/(1-1/f3);
        }
        else {
              l03=1/(1-1/f03);
        }

           document.main.to_kb3.value=RoundX(f03);
           document.main.to_kl3.value=RoundX(l03);

           ////////////////////////////////////////////////////////////////


        to_bet3(f1, f2, f3);
}
function  to_bet_l () {
//alert('to_bet_l')
	var f1=RoundX(document.getElementById('kb1_0').innerHTML);
	var f2=RoundX(document.getElementById('kb2_0').innerHTML);
	var f3=RoundX(document.getElementById('kb3_0').innerHTML);

	var f01=RoundX(document.main.to_kb1.value);
	var f02=RoundX(document.main.to_kb2.value);
	var f03=RoundX(document.main.to_kb3.value);
	var l01=RoundX(document.main.to_kl1.value);
	var l02=RoundX(document.main.to_kl2.value);
	var l03=RoundX(document.main.to_kl3.value);


	if (isNaN(l01) || l01<=1 ) {
              l01=l1;
              f01=1/(1-1/l1);
        }
        else {
              f01=1/(1-1/l01);
        }
        
        document.main.to_kb1.value=RoundX(f01);
        document.main.to_kl1.value=RoundX(l01);

	if (isNaN(l02) || l02<=1 ) {
              l02=l2;
              f02=1/(1-1/l2);
        }
        else {
              f02=1/(1-1/l02);
        }

           document.main.to_kb2.value=RoundX(f02);
           document.main.to_kl2.value=RoundX(l02);

	if (isNaN(l03) || l03<=1 ) {
              l03=l3;
              f03=1/(1-1/l3);
        }
        else {
              f03=1/(1-1/l03);
        }

           document.main.to_kb3.value=RoundX(f03);
           document.main.to_kl3.value=RoundX(l03);

           ////////////////////////////////////////////////////////////////

	var f1=RoundX(document.getElementById('kb1_0').innerHTML);
	var f2=RoundX(document.getElementById('kb2_0').innerHTML);
	var f3=RoundX(document.getElementById('kb3_0').innerHTML);
        to_bet3(f1, f2, f3);
}
