var Score_Cast=44;var Anytime_Cast=10219;var FirstHalf_Cast=10221;var Win_Cast=10220;var Time_Cast=10222;var HTFTCS_Cast=10201;var objOpt;var aSCP;function SCL(){var i,j,k,l,FixID;var oP;var cboN;var HOME=0;var AWAY=1;var DRAW=2;aSCP = getArraySC(ThisCastID);for(i=0;i<aSCP.length;i++){FixID = aSCP[i][0];var iFixIndex=SCGI(FixID);var iCastID=((typeof aSCP[iFixIndex][2]!=='undefined')?aSCP[iFixIndex][2]:0);oP=getCombo(true,FixID,iCastID);oP.length=aSCP[i][1][HOME][2].length+aSCP[i][1][AWAY][2].length+aSCP[i][1][DRAW][2].length;l=0;for(j=0;j<3;j++){for(k=0;k<aSCP[i][1][j][2].length;k++){var player = aSCP[i][1][j][2][k][1];oP.options[l].text=player;oP.options[l++].value=j+',2,'+k+',1'}}objOpt = oP;setTimeout('SIX(0)',20);SCPC(FixID,0,iCastID)}}function getCombo(bPlayer,FixtureID,CastID){var frm;aSCP = getArraySC(CastID);if((typeof CastID=='undefined') || (CastID==null) || (CastID==0)){var iIndex=SCGI(FixtureID);CastID=((typeof aSCP[iIndex][2]!=='undefined')?aSCP[iIndex][2]:0)}if ((typeof document.frmMain!=='undefined') && (document.frmMain!==null)){frm = document.frmMain}else{frm = document.frmMainX}if(bPlayer){return frm.elements['cboPlayer'+FixtureID+'_'+CastID]}else{return frm.elements['cboScore'+FixtureID+'_'+CastID]}}function SIX(sIndex){objOpt.selectedIndex=sIndex}function SCGI(iFixtureID){aSCP = getArraySC(ThisCastID);for(var i=0;i<aSCP.length;i++){if(iFixtureID==aSCP[i][0]){return i}}}function ExGI(iFixtureID,arrE){for(var i=0;i<arrE.length;i++){if(iFixtureID==arrE[i][0]){return i}}}function SCA(sPartCode){if(''==sPartCode){mlAlert(62);return false}else return aBet(sPartCode)}function SCB(sPartCode){if(''==sPartCode){mlAlert(62);return false}else return betN(sPartCode)}function SCPC(iFixtureID,bChangePlayer,CastID){if(bChangePlayer){if ((typeof document.frmMain!=='undefined') && (document.frmMain!==null)){var oSc=getCombo(false,iFixtureID,CastID);oSc.selectedIndex=0}}var i,j,l;var eP;var iFixIndex=SCGI(iFixtureID);eP=getCombo(true,iFixtureID,CastID);aSCP = getArraySC(CastID);var oP=eP[eP.selectedIndex];var aP=oP.value.split(',');var aoP=aSCP[iFixIndex][1][aP[0]][aP[1]][aP[2]];var HA=aP[0];var eS;eS=getCombo(false,iFixtureID,CastID);var oS=eS;var sS='';var labelScore;if(0<oS.length){sS=oS.options[oS.selectedIndex].value}oS.length=aSCP[iFixIndex][1][0][1].length + aSCP[iFixIndex][1][1][1].length + aSCP[iFixIndex][1][2][1].length;l=0;for(i=0;i<3;i++){for(j=0;j<aSCP[iFixIndex][1][i][1].length;j++){if((i==HA||aSCP[iFixIndex][1][i][1][j][3]||(1==aoP[3] && 1!=aSCP[iFixIndex][1][i][1][j][4]))){labelScore=aSCP[iFixIndex][1][i][0];if(CastID==Win_Cast && labelScore=='Draw'){labelScore=aSCP[iFixIndex][1][i][1][0][7]}oS.options[l].text=(3==aSCP[iFixIndex][1][i][1][j][4]) ? aSCP[iFixIndex][1][i][1][j][0]:labelScore+' '+aSCP[iFixIndex][1][i][1][j][0];oS.options[l++].value=i+',1,'+j+',0'}else{oS.length--}}}var BetTypeID=((typeof aSCP[iFixIndex][2]!=='undefined')?aSCP[iFixIndex][2]:0);if(BetTypeID==HTFTCS_Cast){oS = ValidateComboHTFTCS(iFixtureID,CastID)}if(-1==oS.selectedIndex){oS.selectedIndex=0;for(i=0;i<oS.length;i++){if(oS.options[i].value.split(',')[0]==HA){objOpt = oS;setTimeout('SIX("' + i + '")',20);break}}}SCCO(iFixtureID,CastID)}function SCSC(iFixtureID,CastID){SCCO(iFixtureID,CastID)}function SCCO(iFixtureID,CastID){var iFixIndex=SCGI(iFixtureID);var eP;eP=getCombo(true,iFixtureID,CastID);var objPlayer=eP[eP.selectedIndex];var eS;eS=getCombo(false,iFixtureID,CastID);aSCP = getArraySC(CastID);var objScore=eS[eS.selectedIndex];var aP=objPlayer.value.split(',');var aS=objScore.value.split(',');var oP=aSCP[iFixIndex][1][aP[0]][aP[1]][aP[2]];var oS=aSCP[iFixIndex][1][aS[0]][aS[1]][aS[2]];var m=(2==aS[0]?2:(aS[0]==aP[0]?0:1));if(1==oP[3]){m=(0==oS[4]?3:(3==oS[4]?5:4))}if(2==oP[3]){m=(0==oS[4]?6:7)}if(3==oS[4]&&0==oP[3]){m=8}var BetTypeID=((typeof aSCP[iFixIndex][2]!=='undefined')?aSCP[iFixIndex][2]:0);var aO;var Player_HomeDrawAway;var Score_HomeDrawAway;var FirstGoalScorer_OddsDecimal;var OddsToOneStr='\/1';switch(BetTypeID){case Score_Cast:case Anytime_Cast:case FirstHalf_Cast:var Rating_1stGS_OddsDecimal = Number(oP[5]);var TeamScores1st_OddsDecimal = Number(oP[6]);Player_HomeDrawAway   = String(oP[7]);var CorrectScore_OddsDecimal = Number(oS[1]);var CorrectScorePrediction  = String(oS[0]);Score_HomeDrawAway   = String(oS[6]);aO = calcSSC(BetTypeID,Rating_1stGS_OddsDecimal,CorrectScorePrediction,CorrectScore_OddsDecimal,TeamScores1st_OddsDecimal,Score_HomeDrawAway,Player_HomeDrawAway);break;case Win_Cast:FirstGoalScorer_OddsDecimal = Number(oP[2]);Player_HomeDrawAway   = String(oP[7]);Score_HomeDrawAway   = String(oS[6]);aO=calcWinCast(iFixtureID,FirstGoalScorer_OddsDecimal,Score_HomeDrawAway,Player_HomeDrawAway);OddsToOneStr='';break;case HTFTCS_Cast:var FirstHalfCS_OddsDecimal  = Number(oP[2]);var firstHalfScore    = String(oP[8]);var FirstHTeam_WLD    = String(oP[7]);var SecondHalfCS_OddsDecimal = Number(oS[1]);var SecondHTeam_WLD    = String(oS[6]);var secondHalfScore    = String(oS[0]);aO=calcHTFTCast(iFixtureID,FirstHalfCS_OddsDecimal,SecondHalfCS_OddsDecimal,FirstHTeam_WLD,SecondHTeam_WLD,firstHalfScore,secondHalfScore);break;case Time_Cast:FirstGoalScorer_OddsDecimal = Number(oP[2]);var TimeCast1stGoal_OddsDecimal = Number(oS[1]);aO=calcTimeCast(iFixtureID,FirstGoalScorer_OddsDecimal,TimeCast1stGoal_OddsDecimal);break;default:aO=SCRO(((Number(oP[2]) * Number(oS[1])) - 1.0) * Number(aSCM[m]));break}var sO = null;if ((typeof document.frmMain!=='undefined') && (document.frmMain!==null)){sO = document.getElementById('spnodds'+iFixtureID+CastID);if (sO !== null){sO.innerHTML = aO.split('~')[0]}document.frmMain.elements['txtOdds'+iFixtureID+'_'+BetTypeID].value=aO.split('~')[0];if(oP[4]||oS[5]){document.frmMain.elements['txtParticipantCode'+iFixtureID+'_'+BetTypeID].value=''}else{document.frmMain.elements['txtParticipantCode'+iFixtureID+'_'+BetTypeID].value='pendingtype=S#odds='+aO.split('~')[1]+OddsToOneStr+'#fixture=' + iFixtureID + '#selectionorder=0#classificationid='+aCID+'#fpidplayer=' + oP[0]+ '#fpidmatch=' + oS[2] + '#partdesc=' + (2==oP[3]?aSCT[1]:aSCT[0]).replace(/%1/,oP[1]).replace(/%2/,objScore.text) + "#"}}else{sO = document.getElementById('spnodds'+iFixtureID+CastID);if (sO !== null){sO.innerHTML = aO.split('~')[0]}document.frmMainX.elements['txtOdds'+iFixtureID+'_'+BetTypeID].value=aO.split('~')[0];if(oP[4]||oS[5]){document.frmMainX.elements['txtParticipantCode'+iFixtureID+'_'+BetTypeID].value=''}else{document.frmMainX.elements['txtParticipantCode'+iFixtureID+'_'+BetTypeID].value='pendingtype=S#odds='+aO.split('~')[1]+OddsToOneStr+'#fixture=' + iFixtureID + '#selectionorder=0#classificationid='+aCID+'#fpidplayer=' + oP[0]+ '#fpidmatch=' + oS[2] + '#partdesc=' + (2==oP[3]?aSCT[1]:aSCT[0]).replace(/%1/,oP[1]).replace(/%2/,objScore.text) + "#"}}}function calcTimeCast(FixtureID,FirstGS_OddsDecimal,TimeCast1stGoal_OddsDecimal){var FirstGoalscorerProb = (1 / FirstGS_OddsDecimal);var TimeRangeProb = (1 / TimeCast1stGoal_OddsDecimal);var CombinedProb = (FirstGoalscorerProb * TimeRangeProb);var CalculatedPrice = (1 / CombinedProb) - 1;CalculatedPrice = getFactoredPrice(CalculatedPrice);var RoundedDownPrice = Math.floor(CalculatedPrice);var CastPrice = getRoundedDownPrice(RoundedDownPrice,CalculatedPrice);var TimeCastPrice = formatOddsDisplay(CastPrice);return TimeCastPrice}function calcHTFTCast(FixtureID,FirstHalfCS_OddsDecimal,SecondHalfCS_OddsDecimal,FirstHTeam_WLD,SecondHTeam_WLD,firstHalfScore,secondHalfScore){try{var FirstHalfCorrectScoreProb  = (1 / FirstHalfCS_OddsDecimal);var CorrectScoreDoubleMultiplier=0;var matchSecondHalfPriceSocre = "";var firstHalfGoals = firstHalfScore.split('-');var secondHalfGoals = secondHalfScore.split('-');var HomeIndex1stHalf = (FirstHTeam_WLD=='H'?0:1);var HomeIndex2ndHalf = (SecondHTeam_WLD=='H'?0:1);var AwayIndex1stHalf = (FirstHTeam_WLD=='H'?1:0);var AwayIndex2ndHalf = (SecondHTeam_WLD=='H'?1:0);var homeGoals=(Number(secondHalfGoals[HomeIndex2ndHalf])-Number(firstHalfGoals[HomeIndex1stHalf]));var awayGoals=(Number(secondHalfGoals[AwayIndex2ndHalf])-Number(firstHalfGoals[AwayIndex1stHalf]));if (homeGoals>awayGoals){matchSecondHalfPriceSocre='H'+homeGoals+'-'+awayGoals}else if (homeGoals==awayGoals){matchSecondHalfPriceSocre='D'+homeGoals+'-'+awayGoals}else{matchSecondHalfPriceSocre='A'+awayGoals+'-'+homeGoals}var sc2ndHalfCorrectScore=0;arrExCP = getArrayED(HTFTCS_Cast);var iFixIndex=ExGI(FixtureID,arrExCP);for(i=0;i<arrExCP[iFixIndex][1].length;i++){if (matchSecondHalfPriceSocre==arrExCP[iFixIndex][1][i][4]+arrExCP[iFixIndex][1][i][3]){sc2ndHalfCorrectScore = arrExCP[iFixIndex][1][i][1];break}}if(sc2ndHalfCorrectScore==0){sc2ndHalfCorrectScore=1001}var SecondHalfCorrectScoreProb;SecondHalfCorrectScoreProb=(1/sc2ndHalfCorrectScore);var Home1stHalfGoals=Number(firstHalfGoals[HomeIndex1stHalf]);var Home2ndHalfGoals=Number(secondHalfGoals[HomeIndex2ndHalf])-Home1stHalfGoals;var Away1stHalfGoals=Number(firstHalfGoals[AwayIndex1stHalf]);var Away2ndHalfGoals=Number(secondHalfGoals[AwayIndex2ndHalf])-Away1stHalfGoals;if (Home1stHalfGoals>Away1stHalfGoals && Home2ndHalfGoals>Away2ndHalfGoals){CorrectScoreDoubleMultiplier=0.95}else   if (Home1stHalfGoals>Away1stHalfGoals && Home2ndHalfGoals==Away2ndHalfGoals){CorrectScoreDoubleMultiplier=0.9}else   if (Home1stHalfGoals>Away1stHalfGoals && Home2ndHalfGoals<Away2ndHalfGoals){CorrectScoreDoubleMultiplier=0.85}else   if (Home1stHalfGoals==Away1stHalfGoals && Home2ndHalfGoals>Away2ndHalfGoals){CorrectScoreDoubleMultiplier=0.9}else   if (Home1stHalfGoals==Away1stHalfGoals && Home2ndHalfGoals==Away2ndHalfGoals){CorrectScoreDoubleMultiplier=0.9}else   if (Home1stHalfGoals==Away1stHalfGoals && Home2ndHalfGoals<Away2ndHalfGoals){CorrectScoreDoubleMultiplier=0.9}else   if (Home1stHalfGoals<Away1stHalfGoals && Home2ndHalfGoals>Away2ndHalfGoals){CorrectScoreDoubleMultiplier=0.85}else   if (Home1stHalfGoals<Away1stHalfGoals && Home2ndHalfGoals==Away2ndHalfGoals){CorrectScoreDoubleMultiplier=0.9}else   if (Home1stHalfGoals<Away1stHalfGoals && Home2ndHalfGoals<Away2ndHalfGoals){CorrectScoreDoubleMultiplier=0.95}var CombinedProb = FirstHalfCorrectScoreProb * SecondHalfCorrectScoreProb;var CalculatedPrice = ((1/CombinedProb)-1)* CorrectScoreDoubleMultiplier;CalculatedPrice = getFactoredPrice(CalculatedPrice);var RoundedDownPrice = Math.floor(CalculatedPrice);var CastPrice = getRoundedDownPrice(RoundedDownPrice,CalculatedPrice);var HTFTPrice = formatOddsDisplay(CastPrice);return HTFTPrice}catch(err){alert(err)}}function calcWinCast(FixtureID,FirstGS_OddsDecimal,Score_HomeDrawAway,Player_HomeDrawAway){try{var FirstGoalScorerProb = (1 / FirstGS_OddsDecimal);var PlayersTeamIndex = (Player_HomeDrawAway=='H'?0:1);var MatchResultIndex = (Score_HomeDrawAway=='D'?1:(Score_HomeDrawAway=='H'?0:2));var WincastResultIndex = (PlayersTeamIndex*3) + MatchResultIndex;arrExCP = getArrayED(Win_Cast);var iFixIndex=ExGI(FixtureID,arrExCP);var WincastResultPrice = arrExCP[iFixIndex][1][WincastResultIndex][1];var WincastResultProb;WincastResultProb = (1 / WincastResultPrice);var CombinedProb = (FirstGoalScorerProb * WincastResultProb);var CalculatedPrice = ((1/CombinedProb)-1);CalculatedPrice = getFactoredPrice(CalculatedPrice);var RoundedDownPrice = Math.floor(CalculatedPrice);var CastPrice;var WincastPrice;if ((FirstGS_OddsDecimal-1) > Number(RoundedDownPrice)){CastPrice = getRoundedDownPrice(RoundedDownPrice,CalculatedPrice);WincastPrice = formatOddsDisplay(CastPrice) + '\/1';var strPossibleWincastPrices = new Array('6/4','8/5','13/8','7/4','15/8','2/1','11/5','9/4','12/5','5/2','13/5','11/4','3/1','10/3','7/2','15/4','4/1','9/2','5/1','11/2','6/1','13/2','7/1','15/2','8/1','17/2','9/1');var sngPossibleWincastPrices = new Array(strPossibleWincastPrices.length);var intCounter=0;for(intCounter=0;intCounter <= strPossibleWincastPrices.length;intCounter++){sngPossibleWincastPrices[intCounter] = eval(strPossibleWincastPrices[intCounter])}if((FirstGS_OddsDecimal-1) <= sngPossibleWincastPrices[0]){}else{for(intCounter=0;intCounter <= sngPossibleWincastPrices.length;intCounter++){if((FirstGS_OddsDecimal-1) <= sngPossibleWincastPrices[intCounter]){var OddsTypeID=0;OddsTypeID = GetOddsType();if (OddsTypeID==1){CastPrice = strPossibleWincastPrices[intCounter]}else if(OddsTypeID==2){CastPrice = Number(sngPossibleWincastPrices[intCounter]);if(CastPrice.toString().indexOf(".")>0){CastPrice = String(Number((CastPrice + 1)) + "00");CastPrice = CastPrice.substring(0,CastPrice.indexOf(".")+3)}else{CastPrice = String(Number((CastPrice + 1)) + ".00")}}else if(OddsTypeID==3){CastPrice = sngPossibleWincastPrices[intCounter];CastPrice = formatOddsDisplay(CastPrice)}CastPrice = CastPrice+'~'+strPossibleWincastPrices[intCounter];WincastPrice = CastPrice;break}}}}else{CastPrice = getRoundedDownPrice(RoundedDownPrice,CalculatedPrice);WincastPrice = formatOddsDisplay(CastPrice) + '\/1'}return WincastPrice}catch(err){alert(err)}}function calcSSC(BetTypeID,Rating_1stGS_OddsDecimal,CorrectScorePrediction,CorrectScore_OddsDecimal,TeamScores1st_OddsDecimal,Score_HomeDrawAway,Player_HomeDrawAway){try{var MaxValue = 0;var CastPrice = 0;var ResultProb = (1 / CorrectScore_OddsDecimal);var FirstGoalscorerProbFromRating = (1 / Rating_1stGS_OddsDecimal);var PlayerPercentageOfTeamGoals = (FirstGoalscorerProbFromRating / 0.6);var TeamGoalsLeftHS = Number(CorrectScorePrediction.substring(0,CorrectScorePrediction.indexOf('-')));var TeamGoalsRightHS = Number(CorrectScorePrediction.substring(CorrectScorePrediction.indexOf('-')+1));var GoalscorerPartProbability;var PlayersTeamGoals;if (Score_HomeDrawAway=='H' && Player_HomeDrawAway=='H'){PlayersTeamGoals=TeamGoalsLeftHS}else if (Score_HomeDrawAway=='A' && Player_HomeDrawAway=='A'){PlayersTeamGoals=TeamGoalsLeftHS}else if (Score_HomeDrawAway=='H' && Player_HomeDrawAway=='A'){PlayersTeamGoals=TeamGoalsRightHS}else if (Score_HomeDrawAway=='A' && Player_HomeDrawAway=='H'){PlayersTeamGoals=TeamGoalsRightHS}else if (Score_HomeDrawAway=='D'){PlayersTeamGoals=TeamGoalsLeftHS}switch(BetTypeID){case Score_Cast:case FirstHalf_Cast:var ResultTotalGoals = (TeamGoalsLeftHS + TeamGoalsRightHS);var ProbPlayersTeamScoresFirst = (PlayersTeamGoals / ResultTotalGoals);GoalscorerPartProbability = (ProbPlayersTeamScoresFirst * PlayerPercentageOfTeamGoals);break;case Anytime_Cast:var GoalsScoredByTeam = PlayersTeamGoals;var ProbNotScoreAnyOfTeamGoals = Math.pow((1 - PlayerPercentageOfTeamGoals),GoalsScoredByTeam);var ProbScoreAnyOfTeamGoals = (1-ProbNotScoreAnyOfTeamGoals);GoalscorerPartProbability = ProbScoreAnyOfTeamGoals;break;default:aO=SCRO(((Number(oP[2]) * Number(oS[1])) - 1.0) * Number(aSCM[m]));break}var TeamScoresFirstProbability = (1 / TeamScores1st_OddsDecimal);var ScorecastMultiplier = 1 + Math.pow(TeamScoresFirstProbability,2);if (GoalscorerPartProbability > 0.8){MaxValue = GoalscorerPartProbability}else{MaxValue = (1.8 * GoalscorerPartProbability) + (-1 * Math.pow(GoalscorerPartProbability,2))}var MultipliedGoalscorerPart = (GoalscorerPartProbability * ScorecastMultiplier);if(MultipliedGoalscorerPart > MaxValue){MultipliedGoalscorerPart = MaxValue}var ScorecastProbability = (ResultProb * MultipliedGoalscorerPart);var CalculatedPrice = ((1/ScorecastProbability)-1);CalculatedPrice = getFactoredPrice(CalculatedPrice);var RoundedDownPrice = Math.floor(CalculatedPrice);CastPrice = getRoundedDownPrice(RoundedDownPrice,CalculatedPrice);var ScorecastPrice = formatOddsDisplay(CastPrice);return ScorecastPrice}catch(err){alert(err)}}function getRoundedDownPrice(RDP,CP){var CastPrice = 0;var RoundedDownPrice = RDP;var CalculatedPrice = CP;if(RoundedDownPrice <= 16){CastPrice=RoundedDownPrice}else if(RoundedDownPrice<=17){CastPrice=16}else if(RoundedDownPrice<=19){CastPrice=18}else if(RoundedDownPrice<=21){CastPrice=20}else if(RoundedDownPrice<=24){CastPrice=22}else if(RoundedDownPrice<=204){CastPrice=(Math.floor(CalculatedPrice/5)*5)}else if(RoundedDownPrice <= 499){CastPrice=(Math.floor(CalculatedPrice/10)*10)}else{CastPrice=(Math.floor(CalculatedPrice / 50) * 50)}if (CastPrice>10000){CastPrice=10000}return CastPrice}function getFactoredPrice(CP){var FactoredPrice=0;if (CP<60){FactoredPrice=CP}else if(CP<10000){FactoredPrice=24+(0.5975*CP)+(-0.00001*Math.pow(CP,2))}else{FactoredPrice=CP/2}return FactoredPrice}function SCRO(f){var lngActOdds;if (Math.floor(f)<=16){f=Math.floor(f)}else if (Math.floor(f)>16 && Math.floor(f)<=19){f=18}else if (Math.floor(f)==20){f=20}else if (Math.floor(f)==21 || Math.floor(f)==22){f=22}else if (Math.floor(f)>=23 && Math.floor(f)<= 204){f=(Math.ceil(f/5))*5}else if (Math.floor(f)>=205 && Math.floor(f)<= 499){f=(Math.ceil(f/10))*10}else if (Math.floor(f)>=500){f=(Math.ceil(f/50))*50}var FractionalOdds=f;var OddsTypeID;if ((typeof document.frmMain!=='undefined') && (document.frmMain!==null)){OddsTypeID=document.frmMain.txtOddsTypeID.value}else{OddsTypeID=document.frmMainX.txtOddsTypeID.value}if (OddsTypeID == 1){f = f+'\/1'}else if (OddsTypeID == 2){f = (f + 1) + ".00"}else if (OddsTypeID == 3){lngActOdds = f;if (lngActOdds >= 1){f = "+" + Math.floor(lngActOdds * 100)}else{lngActOdds = 1 / lngActOdds;f = "-" + Math.floor(lngActOdds * 100)}}return f+'~'+FractionalOdds}function formatOddsDisplay(od){var FractionalOdds=od;var OddsTypeID;OddsTypeID=GetOddsType();if (OddsTypeID == 1){od=od+'\/1'}else if (OddsTypeID == 2){od=(od+1) + ".00"}else if (OddsTypeID == 3){lngActOdds = od;if (lngActOdds >= 1){od = "+" + Math.floor(lngActOdds * 100)}else{lngActOdds = 1 / lngActOdds;od = "-" + Math.floor(lngActOdds * 100)}}return od+'~'+FractionalOdds}function ValidateComboHTFTCS(iFixtureID,CastID){try{var c1HomeDrawAway;var c1ScorePart;var Home1stHalfGoals=0;var Away1stHalfGoals=0;var i,j,l;var eP;var iFixIndex=SCGI(iFixtureID);eP=getCombo(true,iFixtureID,CastID);aSCP = getArraySC(CastID);var obj1stHalf=eP[eP.selectedIndex];var aP=obj1stHalf.value.split(',');var arrayPlayer = aSCP[iFixIndex][1][aP[0]][aP[1]][aP[2]];c1HomeDrawAway=arrayPlayer[7];c1ScorePart= arrayPlayer[8];if (c1HomeDrawAway=='H'){Home1stHalfGoals=c1ScorePart.split('-')[0];Away1stHalfGoals=c1ScorePart.split('-')[1]}else{Home1stHalfGoals=c1ScorePart.split('-')[1];Away1stHalfGoals=c1ScorePart.split('-')[0]}var eS;eS=getCombo(false,iFixtureID,CastID);var objScore=eS;var HA=aP[0];var sS='';if(0 < objScore.length){sS=objScore.options[objScore.selectedIndex].value}objScore.length = aSCP[iFixIndex][1][0][1].length + aSCP[iFixIndex][1][1][1].length + aSCP[iFixIndex][1][2][1].length;l=0;var ScorePart;var strTxt='';var HomeOrAway ='';var ScoreLine;var Home2ndHalfGoals = 0;var Away2ndHalfGoals = 0;var valid = true;for(i=0;i<3;i++){for(j=0;j<aSCP[iFixIndex][1][i][1].length;j++){HomeOrAway=aSCP[iFixIndex][1][i][1][j][6];ScoreLine=aSCP[iFixIndex][1][i][1][j][0];if (HomeOrAway=='H'){Home2ndHalfGoals=ScoreLine.split('-')[0];Away2ndHalfGoals=ScoreLine.split('-')[1]}else{Home2ndHalfGoals=ScoreLine.split('-')[1];Away2ndHalfGoals=ScoreLine.split('-')[0]}if(Home2ndHalfGoals >= Home1stHalfGoals && Away2ndHalfGoals >= Away1stHalfGoals){valid=true}else{valid=false}if(HomeOrAway=='D' && ScoreLine=='0-0'){valid=false}if((valid==true && (i==HA || aSCP[iFixIndex][1][i][1][j][3] || (1==arrayPlayer[3] && 1 != aSCP[iFixIndex][1][i][1][j][4])))){ScorePart=aSCP[iFixIndex][1][i][1][j][0];DisplayScore=aSCP[iFixIndex][1][i][0]+' '+aSCP[iFixIndex][1][i][1][j][0];if(3==aSCP[iFixIndex][1][i][1][j][4]){strTxt=ScorePart}else{strTxt=DisplayScore}objScore.options[l].text = strTxt;objScore.options[l++].value=i+',1,'+j+',0'}else{objScore.length--}}}if(''!=sS){for(i=0;i<objScore.length;i++){if(sS==objScore.options[i].value){objOpt = objScore;setTimeout('SIX("' + i + '")',20);break}}}if(-1==objScore.selectedIndex){objScore.selectedIndex=0;for(i=0;i<objScore.length;i++){if(objScore.options[i].value.split(',')[0]==HA){objOpt = objScore;setTimeout('SIX("' + i + '")',20);break}}}objScore.selectedIndex=0;return objScore}catch(err){alert(err)}}function getArrayED(CastID){switch(CastID){case Score_Cast:case Anytime_Cast:case FirstHalf_Cast:break;case Win_Cast:return aExCP10220;break;case Time_Cast:return aExCP10222;break;case HTFTCS_Cast:return aExCP10201;break;default:break}}function getArraySC(CastID){var objArr;switch(CastID){case Score_Cast:objArr = aSCP44;break;case Anytime_Cast:objArr = aSCP10219;break;case FirstHalf_Cast:objArr = aSCP10221;break;case Win_Cast:objArr = aSCP10220;break;case Time_Cast:objArr = aSCP10222;break;case HTFTCS_Cast:objArr = aSCP10201;break;default:break}return objArr}function GetOddsType(){var OddsTypeID;if ((typeof document.frmMain!=='undefined') && (document.frmMain!==null)){OddsTypeID = document.frmMain.txtOddsTypeID.value}else{OddsTypeID = document.frmMainX.txtOddsTypeID.value}if ((typeof OddsTypeID=='undefined') || (OddsTypeID==null)){OddsTypeID = document.getElementsByName('txtOddsTypeID')[0].value;if ((typeof OddsTypeID=='undefined') || (OddsTypeID==null)){OddsTypeID=1}}return OddsTypeID}function GetSCVer(){return 'ScorecastSoccer_vA001cr'}
