
function calculateIndexCssProperties() { 

  // div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight+98;
  var formHeight = document.getElementById("formSection").offsetHeight;
  var campusLocHeight = document.getElementById("copyFooter").offsetHeight;
  var mainRegionHeight = copyHeight > formHeight ? copyHeight : formHeight;
  var extraHeight = 4;

  // 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("formSection").style.height=mainRegionHeight+extraHeight;
  document.getElementById("formarea").style.height=mainRegionHeight;

  // Position campus location region
  document.getElementById("copyFooter").style.top=headerHeight+mainRegionHeight+extraHeight-98;

  // Position Footer
  //document.getElementById("footerLinks").style.top=headerHeight+mainRegionHeight+campusLocHeight;
 

  // Position Right copy spacer
  //document.getElementById("rightSpacer").style.top=headerHeight;
  document.getElementById("rightSpacer").style.height=mainRegionHeight+extraHeight;

  // Position form border
  //document.getElementById("formHeader").style.top=headerHeight;
  //document.getElementById("formLeft").style.top=headerHeight;
  //document.getElementById("formLeft").style.height=mainRegionHeight+campusLocHeight;
  //document.getElementById("formRight").style.top=headerHeight;
  //document.getElementById("formRight").style.height=mainRegionHeight+campusLocHeight;
  //document.getElementById("formFooter").style.top=headerHeight+mainRegionHeight+campusLocHeight-1;

}

function calculatePrequalImgBrdrCssProperties(){
      // div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight+98;
  var formHeight = document.getElementById("formSection").offsetHeight;
  var campusLocHeight = document.getElementById("copyFooter").offsetHeight;
  var mainRegionHeight = copyHeight > formHeight ? copyHeight : formHeight;
  var extraHeight = 4;

  // 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("formSection").style.height=mainRegionHeight+extraHeight;
  document.getElementById("formarea").style.height=mainRegionHeight;

  // Position campus location region
  document.getElementById("copyFooter").style.top=headerHeight+mainRegionHeight+extraHeight-98;

  // Position Footer
  //document.getElementById("footerLinks").style.top=headerHeight+mainRegionHeight+campusLocHeight;


  // Position Right copy spacer
  //document.getElementById("rightSpacer").style.top=headerHeight;
  document.getElementById("rightSpacer").style.height=mainRegionHeight+extraHeight;

  // Position form border
  //document.getElementById("formHeader").style.top=headerHeight;
  //document.getElementById("formLeft").style.top=headerHeight;
  //document.getElementById("formLeft").style.height=mainRegionHeight+campusLocHeight;
  //document.getElementById("formRight").style.top=headerHeight;
  //document.getElementById("formRight").style.height=mainRegionHeight+campusLocHeight;
  //document.getElementById("formFooter").style.top=headerHeight+mainRegionHeight+campusLocHeight-1;
}

function calculateFormImgBrdrCssProperties(pageid) {

  // Retrieve region div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var formHeight = document.getElementById("formImg1").offsetHeight+70;
  //var campusLocHeight = document.getElementById("copyFooter1").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight ;
  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;
  //document.getElementById("formImg").style.top=headerHeight+1;
  //document.getElementById("formImg").style.height=mainRegionHeight;

 

  // Position Footer
  //document.getElementById("footerLinks").style.top=headerHeight+mainRegionHeight;
  

  // Position Right copy spacer
//  document.getElementById("rightSpacer").style.top=headerHeight;
//  document.getElementById("rightSpacer").style.height=mainRegionHeight-campusLocHeight;
 

  // Position form border
//  document.getElementById("formImgHeader").style.top=headerHeight;
//  document.getElementById("formImgLeft").style.top=headerHeight+20;
    document.getElementById("formImgLeft").style.height=mainRegionHeight-58;
//  document.getElementById("formImgRight").style.top=headerHeight+20;
    document.getElementById("formImgRight").style.height=mainRegionHeight-58;
  //document.getElementById("formImgFooter").style.top=headerHeight+mainRegionHeight-19;
  

}

