function popupPreview(urltxt, wid, high)
{
    wid+=0;
    high+=0;
    var flagvar=0;

    try{
        confirmWin.close();
        confirmWin=window.open(urltxt, "kwu",
                "height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +
                "resizable=yes,status=no,toolbar=no,scrollbars=yes");
    }
    catch(e)
    {
        confirmWin=window.open(urltxt, "kwu",
                "height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +
                "resizable=yes,status=no,toolbar=no,scrollbars=yes");
    }
    if (window.confirmWin)
    {
        if (window.focus)
        {
            if ((navigator.appName.indexOf("Microsoft Internet Explorer")!=-1)
                    &&
                (navigator.appVersion.indexOf("4.") != -1)
                    &&
                (parent.length>0))
            {
                window.confirmWin.close();
                flagvar=1;
                timevar = setTimeout("openit(urltxt)", 300);
            }
            else
            {
                confirmWin.focus();
            }
        }
        else
        {
            if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1)  // If this is a MSIE Browser
            {
                if (navigator.appVersion.indexOf("3.") != -1)  // MSIE 3.x
                {
                    if (isLoaded == true)
                    {
                        alert("If the large image does not pop up, press the 'Product Close-up' tab in your task bar, or locate the image browser behind your open window." );
                        return;
                    }
                    else
                    {
                        alert("If the Site Menu bar does not pop up, press the 'Product Close-up' tab in your task bar, or locate the image browser behind your open window." );
                        return;
                    }
                }
            }
        }
    }
    else
    {
        confirmWin = window.open(urltxt, "kwu",
                "height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +
                "resizeable=no,status=no,toolbar=no");
        var isLoaded = true;
    }

    // This is important for Netscape 2.0 to enable the opener property
    if (flagvar!=1)
    {
        if (confirmWin.opener == null)
        {
            confirmWin.opener = self;
        }
    }
    wid=0;
    high=0;
}

var window_id = [0,0,1];
var tnode = [0,1,2];
var tnode_status = [0,0];
var num_windows = 2;
var process = "";

function display_window (which_window)
{
    var i;
    var target;
    var node_elt;
    for(i=1; i<=2; i++) {
        target = 't' + tnode[i];
        node_elt = document.getElementById(target);
        if (window_id[i] == which_window) {
            node_elt.className = 'tshow';
        } else {
            node_elt.className = 'thide';
        }
    }
}
function display_processing ()
{
	document.forms[0].submit();
}
/* adjust height */
function setHeight(outerBox1, outerBox2, outerBox3, outerBox4, innerBox, incrementH) {

    var newH = document.getElementById(innerBox).offsetHeight + incrementH;
    document.getElementById(outerBox1).style.height = newH +"px";
    document.getElementById(outerBox2).style.height = newH +"px";
    document.getElementById(outerBox4).style.height =newH +"px";
    document.getElementById(outerBox3).style.top =  newH +"px";
}
function nextQuestion()
{
    document.form.submit();
    return false;
}
function doProcessing() {
	if(null!= document.forms[0].elements['formSubmitted']){
		document.forms[0].elements['formSubmitted'].value = 'Y';
	}
    document.getElementById('submitButton1').className = 'thide';
    document.getElementById('processing').className = 'tshow';

}
            
function preSetHeight(){
    var temp1 = -10;
    var checktop = 40;
    document.getElementById('formrow2').style.top =  temp1 +"px";
    document.getElementById('checkMe').style.top =  checktop +"px";
}
 
