
function backer(){
	
	if (document.backform.odiscount.value<0 || document.backform.oodds.value<1.01 || document.backform.odiscount.value>99)
	{alert('You have filled incorrect value');
return};
    var tstakeval = document.backform.tstake.value;
var ooddsval = document.backform.oodds.value;
    var odiscountval = document.backform.odiscount.value;
        var oabscommval = 0.95+(0.05*(odiscountval/100));


document.backform.netwin.value = Math.round((((tstakeval*ooddsval)-tstakeval)*oabscommval)*100)/100;
document.backform.comm.value = Math.round((((tstakeval*ooddsval)-tstakeval)-document.backform.netwin.value)*100)/100;
document.backform.actodds.value = Math.round((1+(document.backform.netwin.value/tstakeval))*100)/100;
	
}


function layer(){
	
	if (document.layform.ldiscount.value<0 || document.layform.lodds.value<1.01 || document.layform.ldiscount.value>99)
	{alert('You have filled incorrect value');
return};
    var lstakeval = document.layform.lstake.value;
var loddsval = document.layform.lodds.value;
    var ldiscountval = document.layform.ldiscount.value;
        var labscommval = 0.95+(0.05*(ldiscountval/100));

document.layform.lnetwin.value = Math.round(((lstakeval/(loddsval-1))*labscommval)*100)/100;
document.layform.lcomm.value = Math.round(((lstakeval/(loddsval-1))-document.layform.lnetwin.value)*100)/100;
var uno = document.layform.lnetwin.value;
var dos = document.layform.lcomm.value
document.layform.lbstake.value = Math.round((Number(uno) + Number(dos))*100)/100;
document.layform.lactodds.value = Math.round((1+(document.layform.lnetwin.value/lstakeval))*100)/100;
	
}

function valu(){
	if (document.valustake.budget.value<1 || document.valustake.odd.value<1.01)
	{alert('You have filled incorrect value');
return};
var budget = document.valustake.budget.value;
var odd = document.valustake.odd.value;
var sure = document.valustake.sure.value;
var propstake = Math.round(((((budget/(odd-1))*0.9)/20)/sure)*100)/100;
if (propstake < budget/200)
{propstake = budget/200};
 if (propstake > budget/10)
{propstake = budget/10};
document.valustake.stake.value = propstake
};
function kelly(){
	if (document.kellyc.budget.value<1 || document.kellyc.odd.value<1.01 || document.kellyc.prob.value<1)
	{alert('You have filled incorrect value');
return};
var budget = document.kellyc.budget.value;
var odd = document.kellyc.odd.value;
var procent = document.kellyc.prob.value/100
var chisl = ((odd*procent-1)/(odd-1))*100;
var propstake = budget*(chisl/100);
if (propstake<0)
{alert('Odds are too low for the suggested probability');
return}
document.kellyc.stake.value = Math.round(propstake*100)/100
};
function drawnobet(){
    if (document.dnb.tstake.value<1 || document.dnb.owin.value<1.01 || document.dnb.odraw.value<1.01)
	{alert('You have filled incorrect value');
return};
	var tstakeval = document.dnb.tstake.value;
var owinval = document.dnb.owin.value;
    var odrawval = document.dnb.odraw.value;
     document.dnb.stdraw.value = Math.round((tstakeval/odrawval)*100)/100;
document.dnb.stwin.value = tstakeval-document.dnb.stdraw.value;
document.dnb.dodds.value = Math.round((((tstakeval-(tstakeval/odrawval))*owinval)/tstakeval)*1000)/1000;
	
}
;
function halfcalc(){
	if (document.xhalf.xtstake.value<1 || document.xhalf.xowin.value<1.01 || document.xhalf.xodraw.value<1.01)
	{alert('You have filled incorrect value');
return};
    var xtstakeval = document.xhalf.xtstake.value;
var xowinval = document.xhalf.xowin.value;
    var xodrawval = document.xhalf.xodraw.value;
var xvodds = Math.round(((xowinval*xodrawval)/((xowinval*1)+(xodrawval*1)))*1000)/1000;
var xtwin = xtstakeval*xvodds;
document.xhalf.xstdraw.value = Math.round((xtwin/xodrawval)*100)/100;
document.xhalf.xstwin.value = xtstakeval-document.xhalf.xstdraw.value;
document.xhalf.xdodds.value = xvodds;

};
function juicecalc(){
	if (document.bjuice.varone.value<1.01 || document.bjuice.vartwo.value<1.01)
	{alert('You have filled incorrect value');
return};
    var yvarone = document.bjuice.varone.value;
var yvartwo = document.bjuice.vartwo.value;
     document.bjuice.ojuice.value = Math.round((100*(1/((1/yvarone)+(1/yvartwo))))*100)/100;
	
};
function muicecalc(){
	if (document.muice.marone.value<1.01 || document.muice.martwo.value<1.01 || document.muice.martri.value<1.01)
	{alert('You have filled incorrect value');
return};
    var ymarone = document.muice.marone.value;
var ymartwo = document.muice.martwo.value;
    var ymartri = document.muice.martri.value;
     document.muice.mojuice.value = Math.round((100*(1/((1/ymarone)+(1/ymartwo)+(1/ymartri))))*100)/100;
	}
function showhide(id){ 
		if (document.getElementById){ 
			obj = document.getElementById(id); 
			if (obj.style.display == "none"){ 
				obj.style.display = ""; 
			} else { 
				obj.style.display = "none"; 
			} 
		} 
	} 

