function bgcolorchange(divnumber) {
    var elementName = 'labelSpace' + divnumber;
    var preElementName = document.form.testvalue.value;

    document.getElementById(preElementName).style.backgroundColor = "#D4B058";
    document.form.testvalue.value = elementName;
    document.getElementById(elementName).style.backgroundColor = "#D6CEBC";
}

function formBgOn(tblTag, hiliteClass, eventPlan) {
    this.pkgId = tblTag;
    this.tblItem = document.getElementById(tblTag);
    this.hiliteClass = hiliteClass;
    this.rowChoice;
    this.rowChoiceInitClass;
    if (this.tblItem == null) {
        return false;
    }
    var thisClone = this;
    var action = function(e) {
        if (e == null) {
            e = this.tblItem.myDoc.parentWindow.event;
        }
        thisClone.mouseover(e);
    }
    if (this.tblItem.addPlan) {
        for (i = 0; i < eventPlan.length; i++) {
            this.tblItem.addPlan(eventPlan[i], action, false);
        }
    }
    else if (this.tblItem.attachEvent) {
        for (i = 0; i < eventPlan.length; i++) {
            eventName = "on" + eventPlan[i];
            this.tblItem.attachEvent(eventName, action);
        }
    }
    
    return;
}

formBgOn.prototype.mouseover = function(e) {
    var el;

    if (e.target != null) {
        el = e.target;
    }
    else {
        el = e.srcElement;
    }
    while (el != null && el.nodeType != 1 && el.parentNode != this.tblItem) {
        el = el.parentNode;
    }
    if (el == this.tblItem) {
        return false;
    }
    rowEl = this.getCurrentRow(el);
         if (rowEl == null) {
        return false;
    }
    if (rowEl == this.rowChoice) {
        return false;
    }
    if (this.rowChoice) {
        this.rowChoice.className = this.rowChoiceInitClass;
    }
    this.rowChoice = rowEl;
    this.rowChoiceInitClass = rowEl.className;
    rowEl.className = this.hiliteClass;
    return;
}

formBgOn.prototype.getCurrentRow = function(el) {
    while (el != null && el.parentNode.parentNode.id != this.pkgId && el.parentNode != null) {
        el = el.parentNode;
    }
    return el;
}


//pop launcher

function openWindow(URL, width, height, resizable, scrollbars)
{
    try
    {
        newWindow.close();
    }
    catch(e)
    {

    }

    newWindow = window.open(URL, 'page', "status=no,location=no,menubar=no,toolbar=no,directories=no,resizable=" + resizable + ",scrollbars=" + scrollbars + ",width=" + width + ",height=" + height + ",screenX=100,screenY=100");
    window.onerror = null;
}

function changeEdulevel() {
	setLeavingFlagToFalse();
	document.forms[0].submit();
}


// CHG41199: Changes to Grand Canyon site
function changeProgram() {

    var a1 = document.forms[0].ProgramOfInterest.options[document.forms[0].ProgramOfInterest.selectedIndex].value;
     
    if (a1 == '')
    {
        return;
    }
    else if (a1 == 'EMBA')
    {


        document.forms[0].elements['programChangeFlag1'].value = 'YES1';

    }
    else if (a1 == '13')
    {

        document.forms[0].elements['programChangeFlag2'].value = 'YES2';

    }
    else if (a1 == '33' || a1 == '45' || a1 == '46' || a1 == '47' || a1 == '58' || a1 == '64' || a1 == '40' )
    {

        document.forms[0].elements['programChangeFlag3'].value = 'YES3';

    }
    else if (a1 == '33' || a1 == '45' || a1 == '46' || a1 == '47' || a1 == '58' || a1 == '64' || a1 == '40' )
    {

        document.forms[0].elements['programChangeFlag4'].value = 'YES4';

    }
    else
    {

        document.forms[0].elements['programChangeFlag'].value = 'YES';
    }
    setLeavingFlagToFalse();

    document.forms[0].submit();
}

function calculateCssProperties() {
    var addHeight = -100;
    document.getElementById("footerLinks").style.top = document.getElementById("copyContent").offsetHeight + addHeight;
}

function getHeight(box) {
    var h;
    for (var x = 0; x < box.length; x++) {
        // set outer table
        h = document.getElementById(box[x]).offsetHeight;
        for (var y = 0; y < box.length; y++) {
            var test_h = document.getElementById(box[y]).offsetHeight;
            if (h < test_h) h = test_h;
        }
    }
    return h;
}

function adjustHeight(box, h) {
    //set the height of all divs to the tallest
    for (var x = 0; x < box.length; x++) {
        document.getElementById(box[x]).style.height = h + "px";
    }
}

function setHeight() {
    var outerbox = new Array("pageContent", "form2");
    var h = getHeight(outerbox);
    adjustHeight(outerbox, h);
    //changing h to the offset for the nav table
    h = h - 54;
}

// for www.learningandlife.com
function openWin(URL) {
    newWindow = window.open(URL, 'programs', 'toolbar=no,width=550,height=500,directories=0,status=0,scrollbars=1,resizable=0,menubar=0,location=0,screenX=100,screenY=75,left=100,top=75,copyhistory=0');
}
function doProcessing() {

    document.getElementById('submitBtn').className = 'thide';
    document.getElementById('processing').className = 'tshow';
    document.forms[0].elements['sbmtDescFlag'].value='Y';
  	}
    function resetSubmitValue(){

     document.forms[0].elements['sbmtDescFlag'].value='N';
    }