function ClearForm(form){form.teama.value="";form.teamb.value="";form.hca.value="";form.vigorish.value="";form.sweephome.value="";form.sweeproad.value="";form.infivehome.value="";form.infiveroad.value="";form.insixhome.value="";form.insixroad.value="";form.insevenhome.value="";form.insevenroad.value="";form.totalhome.value="";form.totalroad.value="";}function percentUS(a){if(a < 0.5){return(1/a-1)*100;}else{return-(a/(1-a)*100);}}function series(hometeam,roadteam,hfa,vig){var wproba=+(hometeam);var wprobb=+(roadteam);var hca=+(hfa);var juice=+(vig);if(wproba>=1){alert('Please Enter a win probability between 0 and 1');}else if(wprobb>=1){alert('Please Enter a win probability between 0 and 1');}else if(hca>=1){alert('Please Enter a value between 0 and 1');}var homea=(wproba-wproba*wprobb)/(wproba+wprobb-2*wproba*wprobb)+hca;var roadb=1-homea;var homeb=(wprobb-wprobb*wproba)/(wprobb+wproba-2*wprobb*wproba)+hca;var roada=1-homeb;var sweepa=homea*homea*roada*roada;var sweepb=roadb*roadb*homeb*homeb;var infive=((homea*homea*homea*roada*homeb)*2)+((roadb*homea*homea*roada*roada)*2);var infivea=((homeb*homeb*roadb*roadb*homea)*2)+((roada*homeb*roadb*roadb*roadb)*2);var insix=(Math.pow(homea,2)*homeb*roadb*Math.pow(roada,2))*6+(Math.pow(homea,3)*Math.pow(homeb,2)*roada)+(Math.pow(roadb,2)*homea*Math.pow(roada,3))*3;var insixa=(Math.pow(homeb,2)*homea*roada*Math.pow(roadb,2))*6+(Math.pow(homeb,3)*Math.pow(homea,2)*roadb)*3+(Math.pow(roada,2)*homeb*Math.pow(roadb,3));var insevena=(Math.pow(roadb,3)*homeb*Math.pow(roada,2)*homea)*9+(Math.pow(roadb,4)*Math.pow(roada,3))+(Math.pow(homea,2)*Math.pow(roadb,3)*roada*homeb)+(Math.pow(roadb,2)*Math.pow(homea,2)*Math.pow(homeb,2)*roada)*6+(Math.pow(homea,3)*Math.pow(homeb,3)*roadb)+(Math.pow(homea,2)*Math.pow(roadb,2)*Math.pow(homeb,2)*roada)*2;var inseven=(Math.pow(homea,3)*roada*Math.pow(homeb,2)*roadb)*9+Math.pow(homea,4)*Math.pow(homeb,3)+Math.pow(roadb,2)*Math.pow(homea,3)*homeb*roada+(Math.pow(homea,2)*Math.pow(roadb,2)*Math.pow(roada,2)*homeb)*6+Math.pow(roadb,3)*Math.pow(roada,3)*homea+(Math.pow(roadb,2)*Math.pow(homea,2)*Math.pow(roada,2)*homeb)*2;var total=sweepa+infive+insix+inseven+((100+juice)/(200+juice)-0.5);var totala=sweepb+infivea+insixa+insevena+((100+juice)/(200+juice)-0.5);window.document.seriescalc.sweephome.value=Math.round(percentUS(sweepa+((100+juice)/(200+juice)-0.5)));window.document.seriescalc.sweephome.title=sweepa+((100+juice)/(200+juice)-0.5);window.document.seriescalc.sweeproad.value=Math.round(percentUS(sweepb+((100+juice)/(200+juice)-0.5)));window.document.seriescalc.sweeproad.title=sweepb+((100+juice)/(200+juice)-0.5);window.document.seriescalc.infivehome.value=Math.round(percentUS(infive+((100+juice)/(200+juice)-0.5)));window.document.seriescalc.infivehome.title=infive+((100+juice)/(200+juice)-0.5);window.document.seriescalc.infiveroad.value=Math.round(percentUS(infivea+((100+juice)/(200+juice)-0.5)));window.document.seriescalc.infiveroad.title=infivea+((100+juice)/(200+juice)-0.5);window.document.seriescalc.insixhome.value=Math.round(percentUS(insix+((100+juice)/(200+juice)-0.5)));window.document.seriescalc.insixhome.title=insix+((100+juice)/(200+juice)-0.5);window.document.seriescalc.insixroad.value=Math.round(percentUS(insixa+((100+juice)/(200+juice)-0.5)));window.document.seriescalc.insixroad.title=insixa+((100+juice)/(200+juice)-0.5);window.document.seriescalc.insevenhome.value=Math.round(percentUS(inseven+((100+juice)/(200+juice)-0.5)));window.document.seriescalc.insevenhome.title=inseven+((100+juice)/(200+juice)-0.5);window.document.seriescalc.insevenroad.value=Math.round(percentUS(insevena+((100+juice)/(200+juice)-0.5)));window.document.seriescalc.insevenroad.title=insevena+((100+juice)/(200+juice)-0.5);window.document.seriescalc.totalhome.value=Math.round(percentUS(total));window.document.seriescalc.totalhome.title=total+((100+juice)/(200+juice)-0.5);window.document.seriescalc.totalroad.value=Math.round(percentUS(totala));window.document.seriescalc.totalroad.title=totala+((100+juice)/(200+juice)-0.5);}
