// following functions are used when clicking an information link in a popup window
// they load new content in the opener window
function editGame(gameID) {
    if(!gameID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/game/edit.php?gameID="+gameID;
    win.focus();
}

function viewGame(gameID) {
    if(!gameID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/game/view.php?gameID="+gameID;
    win.focus();
}

function editGameReport(rptID) {
    if(!rptID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/game_rept/edit.php?gameReportID="+rptID;
    win.focus();
}

function editSuspension(miscID) {
    if(!miscID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/misconduct/suspension.php?misconductID="+miscID;
    win.focus();
}

function editAccounting(acctID) {
    if(!acctID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/accounting/edit.php?accountingID="+acctID;
    win.focus();
}

function viewGameReportPDF(rptID) {
    if(!rptID) return;
    var d = new Date();
    window.open('/OSICORE/game_rept/print.php?gameReportID='+rptID+'&nocache='+d.getTime(), '', '');
}

function editUser(userID, gameID, gameDate) 
{
    if(userID && gameID && show_referee_options) {
        show_referee_options(gameID, userID, gameDate);
        return false;
    }       
                            
    if(!userID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/user/edit.php?userID="+userID;
    win.focus();
}

function viewUser(userID, gameID, gameDate) 
{
    if(userID && gameID && show_referee_options) {
        show_referee_options(gameID, userID, gameDate);
        return false;
    } 
    
    if(!userID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/user/directory.php?userID="+userID;
    win.focus();
}

function editOrg(orgID) {
    if(!orgID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/org/edit.php?orgID="+orgID;
    win.focus();
}

function viewOrg(orgID) {
    if(!orgID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/org/view.php?orgID="+orgID;
    win.focus();
}

function viewField(fieldID) {
    if(!fieldID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/loc/view.php?fieldID="+fieldID;
    win.focus();
}

function editField(fieldID) {
    if(!fieldID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/loc/edit.php?fieldID="+fieldID;
    win.focus();
}

function viewLocation(locID) {
    if(!locID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/loc/view.php?locationID="+locID;
    win.focus();
}

function editLocation(locID) {
    if(!locID) return;
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/loc/edit.php?locationID="+locID;
    win.focus();
}

function viewUnconfirmedAssignments() {
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/game/confirm.php";
    win.focus();
}

function goToAssignmentSearch() {
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/game/assignment.php";
    win.focus();
}

function goToOrgList() {
	var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/org/index.php";
    win.focus();	
}

function goToAvailability(userID) {
    var win = self;
    if(opener) win = opener;
    win.location = "/OSICORE/user/availability.php?userID="+userID;
    win.focus();
}


