
function calculateIndexCssProperties() { 

  // div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight;
  var formHeight = document.getElementById("formarea").offsetHeight;
  var campusLocHeight = document.getElementById("copyFooter").offsetHeight;
  var mainRegionHeight = copyHeight > formHeight ? copyHeight : formHeight;
  var extraHeight = 10;

  // Position top and height attribute for copy and form 
  document.getElementById("copy").style.top=headerHeight;
  document.getElementById("copy").style.height=mainRegionHeight+extraHeight;
  document.getElementById("formarea").style.top=headerHeight;
  document.getElementById("formarea").style.height=mainRegionHeight+campusLocHeight;

  // Position campus location region
  document.getElementById("copyFooter").style.top=headerHeight+mainRegionHeight+extraHeight -10;

  // Position Footer
  document.getElementById("footerLinks").style.top=headerHeight+mainRegionHeight+campusLocHeight;
  document.getElementById("copyright").style.top=headerHeight+mainRegionHeight+campusLocHeight;

  // Position Right copy spacer
  document.getElementById("rightSpacer").style.top=headerHeight +1;
  document.getElementById("rightSpacer").style.height=mainRegionHeight+extraHeight;
  document.getElementById("copyFooterRight").style.top=headerHeight+mainRegionHeight+extraHeight-1;

  // Position form border
  //document.getElementById("formHeader").style.top=headerHeight;
  //document.getElementById("formLeft").style.top=headerHeight + 18;
  //document.getElementById("formLeft").style.height=mainRegionHeight+campusLocHeight - 33;
  //document.getElementById("formRight").style.top=headerHeight+ 20;
  //document.getElementById("formRight").style.height=mainRegionHeight+campusLocHeight - 40;
  document.getElementById("formFooter").style.top=headerHeight+mainRegionHeight+campusLocHeight-30;

}

function calculatePreformCssProperties() { 

  // div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight;
  var formHeight = document.getElementById("formarea").offsetHeight;
  var campusLocHeight = document.getElementById("copyFooter").offsetHeight;
  var mainRegionHeight = copyHeight > formHeight ? copyHeight : formHeight;
  var extraHeight = 10;

  // Position top and height attribute for copy and form
  document.getElementById("copy").style.top=headerHeight;
  document.getElementById("copy").style.height=mainRegionHeight+extraHeight;
  document.getElementById("formarea").style.top=headerHeight+1;
  document.getElementById("formarea").style.height=mainRegionHeight+campusLocHeight;

  // Position campus location region
  document.getElementById("copyFooter").style.top=headerHeight+mainRegionHeight+extraHeight -10;

  // Position Footer
  document.getElementById("footerLinks").style.top=headerHeight+mainRegionHeight+campusLocHeight;
  document.getElementById("copyright").style.top=headerHeight+mainRegionHeight+campusLocHeight;

  // Position Right copy spacer
  document.getElementById("rightSpacer").style.top=headerHeight;
  document.getElementById("rightSpacer").style.height=mainRegionHeight+extraHeight;
  document.getElementById("copyFooterRight").style.top=headerHeight+mainRegionHeight+extraHeight;

  // Position form border
//  document.getElementById("formHeader").style.top=headerHeight;
//  document.getElementById("formLeft").style.top=headerHeight + 18;
 // document.getElementById("formLeft").style.height=mainRegionHeight+campusLocHeight - 33;
 // document.getElementById("formRight").style.top=headerHeight+ 20;
 // document.getElementById("formRight").style.height=mainRegionHeight+campusLocHeight - 40;
  document.getElementById("formFooter").style.top=headerHeight+mainRegionHeight+campusLocHeight-30;
 // document.getElementById("footertext").style.top=headerHeight+mainRegionHeight+campusLocHeight+45;	
}




function calculateIndexImgBrdrCssProperties() { 

  // Retrieve region div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var formHeight = document.getElementById("formImg").offsetHeight;
  var campusLocHeight = document.getElementById("copyFooter").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight + campusLocHeight;
  var mainRegionHeight = copyHeight > formHeight ? copyHeight : formHeight;

  // Position top and height attribute for copy and form
  document.getElementById("copy").style.top=headerHeight;
  document.getElementById("copy").style.height=mainRegionHeight-campusLocHeight;
  document.getElementById("formImg").style.top=headerHeight+1;
  document.getElementById("formImg").style.height=mainRegionHeight;

  // Position campus location region
  document.getElementById("copyFooter").style.top=headerHeight+mainRegionHeight-campusLocHeight;

  // Position Footer
  document.getElementById("footerLinks").style.top=headerHeight+mainRegionHeight;
  document.getElementById("copyright").style.top=headerHeight+mainRegionHeight;

  // Position Right copy spacer
  document.getElementById("rightSpacer").style.top=headerHeight;
  document.getElementById("rightSpacer").style.height=mainRegionHeight-campusLocHeight;
  document.getElementById("copyFooterRight").style.top=headerHeight+mainRegionHeight-campusLocHeight;

  // Position form border
  document.getElementById("formImgHeader").style.top=headerHeight;
  document.getElementById("formImgLeft").style.top=headerHeight+20;
  document.getElementById("formImgLeft").style.height=mainRegionHeight;
  document.getElementById("formImgRight").style.top=headerHeight+20;
  document.getElementById("formImgRight").style.height=mainRegionHeight;
  document.getElementById("formImgFooter").style.top=headerHeight+mainRegionHeight-19;

}

