// these couple fo functions are used for the quickbrain feature.. //used to add new items to the arrays which quickbrain are based on - only used during initialization function qbadd(count,lId,lName,disId,llName){ leagueId[count]=lId; leagueName[count]=lName; disciplineId[count]=disId; longLeagueName[count] = llName; } //used to copy items from the arrays to the select-box function fillLeague(disId) { fillLeague(disId,'null'); } //used to copy items from the arrays to the select-box function fillLeague(disId,wrapper) { temp = disId.split('_') if (temp[0]=='v') { url= '/valuebets.php?site='+portalId; if(wrapper===undefined || wrapper=='null' || wrapper==''){ location = url; } else { location = wrapper+"?wrapper="+url; } } else if (temp[0]=='s') { url= '/surebets.php?site='+portalId; if(wrapper===undefined || wrapper=='null' || wrapper==''){ location = url; } else { location = wrapper+"?wrapper="+url; } } else if (temp[0]=='n') { url= '/prochains-matchs.php?dayId=0&site='+portalId; if(wrapper===undefined || wrapper=='null' || wrapper==''){ location = url; } else { location = wrapper+"?wrapper="+url; } } else if (temp[0]!='-') { document.quickbrain.qbLeagues.length = 1; iLCount=1; for (iPop = 0; iPop <= leagueId.length; iPop++) { if (disciplineId[iPop] == disId) { dmaf = new Option(leagueName[iPop], leagueId[iPop]+"_"+disciplineId[iPop]); document.quickbrain.qbLeagues.options[iLCount] = dmaf; document.quickbrain.qbLeagues.options[iLCount].title = longLeagueName[iPop]; iLCount++; } } } } //used to copy items from the arrays to the select-box function fillLeaguePageLoadforPortal(disId,wrapper) { temp = disId.split('_') if (temp[0]!='-') { document.quickbrain.qbLeagues.length = 1; iLCount=1; for (iPop = 0; iPop <= leagueId.length; iPop++) { if (disciplineId[iPop] == disId) { dmaf = new Option(leagueName[iPop], leagueId[iPop]+"_"+disciplineId[iPop]); document.quickbrain.qbLeagues.options[iLCount] = dmaf; iLCount++; } } } } //used when the user selects a league.. and the league will be opened. function openLeague(value){ openLeague(value,'null'); } function openLeagueURL(value,country_tournament,discipline){ wrapper='null'; temp = value.split('_') //alert(value+' -- '+country_tournament+' -- '+discipline); lId = temp[0]; lType = temp[1]; dId = temp[2]; //var linkVars=country_tournament.split(', '); //var tournament=encodeURI(linkVars[1].replace(/ |\/|\'/g,'_')); //var country=linkVars[0]; if (lType=='f') { //matchOdds var linkVars=country_tournament.split(', '); var tournament=encodeURI(linkVars[1].replace(/ |\/|\'/g,'_')); var country=linkVars[0]; url= 'resume-cotes.php?dir='+discipline+'-'+country+'-'+tournament+'/tn/'+lId+'/sportId/'+dId+'/site/'+portalId; } else if (lType=='h'){ //horseracing temp2 = lId.split('&') url= '/horses/horseOdds.do?dis='+dId+'&meeting='+temp2[0]+'&race='+temp2[1]+'&site='+portalId; } //alert(url); if(wrapper==undefined || wrapper=='null' || wrapper==''){ location = url; } else { location = wrapper+"?wrapper="+url; } //alert(location); } function openLeague(value,wrapper) { temp = value.split('_') lId = temp[0]; lType = temp[1]; dId = temp[2]; if (lType=='f') { //matchOdds url= 'resume-cotes.php?dir=/tn/'+lId+'/sportId/'+dId+'/site/'+portalId; } else if (lType=='h'){ //horseracing temp2 = lId.split('&') url= '/horses/horseOdds.do?dis='+dId+'&meeting='+temp2[0]+'&race='+temp2[1]+'&site='+portalId; } if(wrapper==undefined || wrapper=='null' || wrapper==''){ location = url; } else { location = wrapper+"?wrapper="+url; } } function goBetType(sel) { value = sel.options[sel.selectedIndex].value sel.options[0].selected=true; if (value!='-1') location = value; } /** * Set a fixed width for the leagues selector in quickbrain portal * See issue #6 for details */ function limitQBLeaguesWidth() { var elem = document.getElementById('qbLeagues'); if ( !elem || !navigator.userAgent.indexOf("Gecko") ) { return; } elem.style.width = '200px'; } // for changing image to text function checkImgLoaded(ckImg,text) { var parent=ckImg.parentNode; parent.innerHTML= text; }