/* borrowed from partimepoker.com */
var level=new Array(15);level[0]=0.05;level[1]=0.08;level[2]=0.12;level[3]=0.16;level[4]=0.23;level[5]=0.26;level[6]=0.28;level[7]=0.31;level[8]=0.04;level[9]=0.06;level[10]=0.08;level[11]=0.13;level[12]=0.18;level[13]=0.22;level[14]=0.26;level[15]=0.06;level[16]=0.09;level[17]=0.13;level[18]=0.17;level[19]=0.24;level[20]=0.27;level[21]=0.29;level[22]=0.32;level[23]=0.05;level[24]=0.07;level[25]=0.09;level[26]=0.14;level[27]=0.19;level[28]=0.23;level[29]=0.27;function compute(form){var selectedLevel=level[form.limit.value]/100;if(form.limit.value<15)var hands=form.hours.value*60;if(form.limit.value>=15)var hands=form.hours.value*80;if(form.tables[0].checked==true)var tables=form.tables[0].value;if(form.tables[1].checked==true)var tables=form.tables[1].value;if(form.tables[2].checked==true)var tables=form.tables[2].value;if(form.tables[3].checked==true)var tables=form.tables[3].value;var amount=(hands*selectedLevel*form.percent.value*(365 / 7 / 12)*tables);var roundedAmount="$"+Math.round((amount*1000)/1000);if(roundedAmount=="$NaN"){document.getElementById("totalDaily").firstChild.nodeValue="$0";document.getElementById("totalWeekly").firstChild.nodeValue="$0";document.getElementById("totalMonthly").firstChild.nodeValue="$0";document.getElementById("totalYearly").firstChild.nodeValue="$0";document.getElementById("rakebackDaily").firstChild.nodeValue="$0";document.getElementById("rakebackWeekly").firstChild.nodeValue="$0";document.getElementById("rakebackMonthly").firstChild.nodeValue="$0";document.getElementById("rakebackYearly").firstChild.nodeValue="$0"}else{var totalDaily=hands*selectedLevel*tables*100/7;var totalWeekly=totalDaily*7;var totalMonthly=totalWeekly*4.345;var totalYearly=totalMonthly*12;var rakebackDaily=totalDaily*form.percent.value/100;var rakebackWeekly=totalWeekly*form.percent.value/100;var rakebackMonthly=totalMonthly*form.percent.value/100;var rakebackYearly=totalYearly*form.percent.value/100;totalDaily=Math.round(totalDaily);totalWeekly=Math.round(totalWeekly);totalMonthly=Math.round(totalMonthly);totalYearly=Math.round(totalYearly);rakebackDaily=Math.round(rakebackDaily);rakebackWeekly=Math.round(rakebackWeekly);rakebackMonthly=Math.round(rakebackMonthly);rakebackYearly=Math.round(rakebackYearly);document.getElementById("totalDaily").firstChild.nodeValue="$"+totalDaily;document.getElementById("totalWeekly").firstChild.nodeValue="$"+totalWeekly;document.getElementById("totalMonthly").firstChild.nodeValue="$"+totalMonthly;document.getElementById("totalYearly").firstChild.nodeValue="$"+totalYearly;document.getElementById("rakebackDaily").firstChild.nodeValue="$"+rakebackDaily;document.getElementById("rakebackWeekly").firstChild.nodeValue="$"+rakebackWeekly;document.getElementById("rakebackMonthly").firstChild.nodeValue="$"+rakebackMonthly;document.getElementById("rakebackYearly").firstChild.nodeValue="$"+rakebackYearly}}
