var zflag_nid="244"; var zflag_cid="120/89/1"; var zflag_sid="16"; var zflag_width="291"; var zflag_height="99"; var zflag_sz="48";

var window_id = [0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,6,6];
var tnode = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28];
var tnode_status = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
var num_windows = 6;
var process = "";
var link_id = ["Programs","Business and Technology","Education","Human Services","Psychology","Undergraduate Studies"];

function display_window (which_window)
{
    if(!funDateCheck())   //if not getting submitted then return false
     return false;
    
    var temp = document.forms[0].elements['EducationLevel'].value;
    var temp1 = document.forms[0].elements['DegreeStartMonth'].value;
    var temp2 = document.forms[0].elements['DegreeStartYear'].value;

    if(temp =="--- Select One ---" && which_window ==4){
        return false;
    }
   if(temp1 =="--- Select One ---" && which_window ==6){
        return false;
    }
    if(temp2 =="--- Select One ---" && which_window ==6){
        return false;
    }

    var i;
    var target;
    var node_elt = "";
    for(i=1; i<=32; i++) {
        target = 't' + tnode[i];

        node_elt = document.getElementById(target);

        if ( node_elt != null ) {
            if (window_id[i] == which_window) {

                node_elt.className = 'tshow';
            } else {

                node_elt.className = 'thide';
            }
        }
    }
    return true;
}

function display_onelink(which_link){
    if(which_link == 'Edu')
    {
        which_link = 'Education';
    }

    for(i=0;i<link_id.length;i++){
        if(which_link != link_id[i]){
            document.getElementById(link_id[i]).className = 'thide';
        }else{
            document.getElementById(link_id[i]).className = 'tshow';
        }
    }
}

function display_alllinks(){
    for(i=0;i<link_id.length;i++){
        document.getElementById(link_id[i]).className = 'tshow';
    }
}

function display_processing ()
{
    var target;
    var node_elt;
    target = 'p1';
    node_elt = document.getElementById(target);
    node_elt.className = 'tshow';
    document.forms[0].submit();
}

function doProcessing(){
    document.getElementById('submitButton').className = 'thide';
    document.getElementById('processing').className = 'tshow';
}


function checkDate(){
    if(document.forms[0].elements['DegreeStartMonth'].value > 0 && document.forms[0].elements['DegreeStartYear'].value > 0){
        display_processing();
    }
}

function popup(URL)
{
    newWindow=window.open(URL, '_capellapop','toolbar=no,width=570,height=500,directories=0,status=0,scrollbars=1,resizable=1,menubar=0,location=0,screenX=100,screenY=75,left=100,top=75,copyhistory=0');
}

function programChange() {
    document.forms[0].elements['progFlag'].value = 'Y';
    document.forms[0].submit();
}

function doProcessingform() {
	document.getElementById('formbuttonrow').className = 'thide';
	document.getElementById('processing').className = 'tshow';
} 


function specialisationOnChange() {
    var num = document.forms[0].elements['SpecializationSample'].value;
    if(num == '368' || num =='370' || num =='353' || num =='622')
    {
        alert('Thank you for your interest in Capella University. The specialization you have selected is for current K - 12 professionals interested in extending their education with a graduate degree. Please be aware that this specialization does not lead to initial teacher licensure.');
    }

}
function SPonChange()
{
    var country = document.form.SP.value.substring(0,2);

    if(country == "US")  {
        document.form.CN.value = "US";
    } else if(country == "CA"){
        document.form.CN.value = "CA";
    } else {
        document.form.CN.value = "--- Select One --";
    }
}
function CNonChange()
{
    if ( document.form.CN.value != "US" && document.form.CN.value != "CA" ) {
        document.form.SP.value = "Foreign Country";

    }
}



function showLayer(layerToShow) {
	var layerValue = layerToShow;
	var idArray = layerArray();
	for (var i = 0; i < idArray.length; i++) {
		var idTmp = idArray[i];
		if (layerValue == idTmp) {
			document.getElementById(idTmp).style.display = "block";
		} else {
			document.getElementById(idTmp).style.display = "none";
		}
	}
}