function calculateIndexImgBrdrCssProperties(pageid) {

  // Retrieve region div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var formHeight = document.getElementById("formImg").offsetHeight+10;
  //var campusLocHeight = document.getElementById("copyFooter").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight;
  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+10;
  //document.getElementById("formImg").style.top=headerHeight+1;
 document.getElementById("formImg").style.height=mainRegionHeight;
 document.getElementById("copyFooter").style.top=mainRegionHeight+ headerHeight ;
  // Position campus location region
  //document.getElementById("copyFooter").style.top=headerHeight+mainRegionHeight-campusLocHeight;

  // Position Footer
  document.getElementById("footerLinks").style.top=headerHeight+mainRegionHeight+44//+42;

  // Position Right copy spacer
  //document.getElementById("rightSpacer").style.top=headerHeight;
  document.getElementById("rightSpacer").style.height=mainRegionHeight;
  document.getElementById("copyFooter").style.height=45;
   document.getElementById("formImgFooter").style.height=50;
  // Position form border
  //document.getElementById("indexImgHeader").style.top=headerHeight;
  //document.getElementById("formImgLeft").style.top=headerHeight+20;
  document.getElementById("formImgLeft").style.height=mainRegionHeight-30;
  //document.getElementById("formImgRight").style.top=headerHeight+20;
  document.getElementById("formImgRight").style.height=mainRegionHeight-30;
  document.getElementById("formImgFooter").style.top=headerHeight+mainRegionHeight-5;
  document.getElementById("copyFooterRight").style.height=mainRegionHeight+45;  
}


function calculatePostImgBrdrCssProperties(pageid) {


  // Retrieve region div heights
  var headerHeight = document.getElementById("header").offsetHeight;
  var formHeight = document.getElementById("formImg").offsetHeight+10;
  //var campusLocHeight = document.getElementById("copyFooter").offsetHeight;
  var copyHeight = document.getElementById("copy").offsetHeight;
  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+10;
  //document.getElementById("formImg").style.top=headerHeight+1;
 document.getElementById("formImg").style.height=mainRegionHeight;
 document.getElementById("copyFooter").style.top=mainRegionHeight+ headerHeight ;
  // Position campus location region
  //document.getElementById("copyFooter").style.top=headerHeight+mainRegionHeight-campusLocHeight;

  // Position Footer
  document.getElementById("footerLinks2").style.top=headerHeight+mainRegionHeight+26;

  // Position Right copy spacer
  //document.getElementById("rightSpacer").style.top=headerHeight;
  document.getElementById("rightSpacer").style.height=mainRegionHeight;
  document.getElementById("copyFooter").style.height=45;
   document.getElementById("formImgFooter").style.height=50;
  // Position form border
  //document.getElementById("indexImgHeader").style.top=headerHeight;
  //document.getElementById("formImgLeft").style.top=headerHeight+20;
  document.getElementById("formImgLeft").style.height=mainRegionHeight-30;
  //document.getElementById("formImgRight").style.top=headerHeight+20;
  document.getElementById("formImgRight").style.height=mainRegionHeight-30;
  document.getElementById("formImgFooter").style.top=headerHeight+mainRegionHeight-5;
  document.getElementById("copyFooterRight").style.height=mainRegionHeight+45;

}


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;
    	
    
} 

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;
        document.getElementById("popupMainCopy").style.height=maximumHeight;
        document.getElementById("popupFooter").style.top=maximumHeight+127;


    } else if(leftHeight < rightHeight) {

        document.getElementById("popupLeftCopy").style.height=document.getElementById("popupMainCopy").offsetHeight;
        document.getElementById("popupFooter").style.top=document.getElementById("popupMainCopy").offsetHeight+127;


    } else {

        document.getElementById("popupMainCopy").style.height=document.getElementById("popupLeftCopy").offsetHeight;
        document.getElementById("popupFooter").style.top=document.getElementById("popupLeftCopy").offsetHeight+127;

    }

    document.getElementById("popUpRightSpacer").style.height=document.getElementById("popupMainCopy").offsetHeight;
} 



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() {
	if(null!= document.forms[0].elements['submitFlag']){
		document.forms[0].elements['submitFlag'].value = 'Y';
		}	
     document.getElementById('submitBtn').className = 'thide';
     document.getElementById('processing').className = 'tshow';
}

function changeQuestionArea(){
    document.form.submitFlag.value= "N";
    document.form.submit();
    
}


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

// change the state to match the country
  function SPonChange()
    {
        
		var country = document.form.SP.value.substring(0,2);
        if(country == "UM")
          {
            document.form.CN.value = "US";
          }
        if(country == "US" || country == "CA" || country == "MX")
          {
            document.form.CN.value = country;
          }
        else
           {
            document.form.CN.value = "--- Select One ---";
           }
    }




  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";
			}
		}
	}

  
 function refreshPage(){
	 document.form.submit();
}
  
  