function calculateNonFormCssProperties() {

 	var headerHeight = document.getElementById("header").offsetHeight;
	var copyHeight = document.getElementById("nonFormCopy").offsetHeight;

	document.getElementById("nonFormCopy").style.top=headerHeight;
	document.getElementById("nonFormFooter").style.top=headerHeight+copyHeight;
	document.getElementById("footerLinks").style.top=headerHeight+copyHeight+98;
    	document.getElementById("copyright").style.top=headerHeight+copyHeight+98;
    
} 

function calculatePopPrgCssProperties() { 

    var maximumHeight = calculateHeight();
    leftHeight = document.getElementById("popupLeftCopy").offsetHeight;
    rightHeight = document.getElementById("popupMainCopy").offsetHeight;

    if ( maximumHeight > leftHeight && maximumHeight > rightHeight ) {
        document.getElementById("popupLeftCopy").style.height=maximumHeight - 8;
        document.getElementById("popupMainCopy").style.height=maximumHeight - 8;
        document.getElementById("popupFooter").style.top=maximumHeight+127;

    } else if(leftHeight < rightHeight) {
       document.getElementById("popupLeftCopy").style.height=document.getElementById("popupMainCopy").offsetHeight  - 8;
       document.getElementById("popupFooter").style.top=document.getElementById("popupMainCopy").offsetHeight+127;
    } else {
        document.getElementById("popupMainCopy").style.height=document.getElementById("popupLeftCopy").offsetHeight - 3;
        document.getElementById("popupFooter").style.top=document.getElementById("popupLeftCopy").offsetHeight+80;
    }

    document.getElementById("popUpRightSpacer").style.height=document.getElementById("popupMainCopy").offsetHeight +3;

} 

function calculatePopupCampCssProperties() { 

    document.getElementById("popupCampContainer").style.height=document.getElementById("regPopUpHeader").offsetHeight +document.getElementById("regPopTitle").offsetHeight+document.getElementById("regPopCopyCamp").offsetHeight+document.getElementById("regPopFtrcampus").offsetHeight+5;

} 

function calculatePopupCssProperties() { 

    document.getElementById("popupContainer").style.height=document.getElementById("regPopUpHeader").offsetHeight +document.getElementById("regPopTitle").offsetHeight+document.getElementById("regPopCopy").offsetHeight+document.getElementById("regPopFtr").offsetHeight+10;
	

} 


function openWin(page,win_width,win_height) {

    try {
    	popup_window.close();
    } catch(e) {
					
    }

    if ( page.indexOf("mailto") == -1 ) {
    	var options = "scrollbars=yes, width=" + win_width + ", height=" + win_height;
    	var win = window.open(page, 'MyWin', options);
    	if (window.focus) { win.focus() }
    }
}

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.visibility='visible';
                  } else {
                      document.getElementById( idTmp ).style.visibility='hidden';
                  }
              }

              

}

function calculateHeight() {

            var maxHeight = 0;

          //  var idArray_ = layerArray();

           //   for ( var i=0; i<idArray_.length; i++ ) {

           //       var divId = idArray_[i];
          //        var divIdHeight = document.getElementById( divId ).offsetHeight;

          //        if ( divIdHeight > maxHeight ) {

          //            maxHeight = divIdHeight + 20;

         //         }
                   

         //     }

       //       return maxHeight;
              

}

function doProcessing() {
  document.getElementById('submitBtn').className = 'thide'; 	
  document.getElementById('processing').className = 'tshow';
}
function STonChange() {
		document.forms[0].elements['stateChangeFlag'].value = 'Y';
		//document.forms[0].elements['MilitaryInstallation'].value = '--- Select One --';
		document.forms[0].submit();		
	}
function MSTonChange() {
		var year = document.forms[0].elements['MilitarySeparationYear'].value;	
		document.forms[0].elements['stateChangeFlag'].value = 'Y';

		document.forms[0].elements['MilitaryInstallation'].value = '--- Select One ---';

		document.forms[0].elements['MilitarySeparationYear'].value = year;
		document.forms[0].submit();
	}	
	
	
	
function NOTonChange() {
		//document.forms[0].elements['stateChangeFlag'].value = 'Y';
		document.forms[0].elements['MilitaryInstallation'].value = '--- Select One --';
		document.forms[0].submit();		
	}

	
function CityonChange() {
		document.forms[0].elements['cityChangeFlag'].value = 'Y';
		document.forms[0].elements['HighSchoolAttended'].value = '--- Select One ---';
		document.forms[0].submit();		
	}