function changeFormProgram() {/*
    var a1 = document.forms[0].ProgramOfInterest.options[document.forms[0].ProgramOfInterest.selectedIndex].value;

    var a2 = document.getElementById('P1').value;

    document.getElementById('teach').className='thide';
    document.getElementById('licence').className='thide';
    document.getElementById('NursingDiploma').className='thide';
	document.getElementById('PreRequirmentQues').className='thide';
    document.getElementById('Age').className='thide';

    var temp1 = -10;
    var checktop = -40;
    document.getElementById('formrow2').style.top =  temp1 +"px";
    document.getElementById('checkMe').style.top =  checktop +"px";

    if (a1 == "NURSING.GEN.INTERES2" && (a2 == "High School Diploma" || a2 == 'Some college 0-23 credits' || a2 == 'Some college 35-59 credits') ) {
	    document.getElementById('licence').className='tshow';
        document.getElementById('NursingDiploma').className='tshow';
    } else if (a1 == "248_WALDENESALTL_DOCT" || a1 == "248_WALDENESTL_DOCT" || a1 == "248_WALDENESET_DOCT" || a1 == "M.E.GN" || a1 == "EDD.W1EDU.EDU.W1TL" || a1 == "PHD.W1EDU.EDU.W1GN" || a1 == "MAT.W1EDU.EDU.W1EBD" || a1 == "TPP.W1EDU.EDU.W1EBD") {
        document.getElementById('teach').className='tshow';
    } else if(a1 == "NURSING.GEN.INTERES2" || a1 == "NURSING.GEN.INTEREST"  || a1 == "CRT.W1NUR.NUR.W1EDUC" ) {
        document.getElementById('licence').className='tshow';
    } else if(a1 == "MS.W1EGR.SYS.W1GEN" || a1 == "MS.W1EGR.SOF.W1GEN" || a1 == "MS.W1EGR.SYS.W1DEN" || a1 == "MS.W1EGR.CE" || a1 == "MS.W1EGR.CS" || a1 == "MS.W1EGR.EE" || a1 == "MS.W1EGR.SE" || a1 == "MS.W1EGR.SY") {
	    var temp1 = -22;
	    var checktop = -50;
	    document.getElementById('formrow2').style.top =  temp1 +"px";
	    document.getElementById('checkMe').style.top =  checktop +"px";
	    document.getElementById('PreRequirmentQues').className='tshow';
    } else if(	a1 == "248_WALDENBSC_BACH" 
    			|| a1 == "248_WALDENBSCJ_BACH" 
    			|| a1 == "248_WALDENBSIDT_BACH" 
    			|| a1 == "248_WALDENBSIDS_BACH" 
   	        	|| a1 == "248_WALDENBSBAS_BACH" 
	        	|| a1 == "248_WALDENBSHS_BACH" 
    			|| a1 == "BS.W1DUS.BA.W1GN" 
    			|| a1 == "BS.W1MGT.BA.W1GN" 
    			|| a1 == "BS.W1DUS.CD.W1ITD" 
    			|| a1 == "BS.W1DUS.CD.W1PS" 
    			|| a1 == "BS.W1DUS.CD.W1PST" 
    			|| a1 == "BS.W1DUS.CIS.W1ISS" 
    			|| a1 == "BS.W1DUS.PSY.W1PAEL" 
    			|| a1 == "BS.W1DUS.PSY.W1PAHP" 
    			|| a1 == "BS.W1DUS.PSY.W1PAW" 
    			|| a1 == "BS.W1DUS.PSY.W1PGS") {
        document.getElementById('Age').className='tshow';
    } else if(a1 == "248_WALDENBSN_BACH") { // B.S. in Nursing (BSN)
        document.getElementById('Age').className='tshow';
        document.getElementById('licence').className='tshow';
    }
*/
	if(null!= document.forms[0].elements['formSubmitted']){
		document.forms[0].elements['formSubmitted'].value = 'N';
	}
	 document.forms[0].submit();	
}
/*
function changeFormQuestion() {

    var a2 = document.forms[0].PrerequirementsMet[1].checked;

    document.getElementById('teach').className='thide';
    document.getElementById('licence').className='thide';
    document.getElementById('NursingDiploma').className='thide';
	//document.getElementById('PreRequirmentQues').className='thide';
    var temp1 = 10;
    var checktop = -42;
    document.getElementById('formrow2').style.top =  temp1 +"px";
    document.getElementById('checkMe').style.top =  checktop +"px";
   	document.getElementById('PreRequirmentQues').className='tshow'; 
   	var temp1 = -22;
	var checktop = -35;
    document.getElementById('formrow2').style.top =  temp1 +"px";
    document.getElementById('checkMe').style.top =  checktop +"px"; 
    if(a2 == true) {
	
		document.getElementById('teach').className='thide';
        //document.getElementById('PreviouslyEnrolledQues').className='tshow';
        document.getElementById('NursingDiploma').className='thide';
		document.getElementById('licence').className='thide';
    }
}

*/
//change the state to blank if country is not US or Canada

function CNonChange()
{
    if ( document.form.CN.value != "US" && document.form.CN.value != "CA" ) {
        document.form.SP.value = "ZZZZ";
    }
}

// change the state to match the country
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 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');
}


