﻿
function selectVaporTeam(TeamIdHash) {
    if (TeamIdHash != null) {
        window.open('DisplayTeam.aspx?q=' + TeamIdHash,'sba','height=700,width=880,top=10,left=10,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes');
    }
}

function createNewVaporTeam(type) {
    window.showModalDialog('DisplayTeam.aspx?t='+type, 'Sportingbet Fantasy - Create Team', 'dialogHeight:700px;dialogWidth:880px');
    document.forms[0].submit();
}

function removeBet(encodedBet) {
    document.getElementById('hdnBetInfo').value = 'DEL:' + encodedBet;
    document.forms[0].submit();
}

function removeMultiBet(encodedBet) {
    document.getElementById('hdnBetInfo').value = 'MULTIDEL:' + encodedBet;
    document.forms[0].submit();
}

function printSlip() {
    window.open('PrintSlip.aspx', 'sbaprintslip', 'height=500,width=600');
}

function printPage() {
    if (window.print) {
        window.print()
    }
    else {
        alert("Sorry, your browser doesn't support this feature.");
    }
}

function placeBet(betStr) {
    document.forms[0].hdnBetInfo.value = betStr;
    document.forms[0].submit();
    document.forms[0].hdnBetInfo.value = '';
}

function placeSportMulti(betStr) {
    document.forms[0].hdnBetInfo.value = 'MULTI-'+betStr;
    document.forms[0].submit();
    document.forms[0].hdnBetInfo.value = '';
}

function setText(callingimg, val) {
    callingimg.selectedIndex = 0;
    //alert(callingimg.parentNode.children[0]);
    var browser = navigator.appName;
    //alert(browser);
    if (browser == 'Netscape') {
        //alert('firstChild' + callingimg.parentNode.childNodes[1].id);
        callingimg.parentNode.childNodes[1].focus();
        callingimg.parentNode.childNodes[1].value = val;
        callingimg.parentNode.childNodes[0].focus();
        callingimg.parentNode.childNodes[0].value = val;
    }
    else {
        //alert('children[0]' + callingimg.parentNode.children[0].id);
        callingimg.parentNode.children[0].focus();
        callingimg.parentNode.children[0].value = val;
    }
}

function openTeamActiveBets(team) {
    //alert(team);
    winRef = window.open('./DisplayTeam.aspx?q='+ team , 'abw', 'height=640px,width=1024px,top=10,left=10,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes')
}

function openSOS(et,e) {
    //alert(team);
    winRef = window.open('./SuperStarsTeam.aspx?et=' + et + '&e=' + e, 'abw', 'height=640px,width=1024px,top=10,left=10,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes')
}

function openHDIW(currentPage) {
    var currentPage = currentPage.toLowerCase().replace('.aspx', 'HowDoesItWork.aspx')
    window.open(currentPage, 'hdiw', 'height=700px,width=690px,top=10,left=10,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes');
}

function openRules(currentPage) {
    var currentPage = currentPage + 'Rules.aspx';
    window.open(currentPage, 'hdiw', 'height=700px,width=690px,top=10,left=10,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes');
}

function openResults(currentPage) {
    var currentPage = currentPage + 'Result.aspx';
    window.open(currentPage, 'hdiw', 'height=700px,width=920px,top=10,left=10,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes');
}

function openSBAReg() {
    window.open('https://www.sportingbet.com.au/Signup.aspx', 'hdsba');
}

function openFreeBetTermsCondition() {

    var currentPage = 'FreeBetTermsAndCondition.html';

    window.open(currentPage, 'hdiw', 'height=730px,width=450px,top=10,left=10,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=no');
}
