

//<script>
var oddlist
function formatBSMultiW(grp)
// USED FOR ADDING BETS TO THE BETTING SLIP
{
var mf;
var i;
var nb =0;
var nr =0;
var t;
oddlist = "";
for (i=0;i<document.forms.length;i++) {
mf = document.forms[i];
if(mf.name.indexOf("SubmitBetsW")>=0) {
if(mf.bslist != null){
if(mf.bslist.value){
nr = 1;
}else{
//it's an array
nr = mf.bslist.length;
}
if (nr==1) {
if (mf.bslist.checked == true) {
nb++;
if (mf.curroddlist!=null) {
if (mf.curroddlist.checked == true) {
getoddlist(mf.curroddlist.value);
}
else {
// else use the SP price
getoddlist(mf.bslist.value);
}
}
else {
getoddlist(mf.bslist.value);
}
} // end if addtobetslip checked
}
else {
//alert(" bslist length ="+nr);
for(var j=0; j<nr;j++) {
// 		if the add to betslip is checked for this row
if (mf.bslist[j].checked == true) {
nb++;
if (mf.curroddlist!=null) {
if (mf.curroddlist[j].checked == true) {
// if the current odd is chosen
getoddlist(mf.curroddlist[j].value);
}
else {
// else SP value used
getoddlist( mf.bslist[j].value);
} // get currentodd checked
} 
else {
getoddlist(mf.bslist[j].value);	
}	
}
// add the selection box option to the oddlist (if > 1 dropdown)
if (mf.selectsign != null) {
if(!mf.selectsign.value) {
t=mf.selectsign[j];	
if (t != null) {
if (t.value != "0") {	
nb++;
getoddlist(t.value);
}
}
}
}
}
}
// if just one dropdown
if (mf.selectsign != null) {
if(mf.selectsign.value) {
// if just one dropdown
t=mf.selectsign;	
if (t != null) {
if (t.value != "0") {	
nb++;
getoddlist(t.value);
}
}
}
}
}
if (mf.favbslist!=null) {
if (mf.favbslist.checked == true) {
nb++;
getoddlist(mf.favbslist.value);
}
}	
}
}
if (nb == 0) {
alert("Please highlight a selection to add to the betslip.");
return false;
}
document.forms["SubmitBetsW"+grp].oddlist.value = oddlist;
return true;
}
function getoddlist(tempstr) {	
position = tempstr.search(':');
if (oddlist == "")
oddlist = tempstr.substr(0,position);
else
oddlist += "^" +tempstr.substr(0,position);
}

function jsTryAddToSlip(grp){if(formatBSMultiW(grp)){document.getElementById("SubmitBetsW"+grp).submit();}}
function jsTryReset(grp){document.getElementById("SubmitBetsW"+grp).reset();}
