var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;
var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;
var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;
function ControlVersion(){var A;
var B;
var C;
try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
A=B.GetVariable("$version")
}catch(C){}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
A="WIN 6,0,21,0";
B.AllowScriptAccess="always";
A=B.GetVariable("$version")
}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
A=B.GetVariable("$version")
}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
A="WIN 3,0,18,0"
}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
A="WIN 2,0,0,11"
}catch(C){A=-1
}}return A
}function GetSwfVer(){var G=-1;
if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var F=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";
var A=navigator.plugins["Shockwave Flash"+F].description;
var E=A.split(" ");
var C=E[2].split(".");
var H=C[0];
var B=C[1];
var D=E[3];
if(D==""){D=E[4]
}if(D[0]=="d"){D=D.substring(1)
}else{if(D[0]=="r"){D=D.substring(1);
if(D.indexOf("d")>0){D=D.substring(0,D.indexOf("d"))
}}}var G=H+"."+B+"."+D
}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){G=4
}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){G=3
}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){G=2
}else{if(isIE&&isWin&&!isOpera){G=ControlVersion()
}}}}}return G
}function DetectFlashVer(F,D,C){versionStr=GetSwfVer();
if(versionStr==-1){return false
}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");
tempString=tempArray[1];
versionArray=tempString.split(",")
}else{versionArray=versionStr.split(".")
}var E=versionArray[0];
var A=versionArray[1];
var B=versionArray[2];
if(E>parseFloat(F)){return true
}else{if(E==parseFloat(F)){if(A>parseFloat(D)){return true
}else{if(A==parseFloat(D)){if(B>=parseFloat(C)){return true
}}}}}return false
}}}function AC_AddExtension(B,A){if(B.indexOf("?")!=-1){return B.replace(/\?/,A+"?")
}else{return B+A
}}function AC_Generateobj(E,D,A){var C="";
if(isIE&&isWin&&!isOpera){C+="<object ";
for(var B in E){C+=B+'="'+E[B]+'" '
}for(var B in D){C+='><param name="'+B+'" value="'+D[B]+'" /> '
}C+="></object>"
}else{C+="<embed ";
for(var B in A){C+=B+'="'+A[B]+'" '
}C+="> </embed>"
}document.write(C)
}function AC_FL_RunContent(){var A=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");
AC_Generateobj(A.objAttrs,A.params,A.embedAttrs)
}function AC_GetArgs(B,E,G,D,H){var A=new Object();
A.embedAttrs=new Object();
A.params=new Object();
A.objAttrs=new Object();
for(var C=0;
C<B.length;
C=C+2){var F=B[C].toLowerCase();
switch(F){case"classid":break;
case"pluginspage":A.embedAttrs[B[C]]=B[C+1];
break;
case"src":case"movie":B[C+1]=AC_AddExtension(B[C+1],E);
A.embedAttrs.src=B[C+1];
A.params[G]=B[C+1];
break;
case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":A.objAttrs[B[C]]=B[C+1];
break;
case"id":case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":A.embedAttrs[B[C]]=A.objAttrs[B[C]]=B[C+1];
break;
default:A.embedAttrs[B[C]]=A.params[B[C]]=B[C+1]
}}A.objAttrs.classid=D;
if(H){A.embedAttrs.type=H
}return A
};jQuery.noConflict();
var BODOG={};
BODOG.components={},SELECTION_VIEW="main.jsp",CHECK_BETS_VIEW="confirm-bets.jsp",PLACE_BETS_VIEW="thank-you-bets-placed.jsp",BUSY="busy",currentBetslipView=SELECTION_VIEW;
function getDwrBetSlip(){if(browserDetection()){setMask();
if(document.getElementById("bet-container")!=null){dwr.engine.setTimeout(120000);
dwr.engine.setErrorHandler(handleDwrError);
dwr.engine.setWarningHandler(handleDwrWarning);
dwr.engine.setTextHtmlHandler(handleDwrError);
BetSlip.getDwrBetSlip(true,function(A){currentBetslipView=A.currentUserView;
if(currentBetslipView==SELECTION_VIEW){renderBetSlipMain(A)
}else{if(currentBetslipView==CHECK_BETS_VIEW){renderBetSlipConfirm(A)
}else{if(A.currentUserView==PLACE_BETS_VIEW){renderBetSlipPlace(A)
}else{if(A.currentUserView==BUSY){}}}}})
}else{clearMask()
}}}function handleDwrError(B,A){if(A.name!="dwr.engine.http.400"){showPopupWithMessage("An Error has occurred: "+B+" - "+A+" Please press 'F5' to refresh the page. ");
jQuery("div#popup-content button").click(function(){jQuery("div#outerPopup").css("display","none")
})
}}function clearMask(A,B){if(A==2){jQuery("div#bet-slip").css("z-index","3")
}jQuery("div#outerPopup").css("display","none");
tTip.hide();
if(currentBetslipView==SELECTION_VIEW){if(!document.getElementById("progress-spinner")){jQuery("div#progress-spinner-logoff").remove()
}else{jQuery("div#progress-spinner").fadeOut("normal")
}jQuery("div#banner-long").children().css("display","block");
if(jQuery.browser.msie&&jQuery.browser.version<"7.0"){jQuery("select").css("visibility","visible")
}}else{jQuery("div#bet-slip").css("z-index","3")
}if(document.getElementById("shc-login-container")!=null&&document.getElementById("shc-login-container").style.display=="block"){jQuery("username-default").focus()
}if(B!=undefined){alert(B)
}}function setMask(A,B){getPageSize();
jQuery("div#banner-long").children().css("display","none");
if(jQuery.browser.msie&&jQuery.browser.version<"7.0"){jQuery("select").css("visibility","hidden")
}if(!document.getElementById("progress-spinner")){jQuery("div#container").append('<div id="progress-spinner-logoff" style="display:block;);"><div class="clearfix"></div></div>');
getPageSize()
}else{jQuery("div#progress-spinner").css("filter","alpha(opacity=85)");
jQuery("div#progress-spinner").css("display","block")
}if(A==3){jQuery("body").append("<iframe id='registrationForm' src='"+B+"' frameborder='no' style='display:none' allowtransparency='true'></iframe>");
jQuery("#registrationForm").load(function(){jQuery(this).css("display","block");
jQuery("#iframeCloseBtn").css("display","block")
})
}}function isMaskVisible(){return(document.getElementById("progress-spinner").style.display=="block")
}function handleDwrWarning(B,A){clearMask()
}function renderRefreshedPrices(A){var B,C,D;
for(B=0;
B<A.outcomeList.length;
B++){C=A.outcomeList[B];
D=document.getElementById("patternSelect"+C.id);
if(D!=null){if(!C.suspended&&!C.startingPrice){document.getElementById("priceCombo-"+C.id)[0].text=C.price;
document.getElementById("livePriceNotSelectableOdd"+C.id).innerHTML=C.price
}renderSelectionPrice(C.selection)
}}renderItemMessages(A.dwrItemMessages)
}function renderItemMessages(C){var A,B;
for(A=0;
A<C.length;
A++){B=C[A];
if(B.errorFound&&document.getElementById("wagerErrorMessage-"+B.id)!=null){renderItemMessage(B.id,B.itemMessage)
}else{clearItemMessage(B.id)
}}}function renderBetSlipMain(B){var E,F,D,A,C,H,G;
clearCenterPanel();
document.getElementById("bet-container").innerHTML=document.getElementById("mainBetslipPattern").innerHTML;
if(document.getElementById("betSlipErrorMessage")!=null){document.getElementById("betSlipErrorMessage").style.display="none"
}if(B.betSlipErrorMessage==null){dwr.util.setValue("betSlipErrorMessage","")
}else{if(B.showGlobaErrorMessageKeyInPopup){showPopupWithMessage(B.betSlipErrorMessage)
}else{dwr.util.setValue("betSlipErrorMessage",B.betSlipErrorMessage);
document.getElementById("betSlipErrorMessage").style.display="block"
}}E=B.dwrBetSlipSelections;
F=1;
for(D=0;
D<E.length;
D++){renderBetSlipSelection(E[D],F);
F++
}G=B.dwrBetSlipForeTricast;
for(D=0;
D<G.length;
D++){renderBetSlipForecastTricast(G[D],F);
F++
}A=B.dwrBetSlipMultiples;
for(D=0;
D<A.length;
D++){renderBetSlipMultipleWager(A[D],F);
F++
}tabOrderInBetSlip(F);
renderHeader(B.allSelectionCount);
if(B.availableBalance!=null){renderSummary(B.totalStake,B.totalStakeZero);
renderSummaryAccountBalance(B.availableBalance,B.accountBalance,B.bonusBalance);
renderSelectionControl(B);
document.getElementById("bet-slip-controls").style.display="block";
document.getElementById("controlsPlaceBets").style.display="block";
document.getElementById("bet-container").style.display="block";
document.getElementById("bet-bottom").style.display="block";
document.getElementById("bet-bottom-nolog").style.display="none";
if(E.length>0){C="stake-"+E[E.length-1].id;
H=document.getElementById(C).disabled;
if(!H&&!(document.getElementById(C).style.display=="none")){document.getElementById(C).focus()
}}}else{document.getElementById("controlsPlaceBets").style.display="none";
document.getElementById("bet-container").style.display="none";
document.getElementById("bet-bottom").style.display="none";
document.getElementById("bet-bottom-nolog").style.display="block";
document.getElementById("bet-slip-controls").style.display="none";
document.getElementById("bet-slip-summary").style.display="none";
document.getElementById("shc-login-container-info").style.display="none";
document.getElementById("shc-login-container").style.display="block";
document.getElementById("refer-a-friend").style.display="none";
document.getElementById("open-account").style.display="block"
}hideCheckBets();
hideThankYou();
renderItemMessages(B.dwrItemMessages);
document.getElementById("max-return").style.display="none";
if(B.showGlobaErrorMessageKeyInPopup==false&&isPopupShown()==false){clearMask()
}document.getElementById("bet-container").scrollTop=0;
checkBetContainer();
moveBetSlip();
tTip.init()
}function thisMovie(A){if(navigator.appName.indexOf("Microsoft")!=-1){return window[A]
}else{return document[A]
}}function tabOrderInBetSlip(A){document.getElementById("selectAll").tabIndex=A++;
document.getElementById("clearAll").tabIndex=A++;
document.getElementById("removeAll").tabIndex=A++;
document.getElementById("button-check-bets").tabIndex=A++
}function hideCheckBets(){document.getElementById("controlsCheckBets").style.display="none"
}function hidePlaceBets(){document.getElementById("controlsPlaceBets").style.display="none"
}function hideThankYou(){document.getElementById("thankYou").style.display="none";
document.getElementById("controlsThanYou").style.display="none"
}function clearCenterPanel(){document.getElementById("bet-container").innerHTML=""
}function renderSummary(B,A){document.getElementById("bet-slip-controls").style.display="block";
document.getElementById("bet-slip-summary").style.display="block";
if(B!=""){document.getElementById("totalStakeAsString").innerHTML=B;
document.getElementById("total-stake").style.display="block"
}else{document.getElementById("total-stake").style.display="none"
}}function renderSummaryPotentialPayout(A){document.getElementById("max-return").style.display="block";
document.getElementById("PotentialPayoutsummary").innerHTML=A
}function renderSummaryAccountBalance(B,A,C){if(B==null){document.getElementById("account-balance").style.display="none"
}else{document.getElementById("account-balance").style.display="block";
document.getElementById("accountBalance").innerHTML=B;
if(document.getElementById("global-account-balance")!=null){document.getElementById("global-account-balance").innerHTML=A
}if((document.getElementById("global-bonus-balance")!=null)&&(C!=undefined)){document.getElementById("global-bonus-balance").innerHTML=C
}}}function renderSelectionControl(A){if(A.dwrBetSlipSelections.length>0||A.dwrBetSlipForeTricast.length>0){document.getElementById("selection-control").style.display="block"
}else{document.getElementById("selection-control").style.display="none"
}}function renderBetSlipConfirm(B){clearCenterPanel();
document.getElementById("bet-container").innerHTML=document.getElementById("confirmBetslipPattern").innerHTML;
var D,C,A,E;
D=B.dwrBetSlipSelections;
for(C=0;
C<D.length;
C++){renderBetSlipSelectionConfirm(D[C])
}E=B.dwrBetSlipForeTricast;
for(C=0;
C<E.length;
C++){renderBetSlipForecastConfirm(E[C])
}A=B.dwrBetSlipMultiples;
for(C=0;
C<A.length;
C++){renderBetSlipMultipleWagerConfirm(A[C])
}renderHeader(B.allSelectionCount);
renderSummary(B.totalStake,B.totalStakeZero);
renderSummaryPotentialPayout(B.potentialPayout);
renderSummaryAccountBalance(B.availableBalance,B.accountBalance,B.bonusBalance);
hidePlaceBets();
hideThankYou();
document.getElementById("bet-container").style.display="block";
document.getElementById("controlsCheckBets").style.display="block";
document.getElementById("bet-slip-summary").style.display="block";
document.getElementById("bet-slip-controls").style.display="block";
document.getElementById("bet-bottom").style.display="block";
document.getElementById("bet-bottom-nolog").style.display="none";
tTip.init();
uncheckRetainSelections()
}function renderBetSlipSelectionConfirm(A){if(A.showAll||A.showHeader){var B=A.id;
dwr.util.cloneNode("PatternSelectionConfirm",{idSuffix:B});
dwr.util.setValue("name"+B,A.name);
if(!A.suspended){renderSelectionPriceNotSelectable(A);
document.getElementById("info-"+B).title=A.confirmationInfo;
document.getElementById("wagerDescription"+B).innerHTML=A.wagerDescription;
if(A.showAll){document.getElementById("stake-"+B).innerHTML=A.stake;
renderNumberOfBetsConfirm(B,A.numberOfBets);
document.getElementById("betDescription"+B).innerHTML=A.betDescription;
document.getElementById("unitStakeWager"+B).innerHTML=A.unitStake;
document.getElementById("total"+B).style.display="block";
document.getElementById("totalStakeWager"+B).innerHTML=A.totalStake;
document.getElementById("payoutWager"+B).style.display="block";
document.getElementById("potentialPayoutWager"+B).innerHTML=A.potentialPayout
}}document.getElementById("PatternSelectionConfirm"+B).style.display="block"
}}function renderBetSlipForecastConfirm(A){renderBetSlipWagerConfirm("PatternForecastConfirm",A)
}function renderBetSlipMultipleWagerConfirm(A){renderBetSlipWagerConfirm("PatternAvailableConfirm",A)
}function renderBetSlipWagerConfirm(A,B){if(B.selected&&B.stake!="0.00"){var C=B.id;
dwr.util.cloneNode(A,{idSuffix:C});
dwr.util.setValue("wagerDescription"+C,B.wagerDescription);
document.getElementById("info-"+C).title=B.information;
if(!B.suspended){document.getElementById("lineOpen"+C).style.display="block";
renderNumberOfBetsConfirm(C,B.numberOfBets);
document.getElementById("stake-"+C).innerHTML=B.stake;
document.getElementById("totalStakeWager"+C).innerHTML=B.totalStake;
document.getElementById("payoutWager"+C).style.display="block";
document.getElementById("potentialPayoutWager"+C).innerHTML=B.potentialPayout
}document.getElementById(A+C).style.display="block"
}}function renderBetSlipPlace(A){clearCenterPanel();
hideCheckBets();
hidePlaceBets();
renderSummary(A.totalStake,A.totalStakeZero);
renderSummaryPotentialPayout(A.potentialPayout);
renderSummaryAccountBalance(A.availableBalance,A.accountBalance,A.bonusBalance);
document.getElementById("selectionCount").style.display="none";
document.getElementById("bet-container").style.display="none";
document.getElementById("thankYou").style.display="block";
document.getElementById("bet-slip-controls").style.display="block";
document.getElementById("controlsThanYou").style.display="block";
document.getElementById("bet-bottom").style.display="block";
document.getElementById("bet-bottom-nolog").style.display="none"
}function renderBetSlipSelection(A,B){var C=A.id;
dwr.util.cloneNode("patternSelect",{idSuffix:C});
dwr.util.setValue("name"+C,A.name);
if(A.suspended){suspendItem(C)
}else{renderEachWay(A);
renderSelectionSelected(A.id,A.selected);
renderSelectionPrice(A);
renderBetSlipDwrItem(A,B);
if(!A.singleBetAvailable){disableEachWayClick(C,true);
document.getElementById("stake-"+C).disabled=true
}}document.getElementById("info-"+C).title=A.confirmationInfo;
document.getElementById("patternSelect"+C).style.display="block"
}function renderBetSlipForecastTricast(A,B){var C=A.id;
dwr.util.cloneNode("patternForecastTricast",{idSuffix:C});
dwr.util.setValue("name"+C,A.name);
renderItemSelected(A.id,A.selected);
document.getElementById("info-"+C).title=A.information;
if(A.suspended){suspendItem(C)
}else{renderBetSlipDwrItem(A,B)
}document.getElementById("patternForecastTricast"+C).style.display="block"
}function renderBetSlipMultipleWager(B,A){var C=B.id;
dwr.util.cloneNode("patternMultiple",{idSuffix:C});
document.getElementById("name"+C).innerHTML=B.name;
renderEachWay(B);
renderBetSlipDwrItem(B,A);
document.getElementById("available-bets").style.display="block";
document.getElementById("patternMultiple"+C).style.display="block"
}function renderBetSlipDwrItem(A,B){renderStake(A,B);
if(A.numberOfBets>0){document.getElementById("numberOfBets"+A.id).innerHTML=A.numberOfBets;
document.getElementById("betMultiplier"+A.id).innerHTML="x"
}}function renderItemSelected(B,A){if(A){document.getElementById("selectionSelected-"+B).style.display="block";
document.getElementById("selectionDeselected-"+B).style.display="none"
}else{document.getElementById("selectionSelected-"+B).style.display="none";
document.getElementById("selectionDeselected-"+B).style.display="block"
}document.getElementById("stake-"+B).disabled=!(A)
}function renderSelectionSelected(B,A){renderItemSelected(B,A);
document.getElementById("priceCombo-"+B).disabled=!(A);
disableEachWayClick(B,!A)
}function renderStake(B,A){document.getElementById("stake-"+B.id).value=B.stake;
if(B.stake==null){document.getElementById("stake-"+B.id).value=""
}else{document.getElementById("stake-"+B.id).value=B.stake
}document.getElementById("stake-"+B.id).tabIndex=A
}function renderEachWay(A){if(A.eachWayAvailable){document.getElementById("eachWay"+A.id).style.display="block";
setEachWaySelected(A.id,A.eachWaySelected)
}else{document.getElementById("eachWay"+A.id).style.display="none"
}}function setEachWaySelected(A,B){if(B){document.getElementById("eachWaySelected-"+A).style.display="block";
document.getElementById("eachWayDeSelected-"+A).style.display="none"
}else{document.getElementById("eachWayDeSelected-"+A).style.display="block";
document.getElementById("eachWaySelected-"+A).style.display="none"
}}function disableEachWayClick(A,B){if(B){document.getElementById("eachWaySelected-"+A).style.display="none";
document.getElementById("eachWayDeSelected-"+A).style.display="none";
document.getElementById("eachWayOnclickDisabled-"+A).style.display="block"
}}function renderSelectionPrice(A){if(A.startingAndLivePriceAvailable){document.getElementById("selectableOdds"+A.id).style.display="block";
document.getElementById("notSelectableOdds"+A.id).style.display="none";
var B=document.getElementById("priceCombo-"+A.id);
B.options[0].text=A.price;
if(A.livePriceSelected){B.value="livePrice"
}else{B.value="SP"
}}else{document.getElementById("selectableOdds"+A.id).style.display="none";
document.getElementById("notSelectableOdds"+A.id).style.display="block";
renderSelectionPriceNotSelectable(A)
}}function renderSelectionPriceNotSelectable(A){if(A.livePriceSelected){document.getElementById("livePriceNotSelectableOdd"+A.id).style.display="inline";
document.getElementById("SPNotSelectableOdd"+A.id).style.display="none";
document.getElementById("livePriceNotSelectableOdd"+A.id).innerHTML=A.price
}else{document.getElementById("livePriceNotSelectableOdd"+A.id).style.display="none";
document.getElementById("SPNotSelectableOdd"+A.id).style.display="inline"
}}function renderHeader(A){if(A>0){document.getElementById("selectionCount").style.display="inline";
document.getElementById("selectionCount").innerHTML="("+A+")"
}else{document.getElementById("selectionCount").style.display="none"
}}function renderNumberOfBetsConfirm(B,A){document.getElementById("numberOfBets"+B).innerHTML=A;
if(A>1){document.getElementById("lineMsg"+B).style.display="none";
document.getElementById("linesMsg"+B).style.display="inline"
}else{document.getElementById("lineMsg"+B).style.display="inline";
document.getElementById("linesMsg"+B).style.display="none"
}}function suspendItem(A){document.getElementById("stake-"+A).disabled=true;
if(document.getElementById("priceCombo-"+A)!=null){document.getElementById("priceCombo-"+A).style.display="none"
}if(document.getElementById("livePriceNotSelectableOdd"+A)!=null){document.getElementById("livePriceNotSelectableOdd"+A).style.display="none"
}if(document.getElementById("SPNotSelectableOdd"+A)!=null){document.getElementById("SPNotSelectableOdd"+A).style.display="none"
}if(document.getElementById("eachWay"+A)!=null){document.getElementById("eachWay"+A).style.display="none"
}if(document.getElementById("selectionSelected-"+A)!=null){document.getElementById("selectionSelected-"+A).style.display="none";
document.getElementById("selectionDeselected-"+A).style.display="block"
}}function reEnableControls(A){}function renderItemMessage(B,A){if(document.getElementById("wagerErrorMessage-"+B)!=null){document.getElementById("wagerErrorMessage-"+B).innerHTML=A;
document.getElementById("wagerErrorMessage-"+B).style.display="block"
}}function clearItemMessage(A){if(document.getElementById("wagerErrorMessage-"+A)!=null){document.getElementById("wagerErrorMessage-"+A).innerHTML="";
document.getElementById("wagerErrorMessage-"+A).style.display="none"
}}function getIdFromHTMLElementId(A){return A.substring(A.lastIndexOf("-")+1)
}function renderDwrStake(B,A){dwr.util.setValue("betSlipErrorMessage","");
document.getElementById("betSlipErrorMessage").style.display="none";
renderItemMessages(B.dwrItemMessages);
document.getElementById(A).value=B.stake;
if(B.errorOccured){document.getElementById(A).focus()
}renderSummary(B.totalStake,B.totalStakeZero)
}function uncheckRetainSelections(){if(document.getElementById("chkRetainSelections").checked){document.getElementById("spanRetainSelections").style.backgroundPosition="0 0px";
document.getElementById("chkRetainSelections").checked=false
}};function checkBetContainer(){if(jQuery.browser.msie){var A=jQuery("div#bet-container").width();
if(jQuery("div#bet-container").attr("offsetHeight")>400){jQuery("span#betSlipErrorMessage").css("width",A-15);
jQuery("div#selections").css("width",A-15);
jQuery("div#available-bets").css("width",A-15);
jQuery("div#betslipSelections").css("width",A-15);
jQuery("div#availableBets").css("width",A-15)
}else{jQuery("span#betSlipErrorMessage").css("width",A);
jQuery("div#selections").css("width",A);
jQuery("div#available-bets").css("width",A);
jQuery("div#betslipSelections").css("width",A);
jQuery("div#availableBets").css("width",A)
}}}function moveBetSlip(){if(!(jQuery.browser.msie&&jQuery.browser.version<"7.0")){jQuery(window).scroll(function(){calculateMovementBetSlip()
}).resize(function(){calculateMovementBetSlip()
});
window.onresize=function(){calculateMovementBetSlip();
getPageSize()
};
jQuery(window).load(function(){calculateMovementBetSlip();
getPageSize()
})
}}function calculateMovementBetSlip(){if(jQuery.browser.safari){scrollTop=document.body.scrollTop;
scrollLeft=document.body.scrollLeft;
scrollWidth=document.body.scrollWidth
}else{scrollTop=document.documentElement.scrollTop;
scrollLeft=document.documentElement.scrollLeft;
scrollWidth=document.documentElement.scrollWidth
}if((document.getElementById("bet-slip")!=null)&&((document.documentElement.clientHeight<=document.getElementById("bet-slip").offsetHeight)||(scrollTop<140))){jQuery("div#bet-slip").css("top","0px");
jQuery("div#bet-slip").css("left","0px");
jQuery("div#bet-slip").css("position","relative")
}else{if(scrollTop>140){jQuery("div#bet-slip").css("overflow","hidden");
jQuery("div#bet-slip").css("position","fixed");
jQuery("div#bet-slip").css("left",jQuery("div#section-body-right").offset().left+"px");
if(scrollWidth<=jQuery("div#container").width()){scrollLeft=jQuery("div#section-body-right").attr("offsetLeft")-scrollLeft;
jQuery("div#bet-slip").css("left",scrollLeft+"px")
}}}getPageSize()
}function howManyRaces(B,A){if(document.getElementsByName(B).length<A){return true
}else{return false
}}function checkboxBackground(A,B){jQuery("span[id="+A+"]").css("background-position",B)
}function toggleExoticEachWay(C,A){var B,D;
B=getIdFromHTMLElementId(C);
D=("stake-"+B);
BetSlip.toggleExoticEachWay(B,A,function(E){setEachWaySelected(B,A);
renderDwrStake(E,D);
document.getElementById("numberOfBets"+B).innerHTML=E.numberOfBets
})
}function clearAllSelections(){BetSlip.clearAllSelections(function(A){renderBetSlipMain(A);
refreshFrontEnd(A)
})
}function selectAllSelections(){BetSlip.selectAllSelections(function(A){renderBetSlipMain(A);
refreshFrontEnd(A)
})
}function removeAllSelections(){BetSlip.removeAllSelections(function(A){currentBetslipView=A.currentUserView;
setAddSelectionButtonsEnabled(false);
renderBetSlipMain(A);
refreshFrontEnd(A)
})
}function closeThankYouScreen(A){BetSlip.closeThankYouScreen(function(B){currentBetslipView=B.currentUserView;
if(!B.retainSelectionsAfterPlace){setAddSelectionButtonsEnabled(false)
}if(A!=null){document.location.href=A
}else{renderBetSlipMain(B);
updateOddsInCoupon()
}})
}function selectSingleSelection(A){var B=getIdFromHTMLElementId(A);
BetSlip.selectSingleSelection(B,function(C){renderBetSlipMain(C);
refreshFrontEnd(C)
})
}function selectForecastTricast(A){var B=getIdFromHTMLElementId(A);
BetSlip.selectForecastTricast(B,function(C){renderBetSlipMain(C);
refreshFrontEnd(C)
})
}function deselectSingleSelection(A){var B=getIdFromHTMLElementId(A);
BetSlip.deselectSingleSelection(B,function(C){renderBetSlipMain(C);
refreshFrontEnd(C)
})
}function deselectForecastTricast(A){var B=getIdFromHTMLElementId(A);
BetSlip.deselectForecastTricast(B,function(C){renderBetSlipMain(C);
refreshFrontEnd(C)
})
}function doGetSelectedEnd(C){var D=0,A,B;
if(document.selection){C.focus();
A=document.selection.createRange();
B=document.selection;
A.moveStart("character",-C.value.length);
D=A.text.length+B.text.length
}else{if(C.selectionStart||C.selectionStart=="0"){D=C.selectionEnd
}}return(D)
}function doGetCaretPosition(B){var C=0,A;
if(document.selection){B.focus();
A=document.selection.createRange();
A.moveStart("character",-B.value.length);
C=A.text.length
}else{if(B.selectionStart||B.selectionStart=="0"){C=B.selectionStart
}}return(C)
}function setStake(B){var A=getIdFromHTMLElementId(B);
stakeValue=dwr.util.getValue(B);
if(stakeValue==""){stakeValue="0.00"
}BetSlip.setStake(A,stakeValue,function(C){renderDwrStake(C,B)
})
}function setStakeSingleSelection(A){var B=getIdFromHTMLElementId(A);
stakeValue=dwr.util.getValue(A);
if(stakeValue==""){stakeValue="0.00"
}BetSlip.setStakeSingleSelection(B,stakeValue,function(C){renderDwrStake(C,A)
})
}function setStakeForecastTricast(A){var B=getIdFromHTMLElementId(A);
stakeValue=dwr.util.getValue(A);
if(stakeValue==""){stakeValue="0.00"
}BetSlip.setStakeForecastTricast(B,stakeValue,function(C){renderDwrStake(C,A)
})
}function selectToolTip(A){var B=getIdFromHTMLElementId(A);
document.getElementById("stake-"+B).focus()
}function validateWagers(){jQuery("div#bet-slip").css("z-index","3");
setMask(1);
BetSlip.validateWagers(function(A){tTip.hide();
currentBetslipView=A.currentUserView;
if(currentBetslipView=="confirm-bets.jsp"){renderBetSlipConfirm(A);
checkBetContainer()
}else{renderBetSlipMain(A);
refreshFrontEnd(A)
}})
}function setAddSelectionButtonsEnabled(C){var D=document.getElementsByName("addSelectionButton"),A="withOver",B;
for(B=0;
B<D.length;
B++){D[B].disabled=C;
D[B].className=A
}buttonScorecast(jQuery("button[name*=scorecast]"))
}function modifyBets(){BetSlip.setCurrentUserViewToSelection(function(A){tTip.hide();
currentBetslipView=A.currentUserView;
renderBetSlipMain(A);
refreshFrontEnd(A)
});
tTip.hide()
}function flashBannerReady(){BetSlip.getDwrBetSlip(false,function(A){refreshFlashFromBetSlip(A)
})
}function clearFlashBanner(){var A=document.getElementById("flashBanner");
if((A!=null)&&(typeof A!="undefined")&&(A.style.display=="none")){jQuery(A).css("display","block");
clearSelectionsFlashBanner("flashBanner");
jQuery(A).css("display","none")
}}function placeWagers(){var B="main.jsp",C="thank-you-bets-placed.jsp",A="busy",D=false;
if(document.getElementById("chkRetainSelections").checked){D=true
}else{clearFlashBanner()
}BetSlip.placeWagers(D,function(E){tTip.hide();
currentBetslipView=E.currentUserView;
if(currentBetslipView==B){renderBetSlipMain(E);
refreshFrontEnd(E)
}else{if(currentBetslipView==C){renderBetSlipPlace(E)
}else{if(currentBetslipView==A){}}}})
}function setPrice(B){var A=getIdFromHTMLElementId(B);
priceString=dwr.util.getValue("priceCombo-"+A);
BetSlip.setPrice(A,priceString)
}function setFocusOnStake(B){var A=getIdFromHTMLElementId(B);
document.getElementById("stake-"+A).focus()
}function addSelectionById(B,C,A,D){addSelectionWithMarketTypeById(B,C,A,null,D)
}function refreshFrontEnd(A){if(A.statusHasChanged){var F="",D=new Array(),G=document.getElementsByName("eventToRefresh"),C,B,E;
for(C=0;
C<G.length;
C++){D.push(G[C].value)
}if(D.length>0){EventService.updateOddsInCoupon(D,function(H){F=constructUpdatedOutcomes(H);
if(F!=null&&F.length>0){callBackUpdateOdds(H);
refreshPricesFlashBanner("flashBanner",F)
}else{callBackUpdateOdds(H)
}})
}else{B=A.dwrBetSlipSelections;
if(B!=null){E=constructUpdatedSelections(A);
refreshPricesFlashBanner("flashBanner",E)
}}}refreshFlashFromBetSlip(A)
}function refreshFrontEndFormat(){refreshFlashBanner();
var C="",B=new Array(),D=document.getElementsByName("eventToRefresh"),A;
for(A=0;
A<D.length;
A++){B.push(D[A].value)
}if(B.length>0){EventService.updateOddsInCoupon(B,function(E){callBackUpdateOdds(E)
})
}}function refreshFlashBanner(){var A=document.getElementById("flashBanner");
if((A!=null)&&(typeof A!="undefined")&&(A.style.display!="none")){jQuery(A).css("display","none");
setTimeout("displayFlash()",50)
}}function displayFlash(){var A=document.getElementById("flashBanner");
if((A!=null)&&(typeof A!="undefined")){jQuery(A).css("display","block")
}}function constructUpdatedOutcomes(A){var D="",B,C;
if((A!=null)&&(typeof A!="undefined")){for(B=0;
B<A.length;
B++){C=A[B];
if(B!=0){D+=","
}if(C.suspended){D+=C.id+":SUSPENDED"
}else{D+=C.id+":"+C.price
}}}return D
}function constructUpdatedSelections(C){var G="",B,F,D=C.dwrBetSlipSelections,A,E;
if((D!=null)&&(typeof D!="undefined")){for(B=0;
B<D.length;
B++){F=D[B];
if(B!=0){G+=","
}if(F.suspended){G+=F.id+":SUSPENDED"
}else{G+=F.id+":"+F.price
}}}A=C.lastSuspDwrBetSlipSelections;
if((A!=null)&&(typeof A!="undefined")){for(B=0;
B<A.length;
B++){E=A[B];
if((G.length>1)||(B!=0)){G+=","
}G+=E.id+":SUSPENDED"
}}return G
}function refreshFlashFromBetSlip(A){var B=A.dwrBetSlipSelections;
if(B!=null||(typeof B!="undefined")){refreshSelectionsFlashBanner(B)
}else{clearSelectionsFlashBanner("flashBanner")
}}function refreshSelectionsFlashBanner(B){if(document.getElementById("flashBanner")!=null){var C="",A;
if((B!=null)&&(typeof B!="undefined")&&(B!="")){for(A=0;
A<B.length;
A++){if(A!=0){C+=","
}C+=B[A].id
}}refreshSelectedFlashBanner("flashBanner",C)
}}function clearSelectionsFlashBanner(B){var A=document.getElementById(B);
if((document.getElementById("bet-container").style.display=="block")&&(A!=null)&&(typeof A!="undefined")&&(A.style.display=="block")){if(A.selectedOutcomes!=undefined){A.selectedOutcomes("")
}}}function refreshPricesFlashBanner(C,B){var A=document.getElementById(C);
if((document.getElementById("bet-container").style.display=="block")&&(A!=null)&&(typeof A!="undefined")&&(A.style.display=="block")&&(B!=null)){if(A.updateOutcomes!=undefined){A.updateOutcomes(B)
}}}function refreshSelectedFlashBanner(C,A){var B=document.getElementById(C);
if((document.getElementById("bet-container").style.display=="block")&&(B!=null)&&(typeof B!="undefined")&&(B.style.display=="block")&&(A!=null)){if(B.selectedOutcomes!=undefined){B.selectedOutcomes(A)
}}}function addSelectionWithMarketTypeById(D,E,C,F,B){var G,A;
if(document.getElementById("progress-spinner")){if(!isMaskVisible()){if(D==null){D=document.getElementById("towin-odd-button-"+C);
if(D==null){D=document.getElementById("american-odd-button-"+C)
}}if(D!=null){G=getIdFromHTMLElementId(D.id);
A=D.innerHTML;
if(D.id.indexOf("american-odd-button")!=-1){A=A.substr(A.indexOf(" ")+1,A.length)
}}if(D==null||(D!=null&&D.className!="selected")){BetSlip.addSelectionById(E,C,F,A,B,function(H){if((H.eventSuspended==false)&&(H.betSlipErrorMessage==null||H.multipleWagerWarnning)){if(D!=null){buttonsRepeated(C,"selected")
}}else{if(D!=null){D.className="withOver"
}}renderBetSlipMain(H);
refreshFrontEnd(H)
})
}}}else{showPopupWithMessage()
}}function buttonsRepeated(A,C){var B=0,D=document.getElementsByName("addSelectionButton");
for(B=0;
B<=D.length;
B++){if(jQuery(D[B]).attr("id")=="american-odd-button-"+A||jQuery(D[B]).attr("id")=="towin-odd-button-"+A){jQuery(D[B]).attr("class",C)
}}}function addScorecastSelections(A,B){if(!isMaskVisible()){if(A!=null&&A!=undefined&&A.className!="selected"&&A.accesskey!=""&&A.accesskey!=undefined){BetSlip.addScorecastSelections(B,A.id,A.innerHTML,A.accesskey,function(C){if((C.eventSuspended==false)&&(C.betSlipErrorMessage==null||C.multipleWagerWarnning)){if(A!=null){jQuery(A).attr("class","selected")
}}else{if(A!=null){jQuery(A).attr("class","withOver")
}}renderBetSlipMain(C);
updateOddsInCoupon()
})
}}}function addTricastOrForcastSelections(C,B,D,A){if(!isMaskVisible()){BetSlip.addTricastOrForcastSelections(A,C,B,D,function(E){renderBetSlipMain(E);
if(E.statusHasChanged){updateOddsInCoupon()
}clearAllForecastTricastSelections()
})
}}function removeSingleSelection(A){var B=getIdFromHTMLElementId(A);
buttonScorecast(jQuery("button[name*=scorecast]"));
BetSlip.removeSingleSelection(B,function(C){renderBetSlipMain(C);
refreshFrontEnd(C);
buttonsRepeated(B,"withOver")
})
}function removeForecastTricast(A){var B=getIdFromHTMLElementId(A);
dwr.engine.setTimeout(120000);
dwr.engine.setErrorHandler(handleDwrError);
BetSlip.removeForecastTricast(B,function(C){renderBetSlipMain(C);
refreshFrontEnd(C)
})
}function selectEachWay(B,A){var E=getIdFromHTMLElementId(B),D=document.getElementById("stake-"+E).value,C=("stake-"+E);
BetSlip.selectEachWay(E,A,D,function(F){if(F!=null){setEachWaySelected(E,A);
renderDwrStake(F,C);
document.getElementById("numberOfBets"+E).innerHTML=F.numberOfBets
}else{showPopupWithMessage("E/W could not be set! Please reload page!")
}})
}function refreshRaceDetail(){setMask(1);
updateOddsInBetSlip();
updateOddsInCoupon();
updateNextEvents();
setTimeout("clearMask()",1200)
}function updateOddsInBetSlip(){if(currentBetslipView==SELECTION_VIEW){BetSlip.updateOddsInBetSlip(function(A){renderRefreshedPrices(A)
})
}}function onClickCheck(B){var A=B.firstChild;
if(A!=null){if(A.checked==true){B.style.backgroundPosition="0 -50px"
}else{B.style.backgroundPosition="0 0px"
}}A.click()
};function buttonHover(){jQuery("button[name!='addSelectionButton']").mouseover(function(A){jQuery(this).attr("class","ftOver")
}).mouseout(function(A){jQuery(this).attr("class","ft")
});
jQuery('button[name="addSelectionButton"]').mouseover(function(A){if(jQuery(this).attr("class")!="selected"){jQuery(this).attr("class","withHover")
}}).mouseout(function(A){if(jQuery(this).attr("class")!="selected"){jQuery(this).attr("class","withOver")
}}).click(function(A){jQuery(this).attr("class")=="selected"
});
jQuery("button[name*=scorecast]").attr("class","withOver");
jQuery("button[name*=scorecast]").unbind()
}function buttonScorecast(A){jQuery(A).attr("class","withOver");
jQuery(A).bind("mouseover",function(B){jQuery(this).attr("class","withHover");
B.stopPropagation()
});
jQuery(A).bind("mouseout",function(B){jQuery(this).attr("class","withOver");
B.stopPropagation()
});
jQuery(A).bind("click",function(B){jQuery(this).attr("class","selected");
jQuery(this).unbind()
})
};function getSelectedEvents(){var D,C=new Array(),A,B=document.getElementsByName("eventCheckbox");
for(D=0;
D<B.length;
D++){if(B[D].checked){C.push(B[D].value)
}}if(C.length==0){A=document.getElementsByName("eventCheckboxhid");
for(D=0;
D<A.length;
D++){if(A[D].checked){C.push(A[D].value)
}}}return C
}function selectEvents(B,E){var D=document.getElementById("selectedEvent").selectedIndex,C=document.getElementById("selectedEvent")[D].value,A;
if(C.length>0){A=B+"?eventId="+C;
if(E=="true"){A=A+"&antepost=yes"
}location.href=A
}else{document.getElementById("race-detail").innerHTML=""
}}function hideDropdownPrice(){var A=document.getElementById("shc-fractional");
if(A!=null){A.style.display="none"
}}function selectEventMarket(A,B,C){if(C!=null){if(C=="-2"){return 
}A=A+".htm?marketId="+C;
if(B!=null){A=A+"&eventId="+B
}window.location=A
}else{if(B!=null){A=A+".htm?eventId="+C;
window.location=A
}}}function selectCouponEventMarket(A,B){A=A+"&marketId="+B;
window.location=A
}function selectMarket(A,B){if(B!=null){window.location=A+".htm?marketId="+B
}}function selectAntepost(E,D,F,I){var H,B,K,A,J,C,G;
if(E!=null){H=new Array(),H=E.split("*");
B=H[0];
K=H[1];
A=H[2];
J="";
for(G=3;
G<=H.length-1;
G++){J+=H[G]
}C="";
levelSport="sport";
if(D==levelSport&&A!=""){C="../"+A+"/"+J+".htm?eventId="+B+"&marketId="+K+"&level="+D+"&sport="+F
}else{C=J+".htm?eventId="+B+"&marketId="+K+"&level="+D+"&sport="+F+"&region="+I
}window.location=C
}}function selectCoupon(A,C,B){if(B!=null){window.location=A+".htm?sport="+C+"&couponId="+B
}}function showRaceDetailEvents(){var A=getSelectedEvents();
if(A.length>0){window.location="/horse-racing/create-card.htm?events="+A
}else{showPopupWithResourceBundleMessage("select.any.race.before.create.card")
}}function selectEventResult(A){var B=new Array();
B.push(A);
EventService.setEventsIds(B,callBackMethodForEventResultUpdate)
}function updateOddsInCoupon(){var B=new Array(),A,C=document.getElementsByName("eventToRefresh");
for(A=0;
A<C.length;
A++){B.push(C[A].value)
}if(B.length>0){EventService.updateOddsInCoupon(B,function(D){callBackUpdateOdds(D)
})
}}function callBackUpdateOdds(A){var B,C;
for(B=0;
B<A.length;
B++){C=A[B];
updateMoreButton(C);
updateOddRowAmerican(C);
updateOddRowToWin(C);
updateOddRowForecastTricast("forecast-",C);
updateOddRowForecastTricast("tricast-",C)
}}function updateNextEvents(){NextNEventsService.updateNextEvents(function(A){callBackUpdateNextEvents(A)
})
}function callBackUpdateNextEvents(G){var F,C,E,B,A,D;
F=document.getElementsByName("upcoming-race-event");
for(C=0;
C<F.length;
C++){race=F[C];
E=G[C];
B=race.id;
A=race.getElementsByTagName("a")[0];
D=race.getElementsByTagName("div")[0];
A.href=A.protocol+"//"+E.url;
D.innerHTML=E.description;
D.id="upcoming-event-description-"+E.id;
race.id=E.id
}}function updateScorecastMarketOdds(E){var B,C,D,A;
B=document.getElementById("scorecast-firstScorer-"+E).value;
C=document.getElementById("scorecast-correctScore-"+E).value;
buttonId="scorecastbutton-"+B+"-"+C;
D=document.getElementsByName("scorecastbutton-"+E)[0];
D.id="scorecastbutton-"+B+"-"+C;
buttonScorecast(D);
ScorecastService.updateOdds(B,C,function(F){A=document.getElementById("scorecastbutton-"+B+"-"+C);
A.innerHTML=F.priceFormated;
if(F.livePriceNumerator!=null&&F.livePriceDenominator!=null){A.accesskey=F.livePriceNumerator+"-"+F.livePriceDenominator
}else{A.accesskey="";
jQuery(A).attr("class","withOver");
jQuery(A).unbind()
}if(F.livePriceNumerator!=null&&F.livePriceNumerator!=undefined){if(F.selected){jQuery(A).attr("class","selected");
jQuery(A).unbind()
}else{jQuery(A).attr("class","withOver")
}}})
}function updateOddRowAmerican(B){var A=document.getElementById("american-suspended-"+B.id),D=document.getElementById("american-dash-"+B.id),C=document.getElementById("american-odd-button-"+B.id);
if(C!=null&&typeof C!="undefined"){if(B.marketDisplayed){if(!B.marketActive||B.suspended){if(A!=null&&typeof A!="undefined"){A.style.display="inline"
}if(D!=null&&typeof D!="undefined"){D.style.display="none"
}C.style.display="none"
}else{if(A!=null&&typeof A!="undefined"){A.style.display="none"
}if(D!=null&&typeof D!="undefined"){D.style.display="none"
}C.style.display="inline";
changeAmericanButtonsRepeated("american-odd-button-"+B.id,"inline",B)
}}else{if(A!=null&&typeof A!="undefined"){A.style.display="none"
}if(D!=null&&typeof D!="undefined"){D.style.display="inline"
}C.style.display="none"
}}}function updateMoreButton(C){var A,B;
A=document.getElementById("moreOn-"+C.eventId);
if(A!=null){if(!C.moreMarketsAvailable){A.style.display="none";
B=document.getElementById("linkMarketsEvent-"+C.eventId);
if(B!=null){B.href="#"
}B=document.getElementById("linkMarketsEvent2-"+C.eventId);
if(B!=null){B.href="#"
}}else{A.style.display="block"
}}}function updateOddRowToWin(C){var A=document.getElementById("towin-suspended-"+C.id),B=document.getElementById("towin-nonrunner-"+C.id),D=document.getElementById("towin-notavailable-"+C.id),E=document.getElementById("towin-odd-button-"+C.id);
if(E!=null&&typeof E!="undefined"){if(C.racingType){if(C.suspended){if(C.resultVoid&&!C.unnamedFavourite){A.style.display="none";
B.style.display="inline";
E.style.display="none"
}else{A.style.display="inline";
B.style.display="none";
E.style.display="none"
}}else{A.style.display="none";
B.style.display="none";
E.style.display="inline";
E.innerHTML=getPrice(C)
}}else{if(C.suspended&&!C.resultVoid){if(D!=null&&typeof D!="undefined"){D.style.display="inline"
}if(A!=null&&typeof A!="undefined"){A.style.display="inline"
}changeButtonsRepeated("towin-odd-button-"+C.id,"none")
}else{if(A!=null&&typeof A!="undefined"){A.style.display="none"
}changeButtonsRepeated("towin-odd-button-"+C.id,"inline",C);
if(D!=null&&typeof D!="undefined"){if(C.startingPrice){D.style.display="inline";
D.nextSibling.style.display="none"
}else{D.style.display="none";
D.nextSibling.style.display="inline"
}}}}}}function changeAmericanButtonsRepeated(A,E,D){var B=0,G,C,F=document.getElementsByName("addSelectionButton");
for(B=0;
B<=F.length;
B++){if(jQuery(F[B]).attr("id")==A){jQuery(F[B]).attr("style","display:"+E+";");
if(E=="inline"){G=D.handicap!=null?D.handicap+" ":"";
C=D.priceWithPreferedFormat==null?D.price:D.priceWithPreferedFormat;
jQuery(F[B]).html(G+C)
}}}}function changeButtonsRepeated(A,E,D){var B=0,C,F=document.getElementsByName("addSelectionButton");
for(B=0;
B<=F.length;
B++){if(jQuery(F[B]).attr("id")==A){jQuery(F[B]).attr("style","display:"+E+";");
if(E=="inline"){C=getPrice(D);
jQuery(F[B]).html(C)
}}}}function updateOddRowForecastTricast(G,A){var C=document.getElementById(G+"suspended-"+A.id),F=document.getElementById(G+"nonrunner-"+A.id),E=document.getElementById(G+A.id),J=document.getElementById(G+"CheckFirstCol-"+A.id),I=document.getElementById(G+"CheckSecondCol-"+A.id),H=document.getElementById(G+"CheckThirdCol-"+A.id),B=document.getElementById(G+"CheckAnyOrder-"+A.id),D=false;
if(E!=null&&typeof E!="undefined"){if(A.racingType){if(A.suspended){if(A.resultVoid&&!A.unnamedFavourite){C.style.display="none";
F.style.display="inline";
E.style.display="none";
D=false
}else{C.style.display="inline";
F.style.display="none";
E.style.display="none";
D=false
}}else{C.style.display="none";
F.style.display="none";
E.style.display="inline";
E.innerHTML=getPrice(A);
D=true
}}else{if(A.suspended&&!A.resultVoid){C.style.display="inline";
E.style.display="none";
D=false
}else{C.style.display="none";
E.style.display="inline";
E.innerHTML=getPrice(A);
D=true
}}if(D){J.style.display="inline";
I.style.display="inline";
B.style.display="inline";
if(G=="tricast-"){H.style.display="inline"
}}else{J.style.display="none";
I.style.display="none";
B.style.display="none";
if(G=="tricast-"){H.style.display="none"
}}}}function getPrice(A){return A.price
}function selectLanguage(A){EventService.selectLanguage(A,function(){window.location.reload()
})
};function forecastTricastSelectionsPaint(){var B=document.getElementsByTagName("input"),A;
for(A=0;
A<B.length;
A++){if(B[A].checked){B[A].checked=false;
forecastSelectionCheck(B[A].parentNode)
}}}function forecastSelectionCheck(B){var A=B.firstChild;
if(B.firstChild.name==null){A=B.firstChild.nextSibling
}if(A!=null){if(A.checked==true){B.style.backgroundPosition="0 -50px"
}else{B.style.backgroundPosition="0 0px"
}A.click()
}}function countSelectedRows(C){var A=new Array(),B;
for(B=0;
B<C.length;
B++){if(C[B].checked){A.push(C[B].value)
}}return A
}function forecastSelectionChecked(A,C){objectId=A.getAttribute("id");
columnName=A.getAttribute("name");
checkboxes=document.getElementsByName(columnName);
forecastString=" ";
disabled=true;
if(A.checked){if(columnName!=("any-column-forecast-"+C)){for(var B=0;
B<checkboxes.length;
B++){if(A!=checkboxes[B]){checkboxes[B].checked=false;
checkboxes[B].parentNode.style.backgroundPosition="0 0px"
}}}if(columnName==("any-column-forecast-"+C)){clearColumn("first-column-forecast-"+C);
clearColumn("second-column-forecast-"+C)
}else{if(columnName=="first-column-forecast-"+C){clearSelection("second-column-forecast-"+C,objectId)
}if(columnName=="second-column-forecast-"+C){clearSelection("first-column-forecast-"+C,objectId)
}clearColumn("any-column-forecast-"+C)
}}if(columnName==("any-column-forecast-"+C)){firstForecastSelection="";
secondForecastSelection="";
rows=countSelectedRows(document.getElementsByName("any-column-forecast-"+C));
if(rows.length==2){forecastString="Reverse Forecast "+rows[0]+";"+rows[1];
disabled=false
}else{if(rows.length>2){forecastString="Combination Forecast ";
for(B=0;
B<rows.length;
B++){forecastString=forecastString+rows[B]+";"
}forecastString=forecastString.substring(0,forecastString.length-1);
disabled=false
}}}else{firstColumnRows=countSelectedRows(document.getElementsByName("first-column-forecast-"+C));
secondColumnRows=countSelectedRows(document.getElementsByName("second-column-forecast-"+C));
if(firstColumnRows.length>0&&secondColumnRows.length>0){forecastString="Forecast "+firstColumnRows[0]+";"+secondColumnRows[0];
disabled=false
}}document.getElementById("columns-string-forecast-"+C).innerHTML=forecastString;
if(disabled){document.getElementById("add-button-forecast-"+C).disabled=true;
document.getElementById("add-button-forecast-"+C).className="ftOff"
}else{document.getElementById("add-button-forecast-"+C).disabled=false;
document.getElementById("add-button-forecast-"+C).className="ft"
}}function tricastSelectionChecked(A,C){objectId=A.getAttribute("id");
columnName=A.getAttribute("name");
checkboxes=document.getElementsByName(columnName);
tricastString=" ";
disabled=true;
if(A.checked){if(columnName!=("any-column-tricast-"+C)){for(var B=0;
B<checkboxes.length;
B++){if(A!=checkboxes[B]){checkboxes[B].checked=false;
checkboxes[B].parentNode.style.backgroundPosition="0 0px"
}}}if(columnName==("any-column-tricast-"+C)){clearColumn("first-column-tricast-"+C);
clearColumn("second-column-tricast-"+C);
clearColumn("third-column-tricast-"+C)
}else{if(columnName=="first-column-tricast-"+C){clearSelection("second-column-tricast-"+C,objectId);
clearSelection("third-column-tricast-"+C,objectId)
}else{if(columnName=="second-column-tricast-"+C){clearSelection("first-column-tricast-"+C,objectId);
clearSelection("third-column-tricast-"+C,objectId)
}else{if(columnName=="third-column-tricast-"+C){clearSelection("first-column-tricast-"+C,objectId);
clearSelection("second-column-tricast-"+C,objectId)
}}}clearColumn("any-column-tricast-"+C)
}}if(columnName==("any-column-tricast-"+C)){firstTricastSelection="";
secondTricastSelection="";
thirdTricastSelection="";
rows=countSelectedRows(document.getElementsByName("any-column-tricast-"+C));
if(rows.length>=3){tricastString="Combination Tricast ";
for(B=0;
B<rows.length;
B++){tricastString=tricastString+rows[B]+";"
}tricastString=tricastString.substring(0,tricastString.length-1);
disabled=false
}}else{firstColumnRows=countSelectedRows(document.getElementsByName("first-column-tricast-"+C));
secondColumnRows=countSelectedRows(document.getElementsByName("second-column-tricast-"+C));
thirdColumnRows=countSelectedRows(document.getElementsByName("third-column-tricast-"+C));
if(firstColumnRows.length>0&&secondColumnRows.length>0&&thirdColumnRows.length>0){tricastString="Tricast "+firstColumnRows[0]+";"+secondColumnRows[0]+";"+thirdColumnRows[0];
disabled=false
}}document.getElementById("columns-string-tricast-"+C).innerHTML=tricastString;
if(disabled){document.getElementById("add-button-tricast-"+C).disabled=true;
document.getElementById("add-button-tricast-"+C).className="ftOff"
}else{document.getElementById("add-button-tricast-"+C).disabled=false;
document.getElementById("add-button-tricast-"+C).className="ft"
}}function clearColumn(A){checkboxes=document.getElementsByName(A);
for(var B=0;
B<checkboxes.length;
B++){checkboxes[B].checked=false;
checkboxes[B].parentNode.style.backgroundPosition="0 0px"
}}function enableColumn(A){checkboxes=document.getElementsByName(A);
for(var B=0;
B<checkboxes.length;
B++){checkboxes[B].disabled=false
}}function clearSelection(A,C){checkboxes=document.getElementsByName(A);
for(var B=0;
B<checkboxes.length;
B++){if(C==checkboxes[B].getAttribute("id")){checkboxes[B].checked=false;
checkboxes[B].parentNode.style.backgroundPosition="0 0px";
break
}}}function clearAllForecastTricastSelections(){var B=document.getElementsByName("eventToRefresh"),A;
for(A=0;
A<B.length;
A++){clearAllForecastSelections(B[A].value);
clearAllTricastSelections(B[A].value)
}}function clearAllForecastSelections(A){if(document.getElementById("add-button-forecast-"+A)!=undefined){clearColumn("first-column-forecast-"+A);
clearColumn("second-column-forecast-"+A);
clearColumn("any-column-forecast-"+A);
firstForecastSelection="";
secondForecastSelection="";
document.getElementById("columns-string-forecast-"+A).innerHTML="";
document.getElementById("add-button-forecast-"+A).disabled=true;
document.getElementById("add-button-forecast-"+A).className="ftOff"
}}function clearAllTricastSelections(A){if(document.getElementById("add-button-tricast-"+A)!=undefined){clearColumn("first-column-tricast-"+A);
clearColumn("second-column-tricast-"+A);
clearColumn("third-column-tricast-"+A);
clearColumn("any-column-tricast-"+A);
firstTricastSelection="";
secondTricastSelection="";
thirdTricastSelection="";
document.getElementById("columns-string-tricast-"+A).innerHTML="";
document.getElementById("add-button-tricast-"+A).disabled=true;
document.getElementById("add-button-tricast-"+A).className="ftOff"
}}function countCheckboxesChecked(B){checked=0;
for(var A=0;
A<B.length;
A++){if(B[A].checked){checked=checked+1
}}return checked
}function disableCheckboxesNotChecked(B){for(var A=0;
A<B.length;
A++){if(B[A].checked==false){B[A].disabled=true
}}}function addForecast(B){checkboxes=document.getElementsByName("any-column-forecast-"+B);
forecastSelection="";
if(countCheckboxesChecked(checkboxes)>1){for(var A=0;
A<checkboxes.length;
A++){if(checkboxes[A].checked){forecastSelection=forecastSelection+checkboxes[A].getAttribute("id")+","
}}addTricastOrForcastSelections("forecast",forecastSelection,"true",B);
return 
}validSelection=false;
checkboxes=document.getElementsByName("first-column-forecast-"+B);
for(A=0;
A<checkboxes.length;
A++){if(checkboxes[A].checked){validSelection=true;
forecastSelection=checkboxes[A].getAttribute("id")+","
}}if(validSelection){checkboxes=document.getElementsByName("second-column-forecast-"+B);
for(A=0;
A<checkboxes.length;
A++){if(checkboxes[A].checked){forecastSelection=forecastSelection+checkboxes[A].getAttribute("id");
addTricastOrForcastSelections("forecast",forecastSelection,"false",B);
return 
}}}alert("Wrong selection!")
}function addTricast(B){checkboxes=document.getElementsByName("any-column-tricast-"+B);
tricastSelection="";
if(countCheckboxesChecked(checkboxes)>2){for(var A=0;
A<checkboxes.length;
A++){if(checkboxes[A].checked){tricastSelection=tricastSelection+checkboxes[A].getAttribute("id")+","
}}addTricastOrForcastSelections("tricast",tricastSelection,"true",B);
return 
}validSelection=false;
checkboxes=document.getElementsByName("first-column-tricast-"+B);
for(A=0;
A<checkboxes.length;
A++){if(checkboxes[A].checked){validSelection=true;
tricastSelection=checkboxes[A].getAttribute("id")+",";
break
}}if(validSelection){validSelection=false;
checkboxes=document.getElementsByName("second-column-tricast-"+B);
for(A=0;
A<checkboxes.length;
A++){if(checkboxes[A].checked){validSelection=true;
tricastSelection=tricastSelection+checkboxes[A].getAttribute("id")+",";
break
}}if(validSelection){checkboxes=document.getElementsByName("third-column-tricast-"+B);
for(A=0;
A<checkboxes.length;
A++){if(checkboxes[A].checked){tricastSelection=tricastSelection+checkboxes[A].getAttribute("id");
addTricastOrForcastSelections("tricast",tricastSelection,"false",B);
return 
}}}}alert("Wrong selection!")
}function setAddTricastForecastButtonsEnabled(C){var D=document.getElementsByName("addForecastTricastButton"),A="ft",B;
for(B=0;
B<D.length;
B++){D[B].disabled=C;
D[B].className=A
}};var helpWin,pokerWin,loc=document.location,lastpos=loc.toString().lastIndexOf(".com/")+4,firstpos=loc.toString().lastIndexOf("://"),schedule,_alreadyLoggedIn=false;
function openCmsHelp(A){var B;
if(A==null){B=("")
}else{B=(A)
}if(helpWin==null||helpWin.closed){helpWin=window.open(B,"","toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width=650,height=800,location=no,scrollbars=yes")
}else{helpWin.focus();
helpWin.location.replace(B)
}}function openCmsHelpContactUs(A){var B;
if(A==null){B=("")
}else{B=(A)
}if(helpWin==null||helpWin.closed){helpWin=window.open(B,"","toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width=800,height=900,location=no,scrollbars=yes")
}else{helpWin.focus();
helpWin.location.replace(B)
}}function middleButton(){if(jQuery.browser.msie){}else{if(jQuery.browser.mozilla){jQuery(document).click(function(A){if(A.which==2){return false
}})
}}}function browserDetection(){var A=true;
if(jQuery.browser.mozilla&&jQuery.browser.version<"1.9"){jQuery("div#progress-spinner").css("opacity","0.85");
jQuery("div#outerPopup button[name='hoverButton']").remove();
jQuery("div#popup-content-message").css("display","none");
jQuery("div#firefox").css("display","block");
showPopupWithMessage();
A=false
}return A
}function refreshPriceFormat(D,B){var A=priceFormatToNumber(B),C=D.id,E=priceFormatToNumber(C);
if(C!=B){if(window.location.href.indexOf("priceFormat")!=-1){window.location.href=window.location.href.replace("priceFormat="+A,"priceFormat="+E)
}else{window.location.href=window.location.href+((window.location.href.indexOf("?")!=-1)?"&":"?")+"priceFormat="+E
}}else{BODOG.components.dropDownSelection.closeDropDown()
}}function priceFormatToNumber(B){var A;
if(B=="AMERICAN"){A=41
}else{if(B=="FRACTIONAL"){A=42
}else{if(B=="DECIMAL"){A=43
}}}return A
}function checkErrors(D,A,C){getPageSize();
if(D.length>0){}else{if(A==("false")&&getURLParam("message")=="error"){var B=jQuery("div#popup-content-message div").html();
showPopupWithMessage(C)
}else{if(A==("true")){getDwrBetSlip(A)
}}jQuery("div#popup-content-message button").click(function(){jQuery("div#popup-content-message div").html(B)
})
}}function getURLParam(B){B=B.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var A="[\\?&]"+B+"=([^&#]*)",D=new RegExp(A),C=D.exec(window.location.href);
if(C==null){return""
}else{return C[1]
}}function openHelp(A){var B;
if(A==null){B=("")
}else{B=(A)
}if(helpWin==null||helpWin.closed){helpWin=window.open(B,"","toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width=650,height=800,location=no,scrollbars=yes")
}else{helpWin.focus();
helpWin.location.replace(B)
}}function openHelp2(A){var B;
if(A==null){B=("")
}else{B=(A)
}if(helpWin==null||helpWin.closed){helpWin=window.open("/help2/"+B,"","toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width=650,height=400,location=no,scrollbars=yes")
}else{helpWin.focus();
helpWin.location.replace("/help2/"+B)
}}function openPoker(A){var B;
if(A==null){B=("")
}else{B=(A)
}if(pokerWin==null||pokerWin.closed){pokerWin=window.open("/poker/"+B,"","toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width=600,height=320,location=no,scrollbars=yes")
}else{pokerWin.focus();
pokerWin.location.replace("/poker/"+B)
}}function openQuickTour(){var A=window.open("/quick-tour/","QuickTour","toolbar=no,personal=no,menubar=no,status=no,resizable=no,width=760,height=420,location=no,scrollbars=no");
A.moveTo(screen.availWidth/2-(760/2),screen.availHeight/2-(420/2));
if(A.focus){A.focus()
}}function openRules(D,C,B,A){if(typeof (popupWin)!="object"){popupWin=window.open(D,C,"toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width="+B+",height="+A+",location=no,scrollbars=yes")
}else{if(!popupWin.closed){popupWin.location.href=D
}else{popupWin=window.open(D,C,"toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width="+B+",height="+A+",location=no,scrollbars=yes")
}}popupWin.focus()
}function openLink(A){window.open("/template/popup/openLink.jsp?url="+arguments[0])
}function LinkPop(A,B){LinkWin=window.open("http"+loc.toString().substring(firstpos,lastpos)+"/template/popup/openLink.jsp?url="+A)
}function openParent(A){try{window.opener.location.href=arguments[0]
}catch(B){window.location.href=arguments[0]
}}function openWin(B,A){newWin=window.open(B,A,"toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width=600,height=400,location=no,scrollbars=yes")
}function openImage(B,E,D,G){var C="/template/popupImage.jsp?imageSrc="+B+"&w="+E+"&h="+D,A=E+12,F=D+32;
imageWin=window.open(C,G,"width="+A+",height="+F+",toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,location=no,scrollbars=no")
}function openSizedWin(D,C,B,A){newWin=window.open(D,C,"toolbar=no,personal=no,menubar=no,status=yes,resizable=yes,width="+B+",height="+A+",location=no,scrollbars=yes")
}function notEmail(C){if(C.length==0){return true
}var B=/^[\w\._\-\#\&0-9]+\@[0-9a-zA-Z\.\-]+\.[a-zA-Z]{2,3}$/,A=C.search(B);
if(A=="-1"){return true
}}function validateContestEmail(A){if(notEmail(A.contestEmailEntry.value)){alert("Please enter a valid email address...");
A.contestEmailEntry.focus();
return false
}}function validateSubscribeEmail(A){if(notEmail(A.emailAddress.value)){alert("Please enter a valid email address...");
A.emailAddress.focus();
return false
}}function validateReferralEmail(){if(notEmail(document.getElementById("email1").value)){alert("Please enter a valid email address...");
document.getElementById("email1").select();
return false
}var B=new Array("email2","email3","email4"),A;
for(A=0;
A<B.length;
A++){if(document.getElementById(B[A]).value!=""){if(notEmail(document.getElementById(B[A]).value)){alert("Please enter a valid email address...");
document.getElementById(B[A]).select();
return false
}}}}function printThis(){var A,B;
A=top.document.getElementById("mainContentArea").innerHTML;
top.contentFrame.toPrint.innerHTML=A;
B=document.contentFrame;
B.focus();
B.print()
}function bdClassNew(B,A){B.className=A
}function bdClassNew2(B,A){B.parentNode.className=A;
bdClassNew(B,A)
}function printPageArea(D){if(document.getElementById!=null){var A="<HTML>\n<HEAD>\n",B=document.getElementsByTagName("link"),F,E=document.getElementById(D),C=window.open("","PrinterFriendlyPage","width=730,height=400");
for(F=0;
F<B.length;
F++){A+='<link rel="STYLESHEET" type="text/css" href="'+B[F].href+'">'
}A+='\n</HEAD>\n<BODY bgcolor="white">\n';
A+='<div id="master-content-block" style="width:700px !important;">';
if(E!=null){A+=E.innerHTML
}A+="</div>\n</BODY>\n</HTML>";
C.document.open();
C.document.write(A);
C.document.close();
C.print()
}}function getElementsByTagNames(G,H){var A,F,E,D,C,B;
if(!H){H=document
}A=G.split(",");
F=new Array();
for(E=0;
E<A.length;
E++){B=H.getElementsByTagName(A[E]);
for(D=0;
D<B.length;
D++){F.push(B[D])
}}C=F[0];
if(C.sourceIndex){F.sort(function(J,I){return J.sourceIndex-I.sourceIndex
})
}else{if(C.compareDocumentPosition){F.sort(function(J,I){return 3-(J.compareDocumentPosition(I)&6)
})
}}return F
}function getElementsByClassName(B,F,A){var E=(F=="*"&&B.all)?B.all:B.getElementsByTagName(F),H=new Array(),G,D,C;
A=A.replace(/\-/g,"\\-");
G=new RegExp("(^|\\s)"+A+"(\\s|$)");
D;
for(C=0;
C<E.length;
C++){D=E[C];
if(G.test(D.className)){H.push(D)
}}return(H)
}function loginContainer(A){jQuery(A).toggle();
A=jQuery(A).next();
jQuery(A).toggle();
A.focus()
};var ieBrowser=navigator.appName,cursorPosition=0,decimalPosition=-1,totalNumbers,obj,keyDecimal;
function inputMaskKeypress(B,H,D,I,E){totalNumbers=I+E;
keyDecimal=D.charCodeAt(0);
decimalPosition=B.value.indexOf(D);
cursorPosition=doGetCaretPosition(B);
var F=getSelection(B),A=false,C,G=H.charCode?H.charCode:H.keyCode?H.keyCode:0;
if(G<48||G>57){if((H.charCode==keyDecimal)&&(decimalPosition!=-1)){return false
}if(G==13){B.blur();
if(B.nodeName.toLowerCase()=="input"){return true
}else{return false
}}if(H.keyCode==45&&B.value.length==0){return false
}if((G==39)&&(ieBrowser.indexOf("Microsoft")!=-1)){return false
}if(G!=8&&G!=9&&G!=13&&G!=35&&G!=36&&G!=37&&G!=39&&G!=46){A=false
}else{if(typeof H.charCode!="undefined"){if(H.keyCode==H.which&&H.which!=0){A=true
}else{if(H.keyCode!=0&&H.charCode==0&&H.which==0){A=true
}}}if(((H.keyCode==46)||(H.which==46))&&(H.charCode==0)){if(cursorPosition==decimalPosition){if(totalNumbersPre>I){return false
}else{A=true
}}}if(((H.keyCode==8)||(H.which==8))&&(H.charCode==0)){if((cursorPosition-decimalPosition==1)){if(totalNumbersPre>I){return false
}else{A=true
}}}}if(G==keyDecimal&&B.value.indexOf(D)==-1){A=true
}}else{if(!isAnyTextSelected(F)){if(floatPart.length>1){if(cursorPosition<=decimalPosition){if(floatPart[0].length>=I){A=false
}else{A=true
}}if(cursorPosition>decimalPosition){if(floatPart[0].length>=I){A=false
}else{A=true
}if(floatPart[1].length>=E){A=false
}else{A=true
}}}else{if(floatPart[0].length>=I){A=false
}else{A=true
}}}else{if(isDecimalSymbolSelected(B,D,F)){C=getNewStakeValue(B,G,F);
if(C.length>I){return false
}}return true
}}return A
}function inputMaskKeyDown(B,A){var C=B.charCode?B.charCode:B.keyCode?B.keyCode:0;
floatPart=B.value.split(A);
if(floatPart.length>1){totalNumbersPre=floatPart[0].length+floatPart[1].length
}if((B.ctrlKey&&C==97)||(B.ctrlKey&&C==65)){B.blur()
}if((B.ctrlKey&&C==120)||(B.ctrlKey&&C==88)){B.blur()
}if((B.ctrlKey&&C==99)||(B.ctrlKey&&C==67)){B.blur()
}if((B.ctrlKey&&C==122)||(B.ctrlKey&&C==90)){B.blur()
}if((B.ctrlKey&&C==118)||(B.ctrlKey&&C==86)){B.blur()
}}function isAnyTextSelected(A){return(A.start<A.end)
}function isDecimalSymbolSelected(A,C,B){return(A.value.indexOf(C)>=B.start&&A.value.indexOf(C)<B.end)
}function getNewStakeValue(B,A,D){part1Stake=B.value.substring(0,D.start);
part2Stake=B.value.substring(D.end);
var E=String.fromCharCode(A),C=part1Stake+E+part2Stake;
return C
}function getSelection(A){var E,D,F,B,C;
if("selectionStart" in A){return{start:A.selectionStart,end:A.selectionEnd}
}E=document.selection.createRange().getBookmark();
D=A.createTextRange();
D.moveToBookmark(E);
F=A.createTextRange();
F.collapse(true);
F.setEndPoint("EndToStart",D);
B=F.text.length;
C=D.text.length;
return{start:B,end:B+C}
}function inputMaskSelect(A){A.selectionStart=0;
A.selectionEnd=obj.value.length
};function initLiveCalendar(){jQuery(".supra .event-container").hide();
jQuery(".supra .event-container:first").show();
jQuery(".supra .date-info a").click(function(){var A=jQuery(this).parent("div").next();
if((A.is("div"))&&(A.is(":visible"))){return false
}if((A.is("div"))&&(!A.is(":visible"))){jQuery(".event-container:visible").slideUp("faster");
A.slideDown("faster");
return false
}})
}jQuery(document).ready(function(){initLiveCalendar()
});function getWagerDetails(B,A){if(B!=null){AccountStatementService.getWager(A,{callback:function(C){B.html(getWagerHTML(C));
B.slideToggle(200)
},timeout:120000,errorHandler:function(C){showPopupWithMessage("Reference error: We are unable to display the details for this transaction, please contact customer service")
}})
}}function getWagerHTML(A){var D,B,C;
D=A.currency+A.unitStake+" "+A.note+" "+A.typeDescription;
if(A.numOfPicksVisible){D+=" ("+A.picks.length+")"
}D+=":<br/>";
for(B=0;
B<A.picks.length;
B++){C=A.picks[B];
D+=C.choice+"@"+C.value+" ("+C.lineTypeDescription+") - "+C.eventName+" "+C.eventTypeDescription+" ";
if(C.eventNote!=undefined){D+="("+C.eventNote+")"
}D+="<br/>"
}return D
}function toggleSubmit(A){submitButton=document.getElementById("submitButton").disabled=A
}function disableAutocompleteAndInit(){document.forms.account.setAttribute("autocomplete","off");
var A=document.getElementById("country");
if(A){if(A.selectedIndex>0){if(document.getElementById("addressCountry")!=null){document.getElementById("addressCountry").value=A.options[A.selectedIndex].text
}}A.focus()
}jQuery("button").mouseover(function(B){jQuery(this).attr("class","ftOver")
}).mouseout(function(B){jQuery(this).attr("class","ft")
})
}function validatePassword(){var A=document.forms.account.password,B=document.forms.account.confirmPassword;
if(A.value!=B.value){B.value="";
B.className="error-input";
showErrorFromWithMessage('<spring:message code="account.password.and.confirmation.not.same"/>')
}else{B.className=""
}}function wagerDisplay(){jQuery(".posting_body").hide();
jQuery(".posting_head").click(function(){if(jQuery(this).next(".posting_body").html()!=""){jQuery(this).next(".posting_body").slideToggle(200)
}else{getWagerDetails(jQuery(this).next(".posting_body"),jQuery(this).prev("input").val())
}})
}function validateEmails(){var C,D,B=document.getElementById("email"),A=document.getElementById("confirmEmail");
if(B.value!=A.value){A.value="";
A.className="error-input";
C='<spring:message code="account.invalid.emails" />';
D=D.replace("&$39;","'");
showErrorFormWithMessage(C)
}else{A.className=""
}}function countryChange(){if(document.getElementById("addressCountry")!=null){document.getElementById("addressCountry").value=this.options[this.selectedIndex].text
}};function onloadFuntion(A){getPageSize();
moveBetSlip();
buttonHover();
middleButton();
if(jQuery.browser.msie&&jQuery.browser.version<"7.0"){jQuery.each(jQuery("img"),function(){var B=jQuery(this);
B.css({width:B.width(),height:B.height(),filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+B.attr("src")+"', sizingMethod='scale')"});
B.attr("src",A+"/images/common/blank.gif")
})
}BODOG.components.dropDownSelection.init()
};document.write('<style type="text/css">input.styled { display: none; } select.styled { position: relative; width: '+selectWidth+"px; opacity: 0; z-index: 5; }</style>");
var checkboxHeight="25",radioHeight="25",selectWidth="190",Custom={init:function(){var D=document.getElementsByTagName("input"),F=Array(),C,E,G,B,A;
for(B=0;
B<D.length;
B++){if((D[B].type=="checkbox"||D[B].type=="radio")&&D[B].className=="styled"){F[B]=document.createElement("span");
F[B].className=D[B].type;
if(D[B].checked==true){if(D[B].type=="checkbox"){position="0 -"+(checkboxHeight*2)+"px";
F[B].style.backgroundPosition=position
}else{position="0 -"+(radioHeight*2)+"px";
F[B].style.backgroundPosition=position
}}D[B].parentNode.insertBefore(F[B],D[B]);
D[B].onchange=Custom.clear;
F[B].onmousedown=Custom.pushed;
F[B].onmouseover=Custom.over;
F[B].onmouseout=Custom.left;
F[B].onmouseup=Custom.check;
document.onmouseup=Custom.clear
}}D=document.getElementsByTagName("select");
for(B=0;
B<D.length;
B++){if(D[B].className=="styled"){E=D[B].getElementsByTagName("option");
G=E[0].childNodes[0].nodeValue;
C=document.createTextNode(G);
for(A=0;
A<E.length;
A++){if(E[A].selected==true){C=document.createTextNode(E[A].childNodes[0].nodeValue)
}}F[B]=document.createElement("span");
F[B].className="select";
F[B].id="select"+D[B].name;
F[B].appendChild(C);
D[B].parentNode.insertBefore(F[B],D[B]);
D[B].onchange=Custom.choose
}}},over:function(){element=this.nextSibling;
if(element!=null){if(element.checked==true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight*3+"px"
}else{if(element.checked==true&&element.type=="radio"){this.style.backgroundPosition="0 -"+radioHeight*3+"px"
}else{if(element.checked!=true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight+"px"
}else{this.style.backgroundPosition="0 -"+radioHeight+"px"
}}}}},left:function(){element=this.nextSibling;
if(element!=null){if(element.checked==true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight*2+"px"
}else{if(element.checked==true&&element.type=="radio"){this.style.backgroundPosition="0 -"+radioHeight*2+"px"
}else{if(element.checked!=true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight*0+"px"
}else{this.style.backgroundPosition="0 -"+radioHeight*0+"px"
}}}}},pushed:function(){element=this.nextSibling;
if(element!=null){if(element.checked==true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight*3+"px"
}else{if(element.checked==true&&element.type=="radio"){this.style.backgroundPosition="0 -"+radioHeight*3+"px"
}else{if(element.checked!=true&&element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight+"px"
}else{this.style.backgroundPosition="0 -"+radioHeight+"px"
}}}}},check:function(){element=this.nextSibling;
if(element!=null){if(element.checked==true&&element.type=="checkbox"){this.style.backgroundPosition="0 0";
element.checked=false
}else{if(element.type=="checkbox"){this.style.backgroundPosition="0 -"+checkboxHeight*2+"px"
}else{this.style.backgroundPosition="0 -"+radioHeight*2+"px";
group=this.nextSibling.name;
inputs=document.getElementsByTagName("input");
for(var A=0;
A<inputs.length;
A++){if(inputs[A].name==group&&inputs[A]!=this.nextSibling){inputs[A].previousSibling.style.backgroundPosition="0 0"
}}}element.checked=true
}}},clear:function(){inputs=document.getElementsByTagName("input");
for(var A=0;
A<inputs.length;
A++){if(inputs[A].type=="checkbox"&&inputs[A].checked==true&&inputs[A].className=="styled"){inputs[A].previousSibling.style.backgroundPosition="0 -"+checkboxHeight*2+"px"
}else{if(inputs[A].type=="checkbox"&&inputs[A].className=="styled"){inputs[A].previousSibling.style.backgroundPosition="0 0"
}else{if(inputs[A].type=="radio"&&inputs[A].checked==true&&inputs[A].className=="styled"){inputs[A].previousSibling.style.backgroundPosition="0 -"+radioHeight*2+"px"
}else{if(inputs[A].type=="radio"&&inputs[A].className=="styled"){inputs[A].previousSibling.style.backgroundPosition="0 0"
}}}}}},choose:function(){option=this.getElementsByTagName("option");
for(var A=0;
A<option.length;
A++){if(option[A].selected==true){document.getElementById("select"+this.name).childNodes[0].nodeValue=option[A].childNodes[0].nodeValue
}}},checkAll:function(){var B=document.getElementsByName("eventCheckbox"),A;
for(A=0;
A<B.length;
A++){if(B[A].type=="checkbox"&&B[A].checked==false&&B[A].className=="styled"){B[A].previousSibling.style.backgroundPosition="0 -"+checkboxHeight*2+"px";
B[A].checked=true
}}},checkRace:function(B){var C=getElementsByClassName(B,"input","styled"),A;
for(A=0;
A<C.length;
A++){if(C[A].type=="checkbox"&&C[A].className=="styled"){if(C[A].checked){C[A].previousSibling.style.backgroundPosition="0 0";
C[A].checked=false
}else{C[A].previousSibling.style.backgroundPosition="0 -"+checkboxHeight*2+"px";
C[A].checked=true
}}}},clearAll:function(){var B=document.getElementsByName("eventCheckbox"),A;
for(A=0;
A<B.length;
A++){if(B[A].type=="checkbox"&&B[A].checked==true&&B[A].className=="styled"){B[A].previousSibling.style.backgroundPosition="0 0";
B[A].checked=false
}}}};BODOG.components.dropDownSelection=function(){return{settings:{dropDownID:"#shc-fractional-selected",dropDownContentID:"#shc-fractional-content",dropDownArrowID:"#shc-fractional-selected-arrow"},$divs:{},panel_off:true,init:function(A){var B=this;
jQuery.extend(this.settings,A||{});
this.assignDivs();
this.$divs.dDownArrow.parent().click(function(){B.openDropDown()
});
this.$divs.dDownContent.children().each(function(){jQuery(this).mouseover(function(){jQuery(this).attr("class","over")
}).mouseout(function(){jQuery(this).attr("class","")
}).click(function(){refreshPriceFormat(this,B.$divs.dDown.html());
jQuery("div#shc-fractional-selected").html(this.id);
B.closeDropDown()
})
})
},assignDivs:function(){this.$divs={dDown:jQuery(this.settings.dropDownID),dDownContent:jQuery(this.settings.dropDownContentID),dDownArrow:jQuery(this.settings.dropDownArrowID)}
},openDropDown:function(){that=this;
if(that.panel_off){this.$divs.dDownContent.slideDown(function(){that.panel_off=false
});
that.$divs.dDown.parent().attr("class","shc-selected-over")
}else{this.closeDropDown()
}},closeDropDown:function(){this.$divs.dDownContent.slideUp(function(){that.panel_off=true;
that.$divs.dDown.parent().attr("class","shc-selected")
})
}}
}();var timerID=0,rateTimer=5000;
function updateTimerToRefresh(){if(timerID){clearTimeout(timerID);
timerID=0
}updateOddsInBetSlip();
updateOddsInCoupon();
timerID=setTimeout("updateTimerToRefresh()",rateTimer)
}function initTimerToRefresh(E,D,C,B,H,G){if(E!=-1&&D!=-1&&C!=-1&&B!=-1&&H!=-1&&G!=-1){var A=new Date(),F=E-A.getTime();
if(F>=G){rateTimer=B
}else{if(F>=H&&F<G){rateTimer=C
}else{if(F<=H){rateTimer=D
}}}startTimerToRefresh()
}}function startTimerToRefresh(){timerID=setTimeout("updateTimerToRefresh()",rateTimer)
}function stopTimerToRefresh(){if(timerID){clearTimeout(timerID);
timerID=0
}};BODOG.components.submitTimeZoneForm=function(A){var C=jQuery("#timeZoneSelectedOption"),B;
if((C.attr("selectedIndex")!=0)&&(C.attr("selectedIndex")!=1)&&(C.attr("selectedIndex")!=3)){jQuery("#clientTimeZoneOffset").attr("value",function(){B=new Date().getTimezoneOffset();
return escape(B*(-1))
});
jQuery("#timeZoneChangeCaller").attr("value",function(){return window.location.href
});
jQuery("#timeZonePickerForm").submit()
}else{showPopupWithMessage(A)
}};
BODOG.components.timeZoneSelection=function(){var C=null,B=null,A=null;
return{settings:{timeZoneID:"#time-zone",timeZonePanelID:"#time-zone-panel",clockID:"#clock",timeZoneClosedClass:"time-zone-closed",timeZoneOpenClass:"time-zone-open",postMode:"",shortTimeZone:"",timeStamp:null},$divs:{},panel_off:true,init:function(E){var F=this,D;
jQuery.extend(this.settings,E||{});
this.setPostMode(this.settings.postMode);
this.setShortTimeZone(this.settings.shortTimeZone);
D=this.settings.timeStamp;
this.setTimeStamp(D);
this.assignDivs();
this.tick();
setInterval(function(){F.tick()
},1000);
if(jQuery("#time-zone")){if(C==""){this.$divs.clock.click(function(){F.openTimeZonePanel();
return false
});
this.$divs.clock.focus(function(){this.blur()
})
}}},assignDivs:function(){this.$divs={tz:jQuery(this.settings.timeZoneID),tzPanel:jQuery(this.settings.timeZonePanelID),clock:jQuery(this.settings.clockID)}
},openTimeZonePanel:function(D){if(D=="select"){this.panel_off=true;
showConfirm=false
}if(this.panel_off){this.panel_off=false;
this.$divs.tzPanel.slideDown()
}else{this.closeTimeZonePanel()
}},closeTimeZonePanel:function(){this.panel_off=true;
this.$divs.tzPanel.slideUp()
},tick:function(){var E=new Date(A),D="",F="";
switch(E.getDay()){case 0:D="Sun";
break;
case 1:D="Mon";
break;
case 2:D="Tue";
break;
case 3:D="Wed";
break;
case 4:D="Thu";
break;
case 5:D="Fri";
break;
case 6:D="Sat";
break;
default:D=""
}switch(E.getMonth()){case 0:F="Jan";
break;
case 1:F="Feb";
break;
case 2:F="Mar";
break;
case 3:F="Apr";
break;
case 4:F="May";
break;
case 5:F="Jun";
break;
case 6:F="Jul";
break;
case 7:F="Aug";
break;
case 8:F="Sep";
break;
case 9:F="Oct";
break;
case 10:F="Nov";
break;
case 11:F="Dec";
break;
default:F=""
}function G(K,H){K=K.toString();
var I="",J;
if(H>K.length){for(J=0;
J<(H-K.length);
J++){I+="0"
}}return I+K.toString()
}jQuery("#clock").html(D+" "+F+" "+E.getDate()+" "+G(E.getHours(),2)+":"+G(E.getMinutes(),2)+":"+G(E.getSeconds(),2)+" "+B);
A+=1000
},setPostMode:function(D){C=D
},setShortTimeZone:function(D){B=D
},setTimeStamp:function(D){A=D
}}
}();var tTipTag="infoTip",tTipX=-13,tTipY=15,tTip={name:"toolTip",inname:"innerTip",offsetX:tTipX,offsetY:tTipY,tip:null};
tTip.init=function(){var D,F,G,B,E,C,H,A;
if(!D){D="toolTip"
}F=document.getElementById(D);
if(!F){F=document.createElement("div");
F.setAttribute("id",D);
document.getElementsByTagName("body").item(0).appendChild(F)
}if(!B){B="innerBox"
}G=document.getElementById(B);
if(!G){G=document.createElement("div");
G.setAttribute("id",B);
document.getElementById(D).appendChild(G)
}this.tip=document.getElementById(this.name);
E=document.getElementsByName("infoTip");
for(C=0;
C<E.length;
C++){H=E[C];
A=H.getAttribute("title");
if(A){H.setAttribute("tiptitle",A);
H.removeAttribute("title");
H.removeAttribute("alt");
H.onmouseover=function(){tTip.show(this.getAttribute("tiptitle"))
};
jQuery(H).mousemove(function(I){jQuery("div#toolTip").css("top",I.pageY+tTipY);
jQuery("div#toolTip").css("left",I.pageX+tTipX)
});
H.onmouseout=function(){tTip.hide()
}
}}};
tTip.show=function(A){if(!this.tip){return 
}this.tip.firstChild.innerHTML=A;
this.tip.style.display="block"
};
tTip.hide=function(){if(!this.tip){return 
}this.tip.firstChild.innerHTML="";
this.tip.style.display="none"
};function getPageSize(){var A=document.documentElement.scrollWidth,B=document.documentElement.scrollHeight;
if(document.getElementById("progress-spinner")){jQuery("div#progress-spinner").css({width:A,height:B})
}else{jQuery("div#progress-spinner-logoff").css({width:A,height:B})
}}function openStats(C,A){var B=document.getElementById("section-body").offsetLeft;
window.open(A,C,"resizable=yes, toolbar=yes, scrollbars=yes, width=1005, height=500, left="+B)
}function logOut(){window.location.href="/logout.htm"
}function showPopupWithResourceBundleMessage(A){MessageProvider.getMessage(A,function(B){showPopupWithMessage(B,true);
getDwrBetSlip(isLogged)
})
}function showPopupWithMessage(B){var A=document.documentElement.scrollWidth/2-jQuery("div#outerPopup").width()/2-20;
setMask();
jQuery("div#outerPopup").css("left",A);
jQuery("div#popup-content-message").css("display","none");
jQuery("div#sign-out").css("display","none");
jQuery("div#disabled-account").css("display","none");
jQuery("div#jurisdiction-not-allowed").css("display","none");
if(B=="sign-out"){jQuery("div#sign-out").css("display","block")
}else{if(B=="disabled-account"){jQuery("div#disabled-account").css("display","block")
}else{if(B=="jurisdiction-not-allowed"){jQuery("div#jurisdiction-not-allowed").css("display","block")
}else{jQuery("div#popup-content-message").css("display","block");
jQuery("div#popup-content-message div").html(B)
}}}jQuery("div#outerPopup").css("display","block");
if(jQuery("div#bet-slip").css("z-index")>2){jQuery("div#bet-slip").css("z-index","0")
}}function isPopupShown(){if(document.getElementById("outerPopup").style.display=="block"){return true
}else{return false
}}function showDialog(){setMask(3,"/signup.htm")
}function closeDialog(){jQuery("#iframeCloseBtn").css("display","none");
jQuery("#registrationForm").remove();
buttonHover();
clearMask();
document.getElementById("container").focus()
}function showErrorFormWithMessage(C,A){var B=document.getElementById("shc-logo").clientHeight+jQuery("div.manageAccountTrunk").attr("scrollHeight")-40+74;
jQuery("div#progress-spinner-form").css("filter","alpha(opacity=85)");
if(jQuery.browser.msie&&jQuery.browser.version<"7.0"){jQuery("select").css("visibility","hidden")
}jQuery("div#progress-spinner-form").css("height",B);
jQuery("div#progress-spinner-form").css("display","block");
jQuery("div#popup-content-message").html(C);
if(A!=null){jQuery("div#popup-content button").click(function(D){A.focus()
})
}jQuery("div#outerFormPopup").css("display","block")
}function clearMaskForm(){jQuery("div#outerFormPopup").css("display","none");
if(jQuery.browser.msie&&jQuery.browser.version<"7.0"){jQuery("select").css("visibility","visible")
}jQuery("div#progress-spinner-form").fadeOut("normal",function(){jQuery(this).css("display","none")
})
};