function chartOpen(event,divID,raceID,affid) {

    charts = window.open('event_chart.cgi?ID=' + event + '&raceID=' + raceID + '&divID=' + divID + '&affid=' + affid, 'bcChart', 'dependent=no,location=no,menubar=yes,scrollbars=yes,statusbar=no,resizable=yes,width=700,height=450,top=10,screenY=0,left=10,screenX=10');
    charts.focus();
    return false;
}

function raceOpen(file) {
    affid = document.location.hash;
    if (affid.substring(0,1) == '#') affid = affid.substring(1);

    document.location = file;
    return false;
}

function ppOpen(file) {
    pp = window.open(file, 'bcPP', 'dependent=no,location=no,menubar=no,scrollbars=yes,statusbar=no,resizable=yes,width=700,height=450,top=10,screenY=0,left=10,screenX=10');
    pp.focus();
    return false;
}

function replayOpen(track, date, race, play, affid) {

    var url = 'https://www.americatab.com/secure-bin/replay_video/replay_video.cgi?affid=' + affid + '&track=' + track + '&date=' + date + '&race=' + race

    if (play != -1) url = url + '&play=' + play;

    replays = window.open(url, 'vidArchiveWin', 'dependent=no,location=no,menubar=no,scrollbar=no,statusbar=no,resizable=yes,width=726,height=452,screenX=20,screenY=20,top=20,left=20');
    replays.focus();
    return false;
}
