<?xml version="1.0" encoding="utf-8"?>
<!-- 
Each <Block> contains the information needed to substitute a user defined method in Ruby 
with a matching user defined method in JavaScript.
The 'id' is a MD5 hash generated from the Ruby code for the user method, after linefeeds and whitespace has been removed.
The <RubyCode> contents are the Ruby code used to generate the hash. This code should match what is in the Ruby script 
and the generated hash to ensure a proper match.
The <JavaScriptCode> contents are the JavaScript code to substitute for the Ruby code user method during form conversion.

The conversion application extracts the Ruby user method code and generates a hash value which is compared to the hash values 
in this file to find a match. When the match is found the JavaScript code is substituted in the output JavaScript.
-->
<CodeBlocks xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <Block id="dfarrayListPreparerCodeB" scripttype="JS" codetype="fragment">
    <RubyCode><![CDATA[]]></RubyCode>
    <JavaScriptCode>
      <![CDATA[
        // dfarrayListPreparerCodeB
        for (var i=0; i<df_list.length; i++) 
        {
          tmpEval = eval("df_list[i].join("+")");
          tmpEval = eval(tmpEval);

          if (tmpEval.toString().trim().length <= 0) 
          {
            // Index df_list[i] holds the set of empty Data Flow boxes which we will flow to.
            for (var j=0; j<df_list[i].length; j++) 
            {
              tmp = "";

              switch (j)
              {
                case 0:
                  tmp = ("#{fiduciary.first_name_and_mi} #{fiduciary.last_name}").squeeze(" ").trim()
                  break;
                case 1:
                  tmp = individual.first_name.trim();
                  break;
                case 2:
                  tmp = individual.middle_initial.trim();
                  break;
                case 3:
                  tmp = individual.last_name.trim();
                  break;
                case 4:
                  if (!preparer.work_phone.trim().isEmpty()) { tmp = preparer.work_phone.trim(); }
                  else if (!preparer.phone.trim().isEmpty()) { tmp = preparer.phone.trim(); }
                  else { tmp = preparer.mobile_phone.trim(); }
                  break;
                case 5:
                  tmp = preparer.fax.trim();
                  break;
              }

              if (!tmp.isEmpty()) 
              { 
                df_list[i][j] = tmp;
              }
            }
            break;
          }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="dfarrayListIndividualCode" scripttype="JS" codetype="fragment">
    <RubyCode><![CDATA[]]></RubyCode>
    <JavaScriptCode>
      <![CDATA[
        // dfarrayListIndividualCode
        for (i=0; i<df_list.length; i++) 
        {
          tmpEval = eval("df_list[i].join("+")");
          tmpEval = eval(tmpEval);

            if (tmpEval.toString().trim().length <= 0) 
            {
                // Index df_list[i] holds the set of empty Data Flow boxes which we will flow to. We check for index 0
                // because that is on the first page where we also flow to the bottom signature area.
                acct_id = "";

                if ((individual.business_address.trim() + individual.business_address2.trim()).isEmpty())
                {
                  addr = (individual.address + " " + (individual.apartment_number.trim().isEmpty() ? "" : "Apt. #" + individual.apartment_number)).squeeze(" ").trim();
                  city = individual.city.strip;
                  state = individual.state.strip;
                  zip = individual.zip.strip;
                }
                else
                {
                  addr = (individual.business_address + ' ' + individual.business_address2).squeeze(' ').trim();
                  city = individual.business_city.trim();
                  state = individual.business_state.trim();
                  zip = individual.business_zip.trim();
                } 

                for (j=0; j<df_list[i].length; j++) 
                {
                  tmp = "";

                  switch (j)
                  {
                    case 0:
                      tmp = individual.business_name.trim();
                      break;
                    case 1:
                      tmp = individual.first_name.trim();
                      break;
                    case 2:
                      tmp = individual.middle_initial.trim();
                      break;
                    case 3:
                      tmp = individual.last_name.trim();
                      break;
                    case 4:
                      tmp = addr;
                      break;
                    case 5:
                      tmp = city;
                      break;
                    case 6:
                      tmp = state;
                      break;
                    case 7:
                      tmp = zip;
                      break;
                    case 8:
                      // One box displays either an FEIN or a SSN, but there are separate check boxes to
                      // indicate which is being used - FEIN has priority so we check it first:
                      if (individual.fein.trim().match(/^(.+)$/) != null)
                      {
                        acct_id = "fein";
                        tmp = individual.fein.trim().match(/^(.+)$/);
                      }
                      else if (individual.ssn.trim().match(/^(.+)$/) != null)
                      {
                        acct_id = "ssn";
                        tmp = individual.ssn.trim().match(/^(.+)$/);
                      }
                      break;
                    case 9:
                      if (acct_id == "ssn") { tmp = "X"; }
                      break;
                    case 10:
                      if (acct_id == "fein") { tmp = "X"; }
                      break;
                  }

                  if (!tmp.isEmpty()) 
                  { 
                    df_list[i][j] = tmp;
                  }
                }

              // If we are on the first page, dataflow the name and phone number to the bottom of the page. 
              // Here we just do it like normal DF.
              if (i == 0)
              {
                tmp = (individual.first_name + " " + individual.middle_initial + " " + individual.last_name).squeeze(" ").trim();
                if (!tmp.isEmpty()) { box1_38 = tmp; }

                if (!individual.business_phone.trim().isEmpty()) { tmp = individual.business_phone.trim(); }
                else if (!individual.work_phone.trim().isEmpty()) { tmp = individual.work_phone.trim(); }
                else if (!individual.phone.trim().isEmpty()) { tmp = !individual.phone.trim(); }
                else { tmp = individual.mobile_phone.trim(); }

                if (!tmp.isEmpty()) { box1_39 = tmp; }
              }
              break;
          }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="dfarrayValListIndividualCode" scripttype="JS" codetype="fragment">
    <RubyCode><![CDATA[]]></RubyCode>
    <JavaScriptCode>
      <![CDATA[
        // dfarrayValListIndividualCode
        for (var i=0; i<df_val_list.length; i++) {
            tmpEval = eval("df_val_list[i].join()");

            if (tmpEval.toString().trim().length <= 0)
            {
                if ((individual.business_address.trim() + individual.business_address2.trim()).isEmpty()) {
                    addr = (individual.address + " " + (individual.apartment_number.trim().isEmpty() ? "" : "Apt. #" + individual.apartment_number)).squeeze(" ").trim();
                    city = individual.city.trim();
                    state = individual.state.trim();
                    zip = individual.zip.trim();
                } else {
                    addr = (individual.business_address + " " + individual.business_address2).squeeze(" ").trim();
                    city = individual.business_city.trim();
                    state = individual.business_state.trim();
                    zip = individual.business_zip.trim();
                }

                fein = individual.fein.trim();
                ssn = individual.ssn.trim();

                for (var j=0; j<df_val_list[i].length; j++)
                {
                    tmp = "";
                    switch(j)
                    {
                        case 0:
                            tmp = individual.business_name.trim();
                            break;
                        case 1:
                            tmp = individual.first_name.trim();
                            break;
                        case 2:
                            tmp = individual.middle_initial.trim();
                            break;
                        case 3:
                            tmp = individual.last_name.trim();
                            break;
                        case 4:
                            tmp = addr;
                            break;
                        case 5:
                            tmp = city;
                            break;
                        case 6:
                            tmp = state;
                            break;
                        case 7:
                            tmp = zip;
                            break;
                        // This is an ID number, ssn or fein depending on the page we are on:
                        case 8:
                            if (i > 0) {
                                // Second page:
                                tmp = fein;
                            } else {
                                // First Page - FEIN has priority so we check it first:
                                tmp = (fein.isEmpty() ? ssn : fein);
                            }
                            break;
                        case 9:
                            if (i > 0) {
                                // Second page - ssn box:
                                tmp = ssn;
                            } else {
                                // First Page - set ssn check box IF fein is empty AND ssn is not empty:
                                if (fein.isEmpty()) {
                                    if (!ssn.isEmpty()) {
                                        tmp = "X";
                                    }
                                }
                            }
                            break;
                        // fein check box for both pages.
                        case 10:
                            tmp = (fein.isEmpty() ? "" : "X");
                            break;
                    }

                    if (!tmp.isEmpty()) {
                        df_val_list[i][j] = tmp;
                    }
                }

                //
                // If we are on the first page, dataflow the phone number to the bottom of the page. 
                // Here we just do it like normal DF.
                //
                if (i == 0) {
                    tmp = (individual.first_name + " " + individual.middle_initial + " " + individual.last_name).squeeze(" ").trim();
                    if (!tmp.isEmpty()) {
                        box1_38 = tmp;
                    }

                    if (!individual.business_phone.trim().isEmpty()) {
                        tmp = individual.business_phone;
                    } else if (!individual.work_phone.trim().isEmpty()) {
                        tmp = individual.work_phone;
                    } else if (!individual.phone.trim().isEmpty()) {
                        tmp = individual.phone;
                    } else {
                        tmp = individual.mobile_phone;
                    }
                    tmp = tmp.trim();

                    if (!tmp.isEmpty()) {
                        box1_39 = tmp;
                    }
                }

                // We are done so exiting df_val_list for loop
                break;
            }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="dfarrayValListEntityCode" scripttype="JS" codetype="fragment">
    <RubyCode><![CDATA[]]></RubyCode>
    <JavaScriptCode>
      <![CDATA[
        // dfarrayValListEntityCode
        for (var i=0; i<df_val_list.length; i++) {
            tmpEval = eval("df_val_list[i].join()");

            if (tmpEval.toString().trim().length <= 0)
            {
                acct_id = "";
                for (var j=0; j<df_val_list[i].length; j++)
                {
                    tmp = "";
                    switch(j)
                    {
                        case 0:
                            tmp = entity.name.trim();
                            break;
                        case 4:
                            tmp = (entity.address + " " + entity.address2).squeeze(" ").trim();
                            break;
                        case 5:
                            tmp = entity.city.trim();
                            break;
                        case 6:
                            tmp = entity.state.trim();
                            break;
                        case 7:
                            tmp = entity.zip.trim();
                            break;
                        case 8:
                                   //
                                   // We also have a checkbox to indicate this is an FEIN.
                                   //
                                   // 11/18/13 [HET]: CA forms with a field labelled CA Corporation Number/CA Corp no./etc.. 
                                   // should have entity.state_id flowed. This field is either that or an FEIN [as far as the
                                   // entity profile goes], so I am adjusting the previous FEIN/Checkbox df accordingly.
                                   // Checking the stateID first since most profiles would have the FEIN filled in the profile.
                                   //
                            if (entity.state_id.trim().match(/^(.+)$/)) {
                                acct_id = "state_id";
                                tmp = entity.state_id.trim().match(/^(.+)$/);
                            }
                            else if (entity.fein.trim().match(/^(.+)$/)) {
                                acct_id = "fein";
                                tmp = entity.fein.trim().match(/^(.+)$/);
                            }
                            break;
                        case 10:
                            if (acct_id == "fein") {
                                tmp = "X";
                            }
                            break;
                        case 11:
                            if (acct_id == "state_id") {
                                tmp = "X";
                            }
                            break;
                    }

                    if (!tmp.isEmpty()) {
                        df_val_list[i][j] = tmp;
                    }
                }

                       //
                 // If we are on the first page, dataflow the phone number to the bottom of the page. 
                // Here we just do it like normal DF.
                 //
                if (i == 0) {
                    tmp = entity.phone.trim();
                    if (!tmp.isEmpty()) { box1_39 = tmp; }
                }

                // We are done so exiting df_val_list for loop
                break;
            }
        }
       ]]>
    </JavaScriptCode>
  </Block>
  <Block id="dfarrayListEntityCode" scripttype="JS" codetype="fragment">
    <RubyCode><![CDATA[]]></RubyCode>
    <JavaScriptCode>
      <![CDATA[
        // dfarrayListEntityCode
        for (var i=0; i<df_list.length; i++) {
              tmpEval = eval("df_list[i].join("+")");
              tmpEval = eval(tmpEval);

              if (tmpEval.toString().trim().length <= 0)
              {
                    // Index df_list[i] holds the set of empty Data Flow boxes which we will flow to. We check for index 0
                    // because that is on the first page where we also flow to the bottom signature area.
                    acct_id = "";

                          for (var j=0; j<df_list[i].length; j++)
                          {
                          tmp = "";

                          switch (j)
                          {
                                case 0:
                                      tmp = entity.name.trim();
                                      break;
                                case 4:
                                      tmp = (entity.address + " " + entity.address2).squeeze(" ").trim();
                                      break;
                                case 5:
                                      tmp = entity.city.trim();
                                      break;
                                case 6:
                                      tmp = entity.state.trim();
                                      break;
                                case 7:
                                      tmp = entity.zip.trim();
                                      break;
                                case 8:
                                      // We also have a checkbox to indicate this is an FEIN.
                                      // 11/18/13 [HET]: CA forms with a field labelled CA Corporation Number/CA Corp no./etc.. 
                                      // should have entity.state_id flowed. This field is either that or an FEIN [as far as the
                                      // entity profile goes], so I am adjusting the previous FEIN/Checkbox df accordingly.
                                      // Checking the stateID first since most profiles would have the FEIN filled in the profile.
                                      if (entity.state_id.trim().match(/^(.+)$/) != null)
                                      {
                                            acct_id = "state_id";
                                            tmp = entity.state_id.trim().match(/^(.+)$/);
                                      }
                                      else if (entity.fein.trim().match(/^(.+)$/))
                                      {
                                            acct_id = "fein";
                                            tmp = entity.fein.trim().match(/^(.+)$/);
                                      }
                                      break;
                                case 10:
                                  if (acct_id == "fein") { tmp = "X"; }
                                  break;
                                case 11:
                                  if (acct_id == "state_id") { tmp = "X"; }
                                  break;
                          }
                          if (!tmp.isEmpty())
                          {
                              df_list[i][j] = tmp;
                          }
                    }
                    // If we are on the first page, dataflow the phone number to the bottom of the page. Here we just do it like normal DF.
                    if (i == 0)
                    {
                          tmp = entity.phone.trim();
                          if (!tmp.isEmpty()) { box1_39 = tmp; }
                    }
                    break;
              }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="1F4943D0E0357BEC45F211660EC97889" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def delaware_cd(a)
	        ascii_value = (case (a)
		        when (1..9): a + 48
		        when (11..18): a + 54
		        when (19..23): a + 55
		        when (24..26): a + 56
		        when (27..28): a + 57
		        when (29..31): a + 58
		        else 48
	        end)#.chr

        ( ascii_value == 0 ? '0' : ascii_value.chr )
        end
      ]]>
    </RubyCode>
    <JavaScriptCode><![CDATA[
		    function delaware_cd(a)
		    {
			    var ascii_value = null;
			
			    if (a >= 1 && a <= 9) { ascii_value = String.fromCharCode(a + 48); }
			    else if (a >= 11 && a <= 18) { ascii_value = String.fromCharCode(a + 54); }
			    else if (a >= 19 && a <= 23) { ascii_value = String.fromCharCode(a + 55); }
			    else if (a >= 24 && a <= 26) { ascii_value = String.fromCharCode(a + 56); }
			    else if (a >= 27 && a <= 28) { ascii_value = String.fromCharCode(a + 57); }
			    else if (a >= 29 && a <= 31) { ascii_value = String.fromCharCode(a + 58); }
			    else { ascii_value = String.fromCharCode(48); }
			
			    // The chr turns the ASCII number back into a character.
			    return ( ascii_value == null ? '0' : ascii_value );

		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="FB1DC8C97C97BA2AC35A75AA794D6E58" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def delaware_cd(a)


	        ascii_value = if( a > 10 ) and ( a < 19 ) then a + 54
			        elsif( a >= 19 ) and ( a < 24 ) then a + 55
			        elsif( a >= 24 ) and ( a < 27 ) then a + 56
			        elsif( a >= 27 ) and ( a < 29 ) then a + 57
			        elsif( a >= 29 ) and ( a < 32 ) then a + 58
			        elsif( a >= 1 ) and ( a < 10 ) then a + 48
			        elsif a == 10 then 48
			        else 0
			        end

        ( ascii_value == 0 ? '0' : ascii_value.chr )
        end
      ]]>
    </RubyCode>
	  <JavaScriptCode><![CDATA[
		    function delaware_cd(a)
		    {
			    var ascii_value = null;
			
			    // This is the reverse of the above amap method to convert the cd method result to the Delaware check digit.
			    // result is a string
			    if (( a > 10 ) && ( a < 19 )) { ascii_value = a + 54; }
			    else if (( a >= 19 ) && ( a < 24 )) { ascii_value = a + 55; }
			    else if (( a >= 24 ) && ( a < 27 )) { ascii_value = a + 56; }
			    else if (( a >= 27 ) && ( a < 29 )) { ascii_value = a + 57; }
			    else if (( a >= 29 ) && ( a < 32 )) { ascii_value = a + 58; }
			    else if (( a >= 1 ) && ( a < 10 )) { ascii_value = a + 48; }
			    else if (a == 10) { ascii_value = 48; }
			    else { ascii_value = 0; }
					
			    // Turn ascii_value back into a character.
			    return ( ascii_value == 0 ? '0' : String.fromCharCode(ascii_value) );
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="FBF0FD78CBF6A5A6F2D5C6870F674B80" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def fed5500_cd(a)

	        ascii_value = if( a < 10 ) then a + 48
			        elsif( a > 9 ) and ( a < 36 ) then a + 55
			        elsif a == 36 then 45
			        elsif a == 37 then 46	
			        elsif a == 38 then 32
			        elsif a == 39 then 36
			        elsif a == 40 then 47
			        elsif a == 41 then 43
			        elsif a == 42 then 37		
			        else 0
			        end

        ( ascii_value == 0 ? '0' : ascii_value.chr )
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function fed5500_cd(a)
		    {
			    // capital letters A-Z are mapped to numbers 10 - 35; the numbers 0 - 9 are mapped to 0-9
			    // a hyphen is mapped to 45; a period is mapped to 46; space 32; dollar 36; slash (/) 45; plus 43; percent 37 and all other special characters and lowercase letters are 0  NOTE, this is a REVERSE method to convert the 5500 check digit for 1D Barcode value result is a string
			    // NOTE, going from integer to the character version a 0 = 48
			    var ascii_value = null;
			
			    if ( a < 10 ) { ascii_value = a + 48; }
			    else if (( a > 9 ) && ( a < 36 )) { ascii_value = a + 55; }
			    else if (a == 36) { ascii_value = 45; }
			    else if (a == 37) { ascii_value = 46; }
			    else if (a == 38) { ascii_value = 32; }
			    else if (a == 39) { ascii_value = 36; }
			    else if (a == 40) { ascii_value = 47; }
			    else if (a == 41) { ascii_value = 43; }
			    else if (a == 42) { ascii_value = 37; }
			    else { ascii_value = 0; }

			    // The chr turns the ASCII number back into a character.
			    return ( ascii_value == 0 ? '0' : ascii_value );
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="A5EB47F1E7F87120114E9BC99E0C53EA" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...25000.01)					
			        tax = taxable_income * 0.035				
		        when (25000.01...75000.01)					
			        tax = ((taxable_income - 25000.0) * 0.0793) + 875.0
		        when (75000.01...250000.01)					
			        tax = ((taxable_income - 75000.0) * 0.0833) + 4840.0
		        else	
			        tax = ((taxable_income - 250000.0) * 0.0893) + 19418.0
	        end		
	        return tax		
        end			
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)	
		    {
			    if (taxable_income <= 0.0)
			    {
				    return 0;
			    }

			    if (taxable_income >= 0.01 && taxable_income <= 25000.01)					
			    {
				    return taxable_income * 0.035;
			    }
			    else if (taxable_income >= 25000.01 && taxable_income <= 75000.01)					
			    {
				    return ((taxable_income - 25000.0) * 0.0793) + 875.0;
			    }
			    else if (taxable_income >= 75000.01 && taxable_income <= 250000.01)					
			    {
				    return ((taxable_income - 75000.0) * 0.0833) + 4840.0;
			    }
			    else
			    {
				    return ((taxable_income - 250000.0) * 0.0893) + 19418.0;
			    } 
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="55D3AF652182BD1456E76741196E3032" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def delaware_cd(a)
	        (case (a)
		        when (1..9): a + 48
		        when (11..18): a + 54
		        when (19..23): a + 55
		        when (24..26): a + 56
		        when (27..28): a + 57
		        when (29..31): a + 58
		        else 48
	        end).chr
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function delaware_cd(a)
		    {
			    if (a >= 1 && a <= 9) { return String.fromCharCode(a + 48); }
			    else if (a >= 11 && a <= 18) { return String.fromCharCode(a + 54); }
			    else if (a >= 19 && a <= 23) { return String.fromCharCode(a + 55); }
			    else if (a >= 24 && a <= 26) { return String.fromCharCode(a + 56); }
			    else if (a >= 27 && a <= 28) { return String.fromCharCode(a + 57); }
			    else if (a >= 29 && a <= 31) { return String.fromCharCode(a + 58); }
			    else { return String.fromCharCode(48); }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="AEED8F2C57FD33286D25FE23C9885BB4" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
      function delaware_cd(a)
      {
        if (a >= 1 && a <= 9) { return String.fromCharCode(a + 48); }
        else if (a >= 11 && a <= 18) { return String.fromCharCode(a + 54); }
        else if (a >= 19 && a <= 23) { return String.fromCharCode(a + 55); }
        else if (a >= 24 && a <= 26) { return String.fromCharCode(a + 56); }
        else if (a >= 27 && a <= 28) { return String.fromCharCode(a + 57); }
        else if (a >= 29 && a <= 31) { return String.fromCharCode(a + 58); }
        else { return String.fromCharCode(48); }
      }
      ]]></JavaScriptCode>
	</Block>
	<Block id="3BDFF6A2D15FEB672C60FCDC33F2CB52" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
      function delaware_cd(a)
      {
        if (a >= 1 && a <= 9) { return String.fromCharCode(a + 48); }
        else if (a >= 11 && a <= 18) { return String.fromCharCode(a + 54); }
        else if (a >= 19 && a <= 23) { return String.fromCharCode(a + 55); }
        else if (a >= 24 && a <= 26) { return String.fromCharCode(a + 56); }
        else if (a >= 27 && a <= 28) { return String.fromCharCode(a + 57); }
        else if (a >= 29 && a <= 31) { return String.fromCharCode(a + 58); }
        else { return String.fromCharCode(48); }
        // The chr turns the ASCII number back into a character.
      }
      ]]></JavaScriptCode>
	</Block>
	<Block id="385DE02303E7830433BC515583EEF95A" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def lob_nontax_amount(expenditure)
	        return 0.0 unless (expenditure > 0.0)
	        case (expenditure)
		        when (0.0..500000.0): 0.2 * expenditure
		        when (500000.01..1000000.0): 100000.0 + (0.15 * (expenditure - 500000.0))
		        when (1000000.01..1500000.0): 175000.0 + (0.1 * (expenditure - 1000000.0))
		        when (1500000.01..17000000.0): 225000.0 + (0.05 * (expenditure - 1500000.0))
		        else 1000000.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
      function lob_nontax_amount(expenditure) {
        if (expenditure > 0.0)
        {
          if (expenditure >= 0.0 && expenditure <= 500000.0) { return (0.2 * expenditure) }
          if (expenditure >= 500000.01 && expenditure <= 1000000.0) { return (100000.0 + (0.15 * (expenditure - 500000.0))) }
          if (expenditure >= 1000000.01 && expenditure <= 1500000.0) { return (175000.0 + (0.1 * (expenditure - 1000000.0))) }
          if (expenditure >= 1500000.01 && expenditure <= 17000000.0) { return (225000.0 + (0.05 * (expenditure - 1500000.0))) }
          return 1000000.0;
        }
        else
        {
          return 0.0;
        }
      }
      ]]></JavaScriptCode>
	</Block>
	<Block id="3FFFBB3019A46FE13DF98124EAC16A3E" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def count_not_empty_boxes(*boxes)
	        count = 0
	        0.upto(boxes.length - 1) { |x|
		        if (!boxes[x].strip.empty?) then count += 1 end
		        }
	        return count
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function count_not_empty_boxes(boxes) {
          var count = 0;
          for (var x=0; x<boxes.length; x++) {
            if (!boxes[x].trim().isEmpty()) {
              count++;
            }
          }
          return count;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="3BDFF6A2D15FEB672C60FCDC33F2CB52" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
        function delaware_amap(a)
        {
          if (a == '0') { return 10 }
          else if (a >= '1' && a <= '9') { return parseInt(a); }
          else if (a >= 'A' && a <= 'H') { return (a.charCodeAt(0) - 54); }
          else if (a >= 'J' && a <= 'N') { return (a.charCodeAt(0) - 55); }
          else if (a >= 'P' && a <= 'R') { return (a.charCodeAt(0) - 56); }
          else if (a >= 'T' && a <= 'U') { return (a.charCodeAt(0) - 57); }
          else if (a >= 'W' && a <= 'Y') { return (a.charCodeAt(0) - 58); }
          else { return 0; }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="690F5373EDA646F3DFC5AF08972DEDE0" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def delaware_amap(a)
	        case (a)
		        when ("0"): 10
		        when ("1".."9"): a.to_i
		        when ("A".."H"): a[0] - 54
		        when ("J".."N"): a[0] - 55
		        when ("P".."R"): a[0] - 56
		        when ("T".."U"): a[0] - 57
		        when ("W".."Y"): a[0] - 58
		        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function delaware_amap(a)
        {
          if (a == '0') { return 10 }
          else if (a >= '1' && a <= '9') { return parseInt(a); }
          else if (a >= 'A' && a <= 'H') { return (a.charCodeAt(0) - 54); }
          else if (a >= 'J' && a <= 'N') { return (a.charCodeAt(0) - 55); }
          else if (a >= 'P' && a <= 'R') { return (a.charCodeAt(0) - 56); }
          else if (a >= 'T' && a <= 'U') { return (a.charCodeAt(0) - 57); }
          else if (a >= 'W' && a <= 'Y') { return (a.charCodeAt(0) - 58); }
          else { return 0; }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="439043A47EB1BDDDE50F2622CB2122E8" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)
		    {
			    if (taxable_income < 970000.0) { return 0.0; }
			
			    if (taxable_income >= 970000 && taxable_income <= 1939999) { return 200.0; }
			    else if (taxable_income >= 1940000 && taxable_income <= 9689999) { return 580.0; }
			    else if (taxable_income >= 9690000 && taxable_income <= 19379999) {return 1940.0; }
			    else if (taxable_income >= 19380000 && taxable_income <= 38769999) {return 3880.0; }
			    else { return 9690.0; }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="CECB2443C20085CFBE889A39A272F6C0" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def make_float(*boxes)
	        val = ""
	        boxes.length.times do |i| val += (boxes[i] =~ /\d|-/ ? boxes[i] : "0") end
	        val.gsub(/^0+/, "").to_f / 100.0
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function make_float(boxes)
		    {
			    var val = '';
			    var result;

			    for (var i = 0; i < boxes.length; i++)
			    {
				    val += (/\d|-/.test(boxes[i]) ? boxes[i] : "0");
			    }
			    result = val.replace(/^0+/g, "").to_f() / 100.0;
			
			    return result;
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="202B6BDEA8297896263C3659FBC57CE0" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        return 0.0 unless (taxable_income > 0.0)
	        case taxable_income
		        when (0.01..2900.0): taxable_income * 0.01
		        when (2900.01..5100.0): ((taxable_income * 0.02) - 29.0)
		        when (5100.01..7800.0): ((taxable_income * 0.03) - 80.0)
		        when (7800.01..10500.0): ((taxable_income * 0.04) - 158.0)
		        when (10500.01..13500.0): ((taxable_income * 0.05) - 263.0)
		        when (13500.01..17400.0): ((taxable_income * 0.06) - 398.0)
		        else ((taxable_income * 0.069) - 555.0)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)
		    {
			    if (taxable_income <= 0.0)
			    {
				    return 0.0;
			    }

			    if (taxable_income >= 0.01 && taxable_income <= 2900.0) { return taxable_income * 0.01; }
			    else if (taxable_income >= 2900.01 && taxable_income <= 5100.0) { return ((taxable_income * 0.02) - 29.0); }
			    else if (taxable_income >= 5100.01 && taxable_income <= 7800.0) { return ((taxable_income * 0.03) - 80.0); }
			    else if (taxable_income >= 7800.01 && taxable_income <= 10500.0) { return ((taxable_income * 0.04) - 158.0); }
			    else if (taxable_income >= 10500.01 && taxable_income <= 13500.0) { return ((taxable_income * 0.05) - 263.0); }
			    else if (taxable_income >= 13500.01 && taxable_income <= 17400.0) { return ((taxable_income * 0.06) - 398.0); }
			    else { return ((taxable_income * 0.069) - 555.0); }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="AFE9C79D780F7BA4E693DF851E930ECD" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)	
	        taxable_income = (taxable_income.to_f)
	        if (taxable_income > 1000000.0)	
			        tax = ((taxable_income - 1000000.0) * 0.076 + 66000.0)
	        elsif (taxable_income > 0.0)
			        tax = (taxable_income * 0.066)
	        else	
			        tax = 0.0				
	        end						
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)
		    {
			    taxable_income = (taxable_income.to_f());
			
			    if (taxable_income > 1000000.0)	
			    {
				    return ((taxable_income - 1000000.0) * 0.076 + 66000.0);
			    }
			    else if (taxable_income > 0.0)
			    {
				    return (taxable_income * 0.066);
			    }
			    else	
			    {
				    return 0.0;
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="CEEFEBCA39A94524ABEB999F74CE7E9B" scripttype="TS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
		    function tax(amount: any): number
		    {
			    amount = amount.to_f();
			    if (amount > 25000.0)
			    {
				    return (1650.0 + ( amount - 25000.0 ) * 0.085);
			    }
			    else if( amount > 10000.0 )
			    {
				    return (600.0 + ( amount - 10000.0 ) * 0.07);
			    }
			    else if( amount > 0.0 )
			    {
				    return (amount * 0.06);
			    }
			    else 
			    {
				    return 0.0;
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="A7D96D66A2DCA079468B312191EE9C17" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def not_empty(*boxes)
	        0.upto(boxes.length - 1) { |x|
		        if (!boxes[x].strip.empty?) then return true end
		        }
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function not_empty(boxes) {
          for (var x = 0; x < boxes.length; x++) {
            if (!boxes[x].trim().isEmpty()) {
              return true;
            }
          }
          return false
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="4ABC603EFF207ACB1678294DD50D31D4" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def print_box(str, offset, limit, box_prefix)
	        return unless (box_prefix =~ /\Abox\d+_\Z/)
	
	        0.upto((str.length > limit ? limit - 1 : str.length - 1)) { |x|
		        print box_prefix + (x + offset).to_s, str[x,1]
		        }
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function print_box(str, offset, limit, box_prefix) {
          // First check for bad box_prefix formation - so we do not end up writing '10' instead of 'box1_10', for example.
          if ((/^box\d+_$/).test(box_prefix)) {
            var lmt = (str.length > limit ? limit - 1 : str.length - 1);
            for (var x = 0; x <= lmt; x++) {
              var id = box_prefix + (x + offset).toString();
              SFForms.StorageManager.setValue(formInstanceId, id, str.substr(x, 1));
            }
          }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="1584DAD6A1BCCB8CD7764B95363814AA" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def min_max(function, *values)
	        function.upcase!
	        result = 0.0

	        if ((values.length > 0) and ((function == 'MIN') or (function == 'MAX')))
		        result = values[0].to_f
		        if (function == 'MIN')
			        1.upto(values.length - 1) {|x|
				        result = values[x].to_f if values[x].to_f < result
				        }
		        elsif (function == 'MAX')
			        1.upto(values.length - 1) {|x|
				        result = values[x].to_f if values[x].to_f > result
				        }
		        end
	        end
	        return result
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function min_max(choice: string, values: any): number 
        {
          choice = choice.toUpperCase();
          var result: number = 0.0;

          if ((values.length > 0) && ((choice == 'MIN') || (choice == 'MAX'))) 
          {
            result = values[0].to_i();
            if (choice == 'MIN') 
            {
              for (var x = 1; x < values.length; x++) 
              {
                if (values[x].to_f() < result) 
                {
                    result = values[x].to_f();
                }
              }
            } 
            else if (choice =='MAX') 
            {
              for (var x = 1; x < values.length; x++) 
              {
                if (values[x].to_f() > result) 
                {
                  result = values[x].to_f();
                }
              }
            }
          }

          return result;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="C37F02807CC24FD1EB98E40A5F965682" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_due_date(mm_yr, vch_num)
	        return "" unless ((0..3) === vch_num)
          case (mm_yr)
		        when ("1216"): ["04-01-2016", "06-15-2016", "09-15-2016", "12-15-2016"][vch_num]
		        when ("0117"): ["05-02-2016", "07-17-2016", "10-17-2016", "01-17-2017"][vch_num]
		        when ("0217"): ["06-01-2016", "08-15-2016", "11-15-2016", "02-15-2017"][vch_num]
		        when ("0317"): ["07-01-2016", "09-15-2016", "12-15-2016", "03-15-2017"][vch_num]
		        when ("0417"): ["08-01-2016", "10-17-2016", "01-17-2017", "04-17-2017"][vch_num]
		        when ("0517"): ["09-01-2016", "11-15-2016", "02-15-2017", "05-15-2017"][vch_num]
		        when ("0617"): ["10-03-2016", "12-15-2016", "03-15-2017", "06-15-2017"][vch_num]
		        when ("0717"): ["11-01-2016", "01-17-2017", "04-17-2017", "07-17-2017"][vch_num]
		        when ("0817"): ["12-01-2016", "02-15-2017", "05-15-2017", "08-15-2017"][vch_num]
		        when ("0917"): ["01-03-2017", "03-15-2017", "06-15-2017", "09-15-2017"][vch_num]
		        when ("1017"): ["02-01-2017", "04-17-2017", "07-17-2017", "10-16-2017"][vch_num]
		        when ("1117"): ["03-01-2017", "05-15-2017", "08-15-2017", "11-15-2017"][vch_num]
		        else ""
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function get_due_date(mm_yr, vch_num)
        {
		   var result = "";

	        if (vch_num >= 0 && vch_num <= 3)
	        {
	            switch (mm_yr)
	            {
		        case "1216": result = ["04-01-2016", "06-15-2016", "09-15-2016", "12-15-2016"][vch_num]; break;
		        case "0117": result = ["05-02-2016", "07-17-2016", "10-17-2016", "01-17-2017"][vch_num]; break;
		        case "0217": result = ["06-01-2016", "08-15-2016", "11-15-2016", "02-15-2017"][vch_num]; break;
		        case "0317": result = ["07-01-2016", "09-15-2016", "12-15-2016", "03-15-2017"][vch_num]; break;
		        case "0417": result = ["08-01-2016", "10-17-2016", "01-17-2017", "04-17-2017"][vch_num]; break;
		        case "0517": result = ["09-01-2016", "11-15-2016", "02-15-2017", "05-15-2017"][vch_num]; break;
		        case "0617": result = ["10-03-2016", "12-15-2016", "03-15-2017", "06-15-2017"][vch_num]; break;
            case "0717": result = ["11-01-2016", "01-17-2017", "04-17-2017", "07-17-2017"][vch_num]; break;
		        case "0817": result = ["12-01-2016", "02-15-2017", "05-15-2017", "08-15-2017"][vch_num]; break;
		        case "0917": result = ["01-03-2017", "03-15-2017", "06-15-2017", "09-15-2017"][vch_num]; break;
		        case "1017": result = ["02-01-2017", "04-17-2017", "07-17-2017", "10-16-2017"][vch_num]; break;
		        case "1117": result = ["03-01-2017", "05-15-2017", "08-15-2017", "11-15-2017"][vch_num]; break;
		        default: result = ""; 
	            }
		   }

	       return result;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="0AAA7C9EA3094F516EC19012397E5673" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_due_date(date, install_num)
	        due_date = ""

	        if (date.delete("^0-9") =~ /^(\d\d)\d\d(\d{4})$/)
		
		        mn = $1.to_i
		        yr = $2.to_i

		        if ((1..11) === mn)
			        mn = mn +1
			        yr = yr -1
		        else
			        mn = 1
		        end

		        mn = mn + 3 * install_num - (install_num < 2 ? 0 : 1)

		        if (mn > 12)

			        mn = mn % 12
			        yr += 1
		        end

		        due_date = "#{'%02i' % mn}/15/#{yr}"
	        end
	        due_date
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function get_due_date(date, install_num) {
          var due_date = "";
          var tmp = date.delete(/[^0-9]/g);
          var myReg = /^([0-9]{2})[0-9]{2}([0-9]{4})$/;
          var myMatches = myReg.exec(tmp);
          if (myMatches != null && myMatches.length > 0) {
              var mn = myMatches[1].to_i();
              var yr = myMatches[2].to_i();
              if (mn >= 1 && mn <= 11) {
                  mn = mn + 1;
                  yr = yr - 1;
              } else {
                  mn = 1;
              }
              mn = mn + 3 * install_num - (install_num < 2 ? 0 : 1);
              if (mn > 12) {
                  mn = mn % 12;
                  yr += 1;
              }
              due_date = ("" + ((mn).to_i().complexFixedString(0, '02')) + "/15/" + (yr) + "");
          }
          return due_date;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="EF37BD80F6E04CFFA7522E76DE46EF23" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def a_larger_than_b(array_a, array_b)

	        float_array_a = Array.new
	        float_array_b = Array.new

	        array_a.each {|value| float_array_a.push(value.strip.to_f) if (!value.strip.empty?) }
	        array_b.each {|value| float_array_b.push(value.strip.to_f) if (!value.strip.empty?) }




	        if (float_array_a.length > 0)
		        if (float_array_b.length > 0)
			        return true if (float_array_a.max > float_array_b.min)
		        else
			        return true
		        end
	        end

	        false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function a_larger_than_b(array_a, array_b)
        {
        var float_array_a = new Array();
        var float_array_b = new Array();
            	
        array_a.forEach(function (entry) {
          if (entry.trim().length > 0) {
            float_array_a.push(parseFloat(entry));
          }
        });
        array_b.forEach(function (entry) {
          if (entry.trim().length > 0) {
            float_array_b.push(parseFloat(entry));
          }
        });

        // Choosing to default to TRUE when the first array has elements and the second one does not.
        if (float_array_a.length > 0) {
          if (float_array_b.length > 0) {
            if (Math.max.apply(null, float_array_a) > Math.min.apply(null, float_array_b)) {
              return true;
            }
          }
          else {
            return true;
          }
        }
            
        return false;
        }
      ]]></JavaScriptCode>
	</Block>

<Block id="AAD1B2BE9642F67CA86191963A234348" scripttype="TS" codetype="method">
    <RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	# Correct input arguments.
	input = input.to_s
	multiplier = multiplier.to_s
	modulus = modulus.to_i
	sum_digits = false unless sum_digits.kind_of? TrueClass
	rtl = false unless rtl.kind_of? TrueClass
	
	# Create multiplier string.
	extra = input.length % multiplier.length
	if rtl
		multiplier.reverse! 
		multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	else
		multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	end
	
	# Generate the sum.
	sum = 0
	0.upto(input.length-1) { |i|
		step = input[i, 1].to_i * multiplier[i, 1].to_i
		# Do they want sum of the products, or sum of the product digits?
		if (sum_digits)
			sum += step % 10 + step / 10
		else
			sum += step
		end
	}

	# Value to return as a 2 digit integer.
	(sum % modulus)
	
end
      ]]>
    </RubyCode>
	<JavaScriptCode><![CDATA[
function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
{
    // Correct input arguments
    var inputStr = input.toString();
    var multiplierStr = multiplier.toString();
    var modulusInt = (modulus.toString()).to_i();
    sum_digits = sum_digits || false;
    rtl = rtl || false;

    // Create multiplier string
    var extra = inputStr.length % multiplierStr.length;

    multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

    if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

    // Generate the sum
    var sum = 0;

    for (var i = 0; i < inputStr.length; i++)
    {
        var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

        // Do they want sum of the products, or sum of the product digits?
        sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
    }

    // Value to return as a 2 digit integer.
    return (sum % modulusInt);
}
      ]]></JavaScriptCode>
</Block>

	<Block id="20CBC372D945AD3DA9554FD2EB0A700B" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def bad_taxnum(number)
	        number = number.strip
	        return false unless (number =~ /^[13][0-9]{10}$/)
	
	        cd = check_digit(number[0,10], '12', 10, true, false)
	
	        if (cd != number[10,1].to_i)
		        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
		        return true
	        end
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function bad_taxnum(number)
        {
          number = number.trim();
          if (!/^[13][0-9]{10}$/.test(number)) 
          {
            return false;
          }
		  
          var cd = check_digit(number.substring(0, 10), '12', 10, true, false);
          if (cd !== number.substring(10, 11).to_i())
          {
            SFForms.Utilities.MessageBox(formInstanceId, 'The Taxpayer Number entered is not valid. Please verify and re-enter.', 'Attention!', MB_ICONEXCLAMATION);
            return true;
          }
          
          return false;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="F8E269E8DDDA5EAEC96D8C57F06F294A" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def invalid_11digit_taxnum(number)
	        number = number.strip
	        return false unless (number =~ /^[13][0-9]{10}$/)
	
	        cd = check_digit(number[0,10], '12', 10, true, false)
	
	        if (cd != number[10,1].to_i)
			        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
		        return true
	        end
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function invalid_11digit_taxnum(number)
		    {
			    number = number.trim();
			
			    if (!(/^[13][0-9]{10}$/.test(number)))
			    {
				    return false;
			    }
			
			    var cd = check_digit(number.substring(0,10), '12', 10, true, false)
			    if (cd != number.substr(10, 1).to_i())
			    {
				    SFForms.Utilities.MessageBox(formInstanceId, 'The Taxpayer Number entered is not valid. Please verify and re-enter.', 'Attention!', MB_ICONEXCLAMATION);
				    return true;
			    }
			
			    return false;
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="9999FF107B63A798D57D43442278A134" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def invalid_fein(fein)
	        if ((fein.strip =~ /^[0]{9}$/) or (fein.strip =~ /^[9]{9}$/))
		        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
		        return true
	        end
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function invalid_fein(fein)
        {
			    if (/^[0]{9}$/.test(fein.trim()) || /^[9]{9}$/.test(fein.trim()))
			    {
				    SFForms.Utilities.MessageBox(formInstanceId, 'The Taxpayer Number entered is not valid. Please verify and re-enter.','Attention!', MB_ICONEXCLAMATION);
				    return true;
			    }
			
			    return false;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="094BF011E97C6ADFEA37D03016EEF7D9" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def condition(left, right, third)
	        if (left == true)
		        right
	        elsif (left == false)
		        if (third != nil)
			        third
		        else
			        '0'
		        end
	        else
		        ''
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function condition(left, right, third)
		    {
			    if (left == true)
			    {
				    return right;
			    }
			    else if (left == false)
			    {
				    if (third != null)
				    {
					    return third;
				    }
				    else
				    {
					    return '0';
				    }
			    }
			    else
			    {
				    return '';
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="5F509CBD2EE037EBE074BCB74D48F982" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def invalid_fid(fid_number)
	        fid_number = fid_number.strip

	        if ((fid_number =~ /^([0]{9})|([9]{9})$/))
		        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
		        return true
	        end
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
      function invalid_fid(fid_number)
      {
        fid_number = fid_number.trim();
        
        if (/^([0]{9})|([9]{9})$/.test(fid_number))
        {
            SFForms.Utilities.MessageBox(formInstanceId, 'The Taxpayer Number entered is not valid. Please verify and re-enter.','Attention!', MB_ICONEXCLAMATION);
            return true;
        }
        
        return false;
      }
      ]]></JavaScriptCode>
	</Block>
	<Block id="C440AE964F9B198A5CA7732162669C79" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def invalid_dates(date1, date2)
	        ret = false

	        if (begin_date = check_date(date1))
		        if (end_date = check_date(date2))
			        if (end_date < begin_date)
				        messageBox("The Common owner end date cannot fall before the Common owner start date.", "Attention!", $MB_ICONEXCLAMATION)
				        ret = true
			        end
		        end
	        end

	        return ret
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function invalid_dates(date1, date2)
		    {
			    var ret = false;
			
			    var begin_date = check_date(date1);
			    var end_date = check_date(date2);
			    if (begin_date)
			    {
				    if (end_date)
				    {
					    if (end_date < begin_date)
					    {
						    SFForms.Utilities.MessageBox(formInstanceId, 'The Common owner end date cannot fall before the Common owner start date.', 'Attention!', MB_ICONEXCLAMATION);
						    ret = true;
					    }
				    }
			    }
			
			    return ret;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="A54CEAF9D5DFE2D0E9E119A3964FA9CD" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def invalid_dates(date1, date2)
	        ret = false

	        if (begin_date = check_date(date1))
		        if (end_date = check_date(date2))
			        if (end_date < begin_date)
				        messageBox("Incorrect dates have been entered. The Affiliate reporting end date cannot fall before the Affiliate reporting begin date.", "Attention!", $MB_ICONEXCLAMATION)
				        ret = true
			        end
		        end
	        end

	        return ret
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function invalid_dates(date1, date2)
		    {
			    var ret = false;
			
			    var begin_date = check_date(date1);
			    var end_date = check_date(date2);
			    if (begin_date)
			    {
				    if (end_date)
				    {
					    if (end_date < begin_date)
					    {
						    SFForms.Utilities.MessageBox(formInstanceId, 'Incorrect dates have been entered. The Affiliate reporting end date cannot fall before the Affiliate reporting begin date.', 'Attention!', MB_ICONEXCLAMATION);
						    ret = true;
					    }
				    }
			    }
			
			    return ret;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="8DD22C9161776808F77D0C821493E717" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def bad_fein(id_number)
	        id_number = id_number.strip

	        if ((id_number =~ /^([0]{9})|([9]{9})$/))
		        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
		        return true
	        end
	        return false
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function bad_fein(id_number) {
          id_number = id_number.trim();
          if (/^([0]{9})|([9]{9})$/.test(id_number)) {
              SFForms.Utilities.MessageBox(formInstanceId, 'The Taxpayer Number entered is not valid. Please verify and re-enter.','Attention!', MB_ICONEXCLAMATION);
              return true;
          }
          return false;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="55B4004AB271D65C165F46B1A74FD30E" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_avg_retail_sales_rate(fuel_type)
	        case (fuel_type.strip.to_i)
		        when (1): "1.931"
		        when (2): "2.061"
		        when (3): "3.000"
		        when (4): "1.954"
		        when (5): "1.862"
		        else "0.00"
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function get_avg_retail_sales_rate(fuel_type) {
          var result = '0.00';
          switch(fuel_type.trim().to_i()) {
              case 1:
                  result = '1.784';
                  break;
              case 2:
                  result = '2.011';
                  break;
              case 3:
                  result = '3.000';
                  break;
              case 4:
                  result = '1.954';
                  break;
              case 5:
                  result = '1.717';
                  break;
              default: break;
          }
          return result;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="073C63C5A6FD44A0D2702C1A7966805A" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)
	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 
	        year_end = year_end.to_i

	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        if ((due_mon == 4) and (due_day == 16) and (due_year == 2018))
		        due_day = 17
	        end

	        if ((due_mon == 2) and (due_day == 20) and (due_year == 2017))
		        due_day = 21
	        end

	        if ((due_mon == 1) and (due_day == 15) and (due_year == 2018))
		        due_day = 16
	        end

	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function compute_due_date(id, mon_end, year_end, coupon)
        {
	        var coupon_intervals = [4, 6, 9, 12, 4];
	        var liability_intervals = [3, 6, 9, 12, 12];
	        var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	
	        // Check arguments first.
	        if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
	        {
		        return '00000000';
	        }

	        year_end = year_end.to_i();
	
	        //We will index into the interval arrays with this.
	        var coupon_adj = coupon - 1;
	
	        var year_adj;
	        var mon_adj;
	        var due_year;
	        var mod_mon;
	        var due_mon;
	        var due_day;
	        if (id == 1)
	        {		
		        // Computing Liability Due Date. These fall on the last day of the month.
		        year_adj = year_end - 1;
		        mon_adj = mon_end + liability_intervals[coupon_adj];
		        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
		        mod_mon = mon_adj % 12;
		        due_mon = ( mod_mon > 0 ? mod_mon : 12);
		        if (due_mon == 2)
		        {
			        due_day = (is_leap_year(due_year) ? 29 : 28);
		        }
		        else 
		        {
			        due_day = days_in_month[due_mon - 1];
		        }
	        }
	        else if (id == 2)
	        {
			        // Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end);
			        mon_adj = mon_end + coupon_intervals[coupon_adj];
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
			        mod_mon = mon_adj % 12;
			        due_mon = (mod_mon > 0 ? mod_mon : 12);
			        due_day = (coupon < 5 ? 20 : 15);

			        // Correct the Coupon due dates so that they do not fall on a weekend.
			        // t.wday == 6 is Saturday, Sunday == 0.
			        var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
			        if (t.wday() == 6)
			        {
				        due_day += 2;
			        }
			        else if (t.wday() == 0)
			        {
				        due_day += 1;
			        }
	        }

	        // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        // in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        // out different from the chart in the instructions, put in the computed due month, day and year
	        // which showed as wrong and adjust the day to match the chart.
	 
	        //-###########################################################
	        //IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
	        //-###########################################################
	        //Each year when this form comes through the voucher number and year ending must be entered and checked
	        //in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
	        //dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
	        //-###########################################################

	        //This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        //In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        //year of the due date showing on the form in the variables below. In the variable labeled due_day
	        //set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        //is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

	        // Note 09/30/14: Offset below is for Martin Luther King Day holiday which needed to be adjusted 
	        // from 01/16/2017 to 01/17/2017.
	        //
	        //~ if ((due_mon == 1) and (due_day == 16) and (due_year == 2017))
	        //~ due_day = 17
	        //~ end
	
	        // 10/23/15 [kames]: For year ending 12/17 voucher number 5 it says date voucher due is 4/17/18. 

	        // Note 10/23/15: Offset below is different then what i came up with in the display_compute_date
	        //which needed to be adjusted from 04/17/2017 to 04/18/2017.
	
	        if ((due_mon == 4) && (due_day == 16) && (due_year == 2018))
	        {
		        due_day = 17;
	        }

	        // Note 10/23/15: Offset below is for President's Day holiday which needed to be adjusted 
	        // from 02/20/2017 to 02/21/2017.
	
	        if ((due_mon == 2) && (due_day == 20) && (due_year == 2017))
	        {
		        due_day = 21;
	        }
	
	        // Note 10/23/15: Offset below is for Martin Luther King Day holiday which needed to be adjusted 
	        // from 01/15/2018 to 01/16/2018.
	
	        if ((due_mon == 1) && (due_day == 15) && (due_year == 2018))
	        {
		        due_day = 16;
	        }

	        // Prepare due date for return - string with no '/'s.
	        return due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="8803C6CCD5374C239DB76EF7B5FB1B24" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def make_date(data)
	        (data.delete("^0-9") =~ /\A(\d{4})(\d{2})\Z/ ? "#{'%04i' % Time.gm($2).strftime('%Y')}#{$1}" : "0" * 8)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function make_date(data) {
          var tmpdata = data.delete(/[^0-9]/g);
          var reg = /^(\d{4})(\d{2})$/;
                
          var matches = reg.exec(tmpdata);
          if (matches != null && matches.length > 0) {
            var tmp2 = SFForms.Utilities.Time.gm(matches[2]).strftime('%Y');
            return tmp2 + matches[1];
          } else {
            return '00000000';
          }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="AD96F412D4F52FD18F7F5F2B29A6BFE4" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def is_leap_year(year)
	        if ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0)))
		        return true
	        else
		        return false
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function is_leap_year(year) {
          if ((year % 4 === 0) && ((year % 100 !== 0) || (year % 400 === 0))) {
            return true;
          } else {
            return false;
          }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="47A6873EFE082AFA7264F35024CDED78" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def messageBox(message, title = 'Message', style = 0)
	        mb = Win32API.new("user32", "MessageBox", ['L', 'P', 'P', 'L'], 'L')
	        return mb.Call(0, message, title, style)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        // --------------------------------------
        // placeholder for Ruby messageBox method
        // replaced with SFForms.Utilities.MessageBox
        // --------------------------------------
      ]]></JavaScriptCode>
	</Block>
	<Block id="8F2CC4B749D369938101B65360569F17" scripttype="TS" codetype="method">
		<RubyCode><![CDATA[
        def invalid_taxnum(number)
	        number = number.strip
	        error = false

	        case (number)
		        when (/^[13][0-9]{10}$/)
			        cd = check_digit(number[0,10], '12', 10, true, false)
			        error = true if (cd != number[10,1].to_i)
		        when (/^(0{9}|9{9})$/): error = true
	        end

	        if (error)
		        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
	        end

	        return error
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function invalid_taxnum (num: string): boolean {
          num = num.trim();
          var error: boolean = false;
            
          if (/^[13][0-9]{10}$/.exec(num)) {
            var cd: string = check_digit(num.slice(0,10), '12', 10, true, false)
            if (cd.to_i() != num.slice(-1).to_i()) {
              error = true;
            }
          } else if (/^(0{9}|9{9})$/.exec(num)) {
            error = true;
          }
            
          if (error) {
            SFForms.Utilities.MessageBox(formInstanceId, 'The Taxpayer Number entered is not valid. Please verify and re-enter.', 'Attention!', 0);
          }
            
          return error;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="508184F630D8C8CE8031C9DC55E460D5" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def check_date (date)
	        valid_date = nil

	        if (date.delete("^0-9") =~ /^(\d\d)(\d\d)(\d\d)?(\d\d)$/)
		        year = ($3 ? $3+$4 : ($4.to_i > 37 ? "19#{$4}" : "20#{$4}"))
		        if (((1..12) === $1.to_i) and ((1..31) === $2.to_i) and ((1970..2037) === year.to_i))
			        valid_date = Time.gm(year, $1, $2)
		        end
	        end

	        return valid_date
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function check_date(date)
        {
	        var valid_date = null;
	
	        //
	        // Technically, Time.gm(2038, 1, 19) works and Time.gm(2038, 1, 20) fails
	        // [and for dates that exceed that] but we will treat 2037 as the highest
	        // date we will accept, should not pose a problem!
	        //
	        var matches = /^(\d\d)(\d\d)(\d\d)?(\d\d)$/.exec(date.delete(/[^0-9]/g));
	        if (matches != null && matches.length > 0)
	        {
		        var year = (matches[3] ? matches[3] + matches[4] : (matches[4].to_i() > 37 ? "19" + matches[4] : "20" + matches[4]));
		        if (
								(matches[1].to_i() >= 1 && matches[1].to_i() <= 12) &&
			        	(matches[2].to_i() >= 1 && matches[2].to_i() <= 31) &&
			        	(year.to_i() >= 1970 && year.to_i() <= 2037)
							)
		        {
			        valid_date = SFForms.Utilities.Time.gm(year, matches[1], matches[2]);
		        }
	        }
	
	        return valid_date;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="9F1D5912E7D8DB0B5D5CD9A0B691348C" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def contribution(one_dollar,five_dollars,ten_dollars,twenty_dollars,many_dollars,value)
	        case
		        when (!one_dollar.strip.empty?): '%0.0f' % (1.0)
		        when (!five_dollars.strip.empty?): '%0.0f' % (5.0)
		        when (!ten_dollars.strip.empty?): '%0.0f' % (10.0)
		        when (!twenty_dollars.strip.empty?): '%0.0f' % (20.0)
		        when (!(many_dollars+value).strip.empty?): '%0.0f' % (value.to_f)
		        else ''
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function contribution(one_dollar,five_dollars,ten_dollars,twenty_dollars,many_dollars,value) {
          if (!one_dollar.trim().isEmpty()) { return (1.0).fixed(0); }
          else if (!five_dollars.trim().isEmpty()) { return (5.0).fixed(0); }
          else if (!ten_dollars.trim().isEmpty()) { return (10.0).fixed(0); }
          else if (!twenty_dollars.trim().isEmpty()) { return (20.0).fixed(0); }
          else if (!many_dollars.trim().isEmpty()) { return value.to_f(); }
          else { return ''; }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="DC1B059928C7EF606125951B19AEAB68" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_6(a)
	        if( a[0] < 65 ) or ( a[0] > 90 ) then 0
	        elsif( a[0] < 74 ) then a[0] - 64
	        elsif a[0] < 83 then a[0] - 73
	        else a[0] - 81
	        end
        end      
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function amap_6(a)
		    {
			    // capital letters A-I and J-R are mapped to numbers 1-9; letters S-Z are mapped to numbers 2-9
			    // special characters and lowercase letters are zero

			    if(typeof a !== "string") { return 0; }

			    var firstLetterCode = a.charCodeAt(0);

			    if (firstLetterCode < 65 || firstLetterCode > 90) { return 0; }
			    else if (firstLetterCode < 74) { return firstLetterCode - 64; }
			    else if (firstLetterCode < 83) { return firstLetterCode - 73; }
			    else { return firstLetterCode - 81; }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="8BE473430410F64FCA2F7FC30A82CB4C" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def amap_8(a)
	        case (a)
		        when ("&"): 36
		        when ("0".."9"): a.to_i
		        when ("A".."Z"): a[0] - 55
		        else 37
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
        function amap_8(a) {
          var defaultResult = 37;
          var firstLetter = a.charAt(0);
          if(typeof a !== "string") { return defaultResult; }
          var firstLetterCode = a.charCodeAt(0);
          if(firstLetter === '&') { return 36; }
          if(/[0-9]/.test(firstLetter)) { return firstLetter.to_i(); }
          if(/[A-Z]/.test(firstLetter)) { return firstLetterCode - 55; }
          return defaultResult;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="amap6BlockDigitsMustReturnZero" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode>
            <![CDATA[
        function amap_6(a) {
          var defaultResult = 0;
          var firstLetter = a.charAt(0);
          if(typeof a !== "string") { return defaultResult; }
          var firstLetterCode = a.charCodeAt(0);
          if(/[A-I]/.test(firstLetter)) { return firstLetterCode - 64; }
          if(/[J-R]/.test(firstLetter)) { return firstLetterCode - 73; }
          if(/[S-Z]/.test(firstLetter)) { return firstLetterCode - 81; }
          return defaultResult;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="7F6B22268C40C6BC180E834AD0502A14" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)

	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end
	
	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = amap_6(input[i, 1]) * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        ((modulus - (sum % modulus)) % modulus) % 10
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
		{
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = amap_6(inputStr.substr(i, 1)) * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? (step % 10) + Math.floor(step / 10) : step);
			}

			// Value to return as a single digit integer.
			return (((modulusInt - (sum % modulusInt)) % modulusInt) % 10);
		}
      ]]></JavaScriptCode>
	</Block>
	<Block id="1BF92C65160C45A630CCB987990CA7B7" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def amap_6(a)
	        case (a)
		        when ("0".."9"): a.to_i
		        when ("A".."I"): a[0] - 64
		        when ("J".."R"): a[0] - 73
		        when ("S".."Z"): a[0] - 81
		        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
        function amap_6(a) {
          var defaultResult = 0;
          var firstLetter = a.charAt(0);
          if(typeof a !== "string") { return defaultResult; }
          var firstLetterCode = a.charCodeAt(0);
          if(/[0-9]/.test(firstLetter)) { return firstLetter.to_i(); }
          if(/[A-I]/.test(firstLetter)) { return firstLetterCode - 64; }
          if(/[J-R]/.test(firstLetter)) { return firstLetterCode - 73; }
          if(/[S-Z]/.test(firstLetter)) { return firstLetterCode - 81; }
          return defaultResult;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="1443527CFC01E0CC466E2B313B120B34" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def field_formatter(type, field)
	        field=field.strip

	        case (type)
		        when ("ADDR")
			        field_length = 30
			        field = field.gsub(","," ").squeeze(" ").delete("^A-Z0-9 .&-").strip[0,field_length]

		        when ("CITY")
			        field_length = 15
			        field = field.gsub("-"," ").delete("^A-Z ").squeeze(" ").strip[0,field_length]

		        when ("ZIP")
			        field_length = 9
			        field = field.delete("^0-9")[0,field_length]

		        when ("NAME")
			        field_length = 30
			        field = $' if (field.gsub("."," ") =~ /^(MR|MS|MRS|MISS|DR|REV|PROF) +/)
			        field = field.delete("^A-Z0-9 &-").strip[0,field_length]

		        when ("CITY_STATE_ZIP")
			        field_length = 75
			        field = "#{$`} #{$1}#{$2} #{$'}" if (field =~ /(\d{5}) *-? *(\d{4})?/)
			        field = field.gsub(/[,-]/," ").delete("^A-Z0-9 ").squeeze(" ").strip
	        end

	        (field.empty? ? "" : " " * (field_length - field.length) + field)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function field_formatter(type, field) {
          field = field.trim();
          var field_length = field.length;
          switch(type) {
            case 'ADDR':
              field_length = 30;
              field = field.gsub(',',' ').squeeze(' ').replace(/[^A-Z0-9\\s\\.&-]/g,'').trim().substr(0, field_length);
              break;
            case 'CITY':
              field_length = 15;
              field = field.gsub('-',' ').squeeze(' ').replace(/[^A-Z\\s]/g,'').trim().substr(0, field_length);
              break;
            case 'ZIP':
              field_length = 9;
              field = field.replace(/[^0-9]/g,'').substr(0, field_length);
              break;
            case 'NAME':
              field_length = 30;
              var nameMatch = /^(MR|MS|MRS|MISS|DR|REV|PROF)\\s+(.+)/.exec(field.gsub('.',' '));
              if(nameMatch != null) { field = nameMatch[2]; }
              field = field.replace(/[^A-Z0-9\\s&-]/g,'').trim().substr(0, field_length);
              break;
            case 'CITY_STATE_ZIP':
              field_length = 75;
              var csZipRegEx = /(\\d{5})\\s*-?\\s*(\\d{4})?/;
              var csZipMatch = csZipRegEx.exec(field);
              if(csZipMatch != null) { field = field.replace(csZipRegEx,' $1$2 '); }
              field = field.gsub(/[,-]/,' ').replace(/[^A-Z0-9\\s]/g,'').squeeze(' ').trim();
              break;
            default: break;
          }
          var paddingLeft = ' '.repeat(field_length - field.length);
          field = field.isEmpty() ? '' : paddingLeft + field;
          return field;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="A16DC131FE6BC40A2EB4FBA5F167B583" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(a)
	        a = a.to_f.round
	        if (a >= 25001) then 1650.0 + ((a - 25000.0) * 0.085)
	        elsif (a >= 10001) then 600.0 + ((a - 10000.0) * 0.07)
	        else a * 0.06
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function compute_tax(a) 
        {
          // Don't use .to_i because that chops off cents instead of rounding.
          a = a.to_f().round();
          if (a >= 25001) 
          { 
            return (1650.0 + ((a - 25000.0) * 0.085)); 
          }
          else if (a >= 10001) 
          { 
	          // It's okay to just do a straight multiplication here.  The minimum calcs below and line 11 takes the larger amount, so if this
	          // computes to a negative number it will never show.
            return (600.0 + ((a - 10000.0) * 0.07)); 
          }
          else 
          { 
            return (a * 0.06); 
          }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="C8A0626EB08DC4CB660FA081B09A6C38" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def credit_rate(percent)
	        if (percent < 101.0) then 0.0
	        elsif (percent < 102.0) then 0.015
	        elsif (percent < 103.0) then 0.02
	        else 0.025
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function credit_rate(percent)
        {
	        if (percent < 101.0) { return 0.0; }
	        else if (percent < 102.0) { return 0.015; }
	        else if (percent < 103.0) { return 0.02; }
	        else { return 0.025; }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="6587E7B2B26895A0614E66440299613D" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_credit(allocated_income)							
	        if (allocated_income < 0.0) then return 0 end						
	        case allocated_income	
		        when (0.0..160000.0)					
			        credit = 100.0
		        when (160000.01..164999.0)					
			        credit = 80.0		
		        when (164999.01..169999.0)					
			        credit = 60.0		
		        when (169999.01..174999.0)					
			        credit = 40.0
		        when (174999.01..180000.0)					
			        credit = 20.0
		        else					
			        credit = 0.0				
	        end						
	        return credit						
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function compute_credit(allocated_income)
        {
	        if (allocated_income < 0.0) { return 0; }
	
	        if (allocated_income >= 0.0 && allocated_income <= 160000.0) { return 100.0; }
	        else if (allocated_income >= 160000.01.0 && allocated_income <= 164999.0) { return 80.0; }
	        else if (allocated_income >= 164999.01 && allocated_income <= 169999.0) { return 60.0; }
	        else if (allocated_income >= 169999.01 && allocated_income <= 174999.0) { return 40.0; }
	        else if (allocated_income >= 174999.01 && allocated_income <= 180000.0) { return 20.0; }
	        else { return 0.0; }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="C918E77A335E7A3F2A49D9785FF7C1D7" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...15000.01)					
			        tax = '.35'			
		        when (15000.01...17000.01)					
			        tax = '.34'		
		        when (17000.01...19000.01)					
			        tax = '.33'				
		        when (19000.01...21000.01)					
			        tax = '.32'		
		        when (21000.01...23000.01)					
			        tax = '.31'			
		        when (23000.01...25000.01)					
			        tax = '.30'				
		        when (25000.01...27000.01)					
			        tax = '.29'				
		        when (27000.01...29000.01)					
			        tax = '.28'				
		        when (29000.01...31000.01)					
			        tax = '.27'				
		        when (31000.01...33000.01)					
			        tax = '.26'				
		        when (33000.01...35000.01)					
			        tax = '.25'
		        when (35000.01...37000.01)					
			        tax = '.24'			
		        when (37000.01...39000.01)					
			        tax = '.23'				
		        when (39000.01...41000.01)					
			        tax = '.22'				
		        when (41000.01...43000.01)					
			        tax = '.21'
		        else
			        tax = '.20'
	        end

	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function compute_tax(taxable_income)
        {
          taxable_income = taxable_income.to_f();
          var computeTaxResult = 0.0;
          
          if (taxable_income <= 0.0) { return computeTaxResult; }

          if(0.01<= taxable_income  && taxable_income < 15000.01) { computeTaxResult = 0.35; }
          else if(15000.01 <= taxable_income && taxable_income< 17000.01) { computeTaxResult = 0.34; }
          else if(17000.01 <= taxable_income && taxable_income< 19000.01) { computeTaxResult = 0.33; }
          else if(19000.01 <= taxable_income && taxable_income< 21000.01) { computeTaxResult = 0.32; }
          else if(21000.01 <= taxable_income && taxable_income< 23000.01) { computeTaxResult = 0.31; }
          else if(23000.01 <= taxable_income && taxable_income< 25000.01) { computeTaxResult = 0.30; }
          else if(25000.01 <= taxable_income && taxable_income< 27000.01) { computeTaxResult = 0.29; }
          else if(27000.01 <= taxable_income && taxable_income< 29000.01) { computeTaxResult = 0.28; }
          else if(29000.01 <= taxable_income && taxable_income< 31000.01) { computeTaxResult = 0.27; }
          else if(31000.01 <= taxable_income && taxable_income< 33000.01) { computeTaxResult = 0.26; }
          else if(33000.01 <= taxable_income && taxable_income< 35000.01) { computeTaxResult = 0.25; }
          else if(35000.01 <= taxable_income && taxable_income< 37000.01) { computeTaxResult = 0.24; }
          else if(37000.01 <= taxable_income && taxable_income< 39000.01) { computeTaxResult = 0.23; }
          else if(39000.01 <= taxable_income && taxable_income< 41000.01) { computeTaxResult = 0.22; }
          else if(41000.01 <= taxable_income && taxable_income< 43000.01) { computeTaxResult = 0.21; }
          else { computeTaxResult = 0.20; }

          return computeTaxresult;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="6121438813D216BDF19AD40D61082C2F" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else


			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix +

			        if( !profile.married_joint.strip.empty? )
				        ' & ' + (profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix)
			        else
				        ''
			        end

			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'

		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
	          // Decide if profile's business or personal information should be used.
	          if (business && !profile.business_name.trim().isEmpty())
	          {
		        // Use business information.
		        name = profile.business_name;
		        if (profile.business_address.trim().isEmpty())
		        {
		          address1 = profile.address;
		          if (!profile.apartment_number.trim().isEmpty())
		          {
			        address2 = 'Apt. #' + profile.apartment_number;
		          }
		          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
		        }
		        else
		        {
		          address1 = profile.business_address;
		          address2 = profile.business_address2;
		          address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
		        }
	          }
	          else
	          {
		        // Using personal information.
    				// NOTE: THE INDIVIDUAL NAME SECTION BELOW HAS BEEN MODIFIED TO FLOW SPOUSE NAME IF JOINT.
		        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
				    // CHECK FOR SPOUSE.
				    if( !profile.married_joint.trim().isEmpty() )
				    {
					    name += ' & ' + (profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix);
				    }
				    // END CHECK FOR SPOUSE.
		        address1 = profile.address;
				    if (!profile.apartment_number.trim().isEmpty())
				    {
					    address2 = 'Apt. #' + profile.apartment_number;
				    }
		        address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	          }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
	          name = profile.name;
	          address1 = profile.address;
	          address2 = profile.address2;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
	          // Use Firm name if available 
	          if (!profile.firm_name.trim().isEmpty())
	          {
		        name = profile.firm_name;
	          }
	          else
	          {
		        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
	          }
	          address1 = profile.address;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
	          // Use entity name if available.
	          if (profile.applicant_entity_name.trim().isEmpty())
	          {
		        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
	          }
	          else
	          {
		        name = profile.applicant_entity_name;
	          }
	          address1 = profile.applicant_address;
	          if (!profile.applicant_po_box.trim().isEmpty())
	          {
		        address2 = 'P.O. Box ' + profile.applicant_po_box;
	          }
	          address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
		            address2 = address3;
		            address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="CDB9ABCBBE986B4258AF91949B8FDF5A" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else


			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix
			        address2 = profile.address + ( profile.apartment_number.strip.empty? ? '' : ' ' + 'Apt. #' + profile.apartment_number )
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'

		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4

			        if (address1.empty?)
				        address1 = address2
				        address2 = address3
				        address3 = ''
			        end
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end

	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
	          // Decide if profile's business or personal information should be used.
	          if (business && !profile.business_name.trim().isEmpty())
	          {
		        // Use business information.
		        name = profile.business_name;
		        if (profile.business_address.trim().isEmpty())
		        {
		          address1 = profile.address;
		          if (!profile.apartment_number.trim().isEmpty())
		          {
			        address2 = 'Apt. #' + profile.apartment_number;
		          }
		          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
		        }
		        else
		        {
		          address1 = profile.business_address;
		          address2 = profile.business_address2;
		          address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
		        }
	          }
	          else
	          {
		        // Using personal information.
		        // address1 and address2 were modified
		        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
		        address1 = profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix;
		        address2 = profile.address + ( profile.apartment_number.trim().isEmpty() ? '' : ' ' + 'Apt. #' + profile.apartment_number );
		        address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	          }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
	          name = profile.name;
	          address1 = profile.address;
	          address2 = profile.address2;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
	          // Use Firm name if available 
	          if (!profile.firm_name.trim().isEmpty())
	          {
		        name = profile.firm_name;
	          }
	          else
	          {
		        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
	          }
	          address1 = profile.address;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
	          // Use entity name if available.
	          if (profile.applicant_entity_name.trim().isEmpty())
	          {
		        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
	          }
	          else
	          {
		        name = profile.applicant_entity_name;
	          }
	          address1 = profile.applicant_address;
	          if (!profile.applicant_po_box.trim().isEmpty())
	          {
		        address2 = 'P.O. Box ' + profile.applicant_po_box;
	          }
	          address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          // This first if statement was added.
		          if (address1.isEmpty())
		          {
			          address1 = address2;
			          address2 = address3;
			          address3 = '';
		          }
		          if (address2.isEmpty())
		          {
		            address2 = address3;
		            address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="67A714BC4C4282BA2FCC6B0431568714" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)
        amount = amount.to_f
	        if (amount > 40000.0)
	            (2678.0 + (0.0825 * (amount - 40000.0)))
	        elsif (amount > 30000.0)	
		        (1888.0 + (0.079 * (amount - 30000.0)))
	        elsif (amount > 20000.0)	
	                (1128.0 + (0.076 * (amount - 20000.0)))
	        elsif (amount > 16000.0)	
		        (840.0 + (0.072 * (amount - 16000.0)))
	        elsif (amount > 12000.0)	
		        (568.0 + (0.068 * (amount - 12000.0))) 
	        elsif (amount > 8000.0)
		        (312.00 + (0.064 * (amount - 8000.0)))  
	        elsif (amount > 4000.0)
		        (92.0 + (0.055 * (amount - 4000.0))) 
	        elsif (amount > 2000.0)
		        (28.0 + (0.032 * (amount - 2000.0))) 
	        elsif (amount > 0.0)
		        (amount * 0.014)
	        else
		        0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function tax(amount)
		    {
			    amount = amount.to_f();
			    if (amount > 40000.0)
				    { return (2678.0 + (0.0825 * (amount - 40000.0))); }
			    else if (amount > 30000.0)	
				    { return (1888.0 + (0.079 * (amount - 30000.0))); }
			    else if (amount > 20000.0)	
				    { return (1128.0 + (0.076 * (amount - 20000.0))); }
			    else if (amount > 16000.0)	
				    { return (840.0 + (0.072 * (amount - 16000.0))); }
			    else if (amount > 12000.0)	
				    { return (568.0 + (0.068 * (amount - 12000.0))); }
			    else if (amount > 8000.0)
				    { return (312.00 + (0.064 * (amount - 8000.0))); }
			    else if (amount > 4000.0)
				    { return (92.0 + (0.055 * (amount - 4000.0))); }
			    else if (amount > 2000.0)
				    { return (28.0 + (0.032 * (amount - 2000.0))); }
			    else if (amount > 0.0)
				    { return (amount * 0.014); }
			    else
				    { return 0.0; }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="4033E69C26FE9F2DB6B9E1DB16A9CF8D" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)			 		
	        return 0.0 if (taxable_income < 960000.0)
	        return case taxable_income
			        when (960000...1930000): 200.0		
			        when (1930000...9650000): 580.0
			        when (9650000...19300000): 1930.0
			        when (19300000...38590000): 3860.0
			        else 9650.0
		        end
        end			
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)			 		
		    {
			    if (taxable_income < 960000.0)
			    {
				    return 0.0; 
			    }

			    if (taxable_income >= 960000 && taxable_income <= 1930000) { return 200.0; }
			    else if (taxable_income >= 1930000 && taxable_income <= 9650000) { return 580.0; }
			    else if (taxable_income >= 9650000 && taxable_income <= 19300000) { return 1930.0; }
			    else if (taxable_income >= 19300000 && taxable_income <= 38590000) { return 3860.0; }
			    else { return 9650.0; }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="73C9DBED4B746FF96BD98A28496A20F1" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case (taxable_income)
		        when (0.01..2000.0): taxable_income * 0.014
		        when (2000.01..4000.0): ((taxable_income - 2000.0) * 0.032) + 28.0
		        when (4000.01..8000.0): ((taxable_income - 4000.0) * 0.055) + 92.0
		        when (8000.01..12000.0): ((taxable_income - 8000.0) * 0.064) + 312.0
		        when (12000.01..16000.0): ((taxable_income - 12000.0) * 0.068) + 568.0
		        when (16000.01..20000.0): ((taxable_income - 16000.0) * 0.072) + 840.0
		        when (20000.01..30000.0): ((taxable_income - 20000.0) * 0.076) + 1128.0
		        when (30000.01..40000.0): ((taxable_income - 30000.0) * 0.079) + 1888.0
		        else ((taxable_income - 40000.0) * 0.0825) + 2678.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)
		    {
			    if (taxable_income <= 0.0) {return 0.0; }

			    if (taxable_income >= 0.01 && taxable_income <= 2000.0) { return taxable_income * 0.014; }
			    if (taxable_income >= 2000.01 && taxable_income <= 4000.0) { return ((taxable_income - 2000.0) * 0.032) + 28.0; }
			    if (taxable_income >= 4000.01 && taxable_income <= 8000.0) { return ((taxable_income - 4000.0) * 0.055) + 92.0; }
			    if (taxable_income >= 8000.01 && taxable_income <= 12000.0) { return ((taxable_income - 8000.0) * 0.064) + 312.0; }
			    if (taxable_income >= 12000.01 && taxable_income <= 16000.0) { return ((taxable_income - 12000.0) * 0.068) + 568.0; }
			    if (taxable_income >= 16000.01 && taxable_income <= 20000.0) { return ((taxable_income - 16000.0) * 0.072) + 840.0; }
			    if (taxable_income >= 20000.01 && taxable_income <= 30000.0) { return ((taxable_income - 20000.0) * 0.076) + 1128.0; }
			    if (taxable_income >= 30000.01 && taxable_income <= 40000.0) { return ((taxable_income - 30000.0) * 0.079) + 1888.0; }
			    else { return ((taxable_income - 40000.0) * 0.0825) + 2678.0; }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="9662DB5BE74094825AB0A74A5AF2ACEB" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''
	        global_truncate = false
	        truncate0 = truncate1 = 0
	        data_flow = Array.new

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'


		        if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
			        name = profile.firm_name
		        else
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        data_flow[0] = name.squeeze(' ').strip
	        data_flow[1] = address1.squeeze(' ').strip
	        data_flow[2] = address2.squeeze(' ').strip
	        data_flow[3] = address3.squeeze(' ').strip


	        if (lines[0] =~ /\A(\[)(\d+)(\,)(\d+)(\])\z/)
		        global_truncate = true
		        truncate0 = $2.to_i
		        truncate1 = $4.to_i
		        lines.delete_at(0)
	        end


	        case lines.length
		        when 1
			        data_flow[0] = (name + ' ' + address1 + ' ' + address2 + ' ' + address3).squeeze(' ').strip
		        when 2
			        data_flow[1] = (address1 + ' ' + address2 + ' ' + address3).squeeze(' ').strip
		        when 3
			        data_flow[1] = (address1 + ' ' + address2).squeeze(' ').strip
			        data_flow[2] = data_flow[3]
		        when 4
			        if (address2.empty?) 
				        data_flow[2] = data_flow[3]
				        data_flow[3] = ''
			        end
	        end


	        lines.each_index { |index|
		        if (!data_flow[index].empty?)
			        if (lines[index] =~ /\A(box\d+_\d+)(\[)(\d+)(\,)(\d+)(\])\z/)
				        data_flow[index] = data_flow[index][$3.to_i, $5.to_i]
				        lines[index] = $1
			        elsif (global_truncate)
				        data_flow[index] = data_flow[index][truncate0, truncate1]
			        end
			        print lines[index], data_flow[index]
		        end
	        }
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
		    {
			    if (typeof business === 'undefined') { business = false; }

			    var name = '';
			    var address1 = '';
			    var address2 = '';
			    var address3 = '';
			    var global_truncate = false;
			    var truncate0 = 0;
			    var truncate1 = 0;
			    var data_flow = ["", "", "", ""];
          
			    if (profile instanceof SFForms.Profiles.Individual)
			    {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
					    // Using personal information.
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
					    address1 = profile.address;
					    if (!profile.apartment_number.trim().isEmpty())
					    {
						    address2 = 'Apt. #' + profile.apartment_number;
					    }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
			    }
			    else if (profile instanceof SFForms.Profiles.Entity)
			    {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
			    }
			    else if (profile instanceof SFForms.Profiles.Preparer)
			    {
				    // Use Firm name if available
				    if (!profile.firm_name.trim().isEmpty() && ((profile.self_employed.trim().isEmpty()) || (!profile.self_employed.trim().isEmpty() && business)))
				    {
					    name = profile.firm_name;
				    }
				    else 
				    {
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
			    }
			    else if (profile instanceof SFForms.Profiles.Fcc)
			    {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }
				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
			    }
			    else
			    {
				    return;
			    }
          
			    data_flow[0] = name.squeeze(' ').trim();
			    data_flow[1] = address1.squeeze(' ').trim();
			    data_flow[2] = address2.squeeze(' ').trim();
			    data_flow[3] = address3.squeeze(' ').trim();
		  
			    // Check for a global truncate.
			    var matches = /\A(\[)(\d+)(\,)(\d+)(\])\z/.exec(lines[0]);
			    if (matches != null && matches.length > 0)
			    {
				    global_truncate = true;
				    truncate0 = matches[2].to_i();
				    truncate1 = matches[4].to_i();
				    lines.splice(0, 1);
			    }

			    // Decide what lines are output.
			    switch (lines.length)
			    {
				    case 1:
					    data_flow[0] = (name + ' ' + address1 + ' ' + address2 + ' ' + address3).squeeze(' ').trim();
					    break;
				    case 2:
					    data_flow[1] = (address1 + ' ' + address2 + ' ' + address3).squeeze(' ').trim();
					    break;
				    case 3:
					    data_flow[1] = (address1 + ' ' + address2).squeeze(' ').trim();
					    data_flow[2] = data_flow[3];
					    break;
				    case 4:
					    if (address2.isEmpty()) 
					    {
						    data_flow[2] = data_flow[3];
						    data_flow[3] = '';
					    }
					    break;
			    }
          
		      for (var index = 0; index < lines.length; index++)
		      {
			      if (!dataflow[index].isEmpty())
			      {
				      matches = /\A(box\d+_\d+)(\[)(\d+)(\,)(\d+)(\])\z/.exec(lines[index]);
				      if (matches != null && matches.length > 0)
				      {
					      data_flow[index] =  data_flow[index].substring(matches[3].to_i(), matches[5].to_i());
					      lines[index] = matches[1];
				      }
				      else if (global_truncate)
				      {
					      data_flow[index] = data_flow[index].substring(truncate0, truncate1);
				      }
				      SFForms.StorageManager.setValue(formInstanceId, lines[index], data_flow[index]);
			      }
		      }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="C497B8BA52772C2542D29521EE06BBC2" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
        function renter_rebate(taxable_income)
        {
	        if (taxable_income <= 0.0 )
	        {
		        return 0;
	        }
	
	        if (taxable_income >= 0.0 && taxable_income <= 8000.0)
	        {
		        return 650.0;
	        }
	        else if (taxable_income >= 8001.0 && taxable_income <= 15000.0)
	        {
		        return 500.0;
	        }
	        else 
	        {
		        return 0.0;
	        }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="3D1C5455DED7980A9817ADD8234833BB" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
        function owner_rebate(taxable_income)
        {
	        if (taxable_income <= 0.0 )
	        {
		        return 0;
	        }
	
	        if (taxable_income >= 0.0 && taxable_income <= 8000.0)
	        {
		        return 650.0;
	        }
	        else if (taxable_income >= 8001.0 && taxable_income <= 15000.0)
	        {
		        return 500.0;
	        }
	        else if (taxable_income >= 15001.0 && taxable_income <= 18000.0)
	        {
		        return 300.0;
	        }
	        else if (taxable_income >= 18001.0 && taxable_income <= 35000.0)
	        {
		        return 250.0;
	        }
	        else 
	        {
		        return 0.0;
	        }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="52565995C1AEDAB46661A281C4B147AA" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_fee(license_fee)							
	        if (license_fee <= 0.0) then return 0 end						
	        case license_fee	
		        when (0.01..6.25)					
			        fee = 0.0
		        when (6.26..62.50)					
			        fee = 62.50		
		        else					
			        fee = 3125.0				
	        end						
	        return fee						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function compute_fee(license_fee)
        {
	        if (license_fee <= 0.0 )
	        {
		        return 0;
	        }
	
	        if (license_fee >= 0.01 && license_fee <= 6.25)
	        {
		        return 0.0;
	        }
	        else if (license_fee >= 6.26 && license_fee <= 62.50)
	        {
		        return 62.50;
	        }
	        else 
	        {
		        return 3125.0;
	        }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="952D64B101DA4D8368F17F4527DCDFA8" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = (profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + (profile.married_joint.strip.empty? ? '' : ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name))
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'

		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
		    {
          if (typeof business === 'undefined') { business = false; }
          
          var name = '';
          var address1 = '';
          var address2 = '';
          var address3 = '';
          
          if (profile instanceof SFForms.Profiles.Individual)
          {
            // Decide if profile's business or personal information should be used.
            if (business && !profile.business_name.trim().isEmpty())
            {
              // Use business information.
              name = profile.business_name;
              if (profile.business_address.trim().isEmpty())
			        {
                address1 = profile.address;
                if (!profile.apartment_number.trim().isEmpty())
                {
                  address2 = 'Apt. #' + profile.apartment_number;
                }
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
              else
              {
                address1 = profile.business_address;
                address2 = profile.business_address2;
                address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
              }
            }
            else
			      {
				      // Using personal information.
				      name = (profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + (profile.married_joint.trim().isEmpty() ? '' : ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name));
				      address1 = profile.address;
              if (!profile.apartment_number.trim().isEmpty())
              {
                address2 = 'Apt. #' + profile.apartment_number;
              }
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
          }
          else if (profile instanceof SFForms.Profiles.Entity)
          {
            name = profile.name;
            address1 = profile.address;
            address2 = profile.address2;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Preparer)
          {
			      // Use Firm name if available
            if (profile.firm_name.trim().isEmpty())
			      {
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
            }
            else
            {
              name = profile.firm_name;
            }
            address1 = profile.address;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Fcc)
          {
            // Use entity name if available.
            if (profile.applicant_entity_name.trim().isEmpty())
            {
              name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
            }
            else
            {
              name = profile.applicant_entity_name;
            }
            address1 = profile.applicant_address;
			      if (!profile.applicant_po_box.trim().isEmpty())
            {
				      address2 = profile.applicant_po_box;
			      }
            address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
          }
          else
          {
            return;
          }
          
          name = name.squeeze(' ').trim();
          address1 = address1.squeeze(' ').trim();
          address2 = address2.squeeze(' ').trim();
          address3 = address3.squeeze(' ').trim();
		  
		      // Decide what lines are output.
          switch (lines.length)
          {
            case 1:
              name += ' ' + address1 + ' ' + address2 + ' ' + address3;
              name = name.squeeze(' ').trim();
              address1 = '';
              address2 = '';
              address3 = '';
              break;
            case 2:
              address1 += ' ' + address2 + ' ' + address3;
              address1 = address1.squeeze(' ').trim();
              address2 = '';
              address3 = '';
              break;
            case 3:
              address1 += ' ' + address2;
              address1 = address1.squeeze(' ').trim();
              address2 = address3;
              address3 = '';
              break;
            case 4:
              if (address2.isEmpty())
              {
                address2 = address3;
                address3 = '';
              }
              break;
          }
          
          if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
          if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
          if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
          if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="1B8EF0D2EBE01B0900D1684EFDE43D3E" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = ''
	        address1 = ''
	        address2 = ''
	        address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'

		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = profile.applicant_po_box
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
		    {
          if (typeof business === 'undefined') { business = false; }
          
          var name = '';
          var address1 = '';
          var address2 = '';
          var address3 = '';
          
          if (profile instanceof SFForms.Profiles.Individual)
          {
            // Decide if profile's business or personal information should be used.
            if (business && !profile.business_name.trim().isEmpty())
            {
              // Use business information.
              name = profile.business_name;
              if (profile.business_address.trim().isEmpty())
			        {
                address1 = profile.address;
                if (!profile.apartment_number.trim().isEmpty())
                {
                  address2 = 'Apt. #' + profile.apartment_number;
                }
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
              else
              {
                address1 = profile.business_address;
                address2 = profile.business_address2;
                address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
              }
            }
            else
			      {
				      // Using personal information.
				      name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
				      address1 = profile.address;
              if (!profile.apartment_number.trim().isEmpty())
              {
                address2 = 'Apt. #' + profile.apartment_number;
              }
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
          }
          else if (profile instanceof SFForms.Profiles.Entity)
          {
            name = profile.name;
            address1 = profile.address;
            address2 = profile.address2;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Preparer)
          {
			      // Use Firm name if available
            if (profile.firm_name.trim().isEmpty())
			      {
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
            }
            else
            {
              name = profile.firm_name;
            }
            address1 = profile.address;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Fcc)
          {
            // Use entity name if available.
            if (profile.applicant_entity_name.trim().isEmpty())
            {
              name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
            }
            else
            {
              name = profile.applicant_entity_name;
            }
            address1 = profile.applicant_address;
            address2 = profile.applicant_po_box;
            address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
          }
          else
          {
            return;
          }
          
          name = name.squeeze(' ').trim();
          address1 = address1.squeeze(' ').trim();
          address2 = address2.squeeze(' ').trim();
          address3 = address3.squeeze(' ').trim();
		  
		      // Decide what lines are output.
          switch (lines.length)
          {
            case 1:
              name += ' ' + address1 + ' ' + address2 + ' ' + address3;
              name = name.squeeze(' ').trim();
              address1 = '';
              address2 = '';
              address3 = '';
              break;
            case 2:
              address1 += ' ' + address2 + ' ' + address3;
              address1 = address1.squeeze(' ').trim();
              address2 = '';
              address3 = '';
              break;
            case 3:
              address1 += ' ' + address2;
              address1 = address1.squeeze(' ').trim();
              address2 = address3;
              address3 = '';
              break;
            case 4:
              if (address2.isEmpty())
              {
                address2 = address3;
                address3 = '';
              }
              break;
          }
          
          if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
          if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
          if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
          if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="B317BD4A3DD1CDAC0152437377DC6733" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = ''
	        address1 = ''
	        address2 = ''
	        address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'

		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
		    {
          if (typeof business === 'undefined') { business = false; }
          
          var name = '';
          var address1 = '';
          var address2 = '';
          var address3 = '';
          
          if (profile instanceof SFForms.Profiles.Individual)
          {
            // Decide if profile's business or personal information should be used.
            if (business && !profile.business_name.trim().isEmpty())
            {
              // Use business information.
              name = profile.business_name;
              if (profile.business_address.trim().isEmpty())
			        {
                address1 = profile.address;
                if (!profile.apartment_number.trim().isEmpty())
                {
                  address2 = 'Apt. #' + profile.apartment_number;
                }
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
              else
              {
                address1 = profile.business_address;
                address2 = profile.business_address2;
                address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
              }
            }
            else
			      {
				      // Using personal information.
				      name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
				      address1 = profile.address;
              if (!profile.apartment_number.trim().isEmpty())
              {
                address2 = 'Apt. #' + profile.apartment_number;
              }
              
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
          }
          else if (profile instanceof SFForms.Profiles.Entity)
          {
            name = profile.name;
            address1 = profile.address;
            address2 = profile.address2;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Preparer)
          {
			      // Use Firm name if available
            if (profile.firm_name.trim().isEmpty())
			      {
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
            }
            else
            {
              name = profile.firm_name;
            }
            address1 = profile.address;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Fcc)
          {
            // Use entity name if available.
            if (profile.applicant_entity_name.trim().isEmpty())
            {
              name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
            }
            else
            {
              name = profile.applicant_entity_name;
            }
            address1 = profile.applicant_address;
            if (!profile.applicant_po_box.trim().isEmpty())
            {
              address2 = 'P.O. Box ' + profile.applicant_po_box;
            }
            address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
          }
          else
          {
            return;
          }
          
          name = name.squeeze(' ').trim();
          address1 = address1.squeeze(' ').trim();
          address2 = address2.squeeze(' ').trim();
          address3 = address3.squeeze(' ').trim();
		  
		      // Decide what lines are output.
          switch (lines.length)
          {
            case 1:
              name += ' ' + address1 + ' ' + address2 + ' ' + address3;
              name = name.squeeze(' ').trim();
              address1 = '';
              address2 = '';
              address3 = '';
              break;
            case 2:
              address1 += ' ' + address2 + ' ' + address3;
              address1 = address1.squeeze(' ').trim();
              address2 = '';
              address3 = '';
              break;
            case 3:
              address1 += ' ' + address2;
              address1 = address1.squeeze(' ').trim();
              address2 = address3;
              address3 = '';
              break;
            case 4:
              if (address2.isEmpty())
              {
                address2 = address3;
                address3 = '';
              }
              break;
          }
          
          if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
          if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
          if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
          if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="2E673D4D3C919C7D60E8116EF159838D" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines) {
          if (typeof business === 'undefined') { business = false; }
          
          var name = '';
          var address1 = '';
          var address2 = '';
          var address3 = '';
          
          if (profile instanceof SFForms.Profiles.Individual) {
            // Decide if profile's business or personal information should be used.
            if (business && !profile.business_name.trim().isEmpty()) {
              // Use business information.
              name = profile.business_name;
              if (profile.business_address.trim().isEmpty()) {
                address1 = profile.address;
                if (!profile.apartment_number.trim().isEmpty()) {
                  address2 = 'Apt. #' + profile.apartment_number;
                }
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
              else {
                address1 = profile.business_address;
                address2 = profile.business_address2;
                address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
              }
            }
            else {
              // Using personal information.
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
              address1 = profile.address;
              if (!profile.apartment_number.trim().isEmpty()) {
                address2 = 'Apt. #' + profile.apartment_number;
              }
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
          }
          else if (profile instanceof SFForms.Profiles.Entity) {
            name = profile.name;
            address1 = profile.address;
            address2 = profile.address2;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Preparer) {
            // Use firm name if available.
            if (profile.firm_name.trim().isEmpty()) {
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
            }
            else {
              name = profile.firm_name;
            }
            address1 = profile.address;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Fcc) {
            // Use entity name if available.
            if (profile.applicant_entity_name.trim().isEmpty()) {
              name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
            }
            else {
              name = profile.applicant_entity_name;
            }
            address1 = profile.applicant_address;
            if (profile.applicant_po_box.trim().isEmpty()) {
              address2 = 'P.O. Box ' + profile.applicant_po_box;
            }
            address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
          }
          else {
            return;
          }
          
          name = name.squeeze(' ').trim();
          address1 = address1.squeeze(' ').trim();
          address2 = address2.squeeze(' ').trim();
          address3 = address3.squeeze(' ').trim();
          switch (lines.length) {
            case 1:
              name += ' ' + address1 + ' ' + address2 + ' ' + address3;
              name = name.squeeze(' ').trim();
              address1 = '';
              address2 = '';
              address3 = '';
              break;
            case 2:
              address1 += ' ' + address2 + ' ' + address3;
              address1 = address1.squeeze(' ').trim();
              address2 = '';
              address3 = '';
              break;
            case 3:
              address1 += ' ' + address2;
              address1 = address1.squeeze(' ').trim();
              address2 = address3;
              address3 = '';
              break;
            case 4:
              if (address1.isEmpty()) {
                address1 = address2;
                address2 = address3;
                address3 = '';
              }
              if (address2.isEmpty()) {
                address2 = address3;
                address3 = '';
              }
              break;
          }
          
          if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
          if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
          if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
          if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="BA79C941AABAF4CC5288F6AC6B572511" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
		    {
          if (typeof business === 'undefined') { business = false; }
          
          var name = '';
          var address1 = '';
          var address2 = '';
          var address3 = '';
          
          if (profile instanceof SFForms.Profiles.Individual)
          {
            // Decide if profile's business or personal information should be used.
            if (business && !profile.business_name.trim().isEmpty())
            {
              // Use business information.
              name = profile.business_name;
              if (profile.business_address.trim().isEmpty())
			        {
                address1 = profile.address;
                if (!profile.apartment_number.trim().isEmpty())
                {
                  address2 = 'Apt. #' + profile.apartment_number;
                }
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
              else
              {
                address1 = profile.business_address;
                address2 = profile.business_address2;
                address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
              }
            }
            else
			      {
				      // Using personal information.
				      // NOTE: THE INDIVIDUAL NAME SECTION BELOW HAS BEEN MODIFIED TO FLOW SPOUSE NAME IF JOINT.
				      name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
				      // CHECK FOR SPOUSE.
				      if( !profile.married_joint.strip.empty? )
					    {
                name += ' & ' + (profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix);
              }
				      // END CHECK FOR SPOUSE.
				      address1 = profile.address;
				      if (!profile.apartment_number.trim().isEmpty())
              {
					      address2 = 'Apt. #' + profile.apartment_number;
				      }
				      address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
          }
          else if (profile instanceof SFForms.Profiles.Entity)
          {
            name = profile.name;
            address1 = profile.address;
            address2 = profile.address2;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Preparer)
          {
			      // Use Firm name if available
            if (profile.firm_name.trim().isEmpty())
			      {
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
            }
            else
            {
              name = profile.firm_name;
            }
            address1 = profile.address;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Fcc)
          {
            // Use entity name if available.
            if (profile.applicant_entity_name.trim().isEmpty())
            {
              name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
            }
            else
            {
              name = profile.applicant_entity_name;
            }
            address1 = profile.applicant_address;
			      if (!profile.applicant_po_box.trim().isEmpty())
            {
				      address2 = 'P.O. Box ' + profile.applicant_po_box;
			      }
            address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
          }
          else
          {
            return;
          }
          
          name = name.squeeze(' ').trim();
          address1 = address1.squeeze(' ').trim();
          address2 = address2.squeeze(' ').trim();
          address3 = address3.squeeze(' ').trim();
		  
		      // Decide what lines are output.
          switch (lines.length)
          {
            case 1:
              name += ' ' + address1 + ' ' + address2 + ' ' + address3;
              name = name.squeeze(' ').trim();
              address1 = '';
              address2 = '';
              address3 = '';
              break;
            case 2:
              address1 += ' ' + address2 + ' ' + address3;
              address1 = address1.squeeze(' ').trim();
              address2 = '';
              address3 = '';
              break;
            case 3:
              address1 += ' ' + address2;
              address1 = address1.squeeze(' ').trim();
              address2 = address3;
              address3 = '';
              break;
            case 4:
              if (address2.isEmpty())
              {
                address2 = address3;
                address3 = '';
              }
              break;
          }
          
          if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
          if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
          if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
          if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="9C94DA501FCE20F2D2ABCC111901B9F0" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else



			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name +

			        if( !profile.spouse_first_name.strip.empty? )
				        ' & ' + (profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name)
			        else
				        ''
			        end

			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'

		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
        {
          if (typeof business === 'undefined')
          {
            business = false;
          }
          
          var name = '';
          var address1 = '';
          var address2 = '';
          var address3 = '';
          
          if (profile instanceof SFForms.Profiles.Individual)
          {
            // Decide if profile's business or personal information should be used.
            if (business && !profile.business_name.trim().isEmpty())
            {
              // Use business information.
              name = profile.business_name;
              if (profile.business_address.trim().isEmpty())
              {
                address1 = profile.address;
                if (!profile.apartment_number.trim().isEmpty())
                {
                  address2 = 'Apt. #' + profile.apartment_number;
                }
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
              else
              {
                address1 = profile.business_address;
                address2 = profile.business_address2;
                address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
              }
            }
            else 
            {
				      // Using personal information.
				      // NOTE: THE INDIVIDUAL NAME SECTION BELOW HAS BEEN MODIFIED TO FLOW SPOUSE IF SPOUSE
				      //FIRST NAME EXISTS IN PROFILE.
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
              
			        // CHECK FOR SPOUSE.
			        if (!profile.spouse_first_name.trim().isEmpty())
			        {
                name += ' & ' + (profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name);
			        }
			        // END CHECK FOR SPOUSE.
              
              address1 = profile.address;
              if (!profile.apartment_number.trim().isEmpty()) {
                address2 = 'Apt. #' + profile.apartment_number;
              }
              
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
          }
          else if (profile instanceof SFForms.Profiles.Entity)
          {
            name = profile.name;
            address1 = profile.address;
            address2 = profile.address2;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Preparer)
          {
            // Use firm name if available.
            if (profile.firm_name.trim().isEmpty())
            {
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
            }
            else
            {
              name = profile.firm_name;
            }
            
            address1 = profile.address;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Fcc)
          {
            // Use entity name if available.
            if (profile.applicant_entity_name.trim().isEmpty())
            {
              name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
            }
            else
            {
              name = profile.applicant_entity_name;
            }
            
            address1 = profile.applicant_address;
            if (profile.applicant_po_box.trim().isEmpty())
            {
              address2 = 'P.O. Box ' + profile.applicant_po_box;
            }
            
            address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
          }
          else
          {
            return;
          }
          
          name = name.squeeze(' ').trim();
          address1 = address1.squeeze(' ').trim();
          address2 = address2.squeeze(' ').trim();
          address3 = address3.squeeze(' ').trim();
		  
		      // Decide what lines are output.
          switch (lines.length)
          {
            case 1:
              name += ' ' + address1 + ' ' + address2 + ' ' + address3;
              name = name.squeeze(' ').trim();
              address1 = '';
              address2 = '';
              address3 = '';
              break;
            case 2:
              address1 += ' ' + address2 + ' ' + address3;
              address1 = address1.squeeze(' ').trim();
              address2 = '';
              address3 = '';
              break;
            case 3:
              address1 += ' ' + address2;
              address1 = address1.squeeze(' ').trim();
              address2 = address3;
              address3 = '';
              break;
            case 4:
              if (address2.isEmpty())
              {
                address2 = address3;
                address3 = '';
              }
              break;
          }
          
          if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
          if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
          if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
          if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="B50ADB95418879C910EEFAAC3EF37DB3" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if ((profile.business_address.strip.empty?) and (profile.business_address2.strip.empty?))
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'


		        if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
			        name = profile.firm_name
		        else
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
        {
          if (typeof business === 'undefined')
          {
            business = false;
          }
          
          var name = '';
          var address1 = '';
          var address2 = '';
          var address3 = '';
          
          if (profile instanceof SFForms.Profiles.Individual)
          {
            // Decide if profile's business or personal information should be used.
            if (business && !profile.business_name.trim().isEmpty())
            {
              // Use business information.
              name = profile.business_name;
              if (profile.business_address.trim().isEmpty() && profile.business_address2.trim().isEmpty())
			        {
                address1 = profile.address;
                if (!profile.apartment_number.trim().isEmpty())
                {
                  address2 = 'Apt. #' + profile.apartment_number;
                }
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
              else
              {
                address1 = profile.business_address;
                address2 = profile.business_address2;
                address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
              }
            }
            else
			      {
				      // Using personal information.
				      name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
              address1 = profile.address;
              if (!profile.apartment_number.trim().isEmpty())
              {
                address2 = 'Apt. #' + profile.apartment_number;
              }
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
          }
          else if (profile instanceof SFForms.Profiles.Entity)
          {
            name = profile.name;
            address1 = profile.address;
            address2 = profile.address2;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Preparer)
          {
			      // Use Firm name if available and business = true.
			      // Use Preparer name if the Preparer is self-employed and business = false.
            if (!profile.firm_name.trim().isEmpty() && ((profile.self_employed.trim().isEmpty()) || (!profile.self_employed.trim().isEmpty() && business)))
			      {
              name = profile.firm_name;
            }
            else
            {
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
            }
            address1 = profile.address;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Fcc)
          {
            // Use entity name if available.
            if (profile.applicant_entity_name.trim().isEmpty())
            {
              name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
            }
            else
            {
              name = profile.applicant_entity_name;
            }
            address1 = profile.applicant_address;
            if (!profile.applicant_po_box.trim().isEmpty())
            {
              address2 = 'P.O. Box ' + profile.applicant_po_box;
            }
            address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
          }
          else
          {
            return;
          }
          
          name = name.squeeze(' ').trim();
          address1 = address1.squeeze(' ').trim();
          address2 = address2.squeeze(' ').trim();
          address3 = address3.squeeze(' ').trim();
		  
		      // Decide what lines are output.
          switch (lines.length)
          {
            case 1:
              name += ' ' + address1 + ' ' + address2 + ' ' + address3;
              name = name.squeeze(' ').trim();
              address1 = '';
              address2 = '';
              address3 = '';
              break;
            case 2:
              address1 += ' ' + address2 + ' ' + address3;
              address1 = address1.squeeze(' ').trim();
              address2 = '';
              address3 = '';
              break;
            case 3:
              address1 += ' ' + address2;
              address1 = address1.squeeze(' ').trim();
              address2 = address3;
              address3 = '';
              break;
            case 4:
              if (address2.isEmpty())
              {
                address2 = address3;
                address3 = '';
              }
              break;
          }
          
          if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
          if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
          if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
          if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="F01C1603578C5FEB612FFB6AEB78C303" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        if (business)

			        if (profile.self_employed.strip.empty?)
				        name = profile.firm_name
			        else
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
			        end
		        else

			        if (profile.firm_name.strip.empty?)
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
			        else
				        name = profile.firm_name
			        end
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
		    {
			    if (typeof business === 'undefined') { business = false; }

			    var name = '';
			    var address1 = '';
			    var address2 = '';
			    var address3 = '';
          
			    if (profile instanceof SFForms.Profiles.Individual)
			    {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
					    // Using personal information.
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
					    address1 = profile.address;
					    if (!profile.apartment_number.trim().isEmpty())
					    {
						    address2 = 'Apt. #' + profile.apartment_number;
					    }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
			    }
			    else if (profile instanceof SFForms.Profiles.Entity)
			    {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
			    }
			    else if (profile instanceof SFForms.Profiles.Preparer)
			    {
				    if (business)
				    {
					    // Use Preparer name if the Preparer is self-employed.
					    if (profile.self_employed.trim().isEmpty())
					    {
						    name = profile.firm_name;
					    }
					    else
					    {
						    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
					    }
				    }
				    else
				    {
					    // Use firm name if available.
					    if (profile.firm_name.trim().isEmpty())
						  {
                name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
              }
					    else
						  {
                name = profile.firm_name;
              }
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
			    }
			    else if (profile instanceof SFForms.Profiles.Fcc)
			    {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }
				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
			    }
			    else
			    {
				    return;
			    }
          
			    name = name.squeeze(' ').trim();
			    address1 = address1.squeeze(' ').trim();
			    address2 = address2.squeeze(' ').trim();
			    address3 = address3.squeeze(' ').trim();
		  
			    // Decide what lines are output.
			    switch (lines.length)
			    {
				    case 1:
					    name += ' ' + address1 + ' ' + address2 + ' ' + address3;
					    name = name.squeeze(' ').trim();
					    address1 = '';
					    address2 = '';
					    address3 = '';
					    break;
				    case 2:
					    address1 += ' ' + address2 + ' ' + address3;
					    address1 = address1.squeeze(' ').trim();
					    address2 = '';
					    address3 = '';
					    break;
				    case 3:
					    address1 += ' ' + address2;
					    address1 = address1.squeeze(' ').trim();
					    address2 = address3;
					    address3 = '';
					    break;
				    case 4:
					    if (address2.isEmpty())
					    {
						    address2 = address3;
						    address3 = '';
					    }
					    break;
			    }
          
			    if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
			    if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
			    if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
			    if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="B1AE3BA8097DC34520CDB62275AD7ED0" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else


			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix unless profile.married_joint.strip.empty?
			        address2 = profile.address + ( profile.apartment_number.strip.empty? ? '' : ' ' + 'Apt. #' + profile.apartment_number )
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'

		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4

			        if (address1.empty?)
				        address1 = address2
				        address2 = address3
				        address3 = ''
			        end
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end

	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
        {
          if (typeof business === 'undefined')
          {
            business = false;
          }
          
          var name = '';
          var address1 = '';
          var address2 = '';
          var address3 = '';
          
          if (profile instanceof SFForms.Profiles.Individual)
          {
            // Decide if profile's business or personal information should be used.
            if (business && !profile.business_name.trim().isEmpty())
            {
              // Use business information.
              name = profile.business_name;
              if (profile.business_address.trim().isEmpty())
			        {
                address1 = profile.address;
                if (!profile.apartment_number.trim().isEmpty())
                {
                  address2 = 'Apt. #' + profile.apartment_number;
                }
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
              else
              {
                address1 = profile.business_address;
                address2 = profile.business_address2;
                address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
              }
            }
            else
			      {
				      // Using personal information.
				      // address1 and address2 were modified
				      name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
				      if (!profile.married_joint.trim().isEmpty())
              {
				        address1 = profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix;
			        }
              
              if (!profile.apartment_number.trim().isEmpty())
              {
                address2 = profile.address + ( profile.apartment_number.trim().isEmpty() ? '' : ' ' + 'Apt. #' + profile.apartment_number )
              }
              
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
          }
          else if (profile instanceof SFForms.Profiles.Entity)
          {
            name = profile.name;
            address1 = profile.address;
            address2 = profile.address2;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Preparer)
          {
			      // Use Firm name if available and business = true.
            if (profile.firm_name.trim().isEmpty())
			      {
              name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
            }
            else
            {
              name = profile.firm_name;
            }
            
            address1 = profile.address;
            address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
          }
          else if (profile instanceof SFForms.Profiles.Fcc)
          {
            // Use entity name if available.
            if (profile.applicant_entity_name.trim().isEmpty())
            {
              name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
            }
            else
            {
              name = profile.applicant_entity_name;
            }
            
            address1 = profile.applicant_address;
            if (!profile.applicant_po_box.trim().isEmpty())
            {
              address2 = 'P.O. Box ' + profile.applicant_po_box;
            }
            
            address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
          }
          else
          {
            return;
          }
          
          name = name.squeeze(' ').trim();
          address1 = address1.squeeze(' ').trim();
          address2 = address2.squeeze(' ').trim();
          address3 = address3.squeeze(' ').trim();
		  
		      // Decide what lines are output.
          switch (lines.length)
          {
            case 1:
              name += ' ' + address1 + ' ' + address2 + ' ' + address3;
              name = name.squeeze(' ').trim();
              address1 = '';
              address2 = '';
              address3 = '';
              break;
            case 2:
              address1 += ' ' + address2 + ' ' + address3;
              address1 = address1.squeeze(' ').trim();
              address2 = '';
              address3 = '';
              break;
            case 3:
              address1 += ' ' + address2;
              address1 = address1.squeeze(' ').trim();
              address2 = address3;
              address3 = '';
              break;
            case 4:
				      // This first if statement was added.
				      if (address1.trim().isEmpty())
              {
					      address1 = address2;
					      address2 = address3;
					      address3 = '';
              }

              if (address2.isEmpty())
              {
                address2 = address3;
                address3 = '';
              }
              break;
          }
          
          if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
          if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
          if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
          if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="8C39BAB5E849A292E4105634F12A999E" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip

	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
		    {
			    if (typeof business === 'undefined') { business = false; }

			    var name = '';
			    var address1 = '';
			    var address2 = '';
			    var address3 = '';
          
			    if (profile instanceof SFForms.Profiles.Individual)
			    {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
					    // Using personal information.
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
					    address1 = profile.address;
					    if (!profile.apartment_number.trim().isEmpty())
					    {
						    address2 = 'Apt. #' + profile.apartment_number;
					    }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
			    }
			    else if (profile instanceof SFForms.Profiles.Entity)
			    {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
			    }
			    else
			    {
				    return;
			    }
          
			    name = name.squeeze(' ').trim();
			    address1 = address1.squeeze(' ').trim();
			    address2 = address2.squeeze(' ').trim();
			    address3 = address3.squeeze(' ').trim();
		  
			    // Decide what lines are output.
			    switch (lines.length)
			    {
				    case 1:
					    name += ' ' + address1 + ' ' + address2 + ' ' + address3;
					    name = name.squeeze(' ').trim();
					    address1 = '';
					    address2 = '';
					    address3 = '';
					    break;
				    case 2:
					    address1 += ' ' + address2 + ' ' + address3;
					    address1 = address1.squeeze(' ').trim();
					    address2 = '';
					    address3 = '';
					    break;
				    case 3:
					    address1 += ' ' + address2;
					    address1 = address1.squeeze(' ').trim();
					    address2 = address3;
					    address3 = '';
					    break;
				    case 4:
					    if (address2.isEmpty())
					    {
						    address2 = address3;
						    address3 = '';
					    }
					    break;
			    }
          
			    if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
			    if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
			    if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
			    if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="BF5D6717000A02B1B0C4DDAE1E67C24F" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = profile.last_name + ' ' + profile.first_name + ' ' + profile.middle_initial
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'


		        if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
			        name = profile.firm_name
		        else
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
		    {
			    if (typeof business === 'undefined') { business = false; }

			    var name = '';
			    var address1 = '';
			    var address2 = '';
			    var address3 = '';
          
			    if (profile instanceof SFForms.Profiles.Individual)
			    {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
					    // Using personal information.
					    name = profile.last_name + ' ' + profile.first_name + ' ' + profile.middle_initial;
					    address1 = profile.address;
					    if (!profile.apartment_number.trim().isEmpty())
					    {
						    address2 = 'Apt. #' + profile.apartment_number;
					    }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
			    }
			    else if (profile instanceof SFForms.Profiles.Entity)
			    {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
			    }
			    else if (profile instanceof SFForms.Profiles.Preparer)
			    {
				    // Use Firm name if available and business = true.
				    // Use Preparer name if the Preparer is self-employed and business = false.

				    if (!profile.firm_name.trim().isEmpty() && ((profile.self_employed.trim().isEmpty()) || (!profile.self_employed.trim().isEmpty() && business)))
				    {
					    name = profile.firm_name;
				    }
				    else
				    {
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
			    }
			    else if (profile instanceof SFForms.Profiles.Fcc)
			    {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }
				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
			    }
			    else
			    {
				    return;
			    }
          
			    name = name.squeeze(' ').trim();
			    address1 = address1.squeeze(' ').trim();
			    address2 = address2.squeeze(' ').trim();
			    address3 = address3.squeeze(' ').trim();
		  
			    // Decide what lines are output.
			    switch (lines.length)
			    {
				    case 1:
					    name += ' ' + address1 + ' ' + address2 + ' ' + address3;
					    name = name.squeeze(' ').trim();
					    address1 = '';
					    address2 = '';
					    address3 = '';
					    break;
				    case 2:
					    address1 += ' ' + address2 + ' ' + address3;
					    address1 = address1.squeeze(' ').trim();
					    address2 = '';
					    address3 = '';
					    break;
				    case 3:
					    address1 += ' ' + address2;
					    address1 = address1.squeeze(' ').trim();
					    address2 = address3;
					    address3 = '';
					    break;
				    case 4:
					    if (address2.isEmpty())
					    {
						    address2 = address3;
						    address3 = '';
					    }
					    break;
			    }
          
			    if (!name.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[0], name); }
			    if (!address1.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[1], address1); }
			    if (!address2.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[2], address2); }
			    if (!address3.trim().isEmpty()) { SFForms.StorageManager.setValue(formInstanceId, lines[3], address3); }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="A5A91588D110D33472815A52BCD1C361" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, collapse, *lines)
	        business = false unless business.kind_of? TrueClass
	        collapse = false unless collapse.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'


		        if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
			        name = profile.firm_name
		        else
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty? and collapse)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, collapse, lines) {
            if (typeof business === 'undefined') {
                business = false;
            }
            if (typeof collapse === 'undefined') {
                collapse = false;
            }
            var name = '';
            var address1 = '';
            var address2 = '';
            var address3 = '';
            if (profile instanceof SFForms.Profiles.Individual) {
                // Decide if profile's business or personal information should be used.
                if (business && !profile.business_name.trim().isEmpty()) {
                    // Use business information.
                    name = profile.business_name;
                    if (profile.business_address.trim().isEmpty()) {
                        address1 = profile.address;
                        if (!profile.apartment_number.trim().isEmpty()) {
                            address2 = 'Apt. #' + profile.apartment_number;
                        }
                        address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
                    }
                    else {
                        address1 = profile.business_address;
                        address2 = profile.business_address2;
                        address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
                    }
                }
                else {
                    // Using personal information.
                    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
                    address1 = profile.address;
                    if (!profile.apartment_number.trim().isEmpty()) {
                        address2 = ' Apt. #' + profile.apartment_number;
                    }
                    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
                }
            }
            else if (profile instanceof SFForms.Profiles.Entity) {
                name = profile.name;
                address1 = profile.address;
                address2 = profile.address2;
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
            else if (profile instanceof SFForms.Profiles.Preparer) {
                // Use firm name if available and business = true.
                // Use Preparer name if the Preparer is self-employed and business = false.
                if (!profile.firm_name.trim().isEmpty() && (profile.self_employed.trim().isEmpty() || (!profile.self_employed.trim().isEmpty() && business))) {
                    name = profile.firm_name;
                }
                else {
                    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
                }
                address1 = profile.address;
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
            else if (profile instanceof SFForms.Profiles.Fcc) {
                // Use entity name if available.
                if (profile.applicant_entity_name.trim().isEmpty()) {
                    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
                }
                else {
                    name = profile.applicant_entity_name;
                }
                address1 = profile.applicant_address;
                if (profile.applicant_po_box.trim().isEmpty()) {
                    address2 = 'P.O. Box ' + profile.applicant_po_box;
                }
                address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
            }
            else {
                return;
            }

            name = name.squeeze(' ').trim();
            address1 = address1.squeeze(' ').trim();
            address2 = address2.squeeze(' ').trim();
            address3 = address3.squeeze(' ').trim();

            // Decide what lines are output.
            switch (lines.length) {
                case 1:
                    name += ' ' + address1 + ' ' + address2 + ' ' + address3;
                    name = name.squeeze(' ').trim();
                    address1 = '';
                    address2 = '';
                    address3 = '';
                    break;
                case 2:
                    address1 += ' ' + address2 + ' ' + address3;
                    address1 = address1.squeeze(' ').trim();
                    address2 = '';
                    address3 = '';
                    break;
                case 3:
                    address1 += ' ' + address2;
                    address1 = address1.squeeze(' ').trim();
                    address2 = address3;
                    address3 = '';
                    break;
                case 4:
                    if (address2.isEmpty() && collapse) {
                        address2 = address3;
                        address3 = '';
                    }
                    break;
            }
            if (!name.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
            }
            if (!address1.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
            }
            if (!address2.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
            }
            if (!address3.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
            }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="EACE807884B1BDD8FB0810BA3394A28E" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        if (!profile.married_joint.strip.empty?)
				        name = (profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix) + ' & ' + (profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix)
			        else
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        end
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
    ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function name_block(profile, business, lines)
        {
          if (typeof business === 'undefined') 
          {
            business = false;
          }
          
          var name = '';
          var address1 = '';
          var address2 = '';
          var address3 = '';
          
          if (profile instanceof SFForms.Profiles.Individual)
          {
            // Decide if profile's business or personal information should be used.
              if (business && !profile.business_name.trim().isEmpty()) 
              {
                // Use business information.
                name = profile.business_name;
                if (profile.business_address.trim().isEmpty()) 
                {
                  address1 = profile.address;
                  if (!profile.apartment_number.trim().isEmpty()) 
                  {
                    address2 = 'Apt. #' + profile.apartment_number;
                  }
                  address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
                }
                else 
                {
                  address1 = profile.business_address;
                  address2 = profile.business_address2;
                  address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
                }
              }
              else 
              {
                // Using personal information.
					      if (!profile.married_joint.trim().isEmpty())
					      {
						      name = (profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix) + ' & ' + (profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix);
					      }
					      else
					      {
						      name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
					      }
                
                address1 = profile.address;
					      if (!profile.apartment_number.trim().isEmpty())
                {
				          address2 = 'Apt. #' + profile.apartment_number;
			          }
                
                if (!profile.apartment_number.trim().isEmpty()) 
                {
                  address2 = ' Apt. #' + profile.apartment_number;
                }
                
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
            }
            else if (profile instanceof SFForms.Profiles.Entity)
            {
              name = profile.name;
              address1 = profile.address;
              address2 = profile.address2;
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
            else if (profile instanceof SFForms.Profiles.Preparer) 
            {
              // Use firm name if available.
              if (profile.firm_name.trim().isEmpty())
              {
                name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
              }
              else
              {
                name = profile.firm_name;
              }
              
              address1 = profile.address;
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
            else if (profile instanceof SFForms.Profiles.Fcc)
            {
              // Use entity name if available.
              if (profile.applicant_entity_name.trim().isEmpty())
              {
                name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
              }
              else
              {
                name = profile.applicant_entity_name;
              }
              
              address1 = profile.applicant_address;
              if (!profile.applicant_po_box.trim().isEmpty())
              {
                address2 = 'P.O. Box ' + profile.applicant_po_box;
              }
              
              address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
            }
            else
            {
              return;
            }

            name = name.squeeze(' ').trim();
            address1 = address1.squeeze(' ').trim();
            address2 = address2.squeeze(' ').trim();
            address3 = address3.squeeze(' ').trim();
			
			      // Decide what lines are output.
            switch (lines.length)
            {
              case 1:
                name += ' ' + address1 + ' ' + address2 + ' ' + address3;
                name = name.squeeze(' ').trim();
                address1 = '';
                address2 = '';
                address3 = '';
                break;
              case 2:
                address1 += ' ' + address2 + ' ' + address3;
                address1 = address1.squeeze(' ').trim();
                address2 = '';
                address3 = '';
                break;
              case 3:
                address1 += ' ' + address2;
                address1 = address1.squeeze(' ').trim();
                address2 = address3;
                address3 = '';
                break;
              case 4:
                if (address2.isEmpty())
                {
                  address2 = address3;
                  address3 = '';
                }
                break;
            }
            
            if (!name.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
            }
            if (!address1.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
            }
            if (!address2.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
            }
            if (!address3.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
            }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="2209889EB74DF12E4CD980EC876EFB33" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'


		        if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
			        name = profile.firm_name
		        else
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
        {
            if (typeof business === 'undefined')
            {
              business = false;
            }
            var name = '';
            var address1 = '';
            var address2 = '';
            var address3 = '';
            if (profile instanceof SFForms.Profiles.Individual)
            {
              // Decide if profile's business or personal information should be used.
              if (business && !profile.business_name.trim().isEmpty())
              {
                // Use business information.
                name = profile.business_name;
                if (profile.business_address.trim().isEmpty())
                {
                  address1 = profile.address;
                  if (!profile.apartment_number.trim().isEmpty())
                  {
                    address2 = 'Apt. #' + profile.apartment_number;
                  }
                  address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
                }
                else
                {
                  address1 = profile.business_address;
                  address2 = profile.business_address2;
                  address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
                }
              }
              else
              {
                // Using personal information.
                name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
                address1 = profile.address;
                if (!profile.apartment_number.trim().isEmpty())
                {
                  address2 = ' Apt. #' + profile.apartment_number;
                }
                address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
              }
            }
            else if (profile instanceof SFForms.Profiles.Entity)
            {
              name = profile.name;
              address1 = profile.address;
              address2 = profile.address2;
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
            else if (profile instanceof SFForms.Profiles.Preparer)
            {
              // Use Firm name if available and business = true.
              // Use Preparer name if the Preparer is self-employed and business = false.
              if (!profile.firm_name.trim().isEmpty() && (profile.self_employed.trim().isEmpty() || (!profile.self_employed.trim().isEmpty() && business)))
              {
                name = profile.firm_name;
              }
              else
              {
                name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
              }
              address1 = profile.address;
              address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
            }
            else if (profile instanceof SFForms.Profiles.Fcc)
            {
              // Use entity name if available.
              if (profile.applicant_entity_name.trim().isEmpty())
              {
                name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
              }
              else
              {
                name = profile.applicant_entity_name;
              }
              address1 = profile.applicant_address;
              if (!profile.applicant_po_box.trim().isEmpty())
              {
                address2 = 'P.O. Box ' + profile.applicant_po_box;
              }
              address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
            }
            else
            {
              return;
            }
            
            name = name.squeeze(' ').trim();
            address1 = address1.squeeze(' ').trim();
            address2 = address2.squeeze(' ').trim();
            address3 = address3.squeeze(' ').trim();
				
            // Decide what lines are output.
            switch (lines.length)
            {
              case 1:
                name += ' ' + address1 + ' ' + address2 + ' ' + address3;
                name = name.squeeze(' ').trim();
                address1 = '';
                address2 = '';
                address3 = '';
                break;
              case 2:
                address1 += ' ' + address2 + ' ' + address3;
                address1 = address1.squeeze(' ').trim();
                address2 = '';
                address3 = '';
                break;
              case 3:
                address1 += ' ' + address2;
                address1 = address1.squeeze(' ').trim();
                address2 = address3;
                address3 = '';
                break;
              case 4:
                if (address2.isEmpty())
                {
                  address2 = address3;
                  address3 = '';
                }
                break;
            }
            
            if (!name.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
            }
            if (!address1.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
            }
            if (!address2.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
            }
            if (!address3.trim().isEmpty()) {
                SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
            }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="FECB8E133A320FC78D406DAEB7AD0C05" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else

			        if (profile.spouse_first_name.strip.empty?)
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        else
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix + ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix
			        end			
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'

		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
	          // Decide if profile's business or personal information should be used.
	          if (business && !profile.business_name.trim().isEmpty())
	          {
		        // Use business information.
		        name = profile.business_name;
		        if (profile.business_address.trim().isEmpty())
		        {
		          address1 = profile.address;
		          if (!profile.apartment_number.trim().isEmpty())
		          {
			        address2 = 'Apt. #' + profile.apartment_number;
		          }
		          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
		        }
		        else
		        {
		          address1 = profile.business_address;
		          address2 = profile.business_address2;
		          address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
		        }
	          }
	          else
	          {
		        // Using personal information.
		        if (profile.spouse_first_name.trim().isEmpty())
		        {
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
		        }
		        else
		        {
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix + ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix;
		        }
		
		        address1 = profile.address;
		        if (!profile.apartment_number.trim().isEmpty())
		        {
		          address2 = ' Apt. #' + profile.apartment_number;
		        }
		        address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	          }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
	          name = profile.name;
	          address1 = profile.address;
	          address2 = profile.address2;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
	          // Use Firm name if available 
	          if (!profile.firm_name.trim().isEmpty())
	          {
		        name = profile.firm_name;
	          }
	          else
	          {
		        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
	          }
	          address1 = profile.address;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
	          // Use entity name if available.
	          if (profile.applicant_entity_name.trim().isEmpty())
	          {
		        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
	          }
	          else
	          {
		        name = profile.applicant_entity_name;
	          }
	          address1 = profile.applicant_address;
	          if (!profile.applicant_po_box.trim().isEmpty())
	          {
		        address2 = 'P.O. Box ' + profile.applicant_po_box;
	          }
	          address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		        name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		        name = name.squeeze(' ').trim();
		        address1 = '';
		        address2 = '';
		        address3 = '';
		        break;
	          case 2:
		        address1 += ' ' + address2 + ' ' + address3;
		        address1 = address1.squeeze(' ').trim();
		        address2 = '';
		        address3 = '';
		        break;
	          case 3:
		        address1 += ' ' + address2;
		        address1 = address1.squeeze(' ').trim();
		        address2 = address3;
		        address3 = '';
		        break;
	          case 4:
		        if (address2.isEmpty())
		        {
		          address2 = address3;
		          address3 = '';
		        }
		        break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="923BDA05EBCD5E51CD2956BEC084EEC0" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
		    // -----------------------------------------
        // Placeholder for CheckBoxCtrl method definition
        // -----------------------------------------
      ]]></JavaScriptCode>
	</Block>
	<Block id="FE210E0B2F82949B5DD7D10B741C6818" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def CheckBoxCtrl(stateBox, chkList, bdg)
	          stateList = (eval("#{stateBox}", bdg).empty? ? "0," * chkList.length : eval("#{stateBox}", bdg)).split(",")

	          chkList.each_index do |i|

		        curState = "0b"
		        state = stateList[i].to_i

		        chkList[i].each do |box| curState += eval("#{box}.empty? ? '0' : '1'", bdg) end

		        curState = Integer(curState)
		        unless (curState == state)
			        print chkList[i][-(Math.frexp(state)[1])], eval("#{chkList[i][-(Math.frexp(state)[1])]}.replace('')", bdg) if ((state & curState) > 0)
			        stateList[i] = (state | curState) ^ state
			        print stateBox, eval("#{stateBox}", bdg).replace(stateList.join(","))
			        break
		        end
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
                  <![CDATA[
		function checkBoxCtrl(formInstanceId, stateBox, chkList) {
                var val = eval(stateBox);
                if (val != undefined) {
                    var stateArray = Array.prototype.slice.call((val.length == 0 ? ('0'.repeat(chkList.length)).split('').join(',') : val).split(','));
                    for (var i = 0; i < chkList.length; ++i) {
                        var curStateStr = '';
                        var state = stateArray[i].to_i();
                        for (var j = 0; j < chkList[i].length; ++j) {
                            var chk_val = eval(chkList[i][j]);
                            eval(`${chkList[i][j]} = '${chk_val}'`);
                            curStateStr += (chk_val.length == 0 ? '0' : '1');
                        }
                        var curState = parseInt(curStateStr, 2);
                        //
                        // This is frequently called the change base formula:
                        // log_b(y) = log_a(y) / log_a(b)
                        //
                        // We want log_2(N) where N = 1,2,4,8,16...etc. to get
                        // its binary bit position from the right.  
                        // Ie: 1000b => log_2(8) = 3
                        //     0100b => log_2(4) = 2
                        //
                        var index = Math.trunc((Math.log(state) / Math.log(10)) / (Math.log(2) / Math.log(10)));
                        
                        if (curState !== state) {
                            if ((state & curState) > 0) {
                                eval(`${chkList[i][chkList[i].length - index - 1]} = ''`);
                                SFForms.StorageManager.setValue(formInstanceId, chkList[i][chkList[i].length - index - 1], '');
                            }
                            stateArray[i] = (state | curState) ^ state;
                            SFForms.StorageManager.setValue(formInstanceId, stateBox, stateArray.toString());
                        }
                    }
                }
            }
      ]]></JavaScriptCode>
	</Block>
	<Block id="393FC654E254FCBDD35BCD748BB687AB" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        rem = sum % modulus
	        (rem > 1 ? modulus - rem : rem)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? (step % 10) + Math.floor(step / 10) : step);
			}

			// New check digit code (for mod 11 only!):
			var rem = sum % modulusInt;
			return (rem > 1 ? modulusInt - rem : rem);
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="81A22976A81E2D6BA7FD9E8E7D909105" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input)
	
	        if (input.strip.empty?) then return 0 end
	
	        mult = '234567'
	        len = input.length
	        input = input.reverse
	        mult_len = mult.length
	

	        if (len > mult_len)
		        mult = (mult * (len / mult_len)) + (mult[0, len % mult_len])
	        else
		        mult = mult[0, len]
	        end
	
	        sum = 0
	
	        0.upto(len - 1) { |i|
		        sum += input[i, 1].to_i * mult[i, 1].to_i
	        }
	
	        rem = sum % 11
	
	        return (rem < 2 ? (11 - rem) % 10 : 11 - rem).to_s
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function check_digit(input)
		    {
			    if (input.trim().length === 0)
			    {
				    return 0;
			    }

			    var mult = '234567';
			    var len = input.length;
			    input = input.split('').reverse().join('');
			    var mult_len = mult.length;

			    // set the multiplier to the proper length.
			    if (len > mult_len)
			    {
				    mult = mult.repeat(Math.floor(len / mult_len)) + mult.substring(0, len % mult_len);
			    }
			    else
			    {
				    mult = mult.substring(0, len);
			    }

			    var sum = 0;

			    for (var i = 0; i <= len - 1; i++)
			    {
				    sum += (input[i]).to_i() * (mult[i]).to_i();
			    }
			
			    var rem = sum % 11;
			    return (rem < 2 ? (11 - rem) % 10 : 11 - rem).toString();
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="19E7B7CA66E9FFAB6A97270DDAF4B0AD" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        (modulus - (sum % modulus)) % 10
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? (step % 10) + Math.floor(step / 10) : step);
			}

			// Value to return as a single digit integer.
			// Modified so the check digit is one when the remainder is zero instead of the check digit being zero.
			return ((modulusInt - (sum % modulusInt)) % 10);
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="89EB4BB89726A16FF1D4ACBFCBAE88F6" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        rem = sum % modulus
	        return (rem < 2 ? rem : 11 - rem).to_s
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// NOTE: Modified for VA - "If the remainder is 0 or 1, then the remainder
			// is the check digit. If the remainder is greater than 1, subtract from 11.
			// The result is the check digit".
			//  Value to return as a single digit string.
			var rem = sum % modulusInt;
			return (rem < 2 ? rem : 11 - rem).toString();
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="F375249D6ABC5FB73FBE6E1AD728F0A0" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)

	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end
	

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }


	        ((modulus - (sum % modulus)) % modulus) % 10
	
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments.
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			//Value to return as a single digit integer.
			return ((modulusInt - (sum % modulusInt)) % modulusInt) % 10;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="3A90AE9AEDE6EBBE71B9F02116F148F0" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)

	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end
	

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = delaware_amap(input[i, 1]) * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }


	        (modulus - (sum % modulus))
	
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):number
        {
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = delaware_amap(inputStr.substr(i, 1)) * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			return (modulusInt - (sum % modulusInt));
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="95B6F9FC9F373542A0D3D0961679BAC5" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input)
	
	        if (input.strip.empty?) then return 0 end
	
	        mult = '123456789'
	        len = input.length
	        mult_len = mult.length
	

	        if (len > mult_len)
		        mult = (mult * (len / mult_len)) + (mult[0, len % mult_len])
	        else
		        mult = mult[0, len]
	        end

	        sum = 0
	
	        0.upto(len - 1) { |i|
		        sum += input[i, 1].to_i * mult[i, 1].to_i
	        }

	        return '%02.0f' % ((sum % 11).to_s)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		function check_digit(input)
		{
			if (input.trim().length === 0)
			{
			  return 0;
			}

			var mult = '123456789';
			var len = input.length;
			var mult_len = mult.length;

			// set the multiplier to the proper length.
			if (len > mult_len)
			{
			  mult = mult.repeat(Math.floor(len / mult_len)) + mult.substring(0, len % mult_len);
			}
			else
			{
			  mult = mult.substring(0, len);
			}

			var sum = 0;

			for (var i = 0; i <= len - 1; i++)
			{
			  sum += (input[i]).to_i() * (mult[i]).to_i();
			}

			return ((sum % 11).complexFixedString(0, '02'));
		}
      ]]></JavaScriptCode>
	</Block>
	<Block id="8AD2A949EE9228D5C956555AD5FA86E4" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def day_suffix(day)
	        suffix = case day.to_i
		        when 1,21,31 then 'st'
		        when 2,22 then 'nd'
		        when 3,23 then 'rd'
	        else 'th'
	        end
	        day.to_i.to_s + suffix
        end
    ]]></RubyCode>
		<JavaScriptCode><![CDATA[
        function day_suffix(day: string): string
        {
          var dy:number = day.to_i();
          var suffix:string = 'th';
          
          switch (dy)
          {
            case 1:
            case 21:
            case 31:
              suffix = 'st';
              break;
            case 2:
            case 22:
              suffix = 'nd';
              break;
            case 3:
            case 23:
              suffix = 'rd';
              break;
          }
          
          return dy.to_i().toString() + suffix;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="00B1B3091261A5326556EAC34DCC25A4" scripttype="TS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
        function day_suffix(day: string): string
        {
          var dy:number = day.to_i();
          var suffix:string = 'th';
          
          switch (dy)
          {
            case 1:
            case 21:
            case 31:
              suffix = 'st';
              break;
            case 2:
            case 22:
              suffix = 'nd';
              break;
            case 3:
            case 23:
              suffix = 'rd';
              break;
          }
          
          return dy.toString() + suffix;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="382A71CE936A91FBD5EB65102D85FB90" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        if (profile.married_joint.strip.empty?)
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        else
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix + ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix
			        end			
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
	          // Decide if profile's business or personal information should be used.
	          if (business && !profile.business_name.trim().isEmpty())
	          {
		        // Use business information.
		        name = profile.business_name;
		        if (profile.business_address.trim().isEmpty())
		        {
		          address1 = profile.address;
		          if (!profile.apartment_number.trim().isEmpty())
		          {
			        address2 = 'Apt. #' + profile.apartment_number;
		          }
		          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
		        }
		        else
		        {
		          address1 = profile.business_address;
		          address2 = profile.business_address2;
		          address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
		        }
	          }
	          else
	          {
		        // Using personal information.
		        if (profile.married_joint.trim().isEmpty())
		        {
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
		        }
		        else
		        {
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix + ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix;
		        }
		        address1 = profile.address;
		        if (!profile.apartment_number.trim().isEmpty())
		        {
			        address2 = 'Apt. #' + profile.apartment_number;
		        }
		        address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	          }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
	          name = profile.name;
	          address1 = profile.address;
	          address2 = profile.address2;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
	          // Use Firm name if available 
	          if (!profile.firm_name.trim().isEmpty())
	          {
		        name = profile.firm_name;
	          }
	          else
	          {
		        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
	          }
	          address1 = profile.address;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
	          // Use entity name if available.
	          if (profile.applicant_entity_name.trim().isEmpty())
	          {
		        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
	          }
	          else
	          {
		        name = profile.applicant_entity_name;
	          }
	          address1 = profile.applicant_address;
	          if (!profile.applicant_po_box.trim().isEmpty())
	          {
		        address2 = 'P.O. Box ' + profile.applicant_po_box;
	          }
	          address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
		            address2 = address3;
		            address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="393D6B3CD9E2637EB828BB8CD325AEA7" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)

	        return 0.0 if (taxable_income < 0.0)
	        case (taxable_income)
		        when (0.0..25000.0): taxable_income * 0.0141
		        when (25000.01..50000.0): ((taxable_income - 25000.0) * 0.0355) + 352.50
		        else ((taxable_income - 50000.0) * 0.0431) + 1240.00
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)			 		
		    {
				  if (taxable_income < 0.0)
				  {
					  return 0.0;
				  }
				
				  if (taxable_income >= 0.0 && taxable_income <= 25000.0) { return taxable_income * 0.0141; }
				  else if (taxable_income >= 25000.01 && taxable_income <= 50000.0) { return ((taxable_income - 25000.0) * 0.0355) + 352.50; }
				  else { return ((taxable_income - 50000.0) * 0.0431) + 1240.00; }
			  }
      ]]></JavaScriptCode>
	</Block>
	<Block id="AC090A4FBC486EB72A5277763CFF5480" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)			 		
	        return 0.0 if (taxable_income < 970000.0)
	        return case taxable_income
			        when (970000...1939999): 200.0		
			        when (1940000...9689999): 580.0
			        when (9690000...19379999): 1940.0
			        when (19380000...38769999): 3880.0
			        else 9690.0
		        end
        end			
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)			 		
		    {
			    if (taxable_income < 970000.0)
			    {
				    return 0.0; 
			    }

			    if (taxable_income >= 970000 && taxable_income <= 1939999) { return 200.0; }
			    else if (taxable_income >= 1940000 && taxable_income <= 9689999) { return 580.0; }
			    else if (taxable_income >= 9690000 && taxable_income <= 19379999) { return 1940.0; }
			    else if (taxable_income >= 19380000 && taxable_income <= 38769999) { return 3880.0; }
			    else { return 9690.0; }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="77B5680267B4F7951425E40192EA2DD8" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)						
	        if (taxable_income <= 0.0) then return 0.0 end					
	        case taxable_income		
		        when (0.01..500000.0)					
			        tax = taxable_income * 0.2
		        when (500000.01..1000000.0)					
			        tax = ((taxable_income - 500000.0) * 0.15) + 100000.0
		        when (1000000.01..1500000.0)
			        tax = ((taxable_income - 1000000.0) * 0.10) + 175000.0
		        when (1500000.01..17000000.0)
			        tax = ((taxable_income - 1500000.0) * 0.05) + 225000.0
		        else
			        tax = 1000000.0
	        end
	        return tax
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)			 		
		    {
				  if (taxable_income < 0.0)
				  {
					  return 0.0;
				  }
				
				  if (taxable_income >= 0.01 && taxable_income <= 500000.0)					
				  {
					  return taxable_income * 0.2;
				  }
				  else if (taxable_income >= 500000.01 && taxable_income <= 1000000.0)					
				  {
					  return ((taxable_income - 500000.0) * 0.15) + 100000.0;
				  }
				  else if (taxable_income >= 1000000.01 && taxable_income <= 1500000.0)
				  {
					  return ((taxable_income - 1000000.0) * 0.10) + 175000.0;
				  }
				  else if (taxable_income >= 1500000.01 && taxable_income <= 17000000.0)
				  {
					  return ((taxable_income - 1500000.0) * 0.05) + 225000.0;
				  }
				  else
				  {
					  return 1000000.0;
				  }
			  }
      ]]></JavaScriptCode>
	</Block>
	<Block id="94B532E2A3C7AF34BD050CE94DAED8D0" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(amount)
	        if (amount > 10700.0) then 2764.0 + ((amount - 10700.0) * 0.35)
	        elsif (amount > 7850.0) then 1823.50 + ((amount - 7850.0) * 0.33)
	        elsif (amount > 5150.0) then 1067.50 + ((amount - 5150.0) * 0.28)
	        elsif (amount > 2200.0) then 330.0 + ((amount - 2200.0) * 0.25)
	        elsif (amount > 0.0) then amount * 0.15
	        else 0.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(amount)			 		
		    {
				  if (amount > 10700.0) { return 2764.0 + ((amount - 10700.0) * 0.35); }
				  else if (amount > 7850.0) { return 1823.50 + ((amount - 7850.0) * 0.33); }
				  else if (amount > 5150.0) { return 1067.50 + ((amount - 5150.0) * 0.28); }
				  else if (amount > 2200.0) { return 330.0 + ((amount - 2200.0) * 0.25); }
				  else if (amount > 0.0) { return amount * 0.15; }
				  else { return 0.0; }
  			}
      ]]></JavaScriptCode>
	</Block>
	<Block id="0F9A15170B8570920A820D067FB3FA45" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def min(a,b)
	        if( a.to_f < b.to_f )
		        a.to_f
	        else
		        b.to_f
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function min(a,b)
		    {
			    if ( a.to_f() < b.to_f() )
			    {
				    return a.to_f();
			    }
			    else
			    {
				    return b.to_f();
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="348758FECB82FFAFBEFD5F6809D07266" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def max(a,b)
	        if(a.to_f > b.to_f)
		        a.to_f
	        else
		        b.to_f
	        end
        end 
      ]]>
    </RubyCode>
		<JavaScriptCode>
      <![CDATA[
        function max(a, b)
        {
          if (a.to_f() > b.to_f())
          {
              return a.to_f();
          }
          else
          {
            return b.to_f();
          }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="0BC6AF5BF16C815A9F858E2F8A6701DF" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_6(a)
	        if( a[0] != nil )
		        if( a[0] > 47 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif( a[0] < 65 ) or ( a[0] > 90 ) then 0
		        elsif( a[0] < 74 ) then a[0] - 64
		        elsif a[0] < 83 then a[0] - 73
		        else a[0] - 81
		        end
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
		    function amap_6(a)
		    {
			    // capital letters A-I and J-R are mapped to numbers 1-9; letters S-Z are mapped to numbers 2-9;
			    // the numbers 0 - 9 are mapped to numbers 0-9; special characters and lowercase letters are zero
			    // result is an integer
			    if( a != null )
          {
				    if (( a.charCodeAt(0) > 47 ) && ( a.charCodeAt(0) < 58 )) { return a.charCodeAt(0) - 48; }
				    else if (( a.charCodeAt(0) < 65 ) || ( a.charCodeAt(0) > 90 )) { return 0; }
				    else if ( a.charCodeAt(0) < 74 ) { return a.charCodeAt(0) - 64; }
				    else if (a.charCodeAt(0) < 83) { return a.charCodeAt(0) - 73; }
				    else { return a.charCodeAt(0) - 81; }
          }
			    else 
			    {
				    return 0;
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="4B60512817FA09259A740A678951E04A" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_8(a)
	        if( a[0] != nil )
		        if( a[0] > 64 ) and ( a[0] < 91 ) then a[0] - 55
		        elsif( a[0] > 47 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif a[0] == 38 then 36
		        else 37
		        end
	        else 0
	        end
        end    
      ]]>
    </RubyCode>
		<JavaScriptCode>
      <![CDATA[
        function amap_8(a)
        {
          // capital letters A-Z are mapped to numbers 10 - 35; the numbers 0 - 9 are mapped to 0-9
          // an ampersand (&) is mapped to 36; all other special characters and lowercase letters are 37
          // result is an integer
          if (a != null)
          {
            if ((a.charCodeAt(0) > 64) && (a.charCodeAt(0) < 91)) {
              return a.charCodeAt(0) - 55;
            }
            else if ((a.charCodeAt(0) > 47) && (a.charCodeAt(0) < 58)) {
              return a.charCodeAt(0) - 48;
            }
            else if (a.charCodeAt(0) == 38) {
              return 36;
            }
            else {
              return 37;
            }
          }
          else
          {
            return 0;
          }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="AADD05025A45627DECEFD01F30810BC5" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def delaware_amap(a)
	        if( a[0] != nil )
		        if( a[0] > 64 ) and ( a[0] < 73 ) then a[0] - 54
		        elsif( a[0] > 73 ) and ( a[0] < 79 ) then a[0] - 55
		        elsif( a[0] > 79 ) and ( a[0] < 83 ) then a[0] - 56
		        elsif( a[0] > 83 ) and ( a[0] < 86 ) then a[0] - 57
		        elsif( a[0] > 86 ) and ( a[0] < 90 ) then a[0] - 58
		        elsif( a[0] > 48 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif a[0] == 48 then 10
		        else 0
		        end
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
	      function delaware_amap(a)
	      {
		      // The numbers 1-9 are mapped to 1-9; a zero is mapped to 10; the letters A-H are 11-18; J-N are 19-23;
		      // P-R are 24-26; T-U are 27-28; W-Y are 29-31; the letters I,O,S,V, and Z are mapped to zero because
		      // Delaware wants them to take an index position in the scanline but not compute a value.
		      // There should be no other characters in the Delaware scanline, but anything else defaults to a zero. 
		      // result is an integer
		      if ( a != null )
		      {
			      if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 73 )) { return a.charCodeAt(0) - 54; }
			      else if (( a.charCodeAt(0) > 73 ) && ( a.charCodeAt(0) < 79 )) { return a.charCodeAt(0) - 55; }
			      else if (( a.charCodeAt(0) > 79 ) && ( a.charCodeAt(0) < 83 )) { return a.charCodeAt(0) - 56; }
			      else if (( a.charCodeAt(0) > 83 ) && ( a.charCodeAt(0) < 86 )) { return a.charCodeAt(0) - 57; }
			      else if (( a.charCodeAt(0) > 86 ) && ( a.charCodeAt(0) < 90 )) { return a.charCodeAt(0) - 58; }
			      else if (( a.charCodeAt(0) > 48 ) && ( a.charCodeAt(0) < 58 )) { return a.charCodeAt(0) - 48; }
			      else if (a.charCodeAt(0) == 48) { return 10; }
			      else { return 0; }
		      }
		      else
		      {
			      return 0;
		      }
	      }
      ]]></JavaScriptCode>
	</Block>
	<Block id="D0813912A0A40E81003E16001420F453" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def fed_amap(a)
	        if( a[0] != nil )
		        if( a[0] > 47 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif( a[0] > 64 ) and ( a[0] < 91 ) then a[0] - 55
		        elsif a[0] == 32 then 38
		        elsif a[0] == 36 then 39
		        elsif a[0] == 37 then 42	
		        elsif a[0] == 43 then 41		
		        elsif a[0] == 45 then 36
		        elsif a[0] == 46 then 37	
		        elsif a[0] == 47 then 40
		        else 0
		        end
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
		    function fed_amap(a)
		    {
			    // capital letters A-Z are mapped to numbers 10 - 35; the numbers 0 - 9 are mapped to 0-9
			    // a hyphen is mapped to 36; a period is mapped to 37; space 38; dollar 39; slash (/) 40; plus 41; percent 42 and all other special characters and lowercase letters are 0  

			    if ( a != null )
			    {
				    if (( a.charCodeAt(0) > 47 ) && ( a.charCodeAt(0) < 58 )) { return a.charCodeAt(0) - 48; }
				    else if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 91 )) { return a.charCodeAt(0) - 55; }
				    else if (a.charCodeAt(0) == 32) { return 38; }
				    else if (a.charCodeAt(0) == 36) { return 39; }
				    else if (a.charCodeAt(0) == 37) { return 42; }
				    else if (a.charCodeAt(0) == 43) { return 41; }
				    else if (a.charCodeAt(0) == 45) { return 36; }
				    else if (a.charCodeAt(0) == 46) { return 37; }
				    else if (a.charCodeAt(0) == 47) { return 40; }
				    else { return 0; }
			    }
			    else
			    {
				    return 0;
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="D8ECCB0EA8FC4C9F2A6EEE699EF2A147" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_3(a)
	        if( a[0] != nil )
		        if( a[0] < 65 ) or ( a[0] > 90 ) then '00'
		        else '%02.0f' % ( a[0] - 64 )
		        end
	        else '00'
	        end
        end    
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
		    function amap_3(a)
		    {
			    // capital letters A-Z are mapped to the two-digit numbers 01-26;
			    // numbers, special characters, and lowercase letters are two zeros
			    // result is a string
			
			    if ( a != null )
			    {
				    if (( a.charCodeAt(0) < 65 ) || ( a.charCodeAt(0) > 90 )) 
				    { 
					    return '00';
				    }
				    else
				    {
					    return ( a.charCodeAt(0) - 64 ).complexFixedString(0, '02');
				    }
			    }
			    else 
			    {
				    return '00';
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="02EA505B41F9985DF65A850BFDE49944" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_9(a)
	        if( a[0] != nil )
		        if( a[0] > 47 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif( a[0] < 65 ) or ( a[0] > 90 ) then 0
		        elsif( a[0] > 64 ) and ( a[0] < 74 ) then a[0] - 64
		        elsif( a[0] > 74 ) and ( a[0] < 84 ) then a[0] - 74
		        elsif( a[0] > 84 ) and ( a[0] < 91 ) then a[0] - 84
		        else 0
		        end
	        else 0
	        end
        end    
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
		    function amap_9(a)
		    {
			    // capital letters A-I are mapped to numbers 1-9; J is zero; K-S are 1-9 ; T is zero; U-Z are 1-6
			    // the numbers 0 - 9 are mapped to numbers 0-9; special characters and lowercase letters are zero
			    // result is an integer
			    if( a != null )
			    {
				    if (( a.charCodeAt(0) > 47 ) && ( a.charCodeAt(0) < 58 )) { return a.charCodeAt(0) - 48; }
				    else if (( a.charCodeAt(0) < 65 ) || ( a.charCodeAt(0) > 90 )) { return 0; }
				    else if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 74 )) { return a.charCodeAt(0) - 64; }
				    else if (( a.charCodeAt(0) > 74 ) && ( a.charCodeAt(0) < 84 )) { return a.charCodeAt(0) - 74; }
				    else if (( a.charCodeAt(0) > 84 ) && ( a.charCodeAt(0) < 91 )) { return a.charCodeAt(0) - 84; }
				    else { return 0; }
			    }
			    else
			    {
				    return 0;
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="05E724E9241955381154F4DE80A4AFAF" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax_due(a)
	        a = a.to_f
	        if( a >= 9000.0 ) then '%0.0f' % ( ( a - 9000.0 ) * 0.06 + 315.0 )
	        elsif( a >= 8900.0 ) then '312'
	        elsif( a >= 8800.0 ) then '307'
	        elsif( a >= 8700.0 ) then '301'
	        elsif( a >= 8600.0 ) then '296'
	        elsif( a >= 8500.0 ) then '290'
	        elsif( a >= 8400.0 ) then '285'
	        elsif( a >= 8300.0 ) then '279'
	        elsif( a >= 8200.0 ) then '274'
	        elsif( a >= 8100.0 ) then '268'
	        elsif( a >= 8000.0 ) then '263'
	        elsif( a >= 7900.0 ) then '258'
	        elsif( a >= 7800.0 ) then '253'
	        elsif( a >= 7700.0 ) then '248'
	        elsif( a >= 7600.0 ) then '243'
	        elsif( a >= 7500.0 ) then '238'
	        elsif( a >= 7400.0 ) then '233'
	        elsif( a >= 7300.0 ) then '228'
	        elsif( a >= 7200.0 ) then '223'
	        elsif( a >= 7100.0 ) then '218'
	        elsif( a >= 7000.0 ) then '213'
	        elsif( a >= 6900.0 ) then '208'
	        elsif( a >= 6800.0 ) then '203'
	        elsif( a >= 6700.0 ) then '199'
	        elsif( a >= 6600.0 ) then '194'
	        elsif( a >= 6500.0 ) then '190'
	        elsif( a >= 6400.0 ) then '185'
	        elsif( a >= 6300.0 ) then '181'
	        elsif( a >= 6200.0 ) then '176'
	        elsif( a >= 6100.0 ) then '172'
	        elsif( a >= 6000.0 ) then '167'
	        elsif( a >= 5900.0 ) then '163'
	        elsif( a >= 5800.0 ) then '159'
	        elsif( a >= 5700.0 ) then '155'
	        elsif( a >= 5600.0 ) then '151'
	        elsif( a >= 5500.0 ) then '147'
	        elsif( a >= 5400.0 ) then '143'
	        elsif( a >= 5300.0 ) then '139'
	        elsif( a >= 5200.0 ) then '135'
	        elsif( a >= 5100.0 ) then '131'
	        elsif( a >= 5000.0 ) then '127'
	        elsif( a >= 4900.0 ) then '123'
	        elsif( a >= 4800.0 ) then '120'
	        elsif( a >= 4700.0 ) then '116'
	        elsif( a >= 4600.0 ) then '113'
	        elsif( a >= 4500.0 ) then '109'
	        elsif( a >= 4400.0 ) then '106'
	        elsif( a >= 4300.0 ) then '102'
	        elsif( a >= 4200.0 ) then '99'
	        elsif( a >= 4100.0 ) then '95'
	        elsif( a >= 4000.0 ) then '92'
	        elsif( a >= 3900.0 ) then '89'
	        elsif( a >= 3800.0 ) then '86'
	        elsif( a >= 3700.0 ) then '83'
	        elsif( a >= 3600.0 ) then '80'
	        elsif( a >= 3500.0 ) then '77'
	        elsif( a >= 3400.0 ) then '74'
	        elsif( a >= 3300.0 ) then '71'
	        elsif( a >= 3200.0 ) then '68'
	        elsif( a >= 3100.0 ) then '65'
	        elsif( a >= 3000.0 ) then '62'
	        elsif( a >= 2900.0 ) then '59'
	        elsif( a >= 2800.0 ) then '56'
	        elsif( a >= 2700.0 ) then '54'
	        elsif( a >= 2600.0 ) then '51'
	        elsif( a >= 2500.0 ) then '49'
	        elsif( a >= 2400.0 ) then '46'
	        elsif( a >= 2300.0 ) then '44'
	        elsif( a >= 2200.0 ) then '41'
	        elsif( a >= 2100.0 ) then '39'
	        elsif( a >= 2000.0 ) then '36'
	        elsif( a >= 1900.0 ) then '34'
	        elsif( a >= 1800.0 ) then '32'
	        elsif( a >= 1700.0 ) then '30'
	        elsif( a >= 1600.0 ) then '28'
	        elsif( a >= 1500.0 ) then '26'
	        elsif( a >= 1400.0 ) then '24'
	        elsif( a >= 1300.0 ) then '22'
	        elsif( a >= 1200.0 ) then '20'
	        elsif( a >= 1100.0 ) then '18'
	        elsif( a >= 1000.0 ) then '16'
	        elsif( a >= 900.0 ) then '14'
	        elsif( a >= 800.0 ) then '13'
	        elsif( a >= 700.0 ) then '11'
	        elsif( a >= 600.0 ) then '10'
	        elsif( a >= 500.0 ) then '8'
	        elsif( a >= 400.0 ) then '7'
	        elsif( a >= 300.0 ) then '5'
	        elsif( a >= 200.0 ) then '4'
	        elsif( a >= 100.0 ) then '2'
	        else '0'
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function tax_due(a)
		    {
			    a = a.to_f();
			
			    if ( a >= 9000.0 ) { return ( ( a - 9000.0 ) * 0.06 + 315.0 ).fixed(0); }
			    else if ( a >= 8900.0 ) { return '312'; }
			    else if ( a >= 8800.0 ) { return '307'; }
			    else if ( a >= 8700.0 ) { return '301'; }
			    else if ( a >= 8600.0 ) { return '296'; }
			    else if ( a >= 8500.0 ) { return '290'; }
			    else if ( a >= 8400.0 ) { return '285'; }
			    else if ( a >= 8300.0 ) { return '279'; }
			    else if ( a >= 8200.0 ) { return '274'; }
			    else if ( a >= 8100.0 ) { return '268'; }
			    else if ( a >= 8000.0 ) { return '263'; }
			    else if ( a >= 7900.0 ) { return '258'; }
			    else if ( a >= 7800.0 ) { return '253'; }
			    else if ( a >= 7700.0 ) { return '248'; }
			    else if ( a >= 7600.0 ) { return '243'; }
			    else if ( a >= 7500.0 ) { return '238'; }
			    else if ( a >= 7400.0 ) { return '233'; }
			    else if ( a >= 7300.0 ) { return '228'; }
			    else if ( a >= 7200.0 ) { return '223'; }
			    else if ( a >= 7100.0 ) { return '218'; }
			    else if ( a >= 7000.0 ) { return '213'; }
			    else if ( a >= 6900.0 ) { return '208'; }
			    else if ( a >= 6800.0 ) { return '203'; }
			    else if ( a >= 6700.0 ) { return '199'; }
			    else if ( a >= 6600.0 ) { return '194'; }
			    else if ( a >= 6500.0 ) { return '190'; }
			    else if ( a >= 6400.0 ) { return '185'; }
			    else if ( a >= 6300.0 ) { return '181'; }
			    else if ( a >= 6200.0 ) { return '176'; }
			    else if ( a >= 6100.0 ) { return '172'; }
			    else if ( a >= 6000.0 ) { return '167'; }
			    else if ( a >= 5900.0 ) { return '163'; }
			    else if ( a >= 5800.0 ) { return '159'; }
			    else if ( a >= 5700.0 ) { return '155'; }
			    else if ( a >= 5600.0 ) { return '151'; }
			    else if ( a >= 5500.0 ) { return '147'; }
			    else if ( a >= 5400.0 ) { return '143'; }
			    else if ( a >= 5300.0 ) { return '139'; }
			    else if ( a >= 5200.0 ) { return '135'; }
			    else if ( a >= 5100.0 ) { return '131'; }
			    else if ( a >= 5000.0 ) { return '127'; }
			    else if ( a >= 4900.0 ) { return '123'; }
			    else if ( a >= 4800.0 ) { return '120'; }
			    else if ( a >= 4700.0 ) { return '116'; }
			    else if ( a >= 4600.0 ) { return '113'; }
			    else if ( a >= 4500.0 ) { return '109'; }
			    else if ( a >= 4400.0 ) { return '106'; }
			    else if ( a >= 4300.0 ) { return '102'; }
			    else if ( a >= 4200.0 ) { return '99'; }
			    else if ( a >= 4100.0 ) { return '95'; }
			    else if ( a >= 4000.0 ) { return '92'; }
			    else if ( a >= 3900.0 ) { return '89'; }
			    else if ( a >= 3800.0 ) { return '86'; }
			    else if ( a >= 3700.0 ) { return '83'; }
			    else if ( a >= 3600.0 ) { return '80'; }
			    else if ( a >= 3500.0 ) { return '77'; }
			    else if ( a >= 3400.0 ) { return '74'; }
			    else if ( a >= 3300.0 ) { return '71'; }
			    else if ( a >= 3200.0 ) { return '68'; }
			    else if ( a >= 3100.0 ) { return '65'; }
			    else if ( a >= 3000.0 ) { return '62'; }
			    else if ( a >= 2900.0 ) { return '59'; }
			    else if ( a >= 2800.0 ) { return '56'; }
			    else if ( a >= 2700.0 ) { return '54'; }
			    else if ( a >= 2600.0 ) { return '51'; }
			    else if ( a >= 2500.0 ) { return '49'; }
			    else if ( a >= 2400.0 ) { return '46'; }
			    else if ( a >= 2300.0 ) { return '44'; }
			    else if ( a >= 2200.0 ) { return '41'; }
			    else if ( a >= 2100.0 ) { return '39'; }
			    else if ( a >= 2000.0 ) { return '36'; }
			    else if ( a >= 1900.0 ) { return '34'; }
			    else if ( a >= 1800.0 ) { return '32'; }
			    else if ( a >= 1700.0 ) { return '30'; }
			    else if ( a >= 1600.0 ) { return '28'; }
			    else if ( a >= 1500.0 ) { return '26'; }
			    else if ( a >= 1400.0 ) { return '24'; }
			    else if ( a >= 1300.0 ) { return '22'; }
			    else if ( a >= 1200.0 ) { return '20'; }
			    else if ( a >= 1100.0 ) { return '18'; }
			    else if ( a >= 1000.0 ) { return '16'; }
			    else if ( a >= 900.0 ) { return '14'; }
			    else if ( a >= 800.0 ) { return '13'; }
			    else if ( a >= 700.0 ) { return '11'; }
			    else if ( a >= 600.0 ) { return '10'; }
			    else if ( a >= 500.0 ) { return '8'; }
			    else if ( a >= 400.0 ) { return '7'; }
			    else if ( a >= 300.0 ) { return '5'; }
			    else if ( a >= 200.0 ) { return '4'; }
			    else if ( a >= 100.0 ) { return '2'; }
			    else { return '0'; }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="0A66339681CF8C25B9C321477F16BD27" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def address(addr1,addr2,city_state_zip)
	        "#{addr1},#{addr2},#{city_state_zip}".squeeze(",").chomp(",").reverse.chomp(",").reverse[0,35]
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function address(addr1,addr2,city_state_zip)
		    {
			    var res = (addr1 + ',' + addr2 + ',' + city_state_zip).squeeze(",");
			    if (res.endsWith(','))
			    {
				    res = res.substring(0, res.length - 1);
			    }
			    if (res.startsWith(','))
			    {
				    res = res.substring(1, res.length - 1);
			    }
			    if (res.length > 35)
			    {
				    res = res.substring(0, 35);
			    }
          
          return res;
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="0A7CC7048C6CEBD95B54E1EAF5B7E162" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_due_date(id, due_month, year)
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	        mon_name_array = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']

	        return '' unless ((['Monthly','Quarterly'].include?(id)) and ((1..12) === due_month) and (year > 0))

	        if (due_month == 12)
		        due_month = 1
		        year += 1
	        else
		        due_month += 1
	        end

	        due_day = case id
				        when 'Monthly' then 15
				        when 'Quarterly'

					        if (due_month == 2) then (is_leap_year(year) ? 29 : 28)
					        else days_in_month[due_month - 1]
					        end
			        end

	        check_month = false

	        t = Time.mktime(year, due_month, due_day)

	        if (t.wday == 6) 
		        if (id == 'Monthly')
			        due_day += 2
		        else
			        due_day = 2
			        check_month = true
		        end
	        elsif (t.wday == 0)
		        if (id == 'Monthly')
			        due_day += 1
		        else
			        due_day = 1
			        check_month = true
		        end
	        end

	        if (check_month)
		        if (due_month == 12)
			        due_month = 1
			        year += 1
		        else
			        due_month += 1
		        end
	        end

	        return ("#{mon_name_array[due_month-1]} #{due_day}, #{year}")
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
	function compute_due_date(id, due_month, year) {
    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    var mon_name_array = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'];
    var result = '';
    var due_day;

    // Check arguments first. Paranoia rules!
    if (['Monthly', 'Quarterly'].contains(id) && (due_month >= 1 && due_month <= 12) && year > 0) {
        if (due_month == 12) {
            due_month = 1;
            year += 1;
        }
        else {
            due_month += 1;
        }

        if (id == 'Monthly') { due_day = 15; }
        else if (id == 'Quarterly') {
            if (due_month == 2) {
                due_day = (is_leap_year(year) ? 29 : 28);
            }
            else {
                due_day = days_in_month[due_month - 1];
            }
        }

        // Lookout for weekends: t.wday == 6 is Saturday, Sunday == 0.
        var check_month = false;

        var t = SFForms.Utilities.Time.mktime(year, due_month, due_day);

        if (t.wday() == 6) {
            if (id == 'Monthly') {
                due_day += 2;
            }
            else {
                due_day = 2;
                check_month = true;
            }
        }
        else if (t.wday() == 0) {
            if (id == 'Monthly') {
                due_day += 1;
            }
            else {
                due_day = 1;
                check_month = true;
            }
        }

        if (check_month) {
            if (due_month == 12) {
                due_month = 1;
                year += 1;
            }
            else {
                due_month += 1;
            }
        }

        // Prepare due date for return - "MMM DD, YYYY"
        result = (mon_name_array[due_month - 1] + ' ' + due_day + ', ' + year);
    }

    return result;
}
      ]]></JavaScriptCode>
	</Block>
	<Block id="0B399537103846AE3FA4DB4A11B9FC21" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (1..3000)					
			        tax = taxable_income * 0.02				
		        when (3000.01...5000.01)					
			        tax = ((taxable_income - 3000.0) * 0.03) + 60.0				
		        when (5000.01...17000.01)					
			        tax = ((taxable_income - 5000.0) * 0.05) + 120.0				
		        else					
			        tax = ((taxable_income - 17000.0) * 0.0575) + 720.0				
	        end						
	        return tax						
        end				
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)							
		    {
			    if (taxable_income <= 0.0) { return 0; }
			
          var tax;
			    if (taxable_income >= 1 && taxable_income <= 3000)
			    {
				    tax = taxable_income * 0.02;
			    }
			    else if (taxable_income >= 3000.01 && taxable_income <= 5000.01)					
			    {
				    tax = ((taxable_income - 3000.0) * 0.03) + 60.0;
			    }
			    else if (taxable_income >= 5000.01 && taxable_income <= 17000.01)					
			    {
				    tax = ((taxable_income - 5000.0) * 0.05) + 120.0;
			    }
			    else
			    {
				    tax = ((taxable_income - 17000.0) * 0.0575) + 720.0;
			    }

			    return tax;
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="9DAEF320960D68B84F4EDE9D0014962E" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def utah_amap(a)
	        if( a[0] != nil )
		        if( a[0] > 64 ) and ( a[0] < 91 ) then a[0] - 64
		        elsif( a[0] > 47 ) and ( a[0] < 58 ) then a[0] - 48
		        else 0
		        end
	        else '0'
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
		    function utah_amap(a)
		    {
			    // capital letters A-Z are mapped to numbers 1-26; the numbers 0 - 9 are mapped to 0-9
			    // special characters and lowercase letters are zero
			    // result is an integer
			
			    if ( a != null )
			    {
				    if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 91 )) { return a.charCodeAt(0) - 64; }
				    else if (( a.charCodeAt(0) > 47 ) && ( a.charCodeAt(0) < 58 )) { return a.charCodeAt(0) - 48; }
				    else { return 0; }
			    }
			    else
			    {
				    return '0';
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="8A80EF46AA15A19CEC5AD588B53FB9CA" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...15000.01)					
			        tax = '35'			
		        when (15000.01...17000.01)					
			        tax = '34'		
		        when (17000.01...19000.01)					
			        tax = '33'				
		        when (19000.01...21000.01)					
			        tax = '32'		
		        when (21000.01...23000.01)					
			        tax = '31'			
		        when (23000.01...25000.01)					
			        tax = '30'				
		        when (25000.01...27000.01)					
			        tax = '29'				
		        when (27000.01...29000.01)					
			        tax = '28'				
		        when (29000.01...31000.01)					
			        tax = '27'				
		        when (31000.01...33000.01)					
			        tax = '26'				
		        when (33000.01...35000.01)					
			        tax = '25'
		        when (35000.01...37000.01)					
			        tax = '24'			
		        when (37000.01...39000.01)					
			        tax = '23'				
		        when (39000.01...41000.01)					
			        tax = '22'				
		        when (41000.01...43000.01)					
			        tax = '21'
		        else
						
			        tax = '20'
	        end
					
	        return tax						
        end							
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)
		    {
			    if (taxable_income <= 0.0)
			    {
				    return 0;
			    }
          
			    var tax;
				  if (taxable_income >= 0.01 && taxable_income <= 15000.01) { tax = '35'; }
				  else if (taxable_income >= 15000.01 && taxable_income <= 17000.01) { tax = '34'; }
				  else if (taxable_income >= 17000.01 && taxable_income <= 19000.01) { tax = '33'; }
				  else if (taxable_income >= 19000.01 && taxable_income <= 21000.01) { tax = '32'; }
				  else if (taxable_income >= 21000.01 && taxable_income <= 23000.01) { tax = '31'; }
				  else if (taxable_income >= 23000.01 && taxable_income <= 25000.01) { tax = '30'; }
				  else if (taxable_income >= 25000.01 && taxable_income <= 27000.01) { tax = '29'; }
				  else if (taxable_income >= 27000.01 && taxable_income <= 29000.01) { tax = '28'; }
				  else if (taxable_income >= 29000.01 && taxable_income <= 31000.01) { tax = '27'; }
				  else if (taxable_income >= 31000.01 && taxable_income <= 33000.01) { tax = '26'; }
				  else if (taxable_income >= 33000.01 && taxable_income <= 35000.01) { tax = '25'; }
				  else if (taxable_income >= 35000.01 && taxable_income <= 37000.01) { tax = '24'; }
				  else if (taxable_income >= 37000.01 && taxable_income <= 39000.01) { tax = '23'; }
				  else if (taxable_income >= 39000.01 && taxable_income <= 41000.01) { tax = '22'; }
				  else if (taxable_income >= 41000.01 && taxable_income <= 43000.01) { tax = '21'; }
				  else { tax = '20'; }

			    return tax;
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="773BF82D55DB1DC46295307F5E38EEAB" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)			 			
	        if (taxable_income <= 0.0) then return 0 end					
	        case taxable_income					
		        when (0.01..15000.0)				
			        tax = 0.35			
		        when (15000.01..17000.0)				
			        tax = 0.34			
		        when (17000.01..19000.0)				
			        tax = 0.33			
		        when (19000.01..21000.0)	
			        tax = 0.32
		        when (21000.01..23000.0)	
			        tax = 0.31
		        when (23000.01..25000.0)	
			        tax = 0.30
		        when (25000.01..27000.0)	
			        tax = 0.29
		        when (27000.01..29000.0)	
			        tax = 0.28
		        when (29000.01..31000.0)	
			        tax = 0.27
		        when (31000.01..33000.0)	
			        tax = 0.26
		        when (33000.01..35000.0)	
			        tax = 0.25
		        when (35000.01..37000.0)	
			        tax = 0.24
		        when (37000.01..39000.0)	
			        tax = 0.23
		        when (39000.01..41000.0)	
			        tax = 0.22
		        when (41000.01..43000.0)	
			        tax = 0.21
		        else	
			        tax = 0.20
	        end		
	        return tax		
        end			
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function compute_tax(taxable_income)
		    {
			    if (taxable_income <= 0.0)
			    {
				    return 0;
			    }
          
			    var tax;
			    if (taxable_income >= 0.01 && taxable_income <= 15000.0) { tax = 0.35; }
			    else if (taxable_income >= 15000.01 && taxable_income <= 17000.0) { tax = 0.34; }
			    else if (taxable_income >= 17000.01 && taxable_income <= 19000.0) { tax = 0.33; }
			    else if (taxable_income >= 19000.01 && taxable_income <= 21000.0)	{ tax = 0.32; }
			    else if (taxable_income >= 21000.01 && taxable_income <= 23000.0)	{ tax = 0.31; }
			    else if (taxable_income >= 23000.01 && taxable_income <= 25000.0)	{ tax = 0.30; }
			    else if (taxable_income >= 25000.01 && taxable_income <= 27000.0)	{ tax = 0.29; }
			    else if (taxable_income >= 27000.01 && taxable_income <= 29000.0)	{ tax = 0.28; }
			    else if (taxable_income >= 29000.01 && taxable_income <= 31000.0)	{ tax = 0.27; }
			    else if (taxable_income >= 31000.01 && taxable_income <= 33000.0)	{ tax = 0.26; }
			    else if (taxable_income >= 33000.01 && taxable_income <= 35000.0)	{ tax = 0.25; }
			    else if (taxable_income >= 35000.01 && taxable_income <= 37000.0)	{ tax = 0.24; }
			    else if (taxable_income >= 37000.01 && taxable_income <= 39000.0)	{ tax = 0.23; }
			    else if (taxable_income >= 39000.01 && taxable_income <= 41000.0)	{ tax = 0.22; }
			    else if (taxable_income >= 41000.01 && taxable_income <= 43000.0)	{ tax = 0.21; }
			    else { tax = 0.20; }

			    return tax;
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="F43D7EB580304C6116F4FBF55C14E8B8" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(income)
	        income = income.to_f
	        if( income > 90000.0 )
		        4500.0 + ( income - 90000.0 ) * 0.094
	        elsif( income > 80000.0 )
		        3600.0 + ( income - 80000.0 ) * 0.09
	        elsif( income > 70000.0 )
		        2800.0 + ( income - 70000.0 ) * 0.08
	        elsif( income > 60000.0 )
		        2100.0 + ( income - 60000.0 ) * 0.07
	        elsif( income > 50000.0 )
		        1500.0 + ( income - 50000.0 ) * 0.06
	        elsif( income > 40000.0 )
		        1000.0 + ( income - 40000.0 ) * 0.05
	        elsif( income > 30000.0 )
		        600.0 + ( income - 30000.0 ) * 0.04
	        elsif( income > 20000.0 )
		        300.0 + ( income - 20000.0 ) * 0.03
	        elsif( income > 10000.0 )
		        100.0 + ( income - 10000.0 ) * 0.02
	        else income * 0.01
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function compute_tax(income)
	      {
		      income = income.to_f();
		
		      if ( income > 90000.0 )
		      {
			      return 4500.0 + ( income - 90000.0 ) * 0.094;
		      }
		      else if ( income > 80000.0 )
		      {
			      return 3600.0 + ( income - 80000.0 ) * 0.09;
		      }
		      else if ( income > 70000.0 )
		      {
			      return 2800.0 + ( income - 70000.0 ) * 0.08;
		      }
		      else if ( income > 60000.0 )
		      {
			      return 2100.0 + ( income - 60000.0 ) * 0.07;
		      }
		      else if ( income > 50000.0 )
		      {
			      return 1500.0 + ( income - 50000.0 ) * 0.06;
		      }
		      else if ( income > 40000.0 )
		      {
			      return 1000.0 + ( income - 40000.0 ) * 0.05;
		      }
		      else if ( income > 30000.0 )
		      {
			      return 600.0 + ( income - 30000.0 ) * 0.04;
		      }
		      else if ( income > 20000.0 )
		      {
			      return 300.0 + ( income - 20000.0 ) * 0.03;
		      }
		      else if ( income > 10000.0 )
		      {
			      return 100.0 + ( income - 10000.0 ) * 0.02;
		      }
		      else
		      {
			      return income * 0.01;
		      }
	      }
      ]]></JavaScriptCode>
	</Block>
	<Block id="643170BE9091A663AB25AB128CCB355B" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def contribution(one_dollar,five_dollars,ten_dollars,twenty_dollars,many_dollars,value)
	        if (!one_dollar.strip.empty?) then '%0.0f' % (1.0)
	        elsif (!five_dollars.strip.empty?) then '%0.0f' % (5.0)
	        elsif (!ten_dollars.strip.empty?) then '%0.0f' % (10.0)
	        elsif (!twenty_dollars.strip.empty?) then '%0.0f' % (20.0)
	        elsif (!many_dollars.strip.empty?) then '%0.0f' % (value.to_f)
	        else ''
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function contribution(one_dollar,five_dollars,ten_dollars,twenty_dollars,many_dollars,value)
		    {
			    if (!one_dollar.trim().isEmpty()) { return (1.0).fixed(0); }
			    else if (!five_dollars.trim().isEmpty()) { return (5.0).fixed(0); }
			    else if (!ten_dollars.trim().isEmpty()) { return (10.0).fixed(0); }
			    else if (!twenty_dollars.trim().isEmpty()) { return (20.0).fixed(0); }
			    else if (!many_dollars.trim().isEmpty()) { return (value.to_f()).fixed(0); }
			    else { return ''; }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="48B041B002E0F15F7E4C8E983E74B172" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)
        amount = amount.to_f
        if( amount >= 31000.0 )
	        1341.0 + ( amount - 30999.0 ) * 0.07
        elsif( amount >= 30000.0 )
	        1281.0 + ( amount - 29999.0 ) * 0.06
        elsif( amount >= 29000.0 )
	        1221.0 + ( amount - 28999.0 ) * 0.06
        elsif( amount >= 28000.0 )
	        1161.0 + ( amount - 27999.0 ) * 0.06
        elsif( amount >= 27000.0 )
	        1101.0 + ( amount - 26999.0 ) * 0.06
        elsif( amount >= 26000.0 )
	        1041.0 + ( amount - 25999.0 ) * 0.06
        elsif( amount >= 25000.0 )
	        981.0 + ( amount - 24999.0 ) * 0.06
        elsif( amount >= 24000.0 )
	        921.0 + ( amount - 23999.0 ) * 0.06
        elsif( amount >= 23000.0 )
	        861.0 + ( amount - 22999.0 ) * 0.06
        elsif( amount >= 22000.0 )
	        801.0 + ( amount - 21999.0 ) * 0.06
        elsif( amount >= 21000.0 )
	        741.0 + ( amount - 20999.0 ) * 0.06
        elsif( amount >= 20000.0 )
	        681.0 + ( amount - 19999.0 ) * 0.06
        elsif( amount >= 19000.0 )
	        621.0 + ( amount - 18999.0 ) * 0.06
        elsif( amount >= 18600.0 )
	        597.0 + ( amount - 18599.0 ) * 0.06
        elsif( amount >= 18000.0 )
	        570.0 + ( amount - 17999.0 ) * 0.045
        elsif( amount >= 17000.0 )
	        525.0 + ( amount - 16999.0 ) * 0.045
        elsif( amount >= 16000.0 )
	        480.0 + ( amount - 15999.0 ) * 0.045
        elsif( amount >= 15000.0 )
	        435.0 + ( amount - 14999.0 ) * 0.045
        elsif( amount >= 14000.0 )
	        390.0 + ( amount - 13999.0 ) * 0.045
        elsif( amount >= 13000.0 )
	        345.0 + ( amount - 12999.0 ) * 0.045
        elsif( amount >= 12000.0 )
	        300.0 + ( amount - 11999.0 ) * 0.045
        elsif( amount >= 11100.0 )
	        259.0 + ( amount - 11099.0 ) * 0.045
        elsif( amount >= 11000.0 )
	        256.0 + ( amount - 10999.0 ) * 0.035
        elsif( amount >= 10000.0 )
	        221.0 + ( amount - 9999.0 ) * 0.035
        elsif( amount >= 9000.0 )
	        186.0 + ( amount - 8999.0 ) * 0.035
        elsif( amount >= 8000.0 )
	        151.0 + ( amount - 7999.0 ) * 0.035
        elsif( amount >= 7400.0 )
	        130.0 + ( amount - 7399.0 ) * 0.035
        elsif( amount >= 7000.0 )
	        120.0 + ( amount - 6999.0 ) * 0.025
        elsif( amount >= 6000.0 )
	        95.0 + ( amount - 5999.0 ) * 0.025
        elsif( amount >= 5000.0 )
	        70.0 + ( amount - 4999.0 ) * 0.025
        elsif( amount >= 4000.0 )
	        45.0 + ( amount - 3999.0 ) * 0.025
        elsif( amount >= 3700.0 )
	        37.0 + ( amount - 3699.0 ) * 0.025
        elsif( amount > 0.0 )
	        amount * 0.01
        else 0
        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		    function tax(amount)
		    {
			    amount = amount.to_f();
			
			    if( amount >= 31000.0 )
				    { return 1341.0 + ( amount - 30999.0 ) * 0.07; }
			    else if ( amount >= 30000.0 )
				    { return 1281.0 + ( amount - 29999.0 ) * 0.06; }
			    else if ( amount >= 29000.0 )
				    { return 1221.0 + ( amount - 28999.0 ) * 0.06; }
			    else if ( amount >= 28000.0 )
				    { return 1161.0 + ( amount - 27999.0 ) * 0.06; }
			    else if ( amount >= 27000.0 )
				    { return 1101.0 + ( amount - 26999.0 ) * 0.06; }
			    else if ( amount >= 26000.0 )
				    { return 1041.0 + ( amount - 25999.0 ) * 0.06; }
			    else if ( amount >= 25000.0 )
				    { return 981.0 + ( amount - 24999.0 ) * 0.06; }
			    else if ( amount >= 24000.0 )
				    { return 921.0 + ( amount - 23999.0 ) * 0.06; }
			    else if ( amount >= 23000.0 )
				    { return 861.0 + ( amount - 22999.0 ) * 0.06; }
			    else if ( amount >= 22000.0 )
				    { return 801.0 + ( amount - 21999.0 ) * 0.06; }
			    else if ( amount >= 21000.0 )
				    { return 741.0 + ( amount - 20999.0 ) * 0.06; }
			    else if ( amount >= 20000.0 )
				    { return 681.0 + ( amount - 19999.0 ) * 0.06; }
			    else if ( amount >= 19000.0 )
				    { return 621.0 + ( amount - 18999.0 ) * 0.06; }
			    else if ( amount >= 18600.0 )
				    { return 597.0 + ( amount - 18599.0 ) * 0.06; }
			    else if ( amount >= 18000.0 )
				    { return 570.0 + ( amount - 17999.0 ) * 0.045; }
			    else if ( amount >= 17000.0 )
				    { return 525.0 + ( amount - 16999.0 ) * 0.045; }
			    else if ( amount >= 16000.0 )
				    { return 480.0 + ( amount - 15999.0 ) * 0.045; }
			    else if ( amount >= 15000.0 )
				    { return 435.0 + ( amount - 14999.0 ) * 0.045; }
			    else if ( amount >= 14000.0 )
				    { return 390.0 + ( amount - 13999.0 ) * 0.045; }
			    else if ( amount >= 13000.0 )
				    { return 345.0 + ( amount - 12999.0 ) * 0.045; }
			    else if ( amount >= 12000.0 )
				    { return 300.0 + ( amount - 11999.0 ) * 0.045; }
			    else if ( amount >= 11100.0 )
				    { return 259.0 + ( amount - 11099.0 ) * 0.045; }
			    else if ( amount >= 11000.0 )
				    { return 256.0 + ( amount - 10999.0 ) * 0.035; }
			    else if ( amount >= 10000.0 )
				    { return 221.0 + ( amount - 9999.0 ) * 0.035; }
			    else if ( amount >= 9000.0 )
				    { return 186.0 + ( amount - 8999.0 ) * 0.035; }
			    else if ( amount >= 8000.0 )
				    { return 151.0 + ( amount - 7999.0 ) * 0.035; }
			    else if ( amount >= 7400.0 )
				    { return 130.0 + ( amount - 7399.0 ) * 0.035; }
			    else if ( amount >= 7000.0 )
				    { return 120.0 + ( amount - 6999.0 ) * 0.025; }
			    else if ( amount >= 6000.0 )
				    { return 95.0 + ( amount - 5999.0 ) * 0.025; }
			    else if ( amount >= 5000.0 )
				    { return 70.0 + ( amount - 4999.0 ) * 0.025; }
			    else if ( amount >= 4000.0 )
				    { return 45.0 + ( amount - 3999.0 ) * 0.025; }
			    else if ( amount >= 3700.0 )
				    { return 37.0 + ( amount - 3699.0 ) * 0.025; }
			    else if ( amount > 0.0 )
				    { return amount * 0.01; }
			    else 
			    {
				    return 0;
			    }
		    }
      ]]></JavaScriptCode>
	</Block>
	<Block id="46AC1200228325A7DD5F24C625C026DD" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def print_box(str, start, offset, limit, box_prefix)
	        return unless (box_prefix =~ /\Abox\d+_\Z/)
	
	        0.upto((str.length > limit ? limit - 1 : str.length - 1)) { |x|
		        print box_prefix + (start + x * offset).to_s, str[x,1]
		        }
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function print_box(str, start, offset, limit, box_prefix)
				{
					// First check for bad box_prefix formation - so we do not end up writing '10' instead of 'box1_10', for example.
					if (!/^box\d+_$/.test(box_prefix))
					{
						return
					}

					for (var x = 0; x < (str.length > limit ? limit : str.length); x++)
					{
						var boxname = box_prefix + (start + x * offset).toString();
						SFForms.StorageManager.setValue(formInstanceId, boxname, str.substr(x, 1));
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="3902EF1487ABBB8F833728FF8F89F27B" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        if (taxable_income <= 0.0) then return 0 end
	        case taxable_income
		        when (0.0...3000.01)
			        tax = taxable_income * 0.026
		        when (3000...8000.01)
			        tax = ((taxable_income - 3000.0) * 0.041) + 78.0
		        when (8000...20000.01)
			        tax = ((taxable_income - 8000.0) * 0.056) + 283.0
		        when (20000...30000.01)
			        tax = ((taxable_income - 20000.0) * 0.064) + 955.0
		        else
			        tax = ((taxable_income - 30000.0) * 0.065) + 1595.0
	        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
			  function compute_tax(taxable_income)
			  {
				  if (taxable_income <= 0.0) 
				  {
					  return 0;
				  }
          
				  var tax;
          
				  if (taxable_income >= 0.0 && taxable_income <= 3000.01) { tax = taxable_income * 0.026; }
				  else if (taxable_income >= 3000 && taxable_income <= 8000.01) { tax = ((taxable_income - 3000.0) * 0.041) + 78.0; }
				  else if (taxable_income >= 8000 && taxable_income <= 20000.01) { tax = ((taxable_income - 8000.0) * 0.056) + 283.0; }
				  else if (taxable_income >= 20000 && taxable_income <= 30000.01) { tax = ((taxable_income - 20000.0) * 0.064) + 955.0; }
				  else { tax = ((taxable_income - 30000.0) * 0.065) + 1595.0; }

				  return tax;
			  }
      ]]></JavaScriptCode>
	</Block>
	<Block id="5B051D2BBC9C1D6CB96887817959A280" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)

	        if( amount > 200000.0 )
		        9573.30 + ( amount - 200000.0 ) * 0.0624
	        elsif( amount > 100000.0 )
		        3832.30 + ( amount - 100000.0 ) * 0.05741
	        elsif( amount > 80000.0 )
		        2843.30 + ( amount - 80000.0 ) * 0.04945
	        elsif( amount > 40000.0 )
		        1112.50 + ( amount - 40000.0 ) * 0.04327
	        elsif( amount > 20000.0 )
		        370.90 + ( amount - 20000.0 ) * 0.03708
	        elsif( amount > 15000.0 )
		        216.35 + ( amount - 15000.0 ) * 0.03091
	        elsif( amount > 10000.0 )
		        92.70 + ( amount - 10000.0 ) * 0.02473
	        elsif( amount > 5000.0 )
		        30.90 + ( amount - 5000.0 ) * 0.01236
	        elsif( amount > 0.0 )
		        amount * 0.0618
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
			  function tax(amount)
			  {
				  if ( amount > 200000.0 )
					  { return 9573.30 + ( amount - 200000.0 ) * 0.0624; }
				  else if ( amount > 100000.0 )
					  { return 3832.30 + ( amount - 100000.0 ) * 0.05741; }
				  else if ( amount > 80000.0 )
					  { return 2843.30 + ( amount - 80000.0 ) * 0.04945; }
				  else if ( amount > 40000.0 )
					  { return 1112.50 + ( amount - 40000.0 ) * 0.04327; }
				  else if ( amount > 20000.0 )
					  { return 370.90 + ( amount - 20000.0 ) * 0.03708; }
				  else if ( amount > 15000.0 )
					  { return 216.35 + ( amount - 15000.0 ) * 0.03091; }
				  else if ( amount > 10000.0 )
					  { return 92.70 + ( amount - 10000.0 ) * 0.02473; }
				  else if ( amount > 5000.0 )
					  { return 30.90 + ( amount - 5000.0 ) * 0.01236; }
				  else if ( amount > 0.0 )
					  { return amount * 0.0618; }
				  else 
					  { return 0; }
			  }
      ]]></JavaScriptCode>
	</Block>
	<Block id="A0936E71F71DE9AD2E32A99956C255B4" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_rebate(taxable_income)			 
	        if (taxable_income <= 0.0) then return 0 end		
	        case taxable_income		
		        when (0..8000)	
			        rebate = 650
		        when (8001..15000)	
			        rebate = 500
		        when (15001..18000)	
			        rebate = 300
		        when (18001..35000)	
			        rebate = 250
	        end					

	        return rebate					
        end					
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
			  function compute_rebate(taxable_income)
			  {
				  if (taxable_income <= 0.0) 
				  {
					  return 0;
				  }
				
				  if (taxable_income >= 0 && taxable_income <= 8000) { rebate = 650; }
				  else if (taxable_income >= 8001 && taxable_income <= 15000)	{ rebate = 500; }
				  else if (taxable_income >= 15001 && taxable_income <= 18000) { rebate = 300; }
				  else if (taxable_income >= 18001 && taxable_income <= 35000) { rebate = 250; }

				  return rebate;
			  }
      ]]></JavaScriptCode>
	</Block>
	<Block id="BC2104DC7B3F25BB17D6FC274050F30F" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def rent_compute_rebate(taxable_income)			 
	        if (taxable_income <= 0.0) then return 0 end		
	        case taxable_income		
		        when (0..8000)	
			        rebate = 650
		        when (8001..15000)	
			        rebate = 500
		
	        end					

	        return rebate					
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function rent_compute_rebate(taxable_income)			 
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					if (taxable_income >= 0 && taxable_income <= 8000) { rebate = 650; }
					else if (taxable_income >= 8001 && taxable_income <= 15000)	{	rebate = 500; }

					return rebate;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="5FC00007C7DD5C98E6F47D66A94E53C6" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def address(add1,add2,city,state,zip)
	        ( add1 +
	        if( add2.strip.empty? ) then ''
	        elsif( add1.strip.empty? ) then add2
	        else ',' + add2
	        end +
	        ( city.strip.empty? ? '' : ( ( add1 + add2 ).strip.empty? ? city : ',' + city ) ) + ( state.strip.empty? ? '' : ', ' + state ) + ( zip.strip.empty? ? '' : '  ' + zip ) )[0,35]
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function address(add1,add2,city,state,zip)
				{
					var tmp = addr1;
					
					if ( add1.trim().isEmpty() )
					{
						tmp += add2;
					}
					else
					{
						tmp += ',' + add2;
					}
					
					tmp += ( city.trim().isEmpty() ? '' : ( ( add1 + add2 ).trim().isEmpty() ? city : ',' + city ) ) + ( state.trim().isEmpty() ? '' : ', ' + state ) + ( zip.trim().isEmpty() ? '' : '  ' + zip ) ).substring(0,35);
					
					return tmp;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="3C3DB6D8136240C18ACDBBF66938FDD4" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)					
	        if (taxable_income <= 0.0) then return 0 end				
	        case taxable_income				
		        when (0.01..40000)			
			        tax = taxable_income * 0.055		
		        when (40000.01..240000)			
			        tax = ((taxable_income - 40000.0) * 0.065) + 2200.0		
		        when (240000.01..440000)			
			        tax = ((taxable_income - 240000.0) * 0.075) + 15200.0		
		        else			
			        tax = ((taxable_income - 440000.0) * 0.095) + 30200.0		
	        end				
	        return tax				
        end		
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)					
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
          var tax;
					if (taxable_income >= 0.01 && taxable_income <= 40000) { tax = taxable_income * 0.055; }
					else if (taxable_income >= 40000.01 && 240000) { tax = ((taxable_income - 40000.0) * 0.065) + 2200.0;	}
					else if (taxable_income >= 240000.01 && 440000) { tax = ((taxable_income - 240000.0) * 0.075) + 15200.0; }
					else { tax = ((taxable_income - 440000.0) * 0.095) + 30200.0;	}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="CA248882DF042E829A12BEAC406ECC7E" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        '%0.2f' % ((modulus - (sum % modulus)) % modulus) % 10
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
		{
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}
    
			// The corresponding Ruby method had an extra % 10 which was ignored due to
			// the way it was used, so not using it here.
			return (((modulus - (sum % modulus)) % modulus)).fixedString(2);
		}
      ]]></JavaScriptCode>
	</Block>
	<Block id="3375953A5A519E69DF604F8CC7B28DCA" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        tax = if (taxable_income <= 0.0) then 0.0
		        else
			        case taxable_income
				        when (0.01..2500.0) then taxable_income * 0.01
				        when (2500.01..4400.0) then ((taxable_income * 0.02 ) - 25.0)
				        when (4400.01..6600.0) then ((taxable_income * 0.03) - 69.0)
				        when (6600.01..9000.0) then ((taxable_income * 0.04) - 135.0)
				        when (9000.01..11600.0) then ((taxable_income * 0.05 ) - 225.0)
				        when (11600.01..14900.0) then ((taxable_income * 0.06) - 341.0)
				        else ((taxable_income * 0.069) - 475.0)
				        end
		        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					var tax = 0.0;
					
					if (taxable_income <= 0.01 && taxable_income <= 2500.0) { tax = taxable_income * 0.01; }
					else if (taxable_income <= 2500.01 && taxable_income <= 4400.0) { tax = ((taxable_income * 0.02 ) - 25.0); }
					else if (taxable_income <= 4400.01 && taxable_income <= 6600.0) {	tax = ((taxable_income * 0.03) - 69.0);	}
					else if (taxable_income <= 6600.01 && taxable_income <= 9000.0)	{	tax = ((taxable_income * 0.04) - 135.0); }
					else if (taxable_income <= 9000.01 && taxable_income <= 11600.0) { tax = ((taxable_income * 0.05 ) - 225.0); }
					else if (taxable_income <= 11600.01 && taxable_income <= 14900.0) { tax = ((taxable_income * 0.06) - 341.0); }
					else { tax = ((taxable_income * 0.069) - 475.0); }
						
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="778CBC50360B0EFA2D98E982B8FEE819" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)       
         if (taxable_income <= 0.0) then return 0 end
         if (taxable_income > 10700.0) then tax = (422.66 + (taxable_income - 10700.0) * 0.0554)  end
         case taxable_income      
          when (0..2200)     
           tax = taxable_income * 0.021    
          when (2200.01..5150)     
           tax = (46.20 + (taxable_income - 2200.0) * 0.0392)    
          when (5150.01..7850)     
           tax = (161.84 + (taxable_income - 5150.0) * 0.0434)       
          when (7850.01..10700)     
           tax = (279.02 + (taxable_income - 7850.0) * 0.0504)    
          when (10700.0..1000000000000000000)  
         end      
         return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)       
				{
					var tax = 0.0;
					
					if (taxable_income > 10700.0) { tax = (422.66 + (taxable_income - 10700.0) * 0.0554);	}
					
					if (taxable_income >= 0 && taxable_income <= 2200) { tax = taxable_income * 0.021; }
					else if (taxable_income >= 2200.01 && taxable_income <= 5150) {	tax = (46.20 + (taxable_income - 2200.0) * 0.0392);	}
					else if (taxable_income >= 5150.01 && taxable_income <= 7850) {	tax = (161.84 + (taxable_income - 5150.0) * 0.0434); }
					else if (taxable_income >= 7850.01 && taxable_income <= 10700) { tax = (279.02 + (taxable_income - 7850.0) * 0.0504); }
					//else if (taxable_income >= 10700.0 && taxable_income <= 1000000000000000000) {	}
					
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="44D4495EFC4AF77653E67BC2E0736095" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_10(a)
	        if( a[0] != nil )
		        if( a[0] > 64 ) and ( a[0] < 91 ) then a[0] - 55
		        elsif( a[0] > 47 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif a[0] == 38 then 36
		        elsif a[0] == 32 then 0	
		        else 37
		        end
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function amap_10(a)
				{
					// capital letters A-Z are mapped to numbers 10 - 35; the numbers 0 - 9 are mapped to 0-9
					// an ampersand (&) is mapped to 36; a space is mapped to 0; and all other special characters are 37
					// result is an integer
					
					if( a != null )
					{
						if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 91 ))
						{
							return a.charCodeAt(0) - 55;
						}
						else if (( a.charCodeAt(0) > 47 ) && ( a.charCodeAt(0) < 58 ))
						{
							return a.charCodeAt(0) - 48;
						}
						else if (a.charCodeAt(0) == 38)
						{
							return 36;
						}
						else if (a.charCodeAt(0) == 32)
						{
							return 0;
						}
						else
						{
							return 37;
						}
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="2C4D3F22CF945B4F965595D54A75CD06" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_credit(estate_amount)
	        if (estate_amount <= 40000.0) then return 0.0 end
	        case estate_amount
		        when (40000.01..90000.0)
			        tax = ((estate_amount - 40000.0) * 0.008)
		        when (90000.01..140000.0)
			        tax = ((estate_amount - 90000.0) * 0.016) + 400.0
		        when (140000.01..240000.0)
			        tax = ((estate_amount - 140000.0) * 0.024) + 1200.0
		        when (240000.01..440000.0)
			        tax = ((estate_amount - 240000.0) * 0.032) + 3600.0
		        when (440000.01..640000.0)
			        tax = ((estate_amount - 440000.0) * 0.04) + 10000.0
		        when (640000.01..840000.0)
			        tax = ((estate_amount - 640000.0) * 0.048) + 18000.0
		        when (840000.01..1040000.0)
			        tax = ((estate_amount - 840000.0) * 0.056) + 27600.0
		        when (1040000.01..1540000.0)
			        tax = ((estate_amount - 1040000.0) * 0.064) + 38800.0
		        when (1540000.01..2040000.0)
			        tax = ((estate_amount - 1540000.0) * 0.072) + 70800.0
		        when (2040000.01..2540000.0)
			        tax = ((estate_amount - 2040000.0) * 0.08) + 106800.0
		        when (2540000.01..3040000.0)
			        tax = ((estate_amount - 2540000.0) * 0.088) + 146800.0
		        when (3040000.01..3540000.0)
			        tax = ((estate_amount - 3040000.0) * 0.096) + 190800.0
		        when (3540000.01..4040000.0)
			        tax = ((estate_amount - 3540000.0) * 0.104) + 238800.0
		        when (4040000.01..5040000.0)
			        tax = ((estate_amount - 4040000.0) * 0.112) + 290800.0
		        when (5040000.01..6040000.0)
			        tax = ((estate_amount - 5040000.0) * 0.12) + 402800.0
		        when (6040000.01..7040000.0)
			        tax = ((estate_amount - 6040000.0) * 0.128) + 522800.0
		        when (7040000.01..8040000.0)
			        tax = ((estate_amount - 7040000.0) * 0.136) + 650800.0
		        when (8040000.01..9040000.0)
			        tax = ((estate_amount - 8040000.0) * 0.144) + 786800.0
		        when (9040000.01..10040000.0)
			        tax = ((estate_amount - 9040000.0) * 0.152) + 930800.0
		        else
			        tax = ((estate_amount - 10040000.0) * 0.16) + 1082800.0	
	        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_credit(estate_amount)
				{
					if (estate_amount <= 40000.0)
					{
						return 0.0;
					}
					
					var tax = 0.0;
					
					if (estate_amount >= 40000.01 && estate_amount <= 90000.0)
					{
						tax = ((estate_amount - 40000.0) * 0.008);
					}
					else if (estate_amount >= 90000.01 && estate_amount <= 140000.0)
					{
						tax = ((estate_amount - 90000.0) * 0.016) + 400.0;
					}
					else if (estate_amount >= 140000.01 && estate_amount <= 240000.0)
					{
						tax = ((estate_amount - 140000.0) * 0.024) + 1200.0;
					}
					else if (estate_amount >= 240000.01 && estate_amount <= 440000.0)
					{
						tax = ((estate_amount - 240000.0) * 0.032) + 3600.0;
					}
					else if (estate_amount >= 440000.01 && estate_amount <= 640000.0)
					{
						tax = ((estate_amount - 440000.0) * 0.04) + 10000.0;
					}
					else if (estate_amount >= 640000.01 && estate_amount <= 840000.0)
					{
						tax = ((estate_amount - 640000.0) * 0.048) + 18000.0;
					}
					else if (estate_amount >= 840000.01 && estate_amount <= 1040000.0)
					{
						tax = ((estate_amount - 840000.0) * 0.056) + 27600.0;
					}
					else if (estate_amount >= 1040000.01 && estate_amount <= 1540000.0)
					{
						tax = ((estate_amount - 1040000.0) * 0.064) + 38800.0;
					}
					else if (estate_amount >= 1540000.01 && estate_amount <= 2040000.0)
					{
						tax = ((estate_amount - 1540000.0) * 0.072) + 70800.0;
					}
					else if (estate_amount >= 2040000.01 && estate_amount <= 2540000.0)
					{
						tax = ((estate_amount - 2040000.0) * 0.08) + 106800.0;
					}
					else if (estate_amount >= 2540000.01 && estate_amount <= 3040000.0)
					{
						tax = ((estate_amount - 2540000.0) * 0.088) + 146800.0;
					}
					else if (estate_amount >= 3040000.01 && estate_amount <= 3540000.0)
					{
						tax = ((estate_amount - 3040000.0) * 0.096) + 190800.0;
					}
					else if (estate_amount >= 3540000.01 && estate_amount <= 4040000.0)
					{
						tax = ((estate_amount - 3540000.0) * 0.104) + 238800.0;
					}
					else if (estate_amount >= 4040000.01 && estate_amount <= 5040000.0)
					{
						tax = ((estate_amount - 4040000.0) * 0.112) + 290800.0;
					}
					else if (estate_amount >= 5040000.01 && estate_amount <= 6040000.0)
					{
						tax = ((estate_amount - 5040000.0) * 0.12) + 402800.0;
					}
					else if (estate_amount >= 6040000.01 && estate_amount <= 7040000.0)
					{
						tax = ((estate_amount - 6040000.0) * 0.128) + 522800.0;
					}
					else if (estate_amount >= 7040000.01 && estate_amount <= 8040000.0)
					{
						tax = ((estate_amount - 7040000.0) * 0.136) + 650800.0;
					}
					else if (estate_amount >= 8040000.01 && estate_amount <= 9040000.0)
					{
						tax = ((estate_amount - 8040000.0) * 0.144) + 786800.0;
					}
					else if (estate_amount >= 9040000.01 && estate_amount <= 10040000.0)
					{
						tax = ((estate_amount - 9040000.0) * 0.152) + 930800.0;
					}
					else
					{
						tax = ((estate_amount - 10040000.0) * 0.16) + 1082800.0;
					}
	
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="8B1EDE36A25472BD3845203D0D150E61" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_amount)
	        if (taxable_amount <= 0.0) then return 0.0 end
	        case taxable_amount
		        when (0.01..10000.0)
			        tax = taxable_amount * 0.18
		        when (10000.01..20000.0)
			        tax = ((taxable_amount - 10000.0) * 0.20) + 1800.0
		        when (20000.01..40000.0)
			        tax = ((taxable_amount - 20000.0) * 0.22) + 3800.0
		        when (40000.01..60000.0)
			        tax = ((taxable_amount - 40000.0) * 0.24) + 8200.0
		        when (60000.01..80000.0)
			        tax = ((taxable_amount - 60000.0) * 0.26) + 13000.0
		        when (80000.01..100000.0)
			        tax = ((taxable_amount - 80000.0) * 0.28) + 18200.0
		        when (100000.01..150000.0)
			        tax = ((taxable_amount - 100000.0) * 0.30) + 23800.0
		        when (150000.01..250000.0)
			        tax = ((taxable_amount - 150000.0) * 0.32) + 38800.0
		        when (250000.01..500000.0)
			        tax = ((taxable_amount - 250000.0) * 0.34) + 70800.0
		        when (500000.01..750000.0)
			        tax = ((taxable_amount - 500000.0) * 0.37) + 155800.0
		        when (750000.01..1000000.0)
			        tax = ((taxable_amount - 750000.0) * 0.39) + 248300.0
		        when (1000000.01..1250000.0)
			        tax = ((taxable_amount - 1000000.0) * 0.41) + 345800.0
		        when (1250000.01..1500000.0)
			        tax = ((taxable_amount - 1250000.0) * 0.43) + 448300.0
		        when (1500000.01..2000000.0)
			        tax = ((taxable_amount - 1500000.0) * 0.45) + 555800.0
		        when (2000000.01..2500000.0)
			        tax = ((taxable_amount - 2000000.0) * 0.49) + 780800.0
		        when (2500000.01..3000000.0)
			        tax = ((taxable_amount - 2500000.0) * 0.53) + 1025800.0
		        when (3000000.01..10000000.0)
			        tax = ((taxable_amount - 3000000.0) * 0.55) + 1290800.0
		        when (10000000.01..17184000.0)
			        tax = ((taxable_amount - 10000000.0) * 0.60) + 5140800.0
		        else
			        tax = ((taxable_amount - 17184000.0) * 0.55) + 9451200.0	
	        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_amount)
				{
					if (taxable_amount <= 0.0)
					{
						return 0.0;
					}
					
					var tax = 0.0;
					if (taxable_amount >= 0.01 && taxable_amount <= 10000.0)
					{
						tax = taxable_amount * 0.18;
					}
					else if (taxable_amount >= 10000.01 && taxable_amount <= 20000.0)
					{
						tax = ((taxable_amount - 10000.0) * 0.20) + 1800.0;
					}
					else if (taxable_amount >= 20000.01 && taxable_amount <= 40000.0)
					{
						tax = ((taxable_amount - 20000.0) * 0.22) + 3800.0;
					}
					else if (taxable_amount >= 40000.01 && taxable_amount <= 60000.0)
					{
						tax = ((taxable_amount - 40000.0) * 0.24) + 8200.0;
					}
					else if (taxable_amount >= 60000.01 && taxable_amount <= 80000.0)
					{
						tax = ((taxable_amount - 60000.0) * 0.26) + 13000.0;
					}
					else if (taxable_amount >= 80000.01 && taxable_amount <= 100000.0)
					{
						tax = ((taxable_amount - 80000.0) * 0.28) + 18200.0;
					}
					else if (taxable_amount >= 100000.01 && taxable_amount <= 150000.0)
					{
						tax = ((taxable_amount - 100000.0) * 0.30) + 23800.0;
					}
					else if (taxable_amount >= 150000.01 && taxable_amount <= 250000.0)
					{
						tax = ((taxable_amount - 150000.0) * 0.32) + 38800.0;
					}
					else if (taxable_amount >= 250000.01 && taxable_amount <= 500000.0)
					{
						tax = ((taxable_amount - 250000.0) * 0.34) + 70800.0;
					}
					else if (taxable_amount >= 500000.01 && taxable_amount <= 750000.0)
					{
						tax = ((taxable_amount - 500000.0) * 0.37) + 155800.0;
					}
					else if (taxable_amount >= 750000.01 && taxable_amount <= 1000000.0)
					{
						tax = ((taxable_amount - 750000.0) * 0.39) + 248300.0;
					}
					else if (taxable_amount >= 1000000.01 && taxable_amount <= 1250000.0)
					{
						tax = ((taxable_amount - 1000000.0) * 0.41) + 345800.0;
					}
					else if (taxable_amount >= 1250000.01 && taxable_amount <= 1500000.0)
					{
						tax = ((taxable_amount - 1250000.0) * 0.43) + 448300.0;
					}
					else if (taxable_amount >= 1500000.01 && taxable_amount <= 2000000.0)
					{
						tax = ((taxable_amount - 1500000.0) * 0.45) + 555800.0;
					}
					else if (taxable_amount >= 2000000.01 && taxable_amount <= 2500000.0)
					{
						tax = ((taxable_amount - 2000000.0) * 0.49) + 780800.0;
					}
					else if (taxable_amount >= 2500000.01 && taxable_amount <= 3000000.0)
					{
						tax = ((taxable_amount - 2500000.0) * 0.53) + 1025800.0;
					}
					else if (taxable_amount >= 3000000.01 && taxable_amount <= 10000000.0)
					{
						tax = ((taxable_amount - 3000000.0) * 0.55) + 1290800.0;
					}
					else if (taxable_amount >= 10000000.01 && taxable_amount <= 17184000.0)
					{
						tax = ((taxable_amount - 10000000.0) * 0.60) + 5140800.0;
					}
					else
					{
						tax = ((taxable_amount - 17184000.0) * 0.55) + 9451200.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="32CFC40DB564F930AC3243C4025A57ED" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_credit(taxable_income)
	        if (taxable_income <= 40000.0) then return 0.0 end						
	        credit = case taxable_income
			        when (40000.01..90000.0) then (taxable_income - 40000.0) * 0.008
			        when (90000.01..140000.0) then ((taxable_income - 90000.0) * 0.016) + 400.0
			        when (140000.01..240000.0) then ((taxable_income - 140000.0) * 0.024) + 1200.0
			        when (240000.01..440000.0) then ((taxable_income - 240000.0) * 0.032) + 3600.0
			        when (440000.01..640000.0) then ((taxable_income - 440000.0) * 0.04) + 10000.0
			        when (640000.01..840000.0) then ((taxable_income - 640000.0) * 0.048) + 18000.0
			        when (840000.01..1040000.0) then ((taxable_income - 840000.0) * 0.056) + 27600.0
			        when (1040000.01..1540000.0) then ((taxable_income - 1040000.0) * 0.064) + 38800.0
			        when (1540000.01..2040000.0) then ((taxable_income - 1540000.0) * 0.072) + 70800.0
			        when (2040000.01..2540000.0) then ((taxable_income - 2040000.0) * 0.08) + 106800.0
			        when (2540000.01..3040000.0) then ((taxable_income - 2540000.0) * 0.088) + 146800.0
			        when (3040000.01..3540000.0) then ((taxable_income - 3040000.0) * 0.096) + 190800.0
			        when (3540000.01..4040000.0) then ((taxable_income - 3540000.0) * 0.104) + 238800.0
			        when (4040000.01..5040000.0) then ((taxable_income - 4040000.0) * 0.112) + 290800.0
			        when (5040000.01..6040000.0) then ((taxable_income - 5040000.0) * 0.12) + 402800.0
			        when (6040000.01..7040000.0) then ((taxable_income - 6040000.0) * 0.128) + 522800.0
			        when (7040000.01..8040000.0) then ((taxable_income - 7040000.0) * 0.136) + 650800.0
			        when (8040000.01..9040000.0) then ((taxable_income - 8040000.0) * 0.144) + 786800.0
			        when (9040000.01..10040000.0) then ((taxable_income - 9040000.0) * 0.152) + 930800.0
			        else ((taxable_income - 10040000.0) * 0.16) + 1082800.0
		        end
	        return credit
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_credit(taxable_income)
				{
					if (taxable_income <= 40000.0)
					{
						return 0.0;
					}

					//
					// Over the Lower range, but not over the upper range value.
					//
					var credit = 0.0;

					if (taxable_income >= 40000.01 && taxable_income <= 90000.0)
					{
						credit = (taxable_income - 40000.0) * 0.008;
					}
					else if (taxable_income >= 90000.01 && taxable_income <= 140000.0) 
					{
						credit = ((taxable_income - 90000.0) * 0.016) + 400.0;
					}
					else if (taxable_income >= 140000.01 && taxable_income <= 240000.0) 
					{
						credit = ((taxable_income - 140000.0) * 0.024) + 1200.0;
					}
					else if (taxable_income >= 240000.01 && taxable_income <= 440000.0) 
					{
						credit = ((taxable_income - 240000.0) * 0.032) + 3600.0;
					}
					else if (taxable_income >= 440000.01 && taxable_income <= 640000.0)
					{
						credit = ((taxable_income - 440000.0) * 0.04) + 10000.0;
					}
					else if (taxable_income >= 640000.01 && taxable_income <= 840000.0)
					{
						credit = ((taxable_income - 640000.0) * 0.048) + 18000.0;
					}
					else if (taxable_income >= 840000.01 && taxable_income <= 1040000.0)
					{
						credit = ((taxable_income - 840000.0) * 0.056) + 27600.0;
					}
					else if (taxable_income >= 1040000.01 && taxable_income <= 1540000.0)
					{
						credit = ((taxable_income - 1040000.0) * 0.064) + 38800.0;
					}
					else if (taxable_income >= 1540000.01 && taxable_income <= 2040000.0)
					{
						credit = ((taxable_income - 1540000.0) * 0.072) + 70800.0;
					}
					else if (taxable_income >= 2040000.01 && taxable_income <= 2540000.0)
					{
						credit = ((taxable_income - 2040000.0) * 0.08) + 106800.0;
					}
					else if (taxable_income >= 2540000.01 && taxable_income <= 3040000.0)
					{
						credit = ((taxable_income - 2540000.0) * 0.088) + 146800.0;
					}
					else if (taxable_income >= 3040000.01 && taxable_income <= 3540000.0)
					{
						credit = ((taxable_income - 3040000.0) * 0.096) + 190800.0;
					}
					else if (taxable_income >= 3540000.01 && taxable_income <= 4040000.0)
					{
						credit = ((taxable_income - 3540000.0) * 0.104) + 238800.0;
					}
					else if (taxable_income >= 4040000.01 && taxable_income <= 5040000.0)
					{
						credit = ((taxable_income - 4040000.0) * 0.112) + 290800.0;
					}
					else if (taxable_income >= 5040000.01 && taxable_income <= 6040000.0)
					{
						credit = ((taxable_income - 5040000.0) * 0.12) + 402800.0;
					}
					else if (taxable_income >= 6040000.01 && taxable_income <= 7040000.0)
					{
						credit = ((taxable_income - 6040000.0) * 0.128) + 522800.0;
					}
					else if (taxable_income >= 7040000.01 && taxable_income <= 8040000.0)
					{
						credit = ((taxable_income - 7040000.0) * 0.136) + 650800.0;
					}
					else if (taxable_income >= 8040000.01 && taxable_income <= 9040000.0)
					{
						credit = ((taxable_income - 8040000.0) * 0.144) + 786800.0;
					}
					else if (taxable_income >= 9040000.01 && taxable_income <= 10040000.0)
					{
						credit = ((taxable_income - 9040000.0) * 0.152) + 930800.0;
					}
					else 
					{
						credit = ((taxable_income - 10040000.0) * 0.16) + 1082800.0;
					}
						
					return credit;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D5E6C3ACCD3CD7F5056EF61C1629B0B1" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        if (taxable_income <= 0.0) then return 0.0 end
	        tax = case taxable_income		
			        when (0.01..10000.0) then taxable_income * 0.18
			        when (10000.01..20000.0) then ((taxable_income - 10000.0) * 0.20) + 1800.0
			        when (20000.01..40000.0) then ((taxable_income - 20000.0) * 0.22) + 3800.0
			        when (40000.01..60000.0) then ((taxable_income - 40000.0) * 0.24) + 8200.0
			        when (60000.01..80000.0) then ((taxable_income - 60000.0) * 0.26) + 13000.0
			        when (80000.01..100000.0) then ((taxable_income - 80000.0) * 0.28) + 18200.0
			        when (100000.01..150000.0) then ((taxable_income - 100000.0) * 0.30) + 23800.0
			        when (150000.01..250000.0) then ((taxable_income - 150000.0) * 0.32) + 38800.0
			        when (250000.01..500000.0) then ((taxable_income - 250000.0) * 0.34) + 70800.0
			        when (500000.01..750000.0) then ((taxable_income - 500000.0) * 0.37) + 155800.0
			        when (750000.01..1000000.0) then ((taxable_income - 750000.0) * 0.39) + 248300.0
			        when (1000000.01..1250000.0) then ((taxable_income - 1000000.0) * 0.41) + 345800.0
			        when (1250000.01..1500000.0) then ((taxable_income - 1250000.0) * 0.43) + 448300.0
			        when (1500000.01..2000000.0) then ((taxable_income - 1500000.0) * 0.45) + 555800.0
			        when (2000000.01..2500000.0) then ((taxable_income - 2000000.0) * 0.49) + 780800.0
			        when (2500000.01..3000000.0) then ((taxable_income - 2500000.0) * 0.53) + 1025800.0
			        when (3000000.01..10000000.0) then ((taxable_income - 3000000.0) * 0.55) + 1290800.0
			        when (10000000.01..17184000.0) then ((taxable_income - 10000000.0) * 0.60) + 5140800.0
			        else ((taxable_income - 17184000.0) * 0.55) + 9451200.0
		        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					//
					// Over the Lower range, but not over the upper range value.
					//
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 10000.0)
					{
						tax = taxable_income * 0.18;
					}
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.0)
					{
						tax = (taxable_income - 10000.0) * 0.20) + 1800.0;
					}
					else if (taxable_income >= 20000.01 && taxable_income <= 40000.0)
					{
						tax = (taxable_income - 20000.0) * 0.22) + 3800.0;
					}
					else if (taxable_income >= 40000.01 && taxable_income <= 60000.0)
					{
						tax = (taxable_income - 40000.0) * 0.24) + 8200.0;
					}
					else if (taxable_income >= 60000.01 && taxable_income <= 80000.0)
					{
						tax = (taxable_income - 60000.0) * 0.26) + 13000.0;
					}
					else if (taxable_income >= 80000.01 && taxable_income <= 100000.0)
					{
						tax = (taxable_income - 80000.0) * 0.28) + 18200.0;
					}
					else if (taxable_income >= 100000.01 && taxable_income <= 150000.0)
					{
						tax = (taxable_income - 100000.0) * 0.30) + 23800.0;
					}
					else if (taxable_income >= 150000.01 && taxable_income <= 250000.0)
					{
						tax = (taxable_income - 150000.0) * 0.32) + 38800.0;
					}
					else if (taxable_income >= 250000.01 && taxable_income <= 500000.0)
					{
						tax = (taxable_income - 250000.0) * 0.34) + 70800.0;
					}
					else if (taxable_income >= 500000.01 && taxable_income <= 750000.0)
					{
						tax = (taxable_income - 500000.0) * 0.37) + 155800.0;
					}
					else if (taxable_income >= 750000.01 && taxable_income <= 1000000.0)
					{
						tax = (taxable_income - 750000.0) * 0.39) + 248300.0;
					}
					else if (taxable_income >= 1000000.01 && taxable_income <= 1250000.0)
					{
						tax = (taxable_income - 1000000.0) * 0.41) + 345800.0;
					}
					else if (taxable_income >= 1250000.01 && taxable_income <= 1500000.0)
					{
						tax = (taxable_income - 1250000.0) * 0.43) + 448300.0;
					}
					else if (taxable_income >= 1500000.01 && taxable_income <= 2000000.0)
					{
						tax = (taxable_income - 1500000.0) * 0.45) + 555800.0'
					}
					else if (taxable_income >= 2000000.01 && taxable_income <= 2500000.0)
					{
						tax = (taxable_income - 2000000.0) * 0.49) + 780800.0;
					}
					else if (taxable_income >= 2500000.01 && taxable_income <= 3000000.0)
					{
						tax = (taxable_income - 2500000.0) * 0.53) + 1025800.0;
					}
					else if (taxable_income >= 3000000.01 && taxable_income <= 10000000.0)
					{
						tax = (taxable_income - 3000000.0) * 0.55) + 1290800.0;
					}
					else if (taxable_income >= 10000000.01 && taxable_income <= 17184000.0)
					{
						tax = (taxable_income - 10000000.0) * 0.60) + 5140800.0;
					}
					else
					{
						tax = ((taxable_income - 17184000.0) * 0.55) + 9451200.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="063D7B1775EA863E5E6E978AE9FC5C80" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)

	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end
	
	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = fed_amap(input[i, 1]) * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        (sum % modulus)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = fed_amap(inputStr.substr(i, 1)) * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}
    
			// NOTE...Adding digits yields sum, note characters converted to
			// digits...remainder is check digit
			// Value to return as a 2 digit integer.
			return (sum % modulusInt);
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="CE46E514D01EFB014613A1F600AFD27C" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[]]></RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					if (amount > 11150.0) 
					{
						return 2879.0 + ((amount - 11150.0) * 0.35);
					}
					else if (amount > 8200.0)
					{
						return 1905.50 + ((amount - 8200.0) * 0.33);
					}
					else if (amount > 5350.0)
					{
						return 1107.50 + ((amount - 5350.0) * 0.28);
					}
					else if (amount > 2300.0)
					{
						return 345.0 + ((amount - 2300.0) * 0.25);
					}
					else if (amount > 0.0)
					{
						return amount * 0.15;
					}
					else
					{
						return 0.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D7D84E2CDF6FA1BC6E25A49316033AE8" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def telefile_chars(value)

	        case value.strip.upcase

		        when "A" then "21"
		        when "B" then "22"
		        when "C" then "23"
		        when "D" then "31"
		        when "E" then "32"
		        when "F" then "33"
		        when "G" then "41"
		        when "H" then "42"
		        when "I" then "43"
		        when "J" then "51"
		        when "K" then "52"
		        when "L" then "53"
		        when "M" then "61"
		        when "N" then "62"
		        when "O" then "63"
		        when "P" then "71"
		        when "Q" then "11"
		        when "R" then "72"
		        when "S" then "73"
		        when "T" then "81"
		        when "U" then "82"
		        when "V" then "83"
		        when "W" then "91"
		        when "X" then "92"
		        when "Y" then "93"
		        when "Z" then "12"
		        else ""
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function telefile_chars(value)
				{
					var val = value.toUpperCase();
					switch(val)
					{
						case "A": return "21";
						case "B": return "22";
						case "C": return "23";
						case "D": return "31";
						case "E": return "32";
						case "F": return "33";
						case "G": return "41";
						case "H": return "42";
						case "I": return "43";
						case "J": return "51";
						case "K": return "52";
						case "L": return "53";
						case "M": return "61";
						case "N": return "62";
						case "O": return "63";
						case "P": return "71";
						case "Q": return "11";
						case "R": return "72";
						case "S": return "73";
						case "T": return "81";
						case "U": return "82";
						case "V": return "83";
						case "W": return "91";
						case "X": return "92";
						case "Y": return "93";
						case "Z": return "12";
						default: return "";
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="ED67CCEB6BE1D546C6C208C0B65D0BAC" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(income)
	        income = income.to_f
	        if( income > 60000.0 )
		        2943.5 + ( income - 60000.0 ) * 0.0595
	        elsif( income > 25000.0 )
		        1001.0 + ( income - 25000.0 ) * 0.0555
	        elsif( income > 20000.0 )
		        741.0 + ( income - 20000.0 ) * 0.052
	        elsif( income > 10000.0 )
		        261.0 + ( income - 10000.0 ) * 0.048
	        elsif( income > 5000.0 )
		        66.0 + ( income - 5000.0 ) * 0.039
	        elsif( income > 2000.0 )
		        ( income - 2000.0 ) * 0.022
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(income)
				{
					income = income.to_f();
					
					if( income > 60000.0 )
					{
						return 2943.5 + ( income - 60000.0 ) * 0.0595;
					}
					else if( income > 25000.0 )
					{
						return 1001.0 + ( income - 25000.0 ) * 0.0555;
					}
					else if( income > 20000.0 )
					{
						return 741.0 + ( income - 20000.0 ) * 0.052;
					}
					else if( income > 10000.0 )
					{
						return 261.0 + ( income - 10000.0 ) * 0.048;
					}
					else if( income > 5000.0 )
					{
						return 66.0 + ( income - 5000.0 ) * 0.039;
					}
					else if( income > 2000.0 )
					{
						return ( income - 2000.0 ) * 0.022;
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="514458F910286086DE1053AF5A7DB42C" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...2000.01)					
			        tax = 0.0				
		        when (2000.01...5000.01)					
			        tax = ((taxable_income - 2000.0) * 0.0220)		
		        when (5000.01...10000.01)					
			        tax = ((taxable_income - 5000.0) * 0.0390) + 66.0				
		        when (10000.01...20000.01)					
			        tax = ((taxable_income - 10000.0) * 0.0480) + 261.0
		        when (20000.01...25000.01)					
			        tax = ((taxable_income - 20000.0) * 0.0520) + 741.0
		        when (25000.01...60000.01)					
			        tax = ((taxable_income - 25000.0) * 0.0555) + 1001.0
		        else					
			        tax = ((taxable_income - 60000.0) * 0.0595) + 2943.50				
	        end						
	        return tax						
        end							
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					
					if (taxable_income >= 0.01 && taxable_income <= 2000.01)					
					{
						tax = 0.0;
					}
					else if (taxable_income >= 2000.01 && taxable_income <= 5000.01)					
					{
						tax = ((taxable_income - 2000.0) * 0.0220);
					}
					else if (taxable_income >= 5000.01 && taxable_income <= 10000.01)					
					{
						tax = ((taxable_income - 5000.0) * 0.0390) + 66.0;
					}
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.01)					
					{
						tax = ((taxable_income - 10000.0) * 0.0480) + 261.0;
					}
					else if (taxable_income >= 20000.01 && taxable_income <= 25000.01)					
					{
						tax = ((taxable_income - 20000.0) * 0.0520) + 741.0;
					}
					else if (taxable_income >= 25000.01 && taxable_income <= 60000.01)					
					{
						tax = ((taxable_income - 25000.0) * 0.0555) + 1001.0;
					}
					else					
					{
						tax = ((taxable_income - 60000.0) * 0.0595) + 2943.50;
					}

					return tax;
				}						
      ]]></JavaScriptCode>
	</Block>
	<Block id="6D5AB47F2222F7FF8726335240252D58" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income				
		        when (0.01..10000)					
			        tax = taxable_income * 0.04				
		        when (10000.01..40000)					
			        tax = ((taxable_income - 10000.0) * 0.06) + 400.0				
	
		        else					
			        tax = ((taxable_income - 40000.0) * 0.085) + 2200.0				
	        end						
	        return tax						
        end							
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0) { return 0; }
          
					var tax = 0.0;
					
					if (taxable_income >= 0.01 && taxable_income <= 10000) { tax = taxable_income * 0.04;	}
					else if (taxable_income >= 10000.01 && taxable_income <= 40000) { tax = ((taxable_income - 10000.0) * 0.06) + 400.0; }
					else { tax = ((taxable_income - 40000.0) * 0.085) + 2200.0;	}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="30E55DBF78ED0FE4E043401230CB9B7F" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def get_avg_retail_sales_rate(fuel_type)
	        case (fuel_type.strip.to_i)
		        when (1): "1.654"
		        when (2): "1.887"
		        when (3): "4.516"
		        when (4): "2.409"
		        when (5): "1.619"
		        else "0.00"
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_avg_retail_sales_rate(fuel_type)
				{
					switch (fuel_type.trim().to_i())
					{
						case 1: return "1.654"
						case 2: return "1.887"
						case 3: return "4.516"
						case 4: return "2.409"
						case 5: return "1.619"
						default: return "0.00";
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="E5F3DB440D365F9F94EF1CE5754ACCC1" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end				
	        case taxable_income						
		        when (0.01...2000.01): taxable_income * 0.014				
		        when (2000.01...4000.01): ((taxable_income - 2000.0) * 0.032) + 28.0				
		        when (4000.01...8000.01): ((taxable_income - 4000.0) * 0.055) + 92.0				
		        when (8000.01...12000.01): ((taxable_income - 8000.0) * 0.064) + 312.0
		        when (12000.01...16000.01): ((taxable_income - 12000.0) * 0.068) + 568.0	
		        when (16000.01...20000.01): ((taxable_income - 16000.0) * 0.072) + 840.0	
		        when (20000.01...30000.01): ((taxable_income - 20000.0) * 0.076) + 1128.0	
		        when (30000.01...40000.01): ((taxable_income - 30000.0) * 0.079) + 1888.0				
		        else ((taxable_income - 40000.0) * 0.0825) + 2678.0				
	        end				
        end		
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					if (taxable_income >= 0.01 && taxable_income <= 2000.01)
					{
						return taxable_income * 0.014;
					}
					else if (taxable_income >= 2000.01 && taxable_income <= 4000.01)
					{
						return ((taxable_income - 2000.0) * 0.032) + 28.0;
					}
					else if (taxable_income >= 4000.01 && taxable_income <= 8000.01)
					{
						return ((taxable_income - 4000.0) * 0.055) + 92.0;
					}
					else if (taxable_income >= 8000.01 && taxable_income <= 12000.01)
					{
						return ((taxable_income - 8000.0) * 0.064) + 312.0;
					}
					else if (taxable_income >= 12000.01 && taxable_income <= 16000.01)
					{
						return ((taxable_income - 12000.0) * 0.068) + 568.0;
					}
					else if (taxable_income >= 16000.01 && taxable_income <= 20000.01)
					{
						return ((taxable_income - 16000.0) * 0.072) + 840.0;
					}
					else if (taxable_income >= 20000.01 && taxable_income <= 30000.01)
					{
						return ((taxable_income - 20000.0) * 0.076) + 1128.0;
					}
					else if (taxable_income >= 30000.01 && taxable_income <= 40000.01)
					{
						return ((taxable_income - 30000.0) * 0.079) + 1888.0;
					}
					else
					{
						return ((taxable_income - 40000.0) * 0.0825) + 2678.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="259059033462B16421FC93FFA6FBD5EC" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...2000.01)					
			        tax = taxable_income * 0.014				
		        when (2000.01...4000.01)					
			        tax = ((taxable_income - 2000.0) * 0.032) + 28.0				
		        when (4000.01...8000.01)					
			        tax = ((taxable_income - 4000.0) * 0.055) + 92.0				
		        when (8000.01...12000.01)					
			        tax = ((taxable_income - 8000.0) * 0.064) + 312.0
		        when (12000.01...16000.01)					
			        tax = ((taxable_income - 12000.0) * 0.068) + 568.0	
		        when (16000.01...20000.01)					
			        tax = ((taxable_income - 16000.0) * 0.072) + 840.0	
		        when (20000.01...30000.01)					
			        tax = ((taxable_income - 20000.0) * 0.076) + 1128.0	
		        when (30000.01...40000.01)					
			        tax = ((taxable_income - 30000.0) * 0.079) + 1888.0				
		        else					
			        tax = ((taxable_income - 40000.0) * 0.0825) + 2678.0				
	        end						
	        return tax						
        end							
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 2000.01)					
					{
						tax = taxable_income * 0.014;
					}
					else if (taxable_income >= 2000.01 && taxable_income <= 4000.01)					
					{
						tax = ((taxable_income - 2000.0) * 0.032) + 28.0;
					}
					else if (taxable_income >= 4000.01 && taxable_income <= 8000.01)					
					{
						tax = ((taxable_income - 4000.0) * 0.055) + 92.0;
					}
					else if (taxable_income >= 8000.01 && taxable_income <= 12000.01)					
					{
						tax = ((taxable_income - 8000.0) * 0.064) + 312.0;
					}
					else if (taxable_income >= 12000.01 && taxable_income <= 16000.01)					
					{
						tax = ((taxable_income - 12000.0) * 0.068) + 568.0;
					}
					else if (taxable_income >= 16000.01 && taxable_income <= 20000.01)					
					{
						tax = ((taxable_income - 16000.0) * 0.072) + 840.0;
					}
					else if (taxable_income >= 20000.01 && taxable_income <= 30000.01)					
					{
						tax = ((taxable_income - 20000.0) * 0.076) + 1128.0;
					}
					else if (taxable_income >= 30000.01 && taxable_income <= 40000.01)					
					{
						tax = ((taxable_income - 30000.0) * 0.079) + 1888.0;
					}
					else					
					{
						tax = ((taxable_income - 40000.0) * 0.0825) + 2678.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="E1146101AA94E2BEAFC92F3ABFC5FFCF" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax_two(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...4000.01)					
			        tax = taxable_income * 0.014				
		        when (4000.01...8000.01)					
			        tax = ((taxable_income - 4000.0) * 0.032) + 56.0				
		        when (8000.01...16000.01)					
			        tax = ((taxable_income - 8000.0) * 0.055) + 184.0				
		        when (16000.01...24000.01)					
			        tax = ((taxable_income - 16000.0) * 0.064) + 624.0	
		        when (24000.01...32000.01)					
			        tax = ((taxable_income - 24000.0) * 0.068) + 1136.0	
		        when (32000.01...40000.01)					
			        tax = ((taxable_income - 32000.0) * 0.072) + 1680.0
		        when (40000.01...60000.01)					
			        tax = ((taxable_income - 40000.0) * 0.076) + 2256.0				
		        when (60000.01...80000.01)					
			        tax = ((taxable_income - 60000.0) * 0.079) + 3776.0	
		        else					
			        tax = ((taxable_income - 80000.0) * 0.0825) + 5356.0				
	        end						
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_two(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 4000.01)					
					{
						tax = taxable_income * 0.014;
					}
					else if (taxable_income >= 4000.01 && taxable_income <= 8000.01)					
					{
						tax = ((taxable_income - 4000.0) * 0.032) + 56.0;
					}
					else if (taxable_income >= 8000.01 && taxable_income <= 16000.01)					
					{
						tax = ((taxable_income - 8000.0) * 0.055) + 184.0;
					}
					else if (taxable_income >= 16000.01 && taxable_income <= 24000.01)					
					{
						tax = ((taxable_income - 16000.0) * 0.064) + 624.0;
					}
					else if (taxable_income >= 24000.01 && taxable_income <= 32000.01)					
					{
						tax = ((taxable_income - 24000.0) * 0.068) + 1136.0;
					}
					else if (taxable_income >= 32000.01 && taxable_income <= 40000.01)					
					{
						tax = ((taxable_income - 32000.0) * 0.072) + 1680.0;
					}
					else if (taxable_income >= 40000.01 && taxable_income <= 60000.01)					
					{
						tax = ((taxable_income - 40000.0) * 0.076) + 2256.0;
					}
					else if (taxable_income >= 60000.01 && taxable_income <= 80000.01)					
					{
						tax = ((taxable_income - 60000.0) * 0.079) + 3776.0;
					}
					else					
					{
						tax = ((taxable_income - 80000.0) * 0.0825) + 5356.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="477341E1D6A986BB3209A6FDB7F4DDE3" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax_three(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...3000.01)					
			        tax = taxable_income * 0.014				
		        when (3000.01...6000.01)					
			        tax = ((taxable_income - 3000.0) * 0.032) + 42.0				
		        when (6000.01...12000.01)					
			        tax = ((taxable_income - 6000.0) * 0.055) + 138.0				
		        when (12000.01...18000.01)					
			        tax = ((taxable_income - 12000.0) * 0.064) + 468.0	
		        when (18000.01...24000.01)					
			        tax = ((taxable_income - 18000.0) * 0.068) + 852.0	
		        when (24000.01...30000.01)					
			        tax = ((taxable_income - 24000.0) * 0.072) + 1260.0
		        when (30000.01...45000.01)					
			        tax = ((taxable_income - 30000.0) * 0.076) + 1692.0				
		        when (45000.01...60000.01)					
			        tax = ((taxable_income - 45000.0) * 0.079) + 2832.0	
		        else					
			        tax = ((taxable_income - 60000.0) * 0.0825) + 4017.0				
	        end						
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_three(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 3000.01)					
					{
						tax = taxable_income * 0.014;
					}
					else if (taxable_income >= 3000.01 && taxable_income <= 6000.01)					
					{
						tax = ((taxable_income - 3000.0) * 0.032) + 42.0;
					}
					else if (taxable_income >= 6000.01 && taxable_income <= 12000.01)					
					{
						tax = ((taxable_income - 6000.0) * 0.055) + 138.0;
					}
					else if (taxable_income >= 12000.01 && taxable_income <= 18000.01)					
					{
						tax = ((taxable_income - 12000.0) * 0.064) + 468.0;
					}
					else if (taxable_income >= 18000.01 && taxable_income <= 24000.01)					
					{
						tax = ((taxable_income - 18000.0) * 0.068) + 852.0;
					}
					else if (taxable_income >= 24000.01 && taxable_income <= 30000.01)					
					{
						tax = ((taxable_income - 24000.0) * 0.072) + 1260.0;
					}
					else if (taxable_income >= 30000.01 && taxable_income <= 45000.01)					
					{
						tax = ((taxable_income - 30000.0) * 0.076) + 1692.0;
					}
					else if (taxable_income >= 45000.01 && taxable_income <= 60000.01)					
					{
						tax = ((taxable_income - 45000.0) * 0.079) + 2832.0;
					}
					else					
					{
						tax = ((taxable_income - 60000.0) * 0.0825) + 4017.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="387CA53BE9BBF840DF302CDB78564496" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...2400.01)					
			        tax = taxable_income * 0.014				
		        when (2400.01...4800.01)					
			        tax = ((taxable_income - 2400.0) * 0.032) + 34.0				
		        when (4800.01...9600.01)					
			        tax = ((taxable_income - 4800.0) * 0.055) + 110.0				
		        when (9600.01...14400.01)					
			        tax = ((taxable_income - 9600.0) * 0.064) + 374.0	
		        when (14400.01...19200.01)					
			        tax = ((taxable_income - 14400.0) * 0.068) + 682.0	
		        when (19200.01...24000.01)					
			        tax = ((taxable_income - 19200.0) * 0.072) + 1008.0
		        when (24000.01...36000.01)					
			        tax = ((taxable_income - 24000.0) * 0.076) + 1354.0				
		        when (36000.01...48000.01)					
			        tax = ((taxable_income - 36000.0) * 0.079) + 2266.0	
		        else					
			        tax = ((taxable_income - 48000.0) * 0.0825) + 3214.0				
	        end						
	        return tax						
        end			
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 2400.01)					
					{
						tax = taxable_income * 0.014;
					}
					else if (taxable_income >= 2400.01 && taxable_income <= 4800.01)					
					{
						tax = ((taxable_income - 2400.0) * 0.032) + 34.0;
					}
					else if (taxable_income >= 4800.01 && taxable_income <= 9600.01)					
					{
						tax = ((taxable_income - 4800.0) * 0.055) + 110.0;
					}
					else if (taxable_income >= 9600.01 && taxable_income <= 14400.01)					
					{
						tax = ((taxable_income - 9600.0) * 0.064) + 374.0;
					}
					else if (taxable_income >= 14400.01 && taxable_income <= 19200.01)					
					{
						tax = ((taxable_income - 14400.0) * 0.068) + 682.0;
					}
					else if (taxable_income >= 19200.01 && taxable_income <= 24000.01)					
					{
						tax = ((taxable_income - 19200.0) * 0.072) + 1008.0;
					}
					else if (taxable_income >= 24000.01 && taxable_income <= 36000.01)					
					{
						tax = ((taxable_income - 24000.0) * 0.076) + 1354.0;
					}
					else if (taxable_income >= 36000.01 && taxable_income <= 48000.01)					
					{
						tax = ((taxable_income - 36000.0) * 0.079) + 2266.0;
					}
					else					
					{
						tax = ((taxable_income - 48000.0) * 0.0825) + 3214.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="4A432BC5373E09BB4DC6F55BBAB3288C" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax_two(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...4800.01)					
			        tax = taxable_income * 0.014				
		        when (4800.01...9600.01)					
			        tax = ((taxable_income - 4800.0) * 0.032) + 67.0				
		        when (9600.01...19200.01)					
			        tax = ((taxable_income - 9600.0) * 0.055) + 221.0				
		        when (19200.01...28800.01)					
			        tax = ((taxable_income - 19200.0) * 0.064) + 749.0	
		        when (28800.01...38400.01)					
			        tax = ((taxable_income - 28800.0) * 0.068) + 1363.0	
		        when (38400.01...48000.01)					
			        tax = ((taxable_income - 38400.0) * 0.072) + 2016.0
		        when (48000.01...72000.01)					
			        tax = ((taxable_income - 48000.0) * 0.076) + 2707.0				
		        when (72000.01...96000.01)					
			        tax = ((taxable_income - 72000.0) * 0.079) + 4531.0	
		        else					
			        tax = ((taxable_income - 96000.0) * 0.0825) + 6427.0				
	        end						
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_two(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;

					if (taxable_income >= 0.01 && taxable_income <= 4800.01)					
					{
						tax = taxable_income * 0.014;
					}
					else if (taxable_income >= 4800.01 && taxable_income <= 9600.01)					
					{
						tax = ((taxable_income - 4800.0) * 0.032) + 67.0;
					}
					else if (taxable_income >= 9600.01 && taxable_income <= 19200.01)					
					{
						tax = ((taxable_income - 9600.0) * 0.055) + 221.0;
					}
					else if (taxable_income >= 19200.01 && taxable_income <= 28800.01)					
					{
						tax = ((taxable_income - 19200.0) * 0.064) + 749.0;
					}
					else if (taxable_income >= 28800.01 && taxable_income <= 38400.01)					
					{
						tax = ((taxable_income - 28800.0) * 0.068) + 1363.0;
					}
					else if (taxable_income >= 38400.01 && taxable_income <= 48000.01)					
					{
						tax = ((taxable_income - 38400.0) * 0.072) + 2016.0;
					}
					else if (taxable_income >= 48000.01 && taxable_income <= 72000.01)					
					{
						tax = ((taxable_income - 48000.0) * 0.076) + 2707.0;
					}
					else if (taxable_income >= 72000.01 && taxable_income <= 96000.01)					
					{
						tax = ((taxable_income - 72000.0) * 0.079) + 4531.0;
					}
					else					
					{
						tax = ((taxable_income - 96000.0) * 0.0825) + 6427.0;
					}

					return tax;
				}	
      ]]></JavaScriptCode>
	</Block>
	<Block id="21347A381141E2DB639B4A006DB573E6" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax_three(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...3600.01)					
			        tax = taxable_income * 0.014				
		        when (3600.01...7200.01)					
			        tax = ((taxable_income - 3600.0) * 0.032) + 50.0				
		        when (7200.01...14400.01)					
			        tax = ((taxable_income - 7200.0) * 0.055) + 166.0				
		        when (14400.01...21600.01)					
			        tax = ((taxable_income - 14400.0) * 0.064) + 562.0	
		        when (21600.01...28800.01)					
			        tax = ((taxable_income - 21600.0) * 0.068) + 1022.0	
		        when (28800.01...36000.01)					
			        tax = ((taxable_income - 28800.0) * 0.072) + 1512.0
		        when (36000.01...54000.01)					
			        tax = ((taxable_income - 36000.0) * 0.076) + 2030.0				
		        when (54000.01...72000.01)					
			        tax = ((taxable_income - 54000.0) * 0.079) + 3398.0	
		        else					
			        tax = ((taxable_income - 72000.0) * 0.0825) + 4820.0				
	        end						
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_three(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					
					if (taxable_income >= 0.01 && taxable_income <= 3600.01)					
					{
						tax = taxable_income * 0.014;
					}
					else if (taxable_income >= 3600.01 && taxable_income <= 7200.01)					
					{
						tax = ((taxable_income - 3600.0) * 0.032) + 50.0;
					}
					else if (taxable_income >= 7200.01 && taxable_income <= 14400.01)					
					{
						tax = ((taxable_income - 7200.0) * 0.055) + 166.0;
					}
					else if (taxable_income >= 14400.01 && taxable_income <= 21600.01)					
					{
						tax = ((taxable_income - 14400.0) * 0.064) + 562.0;
					}
					else if (taxable_income >= 21600.01 && taxable_income <= 28800.01)					
					{
						tax = ((taxable_income - 21600.0) * 0.068) + 1022.0;
					}
					else if (taxable_income >= 28800.01 && taxable_income <= 36000.01)					
					{
						tax = ((taxable_income - 28800.0) * 0.072) + 1512.0;
					}
					else if (taxable_income >= 36000.01 && taxable_income <= 54000.01)					
					{
						tax = ((taxable_income - 36000.0) * 0.076) + 2030.0;
					}
					else if (taxable_income >= 54000.01 && taxable_income <= 72000.01)					
					{
						tax = ((taxable_income - 54000.0) * 0.079) + 3398.0;
					}
					else					
					{
						tax = ((taxable_income - 72000.0) * 0.0825) + 4820.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="4AAACE61BCFD0A7B2AB7F0DACDFE2238" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)
        amount = amount.to_f
	        if ( amount > 30000.0 )
		        2745.0 + ( amount - 30000.0 ) * 0.110
	        elsif ( amount > 20000.0 )
		        1695.0 + ( amount - 20000.0 ) * 0.105
	        elsif ( amount > 14000.0 )
		        1095.0 + ( amount - 14000.0 ) * 0.100
	        elsif ( amount > 10000.0 )
		        715.0 + ( amount - 10000.0 ) * 0.095
	        elsif ( amount > 5000.0 )
		        290.0 + ( amount - 5000.0 ) * 0.085
	        elsif ( amount > 3000.0 )
		        140.0 + ( amount - 3000.0 ) * 0.075
	        elsif (amount > 2000.0 )
		        75.0 + ( amount - 2000.0 ) * 0.065
	        elsif ( amount > 1500.0 )
		        50.0 + ( amount - 1500.0 ) * 0.050
	        elsif ( amount > 1000.0 )
		        27.50 + ( amount - 1000.0 ) * 0.045
	        elsif ( amount > 500.0 )
		        11.25 + ( amount - 500.0 ) * 0.0375				
	        elsif ( amount > 0.0 )
		        amount * 0.0225
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					amount = amount.to_f();
					
					if ( amount > 30000.0 )
					{
						return 2745.0 + ( amount - 30000.0 ) * 0.110;
					}
					else if ( amount > 20000.0 )
					{
						return 1695.0 + ( amount - 20000.0 ) * 0.105;
					}
					else if ( amount > 14000.0 )
					{
						return 1095.0 + ( amount - 14000.0 ) * 0.100;
					}
					else if ( amount > 10000.0 )
					{
						return 715.0 + ( amount - 10000.0 ) * 0.095;
					}
					else if ( amount > 5000.0 )
					{
						return 290.0 + ( amount - 5000.0 ) * 0.085;
					}
					else if ( amount > 3000.0 )
					{
						return 140.0 + ( amount - 3000.0 ) * 0.075;
					}
					else if (amount > 2000.0 )
					{
						return 75.0 + ( amount - 2000.0 ) * 0.065;
					}
					else if ( amount > 1500.0 )
					{
						return 50.0 + ( amount - 1500.0 ) * 0.050;
					}
					else if ( amount > 1000.0 )
					{
						return 27.50 + ( amount - 1000.0 ) * 0.045;
					}
					else if ( amount > 500.0 )
					{
						return 11.25 + ( amount - 500.0 ) * 0.0375;
					}
					else if ( amount > 0.0 )
					{
						return amount * 0.0225;
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="6C51DE8ECDA84BFBEF59DD9ACEE26C64" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_suffix(a)

	        if( a[0] < 65 ) or ( a[0] > 90 ) then '00'
	        else '%02.0f' % (a[0] - 64)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
          <![CDATA[
				function amap_suffix(a)
				{
					if (( a.charCodeAt(0) < 65 ) || ( a.charCodeAt(0) > 90 ))
					{
						return '00';
					}
					else
					{
						return (a.charCodeAt(0) - 64).complexFixedString(0, '02');
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="BB0C4A3AD2023B817C460F9F9F579D3A" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_rate(household_income)

	        rate = if (household_income < 0.0) then '0'
		        else
			        case household_income
				        when (0.0..10318.99) then '1.00'
				        when (10319.0..11532.99) then '0.85'
				        when (11533.0..12746.99) then '0.70'
				        when (12747.0..15174.99) then '0.50'
				        when (15175.0..17602.99) then '0.35'
				        when (17603.0..20030.99) then '0.25'
				        else '0'
			        end
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_rate(household_income)
				{
					if (household_income < 0.0)
					{
						return '0';
					}

					if (taxable_income >= 0.0 && taxable_income <= 10318.99)
					{
						return '1.00';
					}
					else if (taxable_income >= 10319.0 && taxable_income <= 11532.99)
					{
						return '0.85';
					}
					else if (taxable_income >= 11533.0 && taxable_income <= 12746.99)
					{
						return '0.70';
					}
					else if (taxable_income >= 12747.0 && taxable_income <= 15174.99)
					{
						return '0.50';
					}
					else if (taxable_income >= 15175.0 && taxable_income <= 17602.99)
					{
						return '0.35';
					}
					else if (taxable_income >= 17603.0 && taxable_income <= 20030.99)
					{
						return '0.25';
					}
					else 
					{
						return '0';
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="84CEA419A07727EE20FD6282C020EE20" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1379.01)
			        tax = taxable_income * 0.0036
		        when (1379.01...2758.01)
			        tax = ((taxable_income - 1379.0) * 0.0072) + 4.96
		        when (2758.01...5516.01)
			        tax = ((taxable_income - 2758.0) * 0.0243) + 14.89
		        when (5516.01...12411.01)
			        tax = ((taxable_income - 5516.0) * 0.0450) + 81.91
		        when (12411.01...20685.01)
			        tax = ((taxable_income - 12411.0) * 0.0612) + 392.19
		        when (20685.01...27580.01)
			        tax = ((taxable_income - 20685.0) * 0.0648) + 898.56
		        when (27580.01...41370.01)
			        tax = ((taxable_income - 27580.0) * 0.0680) + 1345.36
		        when (41370.01...62055.01)
			        tax = ((taxable_income - 41370.0) * 0.0792) + 2283.08
		        else
			        tax = ((taxable_income - 62055.0) * 0.0898) + 3921.33
	        end						
	        return tax						
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1379.01)
					{
						tax = taxable_income * 0.0036;
					}
					else if (taxable_income >= 1379.01 && taxable_income <= 2758.01)
					{
						tax = ((taxable_income - 1379.0) * 0.0072) + 4.96;
					}
					else if (taxable_income >= 2758.01 && taxable_income <= 5516.01)
					{
						tax = ((taxable_income - 2758.0) * 0.0243) + 14.89;
					}
					else if (taxable_income >= 5516.01 && taxable_income <= 12411.01)
					{
						tax = ((taxable_income - 5516.0) * 0.0450) + 81.91;
					}
					else if (taxable_income >= 12411.01 && taxable_income <= 20685.01)
					{
						tax = ((taxable_income - 12411.0) * 0.0612) + 392.19;
					}
					else if (taxable_income >= 20685.01 && taxable_income <= 27580.01)
					{
						tax = ((taxable_income - 20685.0) * 0.0648) + 898.56;
					}
					else if (taxable_income >= 27580.01 && taxable_income <= 41370.01)
					{
						tax = ((taxable_income - 27580.0) * 0.0680) + 1345.36;
					}
					else if (taxable_income >= 41370.01 && taxable_income <= 62055.01)
					{
						tax = ((taxable_income - 41370.0) * 0.0792) + 2283.08;
					}
					else
					{
						tax = ((taxable_income - 62055.0) * 0.0898) + 3921.33;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="AF702F8C667D5C6F75CB665AA8C56F8D" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1407.01)					
			        tax = taxable_income * 0.0036				
		        when (1407.01...2814.01)					
			        tax = ((taxable_income - 1407.0) * 0.0072) + 5.07		
		        when (2814.01...5628.01)					
			        tax = ((taxable_income - 2814.0) * 0.0243) + 15.20		
		        when (5628.01...12663.01)					
			        tax = ((taxable_income - 5628.0) * 0.045) + 83.58
		        when (12663.01...21105.01)					
			        tax = ((taxable_income - 12663.0) * 0.0612) + 400.16
		        when (21105.01...28140.01)					
			        tax = ((taxable_income - 21105.0) * 0.0648) + 916.81
		        when (28140.01...42210.01)					
			        tax = ((taxable_income - 28140.0) * 0.068) + 1372.68
		        when (42210.01...63315.01)					
			        tax = ((taxable_income - 42210.0) * 0.0792) + 2329.44			
		        else					
			        tax = ((taxable_income - 63315.0) * 0.0898) + 4000.96				
	        end						
	        return tax						
        end				
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1407.01)					
					{
						tax = taxable_income * 0.0036;
					}
					else if (taxable_income >= 1407.01 && taxable_income <= 2814.01)					
					{
						tax = ((taxable_income - 1407.0) * 0.0072) + 5.07;
					}
					else if (taxable_income >= 2814.01 && taxable_income <= 5628.01)					
					{
						tax = ((taxable_income - 2814.0) * 0.0243) + 15.20;
					}
					else if (taxable_income >= 5628.01 && taxable_income <= 12663.01)					
					{
						tax = ((taxable_income - 5628.0) * 0.045) + 83.58;
					}
					else if (taxable_income >= 12663.01 && taxable_income <= 21105.01)					
					{
						tax = ((taxable_income - 12663.0) * 0.0612) + 400.16;
					}
					else if (taxable_income >= 21105.01 && taxable_income <= 28140.01)					
					{
						tax = ((taxable_income - 21105.0) * 0.0648) + 916.81;
					}
					else if (taxable_income >= 28140.01 && taxable_income <= 42210.01)					
					{
						tax = ((taxable_income - 28140.0) * 0.068) + 1372.68;
					}
					else if (taxable_income >= 42210.01 && taxable_income <= 63315.01)					
					{
						tax = ((taxable_income - 42210.0) * 0.0792) + 2329.44;
					}
					else					
					{
						tax = ((taxable_income - 63315.0) * 0.0898) + 4000.96;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="FA85DD0104032C709DC1AD487F51856F" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def day_suffix(day)
	        suffix = case day.to_i
			        when 1,21,31 then 'st'
			        when 2,22 then 'nd'
			        when 3,23 then 'rd'
			        else 'th'
			        end
	        day + suffix
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function day_suffix(day)
				{
					var suffix = '';
					var daynum = day.to_i();

					if (daynum == 1 || daynum == 21 || daynum == 31) { suffix = 'st'; }
					else if (daynum == 2 || daynum == 22) { suffix = 'nd'; }
					else if (daynum == 3 || daynum == 23) { suffix = 'rd'; }
					else { suffix = 'th'; }

					return day + suffix;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="819C103C78C1279696DDEB083F9136FE" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_4(a)
	        if( a[0] != nil )
		        if( a[0] > 47 ) and ( a[0] < 58 ) then '%02.0f' % ( a[0] - 18 )
		        elsif( a[0] < 65 ) or ( a[0] > 90 ) then '00'
		        else '%02.0f' % ( a[0] - 64 )
		        end
	        else '00'
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function amap_4(a)
				{
					// capital letters A-Z are mapped to the two-digit numbers 01-26; the numbers 0-9 are mapped
					// to the numbers 30-39; special characters and lowercase letters are two zeros
					// result is a string
					if( a != null )
					{
						if (( a.charCodeAt(0) > 47 ) && ( a.charCodeAt(0) < 58 ))
						{
							return ( a.charCodeAt(0) - 18 ).complexFixedString(0, '02');
						}
						else if (( a.charCodeAt(0) < 65 ) or ( a.charCodeAt(0) > 90 ))
						{
							return '00';
						}
						else
						{
							return ( a.charCodeAt(0) - 64 ).complexFixedString(0, '02');
						}
					else
					{
						return '00';
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="C60AC46F18457C2EC71F813BADE880F0" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def single_tax(value)
	        return 0.0 if (value <= 0.0)
	        case value
		        when (0.01..21800.0) then 0.0535 * value
		        when (21800.01..71590.0) then 1166.30 + 0.0705 * (value - 21800.0)
		        else 4676.50 + 0.0785 * (value - 71590.0)
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function single_tax(value)
				{
					if (value <= 0.0)
					{
						return 0.0;
					}
					
					if (value >= 0.01 && value <= 21800.0)
					{
						return 0.0535 * value;
					}
					else if (value >= 21800.01 && value <= 71590.0)
					{
						return 1166.30 + 0.0705 * (value - 21800.0);
					}
					else 
					{
						return 4676.50 + 0.0785 * (value - 71590.0);
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="F69787ED1069D2808E0233F5FD8E8ED1" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)			 		
	        if (taxable_income < 500000.0) then return 0 end				
	        tax = case taxable_income
			        when (500000...1000000): 100.0		
			        when (1000000...5000000): 300.0
			        when (5000000...10000000): 1000.0
			        when (10000000...20000000): 2000.0
			        else 5000.0
		        end
	        return tax		
        end		
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income < 500000.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 500000 && taxable_income <= 1000000) { tax = 100.0; }
					else if (taxable_income >= 1000000 && taxable_income <= 5000000) { tax = 300.0; }
					else if (taxable_income >= 5000000 && taxable_income <= 10000000) {	tax = 1000.0;	}
					else if (taxable_income >= 10000000 && taxable_income <= 20000000) { tax = 2000.0; }
					else { tax = 5000.0; }

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="47AA3BC651CCBA55E5E2E9E0EFD1CFD9" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def process_alpha_fields(name, field_length)
	        name = name.squeeze(' ').strip.upcase
	        return " " * (field_length - 1) + "N" if (name.empty?)

	        name = if (["THE","A"].include?(name[0, field_length].strip)) then name[field_length, field_length]
			        else name[0, field_length]
			        end
	        return (name != nil ? " " * (field_length - name.length) + name : " " * (field_length - 1) + "N")
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function process_alpha_fields(name, field_length)
				{
					name = name.squeeze(' ').trim().toUpperCase();

					// Empty names default to '   N' as per the specs.
					if (name.isEmpty())
					{
						return " ".repeat(field_length - 1) + "N";
					}

					// The old code looked for "THE ", we are also looking for "A" as per the spec.
					// We strip out any space characters. We also ensure the return value is of the
					// proper length, padded in the front with space characters. Still following the old code
					// method of grabbing the next group of characters and returning those.
					if (["THE","A"].contains(name.substring(0, field_length).trim()))
					{
						name = name.substring(field_length, field_length);
					}
					else
					{
						name = name.substring(0, field_length);
					}

					return (name != null ? " ".repeat(field_length - name.length) + name : " ".repeat(field_length - 1) + "N");
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="13DAD59384A8951D844095BA7346D8F9" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def credit(code)
	        return 2 unless ((2..50) === code.to_i)
	        ([2,3,4,11,12,14].include?(code.to_i) ? 1 : 0)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function credit(code)
				{
					if (code.to_i() < 2 || code.to_i() > 50)
					{
						return 2;
					}

					return ([2,3,4,11,12,14].contains(code.to_i()) ? 1 : 0)
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="C39FF7BAEA068F6FC856F5CB31334841" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax_due(a)
	        a = a.to_f
	        if( a >= 9000.0 ) then 315.0 + ( a - 9000.0 ) * 0.06
	        elsif( a >= 8900.0 ) then 312
	        elsif( a >= 8800.0 ) then 307
	        elsif( a >= 8700.0 ) then 301
	        elsif( a >= 8600.0 ) then 296
	        elsif( a >= 8500.0 ) then 290
	        elsif( a >= 8400.0 ) then 285
	        elsif( a >= 8300.0 ) then 279
	        elsif( a >= 8200.0 ) then 274
	        elsif( a >= 8100.0 ) then 268
	        elsif( a >= 8000.0 ) then 263
	        elsif( a >= 7900.0 ) then 258
	        elsif( a >= 7800.0 ) then 253
	        elsif( a >= 7700.0 ) then 248
	        elsif( a >= 7600.0 ) then 243
	        elsif( a >= 7500.0 ) then 238
	        elsif( a >= 7400.0 ) then 233
	        elsif( a >= 7300.0 ) then 228
	        elsif( a >= 7200.0 ) then 223
	        elsif( a >= 7100.0 ) then 218
	        elsif( a >= 7000.0 ) then 213
	        elsif( a >= 6900.0 ) then 208
	        elsif( a >= 6800.0 ) then 203
	        elsif( a >= 6700.0 ) then 199
	        elsif( a >= 6600.0 ) then 194
	        elsif( a >= 6500.0 ) then 190
	        elsif( a >= 6400.0 ) then 185
	        elsif( a >= 6300.0 ) then 181
	        elsif( a >= 6200.0 ) then 176
	        elsif( a >= 6100.0 ) then 172
	        elsif( a >= 6000.0 ) then 167
	        elsif( a >= 5900.0 ) then 163
	        elsif( a >= 5800.0 ) then 159
	        elsif( a >= 5700.0 ) then 155
	        elsif( a >= 5600.0 ) then 151
	        elsif( a >= 5500.0 ) then 147
	        elsif( a >= 5400.0 ) then 143
	        elsif( a >= 5300.0 ) then 139
	        elsif( a >= 5200.0 ) then 135
	        elsif( a >= 5100.0 ) then 131
	        elsif( a >= 5000.0 ) then 127
	        elsif( a >= 4900.0 ) then 123
	        elsif( a >= 4800.0 ) then 120
	        elsif( a >= 4700.0 ) then 116
	        elsif( a >= 4600.0 ) then 113
	        elsif( a >= 4500.0 ) then 109
	        elsif( a >= 4400.0 ) then 106
	        elsif( a >= 4300.0 ) then 102
	        elsif( a >= 4200.0 ) then 99
	        elsif( a >= 4100.0 ) then 95
	        elsif( a >= 4000.0 ) then 92
	        elsif( a >= 3900.0 ) then 89
	        elsif( a >= 3800.0 ) then 86
	        elsif( a >= 3700.0 ) then 83
	        elsif( a >= 3600.0 ) then 80
	        elsif( a >= 3500.0 ) then 77
	        elsif( a >= 3400.0 ) then 74
	        elsif( a >= 3300.0 ) then 71
	        elsif( a >= 3200.0 ) then 68
	        elsif( a >= 3100.0 ) then 65
	        elsif( a >= 3000.0 ) then 62
	        elsif( a >= 2900.0 ) then 59
	        elsif( a >= 2800.0 ) then 56
	        elsif( a >= 2700.0 ) then 54
	        elsif( a >= 2600.0 ) then 51
	        elsif( a >= 2500.0 ) then 49
	        elsif( a >= 2400.0 ) then 46
	        elsif( a >= 2300.0 ) then 44
	        elsif( a >= 2200.0 ) then 41
	        elsif( a >= 2100.0 ) then 39
	        elsif( a >= 2000.0 ) then 36
	        elsif( a >= 1900.0 ) then 34
	        elsif( a >= 1800.0 ) then 32
	        elsif( a >= 1700.0 ) then 30
	        elsif( a >= 1600.0 ) then 28
	        elsif( a >= 1500.0 ) then 26
	        elsif( a >= 1400.0 ) then 24
	        elsif( a >= 1300.0 ) then 22
	        elsif( a >= 1200.0 ) then 20
	        elsif( a >= 1100.0 ) then 18
	        elsif( a >= 1000.0 ) then 16
	        elsif( a >= 900.0 ) then 14
	        elsif( a >= 800.0 ) then 13
	        elsif( a >= 700.0 ) then 11
	        elsif( a >= 600.0 ) then 10
	        elsif( a >= 500.0 ) then 8
	        elsif( a >= 400.0 ) then 7
	        elsif( a >= 300.0 ) then 5
	        elsif( a >= 200.0 ) then 4
	        elsif( a >= 100.0 ) then 2
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax_due(a)
				{
					a = a.to_f();
					if(a >= 9000.0) { return 315.0 + (a - 9000.0) * 0.06; }
					else if(a >= 8900.0) { return 312; }
					else if(a >= 8800.0) { return 307; }
					else if(a >= 8700.0) { return 301; }
					else if(a >= 8600.0) { return 296; }
					else if(a >= 8500.0) { return 290; }
					else if(a >= 8400.0) { return 285; }
					else if(a >= 8300.0) { return 279; }
					else if(a >= 8200.0) { return 274; }
					else if(a >= 8100.0) { return 268; }
					else if(a >= 8000.0) { return 263; }
					else if(a >= 7900.0) { return 258; }
					else if(a >= 7800.0) { return 253; }
					else if(a >= 7700.0) { return 248; }
					else if(a >= 7600.0) { return 243; }
					else if(a >= 7500.0) { return 238; }
					else if(a >= 7400.0) { return 233; }
					else if(a >= 7300.0) { return 228; }
					else if(a >= 7200.0) { return 223; }
					else if(a >= 7100.0) { return 218; }
					else if(a >= 7000.0) { return 213; }
					else if(a >= 6900.0) { return 208; }
					else if(a >= 6800.0) { return 203; }
					else if(a >= 6700.0) { return 199; }
					else if(a >= 6600.0) { return 194; }
					else if(a >= 6500.0) { return 190; }
					else if(a >= 6400.0) { return 185; }
					else if(a >= 6300.0) { return 181; }
					else if(a >= 6200.0) { return 176; }
					else if(a >= 6100.0) { return 172; }
					else if(a >= 6000.0) { return 167; }
					else if(a >= 5900.0) { return 163; }
					else if(a >= 5800.0) { return 159; }
					else if(a >= 5700.0) { return 155; }
					else if(a >= 5600.0) { return 151; }
					else if(a >= 5500.0) { return 147; }
					else if(a >= 5400.0) { return 143; }
					else if(a >= 5300.0) { return 139; }
					else if(a >= 5200.0) { return 135; }
					else if(a >= 5100.0) { return 131; }
					else if(a >= 5000.0) { return 127; }
					else if(a >= 4900.0) { return 123; }
					else if(a >= 4800.0) { return 120; }
					else if(a >= 4700.0) { return 116; }
					else if(a >= 4600.0) { return 113; }
					else if(a >= 4500.0) { return 109; }
					else if(a >= 4400.0) { return 106; }
					else if(a >= 4300.0) { return 102; }
					else if(a >= 4200.0) { return 99; }
					else if(a >= 4100.0) { return 95; }
					else if(a >= 4000.0) { return 92; }
					else if(a >= 3900.0) { return 89; }
					else if(a >= 3800.0) { return 86; }
					else if(a >= 3700.0) { return 83; }
					else if(a >= 3600.0) { return 80; }
					else if(a >= 3500.0) { return 77; }
					else if(a >= 3400.0) { return 74; }
					else if(a >= 3300.0) { return 71; }
					else if(a >= 3200.0) { return 68; }
					else if(a >= 3100.0) { return 65; }
					else if(a >= 3000.0) { return 62; }
					else if(a >= 2900.0) { return 59; }
					else if(a >= 2800.0) { return 56; }
					else if(a >= 2700.0) { return 54; }
					else if(a >= 2600.0) { return 51; }
					else if(a >= 2500.0) { return 49; }
					else if(a >= 2400.0) { return 46; }
					else if(a >= 2300.0) { return 44; }
					else if(a >= 2200.0) { return 41; }
					else if(a >= 2100.0) { return 39; }
					else if(a >= 2000.0) { return 36; }
					else if(a >= 1900.0) { return 34; }
					else if(a >= 1800.0) { return 32; }
					else if(a >= 1700.0) { return 30; }
					else if(a >= 1600.0) { return 28; }
					else if(a >= 1500.0) { return 26; }
					else if(a >= 1400.0) { return 24; }
					else if(a >= 1300.0) { return 22; }
					else if(a >= 1200.0) { return 20; }
					else if(a >= 1100.0) { return 18; }
					else if(a >= 1000.0) { return 16; }
					else if(a >= 900.0) { return 14; }
					else if(a >= 800.0) { return 13; }
					else if(a >= 700.0) { return 11; }
					else if(a >= 600.0) { return 10; }
					else if(a >= 500.0) { return 8; }
					else if(a >= 400.0) { return 7; }
					else if(a >= 300.0) { return 5; }
					else if(a >= 200.0) { return 4; }
					else if(a >= 100.0) { return 2; }
					else { return 0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="688C06E5CD839B34F193D58FC9E76D04" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_2(a)
	        if( a[0] != nil )
		        if( a[0] > 64 ) and ( a[0] < 91 ) then '%02.0f' % ( a[0] - 64 )
		        elsif a[0] == 44 then '27'
		        elsif a[0] == 45 then '28'
		        elsif a[0] == 39 then '29'
		        else '00'
		        end
	        else '00'
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function amap_2(a)
				{
					// capital letters A-Z are mapped to the two-digit numbers 01-26; a comma is mapped to 27;
					// a hyphen is mapped to 28; an apostrophe is mapped to 29; numbers, lowercase letters, and
					// all other special characters are two zeros
					// result is a string
					if( a != null )
					{
						if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 91 ))
						{
							return ( a.charCodeAt(0) - 64 ).complexFixedString(0, '02');
						}
						else if (a.charCodeAt(0) == 44) { return '27'; }
						else if (a.charCodeAt(0) == 45) { return '28'; }
						else if (a.charCodeAt(0) == 39) { return '29'; }
						else { return '00'; }
					}
					else
					{
						return '00';
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="1C983FBCEB7ED33112FB3F17EE272B29" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)

	        if (taxable_income <= 0.0) then return 0 end						
		        tax = case taxable_income						
				        when (0.01...2600.01) then taxable_income * 0.01
				        when (2600.01...4600.01) then ((taxable_income * 0.02 ) - 26.0)
				        when (4600.01...7000.01) then ((taxable_income * 0.03) - 72.0)
				        when (7000.01...9500.01) then tax = ((taxable_income * 0.04) - 142.0)
				        when (9500.01...12200.01) then ((taxable_income * 0.05 ) - 237.0)
				        when (12200.01...15600.01) then ((taxable_income * 0.06) - 359.0)
				        else ((taxable_income * 0.069) - 499.0)
			        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					if (taxable_income >= 0.01 && taxable_income <= 2600.01)
						{ return taxable_income * 0.01; }
					else if (taxable_income >= 2600.01 && taxable_income <= 4600.01)
						{ return ((taxable_income * 0.02 ) - 26.0); }
					else if (taxable_income >= 4600.01 && taxable_income <= 7000.01)
						{ return ((taxable_income * 0.03) - 72.0); }
					else if (taxable_income >= 7000.01 && taxable_income <= 9500.01)
						{ return ((taxable_income * 0.04) - 142.0); }
					else if (taxable_income >= 9500.01 && taxable_income <= 12200.01)
						{ return ((taxable_income * 0.05 ) - 237.0); }
					else if (taxable_income >= 12200.01 && taxable_income <= 15600.01)
						{ return ((taxable_income * 0.06) - 359.0); }
					else 
						{ return ((taxable_income * 0.069) - 499.0); }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D129692911F68C143ACBDE98B3F7DC89" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(amount)

	        amount = amount.to_f

	        return 0.0 if (amount <= 0.0)

	        case (amount)
		        when (0.01..2600.0): (amount * 0.01)
		        when (2600.01..4600.0): (amount * 0.02) - 26.0
		        when (4600.01..7000.0): (amount * 0.03) - 72.0
		        when (7000.01..9500.0): (amount * 0.04) - 142.0
		        when (9500.01..12200.0): (amount * 0.05) - 237.0
		        when (12200.01..15600.0): (amount * 0.06) - 359.0
		        else (amount * 0.069) - 499.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2600.0)
					{
						return (amount * 0.01);
					}
					else if (amount >= 2600.01 && amount <= 4600.0)
					{
						return (amount * 0.02) - 26.0;
					}
					else if (amount >= 4600.01 && amount <= 7000.0)
					{
						return (amount * 0.03) - 72.0;
					}
					else if (amount >= 7000.01 && amount <= 9500.0)
					{
						return (amount * 0.04) - 142.0;
					}
					else if (amount >= 9500.01 && amount <= 12200.0)
					{
						return (amount * 0.05) - 237.0;
					}
					else if (amount >= 12200.01 && amount <= 15600.0)
					{
						return (amount * 0.06) - 359.0;
					}
					else
					{
						return (amount * 0.069) - 499.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="89C954F0587DB21047547DFCF4F49194" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)

	        if (taxable_income <= 0.0) then return '' end
	        tax = case taxable_income		
			        when (0.01..15000.0) then '35'		
			        when (15000.01..17000.0) then '34'
			        when (17000.01..19000.0) then '33'
			        when (19000.01..21000.0) then '32'
			        when (21000.01..23000.0) then '31'
			        when (23000.01..25000.0) then '30'
			        when (25000.01..27000.0) then '29'
			        when (27000.01..29000.0) then '28'
			        else ''
		        end
	        return tax						
        end			    
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return '';
					}
					
					var tax = '';
					if (taxable_income >= 0.01 && taxable_income <= 15000.0)
					{
						tax = '35';
					}
					else if (taxable_income >= 15000.01 && taxable_income <= 17000.0)
					{
						tax = '34';
					}
					else if (taxable_income >= 17000.01 && taxable_income <= 19000.0)
					{
						tax = '33';
					}
					else if (taxable_income >= 19000.01 && taxable_income <= 21000.0)
					{
						tax = '32';
					}
					else if (taxable_income >= 21000.01 && taxable_income <= 23000.0)
					{
						tax = '31';
					}
					else if (taxable_income >= 23000.01 && taxable_income <= 25000.0)
					{
						tax = '30';
					}
					else if (taxable_income >= 25000.01 && taxable_income <= 27000.0)
					{
						tax = '29';
					}
					else if (taxable_income >= 27000.01 && taxable_income <= 29000.0)
					{
						tax = '28';
					}
					else
						tax = '';
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D439A0A2A7794E92AF1EF461622DD11D" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def min_max(function, *values)
	        function.upcase!
	        if ((values.length > 0) and ((function == 'MIN') or (function == 'MAX')))
		        result = values[0].to_f
		        if (function == 'MIN')
			        1.upto(values.length - 1) {|x|
				        result = values[x].to_f if values[x].to_f < result
				        }
		        elsif (function == 'MAX')
			        1.upto(values.length - 1) {|x|
				        result = values[x].to_f if values[x].to_f > result
				        }
		        end
		        return result
	        end
        end    
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function min_max(function, values)
				{
					function = function.toUpperCase();
					
					if ((values.length > 0) && ((function == 'MIN') || (function == 'MAX')))
					{
						result = values[0].to_f();
						
						if (function == 'MIN')
						{
							for (var x = 1; x < values.length - 1; x++)
							{
								if (values[x].to_f() < result)
								{
									result = values[x].to_f();
								}
							}
						}
						else if (function == 'MAX')
						{
							for (var x = 1; x < values.length - 1; x++)
							{
								if (values[x].to_f() > result)
								{
									result = values[x].to_f();
								}
							}
						}
						
						return result;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="8DF8827719B5D0FA67CE4E58F94D81C9" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							

	        return 0.0 if (taxable_income <= 0.0)

	        case taxable_income
		        when (0.01..2600.0): taxable_income * 0.01
		        when (2600.01..4600.0): ((taxable_income * 0.02 ) - 26.0)
		        when (4600.01..7000.0): ((taxable_income * 0.03) - 72.0)
		        when (7000.01..9500.0): ((taxable_income * 0.04) - 142.0)
		        when (9500.01..12200.0): ((taxable_income * 0.05 ) - 237.0)
		        when (12200.01..15600.0): ((taxable_income * 0.06) - 359.0)
		        else ((taxable_income * 0.069) - 499.0)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					else if (taxable_income >= 0.01 && taxable_income <= 2600.0) { return taxable_income * 0.01; }
					else if (taxable_income >= 2600.01 && taxable_income <= 4600.0) { return ((taxable_income * 0.02 ) - 26.0); }
					else if (taxable_income >= 4600.01 && taxable_income <= 7000.0) { return  ((taxable_income * 0.03) - 72.0); }
					else if (taxable_income >= 7000.01 && taxable_income <= 9500.0) { return  ((taxable_income * 0.04) - 142.0); }
					else if (taxable_income >= 9500.01 && taxable_income <= 12200.0) { return ((taxable_income * 0.05 ) - 237.0); }
					else if (taxable_income >= 12200.01 && taxable_income <= 15600.0) { return ((taxable_income * 0.06) - 359.0); }
					else { return ((taxable_income * 0.069) - 499.0); }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="0FC20DBB8B4B325A28D95F1AD7E5553A" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        tax = case taxable_income						
			        when (0.01..2600.0) then taxable_income * 0.01				
			        when (2600.01..4600.0) then ((taxable_income * 0.02 ) - 26.0)				
			        when (4600.01..7000.0) then ((taxable_income * 0.03) - 72.0)				
			        when (7000.01..9500.0) then ((taxable_income * 0.04) - 142.0)	
			        when (9500.01..12200.0) then ((taxable_income * 0.05) - 237.0)				
			        when (12200.01..15600.0) then ((taxable_income * 0.06) - 359.0)				
			        else ((taxable_income * 0.069) - 499.0)
		        end			
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 2600.0)
					{
						tax = taxable_income * 0.01;
					}
					else if (taxable_income >= 2600.01 && taxable_income <= 4600.0)
					{
						tax = ((taxable_income * 0.02 ) - 26.0);
					}
					else if (taxable_income >= 4600.01 && taxable_income <= 7000.0)
					{
						tax = ((taxable_income * 0.03) - 72.0);
					}
					else if (taxable_income >= 7000.01 && taxable_income <= 9500.0)
					{
						tax = ((taxable_income * 0.04) - 142.0);
					}
					else if (taxable_income >= 9500.01 && taxable_income <= 12200.0)
					{
						tax = ((taxable_income * 0.05) - 237.0);
					}
					else if (taxable_income >= 12200.01 && taxable_income <= 15600.0)
					{
						tax = ((taxable_income * 0.06) - 359.0);
					}
					else
					{
						tax = ((taxable_income * 0.069) - 499.0);
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="0BEEB5612C7FDDC627455BAC007F5967" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_amount)

	        tax =	if (taxable_amount > 15600.0): taxable_amount * 0.069 - 499.0
		        elsif (taxable_amount > 12200.0): taxable_amount * 0.06 - 359.0
		        elsif (taxable_amount > 9500.0): taxable_amount * 0.05 - 237.0
		        elsif (taxable_amount > 7000.0): taxable_amount * 0.04 - 142.0
		        elsif (taxable_amount > 4600.0): taxable_amount * 0.03 - 72.0
		        elsif (taxable_amount > 2600.0): taxable_amount * 0.02 - 26.0
		        elsif (taxable_amount > 0.0): taxable_amount * 0.01
		        else 0.0
		        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_amount)
				{
					var tax = 0.0;
					
					if (taxable_amount > 15600.0)
					{
						tax = taxable_amount * 0.069 - 499.0;
					}
					else if (taxable_amount > 12200.0)
					{
						tax = taxable_amount * 0.06 - 359.0;
					}
					else if (taxable_amount > 9500.0)
					{
						tax = taxable_amount * 0.05 - 237.0;
					}
					else if (taxable_amount > 7000.0)
					{
						tax = taxable_amount * 0.04 - 142.0;
					}
					else if (taxable_amount > 4600.0)
					{
						tax = taxable_amount * 0.03 - 72.0;
					}
					else if (taxable_amount > 2600.0)
					{
						tax = taxable_amount * 0.02 - 26.0;
					}
					else if (taxable_amount > 0.0)
					{
						tax = taxable_amount * 0.01;
					}
					else
					{
						tax = 0.0;
					}
						
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="EDF277489DC9DE059884238A2EAB80D2" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)
	        if( amount > 20000.0 ) then 973.0 + ( amount - 20000.0 ) * 0.0685
	        elsif( amount > 13000.0 ) then 560.0 + ( amount - 13000.0 ) * 0.059
	        elsif( amount > 11000.0 ) then 455.0 + ( amount - 11000.0 ) * 0.0525
	        elsif( amount > 8000.0 ) then 320.0 + ( amount - 8000.0 ) * 0.045
	        elsif( amount > 0.0 ) then amount * 0.04
	        else 0.0
	        end
        end		
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					if( amount > 20000.0 )
					{
						return 973.0 + ( amount - 20000.0 ) * 0.0685;
					}
					else if( amount > 13000.0 )
					{
						return 560.0 + ( amount - 13000.0 ) * 0.059;
					}
					else if( amount > 11000.0 )
					{
						return 455.0 + ( amount - 11000.0 ) * 0.0525;
					}
					else if( amount > 8000.0 )
					{
						return 320.0 + ( amount - 8000.0 ) * 0.045;
					}
					else if( amount > 0.0 )
					{
						return amount * 0.04;
					}
					else
					{
						return 0.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="9E6A8D18EFA107EDE037CC8CD092F5A5" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_1(a)
	        if( a[0] != nil )
		        if( a[0] > 64 ) and ( a[0] < 91 ) then a[0] - 55
		        elsif( a[0] > 47 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif a[0] == 38 then 36
		        else 0
		        end
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function amap_1(a)
				{
					// capital letters A-Z are mapped to numbers 10-35; the numbers 0-9 are mapped to 0-9
					// an ampersand (&) is mapped to 36; all other special characters and lowercase letters are zero
					// result is an integer
					if( a != null )
					{
						if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 91 ))
						{
							return a.charCodeAt(0) - 55;
						}
						else if (( a.charCodeAt(0) > 47 ) && ( a.charCodeAt(0) < 58 ))
						{
							return a.charCodeAt(0) - 48;
						}
						else if (a.charCodeAt(0) == 38)
						{
							return 36;
						}
						else
						{
							return 0;
						}
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="25A111B3D74DE0D5C020268BBCDE070D" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_1(a)
	        if( a[0] != nil )
		        if( a[0] > 64 ) and ( a[0] < 91 ) then a[0] - 55
		        elsif( a[0] > 48 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif a[0] == 38 then 36
		        else 0
		        end
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function amap_1(a)
				{
					// capital letters A-Z are mapped to numbers 10 - 35; the numbers 0 - 9 are mapped to 0-9
					// an ampersand (&) is mapped to 36; all other special characters and lowercase letters are zero
					// result is an integer
					if ( a != null )
					{
						if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 91 )) { return a.charCodeAt(0) - 55; }
						else if (( a.charCodeAt(0) > 48 ) && ( a.charCodeAt(0) < 58 )) { return  a.charCodeAt(0) - 48; }
						else if (a.charCodeAt(0) == 38) { return 36; }
						else { return 0; }
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="238538030C763DC5B5D3B2382DC82F5F" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def modified_amap_1(a)
	        if( a[0] != nil )
		        if( a[0] > 64 ) and ( a[0] < 91 ) then a[0] - 55
		        elsif( a[0] > 47 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif a[0] == 32 then 36
		        else 0
		        end
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function modified_amap_1(a)
				{
					// capital letters A-Z are mapped to numbers 10-35; the numbers 0-9 are mapped to 0-9
					// a space is mapped to 36; all other special characters and lowercase letters are zero
					// result is an integer
					if ( a != null )
					{
						if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 91 ))
						{
							return a.charCodeAt(0) - 55;
						}
						else if (( a.charCodeAt(0) > 47 ) && ( a.charCodeAt(0) < 58 ))
						{
							return a.charCodeAt(0) - 48;
						}
						else if (a.charCodeAt(0) == 32)
						{
							return 36;
						}
						else
						{
							return 0;
						}
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="158B9C165529D896678E0DE4EB256234" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(a)
	        a = a.to_f
	        if( a > 60000.0 )	
		        4072.50 + (0.0775 * (a - 60000.0))
	        elsif( a > 12750.0 )	
		        765.0 + (0.07 * (a - 12750.0))
	        elsif( a > 0.0 )
		        a * 0.06
	        else
		        0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(a)
				{
					a = a.to_f();
					
					if ( a > 60000.0 )	
					{
						return 4072.50 + (0.0775 * (a - 60000.0));
					}
					else if ( a > 12750.0 )	
					{
						return 765.0 + (0.07 * (a - 12750.0));
					}
					else if ( a > 0.0 )
					{
						return a * 0.06;
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="C7515DC4C33E83AA502BF41F021FBD15" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.0...40000)					
			        tax = taxable_income * 0.0				
		        when (40000...90000)					
			        tax = ((taxable_income - 40000.0) * 0.008) 				
		        when (90000...140000)					
			        tax = ((taxable_income - 90000.0) * 0.016) + 400.0				
		        when (140000...240000)					
			        tax = ((taxable_income - 140000.0) * 0.024) + 1200.0	
		        when (240000...440000)					
			        tax = ((taxable_income - 240000.0) * 0.032) + 3600.0	
		        when (440000...640000)					
			        tax = ((taxable_income - 440000.0) * 0.04) + 10000.0	
		        when (640000...840000)					
			        tax = ((taxable_income - 640000.0) * 0.048) + 18000.0	
		        when (840000...1040000)					
			        tax = ((taxable_income - 840000.0) * 0.056) + 27600.0	
		        when (1040000...1540000)					
			        tax = ((taxable_income - 1040000.0) * 0.064) + 38800.0	
		        when (1540000...2040000)					
			        tax = ((taxable_income - 1540000.0) * 0.072) + 70800.0	
		        when (2040000...2540000)					
			        tax = ((taxable_income - 2040000.0) * 0.08) + 106800.0	
		        when (2540000...3040000)					
			        tax = ((taxable_income - 2540000.0) * 0.088) + 146800.0	
		        when (3040000...3540000)					
			        tax = ((taxable_income - 3040000.0) * 0.096) + 190800.0	
		        when (3540000...4040000)					
			        tax = ((taxable_income - 3540000.0) * 0.104) + 238800.0	
		        when (4040000...5040000)					
			        tax = ((taxable_income - 4040000.0) * 0.112) + 290800.0	
		        when (5040000...6040000)					
			        tax = ((taxable_income - 5040000.0) * 0.12) + 402800.0	
		        when (6040000...7040000)					
			        tax = ((taxable_income - 6040000.0) * 0.128) + 522800.0	
		        when (7040000...8040000)					
			        tax = ((taxable_income - 7040000.0) * 0.136) + 650800.0	
		        when (8040000...9040000)					
			        tax = ((taxable_income - 8040000.0) * 0.144) + 786800.0	
		        when (9040000...10040000)					
			        tax = ((taxable_income - 9040000.0) * 0.152) + 930800.0	

		        else					
			        tax = ((taxable_income - 10040000.0) * 0.16) + 1082800.0				
	        end						
	        return tax						
        end							
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.0 && taxable_income <= 40000)					
					{
						tax = taxable_income * 0.0;
					}
					else if (taxable_income >= 40000 && taxable_income <= 90000)					
					{
						tax = ((taxable_income - 40000.0) * 0.008);
					}
					else if (taxable_income >= 90000 && taxable_income <= 140000)					
					{
						tax = ((taxable_income - 90000.0) * 0.016) + 400.0;
					}
					else if (taxable_income >= 140000 && taxable_income <= 240000)					
					{
						tax = ((taxable_income - 140000.0) * 0.024) + 1200.0;
					}
					else if (taxable_income >= 240000 && taxable_income <= 440000)					
					{
						tax = ((taxable_income - 240000.0) * 0.032) + 3600.0;
					}
					else if (taxable_income >= 440000 && taxable_income <= 640000)					
					{
						tax = ((taxable_income - 440000.0) * 0.04) + 10000.0;
					}
					else if (taxable_income >= 640000 && taxable_income <= 840000)					
					{
						tax = ((taxable_income - 640000.0) * 0.048) + 18000.0;
					}
					else if (taxable_income >= 840000 && taxable_income <= 1040000)					
					{
						tax = ((taxable_income - 840000.0) * 0.056) + 27600.0;
					}
					else if (taxable_income >= 1040000 && taxable_income <= 1540000)					
					{
						tax = ((taxable_income - 1040000.0) * 0.064) + 38800.0;
					}
					else if (taxable_income >= 1540000 && taxable_income <= 2040000)					
					{
						tax = ((taxable_income - 1540000.0) * 0.072) + 70800.0;
					}
					else if (taxable_income >= 2040000 && taxable_income <= 2540000)					
					{
						tax = ((taxable_income - 2040000.0) * 0.08) + 106800.0;
					}
					else if (taxable_income >= 2540000 && taxable_income <= 3040000)					
					{
						tax = ((taxable_income - 2540000.0) * 0.088) + 146800.0;
					}
					else if (taxable_income >= 3040000 && taxable_income <= 3540000)					
					{
						tax = ((taxable_income - 3040000.0) * 0.096) + 190800.0;
					}
					else if (taxable_income >= 3540000 && taxable_income <= 4040000)					
					{
						tax = ((taxable_income - 3540000.0) * 0.104) + 238800.0;
					}
					else if (taxable_income >= 4040000 && taxable_income <= 5040000)					
					{
						tax = ((taxable_income - 4040000.0) * 0.112) + 290800.0;
					}
					else if (taxable_income >= 5040000 && taxable_income <= 6040000)					
					{
						tax = ((taxable_income - 5040000.0) * 0.12) + 402800.0;
					}
					else if (taxable_income >= 6040000 && taxable_income <= 7040000)					
					{
						tax = ((taxable_income - 6040000.0) * 0.128) + 522800.0;
					}
					else if (taxable_income >= 7040000 && taxable_income <= 8040000)					
					{
						tax = ((taxable_income - 7040000.0) * 0.136) + 650800.0;
					}
					else if (taxable_income >= 8040000 && taxable_income <= 9040000)					
					{
						tax = ((taxable_income - 8040000.0) * 0.144) + 786800.0;
					}
					else if (taxable_income >= 9040000 && taxable_income <= 10040000)					
					{
						tax = ((taxable_income - 9040000.0) * 0.152) + 930800.0;
					}
					else					
					{
						tax = ((taxable_income - 10040000.0) * 0.16) + 1082800.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="FBB2F4B5AC1ECD455719B4C772F41BF1" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)
	        if( amount > 200000.0 )
		        9090.0 + ( amount - 200000.0 ) * 0.05925
	        elsif( amount > 100000.0 )
		        3639.00 + ( amount - 100000.0 ) * 0.05451
	        elsif( amount > 80000.0 )
		        2700.0 + ( amount - 80000.0 ) * 0.04695
	        elsif( amount > 40000.0 )
		        1056.40 + ( amount - 40000.0 ) * 0.04109
	        elsif( amount > 20000.0 )
		        352.20 + ( amount - 20000.0 ) * 0.03521
	        elsif( amount > 15000.0 )
		        205.45 + ( amount - 15000.0 ) * 0.02935
	        elsif( amount > 10000.0 )
		        88.05 + ( amount - 10000.0 ) * 0.02348
	        elsif( amount > 5000.0 )
		        29.35 + ( amount - 5000.0 ) * 0.01174
	        elsif( amount > 0.0 )
		        amount * 0.00587
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					if( amount > 200000.0 )
					{
						return 9090.0 + ( amount - 200000.0 ) * 0.05925;
					}
					else if( amount > 100000.0 )
					{
						return 3639.00 + ( amount - 100000.0 ) * 0.05451;
					}
					else if( amount > 80000.0 )
					{
						return 2700.0 + ( amount - 80000.0 ) * 0.04695;
					}
					else if( amount > 40000.0 )
					{
						return 1056.40 + ( amount - 40000.0 ) * 0.04109;
					}
					else if( amount > 20000.0 )
					{
						return 352.20 + ( amount - 20000.0 ) * 0.03521;
					}
					else if( amount > 15000.0 )
					{
						return 205.45 + ( amount - 15000.0 ) * 0.02935;
					}
					else if( amount > 10000.0 )
					{
						return 88.05 + ( amount - 10000.0 ) * 0.02348;
					}
					else if( amount > 5000.0 )
					{
						return 29.35 + ( amount - 5000.0 ) * 0.01174;
					}
					else if( amount > 0.0 )
					{
						return amount * 0.00587;
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="F82626FA87073F63CC91C05380C0D3B9" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def get_tax_data(taxable_income)

	        return ["", "0%", ""] if (taxable_income < 0.0)

	        case (taxable_income)
		        when (0...100000): ["0", "0", "0"]
		        when (100000...150000): ["100000", "0", "0.8"]
		        when (150000...200000): ["150000", "400", "1.6"]
		        when (200000...300000): ["200000", "1200", "2.4"]
		        when (300000...500000): ["300000", "3600", "3.2"]
		        when (500000...700000): ["500000", "10000", "4.0"]
		        when (700000...900000): ["700000", "18000", "4.8"]
		        when (900000...1100000): ["900000", "27600", "5.6"]
		        when (1100000...1600000): ["1100000", "38800", "6.4"]
		        when (1600000...2100000): ["1600000", "70800", "7.2"]
		        when (2100000...2600000): ["2100000", "106800", "8.0"]
		        when (2600000...3100000): ["2600000", "146800", "8.8"]
		        when (3100000...3600000): ["3100000", "190800", "9.6"]
		        when (3600000...4100000): ["3600000", "238800", "10.4"]
		        when (4100000...5100000): ["4100000", "290800", "11.2"]
		        when (5100000...6100000): ["5100000", "402800", "12.0"]
		        when (6100000...7100000): ["6100000", "522800", "12.8"]
		        when (7100000...7500000): ["7100000", "650800", "13.6"]
		        when (7500000...8100000): ["7500000", "402800", "13.0"]
		        when (8100000...9100000): ["8100000", "253344", "12.5"]
		        when (9100000...10100000): ["9100000", "146800", "12.0"]
		        when (10100000...11100000): ["10100000", "35400", "11.2"]
		        when (11100000...12100000): ["11100000", "15520", "7.7"]
		        when (12100000...13100000): ["12100000", "8000", "5.7"]
		        when (13100000...14100000): ["13100000", "0", "3.7"]
		        when (14100000...15100000): ["14100000", "0", "1.7"]		
		        else ["15100000", "0", "0"]
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_tax_data(taxable_income)
				{
					if (taxable_income < 0.0)
					{
						return ["", "0%", ""];
					}

					if (taxable_income >= 0 && taxable_income <= 100000) { return  ["0", "0", "0"]; }
					else if (taxable_income >= 100000 && taxable_income <= 150000) { return  ["100000", "0", "0.8"]; }
					else if (taxable_income >= 150000 && taxable_income <= 200000) { return  ["150000", "400", "1.6"]; }
					else if (taxable_income >= 200000 && taxable_income <= 300000) { return  ["200000", "1200", "2.4"]; }
					else if (taxable_income >= 300000 && taxable_income <= 500000) { return  ["300000", "3600", "3.2"]; }
					else if (taxable_income >= 500000 && taxable_income <= 700000) { return  ["500000", "10000", "4.0"]; }
					else if (taxable_income >= 700000 && taxable_income <= 900000) { return  ["700000", "18000", "4.8"]; }
					else if (taxable_income >= 900000 && taxable_income <= 1100000) { return  ["900000", "27600", "5.6"]; }
					else if (taxable_income >= 1100000 && taxable_income <= 1600000) { return  ["1100000", "38800", "6.4"]; }
					else if (taxable_income >= 1600000 && taxable_income <= 2100000) { return  ["1600000", "70800", "7.2"]; }
					else if (taxable_income >= 2100000 && taxable_income <= 2600000) { return  ["2100000", "106800", "8.0"]; }
					else if (taxable_income >= 2600000 && taxable_income <= 3100000) { return  ["2600000", "146800", "8.8"]; }
					else if (taxable_income >= 3100000 && taxable_income <= 3600000) { return  ["3100000", "190800", "9.6"]; }
					else if (taxable_income >= 3600000 && taxable_income <= 4100000) { return  ["3600000", "238800", "10.4"]; }
					else if (taxable_income >= 4100000 && taxable_income <= 5100000) { return  ["4100000", "290800", "11.2"]; }
					else if (taxable_income >= 5100000 && taxable_income <= 6100000) { return  ["5100000", "402800", "12.0"]; }
					else if (taxable_income >= 6100000 && taxable_income <= 7100000) { return  ["6100000", "522800", "12.8"]; }
					else if (taxable_income >= 7100000 && taxable_income <= 7500000) { return  ["7100000", "650800", "13.6"]; }
					else if (taxable_income >= 7500000 && taxable_income <= 8100000) { return  ["7500000", "402800", "13.0"]; }
					else if (taxable_income >= 8100000 && taxable_income <= 9100000) { return  ["8100000", "253344", "12.5"]; }
					else if (taxable_income >= 9100000 && taxable_income <= 10100000) { return  ["9100000", "146800", "12.0"]; }
					else if (taxable_income >= 10100000 && taxable_income <= 11100000) { return  ["10100000", "35400", "11.2"]; }
					else if (taxable_income >= 11100000 && taxable_income <= 12100000) { return  ["11100000", "15520", "7.7"]; }
					else if (taxable_income >= 12100000 && taxable_income <= 13100000) { return  ["12100000", "8000", "5.7"]; }
					else if (taxable_income >= 13100000 && taxable_income <= 14100000) { return  ["13100000", "0", "3.7"]; }
					else if (taxable_income >= 14100000 && taxable_income <= 15100000) { return  ["14100000", "0", "1.7"]; }	
					else { return ["15100000", "0", "0"]; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="F6C88534CAF4C9CCFB64A14A4D99DDD2" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def address(add1,add2,city,state,zip)
	        ( add1 +
	        if( add2.strip.empty? ) then ''
	        elsif( add1.strip.empty? ) then add2
	        else ',' + add2
	        end +
	        ( city.strip.empty? ? '' : ',' + city ) + ( state.strip.empty? ? '' : ', ' + state ) + ( zip.strip.empty? ? '' : '  ' + zip ) )[0,35]
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function address(add1,add2,city,state,zip)
				{
					var res = add1;
					
					if ( add2.trim().isEmpty() )
					{
						res += '';
					}
					else if ( add1.trim().isEmpty() )
					{
						res += add2;
					}
					else
					{
						res += ',' + add2;
					}
					
					res += (( city.trim().isEmpty() ? '' : ',' + city ) + ( state.trim().isEmpty() ? '' : ', ' + state ) + ( zip.trim().isEmpty() ? '' : '  ' + zip ) ).substring(0,35);
					
					return res;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D437B5723E5788CDC2E9EC54B3B2F5BA" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def validate_taxnum(number)
	        number = number.strip

	        return false unless (number =~ /\A[13]{1}[0-9]{10}\Z/)
	
	        cd = check_digit(number[0,10], '12', 10, true, false)
	
	        if (cd != number[10,1].to_i)
		        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
		        return true
	        end
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function validate_taxnum(number)
				{
					number = number.trim();

					if (/\A[13]{1}[0-9]{10}\Z/.test(number))
					{
						var cd = check_digit(number.substring(0,10), '12', 10, true, false);
						
						if (cd != number.substring(10,1).to_i())
						{
							SFForms.Utilities.MessageBox(formInstanceId, "The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", MB_ICONEXCLAMATION);
							return true
						}

						return false;
					}
					else
					{
						return false;
					}
					
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="3BB520A9B47A22CFE89DA2F7308EDAE5" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def tax(amount)
          amount = amount.to_f
          if( amount > 25000.0 )
	          1650.0 + ( amount - 25000.0 ) * 0.085
          elsif( amount > 10000.0 )
	          600.0 + ( amount - 10000.0 ) * 0.07
          elsif( amount > 0.0 )
	          amount * 0.06
          else 0
          end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					amount = amount.to_f();
					
					if ( amount > 25000.0 )
					{
						return 1650.0 + ( amount - 25000.0 ) * 0.085;
					}
					else if ( amount > 10000.0 )
					{
						return 600.0 + ( amount - 10000.0 ) * 0.07;
					}
					else if ( amount > 0.0 )
					{
						return amount * 0.06;
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="F0EA137AA571BA90C9B430F340C7ABD1" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def validate_dates(date1, date2)
	        date1 = date1.strip
	        date2 = date2.strip

	        ret = false

	        if (date1 =~ /\A(\d{2})(\d{2})(\d{2})\Z/)
		        begin_date = Time.gm($3, $1, $2)

		        if (date2 =~ /\A(\d{2})(\d{2})(\d{2})\Z/)
			        end_date = Time.gm($3, $1, $2)
	
			        if (end_date < begin_date)
				        messageBox("Incorrect dates have been entered. The accounting year end date cannot fall before the accounting year begin date.", "Attention!", $MB_ICONEXCLAMATION)
				        ret = true
			        end
		        end
	        end

	        return ret
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function validate_dates(date1, date2)
				{
					date1 = date1.trim();
					date2 = date2.trim();

					var ret = false;
					
					var matches = /\A(\d{2})(\d{2})(\d{2})\Z/.exec(date1);
					
					if (matches != null && matches.length > 0)
					{
						var begin_date = SFForms.Utilities.Time.gm(matches[3], matches[1], matches[2]);
					
						var matches1 = /\A(\d{2})(\d{2})(\d{2})\Z/.exec(date2);
						if (matches1 != null && matches1.length > 0)
						{
							var end_date = SFForms.Utilities.Time.gm(matches1[3], matches1[1], matches1[2]);
					
							if (end_date < begin_date)
							{
								SFForms.Utilities.MessageBox(formInstanceId, "Incorrect dates have been entered. The accounting year end date cannot fall before the accounting year begin date.", "Attention!", MB_ICONEXCLAMATION);
								ret = true;
							}
						}
					}

					return ret;
				}
			]]></JavaScriptCode>
	</Block>
	<Block id="138B2F9B1A4A3C066028FF80A6981570" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)
	         amount = amount.to_f
	        if( amount > 1999.0 )
		        '50%'
	        elsif( amount > 1499.0 )
		        '40%'
	        elsif( amount > 1199.0 )
		        '30%'
	        elsif( amount > 899.0 )
		        '25%'
	        elsif( amount > 599.0 )
		        '20%'
	        elsif( amount > 299.0 )
		        '15%'
	        else 	0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					amount = amount.to_f();
					
					if( amount > 1999.0 )
					{
						return '50%';
					}
					else if( amount > 1499.0 )
					{
						return '40%';
					}
					else if( amount > 1199.0 )
					{
						return '30%';
					}
					else if( amount > 899.0 )
					{
						return '25%';
					}
					else if( amount > 599.0 )
					{
						return '20%';
					}
					else if( amount > 299.0 )
					{
						return '15%';
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D1F65726CD0665CDCEAB90A04CBF3E04" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)

	        tax = if (taxable_income < 0.0) then '0'
		        else
			        case taxable_income
				        when (0.0..10046.99) then '1.00'
				        when (10047.0..11228.99) then '0.85'
				        when (11229.0..12410.99) then '0.70'
				        when (12411.0..14774.99) then '0.50'
				        when (14775.0..17138.99) then '0.35'
				        when (17139.0..19502.99) then '0.25'
				        else '0'
			        end
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income < 0.0)
					{
						return '0';
					}
					
					if (taxable_income >= 0.0 && taxable_income <= 10046.99)
					{
						return '1.00';
					}
					else if (taxable_income >= 10047.0 && taxable_income <= 11228.99)
					{
						return '0.85';
					}
					else if (taxable_income >= 11229.0 && taxable_income <= 12410.99)
					{
						return '0.70';
					}
					else if (taxable_income >= 12411.0 && taxable_income <= 14774.99)
					{
						return '0.50';
					}
					else if (taxable_income >= 14775.0 && taxable_income <= 17138.99)
					{
						return '0.35';
					}
					else if (taxable_income >= 17139.0 && taxable_income <= 19502.99)
					{
						return '0.25';
					}
					else
					{
						return '0';
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D391EF675195913446CBFA557DD0BD52" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1343.01)					
			        tax = taxable_income * 0.0036				
		        when (1343.01...2686.01)					
			        tax = ((taxable_income - 1343.0) * 0.0072) + 4.83
		        when (2686.01...5372.01)					
			        tax = ((taxable_income - 2686.0) * 0.0243) + 14.50				
		        when (5372.01...12087.01)					
			        tax = ((taxable_income - 5372.0) * 0.0450) + 79.77	
		        when (12087.01...20145.01)					
			        tax = ((taxable_income - 12087.0) * 0.0612) + 381.95	
		        when (20145.01...26860.01)					
			        tax = ((taxable_income - 20145.0) * 0.0648) + 875.10
		        when (26860.01...40290.01)					
			        tax = ((taxable_income - 26860.0) * 0.0680) + 1310.23
		        when (40290.01...60435.01)					
			        tax = ((taxable_income - 40290.0) * 0.0792) + 2223.47
		        else					
			        tax = ((taxable_income - 60435.0) * 0.0898) + 3818.95				
	        end						
	        return tax						
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;

					if (taxable_income >= 0.01 && taxable_income <= 1343.01)					
					{
						tax = taxable_income * 0.0036;
					}
					else if (taxable_income >= 1343.01 && taxable_income <= 2686.01)					
					{
						tax = ((taxable_income - 1343.0) * 0.0072) + 4.83;
					}
					else if (taxable_income >= 2686.01 && taxable_income <= 5372.01)					
					{
						tax = ((taxable_income - 2686.0) * 0.0243) + 14.50;
					}
					else if (taxable_income >= 5372.01 && taxable_income <= 12087.01)					
					{
						tax = ((taxable_income - 5372.0) * 0.0450) + 79.77;
					}
					else if (taxable_income >= 12087.01 && taxable_income <= 20145.01)					
					{
						tax = ((taxable_income - 12087.0) * 0.0612) + 381.95;
					}
					else if (taxable_income >= 20145.01 && taxable_income <= 26860.01)					
					{
						tax = ((taxable_income - 20145.0) * 0.0648) + 875.10;
					}
					else if (taxable_income >= 26860.01 && taxable_income <= 40290.01)					
					{
						tax = ((taxable_income - 26860.0) * 0.0680) + 1310.23;
					}
					else if (taxable_income >= 40290.01 && taxable_income <= 60435.01)					
					{
						tax = ((taxable_income - 40290.0) * 0.0792) + 2223.47;
					}
					else					
					{
						tax = ((taxable_income - 60435.0) * 0.0898) + 3818.95;
					}
					
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="36251EA9EA404510CE222B6D516E1183" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1379.01)					
			        tax = taxable_income * 0.0036				
		        when (1379.01...2758.01)					
			        tax = ((taxable_income - 1379.0) * 0.0072) + 4.96		
		        when (2758.01...5516.01)					
			        tax = ((taxable_income - 2758.0) * 0.0243) + 14.89		
		        when (5516.01...12411.01)					
			        tax = ((taxable_income - 5516.0) * 0.045) + 81.91
		        when (12411.01...20685.01)					
			        tax = ((taxable_income - 12411.0) * 0.0612) + 392.19
		        when (20685.01...27580.01)					
			        tax = ((taxable_income - 20685.0) * 0.0648) + 898.56
		        when (27580.01...41370.01)					
			        tax = ((taxable_income - 27580.0) * 0.068) + 1345.36
		        when (41370.01...62055.01)					
			        tax = ((taxable_income - 41370.0) * 0.0792) + 2283.08			
		        else					
			        tax = ((taxable_income - 62055.0) * 0.0898) + 3921.33				
	        end						
	        return tax						
        end					
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					
					if (taxable_income >= 0.01 && taxable_income <= 1379.01)					
					{
						tax = taxable_income * 0.0036;
					}
					else if (taxable_income >= 1379.01 && taxable_income <= 2758.01)					
					{
						tax = ((taxable_income - 1379.0) * 0.0072) + 4.96;
					}
					else if (taxable_income >= 2758.01 && taxable_income <= 5516.01)					
					{
						tax = ((taxable_income - 2758.0) * 0.0243) + 14.89;
					}
					else if (taxable_income >= 5516.01 && taxable_income <= 12411.01)					
					{
						tax = ((taxable_income - 5516.0) * 0.045) + 81.91;
					}
					else if (taxable_income >= 12411.01 && taxable_income <= 20685.01)					
					{
						tax = ((taxable_income - 12411.0) * 0.0612) + 392.19;
					}
					else if (taxable_income >= 20685.01 && taxable_income <= 27580.01)					
					{
						tax = ((taxable_income - 20685.0) * 0.0648) + 898.56;
					}
					else if (taxable_income >= 27580.01 && taxable_income <= 41370.01)					
					{
						tax = ((taxable_income - 27580.0) * 0.068) + 1345.36;
					}
					else if (taxable_income >= 41370.01 && taxable_income <= 62055.01)					
					{
						tax = ((taxable_income - 41370.0) * 0.0792) + 2283.08;
					}
					else					
					{
						tax = ((taxable_income - 62055.0) * 0.0898) + 3921.33;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="25D3CC4414342FF49ABD5A7D6574BDE7" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def usufruct(age)

	        age = age.to_i

	        return 0.0 if ((age < 20) or (age > 95))

	        case (age)
		        when 20 then 0.914452
		        when 21 then 0.910033
		        when 22 then 0.907456
		        when 23 then 0.903328
		        when 24 then 0.899803
		        when 25 then 0.895769
		        when 26 then 0.891503
		        when 27 then 0.887025
		        when 28 then 0.882331
		        when 29 then 0.877467
		        when 30 then 0.872325
		        when 31 then 0.867006
		        when 32 then 0.861509
		        when 33 then 0.855552
		        when 34 then 0.849429
		        when 35 then 0.842997
		        when 36 then 0.836396
		        when 37 then 0.829339
		        when 38 then 0.821920
		        when 39 then 0.814336
		        when 40 then 0.806363
		        when 41 then 0.797914
		        when 42 then 0.782927
		        when 43 then 0.780190
		        when 44 then 0.770562
		        when 45 then 0.760570
		        when 46 then 0.750208
		        when 47 then 0.739388
		        when 48 then 0.728150
		        when 49 then 0.716334
		        when 50 then 0.704257
		        when 51 then 0.691725
		        when 52 then 0.678654
		        when 53 then 0.665322
		        when 54 then 0.651441
		        when 55 then 0.637044
		        when 56 then 0.622620
		        when 57 then 0.607468
		        when 58 then 0.591946
		        when 59 then 0.576226
		        when 60 then 0.560203
		        when 61 then 0.543634
		        when 62 then 0.527223
		        when 63 then 0.510345
		        when 64 then 0.493191
		        when 65 then 0.476194
		        when 66 then 0.458673
		        when 67 then 0.441605
		        when 68 then 0.423848
		        when 69 then 0.407037
		        when 70 then 0.389635
		        when 71 then 0.372588
		        when 72 then 0.355648
		        when 73 then 0.339084
		        when 74 then 0.322174
		        when 75 then 0.305813
		        when 76 then 0.289963
		        when 77 then 0.273468
		        when 78 then 0.257395
		        when 79 then 0.241085
		        when 80 then 0.225392
		        when 81 then 0.210148
		        when 82 then 0.194124
		        when 83 then 0.178916
		        when 84 then 0.164183
		        when 85 then 0.148794
		        when 86 then 0.133681
		        when 87 then 0.119072
		        when 88 then 0.105558
		        when 89 then 0.091848
		        when 90 then 0.079032
		        when 91 then 0.066750
		        when 92 then 0.055472
		        when 93 then 0.045283
		        when 94 then 0.036227
		        when 95 then 0.028302
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function usufruct(age)
				{
					age = age.to_i();

					if ((age < 20) or (age > 95))
					{
						return 0.0;
					}

					// One of these lucky values will be returned.
					switch (age)
					{
						case 20: return  0.914452;
						case 21: return  0.910033;
						case 22: return  0.907456;
						case 23: return  0.903328;
						case 24: return  0.899803;
						case 25: return  0.895769;
						case 26: return  0.891503;
						case 27: return  0.887025;
						case 28: return  0.882331;
						case 29: return  0.877467;
						case 30: return  0.872325;
						case 31: return  0.867006;
						case 32: return  0.861509;
						case 33: return  0.855552;
						case 34: return  0.849429;
						case 35: return  0.842997;
						case 36: return  0.836396;
						case 37: return  0.829339;
						case 38: return  0.821920;
						case 39: return  0.814336;
						case 40: return  0.806363;
						case 41: return  0.797914;
						case 42: return  0.782927;
						case 43: return  0.780190;
						case 44: return  0.770562;
						case 45: return  0.760570;
						case 46: return  0.750208;
						case 47: return  0.739388;
						case 48: return  0.728150;
						case 49: return  0.716334;
						case 50: return  0.704257;
						case 51: return  0.691725;
						case 52: return  0.678654;
						case 53: return  0.665322;
						case 54: return  0.651441;
						case 55: return  0.637044;
						case 56: return  0.622620;
						case 57: return  0.607468;
						case 58: return  0.591946;
						case 59: return  0.576226;
						case 60: return  0.560203;
						case 61: return  0.543634;
						case 62: return  0.527223;
						case 63: return  0.510345;
						case 64: return  0.493191;
						case 65: return  0.476194;
						case 66: return  0.458673;
						case 67: return  0.441605;
						case 68: return  0.423848;
						case 69: return  0.407037;
						case 70: return  0.389635;
						case 71: return  0.372588;
						case 72: return  0.355648;
						case 73: return  0.339084;
						case 74: return  0.322174;
						case 75: return  0.305813;
						case 76: return  0.289963;
						case 77: return  0.273468;
						case 78: return  0.257395;
						case 79: return  0.241085;
						case 80: return  0.225392;
						case 81: return  0.210148;
						case 82: return  0.194124;
						case 83: return  0.178916;
						case 84: return  0.164183;
						case 85: return  0.148794;
						case 86: return  0.133681;
						case 87: return  0.119072;
						case 88: return  0.105558;
						case 89: return  0.091848;
						case 90: return  0.079032;
						case 91: return  0.066750;
						case 92: return  0.055472;
						case 93: return  0.045283;
						case 94: return  0.036227;
						case 95: return  0.028302;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="54E08C377762BD6BFB71B133FFAFA810" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income

		        when (0.01...10000.01)					
			        tax = taxable_income * 0.18				
		        when (10000.01...20000.01)					
			        tax = ((taxable_income - 10000.0) * 0.20) + 1800.0				
		        when (20000.01...40000.01)					
			        tax = ((taxable_income - 20000.0) * 0.22) + 3800.0				
		        when (40000.01...60000.01)					
			        tax = ((taxable_income - 40000.0) * 0.24) + 8200.0	
		        when (60000.01...80000.01)					
			        tax = ((taxable_income - 60000.0) * 0.26) + 13000.0	
		        when (80000.01...100000.01)					
			        tax = ((taxable_income - 80000.0) * 0.28) + 18200.0	
		        when (100000.01...150000.01)					
			        tax = ((taxable_income - 100000.0) * 0.30) + 23800.0	
		        when (150000.01...250000.01)					
			        tax = ((taxable_income - 150000.0) * 0.32) + 38800.0
		        when (250000.01...500000.01)					
			        tax = ((taxable_income - 250000.0) * 0.34) + 70800.0	
		        when (500000.01...750000.01)					
			        tax = ((taxable_income - 500000.0) * 0.37) + 155800.0	
		        when (750000.01...1000000.01)					
			        tax = ((taxable_income - 750000.0) * 0.39) + 248300.0
		        when (1000000.01...1250000.01)					
			        tax = ((taxable_income - 1000000.0) * 0.41) + 345800.0	
		        when (1250000.01...1500000.01)					
			        tax = ((taxable_income - 1250000.0) * 0.43) + 448300.0	
		        when (1500000.01...2000000.01)					
			        tax = ((taxable_income - 1500000.0) * 0.45) + 555800.0	
		        else					
			        tax = ((taxable_income - 2000000.0) * 0.45) + 780800.0				
	        end						
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					// Note:So for the first range were over 0.0 and not over 10000.0 ( >= 0.01 and < 10000.01) and so on && taxable_income <= 
					if (taxable_income >= 0.01 && taxable_income <= 10000.01)					
					{
						tax = taxable_income * 0.18;
					}
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.01)					
					{
						tax = ((taxable_income - 10000.0) * 0.20) + 1800.0;
					}
					else if (taxable_income >= 20000.01 && taxable_income <= 40000.01)					
					{
						tax = ((taxable_income - 20000.0) * 0.22) + 3800.0;
					}
					else if (taxable_income >= 40000.01 && taxable_income <= 60000.01)					
					{
						tax = ((taxable_income - 40000.0) * 0.24) + 8200.0;
					}
					else if (taxable_income >= 60000.01 && taxable_income <= 80000.01)					
					{
						tax = ((taxable_income - 60000.0) * 0.26) + 13000.0;
					}
					else if (taxable_income >= 80000.01 && taxable_income <= 100000.01)					
					{
						tax = ((taxable_income - 80000.0) * 0.28) + 18200.0;
					}
					else if (taxable_income >= 100000.01 && taxable_income <= 150000.01)					
					{
						tax = ((taxable_income - 100000.0) * 0.30) + 23800.0;
					}
					else if (taxable_income >= 150000.01 && taxable_income <= 250000.01)					
					{
						tax = ((taxable_income - 150000.0) * 0.32) + 38800.0;
					}
					else if (taxable_income >= 250000.01 && taxable_income <= 500000.01)					
					{
						tax = ((taxable_income - 250000.0) * 0.34) + 70800.0;
					}
					else if (taxable_income >= 500000.01 && taxable_income <= 750000.01)					
					{
						tax = ((taxable_income - 500000.0) * 0.37) + 155800.0;
					}
					else if (taxable_income >= 750000.01 && taxable_income <= 1000000.01)					
					{
						tax = ((taxable_income - 750000.0) * 0.39) + 248300.0;
					}
					else if (taxable_income >= 1000000.01 && taxable_income <= 1250000.01)					
					{
						tax = ((taxable_income - 1000000.0) * 0.41) + 345800.0;
					}
					else if (taxable_income >= 1250000.01 && taxable_income <= 1500000.01)					
					{
						tax = ((taxable_income - 1250000.0) * 0.43) + 448300.0;
					}
					else if (taxable_income >= 1500000.01 && taxable_income <= 2000000.01)					
					{
						tax = ((taxable_income - 1500000.0) * 0.45) + 555800.0;
					}
					else					
					{
						tax = ((taxable_income - 2000000.0) * 0.45) + 780800.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D8D6CECEE21E1C823FC0FF80280A8148" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_max_credit(adj_tax_estate)
	        if (adj_tax_estate <= 0.0) : return 0.0 end
	        case adj_tax_estate
		        when (0.0...40000): 0.0
		        when (40000...90000): (adj_tax_estate - 40000) * 0.008
		        when (90000...140000): ((adj_tax_estate - 90000) * 0.016) + 400.0
		        when (140000...240000): ((adj_tax_estate - 140000) * 0.024) + 1200.0
		        when (240000...440000): ((adj_tax_estate - 240000) * 0.032) + 3600.0
		        when (440000...640000): ((adj_tax_estate - 440000) * 0.040) + 10000.0
		        when (640000...840000): ((adj_tax_estate - 640000) * 0.048) + 18000.0
		        when (840000...1040000): ((adj_tax_estate - 840000) * 0.056) + 27600.0
		        when (1040000...1540000): ((adj_tax_estate - 1040000) * 0.064) + 38800.0
		        when (1540000...2040000): ((adj_tax_estate - 1540000) * 0.072) + 70800.0
		        when (2040000...2540000): ((adj_tax_estate - 2040000) * 0.080) + 106800.0
		        when (2540000...3040000): ((adj_tax_estate - 2540000) * 0.088) + 146800.0
		        when (3040000...3540000): ((adj_tax_estate - 3040000) * 0.096) + 190800.0
		        when (3540000...4040000): ((adj_tax_estate - 3540000) * 0.104) + 238800.0
		        when (4040000...5040000): ((adj_tax_estate - 4040000) * 0.112) + 290800.0
		        when (5040000...6040000): ((adj_tax_estate - 5040000) * 0.120) + 402800.0
		        when (6040000...7040000): ((adj_tax_estate - 6040000) * 0.128) + 522800.0
		        when (7040000...8040000): ((adj_tax_estate - 7040000) * 0.136) + 650800.0
		        when (8040000...9040000): ((adj_tax_estate - 8040000) * 0.144) + 786800.0
		        when (9040000...10040000): ((adj_tax_estate - 9040000) * 0.152) + 930800.0
		        else ((adj_tax_estate - 10040000) * 0.16) + 1082800.0	
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_max_credit(adj_tax_estate)
				{
					if (adj_tax_estate <= 0.0)
					{
						return 0.0;
					}
					
					if (adj_tax_estate >= 0.0 && adj_tax_estate <= 40000) { return 0.0; }
					else if (adj_tax_estate >= 40000 && adj_tax_estate <= 90000) { return (adj_tax_estate - 40000) * 0.008; }
					else if (adj_tax_estate >= 90000 && adj_tax_estate <= 140000) { return ((adj_tax_estate - 90000) * 0.016) + 400.0; }
					else if (adj_tax_estate >= 140000 && adj_tax_estate <= 240000) { return ((adj_tax_estate - 140000) * 0.024) + 1200.0; }
					else if (adj_tax_estate >= 240000 && adj_tax_estate <= 440000) { return ((adj_tax_estate - 240000) * 0.032) + 3600.0; }
					else if (adj_tax_estate >= 440000 && adj_tax_estate <= 640000) { return ((adj_tax_estate - 440000) * 0.040) + 10000.0; }
					else if (adj_tax_estate >= 640000 && adj_tax_estate <= 840000) { return ((adj_tax_estate - 640000) * 0.048) + 18000.0; }
					else if (adj_tax_estate >= 840000 && adj_tax_estate <= 1040000) { return ((adj_tax_estate - 840000) * 0.056) + 27600.0; }
					else if (adj_tax_estate >= 1040000 && adj_tax_estate <= 1540000) { return ((adj_tax_estate - 1040000) * 0.064) + 38800.0; }
					else if (adj_tax_estate >= 1540000 && adj_tax_estate <= 2040000) { return ((adj_tax_estate - 1540000) * 0.072) + 70800.0; }
					else if (adj_tax_estate >= 2040000 && adj_tax_estate <= 2540000) { return ((adj_tax_estate - 2040000) * 0.080) + 106800.0; }
					else if (adj_tax_estate >= 2540000 && adj_tax_estate <= 3040000) { return ((adj_tax_estate - 2540000) * 0.088) + 146800.0; }
					else if (adj_tax_estate >= 3040000 && adj_tax_estate <= 3540000) { return ((adj_tax_estate - 3040000) * 0.096) + 190800.0; }
					else if (adj_tax_estate >= 3540000 && adj_tax_estate <= 4040000) { return ((adj_tax_estate - 3540000) * 0.104) + 238800.0; }
					else if (adj_tax_estate >= 4040000 && adj_tax_estate <= 5040000) { return ((adj_tax_estate - 4040000) * 0.112) + 290800.0; }
					else if (adj_tax_estate >= 5040000 && adj_tax_estate <= 6040000) { return ((adj_tax_estate - 5040000) * 0.120) + 402800.0; }
					else if (adj_tax_estate >= 6040000 && adj_tax_estate <= 7040000) { return ((adj_tax_estate - 6040000) * 0.128) + 522800.0; }
					else if (adj_tax_estate >= 7040000 && adj_tax_estate <= 8040000) { return ((adj_tax_estate - 7040000) * 0.136) + 650800.0; }
					else if (adj_tax_estate >= 8040000 && adj_tax_estate <= 9040000) { return ((adj_tax_estate - 8040000) * 0.144) + 786800.0; }
					else if (adj_tax_estate >= 9040000 && adj_tax_estate <= 10040000) { return ((adj_tax_estate - 9040000) * 0.152) + 930800.0; }
					else { return ((adj_tax_estate - 10040000) * 0.16) + 1082800.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="B5202080C838E1BCBE205AF9B7FF2E04" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)			 		
	        if (taxable_income < 500000.0) then return 0 end				
	        case taxable_income				
		        when (500000...1000000)			
			        tax = 100.0		
		        when (1000000...5000000)			
			        tax = 300.0		
		        when (5000000...10000000)			
			        tax = 1000.0	
		        when (10000000...20000000)	
			        tax = 2000.0
		        else	
			        tax = 5000.0
	        end		

	        return tax		
        end			
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)			 		
				{
					if (taxable_income < 500000.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 500000 && taxable_income <= 1000000)			
					{
						tax = 100.0;
					}
					else if (taxable_income >= 1000000 && taxable_income <= 5000000)			
					{
						tax = 300.0;
					}
					else if (taxable_income >= 5000000 && taxable_income <= 10000000)			
					{
						tax = 1000.0;
					}
					else if (taxable_income >= 10000000 && taxable_income <= 20000000)	
					{
						tax = 2000.0;
					}
					else	
					{
						tax = 5000.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="1275E8657D3D5802772CB7C4A5014FEC" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def single_tax(value)
	        return 0.0 if (value <= 0.0)
	        case value
		        when (0.01..21310.0) then 0.0535 * value
		        when (21310.01..69990.0) then 1140.09 + 0.0705 * (value - 21310.0)
		        else 4572.03 + 0.0785 * (value - 69990.0)
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function single_tax(value)
				{
					if (value <= 0.0)
					{
						return 0.0;
					}
					
					if (value >= 0.01 && value <= 21310.0)
					{
						return 0.0535 * value;
					}
					else if (value >= 21310.01 && value <= 69990.0)
					{
						return 1140.09 + 0.0705 * (value - 21310.0);
					}
					else
					{
						return 4572.03 + 0.0785 * (value - 69990.0);
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="EE8543568E35EB28A751ED1EC07F8247" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def credit(a)
	        case a.to_i
		        when 2 then 1
		        when 3 then 1
		        when 4 then 1
		        when 11 then 1
		        when 12 then 1
		        when 14 then 1
		        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function credit(a)
				{
					switch (a.to_i())
					{
						case 2 : return 1;
						case 3 : return 1;
						case 4 : return 1;
						case 11 : return 1;
						case 12 : return 1;
						case 14 : return 1;
						default: return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="E267A2E17187965E275C0D8082F2B9CB" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax_due(a)
	        a = a.to_f
	        if( a == 9000.0 ) then '315'
	        elsif( a >= 8900.0 ) then '312'
	        elsif( a >= 8800.0 ) then '307'
	        elsif( a >= 8700.0 ) then '301'
	        elsif( a >= 8600.0 ) then '296'
	        elsif( a >= 8500.0 ) then '290'
	        elsif( a >= 8400.0 ) then '285'
	        elsif( a >= 8300.0 ) then '279'
	        elsif( a >= 8200.0 ) then '274'
	        elsif( a >= 8100.0 ) then '268'
	        elsif( a >= 8000.0 ) then '263'
	        elsif( a >= 7900.0 ) then '258'
	        elsif( a >= 7800.0 ) then '253'
	        elsif( a >= 7700.0 ) then '248'
	        elsif( a >= 7600.0 ) then '243'
	        elsif( a >= 7500.0 ) then '238'
	        elsif( a >= 7400.0 ) then '233'
	        elsif( a >= 7300.0 ) then '228'
	        elsif( a >= 7200.0 ) then '223'
	        elsif( a >= 7100.0 ) then '218'
	        elsif( a >= 7000.0 ) then '213'
	        elsif( a >= 6900.0 ) then '208'
	        elsif( a >= 6800.0 ) then '203'
	        elsif( a >= 6700.0 ) then '199'
	        elsif( a >= 6600.0 ) then '194'
	        elsif( a >= 6500.0 ) then '190'
	        elsif( a >= 6400.0 ) then '185'
	        elsif( a >= 6300.0 ) then '181'
	        elsif( a >= 6200.0 ) then '176'
	        elsif( a >= 6100.0 ) then '172'
	        elsif( a >= 6000.0 ) then '167'
	        elsif( a >= 5900.0 ) then '163'
	        elsif( a >= 5800.0 ) then '159'
	        elsif( a >= 5700.0 ) then '155'
	        elsif( a >= 5600.0 ) then '151'
	        elsif( a >= 5500.0 ) then '147'
	        elsif( a >= 5400.0 ) then '143'
	        elsif( a >= 5300.0 ) then '139'
	        elsif( a >= 5200.0 ) then '135'
	        elsif( a >= 5100.0 ) then '131'
	        elsif( a >= 5000.0 ) then '127'
	        elsif( a >= 4900.0 ) then '123'
	        elsif( a >= 4800.0 ) then '120'
	        elsif( a >= 4700.0 ) then '116'
	        elsif( a >= 4600.0 ) then '113'
	        elsif( a >= 4500.0 ) then '109'
	        elsif( a >= 4400.0 ) then '106'
	        elsif( a >= 4300.0 ) then '102'
	        elsif( a >= 4200.0 ) then '99'
	        elsif( a >= 4100.0 ) then '95'
	        elsif( a >= 4000.0 ) then '92'
	        elsif( a >= 3900.0 ) then '89'
	        elsif( a >= 3800.0 ) then '86'
	        elsif( a >= 3700.0 ) then '83'
	        elsif( a >= 3600.0 ) then '80'
	        elsif( a >= 3500.0 ) then '77'
	        elsif( a >= 3400.0 ) then '74'
	        elsif( a >= 3300.0 ) then '71'
	        elsif( a >= 3200.0 ) then '68'
	        elsif( a >= 3100.0 ) then '65'
	        elsif( a >= 3000.0 ) then '62'
	        elsif( a >= 2900.0 ) then '59'
	        elsif( a >= 2800.0 ) then '56'
	        elsif( a >= 2700.0 ) then '54'
	        elsif( a >= 2600.0 ) then '51'
	        elsif( a >= 2500.0 ) then '49'
	        elsif( a >= 2400.0 ) then '46'
	        elsif( a >= 2300.0 ) then '44'
	        elsif( a >= 2200.0 ) then '41'
	        elsif( a >= 2100.0 ) then '39'
	        elsif( a >= 2000.0 ) then '36'
	        elsif( a >= 1900.0 ) then '34'
	        elsif( a >= 1800.0 ) then '32'
	        elsif( a >= 1700.0 ) then '30'
	        elsif( a >= 1600.0 ) then '28'
	        elsif( a >= 1500.0 ) then '26'
	        elsif( a >= 1400.0 ) then '24'
	        elsif( a >= 1300.0 ) then '22'
	        elsif( a >= 1200.0 ) then '20'
	        elsif( a >= 1100.0 ) then '18'
	        elsif( a >= 1000.0 ) then '16'
	        elsif( a >= 900.0 ) then '14'
	        elsif( a >= 800.0 ) then '13'
	        elsif( a >= 700.0 ) then '11'
	        elsif( a >= 600.0 ) then '10'
	        elsif( a >= 500.0 ) then '8'
	        elsif( a >= 400.0 ) then '7'
	        elsif( a >= 300.0 ) then '5'
	        elsif( a >= 200.0 ) then '4'
	        elsif( a >= 100.0 ) then '2'
	        else '0'
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax_due(a)
				{
					a = a.to_f();
					
					if( a == 9000.0 ) { return '315'
					else if( a >= 8900.0 ) { return '312'; }
					else if( a >= 8800.0 ) { return '307'; }
					else if( a >= 8700.0 ) { return '301'; }
					else if( a >= 8600.0 ) { return '296'; }
					else if( a >= 8500.0 ) { return '290'; }
					else if( a >= 8400.0 ) { return '285'; }
					else if( a >= 8300.0 ) { return '279'; }
					else if( a >= 8200.0 ) { return '274'; }
					else if( a >= 8100.0 ) { return '268'; }
					else if( a >= 8000.0 ) { return '263'; }
					else if( a >= 7900.0 ) { return '258'; }
					else if( a >= 7800.0 ) { return '253'; }
					else if( a >= 7700.0 ) { return '248'; }
					else if( a >= 7600.0 ) { return '243'; }
					else if( a >= 7500.0 ) { return '238'; }
					else if( a >= 7400.0 ) { return '233'; }
					else if( a >= 7300.0 ) { return '228'; }
					else if( a >= 7200.0 ) { return '223'; }
					else if( a >= 7100.0 ) { return '218'; }
					else if( a >= 7000.0 ) { return '213'; }
					else if( a >= 6900.0 ) { return '208'; }
					else if( a >= 6800.0 ) { return '203'; }
					else if( a >= 6700.0 ) { return '199'; }
					else if( a >= 6600.0 ) { return '194'; }
					else if( a >= 6500.0 ) { return '190'; }
					else if( a >= 6400.0 ) { return '185'; }
					else if( a >= 6300.0 ) { return '181'; }
					else if( a >= 6200.0 ) { return '176'; }
					else if( a >= 6100.0 ) { return '172'; }
					else if( a >= 6000.0 ) { return '167'; }
					else if( a >= 5900.0 ) { return '163'; }
					else if( a >= 5800.0 ) { return '159'; }
					else if( a >= 5700.0 ) { return '155'; }
					else if( a >= 5600.0 ) { return '151'; }
					else if( a >= 5500.0 ) { return '147'; }
					else if( a >= 5400.0 ) { return '143'; }
					else if( a >= 5300.0 ) { return '139'; }
					else if( a >= 5200.0 ) { return '135'; }
					else if( a >= 5100.0 ) { return '131'; }
					else if( a >= 5000.0 ) { return '127'; }
					else if( a >= 4900.0 ) { return '123'; }
					else if( a >= 4800.0 ) { return '120'; }
					else if( a >= 4700.0 ) { return '116'; }
					else if( a >= 4600.0 ) { return '113'; }
					else if( a >= 4500.0 ) { return '109'; }
					else if( a >= 4400.0 ) { return '106'; }
					else if( a >= 4300.0 ) { return '102'; }
					else if( a >= 4200.0 ) { return '99'; }
					else if( a >= 4100.0 ) { return '95'; }
					else if( a >= 4000.0 ) { return '92'; }
					else if( a >= 3900.0 ) { return '89'; }
					else if( a >= 3800.0 ) { return '86'; }
					else if( a >= 3700.0 ) { return '83'; }
					else if( a >= 3600.0 ) { return '80'; }
					else if( a >= 3500.0 ) { return '77'; }
					else if( a >= 3400.0 ) { return '74'; }
					else if( a >= 3300.0 ) { return '71'; }
					else if( a >= 3200.0 ) { return '68'; }
					else if( a >= 3100.0 ) { return '65'; }
					else if( a >= 3000.0 ) { return '62'; }
					else if( a >= 2900.0 ) { return '59'; }
					else if( a >= 2800.0 ) { return '56'; }
					else if( a >= 2700.0 ) { return '54'; }
					else if( a >= 2600.0 ) { return '51'; }
					else if( a >= 2500.0 ) { return '49'; }
					else if( a >= 2400.0 ) { return '46'; }
					else if( a >= 2300.0 ) { return '44'; }
					else if( a >= 2200.0 ) { return '41'; }
					else if( a >= 2100.0 ) { return '39'; }
					else if( a >= 2000.0 ) { return '36'; }
					else if( a >= 1900.0 ) { return '34'; }
					else if( a >= 1800.0 ) { return '32'; }
					else if( a >= 1700.0 ) { return '30'; }
					else if( a >= 1600.0 ) { return '28'; }
					else if( a >= 1500.0 ) { return '26'; }
					else if( a >= 1400.0 ) { return '24'; }
					else if( a >= 1300.0 ) { return '22'; }
					else if( a >= 1200.0 ) { return '20'; }
					else if( a >= 1100.0 ) { return '18'; }
					else if( a >= 1000.0 ) { return '16'; }
					else if( a >= 900.0 ) { return '14'; }
					else if( a >= 800.0 ) { return '13'; }
					else if( a >= 700.0 ) { return '11'; }
					else if( a >= 600.0 ) { return '10'; }
					else if( a >= 500.0 ) { return '8'; }
					else if( a >= 400.0 ) { return '7'; }
					else if( a >= 300.0 ) { return '5'; }
					else if( a >= 200.0 ) { return '4'; }
					else if( a >= 100.0 ) { return '2'; }
					else { return '0'; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="322F1CF9299F6545FB6362E167628B51" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        tax = case taxable_income						
			        when (0.01..2500.0) then taxable_income * 0.01				
			        when (2500.01..4400.0) then ((taxable_income * 0.02 ) - 25.0)				
			        when (4400.01..6600.0) then ((taxable_income * 0.03) - 69.0)				
			        when (6600.01..9000.0) then ((taxable_income * 0.04) - 135.0)	
			        when (9000.01..11600.0) then ((taxable_income * 0.05) - 225.0)				
			        when (11600.01..14900.0) then ((taxable_income * 0.06) - 341.0)				
			        else ((taxable_income * 0.069) - 475.0)
		        end			
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;

					if (taxable_income >= 0.01 && taxable_income <= 2500.0)
					{
						tax = taxable_income * 0.01;
					}
					else if (taxable_income >= 2500.01 && taxable_income <= 4400.0)
					{
						tax = ((taxable_income * 0.02 ) - 25.0);
					}
					else if (taxable_income >= 4400.01 && taxable_income <= 6600.0)
					{
						tax = ((taxable_income * 0.03) - 69.0);
					}
					else if (taxable_income >= 6600.01 && taxable_income <= 9000.0)
					{
						tax = ((taxable_income * 0.04) - 135.0);
					}
					else if (taxable_income >= 9000.01 && taxable_income <= 11600.0)
					{
						tax = ((taxable_income * 0.05) - 225.0);
					}
					else if (taxable_income >= 11600.01 && taxable_income <= 14900.0)
					{
						tax = ((taxable_income * 0.06) - 341.0);
					}
					else
					{
						tax = ((taxable_income * 0.069) - 475.0);
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="FBF6C5B6E0F853C71883C61FBB634E19" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_amount)

	        tax =	if (taxable_amount > 14900.0)
			        taxable_amount * 0.069 - 475.0
		        elsif (taxable_amount > 11600.0)
			        taxable_amount * 0.06 - 341.0
		        elsif (taxable_amount > 9000.0)
			        taxable_amount * 0.05 - 225.0
		        elsif (taxable_amount > 6600.0)
			        taxable_amount * 0.04 - 135.0
		        elsif (taxable_amount > 4400.0)
			        taxable_amount * 0.03 - 69.0
		        elsif (taxable_amount > 2500.0)
			        taxable_amount * 0.02 - 25.0
		        elsif (taxable_amount > 0.0)
			        taxable_amount * 0.01
		        else 0.0
		        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_amount)
				{
					var tax = 0.0;
					
					if (taxable_amount > 14900.0)
					{
						tax = taxable_amount * 0.069 - 475.0;
					}
					else if (taxable_amount > 11600.0)
					{
						tax = taxable_amount * 0.06 - 341.0;
					}
					else if (taxable_amount > 9000.0)
					{
						tax = taxable_amount * 0.05 - 225.0;
					}
					else if (taxable_amount > 6600.0)
					{
						tax = taxable_amount * 0.04 - 135.0;
					}
					else if (taxable_amount > 4400.0)
					{
						tax = taxable_amount * 0.03 - 69.0;
					}
					else if (taxable_amount > 2500.0)
					{
						tax = taxable_amount * 0.02 - 25.0;
					}
					else if (taxable_amount > 0.0)
					{
						tax = taxable_amount * 0.01;
					}
					else
					{
						tax = 0.0;
					}
						
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="389CBCD892D0B9EC23D82DEDB5CE8DEE" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)

	        if (taxable_income <= 0.0) then return 0 end						
		        tax = case taxable_income						
				        when (0.01...2500.01) then taxable_income * 0.01
				        when (2500.01...4400.01) then ((taxable_income * 0.02 ) - 25.0)
				        when (4400.01...6600.01) then ((taxable_income * 0.03) - 69.0)
				        when (6600.01...9000.01) then tax = ((taxable_income * 0.04) - 135.0)
				        when (9000.01...11600.01) then ((taxable_income * 0.05 ) - 225.0)
				        when (11600.01...14900.01) then ((taxable_income * 0.06) - 341.0)
				        else ((taxable_income * 0.069) - 475.0)
			        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;

					if (taxable_income >= 0.01 && taxable_income <= 2500.01)
					{
						tax = taxable_income * 0.01;
					}
					else if (taxable_income >= 2500.01 && taxable_income <= 4400.01)
					{
						tax = ((taxable_income * 0.02 ) - 25.0);
					}
					else if (taxable_income >= 4400.01 && taxable_income <= 6600.01)
					{
						tax = ((taxable_income * 0.03) - 69.0);
					}
					else if (taxable_income >= 6600.01 && taxable_income <= 9000.01)
					{
						tax = ((taxable_income * 0.04) - 135.0);
					}
					else if (taxable_income >= 9000.01 && taxable_income <= 11600.01)
					{
						tax = ((taxable_income * 0.05 ) - 225.0);
					}
					else if (taxable_income >= 11600.01 && taxable_income <= 14900.01)
					{
						tax = ((taxable_income * 0.06) - 341.0);
					}
					else
					{
						tax = ((taxable_income * 0.069) - 475.0);
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="A4C7C0F4F14918B18BB3A36B40AF47C2" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)
        amount = amount.to_f
        if( amount > 14900.0 )
	        ( amount * 0.069 ) - 475.0
        elsif( amount > 11600.0 )
	        ( amount * 0.060 ) - 341.0
        elsif( amount > 9000.0 )
	        ( amount * 0.050 ) - 225.0
        elsif( amount > 6600.0 )
	        ( amount * 0.040 ) - 135.0
        elsif( amount > 4400.0 )
	        ( amount * 0.030 ) - 69.0
        elsif( amount > 2500.0 )
	        ( amount * 0.020 ) - 25.0
        elsif( amount > 0.0 )
	        ( amount * 0.010 )
        else 0
        end
        end    
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					amount = amount.to_f();
					
					if( amount > 14900.0 )
					{
						return ( amount * 0.069 ) - 475.0;
					}
					else if( amount > 11600.0 )
					{
						return ( amount * 0.060 ) - 341.0;
					}
					else if( amount > 9000.0 )
					{
						return ( amount * 0.050 ) - 225.0;
					}
					else if( amount > 6600.0 )
					{
						return ( amount * 0.040 ) - 135.0;
					}
					else if( amount > 4400.0 )
					{
						return ( amount * 0.030 ) - 69.0;
					}
					else if( amount > 2500.0 )
					{
						return ( amount * 0.020 ) - 25.0;
					}
					else if( amount > 0.0 )
					{
						return ( amount * 0.010 );
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="233CFC02AD119F4097029F3C6F197159" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def amap_1(a)
	        if( a[0] != nil )
		        if( a[0] > 64 ) and ( a[0] < 91 ) then a[0] - 55
		        elsif( a[0] > 47 ) and ( a[0] < 58 ) then a[0] - 48
		        elsif a[0] == 38 then 36
		        else 37
		        end
	        else 0
	        end
        end    
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function amap_1(a)
				{
					// This has been tweaked a bit to exactly match the spec - "A space or any other character = 37".
					//
					// Capital letters A-Z are mapped to the numbers 10 - 35; the numbers 0 - 9 are mapped to 0-9;
					// an ampersand (&) is mapped to 36; a space or any other character = 37.
					// result is an integer.

					if( a != null )
					{
						if (( a.charCodeAt(0) > 64 ) && ( a.charCodeAt(0) < 91 ))
						{
							return a.charCodeAt(0) - 55;
						}
						else if (( a.charCodeAt(0) > 47 ) && ( a.charCodeAt(0) < 58 ))
						{
							return a.charCodeAt(0) - 48;
						}
						else if (a.charCodeAt(0) == 38)
						{
							return 36;
						}
						else
						{
							return 37;
						}
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="DD3382AC74EC636E8A7F25DC4637946D" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        if (taxable_income < 0.0): return ['', '', '',] end

	        case (taxable_income)
		        when (0.0...10000.0): [0.0, 0.0, '1%']
		        when (10000.0...20000.0): [100.0, 10000.0, '2%']
		        when (20000.0...30000.0): [300.0, 20000.0, '3%']
		        when (30000.0...40000.0): [600.0, 30000.0, '4%']
		        when (40000.0...50000.0): [1000.0, 40000.0, '5%']
		        when (50000.0...60000.0): [1500.0, 50000.0, '6%']
		        when (60000.0...70000.0): [2100.0, 60000.0, '7%']
		        when (70000.0...80000.0): [2800.0, 70000.0, '8%']
		        when (80000.0...90000.0): [3600.0, 80000.0, '9%']
		        else [4500.0, 90000.0, '9.4%']
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income < 0.0)
					{
						return ['', '', '',];
					}

					if (taxable_income >= 0.0 && taxable_income <= 10000.0) { return [0.0, 0.0, '1%']; }
					else if (taxable_income >= 10000.0 && taxable_income <= 20000.0) { return [100.0, 10000.0, '2%']; }
					else if (taxable_income >= 20000.0 && taxable_income <= 30000.0) { return [300.0, 20000.0, '3%']; }
					else if (taxable_income >= 30000.0 && taxable_income <= 40000.0) { return [600.0, 30000.0, '4%']; }
					else if (taxable_income >= 40000.0 && taxable_income <= 50000.0) { return [1000.0, 40000.0, '5%']; }
					else if (taxable_income >= 50000.0 && taxable_income <= 60000.0) { return [1500.0, 50000.0, '6%']; }
					else if (taxable_income >= 60000.0 && taxable_income <= 70000.0) { return [2100.0, 60000.0, '7%']; }
					else if (taxable_income >= 70000.0 && taxable_income <= 80000.0) { return [2800.0, 70000.0, '8%']; }
					else if (taxable_income >= 80000.0 && taxable_income <= 90000.0) { return [3600.0, 80000.0, '9%']; }
					else { return [4500.0, 90000.0, '9.4%']; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="9F20156947E2CAE0CA751A766C70E88A" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def usufruct(age)
	        age = age.to_i
	        return 0.0 if ((age < 20) or (age > 95))
	        case (age)
		        when 20 then 0.914452
		        when 21 then 0.910033
		        when 22 then 0.907456
		        when 23 then 0.903328
		        when 24 then 0.899803
		        when 25 then 0.895769
		        when 26 then 0.891503
		        when 27 then 0.887025
		        when 28 then 0.882331
		        when 29 then 0.877467
		        when 30 then 0.872325
		        when 31 then 0.867006
		        when 32 then 0.861509
		        when 33 then 0.855552
		        when 34 then 0.849429
		        when 35 then 0.842997
		        when 36 then 0.836396
		        when 37 then 0.829339
		        when 38 then 0.821920
		        when 39 then 0.814336
		        when 40 then 0.806363
		        when 41 then 0.797914
		        when 42 then 0.782927
		        when 43 then 0.780190
		        when 44 then 0.770562
		        when 45 then 0.760570
		        when 46 then 0.750206
		        when 47 then 0.739388
		        when 48 then 0.728150
		        when 49 then 0.716334
		        when 50 then 0.704257
		        when 51 then 0.691725
		        when 52 then 0.678654
		        when 53 then 0.665322
		        when 54 then 0.651441
		        when 55 then 0.637044
		        when 56 then 0.622620
		        when 57 then 0.607468
		        when 58 then 0.591946
		        when 59 then 0.576226
		        when 60 then 0.560203
		        when 61 then 0.543634
		        when 62 then 0.527223
		        when 63 then 0.510345
		        when 64 then 0.493191
		        when 65 then 0.476194
		        when 66 then 0.458673
		        when 67 then 0.441605
		        when 68 then 0.423848
		        when 69 then 0.407037
		        when 70 then 0.389635
		        when 71 then 0.372588
		        when 72 then 0.355648
		        when 73 then 0.339084
		        when 74 then 0.322174
		        when 75 then 0.305813
		        when 76 then 0.289963
		        when 77 then 0.273468
		        when 78 then 0.257395
		        when 79 then 0.241085
		        when 80 then 0.225392
		        when 81 then 0.210148
		        when 82 then 0.194124
		        when 83 then 0.178916
		        when 84 then 0.164183
		        when 85 then 0.148794
		        when 86 then 0.133681
		        when 87 then 0.119072
		        when 88 then 0.105558
		        when 89 then 0.091848
		        when 90 then 0.079032
		        when 91 then 0.066750
		        when 92 then 0.055472
		        when 93 then 0.045283
		        when 94 then 0.036227
		        when 95 then 0.028302
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function usufruct(age)
				{
					age = age.to_i();

					if ((age < 20) || (age > 95))
					{
						return 0.0;
					}

					// One of these lucky values will be returned.
					switch (age)
					{
						case 20: return 0.914452;
						case 21: return 0.910033;
						case 22: return 0.907456;
						case 23: return 0.903328;
						case 24: return 0.899803;
						case 25: return 0.895769;
						case 26: return 0.891503;
						case 27: return 0.887025;
						case 28: return 0.882331;
						case 29: return 0.877467;
						case 30: return 0.872325;
						case 31: return 0.867006;
						case 32: return 0.861509;
						case 33: return 0.855552;
						case 34: return 0.849429;
						case 35: return 0.842997;
						case 36: return 0.836396;
						case 37: return 0.829339;
						case 38: return 0.821920;
						case 39: return 0.814336;
						case 40: return 0.806363;
						case 41: return 0.797914;
						case 42: return 0.782927;
						case 43: return 0.780190;
						case 44: return 0.770562;
						case 45: return 0.760570;
						case 46: return 0.750206;
						case 47: return 0.739388;
						case 48: return 0.728150;
						case 49: return 0.716334;
						case 50: return 0.704257;
						case 51: return 0.691725;
						case 52: return 0.678654;
						case 53: return 0.665322;
						case 54: return 0.651441;
						case 55: return 0.637044;
						case 56: return 0.622620;
						case 57: return 0.607468;
						case 58: return 0.591946;
						case 59: return 0.576226;
						case 60: return 0.560203;
						case 61: return 0.543634;
						case 62: return 0.527223;
						case 63: return 0.510345;
						case 64: return 0.493191;
						case 65: return 0.476194;
						case 66: return 0.458673;
						case 67: return 0.441605;
						case 68: return 0.423848;
						case 69: return 0.407037;
						case 70: return 0.389635;
						case 71: return 0.372588;
						case 72: return 0.355648;
						case 73: return 0.339084;
						case 74: return 0.322174;
						case 75: return 0.305813;
						case 76: return 0.289963;
						case 77: return 0.273468;
						case 78: return 0.257395;
						case 79: return 0.241085;
						case 80: return 0.225392;
						case 81: return 0.210148;
						case 82: return 0.194124;
						case 83: return 0.178916;
						case 84: return 0.164183;
						case 85: return 0.148794;
						case 86: return 0.133681;
						case 87: return 0.119072;
						case 88: return 0.105558;
						case 89: return 0.091848;
						case 90: return 0.079032;
						case 91: return 0.066750;
						case 92: return 0.055472;
						case 93: return 0.045283;
						case 94: return 0.036227;
						case 95: return 0.028302;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="DBDFD7CA52225A53F18EC61F7993E538" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input)
	
	        if (input.strip.empty?) then return 0 end
	
	        mult = '23456789'
	        len = input.length
	        input = input.reverse
	

	        if (len > 8)
		        mult = (mult * (len / 8)) + (mult[0, len % 8])
	        else
		        mult = mult[0, len]
	        end
	
	        sum = 0
	
	        0.upto(len - 1) { |i|
		        sum += input[i, 1].to_i * mult[i, 1].to_i
	        }
	
	        rem = if (sum < 11) then (sum * 100) % 11
		        else sum % 11
		        end
	
	        return (rem < 2 ? rem : 11 - rem).to_s
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function check_digit(input)
        {
          if (input.trim().length === 0)
          {
	          return 0;
          }

          var mult = '23456789';
          var len = input.length;
          input = input.split('').reverse().join('');

          // set the multiplier to the proper length.
          if (len > 8)
          {
	          mult = mult.repeat(Math.floor(len / 8)) + mult.substring(0, len % 8);
          }
          else
          {
	          mult = mult.substring(0, len);
          }

          var sum = 0;

          for (var i = 0; i <= len - 1; i++)
          {
	          sum += (input[i]).to_i() * (mult[i]).to_i();
          }
          
          var rem;
          if (sum < 11)
          {
	          rem = (sum * 100) % 11;
          }
          else 
          {
	          rem = sum % 11;
          }
			    
	        return (rem < 2 ? rem : 11 - rem).toString();
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="486CAE544F3347EF8C24F6F96B0DCB45" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)

	        input = input.to_s.squeeze(' ')
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }


	        ((modulus - (sum % modulus)) % modulus) % 10
	
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
	    function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString().squeeze(' ');
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// Value to return as a single digit integer.
			return ((modulusInt - (sum % modulusInt)) % modulusInt) % 10;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="B93E66E8B8E57EE58715F127DA8A34B6" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)

	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	
	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end
	
	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        return '%02.0f' % (11 - (sum % modulus))
        end    
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
	    function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// NOTE: THIS SECTION OF CODE HAS BEEN COMMENTED OUT AND REPLACED BY THE CODE
			// BELOW FOR THIS FORM.
			// # Value to return as a single digit integer.
			// ((modulus - (sum % modulus)) % modulus) % 10
			return (11 - (sum % modulusInt)).complexFixedString(0, '02');
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="BB27831F4BF9BEBB8A83A327B44D24BD" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)

	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        '%02.0f' % (modulus - (sum % modulus))
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// This returns a 2 digit string
			return (modulusInt - (sum % modulusInt)).complexFixedString(0, '02');
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="2DFE7D68E15D55D58DE8692F392B0E5F" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)

	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	
	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        modulus - (sum % modulus)
        end    
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// Value to return as a single or double digit integer.
			return modulusInt - (sum % modulusInt);
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="6E4FA829EC2B427070580EEBAB945FFB" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	
	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        (sum % 10).to_s[-1,1]	
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
	    function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// modified this value due to check digit only wants the units position of the sum
			return (sum % 10).toString();
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="A41E2969562CB9EE28E910CC067906B9" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	
	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        '%02.0f' % ((modulus - (sum % modulus)) % modulus) % 10
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// Value to return as a single digit integer.
			// CHANGED THE VALUE TO RETURN A DOUBLE DIGIT INTEGER - DO NOT CHANGE
			// [HET] The corresponding Ruby method had an extra % 10 which was ignored
			// due to the way it was used, so not using it here (which WAS working).
			return (((modulusInt - (sum % modulusInt)) % modulusInt)).complexFixedString(0, '02');
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="8EBBE4B665E9E9613BFD80D1D1826632" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        if ((modulus - (sum % modulus)) == 10)
		        '+'
	        elsif ((modulus - (sum % modulus)) == 11)
		        '0'
	        else
		        ((modulus - (sum % modulus)) % modulus) % 10
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
	    function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// Per form instructions, if check digit is "10" then post a "+" sign in box 1_3,
			// and if check digit is "11" then post a "0" (zero) in box 1_3,
			// else return as a single digit integer.
			if ((modulus - (sum % modulus)) == 10)
			{
				return '+';
			}
			else if ((modulus - (sum % modulus)) == 11)
			{
				return '0';
			}
			else
			{
				return ((modulus - (sum % modulus)) % modulus) % 10;
			}
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="3945172D38551083E02394616AB8FC74" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        case (rem = sum % modulus)
		        when (0) then '0'
		        when (1) then '+'
		        else (modulus - rem).to_s
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
	    function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// Value to return as a single alphanumeric character.
			var rem = sum % modulusInt;
			switch (rem)
			{
				case 0: return '0';
				case 1: return '+';
				default: return (modulusInt - rem).toString();
			}
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="528F2938A3F7CE02BC8B2708B8465B1B" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = utah_amap(input[i, 1]).to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        ((modulus - (sum % modulus)) % modulus) % 10
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = utah_amap(inputStr.substr(i, 1)).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// Value to return as a single digit integer.
			return ((modulusInt - (sum % modulusInt)) % modulusInt) % 10;
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="1E13F284BDF584546A732E3FA8113D4C" scripttype="TS" codetype="method">
		<RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass

	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end

	        sum = 0
	        0.upto(input.length-1) { |i|
		        step = input[i, 1].to_i * multiplier[i, 1].to_i

		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        rem = sum % 11
	        return (rem < 2 ? rem : 11 - rem).to_s
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
	    function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
        {
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			var rem = sum % 11;
			return (rem < 2 ? rem : 11 - rem).toString();
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="B3CF24CA750DC2E686785167D0208D9F" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def calc_scan_line(vouch_num, tax_end_date, fein, payment)

	        scan_line = '2004400200514' + vouch_num + ' 70 '
	        mmddyy =	(tax_end_date.empty? ? '000000' : tax_end_date.delete('/'))
	        scan_line += mmddyy
	

	        scan_line += check_digit(mmddyy) + ' '
	
	        tmp_id = '1'
	

	        if (fein =~ /^(([0-9]{2}|H[0-9]{1})-[0-9]{7})$/)
		        fein = fein.delete('-')
		
		        if (fein[0, 1] == 'H')
			        tmp_id = '2'
			        fein['H'] = '0'
		        end
	        else

		        fein = '000000000'
	        end



	        scan_line += tmp_id + ' ' + fein + check_digit(fein) + ' '
	


	        pay = ('%011.0f' % (payment.to_f * 100.0)).to_s
	

	        scan_line += pay
	        scan_line += check_digit(pay)
	
	        return scan_line
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function calc_scan_line(vouch_num, tax_end_date, fein, payment)
				{
					var scan_line = '2004400200514' + vouch_num + ' 70 ';
					var mmddyy = (tax_end_date.isEmpty() ? '000000' : tax_end_date.delete('/'));
					scan_line += mmddyy;
					
					// Append tax period end date check digit and a space.
					scan_line += check_digit(mmddyy) + ' ';
					
					var tmp_id = '1';
					
					// Look for the proper pattern.
					if (/^(([0-9]{2}|H[0-9]{1})-[0-9]{7})$/.test(fein))
					{
						fein = fein.delete('-');
						if (fein.substring(0, 1) == 'H')
						{
							tmp_id = '2';
							fein[0] = '0';
						}
					}
					else
					{
						// Pattern is messed up.
						fein = '000000000';
					}
					
					// Append temporary taxpayer id indicator and a space followed by the taxpayer id number and
					// the associated check digit, followed by a space character.
					scan_line += tmp_id + ' ' + fein + check_digit(fein) + ' ';
					
					// Numeric only, prefix with zeroes to ensure an 11 digit value, leave the cents in w/o decimal	point.
					var pay = ((payment.to_f() * 100.0)).toString()).complexFixedString(0, '011');
					
					// Append payment amount and payment amount checkdigit.
					scan_line += pay;
					scan_line += check_digit(pay);
					
					return scan_line;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="65F86BA79451BB5F3682B29203DE95F2" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def calc_scan_line(vouch_num, tax_end_date, fein, payment)

	        scan_line = '2004401000322' + vouch_num + ' 70 '
	        mmddyy =	(tax_end_date.empty? ? '000000' : tax_end_date.delete('/'))
	        scan_line += mmddyy
	

	        scan_line += check_digit(mmddyy) + ' '
	
	        tmp_id = '1'
	

	        if (fein =~ /^(([0-9]{2}|H[0-9]{1})-[0-9]{7})$/)
		        fein = fein.delete('-')
		
		        if (fein[0, 1] == 'H')
			        tmp_id = '2'
			        fein['H'] = '0'
		        end
	        else
		        fein = '000000000'
	        end



	        scan_line += tmp_id + ' ' + fein + check_digit(fein) + ' '
	


	        pay = ('%011.0f' % (payment.to_f * 100.0)).to_s
	

	        scan_line += pay
	        scan_line += check_digit(pay)
	
	        return scan_line
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function calc_scan_line(vouch_num, tax_end_date, fein, payment)
				{
					var scan_line = '2004401000322' + vouch_num + ' 70 ';
					var mmddyy = (tax_end_date.isEmpty() ? '000000' : tax_end_date.delete('/'));
					scan_line += mmddyy;
					
					// Append tax period end date check digit and a space.
					scan_line += check_digit(mmddyy) + ' ';
					
					var tmp_id = '1';
					
					// Look for the proper pattern.
					if (/^(([0-9]{2}|H[0-9]{1})-[0-9]{7})$/.test(fein))
					{
						fein = fein.delete('-');
						if (fein.substring(0, 1) == 'H')
						{
							tmp_id = '2';
							fein[0] = '0';
						}
					}
					else
					{
						// Pattern is messed up.
						fein = '000000000';
					}
					
					// Append temporary taxpayer id indicator and a space followed by the taxpayer id number and
					// the associated check digit, followed by a space character.
					scan_line += tmp_id + ' ' + fein + check_digit(fein) + ' ';
					
					// Numeric only, prefix with zeroes to ensure an 11 digit value, leave the cents in w/o decimal	point.
					var pay = ((payment.to_f() * 100.0)).toString()).complexFixedString(0, '011');
					
					// Append payment amount and payment amount checkdigit.
					scan_line += pay;
					scan_line += check_digit(pay);
					
					return scan_line;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="05D3A32EC6448C4524CA488DFF3CF131" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def calc_scan_line(vouch_num, tax_end_date, ssn, spouse_ssn, payment)

	        scan_line = "2004400100129#{vouch_num} 70 "
	        mmddyy =	(tax_end_date.empty? ? '123108' : tax_end_date.delete('/'))
	        scan_line += mmddyy
	

	        scan_line += check_digit(mmddyy) + ' '
	
	        tmp_id = '1'
	

	        if (ssn =~ /^(([0-9]{3}|H[0-9]{2})-[0-9]{2}-[0-9]{4}|APPLIED FOR)$/)
		        ssn = ssn.delete('-')
		        if (ssn[0, 1] == 'H')
			        tmp_id = '2'
			        ssn['H'] = '0'
		        elsif (ssn == 'APPLIED FOR')
			        ssn = '000000000'
		        end
	        else
		        ssn = '000000000'
	        end



	        scan_line += "#{tmp_id} #{ssn}#{check_digit(ssn)} "
	
	        tmp_id = '1'
	

	        if (spouse_ssn =~ /^(([0-9]{3}|H[0-9]{2})-[0-9]{2}-[0-9]{4}|APPLIED FOR)$/)
		        spouse_ssn = spouse_ssn.delete('-')
	
		        if (spouse_ssn[0, 1] == 'H')
			        tmp_id = '2'
			        spouse_ssn['H'] = '0'
		        elsif (spouse_ssn == 'APPLIED FOR')
			        spouse_ssn = '000000000'
		        end
	        else
		        spouse_ssn = '000000000'
	        end



	        scan_line += "#{tmp_id} #{spouse_ssn}#{check_digit(spouse_ssn)} "
	


	        pay = ('%011.0f' % (payment.to_f * 100.0)).to_s
	

	        scan_line += pay
	        scan_line += check_digit(pay)
	
	        return scan_line
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function calc_scan_line(vouch_num, tax_end_date, ssn, spouse_ssn, payment)
				{
					var scan_line = '2004400100129' + vouch_num + ' 70 ';
					var mmddyy = (tax_end_date.isEmpty() ? '123108' : tax_end_date.delete('/'));
					scan_line += mmddyy;
					
					// Append tax period end date check digit and a space.
					scan_line += check_digit(mmddyy) + ' ';
					
					var tmp_id = '1';
					
					// Look for the proper pattern.
					if (/^(([0-9]{3}|H[0-9]{2})-[0-9]{2}-[0-9]{4}|APPLIED FOR)$/.test(ssn))
					{
						ssn = ssn.delete('-');
						if (ssn.substring(0, 1) == 'H')
						{
							tmp_id = '2';
							ssn[0] = '0';
						}
						else if (ssn == 'APPLIED FOR')
						{
							ssn = '000000000';
						}
					}
					else
					{
						ssn = '000000000';
					}
					
					// Append temporary taxpayer id indicator and a space followed by the taxpayer id number and
					// the associated check digit, followed by a space character.
					scan_line += tmp_id + ' ' + ssn + check_digit(ssn) + ' ';
					
					tmp_id = '1';
	
					// Look for the proper pattern.	
					if (/^(([0-9]{3}|H[0-9]{2})-[0-9]{2}-[0-9]{4}|APPLIED FOR)$/.test(spouse_ssn))
					{
						spouse_ssn = spouse_ssn.delete('-');
					
						if (spouse_ssn.substring(0, 1) == 'H')
						{
							tmp_id = '2';
							spouse_ssn[0] = '0';
						}
						else if (spouse_ssn == 'APPLIED FOR')
						{
							spouse_ssn = '000000000';
						}
					}
					else
					{
						spouse_ssn = '000000000';
					}

					// Append temporary taxpayer spouse id indicator and a space followed by the taxpayer spouse
					// id number and the associated check digit followed by a space character.
					scan_line += tmp_id + " " + spouse_ssn + check_digit(spouse_ssn) + " ";

					// Numeric only, prefix with zeroes to ensure an 11 digit value, leave the cents in w/o decimal	point.
					var pay = ((payment.to_f() * 100.0)).toString()).complexFixedString(0, '011');
					
					// Append payment amount and payment amount checkdigit.
					scan_line += pay;
					scan_line += check_digit(pay);
					
					return scan_line;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="4DC604ACA7985C4147FC28A017EB1549" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(amount)
	        if (amount > 11200.0) then 2895.50 + ((amount - 11200.0) * 0.35)
	        elsif (amount > 8200.0) then 1905.50 + ((amount - 8200.0) * 0.33)
	        elsif (amount > 5350.0) then 1107.50 + ((amount - 5350.0) * 0.28)
	        elsif (amount > 2300.0) then 345.0 + ((amount - 2300.0) * 0.25)
	        elsif (amount > 0.0) then amount * 0.15
	        else 0.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					if (amount > 11200.0)
					{
						return 2895.50 + ((amount - 11200.0) * 0.35);
					}
					else if (amount > 8200.0)
					{
						return 1905.50 + ((amount - 8200.0) * 0.33);
					}
					else if (amount > 5350.0)
					{
						return 1107.50 + ((amount - 5350.0) * 0.28);
					}
					else if (amount > 2300.0)
					{
						return 345.0 + ((amount - 2300.0) * 0.25);
					}
					else if (amount > 0.0)
					{
						return amount * 0.15;
					}
					else
					{
						return 0.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="BA9C3B640C16451048CE45E75BD48438" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(income)
	        income = income.to_f
	        if( income >= 90000.0 )
		        4500.0 + ( income - 90000.0 ) * 0.094
	        elsif( income >= 80000.0 )
		        3600.0 + ( income - 80000.0 ) * 0.09
	        elsif( income >= 70000.0 )
		        2800.0 + ( income - 70000.0 ) * 0.08
	        elsif( income >= 60000.0 )
		        2100.0 + ( income - 60000.0 ) * 0.07
	        elsif( income >= 50000.0 )
		        1500.0 + ( income - 50000.0 ) * 0.06
	        elsif( income >= 40000.0 )
		        1000.0 + ( income - 40000.0 ) * 0.05
	        elsif( income >= 30000.0 )
		        600.0 + ( income - 30000.0 ) * 0.04
	        elsif( income >= 20000.0 )
		        300.0 + ( income - 20000.0 ) * 0.03
	        elsif( income >= 10000.0 )
		        100.0 + ( income - 10000.0 ) * 0.02
	        else income * 0.01
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(income)
				{
					income = income.to_f();
					
					if( income >= 90000.0 )
					{
						return 4500.0 + ( income - 90000.0 ) * 0.094;
					}
					else if( income >= 80000.0 )
					{
						return 3600.0 + ( income - 80000.0 ) * 0.09;
					}
					else if( income >= 70000.0 )
					{
						return 2800.0 + ( income - 70000.0 ) * 0.08;
					}
					else if( income >= 60000.0 )
					{
						return 2100.0 + ( income - 60000.0 ) * 0.07;
					}
					else if( income >= 50000.0 )
					{
						return 1500.0 + ( income - 50000.0 ) * 0.06;
					}
					else if( income >= 40000.0 )
					{
						return 1000.0 + ( income - 40000.0 ) * 0.05;
					}
					else if( income >= 30000.0 )
					{
						return 600.0 + ( income - 30000.0 ) * 0.04;
					}
					else if( income >= 20000.0 )
					{
						return 300.0 + ( income - 20000.0 ) * 0.03;
					}
					else if( income >= 10000.0 )
					{
						return 100.0 + ( income - 10000.0 ) * 0.02;
					}
					else
					{
						return income * 0.01;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="4E37250DCE5FBEDF29CEACB1CD491E45" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tuition(twentyfive_dollars,fifty_dollars,hundred_dollars,many_dollars,value)
	        if (!twentyfive_dollars.strip.empty?) then '%0.0f' % (25.0)
	        elsif (!fifty_dollars.strip.empty?) then '%0.0f' % (50.0)
	        elsif (!hundred_dollars.strip.empty?) then '%0.0f' % (100.0)
	        elsif (!many_dollars.strip.empty?) then '%0.0f' % (value.to_f)
	        else ''
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tuition(twentyfive_dollars,fifty_dollars,hundred_dollars,many_dollars,value)
				{
					if (!twentyfive_dollars.trim().isEmpty())
					{
						return (25.0).fixed(0);
					}
					else if (!fifty_dollars.trim().isEmpty())
					{
						return (50.0).fixed(0);
					}
					else if (!hundred_dollars.trim().isEmpty())
					{
						return (100.0).fixed(0);
					}
					else if (!many_dollars.trim().isEmpty())
					{
						return value.to_f().fixed(0);
					}
					else
					{
						return '';
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="9779EB82C171CFEACB2D0B3A7DD43D9D" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...2000.01)					
			        tax = 0.0				
		        when (2000.01...5000.01)					
			        tax = ((taxable_income - 2000.0) * 0.0220)		
		        when (5000.01...10000.01)					
			        tax = ((taxable_income - 5000.0) * 0.0390) + 66.0				
		        when (10000.01...20000.01)					
			        tax = ((taxable_income - 10000.0) * 0.0480) + 261.0
		        when (20000.01...25000.01)					
			        tax = ((taxable_income - 20000.0) * 0.0520) + 741.0
		        when (25000.01...60000.01)					
			        tax = ((taxable_income - 25000.0) * 0.0555) + 1001.0
		        else					
			        tax = ((taxable_income - 60000.0) * 0.0695) + 2943.50				
	        end						
	        return tax						
        end					
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 2000.01)					
					{
						tax = 0.0;
					}
					else if (taxable_income >= 2000.01 && taxable_income <= 5000.01)					
					{
						tax = ((taxable_income - 2000.0) * 0.0220);
					}
					else if (taxable_income >= 5000.01 && taxable_income <= 10000.01)					
					{
						tax = ((taxable_income - 5000.0) * 0.0390) + 66.0;
					}
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.01)					
					{
						tax = ((taxable_income - 10000.0) * 0.0480) + 261.0;
					}
					else if (taxable_income >= 20000.01 && taxable_income <= 25000.01)					
					{
						tax = ((taxable_income - 20000.0) * 0.0520) + 741.0;
					}
					else if (taxable_income >= 25000.01 && taxable_income <= 60000.01)					
					{
						tax = ((taxable_income - 25000.0) * 0.0555) + 1001.0;
					}
					else					
					{
						tax = ((taxable_income - 60000.0) * 0.0695) + 2943.50;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="86B4F8AC1048635B8BE606994BF4632D" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def get_avg_retail_sales_rate(fuel_type)
	        case (fuel_type.strip.to_i)
		        when (1): "2.337"
		        when (2): "2.503"
		        when (3): "4.303"
		        when (4): "1.748"
		        when (5): "2.302"
		        else "0.00"
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_avg_retail_sales_rate(fuel_type)
				{
					switch (fuel_type.trim().to_i())
					{
						case 1: return "2.337";
						case 2: return "2.503";
						case 3: return "4.303";
						case 4: return "1.748";
						case 5: return "2.302";
						default: return "0.00";
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="A853BD890D57E5775454432214196362" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_rate(household_income)
	        rate = if (household_income < 0.0) then '0'
		        else
			        case household_income
				        when (0.0..10522.99) then '1.00'
				        when (10523.0..11760.99) then '0.85'
				        when (11761.0..12998.99) then '0.70'
				        when (12999.0..15474.99) then '0.50'
				        when (15475.0..17950.99) then '0.35'
				        when (17951.0..20426.99) then '0.25'
				        else '0'
			        end
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_rate(household_income)
				{
					if (household_income < 0.0)
					{
						return '0';
					}
					else
					{
						if (taxable_income >= 0.0 && taxable_income <= 10522.99)
						{
							return '1.00';
						}
						else if (taxable_income >= 10523.0 && taxable_income <= 11760.99)
						{
							return '0.85';
						}
						else if (taxable_income >= 11761.0 && taxable_income <= 12998.99)
						{
							return '0.70';
						}
						else if (taxable_income >= 12999.0 && taxable_income <= 15474.99)
						{
							return '0.50';
						}
						else if (taxable_income >= 15475.0 && taxable_income <= 17950.99)
						{
							return '0.35';
						}
						else if (taxable_income >= 17951.0 && taxable_income <= 20426.99)
						{
							return '0.25';
						}
						else
						{
							return '0';
						}
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="1AE9DACABBAF8BFCAD0657B278EA9FA0" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1407.01)					
			        tax = taxable_income * 0.0036				
		        when (1407.01...2814.01)					
			        tax = ((taxable_income - 1407.0) * 0.0072) + 5.07
		        when (2814.01...5628.01)					
			        tax = ((taxable_income - 2814.0) * 0.0243) + 15.20				
		        when (5628.01...12663.01)					
			        tax = ((taxable_income - 5628.0) * 0.0450) + 83.58	
		        when (12663.01...21105.01)					
			        tax = ((taxable_income - 12663.0) * 0.0612) + 400.16	
		        when (21105.01...28140.01)					
			        tax = ((taxable_income - 21105.0) * 0.0648) + 916.81
		        when (28140.01...42210.01)					
			        tax = ((taxable_income - 28140.0) * 0.0680) + 1372.68
		        when (42210.01...63315.01)					
			        tax = ((taxable_income - 42210.0) * 0.0792) + 2329.44
		        else					
			        tax = ((taxable_income - 63315.0) * 0.0898) + 4000.96				
	        end						
	        return tax						
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1407.01)					
					{
						tax = taxable_income * 0.0036;
					}
					else if (taxable_income >= 1407.01 && taxable_income <= 2814.01)					
					{
						tax = ((taxable_income - 1407.0) * 0.0072) + 5.07;
					}
					else if (taxable_income >= 2814.01 && taxable_income <= 5628.01)					
					{
						tax = ((taxable_income - 2814.0) * 0.0243) + 15.20;
					}
					else if (taxable_income >= 5628.01 && taxable_income <= 12663.01)					
					{
						tax = ((taxable_income - 5628.0) * 0.0450) + 83.58;
					}
					else if (taxable_income >= 12663.01 && taxable_income <= 21105.01)					
					{
						tax = ((taxable_income - 12663.0) * 0.0612) + 400.16;
					}
					else if (taxable_income >= 21105.01 && taxable_income <= 28140.01)					
					{
						tax = ((taxable_income - 21105.0) * 0.0648) + 916.81;
					}
					else if (taxable_income >= 28140.01 && taxable_income <= 42210.01)					
					{
						tax = ((taxable_income - 28140.0) * 0.0680) + 1372.68;
					}
					else if (taxable_income >= 42210.01 && taxable_income <= 63315.01)					
					{
						tax = ((taxable_income - 42210.0) * 0.0792) + 2329.44;
					}
					else					
					{
						tax = ((taxable_income - 63315.0) * 0.0898) + 4000.96;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="B020C6DA56942791EB3C8E6A562EAA06" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def single_tax(value)
	        return 0.0 if (value <= 0.0)
	        case value
		        when (0.01..22730.0) then 0.0535 * value
		        when (22730.01..74650.0) then 1216.06 + 0.0705 * (value - 22730.0)
		        else 4876.42 + 0.0785 * (value - 74650.0)
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function single_tax(value)
				{
					if (value <= 0.0)
					{
						return 0.0;
					}
					
					if (value >= 0.01 && value <= 22730.0)
					{
						return 0.0535 * value;
					}
					else if (value >= 22730.01 && value <= 74650.0)
					{
						return 1216.06 + 0.0705 * (value - 22730.0);
					}
					else
					{
						return 4876.42 + 0.0785 * (value - 74650.0);
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="3A5DEB0816A34960F04F5B51CB976993" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)			 		
	        return 0.0 if (taxable_income < 500000.0)

	        return case taxable_income
			        when (500000...1000000): 100.0		
			        when (1000000...5000000): 300.0
			        when (5000000...10000000): 1000.0
			        when (10000000...20000000): 2000.0
			        else 5000.0
		        end
        end			
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)			 		
				{
					if (taxable_income < 500000.0)
					{
						return 0.0;
					}

					if (taxable_income >= 500000 && taxable_income <= 1000000) { return 100.0; }
					else if (taxable_income >= 1000000 && taxable_income <= 5000000) { return 300.0; }
					else if (taxable_income >= 5000000 && taxable_income <= 10000000) { return 1000.0; }
					else if (taxable_income >= 10000000 && taxable_income <= 20000000) { return 2000.0; }
					else { return 5000.0;	}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D053D042ECE9F201D3876B2989DC2F8A" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def credit(code)
	        return 2 unless ((2..50) === code.to_i)
	        ([2,3,4,11,12].include?(code.to_i) ? 1 : 0)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function credit(code)
				{
					var value = code.to_i();
					if (value < 2 || value > 50)
					{
						return 2;
					}

					return ([2,3,4,11,12].contains(value) ? 1 : 0);
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="7A384A342BE0AC7234A06437404D29BD" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_amount)
	        tax =	if (taxable_amount > 15400.0)
			        taxable_amount * 0.069 - 492.0
		        elsif (taxable_amount > 12000.0)
			        taxable_amount * 0.06 - 353.0
		        elsif (taxable_amount > 9300.0)
			        taxable_amount * 0.05 - 233.0
		        elsif (taxable_amount > 6900.0)
			        taxable_amount * 0.04 - 140.0
		        elsif (taxable_amount > 4500.0)
			        taxable_amount * 0.03 - 71.0
		        elsif (taxable_amount > 2600.0)
			        taxable_amount * 0.02 - 26.0
		        elsif (taxable_amount > 0.0)
			        taxable_amount * 0.01
		        else 0.0
		        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_amount)
				{
					var tax = 0.0;
					
					if (taxable_amount > 15400.0)
					{
						tax = taxable_amount * 0.069 - 492.0;
					}
					else if (taxable_amount > 12000.0)
					{
						tax = taxable_amount * 0.06 - 353.0;
					}
					else if (taxable_amount > 9300.0)
					{
						tax = taxable_amount * 0.05 - 233.0;
					}
					else if (taxable_amount > 6900.0)
					{
						tax = taxable_amount * 0.04 - 140.0;
					}
					else if (taxable_amount > 4500.0)
					{
						tax = taxable_amount * 0.03 - 71.0;
					}
					else if (taxable_amount > 2600.0)
					{
						tax = taxable_amount * 0.02 - 26.0;
					}
					else if (taxable_amount > 0.0)
					{
						tax = taxable_amount * 0.01;
					}
					else
					{
						tax = 0.0;
					}
						
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="7C0EC7EB5AF2DE0EBAC3A15E209360EE" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        if (taxable_income <= 0.0) then return 0 end						
		        tax = case taxable_income						
				        when (0.01...2600.01) then taxable_income * 0.01
				        when (2600.01...4500.01) then ((taxable_income * 0.02 ) - 26.0)
				        when (4500.01...6900.01) then ((taxable_income * 0.03) - 71.0)
				        when (6900.01...9300.01) then tax = ((taxable_income * 0.04) - 140.0)
				        when (9300.01...12000.01) then ((taxable_income * 0.05 ) - 233.0)
				        when (12000.01...15400.01) then ((taxable_income * 0.06) - 353.0)
				        else ((taxable_income * 0.069) - 492.0)
			        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;

					if (taxable_income >= 0.01 && taxable_income <= 2600.01)
					{
						tax = taxable_income * 0.01;
					}
					else if (taxable_income >= 2600.01 && taxable_income <= 4500.01)
					{
						tax = ((taxable_income * 0.02 ) - 26.0);
					}
					else if (taxable_income >= 4500.01 && taxable_income <= 6900.01)
					{
						tax = ((taxable_income * 0.03) - 71.0);
					}
					else if (taxable_income >= 6900.01 && taxable_income <= 9300.01)
					{
						tax = ((taxable_income * 0.04) - 140.0);
					}
					else if (taxable_income >= 9300.01 && taxable_income <= 12000.01)
					{
						tax = ((taxable_income * 0.05 ) - 233.0);
					}
					else if (taxable_income >= 12000.01 && taxable_income <= 15400.01)
					{
						tax = ((taxable_income * 0.06) - 353.0);
					}
					else
					{
						tax = ((taxable_income * 0.069) - 492.0);
					}
							
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="09C2634640479B76300814E333000C84" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(amount)
	        amount = amount.to_f
	        return 0.0 unless (amount > 0.0)

	        case (amount)
		        when (0.01..2600.0): (amount * 0.01)
		        when (2600.01..4500.0): (amount * 0.02) - 26.0
		        when (4500.01..6900.0): (amount * 0.03) - 71.0
		        when (6900.01..9300.0): (amount * 0.04) - 140.0
		        when (9300.01..12000.0): (amount * 0.05) - 233.0
		        when (12000.01..15400.0): (amount * 0.06) - 353.0
		        else (amount * 0.069) - 492.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2600.0)
					{
						return (amount * 0.01);
					}
					else if (taxable_income >= 2600.01 && taxable_income <= 4500.0)
					{
						return (amount * 0.02) - 26.0;
					}
					else if (taxable_income >= 4500.01 && taxable_income <= 6900.0)
					{
						return (amount * 0.03) - 71.0;
					}
					else if (taxable_income >= 6900.01 && taxable_income <= 9300.0)
					{
						return (amount * 0.04) - 140.0;
					}
					else if (taxable_income >= 9300.01 && taxable_income <= 12000.0)
					{
						return (amount * 0.05) - 233.0;
					}
					else if (taxable_income >= 12000.01 && taxable_income <= 15400.0)
					{
						return (amount * 0.06) - 353.0;
					}
					else
					{
						return (amount * 0.069) - 492.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="8CE8F78A4811F17BD2114BAFAF5EC16A" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def federal_tax(taxable_income)
	        if (taxable_income <= 0.0) then return '' end
	        tax = case taxable_income		
			        when (0.01..15000.0) then '0.35'		
			        when (15000.01..17000.0) then '0.34'
			        when (17000.01..19000.0) then '0.33'
			        when (19000.01..21000.0) then '0.32'
			        when (21000.01..23000.0) then '0.31'
			        when (23000.01..25000.0) then '0.30'
			        when (25000.01..27000.0) then '0.29'
			        when (27000.01..29000.0) then '0.28'
			        else ''
		        end
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function federal_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return '';
					}
					
					var tax = '';

					if (taxable_income >= 0.01 && taxable_income <= 15000.0)
					{
						tax = '0.35';
					}
					else if (taxable_income >= 15000.01 && taxable_income <= 17000.0)
					{
						return '0.34';
					}
					else if (taxable_income >= 17000.01 && taxable_income <= 19000.0)
					{
						return '0.33';
					}
					else if (taxable_income >= 19000.01 && taxable_income <= 21000.0)
					{
						return '0.32';
					}
					else if (taxable_income >= 21000.01 && taxable_income <= 23000.0)
					{
						return '0.31';
					}
					else if (taxable_income >= 23000.01 && taxable_income <= 25000.0)
					{
						return '0.30';
					}
					else if (taxable_income >= 25000.01 && taxable_income <= 27000.0)
					{
						return '0.29';
					}
					else if (taxable_income >= 27000.01 && taxable_income <= 29000.0)
					{
						return '0.28';
					}
					else
					{
						return '';
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="7B5B5E6AB999A839359742F5092B8746" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def state_tax(taxable_income)
	        if (taxable_income <= 0.0) then return 1.0 end
	        tax = case taxable_income		
			        when (0.01..22000.0) then '1.0'		
			        when (22000.01..23000.0) then '0.9'
			        when (23000.01..24000.0) then '0.8'			
			        when (24000.01..25000.0) then '0.7'
			        when (25000.01..26000.0) then '0.6'
			        when (26000.01..27000.0) then '0.5'
			        when (27000.01..28000.0) then '0.4'
			        when (28000.01..29000.0) then '0.3'
			        else ''
		        end
	        return tax						
        end				
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function state_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return '1.0';
					}
					
					var tax = '';
					if (taxable_income >= 0.01 && taxable_income <= 22000.0)
					{
						tax = '1.0';
					}
					else if (taxable_income >= 22000.01 && taxable_income <= 23000.0)
					{
						tax = '0.9';
					}
					else if (taxable_income >= 23000.01 && taxable_income <= 24000.0)
					{
						tax = '0.8';
					}
					else if (taxable_income >= 24000.01 && taxable_income <= 25000.0)
					{
						tax = '0.7';
					}
					else if (taxable_income >= 25000.01 && taxable_income <= 26000.0)
					{
						tax = '0.6';
					}
					else if (taxable_income >= 26000.01 && taxable_income <= 27000.0)
					{
						tax = '0.5';
					}
					else if (taxable_income >= 27000.01 && taxable_income <= 28000.0)
					{
						tax = '0.4';
					}
					else if (taxable_income >= 28000.01 && taxable_income <= 29000.0)
					{
						tax = '0.3';
					}
					else
					{
						tax = '';
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="F1E6B05286D9A6AD28F0801D6D135D9D" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        return 0.0 if (taxable_income <= 0.0)
	        case taxable_income
		        when (0.01..2600.0): taxable_income * 0.01
		        when (2600.01..4500.0): ((taxable_income * 0.02 ) - 26.0)
		        when (4500.01..6900.0): ((taxable_income * 0.03) - 71.0)
		        when (6900.01..9300.0): ((taxable_income * 0.04) - 140.0)
		        when (9300.01..12000.0): ((taxable_income * 0.05 ) - 233.0)
		        when (12000.01..15400.0): ((taxable_income * 0.06) - 353.0)
		        else ((taxable_income * 0.069) - 492.0)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2600.0)
					{
						return taxable_income * 0.01;
					}
					else if (taxable_income >= 2600.01 && taxable_income <= 4500.0)
					{
						return ((taxable_income * 0.02 ) - 26.0);
					}
					else if (taxable_income >= 4500.01 && taxable_income <= 6900.0)
					{
						return ((taxable_income * 0.03) - 71.0);
					}
					else if (taxable_income >= 6900.01 && taxable_income <= 9300.0)
					{
						return ((taxable_income * 0.04) - 140.0);
					}
					else if (taxable_income >= 9300.01 && taxable_income <= 12000.0)
					{
						return ((taxable_income * 0.05 ) - 233.0);
					}
					else if (taxable_income >= 12000.01 && taxable_income <= 15400.0)
					{
						return ((taxable_income * 0.06) - 353.0);
					}
					else
					{
						return ((taxable_income * 0.069) - 492.0);
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="94974AAF7F91AF2F646AF24978649AFD" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        tax = case taxable_income						
			        when (0.01..2600.0) then taxable_income * 0.01				
			        when (2600.01..4500.0) then ((taxable_income * 0.02 ) - 26.0)				
			        when (4500.01..6900.0) then ((taxable_income * 0.03) - 71.0)				
			        when (6900.01..9300.0) then ((taxable_income * 0.04) - 140.0)	
			        when (9300.01..12000.0) then ((taxable_income * 0.05) - 233.0)				
			        when (12000.01..15400.0) then ((taxable_income * 0.06) - 353.0)				
			        else ((taxable_income * 0.069) - 492.0)
		        end			
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					
					if (taxable_income >= 0.01 && taxable_income <= 2600.0)
					{
						tax = taxable_income * 0.01;
					}
					else if (taxable_income >= 2600.01 && taxable_income <= 4500.0)
					{
						tax = ((taxable_income * 0.02 ) - 26.0);
					}
					else if (taxable_income >= 4500.01 && taxable_income <= 6900.0)
					{
						tax = ((taxable_income * 0.03) - 71.0);
					}
					else if (taxable_income >= 6900.01 && taxable_income <= 9300.0)
					{
						tax = ((taxable_income * 0.04) - 140.0);
					}
					else if (taxable_income >= 9300.01 && taxable_income <= 12000.0)
					{
						tax = ((taxable_income * 0.05) - 233.0);
					}
					else if (taxable_income >= 12000.01 && taxable_income <= 15400.0)
					{
						tax = ((taxable_income * 0.06) - 353.0);
					}
					else
					{
						tax = ((taxable_income * 0.069) - 492.0);
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="E878EAC8901A250FA1209EA6AA551D0B" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(income)
	        return 0.0 if (income <= 0)
	        case (income)
		        when (0.01..8000.0): (income * 0.04)
		        when (8000.01..11000.0): ((income - 8000) * 0.045 + 320.0)
		        when (11000.01..13000.0): ((income - 11000) * 0.0525 + 455.0)
		        when (13000.01..20000.0): ((income -13000) * 0.059 + 560.0)
		        when (20000.01..200000.0): ((income -20000) * 0.0685 + 973.0)
		        when (200000.01..500000.0): ((income -200000) * 0.0785 + 13303.0)	
		        else ((income - 500000) * 0.0897 + 36853.0)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(income)
				{
					if (income <= 0)
					{
						return 0.0;
					}
					
					if (income >= 0.01 && income <= 8000.0)
					{
						return (income * 0.04);
					}
					else if (income >= 8000.01 && income <= 11000.0)
					{
						return ((income - 8000) * 0.045 + 320.0);
					}
					else if (income >= 11000.01 && income <= 13000.0)
					{
						return ((income - 11000) * 0.0525 + 455.0);
					}
					else if (income >= 13000.01 && income <= 20000.0)
					{
						return ((income -13000) * 0.059 + 560.0);
					}
					else if (income >= 20000.01 && income <= 200000.0)
					{
						return ((income -20000) * 0.0685 + 973.0);
					}
					else if (income >= 200000.01 && income <= 500000.0)
					{
						return ((income -200000) * 0.0785 + 13303.0);
					}
					else
					{
						return ((income - 500000) * 0.0897 + 36853.0);
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="CCE79C65070F0A1DE104C38512247DD0" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)
	        if( amount > 500000.0 ) then 36853.0 + ( amount - 500000.0 ) * 0.0897
	        elsif( amount > 200000.0 ) then 13303.0 + ( amount - 200000.0 ) * 0.0785
	        elsif( amount > 20000.0 ) then 973.0 + ( amount - 20000.0 ) * 0.0685
	        elsif( amount > 13000.0 ) then 560.0 + ( amount - 13000.0 ) * 0.059
	        elsif( amount > 11000.0 ) then 455.0 + ( amount - 11000.0 ) * 0.0525
	        elsif( amount > 8000.0 ) then 320.0 + ( amount - 8000.0 ) * 0.045
	        elsif( amount > 0.0 ) then amount * 0.04
	        else 0.0
	        end
        end			
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					if ( amount > 500000.0 )
					{
						return 36853.0 + ( amount - 500000.0 ) * 0.0897;
					}
					else if ( amount > 200000.0 )
					{
						return 13303.0 + ( amount - 200000.0 ) * 0.0785;
					}
					else if ( amount > 20000.0 )
					{
						return 973.0 + ( amount - 20000.0 ) * 0.0685;
					}
					else if ( amount > 13000.0 )
					{
						return 560.0 + ( amount - 13000.0 ) * 0.059;
					}
					else if ( amount > 11000.0 )
					{
						return 455.0 + ( amount - 11000.0 ) * 0.0525;
					}
					else if ( amount > 8000.0 )
					{
						return 320.0 + ( amount - 8000.0 ) * 0.045;
					}
					else if ( amount > 0.0 )
					{
						return amount * 0.04;
					}
					else
					{
						return 0.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="0B5DC3B9AB4B3D4CD9A75197288C1866" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_surtax(a)
	        a = a.to_f
	        if ( a > 150000.0 )
		        0.03
	        elsif ( a > 60000.0 )
		        0.02
	        else
		        0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_surtax(a)
				{
					a = a.to_f();
					
					if ( a > 150000.0 )
					{
						return 0.03;
					}
					else if ( a > 60000.0 )
					{
						return 0.02;
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="3F825DD19208C89D31C5F251CD17BE58" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        if (taxable_income <= 0.0) then return 0 end
	        case taxable_income
		        when (0.0...25000.01)
			        tax = taxable_income * 0.021
		        when (25000...50000.01)
			        tax = ((taxable_income - 25000.0) * 0.0525) + 525.0
		        else
			        tax = ((taxable_income - 50000.0) * 0.064) + 1837.50
	        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}

					var tax = 0.0;
					if (taxable_income >= 0.0 && taxable_income <= 25000.01)
					{
						tax = taxable_income * 0.021;
					}
					else if (taxable_income >= 25000 && taxable_income <= 50000.01)
					{
						tax = ((taxable_income - 25000.0) * 0.0525) + 525.0;
					}
					else
					{
						tax = ((taxable_income - 50000.0) * 0.064) + 1837.50;
					}
					
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="C08EF79B88E1FB4A4FEA1A86CB322DBD" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def tax(amount)
	        if( amount > 200000.0 )
		        9573.30 + ( amount - 200000.0 ) * 0.0624
	        elsif( amount > 100000.0 )
		        3832.30 + ( amount - 100000.0 ) * 0.05741
	        elsif( amount > 80000.0 )
		        2843.30 + ( amount - 80000.0 ) * 0.04945
	        elsif( amount > 40000.0 )
		        1112.50 + ( amount - 40000.0 ) * 0.04327
	        elsif( amount > 20000.0 )
		        370.90 + ( amount - 20000.0 ) * 0.03708
	        elsif( amount > 15000.0 )
		        216.35 + ( amount - 15000.0 ) * 0.03091
	        elsif( amount > 10000.0 )
		        92.70 + ( amount - 10000.0 ) * 0.02473
	        elsif( amount > 5000.0 )
		        30.90 + ( amount - 5000.0 ) * 0.01236
	        elsif( amount > 0.0 )
		        amount * 0.00618
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					if ( amount > 200000.0 )
					{
						return 9573.30 + ( amount - 200000.0 ) * 0.0624;
					}
					else if( amount > 100000.0 )
					{
						return 3832.30 + ( amount - 100000.0 ) * 0.05741;
					}
					else if( amount > 80000.0 )
					{
						return 2843.30 + ( amount - 80000.0 ) * 0.04945;
					}
					else if( amount > 40000.0 )
					{
						return 1112.50 + ( amount - 40000.0 ) * 0.04327;
					}
					else if( amount > 20000.0 )
					{
						return 370.90 + ( amount - 20000.0 ) * 0.03708;
					}
					else if( amount > 15000.0 )
					{
						return 216.35 + ( amount - 15000.0 ) * 0.03091;
					}
					else if( amount > 10000.0 )
					{
						return 92.70 + ( amount - 10000.0 ) * 0.02473;
					}
					else if( amount > 5000.0 )
					{
						return 30.90 + ( amount - 5000.0 ) * 0.01236;
					}
					else if( amount > 0.0 )
					{
						return amount * 0.00618;
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="BEFA6B6FA589C727DDCD61385CB33847" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def owner_rebate(taxable_income)			 
	        return 0.0 if (taxable_income <= 0.0)
	        rebate = case taxable_income

			        when (0..8000): 650.0
			        when (8001..15000): 500.0
			        when (15001..18000): 300.0
			        when (18001..35000): 250.0
			        else 0.0
	        end					

	        return rebate					
        end				
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function owner_rebate(taxable_income)			 
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					var rebate = 0.0;

					if (taxable_income >= 0 && taxable_income <= 8000)
					{
						rebate = 650.0;
					}
					else if (taxable_income >= 8001 && taxable_income <= 15000)
					{
						rebate = 500.0;
					}
					else if (taxable_income >= 15001 && taxable_income <= 18000)
					{
						rebate = 300.0;
					}
					else if (taxable_income >= 18001 && taxable_income <= 35000)
					{
						rebate = 250.0;
					}
					else
					{
						rebate = 0.0;
					}

					return rebate;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="6BD2B9771788A9CCAF4A18AAB2F85C4F" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def renter_rebate(taxable_income)
	        return 0.0 if (taxable_income <= 0.0)

	        rebate = case taxable_income
			        when (0..8000): 650.0
			        when (8001..15000): 500.0
			        else 0.0
		        end
	        return rebate
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function renter_rebate(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					var rebate = 0.0;

					if (taxable_income >= 0 && taxable_income <= 8000) { rebate = 650.0; }
					else if (taxable_income >= 8001 && taxable_income <= 15000) {	rebate = 500.0;	}
					else { rebate = 0.0; }

					return rebate;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="957708CE0EC9064A69AAF3E7095FDF92" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def invalid_taxnum(number)
	        number = number.strip
	        return false unless (number =~ /\A[13]{1}[0-9]{10}\Z/)
	
	        cd = check_digit(number[0,10], '12', 10, true, false)
	        if (cd != number[10,1].to_i)
		        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
		        return true
	        end
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function invalid_taxnum(number)
				{
					number = number.trim();

					if (!(/\A[13]{1}[0-9]{10}\Z/).test(number))
					{
						return false;
					}
					
					var cd = check_digit(number.substring(0,10), '12', 10, true, false);
					
					if (cd != number.substring(10,1).to_i())
					{
						SFForms.Utilities.MessageBox(formInstanceId, "The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", MB_ICONEXCLAMATION);
						return true;
					}
					
					return false;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="C9309D6ED7E1DD90A7C94753F4D4A41B" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def invalid_11digit_taxnum(number)
	        number = number.strip
	        return false unless (number =~ /\A[13]{1}[0-9]{10}\Z/)
	
	        cd = check_digit(number[0,10], '12', 10, true, false)
	        if (cd != number[10,1].to_i)
		        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
		        return true
	        end
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function invalid_11digit_taxnum(number)
				{
					number = number.trim();

					if (!(/\A[13]{1}[0-9]{10}\Z/).test(number))
					{
						return false;
					}
					
					var cd = check_digit(number.substring(0,10), '12', 10, true, false);
					
					if (cd != number.substring(10,1).to_i())
					{
						SFForms.Utilities.MessageBox(formInstanceId, "The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", MB_ICONEXCLAMATION);
						return true;
					}

					return false;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="DC578CB299B884350BE7F5D156B3575A" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def invalid_dates(date1, date2)
	        date1 = date1.strip
	        date2 = date2.strip
	        ret = false

	        if (date1 =~ /\A(\d{2})(\d{2})(\d{2})\Z/)
		        begin_date = Time.gm($3, $1, $2)
		        if (date2 =~ /\A(\d{2})(\d{2})(\d{2})\Z/)
			        end_date = Time.gm($3, $1, $2)
			        if (end_date < begin_date)
				        messageBox("Incorrect dates have been entered. The accounting year end date cannot fall before the accounting year begin date.", "Attention!", $MB_ICONEXCLAMATION)
				        ret = true
			        end
		        end
	        end

	        return ret
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function invalid_dates(date1, date2)
				{
					date1 = date1.trim();
					date2 = date2.trim();

					var ret = false;

					var matches1 = /\A(\d{2})(\d{2})(\d{2})\Z/.exec(date1);
					if (matches1 != null && matches1.length > 0)
					{
						var begin_date = SFForms.Utilities.Time.gm(matches1[3], matches1[1], matches1[2]);
					
						var matches2 = /\A(\d{2})(\d{2})(\d{2})\Z/.exec(date2);
						if (matches2 != null && matches2.length > 0)
						{
							var end_date = SFForms.Utilities.Time.gm(matches2[3], matches2[1], matches2[2]);
					
							if (end_date < begin_date)
							{
								SFForms.Utilities.MessageBox(formInstanceId, 'Incorrect dates have been entered. The accounting year end date cannot fall before the accounting year begin date.', 'Attention!', MB_ICONEXCLAMATION);
								ret = true;
							}
						}
					}

					return ret;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="C14D29D305B0A5AEE7E02ACBC2ACB590" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def bad_taxnum(number)
	        number = number.strip
	        return false unless (number =~ /\A[13]{1}[0-9]{10}\Z/)
	
	        cd = check_digit(number[0,10], '12', 10, true, false)
	
	        if (cd != number[10,1].to_i)
		        messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
		        return true
	        end
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
      <![CDATA[
	function bad_taxnum(number) {

	// 11 digit Taxpayer Number Validation:
	//
	// If an 11 digit number that starts with a 1 or a 3, is
	// entered, the 11th digit is a CD. We compute that CD
	// ourselves, using the first 10 digits, and make sure it
	// matches the user entered one. If it does not match, we
	// popup a message box telling them that they entered an
	// invalid number.
	//
	// Returns 'false ' if number is not an 11 digit number
	// (must start with a 1 or a 3), or if it was, the CD was
	// good.
	//
	// Returns 'true' if the 11 digit number had a bad CD.

	number = number.trim();

	if (!(/^[13][0-9]{10}$/.test(number))) {
		return false;
	}

	var cd = check_digit(number.substr(0, 10), '12', 10, true, false);

	if (cd != number.substr(10, 1).to_i()) {
		SFForms.Utilities.MessageBox(formInstanceId, 'The Taxpayer Number entered is not valid. Please verify and re-enter.', 'Attention!', MB_ICONEXCLAMATION);
		return true;
	}

	return false;
}
      ]]></JavaScriptCode>
	</Block>
	<Block id="6D40A3424C3CED8C54DAD5F791266A68" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income < 0.0) then return 0 end						
	        case taxable_income						
		        when (0..10000)					
			        tax = taxable_income * 0.06				
		        when (10000.01..25000)					
			        tax = ((taxable_income - 10000.0) * 0.07) + 600.0				
		        else					
			        tax = ((taxable_income - 25000.0) * 0.0850) + 1650.0				
	        end						
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income < 0.0)
					{
						return 0;
					}
					
          var tax = 0.0;
					if (taxable_income >= 0 && taxable_income <= 10000) { tax = taxable_income * 0.06; }
					else if (taxable_income >= 10000.01 && taxable_income <= 25000) {	tax = ((taxable_income - 10000.0) * 0.07) + 600.0; }
					else { tax = ((taxable_income - 25000.0) * 0.0850) + 1650.0; }

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="FADD6561D8C255346E4B97AD3EEC4A77" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income	
		        when (0.01..10000.0): taxable_income * 0.18
            when (10000.01..20000.0): ((taxable_income - 10000.0) * 0.2) + 1800.0
            when (20000.01..40000.0): ((taxable_income - 20000.0) * 0.22) + 3800.0
            when (40000.01..60000.0): ((taxable_income - 40000.0) * 0.24) + 8200.0
            when (60000.01..80000.0): ((taxable_income - 60000.0) * 0.26) + 13000.0
            when (80000.01..100000.0): ((taxable_income - 80000.0) * 0.28) + 18200.0
            when (100000.01..150000.0): ((taxable_income - 100000.0) * 0.3) + 23800.0
            when (150000.01..250000.0): ((taxable_income - 150000.0) * 0.32) + 38800.0
            when (250000.01..500000.0): ((taxable_income - 250000.0) * 0.34) + 70800.0
            else ((taxable_income - 500000.0) * 0.35) + 155800.0				
	        end						
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					if (taxable_income >= 0.01 && taxable_income <= 10000.0)
					{
						return taxable_income * 0.18;
					}
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.0)
					{
						return ((taxable_income - 10000.0) * 0.2) + 1800.0;
					}
					else if (taxable_income >= 20000.01 && taxable_income <= 40000.0)
					{
						return ((taxable_income - 20000.0) * 0.22) + 3800.0;
					}
					else if (taxable_income >= 40000.01 && taxable_income <= 60000.0)
					{
						return ((taxable_income - 40000.0) * 0.24) + 8200.0;
					}
					else if (taxable_income >= 60000.01 && taxable_income <= 80000.0)
					{
						return ((taxable_income - 60000.0) * 0.26) + 13000.0;
					}
					else if (taxable_income >= 80000.01 && taxable_income <= 100000.0)
					{
						return ((taxable_income - 80000.0) * 0.28) + 18200.0;
					}
					else if (taxable_income >= 100000.01 && taxable_income <= 150000.0)
					{
						return ((taxable_income - 100000.0) * 0.3) + 23800.0;
					}
					else if (taxable_income >= 150000.01 && taxable_income <= 250000.0)
					{
						return ((taxable_income - 150000.0) * 0.32) + 38800.0;
					}
					else if (taxable_income >= 250000.01 && taxable_income <= 500000.0)
					{
						return ((taxable_income - 250000.0) * 0.34) + 70800.0;
					}
					else
					{
						return ((taxable_income - 500000.0) * 0.35) + 155800.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="B61BF4B25F8482149A941D895858B591" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(amount)
	        if (amount > 11350.0) then 2937.0 + ((amount - 11350.0) * 0.35)
	        elsif (amount > 8300.0) then 1930.50 + ((amount - 8300.0) * 0.33)
	        elsif (amount > 5450.0) then 1132.50 + ((amount - 5450.0) * 0.28)
	        elsif (amount > 2300.0) then 345.0 + ((amount - 2300.0) * 0.25)
	        elsif (amount > 0.0) then amount * 0.15
	        else 0.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					if (amount > 11350.0)
					{
						return 2937.0 + ((amount - 11350.0) * 0.35);
					}
					else if (amount > 8300.0)
					{
						return 1930.50 + ((amount - 8300.0) * 0.33);
					}
					else if (amount > 5450.0)
					{
						return 1132.50 + ((amount - 5450.0) * 0.28);
					}
					else if (amount > 2300.0)
					{
						return 345.0 + ((amount - 2300.0) * 0.25);
					}
					else if (amount > 0.0)
					{
						return amount * 0.15;
					}
					else
					{
						return 0.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="086E3C71621DD5C148F503BC82DF3B43" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def tax (income)

	        return '0.0' if (income <= 0.0)
	        case (income)
		        when (0.01..3899.0): (income * 0.01)
		        when (3900.0..3999.0): ((income - 3899.0) * 0.025) + 39.0
		        when (4000.0..4999.0): ((income - 3999.0) * 0.025) + 42.0
		        when (5000.0..5999.0): ((income - 4999.0) * 0.025) + 67.0
		        when (6000.0..6999.0): ((income - 5999.0) * 0.025) + 92.0
		        when (7000.0..7799.0): ((income - 6999.0) * 0.025) + 117.0
		        when (7800.0..7999.0): ((income - 7799.0) * 0.035) + 137.0
		        when (8000.0..8999.0): ((income - 7999.0) * 0.035) + 144.0
		        when (9000.0..9999.0): ((income - 8999.0) * 0.035) + 179.0
		        when (10000.0..10999.0): ((income - 9999.0) * 0.035) + 214.0
		        when (11000.0..11799.0): ((income - 10999.0) * 0.035) + 249.0
		        when (11800.0..11999.0): ((income - 11799.0) * 0.045) + 277.0
		        when (12000.0..12999.0): ((income - 11999.0) * 0.045) + 286.0
		        when (13000.0..13999.0): ((income - 12999.0) * 0.045) + 331.0
		        when (14000.0..14999.0): ((income - 13999.0) * 0.045) + 376.0
		        when (15000.0..15999.0): ((income - 14999.0) * 0.045) + 421.0
		        when (16000.0..16999.0): ((income - 15999.0) * 0.045) + 466.0
		        when (17000.0..17999.0): ((income - 16999.0) * 0.045) + 511.0
		        when (18000.0..3999.0): ((income - 17999.0) * 0.045) + 556.0
		        when (19000.0..4999.0): ((income - 18999.0) * 0.045) + 601.0
		        when (19600.0..5999.0): ((income - 19599.0) * 0.06) + 628.0
		        when (20000.0..6999.0): ((income - 19999.0) * 0.06) + 652.0
		        when (21000.0..7799.0): ((income - 20999.0) * 0.06) + 712.0
		        when (22000.0..7999.0): ((income - 21999.0) * 0.06) + 772.0
		        when (23000.0..8999.0): ((income - 22999.0) * 0.06) + 832.0
		        when (24000.0..9999.0): ((income - 23999.0) * 0.06) + 892.0
		        when (25000.0..10999.0): ((income - 24999.0) * 0.06) + 952.0
		        when (26000.0..11799.0): ((income - 25999.0) * 0.06) + 1012.0
		        when (27000.0..11999.0): ((income - 26999.0) * 0.06) + 1072.0
		        when (28000.0..12999.0): ((income - 27999.0) * 0.06) + 1132.0
		        when (29000.0..13999.0): ((income - 28999.0) * 0.06) + 1192.0
		        when (30000.0..14999.0): ((income - 29999.0) * 0.06) + 1252.0
		        when (31000.0..15999.0): ((income - 30999.0) * 0.06) + 1312.0
		        when (32000.0..16999.0): ((income - 31999.0) * 0.06) + 1372.0
		        else ((income - 32699) * 0.07 + 1414.0)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax (income)
				{
					if (income <= 0.0)
					{
						return 0.0;
					}
					
					if (income >= 0.01 && income <= 3899.0) { return (income * 0.01); }
					else if (income >= 3900.0 && income <= 3999.0) { return ((income - 3899.0) * 0.025) + 39.0; }
					else if (income >= 4000.0 && income <= 4999.0) { return ((income - 3999.0) * 0.025) + 42.0; }
					else if (income >= 5000.0 && income <= 5999.0) { return ((income - 4999.0) * 0.025) + 67.0; }
					else if (income >= 6000.0 && income <= 6999.0) { return ((income - 5999.0) * 0.025) + 92.0; }
					else if (income >= 7000.0 && income <= 7799.0) { return ((income - 6999.0) * 0.025) + 117.0; }
					else if (income >= 7800.0 && income <= 7999.0) { return ((income - 7799.0) * 0.035) + 137.0; }
					else if (income >= 8000.0 && income <= 8999.0) { return ((income - 7999.0) * 0.035) + 144.0; }
					else if (income >= 9000.0 && income <= 9999.0) { return ((income - 8999.0) * 0.035) + 179.0; }
					else if (income >= 10000.0 && income <= 10999.0) { return ((income - 9999.0) * 0.035) + 214.0; }
					else if (income >= 11000.0 && income <= 11799.0) { return ((income - 10999.0) * 0.035) + 249.0; }
					else if (income >= 11800.0 && income <= 11999.0) { return ((income - 11799.0) * 0.045) + 277.0; }
					else if (income >= 12000.0 && income <= 12999.0) { return ((income - 11999.0) * 0.045) + 286.0; }
					else if (income >= 13000.0 && income <= 13999.0) { return ((income - 12999.0) * 0.045) + 331.0; }
					else if (income >= 14000.0 && income <= 14999.0) { return ((income - 13999.0) * 0.045) + 376.0; }
					else if (income >= 15000.0 && income <= 15999.0) { return ((income - 14999.0) * 0.045) + 421.0; }
					else if (income >= 16000.0 && income <= 16999.0) { return ((income - 15999.0) * 0.045) + 466.0; }
					else if (income >= 17000.0 && income <= 17999.0) { return ((income - 16999.0) * 0.045) + 511.0; }
					else if (income >= 18000.0 && income <= 3999.0) { return ((income - 17999.0) * 0.045) + 556.0; }
					else if (income >= 19000.0 && income <= 4999.0) { return ((income - 18999.0) * 0.045) + 601.0; }
					else if (income >= 19600.0 && income <= 5999.0) { return ((income - 19599.0) * 0.06) + 628.0; }
					else if (income >= 20000.0 && income <= 6999.0) { return ((income - 19999.0) * 0.06) + 652.0; }
					else if (income >= 21000.0 && income <= 7799.0) { return ((income - 20999.0) * 0.06) + 712.0; }
					else if (income >= 22000.0 && income <= 7999.0) { return ((income - 21999.0) * 0.06) + 772.0; }
					else if (income >= 23000.0 && income <= 8999.0) { return ((income - 22999.0) * 0.06) + 832.0; }
					else if (income >= 24000.0 && income <= 9999.0) { return ((income - 23999.0) * 0.06) + 892.0; }
					else if (income >= 25000.0 && income <= 10999.0) { return ((income - 24999.0) * 0.06) + 952.0; }
					else if (income >= 26000.0 && income <= 11799.0) { return ((income - 25999.0) * 0.06) + 1012.0; }
					else if (income >= 27000.0 && income <= 11999.0) { return ((income - 26999.0) * 0.06) + 1072.0; }
					else if (income >= 28000.0 && income <= 12999.0) { return ((income - 27999.0) * 0.06) + 1132.0; }
					else if (income >= 29000.0 && income <= 13999.0) { return ((income - 28999.0) * 0.06) + 1192.0; }
					else if (income >= 30000.0 && income <= 14999.0) { return ((income - 29999.0) * 0.06) + 1252.0; }
					else if (income >= 31000.0 && income <= 15999.0) { return ((income - 30999.0) * 0.06) + 1312.0; }
					else if (income >= 32000.0 && income <= 16999.0) { return ((income - 31999.0) * 0.06) + 1372.0; }
					else { return ((income - 32699) * 0.07 + 1414.0); }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="089E1DAAE1B88593FF0AFAF5A3F38E62" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_avg_retail_sales_rate(fuel_type)
	        case (fuel_type.strip.to_i)
		        when (1): "2.534"
		        when (2): "2.831"
		        when (3): "4.486"
		        when (4): "1.938"
		        when (5): "2.498"
		        else "0.00"
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_avg_retail_sales_rate(fuel_type)
				{
					switch (fuel_type.trim().to_i())
					{
						case 1: return "2.534";
						case 2: return "2.831";
						case 3: return "4.486";
						case 4: return "1.938";
						case 5: return "2.498";
						default: "0.00";
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="4144248CCDC8E6860B7829C02F7DF3A0" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax_sch_I(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)

	        case taxable_income
		        when (0.01..2400.0): taxable_income * 0.014
		        when (2400.01..4800.0): ((taxable_income - 2400.0) * 0.032) + 34.0
		        when (4800.01..9600.0): ((taxable_income - 4800.0) * 0.055) + 110.0
		        when (9600.01..14400.0): ((taxable_income - 9600.0) * 0.064) + 374.0
		        when (14400.01..19200.0): ((taxable_income - 14400.0) * 0.068) + 682.0
		        when (19200.01..24000.0): ((taxable_income - 19200.0) * 0.072) + 1008.0
		        when (24000.01..36000.0): ((taxable_income - 24000.0) * 0.076) + 1354.0
		        when (36000.01..48000.0): ((taxable_income - 36000.0) * 0.079) + 2266.0
		        else ((taxable_income - 48000.0) * 0.0825) + 3214.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_sch_I(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2400.0) { return taxable_income * 0.014; }
					else if (taxable_income >= 2400.01 && taxable_income <= 4800.0) { return ((taxable_income - 2400.0) * 0.032) + 34.0; }
					else if (taxable_income >= 4800.01 && taxable_income <= 9600.0) { return ((taxable_income - 4800.0) * 0.055) + 110.0; }
					else if (taxable_income >= 9600.01 && taxable_income <= 14400.0) { return ((taxable_income - 9600.0) * 0.064) + 374.0; }
					else if (taxable_income >= 14400.01 && taxable_income <= 19200.0) { return ((taxable_income - 14400.0) * 0.068) + 682.0; }
					else if (taxable_income >= 19200.01 && taxable_income <= 24000.0) { return ((taxable_income - 19200.0) * 0.072) + 1008.0; }
					else if (taxable_income >= 24000.01 && taxable_income <= 36000.0) { return ((taxable_income - 24000.0) * 0.076) + 1354.0; }
					else if (taxable_income >= 36000.01 && taxable_income <= 48000.0) { return ((taxable_income - 36000.0) * 0.079) + 2266.0; }
					else { return ((taxable_income - 48000.0) * 0.0825) + 3214.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="1EFD1445C8033AD7130536AF10EB5076" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax_sch_II(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)

	        case taxable_income
		        when (0.01..4800.0): taxable_income * 0.014
		        when (4800.01..9600.0): ((taxable_income - 4800.0) * 0.032) + 67.0
		        when (9600.01..19200.0): ((taxable_income - 9600.0) * 0.055) + 221.0
		        when (19200.01..28800.0): ((taxable_income - 19200.0) * 0.064) + 749.0
		        when (28800.01..38400.0): ((taxable_income - 28800.0) * 0.068) + 1363.0
		        when (38400.01..48000.0): ((taxable_income - 38400.0) * 0.072) + 2016.0
		        when (48000.01..72000.0): ((taxable_income - 48000.0) * 0.076) + 2707.0
		        when (72000.01..96000.0): ((taxable_income - 72000.0) * 0.079) + 4531.0
		        else ((taxable_income - 96000.0) * 0.0825) + 6427.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_sch_II(taxable_income)
				{
					if (taxable_income <= 0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 4800.0) { return taxable_income * 0.014; }
					else if (taxable_income >= 4800.01 && taxable_income <= 9600.0) { return ((taxable_income - 4800.0) * 0.032) + 67.0; }
					else if (taxable_income >= 9600.01 && taxable_income <= 19200.0) { return ((taxable_income - 9600.0) * 0.055) + 221.0; }
					else if (taxable_income >= 19200.01 && taxable_income <= 28800.0) { return ((taxable_income - 19200.0) * 0.064) + 749.0; }
					else if (taxable_income >= 28800.01 && taxable_income <= 38400.0) { return ((taxable_income - 28800.0) * 0.068) + 1363.0; }
					else if (taxable_income >= 38400.01 && taxable_income <= 48000.0) { return ((taxable_income - 38400.0) * 0.072) + 2016.0; }
					else if (taxable_income >= 48000.01 && taxable_income <= 72000.0) { return ((taxable_income - 48000.0) * 0.076) + 2707.0; }
					else if (taxable_income >= 72000.01 && taxable_income <= 96000.0) { return ((taxable_income - 72000.0) * 0.079) + 4531.0; }
					else { return ((taxable_income - 96000.0) * 0.0825) + 6427.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="674FFC62FB765B6165E0FB593697BC1D" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax_sch_III(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)

	        case taxable_income
		        when (0.01..3600.0): taxable_income * 0.014
		        when (3600.01..7200.0): ((taxable_income - 3600.0) * 0.032) + 50.0
		        when (7200.01..14400.0): ((taxable_income - 7200.0) * 0.055) + 166.0
		        when (14400.01..21600.0): ((taxable_income - 14400.0) * 0.064) + 562.0
		        when (21600.01..28800.0): ((taxable_income - 21600.0) * 0.068) + 1022.0
		        when (28800.01..36000.0): ((taxable_income - 28800.0) * 0.072) + 1512.0
		        when (36000.01..54000.0): ((taxable_income - 36000.0) * 0.076) + 2030.0
		        when (54000.01..72000.0): ((taxable_income - 54000.0) * 0.079) + 3398.0
		        else ((taxable_income - 72000.0) * 0.0825) + 4820.0
	        end
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_sch_III(taxable_income)
				{
					if (taxable_income <= 0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 3600.0) { return taxable_income * 0.014; }
					else if (taxable_income >= 3600.01 && taxable_income <= 7200.0) { return ((taxable_income - 3600.0) * 0.032) + 50.0; }
					else if (taxable_income >= 7200.01 && taxable_income <= 14400.0) { return ((taxable_income - 7200.0) * 0.055) + 166.0; }
					else if (taxable_income >= 14400.01 && taxable_income <= 21600.0) { return ((taxable_income - 14400.0) * 0.064) + 562.0; }
					else if (taxable_income >= 21600.01 && taxable_income <= 28800.0) { return ((taxable_income - 21600.0) * 0.068) + 1022.0; }
					else if (taxable_income >= 28800.01 && taxable_income <= 36000.0) { return ((taxable_income - 28800.0) * 0.072) + 1512.0; }
					else if (taxable_income >= 36000.01 && taxable_income <= 54000.0) { return ((taxable_income - 36000.0) * 0.076) + 2030.0; }
					else if (taxable_income >= 54000.01 && taxable_income <= 72000.0) { return ((taxable_income - 54000.0) * 0.079) + 3398.0; }
					else { return ((taxable_income - 72000.0) * 0.0825) + 4820.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="55B1B1F44824C879C7B691499B8C2211" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax_sch_I(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)

	        case taxable_income
		        when (0.01..2400.0): taxable_income * 0.014
		        when (2400.01..4800.0): ((taxable_income - 2400.0) * 0.032) + 34.0
		        when (4800.01..9600.0): ((taxable_income - 4800.0) * 0.055) + 110.0
		        when (9600.01..14400.0): ((taxable_income - 9600.0) * 0.064) + 374.0
		        when (14400.01..19200.0): ((taxable_income - 14400.0) * 0.068) + 682.0
		        when (19200.01..24000.0): ((taxable_income - 19200.0) * 0.072) + 1008.0
		        when (24000.01..36000.0): ((taxable_income - 24000.0) * 0.076) + 1354.0
		        when (36000.01..48000.0): ((taxable_income - 36000.0) * 0.079) + 2266.0
		        when (48000.01..150000.0): ((taxable_income - 48000.0) * 0.0825) + 3214.0
		        when (150000.01..175000.0): ((taxable_income - 150000.0) * 0.09) + 11629.0
		        when (175000.01..200000.0): ((taxable_income - 175000.0) * 0.1) + 13879.0
		        else ((taxable_income - 200000.0) * 0.11) + 16379.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_sch_I(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2400.0) { return taxable_income * 0.014; }
					else if (taxable_income >= 2400.01 && taxable_income <= 4800.0) { return ((taxable_income - 2400.0) * 0.032) + 34.0; }
					else if (taxable_income >= 4800.01 && taxable_income <= 9600.0) { return ((taxable_income - 4800.0) * 0.055) + 110.0; }
					else if (taxable_income >= 9600.01 && taxable_income <= 14400.0) { return ((taxable_income - 9600.0) * 0.064) + 374.0; }
					else if (taxable_income >= 14400.01 && taxable_income <= 19200.0) { return ((taxable_income - 14400.0) * 0.068) + 682.0; }
					else if (taxable_income >= 19200.01 && taxable_income <= 24000.0) { return ((taxable_income - 19200.0) * 0.072) + 1008.0; }
					else if (taxable_income >= 24000.01 && taxable_income <= 36000.0) { return ((taxable_income - 24000.0) * 0.076) + 1354.0; }
					else if (taxable_income >= 36000.01 && taxable_income <= 48000.0) { return ((taxable_income - 36000.0) * 0.079) + 2266.0; }
					else if (taxable_income >= 48000.01 && taxable_income <= 150000.0) { return ((taxable_income - 48000.0) * 0.0825) + 3214.0; }
					else if (taxable_income >= 150000.01 && taxable_income <= 175000.0) { return ((taxable_income - 150000.0) * 0.09) + 11629.0; }
					else if (taxable_income >= 175000.01 && taxable_income <= 200000.0) { return ((taxable_income - 175000.0) * 0.1) + 13879.0; }
					else { return ((taxable_income - 200000.0) * 0.11) + 16379.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="CF31D2F10D1BA8429E0CFE0DE10ADB38" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax_sch_II(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)

	        case taxable_income
		        when (0.01..4800.0): taxable_income * 0.014
		        when (4800.01..9600.0): ((taxable_income - 4800.0) * 0.032) + 67.0
		        when (9600.01..19200.0): ((taxable_income - 9600.0) * 0.055) + 221.0
		        when (19200.01..28800.0): ((taxable_income - 19200.0) * 0.064) + 749.0
		        when (28800.01..38400.0): ((taxable_income - 28800.0) * 0.068) + 1363.0
		        when (38400.01..48000.0): ((taxable_income - 38400.0) * 0.072) + 2016.0
		        when (48000.01..72000.0): ((taxable_income - 48000.0) * 0.076) + 2707.0
		        when (72000.01..96000.0): ((taxable_income - 72000.0) * 0.079) + 4531.0
		        when (96000.01..300000.0): ((taxable_income - 96000.0) * 0.0825) + 6427.0
		        when (300000.01..350000.0): ((taxable_income - 300000.0) * 0.09) + 23257.0
		        when (350000.01..400000.0): ((taxable_income - 350000.0) * 0.1) + 27757.0
		        else ((taxable_income - 400000.0) * 0.11) + 32757.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_sch_II(taxable_income)
				{
					if ((taxable_income <= 0.0))
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 4800.0) { return taxable_income * 0.014; }
					else if (taxable_income >= 4800.01 && taxable_income <= 9600.0) { return ((taxable_income - 4800.0) * 0.032) + 67.0; }
					else if (taxable_income >= 9600.01 && taxable_income <= 19200.0) { return ((taxable_income - 9600.0) * 0.055) + 221.0; }
					else if (taxable_income >= 19200.01 && taxable_income <= 28800.0) { return ((taxable_income - 19200.0) * 0.064) + 749.0; }
					else if (taxable_income >= 28800.01 && taxable_income <= 38400.0) { return ((taxable_income - 28800.0) * 0.068) + 1363.0; }
					else if (taxable_income >= 38400.01 && taxable_income <= 48000.0) { return ((taxable_income - 38400.0) * 0.072) + 2016.0; }
					else if (taxable_income >= 48000.01 && taxable_income <= 72000.0) { return ((taxable_income - 48000.0) * 0.076) + 2707.0; }
					else if (taxable_income >= 72000.01 && taxable_income <= 96000.0) { return ((taxable_income - 72000.0) * 0.079) + 4531.0; }
					else if (taxable_income >= 96000.01 && taxable_income <= 300000.0) { return ((taxable_income - 96000.0) * 0.0825) + 6427.0; }
					else if (taxable_income >= 300000.01 && taxable_income <= 350000.0) { return ((taxable_income - 300000.0) * 0.09) + 23257.0; }
					else if (taxable_income >= 350000.01 && taxable_income <= 400000.0) { return ((taxable_income - 350000.0) * 0.1) + 27757.0; }
					else { return ((taxable_income - 400000.0) * 0.11) + 32757.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="4199358BB7F94677C6130C66834A75F2" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax_sch_III(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)

	        case taxable_income
		        when (0.01..3600.0): taxable_income * 0.014
		        when (3600.01..7200.0): ((taxable_income - 3600.0) * 0.032) + 50.0
		        when (7200.01..14400.0): ((taxable_income - 7200.0) * 0.055) + 166.0
		        when (14400.01..21600.0): ((taxable_income - 14400.0) * 0.064) + 562.0
		        when (21600.01..28800.0): ((taxable_income - 21600.0) * 0.068) + 1022.0
		        when (28800.01..36000.0): ((taxable_income - 28800.0) * 0.072) + 1512.0
		        when (36000.01..54000.0): ((taxable_income - 36000.0) * 0.076) + 2030.0
		        when (54000.01..72000.0): ((taxable_income - 54000.0) * 0.079) + 3398.0
		        when (72000.01..225000.0): ((taxable_income - 72000.0) * 0.0825) + 4820.0
		        when (225000.01..262500.0): ((taxable_income - 225000.0) * 0.09) + 17443.0
		        when (262500.01..300000.0): ((taxable_income - 262500.0) * 0.1) + 20818.0
		        else ((taxable_income - 300000.0) * 0.11) + 24568.0
	        end
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax_sch_III(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 3600.0) { return taxable_income * 0.014; }
					else if (taxable_income >= 3600.01 && taxable_income <= 7200.0) { return ((taxable_income - 3600.0) * 0.032) + 50.0; }
					else if (taxable_income >= 7200.01 && taxable_income <= 14400.0) { return ((taxable_income - 7200.0) * 0.055) + 166.0; }
					else if (taxable_income >= 14400.01 && taxable_income <= 21600.0) { return ((taxable_income - 14400.0) * 0.064) + 562.0; }
					else if (taxable_income >= 21600.01 && taxable_income <= 28800.0) { return ((taxable_income - 21600.0) * 0.068) + 1022.0; }
					else if (taxable_income >= 28800.01 && taxable_income <= 36000.0) { return ((taxable_income - 28800.0) * 0.072) + 1512.0; }
					else if (taxable_income >= 36000.01 && taxable_income <= 54000.0) { return ((taxable_income - 36000.0) * 0.076) + 2030.0; }
					else if (taxable_income >= 54000.01 && taxable_income <= 72000.0) { return ((taxable_income - 54000.0) * 0.079) + 3398.0; }
					else if (taxable_income >= 72000.01 && taxable_income <= 225000.0) { return ((taxable_income - 72000.0) * 0.0825) + 4820.0; }
					else if (taxable_income >= 225000.01 && taxable_income <= 262500.0) { return ((taxable_income - 225000.0) * 0.09) + 17443.0; }
					else if (taxable_income >= 262500.01 && taxable_income <= 300000.0) { return ((taxable_income - 262500.0) * 0.1) + 20818.0; }
					else { return ((taxable_income - 300000.0) * 0.11) + 24568.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="0867D1CC49EB730CA600C08CAA47849C" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_rate(household_income)
	        rate = if (household_income < 0.0) then '0'
		        else
			        case household_income
				        when (0.0..10684.99) then '1.00'
				        when (10685.0..11941.99) then '0.85'
				        when (11942.0..13198.99) then '0.70'
				        when (13199.0..15712.99) then '0.50'
				        when (15713.0..18226.99) then '0.35'
				        when (18227.0..20740.99) then '0.25'
				        else '0'
			        end
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_rate(household_income)
				{
					if (household_income < 0.0)
					{
						return '0';
					}
					else
					{
						if (taxable_income >= 0.0 && taxable_income <= 10684.99) { return '1.00'; }
						else if (taxable_income >= 10685.0 && taxable_income <= 11941.99) { return '0.85'; }
						else if (taxable_income >= 11942.0 && taxable_income <= 13198.99) { return '0.70'; }
						else if (taxable_income >= 13199.0 && taxable_income <= 15712.99) { return '0.50'; }
						else if (taxable_income >= 15713.0 && taxable_income <= 18226.99) { return '0.35'; }
						else if (taxable_income >= 18227.0 && taxable_income <= 20740.99) { return '0.25'; }
						else { return '0'; }
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="489D28F093DA26FE09FE632986871FAE" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)

	        case (taxable_income)
		        when (0.01..1428.0): taxable_income * 0.0036
		        when (1428.01..2856.0): ((taxable_income - 1428.0) * 0.0072) + 5.14
		        when (2856.01..5712.0): ((taxable_income - 2856.0) * 0.0243) + 15.42
		        when (5712.01..12852.0): ((taxable_income - 5712.0) * 0.045) + 84.82
		        when (12852.01..21420.0): ((taxable_income - 12852.0) * 0.0612) + 406.12
		        when (21420.01..28560.0): ((taxable_income - 21420.0) * 0.0648) + 930.48
		        when (28560.01..42840.0): ((taxable_income - 28560.0) * 0.068) + 1393.15
		        when (42840.01..64260.0): ((taxable_income - 42840.0) * 0.0792) + 2364.19
		        else ((taxable_income - 64260.0) * 0.0898) + 4060.65
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 1428.0) { return taxable_income * 0.0036; }
					else if (taxable_income >= 1428.01 && taxable_income <= 2856.0) { return ((taxable_income - 1428.0) * 0.0072) + 5.14; }
					else if (taxable_income >= 2856.01 && taxable_income <= 5712.0) { return ((taxable_income - 2856.0) * 0.0243) + 15.42; }
					else if (taxable_income >= 5712.01 && taxable_income <= 12852.0) { return ((taxable_income - 5712.0) * 0.045) + 84.82; }
					else if (taxable_income >= 12852.01 && taxable_income <= 21420.0) { return ((taxable_income - 12852.0) * 0.0612) + 406.12; }
					else if (taxable_income >= 21420.01 && taxable_income <= 28560.0) { return ((taxable_income - 21420.0) * 0.0648) + 930.48; }
					else if (taxable_income >= 28560.01 && taxable_income <= 42840.0) { return ((taxable_income - 28560.0) * 0.068) + 1393.15; }
					else if (taxable_income >= 42840.01 && taxable_income <= 64260.0) { return ((taxable_income - 42840.0) * 0.0792) + 2364.19; }
					else { return ((taxable_income - 64260.0) * 0.0898) + 4060.65; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="8D6130D75220473490BF58C83107E6CA" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1439.01)					
			        tax = taxable_income * 0.0036				
		        when (1439.01...2878.01)					
			        tax = ((taxable_income - 1439.0) * 0.0072) + 5.18		
		        when (2878.01...5756.01)					
			        tax = ((taxable_income - 2878.0) * 0.0243) + 15.54		
		        when (5756.01...12951.01)					
			        tax = ((taxable_income - 5756.0) * 0.045) + 85.48
		        when (12951.01...21585.01)					
			        tax = ((taxable_income - 12951.0) * 0.0612) + 409.26
		        when (21585.01...28780.01)					
			        tax = ((taxable_income - 21585.0) * 0.0648) + 937.66
		        when (28780.01...43170.01)					
			        tax = ((taxable_income - 28780.0) * 0.068) + 1403.90
		        when (43170.01...64755.01)					
			        tax = ((taxable_income - 46170.0) * 0.0792) + 2382.42		
		        else					
			        tax = ((taxable_income - 64755.0) * 0.0898) + 4091.95				
	        end						
	        return tax						
        end		
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
          var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1439.01)					
					{
						tax = taxable_income * 0.0036;
					}
					else if (taxable_income >= 1439.01 && taxable_income <= 2878.01)					
					{
						tax = ((taxable_income - 1439.0) * 0.0072) + 5.18;
					}
					else if (taxable_income >= 2878.01 && taxable_income <= 5756.01)					
					{
						tax = ((taxable_income - 2878.0) * 0.0243) + 15.54;
					}
					else if (taxable_income >= 5756.01 && taxable_income <= 12951.01)					
					{
						tax = ((taxable_income - 5756.0) * 0.045) + 85.48;
					}
					else if (taxable_income >= 12951.01 && taxable_income <= 21585.01)					
					{
						tax = ((taxable_income - 12951.0) * 0.0612) + 409.26;
					}
					else if (taxable_income >= 21585.01 && taxable_income <= 28780.01)					
					{
						tax = ((taxable_income - 21585.0) * 0.0648) + 937.66;
					}
					else if (taxable_income >= 28780.01 && taxable_income <= 43170.01)					
					{
						tax = ((taxable_income - 28780.0) * 0.068) + 1403.90;
					}
					else if (taxable_income >= 43170.01 && taxable_income <= 64755.01)					
					{
						tax = ((taxable_income - 46170.0) * 0.0792) + 2382.42;
					}
					else					
					{
						tax = ((taxable_income - 64755.0) * 0.0898) + 4091.95;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="94423885FAD696DD8A37257DB0A1C7C9" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_description_schF(code)

	        case (code.strip)

		        when ("50F"): "Inventory Tax"
		        when ("51F"): "Ad Valorem Natural Gas"
		        when ("52F"): "Ad Valorem Offshore Vessels"
		        when ("54F"): "Telephone Company Property"
		        when ("55F"): "Prison Industry Enhancement"
		        when ("56F"): "Urban Revitalization"
		        when ("57F"): "Mentor-Prot�g�"
		        when ("58F"): "Milk Producers"
		        when ("59F"): "Technology Commercialization"
		        when ("60F"): "Historic Residential"
		        when ("61F"): "Angel Investor"
		        when ("62F"): "Musical and Theatrical Productions"
		        when ("64F"): "Wind and Solar Energy Systems"
		        when ("65F"): "School Readiness Child Care Provider"
		        when ("66F"): "School Readiness Child Care Directors and Staff"
		        when ("67F"): "School Readiness Business-Supported Child Care"
		        when ("68F"): "School Readiness Fees and Grants to Resource and Referral Agencies"
		        when ("69F"): "Sugarcane Trailer Conversion"
		        when ("70F"): "Retention and Modernization"
		        when ("71F"): "Conversion of Vehicle to Alternative Fuel"
		        when ("72F"): "Research and Development"
		        when ("80F"): "Other Refundable Credit"
		        else ""
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_description_schF(code)
				{
					switch (code.trim())
					{
						case "50F": return  "Inventory Tax";
						case "51F": return  "Ad Valorem Natural Gas";
						case "52F": return  "Ad Valorem Offshore Vessels";
						case "54F": return  "Telephone Company Property";
						case "55F": return  "Prison Industry Enhancement";
						case "56F": return  "Urban Revitalization";
						case "57F": return  "Mentor-Protege";
						case "58F": return  "Milk Producers";
						case "59F": return  "Technology Commercialization";
						case "60F": return  "Historic Residential";
						case "61F": return  "Angel Investor";
						case "62F": return  "Musical and Theatrical Productions";
						case "64F": return  "Wind and Solar Energy Systems";
						case "65F": return  "School Readiness Child Care Provider";
						case "66F": return  "School Readiness Child Care Directors and Staff";
						case "67F": return  "School Readiness Business-Supported Child Care";
						case "68F": return  "School Readiness Fees and Grants to Resource and Referral Agencies";
						case "69F": return  "Sugarcane Trailer Conversion";
						case "70F": return  "Retention and Modernization";
						case "71F": return  "Conversion of Vehicle to Alternative Fuel";
						case "72F": return  "Research and Development";
						case "80F": return  "Other Refundable Credit";
						default: return "";
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="16D966DE01375558991640F4C3CAC92A" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_description_schG(code)

	        case (code.to_i)
		        when (100): "Premium Tax"
		        when (105): "Commercial Fishing"
		        when (110): "Family Responsibility"
		        when (115): "Small Town Doctor/Dentist"
		        when (120): "Bone Marrow"
		        when (125): "Law Enforcement Education"
		        when (130): "First Time Drug Offenders"
		        when (135): "Bulletproof Vest"
		        when (140): "Nonviolent Offenders"
		        when (150): "Qualiied Playgrounds"
		        when (155): "Debt Issuance"
		        when (175): "Donations of Materials, Equipment, Advisors, Instructors"
		        when (199): "Other"
		        when (200): "Atchafalaya Trace"
		        when (202): "Organ Donation"
		        when (204): "Household Expense for Physically and Mentally Incapable Persons"
		        when (208): "Previously Unemployed"
		        when (210): "Recycling Credit"
		        when (212): "Basic Skills Training"
		        when (220): "Dedicated Research"
		        when (224): "New Jobs Credit"
		        when (226): "Refunds by Utilities"
		        when (228): "Eligible Re-entrants"
		        when (230): "Neighborhood Assistance"
		        when (232): "Cane River Heritage"
		        when (234): "LA Community Economic Dev."
		        when (236): "Apprenticeship"
		        when (238): "Ports of Louisiana Investor"
		        when (240): "Ports of Louisiana Import Export Cargo"
		        when (251): "Motion Picture Investment"
		        when (252): "Research and Development"
		        when (253): "Historic Structures"
		        when (254): "Digital Interactive Media"
		        when (256): "Motion Picture Resident"
		        when (257): "Capital Company"
		        when (258): "LCDFI"
		        when (259): "New Markets"
		        when (260): "Brownields Investor"
		        when (261): "Motion Picture Infrastructure"
		        when (299): "Other"
		        when (300): "Biomed/University Research"
		        when (305): "Tax Equalization"
		        when (310): "Manufacturing Establishments"
		        when (315): "Enterprise Zone"
		        when (399): "Other"
		        else ""
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_description_schG(code)
				{
					switch (code.to_i())
					{
						case 100: return  "Premium Tax";
						case 105: return  "Commercial Fishing";
						case 110: return  "Family Responsibility";
						case 115: return  "Small Town Doctor/Dentist";
						case 120: return  "Bone Marrow";
						case 125: return  "Law Enforcement Education";
						case 130: return  "First Time Drug Offenders";
						case 135: return  "Bulletproof Vest";
						case 140: return  "Nonviolent Offenders";
						case 150: return  "Qualiied Playgrounds";
						case 155: return  "Debt Issuance";
						case 175: return  "Donations of Materials, Equipment, Advisors, Instructors";
						case 199: return  "Other";
						case 200: return  "Atchafalaya Trace";
						case 202: return  "Organ Donation";
						case 204: return  "Household Expense for Physically and Mentally Incapable Persons";
						case 208: return  "Previously Unemployed";
						case 210: return  "Recycling Credit";
						case 212: return  "Basic Skills Training";
						case 220: return  "Dedicated Research";
						case 224: return  "New Jobs Credit";
						case 226: return  "Refunds by Utilities";
						case 228: return  "Eligible Re-entrants";
						case 230: return  "Neighborhood Assistance";
						case 232: return  "Cane River Heritage";
						case 234: return  "LA Community Economic Dev.";
						case 236: return  "Apprenticeship";
						case 238: return  "Ports of Louisiana Investor";
						case 240: return  "Ports of Louisiana Import Export Cargo";
						case 251: return  "Motion Picture Investment";
						case 252: return  "Research and Development";
						case 253: return  "Historic Structures";
						case 254: return  "Digital Interactive Media";
						case 256: return  "Motion Picture Resident";
						case 257: return  "Capital Company";
						case 258: return  "LCDFI";
						case 259: return  "New Markets";
						case 260: return  "Brownields Investor";
						case 261: return  "Motion Picture Infrastructure";
						case 299: return  "Other";
						case 300: return  "Biomed/University Research";
						case 305: return  "Tax Equalization";
						case 310: return  "Manufacturing Establishments";
						case 315: return  "Enterprise Zone";
						case 399: return  "Other";
						default: return "";
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="E74CDCB07A891F273EBAA8F29A1B6959" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)

	        case taxable_income
		        when (0.01..10000.0): taxable_income * 0.18
		        when (10000.01..20000.0): ((taxable_income - 10000.0) * 0.2) + 1800.0
		        when (20000.01..40000.0): ((taxable_income - 20000.0) * 0.22) + 3800.0
		        when (40000.01..60000.0): ((taxable_income - 40000.0) * 0.24) + 8200.0
		        when (60000.01..80000.0): ((taxable_income - 60000.0) * 0.26) + 13000.0
		        when (80000.01..100000.0): ((taxable_income - 80000.0) * 0.28) + 18200.0
		        when (100000.01..150000.0): ((taxable_income - 100000.0) * 0.3) + 23800.0
		        when (150000.01..250000.0): ((taxable_income - 150000.0) * 0.32) + 38800.0
		        when (250000.01..500000.0): ((taxable_income - 250000.0) * 0.34) + 70800.0
		        else	((taxable_income - 500000.0) * 0.35) + 155800.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 10000.0) { return taxable_income * 0.18; }
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.0) { return ((taxable_income - 10000.0) * 0.2) + 1800.0; }
					else if (taxable_income >= 20000.01 && taxable_income <= 40000.0) { return ((taxable_income - 20000.0) * 0.22) + 3800.0; }
					else if (taxable_income >= 40000.01 && taxable_income <= 60000.0) { return ((taxable_income - 40000.0) * 0.24) + 8200.0; }
					else if (taxable_income >= 60000.01 && taxable_income <= 80000.0) { return ((taxable_income - 60000.0) * 0.26) + 13000.0; }
					else if (taxable_income >= 80000.01 && taxable_income <= 100000.0) { return ((taxable_income - 80000.0) * 0.28) + 18200.0; }
					else if (taxable_income >= 100000.01 && taxable_income <= 150000.0) { return ((taxable_income - 100000.0) * 0.3) + 23800.0; }
					else if (taxable_income >= 150000.01 && taxable_income <= 250000.0) { return ((taxable_income - 150000.0) * 0.32) + 38800.0; }
					else if (taxable_income >= 250000.01 && taxable_income <= 500000.0) { return ((taxable_income - 250000.0) * 0.34) + 70800.0; }
					else { return ((taxable_income - 500000.0) * 0.35) + 155800.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="7A89FDFBBDB8901B32A33633EDA7FB00" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_max_credit(adj_tax_estate)
	        return 0.0 unless (adj_tax_estate > 0.0)

	        case adj_tax_estate
		        when (0.0...40000.0): 0.0
		        when (40000.0...90000.0): (adj_tax_estate - 40000) * 0.008
		        when (90000.0...140000.0): ((adj_tax_estate - 90000) * 0.016) + 400.0
		        when (140000.0...240000.0): ((adj_tax_estate - 140000) * 0.024) + 1200.0
		        when (240000.0...440000.0): ((adj_tax_estate - 240000) * 0.032) + 3600.0
		        when (440000.0...640000.0): ((adj_tax_estate - 440000) * 0.04) + 10000.0
		        when (640000.0...840000.0): ((adj_tax_estate - 640000) * 0.048) + 18000.0
		        when (840000.0...1040000.0): ((adj_tax_estate - 840000) * 0.056) + 27600.0
		        when (1040000.0...1540000.0): ((adj_tax_estate - 1040000) * 0.064) + 38800.0
		        when (1540000.0...2040000.0): ((adj_tax_estate - 1540000) * 0.072) + 70800.0
		        when (2040000.0...2540000.0): ((adj_tax_estate - 2040000) * 0.08) + 106800.0
		        when (2540000.0...3040000.0): ((adj_tax_estate - 2540000) * 0.088) + 146800.0
		        when (3040000.0...3540000.0): ((adj_tax_estate - 3040000) * 0.096) + 190800.0
		        when (3540000.0...4040000.0): ((adj_tax_estate - 3540000) * 0.104) + 238800.0
		        when (4040000.0...5040000.0): ((adj_tax_estate - 4040000) * 0.112) + 290800.0
		        when (5040000.0...6040000.0): ((adj_tax_estate - 5040000) * 0.12) + 402800.0
		        when (6040000.0...7040000.0): ((adj_tax_estate - 6040000) * 0.128) + 522800.0
		        when (7040000.0...8040000.0): ((adj_tax_estate - 7040000) * 0.136) + 650800.0
		        when (8040000.0...9040000.0): ((adj_tax_estate - 8040000) * 0.144) + 786800.0
		        when (9040000.0...10040000.0): ((adj_tax_estate - 9040000) * 0.152) + 930800.0
		        else ((adj_tax_estate - 10040000.0) * 0.16) + 1082800.0	
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_max_credit(adj_tax_estate)
				{
					if (adj_tax_estate <= 0.0)
					{
						return 0.0;
					}

					if (adj_tax_estate >= 0.0 && adj_tax_estate <= 40000.0) { return 0.0; }
					else if (adj_tax_estate >= 40000.0 && adj_tax_estate <= 90000.0) { return (adj_tax_estate - 40000) * 0.008; }
					else if (adj_tax_estate >= 90000.0 && adj_tax_estate <= 140000.0) { return ((adj_tax_estate - 90000) * 0.016) + 400.0; }
					else if (adj_tax_estate >= 140000.0 && adj_tax_estate <= 240000.0) { return ((adj_tax_estate - 140000) * 0.024) + 1200.0; }
					else if (adj_tax_estate >= 240000.0 && adj_tax_estate <= 440000.0) { return ((adj_tax_estate - 240000) * 0.032) + 3600.0; }
					else if (adj_tax_estate >= 440000.0 && adj_tax_estate <= 640000.0) { return ((adj_tax_estate - 440000) * 0.04) + 10000.0; }
					else if (adj_tax_estate >= 640000.0 && adj_tax_estate <= 840000.0) { return ((adj_tax_estate - 640000) * 0.048) + 18000.0; }
					else if (adj_tax_estate >= 840000.0 && adj_tax_estate <= 1040000.0) { return ((adj_tax_estate - 840000) * 0.056) + 27600.0; }
					else if (adj_tax_estate >= 1040000.0 && adj_tax_estate <= 1540000.0) { return ((adj_tax_estate - 1040000) * 0.064) + 38800.0; }
					else if (adj_tax_estate >= 1540000.0 && adj_tax_estate <= 2040000.0) { return ((adj_tax_estate - 1540000) * 0.072) + 70800.0; }
					else if (adj_tax_estate >= 2040000.0 && adj_tax_estate <= 2540000.0) { return ((adj_tax_estate - 2040000) * 0.08) + 106800.0; }
					else if (adj_tax_estate >= 2540000.0 && adj_tax_estate <= 3040000.0) { return ((adj_tax_estate - 2540000) * 0.088) + 146800.0; }
					else if (adj_tax_estate >= 3040000.0 && adj_tax_estate <= 3540000.0) { return ((adj_tax_estate - 3040000) * 0.096) + 190800.0; }
					else if (adj_tax_estate >= 3540000.0 && adj_tax_estate <= 4040000.0) { return ((adj_tax_estate - 3540000) * 0.104) + 238800.0; }
					else if (adj_tax_estate >= 4040000.0 && adj_tax_estate <= 5040000.0) { return ((adj_tax_estate - 4040000) * 0.112) + 290800.0; }
					else if (adj_tax_estate >= 5040000.0 && adj_tax_estate <= 6040000.0) { return ((adj_tax_estate - 5040000) * 0.12) + 402800.0; }
					else if (adj_tax_estate >= 6040000.0 && adj_tax_estate <= 7040000.0) { return ((adj_tax_estate - 6040000) * 0.128) + 522800.0; }
					else if (adj_tax_estate >= 7040000.0 && adj_tax_estate <= 8040000.0) { return ((adj_tax_estate - 7040000) * 0.136) + 650800.0; }
					else if (adj_tax_estate >= 8040000.0 && adj_tax_estate <= 9040000.0) { return ((adj_tax_estate - 8040000) * 0.144) + 786800.0; }
					else if (adj_tax_estate >= 9040000.0 && adj_tax_estate <= 10040000.0) { return ((adj_tax_estate - 9040000) * 0.152) + 930800.0; }
					else { return ((adj_tax_estate - 10040000.0) * 0.16) + 1082800.0	; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="89E7CED2706980B197B44367506CCF1F" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def single_tax(value)
	        return 0.0 if (value <= 0.0)
	        case value
		        when (0.01..22770.0) then 0.0535 * value
		        when (22770.01..74780.0) then 1218.20 + 0.0705 * (value - 22770.0)
		        else 4884.91 + 0.0785 * (value - 74780.0)
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function single_tax(value)
				{
					if (value <= 0.0)
					{
						return 0.0;
					}
					
					if (taxable_income >= 0.01 && taxable_income <= 22770.0) { return 0.0535 * value; }
					else if (taxable_income >= 22770.01 && taxable_income <= 74780.0) { return 1218.20 + 0.0705 * (value - 22770.0); }
					else { return 4884.91 + 0.0785 * (value - 74780.0); }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="ED073A4DEB4F23DA7EB4A2B8BB4358D9" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        return 0.0 if (taxable_income <= 0.0)

	        case taxable_income
		        when (0.01..2600.0): taxable_income * 0.01
		        when (2600.01..4600.0): ((taxable_income * 0.02 ) - 26.0)
		        when (4600.01..6900.0): ((taxable_income * 0.03) - 72.0)
		        when (6900.01..9400.0): ((taxable_income * 0.04) - 141.0)
		        when (9400.01..12100.0): ((taxable_income * 0.05 ) - 235.0)
		        when (12100.01..15600.0): ((taxable_income * 0.06) - 356.0)
		        else ((taxable_income * 0.069) - 496.0)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2600.0) { return taxable_income * 0.01; }
					else if (taxable_income >= 2600.01 && taxable_income <= 4600.0) { return ((taxable_income * 0.02 ) - 26.0); }
					else if (taxable_income >= 4600.01 && taxable_income <= 6900.0) { return ((taxable_income * 0.03) - 72.0); }
					else if (taxable_income >= 6900.01 && taxable_income <= 9400.0) { return ((taxable_income * 0.04) - 141.0); }
					else if (taxable_income >= 9400.01 && taxable_income <= 12100.0) { return ((taxable_income * 0.05 ) - 235.0); }
					else if (taxable_income >= 12100.01 && taxable_income <= 15600.0) { return ((taxable_income * 0.06) - 356.0); }
					else { return ((taxable_income * 0.069) - 496.0); }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="CB2A3510A3DA6BAF8561845E113EECAC" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(amount)
	        amount = amount.to_f
	        return 0.0 unless (amount > 0.0)

	        case (amount)
		        when (0.01..2600.0): (amount * 0.01)
		        when (2600.01..4600.0): (amount * 0.02) - 26.0
		        when (4600.01..6900.0): (amount * 0.03) - 72.0
		        when (6900.01..9400.0): (amount * 0.04) - 141.0
		        when (9400.01..12100.0): (amount * 0.05) - 235.0
		        when (12100.01..15600.0): (amount * 0.06) - 356.0
		        else (amount * 0.069) - 496.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2600.0) { return (amount * 0.01); }
					else if (taxable_income >= 2600.01 && taxable_income <= 4600.0) { return (amount * 0.02) - 26.0; }
					else if (taxable_income >= 4600.01 && taxable_income <= 6900.0) { return (amount * 0.03) - 72.0; }
					else if (taxable_income >= 6900.01 && taxable_income <= 9400.0) { return (amount * 0.04) - 141.0; }
					else if (taxable_income >= 9400.01 && taxable_income <= 12100.0) { return (amount * 0.05) - 235.0; }
					else if (taxable_income >= 12100.01 && taxable_income <= 15600.0) { return (amount * 0.06) - 356.0; }
					else { return (amount * 0.069) - 496.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="1C0C4717787EF521203BDBF6D7B836B7" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        tax = case taxable_income						
			        when (0.01..2600.0) then taxable_income * 0.01				
			        when (2600.01..4600.0) then ((taxable_income * 0.02 ) - 26.0)				
			        when (4600.01..6900.0) then ((taxable_income * 0.03) - 72.0)				
			        when (6900.01..9400.0) then ((taxable_income * 0.04) - 141.0)	
			        when (9400.01..12100.0) then ((taxable_income * 0.05) - 235.0)				
			        when (12100.01..15600.0) then ((taxable_income * 0.06) - 356.0)				
			        else ((taxable_income * 0.069) - 496.0)
		        end			
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;

					if (taxable_income >= 0.01 && taxable_income <= 2600.0) { tax = taxable_income * 0.01; }
					else if (taxable_income >= 2600.01 && taxable_income <= 4600.0) { tax = ((taxable_income * 0.02 ) - 26.0); }
					else if (taxable_income >= 4600.01 && taxable_income <= 6900.0) { tax = ((taxable_income * 0.03) - 72.0); }			
					else if (taxable_income >= 6900.01 && taxable_income <= 9400.0) { tax = ((taxable_income * 0.04) - 141.0); }
					else if (taxable_income >= 9400.01 && taxable_income <= 12100.0) { tax = ((taxable_income * 0.05) - 235.0); }
					else if (taxable_income >= 12100.01 && taxable_income <= 15600.0) { tax = ((taxable_income * 0.06) - 356.0); }
					else { tax = ((taxable_income * 0.069) - 496.0); }
						
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="9B0E49D3F00189501F36BCCA68BB7525" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_amount)
	        tax =	if (taxable_amount > 15600.0)
			        taxable_amount * 0.069 - 496.0
		        elsif (taxable_amount > 12100.0)
			        taxable_amount * 0.06 - 356.0
		        elsif (taxable_amount > 9400.0)
			        taxable_amount * 0.05 - 235.0
		        elsif (taxable_amount > 6900.0)
			        taxable_amount * 0.04 - 141.0
		        elsif (taxable_amount > 4600.0)
			        taxable_amount * 0.03 - 72.0
		        elsif (taxable_amount > 2600.0)
			        taxable_amount * 0.02 - 26.0
		        elsif (taxable_amount > 0.0)
			        taxable_amount * 0.01
		        else 0.0
		        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_amount)
				{
					if (taxable_amount > 15600.0)
					{
						return taxable_amount * 0.069 - 496.0;
					}
					else if (taxable_amount > 12100.0)
					{
						return taxable_amount * 0.06 - 356.0;
					}
					else if (taxable_amount > 9400.0)
					{
						return taxable_amount * 0.05 - 235.0;
					}
					else if (taxable_amount > 6900.0)
					{
						return taxable_amount * 0.04 - 141.0;
					}
					else if (taxable_amount > 4600.0)
					{
						return taxable_amount * 0.03 - 72.0;
					}
					else if (taxable_amount > 2600.0)
					{
						return taxable_amount * 0.02 - 26.0;
					}
					else if (taxable_amount > 0.0)
					{
						return taxable_amount * 0.01;
					}
					else
					{
						return 0.0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="7624BD0617616961507F7C1FA851778C" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def amap_1(a)
	        case (a)
		        when ("&"): 36
		        when ("0".."9"): a.to_i
		        when ("A".."Z"): a[0] - 55
		        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function amap_1(a)
				{
					if (a == "&") { return 36; }
					else if (a >= "0" && a <= "9") { return a.to_i(); }
					else if (a >= "A" && a <= "Z") { return a.charCodeAt(0) - 55; }
					else { return 0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="BAE3F92DBB3BCDBCBFF3EEC3E751EFBF" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def tax(amount)
	        return '00' if (amount < 0.0)
	        case (amount)
	        when (0.01..5050.0): (amount * 0.0587)
	        when (5050.0..10100.0): ((amount - 5050.0) * 0.01174) + 29.64
	        when (10100.0..15150.0): ((amount - 10100.0) * 0.02348) + 88.93
	        when (15150.0..20200.0): ((amount - 15150.0) * 0.02935) + 207.5
	        when (20200.0..40350.0): ((amount - 20200.0) * 0.03521) + 355.72
	        when (40350.0..80700.0): ((amount - 40350.0) * 0.04109) + 1065.2
	        when (80700.0..100900.0): ((amount - 80700.0) * 0.04695) + 2723.19
	        when (100900.0..201800.0): ((amount - 100900.0) * 0.05451) + 3671.58
	        else ((amount - 201800.0) * 0.05925) + 9171.63
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					if (amount < 0.0)
					{
						return 0;
					}
					
					if (amount >= 0.01 && amount <= 5050.0) { return (amount * 0.0587); }
					else if (amount >= 5050.0 && amount <= 10100.0) { return ((amount - 5050.0) * 0.01174) + 29.64; }
					else if (amount >= 10100.0 && amount <= 15150.0) { return ((amount - 10100.0) * 0.02348) + 88.93; }
					else if (amount >= 15150.0 && amount <= 20200.0) { return ((amount - 15150.0) * 0.02935) + 207.5; }
					else if (amount >= 20200.0 && amount <= 40350.0) { return ((amount - 20200.0) * 0.03521) + 355.72; }
					else if (amount >= 40350.0 && amount <= 80700.0) { return ((amount - 40350.0) * 0.04109) + 1065.2; }
					else if (amount >= 80700.0 && amount <= 100900.0) { return ((amount - 80700.0) * 0.04695) + 2723.19; }
					else if (amount >= 100900.0 && amount <= 201800.0) { return ((amount - 100900.0) * 0.05451) + 3671.58; }
					else { return ((amount - 201800.0) * 0.05925) + 9171.63; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="AF55E53B28400EFB7DF9D9CBB1A7F5D6" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(a)
	        a = a.to_f
	        (a > 250000.0 ? (a - 250000.0) * 0.079 : 0) + (a > 0.0 ? [a, 250000.0].min * 0.066 : 0)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(a)
				{
					a = a.to_f();
					return (a > 250000.0 ? (a - 250000.0) * 0.079 : 0) + (a > 0.0 ? Math.min.apply(null, [a, 250000.0]) * 0.066 : 0);
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="F538225B14E160FFB338857F20019D33" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def percentage(result)
	        return '00' if (result < 0.0)
	        case (result)
		        when (1): '8000'
		        when (2): '6000'
		        when (3): '4000'
		        when (4): '2000'
		        else '00'
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function percentage(result)
				{
					if (result < 0.0)
					{
						return '00';
					}
					
					switch (result)
					{
						case 1: return '8000';
						case 2: return '6000';
						case 3: return '4000';
						case 4: return '2000';
						default: return '00';
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="CBB8B8B748772FD5E259D7BA1DA0E037" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def invalid_dates(date1, date2)

	        date1 = date1.strip
	        date2 = date2.strip

	        ret = false

	        if (date1 =~ /^(\d{2})(\d{2})(\d{2})$/)
		        begin_date = Time.gm($3, $1, $2)
	
		        if (date2 =~ /^(\d{2})(\d{2})(\d{2})$/)
			        end_date = Time.gm($3, $1, $2)
	
			        if (end_date < begin_date)
				        messageBox("Incorrect dates have been entered. The Affiliate reporting end date cannot fall before the Affiliate reporting begin date.", "Attention!", $MB_ICONEXCLAMATION)
				        ret = true
			        end
		        end
	        end

	        return ret
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function invalid_dates(date1, date2)
				{
					date1 = date1.trim();
					date2 = date2.trim();

					var ret = false;

					var matches1 = /^(\d{2})(\d{2})(\d{2})$/.exec(date1);
					if (matches1 != null && matches1.length > 0)
					{
						var begin_date = SFForms.Utilities.Time.gm(matches1[3], matches1[1], matches1[2]);
					
						var matches2 = /^(\d{2})(\d{2})(\d{2})$/.exec(date2);
						if (matches2 != null && matches2.length > 0)
						{
							var end_date = SFForms.Utilities.Time.gm(matches2[3], matches2[1], matches2[2]);
					
							if (end_date < begin_date)
							{
								SFForms.Utilities.MessageBox(formInstanceId, 'Incorrect dates have been entered. The Affiliate reporting end date cannot fall before the Affiliate reporting begin date.', 'Attention!', MB_ICONEXCLAMATION);
								ret = true;
							}
						}
					}

					return ret;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="A95702B39AE377A7579515E26274F710" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')

		        if (business and !profile.business_name.strip.empty?)

			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else


			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name +

			        if( !profile.married_joint.strip.empty? )
				        ' & ' + (profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name)
			        else
				        ''
			        end

			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'

		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'

		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	

	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
        function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
	          // Decide if profile's business or personal information should be used.
	          if (business && !profile.business_name.trim().isEmpty())
	          {
		        // Use business information.
		        name = profile.business_name;
		        if (profile.business_address.trim().isEmpty())
		        {
		          address1 = profile.address;
		          if (!profile.apartment_number.trim().isEmpty())
		          {
			        address2 = 'Apt. #' + profile.apartment_number;
		          }
		          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
		        }
		        else
		        {
					    address1 = profile.business_address;
					    address2 = profile.business_address2;
					    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
		        }
	          }
	          else
	          {
				      // Using personal information.
				      // NOTE: THE INDIVIDUAL NAME SECTION BELOW HAS BEEN MODIFIED TO FLOW SPOUSE NAME IF JOINT.
				      name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				      //CHECK FOR SPOUSE.
				      if( !profile.married_joint.trim().isEmpty() )
					    {
                name += ' & ' + (profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name);
				      }
				      // END CHECK FOR SPOUSE.

				      address1 = profile.address;
				      if (!profile.apartment_number.trim().isEmpty())
				      {
					      address2 = 'Apt. #' + profile.apartment_number;
				      }
		          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	          }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
	          name = profile.name;
	          address1 = profile.address;
	          address2 = profile.address2;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
	          // Use Firm name if available 
	          if (!profile.firm_name.trim().isEmpty())
	          {
		        name = profile.firm_name;
	          }
	          else
	          {
		        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
	          }
	          address1 = profile.address;
	          address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
	          // Use entity name if available.
	          if (profile.applicant_entity_name.trim().isEmpty())
	          {
		        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
	          }
	          else
	          {
		        name = profile.applicant_entity_name;
	          }
	          address1 = profile.applicant_address;
	          if (!profile.applicant_po_box.trim().isEmpty())
	          {
		        address2 = 'P.O. Box ' + profile.applicant_po_box;
	          }
	          address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		        name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		        name = name.squeeze(' ').trim();
		        address1 = '';
		        address2 = '';
		        address3 = '';
		        break;
	          case 2:
		        address1 += ' ' + address2 + ' ' + address3;
		        address1 = address1.squeeze(' ').trim();
		        address2 = '';
		        address3 = '';
		        break;
	          case 3:
		        address1 += ' ' + address2;
		        address1 = address1.squeeze(' ').trim();
		        address2 = address3;
		        address3 = '';
		        break;
	          case 4:
		        if (address2.isEmpty())
		        {
		          address2 = address3;
		          address3 = '';
		        }
		        break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]></JavaScriptCode>
	</Block>
	<Block id="ED36682BAB1C3CD8AD6562F6243CAC29" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_year(month)

	        case (month)
	
		        when (1): ["11604","11606","11609","11701"]
		        when (2): ["11605","11607","11610","11702"]
		        when (3): ["11606","11608","11611","11703"]
		        when (4): ["11607","11609","11612","11704"]
		        when (5): ["11608","11610","11701","11705"]
		        when (6): ["11609","11611","11702","11706"]
		        when (7): ["11610","11612","11703","11707"]
		        when (8): ["11611","11701","11704","11708"]
		        when (9): ["11612","11702","11705","11709"]
		        when (10): ["11701","11703","11706","11710"]
		        when (11): ["11702","11704","11707","11711"]
		        when (12): ["11703", "11705","11708","11712"]
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_year(month)
				{
					// A 2 digit month:
					switch (month)
					{
						case 1: return ["11604","11606","11609","11701"];
						case 2: return ["11605","11607","11610","11702"];
						case 3: return ["11606","11608","11611","11703"];
						case 4: return ["11607","11609","11612","11704"];
						case 5: return ["11608","11610","11701","11705"];
						case 6: return ["11609","11611","11702","11706"];
						case 7: return ["11610","11612","11703","11707"];
						case 8: return ["11611","11701","11704","11708"];
						case 9: return ["11612","11702","11705","11709"];
						case 10: return ["11701","11703","11706","11710"];
						case 11: return ["11702","11704","11707","11711"];
						case 12: return ["11703", "11705","11708","11712"];
					}
				}      
      ]]></JavaScriptCode>
	</Block>
	<Block id="B038CDD2CC971669142B888FD24BE709" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case taxable_income	
		        when (0.01..3000.0): taxable_income * 0.02
		        when (3000.01..5000.0): ((taxable_income - 3000.0) * 0.03) + 60.0
		        when (5000.01..17000.0): ((taxable_income - 5000.0) * 0.05) + 120.0
		        else ((taxable_income - 17000.0) * 0.0575) + 720.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 3000.0) { return taxable_income * 0.02; }
					else if (taxable_income >= 3000.01 && taxable_income <= 5000.0) { return ((taxable_income - 3000.0) * 0.03) + 60.0; }
					else if (taxable_income >= 5000.01 && taxable_income <= 17000.0) { return ((taxable_income - 5000.0) * 0.05) + 120.0; }
					else { return ((taxable_income - 17000.0) * 0.0575) + 720.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="32D743FE3AB36141FB18DE6F12072E1A" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def percentage(result)
	        return '0000' if (result < 0.0)
	        case (result)
		        when (1): '8000'
		        when (2): '6000'
		        when (3): '4000'
		        when (4): '2000'
		        else '0000'
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function percentage(result)
				{
					if (result < 0.0)
					{
						return '0000';
					}
					
					switch (result)
					{
						case 1: return '8000';
						case 2: return '6000';
						case 3: return '4000';
						case 4: return '2000'; 
						default: return '0000'; 
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="AEBC721FDC72B10B297118B811DFB20C" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(a)
	        a = a.to_f
	        (a > 1000000.0 ? (a - 1000000.0) * 0.076 + 66000.0 : 0) + (a > 0.0 ? [a, 1000000.0].min * 0.066 : 0)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(a)
				{
					a = a.to_f();
					
					return (a > 1000000.0 ? (a - 1000000.0) * 0.076 + 66000.0 : 0) + (a > 0.0 ? Math.min.apply(null, [a, 1000000.0]) * 0.066 : 0);
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="7ED8442F15F9419D4872040E9A666F18" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)

	        return 0.0 unless (taxable_income > 0.0)

	        case (taxable_income)
		        when (0.01..5200.0): taxable_income * 0.00495
		        when (5200.01..10400.0): ((taxable_income - 5200.0) * 0.00990) + 25.74
		        when (10400.01..15650.0): ((taxable_income - 10400.0) * 0.01980) + 77.22
		        when (15650.01..20900.0): ((taxable_income - 15650.0) * 0.02476) + 181.17
		        when (20900.01..41700.0): ((taxable_income - 20900.0) * 0.02969) + 311.16
		        when (41700.01..83350.0): ((taxable_income - 41700.0) * 0.03465) + 928.71
		        when (83350.01..104250.0): ((taxable_income - 83350.0) * 0.03960) + 2371.88
		        when (104250.01..208500.0): ((taxable_income - 104250.0) * 0.04597) + 3199.52
		        else ((taxable_income - 208500.0) * 0.04997) + 7991.89
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 5200.0) { return taxable_income * 0.00495; }
					else if (taxable_income >= 5200.01 && taxable_income <= 10400.0) { return ((taxable_income - 5200.0) * 0.00990) + 25.74; }
					else if (taxable_income >= 10400.01 && taxable_income <= 15650.0) { return ((taxable_income - 10400.0) * 0.01980) + 77.22; }
					else if (taxable_income >= 15650.01 && taxable_income <= 20900.0) { return ((taxable_income - 15650.0) * 0.02476) + 181.17; }
					else if (taxable_income >= 20900.01 && taxable_income <= 41700.0) { return ((taxable_income - 20900.0) * 0.02969) + 311.16; }
					else if (taxable_income >= 41700.01 && taxable_income <= 83350.0) { return ((taxable_income - 41700.0) * 0.03465) + 928.71; }
					else if (taxable_income >= 83350.01 && taxable_income <= 104250.0) { return ((taxable_income - 83350.0) * 0.03960) + 2371.88; }
					else if (taxable_income >= 104250.01 && taxable_income <= 208500.0) { return ((taxable_income - 104250.0) * 0.04597) + 3199.52; }
					else { return ((taxable_income - 208500.0) * 0.04997) + 7991.89; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="69F4674608D4528E404936080BF70D8E" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def amap(a)
	        case (a)
		        when ("0".."9"): a.to_i
		        when ("A".."Z"): a[0] - 55
		        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
        <![CDATA[
				function amap(a)
				{
					if (a >= "0" && a <= "9") { return a.to_i(); }
					else if (a >= "A" && a <= "Z") { return a.charCodeAt(0) - 55; }
					else { return 0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="22097C19A1928C528D0AD479EE9D99E2" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def amap_1(a)
	        case (a)
		        when ("0".."9"): a.to_i
		        when ("A".."Z"): a[0] - 55
		        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
        <![CDATA[
				function amap_1(a)
				{
					if (a >= "0" && a <= "9") { return a.to_i(); }
					else if (a >= "A" && a <= "Z") { return a.charCodeAt(0) - 55; }
					else { return 0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="FBBDD5D657E5F36A20A1695E7FE8E4DA" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def credit_rate(percent)
	        if( percent < 101.0 ): 0.0
	        elsif( percent < 102.0 ): 0.015
	        elsif( percent < 103.0 ): 0.02
	        else 0.025
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function credit_rate(percent)
				{
					if ( percent < 101.0 ) { return 0.0; }
					else if ( percent < 102.0 ) { return 0.015; }
					else if ( percent < 103.0 ) { return 0.02; }
					else { return 0.025; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="BABD783386C713CE4AFF3866943915A4" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def tax(amount)
	        if( amount > 1062650.0 ) then 71873.0 + ( amount - 1062650.0 ) * 0.0882
	        elsif( amount > 212500.0 ) then 13637.0 + ( amount - 212500.0 ) * 0.0685
	        elsif( amount > 79600.0 ) then 4800.0 + ( amount - 79600.0 ) * 0.0665
	        elsif( amount > 21150.0 ) then 1029.0 + ( amount - 21150.0 ) * 0.0645
	        elsif( amount > 13750.0 ) then 593.0 + ( amount - 13750.0 ) * 0.059
	        elsif( amount > 11600.0 ) then 480.0 + ( amount - 11600.0 ) * 0.0525
	        elsif( amount > 8400.0 ) then 336.0 + ( amount - 8400.0 ) * 0.045
	        elsif( amount > 0.0 ) then amount * 0.04
	        else 0.0
	        end
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					if ( amount > 1062650.0 ) { return 71873.0 + ( amount - 1062650.0 ) * 0.0882; }
					else if ( amount > 212500.0 ) { return 13637.0 + ( amount - 212500.0 ) * 0.0685; }
					else if ( amount > 79600.0 ) { return 4800.0 + ( amount - 79600.0 ) * 0.0665; }
					else if ( amount > 21150.0 ) { return 1029.0 + ( amount - 21150.0 ) * 0.0645; }
					else if ( amount > 13750.0 ) { return 593.0 + ( amount - 13750.0 ) * 0.059; }
					else if ( amount > 11600.0 ) { return 480.0 + ( amount - 11600.0 ) * 0.0525; }
					else if ( amount > 8400.0 ) { return 336.0 + ( amount - 8400.0 ) * 0.045; }
					else if ( amount > 0.0 ) { return amount * 0.04; }
					else { return 0.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="58B03B61D5DEF9D16DE0345AD3E4FC80" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(income)
	
	        return 0.0 if (income <= 0)
	        case (income)
		        when (0.01..8400.0): (income * 0.04)
		        when (8400.01..11600.0): ((income - 8400) * 0.045 + 336.0)
		        when (11600.01..13750.0): ((income - 11600) * 0.0525 + 480.0)
		        when (13750.01..21150.0): ((income -13750) * 0.059 + 593.0)
		        when (21150.01..79600.0): ((income -21150) * 0.0645 + 1029.0)
		        when (79600.01..212500.0): ((income -79600) * 0.0665 + 4800.0)	
		        when (212500.01..1062650.0): ((income -212500) * 0.0685 + 13637.0)
		        else ((income - 1062650.0) * 0.0882 + 71873.0)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(income)
				{
					if (income <= 0)
					{
						return 0.0;
					}
					
					if (income >= 0.01 && income <= 8400.0) { return (income * 0.04); }
					else if (income >= 8400.01 && income <= 11600.0) { return ((income - 8400) * 0.045 + 336.0); }
					else if (income >= 11600.01 && income <= 13750.0) { return ((income - 11600) * 0.0525 + 480.0); }
					else if (income >= 13750.01 && income <= 21150.0) { return ((income -13750) * 0.059 + 593.0); }
					else if (income >= 21150.01 && income <= 79600.0) { return ((income -21150) * 0.0645 + 1029.0); }
					else if (income >= 79600.01 && income <= 212500.0) { return ((income -79600) * 0.0665 + 4800.0)	; }
					else if (income >= 212500.01 && income <= 1062650.0) { return ((income -212500) * 0.0685 + 13637.0); }
					else { return ((income - 1062650.0) * 0.0882 + 71873.0); }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="261FE3E172BA592A45F9F2DB4656B2EF" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)
	        if (taxable_income <= 0.0) then return 0.0 end

	        tax = case taxable_income		
			        when (0.01..500000.0) then taxable_income * 0.0306
			        when (500000.01..1000000.0) then ((taxable_income - 500000.0) * 0.05) + 15300.0
			        when (1000000.01..1500000.0) then ((taxable_income - 1000000.0) * 0.055) + 40300.0
			        when (1500000.01..2100000.0) then ((taxable_income - 1500000.0) * 0.065) + 67800.0
			        when (2100000.01..2600000.0) then ((taxable_income - 2100000.0) * 0.08) + 106800.0
			        when (2600000.01..3100000.0) then ((taxable_income - 2600000.0) * 0.088) + 146800.0
			        when (3100000.01..3600000.0) then ((taxable_income - 3100000.0) * 0.096) + 190800.0
			        when (3600000.01..4100000.0) then ((taxable_income - 3600000.0) * 0.104) + 238800.0
			        when (4100000.01..5100000.0) then ((taxable_income - 4100000.0) * 0.112) + 290800.0
			        when (5100000.01..6100000.0) then ((taxable_income - 5100000.0) * 0.12) + 402800.0
			        when (6100000.01..7100000.0) then ((taxable_income - 6100000.0) * 0.128) + 522800.0
			        when (7100000.01..8100000.0) then ((taxable_income - 7100000.0) * 0.136) + 650800.0
			        when (8100000.01..9100000.0) then ((taxable_income - 8100000.0) * 0.144) + 786800.0
			        when (9100000.01..10100000.0) then ((taxable_income - 9100000.0) * 0.152) + 930800.0
			        else ((taxable_income - 10100000.0) * 0.16) + 1082800.0
		        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					// Over the Lower range, but not over the upper range value.
					if (taxable_income >= 0.01 && taxable_income <= 500000.0) { return taxable_income * 0.0306; }
					else if (taxable_income >= 500000.01 && taxable_income <= 1000000.0) { return ((taxable_income - 500000.0) * 0.05) + 15300.0; }
					else if (taxable_income >= 1000000.01 && taxable_income <= 1500000.0) { return ((taxable_income - 1000000.0) * 0.055) + 40300.0; }
					else if (taxable_income >= 1500000.01 && taxable_income <= 2100000.0) { return ((taxable_income - 1500000.0) * 0.065) + 67800.0; }
					else if (taxable_income >= 2100000.01 && taxable_income <= 2600000.0) { return ((taxable_income - 2100000.0) * 0.08) + 106800.0; }
					else if (taxable_income >= 2600000.01 && taxable_income <= 3100000.0) { return ((taxable_income - 2600000.0) * 0.088) + 146800.0; }
					else if (taxable_income >= 3100000.01 && taxable_income <= 3600000.0) { return ((taxable_income - 3100000.0) * 0.096) + 190800.0; }
					else if (taxable_income >= 3600000.01 && taxable_income <= 4100000.0) { return ((taxable_income - 3600000.0) * 0.104) + 238800.0; }
					else if (taxable_income >= 4100000.01 && taxable_income <= 5100000.0) { return ((taxable_income - 4100000.0) * 0.112) + 290800.0; }
					else if (taxable_income >= 5100000.01 && taxable_income <= 6100000.0) { return ((taxable_income - 5100000.0) * 0.12) + 402800.0; }
					else if (taxable_income >= 6100000.01 && taxable_income <= 7100000.0) { return ((taxable_income - 6100000.0) * 0.128) + 522800.0; }
					else if (taxable_income >= 7100000.01 && taxable_income <= 8100000.0) { return ((taxable_income - 7100000.0) * 0.136) + 650800.0; }
					else if (taxable_income >= 8100000.01 && taxable_income <= 9100000.0) { return ((taxable_income - 8100000.0) * 0.144) + 786800.0; }
					else if (taxable_income >= 9100000.01 && taxable_income <= 10100000.0) { return ((taxable_income - 9100000.0) * 0.152) + 930800.0; }
					else { return ((taxable_income - 10100000.0) * 0.16) + 1082800.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="01C3C1CFCE666815D0CBAE43C31719BF" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def state_decimal(taxable_income)
	        if (taxable_income <= 0.0) then return 1.0 end
	        tax = case taxable_income		
			        when (0.01..22000.0) then '1.0'		
			        when (22000.01..23000.0) then '0.9'
			        when (23000.01..24000.0) then '0.8'			
			        when (24000.01..25000.0) then '0.7'
			        when (25000.01..26000.0) then '0.6'
			        when (26000.01..27000.0) then '0.5'
			        when (27000.01..28000.0) then '0.4'
			        when (28000.01..29000.0) then '0.3'
			        else ''
		        end
	        return tax						
        end				
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function state_decimal(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return '1.0';
					}
					
					if (taxable_income >= 0.01 && taxable_income <= 22000.0) { return '1.0'; }
					else if (taxable_income >= 22000.01 && taxable_income <= 23000.0) { return '0.9'; }
					else if (taxable_income >= 23000.01 && taxable_income <= 24000.0) { return '0.8'; }		
					else if (taxable_income >= 24000.01 && taxable_income <= 25000.0) { return '0.7'; }
					else if (taxable_income >= 25000.01 && taxable_income <= 26000.0) { return '0.6'; }
					else if (taxable_income >= 26000.01 && taxable_income <= 27000.0) { return '0.5'; }
					else if (taxable_income >= 27000.01 && taxable_income <= 28000.0) { return '0.4'; }
					else if (taxable_income >= 28000.01 && taxable_income <= 29000.0) { return '0.3'; }
					else { return ''; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="EDBAA07273054E9FFAB9DC6A58549DBC" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def federal_decimal(taxable_income)
	        if (taxable_income <= 0.0) then return '' end
	        tax = case taxable_income		
			        when (0.01..15000.0) then '0.35'		
			        when (15000.01..17000.0) then '0.34'
			        when (17000.01..19000.0) then '0.33'
			        when (19000.01..21000.0) then '0.32'
			        when (21000.01..23000.0) then '0.31'
			        when (23000.01..25000.0) then '0.30'
			        when (25000.01..27000.0) then '0.29'
			        when (27000.01..29000.0) then '0.28'
			        else ''
		        end
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function federal_decimal(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return '';
					}
					
					if (taxable_income >= 0.01 && taxable_income <= 15000.0) { return '0.35'; }
					else if (taxable_income >= 15000.01 && taxable_income <= 17000.0) { return '0.34'; }
					else if (taxable_income >= 17000.01 && taxable_income <= 19000.0) { return '0.33'; }
					else if (taxable_income >= 19000.01 && taxable_income <= 21000.0) { return '0.32'; }
					else if (taxable_income >= 21000.01 && taxable_income <= 23000.0) { return '0.31'; }
					else if (taxable_income >= 23000.01 && taxable_income <= 25000.0) { return '0.30'; }
					else if (taxable_income >= 25000.01 && taxable_income <= 27000.0) { return '0.29'; }
					else if (taxable_income >= 27000.01 && taxable_income <= 29000.0) { return '0.28'; }
					else { return ''; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="ACF4EFA1DED5401262BB8EDDECE63A34" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        return 0.0 unless (taxable_income > 0.0)
	        case taxable_income
		        when (0.01..2800.0) : taxable_income * 0.01
		        when (2800.01..5000.0): taxable_income * 0.02 - 28.0
		        when (5000.01..7600.0): taxable_income * 0.03 - 78.0
		        when (7600.01..10300.0): taxable_income * 0.04 - 154.0
		        when (10300.01..13300.0): taxable_income * 0.05 - 257.0
		        when (13300.01..17100.0): taxable_income * 0.06 - 390.0
		        else taxable_income * 0.069 - 544.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2800.0) { return taxable_income * 0.01; }
					else if (taxable_income >= 2800.01 && taxable_income <= 5000.0) { return taxable_income * 0.02 - 28.0; }
					else if (taxable_income >= 5000.01 && taxable_income <= 7600.0) { return taxable_income * 0.03 - 78.0; }
					else if (taxable_income >= 7600.01 && taxable_income <= 10300.0) { return taxable_income * 0.04 - 154.0; }
					else if (taxable_income >= 10300.01 && taxable_income <= 13300.0) { return taxable_income * 0.05 - 257.0; }
					else if (taxable_income >= 13300.01 && taxable_income <= 17100.0) { return taxable_income * 0.06 - 390.0; }
					else { return taxable_income * 0.069 - 544.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="B05EC77C25D2CC17B0E36A2D4F4DE4EE" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(amount)
	        amount = (amount.to_f)
	        return 0.0 if (amount <= 0.0)
	        case (amount)
		        when (0.01..2800.0): (amount * 0.01)
		        when (2800.01..5000.0): (amount * 0.02) - 28.0
		        when (5000.01..7600.0): (amount * 0.03) - 78.0
		        when (7600.01..10300.0): (amount * 0.04) - 154.0
		        when (10300.01..13300.0): (amount * 0.05) - 257.0
		        when (13300.01..17100.0): (amount * 0.06) - 390.0
		        else (amount * 0.069) - 544.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					amount = (amount.to_f());

					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2800.0) { return  (amount * 0.01); }
					else if (amount >= 2800.01 && amount <= 5000.0) { return  (amount * 0.02) - 28.0; }
					else if (amount >= 5000.01 && amount <= 7600.0) { return  (amount * 0.03) - 78.0; }
					else if (amount >= 7600.01 && amount <= 10300.0) { return  (amount * 0.04) - 154.0; }
					else if (amount >= 10300.01 && amount <= 13300.0) { return  (amount * 0.05) - 257.0; }
					else if (amount >= 13300.01 && amount <= 17100.0) { return  (amount * 0.06) - 390.0; }
					else { return (amount * 0.069) - 544.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="E2011FEA92C3A2CEC24BF7AC156B98A2" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_amount)
	        tax =	if (taxable_amount > 17100.0)
			        taxable_amount * 0.069 - 544.0
		        elsif (taxable_amount > 13300.0)
			        taxable_amount * 0.06 - 390.0
		        elsif (taxable_amount > 10300.0)
			        taxable_amount * 0.05 - 257.0
		        elsif (taxable_amount > 7600.0)
			        taxable_amount * 0.04 - 154.0
		        elsif (taxable_amount > 5000.0)
			        taxable_amount * 0.03 - 78.0
		        elsif (taxable_amount > 2800.0)
			        taxable_amount * 0.02 - 28.0
		        elsif (taxable_amount > 0.0)
			        taxable_amount * 0.01
		        else 0.0
		        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_amount)
				{
					var tax = 0.0;
					
					if (taxable_amount > 17100.0)
					{
						tax = taxable_amount * 0.069 - 544.0;
					}
					else if (taxable_amount > 13300.0)
					{
						tax = taxable_amount * 0.06 - 390.0;
					}
					else if (taxable_amount > 10300.0)
					{
						tax = taxable_amount * 0.05 - 257.0;
					}
					else if (taxable_amount > 7600.0)
					{
						tax = taxable_amount * 0.04 - 154.0;
					}
					else if (taxable_amount > 5000.0)
					{
						tax = taxable_amount * 0.03 - 78.0;
					}
					else if (taxable_amount > 2800.0)
					{
						tax = taxable_amount * 0.02 - 28.0;
					}
					else if (taxable_amount > 0.0)
					{
						tax = taxable_amount * 0.01;
					}
					else
					{
						tax = 0.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="F357DD7BE42324B548E0F72C2D97273C" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_amount)
	        tax =	if (taxable_amount > 17400.0)
			        taxable_amount * 0.069 - 555.0
		        elsif (taxable_amount > 13500.0)
			        taxable_amount * 0.06 - 398.0
		        elsif (taxable_amount > 10500.0)
			        taxable_amount * 0.05 - 263.0
		        elsif (taxable_amount > 7800.0)
			        taxable_amount * 0.04 - 158.0
		        elsif (taxable_amount > 5100.0)
			        taxable_amount * 0.03 - 80.0
		        elsif (taxable_amount > 2900.0)
			        taxable_amount * 0.02 - 29.0
		        elsif (taxable_amount > 0.0)
			        taxable_amount * 0.01
		        else 0.0
		        end
	        return tax
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_amount)
				{
					var tax = 0.0;
					
					if (taxable_amount > 17400.0)
					{
						tax = taxable_amount * 0.069 - 555.0;
					}
					else if (taxable_amount > 13500.0)
					{
						tax = taxable_amount * 0.06 - 398.0;
					}
					else if (taxable_amount > 10500.0)
					{
						tax = taxable_amount * 0.05 - 263.0;
					}
					else if (taxable_amount > 7800.0)
					{
						tax = taxable_amount * 0.04 - 158.0;
					}
					else if (taxable_amount > 5100.0)
					{
						tax = taxable_amount * 0.03 - 80.0;
					}
					else if (taxable_amount > 2900.0)
					{
						tax = taxable_amount * 0.02 - 29.0;
					}
					else if (taxable_amount > 0.0)
					{
						tax = taxable_amount * 0.01;
					}
					else
					{
						tax = 0.0;
					}
						
					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="DCCAA96A4049D492D48A04E515DE165B" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(amount)
	        amount = amount.to_f
	        return 0.0 unless (amount > 0.0)
	        case (amount)
		        when (0.01..2800.0): (amount * 0.01)
		        when (2800.01..5000.0): (amount * 0.02) - 28.0
		        when (5000.01..7600.0): (amount * 0.03) - 78.0
		        when (7600.01..10300.0): (amount * 0.04) - 154.0
		        when (10300.01..13300.0): (amount * 0.05) - 257.0
		        when (13300.01..17100.0): (amount * 0.06) - 390.0
		        else (amount * 0.069) - 544.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2800.0) { return  (amount * 0.01); }
					else if (amount >= 2800.01 && amount <= 5000.0) { return  (amount * 0.02) - 28.0; }
					else if (amount >= 5000.01 && amount <= 7600.0) { return  (amount * 0.03) - 78.0; }
					else if (amount >= 7600.01 && amount <= 10300.0) { return  (amount * 0.04) - 154.0; }
					else if (amount >= 10300.01 && amount <= 13300.0) { return  (amount * 0.05) - 257.0; }
					else if (amount >= 13300.01 && amount <= 17100.0) { return  (amount * 0.06) - 390.0; }
					else { return (amount * 0.069) - 544.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="453F282A08FBF6455B914B7CBA9450BB" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        return 0.0 unless (taxable_income > 0.0)
	        case taxable_income
		        when (0.01..2800.0): taxable_income * 0.01
		        when (2800.01..5000.0): ((taxable_income * 0.02) - 28.0)
		        when (5000.01..7600.0): ((taxable_income * 0.03) - 78.0)
		        when (7600.01..10300.0): ((taxable_income * 0.04) - 154.0)
		        when (10300.01..13300.0): ((taxable_income * 0.05) - 257.0)
		        when (13300.01..17100.0): ((taxable_income * 0.06) - 390.0)
		        else ((taxable_income * 0.069) - 544.0)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2800.0) { return  taxable_income * 0.01; }
					else if (taxable_income >= 2800.01 && taxable_income <= 5000.0) { return  ((taxable_income * 0.02) - 28.0); }
					else if (taxable_income >= 5000.01 && taxable_income <= 7600.0) { return  ((taxable_income * 0.03) - 78.0); }
					else if (taxable_income >= 7600.01 && taxable_income <= 10300.0) { return  ((taxable_income * 0.04) - 154.0); }
					else if (taxable_income >= 10300.01 && taxable_income <= 13300.0) { return  ((taxable_income * 0.05) - 257.0); }
					else if (taxable_income >= 13300.01 && taxable_income <= 17100.0) { return  ((taxable_income * 0.06) - 390.0); }
					else { return ((taxable_income * 0.069) - 544.0); }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="F2EFEEFCD23A37D38F2325C0B16908AB" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_tax_data(taxable_income)
	        return ["0.00", "0.00"] if (taxable_income <= 0.0)
          case (taxable_income)
		        when (0.01...2800.01): ["0.010", "0.0"]
		        when (2800.01...5000.01): ["0.020", "28.0"]
		        when (5000.01...7600.01): ["0.030", "78.0"]
		        when (7600.01...10300.01): ["0.040", "154.0"]
		        when (10300.01...13300.01): ["0.050", "257.0"]
		        when (13300.01...17100.01): ["0.060", "390.0"]
		        else ["0.069", "544.0"]
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_tax_data(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return ["0.00", "0.00"];
					}
					
					if (taxable_income >= 0.01 && taxable_income <= 2800.01) { return  ["0.010", "0.0"]; }
					else if (taxable_income >= 2800.01 && taxable_income <= 5000.01) { return  ["0.020", "28.0"]; }
					else if (taxable_income >= 5000.01 && taxable_income <= 7600.01) { return  ["0.030", "78.0"]; }
					else if (taxable_income >= 7600.01 && taxable_income <= 10300.01) { return  ["0.040", "154.0"]; }
					else if (taxable_income >= 10300.01 && taxable_income <= 13300.01) { return  ["0.050", "257.0"]; }
					else if (taxable_income >= 13300.01 && taxable_income <= 17100.01) { return  ["0.060", "390.0"]; }
					else { return ["0.069", "544.0"]; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="8528BE8F501DB88E9E495C5FB70B6753" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(amount)
	        amount = amount.to_f
	        return 0.0 unless (amount > 0.0)
	        case (amount)
		        when (0.01..2900.0): (amount * 0.01)
		        when (2900.01..5100.0): (amount * 0.02) - 29.0
		        when (5100.01..7800.0): (amount * 0.03) - 80.0
		        when (7800.01..10500.0): (amount * 0.04) - 158.0
		        when (10500.01..13500.0): (amount * 0.05) - 263.0
		        when (13500.01..17400.0): (amount * 0.06) - 398.0
		        else (amount * 0.069) - 555.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2900.0) { return  (amount * 0.01); }
					else if (amount >= 2900.01 && amount <= 5100.0) { return  (amount * 0.02) - 29.0; }
					else if (amount >= 5100.01 && amount <= 7800.0) { return  (amount * 0.03) - 80.0; }
					else if (amount >= 7800.01 && amount <= 10500.0) { return  (amount * 0.04) - 158.0; }
					else if (amount >= 10500.01 && amount <= 13500.0) { return  (amount * 0.05) - 263.0; }
					else if (amount >= 13500.01 && amount <= 17400.0) { return  (amount * 0.06) - 398.0; }
					else { return (amount * 0.069) - 555.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="EB6D36D383232048D3FB41A9369DAC9C" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case (taxable_income)
		        when (0.00..99.0): 0.0
		        when (100.0..1000.0): (taxable_income * 0.015)
		        when (1000.01..2000.0): ((taxable_income - 1000.0) * 0.02) + 15.0
		        when (2000.01..3000.0): ((taxable_income - 2000.0) * 0.025) + 35.0
		        when (3000.01..4000.0): ((taxable_income - 3000.0) * 0.03) + 60.0
		        when (4000.01..5000.0): ((taxable_income - 4000.0) * 0.035) + 90.0
		        when (5000.01..6000.0): ((taxable_income - 5000.0) * 0.04) + 125.0
		        when (6000.01..7000.0): ((taxable_income - 6000.0) * 0.045) + 165.0
		        when (7000.01..8000.0): ((taxable_income - 7000.0) * 0.05) + 210.0
		        when (8000.01..9000.0): ((taxable_income - 8000.0) * 0.055) + 260.0
		        else ((taxable_income - 9000.0) * 0.06) + 315.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					if (taxable_income >= 0.00 && taxable_income <= 99.0) { return  0.0; }
					else if (taxable_income >= 100.0 && taxable_income <= 1000.0) { return  (taxable_income * 0.015); }
					else if (taxable_income >= 1000.01 && taxable_income <= 2000.0) { return  ((taxable_income - 1000.0) * 0.02) + 15.0; }
					else if (taxable_income >= 2000.01 && taxable_income <= 3000.0) { return  ((taxable_income - 2000.0) * 0.025) + 35.0; }
					else if (taxable_income >= 3000.01 && taxable_income <= 4000.0) { return  ((taxable_income - 3000.0) * 0.03) + 60.0; }
					else if (taxable_income >= 4000.01 && taxable_income <= 5000.0) { return  ((taxable_income - 4000.0) * 0.035) + 90.0; }
					else if (taxable_income >= 5000.01 && taxable_income <= 6000.0) { return  ((taxable_income - 5000.0) * 0.04) + 125.0; }
					else if (taxable_income >= 6000.01 && taxable_income <= 7000.0) { return  ((taxable_income - 6000.0) * 0.045) + 165.0; }
					else if (taxable_income >= 7000.01 && taxable_income <= 8000.0) { return  ((taxable_income - 7000.0) * 0.05) + 210.0; }
					else if (taxable_income >= 8000.01 && taxable_income <= 9000.0) { return  ((taxable_income - 8000.0) * 0.055) + 260.0; }
					else { return ((taxable_income - 9000.0) * 0.06) + 315.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="81E50C67BE8088C59F46AB96CD585D71" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def tax_due(a)
	        a = a.to_f
	        if (a >= 9000.0) then '%0.0f' % ((a - 9000.0) * 0.06 + 315.0)
	        elsif (a >= 8000.0) then '%0.0f' % ((a - 8000.0) * 0.055 + 260.0)
	        elsif (a >= 7000.0) then '%0.0f' % ((a - 7000.0) * 0.05 + 210.0)
	        elsif (a >= 6000.0) then '%0.0f' % ((a - 6000.0) * 0.045 + 165.0)
	        elsif (a >= 5000.0) then '%0.0f' % ((a - 5000.0) * 0.04 + 125.0)
	        elsif (a >= 4000.0) then '%0.0f' % ((a - 4000.0) * 0.035 + 90.0)
	        elsif (a >= 3000.0) then '%0.0f' % ((a - 3000.0) * 0.03 + 60.0)
	        elsif (a >= 2000.0) then '%0.0f' % ((a - 2000.0) * 0.025 + 35.0)
	        elsif (a >= 1000.0) then '%0.0f' % ((a - 1000.0) * 0.02 + 15.0)
	        elsif (a >= 100.0) then '%0.0f' % (a  * 0.015)
	        else '0'
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax_due(a)
				{
					a = a.to_f();
					
					if (a >= 9000.0) { return ((a - 9000.0) * 0.06 + 315.0).fixed(0); }
					else if (a >= 8000.0) { return ((a - 8000.0) * 0.055 + 260.0).fixed(0); }
					else if (a >= 7000.0) { return ((a - 7000.0) * 0.05 + 210.0).fixed(0); }
					else if (a >= 6000.0) { return ((a - 6000.0) * 0.045 + 165.0).fixed(0); }
					else if (a >= 5000.0) { return ((a - 5000.0) * 0.04 + 125.0).fixed(0); }
					else if (a >= 4000.0) { return ((a - 4000.0) * 0.035 + 90.0).fixed(0); }
					else if (a >= 3000.0) { return ((a - 3000.0) * 0.03 + 60.0).fixed(0); }
					else if (a >= 2000.0) { return ((a - 2000.0) * 0.025 + 35.0).fixed(0); }
					else if (a >= 1000.0) { return ((a - 1000.0) * 0.02 + 15.0).fixed(0); }
					else if (a >= 100.0) { return (a  * 0.015).fixed(0); }
					else { return '0'; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="C62C219756EF93190C154650E1262FDD" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income	
		        when (0.0..99.0)
		        tax = 0.0
		        when (100.0..1000.0)					
			        tax = taxable_income * 0.015				
		        when (1000.01..2000.0)					
			        tax = ((taxable_income - 1000.0) * 0.02) + 15.0				
		        when (2000.01..3000.0)					
			        tax = ((taxable_income - 2000.0) * 0.025) + 35.0				
		        when (3000.01..4000.0)					
			        tax = ((taxable_income - 3000.0) * 0.03) + 60.0
		        when (4000.01..5000.0)					
			        tax = ((taxable_income - 4000.0) * 0.035) + 90.0
		        when (5000.01..6000.0)					
			        tax = ((taxable_income - 5000.0) * 0.04) + 125.0
		        when (6000.01..7000.0)					
			        tax = ((taxable_income - 6000.0) * 0.045) + 165.0
		        when (7000.01..8000.0)					
			        tax = ((taxable_income - 7000.0) * 0.05) + 210.0
		        when (8000.01..9000.0)					
			        tax = ((taxable_income - 8000.0) * 0.055) + 260.0	
		        else					
			        tax = ((taxable_income - 9000.0) * 0.06) + 315.0				
	        end						
	        return tax						
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					
					if (taxable_income >= 0.0 && taxable_income <= 99.0)
					{
						tax = 0.0;
					}
					else if (taxable_income >= 100.0 && taxable_income <= 1000.0)					
					{
						tax = taxable_income * 0.015;
					}
					else if (taxable_income >= 1000.01 && taxable_income <= 2000.0)					
					{
						tax = ((taxable_income - 1000.0) * 0.02) + 15.0;
					}
					else if (taxable_income >= 2000.01 && taxable_income <= 3000.0)					
					{
						tax = ((taxable_income - 2000.0) * 0.025) + 35.0;
					}
					else if (taxable_income >= 3000.01 && taxable_income <= 4000.0)					
					{
						tax = ((taxable_income - 3000.0) * 0.03) + 60.0;
					}
					else if (taxable_income >= 4000.01 && taxable_income <= 5000.0)					
					{
						tax = ((taxable_income - 4000.0) * 0.035) + 90.0;
					}
					else if (taxable_income >= 5000.01 && taxable_income <= 6000.0)					
					{
						tax = ((taxable_income - 5000.0) * 0.04) + 125.0;
					}
					else if (taxable_income >= 6000.01 && taxable_income <= 7000.0)					
					{
						tax = ((taxable_income - 6000.0) * 0.045) + 165.0;
					}
					else if (taxable_income >= 7000.01 && taxable_income <= 8000.0)					
					{
						tax = ((taxable_income - 7000.0) * 0.05) + 210.0;
					}
					else if (taxable_income >= 8000.01 && taxable_income <= 9000.0)					
					{
						tax = ((taxable_income - 8000.0) * 0.055) + 260.0;
					}
					else					
					{
						tax = ((taxable_income - 9000.0) * 0.06) + 315.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="21ABC1720E65096E57E95BC6C80049B0" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def amap_2(a)
	        case (a)
		        when (","): "27"
		        when ("-"): "28"
		        when ("'"): "29"
		        when ("A".."Z"): '%02i' % (a[0] - 64)
		        else "00"
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function amap_2(a)
				{
					if (a == ",") { return "27"; }
					else if (a == "-") { return "28"; }
					else if (a == "'") { return "29"; }
					else if (a >= "A" && a <= "Z") { return (a.charCodeAt(0) - 64).to_i().complexFixedString(0, '02'); }
					else { return "00"; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="EA10A8AAC464935D84840FD7CFB09E91" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def not_empty(*boxes)
	        0.upto(boxes.length - 1) { |x| return true unless (boxes[x].strip.empty?) }
	        return false
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function not_empty(boxes)
				{
					var flag = true;
					for (var x = 0; x < boxes.length - 1; x++)
					{
						if (boxes[x].trim().isEmpty())
						{
							flag = false;
						}
					}
					
					return flag;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="8D6D4C38B1495131D77A63C929811085" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
		    def amap_3(a)

		    '%02i' % (("A".."Z").include?(a) ? a[0] - 64 : 0)
		    end
      ]]>
    </RubyCode>
		<JavaScriptCode>
            <![CDATA[
				function amap_3(a)
				{
					if (a >= "A" && a <= "Z")
					{
						return (a.charCodeAt(0) - 64).to_i().complexFixedString(0, '02');
					}
					else
					{
						return (0).to_i().complexFixedString(0, '02');
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="ED2F5991C268C7947095D44C58FCAB8D" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def tax(amount)
	        amount = amount.to_f
	        if ( amount > 30000.0 )
		        2745.0 + ( amount - 30000.0 ) * 0.11
	        elsif ( amount > 20000.0 )
		        1695.0 + ( amount - 20000.0 ) * 0.105
	        elsif ( amount > 14000.0 )
		        1095.0 + ( amount - 14000.0 ) * 0.1
	        elsif ( amount > 10000.0 )
		        715.0 + ( amount - 10000.0 ) * 0.095
	        elsif ( amount > 5000.0 )
		        290.0 + ( amount - 5000.0 ) * 0.085
	        elsif ( amount > 3000.0 )
		        140.0 + ( amount - 3000.0 ) * 0.075
	        elsif (amount > 2000.0 )
		        75.0 + ( amount - 2000.0 ) * 0.065
	        elsif ( amount > 1500.0 )
		        50.0 + ( amount - 1500.0 ) * 0.05
	        elsif ( amount > 1000.0 )
		        27.50 + ( amount - 1000.0 ) * 0.045
	        elsif ( amount > 500.0 )
		        11.25 + ( amount - 500.0 ) * 0.0375				
	        elsif ( amount > 0.0 )
		        amount * 0.0225
	        else 0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax(amount)
				{
					amount = amount.to_f();

					if ( amount > 30000.0 )
					{
						return 2745.0 + ( amount - 30000.0 ) * 0.11;
					}
					else if ( amount > 20000.0 )
					{
						return 1695.0 + ( amount - 20000.0 ) * 0.105;
					}
					else if ( amount > 14000.0 )
					{
						return 1095.0 + ( amount - 14000.0 ) * 0.1;
					}
					else if ( amount > 10000.0 )
					{
						return 715.0 + ( amount - 10000.0 ) * 0.095; 
					}
					else if ( amount > 5000.0 )
					{
						return 290.0 + ( amount - 5000.0 ) * 0.085;
					}
					else if ( amount > 3000.0 )
					{
						return 140.0 + ( amount - 3000.0 ) * 0.075;
					}
					else if (amount > 2000.0 )
					{
						return 75.0 + ( amount - 2000.0 ) * 0.065;
					}
					else if ( amount > 1500.0 )
					{
						return 50.0 + ( amount - 1500.0 ) * 0.05;
					}
					else if ( amount > 1000.0 )
					{
						return 27.50 + ( amount - 1000.0 ) * 0.045;
					}
					else if ( amount > 500.0 )
					{
						return 11.25 + ( amount - 500.0 ) * 0.0375;
					}
					else if ( amount > 0.0 )
					{
						return amount * 0.0225;
					}
					else
					{
						return 0;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="1DAFB623B778B8DEE30EBE11E19BE09B" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        return 0 unless (taxable_income > 0.0)
	        case taxable_income						
		        when (0.01..2000.0): taxable_income * 0.014				
		        when (2000.01..4000.0): ((taxable_income - 2000.0) * 0.032) + 28.0				
		        when (4000.01..8000.0): ((taxable_income - 4000.0) * 0.055) + 92.0				
		        when (8000.01..12000.0): ((taxable_income - 8000.0) * 0.064) + 312.0
		        when (12000.01..16000.0): ((taxable_income - 12000.0) * 0.068) + 568.0	
		        when (16000.01..20000.0): ((taxable_income - 16000.0) * 0.072) + 840.0	
		        when (20000.01..30000.0): ((taxable_income - 20000.0) * 0.076) + 1128.0	
		        when (30000.01..40000.0): ((taxable_income - 30000.0) * 0.079) + 1888.0				
		        else ((taxable_income - 40000.0) * 0.0825) + 2678.0				
	        end				
        end		
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2000.0) { return taxable_income * 0.014; }
					else if (taxable_income >= 2000.01 && taxable_income <= 4000.0) { return ((taxable_income - 2000.0) * 0.032) + 28.0; }
					else if (taxable_income >= 4000.01 && taxable_income <= 8000.0) { return ((taxable_income - 4000.0) * 0.055) + 92.0; }
					else if (taxable_income >= 8000.01 && taxable_income <= 12000.0) { return ((taxable_income - 8000.0) * 0.064) + 312.0; }
					else if (taxable_income >= 12000.01 && taxable_income <= 16000.0) { return ((taxable_income - 12000.0) * 0.068) + 568.0; }	
					else if (taxable_income >= 16000.01 && taxable_income <= 20000.0) { return ((taxable_income - 16000.0) * 0.072) + 840.0; }
					else if (taxable_income >= 20000.01 && taxable_income <= 30000.0) { return ((taxable_income - 20000.0) * 0.076) + 1128.0; }
					else if (taxable_income >= 30000.01 && taxable_income <= 40000.0) { return ((taxable_income - 30000.0) * 0.079) + 1888.0; }
					else { return ((taxable_income - 40000.0) * 0.0825) + 2678.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="87E32C453B2FA9CA423D44A1B56FD610" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def amap_4(a)
	        case (a)
		        when ("0".."9"): (a[0] - 18).to_s
		        when ("A".."Z"): '%02i' % (a[0] - 64)
		        else "00"
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode>
          <![CDATA[
				function amap_4(a)
				{
						if (a >= "0" && a <= "9") { return (a.charCodeAt(0) - 18).toString(); }
						else if (a >= "A" && a <= "Z") { return (a.charCodeAt(0) - 64).to_i().complexFixedString(0, '02'); }
						else { return "00"; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="8D3F796A1F11728CDA595151C6F42FC2" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income	
		        when (0.01...30000.0)					
			        tax = 25.0
		        when (30000.0...40000.0)					
			        tax = 30.0		
		        when (40000.0...50000.0)					
			        tax = 40.0	
		        when (50000.0...60000.0)					
			        tax = 50.0
		        when (60000.0...70000.0)					
			        tax = 60.0	
		        when (70000.0...80000.0)					
			        tax = 70.0
		        when (80000.0...90000.0)					
			        tax = 80.0
		        when (90000.0...100000.0)					
			        tax = 90.0			
		        else					
			        tax = ((taxable_income - 100000.0) * 0.0005) + 90.0				
	        end						
	        return tax						
        end	
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}

					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 30000.0)					
					{
						tax = 25.0;
					}
					else if (taxable_income >= 30000.0 && taxable_income <= 40000.0)					
					{
						tax = 30.0;
					}
					else if (taxable_income >= 40000.0 && taxable_income <= 50000.0)					
					{
						tax = 40.0;
					}
					else if (taxable_income >= 50000.0 && taxable_income <= 60000.0)					
					{
						tax = 50.0;
					}
					else if (taxable_income >= 60000.0 && taxable_income <= 70000.0)					
					{
						tax = 60.0;
					}
					else if (taxable_income >= 70000.0 && taxable_income <= 80000.0)					
					{
						tax = 70.0;
					}
					else if (taxable_income >= 80000.0 && taxable_income <= 90000.0)					
					{
						tax = 80.0;
					}
					else if (taxable_income >= 90000.0 && taxable_income <= 100000.0)					
					{
						tax = 90.0;
					}
					else					
					{
						tax = ((taxable_income - 100000.0) * 0.0005) + 90.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="BDCB0ED871054560C0FDDC413A262633" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def day_suffix(day)
	        day = day.to_i
	        suffix = case day
			        when 1,21,31 then 'st'
			        when 2,22 then 'nd'
			        when 3,23 then 'rd'
			        else 'th'
			        end
	        "#{day}#{suffix}"
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function day_suffix(day)
				{
					day = day.to_i();

					switch (day)
					{
						case 1:
						case 21:
						case 31:
							sufix = 'st';
							break;
						case 2:
						case 22:
							suffix = 'nd';
							break;
						case 3:
						case 23:
							suffix = 'rd';
							break;
						default:
							suffix = 'th';
							break;
					}

					return day.toString() + suffix;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="DE330E983E4005B1B14DB872973E9250" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case (taxable_income)
		        when (0.01..1539.0): taxable_income * 0.0036
		        when (1539.01..3078.0): ((taxable_income - 1539.0) * 0.0072) + 5.54
		        when (3078.01..6156.0): ((taxable_income - 3078.0) * 0.0243) + 16.62
		        when (6156.01..13851.0): ((taxable_income - 6156.0) * 0.045) + 91.42
		        when (13851.01..23085.0): ((taxable_income - 13851.0) * 0.0612) + 437.70
		        when (23085.01..30780.0): ((taxable_income - 23085.0) * 0.0648) + 1002.82
		        when (30780.01..46170.0): ((taxable_income - 30780.0) * 0.068) + 1501.46
		        when (46170.01..69255.0): ((taxable_income - 46170.0) * 0.0792) + 2547.98
		        else ((taxable_income - 69255.0) * 0.0898) + 4376.31
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 1539.0) { return taxable_income * 0.0036; }
					else if (taxable_income >= 1539.01 && taxable_income <= 3078.0) { return ((taxable_income - 1539.0) * 0.0072) + 5.54; }
					else if (taxable_income >= 3078.01 && taxable_income <= 6156.0) { return ((taxable_income - 3078.0) * 0.0243) + 16.62; }
					else if (taxable_income >= 6156.01 && taxable_income <= 13851.0) { return ((taxable_income - 6156.0) * 0.045) + 91.42; }
					else if (taxable_income >= 13851.01 && taxable_income <= 23085.0) { return ((taxable_income - 13851.0) * 0.0612) + 437.70; }
					else if (taxable_income >= 23085.01 && taxable_income <= 30780.0) { return ((taxable_income - 23085.0) * 0.0648) + 1002.82; }
					else if (taxable_income >= 30780.01 && taxable_income <= 46170.0) { return ((taxable_income - 30780.0) * 0.068) + 1501.46; }
					else if (taxable_income >= 46170.01 && taxable_income <= 69255.0) { return ((taxable_income - 46170.0) * 0.0792) + 2547.98; }
					else { return ((taxable_income - 69255.0) * 0.0898) + 4376.31; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="FC2F19614DE9C26977BCE85D35ED3104" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1554.01)					
			        tax = taxable_income * 0.0036				
		        when (1554.01...3108.01)					
			        tax = ((taxable_income - 1554.0) * 0.0072) + 5.59		
		        when (3108.01...6216.01)					
			        tax = ((taxable_income - 3108.0) * 0.0243) + 16.78
		        when (6216.01...13986.01)					
			        tax = ((taxable_income - 6216.0) * 0.045) + 92.30
		        when (13986.01...23310.01)					
			        tax = ((taxable_income - 13986.0) * 0.0612) + 441.95
		        when (23310.01...31080.01)					
			        tax = ((taxable_income - 23310.0) * 0.0648) + 1012.58
		        when (31080.01...46620.01)					
			        tax = ((taxable_income - 31080.0) * 0.068) + 1516.08
		        when (46620.01...69930.01)					
			        tax = ((taxable_income - 46620.0) * 0.0792) + 2572.80		
		        else					
			        tax = ((taxable_income - 69930.0) * 0.0898) + 4418.95				
	        end					
	        return tax						
        end		
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1554.01)					
					{
						tax = taxable_income * 0.0036;
					}
					else if (taxable_income >= 1554.01 && taxable_income <= 3108.01)					
					{
						tax = ((taxable_income - 1554.0) * 0.0072) + 5.59;
					}
					else if (taxable_income >= 3108.01 && taxable_income <= 6216.01)					
					{
						tax = ((taxable_income - 3108.0) * 0.0243) + 16.78;
					}
					else if (taxable_income >= 6216.01 && taxable_income <= 13986.01)					
					{
						tax = ((taxable_income - 6216.0) * 0.045) + 92.30;
					}
					else if (taxable_income >= 13986.01 && taxable_income <= 23310.01)					
					{
						tax = ((taxable_income - 13986.0) * 0.0612) + 441.95;
					}
					else if (taxable_income >= 23310.01 && taxable_income <= 31080.01)					
					{
						tax = ((taxable_income - 23310.0) * 0.0648) + 1012.58;
					}
					else if (taxable_income >= 31080.01 && taxable_income <= 46620.01)					
					{
						tax = ((taxable_income - 31080.0) * 0.068) + 1516.08;
					}
					else if (taxable_income >= 46620.01 && taxable_income <= 69930.01)					
					{
						tax = ((taxable_income - 46620.0) * 0.0792) + 2572.80;
					}
					else					
					{
						tax = ((taxable_income - 69930.0) * 0.0898) + 4418.95;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="AD8591AAD9CACD6F3E7396967BFBF251" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)

	        return 0.0 unless (taxable_income > 0.0)

	        case (taxable_income)

		        when (0.01..1554.0): taxable_income * 0.0036
		        when (1554.01..3108.0): ((taxable_income - 1554.0) * 0.0072) + 5.59
		        when (3108.01..6216.0): ((taxable_income - 3108.0) * 0.0243) + 16.78
		        when (6216.01..13986.0): ((taxable_income - 6216.0) * 0.045) + 92.30
		        when (13986.01..23310.0): ((taxable_income - 13986.0) * 0.0612) + 441.95
		        when (23310.01..31080.0): ((taxable_income - 23310.0) * 0.0648) + 1012.58
		        when (31080.01..46620.0): ((taxable_income - 31080.0) * 0.068) + 1516.08
		        when (46620.01..69930.0): ((taxable_income - 46620.0) * 0.0792) + 2572.80
		        else ((taxable_income - 69930.0) * 0.0898) + 4418.95
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 1554.0) { return  taxable_income * 0.0036; }
					else if (taxable_income >= 1554.01 && taxable_income <= 3108.0) { return  ((taxable_income - 1554.0) * 0.0072) + 5.59; }
					else if (taxable_income >= 3108.01 && taxable_income <= 6216.0) { return  ((taxable_income - 3108.0) * 0.0243) + 16.78; }
					else if (taxable_income >= 6216.01 && taxable_income <= 13986.0) { return  ((taxable_income - 6216.0) * 0.045) + 92.30; }
					else if (taxable_income >= 13986.01 && taxable_income <= 23310.0) { return  ((taxable_income - 13986.0) * 0.0612) + 441.95; }
					else if (taxable_income >= 23310.01 && taxable_income <= 31080.0) { return  ((taxable_income - 23310.0) * 0.0648) + 1012.58; }
					else if (taxable_income >= 31080.01 && taxable_income <= 46620.0) { return  ((taxable_income - 31080.0) * 0.068) + 1516.08; }
					else if (taxable_income >= 46620.01 && taxable_income <= 69930.0) { return  ((taxable_income - 46620.0) * 0.0792) + 2572.80; }
					else { return ((taxable_income - 69930.0) * 0.0898) + 4418.95; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="126D484FBC44C5F676519A2439E4C5F5" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_rate(household_income)
	        rate = if (household_income < 0.0) then '0'
		        else
			        case household_income
				        when (0.0..11518.99) then '1.00'
				        when (11519.0..12873.99) then '0.85'
				        when (12874.0..14228.99) then '0.70'
				        when (14229.0..16939.99) then '0.50'
				        when (16940.0..19649.99) then '0.35'
				        when (19650.0..22359.99) then '0.25'
				        else '0'
			        end
		        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_rate(household_income)
				{
					var rate = 0.0;
					
					if (household_income < 0.0)
					{
						rate = '0';
					}
					else
					{
						if (household_income >= 0.0 && household_income <= 11518.99) { rate =  '1.00'; }
						else if (household_income >= 11519.0 && household_income <= 12873.99) { rate =  '0.85'; }
						else if (household_income >= 12874.0 && household_income <= 14228.99) { rate =  '0.70'; }
						else if (household_income >= 14229.0 && household_income <= 16939.99) { rate =  '0.50'; }
						else if (household_income >= 16940.0 && household_income <= 19649.99) { rate =  '0.35'; }
						else if (household_income >= 19650.0 && household_income <= 22359.99) { rate =  '0.25'; }
						else { rate = '0'; }
					}
					
					return rate;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="C3EB08C8AFE5A244F51B035DC845CE76" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        return 0.0 if (taxable_income <= 0.0)
	        case taxable_income
		        when (0.01..1000000.0): taxable_income * 0.1
		        when (1000000.01..2000000.0): ((taxable_income - 1000000.0) * 0.11) + 100000.0
		        when (2000000.01..3000000.0): ((taxable_income - 2000000.0) * 0.12) + 210000.0
		        when (3000000.01..4000000.0): ((taxable_income - 3000000.0) * 0.13) + 330000.0
		        when (4000000.01..5000000.0): ((taxable_income - 4000000.0) * 0.14) + 460000.0
	        else ((taxable_income - 5000000.0) * 0.157) + 600000.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 1000000.0) { return taxable_income * 0.1; }
					else if (taxable_income >= 1000000.01 && taxable_income <= 2000000.0) { return ((taxable_income - 1000000.0) * 0.11) + 100000.0; }
					else if (taxable_income >= 2000000.01 && taxable_income <= 3000000.0) { return ((taxable_income - 2000000.0) * 0.12) + 210000.0; }
					else if (taxable_income >= 3000000.01 && taxable_income <= 4000000.0) { return ((taxable_income - 3000000.0) * 0.13) + 330000.0; }
					else if (taxable_income >= 4000000.01 && taxable_income <= 5000000.0) { return ((taxable_income - 4000000.0) * 0.14) + 460000.0; }
					else { return ((taxable_income - 5000000.0) * 0.157) + 600000.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="D47C6D6A3CF1180E670588C5E6E66D7B" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_avg_retail_sales_rate(fuel_type)
	        case (fuel_type.strip.to_i)
		        when (1): "3.033"
		        when (2): "3.580"
		        when (3): "5.351"
		        when (4): "1.954"
		        when (5): "2.994"
		        else "0.00"
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_avg_retail_sales_rate(fuel_type)
				{
					switch (fuel_type.trim().to_i())
					{
						case 1: return "3.033"; 
						case 2: return "3.580"; 
						case 3: return "5.351"; 
						case 4: return "1.954"; 
						case 5: return "2.994"; 
						default: return "0.00"; 
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="59F1B3ACAFCDF750B48DFC8C20AAFD57" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_avg_retail_sales_rate(fuel_type)
	        case (fuel_type.strip.to_i)
		        when (1): "1.784"
		        when (2): "2.011"
		        when (3): "3.000"
		        when (4): "1.954"
		        when (5): "1.717"
		        else "0.00"
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_avg_retail_sales_rate(fuel_type)
				{
					switch (fuel_type.trim().to_i())
					{
						case 1: return "1.784";
						case 2: return "2.011";
						case 3: return "3.000";
						case 4: return "1.954";
						case 5: return "1.717";
						default: return "0.00";
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="19426A9AB77AEC61D2AC8306E464A66F" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_avg_retail_sales_rate(fuel_type)
	        case (fuel_type.strip.to_i)
		        when (1): "3.033"
		        when (2): "3.530"
		        when (3): "5.351"
		        when (4): "1.954"
		        when (5): "2.994"
		        else "0.00"
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_avg_retail_sales_rate(fuel_type)
				{
					switch (fuel_type.trim().to_i())
					{
						case 1: return "3.033";
						case 2: return "3.530";
						case 3: return "5.351";
						case 4: return "1.954";
						case 5: return "2.994";
						default: return "0.00";
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="7E438C52B8FF4038822A3460F27BAB68" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income				
		        when (0.01..10000)					
			        tax = taxable_income * 0.04				
		        when (10000.01..40000)					
			        tax = ((taxable_income - 10000.0) * 0.06) + 400.0	
		        when (40000.01..60000)
			        tax = ((taxable_income - 40000.0) * 0.065) + 2200.0
		        when (60000.01..350000)
			        tax = ((taxable_income - 60000.0) * 0.85) + 3500.0
		        when (350000.01..1000000)
			        tax = ((taxable_income - 350000.0) * 0.875) + 28150.0
		        else				
			        tax = ((taxable_income - 1000000.0) * 0.0895) + 85025.0				
	        end						
	        return tax						
        end			
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 10000)					
					{
						tax = taxable_income * 0.04;
					}
					else if (taxable_income >= 10000.01 && taxable_income <= 40000)					
					{
						tax = ((taxable_income - 10000.0) * 0.06) + 400.0;
					}
					else if (taxable_income >= 40000.01 && taxable_income <= 60000)
					{
						tax = ((taxable_income - 40000.0) * 0.065) + 2200.0;
					}
					else if (taxable_income >= 60000.01 && taxable_income <= 350000)
					{
						tax = ((taxable_income - 60000.0) * 0.85) + 3500.0;
					}
					else if (taxable_income >= 350000.01 && taxable_income <= 1000000)
					{
						tax = ((taxable_income - 350000.0) * 0.875) + 28150.0;
					}
					else				
					{
						tax = ((taxable_income - 1000000.0) * 0.0895) + 85025.0;
					}

					return tax;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="491EC0EA1A32BBDB68920B76E9EC5907" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def get_due_date(mm_yr, vch_num)
	        return "" unless ((0..3) === vch_num)
	        case (mm_yr)
		        when ("1215"): ["04-01-2015", "06-15-2015", "09-15-2015", "12-15-2015"][vch_num]
		        when ("0116"): ["05-01-2015", "07-15-2015", "10-15-2015", "01-15-2016"][vch_num]
		        when ("0216"): ["06-01-2015", "08-17-2015", "11-16-2015", "02-16-2016"][vch_num]
		        when ("0316"): ["07-01-2015", "09-15-2015", "12-15-2015", "03-15-2016"][vch_num]
		        when ("0416"): ["08-03-2015", "10-15-2015", "01-15-2016", "04-15-2016"][vch_num]
		        when ("0516"): ["09-01-2015", "11-16-2015", "02-16-2016", "05-16-2016"][vch_num]
		        when ("0616"): ["10-01-2015", "12-15-2015", "03-15-2016", "06-15-2016"][vch_num]
		        when ("0716"): ["11-02-2015", "01-15-2016", "04-15-2016", "07-15-2016"][vch_num]
		        when ("0816"): ["12-01-2015", "02-16-2016", "05-16-2016", "08-15-2016"][vch_num]
		        when ("0916"): ["01-04-2016", "03-15-2016", "06-15-2016", "09-15-2016"][vch_num]
		        when ("1016"): ["02-01-2016", "04-15-2016", "07-15-2016", "10-17-2016"][vch_num]
		        when ("1116"): ["03-01-2016", "05-16-2016", "08-15-2016", "11-15-2016"][vch_num]
		        else ""
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function get_due_date(mm_yr, vch_num)
				{
				     var result = "";

					if (vch_num >= 0 && vch_num <= 3)
					{

					if (mm_yr == "1215") { result =  ["04-01-2015", "06-15-2015", "09-15-2015", "12-15-2015"][vch_num]; }
					else if (mm_yr == "0116") { result =   ["05-01-2015", "07-15-2015", "10-15-2015", "01-15-2016"][vch_num]; }
					else if (mm_yr == "0216") { result =   ["06-01-2015", "08-17-2015", "11-16-2015", "02-16-2016"][vch_num]; }
					else if (mm_yr == "0316") { result =  ["07-01-2015", "09-15-2015", "12-15-2015", "03-15-2016"][vch_num]; }
					else if (mm_yr == "0416") { result =  ["08-03-2015", "10-15-2015", "01-15-2016", "04-15-2016"][vch_num]; }
					else if (mm_yr == "0516") { result =  ["09-01-2015", "11-16-2015", "02-16-2016", "05-16-2016"][vch_num]; }
					else if (mm_yr == "0616") { result =  ["10-01-2015", "12-15-2015", "03-15-2016", "06-15-2016"][vch_num]; }
					else if (mm_yr == "0716") { result =  ["11-02-2015", "01-15-2016", "04-15-2016", "07-15-2016"][vch_num]; }
					else if (mm_yr == "0816") { result =  ["12-01-2015", "02-16-2016", "05-16-2016", "08-15-2016"][vch_num]; }
					else if (mm_yr == "0916") { result =  ["01-04-2016", "03-15-2016", "06-15-2016", "09-15-2016"][vch_num]; }
					else if (mm_yr == "1016") { result =  ["02-01-2016", "04-15-2016", "07-15-2016", "10-17-2016"][vch_num]; }
					else if (mm_yr == "1116") { result =  ["03-01-2016", "05-16-2016", "08-15-2016", "11-15-2016"][vch_num]; }
					else { result =  ""; }
                           }

                           return result;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="FB27C7ED0F869113FC7C67F2A96EED00" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 if (taxable_income < 0.0)

	        case (taxable_income)

		        when (0.0...40000.0): 0.0
		        when (40000.0...90000.0):  ((taxable_income - 40000.0) * 0.008)
		        when (90000.0...140000.0): ((taxable_income - 90000.0) * 0.016) + 400.0
		        when (140000.0...240000.0): ((taxable_income - 140000.0) * 0.024) + 1200.0
		        when (240000.0...440000.0): ((taxable_income - 240000.0) * 0.032) + 3600.0
		        when (440000.0...640000.0): ((taxable_income - 440000.0) * 0.04) + 10000.0
		        when (640000.0...840000.0): ((taxable_income - 640000.0) * 0.048) + 18000.0
		        when (840000.0...1040000.0): ((taxable_income - 840000.0) * 0.056) + 27600.0
		        when (1040000.0...1540000.0): ((taxable_income - 1040000.0) * 0.064) + 38800.0
		        when (1540000.0...2040000.0): ((taxable_income - 1540000.0) * 0.072) + 70800.0
		        when (2040000.0...2540000.0): ((taxable_income - 2040000.0) * 0.08) + 106800.0
		        when (2540000.0...3040000.0): ((taxable_income - 2540000.0) * 0.088) + 146800.0
		        when (3040000.0...3540000.0): ((taxable_income - 3040000.0) * 0.096) + 190800.0
		        when (3540000.0...4040000.0): ((taxable_income - 3540000.0) * 0.104) + 238800.0
		        when (4040000.0...5040000.0): ((taxable_income - 4040000.0) * 0.112) + 290800.0
		        when (5040000.0...6040000.0): ((taxable_income - 5040000.0) * 0.12) + 402800.0
		        when (6040000.0...7040000.0): ((taxable_income - 6040000.0) * 0.128) + 522800.0
		        when (7040000.0...8040000.0): ((taxable_income - 7040000.0) * 0.136) + 650800.0
		        when (8040000.0...9040000.0): ((taxable_income - 8040000.0) * 0.144) + 786800.0
		        when (9040000.0...10040000.0): ((taxable_income - 9040000.0) * 0.152) + 930800.0
		        else ((taxable_income - 10040000.0) * 0.16) + 1082800.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income < 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.0 && taxable_income <= 40000.0) { return  0.0; }
					else if (taxable_income >= 40000.0 && taxable_income <= 90000.0) { return   ((taxable_income - 40000.0) * 0.008); }
					else if (taxable_income >= 90000.0 && taxable_income <= 140000.0) { return  ((taxable_income - 90000.0) * 0.016) + 400.0; }
					else if (taxable_income >= 140000.0 && taxable_income <= 240000.0) { return  ((taxable_income - 140000.0) * 0.024) + 1200.0; }
					else if (taxable_income >= 240000.0 && taxable_income <= 440000.0) { return  ((taxable_income - 240000.0) * 0.032) + 3600.0; }
					else if (taxable_income >= 440000.0 && taxable_income <= 640000.0) { return  ((taxable_income - 440000.0) * 0.04) + 10000.0; }
					else if (taxable_income >= 640000.0 && taxable_income <= 840000.0) { return  ((taxable_income - 640000.0) * 0.048) + 18000.0; }
					else if (taxable_income >= 840000.0 && taxable_income <= 1040000.0) { return  ((taxable_income - 840000.0) * 0.056) + 27600.0; }
					else if (taxable_income >= 1040000.0 && taxable_income <= 1540000.0) { return  ((taxable_income - 1040000.0) * 0.064) + 38800.0; }
					else if (taxable_income >= 1540000.0 && taxable_income <= 2040000.0) { return  ((taxable_income - 1540000.0) * 0.072) + 70800.0; }
					else if (taxable_income >= 2040000.0 && taxable_income <= 2540000.0) { return  ((taxable_income - 2040000.0) * 0.08) + 106800.0; }
					else if (taxable_income >= 2540000.0 && taxable_income <= 3040000.0) { return  ((taxable_income - 2540000.0) * 0.088) + 146800.0; }
					else if (taxable_income >= 3040000.0 && taxable_income <= 3540000.0) { return  ((taxable_income - 3040000.0) * 0.096) + 190800.0; }
					else if (taxable_income >= 3540000.0 && taxable_income <= 4040000.0) { return  ((taxable_income - 3540000.0) * 0.104) + 238800.0; }
					else if (taxable_income >= 4040000.0 && taxable_income <= 5040000.0) { return  ((taxable_income - 4040000.0) * 0.112) + 290800.0; }
					else if (taxable_income >= 5040000.0 && taxable_income <= 6040000.0) { return  ((taxable_income - 5040000.0) * 0.12) + 402800.0; }
					else if (taxable_income >= 6040000.0 && taxable_income <= 7040000.0) { return  ((taxable_income - 6040000.0) * 0.128) + 522800.0; }
					else if (taxable_income >= 7040000.0 && taxable_income <= 8040000.0) { return  ((taxable_income - 7040000.0) * 0.136) + 650800.0; }
					else if (taxable_income >= 8040000.0 && taxable_income <= 9040000.0) { return  ((taxable_income - 8040000.0) * 0.144) + 786800.0; }
					else if (taxable_income >= 9040000.0 && taxable_income <= 10040000.0) { return  ((taxable_income - 9040000.0) * 0.152) + 930800.0; }
					else { return ((taxable_income - 10040000.0) * 0.16) + 1082800.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="978161E6BE15D208E28067E9E39E377F" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case (taxable_income)
		        when (0.01..2000.0): 0.0
		        when (2000.01..5000.0): ((taxable_income - 2000.0) * 0.022)
		        when (5000.01..10000.0): ((taxable_income - 5000.0) * 0.039) + 66.0
		        when (10000.01..20000.0): ((taxable_income - 10000.0) * 0.048) + 261.0
		        when (20000.01..25000.0): ((taxable_income - 20000.0) * 0.052) + 741.0
		        when (25000.01..60000.0): ((taxable_income - 25000.0) * 0.0555) + 1001.0
		        else ((taxable_income - 60000.0) * 0.066) + 2943.5
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2000.0) { return  0.0; }
					else if (taxable_income >= 2000.01 && taxable_income <= 5000.0) { return  ((taxable_income - 2000.0) * 0.022); }
					else if (taxable_income >= 5000.01 && taxable_income <= 10000.0) { return  ((taxable_income - 5000.0) * 0.039) + 66.0; }
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.0) { return  ((taxable_income - 10000.0) * 0.048) + 261.0; }
					else if (taxable_income >= 20000.01 && taxable_income <= 25000.0) { return  ((taxable_income - 20000.0) * 0.052) + 741.0; }
					else if (taxable_income >= 25000.01 && taxable_income <= 60000.0) { return  ((taxable_income - 25000.0) * 0.0555) + 1001.0; }
					else { return ((taxable_income - 60000.0) * 0.066) + 2943.5; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="AC514BDB0CCC15BE037042D143C630F5" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(net_taxable_income)
	        return [net_taxable_income * 0.009, 0.0].max if (net_taxable_income < 4300.0)
	        case (net_taxable_income)
		        when (4300.0..8399.99): 39.0 + (net_taxable_income - 4299.99) * 0.024
		        when (8400.0..12599.99): 137.0 + (net_taxable_income - 8399.99) * 0.034
		        when (12600.0..20999.99): 280.0 + (net_taxable_income - 12599.99) * 0.044
		        when (21000.0..23999.99): 666.0 + (net_taxable_income - 20999.99) * 0.050
		        when (24000.0..24999.99): 816.0 + (net_taxable_income - 23999.99) * 0.050
		        when (25000.0..25999.99): 866.0 + (net_taxable_income - 24999.99) * 0.050
		        when (26000.0..26999.99): 916.0 + (net_taxable_income - 25999.99) * 0.050
		        when (27000.0..27999.99): 966.0 + (net_taxable_income - 26999.99) * 0.050
		        when (28000.0..28999.99): 1016.0 + (net_taxable_income - 27999.99) * 0.050
		        when (29000.0..29999.99): 1066.0 + (net_taxable_income - 28999.99) * 0.050
		        when (30000.0..30999.99): 1116.0 + (net_taxable_income - 29999.99) * 0.050
		        when (31000.0..31999.99): 1166.0 + (net_taxable_income - 30999.99) * 0.050
		        when (32000.0..32999.99): 1216.0 + (net_taxable_income - 31999.99) * 0.050
		        when (33000.0..33999.99): 1266.0 + (net_taxable_income - 32999.99) * 0.050
		        when (34000.0..34999.99): 1316.0 + (net_taxable_income - 33999.99) * 0.050
		        when (35000.0..35099.99): 1366.0 + (net_taxable_income - 34999.99) * 0.050
		        when (35100.0..49999.99): 1371.0 + (net_taxable_income - 35099.99) * 0.060
		        when (50000.0..68000.99): 2265.0 + (net_taxable_income - 49999.99) * 0.060
		        when (68001.0..69000.99): 3345.0 + (net_taxable_income - 68000.99) * 0.060
		        when (69001.0..70000.99): 3405.0 + (net_taxable_income - 69000.99) * 0.060
		        when (70001.0..71000.99): 3465.0 + (net_taxable_income - 70000.99) * 0.060
		        when (71001.0..72000.99): 3525.0 + (net_taxable_income - 71000.99) * 0.060
		        when (72001.0..73000.99): 3585.0 + (net_taxable_income - 72000.99) * 0.060
		        when (73001.0..74000.99): 3645.0 + (net_taxable_income - 73000.99) * 0.060
		        when (74001.0..75000.99): 3705.0 + (net_taxable_income - 74000.99) * 0.060
		        when (75001.0..76000.99): 3825.0 + (net_taxable_income - 75000.99) * 0.069
		        when (76001.0..77000.99): 3994.0 + (net_taxable_income - 76000.99) * 0.069
		        when (77001.0..78000.99): 4163.0 + (net_taxable_income - 77000.99) * 0.069
		        when (78001.0..79000.99): 4332.0 + (net_taxable_income - 78000.99) * 0.069
		        when (79001.0..80000.99): 4501.0 + (net_taxable_income - 79000.99) * 0.069
		        when (80001.0..81000.99): 4610.0 + (net_taxable_income - 80000.99) * 0.069
		        when (81001.0..82000.99): 4679.0 + (net_taxable_income - 81000.99) * 0.069
		        when (82001.0..83000.99): 4748.0 + (net_taxable_income - 82000.99) * 0.069
		        when (83001.0..84000.99): 4817.0 + (net_taxable_income - 83000.99) * 0.069
		        when (84001.0..85000.99): 4886.0 + (net_taxable_income - 84000.99) * 0.069
		        else 4955.0 + (net_taxable_income - 85000.99) * 0.069
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(net_net_taxable_income)
				{
					if (net_net_taxable_income < 4300.0)
					{
						return Math.max(net_net_taxable_income * 0.009, 0.0);
					}

					if (net_taxable_income >= 4300.0 && net_taxable_income <= 8399.99) { return  39.0 + (net_net_taxable_income - 4299.99) * 0.024; }
					else if (net_taxable_income >= 8400.0 && net_taxable_income <= 12599.99) { return  137.0 + (net_net_taxable_income - 8399.99) * 0.034; }
					else if (net_taxable_income >= 12600.0 && net_taxable_income <= 20999.99) { return  280.0 + (net_net_taxable_income - 12599.99) * 0.044; }
					else if (net_taxable_income >= 21000.0 && net_taxable_income <= 23999.99) { return  666.0 + (net_net_taxable_income - 20999.99) * 0.050; }
					else if (net_taxable_income >= 24000.0 && net_taxable_income <= 24999.99) { return  816.0 + (net_net_taxable_income - 23999.99) * 0.050; }
					else if (net_taxable_income >= 25000.0 && net_taxable_income <= 25999.99) { return  866.0 + (net_net_taxable_income - 24999.99) * 0.050; }
					else if (net_taxable_income >= 26000.0 && net_taxable_income <= 26999.99) { return  916.0 + (net_net_taxable_income - 25999.99) * 0.050; }
					else if (net_taxable_income >= 27000.0 && net_taxable_income <= 27999.99) { return  966.0 + (net_net_taxable_income - 26999.99) * 0.050; }
					else if (net_taxable_income >= 28000.0 && net_taxable_income <= 28999.99) { return  1016.0 + (net_net_taxable_income - 27999.99) * 0.050; }
					else if (net_taxable_income >= 29000.0 && net_taxable_income <= 29999.99) { return  1066.0 + (net_net_taxable_income - 28999.99) * 0.050; }
					else if (net_taxable_income >= 30000.0 && net_taxable_income <= 30999.99) { return  1116.0 + (net_net_taxable_income - 29999.99) * 0.050; }
					else if (net_taxable_income >= 31000.0 && net_taxable_income <= 31999.99) { return  1166.0 + (net_net_taxable_income - 30999.99) * 0.050; }
					else if (net_taxable_income >= 32000.0 && net_taxable_income <= 32999.99) { return  1216.0 + (net_net_taxable_income - 31999.99) * 0.050; }
					else if (net_taxable_income >= 33000.0 && net_taxable_income <= 33999.99) { return  1266.0 + (net_net_taxable_income - 32999.99) * 0.050; }
					else if (net_taxable_income >= 34000.0 && net_taxable_income <= 34999.99) { return  1316.0 + (net_net_taxable_income - 33999.99) * 0.050; }
					else if (net_taxable_income >= 35000.0 && net_taxable_income <= 35099.99) { return  1366.0 + (net_net_taxable_income - 34999.99) * 0.050; }
					else if (net_taxable_income >= 35100.0 && net_taxable_income <= 49999.99) { return  1371.0 + (net_net_taxable_income - 35099.99) * 0.060; }
					else if (net_taxable_income >= 50000.0 && net_taxable_income <= 68000.99) { return  2265.0 + (net_net_taxable_income - 49999.99) * 0.060; }
					else if (net_taxable_income >= 68001.0 && net_taxable_income <= 69000.99) { return  3345.0 + (net_net_taxable_income - 68000.99) * 0.060; }
					else if (net_taxable_income >= 69001.0 && net_taxable_income <= 70000.99) { return  3405.0 + (net_net_taxable_income - 69000.99) * 0.060; }
					else if (net_taxable_income >= 70001.0 && net_taxable_income <= 71000.99) { return  3465.0 + (net_net_taxable_income - 70000.99) * 0.060; }
					else if (net_taxable_income >= 71001.0 && net_taxable_income <= 72000.99) { return  3525.0 + (net_net_taxable_income - 71000.99) * 0.060; }
					else if (net_taxable_income >= 72001.0 && net_taxable_income <= 73000.99) { return  3585.0 + (net_net_taxable_income - 72000.99) * 0.060; }
					else if (net_taxable_income >= 73001.0 && net_taxable_income <= 74000.99) { return  3645.0 + (net_net_taxable_income - 73000.99) * 0.060; }
					else if (net_taxable_income >= 74001.0 && net_taxable_income <= 75000.99) { return  3705.0 + (net_net_taxable_income - 74000.99) * 0.060; }
					else if (net_taxable_income >= 75001.0 && net_taxable_income <= 76000.99) { return  3825.0 + (net_net_taxable_income - 75000.99) * 0.069; }
					else if (net_taxable_income >= 76001.0 && net_taxable_income <= 77000.99) { return  3994.0 + (net_net_taxable_income - 76000.99) * 0.069; }
					else if (net_taxable_income >= 77001.0 && net_taxable_income <= 78000.99) { return  4163.0 + (net_net_taxable_income - 77000.99) * 0.069; }
					else if (net_taxable_income >= 78001.0 && net_taxable_income <= 79000.99) { return  4332.0 + (net_net_taxable_income - 78000.99) * 0.069; }
					else if (net_taxable_income >= 79001.0 && net_taxable_income <= 80000.99) { return  4501.0 + (net_net_taxable_income - 79000.99) * 0.069; }
					else if (net_taxable_income >= 80001.0 && net_taxable_income <= 81000.99) { return  4610.0 + (net_net_taxable_income - 80000.99) * 0.069; }
					else if (net_taxable_income >= 81001.0 && net_taxable_income <= 82000.99) { return  4679.0 + (net_net_taxable_income - 81000.99) * 0.069; }
					else if (net_taxable_income >= 82001.0 && net_taxable_income <= 83000.99) { return  4748.0 + (net_net_taxable_income - 82000.99) * 0.069; }
					else if (net_taxable_income >= 83001.0 && net_taxable_income <= 84000.99) { return  4817.0 + (net_net_taxable_income - 83000.99) * 0.069; }
					else if (net_taxable_income >= 84001.0 && net_taxable_income <= 85000.99) { return  4886.0 + (net_net_taxable_income - 84000.99) * 0.069; }
					else { return 4955.0 + (net_net_taxable_income - 85000.99) * 0.069; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="B260A0FAA646913349AB5289AF98A2C4" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def tax (income)
	        return 0.0 unless (income > 0.0)
	        case (income)
		        when (0.01..4299.99): (income * 0.009)
		        when (4300.00..8399.99): ((income - 4299.99) * 0.024) + 39.00
		        when (8400.00..12599.99): ((income - 8399.99) * 0.034) + 137.00
		        when (12600.00..20999.99): ((income - 12599.99) * 0.044) + 280.00
		        when (21000.00..23999.99): ((income - 20999.99) * 0.05) + 666.00
		        when (24000.00..24999.99): ((income - 23999.99) * 0.05) + 816.00
		        when (25000.00..25999.99): ((income - 24999.99) * 0.05) + 866.00
		        when (26000.00..26999.99): ((income - 25999.99) * 0.05) + 916.00
		        when (27000.00..27999.99): ((income - 26999.99) * 0.05) + 966.00
		        when (28000.00..28999.99): ((income - 27999.99) * 0.05) + 1016.00
		        when (29000.00..29999.99): ((income - 28999.99) * 0.05) + 1066.00
		        when (30000.00..30999.99): ((income - 29999.99) * 0.05) + 1116.00
		        when (31000.00..31999.99): ((income - 30999.99) * 0.05) + 1166.00
		        when (32000.00..32999.99): ((income - 31999.99) * 0.05) + 1216.00
		        when (33000.00..33999.99): ((income - 32999.99) * 0.05) + 1266.00
		        when (34000.00..34999.99): ((income - 33999.99) * 0.05) + 1316.00
		        when (35000.00..35099.99): ((income - 34999.99) * 0.05) + 1366.00
		        when (35100.00..49999.99): ((income - 35099.99) * 0.06) + 1371.00
		        when (50000.00..68000.99): ((income - 49999.99) * 0.06) + 2265.00
		        when (68001.00..69000.99): ((income - 68000.99) * 0.06) + 3345.00
		        when (69001.00..70000.99): ((income - 69000.99) * 0.06) + 3405.00
		        when (70001.00..71000.99): ((income - 70000.99) * 0.06) + 3465.00
		        when (71001.00..72000.99): ((income - 71000.99) * 0.06) + 3525.00
		        when (72001.00..73000.99): ((income - 72000.99) * 0.06) + 3585.00
		        when (73001.00..74000.99): ((income - 73000.99) * 0.06) + 3645.00
		        when (74001.00..75000.99): ((income - 74000.99) * 0.06) + 3705.00
		        when (75001.00..76000.99): ((income - 75000.99) * 0.069) + 3825.00
		        when (76001.00..77000.99): ((income - 76000.99) * 0.069) + 3994.00
		        when (77001.00..78000.99): ((income - 77000.99) * 0.069) + 4163.00
		        when (78001.00..79000.99): ((income - 78000.99) * 0.069) + 4332.00
		        when (79001.00..80000.99): ((income - 79000.99) * 0.069) + 4501.00
		        when (80001.00..81000.99): ((income - 80000.99) * 0.069) + 4610.00
		        when (81001.00..82000.99): ((income - 81000.99) * 0.069) + 4679.00
		        when (82001.00..83000.99): ((income - 82000.99) * 0.069) + 4748.00
		        when (83001.00..84000.99): ((income - 83000.99) * 0.069) + 4817.00
		        when (84001.00..85000.99): ((income - 84000.99) * 0.069) + 4886.00
		        else (income - 85000.99) * 0.069 + 4955.00
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function tax (income)
				{
					if (income <= 0.0)
					{
						return 0.0;
					}

					if (income >= 0.01 && income <= 4299.99) { return  (income * 0.009); }
					else if (income >= 4300.00 && income <= 8399.99) { return  ((income - 4299.99) * 0.024) + 39.00; }
					else if (income >= 8400.00 && income <= 12599.99) { return  ((income - 8399.99) * 0.034) + 137.00; }
					else if (income >= 12600.00 && income <= 20999.99) { return  ((income - 12599.99) * 0.044) + 280.00; }
					else if (income >= 21000.00 && income <= 23999.99) { return  ((income - 20999.99) * 0.05) + 666.00; }
					else if (income >= 24000.00 && income <= 24999.99) { return  ((income - 23999.99) * 0.05) + 816.00; }
					else if (income >= 25000.00 && income <= 25999.99) { return  ((income - 24999.99) * 0.05) + 866.00; }
					else if (income >= 26000.00 && income <= 26999.99) { return  ((income - 25999.99) * 0.05) + 916.00; }
					else if (income >= 27000.00 && income <= 27999.99) { return  ((income - 26999.99) * 0.05) + 966.00; }
					else if (income >= 28000.00 && income <= 28999.99) { return  ((income - 27999.99) * 0.05) + 1016.00; }
					else if (income >= 29000.00 && income <= 29999.99) { return  ((income - 28999.99) * 0.05) + 1066.00; }
					else if (income >= 30000.00 && income <= 30999.99) { return  ((income - 29999.99) * 0.05) + 1116.00; }
					else if (income >= 31000.00 && income <= 31999.99) { return  ((income - 30999.99) * 0.05) + 1166.00; }
					else if (income >= 32000.00 && income <= 32999.99) { return  ((income - 31999.99) * 0.05) + 1216.00; }
					else if (income >= 33000.00 && income <= 33999.99) { return  ((income - 32999.99) * 0.05) + 1266.00; }
					else if (income >= 34000.00 && income <= 34999.99) { return  ((income - 33999.99) * 0.05) + 1316.00; }
					else if (income >= 35000.00 && income <= 35099.99) { return  ((income - 34999.99) * 0.05) + 1366.00; }
					else if (income >= 35100.00 && income <= 49999.99) { return  ((income - 35099.99) * 0.06) + 1371.00; }
					else if (income >= 50000.00 && income <= 68000.99) { return  ((income - 49999.99) * 0.06) + 2265.00; }
					else if (income >= 68001.00 && income <= 69000.99) { return  ((income - 68000.99) * 0.06) + 3345.00; }
					else if (income >= 69001.00 && income <= 70000.99) { return  ((income - 69000.99) * 0.06) + 3405.00; }
					else if (income >= 70001.00 && income <= 71000.99) { return  ((income - 70000.99) * 0.06) + 3465.00; }
					else if (income >= 71001.00 && income <= 72000.99) { return  ((income - 71000.99) * 0.06) + 3525.00; }
					else if (income >= 72001.00 && income <= 73000.99) { return  ((income - 72000.99) * 0.06) + 3585.00; }
					else if (income >= 73001.00 && income <= 74000.99) { return  ((income - 73000.99) * 0.06) + 3645.00; }
					else if (income >= 74001.00 && income <= 75000.99) { return  ((income - 74000.99) * 0.06) + 3705.00; }
					else if (income >= 75001.00 && income <= 76000.99) { return  ((income - 75000.99) * 0.069) + 3825.00; }
					else if (income >= 76001.00 && income <= 77000.99) { return  ((income - 76000.99) * 0.069) + 3994.00; }
					else if (income >= 77001.00 && income <= 78000.99) { return  ((income - 77000.99) * 0.069) + 4163.00; }
					else if (income >= 78001.00 && income <= 79000.99) { return  ((income - 78000.99) * 0.069) + 4332.00; }
					else if (income >= 79001.00 && income <= 80000.99) { return  ((income - 79000.99) * 0.069) + 4501.00; }
					else if (income >= 80001.00 && income <= 81000.99) { return  ((income - 80000.99) * 0.069) + 4610.00; }
					else if (income >= 81001.00 && income <= 82000.99) { return  ((income - 81000.99) * 0.069) + 4679.00; }
					else if (income >= 82001.00 && income <= 83000.99) { return  ((income - 82000.99) * 0.069) + 4748.00; }
					else if (income >= 83001.00 && income <= 84000.99) { return  ((income - 83000.99) * 0.069) + 4817.00; }
					else if (income >= 84001.00 && income <= 85000.99) { return  ((income - 84000.99) * 0.069) + 4886.00; }
					else { return (income - 85000.99) * 0.069 + 4955.00; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="CA14E23AC48FF5EBD2905BAD22F04AA3" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def convert_state_from_name_to_usps_abbreviation (state_name)
	        state_name = state_name.upcase.delete('^A-Z')
	        usps_abbrev = case (state_name)
		        when "ALABAMA" then "AL"
		        when "ALASKA" then "AK"
		        when "AMERICANSAMOA" then "AS"
		        when "ARIZONA" then "AZ"
		        when "ARKANSAS" then "AR"
		        when "CALIFORNIA" then "CA"
		        when "COLORADO" then "CO"
		        when "CONNECTICUT" then "CT"
		        when "DELAWARE" then "DE"
		        when "DISTRICTOFCOLUMBIA" then "DC"
		        when "FEDERATEDSTATESOFMICRONESIA" then "FM"
		        when "FLORIDA" then "FL"
		        when "GEORGIA" then "GA"
		        when "GUAM" then "GU"
		        when "HAWAII" then "HI"
		        when "IDAHO" then "ID"
		        when "ILLINOIS" then "IL"
		        when "INDIANA" then "IN"
		        when "IOWA" then "IA"
		        when "KANSAS" then "KS"
		        when "KENTUCKY" then "KY"
		        when "LOUISIANA" then "LA"
		        when "MAINE" then "ME"
		        when "MARSHALLISLANDS" then "MH"
		        when "MARYLAND" then "MD"
		        when "MASSACHUSETTS" then "MA"
		        when "MICHIGAN" then "MI"
		        when "MINNESOTA" then "MN"
		        when "MISSISSIPPI" then "MS"
		        when "MISSOURI" then "MO"
		        when "MONTANA" then "MT"
		        when "NEBRASKA" then "NE"
		        when "NEVADA" then "NV"
		        when "NEWHAMPSHIRE" then "NH"
		        when "NEWJERSEY" then "NJ"
		        when "NEWMEXICO" then "NM"
		        when "NEWYORK" then "NY"
		        when "NORTHCAROLINA" then "NC"
		        when "NORTHDAKOTA" then "ND"
		        when "NORTHERNMARIANAISLANDS" then "MP"
		        when "OHIO" then "OH"
		        when "OKLAHOMA" then "OK"
		        when "OREGON" then "OR"
		        when "PALAU" then "PW"
		        when "PENNSYLVANIA" then "PA"
		        when "PUERTORICO" then "PR"
		        when "RHODEISLAND" then "RI"
		        when "SOUTHCAROLINA" then "SC"
		        when "SOUTHDAKOTA" then "SD"
		        when "TENNESSEE" then "TN"
		        when "TEXAS" then "TX"
		        when "UTAH" then "UT"
		        when "VERMONT" then "VT"
		        when "VIRGINISLANDS" then "VI"
		        when "VIRGINIA" then "VA"
		        when "WASHINGTON" then "WA"
		        when "WESTVIRGINIA" then "WV"
		        when "WISCONSIN" then "WI"
		        when "WYOMING" then "WY"
		        when "" then "  "

		        else (state_name +  "  ")[0,2]
	        end

	        return (usps_abbrev)
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function convert_state_from_name_to_usps_abbreviation(state_name) {
    state_name = state_name.toUpperCase().delete(/[^A-Z]/g);
    var usps_abbrev = '';
    switch (state_name.trim()) {
        case "ALABAMA": usps_abbrev = "AL"; break;
        case "ALASKA": usps_abbrev = "AK"; break;
        case "AMERICANSAMOA": usps_abbrev = "AS"; break;
        case "ARIZONA": usps_abbrev = "AZ"; break;
        case "ARKANSAS": usps_abbrev = "AR"; break;
        case "CALIFORNIA": usps_abbrev = "CA"; break;
        case "COLORADO": usps_abbrev = "CO"; break;
        case "CONNECTICUT": usps_abbrev = "CT"; break;
        case "DELAWARE": usps_abbrev = "DE"; break;
        case "DISTRICTOFCOLUMBIA": usps_abbrev = "DC"; break;
        case "FEDERATEDSTATESOFMICRONESIA": usps_abbrev = "FM"; break;
        case "FLORIDA": usps_abbrev = "FL"; break;
        case "GEORGIA": usps_abbrev = "GA"; break;
        case "GUAM": usps_abbrev = "GU"; break;
        case "HAWAII": usps_abbrev = "HI"; break;
        case "IDAHO": usps_abbrev = "ID"; break;
        case "ILLINOIS": usps_abbrev = "IL"; break;
        case "INDIANA": usps_abbrev = "IN"; break;
        case "IOWA": usps_abbrev = "IA"; break;
        case "KANSAS": usps_abbrev = "KS"; break;
        case "KENTUCKY": usps_abbrev = "KY"; break;
        case "LOUISIANA": usps_abbrev = "LA"; break;
        case "MAINE": usps_abbrev = "ME"; break;
        case "MARSHALLISLANDS": usps_abbrev = "MH"; break;
        case "MARYLAND": usps_abbrev = "MD"; break;
        case "MASSACHUSETTS": usps_abbrev = "MA"; break;
        case "MICHIGAN": usps_abbrev = "MI"; break;
        case "MINNESOTA": usps_abbrev = "MN"; break;
        case "MISSISSIPPI": usps_abbrev = "MS"; break;
        case "MISSOURI": usps_abbrev = "MO"; break;
        case "MONTANA": usps_abbrev = "MT"; break;
        case "NEBRASKA": usps_abbrev = "NE"; break;
        case "NEVADA": usps_abbrev = "NV"; break;
        case "NEWHAMPSHIRE": usps_abbrev = "NH"; break;
        case "NEWJERSEY": usps_abbrev = "NJ"; break;
        case "NEWMEXICO": usps_abbrev = "NM"; break;
        case "NEWYORK": usps_abbrev = "NY"; break;
        case "NORTHCAROLINA": usps_abbrev = "NC"; break;
        case "NORTHDAKOTA": usps_abbrev = "ND"; break;
        case "NORTHERNMARIANAISLANDS": usps_abbrev = "MP"; break;
        case "OHIO": usps_abbrev = "OH"; break;
        case "OKLAHOMA": usps_abbrev = "OK"; break;
        case "OREGON": usps_abbrev = "OR"; break;
        case "PALAU": usps_abbrev = "PW"; break;
        case "PENNSYLVANIA": usps_abbrev = "PA"; break;
        case "PUERTORICO": usps_abbrev = "PR"; break;
        case "RHODEISLAND": usps_abbrev = "RI"; break;
        case "SOUTHCAROLINA": usps_abbrev = "SC"; break;
        case "SOUTHDAKOTA": usps_abbrev = "SD"; break;
        case "TENNESSEE": usps_abbrev = "TN"; break;
        case "TEXAS": usps_abbrev = "TX"; break;
        case "UTAH": usps_abbrev = "UT"; break;
        case "VERMONT": usps_abbrev = "VT"; break;
        case "VIRGINISLANDS": usps_abbrev = "VI"; break;
        case "VIRGINIA": usps_abbrev = "VA"; break;
        case "WASHINGTON": usps_abbrev = "WA"; break;
        case "WESTVIRGINIA": usps_abbrev = "WV"; break;
        case "WISCONSIN": usps_abbrev = "WI"; break;
        case "WYOMING": usps_abbrev = "WY"; break;
        case "": usps_abbrev = "  "; break;
        // Appending 2 spaces as a precaution against a name with length=1 case there's no match
        default: usps_abbrev = (state_name + "  ").substring(0, 2);
    }

    return (usps_abbrev);
}
      ]]></JavaScriptCode>
	</Block>
	<Block id="C9858CEE75899FEB9D362C0AA3187684" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(amount)
	        amount = amount.to_f
	        return 0.0 unless (amount > 0.0)
	        case (amount)
		        when (0.01..2550.0): amount * 0.15
		        when (2550.01..5950.0): 375.0 + ((amount - 2550.0) * 0.25)
		        when (5950.01..9050.0): 1225.0 + ((amount - 5950.0) * 0.28)
		        when (9050.01..12400.0): 2107.0 + ((amount - 9050.0) * 0.33)
		        else 3179.5 + ((amount - 12400.0) * 0.396)
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();
					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2550.0) { return amount * 0.15; }
					else if (amount >= 2550.01 && amount <= 5950.0) { return 375.0 + ((amount - 2550.0) * 0.25); }
					else if (amount >= 5950.01 && amount <= 9050.0) { return 1225.0 + ((amount - 5950.0) * 0.28); }
					else if (amount >= 9050.01 && amount <= 12400.0) { return 2107.0 + ((amount - 9050.0) * 0.33); }
					else { return 3179.5 + ((amount - 12400.0) * 0.396); }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="674160C6545378325C7AF13E71DEF107" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case taxable_income
		        when (0.01..10000.0): taxable_income * 0.18
		        when (10000.01..20000.0): ((taxable_income - 10000.0) * 0.2) + 1800.0
		        when (20000.01..40000.0): ((taxable_income - 20000.0) * 0.22) + 3800.0
		        when (40000.01..60000.0): ((taxable_income - 40000.0) * 0.24) + 8200.0
		        when (60000.01..80000.0): ((taxable_income - 60000.0) * 0.26) + 13000.0
		        when (80000.01..100000.0): ((taxable_income - 80000.0) * 0.28) + 18200.0
		        when (100000.01..150000.0): ((taxable_income - 100000.0) * 0.3) + 23800.0
		        when (150000.01..250000.0): ((taxable_income - 150000.0) * 0.32) + 38800.0
		        when (250000.01..500000.0): ((taxable_income - 250000.0) * 0.34) + 70800.0
		        when (500000.01..750000.0): ((taxable_income - 500000.0) * 0.37) + 155800.0
		        when (750000.01..1000000.0): ((taxable_income - 750000.0) * 0.39) + 248300.0
		        else ((taxable_income - 1000000.0) * 0.4) + 345800.0
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 10000.0) { return taxable_income * 0.18; }
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.0) { return ((taxable_income - 10000.0) * 0.2) + 1800.0; }
					else if (taxable_income >= 20000.01 && taxable_income <= 40000.0) { return ((taxable_income - 20000.0) * 0.22) + 3800.0; }
					else if (taxable_income >= 40000.01 && taxable_income <= 60000.0) { return ((taxable_income - 40000.0) * 0.24) + 8200.0; }
					else if (taxable_income >= 60000.01 && taxable_income <= 80000.0) { return ((taxable_income - 60000.0) * 0.26) + 13000.0; }
					else if (taxable_income >= 80000.01 && taxable_income <= 100000.0) { return ((taxable_income - 80000.0) * 0.28) + 18200.0; }
					else if (taxable_income >= 100000.01 && taxable_income <= 150000.0) { return (taxable_income - 100000.0) * 0.3) + 23800.0; }
					else if (taxable_income >= 150000.01 && taxable_income <= 250000.0) { return ((taxable_income - 150000.0) * 0.32) + 38800.0; }
					else if (taxable_income >= 250000.01 && taxable_income <= 500000.0) { return ((taxable_income - 250000.0) * 0.34) + 70800.0; }
					else if (taxable_income >= 500000.01 && taxable_income <= 750000.0) { return ((taxable_income - 500000.0) * 0.37) + 155800.0; }
					else if (taxable_income >= 750000.01 && taxable_income <= 1000000.0) { return ((taxable_income - 750000.0) * 0.39) + 248300.0; }
					else { return ((taxable_income - 1000000.0) * 0.4) + 345800.0; }
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="A6151BBAA86971CC1253B67552424C20" scripttype="JS" codetype="method">
 	<RubyCode><![CDATA[
        def compute_tax(status, taxable_income)

	        return 0.0 unless (taxable_income > 0.0)

	        case (status)

		        when ("two_and_five")

			        case (taxable_income)

				        when (0.01..16950.0): taxable_income * 0.04
				        when (16950.01..23300.0): ((taxable_income - 16950.0) * 0.045) + 678.0
				        when (23300.01..27550.0): ((taxable_income - 23300.0) * 0.0525) + 964.0
				        when (27550.01..42450.0): ((taxable_income - 27550.0) * 0.059) + 1187.0
				        when (42450.01..159350.0): ((taxable_income - 42450.0) * 0.0645) + 2066.0
				        when (159350.01..318750.0): ((taxable_income - 159350.0) * 0.0665) + 9606.0
				        when (318750.01..2125450.0): ((taxable_income - 318750.0) * 0.0685) + 20206.0
				        else ((taxable_income - 2125450.0) * 0.0882) + 143965.0
			        end

		        when ("one_and_three")

			        case (taxable_income)

				        when (0.01..8400.0): taxable_income * 0.04
				        when (8400.01..11600.0): ((taxable_income - 8400.0) * 0.045) + 336.0
				        when (11600.01..13750.0): ((taxable_income - 11600.0) * 0.0525) + 480.0
				        when (13750.01..21150.0): ((taxable_income - 13750.0) * 0.059) + 593.0
				        when (21150.01..79600.0): ((taxable_income - 21150.0) * 0.0645) + 1029.0
				        when (79600.01..212500.0): ((taxable_income - 79600.0) * 0.0665) + 4800.0
				        when (212500.01..1062650.0): ((taxable_income - 212500.0) * 0.0685) + 13637.0
				        else ((taxable_income - 1062650.0) * 0.0882) + 71873.0
			        end

		        when ("four")

			        case (taxable_income)

				        when (0.01..12700.0): taxable_income * 0.04
				        when (12700.01..17450.0): ((taxable_income - 12700.0) * 0.045) + 508.0
				        when (17450.01..20650.0): ((taxable_income - 17450.0) * 0.0525) + 722.0
				        when (20650.01..31800.0): ((taxable_income - 20650.0) * 0.059) + 890.0
				        when (31800.01..106200.0): ((taxable_income - 31800.0) * 0.0645) + 1548.0
				        when (106200.01..265600.0): ((taxable_income - 106200.0) * 0.0665) + 6346.0
				        when (265600.01..1594050.0): ((taxable_income - 265600.0) * 0.0685) + 16947.0
				        else ((taxable_income - 1594050.0) * 0.0882) + 107945.0
			        end
	        end
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_tax(status, taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					switch (status)
					{
						case "two_and_five":
							if (taxable_income >= 0.01 && taxable_income <= 16950.0) { return taxable_income * 0.04; }
							else if (taxable_income >= 16950.01 && taxable_income <= 23300.0) { return ((taxable_income - 16950.0) * 0.045) + 678.0; }
							else if (taxable_income >= 23300.01 && taxable_income <= 27550.0) { return ((taxable_income - 23300.0) * 0.0525) + 964.0; }
							else if (taxable_income >= 27550.01 && taxable_income <= 42450.0) { return ((taxable_income - 27550.0) * 0.059) + 1187.0; }
							else if (taxable_income >= 42450.01 && taxable_income <= 159350.0) { return ((taxable_income - 42450.0) * 0.0645) + 2066.0; }
							else if (taxable_income >= 159350.01 && taxable_income <= 318750.0) { return ((taxable_income - 159350.0) * 0.0665) + 9606.0; }
							else if (taxable_income >= 318750.01 && taxable_income <= 2125450.0) { return ((taxable_income - 318750.0) * 0.0685) + 20206.0; }
							else { return ((taxable_income - 2125450.0) * 0.0882) + 143965.0; }
							break;

						case "one_and_three":
							if (taxable_income >= 0.01 && taxable_income <= 8400.0) { return taxable_income * 0.04; }
							else if (taxable_income >= 8400.01 && taxable_income <= 11600.0) { return ((taxable_income - 8400.0) * 0.045) + 336.0; }
							else if (taxable_income >= 11600.01 && taxable_income <= 13750.0) { return ((taxable_income - 11600.0) * 0.0525) + 480.0; }
							else if (taxable_income >= 13750.01 && taxable_income <= 21150.0) { return ((taxable_income - 13750.0) * 0.059) + 593.0; }
							else if (taxable_income >= 21150.01 && taxable_income <= 79600.0) { return ((taxable_income - 21150.0) * 0.0645) + 1029.0; }
							else if (taxable_income >= 79600.01 && taxable_income <= 212500.0) { return ((taxable_income - 79600.0) * 0.0665) + 4800.0; }
							else if (taxable_income >= 212500.01 && taxable_income <= 1062650.0) { return ((taxable_income - 212500.0) * 0.0685) + 13637.0; }
							else { return ((taxable_income - 1062650.0) * 0.0882) + 71873.0; }
							break;

						case "four":
							if (taxable_income >= 0.01 && taxable_income <= 12700.0) { return taxable_income * 0.04; }
							else if (taxable_income >= 12700.01 && taxable_income <= 17450.0) { return ((taxable_income - 12700.0) * 0.045) + 508.0; }
							else if (taxable_income >= 17450.01 && taxable_income <= 20650.0) { return ((taxable_income - 17450.0) * 0.0525) + 722.0; }
							else if (taxable_income >= 20650.01 && taxable_income <= 31800.0) { return ((taxable_income - 20650.0) * 0.059) + 890.0; }
							else if (taxable_income >= 31800.01 && taxable_income <= 106200.0) { return ((taxable_income - 31800.0) * 0.0645) + 1548.0; }
							else if (taxable_income >= 106200.01 && taxable_income <= 265600.0) { return ((taxable_income - 106200.0) * 0.0665) + 6346.0; }
							else if (taxable_income >= 265600.01 && taxable_income <= 1594050.0) { return ((taxable_income - 265600.0) * 0.0685) + 16947.0; }
							else { return ((taxable_income - 1594050.0) * 0.0882) + 107945.0; }
							break;
					}
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="F280C32C41E58BD6BA065A453271785C" scripttype="JS" codetype="method">
		<RubyCode>
      <![CDATA[
        def num_days_months(due_date, payment_date, limit_date, fcn)
	        result = 0
	        fcn = fcn.upcase

	        if (due_date =~ /\A(\d{2})[-\/ ]?(\d{2})[-\/ ]?(\d{2})\Z/)
		        due_date = Time.gm($3, $1, $2)

		        if (payment_date =~ /\A(\d{2})[-\/ ]?(\d{2})[-\/ ]?(\d{2})\Z/)
			        payment_date = Time.gm($3, $1, $2)

			        if (fcn == "M")
				        while (due_date < payment_date)
					        result += 1
					        due_date = if (due_date.month == 12)
								        Time.gm(due_date.year+1,1,due_date.day)
							        else
								        Time.gm(due_date.year,due_date.month+1,due_date.day)
							        end
				        end
			        elsif (fcn == "D")
				        if (limit_date =~ /\A(\d{2})[-\/ ]?(\d{2})[-\/ ]?(\d{2})\Z/)
					        limit_date = Time.gm($3, $1, $2)
					        limit_date = payment_date if (payment_date < limit_date)

					        if ((due_date < payment_date) and (limit_date > due_date))
						        if (limit_date.year > due_date.year)
							        result = 365 - due_date.yday + ((is_leap_year(due_date.year) and (due_date > Time.gm(due_date.year,2,28))) ? 1 : 0)
							        (due_date.year + 1).upto(limit_date.year) { |year|
								        result += (year < limit_date.year ? 365 : limit_date.yday - ((is_leap_year(limit_date.year) and (limit_date > Time.gm(limit_date.year,2,28))) ? 1 : 0))
							        }
						        else
							        result = limit_date.yday - due_date.yday - ((is_leap_year(limit_date.year) and (limit_date.yday > 59) and (due_date.yday < 61)) ? 1 : 0)
						        end
					        end		
				        end
			        end
		        end
	        end
	        return result
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function num_days_months(due_date, payment_date, limit_date, fcn)
				{
					var result = 0;
					fcn = fcn.toUpperCase();

					// Check dates for proper format:
					//
					// The $1,$2,$3 are pattern matching variables - when we match (successfully) a date, like the
					// due_date pattern below where we are checking if the due_date is in the MM, DD, and YY 
					// format, where the 2 digit components are either not separated [MMDDYY], or are hyphenated
					// [MM-DD-YY] or separated by forward slashes [MM/DD/YY], or separated by a space char
					// [MM DD YY] ]or any combination like [MM-DD/YY], [MMDD YY], etc. If future validations
					// for the supplied dates involve a 4 digit year we will have to change the regular expressions,
					// not too much time right now to do that [01/27/09].
					// 
					// parens are used to group the due_date YY, MM, and DD components so a successful match will
					// set $1 to the MM portion, the $2 will be set to the DD portion, and the $3 will be set to the
					// YY portion.
					var duedatematches = /^(\d{2})[-\/ ]?(\d{2})[-\/ ]?(\d{2})$/.exec(due_date);
					if (duedatematches != null && duedatematches.length > 0)
					{
						due_date = SFForms.Utilities.Time.gm(duedatematches[3], duedatematches[1], duedatematches[2]);

						var paymentdatematches = /^(\d{2})[-\/ ]?(\d{2})[-\/ ]?(\d{2})$/.exec(payment_date);
						if (paymentdatematches != null && paymentdatematches.length > 0)
						{
							payment_date = SFForms.Utilities.Time.gm(paymentdatematches[3], paymentdatematches[1], paymentdatematches[2]);

							// Check fcn to see if we are calculating days or months - if months, we have all the
							// info we need, there is no limit_date to deal with.
							//
							// NOTE - Vermont interprets partial months as follows:
							//
							// For a due date of 04/15/06 and a payment date of 04/16/06, the number of months
							// would be 1. This would hold up to and including 05/15/06. On 05/16/06, the number
							// of months would be 2, and so on.
							if (fcn == "M")
							{
								while (due_date < payment_date)
								{
									// Run the due_date up to the payment date, counting the months.
									result += 1;
									if (due_date.mon() == 12)
									{
										due_date = SFForms.Utilities.Time.gm(due_date.year() + 1, 1, due_date.day());
									}
									else
									{
										due_date = SFForms.Utilities.Time.gm(due_date.year(), due_date.mon() + 1, due_date.day());
									}
								}
							}
							else if (fcn == "D")
							{
								var limitdatematches = /^(\d{2})[-\/ ]?(\d{2})[-\/ ]?(\d{2})$/.exec(limit_date);
								if (limitdatematches != null && limitdatematches.length > 0)
								{
									limit_date = SFForms.Utilities.Time.gm(limitdatematches[3], limitdatematches[1], limitdatematches[2]);
									if (payment_date < limit_date)
									{
										limit_date = payment_date;
									}
					
									// Check if we can proceed:
									if ((due_date < payment_date) && (limit_date > due_date))
									{
										// Need to handle Leap Years, the state does not include that pesky
										// extra day in February. We need to check when taking the difference
										// between two dates whether we are straddling 02/28/YY AND it is
										// a leap year.
										if (limit_date.year() > due_date.year())
										{
											// Need to calculate number of days from the due date to the end of the due date year, then
											// add remaining days in the range.
											result = 365 - due_date.dayOfYear() + ((is_leap_year(due_date.year()) && (due_date > SFForms.Utilities.Time.gm(due_date.year(),2,28))) ? 1 : 0);

											// Now run thru the remaining years, adding up the days.
											for (var year = due_date.year() + 1; year <= limit_date.year(); year++)
											{
												// If we are adding an entire years worth of days we can just always add 365,
												// no need to check for a leap year. Else, we need to decrement the limit_date.yday
												// by 1 IF it is past 02/28/YY in a leap year.
                        result += (year < limit_date.year() ? 365 : limit_date.dayOfYear() - ((is_leap_year(limit_date.year()) && (limit_date > SFForms.Utilities.Time.gm(limit_date.year(),2,28))) ? 1 : 0));
											}
										}
										else
										{
											// The year is the same for both dates, need to check if we are
											// straddling 02/28/YY IF we are in a leap year.
                      result = limit_date.dayOfYear() - due_date.dayOfYear() - ((is_leap_year(limit_date.year()) && (limit_date.dayOfYear() > 59) && (due_date.dayOfYear() < 61)) ? 1 : 0);
										}
									}		
								}
							}
						}
					}
					
					return result;
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="39E571BA0115E09A0566AD2DBFA475EF" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)
	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 
	        year_end = year_end.to_i

	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        if ((due_mon == 1) and (due_day == 16) and (due_year == 2017))
		        due_day = 17
	        end
	
	        if ((due_mon == 4) and (due_day == 15) and (due_year == 2016))
		        due_day = 18
	        end

	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_due_date(id, mon_end, year_end, coupon)
				{
					var coupon_intervals = [4, 6, 9, 12, 4];
					var liability_intervals = [3, 6, 9, 12, 12];
					var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
					
					// Check arguments first.
					if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
					{
						return '00000000';
					}

					year_end = year_end.to_i();
					
					// We will index into the interval arrays with this.
					var coupon_adj = coupon - 1;
					var year_adj;
					var mon_adj;
					var due_year;
					var due_day;
					var mod_mon;
					var due_mon;
					
					switch (id)
					{
						case 1:
							// Computing Liability Due Date. These fall on the last day of the month.
							year_adj = year_end - 1;
							mon_adj = mon_end + liability_intervals[coupon_adj];
							due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
							mod_mon = mon_adj % 12;
							due_mon = ( mod_mon > 0 ? mod_mon : 12);
							if (due_mon == 2)
							{
								due_day = (is_leap_year(due_year) ? 29 : 28);
							}
							else
							{
								due_day = days_in_month[due_mon - 1];
							}
							break;
						case 2:
							// Computing Coupon Due Date.
							year_adj = (coupon < 5 ? year_end - 1 : year_end);
							mon_adj = mon_end + coupon_intervals[coupon_adj];
							due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
							mod_mon = mon_adj % 12;
							due_mon = (mod_mon > 0 ? mod_mon : 12);
							due_day = (coupon < 5 ? 20 : 15);

							// Correct the Coupon due dates so that they do not fall on a weekend.
							// t.wday == 6 is Saturday, Sunday == 0.
							var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
							if (t.wday() == 6)
							{
								due_day += 2;
							}
							else if (t.wday() == 0)
							{
								due_day += 1;
							}
							else
							{
								due_day += 0;
							}
							break;
					}

					// Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
					// in future years (or an algorithm could be written for it). Test the due dates and if one comes
					// out different from the chart in the instructions, put in the computed due month, day and year
					// which showed as wrong and adjust the day to match the chart.
					 
					//-###########################################################
					//IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
					//-###########################################################
					//Each year when this form comes through the voucher number and year ending must be entered and checked
					//in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
					//dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
					//-###########################################################

					//This offsets the due day for individual due dates that come up incorrect because of a holiday. 
					//In the algorithm below, using the due date that is showing on the form, put the month, date, and
					//year of the due date showing on the form in the variables below. In the variable labeled due_day
					//set the day equal to the correct day that is showing in the specs. For example, if the due day that
					//is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

					// Note 09/30/14: Offset below is for MLK Jr holiday which needed to adjusted from
					// 01/16/2017 to 01/17/2017.
					if ((due_mon == 1) && (due_day == 16) && (due_year == 2017))
					{
						due_day = 17;
					}
					
					if ((due_mon == 4) && (due_day == 15) && (due_year == 2016))
					{
						due_day = 18;
					}

					// Prepare due date for return - string with no '/'s.
					return due_mon.complexFixedString(0, '02') + due_day.toString() + due_year.toString();
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="A0B70AC7736BEFE72CD4E0E40A95B485" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def process_alpha_fields(element, field_length, no_titles, no_padding)
	        element = element.upcase.strip
	        return '' if (element.strip.empty?)
	        element = $'.strip if (element  =~ /^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /) if no_titles

	        #
	        # We have stripped out invalid titles & following space. If we are padding, we also ensure the return value is of the
	        # proper length, padded in the front with space characters; otherwise, we just return the element.
	        #
	        return (no_padding ? element[0,field_length] : (" " * ([field_length - element.length,0].max) + element[0,field_length]))
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function process_alpha_fields(elmnt, field_length, no_titles, no_padding)
				{
					elmnt = elmnt.toUpperCase().trim();
					if (elmnt.trim().isEmpty())
					{
						return '';
					}
					
					if (no_titles)
					{
						elmnt = elmnt.replace(/^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /g, '');
					}

					// We have stripped out invalid titles & following space. If we are padding, we also ensure the return value is of the
					// proper length, padded in the front with space characters; otherwise, we just return the elmnt.
          var len = 0;
          if (field_length - elmnt.length > 0)
          {
            len = field_length - elmnt.length;
          }
					return (no_padding ? elmnt.substring(0,field_length) : (" ".repeat(len) + elmnt.substring(0,field_length)));
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="12FCC64C19195DE3CD3F4CB0AA8B98F7" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def due_date(date, vouch)
	        if ((date =~ /^(0[1-9]|1[012])\d\d(\d{4})$/) and ((1..4) === vouch))
		        if ($1.to_i < 12)
			        mon = $1.succ.to_i
			        yr = $2.to_i - 1
		        else
			        mon = 1
			        yr = $2.to_i
		        end

		        mon = mon + vouch * 3 - ([1,4].include?(vouch) ? 0 : 1)

		        if (mon > 12)
			        yr += 1
			        mon = mon -12
		        end
	        return "#{'%02i' % mon}/15/#{yr}"
	        end
	        ""
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function due_date(date, vouch)
				{
					var matches = /^(0[1-9]|1[012])\d\d(\d{4})$/.exec(date);
					if (matches != null && matches.length > 0 && (vouch >= 1 && vouch <= 4))
					{
						var mon;
						var yr;
						
						// First set the STARTING mon and year for the twelve month year period.
						// For example, a supplied twelve month year ended date of "04302012"
						// would give us a starting date of "05012011". Note that we do not care
						// about the day, just using "01" as an example here could be "99" for all we care.
						if (matches[1].to_i() < 12)
						{
							mon = matches[1].succ().to_i();
							yr = matches[2].to_i() - 1;
						}
						else
						{
							mon = 1;
							yr = matches[2].to_i();
						}

						// Now adjust the month forward from the starting date based on voucher number:
						mon = mon + vouch * 3 - ((vouch == 1 || vouch == 4) ? 0 : 1);

						// Check if we need to correct the year and month:
						if (mon > 12)
						{
							yr += 1;
							mon = mon - 12;
						}

						return (mon.complexFixedString(0, '02') + "/15/" + yr.toString());
					}

					return "";
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="090EE0C756F879CB44CFCADA157C9961" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def process_id(id)
	        sum = 0
	        mult = "0"
	        id = id.delete(" -")
	        return [0, "0" * 9] unless (id =~ /^(CT|TF|NY|\d\d)\d{7}$/)
	        id.each_byte do |dec| sum += ((dec - ((48..57) === dec ? 48 : 55)) * mult.succ!.to_i) end
	        [9 - (sum % 9), id]
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function process_id(id)
				{
					var sum = 0;
					//var mult = '0';
					var mult = 0;
					
					id = id.delete(/[ -]/g);

					if (!(/^(CT|TF|NY|\d\d)\d{7}$/.test(id)))
					{
						return [0, '000000000'];
					}

					for (var idx = 0; idx < id.length; idx++)
					{
						var dec = id.charCodeAt(idx);
						//mult = mult.succ().to_i();
						sum += ((dec - ((dec >= 48 && dec <= 57) ? 48 : 55)) * (++mult));
					}
					
					return [9 - (sum % 9), id];
				}
      ]]></JavaScriptCode>
	</Block>
	<Block id="8755BCC9852A2D7F43CB9222B8CC00EA" scripttype="JS" codetype="method">
		<RubyCode><![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)
	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 
	        year_end = year_end.to_i

	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        if ((due_mon == 4) and (due_day == 17) and (due_year == 2017))
		        due_day = 18
	        end

	        if ((due_mon == 2) and (due_day == 20) and (due_year == 2017))
		        due_day = 21
	        end

	        if ((due_mon == 1) and (due_day == 15) and (due_year == 2018))
		        due_day = 16
	        end

	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
		<JavaScriptCode><![CDATA[
				function compute_due_date(id, mon_end, year_end, coupon)
				{
					var coupon_intervals = [4, 6, 9, 12, 4];
					var liability_intervals = [3, 6, 9, 12, 12];
					var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
					
					// Check arguments first.
					if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
					{
						return '00000000';
					}

					year_end = year_end.to_i();
					
					// We will index into the interval arrays with this.
					var coupon_adj = coupon - 1;
					var year_adj;
					var mon_adj;
					var due_year;
					var due_day;
					var mod_mon;
					var due_mon;
					
					switch (id)
					{
						case 1:
							// Computing Liability Due Date. These fall on the last day of the month.
							year_adj = year_end - 1;
							mon_adj = mon_end + liability_intervals[coupon_adj];
							due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
							mod_mon = mon_adj % 12;
							due_mon = ( mod_mon > 0 ? mod_mon : 12);
							if (due_mon == 2)
							{
								due_day = (is_leap_year(due_year) ? 29 : 28);
							}
							else
							{
								due_day = days_in_month[due_mon - 1];
							}
							break;
						case 2:
							// Computing Coupon Due Date.
							year_adj = (coupon < 5 ? year_end - 1 : year_end);
							mon_adj = mon_end + coupon_intervals[coupon_adj];
							due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
							mod_mon = mon_adj % 12;
							due_mon = (mod_mon > 0 ? mod_mon : 12);
							due_day = (coupon < 5 ? 20 : 15);

							// Correct the Coupon due dates so that they do not fall on a weekend.
							// t.wday == 6 is Saturday, Sunday == 0.
							var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
							if (t.wday() == 6)
							{
								due_day += 2;
							}
							else if (t.wday() == 0)
							{
								due_day += 1;
							}
							else
							{
								due_day += 0;
							}
							break;
					}

					// Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
					// in future years (or an algorithm could be written for it). Test the due dates and if one comes
					// out different from the chart in the instructions, put in the computed due month, day and year
					// which showed as wrong and adjust the day to match the chart.
					   //-###########################################################
					   //IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
					   //-###########################################################
					   //Each year when this form comes through the voucher number and year ending must be entered and checked
					   //in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
					   //dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
					   //-###########################################################

					// This offsets the due day for individual due dates that come up incorrect because of a holiday. 
					// In the algorithm below, using the due date that is showing on the form, put the month, date, and
					// year of the due date showing on the form in the variables below. In the variable labeled due_day
					// set the day equal to the correct day that is showing in the specs. For example, if the due day that
					// is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

					// Note 09/30/14: Offset below is for Martin Luther King Day holiday which needed to be adjusted 
					// from 01/16/2017 to 01/17/2017.
					//~ if ((due_mon == 1) and (due_day == 16) and (due_year == 2017))
						//~ due_day = 17
					//~ end
					
					// 10/23/15 [kames]: For year ending 1/17 voucher number 5 it says date voucher due is 4/18/17. 
					// when I ran the display_compute_dates it came up with 4/17/17. I'm not sure why its different.
					// 4/17/17 is not a weekend or a holiday.

					// Note 10/23/15: Offset below is different then what i came up with in the display_compute_date
					// which needed to be adjusted from 04/17/2017 to 04/18/2017.
					if ((due_mon == 4) && (due_day == 17) && (due_year == 2017))
					{
						due_day = 18;
					}

					// Note 10/23/15: Offset below is for President's Day holiday which needed to be adjusted 
					// from 02/20/2017 to 02/21/2017.
					if ((due_mon == 2) && (due_day == 20) && (due_year == 2017))
					{
						due_day = 21;
					}

					// Note 10/23/15: Offset below is for Martin Luther King Day holiday which needed to be adjusted 
					// from 01/15/2018 to 01/16/2018.
					if ((due_mon == 1) && (due_day == 15) && (due_year == 2018))
					{
						due_day = 16;
					}

					// Prepare due date for return - string with no '/'s.
					return due_mon.complexFixedString(0, '02') + due_day.toString() + due_year.toString();
				}
      ]]></JavaScriptCode>
	</Block>
  <Block id="159453F703F02384936966FAB94BD28F" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Using personal information.
		        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
		        address1 = profile.address
		        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        else
		        return
	        end
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
				    // Using personal information.
				    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
				    address1 = profile.address;
				    if (!profile.apartment_number.trim().isEmpty())
				    {
					    address2 = 'Apt. #' + profile.apartment_number;
				    }
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
		            address2 = address3;
		            address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="D6E84B2D29F69719FFBAAC6C45424482" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use Firm name if available and business = true.
		        # Use Preparer name if the Preparer is self-employed and business = false.
		        if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
			        name = profile.firm_name
		        else
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
				        address2 = address3			address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)

				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
				      // Using personal information.
				      name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
				      address1 = profile.address;
				      if (!profile.apartment_number.trim().isEmpty())
				      {
					      address2 = 'Apt. #' + profile.apartment_number;
				      }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
				    // Use Firm name if available and business = true.
				    // Use Preparer name if the Preparer is self-employed and business = false.
				    if (!profile.firm_name.trim().isEmpty() && ((profile.self_employed.trim().isEmpty()) || (!profile.self_employed.trim().isEmpty() && business)))
				    {
					    name = profile.firm_name;
				    }
				    else
				    {
  					  name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
			      // Use entity name if available.
			      if (profile.applicant_entity_name.trim().isEmpty())
			      {
				      name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
			      }
			      else
			      {
				      name = profile.applicant_entity_name;
			      }

			      address1 = profile.applicant_address;
			      if (!profile.applicant_po_box.trim().isEmpty())
			      {
				      address2 = 'P.O. Box ' + profile.applicant_po_box;
			      }
			      address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
		            address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="F2C3261C5ECBDCB1152D6BE8CA98879D" scripttype="TS" codetype="method">
    <RubyCode>
      <![CDATA[
				def check_digit1(input, multiplier, modulus, sum_digits = false, rtl = false)
					# Correct input arguments.
					input = input.to_s
					multiplier = multiplier.to_s
					modulus = modulus.to_i
					sum_digits = false unless sum_digits.kind_of? TrueClass
					rtl = false unless rtl.kind_of? TrueClass
					
					# Create multiplier string.
					extra = input.length % multiplier.length
					if rtl
						multiplier.reverse! 
						multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
					else
						multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
					end
					
					# Generate the sum.
					sum = 0
					0.upto(input.length-1) { |i|
						step = input[i, 1].to_i * multiplier[i, 1].to_i
						# Do they want sum of the products, or sum of the product digits?
						if (sum_digits)
							sum += step % 10 + step / 10
						else
							sum += step
						end
					}


				#modified this value due to check digit only wants the units position of the sum
					# Value to return as a single digit integer.
					(sum % 10).to_s[-1,1]	

					
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
		{
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// modified this value due to check digit only wants the units position of the sum
			return (sum % 10).toString();
		}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="0306268CF18D8508D21F93A7895F5C83" scripttype="TS" codetype="method">
    <RubyCode>
      <![CDATA[
        def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
	        # Correct input arguments.
	        input = input.to_s
	        multiplier = multiplier.to_s
	        modulus = modulus.to_i
	        sum_digits = false unless sum_digits.kind_of? TrueClass
	        rtl = false unless rtl.kind_of? TrueClass
	
	        # Create multiplier string.
	        extra = input.length % multiplier.length
	        if rtl
		        multiplier.reverse! 
		        multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
	        else
		        multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
	        end
	
	        # Generate the sum.
	        sum = 0
	        0.upto(input.length-1) { |i|

		        #
		        # Converting via amap_6( ) here:
		        #
		        step = amap_6(input[i, 1]).to_i * multiplier[i, 1].to_i

		        # Do they want sum of the products, or sum of the product digits?
		        if (sum_digits)
			        sum += step % 10 + step / 10
		        else
			        sum += step
		        end
	        }

	        # Value to return as a single digit integer.
	        ((modulus - (sum % modulus)) % modulus) % 10
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
		{
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = amap_6(inputStr.substr(i, 1)) * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// Value to return as a single digit integer.
			return ((modulusInt - (sum % modulusInt)) % modulusInt) % 10;
		}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="528BE87544C0914A4B2A00AE87A1F879" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)

	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        #
			        # Correct the Coupon due dates so that they do not fall on a weekend.
			        # t.wday == 6 is Saturday, Sunday == 0.
			        #
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        #
	        # Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        # in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        # out different from the chart in the instructions, put in the computed due month, day and year
	        # which showed as wrong and adjust the day to match the chart.
	        #		
	 
               #-###########################################################
               #IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
               #-###########################################################
               #Each year when this form comes through the voucher number and year ending must be entered and checked
               #in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
               #dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
               #-###########################################################

                #This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        #In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        #year of the due date showing on the form in the variables below. In the variable labeled due_day
	        #set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        #is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

	        #
	        # Note 09/29/16: Offset below is for Emancipation day holiday which needed to adjusted from
	        # 04/15/2017 to 04/18/2017.
	        #
	
	        if ((due_mon == 4) and (due_day == 17) and (due_year == 2017))
		        due_day = 18
	        end
			
	        if ((due_mon == 1) and (due_day == 15) and (due_year == 2018))
		        due_day = 16
	        end
	
	        #
	        # Prepare due date for return - string with no '/'s.
	        #
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        // 528BE87544C0914A4B2A00AE87A1F879
		    function compute_due_date(id, mon_end, year_end, coupon)
        {
	        var coupon_intervals = [4, 6, 9, 12, 4];
	        var liability_intervals = [3, 6, 9, 12, 12];
	        var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	
	        // Check arguments first.
	        if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
	        {
		        return '00000000';
	        }

	        year_end = year_end.to_i();
	
	        //We will index into the interval arrays with this.
	        var coupon_adj = coupon - 1;
	
	        var year_adj;
	        var mon_adj;
	        var due_year;
	        var mod_mon;
	        var due_mon;
	        var due_day;
	        if (id == 1)
	        {		
		        // Computing Liability Due Date. These fall on the last day of the month.
		        year_adj = year_end - 1;
		        mon_adj = mon_end + liability_intervals[coupon_adj];
		        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
		        mod_mon = mon_adj % 12;
		        due_mon = ( mod_mon > 0 ? mod_mon : 12);
		        if (due_mon == 2)
		        {
			        due_day = (is_leap_year(due_year) ? 29 : 28);
		        }
		        else 
		        {
			        due_day = days_in_month[due_mon - 1];
		        }
	        }
	        else if (id == 2)
	        {
				    // Computing Coupon Due Date.
				    year_adj = (coupon < 5 ? year_end - 1 : year_end);
				    mon_adj = mon_end + coupon_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = (mod_mon > 0 ? mod_mon : 12);
				    due_day = (coupon < 5 ? 20 : 15);

				    // Correct the Coupon due dates so that they do not fall on a weekend.
				    // t.wday == 6 is Saturday, Sunday == 0.
				    var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
				    if (t.wday() == 6)
				    {
					    due_day += 2;
				    }
				    else if (t.wday() == 0)
				    {
					    due_day += 1;
				    }
	        }

	        // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        // in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        // out different from the chart in the instructions, put in the computed due month, day and year
	        // which showed as wrong and adjust the day to match the chart.
	 
	        //-###########################################################
	        //IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
	        //-###########################################################
	        //Each year when this form comes through the voucher number and year ending must be entered and checked
	        //in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
	        //dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
	        //-###########################################################

	        //This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        //In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        //year of the due date showing on the form in the variables below. In the variable labeled due_day
	        //set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        //is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

			    // Note 09/29/16: Offset below is for Emancipation day holiday which needed to adjusted from
			    // 04/15/2017 to 04/18/2017.
	        if ((due_mon == 4) && (due_day == 17) && (due_year == 2017))
	        {
		        due_day = 18;
	        }

	        if ((due_mon == 1) && (due_day == 15) && (due_year == 2018))
	        {
		        due_day = 16;
	        }

	        // Prepare due date for return - string with no '/'s.
	        return due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="D0798AA7A93042EE3CE6690F11698C04" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(amount)
	        if (amount > 11650.0) then 3011.50 + ((amount - 11650.0) * 0.35)
	        elsif (amount > 8500.0) then 1972.0 + ((amount - 8500.0) * 0.33)
	        elsif (amount > 5600.0) then 1160.0 + ((amount - 5600.0) * 0.28)
	        elsif (amount > 2400.0) then 360.0 + ((amount - 2400.0) * 0.25)
	        elsif (amount > 0.0) then amount * 0.15
	        else 0.0
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					if (amount > 11650.0)
					{
						return 3011.50 + ((amount - 11650.0) * 0.35);
					}
					else if (amount > 8500.0)
					{
						return 1972.0 + ((amount - 8500.0) * 0.33);
					}
					else if (amount > 5600.0)
					{
						return 1160.0 + ((amount - 5600.0) * 0.28);
					else if (amount > 2400.0)
					{
						return 360.0 + ((amount - 2400.0) * 0.25);
					}
					else if (amount > 0.0)
					{
						return amount * 0.15;
					}
					else
					{
						return 0.0;
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="0B96D8BD4922D9510CCC0C932AADC26B" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.last_name + ' ' + profile.first_name + ' ' + profile.middle_initial
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
				      // Using personal information.
				      name = profile.last_name + ' ' + profile.first_name + ' ' + profile.middle_initial;
				      address1 = profile.address;
				      if (!profile.apartment_number.trim().isEmpty())
				      {
					      address2 = 'Apt. #' + profile.apartment_number;
				      }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
				    // Use Firm name if available
				    if (!profile.firm_name.trim().isEmpty())
				    {
					    name = profile.firm_name;
				    }
				    else
				    {
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }

				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
					      address2 = address3;
					      address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="8FF8097C28794638E156878C9770B1A3" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.last_name + (profile.first_name.strip.empty? ? '' : ',') + ' ' + profile.first_name + ' ' + profile.middle_initial
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.last_name + ' ' + profile.first_name + ' ' + profile.middle_initial
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_last_name + ' ' + (profile.applicant_suffix.empty? ? '' : profile.applicant_suffix) + ' ' + profile.applicant_first_name + ' ' + profile.applicant_middle_initial
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
				      // Using personal information.
				      name = profile.last_name + ' ' + (profile.first_name.trim().isEmpty() ? '' : ',') + ' ' + profile.first_name + ' ' + profile.middle_initial;
				      address1 = profile.address;
				      if (!profile.apartment_number.trim().isEmpty())
				      {
					      address2 = 'Apt. #' + profile.apartment_number;
				      }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
				    // Use Firm name if available
				    if (!profile.firm_name.trim().isEmpty())
				    {
					    name = profile.firm_name;
				    }
				    else
				    {
					    name = profile.last_name + ' ' + profile.first_name + ' ' + profile.middle_initial;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_last_name + ' ' + (profile.applicant_suffix.isEmpty() ? '' : profile.applicant_suffix) + ' ' + profile.applicant_first_name + ' ' + profile.applicant_suffix;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }

				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
					      address2 = address3;
					      address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="855F4CEBD2EE1C6DBEE3788FD66DBBD0" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use Firm name if available and business = true.
		        # Use Preparer name if the Preparer is self-employed and business = false.
		        if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
			        name = profile.firm_name
		        else
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
				        // Using personal information.
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				        address1 = profile.address;
				        if (!profile.apartment_number.trim().isEmpty())
				        {
					        address2 = 'Apt. #' + profile.apartment_number;
				        }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
				    // Use Firm name if available and business = true.
				    // Use Preparer name if the Preparer is self-employed and business = false.
				    if (!profile.firm_name.trim().isEmpty() && ((profile.self_employed.trim().isEmpty()) || (!profile.self_employed.trim().isEmpty() && business)))
				    {
					    name = profile.firm_name;
				    }
				    else
				    {
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }

				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
					      address2 = address3;
					      address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="B5274617039A7B33427022EFF09E4EE9" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
				        // Using personal information.
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
				        address1 = profile.address;
				        if (!profile.apartment_number.trim().isEmpty())
				        {
					        address2 = 'Apt. #' + profile.apartment_number;
				        }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
				    // Use Firm name if available
				    if (!profile.firm_name.trim().isEmpty())
				    {
					    name = profile.firm_name;
				    }
				    else
				    {
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }

				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
					      address2 = address3;
					      address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="08971EA44803A3ADFDCDAE4187AB13D3" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if ((profile.business_address.strip.empty?) and (profile.business_address2.strip.empty?))
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if ((profile.business_address.trim().isEmpty() && (profile.business_address2.trim().isEmpty()))
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
				        // Using personal information.
				        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
				        address1 = profile.address;
				        if (!profile.apartment_number.trim().isEmpty())
				        {
					        address2 = 'Apt. #' + profile.apartment_number;
				        }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
					      address2 = address3;
					      address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="B3D36DC842E584148CD6461BB64E08E4" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix + (profile.spouse_first_name.strip.empty? ? '' : ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix)

			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use Firm name if available and business = true.
		        # Use Preparer name if the Preparer is self-employed and business = false.
		        if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
			        name = profile.firm_name
		        else
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
				        // Using personal information.
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix + (profile.spouse_first_name.trim().isEmpty() ? '' : ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix);
				        address1 = profile.address;
				        if (!profile.apartment_number.trim().isEmpty())
				        {
					        address2 = 'Apt. #' + profile.apartment_number;
				        }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
				    // Use Firm name if available and business = true.
				    // Use Preparer name if the Preparer is self-employed and business = false.
				    if (!profile.firm_name.trim().isEmpty() && ((profile.self_employed.trim().isEmpty()) || (!profile.self_employed.trim().isEmpty() && business)))
				    {
					    name = profile.firm_name;
				    }
				    else
				    {
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }

				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
					      address2 = address3;
					      address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="0C7A2B1B5B01FB866E8F652E223C45D0" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
        {
	        if (typeof business === 'undefined')
	        {
	          business = false;
	        }
	        var name = '';
	        var address1 = '';
	        var address2 = '';
	        var address3 = '';
	
	        if (profile instanceof SFForms.Profiles.Individual)
	        {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
				        // Using personal information.
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				        address1 = profile.address;
				        if (!profile.apartment_number.trim().isEmpty())
				        {
					        address2 = 'Apt. #' + profile.apartment_number;
				        }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
	        }
	        else if (profile instanceof SFForms.Profiles.Entity)
	        {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Preparer)
	        {
				    // Use Firm name if available
				    if (!profile.firm_name.trim().isEmpty())
				    {
					    name = profile.firm_name;
				    }
				    else
				    {
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
	        }
	        else if (profile instanceof SFForms.Profiles.Fcc)
	        {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }

				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
	        }
	        else
	        {
	          return;
	        }
	
	        name = name.squeeze(' ').trim();
	        address1 = address1.squeeze(' ').trim();
	        address2 = address2.squeeze(' ').trim();
	        address3 = address3.squeeze(' ').trim();
		
	        // Decide what lines are output.
	        switch (lines.length)
	        {
	          case 1:
		          name += ' ' + address1 + ' ' + address2 + ' ' + address3;
		          name = name.squeeze(' ').trim();
		          address1 = '';
		          address2 = '';
		          address3 = '';
		          break;
	          case 2:
		          address1 += ' ' + address2 + ' ' + address3;
		          address1 = address1.squeeze(' ').trim();
		          address2 = '';
		          address3 = '';
		          break;
	          case 3:
		          address1 += ' ' + address2;
		          address1 = address1.squeeze(' ').trim();
		          address2 = address3;
		          address3 = '';
		          break;
	          case 4:
		          if (address2.isEmpty())
		          {
					      address2 = address3;
					      address3 = '';
		          }
		          break;
	        }
	
	        if (!name.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
	        }
	        if (!address1.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
	        }
	        if (!address2.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
	        }
	        if (!address3.trim().isEmpty()) {
		        SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="6E121E9C44F8F0D1AF78732E417ABC40" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function name_block(profile, business, lines)
		    {
			    if (typeof business === 'undefined')
			    {
				    business = false;
			    }
			    var name = '';
			    var address1 = '';
			    var address2 = '';
			    var address3 = '';
	
			    if (profile instanceof SFForms.Profiles.Individual)
			    {
				    // Decide if profile's business or personal information should be used.
				    if (business && !profile.business_name.trim().isEmpty())
				    {
					    // Use business information.
					    name = profile.business_name;
					    if (profile.business_address.trim().isEmpty())
					    {
						    address1 = profile.address;
						    if (!profile.apartment_number.trim().isEmpty())
						    {
							    address2 = 'Apt. #' + profile.apartment_number;
						    }
						    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					    }
					    else
					    {
						    address1 = profile.business_address;
						    address2 = profile.business_address2;
						    address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
					    }
				    }
				    else
				    {
				        // Using personal information.
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				        address1 = profile.address;
				        if (!profile.apartment_number.trim().isEmpty())
				        {
					        address2 = 'Apt. #' + profile.apartment_number;
				        }
					    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
				    }
			    }
			    else if (profile instanceof SFForms.Profiles.Entity)
			    {
				    name = profile.name;
				    address1 = profile.address;
				    address2 = profile.address2;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
			    }
			    else if (profile instanceof SFForms.Profiles.Preparer)
			    {
				    // Use Firm name if available
				    if (!profile.firm_name.trim().isEmpty())
				    {
					    name = profile.firm_name;
				    }
				    else
				    {
					    name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
				    }
				    address1 = profile.address;
				    address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
			    }
			    else if (profile instanceof SFForms.Profiles.Fcc)
			    {
				    // Use entity name if available.
				    if (profile.applicant_entity_name.trim().isEmpty())
				    {
					    name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
				    }
				    else
				    {
					    name = profile.applicant_entity_name;
				    }

				    address1 = profile.applicant_address;
				    if (!profile.applicant_po_box.trim().isEmpty())
				    {
					    address2 = 'P.O. Box ' + profile.applicant_po_box;
				    }
				    address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
			    }
			    else
			    {
				    return;
			    }

			    name = name.squeeze(' ').trim();
			    address1 = address1.squeeze(' ').trim();
			    address2 = address2.squeeze(' ').trim();
			    address3 = address3.squeeze(' ').trim();
		
			    // Decide what lines are output.
			    switch (lines.length)
			    {
				    case 1:
					    name += ' ' + address1 + ' ' + address2 + ' ' + address3;
					    name = name.squeeze(' ').trim();
					    address1 = '';
					    address2 = '';
					    address3 = '';
					    break;
				    case 2:
					    address1 += ' ' + address2 + ' ' + address3;
					    address1 = address1.squeeze(' ').trim();
					    address2 = '';
					    address3 = '';
					    break;
				    case 3:
					    address1 += ' ' + address2;
					    address1 = address1.squeeze(' ').trim();
					    address2 = address3;
					    address3 = '';
					    break;
				    case 4:
					    if (address2.isEmpty())
					    {
						    address2 = address3;
						    address3 = '';
					    }
					    break;
			    }
	
			    if (!name.trim().isEmpty()) {
				    SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
			    }
			    if (!address1.trim().isEmpty()) {
				    SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
			    }
			    if (!address2.trim().isEmpty()) {
				    SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
			    }
			    if (!address3.trim().isEmpty()) {
				    SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
			    }
		    }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="3DC9ED6A488DECAFACDFC22C978CEFD1" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def tax (income)

	        return '0.0' if (income <= 0.0)
	        case (income)
		        when (0.01..4000.0): (income * 0.01)
		
		        when (4000.0..4999.0): ((income - 3999.0) * 0.025) + 40.0
		
		        when (5000.0..5999.0): ((income - 4999.0) * 0.025) + 65.0
		
		        when (6000.0..6999.0): ((income - 5999.0) * 0.025) + 90.0
		
		        when (7000.0..7999.0): ((income - 6999.0) * 0.025) + 115.0
		
		        when (8000.0..8999.0): ((income - 7999.0) * 0.035) + 140.0
		
		        when (9000.0..9999.0): ((income - 8999.0) * 0.035) + 175.0
		
		        when (10000.0..10999.0): ((income - 9999.0) * 0.035) + 210.0
		
		        when (11000.0..11899.0): ((income - 10999.0) * 0.035) + 245.0
		
		        when (11900.0..11999.0): ((income - 11899.0) * 0.045) + 277.0
		
		        when (12000.0..12999.0): ((income - 11999.0) * 0.045) + 281.0
		
		        when (13000.0..13999.0): ((income - 12999.0) * 0.045) + 326.0
		
		        when (14000.0..14999.0): ((income - 13999.0) * 0.045) + 371.0
		
		        when (15000.0..15999.0): ((income - 14999.0) * 0.045) + 416.0
		
		        when (16000.0..16999.0): ((income - 15999.0) * 0.045) + 461.0
		
		        when (17000.0..17999.0): ((income - 16999.0) * 0.045) + 506.0
		
		        when (18000.0..18999.0): ((income - 17999.0) * 0.045) + 551.0
		
		        when (19000.0..19899.0): ((income - 19899.0) * 0.045) + 596.0
		
		        when (19900.0..19999.0): ((income - 19899.0) * 0.06) + 637.0
		
		        when (20000.0..20999.0): ((income - 19999.0) * 0.06) + 643.0
		
		        when (21000.0..21999.0): ((income - 20999.0) * 0.06) + 703.0
		
		        when (22000.0..22999.0): ((income - 21999.0) * 0.06) + 763.0
		
		        when (23000.0..23999.0): ((income - 22999.0) * 0.06) + 823.0
		
		        when (24000.0..24999.0): ((income - 23999.0) * 0.06) + 883.0
		
		        when (25000.0..25999.0): ((income - 24999.0) * 0.06) + 943.0
		
		        when (26000.0..26999.0): ((income - 25999.0) * 0.06) + 1003.0
		
		        when (27000.0..27999.0): ((income - 26999.0) * 0.06) + 1063.0
		
		        when (28000.0..28999.0): ((income - 27999.0) * 0.06) + 1123.0
		
		        when (29000.0..29999.0): ((income - 28999.0) * 0.06) + 1183.0
		
		        when (30000.0..30999.0): ((income - 29999.0) * 0.06) + 1243.0
		
		        when (31000.0..31999.0): ((income - 30999.0) * 0.06) + 1303.0
		
		        when (32000.0..32999.0): ((income - 31999.0) * 0.06) + 1363.0
		
		        when (33000.0..33199.0): ((income - 32999.0) * 0.06) + 1423.0
		
		        else ((income - 33199) * 0.07 + 1435.0)
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function tax (income)
        {
	        if (income <= 0.0)
	        {
		        return 0.0;
	        }
	
	        if (income >= 0.01 && income <= 4000.0) { return (income * 0.01); }
	        else if (income >= 4000.0 && income <= 4999.0) { return ((income - 3999.0) * 0.025) + 40.0; }
	        else if (income >= 5000.0 && income <= 5999.0) { return ((income - 4999.0) * 0.025) + 65.0; }
	        else if (income >= 6000.0 && income <= 6999.0) { return ((income - 5999.0) * 0.025) + 90.0; }
	        else if (income >= 7000.0 && income <= 7999.0) { return ((income - 6999.0) * 0.025) + 115.0; }
	        else if (income >= 8000.0 && income <= 8999.0) { return ((income - 7999.0) * 0.035) + 140.0; }
	        else if (income >= 9000.0 && income <= 9999.0) { return ((income - 8999.0) * 0.035) + 175.0; }
	        else if (income >= 10000.0 && income <= 10999.0) { return ((income - 9999.0) * 0.035) + 210.0; }
	        else if (income >= 11000.0 && income <= 11899.0) { return ((income - 10999.0) * 0.035) + 245.0; }
	        else if (income >= 11900.0 && income <= 11999.0) { return ((income - 11899.0) * 0.045) + 277.0; }
	        else if (income >= 12000.0 && income <= 12999.0) { return ((income - 11999.0) * 0.045) + 281.0; }
	        else if (income >= 13000.0 && income <= 13999.0) { return ((income - 12999.0) * 0.045) + 326.0; }
	        else if (income >= 14000.0 && income <= 14999.0) { return ((income - 13999.0) * 0.045) + 371.0; }
	        else if (income >= 15000.0 && income <= 15999.0) { return ((income - 14999.0) * 0.045) + 416.0; }
	        else if (income >= 16000.0 && income <= 16999.0) { return ((income - 15999.0) * 0.045) + 461.0; }
	        else if (income >= 17000.0 && income <= 17999.0) { return ((income - 16999.0) * 0.045) + 506.0; }
	        else if (income >= 18000.0 && income <= 18999.0) { return ((income - 17999.0) * 0.045) + 551.0; }
	        else if (income >= 19000.0 && income <= 19899.0) { return ((income - 19899.0) * 0.045) + 596.0; }
	        else if (income >= 19900.0 && income <= 19999.0) { return ((income - 19899.0) * 0.06) + 637.0; }
	        else if (income >= 20000.0 && income <= 20999.0) { return ((income - 19999.0) * 0.06) + 643.0; }
	        else if (income >= 21000.0 && income <= 21999.0) { return ((income - 20999.0) * 0.06) + 703.0; }
	        else if (income >= 22000.0 && income <= 22999.0) { return ((income - 21999.0) * 0.06) + 763.0; }
	        else if (income >= 23000.0 && income <= 23999.0) { return ((income - 22999.0) * 0.06) + 823.0; }
	        else if (income >= 24000.0 && income <= 24999.0) { return ((income - 23999.0) * 0.06) + 883.0; }
	        else if (income >= 25000.0 && income <= 25999.0) { return ((income - 24999.0) * 0.06) + 943.0; }
	        else if (income >= 26000.0 && income <= 26999.0) { return ((income - 25999.0) * 0.06) + 1003.0; }
	        else if (income >= 27000.0 && income <= 27999.0) { return ((income - 26999.0) * 0.06) + 1063.0; }
	        else if (income >= 28000.0 && income <= 28999.0) { return ((income - 27999.0) * 0.06) + 1123.0; }
	        else if (income >= 29000.0 && income <= 29999.0) { return ((income - 28999.0) * 0.06) + 1183.0; }
	        else if (income >= 30000.0 && income <= 30999.0) { return ((income - 29999.0) * 0.06) + 1243.0; }
	        else if (income >= 31000.0 && income <= 31999.0) { return ((income - 30999.0) * 0.06) + 1303.0; }
	        else if (income >= 32000.0 && income <= 32999.0) { return ((income - 31999.0) * 0.06) + 1363.0; }
	        else if (income >= 33000.0 && income <= 33199.0) { return ((income - 32999.0) * 0.06) + 1423.0; }
	        else { return ((income - 33199) * 0.07 + 1435.0); }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="C021532F592B8619FA106EC67CB0622E" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(a)
	        a = a.to_f
	        (a > 250000.0 ? (a - 250000.0) * 0.076 : 0) + (a > 0.0 ? [a, 250000.0].min * 0.066 : 0)
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(a)
				{
					a = a.to_f();
					return (a > 250000.0 ? (a - 250000.0) * 0.076 : 0) + (a > 0.0 ? Math.min.apply(null, [a, 250000.0]) * 0.066 : 0);
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="149BF68D4B19E79005E110F8ADFA994B" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def amap_6(a)

					case (a)
						when ("0".."9"): a.to_i
						when ("A".."I"): a[0] - 64
						when ("J".."R"): a[0] - 73
						when ("S".."Z"): a[0] - 81
						when ("/"): 1
						else 0
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function amap_6(a)
				{
					if (a >= "0" && a <= "9") { return a.to_i(); }
					else if (a >= "A" && a <= "I") { return a.charCodeAt(0) - 64; }
					else if (a >= "J" && a <= "R") { return a.charCodeAt(0) - 73; }
					else if (a >= "S" && a <= "Z") { return a.charCodeAt(0) - 81; }
					else if (a == "/") { return 1; }
					else { return 0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="F760459601CF0616169D67D9D5BEF2DC" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def single_tax(value)
					return 0.0 if (value <= 0.0)
					case value
						when (0.01..23100.0) then 0.0535 * value
						when (23100.01..75890.0) then 1235.85 + 0.0705 * (value - 23100.0)
						else 4957.55 + 0.0785 * (value - 75890.0)
						end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function single_tax(value)
				{
					if (value <= 0.0)
					{
						return 0.0;
					}
					
					if (value >= 0.01 && value <= 23100.0) { return 0.0535 * value; }
					else if (value >= 23100.01 && value <= 75890.0) { return 1235.85 + 0.0705 * (value - 23100.0); }
					else { return 4957.55 + 0.0785 * (value - 75890.0); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="5BA25615C15945E5AE6218047998D1F3" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_credit_rate(gross_income)							

					return 0 if (gross_income <= 0.0)

					case gross_income
						when (0.01..25000.0): 50
						when (25000.01..35000.0): 30
						else 10
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_credit_rate(gross_income)
				{
					if (gross_income <= 0.0)
					{
						return 0;
					}

					if (gross_income >= 0.01 && gross_income <= 25000.0) { return 50; }
					else if (gross_income >= 25000.01 && gross_income <= 35000.0) { return 30; }
					else { return 10; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="FDEABCACD2F5EB92E6901D163C95E094" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
			  def compute_tax(taxable_income)							
				  if (taxable_income <= 0.0) then return 0 end						
				  case taxable_income				
					  when (0.01..10000)					
						  tax = taxable_income * 0.04				
					  when (10000.01..40000)					
						  tax = ((taxable_income - 10000.0) * 0.06) + 400.0	
					  when (40000.01..350000)
						  tax = ((taxable_income - 40000.0) * 0.085) + 2200.0
					  else				
						  tax = ((taxable_income - 350000.0) * 0.0895) + 28550.0				
				  end						
				  return tax						
			  end							
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
			  function compute_tax(taxable_income)							
			  {
				  if (taxable_income <= 0.0) { return 0; }

          var tax = 0.0;
				  if (taxable_income >= 0.01 && taxable_income <= 10000) { tax = taxable_income * 0.04; }
				  else if (taxable_income >= 10000.01 && taxable_income <= 40000) { tax = ((taxable_income - 10000.0) * 0.06) + 400.0; }
				  else if (taxable_income >= 40000.01 && taxable_income <= 350000) { tax = ((taxable_income - 40000.0) * 0.085) + 2200.0; }
				  else { tax = ((taxable_income - 350000.0) * 0.0895) + 28550.0; }

				  return tax;
			  }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="4689F7A8C5AA45AF0B3F133BB67551E6" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(amount)

					amount = amount.to_f

					return 0.0 unless (amount > 0.0)

					case (amount)
						when (0.01..750.0): (amount * 0.01)
						when (750.01..2250.0): 7.5 + ((amount - 750.0) * 0.02)
						when (2250.01..3750.0): 37.5 + ((amount - 2250.0) * 0.03)
						when (3750.01..5250.0): 82.5 + ((amount - 3750.0) * 0.04)
						when (5250.01..7000.0): 142.5 + ((amount - 5250.0) * 0.05)
						else 230.00 + ((amount - 7000.0) * 0.06)
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount >= amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 750.0) { return (amount * 0.01); }
					else if (amount >= 750.01 && amount <= 2250.0) { return 7.5 + ((amount - 750.0) * 0.02); }
					else if (amount >= 2250.01 && amount <= 3750.0) { return 37.5 + ((amount - 2250.0) * 0.03); }
					else if (amount >= 3750.01 && amount <= 5250.0) { return 82.5 + ((amount - 3750.0) * 0.04); }
					else if (amount >= 5250.01 && amount <= 7000.0) { return 142.5 + ((amount - 5250.0) * 0.05); }
					else { return 230.00 + ((amount - 7000.0) * 0.06); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="418F31253C4F27B70622B7F47185A494" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_rate(household_income)

					rate = if (household_income < 0.0) then '0'
						else
							case household_income
								when (0.0..10769.99) then '1.00'
								when (10770.0..12036.99) then '0.85'
								when (12037.0..13303.99) then '0.70'
								when (13304.0..15837.99) then '0.50'
								when (15838.0..18371.99) then '0.35'
								when (18372.0..20905.99) then '0.25'
								else '0'
							end
						end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_rate(household_income)
				{
					var rate;
					
					if (household_income < 0.0) { rate = '0'; }
					else if (household_income >= 0.0 && household_income <= 10769.99) { rate = '1.00'; }
					else if (household_income >= 10770.0 && household_income <= 12036.99) { rate = '0.85'; }
					else if (household_income >= 12037.0 && household_income <= 13303.99) { rate = '0.70'; }
					else if (household_income >= 13304.0 && household_income <= 15837.99) { rate = '0.50'; }
					else if (household_income >= 15838.0 && household_income <= 18371.99) { rate = '0.35'; }
					else if (household_income >= 18372.0 && household_income <= 20905.99) { rate = '0.25'; }
					else { rate = '0'; }
						
					return rate;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="7CBDB97F87AECA81632DA39FA42E5CAB" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)							
					if (taxable_income <= 0.0) then return 0 end						
					case taxable_income						
						when (0.01...1469.01)					
							tax = taxable_income * 0.0036				
						when (1469.01...2938.01)					
							tax = ((taxable_income - 1469.0) * 0.0072) + 5.29		
						when (2938.01...5876.01)					
							tax = ((taxable_income - 2938.0) * 0.0243) + 15.87	
						when (5876.01...13221.01)					
							tax = ((taxable_income - 5876.0) * 0.045) + 87.26
						when (13221.01...22035.01)					
							tax = ((taxable_income - 13221.0) * 0.0612) + 417.79
						when (22035.01...29380.01)					
							tax = ((taxable_income - 22035.0) * 0.0648) + 957.21
						when (29380.01...44070.01)					
							tax = ((taxable_income - 29380.0) * 0.068) + 1433.17
						when (44070.01...66105.01)					
							tax = ((taxable_income - 44070.0) * 0.0792) + 2432.09		
						else					
							tax = ((taxable_income - 66105.0) * 0.0898) + 4177.26				
					end						
					return tax						
				end							
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
					var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1469.01)
						{ tax = taxable_income * 0.0036; }
					else if (taxable_income >= 1469.01 && taxable_income <= 2938.01)
						{ tax = ((taxable_income - 1469.0) * 0.0072) + 5.29; }
					else if (taxable_income >= 2938.01 && taxable_income <= 5876.01)
						{ tax = ((taxable_income - 2938.0) * 0.0243) + 15.87; }
					else if (taxable_income >= 5876.01 && taxable_income <= 13221.01)
						{ tax = ((taxable_income - 5876.0) * 0.045) + 87.26; }
					else if (taxable_income >= 13221.01 && taxable_income <= 22035.01)
						{ tax = ((taxable_income - 13221.0) * 0.0612) + 417.79; }
					else if (taxable_income >= 22035.01 && taxable_income <= 29380.01)
						{ tax = ((taxable_income - 22035.0) * 0.0648) + 957.21; }
					else if (taxable_income >= 29380.01 && taxable_income <= 44070.01)
						{ tax = ((taxable_income - 29380.0) * 0.068) + 1433.17; }
					else if (taxable_income >= 44070.01 && taxable_income <= 66105.01)
						{ tax = ((taxable_income - 44070.0) * 0.0792) + 2432.09; }
					else
						{ tax = ((taxable_income - 66105.0) * 0.0898) + 4177.26; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="D284B2094F2AA6A9E40C3137782BBFC3" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)

					return 0.0 unless (taxable_income > 0.0)

					case (taxable_income)

						when (0.01..1439.0): taxable_income * 0.0036
						when (1439.01..2878.0): ((taxable_income - 1439.0) * 0.0072) + 5.18
						when (2878.01..5756.0): ((taxable_income - 2878.0) * 0.0243) + 15.54
						when (5756.01..12951.0): ((taxable_income - 5756.0) * 0.045) + 85.48
						when (12951.01..21585.0): ((taxable_income - 12951.0) * 0.0612) + 409.26
						when (21585.01..28780.0): ((taxable_income - 21585.0) * 0.0648) + 937.66
						when (28780.01..43170.0): ((taxable_income - 28780.0) * 0.068) + 1403.90
						when (43170.01..64755.0): ((taxable_income - 43170.0) * 0.0792) + 2382.42
						else ((taxable_income - 64755.0) * 0.0898) + 4091.95
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 1439.0) { return taxable_income * 0.0036; }
					else if (taxable_income >= 1439.01 && taxable_income <= 2878.0) { return ((taxable_income - 1439.0) * 0.0072) + 5.18; }
					else if (taxable_income >= 2878.01 && taxable_income <= 5756.0) { return ((taxable_income - 2878.0) * 0.0243) + 15.54; }
					else if (taxable_income >= 5756.01 && taxable_income <= 12951.0) { return ((taxable_income - 5756.0) * 0.045) + 85.48; }
					else if (taxable_income >= 12951.01 && taxable_income <= 21585.0) { return ((taxable_income - 12951.0) * 0.0612) + 409.26; }
					else if (taxable_income >= 21585.01 && taxable_income <= 28780.0) { return ((taxable_income - 21585.0) * 0.0648) + 937.66; }
					else if (taxable_income >= 28780.01 && taxable_income <= 43170.0) { return ((taxable_income - 28780.0) * 0.068) + 1403.90; }
					else if (taxable_income >= 43170.01 && taxable_income <= 64755.0) { return ((taxable_income - 43170.0) * 0.0792) + 2382.42; }
					else { return ((taxable_income - 64755.0) * 0.0898) + 4091.95; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="A58F90F47D2F208421D043DE5AB17FF1" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(amount)

					amount = amount.to_f

					return 0.0 unless (amount > 0.0)

					case (amount)
						when (0.01..2700.0): (amount * 0.01)
						when (2700.01..4700.0): (amount * 0.02) - 27.0
						when (4700.01..7200.0): (amount * 0.03) - 74.0
						when (7200.01..9700.0): (amount * 0.04) - 146.0
						when (9700.01..12500.0): (amount * 0.05) - 243.0
						when (12500.01..16000.0): (amount * 0.06) - 368.0
						else (amount * 0.069) - 512.0
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount <= 0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2700.0) { return (amount * 0.01); }
					else if (amount >= 2700.01 && amount <= 4700.0) { return (amount * 0.02) - 27.0; }
					else if (amount >= 4700.01 && amount <= 7200.0) { return (amount * 0.03) - 74.0; }
					else if (amount >= 7200.01 && amount <= 9700.0) { return (amount * 0.04) - 146.0; }
					else if (amount >= 9700.01 && amount <= 12500.0) { return (amount * 0.05) - 243.0; }
					else if (amount >= 12500.01 && amount <= 16000.0) { return (amount * 0.06) - 368.0; }
					else { return (amount * 0.069) - 512.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="7E98322B5259B22BA641CD059B37F40E" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)							

					return 0.0 if (taxable_income <= 0.0)

					case taxable_income
						when (0.01..2700.0): taxable_income * 0.01
						when (2700.01..4700.0): ((taxable_income * 0.02 ) - 27.0)
						when (4700.01..7200.0): ((taxable_income * 0.03) - 74.0)
						when (7200.01..9700.0): ((taxable_income * 0.04) - 146.0)
						when (9700.01..12500.0): ((taxable_income * 0.05 ) - 243.0)
						when (12500.01..16000.0): ((taxable_income * 0.06) - 368.0)
						else ((taxable_income * 0.069) - 512.0)
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2700.0) { return taxable_income * 0.01; }
					else if (taxable_income >= 2700.01 && taxable_income <= 4700.0) { return ((taxable_income * 0.02 ) - 27.0); }
					else if (taxable_income >= 4700.01 && taxable_income <= 7200.0) { return ((taxable_income * 0.03) - 74.0); }
					else if (taxable_income >= 7200.01 && taxable_income <= 9700.0) { return ((taxable_income * 0.04) - 146.0); }
					else if (taxable_income >= 9700.01 && taxable_income <= 12500.0) { return ((taxable_income * 0.05 ) - 243.0); }
					else if (taxable_income >= 12500.01 && taxable_income <= 16000.0) { return ((taxable_income * 0.06) - 368.0); }
					else { return ((taxable_income * 0.069) - 512.0); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="AC6539FDC513BEECAC1A965E2701BC48" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_amount)

					tax =	if (taxable_amount > 16000.0)
							taxable_amount * 0.069 - 512.0
						elsif (taxable_amount > 12500.0)
							taxable_amount * 0.06 - 368.0
						elsif (taxable_amount > 9700.0)
							taxable_amount * 0.05 - 243.0
						elsif (taxable_amount > 7200.0)
							taxable_amount * 0.04 - 146.0
						elsif (taxable_amount > 4700.0)
							taxable_amount * 0.03 - 74.0
						elsif (taxable_amount > 2700.0)
							taxable_amount * 0.02 - 27.0
						elsif (taxable_amount > 0.0)
							taxable_amount * 0.01
						else 0.0
						end
					return tax
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_amount)
				{
					if (taxable_amount > 16000.0)
						{ return taxable_amount * 0.069 - 512.0; }
					else if (taxable_amount > 12500.0)
						{ return taxable_amount * 0.06 - 368.0; }
					else if (taxable_amount > 9700.0)
						{ return taxable_amount * 0.05 - 243.0; }
					else if (taxable_amount > 7200.0)
						{ return taxable_amount * 0.04 - 146.0; }
					else if (taxable_amount > 4700.0)
						{ return taxable_amount * 0.03 - 74.0; }
					else if (taxable_amount > 2700.0)
						{ return taxable_amount * 0.02 - 27.0; }
					else if (taxable_amount > 0.0)
						{ return taxable_amount * 0.01; }
					else { return 0.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="A4E90EE80DEAF5C0FF72AB9097A7601C" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)
					if (taxable_income <= 0.0) then return 0 end
					case taxable_income
						when (0.0...25000.01)
							tax = taxable_income * 0.0168
						when (25000...50000.01)
							tax = ((taxable_income - 25000.0) * 0.0423) + 420.0
						else
							tax = ((taxable_income - 50000.0) * 0.0515) + 1477.50
					end
					return tax
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
          
					var tax = 0.0;
					if (taxable_income >= 0.0 && taxable_income <= 25000.01) { tax = taxable_income * 0.0168; }
					else if (taxable_income >= 25000 && taxable_income <= 50000.01) { tax = ((taxable_income - 25000.0) * 0.0423) + 420.0; }
					else { tax = ((taxable_income - 50000.0) * 0.0515) + 1477.50; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="25418722E92D940DD014EAE497C9C437" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def check_digit(input, multiplier, modulus, sum_digits = false, rtl = false)
					# Correct input arguments.
					input = input.to_s
					multiplier = multiplier.to_s
					modulus = modulus.to_i
					sum_digits = false unless sum_digits.kind_of? TrueClass
					rtl = false unless rtl.kind_of? TrueClass
					
					# Create multiplier string.
					extra = input.length % multiplier.length
					if rtl
						multiplier.reverse! 
						multiplier = multiplier[-extra, extra] + (multiplier * (input.length / multiplier.length))
					else
						multiplier = (multiplier * (input.length / multiplier.length)) + multiplier[0, extra]
					end
					
					# Generate the sum.
					sum = 0
					0.upto(input.length-1) { |i|
						step = input[i, 1].to_i * multiplier[i, 1].to_i
						# Do they want sum of the products, or sum of the product digits?
						if (sum_digits)
							sum += step % 10 + step / 10
						else
							sum += step
						end
					}

					return '%02i' % (11 - (sum % modulus))
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		function check_digit(input:any, multiplier:any, modulus:number, sum_digits:boolean = false, rtl:boolean = false):any
		{
			// Correct input arguments
			var inputStr = input.toString();
			var multiplierStr = multiplier.toString();
			var modulusInt = (modulus.toString()).to_i();
			sum_digits = sum_digits || false;
			rtl = rtl || false;

			// Create multiplier string
			var extra = inputStr.length % multiplierStr.length;

			multiplierStr = multiplierStr.repeat(Math.floor(inputStr.length / multiplierStr.length)) + multiplierStr.substring(0, extra);

			if (rtl) { inputStr = inputStr.split('').reverse().join(''); }

			// Generate the sum
			var sum = 0;

			for (var i = 0; i < inputStr.length; i++)
			{
				var step = inputStr.substr(i, 1).to_i() * multiplierStr.substr(i, 1).to_i();

				// Do they want sum of the products, or sum of the product digits?
				sum += (sum_digits ? Math.floor(step / 10) + (step % 10) : step);
			}

			// Value to return as a single digit integer.
			return (11 - (sum % modulusInt)).to_i().complexFixedString(0, '02');
		}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="0503596F88AF873EFAA6369549B3FDC8" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def get_addr_and_overflow(addr1, addr2, len1, len2)

	        # We build these and return them. 'Mail Address' and 'Mail Address Overflow'.
	        mail_addr = over_addr = ""

	        # May as well leave if nothing to work with.
	        return [mail_addr, over_addr] if ((addr1 + (addr2 ? addr2 : '')).empty?)

	        # Whitespace index.
	        ws_index = nil

	        # [A] We add 1 for the added space character if we have a second address argument.
	        if ((addr1.length + (addr2 ? addr2.length + 1 : 0)) <= len1)

		        # The complete address fits in the 2D 'Mailing Address' line. We are done.
		        mail_addr = "#{addr1}#{addr2 ? ' ' + addr2 : ''}".strip
	        # [B]
	        elsif (addr1.length <= len1)

		        # We set mail_addr to addr1 since that fits.
		        mail_addr = addr1

		        # [C] Now we need to check if we have a second address, does it fit in the 2D 'Mailing Address Overflow' line?
		        # If it does not fit we have a blank 'Mailing Address Overflow'.
		        if (addr2)
			        over_addr = addr2 if (addr2.length <= len2)
		        end
	        else
		        # [D]
		        # addr1 will not fit into the 2D 'Mailing Address' slot, so we attempt to break it at a word boundary. The
		        # unlikely scenario where there are no whitespace characters would result in returning blank 'Mailing Address'
		        # and 'Mailing Address Overflow' strings since NY does not want a blatant truncation.
		        #
		        if (addr1[len1-1,1] =~ /\S/)

			        #
			        # We have a non white space character at len1. We need to 'backup' until we see a white space character
			        # and set our whitespace index var ws_index accordingly. If we can not find a whitespace char, .rindex will
			        # return a nil value, which we check for further below.
			        #
			        ws_index = addr1[0,len1-1].rindex(/\s/)
		        else
			        # The address string at len1 - 1 has a white space character, so we set ws_index at len1 - 1 since indices start
			        # from zero.
			        ws_index = len1 - 1
		        end

		        #
		        # [E]
		        # Now we need to see if the remaining chars in addr1 plus the chars in addr2 [if we have an addr2, in which case we add 1
		        # for the space char] will fit into the 2D 'Mailing Address Overflow' field whose size is indicated by len2.
		        #
		        if (ws_index)

			        mail_addr = addr1[0, ws_index + 1]

			        if ((addr1.length - (ws_index + 1) + (addr2 ? addr2.length + 1 : 0)) <= len2)

				        # [F]
				        over_addr = "#{addr1[ws_index + 1, addr1.length - (ws_index + 1)]}#{addr2 ? ' ' + addr2 : ''}".strip
			        elsif ((addr1.length - (ws_index + 1)) <= len2)

				        # [G] We only have room for the remaing chars in addr1 for the overflow.
				        over_addr = addr1[ws_index + 1, addr1.length - (ws_index + 1)]
			        end
		        end
	        end

	        # Return the mailing and overflow addresses via an array.
	        [mail_addr, over_addr]
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function get_addr_and_overflow(addr1, addr2, len1, len2)
				{
					// We build these and return them. 'Mail Address' and 'Mail Address Overflow'.
					var mail_addr = "";
					var over_addr = "";

					// May as well leave if nothing to work with.
					if ((addr1 + (addr2 ? addr2 : '')).isEmpty())
					{
						return [mail_addr, over_addr];
					}

					// Whitespace index.
					var ws_index = null;

					// [A] We add 1 for the added space character if we have a second address argument.
					if ((addr1.length + (addr2 ? addr2.length + 1 : 0)) <= len1)
					{
						// The complete address fits in the 2D 'Mailing Address' line. We are done.
						mail_addr = (addr1 + (addr2 ? ' ' + addr2 : '')).trim();
					}
					// [B]
					else if (addr1.length <= len1)
					{
						// We set mail_addr to addr1 since that fits.
						mail_addr = addr1;

						// [C] Now we need to check if we have a second address, does it fit in the 2D 'Mailing Address Overflow' line?
						// If it does not fit we have a blank 'Mailing Address Overflow'.
						if (addr2)
						{
							if (addr2.length <= len2)
							{
								over_addr = addr2;
							}
						}
					}
					else
					{
						// [D]
						// addr1 will not fit into the 2D 'Mailing Address' slot, so we attempt to break it at a word boundary. The
						// unlikely scenario where there are no whitespace characters would result in returning blank 'Mailing Address'
						// and 'Mailing Address Overflow' strings since NY does not want a blatant truncation.
						if (/\S/.test(addr1.substring(len1-1, 1)))
						{
							// We have a non white space character at len1. We need to 'backup' until we see a white space character
							// and set our whitespace index var ws_index accordingly. If we can not find a whitespace char, .rindex will
							// return a nil value, which we check for further below.
							ws_index = addr1.substring(0, len1-1).lastIndexOf(' ');
						}
						else
						{
							// The address string at len1 - 1 has a white space character, so we set ws_index at len1 - 1 since indices start
							// from zero.
							ws_index = len1 - 1;
						}

						// [E]
						// Now we need to see if the remaining chars in addr1 plus the chars in addr2 [if we have an addr2, in which case we add 1
						// for the space char] will fit into the 2D 'Mailing Address Overflow' field whose size is indicated by len2.
						if (ws_index >= 0)
						{
							mail_addr = addr1.substring(0, ws_index + 1);

							if ((addr1.length - (ws_index + 1) + (addr2 ? addr2.length + 1 : 0)) <= len2)
							{
								// [F]
								over_addr = (addr1.substring(ws_index + 1, addr1.length - (ws_index + 1)) + (addr2 ? ' ' + addr2 : '')).trim();
							}
							else if ((addr1.length - (ws_index + 1)) <= len2)
							{
								// [G] We only have room for the remaing chars in addr1 for the overflow.
								over_addr = addr1.substring(ws_index + 1, addr1.length - (ws_index + 1));
							}
						}
					}

					// Return the mailing and overflow addresses via an array.
					return [mail_addr, over_addr];
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="7DEAA99D26A7E583A4C91120E58232AA" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)

	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        #
			        # Correct the Coupon due dates so that they do not fall on a weekend.
			        # t.wday == 6 is Saturday, Sunday == 0.
			        #
			        t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        #
	        # Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        # in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        # out different from the chart in the instructions, put in the computed due month, day and year
	        # which showed as wrong and adjust the day to match the chart.
	        #		
	 
               #-###########################################################
               #IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
               #-###########################################################
               #Each year when this form comes through the voucher number and year ending must be entered and checked
               #in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
               #dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
               #-###########################################################

                #This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        #In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        #year of the due date showing on the form in the variables below. In the variable labeled due_day
	        #set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        #is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.
       
               #Note 8/24/11:Offset below is for Martin Luther King day holiday which needed to adjusted from
               #the 21st to the 22nd for the next business day. 

	        if ((due_mon == 1) and (due_day == 21) and (due_year == 2013))
		        due_day = 22
	        end
	
               #Note 8/24/11:Offset below is for President's day holiday which needed to adjusted on the extension 
               #payment (voucher 5) from the 17th to the 18th for the next business day.
	
	        if ((due_mon == 2) and (due_day == 17) and (due_year == 2014))
		        due_day = 18
	        end

	        #
	        # Prepare due date for return - string with no '/'s.
	        #
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function compute_due_date(id, mon_end, year_end, coupon)
		    {
			    var coupon_intervals = [4, 6, 9, 12, 4];
			    var liability_intervals = [3, 6, 9, 12, 12];
			    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

			    // Check arguments first.
			    if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
			    {
				    return '00000000';
			    }

			    year_end = year_end.to_i();

			    //We will index into the interval arrays with this.
			    var coupon_adj = coupon - 1;

			    var year_adj;
			    var mon_adj;
			    var due_year;
			    var mod_mon;
			    var due_mon;
			    var due_day;
			    if (id == 1)
			    {
				    // Computing Liability Due Date. These fall on the last day of the month.
				    year_adj = year_end - 1;
				    mon_adj = mon_end + liability_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = ( mod_mon > 0 ? mod_mon : 12);
				    if (due_mon == 2)
				    {
					    due_day = (is_leap_year(due_year) ? 29 : 28);
				    }
				    else 
				    {
					    due_day = days_in_month[due_mon - 1];
				    }
			    }
			    else if (id == 2)
	            {
				    // Computing Coupon Due Date.
				    year_adj = (coupon < 5 ? year_end - 1 : year_end);
				    mon_adj = mon_end + coupon_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = (mod_mon > 0 ? mod_mon : 12);
				    due_day = (coupon < 5 ? 20 : 15);

				    // Correct the Coupon due dates so that they do not fall on a weekend.
				    // t.wday == 6 is Saturday, Sunday == 0.
				    var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
				    if (t.wday() == 6)
				    {
					    due_day += 2;
				    }
				    else if (t.wday() == 0)
				    {
					    due_day += 1;
				    }
			    }

			    // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
			    // in future years (or an algorithm could be written for it). Test the due dates and if one comes
			    // out different from the chart in the instructions, put in the computed due month, day and year
			    // which showed as wrong and adjust the day to match the chart.

			    //-###########################################################
			    //IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
			    //-###########################################################
			    //Each year when this form comes through the voucher number and year ending must be entered and checked
			    //in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
			    //dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
			    //-###########################################################

			    //This offsets the due day for individual due dates that come up incorrect because of a holiday. 
			    //In the algorithm below, using the due date that is showing on the form, put the month, date, and
			    //year of the due date showing on the form in the variables below. In the variable labeled due_day
			    //set the day equal to the correct day that is showing in the specs. For example, if the due day that
			    //is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

			    // Note 8/24/11:Offset below is for Martin Luther King day holiday which needed to adjusted from
			    // the 21st to the 22nd for the next business day. 

			    if ((due_mon == 1) && (due_day == 21) && (due_year == 2013))
			    {
				    due_day = 22;
			    }

			    // Note 8/24/11:Offset below is for President's day holiday which needed to adjusted on the extension 
			    // payment (voucher 5) from the 17th to the 18th for the next business day.
		
			    if ((due_mon == 2) && (due_day == 17) && (due_year == 2014))
			    {
				    due_day = 18;
			    }

	        // Prepare due date for return - string with no '/'s.
	        return due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="9D25414F3B1188179942561F0E7F6A5B" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def invalid_taxnum(number)

					number = number.strip

					return false unless (number =~ /^[13][0-9]{10}$/)

					cd = check_digit(number[0,10], '12', 10, true, false)

					if (cd != number[10,1].to_i)
					
						messageBox("The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", $MB_ICONEXCLAMATION)
						return true
					end
					return false
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function invalid_taxnum(number)
				{
					number = number.trim();

					if (!(/^[13][0-9]{10}$/.test(number)))
					{
						return false;
					}

					var cd = check_digit(number.substring(0,10), '12', 10, true, false);

					if (cd != number.substring(10,1).to_i())
					{
						SFForms.Utilities.MessageBox(formInstanceId, "The Taxpayer Number entered is not valid. Please verify and re-enter.", "Attention!", MB_ICONEXCLAMATION);
						return true;
					}
					
					return false;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="5FCA910F8690D13A8F48D1483032F49C" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip[0,40]
	        address1 = address1.squeeze(' ').strip[0,40]
	        address2 = address2.squeeze(' ').strip[0,40]
	        address3 = address3.squeeze(' ').strip[0,40]
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
							address1 = profile.address;
							if (!profile.apartment_number.trim().isEmpty())
							{
								address2 = 'Apt. #' + profile.apartment_number;
							}
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						name = profile.name;
						address1 = profile.address;
						address2 = profile.address2;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use Firm name if available 
						if (!profile.firm_name.trim().isEmpty())
						{
							name = profile.firm_name;
						}
						else
						{
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
						}
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
						else
							name = profile.applicant_entity_name;
						end
						address1 = profile.applicant_address;
						if(!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim().substring(0, 40);
					address1 = address1.squeeze(' ').trim().substring(0, 40);
					address2 = address2.squeeze(' ').trim().substring(0, 40);
					address3 = address3.squeeze(' ').trim().substring(0, 40);

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="8E24F423CFDF215928074514A0440EF4" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(amount)
					if (amount > 11950.0) then 3090.00 + ((amount - 11950.0) * 0.396)
					elsif (amount > 8750.0) then 2034.0 + ((amount - 8750.0) * 0.33)
					elsif (amount > 5700.0) then 1180.0 + ((amount - 5700.0) * 0.28)
					elsif (amount > 2450.0) then 367.50 + ((amount - 2450.0) * 0.25)
					elsif (amount > 0.0) then amount * 0.15
					else 0.0
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					if (amount > 11950.0) { return 3090.00 + ((amount - 11950.0) * 0.396); }
					else if (amount > 8750.0) { return 2034.0 + ((amount - 8750.0) * 0.33); }
					else if (amount > 5700.0) { return 1180.0 + ((amount - 5700.0) * 0.28); }
					else if (amount > 2450.0) { return 367.50 + ((amount - 2450.0) * 0.25); }
					else if (amount > 0.0) { return amount * 0.15; }
					else { return 0.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="E8627C98ACCDDBF69A63988E8FFB17EE" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def name_block(profile, business, collapse, *lines)
					business = false unless business.kind_of? TrueClass
					collapse = false unless collapse.kind_of? TrueClass
					name = address1 = address2 = address3 = ''

					if (profile.to_s[2,10] == 'Individual')
						# Decide if profile's business or personal information should be used.
						if (business and !profile.business_name.strip.empty?)
							# Use business information.
							name = profile.business_name
							if (profile.business_address.strip.empty?)
								address1 = profile.address
								address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
								address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
							else
								address1 = profile.business_address
								address2 = profile.business_address2
								address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
							end
						else
							# Using personal information.
							if (profile.married_joint.strip.empty?)
								name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
							else
								name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix + ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix
							end			
							address1 = profile.address
							address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
							address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
						end
					elsif profile.to_s[2,6] == 'Entity'
						name = profile.name
						address1 = profile.address
						address2 = profile.address2
						address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
					elsif profile.to_s[2,8] == 'Preparer'
						# Use Firm name if available and business = true.
						# Use Preparer name if the Preparer is self-employed and business = false.
						if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
							name = profile.firm_name
						else
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
						end
						address1 = profile.address
						address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
					elsif profile.to_s[2,3] == 'Fcc'
						# Use entity name if available.
						if (profile.applicant_entity_name.strip.empty?)
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
						else
							name = profile.applicant_entity_name
						end
						address1 = profile.applicant_address
						address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
						address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
					else
						return
					end
					
					name = name.squeeze(' ').strip
					address1 = address1.squeeze(' ').strip
					address2 = address2.squeeze(' ').strip
					address3 = address3.squeeze(' ').strip
					
					# Decide what lines are output.
					case lines.length
						when 1
							name += ' ' + address1 + ' ' + address2 + ' ' + address3
							name = name.squeeze(' ').strip
							address1 = address2 = address3 = ''
						when 2
							address1 += ' ' + address2 + ' ' + address3
							address1 = address1.squeeze(' ').strip
							address2 = address3 = ''
						when 3
							address1 += ' ' + address2
							address1 = address1.squeeze(' ').strip
							address2 = address3
							address3 = ''
						when 4
							if (address2.empty? and collapse)
								address2 = address3
								address3 = ''
							end
					end

					print lines[0], name if !name.empty?
					print lines[1], address1 if !address1.empty?
					print lines[2], address2 if !address2.empty?
					print lines[3], address3 if !address3.empty?
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							if (profile.married_joint.trim().isEmpty())
							{
								name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
							}
							else 
							{
								name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix + ' & ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix;
							}
							address1 = profile.address;
							if (!profile.apartment_number.trim().isEmpty())
							{
								address2 = 'Apt. #' + profile.apartment_number;
							}
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						name = profile.name;
						address1 = profile.address;
						address2 = profile.address2;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use Firm name if available and business = true.
						// Use Preparer name if the Preparer is self-employed and business = false.
						if (!profile.firm_name.trim().isEmpty() && ((profile.self_employed.trim().isEmpty()) || (!profile.self_employed.trim().isEmpty() && business)))
						{
							name = profile.firm_name;
						}
						else
						{
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
						}
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
						else
							name = profile.applicant_entity_name;
						end
						address1 = profile.applicant_address;
						if(!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="7DC05CD6EEEA2E82AD971B892BC6EACD" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def name_block(profile, business, *lines)
					business = false unless business.kind_of? TrueClass
					name = address1 = address2 = address3 = ''

					if (profile.to_s[2,10] == 'Individual')
						# Decide if profile's business or personal information should be used.
						if (business and !profile.business_name.strip.empty?)
							# Use business information.
							name = profile.business_name
							if (profile.business_address.strip.empty?)
								address1 = profile.address
								address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
								address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
							else
								address1 = profile.business_address
								address2 = profile.business_address2
								address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
							end
						else
							# Using personal information.
							#address1 and address2 were modified
							name = profile.last_name + ' ' + profile.first_name + ' ' + profile.middle_initial
							address1 = profile.spouse_last_name + ' ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial unless profile.married_joint.strip.empty?
							address2 = profile.address + ( profile.apartment_number.strip.empty? ? '' : ' ' + 'Apt. #' + profile.apartment_number )
							address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
						end
					elsif profile.to_s[2,6] == 'Entity'
						name = profile.name
						address1 = profile.address
						address2 = profile.address2
						address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
					elsif profile.to_s[2,8] == 'Preparer'
						# Use firm name if available.
						if (profile.firm_name.strip.empty?)
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
						else
							name = profile.firm_name
						end
						address1 = profile.address
						address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
					elsif profile.to_s[2,3] == 'Fcc'
						# Use entity name if available.
						if (profile.applicant_entity_name.strip.empty?)
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
						else
							name = profile.applicant_entity_name
						end
						address1 = profile.applicant_address
						address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
						address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
					else
						return
					end
					
					name = name.squeeze(' ').strip
					address1 = address1.squeeze(' ').strip
					address2 = address2.squeeze(' ').strip
					address3 = address3.squeeze(' ').strip
					
					# Decide what lines are output.
					case lines.length
						when 1
							name += ' ' + address1 + ' ' + address2 + ' ' + address3
							name = name.squeeze(' ').strip
							address1 = address2 = address3 = ''
						when 2
							address1 += ' ' + address2 + ' ' + address3
							address1 = address1.squeeze(' ').strip
							address2 = address3 = ''
						when 3
							address1 += ' ' + address2
							address1 = address1.squeeze(' ').strip
							address2 = address3
							address3 = ''
						when 4
							#This first if statement was added.
							if (address1.empty?)
								address1 = address2
								address2 = address3
								address3 = ''
							end
							if (address2.empty?)
								address2 = address3
								address3 = ''
							end

					end

					print lines[0], name if !name.empty?
					print lines[1], address1 if !address1.empty?
					print lines[2], address2 if !address2.empty?
					print lines[3], address3 if !address3.empty?

				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							// address1 and address2 were modified
							name = profile.last_name + ' ' + profile.first_name + ' ' + profile.middle_initial;
							if (!profile.married_joint.trim().isEmpty())
							{
								address1 = profile.spouse_last_name + ' ' + profile.spouse_first_name + ' ' + profile.spouse_middle_initial;
							}
							address2 = profile.address + ( profile.apartment_number.trim().isEmpty() ? '' : ' ' + 'Apt. #' + profile.apartment_number );
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						name = profile.name;
						address1 = profile.address;
						address2 = profile.address2;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use Firm name if available
						if (!profile.firm_name.trim().isEmpty())
						{
							name = profile.firm_name;
						}
						else
						{
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
						}
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
						{
              name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
            }
						else
						{
              name = profile.applicant_entity_name;
            }
						address1 = profile.applicant_address;
						if(!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							// This first if statement was added.
							if (address1.isEmpty())
							{
								address1 = address2;
								address2 = address3;
								address3 = '';
							}

							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="03C80F28C236C2B4F2E4551200E31E67" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_rate(household_income)

	        rate = if (household_income < 0.0) then '0'
		        else
			        case household_income
				        when (0.0..10990.99) then '1.00'
				        when (10991.0..12283.99) then '0.85'
				        when (12284.0..13576.99) then '0.70'
				        when (13577.0..16162.99) then '0.50'
				        when (16163.0..18748.99) then '0.35'
				        when (18749.0..21334.99) then '0.25'
				        else '0'
			        end
		        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_rate(household_income)
				{
					if (household_income < 0.0) { return '0'; }
					else if (household_income >= 0.0 && household_income <= 10990.99) { return '1.00'; }
					else if (household_income >= 10991.0 && household_income <= 12283.99) { return '0.85'; }
					else if (household_income >= 12284.0 && household_income <= 13576.99) { return '0.70'; }
					else if (household_income >= 13577.0 && household_income <= 16162.99) { return '0.50'; }
					else if (household_income >= 16163.0 && household_income <= 18748.99) { return '0.35'; }
					else if (household_income >= 18749.0 && household_income <= 21334.99) { return '0.25'; }
					else { return '0'; }
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="03C80F28C236C2B4F2E4551200E31E67" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_rate(household_income)

					rate = if (household_income < 0.0) { return '0'
						else
							case household_income
								when (0.0..10990.99) { return '1.00'
								when (10991.0..12283.99) { return '0.85'
								when (12284.0..13576.99) { return '0.70'
								when (13577.0..16162.99) { return '0.50'
								when (16163.0..18748.99) { return '0.35'
								when (18749.0..21334.99) { return '0.25'
								else '0'
							end
						end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_rate(household_income)
				{
					if (household_income < 0.0) { return '0'; }
					else if (household_income >= 0.0 && household_income <= 10990.99) { return '1.00'; }
					else if (household_income >= 10991.0 && household_income <= 12283.99) { return '0.85'; }
					else if (household_income >= 12284.0 && household_income <= 13576.99) { return '0.70'; }
					else if (household_income >= 13577.0 && household_income <= 16162.99) { return '0.50'; }
					else if (household_income >= 16163.0 && household_income <= 18748.99) { return '0.35'; }
					else if (household_income >= 18749.0 && household_income <= 21334.99) { return '0.25'; }
					else { return '0'; }
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="DCCBCC2DEEF4CC4BE3AAF3C3B15E2EDE" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)

					return 0.0 unless (taxable_income > 0.0)

					case (taxable_income)

						when (0.01..1469.0): taxable_income * 0.0036
						when (1469.01..2938.0): ((taxable_income - 1469.0) * 0.0072) + 5.29
						when (2938.01..5876.0): ((taxable_income - 2938.0) * 0.0243) + 15.87
						when (5876.01..13221.0): ((taxable_income - 5876.0) * 0.045) + 87.26
						when (13221.01..22035.0): ((taxable_income - 13221.0) * 0.0612) + 417.79
						when (22035.01..29380.0): ((taxable_income - 22035.0) * 0.0648) + 957.21
						when (29380.01..44070.0): ((taxable_income - 29380.0) * 0.068) + 1433.17
						when (44070.01..66105.0): ((taxable_income - 44070.0) * 0.0792) + 2432.09
						else ((taxable_income - 66105.0) * 0.0898) + 4177.26
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 1469.0) { return taxable_income * 0.0036; }
					else if (taxable_income >= 1469.01 && taxable_income <= 2938.0) { return ((taxable_income - 1469.0) * 0.0072) + 5.29; }
					else if (taxable_income >= 2938.01 && taxable_income <= 5876.0) { return ((taxable_income - 2938.0) * 0.0243) + 15.87; }
					else if (taxable_income >= 5876.01 && taxable_income <= 13221.0) { return ((taxable_income - 5876.0) * 0.045) + 87.26; }
					else if (taxable_income >= 13221.01 && taxable_income <= 22035.0) { return ((taxable_income - 13221.0) * 0.0612) + 417.79; }
					else if (taxable_income >= 22035.01 && taxable_income <= 29380.0) { return ((taxable_income - 22035.0) * 0.0648) + 957.21; }
					else if (taxable_income >= 29380.01 && taxable_income <= 44070.0) { return ((taxable_income - 29380.0) * 0.068) + 1433.17; }
					else if (taxable_income >= 44070.01 && taxable_income <= 66105.0) { return ((taxable_income - 44070.0) * 0.0792) + 2432.09; }
					else { return ((taxable_income - 66105.0) * 0.0898) + 4177.26; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="FE133C092FE17680FF5E8C522EF65C0B" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(net_taxable_income)

					return [net_taxable_income * 0.01, 0.0].max if (net_taxable_income < 4100.0)

					case (net_taxable_income)

						when (4100.0..4999.0): 41.0 + (net_taxable_income - 4099.0) * 0.025
						when (5000.0..5999.0): 64.0 + (net_taxable_income - 4999.0) * 0.025
						when (6000.0..6999.0): 89.0 + (net_taxable_income - 5999.0) * 0.025
						when (7000.0..7999.0): 114.0 + (net_taxable_income - 6999.0) * 0.025
						when (8000.0..8199.0): 139.0 + (net_taxable_income - 7999.0) * 0.025
						when (8200.0..8999.0): 144.0 + (net_taxable_income - 8199.0) * 0.035
						when (9000.0..9999.0): 172.0 + (net_taxable_income - 8999.0) * 0.035
						when (10000.0..10999.0): 207.0 + (net_taxable_income - 9999.0) * 0.035
						when (11000.0..11999.0): 242.0 + (net_taxable_income - 10999.0) * 0.035
						when (12000.0..12199.0): 277.0 + (net_taxable_income - 11999.0) * 0.035
						when (12200.0..12999.0): 284.0 + (net_taxable_income - 12199.0) * 0.045
						when (13000.0..13999.0): 320.0 + (net_taxable_income - 12999.0) * 0.045
						when (14000.0..14999.0): 365.0 + (net_taxable_income - 13999.0) * 0.045
						when (15000.0..15999.0): 410.0 + (net_taxable_income - 14999.0) * 0.045
						when (16000.0..16999.0): 455.0 + (net_taxable_income - 15999.0) * 0.045
						when (17000.0..17999.0): 500.0 + (net_taxable_income - 16999.0) * 0.045
						when (18000.0..18999.0): 545.0 + (net_taxable_income - 17999.0) * 0.045
						when (19000.0..19999.0): 590.0 + (net_taxable_income - 18999.0) * 0.045
						when (20000.0..20399.0): 635.0 + (net_taxable_income - 19999.0) * 0.045
						when (20400.0..20999.0): 653.0 + (net_taxable_income - 20399.0) * 0.06
						when (21000.0..21999.0): 689.0 + (net_taxable_income - 20999.0) * 0.06
						when (22000.0..22999.0): 749.0 + (net_taxable_income - 21999.0) * 0.06
						when (23000.0..23999.0): 809.0 + (net_taxable_income - 22999.0) * 0.06
						when (24000.0..24999.0): 869.0 + (net_taxable_income - 23999.0) * 0.06
						when (25000.0..25999.0): 929.0 + (net_taxable_income - 24999.0) * 0.06
						when (26000.0..26999.0): 989.0 + (net_taxable_income - 25999.0) * 0.06
						when (27000.0..27999.0): 1049.0 + (net_taxable_income - 26999.0) * 0.06
						when (28000.0..28999.0): 1109.0 + (net_taxable_income - 27999.0) * 0.06
						when (29000.0..29999.0): 1169.0 + (net_taxable_income - 28999.0) * 0.06
						when (30000.0..30999.0): 1229.0 + (net_taxable_income - 29999.0) * 0.06
						when (31000.0..31999.0): 1289.0 + (net_taxable_income - 30999.0) * 0.06
						when (32000.0..32999.0): 1349.0 + (net_taxable_income - 31999.0) * 0.06
						when (33000.0..33999.0): 1409.0 + (net_taxable_income - 32999.0) * 0.06
						else 1469.0 + (net_taxable_income - 33999.0) * 0.07
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(net_taxable_income)
				{
					if (net_taxable_income < 4100.0)
					{
						return Math.max(net_taxable_income * 0.01, 0.0);
					}

					if (net_taxable_income >= 4100.0 && net_taxable_income <= 4999.0) { return  41.0 + (net_taxable_income - 4099.0) * 0.025; }
					else if (net_taxable_income >= 5000.0 && net_taxable_income <= 5999.0) { return  64.0 + (net_taxable_income - 4999.0) * 0.025; }
					else if (net_taxable_income >= 6000.0 && net_taxable_income <= 6999.0) { return  89.0 + (net_taxable_income - 5999.0) * 0.025; }
					else if (net_taxable_income >= 7000.0 && net_taxable_income <= 7999.0) { return  114.0 + (net_taxable_income - 6999.0) * 0.025; }
					else if (net_taxable_income >= 8000.0 && net_taxable_income <= 8199.0) { return  139.0 + (net_taxable_income - 7999.0) * 0.025; }
					else if (net_taxable_income >= 8200.0 && net_taxable_income <= 8999.0) { return  144.0 + (net_taxable_income - 8199.0) * 0.035; }
					else if (net_taxable_income >= 9000.0 && net_taxable_income <= 9999.0) { return  172.0 + (net_taxable_income - 8999.0) * 0.035; }
					else if (net_taxable_income >= 10000.0 && net_taxable_income <= 10999.0) { return  207.0 + (net_taxable_income - 9999.0) * 0.035; }
					else if (net_taxable_income >= 11000.0 && net_taxable_income <= 11999.0) { return  242.0 + (net_taxable_income - 10999.0) * 0.035; }
					else if (net_taxable_income >= 12000.0 && net_taxable_income <= 12199.0) { return  277.0 + (net_taxable_income - 11999.0) * 0.035; }
					else if (net_taxable_income >= 12200.0 && net_taxable_income <= 12999.0) { return  284.0 + (net_taxable_income - 12199.0) * 0.045; }
					else if (net_taxable_income >= 13000.0 && net_taxable_income <= 13999.0) { return  320.0 + (net_taxable_income - 12999.0) * 0.045; }
					else if (net_taxable_income >= 14000.0 && net_taxable_income <= 14999.0) { return  365.0 + (net_taxable_income - 13999.0) * 0.045; }
					else if (net_taxable_income >= 15000.0 && net_taxable_income <= 15999.0) { return  410.0 + (net_taxable_income - 14999.0) * 0.045; }
					else if (net_taxable_income >= 16000.0 && net_taxable_income <= 16999.0) { return  455.0 + (net_taxable_income - 15999.0) * 0.045; }
					else if (net_taxable_income >= 17000.0 && net_taxable_income <= 17999.0) { return  500.0 + (net_taxable_income - 16999.0) * 0.045; }
					else if (net_taxable_income >= 18000.0 && net_taxable_income <= 18999.0) { return  545.0 + (net_taxable_income - 17999.0) * 0.045; }
					else if (net_taxable_income >= 19000.0 && net_taxable_income <= 19999.0) { return  590.0 + (net_taxable_income - 18999.0) * 0.045; }
					else if (net_taxable_income >= 20000.0 && net_taxable_income <= 20399.0) { return  635.0 + (net_taxable_income - 19999.0) * 0.045; }
					else if (net_taxable_income >= 20400.0 && net_taxable_income <= 20999.0) { return  653.0 + (net_taxable_income - 20399.0) * 0.06; }
					else if (net_taxable_income >= 21000.0 && net_taxable_income <= 21999.0) { return  689.0 + (net_taxable_income - 20999.0) * 0.06; }
					else if (net_taxable_income >= 22000.0 && net_taxable_income <= 22999.0) { return  749.0 + (net_taxable_income - 21999.0) * 0.06; }
					else if (net_taxable_income >= 23000.0 && net_taxable_income <= 23999.0) { return  809.0 + (net_taxable_income - 22999.0) * 0.06; }
					else if (net_taxable_income >= 24000.0 && net_taxable_income <= 24999.0) { return  869.0 + (net_taxable_income - 23999.0) * 0.06; }
					else if (net_taxable_income >= 25000.0 && net_taxable_income <= 25999.0) { return  929.0 + (net_taxable_income - 24999.0) * 0.06; }
					else if (net_taxable_income >= 26000.0 && net_taxable_income <= 26999.0) { return  989.0 + (net_taxable_income - 25999.0) * 0.06; }
					else if (net_taxable_income >= 27000.0 && net_taxable_income <= 27999.0) { return  1049.0 + (net_taxable_income - 26999.0) * 0.06; }
					else if (net_taxable_income >= 28000.0 && net_taxable_income <= 28999.0) { return  1109.0 + (net_taxable_income - 27999.0) * 0.06; }
					else if (net_taxable_income >= 29000.0 && net_taxable_income <= 29999.0) { return  1169.0 + (net_taxable_income - 28999.0) * 0.06; }
					else if (net_taxable_income >= 30000.0 && net_taxable_income <= 30999.0) { return  1229.0 + (net_taxable_income - 29999.0) * 0.06; }
					else if (net_taxable_income >= 31000.0 && net_taxable_income <= 31999.0) { return  1289.0 + (net_taxable_income - 30999.0) * 0.06; }
					else if (net_taxable_income >= 32000.0 && net_taxable_income <= 32999.0) { return  1349.0 + (net_taxable_income - 31999.0) * 0.06; }
					else if (net_taxable_income >= 33000.0 && net_taxable_income <= 33999.0) { return  1409.0 + (net_taxable_income - 32999.0) * 0.06; }
					else { return 1469.0 + (net_taxable_income - 33999.0) * 0.07; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="51028ED45EC676F5940ADC08AE688F9A" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def tax (income)

					return 0.0 unless (income > 0.0)

					case (income)
						when (0.01..4099.99): (income * 0.01)
						when (4100.0..4999.0): ((income - 4099.0) * 0.025) + 41.0
						when (5000.0..5999.0): ((income - 4999.0) * 0.025) + 64.0
						when (6000.0..6999.0): ((income - 5999.0) * 0.025) + 89.0
						when (7000.0..7999.0): ((income - 6999.0) * 0.025) + 114.0
						when (8000.0..8199.0): ((income - 7999.0) * 0.025) + 139.0
						when (8200.0..8999.0): ((income - 8199.0) * 0.035) + 144.0
						when (9000.0..9999.0): ((income - 8999.0) * 0.035) + 172.0
						when (10000.0..10999.0): ((income - 9999.0) * 0.035) + 207.0
						when (11000.0..11999.0): ((income - 10999.0) * 0.035) + 242.0
						when (12000.0..12199.0): ((income - 11999.0) * 0.035) + 277.0
						when (12200.0..12999.0): ((income - 12199.0) * 0.045) + 284.0
						when (13000.0..13999.0): ((income - 12999.0) * 0.045) + 320.0
						when (14000.0..14999.0): ((income - 13999.0) * 0.045) + 365.0
						when (15000.0..15999.0): ((income - 14999.0) * 0.045) + 410.0
						when (16000.0..16999.0): ((income - 15999.0) * 0.045) + 455.0
						when (17000.0..17999.0): ((income - 16999.0) * 0.045) + 500.0
						when (18000.0..18999.0): ((income - 17999.0) * 0.045) + 545.0
						when (19000.0..19999.0): ((income - 18999.0) * 0.045) + 590.0
						when (20000.0..20399.0): ((income - 19999.0) * 0.045) + 635.0
						when (20400.0..20999.0): ((income - 20399.0) * 0.06) + 653.0
						when (21000.0..21999.0): ((income - 20999.0) * 0.06) + 689.0
						when (22000.0..22999.0): ((income - 21999.0) * 0.06) + 749.0
						when (23000.0..23999.0): ((income - 22999.0) * 0.06) + 809.0
						when (24000.0..24999.0): ((income - 23999.0) * 0.06) + 869.0
						when (25000.0..25999.0): ((income - 24999.0) * 0.06) + 929.0
						when (26000.0..26999.0): ((income - 25999.0) * 0.06) + 989.0
						when (27000.0..27999.0): ((income - 26999.0) * 0.06) + 1049.0
						when (28000.0..28999.0): ((income - 27999.0) * 0.06) + 1109.0
						when (29000.0..29999.0): ((income - 28999.0) * 0.06) + 1169.0
						when (30000.0..30999.0): ((income - 29999.0) * 0.06) + 1229.0
						when (31000.0..31999.0): ((income - 30999.0) * 0.06) + 1289.0
						when (32000.0..32999.0): ((income - 31999.0) * 0.06) + 1349.0
						when (33000.0..33999.0): ((income - 32999.0) * 0.06) + 1409.0
						else (income - 33999) * 0.07 + 1469.0
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function tax (income)
				{
					if (income <= 0.0)
					{
						return 0.0;
					}

					if (income >= 0.01 && income <= 4099.99) { return (income * 0.01); }
					else if (income >= 4100.0 && income <= 4999.0) { return ((income - 4099.0) * 0.025) + 41.0; }
					else if (income >= 5000.0 && income <= 5999.0) { return ((income - 4999.0) * 0.025) + 64.0; }
					else if (income >= 6000.0 && income <= 6999.0) { return ((income - 5999.0) * 0.025) + 89.0; }
					else if (income >= 7000.0 && income <= 7999.0) { return ((income - 6999.0) * 0.025) + 114.0; }
					else if (income >= 8000.0 && income <= 8199.0) { return ((income - 7999.0) * 0.025) + 139.0; }
					else if (income >= 8200.0 && income <= 8999.0) { return ((income - 8199.0) * 0.035) + 144.0; }
					else if (income >= 9000.0 && income <= 9999.0) { return ((income - 8999.0) * 0.035) + 172.0; }
					else if (income >= 10000.0 && income <= 10999.0) { return ((income - 9999.0) * 0.035) + 207.0; }
					else if (income >= 11000.0 && income <= 11999.0) { return ((income - 10999.0) * 0.035) + 242.0; }
					else if (income >= 12000.0 && income <= 12199.0) { return ((income - 11999.0) * 0.035) + 277.0; }
					else if (income >= 12200.0 && income <= 12999.0) { return ((income - 12199.0) * 0.045) + 284.0; }
					else if (income >= 13000.0 && income <= 13999.0) { return ((income - 12999.0) * 0.045) + 320.0; }
					else if (income >= 14000.0 && income <= 14999.0) { return ((income - 13999.0) * 0.045) + 365.0; }
					else if (income >= 15000.0 && income <= 15999.0) { return ((income - 14999.0) * 0.045) + 410.0; }
					else if (income >= 16000.0 && income <= 16999.0) { return ((income - 15999.0) * 0.045) + 455.0; }
					else if (income >= 17000.0 && income <= 17999.0) { return ((income - 16999.0) * 0.045) + 500.0; }
					else if (income >= 18000.0 && income <= 18999.0) { return ((income - 17999.0) * 0.045) + 545.0; }
					else if (income >= 19000.0 && income <= 19999.0) { return ((income - 18999.0) * 0.045) + 590.0; }
					else if (income >= 20000.0 && income <= 20399.0) { return ((income - 19999.0) * 0.045) + 635.0; }
					else if (income >= 20400.0 && income <= 20999.0) { return ((income - 20399.0) * 0.06) + 653.0; }
					else if (income >= 21000.0 && income <= 21999.0) { return ((income - 20999.0) * 0.06) + 689.0; }
					else if (income >= 22000.0 && income <= 22999.0) { return ((income - 21999.0) * 0.06) + 749.0; }
					else if (income >= 23000.0 && income <= 23999.0) { return ((income - 22999.0) * 0.06) + 809.0; }
					else if (income >= 24000.0 && income <= 24999.0) { return ((income - 23999.0) * 0.06) + 869.0; }
					else if (income >= 25000.0 && income <= 25999.0) { return ((income - 24999.0) * 0.06) + 929.0; }
					else if (income >= 26000.0 && income <= 26999.0) { return ((income - 25999.0) * 0.06) + 989.0; }
					else if (income >= 27000.0 && income <= 27999.0) { return ((income - 26999.0) * 0.06) + 1049.0; }
					else if (income >= 28000.0 && income <= 28999.0) { return ((income - 27999.0) * 0.06) + 1109.0; }
					else if (income >= 29000.0 && income <= 29999.0) { return ((income - 28999.0) * 0.06) + 1169.0; }
					else if (income >= 30000.0 && income <= 30999.0) { return ((income - 29999.0) * 0.06) + 1229.0; }
					else if (income >= 31000.0 && income <= 31999.0) { return ((income - 30999.0) * 0.06) + 1289.0; }
					else if (income >= 32000.0 && income <= 32999.0) { return ((income - 31999.0) * 0.06) + 1349.0; }
					else if (income >= 33000.0 && income <= 33999.0) { return ((income - 32999.0) * 0.06) + 1409.0; }
					else { return (income - 33999) * 0.07 + 1469.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="698D9A2736187A768150F85B91144E3B" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(income)
					
					return 0.0 if (income <= 0)
					case (income)
						when (0.01..8000.0): (income * 0.04)
						when (8000.01..11000.0): ((income - 8000) * 0.045 + 320.0)
						when (11000.01..13000.0): ((income - 11000) * 0.0525 + 455.0)
						when (13000.01..20000.0): ((income -13000) * 0.059 + 560.0)
						when (20000.01..75000.0): ((income -20000) * 0.0645 + 973.0)
						when (75000.01..200000.0): ((income -75000) * 0.0665 + 4521.0)	
						when (200000.01..1000000.0): ((income -200000) * 0.0685 + 12833.0)
						else ((income - 1000000) * 0.0882 + 67633.0)
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(income)
				{
					if (income <= 0)
					{
						return 0.0;
					}
					
					if (income >= 0.01 && income <= 8000.0) { return  (income * 0.04); }
					else if (income >= 8000.01 && income <= 11000.0) { return  ((income - 8000) * 0.045 + 320.0); }
					else if (income >= 11000.01 && income <= 13000.0) { return  ((income - 11000) * 0.0525 + 455.0); }
					else if (income >= 13000.01 && income <= 20000.0) { return  ((income -13000) * 0.059 + 560.0); }
					else if (income >= 20000.01 && income <= 75000.0) { return  ((income -20000) * 0.0645 + 973.0); }
					else if (income >= 75000.01 && income <= 200000.0) { return  ((income -75000) * 0.0665 + 4521.0); }
					else if (income >= 200000.01 && income <= 1000000.0) { return  ((income -200000) * 0.0685 + 12833.0); }
					else { return ((income - 1000000) * 0.0882 + 67633.0); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="5F0041A1848628E6BBA347EF0AE96A3C" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def tax(amount)
					if( amount > 1000000.0 ) then 67633.0 + ( amount - 1000000.0 ) * 0.0882
					elsif( amount > 200000.0 ) then 12833.0 + ( amount - 200000.0 ) * 0.0685
					elsif( amount > 75000.0 ) then 4521.0 + ( amount - 75000.0 ) * 0.0665
					elsif( amount > 20000.0 ) then 973.0 + ( amount - 20000.0 ) * 0.0645
					elsif( amount > 13000.0 ) then 560.0 + ( amount - 13000.0 ) * 0.059
					elsif( amount > 11000.0 ) then 455.0 + ( amount - 11000.0 ) * 0.0525
					elsif( amount > 8000.0 ) then 320.0 + ( amount - 8000.0 ) * 0.045
					elsif( amount > 0.0 ) then amount * 0.04
					else 0.0
					end
				end	
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function tax(amount)
				{
					if ( amount > 1000000.0 ) { return 67633.0 + ( amount - 1000000.0 ) * 0.0882; }
					else if( amount > 200000.0 ) { return 12833.0 + ( amount - 200000.0 ) * 0.0685; }
					else if( amount > 75000.0 ) { return 4521.0 + ( amount - 75000.0 ) * 0.0665; }
					else if( amount > 20000.0 ) { return 973.0 + ( amount - 20000.0 ) * 0.0645; }
					else if( amount > 13000.0 ) { return 560.0 + ( amount - 13000.0 ) * 0.059; }
					else if( amount > 11000.0 ) { return 455.0 + ( amount - 11000.0 ) * 0.0525; }
					else if( amount > 8000.0 ) { return 320.0 + ( amount - 8000.0 ) * 0.045; }
					else if( amount > 0.0 ) { return amount * 0.04; }; }
					else { return 0.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="FA94E209E0B2F2216942A82D90129311" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_amount)

					tax =	if (taxable_amount > 16400.0)
							taxable_amount * 0.069 - 522.0
						elsif (taxable_amount > 12700.0)
							taxable_amount * 0.06 - 374.0
						elsif (taxable_amount > 9900.0)
							taxable_amount * 0.05 - 247.0
						elsif (taxable_amount > 7300.0)
							taxable_amount * 0.04 - 148.0
						elsif (taxable_amount > 4800.0)
							taxable_amount * 0.03 - 75.0
						elsif (taxable_amount > 2700.0)
							taxable_amount * 0.02 - 27.0
						elsif (taxable_amount > 0.0)
							taxable_amount * 0.01
						else 0.0
						end
					return tax
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_amount)
				{
					if (taxable_amount > 16400.0) { return taxable_amount * 0.069 - 522.0; }
					else if (taxable_amount > 12700.0) { return taxable_amount * 0.06 - 374.0; 	}
					else if (taxable_amount > 9900.0) { return taxable_amount * 0.05 - 247.0; }
					else if (taxable_amount > 7300.0) { return taxable_amount * 0.04 - 148.0; }
					else if (taxable_amount > 4800.0) { return taxable_amount * 0.03 - 75.0; }
					else if (taxable_amount > 2700.0) { return taxable_amount * 0.02 - 27.0; }
					else if (taxable_amount > 0.0) { return taxable_amount * 0.01; }
					else { return 0.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="BE1954A7D8BE42394C0F58A08ED7E331" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)							

					return 0.0 if (taxable_income <= 0.0)

					case taxable_income
						when (0.01..2700.0): taxable_income * 0.01
						when (2700.01..4800.0): ((taxable_income * 0.02 ) - 27.0)
						when (4800.01..7300.0): ((taxable_income * 0.03) - 75.0)
						when (7300.01..9900.0): ((taxable_income * 0.04) - 148.0)
						when (9900.01..12700.0): ((taxable_income * 0.05 ) - 247.0)
						when (12700.01..16400.0): ((taxable_income * 0.06) - 374.0)
						else ((taxable_income * 0.069) - 522.0)
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2700.0) { return  taxable_income * 0.01; }
					else if (taxable_income >= 2700.01 && taxable_income <= 4800.0) { return  ((taxable_income * 0.02 ) - 27.0); }
					else if (taxable_income >= 4800.01 && taxable_income <= 7300.0) { return  ((taxable_income * 0.03) - 75.0); }
					else if (taxable_income >= 7300.01 && taxable_income <= 9900.0) { return  ((taxable_income * 0.04) - 148.0); }
					else if (taxable_income >= 9900.01 && taxable_income <= 12700.0) { return  ((taxable_income * 0.05 ) - 247.0); }
					else if (taxable_income >= 12700.01 && taxable_income <= 16400.0) { return  ((taxable_income * 0.06) - 374.0); }
					else { return ((taxable_income * 0.069) - 522.0); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="A7D7704728B92A2D385BC644386FCB92" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(amount)

					amount = amount.to_f

					return 0.0 unless (amount > 0.0)

					case (amount)
						when (0.01..2700.0): (amount * 0.01)
						when (2700.01..4800.0): (amount * 0.02) - 27.0
						when (4800.01..7300.0): (amount * 0.03) - 75.0
						when (7300.01..9900.0): (amount * 0.04) - 148.0
						when (9900.01..12700.0): (amount * 0.05) - 247.0
						when (12700.01..16400.0): (amount * 0.06) - 374.0
						else (amount * 0.069) - 522.0
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2700.0) { return (amount * 0.01); }
					else if (amount >= 2700.01 && amount <= 4800.0) { return (amount * 0.02) - 27.0; }
					else if (amount >= 4800.01 && amount <= 7300.0) { return (amount * 0.03) - 75.0; }
					else if (amount >= 7300.01 && amount <= 9900.0) { return (amount * 0.04) - 148.0; }
					else if (amount >= 9900.01 && amount <= 12700.0) { return (amount * 0.05) - 247.0; }
					else if (amount >= 12700.01 && amount <= 16400.0) { return (amount * 0.06) - 374.0; }
					else { return (amount * 0.069) - 522.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="25B8A0615B4762CF53D7DE5CFC6F42A4" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)			 		

					return 0.0 if (taxable_income < 930000.0)

					return case taxable_income
							when (930000...1870000): 190.0		
							when (1870000...9340000): 560.0
							when (9340000...18680000): 1870.0
							when (18680000...37360000): 3740.0
							else 9340.0
						end
				end			
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)			 		
				{
					if (taxable_income < 930000.0)
					{
						return 0.0;
					}

					if (taxable_income >= 930000 && taxable_income <= 1870000) { return  190.0; }
					else if (taxable_income >= 1870000 && taxable_income <= 9340000) { return  560.0; }
					else if (taxable_income >= 9340000 && taxable_income <= 18680000) { return  1870.0; }
					else if (taxable_income >= 18680000 && taxable_income <= 37360000) { return  3740.0; }
					else { return 9340.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="8A826F0FD672A6C2900F829601AEF356" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)							

					return 0.0 if (taxable_income <= 0.0)

					case taxable_income
						when (0.01..1000000.0): taxable_income * 0.1
						when (1000000.01..2000000.0): (((taxable_income - 1000000.0) * 0.11 ) + 100000.0)
						when (2000000.01..3000000.0): (((taxable_income - 2000000.0) * 0.12 ) + 210000.0)
						when (3000000.01..4000000.0): (((taxable_income - 3000000.0) * 0.13 ) + 330000.0)
						when (4000000.01..5000000.0): (((taxable_income - 4000000.0) * 0.14 ) + 460000.0)
						else (((taxable_income - 5000000) * 0.157) + 600000.0)
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 1000000.0) { return  taxable_income * 0.1; }
					else if (taxable_income >= 1000000.01 && taxable_income <= 2000000.0) { return  (((taxable_income - 1000000.0) * 0.11 ) + 100000.0); }
					else if (taxable_income >= 2000000.01 && taxable_income <= 3000000.0) { return  (((taxable_income - 2000000.0) * 0.12 ) + 210000.0); }
					else if (taxable_income >= 3000000.01 && taxable_income <= 4000000.0) { return  (((taxable_income - 3000000.0) * 0.13 ) + 330000.0); }
					else if (taxable_income >= 4000000.01 && taxable_income <= 5000000.0) { return  (((taxable_income - 4000000.0) * 0.14 ) + 460000.0); }
					else { return (((taxable_income - 5000000) * 0.157) + 600000.0); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="2EAF23BAA9479FC83F3470D0B00B7D0D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1494.01)					
			        tax = taxable_income * 0.0036				
		        when (1494.01...2988.01)					
			        tax = ((taxable_income - 1494.0) * 0.0072) + 5.38		
		        when (2988.01...5976.01)					
			        tax = ((taxable_income - 2988.0) * 0.0243) + 16.14	
		        when (5976.01...13446.01)					
			        tax = ((taxable_income - 5976.0) * 0.045) + 88.75
		        when (13446.01...22410.01)					
			        tax = ((taxable_income - 13446.0) * 0.0612) + 424.90
		        when (22410.01...29880.01)					
			        tax = ((taxable_income - 22410.0) * 0.0648) + 973.50
		        when (29880.01...44820.01)					
			        tax = ((taxable_income - 29880.0) * 0.068) + 1457.56
		        when (44820.01...67230.01)					
			        tax = ((taxable_income - 44820.0) * 0.0792) + 2473.48		
		        else					
			        tax = ((taxable_income - 67230.0) * 0.0898) + 4248.35				
	        end					
	        return tax						
        end					
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
  
          var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1494.01)
						{ tax = taxable_income * 0.0036; }
					else if (taxable_income >= 1494.01 && taxable_income <= 2988.01)
						{ tax = ((taxable_income - 1494.0) * 0.0072) + 5.38; }
					else if (taxable_income >= 2988.01 && taxable_income <= 5976.01)
						{ tax = ((taxable_income - 2988.0) * 0.0243) + 16.14; }
					else if (taxable_income >= 5976.01 && taxable_income <= 13446.01)
						{ tax = ((taxable_income - 5976.0) * 0.045) + 88.75; }
					else if (taxable_income >= 13446.01 && taxable_income <= 22410.01)
						{ tax = ((taxable_income - 13446.0) * 0.0612) + 424.90; }
					else if (taxable_income >= 22410.01 && taxable_income <= 29880.01)
						{ tax = ((taxable_income - 22410.0) * 0.0648) + 973.50; }
					else if (taxable_income >= 29880.01 && taxable_income <= 44820.01)
						{ tax = ((taxable_income - 29880.0) * 0.068) + 1457.56; }
					else if (taxable_income >= 44820.01 && taxable_income <= 67230.01)
						{ tax = ((taxable_income - 44820.0) * 0.0792) + 2473.48; }
					else
						{ tax = ((taxable_income - 67230.0) * 0.0898) + 4248.35; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="2EAF23BAA9479FC83F3470D0B00B7D0D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)							
					if (taxable_income <= 0.0) { return return 0 end						
					case taxable_income						
						when (0.01...1494.01)					
							tax = taxable_income * 0.0036				
						when (1494.01...2988.01)					
							tax = ((taxable_income - 1494.0) * 0.0072) + 5.38		
						when (2988.01...5976.01)					
							tax = ((taxable_income - 2988.0) * 0.0243) + 16.14	
						when (5976.01...13446.01)					
							tax = ((taxable_income - 5976.0) * 0.045) + 88.75
						when (13446.01...22410.01)					
							tax = ((taxable_income - 13446.0) * 0.0612) + 424.90
						when (22410.01...29880.01)					
							tax = ((taxable_income - 22410.0) * 0.0648) + 973.50
						when (29880.01...44820.01)					
							tax = ((taxable_income - 29880.0) * 0.068) + 1457.56
						when (44820.01...67230.01)					
							tax = ((taxable_income - 44820.0) * 0.0792) + 2473.48		
						else					
							tax = ((taxable_income - 67230.0) * 0.0898) + 4248.35				
					end					
					return tax						
				end							
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}
          
          var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1494.01)
						{ tax = taxable_income * 0.0036; }
					else if (taxable_income >= 1494.01 && taxable_income <= 2988.01)
						{ tax = ((taxable_income - 1494.0) * 0.0072) + 5.38; }
					else if (taxable_income >= 2988.01 && taxable_income <= 5976.01)
						{ tax = ((taxable_income - 2988.0) * 0.0243) + 16.14; }
					else if (taxable_income >= 5976.01 && taxable_income <= 13446.01)
						{ tax = ((taxable_income - 5976.0) * 0.045) + 88.75; }
					else if (taxable_income >= 13446.01 && taxable_income <= 22410.01)
						{ tax = ((taxable_income - 13446.0) * 0.0612) + 424.90; }
					else if (taxable_income >= 22410.01 && taxable_income <= 29880.01)
						{ tax = ((taxable_income - 22410.0) * 0.0648) + 973.50; }
					else if (taxable_income >= 29880.01 && taxable_income <= 44820.01)
						{ tax = ((taxable_income - 29880.0) * 0.068) + 1457.56; }
					else if (taxable_income >= 44820.01 && taxable_income <= 67230.01)
						{ tax = ((taxable_income - 44820.0) * 0.0792) + 2473.48; }
					else
						{ tax = ((taxable_income - 67230.0) * 0.0898) + 4248.35; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="BAE9E60829B87A0F040E57989220664D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def tax(amount)

					return 0.0 unless (amount > 0.0)

					case (amount)
						when (0.01..5200.0): amount * 0.00587
						when (5200.01..10400.0): ((amount - 5200.0) * 0.01174) + 30.52
						when (10400.01..15650.0): ((amount - 10400.0) * 0.02348) + 91.57
						when (15650.01..20900.0): ((amount - 15650.0) * 0.02935) + 214.84
						when (20900.01..41700.0): ((amount - 20900.0) * 0.03521) + 368.93
						when (41700.01..83350.0): ((amount - 41700.0) * 0.04109) + 1101.3
						when (83350.01..104250.0): ((amount - 83350.0) * 0.04695) + 2812.7
						when (104250.01..208500.0): ((amount - 104250.0) * 0.05451) + 3793.96
						else ((amount - 208500.0) * 0.05925) + 9476.63
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function tax(amount)
				{
					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 5200.0) { return amount * 0.00587; }
					else if (amount >= 5200.01 && amount <= 10400.0) { return ((amount - 5200.0) * 0.01174) + 30.52; }
					else if (amount >= 10400.01 && amount <= 15650.0) { return ((amount - 10400.0) * 0.02348) + 91.57; }
					else if (amount >= 15650.01 && amount <= 20900.0) { return ((amount - 15650.0) * 0.02935) + 214.84; }
					else if (amount >= 20900.01 && amount <= 41700.0) { return ((amount - 20900.0) * 0.03521) + 368.93; }
					else if (amount >= 41700.01 && amount <= 83350.0) { return ((amount - 41700.0) * 0.04109) + 1101.3; }
					else if (amount >= 83350.01 && amount <= 104250.0) { return ((amount - 83350.0) * 0.04695) + 2812.7; }
					else if (amount >= 104250.01 && amount <= 208500.0) { return ((amount - 104250.0) * 0.05451) + 3793.96; }
					else { return ((amount - 208500.0) * 0.05925) + 9476.63; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="CCAE32D42F31D88A4E95D34BC8C965CF" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...2000.01)					
			        tax = 0.0				
		        when (2000.01...5000.01)					
			        tax = ((taxable_income - 2000.0) * 0.0220)		
		        when (5000.01...10000.01)					
			        tax = ((taxable_income - 5000.0) * 0.0390) + 66.0				
		        when (10000.01...20000.01)					
			        tax = ((taxable_income - 10000.0) * 0.0480) + 261.0
		        when (20000.01...25000.01)					
			        tax = ((taxable_income - 20000.0) * 0.0520) + 741.0
		        when (25000.01...60000.01)					
			        tax = ((taxable_income - 25000.0) * 0.0555) + 1001.0
		        else					
			        tax = ((taxable_income - 60000.0) * 0.0675) + 2943.50				
	        end						
	        return tax						
        end	
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

          var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 2000.01) { tax = 0.0; }
					else if (taxable_income >= 2000.01 && taxable_income <= 5000.01) { tax = ((taxable_income - 2000.0) * 0.0220); }
					else if (taxable_income >= 5000.01 && taxable_income <= 10000.01) { tax = ((taxable_income - 5000.0) * 0.0390) + 66.0; }
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.01) { tax = ((taxable_income - 10000.0) * 0.0480) + 261.0; }
					else if (taxable_income >= 20000.01 && taxable_income <= 25000.01) { tax = ((taxable_income - 20000.0) * 0.0520) + 741.0; }
					else if (taxable_income >= 25000.01 && taxable_income <= 60000.01) { tax = ((taxable_income - 25000.0) * 0.0555) + 1001.0; }
					else { tax = ((taxable_income - 60000.0) * 0.0675) + 2943.50; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="CCAE32D42F31D88A4E95D34BC8C965CF" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(taxable_income)							
					if (taxable_income <= 0.0) { return return 0 end						
					case taxable_income						
						when (0.01...2000.01)					
							tax = 0.0				
						when (2000.01...5000.01)					
							tax = ((taxable_income - 2000.0) * 0.0220)		
						when (5000.01...10000.01)					
							tax = ((taxable_income - 5000.0) * 0.0390) + 66.0				
						when (10000.01...20000.01)					
							tax = ((taxable_income - 10000.0) * 0.0480) + 261.0
						when (20000.01...25000.01)					
							tax = ((taxable_income - 20000.0) * 0.0520) + 741.0
						when (25000.01...60000.01)					
							tax = ((taxable_income - 25000.0) * 0.0555) + 1001.0
						else					
							tax = ((taxable_income - 60000.0) * 0.0675) + 2943.50				
					end						
					return tax						
				end							
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

          var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 2000.01) { tax = 0.0; }
					else if (taxable_income >= 2000.01 && taxable_income <= 5000.01) { tax = ((taxable_income - 2000.0) * 0.0220); }
					else if (taxable_income >= 5000.01 && taxable_income <= 10000.01) { tax = ((taxable_income - 5000.0) * 0.0390) + 66.0; }
					else if (taxable_income >= 10000.01 && taxable_income <= 20000.01) { tax = ((taxable_income - 10000.0) * 0.0480) + 261.0; }
					else if (taxable_income >= 20000.01 && taxable_income <= 25000.01) { tax = ((taxable_income - 20000.0) * 0.0520) + 741.0; }
					else if (taxable_income >= 25000.01 && taxable_income <= 60000.01) { tax = ((taxable_income - 25000.0) * 0.0555) + 1001.0; }
					else { tax = ((taxable_income - 60000.0) * 0.0675) + 2943.50; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="F4A8F8EFE9611BC95649E187EF95D771" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(status, taxable_income)

					return 0.0 unless (taxable_income > 0.0)

					case (status)

						when ("two_and_five")

							case (taxable_income)

								when (0.01..16000.0): taxable_income * 0.04
								when (16000.01..22000.0): ((taxable_income - 16000.0) * 0.045) + 640.0
								when (22000.01..26000.0): ((taxable_income - 22000.0) * 0.0525) + 910.0
								when (26000.01..40000.0): ((taxable_income - 26000.0) * 0.059) + 1120.0
								when (40000.01..150000.0): ((taxable_income - 40000.0) * 0.0645) + 1946.0
								when (150000.01..300000.0): ((taxable_income - 150000.0) * 0.0665) + 9041.0
								when (300000.01..2000000.0): ((taxable_income - 300000.0) * 0.0685) + 19016.0
								else ((taxable_income - 2000000.0) * 0.0882) + 135466.0
							end

						when ("one_and_three")

							case (taxable_income)

								when (0.01..8000.0): taxable_income * 0.04
								when (8000.01..11000.0): ((taxable_income - 8000.0) * 0.045) + 320.0
								when (11000.01..13000.0): ((taxable_income - 11000.0) * 0.0525) + 455.0
								when (13000.01..20000.0): ((taxable_income - 13000.0) * 0.059) + 560.0
								when (20000.01..75000.0): ((taxable_income - 20000.0) * 0.0645) + 973.0
								when (75000.01..200000.0): ((taxable_income - 75000.0) * 0.0665) + 4521.0
								when (200000.01..1000000.0): ((taxable_income - 200000.0) * 0.0685) + 12833.0
								else ((taxable_income - 1000000.0) * 0.0882) + 67633.0
							end

						when ("four")

							case (taxable_income)

								when (0.01..12000.0): taxable_income * 0.04
								when (12000.01..16500.0): ((taxable_income - 12000.0) * 0.045) + 480.0
								when (16500.01..19500.0): ((taxable_income - 16500.0) * 0.0525) + 683.0
								when (19500.01..30000.0): ((taxable_income - 19500.0) * 0.059) + 840.0
								when (30000.01..100000.0): ((taxable_income - 30000.0) * 0.0645) + 1460.0
								when (100000.01..250000.0): ((taxable_income - 100000.0) * 0.0665) + 5975.0
								when (250000.01..1500000.0): ((taxable_income - 250000.0) * 0.0685) + 15950.0
								else ((taxable_income - 1500000.0) * 0.0882) + 101575.0
							end
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(status, taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (status == "two_and_five")
					{
						if (taxable_income >= 0.01 && taxable_income <= 16000.0) { return taxable_income * 0.04; }
						else if (taxable_income >= 16000.01 && taxable_income <= 22000.0) { return ((taxable_income - 16000.0) * 0.045) + 640.0; }
						else if (taxable_income >= 22000.01 && taxable_income <= 26000.0) { return ((taxable_income - 22000.0) * 0.0525) + 910.0; }
						else if (taxable_income >= 26000.01 && taxable_income <= 40000.0) { return ((taxable_income - 26000.0) * 0.059) + 1120.0; }
						else if (taxable_income >= 40000.01 && taxable_income <= 150000.0) { return ((taxable_income - 40000.0) * 0.0645) + 1946.0; }
						else if (taxable_income >= 150000.01 && taxable_income <= 300000.0) { return ((taxable_income - 150000.0) * 0.0665) + 9041.0; }
						else if (taxable_income >= 300000.01 && taxable_income <= 2000000.0) { return ((taxable_income - 300000.0) * 0.0685) + 19016.0; }
						else { return ((taxable_income - 2000000.0) * 0.0882) + 135466.0; }
					}
					else if (status == "one_and_three")
					{
						if (taxable_income >= 0.01 && taxable_income <= 8000.0) { return taxable_income * 0.04; }
						else if (taxable_income >= 8000.01 && taxable_income <= 11000.0) { return ((taxable_income - 8000.0) * 0.045) + 320.0; }
						else if (taxable_income >= 11000.01 && taxable_income <= 13000.0) { return ((taxable_income - 11000.0) * 0.0525) + 455.0; }
						else if (taxable_income >= 13000.01 && taxable_income <= 20000.0) { return ((taxable_income - 13000.0) * 0.059) + 560.0; }
						else if (taxable_income >= 20000.01 && taxable_income <= 75000.0) { return ((taxable_income - 20000.0) * 0.0645) + 973.0; }
						else if (taxable_income >= 75000.01 && taxable_income <= 200000.0) { return ((taxable_income - 75000.0) * 0.0665) + 4521.0; }
						else if (taxable_income >= 200000.01 && taxable_income <= 1000000.0) { return ((taxable_income - 200000.0) * 0.0685) + 12833.0; }
						else { return ((taxable_income - 1000000.0) * 0.0882) + 67633.0; }
					}
					else if (status == "four")
					{
						if (taxable_income >= 0.01 && taxable_income <= 12000.0) { return taxable_income * 0.04; }
						else if (taxable_income >= 12000.01 && taxable_income <= 16500.0) { return ((taxable_income - 12000.0) * 0.045) + 480.0; }
						else if (taxable_income >= 16500.01 && taxable_income <= 19500.0) { return ((taxable_income - 16500.0) * 0.0525) + 683.0; }
						else if (taxable_income >= 19500.01 && taxable_income <= 30000.0) { return ((taxable_income - 19500.0) * 0.059) + 840.0; }
						else if (taxable_income >= 30000.01 && taxable_income <= 100000.0) { return ((taxable_income - 30000.0) * 0.0645) + 1460.0; }
						else if (taxable_income >= 100000.01 && taxable_income <= 250000.0) { return ((taxable_income - 100000.0) * 0.0665) + 5975.0; }
						else if (taxable_income >= 250000.01 && taxable_income <= 1500000.0) { return ((taxable_income - 250000.0) * 0.0685) + 15950.0; }
						else { return ((taxable_income - 1500000.0) * 0.0882) + 101575.0; }
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="507636D8D49C4CDC8641FAA3E05EBFD6" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(amount)

					amount = amount.to_f
					return 0.0 unless (amount > 0.0)

					case (amount)
						when (0.01..2500.0): amount * 0.15
						when (2500.01..5900.0): 375.0 + ((amount - 2500.0) * 0.25)
						when (5900.01..9050.0): 1225.0 + ((amount - 5900.0) * 0.28)
						when (9050.01..12300.0): 2107.0 + ((amount - 9050.0) * 0.33)
						else 3179.5 + ((amount - 12300.0) * 0.396)
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();
					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2500.0) { return amount * 0.15; }
					else if (amount >= 2500.01 && amount <= 5900.0) { return 375.0 + ((amount - 2500.0) * 0.25); }
					else if (amount >= 5900.01 && amount <= 9050.0) { return 1225.0 + ((amount - 5900.0) * 0.28); }
					else if (amount >= 9050.01 && amount <= 12300.0) { return 2107.0 + ((amount - 9050.0) * 0.33); }
					else { return 3179.5 + ((amount - 12300.0) * 0.396); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="C488EC5A909BE05DE8A6FA7E27A06B1C" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def compute_tax(amount)

					amount = amount.to_f
					return 0.0 unless (amount > 0.0)

					case (amount)
						when (0.01..2500.0): amount * 0.15
						when (2500.01..5800.0): 375.0 + ((amount - 2500.0) * 0.25)
						when (5800.01..8900.0): 1200.0 + ((amount - 5800.0) * 0.28)
						when (8900.01..12150.0): 2068.0 + ((amount - 8900.0) * 0.33)
						else 3140.5 + ((amount - 12150.0) * 0.396)
					end
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();
					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2500.0) { return amount * 0.15; }
					else if (amount >= 2500.01 && amount <= 5800.0) { return 375.0 + ((amount - 2500.0) * 0.25); }
					else if (amount >= 5800.01 && amount <= 8900.0) { return 1200.0 + ((amount - 5800.0) * 0.28); }
					else if (amount >= 8900.01 && amount <= 12150.0) { return 2068.0 + ((amount - 8900.0) * 0.33); }
					else { return 3140.5 + ((amount - 12150.0) * 0.396); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="09AD8CB7469C0D295550E75B08BB146B" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def process_alpha_fields(name, field_length)

					name = name.upcase.strip
					name = $'.strip if (name  =~ /^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /)

					#
					# Empty names default to field_length (MPRZ1004 has a somewhat similar routine that has a default value)
					#
					# We strip out invalid titles & following space. We also ensure the return value is of the
					# proper length, padded in the front with space characters. 
					#
					return (" " * ([field_length - name.length,0].max) + name[0,field_length])
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function process_alpha_fields(name, field_length)
				{
					name = name.trim().toUpperCase();

					name = name.replace(/^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /g, '');

					// Empty names default to field_length (MPRZ1004 has a somewhat similar routine that has a default value)
					//
					// We strip out invalid titles & following space. We also ensure the return value is of the
					// proper length, padded in the front with space characters. 
					return (" ".repeat(Math.max(field_length - name.length, 0)) + name.substring(0,field_length));
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="01DA139485395D46595C707591E03E63" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def process_alpha_fields(element, field_length, no_titles, test)

					element = element.upcase.strip
					return '' if (element.strip.empty?)
					element = $'.strip if (element  =~ /^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /) if no_titles

					#
					# We strip out invalid titles & following space. We also ensure the return value is of the
					# proper length, padded in the front with space characters. 
					#
					return (" " * ([field_length - element.length,0].max) + element[0,field_length])
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function process_alpha_fields(elmnt, field_length, no_titles, test)
				{
					elmnt = elmnt.toUpperCase().trim();
					if (elmnt.trim().isEmpty())
					{
						return '';
					}
					
					if (no_titles)
					{
						elmnt = elmnt.replace(/^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /g, '');
					}

					// We strip out invalid titles & following space. We also ensure the return value is of the
					// proper length, padded in the front with space characters. 
					return (" ".repeat(Math.max(field_length - elmnt.length, 0)) + elmnt.substring(0,field_length));
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="00F2A7FDED85F9497B2149ACFE81CF1D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def process_alpha_fields(element, field_length, no_titles, test)

	        element = element.upcase.strip
	        return '' if (element.empty?)
	        element = $'.strip if (element  =~ /^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /) if (no_titles)
	        return (test ? element : (" " * ([field_length - element.length,0].max) + element[0,field_length]))
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function process_alpha_fields(element, field_length, no_titles, test)
				{
					element = element.toUpperCase().trim();
					if (elment.trim().isEmpty())
					{
						return '';
					}
					
					if (no_titles)
					{
						element = element.replace(/^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /g, '');
					}

					return (test ? element : (" ".repeat(Math.max(field_length - element.length, 0)) + element.substring(0,field_length));
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="A4D2C637D18B0F78CE0587CE4B06C959" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
				def check_date (date)

					valid_date = nil

					#
					# Technically, Time.gm(2038, 1, 19) works and Time.gm(2038, 1, 20) fails
					# [and for dates that exceed that] but we will treat 2037 as the highest
					# date we will accept, should not pose a problem!
					#
					if (date.delete("^0-9") =~ /^(\d\d)(\d\d)(\d{4})$/)
				 
						if (((1..12) === $1.to_i) and ((1..31) === $2.to_i) and ((1970..2037) === $3.to_i))
					
							valid_date = Time.gm($3, $1, $2)
						end
					end

					return valid_date
				end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function check_date(date)
		    {
			    var valid_date = null;
	
			    // Technically, Time.gm(2038, 1, 19) works and Time.gm(2038, 1, 20) fails
			    // [and for dates that exceed that] but we will treat 2037 as the highest
			    // date we will accept, should not pose a problem!
			    var matches = /^(\d\d)(\d\d)(\d{4})$/.exec(date.delete(/[^0-9]/g));
			    if (matches != null && matches.length > 0)
			    {
				    if ((matches[1].to_i() >= 1 && matches[1].to_i() <= 12) &&
					    (matches[2].to_i() >= 1 && matches[2].to_i() <= 31) &&
					    (matches[3].to_i() >= 1970 && matches[3].to_i() <= 2037))
				    {
					    valid_date = SFForms.Utilities.Time.gm(matches[3].to_i(), matches[1].to_i(), matches[2].to_i());
				    }
			    }

			    return valid_date;
		    }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="E1D4026877459B90AD7C0B804103E10B" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(period, mon, year)
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..4) === period) and ((1..12) === mon) and (year.to_s.length == 4))

	        #First adjust days_in_month[] for a leap year.
	        if ((mon == 2) and (is_leap_year(year))) then days_in_month[1] = 29 end
	
	        #Setup for the Date Coupon Due. mon is set to the next month.
	        if (mon < 12)
		        mon = mon + 1
	        else
		        #Moving into January of next year.
		        mon = 1
		        year += 1
	        end

	        #Set the Date Coupon Due day component.
	        case period
		        when 1
			        #Monthly Regular Filer. 30 days following the end of the Liability Period.
			        day = days_in_month[mon - 1]
			
			        #Adjust day for February, or months with 31 days.
			        if (day < 30)
				        #Dealing with February - move into March.
				        day = 30 - day
				        mon += 1
			        elsif (day > 30)
				        #Dealing with months that have 31 days.
				        day = 30
			        end

		        when 2
			        #Monthly Early Filer. 20th of the month following the end of the Liability Period.
			        day = 20
		        when 3
			        #Quarterly Filer. Last day of the month following the end of the Liability Period.
			        day = days_in_month[mon - 1]
		        when 4
			        #Annual Filer. Last day of the month following the end of the Liability Period.
			        day = days_in_month[mon - 1]
	        end
	
	        #Correct the Date Coupon Due dates so that they do not fall on a weekend. t.wday == 6 is Saturday,
	        #Sunday == 0. Adjust mon and year if necessary.
	        t = Time.mktime(year, mon, day)
	        day += if (t.wday == 6) then 2
		        elsif (t.wday == 0) then 1
		        else 0 end

	        if (day > days_in_month[mon - 1])
	
		        #Moving into the next month.
		        day = day - days_in_month[mon - 1]

		        if (mon < 12)
			        mon = mon + 1
		        else
			        #Moving into January of next year.
			        mon = 1
			        year += 1
		        end
	        end

	        #Check for certain holiday dates to conform to the specs. The holiday dates will
	        #need to be adjusted in future years (or an algorithm could be written for it).
	        #Ex. 01/21/2008 is Martin Luther King Jr. Day,
	
	        #For example, in 2008 labor day is on Sept. 1st.  If the
	        #liability date was 07/31/2008, the date due was output as 09/01/2008
	        # which matches the algorithm above. To compensate for these
	        #holidays, place the BAD OUTPUT DATE like 09/01/2008 
	        #(mon == 9, day == 1, year ==2008) and set the day variable to the correct
	        #day that should be displayed ie. day = 2.
	        #Martin Luther King Day
	        if ((mon == 1) and (day == 21) and (year == 2008))
		        day = 22
	        #2007 Note:This fixes labor day falling on Sept. 1 in 2008 and changes the day
	        #to Sept. 2nd.  This may need to be removed or modified next year.
	        elsif ((mon == 9) and (day == 1) and (year == 2008))
		        day = 2
	        end

	        #Assemble the Date Coupon Due components and return to caller.
	        return ('%02.0f'% mon.to_s) + ('%02.0f'% day.to_s) + year.to_s
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
function compute_due_date(period, mon, year) {
    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    var result = '00000000';

    // Check arguments first.
    if ((period >= 1 && period <= 4) && (mon >= 1 && mon <= 12) && (year.toString().length == 4)) {
        // First adjust days_in_month[] for a leap year.
        if ((mon == 2) && (is_leap_year(year))) {
            days_in_month[1] = 29;
        }

        // Setup for the Date Coupon Due. mon is set to the next month.
        if (mon < 12) {
            mon = mon + 1;
        }
        else {
            // Moving into January of next year.
            mon = 1;
            year += 1;
        }

        // Set the Date Coupon Due day component.
        var day = days_in_month[0];
        if (period == 1) {
            // Monthly Regular Filer. 30 days following the end of the Liability Period.
            day = days_in_month[mon - 1];

            // Adjust day for February, or months with 31 days.
            if (day < 30) {
                // Dealing with February - move into March.
                day = 30 - day;
                mon += 1;
            }
            else if (day > 30) {
                // Dealing with months that have 31 days.
                day = 30;
            }
        }
        else if (period == 2) {
            // Monthly Early Filer. 20th of the month following the end of the Liability Period.
            day = 20;
        }
        else if (period == 3) {
            // Quarterly Filer. Last day of the month following the end of the Liability Period.
            day = days_in_month[mon - 1];
        }
        else if (period == 4) {
            // Annual Filer. Last day of the month following the end of the Liability Period.
            day = days_in_month[mon - 1];
        }

        // Correct the Date Coupon Due dates so that they do not fall on a weekend. t.wday == 6 is Saturday,
        // Sunday == 0. Adjust mon and year if necessary.
        var t = SFForms.Utilities.Time.mktime(year, mon, day);
        if (t.wday() == 6) {
            day += 2;
        }
        else if (t.wday() == 0) {
            day += 1;
        }

        if (day > days_in_month[mon - 1]) {
            // Moving into the next month.
            day = day - days_in_month[mon - 1];

            if (mon < 12) {
                mon = mon + 1;
            }
            else {
                // Moving into January of next year.
                mon = 1;
                year += 1;
            }
        }

        // Check for certain holiday dates to conform to the specs. The holiday dates will
        // need to be adjusted in future years (or an algorithm could be written for it).
        // Ex. 01/21/2008 is Martin Luther King Jr. Day,

        // For example, in 2008 labor day is on Sept. 1st.  If the
        // liability date was 07/31/2008, the date due was output as 09/01/2008
        // which matches the algorithm above. To compensate for these
        // holidays, place the BAD OUTPUT DATE like 09/01/2008 
        // (mon == 9, day == 1, year ==2008) and set the day variable to the correct
        // day that should be displayed ie. day = 2.
        // Martin Luther King Day
        if ((mon == 1) && (day == 21) && (year == 2008)) {
            day = 22;
        }
        // 2007 Note:This fixes labor day falling on Sept. 1 in 2008 and changes the day
        // to Sept. 2nd.  This may need to be removed or modified next year.
        else if ((mon == 9) && (day == 1) && (year == 2008)) {
            day = 2;
        }

        // Assemble the Date Coupon Due components and return to caller.
        result = (mon.to_f().complexFixedString(0, '02') + day.to_f().complexFixedString(0, '02') + year.toString());
    }

    return result;
}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="9C0E7CE148345FE56957F3FA1E1EE00E" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(period, mon, year)
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..4) === period) and ((1..12) === mon) and (year.to_s.length == 4))

	        #First adjust days_in_month[] for a leap year.
	        if ((mon == 2) and (is_leap_year(year))) then days_in_month[1] = 29 end
	
	        #Setup for the Date Coupon Due. mon is set to the next month.
	        if (mon < 12)
		        mon = mon + 1
	        else
		        #Moving into January of next year.
		        mon = 1
		        year += 1
	        end

	        #Set the Date Coupon Due day component.
	        case period
		        when 1
			        #Monthly Regular Filer. 30 days following the end of the Liability Period.
			        day = days_in_month[mon - 1]
			
			        #Adjust day for February, or months with 31 days.
			        if (day < 30)
				        #Dealing with February - move into March.
				        day = 30 - day
				        mon += 1
			        elsif (day > 30)
				        #Dealing with months that have 31 days.
				        day = 30
			        end

		        when 2
			        #Monthly Early Filer. 20th of the month following the end of the Liability Period.
			        day = 20
		        when 3
			        #Quarterly Filer. Last day of the month following the end of the Liability Period.
			        day = days_in_month[mon - 1]
		        when 4
			        #Annual Filer. Last day of the month following the end of the Liability Period.
			        day = days_in_month[mon - 1]
	        end
	
	        #Correct the Date Coupon Due dates so that they do not fall on a weekend. t.wday == 6 is Saturday,
	        #Sunday == 0. Adjust mon and year if necessary.
	        t = Time.mktime(year, mon, day)
	        day += if (t.wday == 6) then 2
		        elsif (t.wday == 0) then 1
		        else 0 end

	        if (day > days_in_month[mon - 1])
	
		        #Moving into the next month.
		        day = day - days_in_month[mon - 1]

		        if (mon < 12)
			        mon = mon + 1
		        else
			        #Moving into January of next year.
			        mon = 1
			        year += 1
		        end
	        end

	        # Check for certain holiday dates to conform to the specs. The holiday dates will
	        # need to be adjusted in future years (or an algorithm could be written for it).
	        # 01/21/2008 is Martin Luther King Jr. Day,
	        if ((mon == 1) and (day == 21) and (year == 2008))
		        day = 22
	        end

	        #Assemble the Date Coupon Due components and return to caller.
	        return ('%02.0f'% mon.to_s) + ('%02.0f'% day.to_s) + year.to_s
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
function compute_due_date(period, mon, year) {
    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    var result = '00000000';
    var day;

    // Check arguments first.
    if ((period >= 1 && period <= 4) && (mon >= 1 && mon <= 12) && (year.toString().length == 4)) {
        // First adjust days_in_month[] for a leap year.
        if ((mon == 2) && (is_leap_year(year))) {
            days_in_month[1] = 29;
        }

        // Setup for the Date Coupon Due. mon is set to the next month.
        if (mon < 12) {
            mon = mon + 1;
        }
        else {
            // Moving into January of next year.
            mon = 1;
            year += 1;
        }

        // Set the Date Coupon Due day component.
        if (period == 1) {
            // Monthly Regular Filer. 30 days following the end of the Liability Period.
            day = days_in_month[mon - 1];

            // Adjust day for February, or months with 31 days.
            if (day < 30) {
                // Dealing with February - move into March.
                day = 30 - day;
                mon += 1;
            }
            else if (day > 30) {
                // Dealing with months that have 31 days.
                day = 30;
            }
        }
        else if (period == 2) {
            // Monthly Early Filer. 20th of the month following the end of the Liability Period.
            day = 20;
        }
        else if (period == 3) {
            // Quarterly Filer. Last day of the month following the end of the Liability Period.
            day = days_in_month[mon - 1];
        }
        else if (period == 4) {
            // Annual Filer. Last day of the month following the end of the Liability Period.
            day = days_in_month[mon - 1];
        }

        // Correct the Date Coupon Due dates so that they do not fall on a weekend. t.wday == 6 is Saturday,
        // Sunday == 0. Adjust mon and year if necessary.
        var t = SFForms.Utilities.Time.mktime(year, mon, day);
        if (t.wday == 6) {
            day += 2;
        }
        else if (t.wday == 0) {
            day += 1;
        }

        if (day > days_in_month[mon - 1]) {
            // Moving into the next month.
            day = day - days_in_month[mon - 1];

            if (mon < 12) {
                mon = mon + 1;
            }
            else {
                // Moving into January of next year.
                mon = 1;
                year += 1;
            }
        }

        // Check for certain holiday dates to conform to the specs. The holiday dates will
        // need to be adjusted in future years (or an algorithm could be written for it).
        // 01/21/2008 is Martin Luther King Jr. Day,
        if ((mon == 1) && (day == 21) && (year == 2008)) {
            day = 22;
        }

        // Assemble the Date Coupon Due components and return to caller.
        result = (mon.to_f().complexFixedString(0, '02') + day.to_f().complexFixedString(0, '02') + year.toString());
    }

    return result;
}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="BA214A5F3DC1B8193494F96B86062468" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)

	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)
			
			        #Correct the Coupon due dates so that they do not fall on a weekend.
			        #t.wday == 6 is Saturday, Sunday == 0.
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end
	
	        #Check for certain dates to conform to the specs. The holiday dates will
	        #need to be adjusted in future years (or an algorithm could be written for it).
	        #02/15/2010 is a holiday date, so we want 02/16/2010 for example.
	        if ((due_mon == 2) and (due_day == 15) and (due_year == 2010))
		        due_day = 16
	        end
	
	        #Prepare due date for return - string with no '/'s.
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function compute_due_date(id, mon_end, year_end, coupon)
		    {
			    var coupon_intervals = [4, 6, 9, 12, 4];
			    var liability_intervals = [3, 6, 9, 12, 12];
			    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

			    // Check arguments first.
			    if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
			    {
				    return '00000000';
			    }

			    year_end = year_end.to_i();

			    // We will index into the interval arrays with this.
			    var coupon_adj = coupon - 1;

			    var year_adj;
			    var mon_adj;
			    var due_year;
			    var mod_mon;
			    var due_mon;
			    var due_day;
			    if (id == 1)
			    {		
				    // Computing Liability Due Date. These fall on the last day of the month.
				    year_adj = year_end - 1;
				    mon_adj = mon_end + liability_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = ( mod_mon > 0 ? mod_mon : 12);
				    if (due_mon == 2)
				    {
					    due_day = (is_leap_year(due_year) ? 29 : 28);
				    }
				    else 
				    {
					    due_day = days_in_month[due_mon - 1];
				    }
			    }
			    else if (id == 2)
			    {
				    // Computing Coupon Due Date.
				    year_adj = (coupon < 5 ? year_end - 1 : year_end);
				    mon_adj = mon_end + coupon_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = (mod_mon > 0 ? mod_mon : 12);
				    due_day = (coupon < 5 ? 20 : 15);

				    // Correct the Coupon due dates so that they do not fall on a weekend.
				    // t.wday == 6 is Saturday, Sunday == 0.
				    var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
				    if (t.wday() == 6)
				    {
					    due_day += 2;
				    }
				    else if (t.wday() == 0)
				    {
					    due_day += 1;
				    }
			    }

			    // Check for certain dates to conform to the specs. The holiday dates will
			    // need to be adjusted in future years (or an algorithm could be written for it).
			    // 02/15/2010 is a holiday date, so we want 02/16/2010 for example.
			    if ((due_mon == 2) && (due_day == 15) && (due_year == 2010))
			    {
				    due_day = 16;
			    }

			    // Prepare due date for return - string with no '/'s.
			    return due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
		    }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="521BEAD6846FDC1010DD8DF88690948D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)

	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        #
			        # Correct the Coupon due dates so that they do not fall on a weekend.
			        # t.wday == 6 is Saturday, Sunday == 0.
			        #
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        #
	        # Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        # in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        # out different from the chart in the instructions, put in the computed due month, day and year
	        # which showed as wrong and adjust the day to match the chart.
	        #		
	 
               #-###########################################################
               #IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
               #-###########################################################
               #Each year when this form comes through the voucher number and year ending must be entered and checked
               #in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
               #dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
               #-###########################################################

                #This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        #In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        #year of the due date showing on the form in the variables below. In the variable labeled due_day
	        #set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        #is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

	        #
	        # Note 02/04/13: Offset below is for Martin Luther King Day holiday which needed to adjusted from
	        # 01/20/2014 to 01/21/2014.
	        #
	        if ((due_mon == 1) and (due_day == 20) and (due_year == 2014))
		        due_day = 21
	        end
	
	        #
	        # Note 02/04/13: Offset below is for Presidents' Day holiday which needed to adjusted from
	        # 02/16/2015 to 02/17/2015.
	        #
	        if ((due_mon == 2) and (due_day == 16) and (due_year == 2015))
		        due_day = 17
	        end

	        #
	        # Prepare due date for return - string with no '/'s.
	        #
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function compute_due_date(id, mon_end, year_end, coupon)
		    {
			    var coupon_intervals = [4, 6, 9, 12, 4];
			    var liability_intervals = [3, 6, 9, 12, 12];
			    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

			    // Check arguments first.
			    if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
			    {
				    return '00000000';
			    }

			    year_end = year_end.to_i();

			    // We will index into the interval arrays with this.
			    var coupon_adj = coupon - 1;

			    var year_adj;
			    var mon_adj;
			    var due_year;
			    var mod_mon;
			    var due_mon;
			    var due_day;
			    if (id == 1)
			    {		
				    // Computing Liability Due Date. These fall on the last day of the month.
				    year_adj = year_end - 1;
				    mon_adj = mon_end + liability_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = ( mod_mon > 0 ? mod_mon : 12);
				    if (due_mon == 2)
				    {
					    due_day = (is_leap_year(due_year) ? 29 : 28);
				    }
				    else 
				    {
					    due_day = days_in_month[due_mon - 1];
				    }
			    }
			    else if (id == 2)
			    {
				    // Computing Coupon Due Date.
				    year_adj = (coupon < 5 ? year_end - 1 : year_end);
				    mon_adj = mon_end + coupon_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = (mod_mon > 0 ? mod_mon : 12);
				    due_day = (coupon < 5 ? 20 : 15);

				    // Correct the Coupon due dates so that they do not fall on a weekend.
				    // t.wday == 6 is Saturday, Sunday == 0.
				    var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
				    if (t.wday() == 6)
				    {
					    due_day += 2;
				    }
				    else if (t.wday() == 0)
				    {
					    due_day += 1;
				    }
			    }

			    // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
			    // in future years (or an algorithm could be written for it). Test the due dates and if one comes
			    // out different from the chart in the instructions, put in the computed due month, day and year
			    // which showed as wrong and adjust the day to match the chart.
			 
			    //-###########################################################
			    //IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
			    //-###########################################################
			    //Each year when this form comes through the voucher number and year ending must be entered and checked
			    //in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
			    //dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
			    //-###########################################################

			    // This offsets the due day for individual due dates that come up incorrect because of a holiday. 
			    // In the algorithm below, using the due date that is showing on the form, put the month, date, and
			    // year of the due date showing on the form in the variables below. In the variable labeled due_day
			    // set the day equal to the correct day that is showing in the specs. For example, if the due day that
			    // is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

			    // Note 02/04/13: Offset below is for Martin Luther King Day holiday which needed to adjusted from
			    // 01/20/2014 to 01/21/2014.
			    if ((due_mon == 1) && (due_day == 20) && (due_year == 2014))
			    {
				    due_day = 21;
			    }

			    // Note 02/04/13: Offset below is for Presidents' Day holiday which needed to adjusted from
			    // 02/16/2015 to 02/17/2015.
			    if ((due_mon == 2) && (due_day == 16) && (due_year == 2015))
			    {
				    due_day = 17;
			    }

			    // Prepare due date for return - string with no '/'s.
			    return due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
		    }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="521BEAD6846FDC1010DD8DF88690948D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)

	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        #
			        # Correct the Coupon due dates so that they do not fall on a weekend.
			        # t.wday == 6 is Saturday, Sunday == 0.
			        #
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) { return 2
					        elsif (t.wday == 0) { return 1
					        else 0 end
	        end

	        #
	        # Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        # in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        # out different from the chart in the instructions, put in the computed due month, day and year
	        # which showed as wrong and adjust the day to match the chart.
	        #		
	 
               #-###########################################################
               #IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
               #-###########################################################
               #Each year when this form comes through the voucher number and year ending must be entered and checked
               #in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
               #dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
               #-###########################################################

                #This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        #In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        #year of the due date showing on the form in the variables below. In the variable labeled due_day
	        #set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        #is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

	        #
	        # Note 02/04/13: Offset below is for Martin Luther King Day holiday which needed to adjusted from
	        # 01/20/2014 to 01/21/2014.
	        #
	        if ((due_mon == 1) and (due_day == 20) and (due_year == 2014))
		        due_day = 21
	        end
	
	        #
	        # Note 02/04/13: Offset below is for Presidents' Day holiday which needed to adjusted from
	        # 02/16/2015 to 02/17/2015.
	        #
	        if ((due_mon == 2) and (due_day == 16) and (due_year == 2015))
		        due_day = 17
	        end

	        #
	        # Prepare due date for return - string with no '/'s.
	        #
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function compute_due_date(id, mon_end, year_end, coupon)
		    {
			    var coupon_intervals = [4, 6, 9, 12, 4];
			    var liability_intervals = [3, 6, 9, 12, 12];
			    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

			    // Check arguments first.
			    if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
			    {
				    return '00000000';
			    }

			    year_end = year_end.to_i();

			    // We will index into the interval arrays with this.
			    var coupon_adj = coupon - 1;

			    var year_adj;
			    var mon_adj;
			    var due_year;
			    var mod_mon;
			    var due_mon;
			    var due_day;
			    if (id == 1)
			    {		
				    // Computing Liability Due Date. These fall on the last day of the month.
				    year_adj = year_end - 1;
				    mon_adj = mon_end + liability_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = ( mod_mon > 0 ? mod_mon : 12);
				    if (due_mon == 2)
				    {
					    due_day = (is_leap_year(due_year) ? 29 : 28);
				    }
				    else 
				    {
					    due_day = days_in_month[due_mon - 1];
				    }
			    }
			    else if (id == 2)
			    {
				    // Computing Coupon Due Date.
				    year_adj = (coupon < 5 ? year_end - 1 : year_end);
				    mon_adj = mon_end + coupon_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = (mod_mon > 0 ? mod_mon : 12);
				    due_day = (coupon < 5 ? 20 : 15);

				    // Correct the Coupon due dates so that they do not fall on a weekend.
				    // t.wday == 6 is Saturday, Sunday == 0.
				    var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
				    if (t.wday() == 6)
				    {
					    due_day += 2;
				    }
				    else if (t.wday() == 0)
				    {
					    due_day += 1;
				    }
			    }

			    // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
			    // in future years (or an algorithm could be written for it). Test the due dates and if one comes
			    // out different from the chart in the instructions, put in the computed due month, day and year
			    // which showed as wrong and adjust the day to match the chart.
			 
			    //-###########################################################
			    //IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
			    //-###########################################################
			    //Each year when this form comes through the voucher number and year ending must be entered and checked
			    //in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
			    //dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
			    //-###########################################################

			    // This offsets the due day for individual due dates that come up incorrect because of a holiday. 
			    // In the algorithm below, using the due date that is showing on the form, put the month, date, and
			    // year of the due date showing on the form in the variables below. In the variable labeled due_day
			    // set the day equal to the correct day that is showing in the specs. For example, if the due day that
			    // is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

			    // Note 02/04/13: Offset below is for Martin Luther King Day holiday which needed to adjusted from
			    // 01/20/2014 to 01/21/2014.
			    if ((due_mon == 1) && (due_day == 20) && (due_year == 2014))
			    {
				    due_day = 21;
			    }

			    // Note 02/04/13: Offset below is for Presidents' Day holiday which needed to adjusted from
			    // 02/16/2015 to 02/17/2015.
			    if ((due_mon == 2) && (due_day == 16) && (due_year == 2015))
			    {
				    due_day = 17;
			    }

			    // Prepare due date for return - string with no '/'s.
			    return due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
		    }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="74E7A702F521131648DDA24AF11DD70D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        #address1 and address2 were modified
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
			        address1 = profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name
			        address2 = profile.address + ( profile.apartment_number.strip.empty? ? '' : ' ' + 'Apt. #' + profile.apartment_number )
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        #This first if statement was added.
			        if (address1.empty?)
				        address1 = address2
				        address2 = address3
				        address3 = ''
			        end
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end

	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							// address1 and address2 were modified
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
							address1 = profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name;
							address2 = profile.address + ( profile.apartment_number.trim().isEmpty() ? '' : ' ' + 'Apt. #' + profile.apartment_number );
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						name = profile.name;
						address1 = profile.address;
						address2 = profile.address2;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use Firm name if available 
						if (!profile.firm_name.trim().isEmpty())
						{
							name = profile.firm_name;
						}
						else
						{
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
						}
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
						{
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
						}
						else 
						{
							name = profile.applicant_entity_name;
						}
						address1 = profile.applicant_address;
						if (!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							// This first if statement was added.
							if (address1.isEmpty())
							{
								address1 = address2;
								address2 = address3;
								address3 = '';
							}
							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="E361D96BB70A770BA198B4F56F2044F3" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', '.to_f + profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
							address1 = profile.address;
							if (! profile.apartment_number.trim().isEmpty())
							{
								address2 = 'Apt. #' + profile.apartment_number;
							}
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						name = profile.name;
						address1 = profile.address;
						address2 = profile.address2;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use Firm name if available 
						if (!profile.firm_name.trim().isEmpty())
						{
							name = profile.firm_name;
						}
						else
						{
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
						}
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
						{
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
						}
						else 
						{
							name = profile.applicant_entity_name;
						}
						address1 = profile.applicant_address;
						if (!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="EE0C09DF59C9CB22734A2E2C647D6619" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        if profile.estate_name.strip.empty?
			        name = profile.name
			        address1 = profile.address
			        address2 = profile.address2
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        else	
			        name = profile.estate_name
		        end
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
							address1 = profile.address;
							if (!profile.apartment_number.trim().isEmpty())
							{
								address2 = 'Apt. #' + profile.apartment_number;
							}
							address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						if profile.estate_name.strip.empty?
						{
							name = profile.name;
							address1 = profile.address;
							address2 = profile.address2;
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
						else
						{
							name = profile.estate_name;
						}
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use Firm name if available 
						if (!profile.firm_name.trim().isEmpty())
						{
							name = profile.firm_name;
						}
						else
						{
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
						}
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
						{
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
						}
						else 
						{
							name = profile.applicant_entity_name;
						}
						address1 = profile.applicant_address;
						if (!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="D0719D8826057F14C7CE081F16C2EDAA" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.last_name + ' ' +  (profile.suffix.strip.empty? ? '' : profile.suffix + ' ') + profile.first_name + ' ' + profile.middle_initial
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.last_name + ' ' + profile.first_name + ' ' + profile.middle_initial
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_last_name + ' ' + (profile.applicant_suffix.empty? ? '' : profile.applicant_suffix) + ' ' + profile.applicant_first_name + ' ' + profile.applicant_middle_initial
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							name = profile.last_name + ' ' +  (profile.suffix.trim().isEmpty() ? '' : profile.suffix + ' ') + profile.first_name + ' ' + profile.middle_initial;
							address1 = profile.address;
							if (!profile.apartment_number.trim().isEmpty())
							{
								address2 = 'Apt. #' + profile.apartment_number;
							}
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						name = profile.name;
						address1 = profile.address;
						address2 = profile.address2;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use Firm name if available 
						if (profile.firm_name.trim().isEmpty())
						{
							name = profile.last_name + ' ' + profile.middle_initial + ' ' + profile.first_name;
						}
						else
						{
							name = profile.firm_name;
						}
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
						{
							name = profile.applicant_last_name + ' ' + (profile.applicant_suffix.isEmpty() ? '' : profile.applicant_suffix) + ' ' + profile.applicant_first_name + ' ' + profile.applicant_middle_initial;
						}
						else 
						{
							name = profile.applicant_entity_name;
						}
						address1 = profile.applicant_address;
						if (!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="EE0C09DF59C9CB22734A2E2C647D6619" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        if profile.estate_name.strip.empty?
			        name = profile.name
			        address1 = profile.address
			        address2 = profile.address2
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        else	
			        name = profile.estate_name
		        end
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
							address1 = profile.address;
							if (!profile.apartment_number.trim().isEmpty())
							{
								address2 = 'Apt. #' + profile.apartment_number;
							}
							address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						if profile.estate_name.trim().isEmpty()
						{
							name = profile.name;
							address1 = profile.address;
							address2 = profile.address2;
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
						else
						{
							name = profile.estate_name;
						}
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use Firm name if available 
						if (profile.firm_name.trim().isEmpty())
						{
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
						}
						else
						{
							name = profile.firm_name;
						}
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
						{
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
						}
						else 
						{
							name = profile.applicant_entity_name;
						}
						address1 = profile.applicant_address;
						if (!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="56083FD038E05EFECA15CE4FD7FA7E28" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business &= true
	        name = ''
	        address1 = ''
	        address2 = ''
	        address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # using personal information.
			        name = profile.first_name + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        name = (!profile.firm_name.strip.empty? ? profile.firm_name : profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name).squeeze(' ').strip
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
						
	        elsif profile.to_s[2,3] == 'Fcc'
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip
	        address1 = address1.squeeze(' ').strip
	        address2 = address2.squeeze(' ').strip
	        address3 = address3.squeeze(' ').strip
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							name = profile.first_name + ' ' + profile.last_name + ' ' + profile.suffix;
							address1 = profile.address;
							if (!profile.apartment_number.trim().isEmpty())
							{
								address2 = 'Apt. #' + profile.apartment_number;
							}
							address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						name = profile.name;
						address1 = profile.address;
						address2 = profile.address2;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						name = (!profile.firm_name.trim().isEmpty() ? profile.firm_name : profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name).squeeze(' ').trim();
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="672EA48123A1138409A7754D8BA75684" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.address
			        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use firm name if available.
		        if (profile.firm_name.strip.empty?)
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        else
			        name = profile.firm_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        name = name.squeeze(' ').strip[0,35]
	        address1 = address1.squeeze(' ').strip[0,35]
	        address2 = address2.squeeze(' ').strip[0,35]
	        address3 = address3.squeeze(' ').strip[0,35]
	
	        # Decide what lines are output.
	        case lines.length
		        when 1
			        name += ' ' + address1 + ' ' + address2 + ' ' + address3
			        name = name.squeeze(' ').strip
			        address1 = address2 = address3 = ''
		        when 2
			        address1 += ' ' + address2 + ' ' + address3
			        address1 = address1.squeeze(' ').strip
			        address2 = address3 = ''
		        when 3
			        address1 += ' ' + address2
			        address1 = address1.squeeze(' ').strip
			        address2 = address3
			        address3 = ''
		        when 4
			        if (address2.empty?)
				        address2 = address3
				        address3 = ''
			        end
	        end

	        print lines[0], name if !name.empty?
	        print lines[1], address1 if !address1.empty?
	        print lines[2], address2 if !address2.empty?
	        print lines[3], address3 if !address3.empty?

        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';

					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
							address1 = profile.address;
							if (!profile.apartment_number.trim().isEmpty())
							{
								address2 = 'Apt. #' + profile.apartment_number;
							}
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						name = profile.name;
						address1 = profile.address;
						address2 = profile.address2;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use firm name if available.
						if (profile.firm_name.trim().isEmpty())
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
						else
							name = profile.firm_name;
						end
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
						{
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
						}
						else
						{
							name = profile.applicant_entity_name;
						}
						address1 = profile.applicant_address;
						if (!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							name += ' ' + address1 + ' ' + address2 + ' ' + address3;
							name = name.squeeze(' ').trim();
							address1 = '';
							address2 = '';
							address3 = '';
							break;
						case 2:
							address1 += ' ' + address2 + ' ' + address3;
							address1 = address1.squeeze(' ').trim();
							address2 = '';
							address3 = '';
							break;
						case 3:
							address1 += ' ' + address2;
							address1 = address1.squeeze(' ').trim();
							address2 = address3;
							address3 = '';
							break;
						case 4:
							if (address2.isEmpty())
							{
								address2 = address3;
								address3 = '';
							}
							break;
					}

					if (!name.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[0], name);
					}
					if (!address1.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[1], address1);
					}
					if (!address2.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[2], address2);
					}
					if (!address3.trim().isEmpty()) {
						SFForms.StorageManager.setValue(formInstanceId, lines[3], address3);
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="02D7009092BA32D9AD027566841BA068" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def num_days_months(due_date, payment_date, limit_date, fcn)

	        result = 0
	        fcn = fcn.upcase

	        #
	        # Check dates for proper format:
	        #
	        # The $1,$2,$3 are pattern matching variables - when we match (successfully) a date, like the
	        # due_date pattern below where we are checking if the due_date is in the MM/DD/YY format. The
	        # parens are used to group the due_date YY, MM, and DD components so a successful match will
	        # set $1 to the MM portion, the $2 will be set to the DD portion, and the $3 will be set to the
	        # YY portion.
	        # 
	        if (due_date =~ /(\d{2})\/(\d{2})\/(\d{2})/)

		        due_date = Time.gm($3, $1, $2)

		        if (payment_date =~ /(\d{2})\/(\d{2})\/(\d{2})/)

			        payment_date = Time.gm($3, $1, $2)

			        #
			        # Check fcn to see if we are calculating days or months - if months, we have all the
			        # info we need, there is no limit_date to deal with.
			        #
			        # NOTE - Vermont interprets partial months as follows:
			        #
			        # For a due date of 04/15/06 and a payment date of 04/16/06, the number of months
			        # would be 1. This would hold up to and including 05/15/06. On 05/16/06, the number
			        # of months would be 2, and so on.
			        #
			        if (fcn == "M")
				        while (due_date < payment_date)

					        #
					        # Run the due_date up to the payment date, counting the months.
					        #
					        result += 1
					        due_date = if (due_date.month == 12)
								        Time.gm(due_date.year+1,1,due_date.day)
							        else
								        Time.gm(due_date.year,due_date.month+1,due_date.day)
							        end
				        end
			        elsif (fcn == "D")
				        if (limit_date =~ /(\d{2})\/(\d{2})\/(\d{2})/)
					
					
					        limit_date = Time.gm($3, $1, $2)
					        limit_date = payment_date if (payment_date < limit_date)
	
					        #
					        # Check if we can proceed:
					        #
					        if ((due_date < payment_date) and (limit_date > due_date))
						        if (limit_date.year > due_date.year)
		
							        #
							        # Need to calculate number of days from the due date to the end of the due date year, then
							        # add remaining days in the range.
							        #
							        result = Time.gm(due_date.year, 12, 31).yday - due_date.yday
		
							        #
							        # Now run thru the remaining years, adding up the days.
							        #
							        (due_date.year + 1).upto(limit_date.year) { |year|
								        result += (year < limit_date.year ? Time.gm(year, 12, 31).yday : limit_date.yday)
							        }
						        else
							        result = limit_date.yday - due_date.yday
														
							
						        end
						        #NOTE 2008:The state rejected the form because they DO NOT
						        #want us to take leap years into consideration.  So we added the call
						        #to this function to offset the algorithm which does compensate for leap years.
						        #Remove Leap Year from Calc.
						        if is_leap_year($3.to_i)
							        leap_date = Time.gm($3,2,28)
							        if (limit_date > leap_date)
								        result = result - 1
							        end
						        #End Remove Leap Year
						        end	
					
					        end		
				        end
			        end
		        end
	        end
	        return result
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function num_days_months(due_date, payment_date, limit_date, fcn)
				{
					var result = 0;
					fcn = fcn.toUpperCase();

					// Check dates for proper format:
					//
					// The $1,$2,$3 are pattern matching variables - when we match (successfully) a date, like the
					// due_date pattern below where we are checking if the due_date is in the MM/DD/YY format. The
					// parens are used to group the due_date YY, MM, and DD components so a successful match will
					// set $1 to the MM portion, the $2 will be set to the DD portion, and the $3 will be set to the
					// YY portion.
					var duedatematches = /(\d{2})\/(\d{2})\/(\d{2})/.exec(due_date);
					if (duedatematches != null && duedatematches.length > 0)
					{
						due_date = SFForms.Utilities.Time.gm(duedatematches[3], duedatematches[1], duedatematches[2]);

						var paymentdatematches = /(\d{2})\/(\d{2})\/(\d{2})/.exec(payment_date);
						if (paymentdatematches != null && paymentdatematches.length > 0)
						{
							payment_date = SFForms.Utilities.Time.gm(paymentdatematches[3], paymentdatematches[1], paymentdatematches[2]);

							// Check fcn to see if we are calculating days or months - if months, we have all the
							// info we need, there is no limit_date to deal with.
							//
							// NOTE - Vermont interprets partial months as follows:
							//
							// For a due date of 04/15/06 and a payment date of 04/16/06, the number of months
							// would be 1. This would hold up to and including 05/15/06. On 05/16/06, the number
							// of months would be 2, and so on.
							if (fcn == "M")
							{
								while (due_date < payment_date)
								{
									// Run the due_date up to the payment date, counting the months.
									result += 1;
									if (due_date.mon() == 12)
									{
										due_date = SFForms.Utilities.Time.gm(due_date.year() + 1, 1, due_date.day());
									}
									else
									{
										due_date = SFForms.Utilities.Time.gm(due_date.year(), due_date.mon() + 1, due_date.day());
									}
								}
							}
							else if (fcn == "D")
							{
								var limitdatematches = /(\d{2})\/(\d{2})\/(\d{2})/.exec(limit_date);
								if (limitdatematches != null && limitdatematches.length > 0)
								{
									limit_date = SFForms.Utilities.Time.gm(limitdatematches[3], limitdatematches[1], limitdatematches[2]);
									if (payment_date < limit_date)
									{
										limit_date = payment_date;
									}

									// Check if we can proceed:
									if ((due_date < payment_date) && (limit_date > due_date))
									{
										if (limit_date.year() > due_date.year())
										{
											// Need to calculate number of days from the due date to the end of the due date year, then
											// add remaining days in the range.
											result = SFForms.Utilities.Time.gm(due_date.year(), 12, 31).dayOfYear() - due_date.dayOfYear();

											// Now run thru the remaining years, adding up the days.
											for (var year = due_date.year() + 1; year <= limit_date.year(); year++)
											{
												result += (year < limit_date.year() ? SFForms.Utilities.Time.gm(year, 12, 31).dayOfYear() : limit_date.dayOfYear());
											}
										}
										else
										{
											result = limit_date.dayOfYear() - due_date.dayOfYear();
										}

										// NOTE 2008:The state rejected the form because they DO NOT
										// want us to take leap years into consideration.  So we added the call
										// to this function to offset the algorithm which does compensate for leap years.
										// Remove Leap Year from Calc.
										if (is_leap_year(limitdatematches[3].to_i()))
										{
											var leap_date = SFForms.Utilities.Time.gm(limitdatematches[3], 2, 28);
											if (limit_date > leap_date)
											{
												result = result - 1;
											}
											//End Remove Leap Year
										}
									}		
								}
							}
						}
					}

					return result;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="9E3977D2048A5359B3F8E6F0D1854E4D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def name_block(profile, business, *lines)
	        business = false unless business.kind_of? TrueClass
	        name = address1 = address2 = address3 = ''
	        global_truncate = false
	        truncate0 = truncate1 = 0
	        data_flow = Array.new

	        if (profile.to_s[2,10] == 'Individual')
		        # Decide if profile's business or personal information should be used.
		        if (business and !profile.business_name.strip.empty?)
			        # Use business information.
			        name = profile.business_name
			        if (profile.business_address.strip.empty?)
				        address1 = profile.address
				        address2 = 'Apt. #' + profile.apartment_number unless profile.apartment_number.strip.empty?
				        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
			        else
				        address1 = profile.business_address
				        address2 = profile.business_address2
				        address3 = (profile.business_city.strip.empty? ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip
			        end
		        else
			        # Using personal information.
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix
			        address1 = profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix
			        address2 = profile.address + ( profile.apartment_number.strip.empty? ? '' : ' ' + 'Apt. #' + profile.apartment_number )
			        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
		        end
	        elsif profile.to_s[2,6] == 'Entity'
		        name = profile.name
		        address1 = profile.address
		        address2 = profile.address2
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip
	        elsif profile.to_s[2,8] == 'Preparer'
		        # Use Firm name if available and business = true.
		        # Use Preparer name if the Preparer is self-employed and business = false.
		        if (!profile.firm_name.strip.empty? and ((profile.self_employed.strip.empty?) or (!profile.self_employed.strip.empty? and business)))
			        name = profile.firm_name
		        else
			        name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name
		        end
		        address1 = profile.address
		        address3 = (profile.city.strip.empty? ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip	
	        elsif profile.to_s[2,3] == 'Fcc'
		        # Use entity name if available.
		        if (profile.applicant_entity_name.strip.empty?)
			        name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix
		        else
			        name = profile.applicant_entity_name
		        end
		        address1 = profile.applicant_address
		        address2 = 'P.O. Box ' + profile.applicant_po_box unless profile.applicant_po_box.strip.empty?
		        address3 = (profile.applicant_city.strip.empty? ? '' : profile.applicant_city + ', ') + (profile.applicant_state.strip.empty? ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip
	        else
		        return
	        end
	
	        data_flow[0] = name.squeeze(' ').strip
	        data_flow[1] = address1.squeeze(' ').strip
	        data_flow[2] = address2.squeeze(' ').strip
	        data_flow[3] = address3.squeeze(' ').strip

	        # Check for a global truncate.
	        if (lines[0] =~ /\A(\[)(\d+)(\,)(\d+)(\])\z/)
		        global_truncate = true
		        truncate0 = $2.to_i
		        truncate1 = $4.to_i
		        lines.delete_at(0)
	        end

	        # Decide what lines are output.
	        case lines.length
		        when 1
			        data_flow[0] = (name + ' ' + address1 + ' ' + address2 + ' ' + address3).squeeze(' ').strip
		        when 2
			        data_flow[1] = (address1 + ' ' + address2 + ' ' + address3).squeeze(' ').strip
		        when 3
			        data_flow[1] = (address1 + ' ' + address2).squeeze(' ').strip
			        data_flow[2] = data_flow[3]
		        when 4
			        if (address2.empty?) 
				        data_flow[2] = data_flow[3]
				        data_flow[3] = ''
			        end
	        end

	        # Do the truncation if applicable - individual truncates take precedence over a global truncate, then print the lines.
	        lines.each_index { |index|
		        if (!data_flow[index].empty?)
			        if (lines[index] =~ /\A(box\d+_\d+)(\[)(\d+)(\,)(\d+)(\])\z/)
				        data_flow[index] = data_flow[index][$3.to_i, $5.to_i]
				        lines[index] = $1
			        elsif (global_truncate)
				        data_flow[index] = data_flow[index][truncate0, truncate1]
			        end
			        print lines[index], data_flow[index]
		        end
	        }
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function name_block(profile, business, lines)
				{
					if (typeof business === 'undefined')
					{
						business = false;
					}
					var name = '';
					var address1 = '';
					var address2 = '';
					var address3 = '';
					var global_truncate = false;
					var truncate0 = 0;
					var truncate1 = 0;
					var data_flow = [];
	
					if (profile instanceof SFForms.Profiles.Individual)
					{
						// Decide if profile's business or personal information should be used.
						if (business && !profile.business_name.trim().isEmpty())
						{
							// Use business information.
							name = profile.business_name;
							if (profile.business_address.trim().isEmpty())
							{
								address1 = profile.address;
								if (!profile.apartment_number.trim().isEmpty())
								{
									address2 = 'Apt. #' + profile.apartment_number;
								}
								address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
							}
							else
							{
								address1 = profile.business_address;
								address2 = profile.business_address2;
								address3 = (profile.business_city.trim().isEmpty() ? '' : profile.business_city + ', ') + profile.business_state + ' ' + profile.business_zip;
							}
						}
						else
						{
							// Using personal information.
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name + ' ' + profile.suffix;
							address1 = profile.spouse_first_name + ' ' + profile.spouse_middle_initial + ' ' + profile.spouse_last_name + ' ' + profile.spouse_suffix;
							address2 = profile.address + ( profile.apartment_number.trim().isEmpty() ? '' : ' ' + 'Apt. #' + profile.apartment_number );
							address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
						}
					}
					else if (profile instanceof SFForms.Profiles.Entity)
					{
						name = profile.name;
						address1 = profile.address;
						address2 = profile.address2;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Preparer)
					{
						// Use Firm name if available and business = true.
						// Use Preparer name if the Preparer is self-employed and business = false.
						if (!profile.firm_name.trim().isEmpty() && ((profile.self_employed.trim().isEmpty()) || (!profile.self_employed.trim().isEmpty() && business)))
						{
							name = profile.firm_name;
						}
						else
						{
							name = profile.first_name + ' ' + profile.middle_initial + ' ' + profile.last_name;
						}
						address1 = profile.address;
						address3 = (profile.city.trim().isEmpty() ? '' : profile.city + ', ') + profile.state + ' ' + profile.zip;
					}
					else if (profile instanceof SFForms.Profiles.Fcc)
					{
						// Use entity name if available.
						if (profile.applicant_entity_name.trim().isEmpty())
						{
							name = profile.applicant_first_name + ' ' + profile.applicant_middle_initial + ' ' + profile.applicant_last_name + ' ' + profile.applicant_suffix;
						}
						else
						{
							name = profile.applicant_entity_name;
						}
						address1 = profile.applicant_address;
						if (!profile.applicant_po_box.trim().isEmpty())
						{
							address2 = 'P.O. Box ' + profile.applicant_po_box;
						}
						address3 = (profile.applicant_city.trim().isEmpty() ? '' : profile.applicant_city + ', ') + (profile.applicant_state.trim().isEmpty() ? profile.applicant_country : profile.applicant_state) + ' ' + profile.applicant_zip;
					}
					else
					{
						return;
					}

					name = name.squeeze(' ').trim();
					address1 = address1.squeeze(' ').trim();
					address2 = address2.squeeze(' ').trim();
					address3 = address3.squeeze(' ').trim();

					// Check for a global truncate.
					var myMatches = /\A(\[)(\d+)(\,)(\d+)(\])\z/.exec(lines[0]);
					if (myMatches != null && myMatches.length > 0)
					{
						global_truncate = true;
						truncate0 = myMatches[2].to_i();
						truncate1 = myMatches[4].to_i();
						lines.splice(0, 1);
					}

					// Decide what lines are output.
					switch (lines.length)
					{
						case 1:
							data_flow[0] = (name + ' ' + address1 + ' ' + address2 + ' ' + address3).squeeze(' ').trim();
							break;
						case 2:
							data_flow[1] = (address1 + ' ' + address2 + ' ' + address3).squeeze(' ').trim();
							break;
						case 3:
							data_flow[1] = (address1 + ' ' + address2).squeeze(' ').trim();
							data_flow[2] = data_flow[3];
							break;
						case 4:
							if (address2.isEmpty())
							{
								data_flow[2] = data_flow[3];
								data_flow[3] = '';
							}
							break;
					}

					// Do the truncation if applicable - individual truncates take precedence over a global truncate, then print the lines.
					for (var index = 0; index < lines.length; index++)
					{
						if (!data_flow[index].isEmpty())
						{
							myMatches = /\A(box\d+_\d+)(\[)(\d+)(\,)(\d+)(\])\z/.exec(lines[index]);
							if (myMatches != null && myMatches.length > 0)
							{
								data_flow[index] = data_flow[index].substring(myMatches[3].to_i(), myMatches[5].to_i()];
								lines[index] = myMathces[1];
							}
							else if (global_truncate)
							{
								data_flow[index] = data_flow[index].substring(truncate0, truncate1);
							}
							
							SFForms.StorageManager.setValue(formInstanceId, lines[index], data_flow[index]);
						}
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="90FA05AE7F172286C0744E694FC26A8A" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)

	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i

	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        if ((due_mon == 1) and (due_day == 17) and (due_year == 2011))
		        due_day = 18
	        end

	        if ((due_mon == 2) and (due_day == 15) and (due_year == 2011))
		        due_day = 16
	        end

	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
	function compute_due_date(id, mon_end, year_end, coupon) {
         var coupon_intervals = [4, 6, 9, 12, 4];
         var liability_intervals = [3, 6, 9, 12, 12]
         var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
         var result = '00000000';

         if ((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)) {

             year_end = year_end.to_i();
             var coupon_adj = coupon - 1;

             var year_adj;
             var mon_adj;
             var due_year;
             var mod_mon;
             var due_mon;
             var due_day;

             if (id == 1) {
                 year_adj = year_end - 1;
                 mon_adj = mon_end + liability_intervals[coupon_adj];
                 due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
                 mod_mon = mon_adj % 12;
                 due_mon = (mod_mon > 0 ? mod_mon : 12);
                 if (due_mon == 2) {
                     due_day = (is_leap_year(due_year) ? 29 : 28);
                 }
                 else {
                     due_day = days_in_month[due_mon - 1];
                 }
             }
             else if (id == 2) {
                 year_adj = (coupon < 5 ? year_end - 1 : year_end);
                 mon_adj = mon_end + coupon_intervals[coupon_adj];
                 due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
                 mod_mon = mon_adj % 12;
                 due_mon = (mod_mon > 0 ? mod_mon : 12);
                 due_day = (coupon < 5 ? 20 : 15);

                 var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
                 if (t.wday() == 6) {
                     due_day += 2;
                 }
                 else if (t.wday() == 0) {
                     due_day += 1;
                 }
             }

             if ((due_mon == 1) && (due_day == 17) && (due_year == 2011)) {
                 due_day = 18;
             }

             if ((due_mon == 2) && (due_day == 15) && (due_year == 2011)) {
                 due_day = 16;
             }

             result = due_mon.complexFixedString(0, '02') + due_day.toString() + due_year.toString();
         }
    
         return result;
     }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="1ADC711A974553B4F09031FB9727B46C" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def get_due_date(mm_yr, vch_num)
	        return "" unless ((0..3) === vch_num)
	        case (mm_yr)
		        when ("1214"): ["04-01-2014","06-16-2014","09-15-2014","12-15-2014"][vch_num]
		        when ("0115"): ["05-01-2014","07-15-2014","10-15-2014","01-15-2015"][vch_num]
		        when ("0215"): ["06-02-2014","08-15-2014","11-17-2014","02-17-2015"][vch_num]
		        when ("0315"): ["07-01-2014","09-15-2014","12-15-2014","03-16-2015"][vch_num]
		        when ("0415"): ["08-01-2014","10-15-2014","01-15-2015","04-15-2015"][vch_num]
		        when ("0515"): ["09-02-2014","11-17-2014","02-17-2015","05-15-2015"][vch_num]
		        when ("0615"): ["10-01-2014","12-15-2014","03-16-2015","06-15-2015"][vch_num]
		        when ("0715"): ["11-03-2014","01-15-2015","04-15-2015","07-15-2015"][vch_num]
		        when ("0815"): ["12-01-2014","02-17-2015","05-15-2015","08-17-2015"][vch_num]
		        when ("0915"): ["01-02-2015","03-16-2015","06-15-2015","09-15-2015"][vch_num]
		        when ("1015"): ["02-02-2015","04-15-2015","07-15-2015","10-15-2015"][vch_num]
		        when ("1115"): ["03-02-2015","05-15-2015","08-17-2015","11-16-2015"][vch_num]
		        else ""
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function get_due_date(mm_yr, vch_num)
				{
                           var result = "";

					if (vch_num >= 0 && vch_num <= 3)
					{

					if (mm_yr == "1214") { result = ["04-01-2014","06-16-2014","09-15-2014","12-15-2014"][vch_num]; }
					else if (mm_yr == "0115") { result = ["05-01-2014","07-15-2014","10-15-2014","01-15-2015"][vch_num]; }
					else if (mm_yr == "0215") { result = ["06-02-2014","08-15-2014","11-17-2014","02-17-2015"][vch_num]; }
					else if (mm_yr == "0315") { result = ["07-01-2014","09-15-2014","12-15-2014","03-16-2015"][vch_num]; }
					else if (mm_yr == "0415") { result = ["08-01-2014","10-15-2014","01-15-2015","04-15-2015"][vch_num]; }
					else if (mm_yr == "0515") { result = ["09-02-2014","11-17-2014","02-17-2015","05-15-2015"][vch_num]; }
					else if (mm_yr == "0615") { result = ["10-01-2014","12-15-2014","03-16-2015","06-15-2015"][vch_num]; }
					else if (mm_yr == "0715") { result = ["11-03-2014","01-15-2015","04-15-2015","07-15-2015"][vch_num]; }
					else if (mm_yr == "0815") { result = ["12-01-2014","02-17-2015","05-15-2015","08-17-2015"][vch_num]; }
					else if (mm_yr == "0915") { result = ["01-02-2015","03-16-2015","06-15-2015","09-15-2015"][vch_num]; }
					else if (mm_yr == "1015") { result = ["02-02-2015","04-15-2015","07-15-2015","10-15-2015"][vch_num]; }
					else if (mm_yr == "1115") { result = ["03-02-2015","05-15-2015","08-17-2015","11-16-2015"][vch_num]; }
					else { result = ""; }
                           }
                           
                           return result;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="BFABBAF0127CC0B4C0723DF5625BDC62" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							

	        return 0.0 if (taxable_income <= 0.0)

	        case taxable_income
		        when (0.0...40000.0): 0.0
		        when (40000.0...90000.0): ((taxable_income - 40000.0) * 0.008) + 0.0
		        when (90000.0...140000.0): ((taxable_income - 90000.0) * 0.016) + 400.0
		        when (140000.0...240000.0): ((taxable_income - 140000.0) * 0.024) + 1200.0
		        when (240000.0...440000.0): ((taxable_income - 240000.0) * 0.032) + 3600.0
		        when (440000.0...640000.0): ((taxable_income - 440000.0) * 0.04) + 10000.0
		        when (640000.0...840000.0): ((taxable_income - 640000.0) * 0.048) + 18000.0
		        when (840000.0...1040000.0): ((taxable_income - 840000.0) * 0.056) + 27600.0
		        when (1040000.0...1540000.0): ((taxable_income - 1040000.0) * 0.064) + 38800.0
		        when (1540000.0...2040000.0): ((taxable_income - 1540000.0) * 0.072) + 70800.0
		        when (2040000.0...2540000.0): ((taxable_income - 2040000.0) * 0.08) + 106800.0
		        when (2540000.0...3040000.0): ((taxable_income - 2540000.0) * 0.088) + 146800.0
		        when (3040000.0...3540000.0): ((taxable_income - 3040000.0) * 0.096) + 190800.0
		        when (3540000.0...4040000.0): ((taxable_income - 3540000.0) * 0.104) + 238800.0
		        when (4040000.0...5040000.0): ((taxable_income - 4040000.0) * 0.112) + 290800.0
		        when (5040000.0...6040000.0): ((taxable_income - 5040000.0) * 0.12) + 402800.0
		        when (6040000.0...7040000.0): ((taxable_income - 6040000.0) * 0.128) + 522800.0
		        when (7040000.0...8040000.0): ((taxable_income - 7040000.0) * 0.136) + 650800.0
		        when (8040000.0...9040000.0): ((taxable_income - 8040000.0) * 0.144) + 786800.0
		        when (9040000.0...10040000.0): ((taxable_income - 9040000.0) * 0.152) + 930800.0
	        else ((taxable_income - 10040000.0) * 0.16) + 1082800.0
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.0 && taxable_income <= 40000.0) { return 0.0; }
					else if (taxable_income >= 40000.0 && taxable_income <= 90000.0) { return ((taxable_income - 40000.0) * 0.008) + 0.0; }
					else if (taxable_income >= 90000.0 && taxable_income <= 140000.0) { return ((taxable_income - 90000.0) * 0.016) + 400.0; }
					else if (taxable_income >= 140000.0 && taxable_income <= 240000.0) { return ((taxable_income - 140000.0) * 0.024) + 1200.0; }
					else if (taxable_income >= 240000.0 && taxable_income <= 440000.0) { return ((taxable_income - 240000.0) * 0.032) + 3600.0; }
					else if (taxable_income >= 440000.0 && taxable_income <= 640000.0) { return ((taxable_income - 440000.0) * 0.04) + 10000.0; }
					else if (taxable_income >= 640000.0 && taxable_income <= 840000.0) { return ((taxable_income - 640000.0) * 0.048) + 18000.0; }
					else if (taxable_income >= 840000.0 && taxable_income <= 1040000.0) { return ((taxable_income - 840000.0) * 0.056) + 27600.0; }
					else if (taxable_income >= 1040000.0 && taxable_income <= 1540000.0) { return ((taxable_income - 1040000.0) * 0.064) + 38800.0; }
					else if (taxable_income >= 1540000.0 && taxable_income <= 2040000.0) { return ((taxable_income - 1540000.0) * 0.072) + 70800.0; }
					else if (taxable_income >= 2040000.0 && taxable_income <= 2540000.0) { return ((taxable_income - 2040000.0) * 0.08) + 106800.0; }
					else if (taxable_income >= 2540000.0 && taxable_income <= 3040000.0) { return ((taxable_income - 2540000.0) * 0.088) + 146800.0; }
					else if (taxable_income >= 3040000.0 && taxable_income <= 3540000.0) { return ((taxable_income - 3040000.0) * 0.096) + 190800.0; }
					else if (taxable_income >= 3540000.0 && taxable_income <= 4040000.0) { return ((taxable_income - 3540000.0) * 0.104) + 238800.0; }
					else if (taxable_income >= 4040000.0 && taxable_income <= 5040000.0) { return ((taxable_income - 4040000.0) * 0.112) + 290800.0; }
					else if (taxable_income >= 5040000.0 && taxable_income <= 6040000.0) { return ((taxable_income - 5040000.0) * 0.12) + 402800.0; }
					else if (taxable_income >= 6040000.0 && taxable_income <= 7040000.0) { return ((taxable_income - 6040000.0) * 0.128) + 522800.0; }
					else if (taxable_income >= 7040000.0 && taxable_income <= 8040000.0) { return ((taxable_income - 7040000.0) * 0.136) + 650800.0; }
					else if (taxable_income >= 8040000.0 && taxable_income <= 9040000.0) { return ((taxable_income - 8040000.0) * 0.144) + 786800.0; }
					else if (taxable_income >= 9040000.0 && taxable_income <= 10040000.0) { return ((taxable_income - 9040000.0) * 0.152) + 930800.0; }
					else { return ((taxable_income - 10040000.0) * 0.16) + 1082800.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="84CDEA1847231F34B982CF05D554A8B8" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 if (taxable_income < 0.0)
	        case (taxable_income)
		        when (0.0..25000.0): taxable_income * 0.0148
		        when (25000.01..50000.0): ((taxable_income - 25000.0) * 0.0373) + 370.0
		        else ((taxable_income - 50000.0) * 0.0453) + 1302.5
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income < 0.0)
					{
						return 0.0;
					}
					
					if (taxable_income >= 0.0 && taxable_income <= 25000.0) { return taxable_income * 0.0148; }
					else if (taxable_income >= 25000.01 && taxable_income <= 50000.0) { return ((taxable_income - 25000.0) * 0.0373) + 370.0; }
					else { return ((taxable_income - 50000.0) * 0.0453) + 1302.5; }
				}

      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="33DB01EF75CFF9185F76D756719CD256" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_year(month)
	        #
	        # A 2 digit month:
	        #
	        case (month)
		        when (1): ["11504","11506","11509","11601"]
		        when (2): ["11505","11507","11510","11602"]
		        when (3): ["11506","11508","11511","11603"]
		        when (4): ["11507","11509","11512","11604"]
		        when (5): ["11508","11510","11601","11605"]
		        when (6): ["11509","11511","11602","11606"]
		        when (7): ["11510","11512","11603","11607"]
		        when (8): ["11511","11601","11604","11608"]
		        when (9): ["11512","11602","11605","11609"]
		        when (10): ["11601","11603","11606","11610"]
		        when (11): ["11602","11604","11607","11611"]
		        when (12): ["11603", "11605","11608","11612"]
		        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_year(month)
				{
					// A 2 digit month:
					if (month == 1) { return ["11504","11506","11509","11601"]; }
					else if (month == 2) { return ["11505","11507","11510","11602"]; }
					else if (month == 3) { return ["11506","11508","11511","11603"]; }
					else if (month == 4) { return ["11507","11509","11512","11604"]; }
					else if (month == 5) { return ["11508","11510","11601","11605"]; }
					else if (month == 6) { return ["11509","11511","11602","11606"]; }
					else if (month == 7) { return ["11510","11512","11603","11607"]; }
					else if (month == 8) { return ["11511","11601","11604","11608"]; }
					else if (month == 9) { return ["11512","11602","11605","11609"]; }
					else if (month == 10) { return ["11601","11603","11606","11610"]; }
					else if (month == 11) { return ["11602","11604","11607","11611"]; }
					else if (month == 12) { return ["11603", "11605","11608","11612"]; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="F82DBBDD59E4F9AC945F514AA03E64DB" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case (taxable_income)
		        when (0.01..5000.0): taxable_income * 0.00528
		        when (5000.01..10000.0): ((taxable_income - 5000.0) * 0.01057) + 26.41
		        when (10000.01..15000.0): ((taxable_income - 10000.0) * 0.02113) + 79.24
		        when (15000.01..20000.0): ((taxable_income - 15000.0) * 0.02642) + 184.9
		        when (20000.01..40000.0): ((taxable_income - 20000.0) * 0.03169) + 316.98
		        when (40000.01..80000.0): ((taxable_income - 40000.0) * 0.03698) + 950.76
		        when (80000.01..100000.0): ((taxable_income - 80000.0) * 0.04226) + 2430.0
		        when (100000.01..200000.0): ((taxable_income - 100000.0) * 0.04906) + 3275.1
		        else ((taxable_income - 200000.0) * 0.05333) + 8181.0
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 5000.0) { return taxable_income * 0.00528; }
					else if (taxable_income >= 5000.01 && taxable_income <= 10000.0) { return ((taxable_income - 5000.0) * 0.01057) + 26.41; }
					else if (taxable_income >= 10000.01 && taxable_income <= 15000.0) { return ((taxable_income - 10000.0) * 0.02113) + 79.24; }
					else if (taxable_income >= 15000.01 && taxable_income <= 20000.0) { return ((taxable_income - 15000.0) * 0.02642) + 184.9; }
					else if (taxable_income >= 20000.01 && taxable_income <= 40000.0) { return ((taxable_income - 20000.0) * 0.03169) + 316.98; }
					else if (taxable_income >= 40000.01 && taxable_income <= 80000.0) { return ((taxable_income - 40000.0) * 0.03698) + 950.76; }
					else if (taxable_income >= 80000.01 && taxable_income <= 100000.0) { return ((taxable_income - 80000.0) * 0.04226) + 2430.0; }
					else if (taxable_income >= 100000.01 && taxable_income <= 200000.0) { return ((taxable_income - 100000.0) * 0.04906) + 3275.1; }
					else { return ((taxable_income - 200000.0) * 0.05333) + 8181.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="2B6E255D4AB4377DFC3F7D1771FFF4E7" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def tax(amount)
	        if( amount > 1046350.0 ) then 70770.0 + ( amount - 1046350.0 ) * 0.0882
	        elsif( amount > 209250.0 ) then 13428.0 + ( amount - 209250.0 ) * 0.0685
	        elsif( amount > 78400.0 ) then 4727.0 + ( amount - 78400.0 ) * 0.0665
	        elsif( amount > 20850.0 ) then 1015.0 + ( amount - 20850.0 ) * 0.0645
	        elsif( amount > 13550.0 ) then 584.0 + ( amount - 13550.0 ) * 0.059
	        elsif( amount > 11450.0 ) then 474.0 + ( amount - 11450.0 ) * 0.0525
	        elsif( amount > 8300.0 ) then 332.0 + ( amount - 8300.0 ) * 0.045
	        elsif( amount > 0.0 ) then amount * 0.04
	        else 0.0
	        end
        end	
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function tax(amount)
				{
					if ( amount > 1046350.0 ) { return 70770.0 + ( amount - 1046350.0 ) * 0.0882; }
					else if( amount > 209250.0 ) { return 13428.0 + ( amount - 209250.0 ) * 0.0685; }
					else if( amount > 78400.0 ) { return 4727.0 + ( amount - 78400.0 ) * 0.0665; }
					else if( amount > 20850.0 ) { return 1015.0 + ( amount - 20850.0 ) * 0.0645; }
					else if( amount > 13550.0 ) { return 584.0 + ( amount - 13550.0 ) * 0.059; }
					else if( amount > 11450.0 ) { return 474.0 + ( amount - 11450.0 ) * 0.0525; }
					else if( amount > 8300.0 ) { return 332.0 + ( amount - 8300.0 ) * 0.045; }
					else if( amount > 0.0 ) { return amount * 0.04; }
					else { return 0.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="A99ADD79FEE58974BA19C5310E698370" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(income)
	        return 0.0 if (income <= 0)
	        case (income)
		        when (0.01..8300.0): (income * 0.04)
		        when (8300.01..11450.0): ((income - 8300) * 0.045 + 332.0)
		        when (11450.01..13550.0): ((income - 11450) * 0.0525 + 474.0)
		        when (13550.01..20850.0): ((income -13550) * 0.059 + 584.0)
		        when (20850.01..78400.0): ((income -20850) * 0.0645 + 1015.0)
		        when (78400.01..209250.0): ((income -78400) * 0.0665 + 4727.0)	
		        when (209250.01..1046350.0): ((income -209250) * 0.0685 + 13428.0)
		        else ((income - 1046350.0) * 0.0882 + 70770.0)
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(income)
				{
					if (income <= 0)
					{
						return 0.0;
					}

					if (income >= 0.01 && income <= 8300.0) { return (income * 0.04); }
					else if (income >= 8300.01 && income <= 11450.0) { return ((income - 8300) * 0.045 + 332.0); }
					else if (income >= 11450.01 && income <= 13550.0) { return ((income - 11450) * 0.0525 + 474.0); }
					else if (income >= 13550.01 && income <= 20850.0) { return ((income -13550) * 0.059 + 584.0); }
					else if (income >= 20850.01 && income <= 78400.0) { return ((income -20850) * 0.0645 + 1015.0); }
					else if (income >= 78400.01 && income <= 209250.0) { return ((income -78400) * 0.0665 + 4727.0); }
					else if (income >= 209250.01 && income <= 1046350.0) { return ((income -209250) * 0.0685 + 13428.0); }
					else { return ((income - 1046350.0) * 0.0882 + 70770.0); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="8D77D23912DDCE3CFD718451A2167BA0" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1539.01)					
			        tax = taxable_income * 0.0036				
		        when (1539.01...3078.01)					
			        tax = ((taxable_income - 1539.0) * 0.0072) + 5.54		
		        when (3078.01...6156.01)					
			        tax = ((taxable_income - 3078.0) * 0.0243) + 16.62	
		        when (6156.01...13851.01)					
			        tax = ((taxable_income - 6156.0) * 0.045) + 91.42
		        when (13851.01...23085.01)					
			        tax = ((taxable_income - 13851.0) * 0.0612) + 437.70
		        when (23085.01...30780.01)					
			        tax = ((taxable_income - 23085.0) * 0.0648) + 1002.82
		        when (30780.01...46170.01)					
			        tax = ((taxable_income - 30780.0) * 0.068) + 1501.46
		        when (46170.01...69255.01)					
			        tax = ((taxable_income - 46170.0) * 0.0792) + 2547.98		
		        else					
			        tax = ((taxable_income - 69255.0) * 0.0898) + 4376.31				
	        end					
	        return tax						
        end							
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}

          var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1539.01) { tax = taxable_income * 0.0036; }
					else if (taxable_income >= 1539.01 && taxable_income <= 3078.01) { tax = ((taxable_income - 1539.0) * 0.0072) + 5.54; }
					else if (taxable_income >= 3078.01 && taxable_income <= 6156.01) { tax = ((taxable_income - 3078.0) * 0.0243) + 16.62; }
					else if (taxable_income >= 6156.01 && taxable_income <= 13851.01) { tax = ((taxable_income - 6156.0) * 0.045) + 91.42; }
					else if (taxable_income >= 13851.01 && taxable_income <= 23085.01) { tax = ((taxable_income - 13851.0) * 0.0612) + 437.70; }
					else if (taxable_income >= 23085.01 && taxable_income <= 30780.01) { tax = ((taxable_income - 23085.0) * 0.0648) + 1002.82; }
					else if (taxable_income >= 30780.01 && taxable_income <= 46170.01) { tax = ((taxable_income - 30780.0) * 0.068) + 1501.46; }
					else if (taxable_income >= 46170.01 && taxable_income <= 69255.01) { tax = ((taxable_income - 46170.0) * 0.0792) + 2547.98; }
					else { tax = ((taxable_income - 69255.0) * 0.0898) + 4376.31; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="D8F7FA24956A99AF488D1CD7DC42512C" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income				
		        when (0.01..10000)					
			        tax = taxable_income * 0.04				
		        when (10000.01..40000)					
			        tax = ((taxable_income - 10000.0) * 0.06) + 400.0	
		        when (40000.01..60000)
			        tax = ((taxable_income - 40000.0) * 0.07) + 2200.0
		        when (60000.01..350000)
			        tax = ((taxable_income - 60000.0) * 0.85) + 3600.0
		        else				
			        tax = ((taxable_income - 350000.0) * 0.0895) + 28250.0				
	        end						
	        return tax						
        end							
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}

          var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 10000) { tax = taxable_income * 0.04; }
					else if (taxable_income >= 10000.01 && taxable_income <= 40000) { tax = ((taxable_income - 10000.0) * 0.06) + 400.0; }
					else if (taxable_income >= 40000.01 && taxable_income <= 60000) { tax = ((taxable_income - 40000.0) * 0.07) + 2200.0; }
					else if (taxable_income >= 60000.01 && taxable_income <= 350000) { tax = ((taxable_income - 60000.0) * 0.85) + 3600.0; }
					else { tax = ((taxable_income - 350000.0) * 0.0895) + 28250.0; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="061D6FFFDB4A09939084BBCB03F43677" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def tax(amount)
	        return 0.0 unless (amount > 0.0)
	        case (amount)
		        when (0.01..5200.0): amount * 0.00537
		        when (5200.01..10400.0): ((amount - 5200.0) * 0.01074) + 27.92
		        when (10400.01..15650.0): ((amount - 10400.0) * 0.02148) + 83.77
		        when (15650.01..20900.0): ((amount - 15650.0) * 0.02686) + 196.94
		        when (20900.01..41700.0): ((amount - 20900.0) * 0.03222) + 337.56
		        when (41700.01..83350.0): ((amount - 41700.0) * 0.03760) + 1007.74
		        when (83350.01..104250.0): ((amount - 83350.0) * 0.04296) + 2573.78
		        when (104250.01..208500.0): ((amount - 104250.0) * 0.04988) + 3471.64
		        else ((amount - 208500.0) * 0.05421) + 8671.63
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function tax(amount)
				{
					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 5200.0) { return amount * 0.00537; }
					else if (amount >= 5200.01 && amount <= 10400.0) { return ((amount - 5200.0) * 0.01074) + 27.92; }
					else if (amount >= 10400.01 && amount <= 15650.0) { return ((amount - 10400.0) * 0.02148) + 83.77; }
					else if (amount >= 15650.01 && amount <= 20900.0) { return ((amount - 15650.0) * 0.02686) + 196.94; }
					else if (amount >= 20900.01 && amount <= 41700.0) { return ((amount - 20900.0) * 0.03222) + 337.56; }
					else if (amount >= 41700.01 && amount <= 83350.0) { return ((amount - 41700.0) * 0.03760) + 1007.74; }
					else if (amount >= 83350.01 && amount <= 104250.0) { return ((amount - 83350.0) * 0.04296) + 2573.78; }
					else if (amount >= 104250.01 && amount <= 208500.0) { return ((amount - 104250.0) * 0.04988) + 3471.64; }
					else { return ((amount - 208500.0) * 0.05421) + 8671.63; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="0F1E062C296AEB6F3ACBC9EDC9CFBDED" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(income)
	        return 0.0 if (income <= 0)
	        case (income)
		        when (0.01..8200.0): (income * 0.04)
		        when (8200.01..11300.0): ((income - 8200) * 0.045 + 328.0)
		        when (11300.01..13350.0): ((income - 11300) * 0.0525 + 468.0)
		        when (13350.01..20550.0): ((income -13350) * 0.059 + 575.0)
		        when (20550.01..77150.0): ((income -20550) * 0.0645 + 1000.0)
		        when (77150.01..205850.0): ((income -77150) * 0.0665 + 4651.0)	
		        when (205850.01..1029250.0): ((income -205850) * 0.0685 + 13209.0)
		        else ((income - 1029250) * 0.0882 + 69612.0)
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(income)
				{
					if (income <= 0)
					{
						return 0.0;
					}

					if (income >= 0.01 && income <= 8200.0) { return (income * 0.04); }
					else if (income >= 8200.01 && income <= 11300.0) { return ((income - 8200) * 0.045 + 328.0); }
					else if (income >= 11300.01 && income <= 13350.0) { return ((income - 11300) * 0.0525 + 468.0); }
					else if (income >= 13350.01 && income <= 20550.0) { return ((income -13350) * 0.059 + 575.0); }
					else if (income >= 20550.01 && income <= 77150.0) { return ((income -20550) * 0.0645 + 1000.0); }
					else if (income >= 77150.01 && income <= 205850.0) { return ((income -77150) * 0.0665 + 4651.0); }
					else if (income >= 205850.01 && income <= 1029250.0) { return ((income -205850) * 0.0685 + 13209.0); }
					else { return ((income - 1029250) * 0.0882 + 69612.0); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="43667327EEB30E75D51E2F59EC666064" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def tax(amount)
	        if( amount > 1029250.0 ) then 69612.0 + ( amount - 1029250.0 ) * 0.0882
	        elsif( amount > 205850.0 ) then 13209.0 + ( amount - 205850.0 ) * 0.0685
	        elsif( amount > 77150.0 ) then 4651.0 + ( amount - 77150.0 ) * 0.0665
	        elsif( amount > 20550.0 ) then 1000.0 + ( amount - 20550.0 ) * 0.0645
	        elsif( amount > 13350.0 ) then 575.0 + ( amount - 13350.0 ) * 0.059
	        elsif( amount > 11300.0 ) then 468.0 + ( amount - 11300.0 ) * 0.0525
	        elsif( amount > 8200.0 ) then 328.0 + ( amount - 8200.0 ) * 0.045
	        elsif( amount > 0.0 ) then amount * 0.04
	        else 0.0
	        end
        end	
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function tax(amount)
				{
					if ( amount > 1029250.0 ) { return 69612.0 + ( amount - 1029250.0 ) * 0.0882; }
					else if ( amount > 205850.0 ) { return 13209.0 + ( amount - 205850.0 ) * 0.0685; }
					else if ( amount > 77150.0 ) { return 4651.0 + ( amount - 77150.0 ) * 0.0665; }
					else if ( amount > 20550.0 ) { return 1000.0 + ( amount - 20550.0 ) * 0.0645; }
					else if ( amount > 13350.0 ) { return 575.0 + ( amount - 13350.0 ) * 0.059; }
					else if ( amount > 11300.0 ) { return 468.0 + ( amount - 11300.0 ) * 0.0525; }
					else if ( amount > 8200.0 ) { return 328.0 + ( amount - 8200.0 ) * 0.045; }
					else if ( amount > 0.0 ) { return amount * 0.04; }
					else { return 0.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="8A23262C8AF92A960D1A62952D6A9D5A" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(amount)
	        amount = (amount.to_f)
	        return 0.0 if (amount <= 0.0)
	        case (amount)
		        when (0.01..2800.0): (amount * 0.01)
		        when (2800.01..4900.0): (amount * 0.02) - 28.0
		        when (4900.01..7400.0): (amount * 0.03) - 77.0
		        when (7400.01..10100.0): (amount * 0.04) - 151.0
		        when (10100.01..13000.0): (amount * 0.05) - 252.0
		        when (13000.01..16700.0): (amount * 0.06) - 382.0
		        else (amount * 0.069) - 532.0
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2800.0) { return (amount * 0.01); }
					else if (amount >= 2800.01 && amount <= 4900.0) { return (amount * 0.02) - 28.0; }
					else if (amount >= 4900.01 && amount <= 7400.0) { return (amount * 0.03) - 77.0; }
					else if (amount >= 7400.01 && amount <= 10100.0) { return (amount * 0.04) - 151.0; }
					else if (amount >= 10100.01 && amount <= 13000.0) { return (amount * 0.05) - 252.0; }
					else if (amount >= 13000.01 && amount <= 16700.0) { return (amount * 0.06) - 382.0; }
					else { return (amount * 0.069) - 532.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="183666B4D6B8CDFA5E15FACEB200BF89" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_amount)
	        tax =	if (taxable_amount > 16700.0)
			        taxable_amount * 0.069 - 532.0
		        elsif (taxable_amount > 13000.0)
			        taxable_amount * 0.06 - 382.0
		        elsif (taxable_amount > 10100.0)
			        taxable_amount * 0.05 - 252.0
		        elsif (taxable_amount > 7400.0)
			        taxable_amount * 0.04 - 151.0
		        elsif (taxable_amount > 4900.0)
			        taxable_amount * 0.03 - 77.0
		        elsif (taxable_amount > 2800.0)
			        taxable_amount * 0.02 - 28.0
		        elsif (taxable_amount > 0.0)
			        taxable_amount * 0.01
		        else 0.0
		        end
	        return tax
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_amount)
				{
					var tax = 0.0;
					
					if (taxable_amount > 16700.0) { tax = taxable_amount * 0.069 - 532.0; }
					else if (taxable_amount > 13000.0) { tax = taxable_amount * 0.06 - 382.0; }
					else if (taxable_amount > 10100.0) { tax = taxable_amount * 0.05 - 252.0; }
					else if (taxable_amount > 7400.0) { tax = taxable_amount * 0.04 - 151.0; }
					else if (taxable_amount > 4900.0) { tax = taxable_amount * 0.03 - 77.0; }
					else if (taxable_amount > 2800.0) { tax = taxable_amount * 0.02 - 28.0; }
					else if (taxable_amount > 0.0) { tax = taxable_amount * 0.01; }
					else { tax = 0.0; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="F2E2601920F3D34472ADBC33D5FF473D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        return 0.0 unless (taxable_income > 0.0)
	        case taxable_income
		        when (0.01..2800.0): taxable_income * 0.01
		        when (2800.01..4900.0): ((taxable_income * 0.02) - 28.0)
		        when (4900.01..7400.0): ((taxable_income * 0.03) - 77.0)
		        when (7400.01..10100.0): ((taxable_income * 0.04) - 151.0)
		        when (10100.01..13000.0): ((taxable_income * 0.05) - 252.0)
		        when (13000.01..16700.0): ((taxable_income * 0.06) - 382.0)
		        else ((taxable_income * 0.069) - 532.0)
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)							
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 2800.0) { return taxable_income * 0.01; }
					else if (taxable_income >= 2800.01 && taxable_income <= 4900.0) { return ((taxable_income * 0.02) - 28.0); }
					else if (taxable_income >= 4900.01 && taxable_income <= 7400.0) { return ((taxable_income * 0.03) - 77.0); }
					else if (taxable_income >= 7400.01 && taxable_income <= 10100.0) { return ((taxable_income * 0.04) - 151.0); }
					else if (taxable_income >= 10100.01 && taxable_income <= 13000.0) { return ((taxable_income * 0.05) - 252.0); }
					else if (taxable_income >= 13000.01 && taxable_income <= 16700.0) { return ((taxable_income * 0.06) - 382.0); }
					else { return ((taxable_income * 0.069) - 532.0); }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="BE30D6E4BA86D059701203648C651623" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def tax_due(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case (taxable_income)
		        when (0.0...100.0): 0.0
		        when (100.0...200.0): 2.0
		        when (200.0...300.0): 4.0
		        when (300.0...400.0): 5.0
		        when (400.0...500.0): 7.0
		        when (500.0...600.0): 8.0
		        when (600.0...700.0): 10.0
		        when (700.0...800.0): 11.0
		        when (800.0...900.0): 13.0
		        when (900.0...1000.0): 14.0
		        when (1000.0...1100.0): 16.0
		        when (1100.0...1200.0): 18.0
		        when (1200.0...1300.0): 20.0
		        when (1300.0...1400.0): 22.0
		        when (1400.0...1500.0): 24.0
		        when (1500.0...1600.0): 26.0
		        when (1600.0...1700.0): 28.0
		        when (1700.0...1800.0): 30.0
		        when (1800.0...1900.0): 32.0
		        when (1900.0...2000.0): 34.0
		        when (2000.0...2100.0): 36.0
		        when (2100.0...2200.0): 39.0
		        when (2200.0...2300.0): 41.0
		        when (2300.0...2400.0): 44.0
		        when (2400.0...2500.0): 46.0
		        when (2500.0...2600.0): 49.0
		        when (2600.0...2700.0): 51.0
		        when (2700.0...2800.0): 54.0
		        when (2800.0...2900.0): 56.0
		        when (2900.0...3000.0): 59.0
		        when (3000.0...3100.0): 62.0
		        when (3100.0...3200.0): 65.0
		        when (3200.0...3300.0): 68.0
		        when (3300.0...3400.0): 71.0
		        when (3400.0...3500.0): 74.0
		        when (3500.0...3600.0): 77.0
		        when (3600.0...3700.0): 80.0
		        when (3700.0...3800.0): 83.0
		        when (3800.0...3900.0): 86.0
		        when (3900.0...4000.0): 89.0
		        when (4000.0...4100.0): 92.0
		        when (4100.0...4200.0): 95.0
		        when (4200.0...4300.0): 99.0
		        when (4300.0...4400.0): 102.0
		        when (4400.0...4500.0): 106.0
		        when (4500.0...4600.0): 109.0
		        when (4600.0...4700.0): 113.0
		        when (4700.0...4800.0): 116.0
		        when (4800.0...4900.0): 120.0
		        when (4900.0...5000.0): 123.0
		        when (5000.0...5100.0): 127.0
		        when (5100.0...5200.0): 131.0
		        when (5200.0...5300.0): 135.0
		        when (5300.0...5400.0): 139.0
		        when (5400.0...5500.0): 143.0
		        when (5500.0...5600.0): 147.0
		        when (5600.0...5700.0): 151.0
		        when (5700.0...5800.0): 155.0
		        when (5800.0...5900.0): 159.0
		        when (5900.0...6000.0): 163.0
		        when (6000.0...6100.0): 167.0
		        when (6100.0...6200.0): 172.0
		        when (6200.0...6300.0): 176.0
		        when (6300.0...6400.0): 181.0
		        when (6400.0...6500.0): 185.0
		        when (6500.0...6600.0): 190.0
		        when (6600.0...6700.0): 194.0
		        when (6700.0...6800.0): 199.0
		        when (6800.0...6900.0): 203.0
		        when (6900.0...7000.0): 208.0
		        when (7000.0...7100.0): 213.0
		        when (7100.0...7200.0): 218.0
		        when (7200.0...7300.0): 223.0
		        when (7300.0...7400.0): 228.0
		        when (7400.0...7500.0): 233.0
		        when (7500.0...7600.0): 238.0
		        when (7600.0...7700.0): 243.0
		        when (7700.0...7800.0): 248.0
		        when (7800.0...7900.0): 253.0
		        when (7900.0...8000.0): 258.0
		        when (8000.0...8100.0): 263.0
		        when (8100.0...8200.0): 268.0
		        when (8200.0...8300.0): 274.0
		        when (8300.0...8400.0): 279.0
		        when (8400.0...8500.0): 285.0
		        when (8500.0...8600.0): 290.0
		        when (8600.0...8700.0): 296.0
		        when (8700.0...8800.0): 301.0
		        when (8800.0...8900.0): 307.0
		        when (8900.0...9000.0): 312.0
		        else 315.0 + (taxable_income - 9000.0) * 0.06
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function tax_due(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.0 && taxable_income <= 100.0) { return 0.0; }
					else if (taxable_income >= 100.0 && taxable_income <= 200.0) { return 2.0; }
					else if (taxable_income >= 200.0 && taxable_income <= 300.0) { return 4.0; }
					else if (taxable_income >= 300.0 && taxable_income <= 400.0) { return 5.0; }
					else if (taxable_income >= 400.0 && taxable_income <= 500.0) { return 7.0; }
					else if (taxable_income >= 500.0 && taxable_income <= 600.0) { return 8.0; }
					else if (taxable_income >= 600.0 && taxable_income <= 700.0) { return 10.0; }
					else if (taxable_income >= 700.0 && taxable_income <= 800.0) { return 11.0; }
					else if (taxable_income >= 800.0 && taxable_income <= 900.0) { return 13.0; }
					else if (taxable_income >= 900.0 && taxable_income <= 1000.0) { return 14.0; }
					else if (taxable_income >= 1000.0 && taxable_income <= 1100.0) { return 16.0; }
					else if (taxable_income >= 1100.0 && taxable_income <= 1200.0) { return 18.0; }
					else if (taxable_income >= 1200.0 && taxable_income <= 1300.0) { return 20.0; }
					else if (taxable_income >= 1300.0 && taxable_income <= 1400.0) { return 22.0; }
					else if (taxable_income >= 1400.0 && taxable_income <= 1500.0) { return 24.0; }
					else if (taxable_income >= 1500.0 && taxable_income <= 1600.0) { return 26.0; }
					else if (taxable_income >= 1600.0 && taxable_income <= 1700.0) { return 28.0; }
					else if (taxable_income >= 1700.0 && taxable_income <= 1800.0) { return 30.0; }
					else if (taxable_income >= 1800.0 && taxable_income <= 1900.0) { return 32.0; }
					else if (taxable_income >= 1900.0 && taxable_income <= 2000.0) { return 34.0; }
					else if (taxable_income >= 2000.0 && taxable_income <= 2100.0) { return 36.0; }
					else if (taxable_income >= 2100.0 && taxable_income <= 2200.0) { return 39.0; }
					else if (taxable_income >= 2200.0 && taxable_income <= 2300.0) { return 41.0; }
					else if (taxable_income >= 2300.0 && taxable_income <= 2400.0) { return 44.0; }
					else if (taxable_income >= 2400.0 && taxable_income <= 2500.0) { return 46.0; }
					else if (taxable_income >= 2500.0 && taxable_income <= 2600.0) { return 49.0; }
					else if (taxable_income >= 2600.0 && taxable_income <= 2700.0) { return 51.0; }
					else if (taxable_income >= 2700.0 && taxable_income <= 2800.0) { return 54.0; }
					else if (taxable_income >= 2800.0 && taxable_income <= 2900.0) { return 56.0; }
					else if (taxable_income >= 2900.0 && taxable_income <= 3000.0) { return 59.0; }
					else if (taxable_income >= 3000.0 && taxable_income <= 3100.0) { return 62.0; }
					else if (taxable_income >= 3100.0 && taxable_income <= 3200.0) { return 65.0; }
					else if (taxable_income >= 3200.0 && taxable_income <= 3300.0) { return 68.0; }
					else if (taxable_income >= 3300.0 && taxable_income <= 3400.0) { return 71.0; }
					else if (taxable_income >= 3400.0 && taxable_income <= 3500.0) { return 74.0; }
					else if (taxable_income >= 3500.0 && taxable_income <= 3600.0) { return 77.0; }
					else if (taxable_income >= 3600.0 && taxable_income <= 3700.0) { return 80.0; }
					else if (taxable_income >= 3700.0 && taxable_income <= 3800.0) { return 83.0; }
					else if (taxable_income >= 3800.0 && taxable_income <= 3900.0) { return 86.0; }
					else if (taxable_income >= 3900.0 && taxable_income <= 4000.0) { return 89.0; }
					else if (taxable_income >= 4000.0 && taxable_income <= 4100.0) { return 92.0; }
					else if (taxable_income >= 4100.0 && taxable_income <= 4200.0) { return 95.0; }
					else if (taxable_income >= 4200.0 && taxable_income <= 4300.0) { return 99.0; }
					else if (taxable_income >= 4300.0 && taxable_income <= 4400.0) { return 102.0; }
					else if (taxable_income >= 4400.0 && taxable_income <= 4500.0) { return 106.0; }
					else if (taxable_income >= 4500.0 && taxable_income <= 4600.0) { return 109.0; }
					else if (taxable_income >= 4600.0 && taxable_income <= 4700.0) { return 113.0; }
					else if (taxable_income >= 4700.0 && taxable_income <= 4800.0) { return 116.0; }
					else if (taxable_income >= 4800.0 && taxable_income <= 4900.0) { return 120.0; }
					else if (taxable_income >= 4900.0 && taxable_income <= 5000.0) { return 123.0; }
					else if (taxable_income >= 5000.0 && taxable_income <= 5100.0) { return 127.0; }
					else if (taxable_income >= 5100.0 && taxable_income <= 5200.0) { return 131.0; }
					else if (taxable_income >= 5200.0 && taxable_income <= 5300.0) { return 135.0; }
					else if (taxable_income >= 5300.0 && taxable_income <= 5400.0) { return 139.0; }
					else if (taxable_income >= 5400.0 && taxable_income <= 5500.0) { return 143.0; }
					else if (taxable_income >= 5500.0 && taxable_income <= 5600.0) { return 147.0; }
					else if (taxable_income >= 5600.0 && taxable_income <= 5700.0) { return 151.0; }
					else if (taxable_income >= 5700.0 && taxable_income <= 5800.0) { return 155.0; }
					else if (taxable_income >= 5800.0 && taxable_income <= 5900.0) { return 159.0; }
					else if (taxable_income >= 5900.0 && taxable_income <= 6000.0) { return 163.0; }
					else if (taxable_income >= 6000.0 && taxable_income <= 6100.0) { return 167.0; }
					else if (taxable_income >= 6100.0 && taxable_income <= 6200.0) { return 172.0; }
					else if (taxable_income >= 6200.0 && taxable_income <= 6300.0) { return 176.0; }
					else if (taxable_income >= 6300.0 && taxable_income <= 6400.0) { return 181.0; }
					else if (taxable_income >= 6400.0 && taxable_income <= 6500.0) { return 185.0; }
					else if (taxable_income >= 6500.0 && taxable_income <= 6600.0) { return 190.0; }
					else if (taxable_income >= 6600.0 && taxable_income <= 6700.0) { return 194.0; }
					else if (taxable_income >= 6700.0 && taxable_income <= 6800.0) { return 199.0; }
					else if (taxable_income >= 6800.0 && taxable_income <= 6900.0) { return 203.0; }
					else if (taxable_income >= 6900.0 && taxable_income <= 7000.0) { return 208.0; }
					else if (taxable_income >= 7000.0 && taxable_income <= 7100.0) { return 213.0; }
					else if (taxable_income >= 7100.0 && taxable_income <= 7200.0) { return 218.0; }
					else if (taxable_income >= 7200.0 && taxable_income <= 7300.0) { return 223.0; }
					else if (taxable_income >= 7300.0 && taxable_income <= 7400.0) { return 228.0; }
					else if (taxable_income >= 7400.0 && taxable_income <= 7500.0) { return 233.0; }
					else if (taxable_income >= 7500.0 && taxable_income <= 7600.0) { return 238.0; }
					else if (taxable_income >= 7600.0 && taxable_income <= 7700.0) { return 243.0; }
					else if (taxable_income >= 7700.0 && taxable_income <= 7800.0) { return 248.0; }
					else if (taxable_income >= 7800.0 && taxable_income <= 7900.0) { return 253.0; }
					else if (taxable_income >= 7900.0 && taxable_income <= 8000.0) { return 258.0; }
					else if (taxable_income >= 8000.0 && taxable_income <= 8100.0) { return 263.0; }
					else if (taxable_income >= 8100.0 && taxable_income <= 8200.0) { return 268.0; }
					else if (taxable_income >= 8200.0 && taxable_income <= 8300.0) { return 274.0; }
					else if (taxable_income >= 8300.0 && taxable_income <= 8400.0) { return 279.0; }
					else if (taxable_income >= 8400.0 && taxable_income <= 8500.0) { return 285.0; }
					else if (taxable_income >= 8500.0 && taxable_income <= 8600.0) { return 290.0; }
					else if (taxable_income >= 8600.0 && taxable_income <= 8700.0) { return 296.0; }
					else if (taxable_income >= 8700.0 && taxable_income <= 8800.0) { return 301.0; }
					else if (taxable_income >= 8800.0 && taxable_income <= 8900.0) { return 307.0; }
					else if (taxable_income >= 8900.0 && taxable_income <= 9000.0) { return 312.0; }
					else { return 315.0 + (taxable_income - 9000.0) * 0.06; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="7637FD974B2618E29891D185BD45A282" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)			 		
	        return 0.0 if (taxable_income < 950000.0)
	        return case taxable_income
			        when (950000...1900000): 190.0		
			        when (1900000...9500000): 570.0
			        when (9500000...19000000): 1900.0
			        when (19000000...37990000): 3800.0
			        else 9500.0
		        end
        end			
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)			 		
				{
					if (taxable_income < 950000.0)
					{
						return 0.0;
					}

					if (taxable_income >= 950000 && taxable_income <= 1900000) { return 190.0; }
					else if (taxable_income >= 1900000 && taxable_income <= 9500000) { return 570.0; }
					else if (taxable_income >= 9500000 && taxable_income <= 19000000) { return 1900.0; }
					else if (taxable_income >= 19000000 && taxable_income <= 37990000) { return 3800.0; }
					else { return 9500.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="1D94DF06178F46D2B7379243B64ECD73" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_rate(household_income)
	        rate = if (household_income < 0.0) then '0'
		        else
			        case household_income
				        when (0.0..11338.99) then '1.00'
				        when (11339.0..12672.99) then '0.85'
				        when (12673.0..14006.99) then '0.70'
				        when (14007.0..16674.99) then '0.50'
				        when (16675.0..19342.99) then '0.35'
				        when (19343.0..22010.99) then '0.25'
				        else '0'
			        end
		        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_rate(household_income)
				{
					if (household_income < 0.0)
					{
						return '0';
					}
					else
					{
						if (household_income >= 0.0 && household_income <= 11338.99) { return '1.00'; }
						else if (household_income >= 11339.0 && household_income <= 12672.99) { return '0.85'; }
						else if (household_income >= 12673.0 && household_income <= 14006.99) { return '0.70'; }
						else if (household_income >= 14007.0 && household_income <= 16674.99) { return '0.50'; }
						else if (household_income >= 16675.0 && household_income <= 19342.99) { return '0.35'; }
						else if (household_income >= 19343.0 && household_income <= 22010.99) { return '0.25'; }
						else { return '0'; }
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="92F7480355E80D4AEF3287C33C36EECB" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1515.01)					
			        tax = taxable_income * 0.0036				
		        when (1515.01...3030.01)					
			        tax = ((taxable_income - 1515.0) * 0.0072) + 5.45		
		        when (3030.01...6060.01)					
			        tax = ((taxable_income - 3030.0) * 0.0243) + 16.36	
		        when (6060.01...13635.01)					
			        tax = ((taxable_income - 6060.0) * 0.045) + 89.99
		        when (13635.01...22725.01)					
			        tax = ((taxable_income - 13635.0) * 0.0612) + 430.87
		        when (22725.01...30300.01)					
			        tax = ((taxable_income - 22725.0) * 0.0648) + 987.18
		        when (30300.01...45450.01)					
			        tax = ((taxable_income - 30300.0) * 0.068) + 1478.04
		        when (45450.01...68175.01)					
			        tax = ((taxable_income - 45450.0) * 0.0792) + 2508.24		
		        else					
			        tax = ((taxable_income - 68175.0) * 0.0898) + 4308.06				
	        end					
	        return tax						
        end							
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0;
					}

          var tax = 0.0;
					if (taxable_income >= 0.01 && taxable_income <= 1515.01) { tax = taxable_income * 0.0036; }
					else if (taxable_income >= 1515.01 && taxable_income <= 3030.01) { tax = ((taxable_income - 1515.0) * 0.0072) + 5.45; }
					else if (taxable_income >= 3030.01 && taxable_income <= 6060.01) { tax = ((taxable_income - 3030.0) * 0.0243) + 16.36; }
					else if (taxable_income >= 6060.01 && taxable_income <= 13635.01) { tax = ((taxable_income - 6060.0) * 0.045) + 89.99; }
					else if (taxable_income >= 13635.01 && taxable_income <= 22725.01) { tax = ((taxable_income - 13635.0) * 0.0612) + 430.87; }
					else if (taxable_income >= 22725.01 && taxable_income <= 30300.01) { tax = ((taxable_income - 22725.0) * 0.0648) + 987.18; }
					else if (taxable_income >= 30300.01 && taxable_income <= 45450.01) { tax = ((taxable_income - 30300.0) * 0.068) + 1478.04; }
					else if (taxable_income >= 45450.01 && taxable_income <= 68175.01) { tax = ((taxable_income - 45450.0) * 0.0792) + 2508.24; }
					else { tax = ((taxable_income - 68175.0) * 0.0898) + 4308.06; }

					return tax;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="E6D95AB16BAC8E36D57DCA1C9127093B" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case (taxable_income)
		        when (0.01..1515.0): taxable_income * 0.0036
		        when (1515.01..3030.0): ((taxable_income - 1515.0) * 0.0072) + 5.45
		        when (3030.01..6060.0): ((taxable_income - 3030.0) * 0.0243) + 16.36
		        when (6060.01..13635.0): ((taxable_income - 6060.0) * 0.045) + 89.99
		        when (13635.01..22725.0): ((taxable_income - 13635.0) * 0.0612) + 430.87
		        when (22725.01..30300.0): ((taxable_income - 22725.0) * 0.0648) + 987.18
		        when (30300.01..45450.0): ((taxable_income - 30300.0) * 0.068) + 1478.04
		        when (45450.01..68175.0): ((taxable_income - 45450.0) * 0.0792) + 2508.24
		        else ((taxable_income - 68175.0) * 0.0898) + 4308.06
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 1515.0) { return taxable_income * 0.0036; }
					else if (taxable_income >= 1515.01 && taxable_income <= 3030.0) { return ((taxable_income - 1515.0) * 0.0072) + 5.45; }
					else if (taxable_income >= 3030.01 && taxable_income <= 6060.0) { return ((taxable_income - 3030.0) * 0.0243) + 16.36; }
					else if (taxable_income >= 6060.01 && taxable_income <= 13635.0) { return ((taxable_income - 6060.0) * 0.045) + 89.99; }
					else if (taxable_income >= 13635.01 && taxable_income <= 22725.0) { return ((taxable_income - 13635.0) * 0.0612) + 430.87; }
					else if (taxable_income >= 22725.01 && taxable_income <= 30300.0) { return ((taxable_income - 22725.0) * 0.0648) + 987.18; }
					else if (taxable_income >= 30300.01 && taxable_income <= 45450.0) { return ((taxable_income - 30300.0) * 0.068) + 1478.04; }
					else if (taxable_income >= 45450.01 && taxable_income <= 68175.0) { return ((taxable_income - 45450.0) * 0.0792) + 2508.24; }
					else { return ((taxable_income - 68175.0) * 0.0898) + 4308.06; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="5AEAF39057A2BF01928DF2950C72F83F" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case (taxable_income)
		        when (0.01..1494.0): taxable_income * 0.0036
		        when (1494.01..2988.0): ((taxable_income - 1494.0) * 0.0072) + 5.38
		        when (2988.01..5976.0): ((taxable_income - 2988.0) * 0.0243) + 16.14
		        when (5976.01..13446.0): ((taxable_income - 5976.0) * 0.045) + 88.75
		        when (13446.01..22410.0): ((taxable_income - 13446.0) * 0.0612) + 424.9
		        when (22410.01..29880.0): ((taxable_income - 22410.0) * 0.0648) + 973.5
		        when (29880.01..44820.0): ((taxable_income - 29880.0) * 0.068) + 1457.56
		        when (44820.01..67230.0): ((taxable_income - 44820.0) * 0.0792) + 2473.48
		        else ((taxable_income - 67230.0) * 0.0898) + 4248.35
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (taxable_income >= 0.01 && taxable_income <= 1494.0) { return  taxable_income * 0.0036; }
					else if (taxable_income >= 1494.01 && taxable_income <= 2988.0) { return  ((taxable_income - 1494.0) * 0.0072) + 5.38; }
					else if (taxable_income >= 2988.01 && taxable_income <= 5976.0) { return  ((taxable_income - 2988.0) * 0.0243) + 16.14; }
					else if (taxable_income >= 5976.01 && taxable_income <= 13446.0) { return  ((taxable_income - 5976.0) * 0.045) + 88.75; }
					else if (taxable_income >= 13446.01 && taxable_income <= 22410.0) { return  ((taxable_income - 13446.0) * 0.0612) + 424.9; }
					else if (taxable_income >= 22410.01 && taxable_income <= 29880.0) { return  ((taxable_income - 22410.0) * 0.0648) + 973.5; }
					else if (taxable_income >= 29880.01 && taxable_income <= 44820.0) { return  ((taxable_income - 29880.0) * 0.068) + 1457.56; }
					else if (taxable_income >= 44820.01 && taxable_income <= 67230.0) { return  ((taxable_income - 44820.0) * 0.0792) + 2473.48; }
					else { return ((taxable_income - 67230.0) * 0.0898) + 4248.35; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="6898F6A2D940BEEEE6DF4AE57071FE38" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(net_taxable_income)
	        return [net_taxable_income * 0.009, 0.0].max if (net_taxable_income < 4300.0)
	        case (net_taxable_income)
		        when (4300.0..4999.0): 39.0 + (net_taxable_income - 4299.0) * 0.025
		        when (5000.0..5999.0): 56.0 + (net_taxable_income - 4999.0) * 0.025
		        when (6000.0..6999.0): 81.0 + (net_taxable_income - 5999.0) * 0.025
		        when (7000.0..7999.0): 106.0 + (net_taxable_income - 6999.0) * 0.025
		        when (8000.0..8399.0): 131.0 + (net_taxable_income - 7999.0) * 0.025
		        when (8400.0..8999.0): 141.0 + (net_taxable_income - 8399.0) * 0.035
		        when (9000.0..9999.0): 162.0 + (net_taxable_income - 8999.0) * 0.035
		        when (10000.0..10999.0): 197.0 + (net_taxable_income - 9999.0) * 0.035
		        when (11000.0..11999.0): 232.0 + (net_taxable_income - 10999.0) * 0.035
		        when (12000.0..12599.0): 267.0 + (net_taxable_income - 11999.0) * 0.035
		        when (12600.0..12999.0): 288.0 + (net_taxable_income - 12599.0) * 0.045
		        when (13000.0..13999.0): 306.0 + (net_taxable_income - 12999.0) * 0.045
		        when (14000.0..14999.0): 351.0 + (net_taxable_income - 13999.0) * 0.045
		        when (15000.0..15999.0): 396.0 + (net_taxable_income - 14999.0) * 0.045
		        when (16000.0..16999.0): 441.0 + (net_taxable_income - 15999.0) * 0.045
		        when (17000.0..17999.0): 486.0 + (net_taxable_income - 16999.0) * 0.045
		        when (18000.0..18999.0): 531.0 + (net_taxable_income - 17999.0) * 0.045
		        when (19000.0..19999.0): 576.0 + (net_taxable_income - 18999.0) * 0.045
		        when (20000.0..20999.0): 621.0 + (net_taxable_income - 19999.0) * 0.045
		        when (21000.0..21999.0): 666.0 + (net_taxable_income - 20999.0) * 0.06
		        when (22000.0..22999.0): 726.0 + (net_taxable_income - 21999.0) * 0.06
		        when (23000.0..23999.0): 786.0 + (net_taxable_income - 22999.0) * 0.06
		        when (24000.0..24999.0): 846.0 + (net_taxable_income - 23999.0) * 0.06
		        when (25000.0..25999.0): 906.0 + (net_taxable_income - 24999.0) * 0.06
		        when (26000.0..26999.0): 966.0 + (net_taxable_income - 25999.0) * 0.06
		        when (27000.0..27999.0): 1026.0 + (net_taxable_income - 26999.0) * 0.06
		        when (28000.0..28999.0): 1086.0 + (net_taxable_income - 27999.0) * 0.06
		        when (29000.0..29999.0): 1146.0 + (net_taxable_income - 28999.0) * 0.06
		        when (30000.0..30999.0): 1206.0 + (net_taxable_income - 29999.0) * 0.06
		        when (31000.0..31999.0): 1266.0 + (net_taxable_income - 30999.0) * 0.06
		        when (32000.0..32999.0): 1326.0 + (net_taxable_income - 31999.0) * 0.06
		        when (33000.0..33999.0): 1386.0 + (net_taxable_income - 32999.0) * 0.06
		        when (34000.0..34999.0): 1446.0 + (net_taxable_income - 33999.0) * 0.06
		        when (35000.0..35099.0): 1506.0 + (net_taxable_income - 34999.0) * 0.06
		        else 1512.0 + (net_taxable_income - 35099.0) * 0.07
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(net_taxable_income)
				{
					if (net_taxable_income < 4300.0)
					{
						return Math.max(net_taxable_income * 0.009, 0.0);
					}

					if (net_taxable_income >= 4300.0 && net_taxable_income <= 4999.0) { return  39.0 + (net_taxable_income - 4299.0) * 0.025; }
					else if (net_taxable_income >= 5000.0 && net_taxable_income <= 5999.0) { return  56.0 + (net_taxable_income - 4999.0) * 0.025; }
					else if (net_taxable_income >= 6000.0 && net_taxable_income <= 6999.0) { return  81.0 + (net_taxable_income - 5999.0) * 0.025; }
					else if (net_taxable_income >= 7000.0 && net_taxable_income <= 7999.0) { return  106.0 + (net_taxable_income - 6999.0) * 0.025; }
					else if (net_taxable_income >= 8000.0 && net_taxable_income <= 8399.0) { return  131.0 + (net_taxable_income - 7999.0) * 0.025; }
					else if (net_taxable_income >= 8400.0 && net_taxable_income <= 8999.0) { return  141.0 + (net_taxable_income - 8399.0) * 0.035; }
					else if (net_taxable_income >= 9000.0 && net_taxable_income <= 9999.0) { return  162.0 + (net_taxable_income - 8999.0) * 0.035; }
					else if (net_taxable_income >= 10000.0 && net_taxable_income <= 10999.0) { return  197.0 + (net_taxable_income - 9999.0) * 0.035; }
					else if (net_taxable_income >= 11000.0 && net_taxable_income <= 11999.0) { return  232.0 + (net_taxable_income - 10999.0) * 0.035; }
					else if (net_taxable_income >= 12000.0 && net_taxable_income <= 12599.0) { return  267.0 + (net_taxable_income - 11999.0) * 0.035; }
					else if (net_taxable_income >= 12600.0 && net_taxable_income <= 12999.0) { return  288.0 + (net_taxable_income - 12599.0) * 0.045; }
					else if (net_taxable_income >= 13000.0 && net_taxable_income <= 13999.0) { return  306.0 + (net_taxable_income - 12999.0) * 0.045; }
					else if (net_taxable_income >= 14000.0 && net_taxable_income <= 14999.0) { return  351.0 + (net_taxable_income - 13999.0) * 0.045; }
					else if (net_taxable_income >= 15000.0 && net_taxable_income <= 15999.0) { return  396.0 + (net_taxable_income - 14999.0) * 0.045; }
					else if (net_taxable_income >= 16000.0 && net_taxable_income <= 16999.0) { return  441.0 + (net_taxable_income - 15999.0) * 0.045; }
					else if (net_taxable_income >= 17000.0 && net_taxable_income <= 17999.0) { return  486.0 + (net_taxable_income - 16999.0) * 0.045; }
					else if (net_taxable_income >= 18000.0 && net_taxable_income <= 18999.0) { return  531.0 + (net_taxable_income - 17999.0) * 0.045; }
					else if (net_taxable_income >= 19000.0 && net_taxable_income <= 19999.0) { return  576.0 + (net_taxable_income - 18999.0) * 0.045; }
					else if (net_taxable_income >= 20000.0 && net_taxable_income <= 20999.0) { return  621.0 + (net_taxable_income - 19999.0) * 0.045; }
					else if (net_taxable_income >= 21000.0 && net_taxable_income <= 21999.0) { return  666.0 + (net_taxable_income - 20999.0) * 0.06; }
					else if (net_taxable_income >= 22000.0 && net_taxable_income <= 22999.0) { return  726.0 + (net_taxable_income - 21999.0) * 0.06; }
					else if (net_taxable_income >= 23000.0 && net_taxable_income <= 23999.0) { return  786.0 + (net_taxable_income - 22999.0) * 0.06; }
					else if (net_taxable_income >= 24000.0 && net_taxable_income <= 24999.0) { return  846.0 + (net_taxable_income - 23999.0) * 0.06; }
					else if (net_taxable_income >= 25000.0 && net_taxable_income <= 25999.0) { return  906.0 + (net_taxable_income - 24999.0) * 0.06; }
					else if (net_taxable_income >= 26000.0 && net_taxable_income <= 26999.0) { return  966.0 + (net_taxable_income - 25999.0) * 0.06; }
					else if (net_taxable_income >= 27000.0 && net_taxable_income <= 27999.0) { return  1026.0 + (net_taxable_income - 26999.0) * 0.06; }
					else if (net_taxable_income >= 28000.0 && net_taxable_income <= 28999.0) { return  1086.0 + (net_taxable_income - 27999.0) * 0.06; }
					else if (net_taxable_income >= 29000.0 && net_taxable_income <= 29999.0) { return  1146.0 + (net_taxable_income - 28999.0) * 0.06; }
					else if (net_taxable_income >= 30000.0 && net_taxable_income <= 30999.0) { return  1206.0 + (net_taxable_income - 29999.0) * 0.06; }
					else if (net_taxable_income >= 31000.0 && net_taxable_income <= 31999.0) { return  1266.0 + (net_taxable_income - 30999.0) * 0.06; }
					else if (net_taxable_income >= 32000.0 && net_taxable_income <= 32999.0) { return  1326.0 + (net_taxable_income - 31999.0) * 0.06; }
					else if (net_taxable_income >= 33000.0 && net_taxable_income <= 33999.0) { return  1386.0 + (net_taxable_income - 32999.0) * 0.06; }
					else if (net_taxable_income >= 34000.0 && net_taxable_income <= 34999.0) { return  1446.0 + (net_taxable_income - 33999.0) * 0.06; }
					else if (net_taxable_income >= 35000.0 && net_taxable_income <= 35099.0) { return  1506.0 + (net_taxable_income - 34999.0) * 0.06; }
					else { return 1512.0 + (net_taxable_income - 35099.0) * 0.07; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="30AA22D844F50112961BF4D3E0C010B4" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def tax (income)
	        return 0.0 unless (income > 0.0)
	        case (income)
		        when (0.01..4300.00): (income * 0.009)
		        when (4300.0..4999.0): ((income - 4299.0) * 0.025) + 39.0
		        when (5000.0..5999.0): ((income - 4999.0) * 0.025) + 56.0
		        when (6000.0..6999.0): ((income - 5999.0) * 0.025) + 81.0
		        when (7000.0..7999.0): ((income - 6999.0) * 0.025) + 106.0
		        when (8000.0..8399.0): ((income - 7999.0) * 0.025) + 131.0
		        when (8400.0..8999.0): ((income - 8399.0) * 0.035) + 141.0
		        when (9000.0..9999.0): ((income - 8999.0) * 0.035) + 162.0
		        when (10000.0..10999.0): ((income - 9999.0) * 0.035) + 197.0
		        when (11000.0..11999.0): ((income - 10999.0) * 0.035) + 232.0
		        when (12000.0..12599.0): ((income - 11999.0) * 0.035) + 267.0
		        when (12600.0..12999.0): ((income - 12599.0) * 0.045) + 288.0
		        when (13000.0..13999.0): ((income - 12999.0) * 0.045) + 306.0
		        when (14000.0..14999.0): ((income - 13999.0) * 0.045) + 351.0
		        when (15000.0..15999.0): ((income - 14999.0) * 0.045) + 396.0
		        when (16000.0..16999.0): ((income - 15999.0) * 0.045) + 441.0
		        when (17000.0..17999.0): ((income - 16999.0) * 0.045) + 486.0
		        when (18000.0..18999.0): ((income - 17999.0) * 0.045) + 531.0
		        when (19000.0..19999.0): ((income - 18999.0) * 0.045) + 576.0
		        when (20000.0..20999.0): ((income - 19999.0) * 0.045) + 621.0
		        when (21000.0..21999.0): ((income - 20999.0) * 0.06) + 666.0
		        when (22000.0..22999.0): ((income - 21999.0) * 0.06) + 726.0
		        when (23000.0..23999.0): ((income - 22999.0) * 0.06) + 786.0
		        when (24000.0..24999.0): ((income - 23999.0) * 0.06) + 846.0
		        when (25000.0..25999.0): ((income - 24999.0) * 0.06) + 906.0
		        when (26000.0..26999.0): ((income - 25999.0) * 0.06) + 966.0
		        when (27000.0..27999.0): ((income - 26999.0) * 0.06) + 1026.0
		        when (28000.0..28999.0): ((income - 27999.0) * 0.06) + 1086.0
		        when (29000.0..29999.0): ((income - 28999.0) * 0.06) + 1146.0
		        when (30000.0..30999.0): ((income - 29999.0) * 0.06) + 1206.0
		        when (31000.0..31999.0): ((income - 30999.0) * 0.06) + 1266.0
		        when (32000.0..32999.0): ((income - 31999.0) * 0.06) + 1326.0
		        when (33000.0..33999.0): ((income - 32999.0) * 0.06) + 1386.0
		        when (34000.0..34999.0): ((income - 33999.0) * 0.06) + 1446.0
		        when (35000.0..35099.0): ((income - 34999.0) * 0.06) + 1506.0
		        else (income - 35100) * 0.07 + 1512.0
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function tax (income)
				{
					if (income <= 0.0)
					{
						return 0.0;
					}

					if (income >= 0.01 && income <= 4300.00) { return (income * 0.009); }
					else if (income >= 4300.0 && income <= 4999.0) { return ((income - 4299.0) * 0.025) + 39.0; }
					else if (income >= 5000.0 && income <= 5999.0) { return ((income - 4999.0) * 0.025) + 56.0; }
					else if (income >= 6000.0 && income <= 6999.0) { return ((income - 5999.0) * 0.025) + 81.0; }
					else if (income >= 7000.0 && income <= 7999.0) { return ((income - 6999.0) * 0.025) + 106.0; }
					else if (income >= 8000.0 && income <= 8399.0) { return ((income - 7999.0) * 0.025) + 131.0; }
					else if (income >= 8400.0 && income <= 8999.0) { return ((income - 8399.0) * 0.035) + 141.0; }
					else if (income >= 9000.0 && income <= 9999.0) { return ((income - 8999.0) * 0.035) + 162.0; }
					else if (income >= 10000.0 && income <= 10999.0) { return ((income - 9999.0) * 0.035) + 197.0; }
					else if (income >= 11000.0 && income <= 11999.0) { return ((income - 10999.0) * 0.035) + 232.0; }
					else if (income >= 12000.0 && income <= 12599.0) { return ((income - 11999.0) * 0.035) + 267.0; }
					else if (income >= 12600.0 && income <= 12999.0) { return ((income - 12599.0) * 0.045) + 288.0; }
					else if (income >= 13000.0 && income <= 13999.0) { return ((income - 12999.0) * 0.045) + 306.0; }
					else if (income >= 14000.0 && income <= 14999.0) { return ((income - 13999.0) * 0.045) + 351.0; }
					else if (income >= 15000.0 && income <= 15999.0) { return ((income - 14999.0) * 0.045) + 396.0; }
					else if (income >= 16000.0 && income <= 16999.0) { return ((income - 15999.0) * 0.045) + 441.0; }
					else if (income >= 17000.0 && income <= 17999.0) { return ((income - 16999.0) * 0.045) + 486.0; }
					else if (income >= 18000.0 && income <= 18999.0) { return ((income - 17999.0) * 0.045) + 531.0; }
					else if (income >= 19000.0 && income <= 19999.0) { return ((income - 18999.0) * 0.045) + 576.0; }
					else if (income >= 20000.0 && income <= 20999.0) { return ((income - 19999.0) * 0.045) + 621.0; }
					else if (income >= 21000.0 && income <= 21999.0) { return ((income - 20999.0) * 0.06) + 666.0; }
					else if (income >= 22000.0 && income <= 22999.0) { return ((income - 21999.0) * 0.06) + 726.0; }
					else if (income >= 23000.0 && income <= 23999.0) { return ((income - 22999.0) * 0.06) + 786.0; }
					else if (income >= 24000.0 && income <= 24999.0) { return ((income - 23999.0) * 0.06) + 846.0; }
					else if (income >= 25000.0 && income <= 25999.0) { return ((income - 24999.0) * 0.06) + 906.0; }
					else if (income >= 26000.0 && income <= 26999.0) { return ((income - 25999.0) * 0.06) + 966.0; }
					else if (income >= 27000.0 && income <= 27999.0) { return ((income - 26999.0) * 0.06) + 1026.0; }
					else if (income >= 28000.0 && income <= 28999.0) { return ((income - 27999.0) * 0.06) + 1086.0; }
					else if (income >= 29000.0 && income <= 29999.0) { return ((income - 28999.0) * 0.06) + 1146.0; }
					else if (income >= 30000.0 && income <= 30999.0) { return ((income - 29999.0) * 0.06) + 1206.0; }
					else if (income >= 31000.0 && income <= 31999.0) { return ((income - 30999.0) * 0.06) + 1266.0; }
					else if (income >= 32000.0 && income <= 32999.0) { return ((income - 31999.0) * 0.06) + 1326.0; }
					else if (income >= 33000.0 && income <= 33999.0) { return ((income - 32999.0) * 0.06) + 1386.0; }
					else if (income >= 34000.0 && income <= 34999.0) { return ((income - 33999.0) * 0.06) + 1446.0; }
					else if (income >= 35000.0 && income <= 35099.0) { return ((income - 34999.0) * 0.06) + 1506.0; }
					else { return (income - 35100) * 0.07 + 1512.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="8B16D05A8CBE4E9B8341709F06D1B0CF" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(net_taxable_income)
	        return [net_taxable_income * 0.01, 0.0].max if (net_taxable_income < 4200.0)
	        case (net_taxable_income)
		        when (4200.0..4999.0): 42.0 + (net_taxable_income - 4199.0) * 0.025
		        when (5000.0..5999.0): 62.0 + (net_taxable_income - 4999.0) * 0.025
		        when (6000.0..6999.0): 87.0 + (net_taxable_income - 5999.0) * 0.025
		        when (7000.0..7999.0): 112.0 + (net_taxable_income - 6999.0) * 0.025
		        when (8000.0..8299.0): 137.0 + (net_taxable_income - 7999.0) * 0.025
		        when (8300.0..8999.0): 145.0 + (net_taxable_income - 8299.0) * 0.035
		        when (9000.0..9999.0): 169.0 + (net_taxable_income - 8999.0) * 0.035
		        when (10000.0..10999.0): 204.0 + (net_taxable_income - 9999.0) * 0.035
		        when (11000.0..11999.0): 239.0 + (net_taxable_income - 10999.0) * 0.035
		        when (12000.0..12399.0): 274.0 + (net_taxable_income - 11999.0) * 0.035
		        when (12400.0..12999.0): 288.0 + (net_taxable_income - 12399.0) * 0.045
		        when (13000.0..13999.0): 315.0 + (net_taxable_income - 12999.0) * 0.045
		        when (14000.0..14999.0): 360.0 + (net_taxable_income - 13999.0) * 0.045
		        when (15000.0..15999.0): 405.0 + (net_taxable_income - 14999.0) * 0.045
		        when (16000.0..16999.0): 450.0 + (net_taxable_income - 15999.0) * 0.045
		        when (17000.0..17999.0): 495.0 + (net_taxable_income - 16999.0) * 0.045
		        when (18000.0..18999.0): 540.0 + (net_taxable_income - 17999.0) * 0.045
		        when (19000.0..19999.0): 585.0 + (net_taxable_income - 18999.0) * 0.045
		        when (20000.0..20699.0): 630.0 + (net_taxable_income - 19999.0) * 0.045
		        when (20700.0..20999.0): 662.0 + (net_taxable_income - 20699.0) * 0.06
		        when (21000.0..21999.0): 680.0 + (net_taxable_income - 20999.0) * 0.06
		        when (22000.0..22999.0): 740.0 + (net_taxable_income - 21999.0) * 0.06
		        when (23000.0..23999.0): 800.0 + (net_taxable_income - 22999.0) * 0.06
		        when (24000.0..24999.0): 860.0 + (net_taxable_income - 23999.0) * 0.06
		        when (25000.0..25999.0): 920.0 + (net_taxable_income - 24999.0) * 0.06
		        when (26000.0..26999.0): 980.0 + (net_taxable_income - 25999.0) * 0.06
		        when (27000.0..27999.0): 1040.0 + (net_taxable_income - 26999.0) * 0.06
		        when (28000.0..28999.0): 1100.0 + (net_taxable_income - 27999.0) * 0.06
		        when (29000.0..29999.0): 1160.0 + (net_taxable_income - 28999.0) * 0.06
		        when (30000.0..30999.0): 1220.0 + (net_taxable_income - 29999.0) * 0.06
		        when (31000.0..31999.0): 1280.0 + (net_taxable_income - 30999.0) * 0.06
		        when (32000.0..32999.0): 1340.0 + (net_taxable_income - 31999.0) * 0.06
		        when (33000.0..33999.0): 1400.0 + (net_taxable_income - 32999.0) * 0.06
		        when (34000.0..34599.0): 1460.0 + (net_taxable_income - 33999.0) * 0.06
		        else 1469.0 + (net_taxable_income - 34599.0) * 0.07
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(net_taxable_income)
				{
					if (net_taxable_income < 4200.0)
					{
						return Math.max(net_taxable_income * 0.01, 0.0);
					}

					if (net_taxable_income >= 4200.0 && net_taxable_income <= 4999.0) { return  42.0 + (net_taxable_income - 4199.0) * 0.025; }
					else if (net_taxable_income >= 5000.0 && net_taxable_income <= 5999.0) { return  62.0 + (net_taxable_income - 4999.0) * 0.025; }
					else if (net_taxable_income >= 6000.0 && net_taxable_income <= 6999.0) { return  87.0 + (net_taxable_income - 5999.0) * 0.025; }
					else if (net_taxable_income >= 7000.0 && net_taxable_income <= 7999.0) { return  112.0 + (net_taxable_income - 6999.0) * 0.025; }
					else if (net_taxable_income >= 8000.0 && net_taxable_income <= 8299.0) { return  137.0 + (net_taxable_income - 7999.0) * 0.025; }
					else if (net_taxable_income >= 8300.0 && net_taxable_income <= 8999.0) { return  145.0 + (net_taxable_income - 8299.0) * 0.035; }
					else if (net_taxable_income >= 9000.0 && net_taxable_income <= 9999.0) { return  169.0 + (net_taxable_income - 8999.0) * 0.035; }
					else if (net_taxable_income >= 10000.0 && net_taxable_income <= 10999.0) { return  204.0 + (net_taxable_income - 9999.0) * 0.035; }
					else if (net_taxable_income >= 11000.0 && net_taxable_income <= 11999.0) { return  239.0 + (net_taxable_income - 10999.0) * 0.035; }
					else if (net_taxable_income >= 12000.0 && net_taxable_income <= 12399.0) { return  274.0 + (net_taxable_income - 11999.0) * 0.035; }
					else if (net_taxable_income >= 12400.0 && net_taxable_income <= 12999.0) { return  288.0 + (net_taxable_income - 12399.0) * 0.045; }
					else if (net_taxable_income >= 13000.0 && net_taxable_income <= 13999.0) { return  315.0 + (net_taxable_income - 12999.0) * 0.045; }
					else if (net_taxable_income >= 14000.0 && net_taxable_income <= 14999.0) { return  360.0 + (net_taxable_income - 13999.0) * 0.045; }
					else if (net_taxable_income >= 15000.0 && net_taxable_income <= 15999.0) { return  405.0 + (net_taxable_income - 14999.0) * 0.045; }
					else if (net_taxable_income >= 16000.0 && net_taxable_income <= 16999.0) { return  450.0 + (net_taxable_income - 15999.0) * 0.045; }
					else if (net_taxable_income >= 17000.0 && net_taxable_income <= 17999.0) { return  495.0 + (net_taxable_income - 16999.0) * 0.045; }
					else if (net_taxable_income >= 18000.0 && net_taxable_income <= 18999.0) { return  540.0 + (net_taxable_income - 17999.0) * 0.045; }
					else if (net_taxable_income >= 19000.0 && net_taxable_income <= 19999.0) { return  585.0 + (net_taxable_income - 18999.0) * 0.045; }
					else if (net_taxable_income >= 20000.0 && net_taxable_income <= 20699.0) { return  630.0 + (net_taxable_income - 19999.0) * 0.045; }
					else if (net_taxable_income >= 20700.0 && net_taxable_income <= 20999.0) { return  662.0 + (net_taxable_income - 20699.0) * 0.06; }
					else if (net_taxable_income >= 21000.0 && net_taxable_income <= 21999.0) { return  680.0 + (net_taxable_income - 20999.0) * 0.06; }
					else if (net_taxable_income >= 22000.0 && net_taxable_income <= 22999.0) { return  740.0 + (net_taxable_income - 21999.0) * 0.06; }
					else if (net_taxable_income >= 23000.0 && net_taxable_income <= 23999.0) { return  800.0 + (net_taxable_income - 22999.0) * 0.06; }
					else if (net_taxable_income >= 24000.0 && net_taxable_income <= 24999.0) { return  860.0 + (net_taxable_income - 23999.0) * 0.06; }
					else if (net_taxable_income >= 25000.0 && net_taxable_income <= 25999.0) { return  920.0 + (net_taxable_income - 24999.0) * 0.06; }
					else if (net_taxable_income >= 26000.0 && net_taxable_income <= 26999.0) { return  980.0 + (net_taxable_income - 25999.0) * 0.06; }
					else if (net_taxable_income >= 27000.0 && net_taxable_income <= 27999.0) { return  1040.0 + (net_taxable_income - 26999.0) * 0.06; }
					else if (net_taxable_income >= 28000.0 && net_taxable_income <= 28999.0) { return  1100.0 + (net_taxable_income - 27999.0) * 0.06; }
					else if (net_taxable_income >= 29000.0 && net_taxable_income <= 29999.0) { return  1160.0 + (net_taxable_income - 28999.0) * 0.06; }
					else if (net_taxable_income >= 30000.0 && net_taxable_income <= 30999.0) { return  1220.0 + (net_taxable_income - 29999.0) * 0.06; }
					else if (net_taxable_income >= 31000.0 && net_taxable_income <= 31999.0) { return  1280.0 + (net_taxable_income - 30999.0) * 0.06; }
					else if (net_taxable_income >= 32000.0 && net_taxable_income <= 32999.0) { return  1340.0 + (net_taxable_income - 31999.0) * 0.06; }
					else if (net_taxable_income >= 33000.0 && net_taxable_income <= 33999.0) { return  1400.0 + (net_taxable_income - 32999.0) * 0.06; }
					else if (net_taxable_income >= 34000.0 && net_taxable_income <= 34599.0) { return  1460.0 + (net_taxable_income - 33999.0) * 0.06; }
					else { return 1469.0 + (net_taxable_income - 34599.0) * 0.07; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="77F38BD22B8E8CAB2D9DA5E5975D56F4" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def get_year(yr)
	        yr = yr.to_i
	        return Time.gm(yr).strftime("%Y")
	        rescue ArgumentError
		        case (yr.to_s.length)
			        when 2: "19" + '%02i' % yr
			        when 3: nil
			        when 4: yr.to_s
			        else nil
		        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function get_year(yr)
				{
					yr = yr.to_i().toString();

					switch (yr.length)
					{
						case 2: 
							return "19" + yr;
							break;
						case 4: 
							return yr;
							break;
						case 3:
						default:
							return nil;
							break;
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="ABF6A9FB060B95AE785D5D314BB79A82" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(status, taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case (status)
		        when ("two_and_five")
			        case (taxable_income)
				        when (0.01..16450.0): taxable_income * 0.04
				        when (16450.01..22600.0): ((taxable_income - 16450.0) * 0.045) + 658.0
				        when (22600.01..26750.0): ((taxable_income - 22600.0) * 0.0525) + 935.0
				        when (26750.01..41150.0): ((taxable_income - 26750.0) * 0.059) + 1153.0
				        when (41150.01..154350.0): ((taxable_income - 41150.0) * 0.0645) + 2002.0
				        when (154350.01..308750.0): ((taxable_income - 154350.0) * 0.0665) + 9304.0
				        when (308750.01..2058550.0): ((taxable_income - 308750.0) * 0.0685) + 19571.0
				        else ((taxable_income - 2058550.0) * 0.0882) + 139433.0
			        end
		        when ("one_and_three")
			        case (taxable_income)
				        when (0.01..8200.0): taxable_income * 0.04
				        when (8200.01..11300.0): ((taxable_income - 8200.0) * 0.045) + 328.0
				        when (11300.01..13350.0): ((taxable_income - 11300.0) * 0.0525) + 468.0
				        when (13350.01..20550.0): ((taxable_income - 13350.0) * 0.059) + 575.0
				        when (20550.01..77150.0): ((taxable_income - 20550.0) * 0.0645) + 1000.0
				        when (77150.01..205850.0): ((taxable_income - 77150.0) * 0.0665) + 4651.0
				        when (205850.01..1029250.0): ((taxable_income - 205850.0) * 0.0685) + 13209.0
				        else ((taxable_income - 1029250.0) * 0.0882) + 69612.0
			        end
		        when ("four")
			        case (taxable_income)
				        when (0.01..12350.0): taxable_income * 0.04
				        when (12350.01..16950.0): ((taxable_income - 12350.0) * 0.045) + 494.0
				        when (16950.01..20050.0): ((taxable_income - 16950.0) * 0.0525) + 701.0
				        when (20050.01..30850.0): ((taxable_income - 20050.0) * 0.059) + 864.0
				        when (30850.01..102900.0): ((taxable_income - 30850.0) * 0.0645) + 1501.0
				        when (102900.01..257300.0): ((taxable_income - 102900.0) * 0.0665) + 6148.0
				        when (257300.01..1543900.0): ((taxable_income - 257300.0) * 0.0685) + 16416.0
				        else ((taxable_income - 1543900.0) * 0.0882) + 104548.0
			        end
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(status, taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (status == "two_and_five")
					{
						if (taxable_income >= 0.01 && taxable_income <= 16450.0) { return taxable_income * 0.04; }
						else if (taxable_income >= 16450.01 && taxable_income <= 22600.0) { return ((taxable_income - 16450.0) * 0.045) + 658.0; }
						else if (taxable_income >= 22600.01 && taxable_income <= 26750.0) { return ((taxable_income - 22600.0) * 0.0525) + 935.0; }
						else if (taxable_income >= 26750.01 && taxable_income <= 41150.0) { return ((taxable_income - 26750.0) * 0.059) + 1153.0; }
						else if (taxable_income >= 41150.01 && taxable_income <= 154350.0) { return ((taxable_income - 41150.0) * 0.0645) + 2002.0; }
						else if (taxable_income >= 154350.01 && taxable_income <= 308750.0) { return ((taxable_income - 154350.0) * 0.0665) + 9304.0; }
						else if (taxable_income >= 308750.01 && taxable_income <= 2058550.0) { return ((taxable_income - 308750.0) * 0.0685) + 19571.0; }
						else { return ((taxable_income - 2058550.0) * 0.0882) + 139433.0; }
					}
					else if (status == "one_and_three")
					{
						if (taxable_income >= 0.01 && taxable_income <= 8200.0) { return taxable_income * 0.04; }
						else if (taxable_income >= 8200.01 && taxable_income <= 11300.0) { return ((taxable_income - 8200.0) * 0.045) + 328.0; }
						else if (taxable_income >= 11300.01 && taxable_income <= 13350.0) { return ((taxable_income - 11300.0) * 0.0525) + 468.0; }
						else if (taxable_income >= 13350.01 && taxable_income <= 20550.0) { return ((taxable_income - 13350.0) * 0.059) + 575.0; }
						else if (taxable_income >= 20550.01 && taxable_income <= 77150.0) { return ((taxable_income - 20550.0) * 0.0645) + 1000.0; }
						else if (taxable_income >= 77150.01 && taxable_income <= 205850.0) { return ((taxable_income - 77150.0) * 0.0665) + 4651.0; }
						else if (taxable_income >= 205850.01 && taxable_income <= 1029250.0) { return ((taxable_income - 205850.0) * 0.0685) + 13209.0; }
						else { return ((taxable_income - 1029250.0) * 0.0882) + 69612.0; }
					}
					else if (status == "four")
					{
						if (taxable_income >= 0.01 && taxable_income <= 12350.0) { return taxable_income * 0.04; }
						else if (taxable_income >= 12350.01 && taxable_income <= 16950.0) { return ((taxable_income - 12350.0) * 0.045) + 494.0; }
						else if (taxable_income >= 16950.01 && taxable_income <= 20050.0) { return ((taxable_income - 16950.0) * 0.0525) + 701.0; }
						else if (taxable_income >= 20050.01 && taxable_income <= 30850.0) { return ((taxable_income - 20050.0) * 0.059) + 864.0; }
						else if (taxable_income >= 30850.01 && taxable_income <= 102900.0) { return ((taxable_income - 30850.0) * 0.0645) + 1501.0; }
						else if (taxable_income >= 102900.01 && taxable_income <= 257300.0) { return ((taxable_income - 102900.0) * 0.0665) + 6148.0; }
						else if (taxable_income >= 257300.01 && taxable_income <= 1543900.0) { return ((taxable_income - 257300.0) * 0.0685) + 16416.0; }
						else { return ((taxable_income - 1543900.0) * 0.0882) + 104548.0; }
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="C31DF4CA2D99E7C4291EE06AEA39F51B" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(status, taxable_income)
	        return 0.0 unless (taxable_income > 0.0)
	        case (status)
		        when ("two_and_five")
			        case (taxable_income)
				        when (0.01..16700.0): taxable_income * 0.04
				        when (16700.01..22950.0): ((taxable_income - 16700.0) * 0.045) + 668.0
				        when (22950.01..27150.0): ((taxable_income - 22950.0) * 0.0525) + 949.0
				        when (27150.01..41800.0): ((taxable_income - 27150.0) * 0.059) + 1170.0
				        when (41800.01..156900.0): ((taxable_income - 41800.0) * 0.0645) + 2034.0
				        when (156900.01..313850.0): ((taxable_income - 156900.0) * 0.0665) + 9458.0
				        when (313850.01..2092800.0): ((taxable_income - 313850.0) * 0.0685) + 19895.0
				        else ((taxable_income - 2092800.0) * 0.0882) + 141753.0
			        end
		        when ("one_and_three")
			        case (taxable_income)
				        when (0.01..8300.0): taxable_income * 0.04
				        when (8300.01..11450.0): ((taxable_income - 8300.0) * 0.045) + 332.0
				        when (11450.01..13550.0): ((taxable_income - 11450.0) * 0.0525) + 474.0
				        when (13550.01..20850.0): ((taxable_income - 13550.0) * 0.059) + 584.0
				        when (20850.01..78400.0): ((taxable_income - 20850.0) * 0.0645) + 1015.0
				        when (78400.01..209250.0): ((taxable_income - 78400.0) * 0.0665) + 4727.0
				        when (209250.01..1046350.0): ((taxable_income - 209250.0) * 0.0685) + 13428.0
				        else ((taxable_income - 1046350.0) * 0.0882) + 70770.0
			        end
		        when ("four")
			        case (taxable_income)
				        when (0.01..12550.0): taxable_income * 0.04
				        when (12550.01..17200.0): ((taxable_income - 12550.0) * 0.045) + 502.0
				        when (17200.01..20350.0): ((taxable_income - 17200.0) * 0.0525) + 711.0
				        when (20350.01..31350.0): ((taxable_income - 20350.0) * 0.059) + 877.0
				        when (31350.01..104600.0): ((taxable_income - 31350.0) * 0.0645) + 1526.0
				        when (104600.01..261550.0): ((taxable_income - 104600.0) * 0.0665) + 6250.0
				        when (261550.01..1569550.0): ((taxable_income - 261550.0) * 0.0685) + 16687.0
				        else ((taxable_income - 1569550.0) * 0.0882) + 106285.0
			        end
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(status, taxable_income)
				{
					if (taxable_income <= 0.0)
					{
						return 0.0;
					}

					if (status == "two_and_five")
					{
						if (taxable_income >= 0.01 && taxable_income <= 16700.0) { return taxable_income * 0.04; }
						else if (taxable_income >= 16700.01 && taxable_income <= 22950.0) { return ((taxable_income - 16700.0) * 0.045) + 668.0; }
						else if (taxable_income >= 22950.01 && taxable_income <= 27150.0) { return ((taxable_income - 22950.0) * 0.0525) + 949.0; }
						else if (taxable_income >= 27150.01 && taxable_income <= 41800.0) { return ((taxable_income - 27150.0) * 0.059) + 1170.0; }
						else if (taxable_income >= 41800.01 && taxable_income <= 156900.0) { return ((taxable_income - 41800.0) * 0.0645) + 2034.0; }
						else if (taxable_income >= 156900.01 && taxable_income <= 313850.0) { return ((taxable_income - 156900.0) * 0.0665) + 9458.0; }
						else if (taxable_income >= 313850.01 && taxable_income <= 2092800.0) { return ((taxable_income - 313850.0) * 0.0685) + 19895.0; }
						else { return ((taxable_income - 2092800.0) * 0.0882) + 141753.0; }
					}
					else if (status == "one_and_three")
					{
						if (taxable_income >= 0.01 && taxable_income <= 8300.0) { return taxable_income * 0.04; }
						else if (taxable_income >= 8300.01 && taxable_income <= 11450.0) { return ((taxable_income - 8300.0) * 0.045) + 332.0; }
						else if (taxable_income >= 11450.01 && taxable_income <= 13550.0) { return ((taxable_income - 11450.0) * 0.0525) + 474.0; }
						else if (taxable_income >= 13550.01 && taxable_income <= 20850.0) { return ((taxable_income - 13550.0) * 0.059) + 584.0; }
						else if (taxable_income >= 20850.01 && taxable_income <= 78400.0) { return ((taxable_income - 20850.0) * 0.0645) + 1015.0; }
						else if (taxable_income >= 78400.01 && taxable_income <= 209250.0) { return ((taxable_income - 78400.0) * 0.0665) + 4727.0; }
						else if (taxable_income >= 209250.01 && taxable_income <= 1046350.0) { return ((taxable_income - 209250.0) * 0.0685) + 13428.0; }
						else { return ((taxable_income - 1046350.0) * 0.0882) + 70770.0; }
					}
					else if (status == "four")
					{
						if (taxable_income >= 0.01 && taxable_income <= 12550.0) { return taxable_income * 0.04; }
						else if (taxable_income >= 12550.01 && taxable_income <= 17200.0) { return ((taxable_income - 12550.0) * 0.045) + 502.0; }
						else if (taxable_income >= 17200.01 && taxable_income <= 20350.0) { return ((taxable_income - 17200.0) * 0.0525) + 711.0; }
						else if (taxable_income >= 20350.01 && taxable_income <= 31350.0) { return ((taxable_income - 20350.0) * 0.059) + 877.0; }
						else if (taxable_income >= 31350.01 && taxable_income <= 104600.0) { return ((taxable_income - 31350.0) * 0.0645) + 1526.0; }
						else if (taxable_income >= 104600.01 && taxable_income <= 261550.0) { return ((taxable_income - 104600.0) * 0.0665) + 6250.0; }
						else if (taxable_income >= 261550.01 && taxable_income <= 1569550.0) { return ((taxable_income - 261550.0) * 0.0685) + 16687.0; }
						else { return ((taxable_income - 1569550.0) * 0.0882) + 106285.0; }
					}
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="8E04A9ADE80666DC0677DB06DD96FEAD" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(amount)
	        amount = amount.to_f
	        return 0.0 unless (amount > 0.0)
	        case (amount)
		        when (0.01..2800.0): (amount * 0.01)
		        when (2800.01..4900.0): (amount * 0.02) - 28.0
		        when (4900.01..7400.0): (amount * 0.03) - 77.0
		        when (7400.01..10100.0): (amount * 0.04) - 151.0
		        when (10100.01..13000.0): (amount * 0.05) - 252.0
		        when (13000.01..16700.0): (amount * 0.06) - 382.0
		        else (amount * 0.069) - 532.0
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					amount = amount.to_f();

					if (amount <= 0.0)
					{
						return 0.0;
					}

					if (amount >= 0.01 && amount <= 2800.0) { return (amount * 0.01); }
					else if (amount >= 2800.01 && amount <= 4900.0) { return (amount * 0.02) - 28.0; }
					else if (amount >= 4900.01 && amount <= 7400.0) { return (amount * 0.03) - 77.0; }
					else if (amount >= 7400.01 && amount <= 10100.0) { return (amount * 0.04) - 151.0; }
					else if (amount >= 10100.01 && amount <= 13000.0) { return (amount * 0.05) - 252.0; }
					else if (amount >= 13000.01 && amount <= 16700.0) { return (amount * 0.06) - 382.0; }
					else { return (amount * 0.069) - 532.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="AF17A7A2F5DA989340861F1D5045F982" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)
	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        #
			        # Correct the Coupon due dates so that they do not fall on a weekend.
			        # t.wday == 6 is Saturday, Sunday == 0.
			        #
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        #
	        # Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        # in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        # out different from the chart in the instructions, put in the computed due month, day and year
	        # which showed as wrong and adjust the day to match the chart.
	        #		
	 
               #-###########################################################
               #IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
               #-###########################################################
               #Each year when this form comes through the voucher number and year ending must be entered and checked
               #in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
               #dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
               #-###########################################################

                #This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        #In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        #year of the due date showing on the form in the variables below. In the variable labeled due_day
	        #set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        #is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

	        #
	        # Note 09/30/14: Offset below is for Martin Luther King Day holiday which needed to be adjusted 
	        # from 01/16/2017 to 01/17/2017.
	        #
	        if ((due_mon == 1) and (due_day == 16) and (due_year == 2017))
		        due_day = 17
	        end
	
	        #
	        # Prepare due date for return - string with no '/'s.
	        #
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
		    function compute_due_date(id, mon_end, year_end, coupon)
		    {
			    var coupon_intervals = [4, 6, 9, 12, 4];
			    var liability_intervals = [3, 6, 9, 12, 12];
			    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

			    // Check arguments first.
			    if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
			    {
				    return '00000000';
			    }

			    year_end = year_end.to_i();

			    //We will index into the interval arrays with this.
			    var coupon_adj = coupon - 1;

			    var year_adj;
			    var mon_adj;
			    var due_year;
			    var mod_mon;
			    var due_mon;
			    var due_day;
			    if (id == 1)
			    {
				    // Computing Liability Due Date. These fall on the last day of the month.
				    year_adj = year_end - 1;
				    mon_adj = mon_end + liability_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = ( mod_mon > 0 ? mod_mon : 12);
				    if (due_mon == 2)
				    {
					    due_day = (is_leap_year(due_year) ? 29 : 28);
				    }
				    else 
				    {
					    due_day = days_in_month[due_mon - 1];
				    }
			    }
			    else if (id == 2)
			    {
				    // Computing Coupon Due Date.
				    year_adj = (coupon < 5 ? year_end - 1 : year_end);
				    mon_adj = mon_end + coupon_intervals[coupon_adj];
				    due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
				    mod_mon = mon_adj % 12;
				    due_mon = (mod_mon > 0 ? mod_mon : 12);
				    due_day = (coupon < 5 ? 20 : 15);

				    // Correct the Coupon due dates so that they do not fall on a weekend.
				    // t.wday == 6 is Saturday, Sunday == 0.
				    var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
				    if (t.wday() == 6)
				    {
					    due_day += 2;
				    }
				    else if (t.wday() == 0)
				    {
					    due_day += 1;
				    }
			    }

			    // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
			    // in future years (or an algorithm could be written for it). Test the due dates and if one comes
			    // out different from the chart in the instructions, put in the computed due month, day and year
			    // which showed as wrong and adjust the day to match the chart.

			    //-###########################################################
			    //IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
			    //-###########################################################
			    //Each year when this form comes through the voucher number and year ending must be entered and checked
			    //in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
			    //dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
			    //-###########################################################

			    //This offsets the due day for individual due dates that come up incorrect because of a holiday. 
			    //In the algorithm below, using the due date that is showing on the form, put the month, date, and
			    //year of the due date showing on the form in the variables below. In the variable labeled due_day
			    //set the day equal to the correct day that is showing in the specs. For example, if the due day that
			    //is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

			    // Note 09/30/14: Offset below is for Martin Luther King Day holiday which needed to be adjusted 
			    // from 01/16/2017 to 01/17/2017.
			    if ((due_mon == 1) && (due_day == 16) && (due_year == 2017))
			    {
				    due_day = 17;
			    }

			    // Prepare due date for return - string with no '/'s.
			    return due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
		    }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="0DC5B666DAB4401C95074B959BC8BCE7" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def get_due_date(mm_yr, vch_num)
	        return "" unless ((0..3) === vch_num)
	        case (mm_yr)
		        when ("1215"): ["04-01-2015","06-16-2015","09-15-2015","12-15-2015"][vch_num]
		        when ("0116"): ["05-01-2015","07-15-2015","10-15-2015","01-15-2016"][vch_num]
		        when ("0216"): ["06-02-2015","08-14-2015","11-17-2015","02-17-2016"][vch_num]
		        when ("0316"): ["07-01-2015","09-15-2015","12-15-2015","03-16-2016"][vch_num]
		        when ("0416"): ["07-31-2015","10-15-2015","01-15-2016","04-15-2016"][vch_num]
		        when ("0516"): ["09-02-2015","11-17-2015","02-17-2016","05-13-2016"][vch_num]
		        when ("0616"): ["10-01-2015","12-15-2015","03-16-2016","06-15-2016"][vch_num]
		        when ("0716"): ["11-03-2015","01-15-2016","04-15-2016","07-15-2016"][vch_num]
		        when ("0816"): ["12-01-2015","02-17-2016","05-13-2016","08-17-2016"][vch_num]
		        when ("0916"): ["12-31-2015","03-16-2016","06-15-2016","09-15-2016"][vch_num]
		        when ("1016"): ["02-02-2016","04-15-2016","07-15-2016","10-14-2016"][vch_num]
		        when ("1116"): ["03-02-2016","05-13-2016","08-17-2016","11-16-2016"][vch_num]
		        else ""
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function get_due_date(mm_yr, vch_num)
				{
                           var result = "";

					if (vch_num >= 0 && vch_num <= 3)
					{
					if (mm_yr == "1215") { result = ["04-01-2015","06-16-2015","09-15-2015","12-15-2015"][vch_num]; }
					else if (mm_yr == "0116") { result = ["05-01-2015","07-15-2015","10-15-2015","01-15-2016"][vch_num]; }
					else if (mm_yr == "0216") { result = ["06-02-2015","08-14-2015","11-17-2015","02-17-2016"][vch_num]; }
					else if (mm_yr == "0316") { result = ["07-01-2015","09-15-2015","12-15-2015","03-16-2016"][vch_num]; }
					else if (mm_yr == "0416") { result = ["07-31-2015","10-15-2015","01-15-2016","04-15-2016"][vch_num]; }
					else if (mm_yr == "0516") { result = ["09-02-2015","11-17-2015","02-17-2016","05-13-2016"][vch_num]; }
					else if (mm_yr == "0616") { result = ["10-01-2015","12-15-2015","03-16-2016","06-15-2016"][vch_num]; }
					else if (mm_yr == "0716") { result = ["11-03-2015","01-15-2016","04-15-2016","07-15-2016"][vch_num]; }
					else if (mm_yr == "0816") { result = ["12-01-2015","02-17-2016","05-13-2016","08-17-2016"][vch_num]; }
					else if (mm_yr == "0916") { result = ["12-31-2015","03-16-2016","06-15-2016","09-15-2016"][vch_num]; }
					else if (mm_yr == "1016") { result = ["02-02-2016","04-15-2016","07-15-2016","10-14-2016"][vch_num]; }
					else if (mm_yr == "1116") { result = ["03-02-2016","05-13-2016","08-17-2016","11-16-2016"][vch_num]; }
					else { result = ""; }
                           }

                           return result;
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="B71B91EBF84C5FE9A50F4933DE267899" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)
	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        #
			        # Correct the Coupon due dates so that they do not fall on a weekend.
			        # t.wday == 6 is Saturday, Sunday == 0.
			        #
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        #
	        # Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        # in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        # out different from the chart in the instructions, put in the computed due month, day and year
	        # which showed as wrong and adjust the day to match the chart.
	        #		
	 
               #-###########################################################
               #IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
               #-###########################################################
               #Each year when this form comes through the voucher number and year ending must be entered and checked
               #in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
               #dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
               #-###########################################################

                #This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        #In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        #year of the due date showing on the form in the variables below. In the variable labeled due_day
	        #set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        #is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

	        #
	        # Note 09/30/14: Offset below is for Susan B Anthony's birthday holiday which needed to adjusted from
	        # 02/15/2016 to 02/16/2016.
	        #
	        if ((due_mon == 2) and (due_day == 15) and (due_year == 2016))
		        due_day = 16
	        end
	
	        #
	        # Prepare due date for return - string with no '/'s.
	        #
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
			  function compute_due_date(id, mon_end, year_end, coupon)
			  {
				  var coupon_intervals = [4, 6, 9, 12, 4];
				  var liability_intervals = [3, 6, 9, 12, 12];
				  var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

				  // Check arguments first.
				  if (!((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
				  {
					  return '00000000';
				  }

				  year_end = year_end.to_i();

				  //We will index into the interval arrays with this.
				  var coupon_adj = coupon - 1;

				  var year_adj;
				  var mon_adj;
				  var due_year;
				  var mod_mon;
				  var due_mon;
				  var due_day;
				  if (id == 1)
				  {
					  // Computing Liability Due Date. These fall on the last day of the month.
					  year_adj = year_end - 1;
					  mon_adj = mon_end + liability_intervals[coupon_adj];
					  due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
					  mod_mon = mon_adj % 12;
					  due_mon = ( mod_mon > 0 ? mod_mon : 12);
					  if (due_mon == 2)
					  {
						  due_day = (is_leap_year(due_year) ? 29 : 28);
					  }
					  else 
					  {
						  due_day = days_in_month[due_mon - 1];
					  }
				  }
				  else if (id == 2)
				  {
					  // Computing Coupon Due Date.
					  year_adj = (coupon < 5 ? year_end - 1 : year_end);
					  mon_adj = mon_end + coupon_intervals[coupon_adj];
					  due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
					  mod_mon = mon_adj % 12;
					  due_mon = (mod_mon > 0 ? mod_mon : 12);
					  due_day = (coupon < 5 ? 20 : 15);

					  // Correct the Coupon due dates so that they do not fall on a weekend.
					  // t.wday == 6 is Saturday, Sunday == 0.
					  var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
					  if (t.wday() == 6)
					  {
						  due_day += 2;
					  }
					  else if (t.wday() == 0)
					  {
						  due_day += 1;
					  }
				  }

				  // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
				  // in future years (or an algorithm could be written for it). Test the due dates and if one comes
				  // out different from the chart in the instructions, put in the computed due month, day and year
				  // which showed as wrong and adjust the day to match the chart.

				  //-###########################################################
				  //IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
				  //-###########################################################
				  //Each year when this form comes through the voucher number and year ending must be entered and checked
				  //in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
				  //dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
				  //-###########################################################

				  //This offsets the due day for individual due dates that come up incorrect because of a holiday. 
				  //In the algorithm below, using the due date that is showing on the form, put the month, date, and
				  //year of the due date showing on the form in the variables below. In the variable labeled due_day
				  //set the day equal to the correct day that is showing in the specs. For example, if the due day that
				  //is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

				  // Note 09/30/14: Offset below is for Susan B Anthony's birthday holiday which needed to adjusted from
				  // 02/15/2016 to 02/16/2016.
				  if ((due_mon == 2) && (due_day == 15) && (due_year == 2016))
				  {
					  due_day = 16;
				  }

				  // Prepare due date for return - string with no '/'s.
				  return due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
			  }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="9FCD5FFEA588672252FEE674BD1098A6" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def get_addr_and_overflow_version2(mail_len, over_len, *units)
	        #-######################################################
	        #
	        # This method is for building the NYS 2D 'Mailing Address' and 'Mailing Address Overflow' fields.
	        # NY told us they are having problems with the way vendors are populating the 'Mailing Address
	        # Overflow' field in their 2Ds. They want us to follow the MeF standard [Modernized E-File] regarding this.
	        # We were just appending the address fields on the document and simply truncating at the length for
	        # 'Mailing Address' and inserting what is left over, if anything, to the 'Mailing Address Overflow'
	        # field, which is a common technique we employ for other 2D address fields. Well, NY wants
	        # 'logical breaks' in the adress fields [the MeF part], so a street address with an apartment number would
	        # be split such that the apartment portion would go to the overflow field, or we could keep the two parts
	        # together and insert into the 'Mailing Address' field IF there is room. DAS has an email showing examples.
	        #
	        # First: This method is written to handle TWO 2D address fields where the first field is the 'Mailing Address'
	        # 	    field, the second field is the 'Mailing Address Overflow' field. We will need to revisit this method in
	        #	    case they change this.
	        #
	        # Second: NY calls values that can not be split 'logical units' which we adopt here. A logical unit is something
	        # 	     like an apartment number such as "Apt 12". We set these forms up so that the logical units are separate
	        #	     address boxes which helps us here rather than trying to parse the address data which would be a nightmare.
	        #	     Logical units can be boxes or can be a string such as a country abbreviation, "CA" for Canada as an example.
	        #	     The calling code sets the logical units.
	        #
	        # Third: This routine can handle multiple logical units, it is not dependent on the number.
	        #
	        # Fourth: We have a set of rules that we are following based on feedback from NY - emails, approval results, phone
	        #	     conversations.
	        #
	        # 1) The first unit MUST be the main address box on the document. This is the one unit we are allowed to split on
	        #     white space.
	        # 2) We can NOT split the other units.
	        #
	        # Inputs:
	        #
	        # mail_len: This is the number of characters allowed in the 2D 'Mailing Address' field.
	        # over_len: This is  number of characters allowed in the 2D 'Mailing Address Overflow' field.
	        # *units: The array of logical units to process. This array can vary in the number of logical units.
	        #
	        # Returns: A two element string array, first element is for the 'Mailing Address' 2D field, the second element is for the
	        #	'Mailing Address Overflow' 2D field.
	        #
	        # Calling this method - Example: Note that we use parallel assignment in setting our variables.
	        #
	        # mail_addr, mail_addr_over = get_addr_and_version2(30, 30, box1_1, box1_2)
	        #
	        # The above example would result in *units being a two element array since we passed it 2 boxes.
	        #
	        # Logic:
	        #
	        # We first remove from the units array any empty units, while noting if the first unit is empty before we remove it.
	        # We need to know this since we can only split the first unit, and if we remove the first unit because it is empty, we
	        # would have a NEW first unit if the other units are not empty.
	        #
	        # We then .join ALL units and check if that string fits in 'Mailing Address' using the associated allowable length. If the
	        # string does not fit, we chop off the LAST unit, and re-check. If the string fits, we move on to the second 2D field for
	        # the overflow chars. We repeatedly work down, chopping off units at the end, all the way until we can either fit or not.
	        # If we are left with just the first unit in the string, we determine if we can split or not, remember that we may have
	        # removed the first unit at the start IF it was empty. If we can split on a white space char we do, else we are done and they
	        # get nothing.
	        #
	        # Next we process the overflow field. We determine IF we split the first unit above, if so, we grab the LEFTOVER
	        # characters in the first unit. We then append to any leftover chars the units that were chopped off while trying to fit
	        # into the 'Mailing Address' field. We can not split these units, so we append until we can no longer fit and use the portion
	        # that does fit, any units that do not fit are ignored.
	        #
	        #-######################################################

	        # Set to true IF the first unit is empty. We can only split the first unit since that is reserved for
	        # the main address box.
	        can_split = true

	        # We build these and return them. 'Mail Address' and 'Mail Address Overflow'.
	        mail_addr = over_addr = ""

	        # Need to do this since units is passed as an array, the Ruby interpretor will not flag missing units.
	        return [mail_addr, over_addr] unless (units.length > 0)

	        # We set this here since we delete empty units before we process them.
	        can_split = false if (units[0].empty?)

	        # Now delete any empty units.
	        units.delete_if { |box| box.empty? }

	        # Again, we return if no units after deleting emptys. Each box is considered a logical unit [NY's terminology].
	        return [mail_addr, over_addr] unless ((num_units = units.length) > 0)

	        # split_leftover holds the leftover chars IF we have to split the FIRST unit [i.e. units[0]].
	        split_leftover = ''
	        unit_str = ''

	        # Our default value.
	        num_copy = 1

	        # Whitespace index.
	        ws_index = nil

	        #
	        # One thing to keep in mind about indices and lengths: string indices start at 0, so an index value of 2 translates to
	        # 3 characters counting from the first index of zero, and the 3rd character is at index 2. So mail_len - 1 as an index
	        # is the full width of the 2D field [from index 0] which holds mail_len characters.
	        #
	        # Our first task is to set the mail_addr. We use .downto based on num_units so the FIRST pass includes
	        # all units in the string, if the string does not fit we rebuild using the number of units specified by loop
	        # var 'num', which is decremented by one for each pass.
	        #
	        num_units.downto(1) do |num|

		        # Build the string to see if it will fit in the mail_addr field, each unit separated by a space char.
		        unit_str = units[0,num].join(" ").squeeze(" ").strip

		        if (unit_str.length > mail_len)

			        unless (num > 1)

				        if (can_split)

					        #
					        # We are on the FIRST unit and it does not fit, so we will attempt to break it at a
					        # word boundary. The unlikely scenario where there are no whitespace characters
					        # would result in returning blank 'Mailing Address' and 'Mailing Address Overflow'
					        # strings since NY does not want a blatant truncation. Note that ws_index is only used
					        # for the FIRST unit, since our rule is that we can only split on the first unit/box.
					        #
					        if (unit_str[mail_len - 1,1] =~ /\S/)
			
						        #
						        # We have a non white space character at index mail_len - 1. We first check if there
						        # is a white space char at index position mail_len, if true, we split at index mail_len - 1.
						        # If not true, we then 'backup' in the string until we see a white space character and set
						        # our whitespace index var ws_index accordingly. If we can not find a whitespace char,
						        # .rindex will return a nil value, which we check for further below.
						        #
						        ws_index = (unit_str[mail_len,1] =~ /\s/ ? mail_len - 1 : unit_str[0,mail_len].rindex(/\s/))
					        else
						        # The address string at index position mail_len - 1 has a white space character.
						        ws_index = mail_len - 1
					        end

					        if (ws_index)

						        # We could split the first unit. Set mail_addr and any leftover portion.
						        mail_addr = unit_str[0, ws_index + 1]
						        split_leftover = unit_str[ws_index + 1, unit_str.length - (ws_index + 1)]
					        end
				        end
			        end
		        else
			        # unit_str fits in the 2D 'Mailing Address' field.
			        mail_addr = unit_str

			        # We are done with mail_addr, we retain the value of num for processing over_addr.
			        num_copy = num
			        break
		        end
	        end

	        # No sense continuing if we could not set mail_addr, else we try to set over_addr.
	        if (mail_addr.length > 0)

		        #
		        # We set num_copy above, it is where we were when we set mail_addr else we use the default value set at
		        # the start of this method which would be the case where we ran all the way down to the first unit while 
		        # trying to fit into mail_addr. We now run thru the units that have not been inserted into mail_addr, FIRST 
		        # taking into account any chars in split_leftover if we split unit one.
		        #
		        unless (split_leftover.length > over_len)

			        unit_str = split_leftover

			        #
			        # We run now from the lower to the higher unit numbers. This loop will not run IF num_copy equals
			        # num_units since we are adding 1.
			        #
			        (num_copy + 1).upto(num_units) do |num|

				        # Plus 1 for the added space char between parts IF unit_str has characters in it.
				        if ((unit_str.length + units[num-1].length + (unit_str.length > 0 ? 1 : 0)) > over_len)

					        break
				        else
					        unit_str += ((unit_str.length > 0 ? ' ' : '') + units[num-1])
				        end
			        end

			        over_addr = unit_str.squeeze(" ")
		        end
	        end

	        # Return the mailing and overflow addresses via an array.
	        [mail_addr, over_addr]
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function get_addr_and_overflow_version2(mail_len, over_len, units)
				{
					//-######################################################
					//
					// This method is for building the NYS 2D 'Mailing Address' and 'Mailing Address Overflow' fields.
					// NY told us they are having problems with the way vendors are populating the 'Mailing Address
					// Overflow' field in their 2Ds. They want us to follow the MeF standard [Modernized E-File] regarding this.
					// We were just appending the address fields on the document and simply truncating at the length for
					// 'Mailing Address' and inserting what is left over, if anything, to the 'Mailing Address Overflow'
					// field, which is a common technique we employ for other 2D address fields. Well, NY wants
					// 'logical breaks' in the adress fields [the MeF part], so a street address with an apartment number would
					// be split such that the apartment portion would go to the overflow field, or we could keep the two parts
					// together and insert into the 'Mailing Address' field IF there is room. DAS has an email showing examples.
					//
					// First: This method is written to handle TWO 2D address fields where the first field is the 'Mailing Address'
					// 	    field, the second field is the 'Mailing Address Overflow' field. We will need to revisit this method in
					//	    case they change this.
					//
					// Second: NY calls values that can not be split 'logical units' which we adopt here. A logical unit is something
					// 	     like an apartment number such as "Apt 12". We set these forms up so that the logical units are separate
					//	     address boxes which helps us here rather than trying to parse the address data which would be a nightmare.
					//	     Logical units can be boxes or can be a string such as a country abbreviation, "CA" for Canada as an example.
					//	     The calling code sets the logical units.
					//
					// Third: This routine can handle multiple logical units, it is not dependent on the number.
					//
					// Fourth: We have a set of rules that we are following based on feedback from NY - emails, approval results, phone
					//	     conversations.
					//
					// 1) The first unit MUST be the main address box on the document. This is the one unit we are allowed to split on
					//     white space.
					// 2) We can NOT split the other units.
					//
					// Inputs:
					//
					// mail_len: This is the number of characters allowed in the 2D 'Mailing Address' field.
					// over_len: This is  number of characters allowed in the 2D 'Mailing Address Overflow' field.
					// *units: The array of logical units to process. This array can vary in the number of logical units.
					//
					// Returns: A two element string array, first element is for the 'Mailing Address' 2D field, the second element is for the
					//	'Mailing Address Overflow' 2D field.
					//
					// Calling this method - Example: Note that we use parallel assignment in setting our variables.
					//
					// mail_addr, mail_addr_over = get_addr_and_version2(30, 30, box1_1, box1_2)
					//
					// The above example would result in *units being a two element array since we passed it 2 boxes.
					//
					// Logic:
					//
					// We first remove from the units array any empty units, while noting if the first unit is empty before we remove it.
					// We need to know this since we can only split the first unit, and if we remove the first unit because it is empty, we
					// would have a NEW first unit if the other units are not empty.
					//
					// We then .join ALL units and check if that string fits in 'Mailing Address' using the associated allowable length. If the
					// string does not fit, we chop off the LAST unit, and re-check. If the string fits, we move on to the second 2D field for
					// the overflow chars. We repeatedly work down, chopping off units at the end, all the way until we can either fit or not.
					// If we are left with just the first unit in the string, we determine if we can split or not, remember that we may have
					// removed the first unit at the start IF it was empty. If we can split on a white space char we do, else we are done and they
					// get nothing.
					//
					// Next we process the overflow field. We determine IF we split the first unit above, if so, we grab the LEFTOVER
					// characters in the first unit. We then append to any leftover chars the units that were chopped off while trying to fit
					// into the 'Mailing Address' field. We can not split these units, so we append until we can no longer fit and use the portion
					// that does fit, any units that do not fit are ignored.
					//
					//-######################################################

					// Set to true IF the first unit is empty. We can only split the first unit since that is reserved for
					// the main address box.
					var can_split = true;

					// We build these and return them. 'Mail Address' and 'Mail Address Overflow'.
					var mail_addr = "";
					var over_addr = "";

					// Need to do this since units is passed as an array, the Ruby interpretor will not flag missing units.
					if (units.length <= 0)
					{
						return [mail_addr, over_addr];
					}

					// We set this here since we delete empty units before we process them.
					if (units[0].isEmpty())
					{
						can_split = false;
					}

					// Now delete any empty units.
					for (var idx = units.length - 1; idx >= 0; idx--)
					{
						if (units[idx].isEmpty())
						{
							units.splice(idx, 1);
						}
					}

					// Again, we return if no units after deleting emptys. Each box is considered a logical unit [NY's terminology].
					var num_units = units.length;
					if (num_units <= 0)
					{
						return [mail_addr, over_addr];
					}

					// split_leftover holds the leftover chars IF we have to split the FIRST unit [i.e. units[0]].
					var split_leftover = '';
					var unit_str = '';

					// Our default value.
					var num_copy = 1;

					// Whitespace index.
					var ws_index = null;
          var num = 0;
          
					// One thing to keep in mind about indices and lengths: string indices start at 0, so an index value of 2 translates to
					// 3 characters counting from the first index of zero, and the 3rd character is at index 2. So mail_len - 1 as an index
					// is the full width of the 2D field [from index 0] which holds mail_len characters.
					//
					// Our first task is to set the mail_addr. We use .downto based on num_units so the FIRST pass includes
					// all units in the string, if the string does not fit we rebuild using the number of units specified by loop
					// var 'num', which is decremented by one for each pass.
					for (num = num_units; num >= 1; num--)
					{
						// Build the string to see if it will fit in the mail_addr field, each unit separated by a space char.
						unit_str = "";
						for (var cnt = 0; cnt <= num; cnt++)
						{
							unit_str += " " + units[cnt];
						}
						unit_str = unit_str.squeeze(" ").trim();

						if (unit_str.length > mail_len)
						{
							if (num <= 0)
							{
								if (can_split)
								{
									// We are on the FIRST unit and it does not fit, so we will attempt to break it at a
									// word boundary. The unlikely scenario where there are no whitespace characters
									// would result in returning blank 'Mailing Address' and 'Mailing Address Overflow'
									// strings since NY does not want a blatant truncation. Note that ws_index is only used
									// for the FIRST unit, since our rule is that we can only split on the first unit/box.
									if (/\S/.test(unit_str.substring(mail_len - 1, 1)))
									{
										// We have a non white space character at index mail_len - 1. We first check if there
										// is a white space char at index position mail_len, if true, we split at index mail_len - 1.
										// If not true, we then 'backup' in the string until we see a white space character and set
										// our whitespace index var ws_index accordingly. If we can not find a whitespace char,
										// .rindex will return a nil value, which we check for further below.
										ws_index = (/\s/.test(unit_str.substring(mail_len, 1)) ? mail_len - 1 : unit_str.substring(0, mail_len).lastIndexOf(' '));
									}
									else
									{
										// The address string at index position mail_len - 1 has a white space character.
										ws_index = mail_len - 1;
									}

									if (ws_index)
									{
										// We could split the first unit. Set mail_addr and any leftover portion.
										mail_addr = unit_str.substring(0, ws_index + 1);
										split_leftover = unit_str.substring(ws_index + 1, unit_str.length - (ws_index + 1));
									}
								}
							}
						}
						else
						{
							// unit_str fits in the 2D 'Mailing Address' field.
							mail_addr = unit_str;

							// We are done with mail_addr, we retain the value of num for processing over_addr.
							num_copy = num;
							break;
						}
					}

					// No sense continuing if we could not set mail_addr, else we try to set over_addr.
					if (mail_addr.length > 0)
					{
						// We set num_copy above, it is where we were when we set mail_addr else we use the default value set at
						// the start of this method which would be the case where we ran all the way down to the first unit while 
						// trying to fit into mail_addr. We now run thru the units that have not been inserted into mail_addr, FIRST 
						// taking into account any chars in split_leftover if we split unit one.
						if (split_leftover.length <= over_len)
						{
							unit_str = split_leftover;
							
							// We run now from the lower to the higher unit numbers. This loop will not run IF num_copy equals
							// num_units since we are adding 1.
							for (num = num_copy + 1; num <= num_units; num++)
							{
								// Plus 1 for the added space char between parts IF unit_str has characters in it.
								if ((unit_str.length + units[num-1].length + (unit_str.length > 0 ? 1 : 0)) > over_len)
								{
									break;
								}
								else
								{
									unit_str += ((unit_str.length > 0 ? ' ' : '') + units[num]);
								}
							}

							over_addr = unit_str.squeeze(" ");
						}
					}

					// Return the mailing and overflow addresses via an array.
					return [mail_addr, over_addr];
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="5DAC29399BEE7894A4FBF20515396266" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)
	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1

	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)
			
			        #Correct the Coupon due dates so that they do not fall on a weekend.
			        #t.wday == 6 is Saturday, Sunday == 0.
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        #Check for certain dates to conform to the specs. The holiday dates will
	        #need to be adjusted in future years (or an algorithm could be written for it).
	        #Test the due dates and if one comes out different from the chart in the instructions, put in the computed due month, day
	        #and year which showed as wrong and adjust the day to match the chart.
	        #Example, the due date for the year ending 09/2011 for the extension voucher (coupon 5) comes out to 01/16/2012 which
	        #doesn't match the chart date.  So 1, 16, 2012 are entered on the if line and the due_day is changed to 17.
	        if ((due_mon == 1) and (due_day == 16) and (due_year == 2012))
		        due_day = 17
	        end
	        #02/21/2011 is returned in several charts (02/2011, 05/2011, 08/2011, 10/2011) and it needs to return 02/22/2011.  This
	        #code fixes all of them.
	        if ((due_mon == 2) and (due_day == 21) and (due_year == 2011))
		        due_day = 22
	        end	
	        #Prepare due date for return - string with no '/'s.
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_due_date(id, mon_end, year_end, coupon) {
    var coupon_intervals = [4, 6, 9, 12, 4];
    var liability_intervals = [3, 6, 9, 12, 12];
    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
    var result = '00000000';
    // Check arguments first.
    if ((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)) {

        year_end = year_end.to_i();

        // We will index into the interval arrays with this.
        var coupon_adj = coupon - 1;

        var year_adj;
        var mon_adj;
        var due_year;
        var mod_mon;
        var due_mon;
        var due_day;

        if (id == 1) {
            // Computing Liability Due Date. These fall on the last day of the month.
            year_adj = year_end - 1;
            mon_adj = mon_end + liability_intervals[coupon_adj];
            due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
            mod_mon = mon_adj % 12;
            due_mon = (mod_mon > 0 ? mod_mon : 12);
            if (due_mon == 2) {
                due_day = (is_leap_year(due_year) ? 29 : 28);
            }
            else {
                due_day = days_in_month[due_mon - 1];
            }
        }
        else if (id == 2) {
            // Computing Coupon Due Date.
            year_adj = (coupon < 5 ? year_end - 1 : year_end);
            mon_adj = mon_end + coupon_intervals[coupon_adj];
            due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
            mod_mon = mon_adj % 12;
            due_mon = (mod_mon > 0 ? mod_mon : 12);
            due_day = (coupon < 5 ? 20 : 15);

            // Correct the Coupon due dates so that they do not fall on a weekend.
            // t.wday == 6 is Saturday, Sunday == 0.
            var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
            if (t.wday() == 6) {
                due_day += 2;
            }
            else if (t.wday() == 0) {
                due_day += 1;
            }
        }

        // Check for certain dates to conform to the specs. The holiday dates will
        // need to be adjusted in future years (or an algorithm could be written for it).
        // Test the due dates and if one comes out different from the chart in the instructions, put in the computed due month, day
        // and year which showed as wrong and adjust the day to match the chart.
        // Example, the due date for the year ending 09/2011 for the extension voucher (coupon 5) comes out to 01/16/2012 which
        // doesn't match the chart date.  So 1, 16, 2012 are entered on the if line and the due_day is changed to 17.
        if ((due_mon == 1) && (due_day == 16) && (due_year == 2012)) {
            due_day = 17;
        }

        // 02/21/2011 is returned in several charts (02/2011, 05/2011, 08/2011, 10/2011) and it needs to return 02/22/2011.  This
        // code fixes all of them.
        if ((due_mon == 2) && (due_day == 21) && (due_year == 2011)) {
            due_day = 22;
        }

        // Prepare due date for return - string with no '/'s.
        result = due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
    }

    return result;
}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="FD482F1B502DF51CE95FF160A5DBB340" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)
	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        #
			        # Correct the Coupon due dates so that they do not fall on a weekend.
			        # t.wday == 6 is Saturday, Sunday == 0.
			        #
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        #
	        # Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        # in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        # out different from the chart in the instructions, put in the computed due month, day and year
	        # which showed as wrong and adjust the day to match the chart.
	        #
	        # Example, the due date for the year ending 09/2011 for the extension voucher (coupon 5) comes
	        # out to 01/16/2012 which doesn't match the chart date. So 1, 16, 2012 are entered on the if line
	        # and the due_day is changed to 17.
	        #
	        if ((due_mon == 4) and (due_day == 16) and (due_year == 2012))
		        due_day = 17
	        end

	        #
	        # Prepare due date for return - string with no '/'s.
	        #
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_due_date(id, mon_end, year_end, coupon) {
    var coupon_intervals = [4, 6, 9, 12, 4]
    var liability_intervals = [3, 6, 9, 12, 12]
    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    var result = '00000000';
    // Check arguments first.
    if ((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)) {

        year_end = year_end.to_i();

        // We will index into the interval arrays with this.
        var coupon_adj = coupon - 1;

        var year_adj;
        var mon_adj;
        var due_year;
        var mod_mon;
        var due_mon;
        var due_day;

        if (id == 1) {
            // Computing Liability Due Date. These fall on the last day of the month.
            year_adj = year_end - 1;
            mon_adj = mon_end + liability_intervals[coupon_adj];
            due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
            mod_mon = mon_adj % 12;
            due_mon = (mod_mon > 0 ? mod_mon : 12);
            if (due_mon == 2) {
                due_day = (is_leap_year(due_year) ? 29 : 28);
            }
            else {
                due_day = days_in_month[due_mon - 1];
            }
        }
        else if (id == 2) {
            // Computing Coupon Due Date.
            year_adj = (coupon < 5 ? year_end - 1 : year_end);
            mon_adj = mon_end + coupon_intervals[coupon_adj];
            due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
            mod_mon = mon_adj % 12;
            due_mon = (mod_mon > 0 ? mod_mon : 12);
            due_day = (coupon < 5 ? 20 : 15);

            // Correct the Coupon due dates so that they do not fall on a weekend.
            // t.wday == 6 is Saturday, Sunday == 0.
            var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
            if (t.wday() == 6) {
                due_day += 2;
            }
            else if (t.wday() == 0) {
                due_day += 1;
            }
        }

        // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
        // in future years (or an algorithm could be written for it). Test the due dates and if one comes
        // out different from the chart in the instructions, put in the computed due month, day and year
        // which showed as wrong and adjust the day to match the chart.

        // Example, the due date for the year ending 09/2011 for the extension voucher (coupon 5) comes
        // out to 01/16/2012 which doesn't match the chart date. So 1, 16, 2012 are entered on the if line
        // and the due_day is changed to 17.
        if ((due_mon == 4) && (due_day == 16) && (due_year == 2012)) {
            due_day = 17;
        }

        // Prepare due date for return - string with no '/'s.
        result = due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
    }

    return result;
}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="7DEAA99D26A7E583A4C91120E58232AA" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)

	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        #
			        # Correct the Coupon due dates so that they do not fall on a weekend.
			        # t.wday == 6 is Saturday, Sunday == 0.
			        #
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        #
	        # Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        # in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        # out different from the chart in the instructions, put in the computed due month, day and year
	        # which showed as wrong and adjust the day to match the chart.
	        #		
	 
               #-###########################################################
               #IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
               #-###########################################################
               #Each year when this form comes through the voucher number and year ending must be entered and checked
               #in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
               #dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
               #-###########################################################

                #This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        #In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        #year of the due date showing on the form in the variables below. In the variable labeled due_day
	        #set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        #is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.
       
               #Note 8/24/11:Offset below is for Martin Luther King day holiday which needed to adjusted from
               #the 21st to the 22nd for the next business day. 

	        if ((due_mon == 1) and (due_day == 21) and (due_year == 2013))
		        due_day = 22
	        end
	
               #Note 8/24/11:Offset below is for President's day holiday which needed to adjusted on the extension 
               #payment (voucher 5) from the 17th to the 18th for the next business day.
	
	        if ((due_mon == 2) and (due_day == 17) and (due_year == 2014))
		        due_day = 18
	        end

	        #
	        # Prepare due date for return - string with no '/'s.
	        #
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
      function compute_due_date(id, mon_end, year_end, coupon) {
    var coupon_intervals = [4, 6, 9, 12, 4]
    var liability_intervals = [3, 6, 9, 12, 12]
    var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    var result = '00000000';
    // Check arguments first.
    if ((id >= 1 && id <= 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)) {

        year_end = year_end.to_i();

        // We will index into the interval arrays with this.
        var coupon_adj = coupon - 1;

        var year_adj;
        var mon_adj;
        var due_year;
        var mod_mon;
        var due_mon;
        var due_day;

        if (id == 1) {
            // Computing Liability Due Date. These fall on the last day of the month.
            year_adj = year_end - 1;
            mon_adj = mon_end + liability_intervals[coupon_adj];
            due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
            mod_mon = mon_adj % 12;
            due_mon = (mod_mon > 0 ? mod_mon : 12);
            if (due_mon == 2) {
                due_day = (is_leap_year(due_year) ? 29 : 28);
            }
            else {
                due_day = days_in_month[due_mon - 1];
            }
        }
        else if (id == 2) {
            // Computing Coupon Due Date.
            year_adj = (coupon < 5 ? year_end - 1 : year_end);
            mon_adj = mon_end + coupon_intervals[coupon_adj];
            due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
            mod_mon = mon_adj % 12;
            due_mon = (mod_mon > 0 ? mod_mon : 12);
            due_day = (coupon < 5 ? 20 : 15);

            // Correct the Coupon due dates so that they do not fall on a weekend.
            // t.wday == 6 is Saturday, Sunday == 0.
            var t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day);
            if (t.wday() == 6) {
                due_day += 2;
            }
            else if (t.wday() == 0) {
                due_day += 1;
            }
        }

        // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
        // in future years (or an algorithm could be written for it). Test the due dates and if one comes
        // out different from the chart in the instructions, put in the computed due month, day and year
        // which showed as wrong and adjust the day to match the chart.

        //-###########################################################
        // IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
        //-###########################################################
        // Each year when this form comes through the voucher number and year ending must be entered and checked
        // in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
        // dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
        //-###########################################################

        // This offsets the due day for individual due dates that come up incorrect because of a holiday. 
        // In the algorithm below, using the due date that is showing on the form, put the month, date, and
        // year of the due date showing on the form in the variables below. In the variable labeled due_day
        // set the day equal to the correct day that is showing in the specs. For example, if the due day that
        // is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

        // Note 8/24/11:Offset below is for Martin Luther King day holiday which needed to adjusted from
        // the 21st to the 22nd for the next business day. 
        if ((due_mon == 1) && (due_day == 21) && (due_year == 2013)) {
            due_day = 22;
        }

        // Note 8/24/11:Offset below is for President's day holiday which needed to adjusted on the extension 
        // payment (voucher 5) from the 17th to the 18th for the next business day.
        if ((due_mon == 2) && (due_day == 17) && (due_year == 2014)) {
            due_day = 18;
        }

        // Prepare due date for return - string with no '/'s.
        result = due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
    }

    return result;
}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="CE46E514D01EFB014613A1F600AFD27C" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(amount)
	        if (amount > 11150.0) then 2879.0 + ((amount - 11150.0) * 0.35)
	        elsif (amount > 8200.0) then 1905.50 + ((amount - 8200.0) * 0.33)
	        elsif (amount > 5350.0) then 1107.50 + ((amount - 5350.0) * 0.28)
	        elsif (amount > 2300.0) then 345.0 + ((amount - 2300.0) * 0.25)
	        elsif (amount > 0.0) then amount * 0.15
	        else 0.0
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(amount)
				{
					if (amount > 11150.0) { return 2879.0 + ((amount - 11150.0) * 0.35); }
					else if (amount > 8200.0) { return 1905.50 + ((amount - 8200.0) * 0.33); }
					else if (amount > 5350.0) { return 1107.50 + ((amount - 5350.0) * 0.28); }
					else if (amount > 2300.0) { return 345.0 + ((amount - 2300.0) * 0.25); }
					else if (amount > 0.0) { return amount * 0.15; }
					else { return 0.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="BB553D7AF454209A4995EFB7EDADA1A8" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def get_avg_retail_sales_rate(fuel_type)
	        case (fuel_type.strip.to_i)
		        when (1): "1.941"
		        when (2): "2.170"
		        when (3): "3.000"
		        when (4): "1.954"
		        when (5): "1.868"
		        else "0.00"
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function get_avg_retail_sales_rate(fuel_type)
        {
	        switch (fuel_type.trim().to_i()
	        {
		        case 1: return "1.941";
		        case 2: return "2.170";
		        case 3: return "3.000";
		        case 4: return "1.954";
		        case 5: return "1.868";
		        else return "0.00";
	        }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="B5C5037EC4A8334F3DB378046CA80D60" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)			 		
	        return 0.0 if (taxable_income < 970000.0)

	        return case taxable_income
			        when (970000...1959999): 200.0		
			        when (1960000...9769999): 590.0
			        when (9770000...19539999): 1960.0
			        when (19540000...39079999): 3910.0
			        else 9770.0
		        end
        end			
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
				function compute_tax(taxable_income)			 		
				{
					if (taxable_income < 970000.0)
					{
						return 0.0;
					}

					if (taxable_income >= 970000 && taxable_income <= 1959999) { return 200.0; }
					else if (taxable_income >= 1960000 && taxable_income <= 9769999) { return 590.0; }
					else if (taxable_income >= 9770000 && taxable_income <= 19539999) { return 1960.0; }
					else if (taxable_income >= 19540000 && taxable_income <= 39079999) { return 3910.0; }
					else { return 9770.0; }
				}
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="1D4EA87928D651C1DACCCC50EA18AABC" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
		    def compute_tax(amount)
	        amount = amount.to_f
	        return 0.0 unless (amount > 0.0)

	        case (amount)
		        when (0.01..2550.0): amount * 0.15
		        when (2550.01..6000.0): 382.50 + ((amount - 2550.0) * 0.25)
		        when (6000.01..9150.0): 1245.00 + ((amount - 6000.0) * 0.28)
		        when (9150.01..12500.0): 2127.00 + ((amount - 9150.0) * 0.33)
		        else 3232.50 + ((amount - 12500.0) * 0.396)
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_tax(amount)
        {
	        amount = amount.to_f();
	        if (amount <= 0.0) {
		        return 0.0;
	        }
	
	        if (amount >= 0.01 && amount <=  2550.0) { return amount * 0.15; }
	        else if (amount >= 2550.01 && amount <=  6000.0) { return 382.50 + ((amount - 2550.0) * 0.25); }
	        else if (amount >= 6000.01 && amount <=  9150.0) { return 1245.00 + ((amount - 6000.0) * 0.28); }
	        else if (amount >= 9150.01 && amount <=  12500.0) { return 2127.00 + ((amount - 9150.0) * 0.33); }
	        else { return 3232.50 + ((amount - 12500.0) * 0.396); }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="EDF68AEFDC9FB44CA2244D5906982E8D" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(net_taxable_income)

	        return [net_taxable_income * 0.009, 0.0].max if (net_taxable_income < 4300.0)

	        case (net_taxable_income)

		        when (4400.0..8699.99): 39.0 + (net_taxable_income - 4399.99) * 0.024
		        when (8700.0..13099.99): 142.0 + (net_taxable_income - 8699.99) * 0.034
		        when (13100.0..21699.99): 291.0 + (net_taxable_income - 13099.99) * 0.044
		        when (21700.0..29999.99): 669.0 + (net_taxable_income - 21699.99) * 0.050
		        when (30000.0..36999.99): 1101.0 + (net_taxable_income - 29999.99) * 0.050
		        when (36300.0..39999.99): 1416.0 + (net_taxable_income - 36299.99) * 0.050
		        when (40000.0..49999.99): 1637.0 + (net_taxable_income - 39999.99) * 0.060
		        when (50000.0..59999.99): 2237.0 + (net_taxable_income - 49999.99) * 0.060
		        when (60000.0..69999.99): 2837.0 + (net_taxable_income - 59999.99) * 0.060
		        when (70000.0..77400.99): 3437.0 + (net_taxable_income - 69999.99) * 0.060
		        when (77401.0..78400.99): 3957.0 + (net_taxable_income - 77400.99) * 0.069
		        when (78401.0..79400.99): 4126.0 + (net_taxable_income - 78400.99) * 0.069
		        when (79401.0..80600.99): 4295.0 + (net_taxable_income - 79400.99) * 0.069
		        when (80601.0..81600.99): 4477.0 + (net_taxable_income - 80600.99) * 0.069
		        when (81601.0..82600.99): 4646.0 + (net_taxable_income - 81600.99) * 0.069		
		        else 4755.0 + (net_taxable_income - 82600.99) * 0.069
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_tax(net_taxable_income)
        {
	        if (net_taxable_income < 4300.0)
	        {
		        return Math.max(net_taxable_income * 0.009, 0.0);
	        }

          if (net_taxable_income >= 4400.0 && net_taxable_income <= 8699.99) { return 39.0 + (net_taxable_income - 4399.99) * 0.024; }
          else if (net_taxable_income >= 8700.0 && net_taxable_income <= 13099.99) { return 142.0 + (net_taxable_income - 8699.99) * 0.034; }
          else if (net_taxable_income >= 13100.0 && net_taxable_income <= 21699.99) { return 291.0 + (net_taxable_income - 13099.99) * 0.044; }
          else if (net_taxable_income >= 21700.0 && net_taxable_income <= 29999.99) { return 669.0 + (net_taxable_income - 21699.99) * 0.050; }
          else if (net_taxable_income >= 30000.0 && net_taxable_income <= 36999.99) { return 1101.0 + (net_taxable_income - 29999.99) * 0.050; }
          else if (net_taxable_income >= 36300.0 && net_taxable_income <= 39999.99) { return 1416.0 + (net_taxable_income - 36299.99) * 0.050; }
          else if (net_taxable_income >= 40000.0 && net_taxable_income <= 49999.99) { return 1637.0 + (net_taxable_income - 39999.99) * 0.060; }
          else if (net_taxable_income >= 50000.0 && net_taxable_income <= 59999.99) { return 2237.0 + (net_taxable_income - 49999.99) * 0.060; }
          else if (net_taxable_income >= 60000.0 && net_taxable_income <= 69999.99) { return 2837.0 + (net_taxable_income - 59999.99) * 0.060; }
          else if (net_taxable_income >= 70000.0 && net_taxable_income <= 77400.99) { return 3437.0 + (net_taxable_income - 69999.99) * 0.060; }
          else if (net_taxable_income >= 77401.0 && net_taxable_income <= 78400.99) { return 3957.0 + (net_taxable_income - 77400.99) * 0.069; }
          else if (net_taxable_income >= 78401.0 && net_taxable_income <= 79400.99) { return 4126.0 + (net_taxable_income - 78400.99) * 0.069; }
          else if (net_taxable_income >= 79401.0 && net_taxable_income <= 80600.99) { return 4295.0 + (net_taxable_income - 79400.99) * 0.069; }
          else if (net_taxable_income >= 80601.0 && net_taxable_income <= 81600.99) { return 4477.0 + (net_taxable_income - 80600.99) * 0.069; }
          else if (net_taxable_income >= 81601.0 && net_taxable_income <= 82600.99) { return 4646.0 + (net_taxable_income - 81600.99) * 0.06; }	
          else { return 4755.0 + (net_taxable_income - 82600.99) * 0.069; }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="3EB2AB162F15542BA7B4FDA5136AEB30" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(income)
	        return [income * 0.009, 0.0].max if (income < 4399.0)

	        case (income)
		        when (4400.00..8699.99): ((income - 4399.99) * 0.024) + 39.00
		        when (8700.00..13099.99): ((income - 8699.99) * 0.034) + 142.00
		        when (13100.00..21699.99): ((income - 13099.99) * 0.044) + 291.00
		        when (21700.00..29999.99): ((income - 21699.99) * 0.05) + 669.00
		        when (30000.00..36299.99): ((income - 29999.99) * 0.05) + 1101.00
		        when (36300.00..39999.99): ((income - 36299.99) * 0.06) + 1416.00
		        when (40000.00..49999.99): ((income - 39999.99) * 0.06) + 1637.00
		        when (50000.00..59999.99): ((income - 49999.99) * 0.06) + 2337.00
		        when (60000.00..69999.99): ((income - 59999.99) * 0.06) + 2837.00
		        when (70000.00..77400.99): ((income - 69999.99) * 0.06) + 3437.00
		        when (77401.00..78400.99): ((income - 74499.99) * 0.069) + 3957.00
		        when (78401.00..79400.99): ((income - 78499.99) * 0.069) + 4126.00
		        when (79401.00..80600.99): ((income - 79499.99) * 0.069) + 4295.00
		        when (80601.00..81600.99): ((income - 80699.99) * 0.069) + 4477.00
		        when (81601.00..82600.99): ((income - 81699.99) * 0.069) + 4646.00
		        else (income - 82600.99) * 0.069 + 4755.00
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_tax(income)
        {
	        if (income < 4399.0)
	        {
		        return Math.max(income * 0.009, 0.0);
	        }

	        if (income >= 4400.00 && income <= 8699.99) { return ((income - 4399.99) * 0.024) + 39.00; }
	        else if (income >= 8700.00 && income <= 13099.99) { return ((income - 8699.99) * 0.034) + 142.00; }
	        else if (income >= 13100.00 && income <= 21699.99) { return ((income - 13099.99) * 0.044) + 291.00; }
	        else if (income >= 21700.00 && income <= 29999.99) { return ((income - 21699.99) * 0.05) + 669.00; }
	        else if (income >= 30000.00 && income <= 36299.99) { return ((income - 29999.99) * 0.05) + 1101.00; }
	        else if (income >= 36300.00 && income <= 39999.99) { return ((income - 36299.99) * 0.06) + 1416.00; }
	        else if (income >= 40000.00 && income <= 49999.99) { return ((income - 39999.99) * 0.06) + 1637.00; }
	        else if (income >= 50000.00 && income <= 59999.99) { return ((income - 49999.99) * 0.06) + 2337.00; }
	        else if (income >= 60000.00 && income <= 69999.99) { return ((income - 59999.99) * 0.06) + 2837.00; }
	        else if (income >= 70000.00 && income <= 77400.99) { return ((income - 69999.99) * 0.06) + 3437.00; }
	        else if (income >= 77401.00 && income <= 78400.99) { return ((income - 74499.99) * 0.069) + 3957.00; }
	        else if (income >= 78401.00 && income <= 79400.99) { return ((income - 78499.99) * 0.069) + 4126.00; }
	        else if (income >= 79401.00 && income <= 80600.99) { return ((income - 79499.99) * 0.069) + 4295.00; }
	        else if (income >= 80601.00 && income <= 81600.99) { return ((income - 80699.99) * 0.069) + 4477.00; }
	        else if (income >= 81601.00 && income <= 82600.99) { return ((income - 81699.99) * 0.069) + 4646.00; }
	        else { return (income - 82600.99) * 0.069 + 4755.00; }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="D5F0961E3085E4DEDD0CF1EECCFC8E77" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_rate(household_income)
	        rate = if (household_income < 0.0) then '0'
		        else
			        case household_income
				        when (0.0..11633.99) then '1.00'
				        when (11634.0..13002.99) then '0.85'
				        when (13003.0..14371.99) then '0.70'
				        when (14372.0..17108.99) then '0.50'
				        when (17109.0..19846.99) then '0.35'
				        when (19847.0..22583.99) then '0.25'
				        else '0'
			        end
		        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_rate(household_income)
        {
	        var rate = '0';
	        if (household_income < 0.0) { rate = '0'; }
	        else
	        {
		        if (household_income >= 0.0 && household_income <= 11633.99) { rate = '1.00'; }
		        else if (household_income >= 11634.0 && household_income <= 13002.99) { rate = '0.85'; }
		        else if (household_income >= 13003.0 && household_income <= 14371.99) { rate = '0.70'; }
		        else if (household_income >= 14372.0 && household_income <= 17108.99) { rate = '0.50'; }
		        else if (household_income >= 17109.0 && household_income <= 19846.99) { rate = '0.35'; }
		        else if (household_income >= 19847.0 && household_income <= 22583.99) { rate = '0.25'; }
		        else { rate = '0'; }
	        }
	
	        return rate;
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="655C5FC72818548211B132F1643157F3" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_rate(household_income)
	        rate = if (household_income < 0.0) then '0'
		        else
			        case household_income
				        when (0.0..11773.99) then '1.00'
				        when (11774.0..13158.99) then '0.85'
				        when (13159.0..14543.99) then '0.70'
				        when (14544.0..17313.99) then '0.50'
				        when (17314.0..20084.99) then '0.35'
				        when (20085.0..22854.99) then '0.25'
				        else '0'
			        end
		        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_rate(household_income)
        {
	        var rate = '0';
	        if (household_income < 0.0) { rate = '0'; }
	        else
	        {
		        if (household_income >= 0.0 && household_income <= 11773.99) { rate = '1.00'; }
		        else if (household_income >= 11774.0 && household_income <= 13158.99) { rate = '0.85'; }
		        else if (household_income >= 13159.0 && household_income <= 14543.99) { rate = '0.70'; }
		        else if (household_income >= 14544.0 && household_income <= 17313.99) { rate = '0.50'; }
		        else if (household_income >= 17314.0 && household_income <= 20084.99) { rate = '0.35'; }
		        else if (household_income >= 20085.0 && household_income <= 22854.99) { rate = '0.25'; }
		        else { rate = '0'; }
	        }
	
	        return rate;
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="C4E77C3B6F17A096E880B4D9906F452A" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)							
	        if (taxable_income <= 0.0) then return 0 end						
	        case taxable_income						
		        when (0.01...1598.01)					
			        tax = taxable_income * 0.0036				
		        when (1598.01...3196.01)					
			        tax = ((taxable_income - 1573.0) * 0.0072) + 6.75		
		        when (3196.01...6392.01)					
			        tax = ((taxable_income - 3146.0) * 0.0243) + 17.26
		        when (6392.01...14382.01)					
			        tax = ((taxable_income - 6292.0) * 0.045) + 94.92
		        when (14382.01...23970.01)					
			        tax = ((taxable_income - 14157.0) * 0.0612) + 454.47
		        when (23970.01...31960.01)					
			        tax = ((taxable_income - 23595.0) * 0.0648) + 1041.26
		        when (31960.01...47940.01)					
			        tax = ((taxable_income - 31460.0) * 0.068) + 1559.01
		        when (47940.01...71910.01)					
			        tax = ((taxable_income - 47190.0) * 0.0792) + 2645.65		
		        else					
			        tax = ((taxable_income - 70785.0) * 0.0898) + 4544.907			
	        end					
	        return tax						
        end	
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_tax(taxable_income)
        {
	        if (taxable_income <= 0.0) { return 0; }

	        if (taxable_income >= 0.01 && taxable_income <= 1598.01) { tax = taxable_income * 0.0036; }
	        else if (taxable_income >= 1598.01 && taxable_income <= 3196.01) { tax = ((taxable_income - 1573.0) * 0.0072) + 6.75; }
	        else if (taxable_income >= 3196.01 && taxable_income <= 6392.01) { tax = ((taxable_income - 3146.0) * 0.0243) + 17.26; }
	        else if (taxable_income >= 6392.01 && taxable_income <= 14382.01) { tax = ((taxable_income - 6292.0) * 0.045) + 94.92; }
	        else if (taxable_income >= 14382.01 && taxable_income <= 23970.01) { tax = ((taxable_income - 14157.0) * 0.0612) + 454.47; }
	        else if (taxable_income >= 23970.01 && taxable_income <= 31960.01) { tax = ((taxable_income - 23595.0) * 0.0648) + 1041.26; }
	        else if (taxable_income >= 31960.01 && taxable_income <= 47940.01) { tax = ((taxable_income - 31460.0) * 0.068) + 1559.01; }
	        else if (taxable_income >= 47940.01 && taxable_income <= 71910.01) { tax = ((taxable_income - 47190.0) * 0.0792) + 2645.65; }
	        else { tax = ((taxable_income - 70785.0) * 0.0898) + 4544.907; }

	        return tax;
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="665BA7382B544A4236E4A31908AAD329" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        if (taxable_income <= 0.0) then return 0 end
	        case taxable_income
		        when (0.01...1573.01)
			        tax = taxable_income * 0.0036
		        when (1573.01...3146.01)
			        tax = ((taxable_income - 1573.0) * 0.0072) + 5.66
		        when (3146.01...6292.01)
			        tax = ((taxable_income - 3146.0) * 0.0243) + 16.99
		        when (6292.01...14157.01)
			        tax = ((taxable_income - 6292.0) * 0.045) + 93.44
		        when (14157.01...23595.01)
			        tax = ((taxable_income - 14157.0) * 0.0612) + 447.37
		        when (23595.01...31460.01)
			        tax = ((taxable_income - 23595.0) * 0.0648) + 1024.98
		        when (31460.01...47190.01)
			        tax = ((taxable_income - 31460.0) * 0.068) + 1534.63
		        when (47190.01...70785.01)
			        tax = ((taxable_income - 47190.0) * 0.0792) + 2604.27
		        else
			        tax = ((taxable_income - 70785.0) * 0.0898) + 4472.99
	        end
	        return tax
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_tax(taxable_income)
        {
	        if (taxable_income <= 0.0) { return 0; }

	        if (taxable_income >= 0.01 && taxable_income <= 1573.01) { tax = taxable_income * 0.0036; }
	        else if (taxable_income >= 1573.01 && taxable_income <= 3146.01) { tax = ((taxable_income - 1573.0) * 0.0072) + 5.66; }
	        else if (taxable_income >= 3146.01 && taxable_income <= 6292.01) { tax = ((taxable_income - 3146.0) * 0.0243) + 16.99; }
	        else if (taxable_income >= 6292.01 && taxable_income <= 14157.01) { tax = ((taxable_income - 6292.0) * 0.045) + 93.44; }
	        else if (taxable_income >= 14157.01 && taxable_income <= 23595.01) { tax = ((taxable_income - 14157.0) * 0.0612) + 447.37; }
	        else if (taxable_income >= 23595.01 && taxable_income <= 31460.01) { tax = ((taxable_income - 23595.0) * 0.0648) + 1024.98; }
	        else if (taxable_income >= 31460.01 && taxable_income <= 47190.01) { tax = ((taxable_income - 31460.0) * 0.068) + 1534.63; }
	        else if (taxable_income >= 47190.01 && taxable_income <= 70785.01) { tax = ((taxable_income - 47190.0) * 0.0792) + 2604.27; }
	        else { tax = ((taxable_income - 70785.0) * 0.0898) + 4472.99; }

	        return tax;
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="E2F44E5CE456F68C2D65C743B5B9DAC3" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_tax(taxable_income)
	        return 0.0 unless (taxable_income > 0.0)

	        case (taxable_income)
		        when (0.01..1573.0): taxable_income * 0.0036
		        when (1573.01..3146.0): ((taxable_income - 1576.0) * 0.0072) + 5.66
		        when (3146.01..6292.0): ((taxable_income - 3146.0) * 0.0243) + 16.99
		        when (6292.01..14157.0): ((taxable_income - 6292.0) * 0.045) + 93.44
		        when (14157.01..23595.0): ((taxable_income - 14157.0) * 0.0612) + 447.37
		        when (23595.01..31460.0): ((taxable_income - 23595.0) * 0.0648) + 1024.98
		        when (31460.01..47190.0): ((taxable_income - 31460.0) * 0.068) + 1534.63
		        when (47190.01..70785.0): ((taxable_income - 47190.0) * 0.0792) + 2604.27
		        else ((taxable_income - 70785.0) * 0.0898) + 4472.99
	        end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_tax(taxable_income)
        {
	        if (taxable_income <= 0.0)
	        {
		        return 0.0;
	        }

	        if (taxable_income >= 0.01 && taxable_income <= 1573.0) { return taxable_income * 0.0036; }
	        else if (taxable_income >= 1573.01 && taxable_income <= 3146.0) { return ((taxable_income - 1576.0) * 0.0072) + 5.66; }
	        else if (taxable_income >= 3146.01 && taxable_income <= 6292.0) { return ((taxable_income - 3146.0) * 0.0243) + 16.99; }
	        else if (taxable_income >= 6292.01 && taxable_income <= 14157.0) { return ((taxable_income - 6292.0) * 0.045) + 93.44; }
	        else if (taxable_income >= 14157.01 && taxable_income <= 23595.0) { return ((taxable_income - 14157.0) * 0.0612) + 447.37; }
	        else if (taxable_income >= 23595.01 && taxable_income <= 31460.0) { return ((taxable_income - 23595.0) * 0.0648) + 1024.98; }
	        else if (taxable_income >= 31460.01 && taxable_income <= 47190.0) { return ((taxable_income - 31460.0) * 0.068) + 1534.63; }
	        else if (taxable_income >= 47190.01 && taxable_income <= 70785.0) { return ((taxable_income - 47190.0) * 0.0792) + 2604.27; }
	        else { return ((taxable_income - 70785.0) * 0.0898) + 4472.99; }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="6E5AFBD309218FDFD0F963491E49CD0E" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def process_alpha_fields(element, field_length, no_titles, no_padding)

	        element = element.upcase.strip
	        return '' if (element.empty?)
	        element = $'.strip if (element  =~ /^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /) if no_titles

	        #
	        # We have stripped out invalid titles & following space. If we are padding, we also ensure the return value is of the
	        # proper length, padded in the front with space characters; otherwise, we just return the element for the length specified.
	        #
	        return (no_padding ? element[0,field_length] : (" " * ([field_length - element.length,0].max) + element[0,field_length]))
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function process_alpha_fields(element, field_length, no_titles, no_padding)
        {
	        element = element.toUpperCase().trim();
	        if (element.trim().isEmpty()) { return ''; }
	
	        if (no_titles)
	        {
		        element = element.replace(/^MR\.? |MS\.? |MRS\.? |MISS |DR\.? |REV\.? |PROF\.? /g, '');
	        }

	        // We have stripped out invalid titles & following space. If we are padding, we also ensure the return value is of the
	        // proper length, padded in the front with space characters; otherwise, we just return the element for the length specified.
	        var len = 0;
	        if (field_length - element.length > 0)
	        {
		        len = field_length - element.length;
	        }
	
	        return (no_padding ? element.substring(0,field_length) : (" ".repeat(len) + element.substring(0,field_length)));
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="08332989506D04C62D9B1F9C6CA427EA" scripttype="JS" codetype="method">
    <RubyCode>
      <![CDATA[
        def compute_due_date(id, mon_end, year_end, coupon)

	        coupon_intervals = [4, 6, 9, 12, 4]
	        liability_intervals = [3, 6, 9, 12, 12]
	        days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
	
	        #Check arguments first.
	        return '00000000' unless (((1..2) === id) and ((1..12) === mon_end) and (year_end.length == 4) and ((1..5) === coupon)) 

	        year_end = year_end.to_i
	
	        #We will index into the interval arrays with this.
	        coupon_adj = coupon - 1
	
	        case id
		        when 1
			        #Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1
			        mon_adj = mon_end + liability_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = ( mod_mon > 0 ? mod_mon : 12)
			        due_day = if (due_mon == 2)
						        (is_leap_year(due_year) ? 29 : 28)
					        else
						        days_in_month[due_mon - 1]
					        end
		        when 2
			        #Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end)
			        mon_adj = mon_end + coupon_intervals[coupon_adj]
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj)
			        mod_mon = mon_adj % 12
			        due_mon = (mod_mon > 0 ? mod_mon : 12)
			        due_day = (coupon < 5 ? 20 : 15)

			        #
			        # Correct the Coupon due dates so that they do not fall on a weekend.
			        # t.wday == 6 is Saturday, Sunday == 0.
			        #
			        t = Time.mktime(due_year, due_mon, due_day)
			        due_day += if (t.wday == 6) then 2
					        elsif (t.wday == 0) then 1
					        else 0 end
	        end

	        #
	        # Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        # in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        # out different from the chart in the instructions, put in the computed due month, day and year
	        # which showed as wrong and adjust the day to match the chart.
	        #		
	 
               #-###########################################################
               #IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
               #-###########################################################
               #Each year when this form comes through the voucher number and year ending must be entered and checked
               #in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
               #dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
               #-###########################################################

                #This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        #In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        #year of the due date showing on the form in the variables below. In the variable labeled due_day
	        #set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        #is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

	        #Note 08/22/17 [rtroy]:The date adjustments below are all for emancipation day which falls
	        #on the calculated due date and needs to be adjusted to the next day.

	        if ((due_mon == 4) and (due_day == 16) and (due_year == 2018))
		        due_day = 17
	        end
	
	        if ((due_mon == 4) and (due_day == 17) and (due_year == 2017))
		        due_day = 18
	        end
			
	        if ((due_mon == 1) and (due_day == 15) and (due_year == 2018))
		        due_day = 16
	        end
	
	        #
	        # Prepare due date for return - string with no '/'s.
	        #
	        return ('%02.0f'% due_mon.to_s) + due_day.to_s + due_year.to_s 
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        function compute_due_date(id, mon_end, year_end, coupon)
        {
	        var coupon_intervals = [4, 6, 9, 12, 4];
	        var liability_intervals = [3, 6, 9, 12, 12];
	        var days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	
	        // Check arguments first.
	        if (!((id == 1 || id == 2) && (mon_end >= 1 && mon_end <= 12) && (year_end.toString().length == 4) && (coupon >= 1 && coupon <= 5)))
            {
                return '00000000';
            }

	        year_end = year_end.to_i();
	
	        // We will index into the interval arrays with this.
	        var coupon_adj = coupon - 1;
            var year_adj;
            var mon_adj;
            var due_year;
            var mod_mon;
            var due_mon;
            var due_day;

            switch (id)
            {
		        case 1:
			        // Computing Liability Due Date. These fall on the last day of the month.
			        year_adj = year_end - 1;
			        mon_adj = mon_end + liability_intervals[coupon_adj];
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
			        mod_mon = mon_adj % 12;
			        due_mon = ( mod_mon > 0 ? mod_mon : 12);
                    if (due_mon == 2)
                    {
                        due_day = (is_leap_year(due_year) ? 29 : 28);
                    }
                    else
                    {
				        due_day = days_in_month[due_mon - 1];
                    }
                    break;
		        case 2:
			        // Computing Coupon Due Date.
			        year_adj = (coupon < 5 ? year_end - 1 : year_end);
			        mon_adj = mon_end + coupon_intervals[coupon_adj];
			        due_year = (mon_adj > 12 ? year_adj + 1 : year_adj);
			        mod_mon = mon_adj % 12;
			        due_mon = (mod_mon > 0 ? mod_mon : 12);
			        due_day = (coupon < 5 ? 20 : 15);

			        // Correct the Coupon due dates so that they do not fall on a weekend.
			        // t.wday == 6 is Saturday, Sunday == 0.

                    t = SFForms.Utilities.Time.mktime(due_year, due_mon, due_day)
                    if (t.wday() == 6) { due_day += 2; }
			        else if (t.wday() == 0) { due_day += 1; }
                    break;
	        }

	        // Check for certain dates to conform to the specs. The holiday dates will need to be adjusted
	        // in future years (or an algorithm could be written for it). Test the due dates and if one comes
	        // out different from the chart in the instructions, put in the computed due month, day and year
	        // which showed as wrong and adjust the day to match the chart.
	 
            //-###########################################################
            // IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
            //-###########################################################
            // Each year when this form comes through the voucher number and year ending must be entered and checked
            // in SuperForm through the entire date tables in the specs. to assure that the due date is correct. Some due
            // dates may need to be adjusted using the offset below because they fall on a holiday for that year.      
            //-###########################################################

            // This offsets the due day for individual due dates that come up incorrect because of a holiday. 
	        // In the algorithm below, using the due date that is showing on the form, put the month, date, and
	        // year of the due date showing on the form in the variables below. In the variable labeled due_day
	        // set the day equal to the correct day that is showing in the specs. For example, if the due day that
	        // is showing the form was 21, and the specs. say it should be 22, the variable would be due_day = 22.

	        // Note 08/22/17 [rtroy]:The date adjustments below are all for emancipation day which falls
	        // on the calculated due date and needs to be adjusted to the next day.

	        if ((due_mon == 4) && (due_day == 16) && (due_year == 2018))
	        {
                due_day = 17;
            }
	
	        if ((due_mon == 4) && (due_day == 17) && (due_year == 2017))
	        {
                due_day = 18;
            }
			
	        if ((due_mon == 1) && (due_day == 15) && (due_year == 2018))
	        {
                due_day = 16;
            }
	
            // Prepare due date for return - string with no '/'s.
            return due_mon.to_f().complexFixedString(0, '02') + due_day.toString() + due_year.toString();
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="6BCFBC010D9D5EB5EA3EC5610E5A7834" scripttype="JS" codetype="fragment">
    <RubyCode>
      <![CDATA[
        df_list.each_index do |i|
          if (eval("#{df_list[i].join('+')}").strip.trim().isEmpty())
         		#
		        # Index df_list[i] holds the set of empty Data Flow boxes which we will flow to.
		        #

            df_list[i].each_index do |j| 
              tmp = ""
              case (j)
                when(0):tmp = ((name="#{preparer.first_name}#{preparer.middle_initial}#{preparer.last_name}".squeeze('').strip).trim().isEmpty()?preparer.firm_name.strip:name)
                when(1):tmp = preparer.address.strip
                when(2):tmp = ((preparer.city.strip.trim().isEmpty()?'':preparer.city+',')+preparer.state+''+preparer.zip).squeeze('').strip
                when(3):tmp = preparer.ptin.strip
                when(4):tmp = (case
                  when (!preparer.work_phone.strip.trim().isEmpty()):preparer.work_phone
                  when (!preparer.phone.strip.trim().isEmpty()):preparer.phone
                  else preparer.mobile_phone
                end).strip
                when(5):tmp = preparer.fax.strip
              end
              print "#{df_list[i][j]}", tmp unless (tmp.trim().isEmpty())
            end
            break
          end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        for (var i=0; i<df_list.length; i++) 
        {
          tmpEval = eval("df_list[i].join("+")");
          tmpEval = eval(tmpEval);

          if (tmpEval.toString().trim().length <= 0) 
          {
            // Index df_list[i] holds the set of empty Data Flow boxes which we will flow to.
            for (var j=0; j<df_list[i].length; j++) 
            {
              tmp = "";

              switch (j)
              {
                case 0:
                  tmp = ("#{preparer.first_name} #{preparer.middle_initial} #{preparer.last_name}").squeeze(" ").trim();
                  tmp = tmp.isEmpty() ? preparer.firm_name.trim() : name;
                  break;
                case 1:
                  tmp = preparer.address.trim();
                  break;
                case 2:
                  tmp = ((preparer.city.trim().isEmpty() ? '' : preparer.city + ', ') + preparer.state + ' ' + preparer.zip).squeeze(" ").trim();
                  break;
                case 3:
                  tmp = preparer.ptin.trim();
                  break;
                case 4:
                  if (!preparer.work_phone.trim().isEmpty()) { tmp = preparer.work_phone.trim(); }
                  else if (!preparer.phone.trim().isEmpty()) { tmp = preparer.phone.trim(); }
                  else { tmp = preparer.mobile_phone.trim(); }
                  break;
                case 5:
                  tmp = preparer.fax.trim();
                  break;
              }

              if (!tmp.isEmpty()) 
              { 
                df_list[i][j] = tmp;
              }
            }
            break;
          }
        }
      ]]>
    </JavaScriptCode>
  </Block>
  <Block id="5A996D28F7C0B3BF509DF843ED44C9F5" scripttype="JS" codetype="fragment">
    <RubyCode>
      <![CDATA[
        df_list.each_index do |i|
          if (eval("#{df_list[i].join('+')}").strip.trim().isEmpty())
            df_list[i].each_index do |j| 
              tmp= ""
              case(j)
                when(0): tmp = ("#{fiduciary.first_name_and_mi}#{fiduciary.last_name}").squeeze('').strip
                when(1): tmp = fiduciary.address.strip
                when(2): tmp = ((fiduciary.city.strip.trim().isEmpty()?'':fiduciary.city+',') + fiduciary.state + '' + fiduciary.zip).squeeze('').strip
                when(3): tmp = fiduciary.phone.strip
              end
              
              print "#{df_list[i][j]}", tmp unless (tmp.trim().isEmpty())
            end
            break
          end
        end
      ]]>
    </RubyCode>
    <JavaScriptCode>
      <![CDATA[
        for (var i=0; i<df_list.length; i++) 
        {
          tmpEval = eval("df_list[i].join("+")");
          tmpEval = eval(tmpEval);

          if (tmpEval.toString().trim().length <= 0) 
          {
		        //
		        // Index df_list[i] holds the set of empty Data Flow boxes which we will flow to.
		        //
            for (var j=0; j<df_list[i].length; j++) 
            {
              tmp = "";

              switch (j)
              {
                case 0:
                  tmp = ("#{fiduciary.first_name_and_mi} #{fiduciary.last_name}").squeeze(" ").trim();
                  break;
                case 1:
                  tmp = fiduciary.address.trim();
                  break;
                case 2:
                  tmp = ((fiduciary.city.trim().isEmpty() ? '' : fiduciary.city + ', ') + fiduciary.state + ' ' + fiduciary.zip).squeeze(" ").trim();
                  break;
                case 3:
                  tmp = fiduciary.phone.trim();
                  break;
              }

              if (!tmp.isEmpty()) 
              { 
                df_list[i][j] = tmp;
              }
            }
            break;
          }
        }
      ]]>
    </JavaScriptCode>
  </Block>
</CodeBlocks>
