﻿function changeNavigationOver(iNav) {
    document.getElementById(iNav + 'A').className = 'TopNavOn';
    document.getElementById(iNav + 'B').className = 'RFont';
}

function changeNavigationOff(iNav) {
    if (document.getElementById('ctl00_hINav').value == iNav) {
        return;
    }
    else {
        document.getElementById(iNav + 'A').className = 'TopNavOff';
        document.getElementById(iNav + 'B').className = 'DFont';
    }
}

function ChangePage(url) {
    var iBase = document.getElementById('ctl00_editKey');

    try {
        if (iBase) {
            if (iBase.value != '3e3d6121c8ea4f1ea1cddc1f4d2138e1') {
                location.href = url;
            }
        }
    }
    catch (e) {
    }
}

function DeleteBio(bioID) {
    var randid = Math.floor(Math.random() * 1001)
    if (document.getElementById('ctl00_editKey').value == '3e3d6121c8ea4f1ea1cddc1f4d2138e1') {
        var answer = confirm("You are about to delete this bio are you sure you wish to do this?")
        if (answer) {
            location.href = './dbid.aspx?bioid=' + bioID + '&adminKey=3e3d6121c8ea4f1ea1cddc1f4d2138e1&randid=' + randid;
        }
    }
}

function DeleteEvent(eventID) {
    var randid = Math.floor(Math.random() * 1001)
    if (document.getElementById('ctl00_editKey').value == '3e3d6121c8ea4f1ea1cddc1f4d2138e1') {
        var answer = confirm("You are about to delete this event are you sure you wish to do this?")
        if (answer) {
            location.href = './deid.aspx?eventid=' + eventID + '&adminKey=3e3d6121c8ea4f1ea1cddc1f4d2138e1&randid=' + randid;
        }
    }
}

function RefreshBase(url) {
    location.href = url;
}

function ChangePreviewMode(iMode) {
    var appKey = '3e3d6121c8ea4f1ea1cddc1f4d2138e1';
    var url = location.href;

    url = url.replace(/\?.*/, '');
    if (iMode == 'edit') {
        if (url.indexOf('?') == -1) {
            url = url + '?editmode=' + appKey;
        }
        else {
            url = url + '&editmode=' + appKey;
        }
    }
    else {
        if (url.indexOf('?') == -1) {
            url = url + '?previewmode=' + appKey;
        }
        else {
            url = url + '&previewmode=' + appKey;
        }
    }
    location.href=url;
}
