var exitPopEnabled = true;

function setHeight(box1, box3) {
	var h2 = document.getElementById(box1).offsetHeight + 20;
	var mainsection_hg = document.getElementById('pagecopysection').offsetHeight;
	document.getElementById('mainsection').style.height = mainsection_hg + 30 + "px";
//	document.getElementById('footersection').style.top = 500 + 'px';
	document.getElementById(box3).style.height = h2 + "px";
}

function varyHeight(box1, box2, box3, box4, box5) {
	var h1 = document.getElementById(box1).offsetHeight + 50;
	var h2 = document.getElementById(box2).offsetHeight + 50;
	var h5 = document.getElementById(box5).offsetHeight + 20;	
	if(h1 > h2) {
		document.getElementById(box3).style.height = h1 + "px";
		document.getElementById(box4).style.top = h1 + h5 + 125 + "px";		
		
	} else {
		document.getElementById(box3).style.height = h2 + "px";
		document.getElementById(box4).style.top = h2 + h5 + 125 + "px";				
	}
}

function display_next () {
    var questionNumber = document.forms[0].question.value;

    if (questionNumber == "2") {
        switchText();
    }
	
   document.forms[0].submit();
}

function previous () {
    history.back();
}

function closePopUp () {
    window.close();
}

function openPopUp (pagename) {
	
    try {
    	popup_window.close();
    } catch(e) {
    }
    var height = 520; var win_width=640;
	if ( pagename.indexOf('aboutus') != -1 || pagename.indexOf('financialaid') != -1 || pagename.indexOf('career') != -1 )
		height = 350;
	var options = "scrollbars=yes, width=" + win_width + ", height=" + height;
	var win = window.open(pagename, 'popup', options);
	if (window.focus) { win.focus();}
	
}

function openNew (pagename) {
 
    try {
    	popup_window.close();
    } catch(e) {
    }
    var height = 600; var win_width=640;
	var options = "scrollbars=yes, width=" + win_width + ", height=" + height;
	var win = window.open(pagename, 'popup', options);
	if (window.focus) { win.focus();}
          
}

function switchText () {
    document.getElementById('text1').className='texthide';
	document.getElementById('text2').className='textshow';
}

function openPrograms () {
    window.open('programs.jsp', 'programs', 'scrollbars=yes, resizable=yes, width=622, height=550');
}

function doProcessing() 
{	
	exitPopEnabled=false;
	document.getElementById('submitBtn').className = 'texthide'; 
	document.getElementById('processing').className = 'statusProcessing';
	//document.forms[0].onchangesubmit.value = 'Onsubmit';
	document.forms[0].submit.value = 'Onsubmit';
}

function doProcessingform() 
{
	document.getElementById('submitBtn').className = 'texthide'; 
	document.getElementById('processing').className = 'statusProcessing';
	document.forms[0].onchangesubmit.value = 'Onsubmit';
	//document.forms[0].submit.value = 'Onsubmit';
}

function doProcessing1() 
{
	document.getElementById('submitBtn').className = 'texthide'; 
	document.getElementById('processing1').className = 'statusProcessing1';
	
}

function changecampus() {
	document.forms[0].onchangesubmit.value = 'Onchange';
	document.forms[0].submit();
}


function exitwindow(){
	if ( exitPopEnabled ){
		openPopUp('exitpopup.jsp');
	 }

 }

