  var Spanish=false  var txtMessage=""    function IsBlank(value)    {      if (value.length == 0) return true;      for (var i = 0; i <= value.length-1; i++) if (value.charAt(i) != " ") return false;      return true;      }    function IsNumeric(value)    {      //Make sure it's not Blank      if (!IsBlank(value))        {          //Look for Multiple Periods          var i = value.indexOf(".");          if (i!=-1) if (value.indexOf(".",i+1)!=-1) return false;          //Look for invalid characters          // 12/22/2003 (9/30/2004) - consider commas "," as valid          for (i=0; i<=value.length-1; i++)  if("0123456789.-,".indexOf(value.charAt(i))==-1) return false;          //It's Good          return true;        }      return false;    }    function RemoveCommas(value)	// function written 12/23/2003, modified version MTP October 2004  	{	var temp2 = "";      	var Done = false;      	var Max = value.length-1;      	for (var i=0; i<Max; i++)         	{          	if ((" 0".indexOf(value.charAt(i))==-1)||Done)             		{                		if("0123456789.-".indexOf(value.charAt(i))!=-1)				{				temp2 = temp2 + value.charAt(i);				}             		Done=true;            		}        	}      	temp2 = temp2 + value.charAt(Max);	value = temp2;        return value;	}    function IsNonNegative(value)    {      if (!IsNumeric(value)) return false;      if (parseFloat(value)>=0.0) return true;      return false;    }      function IsNonZero(value)    {      if (!IsNumeric(value)) return false;      if (parseFloat(value)==0) return false;      return true;    }      function IsPositive(value)    {      if (!IsNumeric(value)) return false;      if (parseFloat(value)>0.0) return true;      return false;    }  function ValidateCurrency(field)    {      var temp = "";      var temp2 = "";      var Done = false;      var Max = field.value.length-1;      for (var i=0; i<Max; i++)         {          if ((" 0".indexOf(field.value.charAt(i))==-1)||Done)             {                temp=temp+field.value.charAt(i);              Done=true;            }        }      temp = temp + field.value.charAt(Max);      if (IsNumeric(temp))         {          // At this point, call a function to removes commas, if they exist	  temp2 = RemoveCommas(temp);          field.value = FormatCurrency(parseInt(temp2));//Truncates !          return true;        }      else         {          if (Spanish) {          	txtMessage = "Por favor inserte una cantidad en D\u00F3lares en este espacio.";          }          else {          	txtMessage = "Please enter a Dollar amount for this field.";          }          alert(txtMessage);          //alert("Please enter a Dollar amount for this field.");          field.focus();          return false;        }    }    function ValidateInteger(field)    {      var temp = "";      var Done = false;      var Max = field.value.length-1;      for (var i=0; i<Max; i++)         {          if ((" 0".indexOf(field.value.charAt(i))==-1)||Done)             {                temp=temp+field.value.charAt(i);              Done=true;            }        }      temp = temp + field.value.charAt(Max);      if (IsNumeric(temp))         {          field.value = parseInt(temp);//Truncates !          return true;        }      else         {          if (Spanish) {          	txtMessage = "Por favor inserte un n\u00FAmero entero en este espacio.";          }          else {          	txtMessage = "Please enter a whole number for this field.";          }          alert(txtMessage);	  //alert("Please enter a whole number for this field.");          field.focus();          return false;        }    }  function EstimateTap(NTB, Tuition, Schedule, UpperCut)    {      // Validate the NTB, Tuition, and Schedule before calling this function !            var Award = 0;      var MinAward = 0;      var MaxAward = 1.00 * Tuition; // Increased from 95% for 2001-2002      var MaxAwardThreshold= 0;      var Reduction = 0;            if (DebugFlag)        {          alert("EstimateTap()\n\nNTB = "+NTB);          alert("EstimateTap()\n\nTuition = "+Tuition);          alert("EstimateTap()\n\nSchedule = "+Schedule);        }       if (Schedule=="-") return false;      if (Schedule=="A")// schedule A          {            MaxAwardThreshold = 3575;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold;            //New for 2000-2001, Calculate the MinAward Based on NTB            if (NTB<=80000) MinAward = 500;		//Per 2002-03 buget MinAward=500 if NTB <= 80000            //else if (NTB<=70000) MinAward = 325;	//no longer applies as of 2002-03 buget            //else if (NTB<=80000) MinAward = 275;	//no longer applies as of 2002-03 buget            //Calculate the Reduction            if (NTB<=7000) Reduction = 0;			else if (NTB<=11000) Reduction = 0.07*(NTB-7000);			else if (NTB<=18000) Reduction = 280+0.10*(NTB-11000);			else if (NTB<=80000) Reduction = 980+0.12*(NTB-18000); // Increased for 2000-2001			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="B")// schedule B - No longer used for 2000-2001          {            MaxAwardThreshold = 3575;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 100;            if (NTB<=7000) Reduction = 0;			else if (NTB<=11000) Reduction = 0.07*(NTB-7000);			else if (NTB<=18000) Reduction = 280+0.10*(NTB-11000);			else if (NTB<=42500) Reduction = 980+0.12*(NTB-18000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="C")// schedule C - No longer used for 2000-2001          {            MaxAwardThreshold = 3575;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 100;            if (NTB<=7000) Reduction = 0;			else if (NTB<=11000) Reduction = 0.07*(NTB-7000);			else if (NTB<=18000) Reduction = 280+0.10*(NTB-11000);			else if (NTB<=50500) Reduction = 980+0.12*(NTB-18000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="D")// schedule D          {            MaxAwardThreshold = 4125;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            //New for 2000-2001, Calculate the MinAward Based on NTB            if (NTB<=80000) MinAward = 500;		//Per 2002-03 buget MinAward=500 if NTB <= 80000            //else if (NTB<=70000) MinAward = 325;	//no longer applies as of 2002-03 buget            //else if (NTB<=80000) MinAward = 275;	//no longer applies as of 2002-03 buget            //Calculate the Reduction            if (NTB<=7000) Reduction = 0;			else if (NTB<=11000) Reduction = 0.07*(NTB-7000);			else if (NTB<=18000) Reduction = 280+0.10*(NTB-11000);			else if (NTB<=80000) Reduction = 980+0.12*(NTB-18000); // Increased from 50500 for 2000-2001			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }	  if (Schedule=="E")// schedule E, New for 2000-2001           {            MaxAwardThreshold = 5000;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            //Calculate the MinAward Based on NTB            if (NTB<=80000) MinAward = 500;		//Per 2002-03 buget MinAward=500 if NTB <= 80000            //else if (NTB<=70000) MinAward = 325;	//no longer applies as of 2002-03 buget            //else if (NTB<=80000) MinAward = 275;	//no longer applies as of 2002-03 buget            //Calculate the Reduction            if (NTB<=7000) Reduction = 0;			else if (NTB<=11000) Reduction = 0.07*(NTB-7000);			else if (NTB<=18000) Reduction = 280+0.10*(NTB-11000);			else if (NTB<=80000) Reduction = 980+0.12*(NTB-18000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="F")// schedule F          {            MaxAwardThreshold = 800;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 100;            if (NTB<=7000) Reduction = 0;			else if (NTB<=11000) Reduction = 0.07*(NTB-7000);			else if (NTB<=34250) Reduction = 280+0.10*(NTB-11000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="G")// schedule G          {            MaxAwardThreshold = 800;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 100;            if (NTB<=7000) Reduction = 0;			else if (NTB<=11000) Reduction = 0.07*(NTB-7000);			else if (NTB<=42500) Reduction = 280+0.10*(NTB-11000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="H")// schedule H          {            MaxAwardThreshold = 800;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 100;            if (NTB<=7000) Reduction = 0;			else if (NTB<=11000) Reduction = 0.07*(NTB-7000);			else if (NTB<=50500) Reduction = 280+0.10*(NTB-11000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="K")// schedule K          {            MaxAwardThreshold = 2450;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 500;  // Increased from 425 in 2001-02 budget            if (NTB<=3000) Reduction = 0;			else if (NTB<=10000) Reduction = 0.31*(NTB-3000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="L")// schedule L          {            MaxAwardThreshold = 2575;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 500; // Increased from 425 in 2001-02 budget            if (NTB<=3000) Reduction = 0;			else if (NTB<=10000) Reduction = 0.31*(NTB-3000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="M")// schedule M          {            MaxAwardThreshold = 3025;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 500; // Increased from 425 in 2001-02 budget            if (NTB<=3000) Reduction = 0;			else if (NTB<=10000) Reduction = 0.31*(NTB-3000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="P")// schedule P          {            MaxAwardThreshold = 640;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 100;            if (NTB<=3000) Reduction = 0;			else if (NTB<=10000) Reduction = 0.31*(NTB-3000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="U")// schedule U          {            MaxAwardThreshold = 550;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 75;            if (NTB<=2000) Reduction = 0;			else if (NTB<=20000) Reduction = 0.077*(NTB-2000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (Schedule=="V")// schedule V          {            MaxAwardThreshold = 550;            if (MaxAward > MaxAwardThreshold) MaxAward=MaxAwardThreshold            MinAward = 75;            if (NTB<=1000) Reduction = 0;			else if (NTB<=5666) Reduction = 0.26*(NTB-1000);			else // No Award			  {			    Reduction = MaxAward;			    MinAward = 0;			  }		  }      if (UpperCut==1 && (Schedule!="U" || Schedule!="V")) Reduction = Reduction + 100;  //Only applies to UnderGrads & was Reduced from 150 for 2001-2002      Award=MaxAward-Reduction;      if (Award < MinAward) Award=MinAward;      if (Award > MaxAward) Award=MaxAward;      if (DebugFlag) alert("EstimateTap()\n\nAnual Award Before Rounding = "+Award);      Award = Math.ceil(Award); // Round Anual Award up to nearest Dollar Amount per Brian Matthews      if (DebugFlag)        {          alert("EstimateTap()\n\nMinAward = "+MinAward);          alert("EstimateTap()\n\nMaxAward = "+MaxAward);          alert("EstimateTap()\n\nAward = "+Award);        }      document.TapAward.Annual.value = "$" + FormatCurrency(Award);      document.TapAward.Semester.value = "$" + FormatCurrency(Award/2);      document.TapAward.Trimester.value = "$" + FormatCurrency(Award/3);      window.location = "#award";      return true;    }      function FormatCurrency(amount)    {      var temp = "" + Math.round(100*amount);      while (temp.length <= 2) temp = "0" + temp;      var DecPlace = temp.length-2;       return temp.substring(0,DecPlace) + "." + temp.substring(DecPlace, temp.length);    }  function QuickTapSchedule(index)    {      // B & C Are Gone and E is new for 2000-2001      var temp = ""      if (index==0) temp = "A";      if (index==1) temp = "D";      if (index==2) temp = "E";      if (index==3) temp = "F";      if (index==4) temp = "G";      if (index==5) temp = "H";      if (index==6) temp = "K";      if (index==7) temp = "L";      if (index==8) temp = "M";      if (index==9) temp = "P";      if (index==10) temp = "U";      if (index==11) temp = "V";      if (DebugFlag) alert("QuickTapSchedule()\n\nSchedule = "+temp);        return temp;      }  function QuickValidateAndEstimate()    {      if (IsNonNegative(document.QuickTAP.NetTaxableBalance.value))        {  	      if (IsPositive(document.QuickTAP.AnnualTuition.value))	        {	          EstimateTap(parseInt(document.QuickTAP.NetTaxableBalance.value), parseInt(document.QuickTAP.AnnualTuition.value), QuickTapSchedule(document.QuickTAP.TapSchedule.selectedIndex),0);	        }	      else	        {	          if (Spanish) {          		txtMessage = "Por favor inserte una cantidad positiva en d\u00F3lares para la Pregunta # 3.";          	  }          	  else {          		txtMessage = "You must enter a positive dollar amount for Question #3.";          	  }          	  alert(txtMessage);          	  //alert("You must enter a positive dollar amount for Question #3.");	          document.QuickTAP.AnnualTuition.focus();	        }	    }	  else	    {	      if (Spanish) {          	  txtMessage = "Por favor inserte una cantidad de n\u00FAmero no negativo para la Pregunta # 1.";              }              else {          	  txtMessage = "You must enter a non-negative dollar amount for Question #1.";              }              alert(txtMessage);              //alert("You must enter a non-negative dollar amount for Question #1.");	      document.QuickTAP.NetTaxableBalance.focus();	    }	  return true;    }  function ResetAward()    {      document.TapAward.Annual.value = "TBD";      document.TapAward.Semester.value = "TBD";      document.TapAward.Trimester.value = "TBD";      }    function FullTapSchedule(GradOrPro,SchoolType,FinancialStatus,FirstReceived)    {      var Schedule = ""      if (DebugFlag) alert("FullTapSchedule\n\nGradOrPro = " + GradOrPro);      if (DebugFlag) alert("FullTapSchedule\n\nSchoolType = " + SchoolType);      if (DebugFlag) alert("FullTapSchedule\n\nFinancialStatus = " + FinancialStatus);      if (DebugFlag) alert("FullTapSchedule\n\nFirstReceived = " + FirstReceived);      if (GradOrPro==0)  //Undergrad            {              if (SchoolType==0) // Degree                    {                      if(FinancialStatus==0)//Dependent                            {                                  if(FirstReceived==0) Schedule = "E"; //2000-2001                                  if(FirstReceived==1) Schedule = "D"; //1994-1995 to 1999-2000                                  if(FirstReceived==2) Schedule = "A"; //1992-1993 or 1993-1994                                  if(FirstReceived==3) Schedule = "A"; //1990-1991 or 1991-1992                                  if(FirstReceived==4) Schedule = "A"; //1989-1990                                  if(FirstReceived==5) Schedule = "A"; //1988-1989 or Prior                            }                       else //Independent                            {                                   if(FirstReceived==0) Schedule = "M"; //2000-2001                                  if(FirstReceived==1) Schedule = "M"; //1994-1995 to 1999-2000                                  if(FirstReceived==2) Schedule = "L"; //1992-1993 or 1993-1994                                  if(FirstReceived==3) Schedule = "K"; //1990-1991 or 1991-1992                                  if(FirstReceived==4) Schedule = "K"; //1989-1990                                  if(FirstReceived==5) Schedule = "K"; //1988-1989 or Prior                            }                    }              else // Non-Degree                    {                      if (FinancialStatus==0)  //Dependent                            {                                  if (FirstReceived==0) Schedule = "H"; //2000-2001                                  if (FirstReceived==1) Schedule = "H"; //1994-1995 to 1999-2000                                  if (FirstReceived==2) Schedule = "G"; //1992-1993 or 1993-1994                                  if (FirstReceived==3) Schedule = "H"; //1990-1991 or 1991-1992                                  if (FirstReceived==4) Schedule = "G"; //1989-1990                                  if (FirstReceived==5) Schedule = "F"; //1988-1989 or Prior                            }                       else  //Independent                            {                              Schedule = "P";                            }                    }            }      else  //Yes Graduate            {              if (SchoolType==0)  // Degree                    {                      if (FinancialStatus==0) //Dependent                            {                              Schedule = "U";                            }                      else //Independent                            {                              Schedule = "V";                            }                    }              else  // Non-Degree                      {                      if (Spanish) {                      	  txtMessage = "Los estudiantes graduados en programas que no conducen a un grado acad\u00E9mico son inelegibles para el TAP.";                      }                      else {                      	  txtMessage = "Graduate Students in Non-Degree Progams are ineligible for TAP.";                      }                      alert(txtMessage);                      //alert("Graduate Students in Non-Degree Progams are ineligible for TAP.");                      Schedule = "-";                    }            }      if (DebugFlag) alert("FullTapSchedule()\n\nSchedule = "+Schedule);        return Schedule    }  function NYSExemption(MaritalStatus, FamilySize)    {      var temp1=1;      if (MaritalStatus==0) temp1=2; //Married      var temp2 = FamilySize - temp1      var NYSE = 1000* Math.max(temp2,0)      if (DebugFlag) alert("NYSExemption()\n\nNYSE = "+NYSE);      return NYSE;    }    function NYSDeduction(MaritalStatus, FinancialStatus, FamilySize)    {      var NYSD = 0;      if (MaritalStatus==0)//Married            {              NYSD=15000            }          else //Not married            {              if (FinancialStatus==0) //Dependent                    {                      NYSD=3000                    }                  else //Independent                    {                      if (parseInt(FamilySize)-1>0) NYSD=10500;                      else NYSD=7500;                     }            }      if (DebugFlag) alert("NYSDeduction()\n\nNYSD = "+NYSD);      return NYSD;    }  function KnowSNTIBlur()    {      if(document.FullTap.KnowStudentsNTI.selectedIndex==0)            {              StudentNTIFlag = false;              if (Spanish) {          	    txtMessage = 'Dado el hecho de que usted contesto "No," el NTI ser\u00E1 estimado en base a sus respuestas a las siguientes preguntas.';              }              else {          	    txtMessage = "Since you answered 'No', the NTI will be estimated based on your answers to the next few questions.";              }              alert(txtMessage);              //alert("Since you answered 'No', the NTI will be estimated based on your answers to the next few questions.");              document.FullTap.StudentsNTI.readOnly = true;              document.FullTap.StudentsAGI.readOnly = false;              // document.FullTap.StudentsMaritalStatus.disabled = false;              // document.FullTap.StudentsFamilySize.readOnly = false;              document.FullTap.StudentsAGI.focus();            }          else            {              StudentNTIFlag = true;              if (Spanish) {                  	txtMessage = 'Dado el hecho de que usted contesto "S\u00ED" omitiremos algunas de las siguientes preguntas e insertaremos el NTI.';              }              else {          	    txtMessage = "Since you answered 'Yes', we'll skip the next few questions and enter the NTI.";              }              alert(txtMessage);              //alert("Since you answered 'Yes', we'll skip the next few questions and enter the NTI.");              document.FullTap.StudentsNTI.readOnly = false;              document.FullTap.StudentsAGI.readOnly = true;              // document.FullTap.StudentsMaritalStatus.disabled = true;              // document.FullTap.StudentsFamilySize.readOnly = true;              document.FullTap.StudentsNTI.focus();            }    }  function KnowPNTIBlur()    {      if(document.FullTap.KnowParentsNTI.selectedIndex==0)            {              ParentNTIFlag = false;              if (Spanish) {                  	txtMessage = 'Dado el hecho de que usted contesto "No," el NTI ser\u00E1 estimado en base a sus respuestas a las siguientes preguntas.';              }              else {                  	txtMessage = "Since you answered 'No', the NTI will be estimated based on your answers to the next few questions.";              }              alert(txtMessage);              //alert("Since you answered 'No', the NTI will be estimated based on your answers to the next few questions.");              document.FullTap.ParentsNTI.readOnly = true;              document.FullTap.ParentsAGI.readOnly=false;              //document.FullTap.ParentsMaritalStatus.disabled=false;              //document.FullTap.ParentsFamilySize.readOnly=false;              document.FullTap.ParentsAGI.focus();            }          else            {              ParentNTIFlag = true;              if (Spanish) {                  	txtMessage = 'Dado el hecho de que usted contesto "S\u00ED" omitiremos algunas de las siguientes preguntas e insertaremos el NTI.';              }              else {                  	txtMessage = "Since you answered 'Yes', we'll skip the next few questions and enter the NTI.";              }              alert(txtMessage);              //alert("Since you answered 'Yes', we'll skip the next few questions and enter the NTI.");              document.FullTap.ParentsNTI.readOnly = false;              document.FullTap.ParentsAGI.readOnly=true;              //document.FullTap.ParentsMaritalStatus.disabled=true;              //document.FullTap.ParentsFamilySize.readOnly=true;              document.FullTap.ParentsNTI.focus();            }    }   function EstimateStudentsNTI(SAGI, MaritalStatus, FamilySize, FinancialStatus)    {      var SNTI = SAGI-NYSDeduction(MaritalStatus, FinancialStatus, FamilySize);      if (FinancialStatus==1) SNTI = SNTI - NYSExemption(MaritalStatus, FamilySize);      if (SNTI<0) SNTI=0;      if (DebugFlag) alert("EstimateStudentsNTI()\n\nSNTI = "+SNTI);      return SNTI;    }      function EstimateParentsNTI(PAGI, MaritalStatus, FamilySize)    {      var PNTI = PAGI - NYSDeduction(MaritalStatus,1,2) - NYSExemption(MaritalStatus, FamilySize);      if (PNTI<0) PNTI=0;      if (DebugFlag) alert("EstimateParentsNTI()\n\nPNTI = "+PNTI);      return PNTI;    }    function CalculateNTB(Grad, PNTI, SNTI, FinancialStatus, FullTimers, ChildSupport)    {      var NTB = SNTI;      if (FinancialStatus==0) NTB=NTB+PNTI  //Include Parents income for Dependent Students      if(Grad==0)  //Undergrad            {              if (FullTimers>0) NTB = NTB - (2000 * FullTimers + 1000);            }          else  //Graduate            {              NTB=NTB/(FullTimers+1);            }      if (FinancialStatus==0) NTB=NTB+ChildSupport      if (DebugFlag) alert("CalculateNTB()\n\nNTB = "+NTB);      return NTB;    }    function ResetFields()    {      StudentNTIFlag = false;       ParentNTIFlag = false;      document.FullTap.ParentsNTI.readOnly=true;      document.FullTap.StudentsNTI.readOnly=true;       document.FullTap.StudentsAGI.readOnly = false;      document.FullTap.StudentsMaritalStatus.disabled = false;      document.FullTap.StudentsFamilySize.readOnly = false;      document.FullTap.ParentsAGI.readOnly=false;      document.FullTap.ParentsMaritalStatus.disabled=false;      document.FullTap.ParentsFamilySize.readOnly=false;    }     function FullValidateAndEstimate()    {       if (FullValidate()) return FullEstimate();       return false;    }      function FullValidate()    {      StudentIsIndependant = IsStudentIndependent(false);      if (!IsNonNegative(document.FullTap.NumInCollege.value))        {          if (Spanish) {              	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el N\u00FAmero en Colegio.";          }          else {          	txtMessage = "Please enter a non-negative number for the Number in College.";          }          alert(txtMessage);          //alert("Please enter a non-negative number for the Number in College.");          document.FullTap.NumInCollege.focus();          return false;        }      if (!IsNonNegative(document.FullTap.ChildSupport.value))        {          if (Spanish) {              	txtMessage = "Por favor inserte un n\u00FAmero no negativo para Asistencia al Ni\u00F1o.";          }          else {          	txtMessage = "Please enter a non-negative number for the Child Support.";          }          alert(txtMessage);          //alert("Please enter a non-negative number for the Child Support.");          document.FullTap.ChildSupport.focus();          return false;        }      if (!IsPositive(document.FullTap.Tuition.value))        {          if (Spanish) {              	txtMessage = "Por favor inserte un n\u00FAmero positivo para la Matr\u00EDcula.";          }          else {          	txtMessage = "Please enter a positive number for the Tuition.";          }          alert(txtMessage);          //alert("Please enter a positive number for the Tuition.");          document.FullTap.Tuition.focus();          return false;        }      if (StudentNTIFlag)        {            if(!IsNonNegative(document.FullTap.StudentsNTI.value))             {              if (Spanish) {                  	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el NTI del Estudiante.";              }              else {                  	txtMessage = "Please enter a non-negative number for the Student's NTI.";              }              alert(txtMessage);              //alert("Please enter a non-negative number for the Student's NTI.");              document.FullTap.StudentsNTI.focus();              return false;            }          }      else        {          if(!IsNonNegative(document.FullTap.StudentsAGI.value))            {              if (Spanish) {                  	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el AGI del Estudiante.";              }              else {                  	txtMessage = "Please enter a non-negative number for the Student's AGI.";              }              alert(txtMessage);              //alert("Please enter a non-negative number for the Student's AGI.");              document.FullTap.StudentsAGI.focus();              return false;            }          if(!IsNonNegative(document.FullTap.StudentsFamilySize.value))            {              if (Spanish) {                  	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el Tama\u00F1o de la Familia del Estudiante.";              }              else {                  	txtMessage = "Please enter a non-negative number for the Student's Family Size.";              }              alert(txtMessage);              //alert("Please enter a non-negative number for the Student's Family Size.");              document.FullTap.StudentsFamilySize.focus();              return false;            }           }      if (ParentNTIFlag)        {            if(!IsNonNegative(document.FullTap.ParentsNTI.value))             {              if (Spanish) {                  	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el NTI de los Padres.";              }              else {                  	txtMessage = "Please enter a non-negative number for the Parent's NTI.";              }              alert(txtMessage);              //alert("Please enter a non-negative number for the Parent's NTI.");              document.FullTap.ParentsNTI.focus();              return false;            }          }      else        {          if(!IsNonNegative(document.FullTap.ParentsAGI.value))            {              if (Spanish) {                  	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el AGI de los Padres.";              }              else {                  	txtMessage = "Please enter a non-negative number for the Parent's AGI.";              }              alert(txtMessage);              //alert("Please enter a non-negative number for the Parent's AGI.");              document.FullTap.ParentsAGI.focus();              return false;            }          if(!IsNonNegative(document.FullTap.ParentsFamilySize.value))            {              if (Spanish) {                  	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el Tama\u00F1o de la Familia del Estudiante.";              }              else {                  	txtMessage = "Please enter a non-negative number for the Parent's Family Size.";              }              alert(txtMessage);              //alert("Please enter a non-negative number for the Parent's Family Size.");              document.FullTap.ParentsFamilySize.focus();              return false;            }           }      return true;  //If it got this far it's all good    }      function FullEstimate()    {      //Validate all the inputs to these functions first !            if (ParentNTIFlag) var PNTI=parseInt(document.FullTap.ParentsNTI.value);      else        {          var PNTI = EstimateParentsNTI(parseInt(document.FullTap.ParentsAGI.value), document.FullTap.ParentsMaritalStatus.selectedIndex, parseInt(document.FullTap.ParentsFamilySize.value));          document.FullTap.ParentsNTI.value = FormatCurrency(PNTI);        }      //Validate all the inputs to these functions first !      if (StudentNTIFlag) var SNTI=parseInt(document.FullTap.StudentsNTI.value);      else        {           var SNTI = EstimateStudentsNTI(parseInt(document.FullTap.StudentsAGI.value), document.FullTap.StudentsMaritalStatus.selectedIndex, parseInt(document.FullTap.StudentsFamilySize.value), StudentIsIndependant);          document.FullTap.StudentsNTI.value = FormatCurrency(SNTI);        }      var NTB = CalculateNTB(document.FullTap.GradOrPro.selectedIndex, PNTI, SNTI, StudentIsIndependant, parseInt(document.FullTap.NumInCollege.value), parseInt(document.FullTap.ChildSupport.value));      EstimateTap(NTB, parseInt(document.FullTap.Tuition.value), FullTapSchedule(document.FullTap.GradOrPro.selectedIndex,document.FullTap.SchoolType.selectedIndex,StudentIsIndependant,document.FullTap.FirstReceived.selectedIndex), document.FullTap.UpperCut.selectedIndex)    }  function IsStudentIndependent( fromIndepCalc )	{		//This function replaces the question as taken from Able-2		//to minimize the impact on the existing code the following are returned 		//1 if the student is determined to be Independent 		//0 if the student is determined to be dependent		if (fromIndepCalc) {		if (ValidateDate(document.FullTap.StudentDOB))		  { 		    if (CalculateAge(document.FullTap.StudentDOB.value)>=35) return 1;		  }		if (DebugFlag==true) alert("Got Past 35 years of age test !");		if (document.FullTap.Veteran.selectedIndex==1 && document.FullTap.ClaimedByParents.selectedIndex==0) return 1;		if (DebugFlag==true) alert("Got Past Veteran test !");		if (document.FullTap.LiveWithParents.selectedIndex==0 && document.FullTap.ClaimedByParents.selectedIndex==0 && document.FullTap.SupportFromParents.selectedIndex==0) return 1;		if (DebugFlag==true) alert("Got Past other 3 tests !");		return 0 }		else {		return 0 }	}	function GoToTapPage( c ) {	  if (Spanish) {              	window.location = (c==0) ? "E66F07E2E2359A24852572370071CDF8" : "1D2199FB963D9D2385257236007459CB"              	// window.location = (c==0) ? "9A48C3DBAF9AD85F85256F1E004FA9CC" : "E50E7127672C22FD85256F1E005EDEB9"          }          else {          	window.location = (c==0) ? "TAP_Award_Estimator_for_Financially_Dependent_Students" : "TAP_Award_Estimator_for_Independent_Students"          	// window.location = (c==0) ? "EBEA7258A36915EB852571F00066D58E" : "BB01F098ECF2AE5E852571F000669C3A"          	// window.location = (c==0) ? "EBEA7258A36915EB852571F00066D58E" : "BB01F098ECF2AE5E852571F000669C3A"          	// window.location = (c==0) ? "DC19434D7C548C6985256DAD0056F13B" : "AACF27BADE50D5D885256DAD005DFAF4"          }          // window.location = (c==0) ? "DC19434D7C548C6985256DAD0056F13B" : "AACF27BADE50D5D885256DAD005DFAF4"      } function RedirectDependentStudents()    {      // returns true if page will be redirected      StudentIsIndependant = IsStudentIndependent(true);      if (DebugFlag) alert(StudentIsIndependant);      if (StudentIsIndependant==0)         {          if (Spanish) {              	txtMessage = "Sus respuestas indican que el estudiante es financieramente dependiente. Consecuentemente, le llevaremos a la versi\u00F3n del Calculador de TAP para Estudiantes Dependientes.";          }          else {          	txtMessage = "Your answers indicate that the student is financially dependant so we'll take you to the Dependent Student version of the TAP Estimator.";          }          alert(txtMessage);          // Should the above message be updated to reflect the current TAP year?          //alert("Your answers indicate that the student is financially dependant so we'll take you to the Dependent Student version of the TAP 2000-2001 Estimator.");          GoToTapPage( 0 );          return true;        }      return false;    }      function ValidateDate(dateStr) {    // Date validation function courtesty of Sandeep V. Tamhankar (stamhankar@hotmail.com)        var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/; // requires 4 digit year    var matchArray = dateStr.value.match(datePat); // is the format ok?    if (matchArray == null || dateStr.value==""){      if (Spanish) {      	txtMessage = "Por favor inserte el d\u00EDa de nacimiento en el formato de MM/DD/YYYY.";      }      else {      	txtMessage = "Please enter student's date of birth in MM/DD/YYYY format.";      }      alert(txtMessage);      //alert("Please enter student's date of birth in MM/DD/YYYY format.");      dateStr.focus();      return false;    }    month = matchArray[1]; // parse date into variables    day = matchArray[3];    year = matchArray[4];    if (month < 1 || month > 12) { // check month range      if (Spanish) {       	txtMessage = "Los meses deben ser entre el 1 y el 12.";      }      else {      	txtMessage = "Month must be between 1 and 12.";      }      alert(txtMessage);      //alert("Month must be between 1 and 12.");      return false;    }    if (day < 1 || day > 31) {      if (Spanish) {       	txtMessage = "Los d\u00EDas deben ser entre el 1 y el 31.";      }      else {       	txtMessage = "Day must be between 1 and 31.";      }      alert(txtMessage);      //alert("Day must be between 1 and 31.");      return false;    }    if ((month==4 || month==6 || month==9 || month==11) && day==31) {      if (Spanish) {       	txtMessage = "Este mes " + month + " no tiene 31 d\u00EDas!";      }      else {       	txtMessage = "Month " + month + " doesn't have 31 days!";      }      alert(txtMessage);      //alert("Month "+month+" doesn't have 31 days!")      return false;    }    if (month == 2) { // check for february 29th      var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));      if (day>29 || (day==29 && !isleap)) {        if (Spanish) {        	txtMessage = "El mes de febrero del " + year + " no tiene " + day + " d\u00EDas.";        }        else {          	txtMessage = "February " + year + " doesn't have " + day + " days!";        }        alert(txtMessage);        //alert("February " + year + " doesn't have " + day + " days!");        return false;      }    }    return true;  }    function CalculateAge(DOB)    {      var i = DOB.indexOf("/");      var j = DOB.indexOf("/",i+1);      var Year = DOB.substring(j+1,DOB.length);      var Age=2000-Year      if (DebugFlag) alert("CalculateAge\n\nAge = " + Age);      return Age;    }      function SkipIt1(AgeObj)    {      if (ValidateDate(AgeObj))         {          if (CalculateAge(AgeObj.value)>=35)             {              if (Spanish) {               	txtMessage = "Tenemos suficiente informaci\u00F3n para determinar que el estudiante es financieramente independiente, as\u00ED que pasaremos a la pregunta # 6.";              }              else {          	txtMessage = "We have enough information to determine that the student is financially independent so we'll skip to question #6.";              }              alert(txtMessage);              //alert("We have enough information to determine that the student is financially independent so we'll skip to question #6.");              document.FullTap.GradOrPro.focus();              return true;            }        }      else return false;    }      function SkipIt2()    {      if (document.FullTap.Veteran.selectedIndex==1)         {          if (Spanish) {              	txtMessage = "Dado el hecho de que el Estudiante es un Veterano, pasaremos a la pregunta # 5.";          }          else {          	txtMessage = "Since the Student is a Veteran, we'll skip to question #5.";          }          alert(txtMessage);          //alert("Since the Student is a Veteran, we'll skip to question #5.");          document.FullTap.ClaimedByParents.focus();        }    }       function FullEstimate2()    {      if (FullValidate2())      {      //Validate all the inputs to these functions first !      if (StudentNTIFlag) var SNTI=parseInt(document.FullTap.StudentsNTI.value);      else        {           var SNTI = EstimateStudentsNTI(parseInt(document.FullTap.StudentsAGI.value), document.FullTap.StudentsMaritalStatus.selectedIndex, parseInt(document.FullTap.StudentsFamilySize.value), StudentIsIndependant);          document.FullTap.StudentsNTI.value = FormatCurrency(SNTI);        }      var NTB = CalculateNTB(document.FullTap.GradOrPro.selectedIndex, 0, SNTI, StudentIsIndependant, parseInt(document.FullTap.NumInCollege.value), 0);      //Put Married or Single w/Dependents on Dependent Schedules      if ( document.FullTap.StudentsMaritalStatus.selectedIndex==0)         {          //Married          StudentIsIndependant = 0;        }      else if (document.FullTap.StudentsFamilySize.value > 1)        {          //Single w/Dependents          StudentIsIndependant = 0;        }      EstimateTap(NTB, parseInt(document.FullTap.Tuition.value), FullTapSchedule(document.FullTap.GradOrPro.selectedIndex,document.FullTap.SchoolType.selectedIndex,StudentIsIndependant,document.FullTap.FirstReceived.selectedIndex), document.FullTap.UpperCut.selectedIndex)      }    }      function FullValidate2()    {      if (!ValidateDate(document.FullTap.StudentDOB))        {          return false;        }      StudentIsIndependant = IsStudentIndependent(true);            if (!IsNonNegative(document.FullTap.NumInCollege.value))        {          if (Spanish) {              	txtMessage = "Por favor inserte un n\u00FAmero positivo para el n\u00FAmero de Colegio.";          }          else {          	txtMessage = "Please enter a non-negative number for the Number in College.";          }          alert(txtMessage);          //alert("Please enter a non-negative number for the Number in College.");          document.FullTap.NumInCollege.focus();          return false;        }      if (!IsPositive(document.FullTap.Tuition.value))        {          if (Spanish) {              	txtMessage = "Por favor inserte un n\u00FAmero positivo para la Matr\u00EDcula.";          }          else {          	txtMessage = "Please enter a positive number for the Tuition.";          }          alert(txtMessage);          //alert("Please enter a positive number for the Tuition.");          document.FullTap.Tuition.focus();          return false;        }      if (StudentNTIFlag)        {            if(!IsNonNegative(document.FullTap.StudentsNTI.value))             {              if (Spanish) {               	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el NTI del Estudiante.";              }              else {          	txtMessage = "Please enter a non-negative number for the Student's NTI.";              }              alert(txtMessage);              //alert("Please enter a non-negative number for the Student's NTI.");              document.FullTap.StudentsNTI.focus();              return false;            }          }      else        {          if(!IsNonNegative(document.FullTap.StudentsAGI.value))            {              if (Spanish) {              	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el AGI del Estudiante.";              }              else {          	txtMessage = "Please enter a non-negative number for the Student's AGI.";              }              alert(txtMessage);              //alert("Please enter a non-negative number for the Student's AGI.");              document.FullTap.StudentsAGI.focus();              return false;            }          if(!IsNonNegative(document.FullTap.StudentsFamilySize.value))            {              if (Spanish) {              	txtMessage = "Por favor inserte un n\u00FAmero no negativo para el Tama\u00F1o de la Familia del Estudiante.";              }              else {          	txtMessage = "Please enter a non-negative number for the Student's Family Size.";              }              alert(txtMessage);              //alert("Please enter a non-negative number for the Student's Family Size.");              document.FullTap.StudentsFamilySize.focus();              return false;            }           }            return true;  //If it got this far it's all good    }      function ResetFields2()    {      StudentNTIFlag = false;       document.FullTap.StudentsNTI.readOnly=true;       document.FullTap.StudentsAGI.readOnly = false;      document.FullTap.StudentsMaritalStatus.disabled = false;      document.FullTap.StudentsFamilySize.readOnly = false;    }