function InstallationChange() {
	if(document.forms[0].elements['MilitaryInstallation'].value == 'ZzZZOther')
	{
	  document.getElementById('installation').className = 'tshow';
	  document.forms[0].elements['isOtherVisible'].value = 'true';
	}
	else
	{
	  document.getElementById('installation').className = 'thide';
	  document.forms[0].elements['isOtherVisible'].value = 'false';	
	} 
} 

function SchoolChange() {
	if(document.forms[0].elements['HighSchoolAttended'].value == 'ZzZZOther')
	{
	  document.getElementById('school').className = 'tshow';
	  document.forms[0].elements['isCommentsVisible'].value = 'true';
	}
	else
	{
	  document.getElementById('school').className = 'thide';
	  document.forms[0].elements['isCommentsVisible'].value = 'false';	
	} 
} 

	
function calculatePostqualCssProperties() { 

  // div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight;
  var formHeight = document.getElementById("formarea").offsetHeight;
  var campusLocHeight = document.getElementById("copyFooter").offsetHeight;
  var mainRegionHeight = copyHeight > formHeight ? copyHeight : formHeight;
  var extraHeight = 10;

  // Position top and height attribute for copy and form
  document.getElementById("copy").style.top=headerHeight;
  document.getElementById("copy").style.height=mainRegionHeight+extraHeight+247;
  document.getElementById("formarea").style.top=headerHeight+1;
  document.getElementById("formarea").style.height=mainRegionHeight+campusLocHeight+209;

  // Position campus location region
  document.getElementById("copyFooter").style.top=headerHeight+mainRegionHeight+extraHeight;

  // Position Footer
  document.getElementById("footerLinks").style.top=headerHeight+mainRegionHeight+campusLocHeight+174;
  document.getElementById("copyright").style.top=headerHeight+mainRegionHeight+campusLocHeight+174;

  // Position Right copy spacer
  document.getElementById("rightSpacer").style.top=headerHeight;
  document.getElementById("rightSpacer").style.height=mainRegionHeight+extraHeight+247;
  document.getElementById("copyFooterRight").style.top=headerHeight+mainRegionHeight+extraHeight;

  // Position form border
 // document.getElementById("formHeader").style.top=headerHeight;
  //document.getElementById("formLeft").style.top=headerHeight + 18;
  //document.getElementById("formLeft").style.height=mainRegionHeight+campusLocHeight - 33;
  //document.getElementById("formRight").style.top=headerHeight+ 20;
  //document.getElementById("formRight").style.height=mainRegionHeight+campusLocHeight - 30;
  document.getElementById("formFooter").style.top=headerHeight+mainRegionHeight+campusLocHeight-20;
  //document.getElementById("footertext").style.top=headerHeight+mainRegionHeight+campusLocHeight+45;
document.getElementById("postqualContent").style.height=630;
}
function doProcessingPost() {
  document.forms[0].elements['submitvalue'].value = 'true';
  document.getElementById('submitBtn').className = 'thide'; 	
  document.getElementById('processing').className = 'tshow';
}
		
		
function calculateFormCssProperties() { 

  // div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight;
  var formHeight = document.getElementById("formarea").offsetHeight;
  var campusLocHeight = document.getElementById("copyFooter").offsetHeight;
  var mainRegionHeight = copyHeight > formHeight ? copyHeight : formHeight;
  var extraHeight = 10;

  // Position top and height attribute for copy and form
  document.getElementById("copy").style.top=headerHeight;
  document.getElementById("copy").style.height=mainRegionHeight+extraHeight;
  document.getElementById("formarea").style.top=headerHeight+1;
  document.getElementById("formarea").style.height=mainRegionHeight+campusLocHeight;
  document.getElementById("formContentform1").style.height=mainRegionHeight+campusLocHeight - 65;

  // Position campus location region
  document.getElementById("copyFooter").style.top=headerHeight+mainRegionHeight+extraHeight -10;

  // Position Footer
  document.getElementById("footerLinks").style.top=headerHeight+mainRegionHeight+campusLocHeight;
  document.getElementById("copyright").style.top=headerHeight+mainRegionHeight+campusLocHeight;

  // Position Right copy spacer
  document.getElementById("rightSpacer").style.top=headerHeight;
  document.getElementById("rightSpacer").style.height=mainRegionHeight+extraHeight;
  document.getElementById("copyFooterRight").style.top=headerHeight+mainRegionHeight+extraHeight;

  // Position form border
  //document.getElementById("formHeader").style.top=headerHeight;
  //document.getElementById("formLeft").style.top=headerHeight + 18;
  //document.getElementById("formLeft").style.height=mainRegionHeight+campusLocHeight - 33;
  //document.getElementById("formRight").style.top=headerHeight+ 20; 
  //document.getElementById("formRight").style.height=mainRegionHeight+campusLocHeight - 40;
  document.getElementById("formFooter").style.top=headerHeight+mainRegionHeight+campusLocHeight-30;
  //document.getElementById("footertext").style.top=headerHeight+mainRegionHeight+campusLocHeight+45;	
}
		