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

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=no,status=no,toolbar=no,scrollbars=yes");
      }
      catch(e)
      {
            confirmWin=window.open(urltxt, "kwu",
                         "height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +
                         "resizable=no,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;
}

// 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.CN.value != "MX")
    {
	  document.form.SP.value="ZOutside 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 openWin(page, name, details)
      {
		newWin = window.open(page, name, details);
		if (window.focus) { newWin.focus() }
	  }
	
	function openWinLandL(page, name, details)
      {
		newWin = window.open(page, name, "status=no,toolbar=no,scrollbars=yes");
		if (window.focus) { newWin.focus() }
	  }
	
	function updatePrograms()
    {
		document.forms[0].elements['campusChangeFlag'].value = 'Y';
		document.forms[0].submit();
	}
	function popUp(URL, width, height)
    {
	 try {
		  popup_window.close();
	     } catch(e){}
	   popup_window = window.open(URL, "_popover", "status=yes,location=yes,menubar=yes,toolbar=yes,directories=no,resizable=no,scrollbars=yes,width=" + width + ",height=" + height + ",screenX=100,screenY=100");
	   window.onerror = null;
}

function EveryFormLoad()
    {
        /*Function call to respective functions*/
       PROGonChange();
       calculateCssPropertiesfortab();
    }


/* Code to display Program specific questions for 'FRM' Program */
 function PROGonChange()
    {
	 
	 if(document.getElementById("formtab") != null)
     {
       document.getElementById("formbody").style.height = document.getElementById("formbodyarea").offsetHeight +5 + "px" ;
       document.getElementById("form_bot_grey").style.top = document.getElementById("formbodyarea").offsetHeight +68 + "px" ; 
     }
            if ( document.form.ProgramOfInterest.value != "ASSOCIATE" && document.form.ProgramOfInterest.value != "BACHELOR" && document.form.ProgramOfInterest.value != "DIPLOMA" && document.form.ProgramOfInterest.value != "MASTER")
            {
                if( document.form.ProgramOfInterest.value == "FRM" )
                 {
                     //document.getElementById("formbodyarea").style.height = document.getElementById("formtab").offsetHeight + 160 +"px";

                     document.getElementById("qHSGPA").className='show';
                     document.getElementById("aHSGPA").className='show';
                     if(document.getElementById("errHSGPA") != null)document.getElementById("errHSGPA").className='show';
                     document.getElementById("qCA").className='show';
                     document.getElementById("aCA").className='show';
                     if(document.getElementById("errHSGPA") != null)document.getElementById("errCA").className='show';
                 }
                else{
                     //document.getElementById("formbodyarea").style.height = document.getElementById("formtab").offsetHeight + 60 +"px";

                     document.getElementById("qHSGPA").className='thide';
                     document.getElementById("aHSGPA").className='thide';
                     if(document.getElementById("errHSGPA") != null) document.getElementById("errHSGPA").className='thide';
                     document.getElementById("qCA").className='thide';
                     document.getElementById("aCA").className='thide';
                     if(document.getElementById("errCA") != null) document.getElementById("errCA").className='thide';
                    }
                /* Call to javascript function calculateCssPropertiesfortab() to realign the page on changing the program from 'FRM to other and vice-versa'*/
                calculateCssPropertiesfortab();
            }         
    }

    /*for dynamically changing the width of page on formload*/
   function calculateCssPropertiesfortab()
    {
      if(document.getElementById("formsubtab") != null)
       {
        document.getElementById("formbody").style.height = document.getElementById("formbodyarea").offsetHeight +4 + "px" ;
        document.getElementById("form_bot_grey").style.top = document.getElementById("formbodyarea").offsetHeight +67 + "px" ;
        document.getElementById("formmid").style.height = document.getElementById("formbodyarea").offsetHeight +150 + "px" ;
        document.getElementById("formbottom").style.top = document.getElementById("formbodyarea").offsetHeight +280 + "px" ;
        document.getElementById("formfooter").style.top = document.getElementById("formbodyarea").offsetHeight +300 + "px" ;
        document.getElementById("formcontainer").style.height = document.getElementById("formbodyarea").offsetHeight +350 +"px" ;
       }
    }
	
function EveryFormLoad5()
    {
        /*Function call to respective functions*/
       PROGonChange5();
       calculateCssPropertiesfortab5();
    }
	
function PROGonChange5()
    {
            if ( document.form.ProgramOfInterest.value != "ASSOCIATE" && document.form.ProgramOfInterest.value != "BACHELOR" && document.form.ProgramOfInterest.value != "DIPLOMA" && document.form.ProgramOfInterest.value != "MASTER")
            {
                if( document.form.ProgramOfInterest.value == "FRM" )
                 {
                     document.getElementById("formbodyarea").style.height = document.getElementById("formtab").offsetHeight + 160 +"px";

                     document.getElementById("qHSGPA").className='show';
                     document.getElementById("aHSGPA").className='show';
                     if(document.getElementById("errHSGPA") != null)document.getElementById("errHSGPA").className='show';
                     document.getElementById("qCA").className='show';
                     document.getElementById("aCA").className='show';
                     if(document.getElementById("errHSGPA") != null)document.getElementById("errCA").className='show';
                 }
                else{
                     zdocument.getElementById("formbodyarea").style.height = document.getElementById("formtab").offsetHeight + 60 +"px";

                     document.getElementById("qHSGPA").className='thide';
                     document.getElementById("aHSGPA").className='thide';
                     if(document.getElementById("errHSGPA") != null) document.getElementById("errHSGPA").className='thide';
                     document.getElementById("qCA").className='thide';
                     document.getElementById("aCA").className='thide';
                     if(document.getElementById("errCA") != null) document.getElementById("errCA").className='thide';
                    }
                /* Call to javascript function calculateCssPropertiesfortab() to realign the page on changing the program from 'FRM to other and vice-versa'*/
                calculateCssPropertiesfortab5();
				return true;
            }         
    }

    /*for dynamically changing the width of page on formload*/
   function calculateCssPropertiesfortab5()
    {
	 	
      if(document.getElementById("formsubtab") != null)
       {
	    
        document.getElementById("formbody").style.height = document.getElementById("formbodyarea").offsetHeight +4 + "px" ;
        document.getElementById("form_bot_grey").style.top = document.getElementById("formbodyarea").offsetHeight +67 + "px" ;
        document.getElementById("formmid").style.height = document.getElementById("formbodyarea").offsetHeight +150 + "px" ;
        document.getElementById("formbottom").style.top = document.getElementById("formbodyarea").offsetHeight +280 + "px" ;
        document.getElementById("formfooter").style.top = document.getElementById("formbodyarea").offsetHeight +300 + "px" ;
        document.getElementById("formcontainer").style.height = document.getElementById("formbodyarea").offsetHeight +350 + 123+"px" ;
		
       }
    }


  /*for dynamically changing the width of page on prequalload*/
   function calcPreqCssProperties()
      {
        if(document.getElementById("pretab") != null)
          {
            document.getElementById("prebody").style.height = document.getElementById("prebodyarea").offsetHeight +18 + "px" ;
            document.getElementById("pre_bot_grey").style.top = document.getElementById("prebodyarea").offsetHeight +67 + "px" ; 
          }
      }
   
   
   
   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";
			}
		}
	}
