// RateCalculator.js

/*
  History: 
  Created originally DRH; 
  Global mods 03/08/2001 ROD to mimic legacy UW and TitlePolicy, provide foundation for 
  multiple states, and generally tighten code.
*/


/*
  Init Rate Matrix into global array; order is significant for any graduated level (e.g. MOLx)
  Note: tables values may differ significantly from legacy UW, such as TN's OWN and MTG levels
  Many values defined below are unused in this web version since we're only concerned with
  the most frequently used rate methods. 

  Refer to TitlePolicy Rate Generator instead of UW for determining most recent changes.

  07/17/02 ROD cleaned out rate matrix removing those rows not currently in use

*/
var applyNY15PercentDiscount=true

//               Region     Code     MinLimit      MaxLimit        Rate   Additional

var gaMatrix = [[ "AL",    "MINP",        0.00,         0.00,    50.000,     0.00],  // Minimum Premium
                [ "AL",    "MTG1",        0.00,    100000.00,     2.500,     0.00],  // Mortgagee Level 1
                [ "AL",    "MTG2",   100000.01,    500000.00,     2.000,     0.00],  // Mortgagee Level 2
                [ "AL",    "MTG3",   500000.01,  10000000.00,     1.500,     0.00],  // Mortgagee Level 3
      			[ "AL",    "MTG4", 10000000.01,  15000000.00,     1.250,     0.00],  // Mortgagee Level 4                
                [ "AL",    "MTG5", 15000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 5
				[ "AL",    "OWN1",        0.00,     50000.00,     3.500,     0.00],  // Owner Level 1
                [ "AL",    "OWN2",    50000.01,    100000.00,     3.000,     0.00],  // Owner Level 2
                [ "AL",    "OWN3",   100000.01,   1000000.00,     2.000,     0.00],  // Owner Level 3
                [ "AL",    "OWN4",  1000000.01,  10000000.00,     1.750,     0.00],  // Owner Level 4
                [ "AL",    "OWN5", 10000000.01, 999999999.99,     1.250,     0.00],  // Owner Level 5
                [ "AL",    "REFI",        0.00,        15.00,    50.000,     0.00],  // Refinance
                [ "AL",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue
                [ "AL",    "SIOM",        0.00,         0.00,    50.000,     0.00],  // Simultaneous Issue; flat rate
		        [ "AL",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
		        
				[ "AR",    "MINP",        0.00,         0.00,    50.000,     0.00],  // Minimum Premium
                [ "AR",    "MTG1",        0.00,     50000.00,     2.500,     0.00],  // Mortgagee Level 1
                [ "AR",    "MTG2",    50000.01,    100000.00,     2.000,     0.00],  // Mortgagee Level 2
                [ "AR",    "MTG3",   100000.01,    500000.00,     1.750,     0.00],  // Mortgagee Level 3
      			[ "AR",    "MTG4",   500000.01,  10000000.00,     1.500,     0.00],  // Mortgagee Level 4                
                [ "AR",    "MTG5", 10000000.01,  15000000.00,     1.250,     0.00],  // Mortgagee Level 5
                [ "AR",    "MTG6", 15000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 6
				[ "AR",    "OWN1",        0.00,     50000.00,     3.500,     0.00],  // Owner Level 1
                [ "AR",    "OWN2",    50000.01,    100000.00,     3.000,     0.00],  // Owner Level 2
                [ "AR",    "OWN3",   100000.01,   5000000.00,     2.000,     0.00],  // Owner Level 3
                [ "AR",    "OWN4",  5000000.01,  10000000.00,     1.750,     0.00],  // Owner Level 4
                [ "AR",    "OWN5", 10000000.01,  15000000.00,     1.500,     0.00],  // Owner Level 5
               	[ "AR",    "OWN6", 15000000.01, 999999999.99,     1.250,     0.00],  // Owner Level 6
                [ "AR",    "REFI",        0.00,        15.00,    50.000,     0.00],  // Refinance
                [ "AR",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue
                [ "AR",    "SIOM",        0.00,         0.00,    50.000,     0.00],  // Simultaneous Issue; flat rate
		       	[ "AR",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
				[ "DC",    "MINP",        0.00,         0.00,   150.000,   100.00],  // Rate = OWNER minimum Prem; Mtgee Min premium
                [ "DC",    "MTG1",        0.00,    250000.00,     2.500,     0.00],  // Mortgagee Level 1
                [ "DC",    "MTG2",   250000.01,    500000.00,     2.000,     0.00],  // Mortgagee Level 2
                [ "DC",    "MTG3",   500000.01,   1000000.00,     1.750,     0.00],  // Mortgagee Level 3
                [ "DC",    "MTG4",  1000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee Level 4
                [ "DC",    "MTG5",  5000000.01,  15000000.00,     1.250,     0.00],  // Mortgagee Level 5
                [ "DC",    "MTG6", 15000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 6
                [ "DC",    "OWN1",        0.00,    250000.00,     3.500,     0.00],  // Mortgagee Level 1
                [ "DC",    "OWN2",   250000.01,    500000.00,     3.000,     0.00],  // Mortgagee Level 2
                [ "DC",    "OWN3",   500000.01,   1000000.00,     2.500,     0.00],  // Mortgagee Level 3
                [ "DC",    "OWN4",  1000000.01,   5000000.00,     2.000,     0.00],  // Mortgagee Level 4
                [ "DC",    "OWN5",  5000000.01,  15000000.00,     1.750,     0.00],  // Mortgagee Level 5
                [ "DC",    "OWN6", 15000000.01, 999999999.99,     1.500,     0.00],  // Mortgagee Level 6
 				[ "DC",    "REFI",        0.00,        10.00,    40.000,     0.00],  // Refinance
                [ "DC",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "DC",    "SIOM",        0.00,         0.00,   150.000,    50.00],  // Simultaneous Issue/Owner-Mtgee; max = flat fee; additional = rate
                [ "DC",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
                
				[ "FL",    "CEIL",        0.00,         0.00,     3.000,     0.00],  // Reissue age ceiling in years
                [ "FL",    "MINP",        0.00,         0.00,   100.000,    60.00],  // Minimum Premium Amount; addt'l = min prem amount for Reg Multiple Conveyance
                [ "FL",    "MOL1",        0.00,    100000.00,     5.750,     0.00],  // Mortgagee/Owner Level 1
                [ "FL",    "MOL2",   100000.01,   1000000.00,     5.000,     0.00],  // Mortgagee/Owner Level 2
                [ "FL",    "MOL3",  1000000.01,   5000000.00,     2.500,     0.00],  // Mortgagee/Owner Level 3
                [ "FL",    "MOL4",  5000000.01,  10000000.00,     2.250,     0.00],  // Mortgagee/Owner Level 4
				[ "FL",    "MOL5", 10000000.01, 999999999.99,     2.000,     0.00],  // Mortgagee/Owner Level 5
				[ "FL",    "REI1",        0.00,    100000.00,     3.300,     0.00],  // reissue Mortgagee/Owner Level 1
                [ "FL",    "REI2",   100000.01,   1000000.00,     3.000,     0.00],  // reissue Mortgagee/Owner Level 2
                [ "FL",    "REI3",  1000000.01,  10000000.00,     2.000,     0.00],  // reissue Mortgagee/Owner Level 3
                [ "FL",    "REI4", 10000000.01, 999999999.99,     1.500,     0.00],  // reissue Mortgagee/Owner Level 4
				[ "FL",    "SIOM",        0.00,         0.00,    25.000,     0.00],  // Simultaneous Issue; flat rate
				
		        [ "GM",    "MINP",        0.00,         0.00,    50.000,     0.00],  // Minimum Premium
                [ "GM",    "MTG1",        0.00,     50000.00,     2.000,     0.00],  // Mortgagee Level 1
                [ "GM",    "MTG2",    50000.01,  10000000.00,     1.500,     0.00],  // Mortgagee Level 2
                [ "GM",    "MTG3", 10000000.01,  15000000.00,     1.250,     0.00],  // Mortgagee Level 3
                [ "GM",    "MTG4", 15000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 4
                [ "GM",    "OWN1",        0.00,     25000.00,     3.000,     0.00],  // Owner Level 1
                [ "GM",    "OWN2",    25000.01,     50000.00,     2.500,     0.00],  // Owner Level 2
                [ "GM",    "OWN3",    50000.01,  10000000.00,     1.500,     0.00],  // Owner Level 3
                [ "GM",    "OWN4", 10000000.01,  15000000.00,     1.250,     0.00],  // Owner Level 4
                [ "GM",    "OWN5", 15000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 5
                [ "GM",    "REFI",        0.00,         5.00,    50.000,     0.00],  // Refinance
                [ "GM",    "REFI",        6.00,        10.00,    60.000,     0.00],  // Refinance
                [ "GM",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue
                [ "GM",    "SIOM",        0.00,         0.00,    25.000,     0.00],  // Simultaneous Mtgee/Owner
                [ "GM",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Mortgagee Construction
                
               	[ "GS",    "MINP",        0.00,         0.00,   100.000,     0.00],  // Minimum Premium
                [ "GS",    "MTG1",        0.00,     50000.00,     2.500,     0.00],  // Mortgagee Level 1
                [ "GS",    "MTG2",    50000.01,    100000.00,     2.500,     0.00],  // Mortgagee Level 2
                [ "GS",    "MTG3",   100000.01,    500000.00,     2.000,     0.00],  // Mortgagee Level 3
                [ "GS",    "MTG4",   500000.01,  10000000.00,     1.750,     0.00],  // Mortgagee Level 4
                [ "GS",    "MTG5", 10000000.01,  15000000.00,     1.750,     0.00],  // Mortgagee Level 5
                [ "GS",    "MTG6", 15000000.01, 999999999.99,     1.750,     0.00],  // Mortgagee Level 6
                [ "GS",    "OWN1",        0.00,     50000.00,     3.500,     0.00],  // Owner Level 1
                [ "GS",    "OWN2",    50000.01,    100000.00,     3.500,     0.00],  // Owner Level 2
                [ "GS",    "OWN3",   100000.01,   5000000.00,     3.000,     0.00],  // Owner Level 3
                [ "GS",    "OWN4",  5000000.01,  10000000.00,     2.500,     0.00],  // Owner Level 4
                [ "GS",    "OWN5", 10000000.01,  15000000.00,     2.500,     0.00],  // Owner Level 5
                [ "GS",    "OWN6", 15000000.01, 999999999.99,     2.500,     0.00],  // Owner Level 6
                [ "GS",    "REFI",        0.00,         5.00,    50.000,     0.00],  // Refinance
                [ "GS",    "REFI",        6.00,        10.00,    60.000,     0.00],  // Refinance
                [ "GS",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue
                [ "GS",    "SIOM",        0.00,         0.00,   100.000,     0.00],  // Simultaneous Mtgee/Owner
                [ "GS",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Mortgagee Construction
                
				[ "IL",    "MINP",        0.00,         0.00,   100.000,     0.00],  // Rate = minimum Prem
                [ "IL",    "MTG1",        0.00,     50000.00,     2.500,     0.00],  // Mortgagee Level 1
                [ "IL",    "MTG2",    50000.01,    100000.00,     2.000,     0.00],  // Mortgagee Level 2
                [ "IL",    "MTG3",   100000.01,    500000.00,     1.750,     0.00],  // Mortgagee Level 3
                [ "IL",    "MTG4",   500000.01,  10000000.00,     1.500,     0.00],  // Mortgagee Level 4
                [ "IL",    "MTG5", 10000000.01,  15000000.00,     1.250,     0.00],  // Mortgagee Level 5
                [ "IL",    "MTG6", 15000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 6
                [ "IL",    "OWN1",        0.00,     50000.00,     3.500,     0.00],  // Owner Level 1
                [ "IL",    "OWN2",    50000.01,    100000.00,     3.000,     0.00],  // Owner Level 2
                [ "IL",    "OWN3",   100000.01,   5000000.00,     2.000,     0.00],  // Owner Level 3
                [ "IL",    "OWN4",  5000000.01,  10000000.00,     1.750,     0.00],  // Owner Level 4
                [ "IL",    "OWN5", 10000000.01,  15000000.00,     1.500,     0.00],  // Owner Level 5
                [ "IL",    "OWN6", 15000000.01, 999999999.99,     1.250,     0.00],  // Owenr Level 6
                [ "IL",    "REFI",        0.00,        15.00,    50.000,     0.00],  // Refinance
                [ "IL",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "IL",    "SIOM",        0.00,         0.00,    50.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
				[ "IL",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
           		[ "IN1",   "MINP",        0.00,         0.00,    75.000,     0.00],  // Minimum Prem - Reg Rates
                [ "IN1",   "MOL1",        0.00,     50000.00,     5.000,     0.00],  // Mortgagee/Owner Level 1
                [ "IN1",   "MOL2",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee/Owner Level 2
                [ "IN1",   "MOL3",   100000.01,    150000.00,     2.000,     0.00],  // Mortgagee/Owner Level 3
                [ "IN1",   "MOL4",   150000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 5
				[ "IN1",   "REFI",        0.00,        10.00,    60.000,     0.00],  // Refinance
                [ "IN1",   "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
               	[ "IN1",   "SIOM",        0.00,         0.00,    75.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "IN1",   "TCON",        0.00,         0.00,     1.000,     0.00],  // Temp Construction
				[ "IN2",   "MINP",        0.00,         0.00,    60.000,     0.00],  // Minimum Prem - Reg Rates
                [ "IN2",   "MOL1",        0.00,     50000.00,     2.900,     0.00],  // Mortgagee/Owner Level 2
                [ "IN2",   "MOL2",    50000.01,    100000.00,     2.300,     0.00],  // Mortgagee/Owner Level 3
                [ "IN2",   "MOL3",   100000.01,    500000.00,     2.000,     0.00],  // Mortgagee/Owner Level 4
                [ "IN2",   "MOL4",   500000.01,  10000000.00,     1.750,     0.00],  // Mortgagee/Owner Level 5
                [ "IN2",   "MOL5", 10000000.01,  15000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 6
                [ "IN2",   "MOL6", 15000000.01, 999999999.99,     1.250,     0.00],  // Mortgagee/Owner Level 7
				[ "IN2",   "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "IN2",   "SIOM",        0.00,         0.00,    60.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "IN2",   "SURE",        0.00,        10.00,    60.000,     0.00],  // Substitution-Refinance
                [ "IN2",   "TCON",        0.00,         0.00,     1.000,     0.00],  // Temp Constr. Binder
               	[ "IN3",   "MINP",        0.00,         0.00,    75.000,     0.00],  // Minimum Prem - Reg Rates
                [ "IN3",   "MOL1",        0.00,     50000.00,     4.500,     0.00],  // Mortgagee/Owner Level 2
                [ "IN3",   "MOL2",    50000.01,     75000.00,     3.000,     0.00],  // Mortgagee/Owner Level 3
                [ "IN3",   "MOL3",    75000.01,    150000.00,     2.000,     0.00],  // Mortgagee/Owner Level 4
                [ "IN3",   "MOL4",   150000.01,    200000.00,     1.500,     0.00],  // Mortgagee/Owner Level 5
                [ "IN3",   "MOL5",   200000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 6
               	[ "IN3",   "REFI",        0.00,        10.00,    50.000,     0.00],  // Refinance
                [ "IN3",   "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
               	[ "IN3",   "SIOM",        0.00,         0.00,    50.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "IN3",   "TCON",        0.00,         0.00,     1.000,     0.00],  // Temp Construction
                
             	[ "KY",    "MINP",        0.00,         0.00,    25.000,     0.00],  // Rate = minimum Prem
                [ "KY",    "MTG1",        0.00,     50000.00,     2.500,     0.00],  // Mortgagee Level 1
                [ "KY",    "MTG2",    50000.01,    100000.00,     2.000,     0.00],  // Mortgagee Level 2
                [ "KY",    "MTG3",   100000.01,    500000.00,     1.750,     0.00],  // Mortgagee Level 3
                [ "KY",    "MTG4",   500000.01,   1000000.00,     1.500,     0.00],  // Mortgagee Level 4
                [ "KY",    "MTG5",  1000000.01,  15000000.00,     1.250,     0.00],  // Mortgagee Level 5
                [ "KY",    "MTG6", 15000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 6
                [ "KY",    "OWN1",        0.00,     50000.00,     4.000,     0.00],  // Owner Level 1
                [ "KY",    "OWN2",    50000.01,    100000.00,     3.500,     0.00],  // Owner Level 2
                [ "KY",    "OWN3",   100000.01,   1000000.00,     2.500,     0.00],  // Owner Level 3
                [ "KY",    "OWN4",  1000000.01,  10000000.00,     2.000,     0.00],  // Owner Level 4
                [ "KY",    "OWN5", 10000000.01, 999999999.99,     1.500,     0.00],  // Owenr Level 5
                [ "KY",    "REFI",        0.00,        10.00,    60.000,     0.00],  // Refinance
                [ "KY",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "KY",    "SIOM",        0.00,         0.00,    50.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "KY",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
                
				[ "LA",    "MINP",        0.00,         0.00,    58.000,    49.00],  // Rate = O minimum Prem; Additional = M Min Prem
                [ "LA",    "MTG1",        0.00,     12000.00,   100.000,     0.00],  // Mortgagee Level 1
                [ "LA",    "MTG2",    12000.01,     50000.00,     4.200,     0.00],  // Mortgagee Level 2
                [ "LA",    "MTG3",    50000.01,    100000.00,     3.600,     0.00],  // Mortgagee Level 3
                [ "LA",    "MTG4",   100000.01,    500000.00,     3.300,     0.00],  // Mortgagee Level 4
                [ "LA",    "MTG5",   500000.01,   1000000.00,     2.700,     0.00],  // Mortgagee Level 5
                [ "LA",    "MTG6",  1000000.01,   2000000.00,     2.400,     0.00],  // Mortgagee Level 6
                [ "LA",    "MTG7",  2000000.01,  15000000.00,     2.100,     0.00],  // Mortgagee Level 7
                [ "LA",    "MTG8", 15000000.01,  25000000.00,     1.800,     0.00],  // Mortgagee Level 8
                [ "LA",    "MTG9", 25000000.01,  35000000.00,     1.500,     0.00],  // Mortgagee Level 9
                [ "LA",    "MTG10",35000000.01, 999999999.99,     1.200,     0.00],  // Mortgagee Level 10
				[ "LA",    "OWN1",        0.00,     12000.00,    58.000,     0.00],  // Owner Level 1
                [ "LA",    "OWN2",    12000.01,     50000.00,     4.500,     0.00],  // Owner Level 2
                [ "LA",    "OWN3",    50000.01,    100000.00,     4.000,     0.00],  // Owner Level 3
                [ "LA",    "OWN4",   100000.01,    500000.00,     3.750,     0.00],  // Owner Level 4
                [ "LA",    "OWN5",   500000.01,   1000000.00,     3.000,     0.00],  // Owner Level 5
                [ "LA",    "OWN6",  1000000.01,   2000000.00,     2.500,     0.00],  // Owner Level 6
                [ "LA",    "OWN7",  2000000.01,  10000000.00,     2.250,     0.00],  // Owner Level 7
                [ "LA",    "OWN8", 10000000.01,  15000000.00,     2.000,     0.00],  // Owner Level 8
                [ "LA",    "OWN9", 15000000.01,  25000000.00,     1.750,     0.00],  // Owner Level 9
                [ "LA",    "OWN10",25000000.01,  35000000.00,     1.500,     0.00],  // Owner Level 10               
				[ "LA",    "OWN11",35000000.01, 999999999.99,     1.250,     0.00],  // Owner Level 11
				[ "LA",    "REFI",        0.00,        15.00,    50.000,     0.00],  // Refinance
                [ "LA",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "LA",    "SIOM",        0.00,         0.00,    30.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "LA",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
             	[ "MD",    "MINP",        0.00,         0.00,   140.000,   111.20],  // Rate = O minimum Prem; Additional = M Min Prem
                [ "MD",    "MTG1",        0.00,    250000.00,     2.780,     0.00],  // Mortgagee Level 1
                [ "MD",    "MTG2",   250000.01,    500000.00,     2.210,     0.00],  // Mortgagee Level 2
                [ "MD",    "MTG3",   500000.01,   1000000.00,     1.940,     0.00],  // Mortgagee Level 3
                [ "MD",    "MTG4",  1000000.01,   5000000.00,     1.680,     0.00],  // Mortgagee Level 4
                [ "MD",    "MTG5",  5000000.01,  15000000.00,     1.310,     0.00],  // Mortgagee Level 5
                [ "MD",    "MTG6", 15000000.01, 999999999.99,     1.050,     0.00],  // Mortgagee Level 6
             	[ "MD",    "OWN1",        0.00,    250000.00,     3.500,     0.00],  // Owner Level 1
                [ "MD",    "OWN2",   250000.01,    500000.00,     3.000,     0.00],  // Owner Level 2
                [ "MD",    "OWN3",   500000.01,   1000000.00,     2.500,     0.00],  // Owner Level 3
                [ "MD",    "OWN4",  1000000.01,   5000000.00,     2.000,     0.00],  // Owner Level 4
                [ "MD",    "OWN5",  5000000.01,  15000000.00,     1.750,     0.00],  // Owner Level 5
                [ "MD",    "OWN6", 15000000.01, 999999999.99,     1.500,     0.00],  // Owner Level 6
             	[ "MD",    "REFI",        0.00,        10.00,    40.000,     0.00],  // Refinance
                [ "MD",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "MD",    "SIOM",        0.00,         0.00,    35.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "MD",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
 				[ "MI1",   "MINP",        0.00,         0.00,   190.000,     0.00],  // Minimum Premium
                [ "MI1",   "MOL1",        0.00,     10000.00,   190.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MI1",   "MOL2",    10000.01,     50000.00,     5.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MI1",   "MOL3",    50000.01,    100000.00,     4.000,     0.00],  // Mortgagee/Owner Level 3
                [ "MI1",   "MOL4",   100000.01,    200000.00,     3.500,     0.00],  // Mortgagee/Owner Level 4
                [ "MI1",   "MOL5",   200000.01,    300000.00,     3.000,     0.00],  // Mortgagee/Owner Level 5
                [ "MI1",   "MOL6",   300000.01,   1000000.00,     2.500,     0.00],  // Mortgagee/Owner Level 6
                [ "MI1",   "MOL7",  1000000.01,   4000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 7
                [ "MI1",   "MOL8",  4000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 8
                [ "MI1",   "MOL9",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 9
                [ "MI1",   "MTG1",        0.00,     14000.00,   190.000,     0.00],  // Mortgagee Level 1
                [ "MI1",   "MTG2",    14000.01,     50000.00,     4.000,     0.00],  // Mortgagee Level 2
                [ "MI1",   "MTG3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee Level 3
                [ "MI1",   "MTG4",   100000.01,    200000.00,     2.750,     0.00],  // Mortgagee Level 4
                [ "MI1",   "MTG5",   200000.01,    300000.00,     2.500,     0.00],  // Mortgagee Level 5
                [ "MI1",   "MTG6",   300000.01,   1000000.00,     2.000,     0.00],  // Mortgagee Level 6
                [ "MI1",   "MTG7",  1000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee Level 7
                [ "MI1",   "MTG8",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 8
 				[ "MI1",   "OWN1",        0.00,     10000.00,   190.000,     0.00],  // Owner Level 1
                [ "MI1",   "OWN2",    10000.01,     50000.00,     5.000,     0.00],  // Owner Level 2
                [ "MI1",   "OWN3",    50000.01,    100000.00,     4.000,     0.00],  // Owner Level 3
                [ "MI1",   "OWN4",   100000.01,    200000.00,     3.500,     0.00],  // Owner Level 4
                [ "MI1",   "OWN5",   200000.01,    300000.00,     3.000,     0.00],  // Owner Level 5
                [ "MI1",   "OWN6",   300000.01,   1000000.00,     2.500,     0.00],  // Owner Level 6
                [ "MI1",   "OWN7",  1000000.01,   4000000.00,     2.000,     0.00],  // Owner Level 7
                [ "MI1",   "OWN8",  4000000.01,   5000000.00,     1.500,     0.00],  // Owner Level 8
                [ "MI1",   "OWN9",  5000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 9
 				[ "MI1",   "REFI",        0.00,         0.11,    40.000,     0.00],  // Refinance Rate Level 1
                [ "MI1",   "REFI",        1.00, 999999999.00,    50.000,     0.00],  // Refinance Rate Level 2
                [ "MI1",   "REIS",        0.00,         0.11,    40.000,     0.00],  // Reissue Rate
                [ "MI1",   "REIS",        1.00,         3.00,    60.000,     0.00],  // Reissue Rate
                [ "MI1",   "REIS",        4.00,         5.00,    80.000,     0.00],  // Reissue Rate
                [ "MI1",   "REIS",        6.00, 999999999.00,    90.000,     0.00],  // Reissue Rate
                [ "MI1",   "SIOM",        0.00,         0.00,    40.000,     0.00],  // Simultaneous Issue
                [ "MI2",   "MINP",        0.00,         0.00,   190.000,     0.00],  // Minimum Premium
                [ "MI2",   "MOL1",        0.00,     11000.00,   190.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MI2",   "MOL2",    11000.01,     50000.00,     4.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MI2",   "MOL3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee/Owner Level 3
                [ "MI2",   "MOL4",   100000.01,    300000.00,     2.500,     0.00],  // Mortgagee/Owner Level 4
                [ "MI2",   "MOL5",   300000.01,   4000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 5
                [ "MI2",   "MOL6",  4000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 6
                [ "MI2",   "MOL7",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 7
                [ "MI2",   "MTG1",        0.00,     19000.00,   190.000,     0.00],  // Mortgagee Level 1
                [ "MI2",   "MTG2",    19000.01,     50000.00,     2.500,     0.00],  // Mortgagee Level 2
                [ "MI2",   "MTG3",    50000.01,    100000.00,     2.000,     0.00],  // Mortgagee Level 3
                [ "MI2",   "MTG4",   100000.01,    300000.00,     1.750,     0.00],  // Mortgagee Level 4
                [ "MI2",   "MTG5",   300000.01,   5000000.00,     1.500,     0.00],  // Mortgagee Level 5
                [ "MI2",   "MTG6",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 6
                [ "MI2",   "OWN1",        0.00,     11000.00,   190.000,     0.00],  // Owner Level 1
                [ "MI2",   "OWN2",    11000.01,     50000.00,     4.000,     0.00],  // Owner Level 2
                [ "MI2",   "OWN3",    50000.01,    100000.00,     3.000,     0.00],  // Owner Level 3
                [ "MI2",   "OWN4",   100000.01,    300000.00,     2.500,     0.00],  // Owner Level 4
                [ "MI2",   "OWN5",   300000.01,   4000000.00,     2.000,     0.00],  // Owner Level 5
                [ "MI2",   "OWN6",  4000000.01,   5000000.00,     1.500,     0.00],  // Owner Level 6
                [ "MI2",   "OWN7",  5000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 7
                [ "MI2",   "REFI",        0.00,         0.11,    40.000,     0.00],  // Refinance Rate Level 1
                [ "MI2",   "REFI",        1.00, 999999999.00,    50.000,     0.00],  // Refinance Rate Level 2
                [ "MI2",   "REIS",        0.00,         0.11,    40.000,     0.00],  // Reissue Rate
                [ "MI2",   "REIS",        1.00,         3.00,    60.000,     0.00],  // Reissue Rate
                [ "MI2",   "REIS",        4.00,         5.00,    80.000,     0.00],  // Reissue Rate
                [ "MI2",   "REIS",        6.00, 999999999.00,    90.000,     0.00],  // Reissue Rate
                [ "MI2",   "SIOM",        0.00,         0.00,    40.000,     0.00],  // Simultaneous Issue
                [ "MIC",   "MINP",        0.00,         0.00,  1750.000,     0.00],  // Minimum Premium
                [ "MIC",   "MOL1",        0.00,   1000000.00,  1750.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MIC",   "MOL2",  1000000.01,  10000000.00,     1.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MIC",   "MOL3", 10000000.01, 100000000.00,     0.850,     0.00],  // Mortgagee/Owner Level 3
                [ "MIC",   "MOL4",100000000.01, 999999999.99,     0.800,     0.00],  // Mortgagee/Owner Level 4
                [ "MIC",   "REFI",        0.00,  10000000.00,    75.000,     0.00],  // Refinance Rate Level 1
                [ "MIC",   "REFI", 10000000.01, 999999999.00,    60.000,     0.00],  // Refinance Rate Level 2
                [ "MIC",   "REIS",        0.00,  10000000.00,    90.000,     0.00],  // Reissue Rate Level 1
                [ "MIC",   "REIS", 10000000.01, 999999999.99,    75.000,     0.00],  // Reissue Rate Level 2
                [ "MIC",   "SIOM",        0.00,         0.00,   100.000,     0.00],  // Simultaneous Issue
                [ "MIK",   "MINP",        0.00,         0.00,   190.000,   104.00],  // Minimum Premium
                [ "MIK",   "MOL1",        0.00,     12000.00,   190.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MIK",   "MOL2",    12000.01,     50000.00,     5.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MIK",   "MOL3",    50000.01,     80000.00,     4.000,     0.00],  // Mortgagee/Owner Level 3
                [ "MIK",   "MOL4",    80000.01,    300000.00,     3.000,     0.00],  // Mortgagee/Owner Level 4
                [ "MIK",   "MOL5",   300000.01,   1000000.00,     2.500,     0.00],  // Mortgagee/Owner Level 5
                [ "MIK",   "MOL6",  1000000.01,   4000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 6
                [ "MIK",   "MOL7",  4000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 7
                [ "MIK",   "MOL8",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 8
               	[ "MIK",   "MTG1",        0.00,     12000.00,   190.000,     0.00],  // Mortgagee Level 1
                [ "MIK",   "MTG2",    12000.01,     50000.00,     4.000,     0.00],  // Mortgagee Level 2
                [ "MIK",   "MTG3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee Level 3
                [ "MIK",   "MTG4",   100000.01,    300000.00,     2.500,     0.00],  // Mortgagee Level 4
                [ "MIK",   "MTG5",   300000.01,   1000000.00,     2.000,     0.00],  // Mortgagee Level 5
                [ "MIK",   "MTG6",  1000000.01, 999999999.99,     1.500,     0.00],  // Mortgagee Level 6
                [ "MIK",   "OWN1",        0.00,     12000.00,   190.000,     0.00],  // Owner Level 1
                [ "MIK",   "OWN2",    12000.01,     50000.00,     5.000,     0.00],  // Owner Level 2
                [ "MIK",   "OWN3",    50000.01,     80000.00,     4.000,     0.00],  // Owner Level 3
                [ "MIK",   "OWN4",    80000.01,    300000.00,     3.000,     0.00],  // Owner Level 4
                [ "MIK",   "OWN5",   300000.01,   1000000.00,     2.500,     0.00],  // Owner Level 5
                [ "MIK",   "OWN6",  1000000.01,   4000000.00,     2.000,     0.00],  // Owner Level 6
                [ "MIK",   "OWN7",  4000000.01,   5000000.00,     1.500,     0.00],  // Owner Level 7
                [ "MIK",   "OWN8",  5000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 8
                [ "MIK",   "REFI",        0.00,         0.11,    40.000,     0.00],  // Refinance Rate Level 1
                [ "MIK",   "REFI",        1.00, 999999999.00,    50.000,     0.00],  // Refinance Rate Level 2
                [ "MIK",   "REIS",        0.00,         0.11,    40.000,     0.00],  // Reissue Rate
                [ "MIK",   "REIS",        1.00,         3.00,    60.000,     0.00],  // Reissue Rate
                [ "MIK",   "REIS",        4.00,         5.00,    80.000,     0.00],  // Reissue Rate
                [ "MIK",   "REIS",        6.00, 999999999.00,    90.000,     0.00],  // Reissue Rate
                [ "MIK",   "SIOM",        0.00,         0.00,    40.000,     0.00],  // Simultaneous Issue
                [ "MI1x",  "MINP",        0.00,         0.00,   165.000,     0.00],  // Minimum Premium
                [ "MI1x",  "MOL1",        0.00,     10000.00,   165.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MI1x",  "MOL2",    10000.01,     50000.00,     5.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MI1x",  "MOL3",    50000.01,    100000.00,     4.000,     0.00],  // Mortgagee/Owner Level 3
                [ "MI1x",  "MOL4",   100000.01,    200000.00,     3.500,     0.00],  // Mortgagee/Owner Level 4
                [ "MI1x",  "MOL5",   200000.01,    300000.00,     3.000,     0.00],  // Mortgagee/Owner Level 5
                [ "MI1x",  "MOL6",   300000.01,   1000000.00,     2.500,     0.00],  // Mortgagee/Owner Level 6
                [ "MI1x",  "MOL7",  1000000.01,   4000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 7
                [ "MI1x",  "MOL8",  4000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 8
                [ "MI1x",  "MOL9",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 9
                [ "MI1x",  "MTG1",        0.00,     14000.00,   165.000,     0.00],  // Mortgagee Level 1
                [ "MI1x",  "MTG2",    14000.01,     50000.00,     4.000,     0.00],  // Mortgagee Level 2
                [ "MI1x",  "MTG3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee Level 3
                [ "MI1x",  "MTG4",   100000.01,    200000.00,     2.750,     0.00],  // Mortgagee Level 4
                [ "MI1x",  "MTG5",   200000.01,    300000.00,     2.500,     0.00],  // Mortgagee Level 5
                [ "MI1x",  "MTG6",   300000.01,   1000000.00,     2.000,     0.00],  // Mortgagee Level 6
                [ "MI1x",  "MTG7",  1000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee Level 7
                [ "MI1x",  "MTG8",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 8
                [ "MI1x",  "OWN1",        0.00,     10000.00,   165.000,     0.00],  // Owner Level 1
                [ "MI1x",  "OWN2",    10000.01,     50000.00,     5.000,     0.00],  // Owner Level 2
                [ "MI1x",  "OWN3",    50000.01,    100000.00,     4.000,     0.00],  // Owner Level 3
                [ "MI1x",  "OWN4",   100000.01,    200000.00,     3.500,     0.00],  // Owner Level 4
                [ "MI1x",  "OWN5",   200000.01,    300000.00,     3.000,     0.00],  // Owner Level 5
                [ "MI1x",  "OWN6",   300000.01,   1000000.00,     2.500,     0.00],  // Owner Level 6
                [ "MI1x",  "OWN7",  1000000.01,   4000000.00,     2.000,     0.00],  // Owner Level 7
                [ "MI1x",  "OWN8",  4000000.01,   5000000.00,     1.500,     0.00],  // Owner Level 8
                [ "MI1x",  "OWN9",  5000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 9
                [ "MI1x",  "REFI",        0.00,         0.11,    40.000,     0.00],  // Refinance Rate Level 1
                [ "MI1x",  "REFI",        1.00, 999999999.00,    50.000,     0.00],  // Refinance Rate Level 2
                [ "MI1x",  "REIS",        0.00,         0.11,    40.000,     0.00],  // Reissue Rate
                [ "MI1x",  "REIS",        1.00,         3.00,    60.000,     0.00],  // Reissue Rate
                [ "MI1x",  "REIS",        4.00,         5.00,    80.000,     0.00],  // Reissue Rate
                [ "MI1x",  "REIS",        6.00, 999999999.00,    90.000,     0.00],  // Reissue Rate
                [ "MI1x",  "SIOM",        0.00,         0.00,    40.000,     0.00],  // Simultaneous Issue
               	[ "MI2x",  "MINP",        0.00,         0.00,   165.000,     0.00],  // Minimum Premium
                [ "MI2x",  "MOL1",        0.00,     11000.00,   165.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MI2x",  "MOL2",    11000.01,     50000.00,     4.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MI2x",  "MOL3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee/Owner Level 3
                [ "MI2x",  "MOL4",   100000.01,    300000.00,     2.500,     0.00],  // Mortgagee/Owner Level 4
                [ "MI2x",  "MOL5",   300000.01,   4000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 5
                [ "MI2x",  "MOL6",  4000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 6
                [ "MI2x",  "MOL7",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 7
                [ "MI2x",  "MTG1",        0.00,     19000.00,   165.000,     0.00],  // Mortgagee Level 1
                [ "MI2x",  "MTG2",    19000.01,     50000.00,     2.500,     0.00],  // Mortgagee Level 2
                [ "MI2x",  "MTG3",    50000.01,    100000.00,     2.000,     0.00],  // Mortgagee Level 3
                [ "MI2x",  "MTG4",   100000.01,    300000.00,     1.750,     0.00],  // Mortgagee Level 4
                [ "MI2x",  "MTG5",   300000.01,   5000000.00,     1.500,     0.00],  // Mortgagee Level 5
                [ "MI2x",  "MTG6",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 6
               	[ "MI2x",  "OWN1",        0.00,     11000.00,   165.000,     0.00],  // Owner Level 1
                [ "MI2x",  "OWN2",    11000.01,     50000.00,     4.000,     0.00],  // Owner Level 2
                [ "MI2x",  "OWN3",    50000.01,    100000.00,     3.000,     0.00],  // Owner Level 3
                [ "MI2x",  "OWN4",   100000.01,    300000.00,     2.500,     0.00],  // Owner Level 4
                [ "MI2x",  "OWN5",   300000.01,   4000000.00,     2.000,     0.00],  // Owner Level 5
                [ "MI2x",  "OWN6",  4000000.01,   5000000.00,     1.500,     0.00],  // Owner Level 6
                [ "MI2x",  "OWN7",  5000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 7
               	[ "MI2x",  "REFI",        0.00,         0.11,    40.000,     0.00],  // Refinance Rate Level 1
                [ "MI2x",  "REFI",        1.00, 999999999.00,    50.000,     0.00],  // Refinance Rate Level 2
                [ "MI2x",  "REIS",        0.00,         0.11,    40.000,     0.00],  // Reissue Rate
                [ "MI2x",  "REIS",        1.00,         3.00,    60.000,     0.00],  // Reissue Rate
                [ "MI2x",  "REIS",        4.00,         5.00,    80.000,     0.00],  // Reissue Rate
                [ "MI2x",  "REIS",        6.00, 999999999.00,    90.000,     0.00],  // Reissue Rate
                [ "MI2x",  "SIOM",        0.00,         0.00,    40.000,     0.00],  // Simultaneous Issue
               	[ "MIKx",  "MINP",        0.00,         0.00,   165.000,   104.00],  // Minimum Premium
                [ "MIKx",  "MOL1",        0.00,     12000.00,   165.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MIKx",  "MOL2",    12000.01,     50000.00,     5.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MIKx",  "MOL3",    50000.01,     80000.00,     4.000,     0.00],  // Mortgagee/Owner Level 3
                [ "MIKx",  "MOL4",    80000.01,    300000.00,     3.000,     0.00],  // Mortgagee/Owner Level 4
                [ "MIKx",  "MOL5",   300000.01,   1000000.00,     2.500,     0.00],  // Mortgagee/Owner Level 5
                [ "MIKx",  "MOL6",  1000000.01,   4000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 6
                [ "MIKx",  "MOL7",  4000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 7
                [ "MIKx",  "MOL8",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 8
                [ "MIKx",  "MTG1",        0.00,     12000.00,   165.000,     0.00],  // Mortgagee Level 1
                [ "MIKx",  "MTG2",    12000.01,     50000.00,     4.000,     0.00],  // Mortgagee Level 2
                [ "MIKx",  "MTG3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee Level 3
                [ "MIKx",  "MTG4",   100000.01,    300000.00,     2.500,     0.00],  // Mortgagee Level 4
                [ "MIKx",  "MTG5",   300000.01,   1000000.00,     2.000,     0.00],  // Mortgagee Level 5
                [ "MIKx",  "MTG6",  1000000.01, 999999999.99,     1.500,     0.00],  // Mortgagee Level 6
                [ "MIKx",  "NERE",  2000000.01,   2250000.00,     0.300,     0.00],  // Reinsurance - (NE)
                [ "MIKx",  "OWN1",        0.00,     12000.00,   165.000,     0.00],  // Owner Level 1
                [ "MIKx",  "OWN2",    12000.01,     50000.00,     5.000,     0.00],  // Owner Level 2
                [ "MIKx",  "OWN3",    50000.01,     80000.00,     4.000,     0.00],  // Owner Level 3
                [ "MIKx",  "OWN4",    80000.01,    300000.00,     3.000,     0.00],  // Owner Level 4
                [ "MIKx",  "OWN5",   300000.01,   1000000.00,     2.500,     0.00],  // Owner Level 5
                [ "MIKx",  "OWN6",  1000000.01,   4000000.00,     2.000,     0.00],  // Owner Level 6
                [ "MIKx",  "OWN7",  4000000.01,   5000000.00,     1.500,     0.00],  // Owner Level 7
                [ "MIKx",  "OWN8",  5000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 8
                [ "MIKx",  "REFI",        0.00,         0.11,    40.000,     0.00],  // Refinance Rate Level 1
                [ "MIKx",  "REFI",        1.00, 999999999.00,    50.000,     0.00],  // Refinance Rate Level 2
                [ "MIKx",  "REIS",        0.00,         0.11,    40.000,     0.00],  // Reissue Rate
                [ "MIKx",  "REIS",        1.00,         3.00,    60.000,     0.00],  // Reissue Rate
                [ "MIKx",  "REIS",        4.00,         5.00,    80.000,     0.00],  // Reissue Rate
                [ "MIKx",  "REIS",        6.00, 999999999.00,    90.000,     0.00],  // Reissue Rate
                [ "MIKx",  "SIOM",        0.00,         0.00,    40.000,     0.00],  // Simultaneous Issue
                [ "MI1m",  "MINP",        0.00,         0.00,   160.000,     0.00],  // Minimum Premium
                [ "MI1m",  "MOL1",        0.00,     10000.00,   160.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MI1m",  "MOL2",    10000.01,     50000.00,     5.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MI1m",  "MOL3",    50000.01,    100000.00,     4.000,     0.00],  // Mortgagee/Owner Level 3
                [ "MI1m",  "MOL4",   100000.01,    200000.00,     3.500,     0.00],  // Mortgagee/Owner Level 4
                [ "MI1m",  "MOL5",   200000.01,    300000.00,     3.000,     0.00],  // Mortgagee/Owner Level 5
                [ "MI1m",  "MOL6",   300000.01,   1000000.00,     2.500,     0.00],  // Mortgagee/Owner Level 6
                [ "MI1m",  "MOL7",  1000000.01,   4000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 7
                [ "MI1m",  "MOL8",  4000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 8
                [ "MI1m",  "MOL9",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 9
                [ "MI1m",  "MTG1",        0.00,     14000.00,   160.000,     0.00],  // Mortgagee Level 1
                [ "MI1m",  "MTG2",    14000.01,     50000.00,     4.000,     0.00],  // Mortgagee Level 2
                [ "MI1m",  "MTG3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee Level 3
                [ "MI1m",  "MTG4",   100000.01,    200000.00,     2.750,     0.00],  // Mortgagee Level 4
                [ "MI1m",  "MTG5",   200000.01,    300000.00,     2.500,     0.00],  // Mortgagee Level 5
                [ "MI1m",  "MTG6",   300000.01,   1000000.00,     2.000,     0.00],  // Mortgagee Level 6
                [ "MI1m",  "MTG7",  1000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee Level 7
                [ "MI1m",  "MTG8",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 8
                [ "MI1m",  "OWN1",        0.00,     10000.00,   160.000,     0.00],  // Owner Level 1
                [ "MI1m",  "OWN2",    10000.01,     50000.00,     5.000,     0.00],  // Owner Level 2
                [ "MI1m",  "OWN3",    50000.01,    100000.00,     4.000,     0.00],  // Owner Level 3
                [ "MI1m",  "OWN4",   100000.01,    200000.00,     3.500,     0.00],  // Owner Level 4
                [ "MI1m",  "OWN5",   200000.01,    300000.00,     3.000,     0.00],  // Owner Level 5
                [ "MI1m",  "OWN6",   300000.01,   1000000.00,     2.500,     0.00],  // Owner Level 6
                [ "MI1m",  "OWN7",  1000000.01,   4000000.00,     2.000,     0.00],  // Owner Level 7
                [ "MI1m",  "OWN8",  4000000.01,   5000000.00,     1.500,     0.00],  // Owner Level 8
                [ "MI1m",  "OWN9",  5000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 9
                [ "MI1m",  "REFI",        0.00,         0.11,    40.000,     0.00],  // Refinance Rate Level 1
                [ "MI1m",  "REFI",        1.00, 999999999.00,    50.000,     0.00],  // Refinance Rate Level 2
                [ "MI1m",  "REIS",        0.00,         0.11,    40.000,     0.00],  // Reissue Rate
                [ "MI1m",  "REIS",        1.00,         3.00,    60.000,     0.00],  // Reissue Rate
                [ "MI1m",  "REIS",        4.00,         5.00,    80.000,     0.00],  // Reissue Rate
                [ "MI1m",  "REIS",        6.00, 999999999.00,    90.000,     0.00],  // Reissue Rate
                [ "MI1m",  "SIOM",        0.00,         0.00,    40.000,     0.00],  // Simultaneous Issue
                [ "MI2m",  "MINP",        0.00,         0.00,   160.000,     0.00],  // Minimum Premium
                [ "MI2m",  "MOL1",        0.00,     11000.00,   160.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MI2m",  "MOL2",    11000.01,     50000.00,     4.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MI2m",  "MOL3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee/Owner Level 3
                [ "MI2m",  "MOL4",   100000.01,    300000.00,     2.500,     0.00],  // Mortgagee/Owner Level 4
                [ "MI2m",  "MOL5",   300000.01,   4000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 5
                [ "MI2m",  "MOL6",  4000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 6
                [ "MI2m",  "MOL7",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 7
                [ "MI2m",  "MTG1",        0.00,     19000.00,   160.000,     0.00],  // Mortgagee Level 1
                [ "MI2m",  "MTG2",    19000.01,     50000.00,     2.500,     0.00],  // Mortgagee Level 2
                [ "MI2m",  "MTG3",    50000.01,    100000.00,     2.000,     0.00],  // Mortgagee Level 3
                [ "MI2m",  "MTG4",   100000.01,    300000.00,     1.750,     0.00],  // Mortgagee Level 4
                [ "MI2m",  "MTG5",   300000.01,   5000000.00,     1.500,     0.00],  // Mortgagee Level 5
                [ "MI2m",  "MTG6",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 6
               	[ "MI2m",  "OWN1",        0.00,     11000.00,   160.000,     0.00],  // Owner Level 1
                [ "MI2m",  "OWN2",    11000.01,     50000.00,     4.000,     0.00],  // Owner Level 2
                [ "MI2m",  "OWN3",    50000.01,    100000.00,     3.000,     0.00],  // Owner Level 3
                [ "MI2m",  "OWN4",   100000.01,    300000.00,     2.500,     0.00],  // Owner Level 4
                [ "MI2m",  "OWN5",   300000.01,   4000000.00,     2.000,     0.00],  // Owner Level 5
                [ "MI2m",  "OWN6",  4000000.01,   5000000.00,     1.500,     0.00],  // Owner Level 6
                [ "MI2m",  "OWN7",  5000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 7
               	[ "MI2m",  "REFI",        0.00,         0.11,    40.000,     0.00],  // Refinance Rate Level 1
                [ "MI2m",  "REFI",        1.00, 999999999.00,    50.000,     0.00],  // Refinance Rate Level 2
                [ "MI2m",  "REIS",        0.00,         0.11,    40.000,     0.00],  // Reissue Rate
                [ "MI2m",  "REIS",        1.00,         3.00,    60.000,     0.00],  // Reissue Rate
                [ "MI2m",  "REIS",        4.00,         5.00,    80.000,     0.00],  // Reissue Rate
                [ "MI2m",  "REIS",        6.00, 999999999.00,    90.000,     0.00],  // Reissue Rate
                [ "MI2m",  "SIOM",        0.00,         0.00,    40.000,     0.00],  // Simultaneous Issue
                [ "MIKm",  "MINP",        0.00,         0.00,   160.000,   104.00],  // Minimum Premium
                [ "MIKm",  "MOL1",        0.00,     12000.00,   160.000,     0.00],  // Mortgagee/Owner Level 1
                [ "MIKm",  "MOL2",    12000.01,     50000.00,     5.000,     0.00],  // Mortgagee/Owner Level 2
                [ "MIKm",  "MOL3",    50000.01,     80000.00,     4.000,     0.00],  // Mortgagee/Owner Level 3
                [ "MIKm",  "MOL4",    80000.01,    300000.00,     3.000,     0.00],  // Mortgagee/Owner Level 4
                [ "MIKm",  "MOL5",   300000.01,   1000000.00,     2.500,     0.00],  // Mortgagee/Owner Level 5
                [ "MIKm",  "MOL6",  1000000.01,   4000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 6
                [ "MIKm",  "MOL7",  4000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 7
                [ "MIKm",  "MOL8",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 8
                [ "MIKm",  "MTG1",        0.00,     12000.00,   160.000,     0.00],  // Mortgagee Level 1
                [ "MIKm",  "MTG2",    12000.01,     50000.00,     4.000,     0.00],  // Mortgagee Level 2
                [ "MIKm",  "MTG3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee Level 3
                [ "MIKm",  "MTG4",   100000.01,    300000.00,     2.500,     0.00],  // Mortgagee Level 4
                [ "MIKm",  "MTG5",   300000.01,   1000000.00,     2.000,     0.00],  // Mortgagee Level 5
                [ "MIKm",  "MTG6",  1000000.01, 999999999.99,     1.500,     0.00],  // Mortgagee Level 6
                [ "MIKm",  "OWN1",        0.00,     12000.00,   160.000,     0.00],  // Owner Level 1
                [ "MIKm",  "OWN2",    12000.01,     50000.00,     5.000,     0.00],  // Owner Level 2
                [ "MIKm",  "OWN3",    50000.01,     80000.00,     4.000,     0.00],  // Owner Level 3
                [ "MIKm",  "OWN4",    80000.01,    300000.00,     3.000,     0.00],  // Owner Level 4
                [ "MIKm",  "OWN5",   300000.01,   1000000.00,     2.500,     0.00],  // Owner Level 5
                [ "MIKm",  "OWN6",  1000000.01,   4000000.00,     2.000,     0.00],  // Owner Level 6
                [ "MIKm",  "OWN7",  4000000.01,   5000000.00,     1.500,     0.00],  // Owner Level 7
                [ "MIKm",  "OWN8",  5000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 8
                [ "MIKm",  "REFI",        0.00,         0.11,    40.000,     0.00],  // Refinance Rate Level 1
                [ "MIKm",  "REFI",        1.00, 999999999.00,    50.000,     0.00],  // Refinance Rate Level 2
                [ "MIKm",  "REIS",        0.00,         0.11,    40.000,     0.00],  // Reissue Rate
                [ "MIKm",  "REIS",        1.00,         3.00,    60.000,     0.00],  // Reissue Rate
                [ "MIKm",  "REIS",        4.00,         5.00,    80.000,     0.00],  // Reissue Rate
                [ "MIKm",  "REIS",        6.00, 999999999.00,    90.000,     0.00],  // Reissue Rate
                [ "MIKm",  "SIOM",        0.00,         0.00,    40.000,     0.00],  // Simultaneous Issue
               	[ "MS",    "MINP",        0.00,         0.00,    50.000,     0.00],  // Minimum Premium
                [ "MS",    "MTG1",        0.00,    100000.00,     3.000,     0.00],  // Mortgagee Level 1
                [ "MS",    "MTG2",   100000.01,   1000000.00,     2.500,     0.00],  // Mortgagee Level 2
                [ "MS",    "MTG3",  1000000.01,  10000000.00,     1.500,     0.00],  // Mortgagee Level 3
      			[ "MS",    "MTG4", 10000000.01, 999999999.99,     1.250,     0.00],  // Mortgagee Level 4
				[ "MS",    "OWN1",        0.00,    100000.00,     4.000,     0.00],  // Owner Level 1
                [ "MS",    "OWN2",   100000.01,   1000000.00,     3.000,     0.00],  // Owner Level 2
                [ "MS",    "OWN3",  1000000.01,  10000000.00,     2.000,     0.00],  // Owner Level 3
                [ "MS",    "OWN4", 10000000.01, 999999999.99,     1.500,     0.00],  // Owner Level 4
				[ "MS",    "REFI",        0.00,        15.00,    50.000,     0.00],  // Refinance
                [ "MS",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue
                [ "MS",    "SIOM",        0.00,         0.00,    25.000,     0.00],  // Simultaneous Issue; flat rate
		        [ "MS",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
				[ "NE",    "MINP",        0.00,         0.00,   100.000,     0.00],  // Minimum Premium Amount
                [ "NE",    "MOL1",        0.00,     20000.00,   100.000,     0.00],  // Mortgagee/Owner Level 1
                [ "NE",    "MOL2",    20000.01,     50000.00,     3.500,     0.00],  // Mortgagee/Owner Level 2
                [ "NE",    "MOL3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee/Owner Level 3
                [ "NE",    "MOL4",   100000.01,   1000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 4
                [ "NE",    "MOL5",  1000000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 5
                [ "NE",    "MOL6",  5000000.01,  10000000.00,     1.200,     0.00],  // Mortgagee/Owner Level 6
                [ "NE",    "MOL7", 10000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 7
                [ "NE",    "REFI",        0.00,         5.00,    70.000,     0.00],  // Refinance
               	[ "NE",    "SIOM",        0.00,         0.00,    50.000,     0.00],  // Simultaneous Issue; flat rate
		       	[ "NE1",   "MINP",        0.00,         0.00,   100.000,     0.00],  // Minimum Premium Amount
                [ "NE1",   "MOL1",        0.00,      5000.00,   100.000,     0.00],  // Mortgagee/Owner Level 1
                [ "NE1",   "MOL2",     5000.01,     50000.00,     3.500,     0.00],  // Mortgagee/Owner Level 2
                [ "NE1",   "MOL3",    50000.01,    100000.00,     3.000,     0.00],  // Mortgagee/Owner Level 3
                [ "NE1",   "MOL4",   100000.01,   1000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 4
                [ "NE1",   "MOL5",  1000000.01,  50000000.00,     1.500,     0.00],  // Mortgagee/Owner Level 5
                [ "NE1",   "MOL6",  5000000.01,  10000000.00,     1.200,     0.00],  // Mortgagee/Owner Level 6
                [ "NE1",   "MOL7", 10000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 7
                [ "NE1",   "REFI",        0.00,         5.00,    70.000,     0.00],  // Refinance
               	[ "NE1",   "SIOM",        0.00,         0.00,    50.000,     0.00],  // Simultaneous Issue; flat rate

		        [ "NJ",    "MINP",        0.00,         0.00,   200.000,     0.00],  // Minimum Premium Amount
                [ "NJ",    "MOL1",        0.00,    100000.00,     5.000,     0.00],  // Mortgagee/Owner Level 1
                [ "NJ",    "MOL2",   100000.01,    500000.00,     3.950,     0.00],  // Mortgagee/Owner Level 2
                [ "NJ",    "MOL3",   500000.01,   2000000.00,     2.650,     0.00],  // Mortgagee/Owner Level 3
                [ "NJ",    "MOL4",  2000000.01, 999999999.99,     2.000,     0.00],  // Mortgagee/Owner Level 4
                [ "NJ",    "REF1",        0.00,    100000.00,     2.500,     0.00],  // Refi Level 1
                [ "NJ",    "REF2",   100000.01,    500000.00,     2.250,     0.00],  // Refi Level 2
                [ "NJ",    "REF3",   500000.01,   2000000.00,     2.000,     0.00],  // Refi Level 3
                [ "NJ",    "REF4",  2000000.01, 999999999.99,     1.500,     0.00],  // Refi Level 4
                [ "NJ",    "SIOM",        0.00,         0.00,    25.000,     0.00],  // Simultaneous Issue; flat rate
				[ "NJ",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temp Construction


/*		[ "NY1",   "MODOWN1",        0.00,     35000.00,    178.00,     0.00],  // Owner Level 1
		[ "NY1",   "MODOWN2",    35000.01,     50000.00,     3.96,     0.00],  // Owner Level 2
		[ "NY1",   "MODOWN3",    50000.01,    100000.00,     2.47,     0.00],  // Owner Level 3
		[ "NY1",   "MODOWN4",   100000.01,    500000.00,     1.99,     0.00],  // Owner Level 4
		[ "NY1",   "MODOWN5",   500000.01,   1000000.00,     1.78,     0.00],  // Owner Level 5				
		[ "NY1",   "MODOWN6",  1000000.01,   5000000.00,     1.625,     0.00],  // Owner Level 6
		[ "NY1",   "MODOWN7",  5000000.01,  10000000.00,     1.48,     0.00],  // Owner Level 7
		[ "NY1",   "MODOWN8", 10000000.01,  15000000.00,     1.38,     0.00],  // Owner Level 8
		[ "NY1",   "MODOWN9", 15000000.01, 999999999.99,     1.24,     0.00],  // Owner Level 9				
		
		[ "NY2",   "MODOWN1",        0.00,     35000.00,    201.00,     0.00],  // Owner Level 1
		[ "NY2",   "MODOWN2",    35000.01,     50000.00,     3.335,     0.00],  // Owner Level 2
		[ "NY2",   "MODOWN3",    50000.01,    100000.00,     2.715,     0.00],  // Owner Level 3
		[ "NY2",   "MODOWN4",   100000.01,    500000.00,     2.18,     0.00],  // Owner Level 4
		[ "NY2",   "MODOWN5",   500000.01,   1000000.00,     1.99,     0.00],  // Owner Level 5				
		[ "NY2",   "MODOWN6",  1000000.01,   5000000.00,     1.83,     0.00],  // Owner Level 6
		[ "NY2",   "MODOWN7",  5000000.01,  10000000.00,     1.625,     0.00],  // Owner Level 7
		[ "NY2",   "MODOWN8", 10000000.01,  15000000.00,     1.535,     0.00],  // Owner Level 8
		[ "NY2",   "MODOWN9", 15000000.01, 999999999.99,     1.38,     0.00],  // Owner Level 9
		
		[ "NY2",   "LOWMODOWN1",        0.00,     35000.00,    170.85,     0.00],  // Owner Level 1
		[ "NY2",   "LOWMODOWN2",    35000.01,     50000.00,     2.835,     0.00],  // Owner Level 2
		[ "NY2",   "LOWMODOWN3",    50000.01,    100000.00,     2.31,     0.00],  // Owner Level 3
		[ "NY2",   "LOWMODOWN4",   100000.01,    500000.00,     1.855,     0.00],  // Owner Level 4
		[ "NY2",   "LOWMODOWN5",   500000.01,   1000000.00,     1.69,     0.00],  // Owner Level 5				
		[ "NY2",   "LOWMODOWN6",  1000000.01,   5000000.00,     1.83,     0.00],  // Owner Level 6
		[ "NY2",   "LOWMODOWN7",  5000000.01,  10000000.00,     1.625,     0.00],  // Owner Level 7
		[ "NY2",   "LOWMODOWN8", 10000000.01,  15000000.00,     1.535,     0.00],  // Owner Level 8
		[ "NY2",   "LOWMODOWN9", 15000000.01, 999999999.99,     1.38,     0.00],  // Owner Level 9
		
*/
		[ "NY1",   "MINP",        0.00,         0.00,   299.000,   299.00],  // Rate = O minimum Prem; Additional = M Min Prem				

		[ "NY1",   "MTG1",        0.00,     35000.00,    299.00,     0.00],  // Mortgagee Level 1
		[ "NY1",   "MTG2",    35000.01,     50000.00,     6.610,     0.00],  // Mortgagee Level 2
		[ "NY1",   "MTG3",    50000.01,    100000.00,     4.100,     0.00],  // Mortgagee Level 3
		[ "NY1",   "MTG4",   100000.01,    500000.00,     3.310,     0.00],  // Mortgagee Level 4
		[ "NY1",   "MTG5",   500000.01,   1000000.00,     2.960,     0.00],  // Mortgagee Level 5				
		[ "NY1",   "MTG6",  1000000.01,   5000000.00,     2.710,     0.00],  // Mortgagee Level 6
		[ "NY1",   "MTG7",  5000000.01,  10000000.00,     2.470,     0.00],  // Mortgagee Level 7
		[ "NY1",   "MTG8", 10000000.01,  15000000.00,     2.310,     0.00],  // Mortgagee Level 8
		[ "NY1",   "MTG9", 15000000.01, 999999999.99,     2.070,     0.00],  // Mortgagee Level 9				

		[ "NY1",   "OWN1",        0.00,     35000.00,    356.00,     0.00],  // Owner Level 1
		[ "NY1",   "OWN2",    35000.01,     50000.00,     7.920,     0.00],  // Owner Level 2
		[ "NY1",   "OWN3",    50000.01,    100000.00,     4.940,     0.00],  // Owner Level 3
		[ "NY1",   "OWN4",   100000.01,    500000.00,     3.980,     0.00],  // Owner Level 4
		[ "NY1",   "OWN5",   500000.01,   1000000.00,     3.560,     0.00],  // Owner Level 5				
		[ "NY1",   "OWN6",  1000000.01,   5000000.00,     3.250,     0.00],  // Owner Level 6
		[ "NY1",   "OWN7",  5000000.01,  10000000.00,     2.960,     0.00],  // Owner Level 7
		[ "NY1",   "OWN8", 10000000.01,  15000000.00,     2.760,     0.00],  // Owner Level 8
		[ "NY1",   "OWN9", 15000000.01, 999999999.99,     2.480,     0.00],  // Owner Level 9	
		
		[ "NY1",   "MODMTG1",        0.00,     35000.00,    149.50,     0.00],  // Mortgagee Level 1
		[ "NY1",   "MODMTG2",    35000.01,     50000.00,     3.305,     0.00],  // Mortgagee Level 2
		[ "NY1",   "MODMTG3",    50000.01,    100000.00,     2.050,     0.00],  // Mortgagee Level 3
		[ "NY1",   "MODMTG4",   100000.01,    500000.00,     1.655,     0.00],  // Mortgagee Level 4
		[ "NY1",   "MODMTG5",   500000.01,   1000000.00,     1.48,     0.00],  // Mortgagee Level 5				
		[ "NY1",   "MODMTG6",  1000000.01,   5000000.00,     1.355,     0.00],  // Mortgagee Level 6
		[ "NY1",   "MODMTG7",  5000000.01,  10000000.00,     1.235,     0.00],  // Mortgagee Level 7
		[ "NY1",   "MODMTG8", 10000000.01,  15000000.00,     1.155,     0.00],  // Mortgagee Level 8
		[ "NY1",   "MODMTG9", 15000000.01, 999999999.99,     1.035,     0.00],  // Mortgagee Level 9				

		[ "NY1",   "REFI",        0.00,    475000.00,     0.000,     0.00],  // Refinance cvg ceiling for rate break
		[ "NY1",   "REFx",        0.00,        10.00,    50.000,     0.00],  // Refinance <= 250K cvg
		[ "NY1",   "REFy",        0.00,        10.00,    70.000,     0.00],  // Refinance > 250K cvg
		[ "NY1",   "SIOM",        0.00,         0.00,    30.000,     0.00],  // simul rate

		[ "NY2",   "MINP",        0.00,         0.00,   341.700,   344.00],  // Rate = O minimum Prem; Additional = M Min Prem	
			
		[ "NY2",   "MODMTG1",        0.00,     35000.00,    172.00,     0.00],  // Mortgagee Level 1
		[ "NY2",   "MODMTG2",    35000.01,     50000.00,     2.775,     0.00],  // Mortgagee Level 2
		[ "NY2",   "MODMTG3",    50000.01,    100000.00,     2.27,     0.00],  // Mortgagee Level 3
		[ "NY2",   "MODMTG4",   100000.01,    500000.00,     1.82,     0.00],  // Mortgagee Level 4
		[ "NY2",   "MODMTG5",   500000.01,   1000000.00,     1.655,     0.00],  // Mortgagee Level 5				
		[ "NY2",   "MODMTG6",  1000000.01,   5000000.00,     1.525,     0.00],  // Mortgagee Level 6
		[ "NY2",   "MODMTG7",  5000000.01,  10000000.00,     1.355,     0.00],  // Mortgagee Level 7
		[ "NY2",   "MODMTG8", 10000000.01,  15000000.00,     1.275,     0.00],  // Mortgagee Level 8
		[ "NY2",   "MODMTG9", 15000000.01, 999999999.99,     1.155,     0.00],  // Mortgagee Level 9

	
		[ "NY2",   "MTG1",        0.00,     35000.00,    344.00,     0.00],  // Mortgagee Level 1
		[ "NY2",   "MTG2",    35000.01,     50000.00,     5.550,     0.00],  // Mortgagee Level 2
		[ "NY2",   "MTG3",    50000.01,    100000.00,     4.540,     0.00],  // Mortgagee Level 3
		[ "NY2",   "MTG4",   100000.01,    500000.00,     3.640,     0.00],  // Mortgagee Level 4
		[ "NY2",   "MTG5",   500000.01,   1000000.00,     3.310,     0.00],  // Mortgagee Level 5				
		[ "NY2",   "MTG6",  1000000.01,   5000000.00,     3.050,     0.00],  // Mortgagee Level 6
		[ "NY2",   "MTG7",  5000000.01,  10000000.00,     2.710,     0.00],  // Mortgagee Level 7
		[ "NY2",   "MTG8", 10000000.01,  15000000.00,     2.550,     0.00],  // Mortgagee Level 8
		[ "NY2",   "MTG9", 15000000.01, 999999999.99,     2.310,     0.00],  // Mortgagee Level 9

		[ "NY2",   "LOWOWN1",        0.00,     35000.00,    341.70,     0.00],  // Owner Level 1
		[ "NY2",   "LOWOWN2",    35000.01,     50000.00,     5.6695,     0.00],  // Owner Level 2
		[ "NY2",   "LOWOWN3",    50000.01,    100000.00,     4.6155,     0.00],  // Owner Level 3
		[ "NY2",   "LOWOWN4",   100000.01,    500000.00,     3.706,     0.00],  // Owner Level 4
		[ "NY2",   "LOWOWN5",   500000.01,   1000000.00,     3.383,     0.00],  // Owner Level 5				
		[ "NY2",   "LOWOWN6",  1000000.01,   5000000.00,     3.660,     0.00],  // Owner Level 6
		[ "NY2",   "LOWOWN7",  5000000.01,  10000000.00,     3.250,     0.00],  // Owner Level 7
		[ "NY2",   "LOWOWN8", 10000000.01,  15000000.00,     3.070,     0.00],  // Owner Level 8
		[ "NY2",   "LOWOWN9", 15000000.01, 999999999.99,     2.760,     0.00],  // Owner Level 9

		[ "NY2",   "OWN1",        0.00,     35000.00,    402.00,     0.00],  // Owner Level 1
		[ "NY2",   "OWN2",    35000.01,     50000.00,     6.670,     0.00],  // Owner Level 2
		[ "NY2",   "OWN3",    50000.01,    100000.00,     5.430,     0.00],  // Owner Level 3
		[ "NY2",   "OWN4",   100000.01,    500000.00,     4.360,     0.00],  // Owner Level 4
		[ "NY2",   "OWN5",   500000.01,   1000000.00,     3.980,     0.00],  // Owner Level 5				
		[ "NY2",   "OWN6",  1000000.01,   5000000.00,     3.660,     0.00],  // Owner Level 6
		[ "NY2",   "OWN7",  5000000.01,  10000000.00,     3.250,     0.00],  // Owner Level 7
		[ "NY2",   "OWN8", 10000000.01,  15000000.00,     3.070,     0.00],  // Owner Level 8
		[ "NY2",   "OWN9", 15000000.01, 999999999.99,     2.760,     0.00],  // Owner Level 9

		[ "NY2",   "REFI",        0.00,    475000.00,     0.000,     0.00],  // Refinance cvg ceiling for rate break
		[ "NY2",   "REFx",        0.00,        10.00,    50.000,     0.00],  // Refinance <= 250K cvg
		[ "NY2",   "REFy",        0.00,        10.00,    70.000,     0.00],  // Refinance > 250K cvg
		[ "NY2",   "SIOM",        0.00,         0.00,    30.000,     0.00],  // simul rate
				
				
				[ "NC",    "CHOU",        0.00,         0.00,     0.750,     0.00],  // Community Housing Rate
                [ "NC",    "CMER",        0.00,         0.00,     0.750,     0.00],  // Commercial Rate
                [ "NC",    "MINP",        0.00,         0.00,    50.000,     0.00],  // Minimum Premium Amount
                [ "NC",    "MOL1",        0.00,    100000.00,     2.000,     0.00],  // Mortgagee/Owner Level 1
                [ "NC",    "MOL2",   100000.01,    500000.00,     1.500,     0.00],  // Mortgagee/Owner Level 2
                [ "NC",    "MOL3",   500000.01,   2000000.00,     1.000,     0.00],  // Mortgagee/Owner Level 3
                [ "NC",    "MOL4",  2000000.01,   7000000.00,     0.750,     0.00],  // Mortgagee/Owner Level 4
                [ "NC",    "MOL5",  7000000.01, 999999999.99,     0.500,     0.00],  // Mortgagee/Owner Level 5
               	[ "NC",    "REFI",        0.00,        15.00,    50.000,     0.00],  // Refinance
                [ "NC",    "REIS",        0.00,        15.00,    50.000,     0.00],  // Re-Issue Rate
                [ "NC",    "SDSA",        0.00,         0.00,     0.750,     0.00],  // Subdivider/Developer Sales
                [ "NC",    "TCON",        0.00,         0.00,     0.250,     0.00],  // Temporary Construction
				
				[ "OH",    "MINP",        0.00,         0.00,   175.000,    125.00],  // Minimum Premium; owner, additional - mtgee
                [ "OH",    "MTG1",        0.00,    150000.00,     4.000,     0.00],  // Mortgagee Level 1
                [ "OH",    "MTG2",   150000.01,    250000.00,     3.250,     0.00],  // Mortgagee Level 2
                [ "OH",    "MTG3",   250000.01,    500000.00,     2.500,     0.00],  // Mortgagee Level 3
      			[ "OH",    "MTG4",   500000.01,  10000000.00,     2.250,     0.00],  // Mortgagee Level 4                
                [ "OH",    "MTG5", 10000000.01, 999999999.99,     2.000,     0.00],  // Mortgagee Level 5
				
				[ "OH",    "OWN1",        0.00,    150000.00,     5.750,     0.00],  // Owner Level 1
                [ "OH",    "OWN2",   150000.01,    250000.00,     4.500,     0.00],  // Owner Level 3
                [ "OH",    "OWN3",   250000.01,    500000.00,     3.500,     0.00],  // Owner Level 4
				[ "OH",    "OWN4",   500000.01,  10000000.00,     2.750,     0.00],  // Owner Level 5
                [ "OH",    "OWN5", 10000000.01, 999999999.99,     2.250,     0.00],  // Owner Level 6
                
                [ "OH",    "REFI",        0.00,        10.00,    70.000,     0.00],  // Refinance
                [ "OH",    "REIS",        0.00,        10.00,    70.000,     0.00],  // Reissue
                [ "OH",    "SIOM",        0.00,         0.00,    100.000,     0.00],  // Simultaneous Issue; flat rate
				[ "OH",    "TCN1",        0.00,    500000.00,     2.500,     0.00],  // Temporary Construction - level 1
				[ "OH",    "TCN2",   500000.01, 999999999.99,     1.500,     0.00],  // Temporary Construction - level 2


               	[ "PA",    "MINP",        0.00,         0.00,   125.000,     0.00],  // Minimum Premium
                [ "PA",    "MOL1",        0.00,     30000.00,   125.000,     0.00],  // Mortgagee/Owner Level 1
                [ "PA",    "MOL2",    30000.01,    100000.00,     3.250,     0.00],  // Mortgagee/Owner Level 2
                [ "PA",    "MOL3",   100000.01,    500000.00,     2.750,     0.00],  // Mortgagee/Owner Level 3
                [ "PA",    "MOL4",   500000.01,   1000000.00,     2.500,     0.00],  // Mortgagee/Owner Level 4
                [ "PA",    "MOL5",  1000000.01,   2000000.00,     2.250,     0.00],  // Mortgagee/Owner Level 5
                [ "PA",    "MOL6",  2000000.01,   7000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 6
                [ "PA",    "MOL7",  7000000.01, 999999999.99,     1.500,     0.00],  // Mortgagee/Owner Level 7
                [ "PA",    "REFI",        0.00,         5.00,    60.000,     0.00],  // Refinance
                [ "PA",    "REIS",        0.00,        10.00,    70.000,     0.00],  // Reissue
                
                [ "PAC",   "MINP",        0.00,         0.00,   420.000,     0.00],  // Minimum Premium
                [ "PAC",   "MOL1",        0.00,     30000.00,   420.000,     0.00],  // Mortgagee/Owner Level 1
                [ "PAC",   "MOL2",    30000.01,     45000.00,     7.250,     0.00],  // Mortgagee/Owner Level 2
                [ "PAC",   "MOL3",    45000.01,    100000.00,     6.000,     0.00],  // Mortgagee/Owner Level 3
                [ "PAC",   "MOL4",   100000.01,    500000.00,     5.000,     0.00],  // Mortgagee/Owner Level 4
                [ "PAC",   "MOL5",   500000.01,   1000000.00,     3.750,     0.00],  // Mortgagee/Owner Level 5
                [ "PAC",   "MOL6",  1000000.01,   2000000.00,     2.750,     0.00],  // Mortgagee/Owner Level 6
                [ "PAC",   "MOL7",  2000000.01,   7000000.00,     2.000,     0.00],  // Mortgagee/Owner Level 7
                [ "PAC",   "MOL8",  7000000.01, 999999999.99,     1.500,     0.00],  // Mortgagee/Owner Level 8
                [ "PAC",   "REF1",        0.00,         2.00,    70.000,     0.00],  // Refinance - Level 1 (% rate)
                [ "PAC",   "REF2",        2.00,         4.00,    80.000,     0.00],  // Refinance - Level 2 (% rate)
                [ "PAC",   "REF3",        4.01,        10.00,    90.000,     0.00],  // Refinance - Level 3 (% rate)
                [ "PAC",   "REI1",        0.00,         2.00,    70.000,     0.00],  // Reissue - Level 1 (% rate)
                [ "PAC",   "REI2",        2.00,         4.00,    80.000,     0.00],  // Reissue - Level 2 (% rate)
                [ "PAC",   "REI3",        4.01,        10.00,    90.000,     0.00],  // Reissue - Level 3 (% rate)
                
                [ "SC",    "MINP",        0.00,         0.00,    75.000,     0.00],  // Minimum Premium
                [ "SC",    "MOL1",        0.00,     50000.00,     3.000,     0.00],  // Mortgagee/Owner - Level 1
                [ "SC",    "MOL2",    50000.01,    100000.00,     2.500,     0.00],  // Mortgagee/Owner - Level 2
                [ "SC",    "MOL3",   100000.01,    500000.00,     1.750,     0.00],  // Mortgagee/Owner - Level 3
                [ "SC",    "MOL4",   500000.01,   5000000.00,     1.500,     0.00],  // Mortgagee/Owner - Level 4
                [ "SC",    "MOL5",  5000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner - Level 5
                [ "SC",    "REFI",        0.00,        10.00,    50.000,     0.00],  // Refinance
                [ "SC",    "REIS",        0.00,        10.00,    50.000,     0.00],  // Reissue
                [ "SC",    "SIOM",        0.00,         0.00,    50.000,     0.00],  // Simult. Issue - Owner-Mtgee
                [ "SC",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
                
                
                [ "TN",    "BCOF",        0.00,         0.00,    20.000,     0.00],  // Binder/Commitment Fee
                [ "TN",    "MINP",        0.00,         0.00,    30.000,     0.00],  // Minimum Premium
                [ "TN",    "MTG1",        0.00,     50000.00,     2.500,     0.00],  // Mortgagee Level 1
                [ "TN",    "MTG2",    50000.01,    100000.00,     2.000,     0.00],  // Mortgagee Level 2
                [ "TN",    "MTG3",   100000.01,    500000.00,     1.750,     0.00],  // Mortgagee Level 3
                [ "TN",    "MTG4",   500000.01,   1000000.00,     1.500,     0.00],  // Mortgagee Level 4
                [ "TN",    "MTG5",  1000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 5
                [ "TN",    "OWN1",        0.00,    100000.00,     3.500,     0.00],  // Owner Level 1
                [ "TN",    "OWN2",   100000.01,   1000000.00,     2.000,     0.00],  // Owner Level 2
                [ "TN",    "OWN3",  1000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 3
                [ "TN",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "TN",    "SIOM",        0.00,         0.00,    30.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "TN",    "SURE",        0.00,         3.00,    30.000,     0.00],  // Substitution-Refinance
                [ "TN",    "SURE",        4.00,         4.00,    40.000,     0.00],  // Substitution-Refinance
                [ "TN",    "SURE",        5.00,         5.00,    50.000,     0.00],  // Substitution-Refinance
                [ "TN",    "SURE",        6.00,         6.00,    60.000,     0.00],  // Substitution-Refinance
                [ "TN",    "SURE",        7.00,         7.00,    70.000,     0.00],  // Substitution-Refinance
                [ "TN",    "SURE",        8.00,         8.00,    80.000,     0.00],  // Substitution-Refinance
                [ "TN",    "SURE",        9.00, 999999999.00,   100.000,     0.00],  // Substitution-Refinance
                [ "TN",    "TCON",        0.00,         0.00,    50.000,     0.00],  // Constr. Loan Binder
				[ "TND",   "MINP",        0.00,         0.00,   100.000,     0.00],  // Minimum Premium
                [ "TND",   "MOL1",        0.00,      1000.00,   100.000,     0.00],  // Mortgagee/Owner Level 1
                [ "TND",   "MOL2",     1000.01,    100000.00,     5.000,     0.00],  // Mortgagee/Owner Level 2
                [ "TND",   "MOL3",   100000.01,    500000.00,     4.500,     0.00],  // Mortgagee/Owner Level 3
                [ "TND",   "MOL4",   500000.01,   1000000.00,     3.000,     0.00],  // Mortgagee/Owner Level 4
                [ "TND",   "MOL5",  1000000.01,  99999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 5
                [ "TND",   "REIS",        0.00,        10.00,    70.000,     0.00],  // Reissue Rate
                [ "TND",   "SIOM",        0.00,         0.00,    35.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "TND",   "SURE",        0.00,         3.00,    30.000,    30.00],  // Substitution-Refinance
                [ "TND",   "SURE",        4.00,         4.00,    40.000,     0.00],  // Substitution-Refinance
                [ "TND",   "SURE",        5.00,         5.00,    50.000,     0.00],  // Substitution-Refinance
                [ "TND",   "SURE",        6.00,         6.00,    60.000,     0.00],  // Substitution-Refinance
                [ "TND",   "SURE",        7.00,         7.00,    70.000,     0.00],  // Substitution-Refinance
                [ "TND",   "SURE",        8.00,         8.00,    80.000,     0.00],  // Substitution-Refinance
                [ "TND",   "SURE",        9.00, 999999999.00,   100.000,     0.00],  // Substitution-Refinance
                [ "TND",   "TCB1",        0.00,      1000.00,   100.000,     0.00],  // Constr. Loan Binder - Level 1
                [ "TND",   "TCB2",     1000.01,    100000.00,     2.000,     0.00],  // Constr. Loan Binder - Level 2
                [ "TND",   "TCB3",   100000.01, 999999999.99,     1.500,     0.00],  // Constr. Loan Binder - Level 3
                [ "TNH",   "MINP",        0.00,         0.00,    50.000,     0.00],  // Minimum Premium
                [ "TNH",   "MTG1",        0.00,      1000.00,    50.000,     0.00],  // Mortgagee Level 1
                [ "TNH",   "MTG2",     1000.01,    100000.00,     5.000,     0.00],  // Mortgagee Level 2
                [ "TNH",   "MTG3",   100000.01,   1000000.00,     2.500,     0.00],  // Mortgagee Level 3
                [ "TNH",   "MTG4",  1000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee Level 4
                [ "TNH",   "OWN1",        0.00,      1000.00,    50.000,     0.00],  // Owner Level 1
                [ "TNH",   "OWN2",     1000.01,    100000.00,     6.000,     0.00],  // Owner Level 2
                [ "TNH",   "OWN3",   100000.01,   1000000.00,     2.500,     0.00],  // Owner Level 3
                [ "TNH",   "OWN4",  1000000.01, 999999999.99,     1.000,     0.00],  // Owner Level 4
                [ "TNH",   "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "TNH",   "SIOM",        0.00,         0.00,    50.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "TNH",   "SURE",        0.00,         3.00,    30.000,    30.00],  // Substitution-Refinance
                [ "TNH",   "SURE",        4.00,         4.00,    40.000,     0.00],  // Substitution-Refinance
                [ "TNH",   "SURE",        5.00,         5.00,    50.000,     0.00],  // Substitution-Refinance
                [ "TNH",   "SURE",        6.00,         6.00,    60.000,     0.00],  // Substitution-Refinance
                [ "TNH",   "SURE",        7.00,         7.00,    70.000,     0.00],  // Substitution-Refinance
                [ "TNH",   "SURE",        8.00,         8.00,    80.000,     0.00],  // Substitution-Refinance
                [ "TNH",   "SURE",        9.00, 999999999.00,   100.000,     0.00],  // Substitution-Refinance
                [ "TNH",   "TCB1",        0.00,      1000.00,   100.000,     0.00],  // Constr. Loan Binder - Level 1
                [ "TNH",   "TCB2",     1000.01,    100000.00,     2.000,     0.00],  // Constr. Loan Binder - Level 2
                [ "TNH",   "TCB3",   100000.01, 999999999.99,     1.500,     0.00],  // Constr. Loan Binder - Level 3
                [ "TNK",   "BCOF",        0.00,         0.00,    25.000,     0.00],  // Binder/Commitment Fee
                [ "TNK",   "MINP",        0.00,         0.00,    75.000,     0.00],  // Minimum Premium
                [ "TNK",   "MOL1",        0.00,      1000.00,    75.000,     0.00],  // Mortgagee/Owner Level 1
                [ "TNK",   "MOL2",     1000.01,    100000.00,     5.500,     0.00],  // Mortgagee/Owner Level 2
                [ "TNK",   "MOL3",   100000.01,   1000000.00,     2.500,     0.00],  // Mortgagee/Owner Level 3
                [ "TNK",   "MOL4",  1000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 4
                [ "TNK",   "NERE",  2000000.01,   2250000.00,     0.300,     0.00],  // Reinsurance - (NE)
                [ "TNK",   "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "TNK",   "SIOM",        0.00,         0.00,    30.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "TNK",   "SURE",        0.00,         3.00,    30.000,    30.00],  // Substitution-Refinance
                [ "TNK",   "SURE",        4.00,         4.00,    40.000,     0.00],  // Substitution-Refinance
                [ "TNK",   "SURE",        5.00,         5.00,    50.000,     0.00],  // Substitution-Refinance
                [ "TNK",   "SURE",        6.00,         6.00,    60.000,     0.00],  // Substitution-Refinance
                [ "TNK",   "SURE",        7.00,         7.00,    70.000,     0.00],  // Substitution-Refinance
                [ "TNK",   "SURE",        8.00,         8.00,    80.000,     0.00],  // Substitution-Refinance
                [ "TNK",   "SURE",        9.00, 999999999.00,   100.000,     0.00],  // Substitution-Refinance
                [ "TNK",   "TCB1",        0.00,      1000.00,   100.000,     0.00],  // Constr. Loan Binder - Level 1
                [ "TNK",   "TCB2",     1000.01,    100000.00,     2.000,     0.00],  // Constr. Loan Binder - Level 2
                [ "TNK",   "TCB3",   100000.01, 999999999.99,     1.500,     0.00],  // Constr. Loan Binder - Level 3
                [ "TNS",   "MINP",        0.00,         0.00,    50.000,     0.00],  // Minimum Premium
                [ "TNS",   "MOL1",        0.00,      1000.00,    50.000,     0.00],  // Mortgagee/Owner Level 1
                [ "TNS",   "MOL2",     1000.01,    100000.00,     3.500,     0.00],  // Mortgagee/Owner Level 2
                [ "TNS",   "MOL3",   100000.01,   1000000.00,     3.000,     0.00],  // Mortgagee/Owner Level 3
                [ "TNS",   "MOL4",  1000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Owner Level 4
                [ "TNS",   "SIOM",        0.00,         0.00,    35.000,     0.00],  // Simultaneous Issue/Owner-Mtgee
                [ "TNS",   "SURE",        0.00,         3.00,    30.000,    30.00],  // Substitution-Refinance
                [ "TNS",   "SURE",        4.00,         4.00,    40.000,     0.00],  // Substitution-Refinance
                [ "TNS",   "SURE",        5.00,         5.00,    50.000,     0.00],  // Substitution-Refinance
                [ "TNS",   "SURE",        6.00,         6.00,    60.000,     0.00],  // Substitution-Refinance
                [ "TNS",   "SURE",        7.00,         7.00,    70.000,     0.00],  // Substitution-Refinance
                [ "TNS",   "SURE",        8.00,         8.00,    80.000,     0.00],  // Substitution-Refinance
                [ "TNS",   "SURE",        9.00, 999999999.00,   100.000,     0.00],  // Substitution-Refinance
                [ "TNS",   "TCON",        0.00,         0.00,    50.000,     0.00],  // Constr. Loan Binder
                [ "V1",    "MINP",        0.00,         0.00,    75.000,     0.00],  // Minimum Premium Amount
                [ "V1",    "MTG1",        0.00,    100000.00,     2.500,     0.00],  // Mortgagee Level 1
                [ "V1",    "MTG2",   100000.01,    500000.00,     2.000,     0.00],  // Mortgagee Level 2
                [ "V1",    "MTG3",   500000.01,  10000000.00,     1.750,     0.00],  // Mortgagee Level 3
                [ "V1",    "MTG4", 10000000.01,  15000000.00,     1.500,     0.00],  // Mortgagee Level 4
                [ "V1",    "MTG5", 15000000.01, 999999999.99,     1.250,     0.00],  // Mortgagee Level 5
                [ "V1",    "OWN1",        0.00,    100000.00,     3.500,     0.00],  // Owner Level 1
                [ "V1",    "OWN2",   100000.01,   5000000.00,     3.000,     0.00],  // Owner Level 2
                [ "V1",    "OWN3",  5000000.01,  10000000.00,     2.000,     0.00],  // Owner Level 3
                [ "V1",    "OWN4", 10000000.01,  15000000.00,     1.750,     0.00],  // Owner Level 4
                [ "V1",    "OWN5", 15000000.01, 999999999.99,     1.500,     0.00],  // Owner Level 5
                [ "V1",    "REIS",        0.00,         5.00,    60.000,     0.00],  // Re-Issue Rate
                [ "V1",    "REIS",        6.00,        10.00,    75.000,     0.00],  // Re-Issue
                [ "V1",    "SIOM",        0.00,        50.00,    50.000,     0.00],  // Simultaneous Issue; note max and rate value for different uses
                [ "V1",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
                [ "V2",    "MINP",        0.00,         0.00,    85.000,     0.00],  // Minimum Premium
                [ "V2",    "MTG1",        0.00,    150000.00,     2.750,     0.00],  // Mortgagee Level 1
                [ "V2",    "MTG2",   150000.01,    500000.00,     2.250,     0.00],  // Mortgagee Level 2
                [ "V2",    "MTG3",   500000.01,   1000000.00,     2.000,     0.00],  // Mortgagee Level 3
                [ "V2",    "MTG4",  1000000.01,  10000000.00,     1.750,     0.00],  // Mortgagee Level 4
                [ "V2",    "MTG5", 10000000.01,  15000000.00,     1.500,     0.00],  // Mortgagee Level 5
                [ "V2",    "MTG6", 15000000.01, 999999999.99,     1.250,     0.00],  // Mortgagee Level 6
                [ "V2",    "OWN1",        0.00,    150000.00,     3.750,     0.00],  // Owner Level 1
                [ "V2",    "OWN2",   150000.01,   1000000.00,     3.250,     0.00],  // Owner Level 2
                [ "V2",    "OWN3",  1000000.01,   5000000.00,     2.750,     0.00],  // Owner Level 3
                [ "V2",    "OWN4",  5000000.01,  10000000.00,     2.000,     0.00],  // Owner Level 4
                [ "V2",    "OWN5", 10000000.01,  15000000.00,     1.750,     0.00],  // Owner Level 5
                [ "V2",    "OWN6", 15000000.01, 999999999.99,     1.500,     0.00],  // Owner Level 6
                [ "V2",    "REIS",        0.00,        10.00,    60.000,     0.00],  // Reissue Rate
                [ "V2",    "SIOM",        0.00,        50.00,    50.000,     0.00],  // Simultaneous Issue; note max and rate values for different uses
                [ "V2",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
                [ "V3",    "MINP",        0.00,         0.00,    85.000,     0.00],  // Mininum Premium
                [ "V3",    "MTG1",        0.00,    100000.00,     2.900,     0.00],  // Mortgagee Level 1
                [ "V3",    "MTG2",   100000.01,    500000.00,     2.400,     0.00],  // Mortgagee Level 2
                [ "V3",    "MTG3",   500000.01,  10000000.00,     2.000,     0.00],  // Mortgagee Level 3
                [ "V3",    "MTG4", 10000000.01,  15000000.00,     1.500,     0.00],  // Mortgagee Level 4
                [ "V3",    "MTG5", 15000000.01,  99999999.99,     1.250,     0.00],  // Mortgagee Level 5
				[ "V3",    "OWN1",        0.00,    100000.00,     3.900,     0.00],  // Owner Level 1
                [ "V3",    "OWN2",   100000.01,    500000.00,     3.400,     0.00],  // Owner Level 2
                [ "V3",    "OWN3",   500000.01,  10000000.00,     3.000,     0.00],  // Owner Level 3
                [ "V3",    "OWN4", 10000000.01,  15000000.00,     2.000,     0.00],  // Owner Level 4 
                [ "V3",    "OWN5", 15000000.01, 999999999.99,     1.500,     0.00],  // Owner Level 5 
				[ "V3",    "REIS",        0.00,        10.00,    70.000,     0.00],  // Reissue
                [ "V3",    "SIOM",        0.00,        50.00,    50.000,     0.00],  // Simultaneous Issue; note max and rate value for different uses
                [ "V3",    "TCON",        0.00,         0.00,     1.000,     0.00],  // Temporary Construction
                [ "WI",    "AL31",      200.00,         0.00,     0.500,     0.00],  // Alta 3.1 Endorsement
                [ "WI",    "ALT2",       25.00,       500.00,    10.000,     0.00],  // Alta 2 Endorsement
                [ "WI",    "ALT3",      200.00,         0.00,     0.500,     0.00],  // Alta 3 Endorsement
                [ "WI",    "ALT9",        0.00,       100.00,     0.000,     0.00],  // Alta 9 Endorsement
                [ "WI",    "ASLP",       60.00,       100.00,     0.000,     0.00],  // Assignee Loan Pol.Endorsement
                [ "WI",    "BALL",        0.00,         0.00,    60.000,     0.00],  // Balloon Mortgage Endorsement
                [ "WI",    "CCAN",        0.00,         0.00,    25.000,     0.00],  // Commitment/Cancellation Fee
                [ "WI",    "CRRE",  2250000.01, 999999999.99,     0.300,     0.00],  // Reinsurance - (CR)
                [ "WI",    "GRNT",       50.00,       125.00,    30.000,     0.00],  // Grantor/Grantee/Mortgagee Min
                [ "WI",    "LOCE",        0.00,        50.00,     0.000,     0.00],  // Location Endorsement
                [ "WI",    "MHP1",        0.00,     50000.00,   100.000,     0.00],  // MHELP Policy
                [ "WI",    "MINP",        0.00,         0.00,   150.000,     0.00],  // Minimum Premium
                [ "WI",    "MOM1",        0.00,     10000.00,   150.000,     0.00],  // Mortgagee/Lender MIN Level 1
                [ "WI",    "MOM2",    10000.01,     50000.00,     4.000,     0.00],  // Mortgagee/Lender MIN Level 2
                [ "WI",    "MOM3",    50000.01,    100000.00,     2.500,     0.00],  // Mortgagee/Lender MIN Level 3
                [ "WI",    "MOM4",   100000.01,    500000.00,     2.000,     0.00],  // Mortgagee/Lender MIN Level 4
                [ "WI",    "MOM5",   500000.01,   1000000.00,     1.500,     0.00],  // Mortgagee/Lender MIN Level 5
                [ "WI",    "MOM6",  1000000.01,   5000000.00,     1.000,     0.00],  // Mortgagee/Lender MIN Level 6
                [ "WI",    "MOM7",  5000000.01,  10000000.00,     0.750,     0.00],  // Mortgagee/Lender MIN Level 7
                [ "WI",    "MOM8", 10000000.01, 999999999.99,     0.500,     0.00],  // Mortgagee/Lender MIN Level 8
                [ "WI",    "MOX1",        0.00,     10000.00,   275.000,     0.00],  // Mortgagee/Lender MAX Level 1
                [ "WI",    "MOX2",    10000.01,     50000.00,     5.500,     0.00],  // Mortgagee/Lender MAX Level 2
                [ "WI",    "MOX3",    50000.01,    100000.00,     5.000,     0.00],  // Mortgagee/Lender MAX Level 3
                [ "WI",    "MOX4",   100000.01,    500000.00,     4.500,     0.00],  // Mortgagee/Lender MAX Level 4
                [ "WI",    "MOX5",   500000.01,   1000000.00,     4.000,     0.00],  // Mortgagee/Lender MAX Level 5
                [ "WI",    "MOX6",  1000000.01,   2000000.00,     3.000,     0.00],  // Mortgagee/Lender MAX Level 6
                [ "WI",    "MOX7",  2000000.01,   5000000.00,     2.000,     0.00],  // Mortgagee/Lender MAX Level 7
                [ "WI",    "MOX8",  5000000.01,  10000000.00,     1.500,     0.00],  // Mortgagee/Lender MAX Level 8
                [ "WI",    "MOX9", 10000000.01, 999999999.99,     1.000,     0.00],  // Mortgagee/Lender MAX Level 9
                [ "WI",    "NERE",  2000000.01,   2250000.00,     0.300,     0.00],  // Reinsurance - (NE)
                [ "WI",    "OMLE",       50.00,       125.00,    30.000,     0.00],  // Owner/Mortgagee/Leasehold
                [ "WI",    "PRMP",       60.00,       100.00,     0.000,     0.00],  // Partial Release Mtg Prop End.
                [ "WI",    "RECL",        0.00,       100.00,     0.000,     0.00],  // Revolving Credit Endorsement
                [ "WI",    "REIM",        0.00,         0.00,    50.000,     0.00],  // Reissue - Min Rate
                [ "WI",    "REIX",        0.00,         0.00,    80.000,     0.00],  // Reissue Max Rate
                [ "WI",    "REVA",        0.00,         0.00,    60.000,     0.00],  // Reverse Annuity Endorsement
                [ "WI",    "RPLM",       60.00,       100.00,     0.000,     0.00],  // Release Persnal Liab Mtgr End.
                [ "WI",    "SIOM",       50.00,       125.00,     0.000,     0.00],  // Simultaneous Issue
                [ "WI",    "SUBM",        0.00,         5.00,    30.000,     0.00],  // Substitution Min Level 1
                [ "WI",    "SUBM",        6.00, 999999999.00,    50.000,     0.00],  // Substitution Min Level 2
                [ "WI",    "SUBX",        0.00, 999999999.00,    80.000,     0.00],  // Substitution Max (one level)
                [ "WI",    "TAKE",       40.00,       150.00,     0.000,     0.00],  // Take Off from Owner Master
                [ "WI",    "USRY",      200.00,         0.00,     0.500,     0.00],  // Usury Endorsement
                [ "WI",    "VRAT",       60.00,       100.00,     0.000,     0.00],  // Variable Rate Endorsement
                [ "WV",    "MINP",        0.00,         0.00,    85.000,     0.00],  // Mininum Premium
                [ "WV",    "MTG1",        0.00,    100000.00,     2.900,     0.00],  // Mortgagee Level 1
                [ "WV",    "MTG2",   100000.01,    500000.00,     2.400,     0.00],  // Mortgagee Level 2
                [ "WV",    "MTG3",   500000.01,   5000000.00,     2.000,     0.00],  // Mortgagee Level 3
                [ "WV",    "MTG4",  5000000.01, 999999999.99,     1.750,     0.00],  // Mortgagee Level 4
                [ "WV",    "OWN1",        0.00,    100000.00,     3.900,     0.00],  // Owner Level 1
                [ "WV",    "OWN2",   100000.01,    500000.00,     3.400,     0.00],  // Owner Level 2
                [ "WV",    "OWN3",   500000.01,   5000000.00,     3.000,     0.00],  // Owner Level 3
                [ "WV",    "OWN4",  5000000.01, 999999999.99,     2.750,     0.00],  // Owner Level 4
                [ "WV",    "REIS",        0.00,         5.00,    70.000,     0.00],  // Reissue Level 1
                [ "WV",    "REIS",        6.00,        10.00,    80.000,     0.00],  // Reissue Level 2
                [ "WV",    "SIOM",        0.00,        50.00,    50.000,     0.00],  // Simultaneous Issue; note max and rate value for different uses
                [ "WV",    "TCON",        0.00,         0.00,     1.000,     0.00] ] // Temporary Construction

				

//  gaMatrix array columns
var gnCol_region = 0
var gnCol_code = 1
var gnCol_minlimit = 2
var gnCol_maxlimit = 3
var gnCol_rate = 4
var gnCol_additional = 5


// init method listbox options into global array for dynamic listbox usage
//  columns:     region   text                      value
var gaOption  = [["AL", "Regular Owner/Mortgagee", "Regular" ], 
				 ["AL", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["AL", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["AL", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["AR", "Regular Owner/Mortgagee", "Regular" ], 
				 ["AR", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["AR", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["AR", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["DC", "Regular Owner/Mortgagee", "Regular" ], 
				 ["DC", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["DC", "Refinance - Mortgagee",  "Refinance" ],
				 ["DC", "Mortgagee Temp. Construction and/or Owners", "Temporary"],
				 ["FL", "Original Owner/Mortgagee", "Regular" ], 
				 ["FL", "Original Multiple Conveyences", "RegularMultiple" ], 
				 ["FL", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["FL", "Re-Issue Unimproved",  "ReissueUnimproved" ],
				 ["GM", "Regular Owner/Mortgagee", "Regular" ], 
				 ["GM", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["GM", "Substitution/Refinance",  "Refinance" ],
				 ["GM", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["GS", "Regular Owner/Mortgagee", "Regular" ], 
				 ["GS", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["GS", "Substitution/Refinance",  "Refinance" ],
				 ["GS", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["IL", "Regular Owner/Mortgagee", "Regular" ], 
				 ["IL", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["IL", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["IL", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["IN1", "Regular Owner/Mortgagee", "Regular" ], 
				 ["IN1", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["IN1", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["IN1", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["IN2", "Regular Owner/Mortgagee", "Regular" ], 
				 ["IN2", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["IN2", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["IN2", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["IN3", "Regular Owner/Mortgagee", "Regular" ], 
				 ["IN3", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["IN3", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["IN3", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
			     ["KY", "Regular Owner/Mortgagee", "Regular" ], 
				 ["KY", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["KY", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["KY", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["LA", "Regular Owner/Mortgagee", "Regular" ], 
				 ["LA", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["LA", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["LA", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["MD", "Regular Owner/Mortgagee", "Regular" ], 
				 ["MD", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["MD", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["MD", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
    			 ["MI1", "Basic Owner/Loan w/out SE", "BasicWithoutSE" ], 
				 ["MI1", "Basic Owner/Loan with SE", "BasicWithSE" ], 
				 ["MI1", "Reissue Owner/Loan w/out SE", "ReissueWithoutSE" ], 
				 ["MI1", "Reissue Owner/Loan with SE", "ReissueWithSE" ], 
				 ["MI1", "Refinance Loan w/out SE", "RefinanceWithoutSE" ], 
				 ["MI1", "Refinance Loan with SE", "RefinanceWithSE" ], 
				 ["MI2", "Basic Owner/Loan w/out SE", "BasicWithoutSE" ], 
				 ["MI2", "Basic Owner/Loan with SE", "BasicWithSE" ], 
				 ["MI2", "Reissue Owner/Loan w/out SE", "ReissueWithoutSE" ], 
				 ["MI2", "Reissue Owner/Loan with SE", "ReissueWithSE" ], 
				 ["MI2", "Refinance Loan w/out SE", "RefinanceWithoutSE" ], 
				 ["MI2", "Refinance Loan with SE", "RefinanceWithSE" ], 
				 ["MIK", "Basic Owner/Loan w/out SE", "BasicWithoutSE" ], 
				 ["MIK", "Basic Owner/Loan with SE", "BasicWithSE" ], 
				 ["MIK", "Reissue Owner/Loan w/out SE", "ReissueWithoutSE" ], 
				 ["MIK", "Reissue Owner/Loan with SE", "ReissueWithSE" ], 
				 ["MIK", "Refinance Loan w/out SE", "RefinanceWithoutSE" ], 
				 ["MIK", "Refinance Loan with SE", "RefinanceWithSE" ], 
				 ["MIC", "Basic Owner only or Simul", "Basic" ], 
				 ["MIC", "Basic Mortgagee only", "BasicLoan" ], 
				 ["MIC", "Reissue Owner only or Simul", "Reissue" ], 
				 ["MIC", "Reissue Mortgagee only", "ReissueLoan" ], 
				 ["MIC", "Refinance Loan policy", "Refinance" ], 
				 ["MI1x", "Basic Owner/Loan w/out SE", "BasicWithoutSE" ], 
				 ["MI1x", "Basic Owner/Loan with SE", "BasicWithSE" ], 
				 ["MI1x", "Reissue Owner/Loan w/out SE", "ReissueWithoutSE" ], 
				 ["MI1x", "Reissue Owner/Loan with SE", "ReissueWithSE" ], 
				 ["MI1x", "Refinance Loan w/out SE", "RefinanceWithoutSE" ], 
				 ["MI1x", "Refinance Loan with SE", "RefinanceWithSE" ], 
				 ["MI2x", "Basic Owner/Loan w/out SE", "BasicWithoutSE" ], 
				 ["MI2x", "Basic Owner/Loan with SE", "BasicWithSE" ], 
				 ["MI2x", "Reissue Owner/Loan w/out SE", "ReissueWithoutSE" ], 
				 ["MI2x", "Reissue Owner/Loan with SE", "ReissueWithSE" ], 
				 ["MI2x", "Refinance Loan w/out SE", "RefinanceWithoutSE" ], 
				 ["MI2x", "Refinance Loan with SE", "RefinanceWithSE" ], 
				 ["MIKx", "Basic Owner/Loan w/out SE", "BasicWithoutSE" ], 
				 ["MIKx", "Basic Owner/Loan with SE", "BasicWithSE" ], 
				 ["MIKx", "Reissue Owner/Loan w/out SE", "ReissueWithoutSE" ], 
				 ["MIKx", "Reissue Owner/Loan with SE", "ReissueWithSE" ], 
				 ["MIKx", "Refinance Loan w/out SE", "RefinanceWithoutSE" ], 
				 ["MIKx", "Refinance Loan with SE", "RefinanceWithSE" ], 
				 ["MI1m", "Basic Owner/Loan w/out SE", "BasicWithoutSE" ], 
				 ["MI1m", "Basic Owner/Loan with SE", "BasicWithSE" ], 
				 ["MI1m", "Reissue Owner/Loan w/out SE", "ReissueWithoutSE" ], 
				 ["MI1m", "Reissue Owner/Loan with SE", "ReissueWithSE" ], 
				 ["MI1m", "Refinance Loan w/out SE", "RefinanceWithoutSE" ], 
				 ["MI1m", "Refinance Loan with SE", "RefinanceWithSE" ], 
				 ["MI2m", "Basic Owner/Loan w/out SE", "BasicWithoutSE" ], 
				 ["MI2m", "Basic Owner/Loan with SE", "BasicWithSE" ], 
				 ["MI2m", "Reissue Owner/Loan w/out SE", "ReissueWithoutSE" ], 
				 ["MI2m", "Reissue Owner/Loan with SE", "ReissueWithSE" ], 
				 ["MI2m", "Refinance Loan w/out SE", "RefinanceWithoutSE" ], 
				 ["MI2m", "Refinance Loan with SE", "RefinanceWithSE" ], 
				 ["MIKm", "Basic Owner/Loan w/out SE", "BasicWithoutSE" ], 
				 ["MIKm", "Basic Owner/Loan with SE", "BasicWithSE" ], 
				 ["MIKm", "Reissue Owner/Loan w/out SE", "ReissueWithoutSE" ], 
				 ["MIKm", "Reissue Owner/Loan with SE", "ReissueWithSE" ], 
				 ["MIKm", "Refinance Loan w/out SE", "RefinanceWithoutSE" ], 
				 ["MIKm", "Refinance Loan with SE", "RefinanceWithSE" ], 
				 ["MS", "Regular Owner/Mortgagee", "Regular" ], 
				 ["MS", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["MS", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["MS", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["NE", "Regular Owner/Mortgagee", "Regular" ], 	
				 ["NE", "Refinance Owner/Mortgagee", "Refinance" ], 
				 ["NE1", "Regular Owner/Mortgagee", "Regular" ], 	
				 ["NE1", "Refinance Owner/Mortgagee", "Refinance" ], 
				 ["NJ", "Regular Owner/Mortgagee", "Regular" ], 
				 ["NJ", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["NJ", "Mortgagee Temp. Construction and/or Owners", "Temporary"],
				 
				 ["NY1", "Regular Owner/Mortgagee", "Regular" ], 	
				 ["NY1", "Refinance", "Refinance" ], 
        		 ["NY1", "Construction Loan / Owner", "Temporary" ],
        		 ["NY1", "Loan Modification", "Modification" ], 	
                 ["NY2", "Regular Owner/Mortgagee", "Regular" ], 	
				 ["NY2", "Refinance", "Refinance" ], 	 
				 ["NY2", "Construction Loan / Owner", "Temporary" ],
        		 ["NY2", "Loan Modification", "Modification" ], 	
				 
                 ["NC", "Regular Owner/Mortgagee", "Regular" ], 
                 ["NC", "Re-Issue Owner/Mortgagee",  "Reissue" ], 
                 ["NC", "Refinance Owner/Mortgagee", "Refinance" ],
                 ["NC", "Commercial Property", "Commercial"],
                 ["NC", "Temporary Construction", "Temporary"],
                 ["NC", "Subdivider/Developer Sales", "SubdivDevel"],
                 ["NC", "Community Housing", "CommunHouse"],
				 ["OH", "Regular Owner/Mortgagee", "Regular" ], 
				 ["OH", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["OH", "Refinance Owner/Mortgagee",  "Refinance" ],
				 ["OH", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["PA", "Regular Owner/Mortgagee", "Regular" ], 
			     ["PA", "Re-Issue Owner/Mortgagee",  "Reissue" ], 
                 ["PA", "Refinance Owner/Mortgagee", "Refinance" ],
			     ["PAC", "Regular Owner/Mortgagee", "Regular" ], 
			     ["PAC", "Re-Issue Owner/Mortgagee",  "Reissue" ], 
                 ["PAC", "Refinance Owner/Mortgagee", "Refinance" ],
		         ["SC", "Regular Owner/Mortgagee", "Regular" ], 
			     ["SC", "Re-Issue Owner/Mortgagee",  "Reissue" ], 
                 ["SC", "Refinance Owner/Mortgagee", "Refinance" ],
                 ["SC", "Temporary Construction", "Temporary"], 
				 ["TN", "Regular Owner/Mortgagee", "Regular" ], 
				 ["TN", "Re-Issue Owner/Mortgagee",  "Reissue" ], 
				 ["TN", "Substitution-Refinance Owner/Mortgagee", "Refinance"],
				 ["TN", "Temporary Construction (Binder only)", "Temporary"],
				 ["TND", "Regular Owner/Mortgagee", "Regular" ], 
				 ["TND", "Re-Issue Owner/Mortgagee",  "Reissue" ], 
				 ["TND", "Substitution-Refinance Owner/Mortgagee", "Refinance"],
				 ["TND", "Temporary Construction (Binder only)", "Temporary"],
				 ["TNH", "Regular Owner/Mortgagee", "Regular" ], 
				 ["TNH", "Re-Issue Owner/Mortgagee",  "Reissue" ], 
				 ["TNH", "Substitution-Refinance Owner/Mortgagee", "Refinance"],
				 ["TNH", "Temporary Construction (Binder only)", "Temporary"],
				 ["TNK", "Regular Owner/Mortgagee", "Regular" ], 
				 ["TNK", "Re-Issue Owner/Mortgagee",  "Reissue" ], 
				 ["TNK", "Substitution-Refinance Owner/Mortgagee", "Refinance"],
				 ["TNK", "Temporary Construction (Binder only)", "Temporary"],
				 ["TNS", "Regular Owner/Mortgagee", "Regular" ], 
				 ["TNS", "Substitution-Refinance Owner/Mortgagee", "Refinance"],
				 ["TNS", "Temporary Construction (Binder only)", "Temporary"], 
			     ["V1", "Regular Owner/Mortgagee", "Regular" ], 
				 ["V1", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["V1", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["V2", "Regular Owner/Mortgagee", "Regular" ], 
				 ["V2", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["V2", "Mortgagee Temp. Construction and/or Owners", "Temporary"], 
				 ["V3", "Regular Owner/Mortgagee", "Regular" ], 
				 ["V3", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["V3", "Mortgagee Temp. Construction and/or Owners", "Temporary"],
				 ["WV", "Regular Owner/Mortgagee", "Regular" ], 
				 ["WV", "Re-Issue Owner/Mortgagee",  "Reissue" ],
				 ["WV", "Mortgagee Temp. Construction and/or Owners", "Temporary"] ]


//               ["NJ", "Refinance Owner/Mortgagee",  "Refinance" ],

// boolean for testing purposes
var glDebug

				 				 
// gaOptions column defs
var gnCol_opt_region = 0
var gnCol_opt_text = 1
var gnCol_opt_value = 2



// these memvars for dynamic sizing of methods listbox
var gnMaxRegionCount
var gnMaxRegionWidth

// document form name container 
var goCalcform

// for form element navigtion; last element with focus
var gnLastIdentFocus


// identify browers by object support
var gbNav4 = document.layers ? true : false
var gbNS6  = document.getElementByID && !document.all? true : false
var gbIE4 = document.all ? true : false
var gbIE5 = document.all && document.getElementByID ? true : false

// carriage return/line feed pair
var gs_crlf = "\r\n";


function window_onload(ADocument) {
/*
	Disable right mouse click; 
	Populate methods listbox
*/


	if (ADocument.layers)
		ADocument.captureEvents(Event.Click);

	ADocument.onmousedown=click;
		
	// encapsulate the HTML form
	goCalcform = document.cal

	// init default method listbox options 
	setOption(goCalcform.region.selectedIndex)
	
}
// eofct: window_onload()


function click(e)
{
	var message = "Copyright 2003-Present" + gs_crlf + "Imperial Web Design" + 
			gs_crlf + "All rights reserved.";

	if (document.all)
	{
		if (event.button == 2)
		{
			alert(message);
			return false;
		}
	}

	if (document.layers)
	{
		if (e.which == 3)
		{
			alert(message);
			return false;
		}
	}
}
// eofct: click()


function netscapeMouseClick(e)
{
	return false;
}
// eofct: netscapeMouseClick()



function codes(e) {
/*
	trap keypress
*/


	if (gbNav4) // Netscape Navigator 4.0x
	{
		var whichCode = e.which
    }
	else // Microsoft Internet Explorer 4.0x
	{
		var whichCode = e.keyCode
    }

	
	//alert(whichCode)
	if (whichCode == 13)      // enter key
	{
		calc()
	}
}
// eofct: codes()


function NJCalc(coverage,priorcoverage){
//MOLX, REFX
	if(priorcoverage>coverage)
		priorcoverage=coverage
	remainingPriorCoverage=priorcoverage
	accumulatedPriorCoverage=0
	priorPrem=0

	method='REF'
	x = aSeek('NJ', method)
	startRow=x
	state=gaMatrix[x][0]
	method=gaMatrix[x][1]
	min=gaMatrix[x][2]
	max=gaMatrix[x][3]
	rate=gaMatrix[x][4]
	
	//debugLog('start at row '+x+': '+'min='+min+', max='+max+', rate='+rate)
	bail=false
	while(remainingPriorCoverage>0.1&&!bail){
		if((accumulatedPriorCoverage+remainingPriorCoverage)>max){
			portionInBlock=max-min
		}else{
			portionInBlock=accumulatedPriorCoverage+remainingPriorCoverage-min
		}
		accumulatedPriorCoverage=accumulatedPriorCoverage+portionInBlock
		remainingPriorCoverage=remainingPriorCoverage-portionInBlock
		priorPrem=priorPrem+rate*portionInBlock/1000
		
//		debugLog('row '+(x-startRow+1)+': '+'min='+min+', max='+max+', rate='+rate+', accumulatedPriorCoverage='+accumulatedPriorCoverage+', remainingPriorCoverage='+remainingPriorCoverage+', portionInBlock='+portionInBlock+', priorPrem='+priorPrem)
		x++
		
		state=gaMatrix[x][0]
		method=gaMatrix[x][1]
		min=gaMatrix[x][2];
		max=gaMatrix[x][3];
		rate=gaMatrix[x][4];
		if(state!='NJ')
			bail=true
		if(method != gaMatrix[x][1].substring(0, method.length) )
			bail=true
	}
	
	currentPrem=0
	remainingCoverage=Math.round(coverage-priorcoverage)
	accumulatedCoverage=Math.round(priorcoverage)

	method='MOL'
	x = aSeek('NJ', method)
	startRow=x
	state=gaMatrix[x][0]
	method=gaMatrix[x][1]
	min=gaMatrix[x][2]
	max=gaMatrix[x][3]
	rate=gaMatrix[x][4]
	
	//debugLog('start at row '+x+': '+'min='+min+', max='+max+', rate='+rate)
	bail=false
	while(max<accumulatedCoverage&&!bail){
	//	debugLog('Skipping Row '+(x-startRow+1)+': '+'min='+min+', max='+max+', rate='+rate+', accumulatedCoverage='+accumulatedCoverage+', remainingCoverage='+remainingCoverage+', portionInBlock=100%, currentPrem='+currentPrem)
		x++
		state=gaMatrix[x][0]
		method=gaMatrix[x][1]
		min=gaMatrix[x][2];
		max=gaMatrix[x][3];
		rate=gaMatrix[x][4];
		if(state!='NJ')
			bail=true
		if(method != gaMatrix[x][1].substring(0, method.length) )
			bail=true
	}
	while(remainingCoverage>0.1&&!bail){
		if((accumulatedCoverage+remainingCoverage)>=max){
			if(accumulatedCoverage>min)
				offsetCoverage=accumulatedCoverage-min
			else offsetCoverage=0
			portionInBlock=max-min-offsetCoverage
		//	debugLog('portionInBlock=max-min-offsetCoverage='+max+'-'+min+'-'+offsetCoverage+'='+ portionInBlock)
		}else{
			if(accumulatedCoverage>min)
				offsetCoverage=accumulatedCoverage-min
			else offsetCoverage=0
			portionInBlock=accumulatedCoverage+remainingCoverage-min-offsetCoverage
			//debugLog('portionInBlock=accumulatedCoverage+remainingCoverage-min-offsetCoverage='+accumulatedCoverage+'+'+remainingCoverage+'-'+min+'-'+offsetCoverage+'='+ portionInBlock)
		}
		accumulatedCoverage=accumulatedCoverage+portionInBlock
		remainingCoverage=remainingCoverage-portionInBlock
		currentPrem=currentPrem+rate*portionInBlock/1000
		
//		debugLog('row '+(x-startRow+1)+': '+'min='+min+', max='+max+', rate='+rate+', accumulatedCoverage='+accumulatedCoverage+', remainingCoverage='+remainingCoverage+', portionInBlock='+portionInBlock+', currentPrem='+currentPrem)
		x++
		
		state=gaMatrix[x][0]
		method=gaMatrix[x][1]
		min=gaMatrix[x][2];
		max=gaMatrix[x][3];
		rate=gaMatrix[x][4];
		if(state!='NJ')
			bail=true
		if(method != gaMatrix[x][1].substring(0, method.length) )
			bail=true
	}
	return priorPrem+currentPrem
}



function calc()  {
/*
   Front door to calc routines
   Created DRH; modfied and enhanced ROD 03/09/01
*/
clearLog()
	var nPremium = 0
	var nCvg = 0
	var nPriorcvg = 0
	var nOwnPriorcvg = 0
	var nMtgPriorcvg = 0
	var nYears = 0
	var nMonths = 0
	var nDays = 0
	var nNew = 0
	var nPrior = 0
	var nOwnercvg = 0
	var nLendercvg = 0
	var nOwneramt = 0
	var nLenderamt = 0
	var nSearchamt = 0
	var nRegionamt = 0
	var nNewLenderamt = 0
	var cRegion, nAmt
	var nMinprem, nOwnMinprem, nMtgMinprem, nDiscMin
	var cOldRegion, nPass, nPercent 
	var cCode, cOwnCode, cMtgeCode
	var x
	var sPriordate, nDiscamt
	var bCalc = false
	var nCeiling = 0
	glDebug = false

	// get the selected state region
	cRegion = goCalcform.region.options[goCalcform.region.selectedIndex].value

	// fetch the shared coverage	
	if (!goCalcform.coverage.disabled)
	{
		nCvg = goCalcform.coverage.value.replace(" ","")
	}
	else
	{
		nCvg = 0
	}

	// make the coverge numeric
	nCvg = StrToNum(nCvg)

	if (nCvg > 1000000000)
	{
		nPremium = 0
		nCvg = 0
	}


	// fetch the owner-specific cvg
	if (!goCalcform.ownercvg.disabled)
	{
		nOwnercvg = goCalcform.ownercvg.value.replace(" ","")
	}
	else
	{
		nOwnercvg = 0
	}
	
	// make the coverge numeric
	nOwnercvg = StrToNum(nOwnercvg)

	if (nOwnercvg > 1000000000)
	{
		nPremium = 0
		nOwnercvg = 0
	}


	// fetch the lender-specific cvg
	if (!goCalcform.lendercvg.disabled)
	{
		nLendercvg = goCalcform.lendercvg.value.replace(" ","")
	}
	else
	{
		nLendercvg = 0
	}
	
	// make the coverge numeric
	nLendercvg = StrToNum(nLendercvg)

	if (nLendercvg > 1000000000)
	{
		nPremium = 0
		nLendercvg = 0
	}

	/*
		ROD 06/13/02 Note: replacing user-provided entry for age of prior policy (in years) 
	                 with a date string, from which we'll calculate the prior policy age
	*/

	// fetch prior info
	if (!goCalcform.priorcvg.disabled)
	{
		nPriorcvg = goCalcform.priorcvg.value.replace(" ","")
		// make the priorcvg numeric
		nPriorcvg = StrToNum(nPriorcvg)
	}
	
	if (!goCalcform.opriorcvg.disabled)
	{
		nOwnPriorcvg = goCalcform.opriorcvg.value.replace(" ","")
		// make the priorcvg numeric
		nOwnPriorcvg = StrToNum(nOwnPriorcvg)
	}

	if (!goCalcform.mpriorcvg.disabled)
	{
		nMtgPriorcvg = goCalcform.mpriorcvg.value.replace(" ","")
		// make the priorcvg numeric
		nMtgPriorcvg = StrToNum(nMtgPriorcvg)
	}


	// nYears = goCalcform.years.value.replace(" ","")
	sPriordate = goCalcform.priordate.value.replace(" ","")
	
	

	/* *************
	// validate age of prior policy
	if (nYears.indexOf(",") != -1)
	{
		nYears = parseInt(nYears.replace(",",""))
	}
	
	if (nYears.indexOf(".") != -1)
	{
		// retain only left of decimal
		nYears = parseInt(nYears.substring(0, nYears.indexOf(".")))
		goCalcform.years.value = "" + nYears
	}
	
	if (nYears == "")
	{
		nYears = 0
	}
	*************************** */
	

	// identify the rate method by its description
	method = goCalcform.method.options[goCalcform.method.selectedIndex].value


	if(cRegion=='NJ'){
		if(method=='Refinance'){
			opriorDisplay = ""
			mpriorDisplay = "none"
			lendertextDisplay="none"
		}else{
			opriorDisplay = "none"
			mpriorDisplay = "none"
			lendertextDisplay=""
		}
		
		
		document.getElementById('lendertext').style.display=lendertextDisplay
		document.getElementById('lenderdata').style.display=lendertextDisplay
		
		document.getElementById('opriorcvgtext').style.display=opriorDisplay
		document.getElementById('opriorcvgdata').style.display=opriorDisplay
		document.getElementById('opriorcvg').style.textAlign="right"	

		document.getElementById('mpriorcvgtext').style.display=mpriorDisplay
		document.getElementById('mpriorcvgdata').style.display=mpriorDisplay
		document.getElementById('mpriorcvg').style.textAlign="right"	
	}

	if ((method != "Reissue" && method != "Refinance" && method != "ReissueWithSE" 
		&& method != "ReissueWithoutSE" && method != "RefinanceWithSE" 
		&& method != "RefinanceWithoutSE" && method != "ReissueLoan" 
		&& method != "ReissueUnimproved") || (cRegion == "MIC" )) 
	{
		// don't allow prior info usage unless Reissue or Refinance; no prior needed for MIC
		nPriorcvg = 0.00
		nOwnPriorcvg = 0.00
		nMtgPriorcvg = 0.00

		// nYears = 0
		sPriordate = ""
	}

	if (cRegion == "PAC" && (method == "Reissue" || method == "Refinance"))
	{
		// no prior cvg amount used
		nPriorcvg = 0.00
	}


	if (method == "Reissue" || method == "Refinance" || method == "ReissueWithSE" 
		|| method == "ReissueWithoutSE" || method == "RefinanceWithSE" 
		|| method == "RefinanceWithoutSE" || method == "ReissueLoan" 
		|| method == "ReissueUnimproved")
	{
		// validate prior policy date and calc age

		if (sPriordate != "")
		{

			// format and redisp if necessary
			sPriordate = formatDateString(sPriordate)
			goCalcform.priordate.value = sPriordate

			if (!verifyDate(sPriordate))
			{
				alert("Provide a valid Prior Coverage date in format mm/dd/yyyy")
				goCalcform.priordate.value = ""
				goCalcform.priordate.focus()
				return(false)
			}

			// gather age in 3 elem array...years, months, days
			aAge = getAge(sPriordate,5)

			for (i=0; i < aAge.length ; i++ )
			{
				// init age of prior policy into vars
				nYears = (i == 0) ? aAge[i] : nYears	
				nMonths = (i == 1) ? aAge[i] : nMonths
				nDays = (i == 2) ? aAge[i] : nDays	
			}


			// alert("years = " + nYears + " mths = " + nMonths + " days = " + nDays )

			// convert to pseudo-fractional amount if less than year old (eg. 11 mths = 0.11, 25 days = .025)
			nYears = (nYears == 0) ? nMonths * .01 : nYears
			nYears = (nYears == 0) ? nDays * .001 : nYears

			// alert("years = " + nYears + " mths = " + nMonths + " days = " + nDays )

			if (nYears >= 1)
			{
				// year or more old, force rounding of years up to next whole number whenever months/days present
				if (nMonths > 0 || nDays > 0)
				{
					// force next whole number
					nYears = Math.ceil(nYears + .1)
				}

				// alert("years = " + nYears + " mths = " + nMonths + " days = " + nDays )
			}
				
			
			// examine possible prior policy age ceiling
			nCeiling = GetAgeCeiling(cRegion)

			if (nCeiling != 0 && cRegion != "NJ")
			{
				if (method == "Reissue" && nYears > nCeiling)
				{
					alert("Prior policy age exceeds " + nCeiling + " year limit for " + method + ".\r\nUse Regular or Orginal method instead.")
					goCalcform.priordate.value = ""
					return(false)
				}
			}

			// whew!

		} // endif (sPriordate != "")		

	} // endif (method == ...)


	if ( (method == "Temporary" && (cRegion == "SC" || cRegion == "TN" || cRegion == "TND"
			|| cRegion == "TNS" || cRegion == "TNK" || cRegion == "TNH" ))	|| 
			(method == "RefinanceWithSE" || method == "RefinanceWithoutSE") ||
			method == "Modification" ||
			(cRegion == "MIC" && (method == "ReissueLoan" || method == "Refinance" 
			|| method == "BasicLoan")) || 
			((cRegion == "NY1" || cRegion == "NY2" || cRegion == "DC") && method == "Refinance") ) 
	{
		// mortgagee only method, so don't allow owner cvg usage
		nOwnercvg = 0.00
	}
	
	if (cRegion == "MIC")
	{
		// force $1m min cvg usage in Mich Commercial region
		if (nLendercvg < 1000000)
		{
			nLendercvg = 0.00
		}
		if (nOwnercvg < 1000000)
		{
			nOwnercvg = 0.00
		}
		if (nPriorcvg < 1000000)
		{
			nPriorcvg = 0.00
		}
		if (nCvg < 1000000)
		{
			nCvg = 0.00
		}
	}

	
	//validate shared coverage is numeric
	if (isNaN(nCvg) && !goCalcform.coverage.disabled)
	{
		alert("Please enter numeric values only for Highest coverage.")
		goCalcform.coverage.value = "0.00"
		goCalcform.coverage.focus()
		return(false)
	}

	//validate owner coverage is numeric
	if (isNaN(nOwnercvg) && !goCalcform.ownercvg.disabled)
	{
		alert("Please enter numeric values only for Owner coverage.")
		goCalcform.ownercvg.value = "0.00"
		goCalcform.ownercvg.focus()
		return(false)
	}

	//validate lender coverage is numeric
	if (isNaN(nLendercvg) && !goCalcform.lendercvg.disabled)
	{
		alert("Please enter numeric values only for Lender coverage.")
		goCalcform.lendercvg.value = "0.00"
		goCalcform.lendercvg.focus()
		return(false)
	}

	//validate highest prior cvg
	if (isNaN(nPriorcvg) && !goCalcform.priorcvg.disabled)
	{
		alert("Please enter numeric values only for Highest prior coverage.")
		goCalcform.priorcvg.value = "0.00"
		goCalcform.priorcvg.focus()
		return (false)
	}

	// validate owner prior cvg
	if (isNaN(nOwnPriorcvg) && !goCalcform.opriorcvg.disabled)
	{
		alert("Please enter numeric values only for Owner prior coverage.")
		goCalcform.opriorcvg.value = "0.00"
		goCalcform.opriorcvg.focus()
		return (false)
	}
	
	// validate lender prior cvg
	if (isNaN(nMtgPriorcvg) && !goCalcform.mpriorcvg.disabled)
	{
		alert("Please enter numeric values only for Mortgagee prior coverage.")
		goCalcform.mpriorcvg.value = "0.00"
		goCalcform.mpriorcvg.focus()
		return (false)
	}


	/* ************************************
	//validate 'nYears' is numeric
	if (isNaN(nYears))
	{
		alert("Please enter numeric values only.")
		goCalcform.years.value = "0"
		goCalcform.years.focus()
		return (false)
	} 

	// validate reasonableness in years
	if (nYears > 99)
	{
		alert("Prior policy age should be less than 100")
		goCalcform.years.value = "0"
		goCalcform.years.focus()
		return (false)
	}
	************************************ */


	if ( ((cRegion == "MD" || cRegion == "TN" || cRegion == "TND" || cRegion == "TNH" || cRegion == "TNK" 
		|| cRegion == "NE" || cRegion == "NE1" || cRegion == "MS" || cRegion == "AR" 
		|| cRegion == "IN1" || cRegion == "IN2" || cRegion == "IN3" || cRegion == "IL")
		&& method == "Refinance" && nPriorcvg > 0 && nYears > 0 && nLendercvg == 0) || 
		(cRegion == "PAC" && method == "Refinance" && nYears > 0 && nLendercvg == 0) )
	{
		alert("Mortgagee coverage required for " + method)
		// seeding a non-zero value keeps this trap from repeatedly firing
		goCalcform.lendercvg.value = "1.00"
		goCalcform.lendercvg.focus()
		return (false)
	}
	
	if (cRegion == "MIC" && (method == "Basic" || method == "Reissue") && nOwnercvg == 0 && nLendercvg > 0)
	{
		alert("Owner coverage required for " + method)
		// seeding a non-zero value keeps this trap from repeatedly firing
		goCalcform.ownercvg.value = "1000000.00"
		goCalcform.ownercvg.focus()
		return (false)
	}

	
	// round coverages up to nearest $k for these regions
	if (cRegion == "PA" || cRegion == "PAC" || cRegion == "SC" || cRegion == "V1" 
		|| cRegion == "V2" || cRegion == "V3" || cRegion == "WV"  || cRegion == "NY1" 
		|| cRegion == "NY2"  || cRegion == "MI1" || cRegion == "MI2" || cRegion == "MIK" 
		|| cRegion == "MIC"  || cRegion == "MI1m" || cRegion == "MI2m" || cRegion == "MIKm"
		|| cRegion == "MI1x" || cRegion == "MI2x" || cRegion == "MIKx" || cRegion == "AL"
		|| cRegion == "KY" || cRegion == "NE" || cRegion == "NE1" || cRegion == "DC" 
		|| cRegion == "MS" || cRegion == "AR" || cRegion == "IN1" || cRegion == "IN2" 
		|| cRegion == "IN3" || cRegion == "NJ" || cRegion == "IL" || cRegion == "LA" )
	{
		nCvg = (nCvg > 0) ? kRoundup(nCvg) : nCvg
		nOwnercvg = (nOwnercvg > 0) ? kRoundup(nOwnercvg) : nOwnercvg
		nLendercvg = (nLendercvg > 0) ? kRoundup(nLendercvg) : nLendercvg
		nPriorcvg = (nPriorcvg > 0) ? kRoundup(nPriorcvg) : nPriorcvg

		// these are NJ prior coverages
		nOwnPriorcvg = (nOwnPriorcvg > 0) ? kRoundup(nOwnPriorcvg) : nOwnPriorcvg
		nMtgPriorcvg = (nMtgPriorcvg > 0) ? kRoundup(nMtgPriorcvg) : nMtgPriorcvg

	}
	

	// round coverages up to nearest $100 for these regions
	if (cRegion == "FL")
	{
		nCvg = (nCvg > 0) ? hRoundup(nCvg) : nCvg
		nOwnercvg = (nOwnercvg > 0) ? hRoundup(nOwnercvg) : nOwnercvg
		nLendercvg = (nLendercvg > 0) ? hRoundup(nLendercvg) : nLendercvg
		nPriorcvg = (nPriorcvg > 0) ? hRoundup(nPriorcvg) : nPriorcvg
	}

	// reinit the prior cvg for New Jersey 
	nPriorcvg = (cRegion == "NJ" && method == "Reissue") ? nOwnPriorcvg : nPriorcvg
	nPriorcvg = (cRegion == "NJ" && method == "Refinance") ? nMtgPriorcvg : nPriorcvg

	// start the shoooww..

	// fetch the min premium for the region
	nMinprem = getMinPrem(cRegion)

	if (cRegion == "NC")
	{
		// shared coverage prompts

		if (method == "Regular")
		{
			nPremium = PremCalc(cRegion, "MOL", nCvg, nMinprem)
		}

		else if (method == "Reissue" && nPriorcvg > 0 && nYears > 0)
		{
			nNew = PremCalc(cRegion, "MOL", nCvg, nMinprem)     // calc at new cvg
			nPrior = PremCalc(cRegion, "MOL", nPriorcvg, nMinprem)   // calc at prior cvg
			nPremium = PremDisc(cRegion, "REIS", nNew, nPrior, nYears, nMinprem)  // apply discount
		}
		
		else if (method == "Refinance" && nPriorcvg > 0 && nYears > 0)
		{
			nNew = PremCalc(cRegion, "MOL", nCvg, nMinprem)     // calc at new cvg
			nPrior = PremCalc(cRegion, "MOL", nPriorcvg, nMinprem)   // calc at prior cvg
			nPremium = PremDisc(cRegion, "REFI", nNew, nPrior, nYears, nMinprem)  // apply discount
		}

		else if (method == "Commercial")
		{
			nPremium = getFlatRatePerK(cRegion, "CMER", nCvg, nMinprem)
		}

		else if (method == "Temporary")
		{
			nPremium = getFlatRatePerK(cRegion, "TCON", nCvg, nMinprem)
		}

		else if (method == "SubdivDevel")
		{
			nPremium = getFlatRatePerK(cRegion, "SDSA", nCvg, nMinprem)
		}

		else if (method == "CommunHouse")
		{
			nPremium = getFlatRatePerK(cRegion, "CHOU", nCvg, nMinprem)
		}

	} // end NC calcs

	else if (cRegion == "MD" || cRegion == "SC" || cRegion == "V1" || cRegion == "V2" 
			|| cRegion == "V3" || cRegion == "WV" || cRegion == "MI1" || cRegion == "MI2" 
			|| cRegion == "MIK" || cRegion == "MIC" || cRegion == "MI1x" || cRegion == "MI2x" 
			|| cRegion == "MIKx" || cRegion == "MI1m" || cRegion == "MI2m" 
			|| cRegion == "MIKm" || cRegion == "NY1" || cRegion == "NY2" || cRegion == "AL" 
			|| cRegion == "PA" || cRegion == "PAC" || cRegion == "KY" || cRegion == "NE"
			|| cRegion == "NE1" || cRegion == "DC" || cRegion == "MS" || cRegion == "AR" 
			|| cRegion == "IN1" || cRegion == "IN2" || cRegion == "IN3" || cRegion == "OH"
			|| cRegion == "NJ" || cRegion == "GM" || cRegion == "GS" || cRegion == "IL" 
			|| cRegion == "LA" || cRegion == "FL" ) 
	{
		
		// dual coverage prompts and calcs

		// init matrix table codes
		if (cRegion == "SC" || cRegion == "MIC"  || cRegion == "PA" || cRegion == "PAC" 
			|| cRegion == "NE" || cRegion == "NE1" || cRegion == "IN1" || cRegion == "IN2"
			|| cRegion == "IN3" || cRegion == "NJ" || cRegion == "FL"
			|| method == "BasicWithoutSE" || method == "ReissueWithoutSE" 
			|| method == "RefinanceWithoutSE" )
		{
			cMtgeCode = "MOL"
			cOwnCode = "MOL"
		}
		else
		{
			if(applyNY15PercentDiscount){		
	//			alert('method '+method);
				if((cRegion=="NY1"||cRegion=="NY2")&&method=="Modification"){
				
					cMtgeCode = "MODMTG"
					if(cRegion=="NY2"){
						if(nOwnercvg>=1000000){
							cOwnCode = "MODOWN"
						}else cOwnCode = "LOWMODOWN"
					}else
						cOwnCode = "MODOWN"
				}else{
					cMtgeCode = "MTG"
					if(method!="Temporary"){
						if(cRegion=="NY2"){
							if(nOwnercvg>=1000000){
								cOwnCode = "OWN"
							}else cOwnCode = "LOWOWN"
						}else
							cOwnCode = "OWN"
					}else
							cOwnCode = "OWN"
				}
			}else{
				if((cRegion=="NY1"||cRegion=="NY2")&&method=="Modification"){
					cMtgeCode = "MODMTG"
					cOwnCode = "MODOWN"
				}else{
					cMtgeCode = "MTG"
					cOwnCode = "OWN"
				}
			}
//			alert('mtgcode '+cMtgeCode+' owncode '+cOwnCode);
		}

		if (cRegion == "FL" && method == "RegularMultiple")
		{
			// method has its own min prem
			nMinprem = getOtherMinPrem(cRegion)
		}

		// re-init min premium values for separate entity usage
		if (cRegion == "MD" || cRegion == "NY1" || cRegion == "NY2" || cRegion == "DC" 
		      || cRegion == "OH" || cRegion == "LA")
		{
			nOwnMinprem = nMinprem
			nMtgMinprem = getOtherMinPrem(cRegion)
		}
		else
		{
			nOwnMinprem = nMinprem
			nMtgMinprem = nMinprem
		}


		// rate calcs follow
///alert('('+cRegion+','+ cOwnCode+','+ cMtgeCode+','+method+')');
		if (method == "Regular" || method == "Basic" || method == "BasicWithSE" 
				|| method == "BasicWithoutSE"  || method == "BasicLoan" 
				|| method == "RegularMultiple" || method == "Modification")
		{

			
			// calc each entity
			nOwneramt = PremCalc(cRegion, cOwnCode, nOwnercvg, nOwnMinprem)
			nLenderamt = PremCalc(cRegion, cMtgeCode, nLendercvg, nMtgMinprem)
/*			if(method=='Modification'){
				nOwneramt=Math.ceil(nOwneramt);
				nLenderamt=Math.ceil(nLenderamt); 
			}*/
			// save off the "new" lenderamt for simul calc in Mich
			nNewLenderamt = nLenderamt

			// flag for simul calc
			bCalc = true

			 //alert("Owner = " + nOwneramt +" lender="+nLenderamt)

		}


	/* *********************************************************************

	NOTE: disabled but preserving legacy UW method of Reissue/Refi calc;
	see note in following Refi/Reis section for explantion
		
		else if (cRegion != "MD" && (method == "Reissue" || method == "Refinance") 
				&& nPriorcvg > 0 && nYears > 0)
		{

			// calc new 
			nOwneramt = PremCalc(cRegion, cOwnCode, nOwnercvg, nMinprem)
			nLenderamt = PremCalc(cRegion, cMtgeCode, nLendercvg, nMinprem)
			nNew = Math.max(nOwneramt, nLenderamt)

			// calc prior; note use of same cvg in both calcs
			if (nOwnercvg > 0)
			{
				nOwneramt = PremCalc(cRegion, cOwnCode, nPriorcvg, nMinprem)
			}
			if (nLendercvg > 0)
			{
				nLenderamt = PremCalc(cRegion, cMtgeCode, nPriorcvg, nMinprem)
			}
				
			nPrior = Math.max(nOwneramt, nLenderamt)
			
			if (method == "Reissue")
			{
				cCode = "REIS"
			}
			else
			{
				cCode = "REFI"
			}

			// apply discount
			nPremium = PremDisc(cRegion, cCode, nNew, nPrior, nYears, nMinprem) 
			
		}
		
		else if (cRegion == "MD" && (method == "Reissue" || method == "Refinance") 
				&& nPriorcvg > 0 && nYears > 0)

	********************************************************************************** */

		
		else if ((method == "Reissue" || method == "Refinance" || method == "ReissueWithoutSE" 
				|| method == "ReissueWithSE" || method == "ReissueLoan" 
				|| method == "RefinanceWithoutSE" || method == "RefinanceWithSE" 
				|| method == "ReissueUnimproved") &&
				 ( (nPriorcvg > 0 && nYears > 0) || (cRegion == "NJ" ) || (cRegion == "MIC" || (cRegion == "PAC" && nYears > 0)) ))
		{

			/*
			  NOTE: To arrive at same calcs as TP, must now calc each entity
			        separately (e.g. calc owner new and prior, then lender
					new and prior). Legacy UW method of calcing new and prior
					with max coverage value no longer works with Eva's TP scripts 
					when lender exceeds owner and prior <= new. Already had this
					method written for Maryland anyway due to differing owner
					and mtgee min premiums; just had to open it up for 
					everyone else. ROD 08/02/01
			*/


			/*
				10/21/02 ROD revise minprem usage
			*/
			if (cRegion == "PAC")
			{
				// no min prem used here
				nOwnMinprem = 0
				nMtgMinprem = 0
			}

			// calc new 
			nOwneramt = PremCalc(cRegion, cOwnCode, nOwnercvg, nOwnMinprem)
			nLenderamt = PremCalc(cRegion, cMtgeCode, nLendercvg, nMtgMinprem)

			// save off the "new" lenderamt for simul calc in Mich
			nNewLenderamt = nLenderamt

			// flag for simul calc
			bCalc = true

			// alert("Owner new = " + nOwneramt +  "   Lender new = " + nLenderamt)

			if (method == "Reissue" || method == "ReissueWithSE" || method == "ReissueWithoutSE" 
					|| method == "ReissueLoan" || method == "ReissueUnimproved")
			{
				cCode = (cRegion == "PAC" || cRegion == "NJ" || cRegion == "FL") ? "REI" : "REIS"
			}
			else
			{
				cCode = (cRegion == "PAC" || cRegion == "NJ") ? "REF" : "REFI"

				if (cRegion == "NY1" || cRegion == "NY2")
				{
					// New York has differing discount rate based upon cvg
					x = aSeek(cRegion, "REFI")
					if (x > -1)
					{
						// init the discount code to use
						cCode = (nLendercvg > gaMatrix[x][gnCol_maxlimit]) ? "REFy" : "REFx"
						// nMtgMinprem = (cCode == "REFy") ? 0 : nMtgMinPrem
					}
				}
				else if (cRegion == "IN2")
				{
					// Refi uses Reissue in this region for whatever strange reason
					cCode = "REIS"
				}
				
			}
			// calc prior and discount...each entity
			
			if (nOwnercvg > 0)
			{

				if (cRegion == "MIC")
				{
					// MIC commerical does its own discount thing...no prior cvg involved
					nOwneramt = CommDisc(cRegion,cCode,nOwnercvg,nOwneramt,nOwnMinprem,cOwnCode)	

					// alert("Discounted Owner = " + nOwneramt)

				}
				else if (cRegion == "PAC")
				{
					// PAC does its own discount thing...no prior cvg involved
					nOwneramt = SpecDisc(cRegion,cCode,nOwnercvg,nOwneramt,nYears,nOwnMinprem,cOwnCode)
				}
				else if ( (cRegion == "NJ"  && method == "Reissue") || cRegion == "FL")
				{
					// Jersey and Floridas out there alone
									
					// calc prior rate
					nPrior = PremCalc(cRegion, cOwnCode, nPriorcvg, nOwnMinprem)
					
					// calc in discount matrix
					nDiscamt = PremCalc(cRegion, cCode, Math.min(nPriorcvg,nOwnercvg), nOwnMinprem)
					
					// apply discount
					nOwneramt = nDiscamt + Math.max((nOwneramt - nPrior),0)

				}

				else if (cRegion == "NJ"  && method == "Refinance")
				{
					nOwneramt =  NJCalc(nOwnercvg, nOwnPriorcvg)
				}
				else
				{
					// all other regions calc prior rate
					nPrior = PremCalc(cRegion, cOwnCode, nPriorcvg, nOwnMinprem)
					// apply discount
					nOwneramt = PremDisc(cRegion, cCode, nOwneramt, nPrior, nYears, nOwnMinprem)

					// alert("Owner Prior = " + nPrior)

				}  // endif (cRegion == ...)
				
			} // endif (nOwnercvg > 0)

			if (nLendercvg > 0)
			{
				if (cRegion == "MIC")
				{
					// MIC commerical does its own discount thing...no prior cvg involved
					nLenderamt = CommDisc(cRegion,cCode,nLendercvg,nLenderamt,nMtgMinprem,cMtgeCode)	

					// alert("Discounted Lender = " + nLender)
				}
				else if (cRegion == "PAC")
				{
					// PAC does its own discount thing...no prior cvg involved
					nLenderamt = SpecDisc(cRegion,cCode,nLendercvg,nLenderamt,nYears,nMtgMinprem,cMtgeCode)
				}
				else if ( (cRegion== "NJ" && method == "Reissue" ) || cRegion == "FL")
				{
					// Jersey and Florida out there alone
					
					// calc prior rate
					nPrior = PremCalc(cRegion, cMtgeCode, nPriorcvg, nMtgMinprem)
					
					// calc in discount matrix
					nDiscamt = PremCalc(cRegion, cCode, Math.min(nPriorcvg,nLendercvg), nMtgMinprem)
					
					// apply discount
					nLenderamt = nDiscamt + Math.max((nLenderamt - nPrior),0)

				}

				else if (cRegion == "NJ"  && method == "Refinance")
				{
					// this one's from another planet

					nOwneramt =  NJCalc(nLendercvg, nMtgPriorcvg)
				}	


				else
				{
					// prior rate
					nPrior = PremCalc(cRegion, cMtgeCode, nPriorcvg, nMtgMinprem)
					
		
					// apply discount
					if ((method == "RefinanceWithSE" || method == "RefinanceWithoutSE")) 
					{
						// Refinance is pretty bizzare in Michigan regions

						/*
						  first calc discount at 1 year or more rate;
						  note hardcoded parameters: 0 for priorcvg and 1 for years age of prior
						*/
						nDiscamt = PremDisc(cRegion, cCode, nLenderamt, 0, 1, nMtgMinprem)

						// alert("nDiscamt = " + nDiscamt)

						if (nYears < 1)
						{
							/*
							 if prior less than a year old, take lesser of previous discount calc or
                             or calcuated discount for less than year old. Screwy!
							*/
							nLenderamt = Math.min(nDiscamt, PremDisc(cRegion, cCode, nLenderamt, nPrior, nYears, nMtgMinprem))
						}
						else
						{
							// older than a year...just go with the full rate discount
							nLenderamt = nDiscamt
						}

					}
					else
					{
						// all others proceed with normal discount method...pass prior rate
						nLenderamt = PremDisc(cRegion, cCode, nLenderamt, nPrior, nYears, nMtgMinprem)
					}
								
					// alert("Lender Prior = " + nPrior + "  Lender Disc Prem = " + nLenderamt)

				}  // (cRegion == ...)

			} //endif (nLendercvg > 0)
			
		} // endif (method == "Reissue/Refinance")
		
		else if (method == "Temporary" && nLendercvg > 0)
		{
			// calc any owner at regular rate
			nOwneramt = PremCalc(cRegion, cOwnCode, nOwnercvg, nOwnMinprem)
		
			// flag for simul calc
			bCalc = true

			if (cRegion == "NY1" || cRegion == "NY2")
			{
				// calc lender cvg under Owner matrix
				nLenderamt = PremCalc(cRegion, cOwnCode, nLendercvg, nOwnMinprem)
			}
			else if (cRegion == "OH")
			{
				// calc lender with matrix
				nLenderamt = PremCalc(cRegion, "TCN", nLendercvg, nMtgMinprem)
			}
			else 
			{
				// calc lender at TC rate
				nLenderamt = getFlatRatePerK(cRegion, "TCON", nLendercvg, nMtgMinprem)
			}
			
		
			// alert("Owner = " + nOwneramt + "  Lender = " + nLenderamt)
		
		} // endif (method == ...)

		
		if (cRegion == "V1" || cRegion == "V2" || cRegion == "V3" || cRegion == "WV"  
			|| cRegion == "NY1" || cRegion == "NY2"  || cRegion == "AL" || cRegion == "KY"
			|| cRegion == "DC" || cRegion == "MS" || cRegion == "AR" || cRegion == "IN1" 
			|| cRegion == "IN2" || cRegion == "IN3" || cRegion == "NJ" || cRegion == "IL"
			|| cRegion == "LA")
		{
			// apply premium rounding to nearest whole dollar...prior to simul
			nOwneramt = Math.round(nOwneramt)
			nLenderamt =  Math.round(nLenderamt)
		}


		// finish calcs with simul examination

		if (bCalc)
		{

			if (cRegion == "MI1" || cRegion == "MI2" || cRegion == "MIK" 
				|| cRegion == "MI1x" || cRegion == "MI2x" || cRegion == "MIKx"
				|| cRegion == "MI1m" || cRegion == "MI2m" || cRegion == "MIKm"
				|| cRegion == "MIC")
			{
				// reassess Lender portion when simul...Michigan's out there by itself
						
				if (nOwnercvg > 0 && nLendercvg > 0)
				{
					// simul issue calcs	
					if (cRegion == "MIC")
					{	
						// MI commercial, flat fee assessed for lender portion
						nLenderamt = GetSimulfee(cRegion, nOwnercvg, nLendercvg)
					}
					else
					{
						// all other MI, apply discount to NEW lender amt in simul issue	
						nLenderamt = getPercentRate(cRegion, "SIOM", nNewLenderamt, nMtgMinprem)	

						// alert("Lender @simul rate = " + nLenderamt)
					}
				}
			}

			else if (cRegion == "NY1" || cRegion == "NY2")
			{
				if (nOwnercvg > 0 && nLendercvg > 0)
				{
					// New York does it's own thing for simul
					if (nLendercvg > nOwnercvg)
					{
						if (method == "Regular")
						{
							// get an *Owner* rate based upon *Lender* matrix
							nAmt = PremCalc(cRegion, cMtgeCode, nOwnercvg, nMtgMinprem)
							// recalc the lender
							nLenderamt = (nLenderamt - nAmt) + getPercentRate(cRegion, "SIOM", nAmt, 0)
						}
						else if (method == "Temporary")
						{
							// recalc the lender
							nLenderamt = (nLenderamt - nOwneramt) + getPercentRate(cRegion, "SIOM", nOwneramt, 0)
						}
						
					}
					else
					{	
						// calc lender at percent rate	
						nLenderamt = getPercentRate(cRegion, "SIOM", nLenderamt, 0)
					}
					
					// round entity premium for consistency with TP
					nLenderamt = Math.round(nLenderamt)

				}
			}

			else if (cRegion == "DC" && method != "Temporary")
			{
				// DC does its own thing for simul
				if (nOwnercvg > 0 && nLendercvg > 0)
				{
					x = aSeek(cRegion, "SIOM")
					if (x > -1)
					{
						// greater of...flat fee or x% of owner amt
						nOwneramt = Math.max(gaMatrix[x][gnCol_rate], percentcalc(nOwneramt, gaMatrix[x][gnCol_additional]))
					}

					// round entity premiums for consistency with TP
					nOwneramt = Math.round(nOwneramt)
					
				}
			}

			else if (nOwnercvg > 0 && nLendercvg > 0 && cRegion == "NJ" && method == "Refinance")
			{
				// NJ Refi: Lender absorbs simul in addition to existing calc
				nLenderamt += GetSimulfee(cRegion, nOwnercvg, nLendercvg)
			}

			
			else if (nOwnercvg > 0 && nLendercvg > 0 && !(cRegion == "DC" && method == "Temporary"))
			{
				// simul calc for remaining regions
				if (nLenderamt > nOwneramt)
				{
					nLenderamt = (nLenderamt - nOwneramt) + GetSimulfee(cRegion, nOwnercvg, nLendercvg)
				}
				else
				{
					nLenderamt = GetSimulfee(cRegion, nOwnercvg, nLendercvg)
				}
			}
		
		}	// endif (bCalc)

		// sum entities for result
		nPremium = nOwneramt + nLenderamt

	}
	
	else if (cRegion == "TN" || cRegion == "TND" || cRegion == "TNH" || cRegion == "TNK" ||
				cRegion == "TNS")
	{
		// dual coverages with unique setup for search fee calcs

		cOldRegion = cRegion

		// set up two passes through rate calcs, specifically for TNK, TNH search fee calc
		for (nPass = 1; nPass < 3 ; nPass++ )
		{

			if (nPass == 2 && (cOldRegion == "TNK" || cOldRegion == "TNH"))
			{
				// temporary identity switch of region
				cRegion = "TN"
			}

			// fetch the min premium for the region in use
			nMinprem = getMinPrem(cRegion)

			// init matrix codes
			if (cRegion == "TND" || cRegion == "TNK" || cRegion == "TNS")
			{
				cMtgeCode = "MOL"
				cOwnCode = "MOL"
			}
			else
			{
				cMtgeCode = "MTG"
				cOwnCode = "OWN"
			}

			
			// rate calcs follow

			if (method == "Regular")
			{
				nOwneramt = PremCalc(cRegion, cOwnCode, nOwnercvg, nMinprem)
				nLenderamt = PremCalc(cRegion, cMtgeCode, nLendercvg, nMinprem)
			}

			else if (method == "Reissue" && nPriorcvg > 0 && nYears > 0)
			{

				// see note in previous Reissue/Refinance calc

				// calc new 
				nOwneramt = PremCalc(cRegion, cOwnCode, nOwnercvg, nMinprem)
				nLenderamt = PremCalc(cRegion, cMtgeCode, nLendercvg, nMinprem)
				
				// calc prior and discount...each entity
				
				if (nOwnercvg > 0)
				{
					// prior rate
					nPrior = PremCalc(cRegion, cOwnCode, nPriorcvg, nMinprem)
					// apply discount
					nOwneramt = PremDisc(cRegion, "REIS", nOwneramt, nPrior, nYears, nMinprem)

				}

				if (nLendercvg > 0)
				{
					// prior rate
					nPrior = PremCalc(cRegion, cMtgeCode, nPriorcvg, nMinprem)
					// apply discount
					nLenderamt = PremDisc(cRegion, "REIS", nLenderamt, nPrior, nYears, nMinprem)

				}
				
			}
		
			else if (method == "Refinance" && nPriorcvg > 0 && nYears > 0)
			{

				// see note in previous Reissue/Refinance calc

				// calc new 
				nOwneramt = PremCalc(cRegion, cOwnCode, nOwnercvg, nMinprem)
				nLenderamt = PremCalc(cRegion, cMtgeCode, nLendercvg, nMinprem)

				// init special min for discount calc
				x = aSeek(cRegion, "SURE")
				if (x > -1)
				{
					nDiscMin = gaMatrix[x][gnCol_additional]
				}

				// calc prior and discount...each entity
				
				if (nOwnercvg > 0)
				{
					// prior rate
					nPrior = PremCalc(cRegion, cOwnCode, nPriorcvg, nMinprem)
					// apply discount
					nOwneramt = PremDisc(cRegion, "SURE", nOwneramt, nPrior, nYears, nDiscMin)

				}

				if (nLendercvg > 0)
				{
					// prior rate
					nPrior = PremCalc(cRegion, cMtgeCode, nPriorcvg, nMinprem)
					// apply discount
					nLenderamt = PremDisc(cRegion, "SURE", nLenderamt, nPrior, nYears, nDiscMin)

				}
							
			}

			else if (method == "Temporary" && nLendercvg > 0)
			{
				if (cRegion == "TN" || cRegion == "TNS")
				{
					// calc the premium rate
					nLenderamt = PremCalc(cRegion, cMtgeCode, nLendercvg, nMinprem)
				    nLenderamt = getPercentRate(cRegion, "TCON", nLenderamt, nMinprem)
				}
				else
				{
					// use a graduated level
					nLenderamt = PremCalc(cRegion, "TCB", nLendercvg, nMinprem)
				}
				
				
			}  // endif (method == ...)

			
			// simul examination
			if (nOwneramt > 0 && nLenderamt > 0)
			{
				if (nLenderamt > nOwneramt)
				{
					nLenderamt = (nLenderamt - nOwneramt) + GetSimulfee(cRegion, nOwnercvg, nLendercvg)
				}
				else
				{
					nLenderamt = GetSimulfee(cRegion, nOwnercvg, nLendercvg)
				}	
			}

			nPremium = nOwneramt + nLenderamt


			if (cRegion == "TNK" || cRegion == "TNH")
			{
				// save off the Knox and Hamilton premium
				nRegionprem = nPremium
			}

			if (nPass == 1 && (cRegion == "TN" || cRegion == "TND" || cRegion == "TNS"))
			{
				// TNK and TNH take a second pass thru to calcs; all others exit
				break
			}
			else
			{
				// restore region identity
				cRegion = cOldRegion
			}

		}

		// calc the search fees

		if (cRegion == "TNK" || cRegion == "TNH")
		{
			// search is All Other region less current region
			nSearchamt = nRegionprem - nPremium
		}
		else if (cRegion == "TND" || cRegion == "TNS")
		{
			// search is premium less percentage of premium
			nPercent = (cRegion == "TND") ? 50 : 60
			nOwneramt = percentcalc(nOwneramt, nPercent)
			nLenderamt = percentcalc(nLenderamt, nPercent)
			
			nPremium = nOwneramt + nLenderamt
			nSearchamt = nPremium
		}

		if (method == "Temporary" && nLendercvg > 0)
		{
			// add-in any commitment fee, but after search calc
			nPremium += GetCommitmentfee(cRegion, nLendercvg)
		}

	} // endif (sRegion == ...)


	// format and reinit rate parameters
	goCalcform.premium.value = format(nPremium,2)
	// goCalcform.priorcvg.value = format(nPriorcvg,2)
	// goCalcform.years.value = "" + nYears
	goCalcform.priordate.value = sPriordate
	
	if (gbNav4)
	{
		// goCalcform.years.value = padl(nYears,14)
	}

	if (!goCalcform.priorcvg.disabled)
	{	
		goCalcform.priorcvg.value = format(nPriorcvg,2)
	}

	if (!goCalcform.opriorcvg.disabled)
	{	
		goCalcform.opriorcvg.value = format(nOwnPriorcvg,2)
	}

	if (!goCalcform.mpriorcvg.disabled)
	{	
		goCalcform.mpriorcvg.value = format(nMtgPriorcvg,2)
	}

	if (!goCalcform.coverage.disabled)
	{	
		goCalcform.coverage.value = format(nCvg,2)
	}

	if (!goCalcform.ownercvg.disabled)
	{	
		goCalcform.ownercvg.value = format(nOwnercvg,2)
	}

	if (!goCalcform.lendercvg.disabled)
	{	
		goCalcform.lendercvg.value = format(nLendercvg,2)
	}

	if (!goCalcform.search.disabled)
	{
		goCalcform.search.value = format(nSearchamt,2)
	}

	if (!goCalcform.allincl.disabled)
	{
		goCalcform.allincl.value = format(nPremium + nSearchamt,2)
	}

	if (!goCalcform.ownprem.disabled)
	{
		goCalcform.ownprem.value = format(nOwneramt,2)
	}

	if (!goCalcform.mtgprem.disabled)
	{
		goCalcform.mtgprem.value = format(nLenderamt,2)
	}


}
//eofct: calc()


///////////////////////////////////////////
// calculator supporting functions below //
///////////////////////////////////////////


function aSeek(cRegion, cCode) {
/* 
  scan matrix array for first state and method code ocurrance, 
  returning first element number found; basically simulates a table seek
  created ROD 03/08/01
*/
	var i
	var element = -1

	for (i=0; i < gaMatrix.length ; i++ )
	{
		if (gaMatrix[i][gnCol_region] == cRegion && gaMatrix[i][gnCol_code].substring(0, cCode.length) == cCode)
		{
			element = i
			break
		}
	}

	return element 
}
// eofct: aSeek()


function aOptSeek(cRegion) {
/* 
  scan options array for first state ocurrance, 
  returning first element number found; basically simulates a table seek
  created ROD 03/12/01
*/
	var i
	var element = -1

	for (i=0; i < gaOption.length ; i++ )
	{
		if (gaOption[i][gnCol_opt_region] == cRegion) 
		{
			element = i
			break
		}
	}

	return element 
}
// eofct: aOptSeek()


function extcalc(nAmt, nUnits) {
/*
   Calculate an extended two-decimal price 
   created ROD 03/08/01
*/
	nAmt = Math.round( 100 * nAmt * nUnits) / 100
	return nAmt
}
// eofct: extcalc()


function percentcalc(nAmt, nRate) {
/*
   Calculate an extended two-decimal price for percentage rate
   created ROD 03/08/01
*/
	nAmt = Math.round( 100 * nAmt * (nRate * .01) ) / 100
	return nAmt
}
// eofct: percentcalc()


function getMinPrem(cRegion) {
/*
   Retrieve the minimum premium for the region
   created ROD 03/08/01
*/
	var minprem = 0

	var x = aSeek(cRegion, "MINP")      // find the min premium element
	if (x > -1)
	{
		// use the standard array value
		minprem = gaMatrix[x][gnCol_rate]
	}
	return minprem
}
// eofct: getMinPrem()


function getOtherMinPrem(cRegion) {
/*
   Retrieve Other minimum premium for the region
   created ROD 05/03/01
*/
	var minprem = 0

	var x = aSeek(cRegion, "MINP")      // find the min premium element
	if (x > -1)
	{
		// use the standard array value
		minprem = gaMatrix[x][gnCol_additional]
	}
	return minprem
}
// eofct: getOtherMinPrem()



function kRoundup(nCvg) {
/*
  round coverage *up* to nearest $k; one line of code...thankyouverymuch
  created 03/14/01 ROD
  */
var nResult = Math.floor((eval(nCvg) + 999.99) * .001) * 1000
return nResult
}
// eofct: kRoundup()


function hRoundup(nCvg) {
/*
  round coverage *up* to nearest $100; one line of code...thankyouverymuch
  created 09/25/02 ROD
  */
var nResult = Math.floor((eval(nCvg) + 99.99) * .01) * 100
return nResult
}
// eofct: hRoundup()


function PremCalc(cRegion, cCode, nCvg, nMinprem) {
/*
  step-thru of rate matrix based upon supplied region and code,
  and return calculated premium
  created ROD 03/08/01
*/
//alert('PremCalc('+cRegion+','+ cCode+','+ nCvg+','+ nMinprem+')');
	var nAmt = 0.00
	var nPrem = 0.00
	var nApplied = 0.00
	var minprem = 0.00

	// init from coverage 
	var nRemain = nCvg         
	
	var i = aSeek(cRegion, cCode)       // find the 1st matrix method element

	if (i > -1 && nCvg  > 0 && (((cRegion == "TND" || cRegion == "TNH" || cRegion == "TNK" 
			|| cRegion == "TNS" || cRegion == "NY1" || cRegion == "NY2" || cRegion == "MIC"
			|| cRegion == "MI1" || cRegion == "MI2" || cRegion == "MIK"
			|| cRegion == "MI1x" || cRegion == "MI2x" || cRegion == "MIKx"
			|| cRegion == "MI1m" || cRegion == "MI2m" || cRegion == "MIKm" 
			|| cRegion == "PA" || cRegion == "PAC" || cRegion == "NE" 
			|| cRegion == "NE1" || cRegion == "LA" ) && 
		    (cCode == "MOL" || cCode == "OWN" || cCode == "MTG" || 
			cCode == "TCB" ||cCode == "MODOWN" ||cCode == "MODMTG" ||cCode == "LOWMODOWN"  )) ||  (cRegion == "NY2" && cCode == "LOWOWN") ))
	{
		// these regions calc first level at flat rate
//		alert("i = "+i+", gnCol_rate = "+gnCol_rate)
		nPrem = gaMatrix[i][gnCol_rate]
		nApplied += gaMatrix[i][gnCol_maxlimit]
		nRemain -= gaMatrix[i][gnCol_maxlimit]
		i++
	}

	// step thru the rate matrix levels
	while (i > -1 && i < gaMatrix.length && nRemain > 0.00 && cRegion + cCode == gaMatrix[i][gnCol_region] + gaMatrix[i][gnCol_code].substring(0, cCode.length) )
	{

		if (cCode == "MHP")
		{
			// MHELP uses a flat rate on coverage levels
			nPrem += gaMatrix[i][gnCol_rate]
			nApplied += gaMatrix[i][gnCol_maxlimit]
			nRemain -= gaMatrix[i][gnCol_maxlimit]
		}
		else 
		{
			// all other calcs use rate per $k 
			nAmt = Math.min( gaMatrix[i][gnCol_maxlimit] - nApplied, nCvg - nApplied )
			nPrem += extcalc(nAmt, gaMatrix[i][gnCol_rate] * .001)
			nApplied += nAmt
			nRemain -= nAmt
		}

		if (glDebug)
		{
			alert("cRegion = "+cRegion+", cCode = "+cCode+", nAmt = " + nAmt + gs_crlf + "nPrem = " + nPrem + gs_crlf + "nApplied = " + nApplied + gs_crlf + "nRemain = " + nRemain)
		}

		i++
	}


	// don't apply minimum unless there's a provided coverage
	if (nCvg > 0)
	{
		nPrem = Math.max(nPrem,nMinprem)
	}

	// alert("Premium = " + nPrem)

	return nPrem
}
// eofct: PremCalc()


function getFlatRatePerK(cRegion, cCode, nCvg, nMinprem)	{
/*
  Calculate a flat rate per thousand;
  used for Temp Constr., Commercial, Community Housing, Subdivider
  created ROD 03/08/01
*/

	var nPrem = 0

	// find the rate method
	var i = aSeek(cRegion, cCode)
	if (i > - 1)
	{
		nPrem = Math.max(extcalc(nCvg, gaMatrix[i][gnCol_rate] * .001), nMinprem)
	}
	return nPrem
}
//eofct: getFlatRatePerK()


function getPercentRate(cRegion, cCode, nAmt, nMinprem)	{
/*
  Calculate an amount from a percentage rate
  created ROD 04/30/01
*/
	var nPrem = nAmt    // default to received parameter

	// find the rate method
	var i = aSeek(cRegion, cCode)
	if (i > - 1)
	{
		// calc percentage 
		nPrem = Math.max(percentcalc(nAmt,gaMatrix[i][gnCol_rate]),nMinprem)
	}
	
	//alert("Basic " + nAmt + " Rate = " + gaMatrix[i][gnCol_rate] + "  Minprem = " + nMinprem)
	// alert("nprem = " + nPrem)

	return nPrem
}
//eofct: getFlatRatePercent()



function PremDisc(cRegion, cCode, nNew, nPrior, nYears, nMinprem) {
/*
  Calculate Premium Discount for Reissue/Refinance
  created ROD 03/08/01
*/
	var nPercent = 100.00
	var nPrem

	var i = aSeek(cRegion, cCode)

	while (i > -1 && cRegion + cCode == gaMatrix[i][gnCol_region] + gaMatrix[i][gnCol_code].substring(0, cCode.length) )
	{
		if (nYears >= gaMatrix[i][gnCol_minlimit] && nYears <= gaMatrix[i][gnCol_maxlimit])
		{
			nPercent = gaMatrix[i][gnCol_rate]
			break
		}
		else
		{
			i++
		}
	}
	if (nPrior != 0 && nPrior <= nNew)
	{
		nPrem = (nNew - nPrior) + percentcalc(nPrior, nPercent)
	}
	else
	{
		nPrem = percentcalc(nNew, nPercent)
	}

// alert("New = " + nNew + "  nPrior = " + nPrior + "  nPercent = " + nPercent + "  nYears = " + nYears)

	return Math.max(nPrem, nMinprem)
}
// eofct: PremDisc()



function CommDisc(cRegion,cDiscCode,nCoverage,nNew,nMinprem,cOwnCode) {
/*
  Calculate Commercial Premium Discount for Reissue/Refinance (MIC only);
  ROD created 06/24/02 
*/
	var nPrem, nRemain, nAmount, nDisc, nPercent, bFirstpass

	nDisc = 0
	nRemain = nNew
	bFirstPass = false

	var i = aSeek(cRegion, cDiscCode)

	while (i > -1 && cRegion + cDiscCode == gaMatrix[i][gnCol_region] + gaMatrix[i][gnCol_code].substring(0, cDiscCode.length) )
	{
		nPercent = gaMatrix[i][gnCol_rate]

		if (!bFirstPass)
		{
					
			// calc basic rate on coverage up to maxlimit
			nAmount = PremCalc(cRegion, cOwnCode, Math.min(nCoverage, gaMatrix[i][gnCol_maxlimit]), nMinprem)
			
			bFirstPass = true
			nRemain -= nAmount

			// alert("nAmount = " + nAmount + "  nPercent = " + nPercent)

			// calc % of first portion of basic rate
			nDisc = percentcalc(nAmount, nPercent)

			// alert("first pass commdisc = " + nDisc)

		}
		else
		{
			// calc % on remaining portion of basic rate
			nDisc += percentcalc(nRemain, nPercent)

			//alert("subsequent pass commdisc = " + nDisc)

			break
		}

		i++

	}  // end while

	nPrem = nDisc

	return nPrem
}
// eofct: CommDisc()


function SpecDisc(cRegion,cDiscCode,nCoverage,nNew,nYears,nMinprem,cLvlCode) {
/*
  Calculate Discount for Reissue (PAC only);
  This discount is so unique, it needs its own "special" routine.
  Uses a graduated coverage level that uses a percentage in the
  first level (and second level for Refinance), and rate per $k for
  each successive level!

  Returns discounted premium amount
  07/10/02 ROD created
*/

	// alert("Parameters: " + cRegion + " " + cDiscCode + " " + nCoverage + " " + nNew + " " + nYears + " " + cLvlCode)

	var nAmount, nBase, nRate

	var nApplied = 0
	var nDisc = 0
	var nRemain = nCoverage

	var nCount = 1  // needed for refinance passes
	var bFirstPass = true
	var bApply = false

	var i = aSeek(cRegion, cDiscCode)
		

	// alert("years = " + nYears)

	// alert("i = " + i)

	while (i > -1 && cRegion + cDiscCode == gaMatrix[i][gnCol_region] + gaMatrix[i][gnCol_code].substring(0, cDiscCode.length) && nRemain > 0)
	{

		/*
		  Examine the age of prior policy during the first pass.
		  Also note usage of fractional years!
		*/

		if (bFirstPass && cDiscCode == "REI" && nYears > gaMatrix[i][gnCol_additional])
		{
			// age of prior policy exceeds threshold window - no reissue discount given
			nDisc = nNew
			break
		}
		else if (bFirstPass && cDiscCode == "REF" && nCount == 1)
		{
			/*
			   The first Refinance level, determined by age of prior policy,
			   applies an additional percentage rate discount to the discounted
			   premium. We'll init those needed values here.
			*/

			if (nYears <= gaMatrix[i][gnCol_maxlimit])
			{
				nRate = gaMatrix[i][gnCol_rate]
				bApply = true
			}
			else		
			{
				/*
					10/21/02 ROD add this else branch to break out; didn't have in legacy UW
				*/

				// age doesn't qualify for discount so bust out
				nDisc = nNew
				break
			}
			
			// advance to next level, incrementing counter but holding on to firstpass flag
			nCount ++
			i++ 
			continue
		}

		
		// alert("nRate = " + nRate)

		// determine coverage basis for calc
		nAmount = Math.min(gaMatrix[i][gnCol_maxlimit] - nApplied, nCoverage - nApplied)

		// alert("nAmount = " + nAmount)

		if (bFirstPass)
		{
			if (nCoverage > gaMatrix[i][gnCol_maxlimit])
			{
				// calc regular rate with max coverage threshold
				nBase = PremCalc(cRegion, cLvlCode, nAmount, nMinprem)

				// alert("upper nBase = " + nBase)
			}
			else
			{
				// use the existing premium rate
				nBase = nNew
				
				// alert("lower nBase = " + nBase)
			}
			
			// first level - use percentage of premium subject to max coverage level
			nDisc += percentcalc(nBase, gaMatrix[i][gnCol_rate])
			bFirstPass = false
		
		}
		else
		{
			// successive passes - use rate per $k on remaining portion
			nDisc += extcalc(nAmount, gaMatrix[i][gnCol_rate] * .001)
		}

		nApplied += nAmount
		nRemain -= nAmount
		i++

	}  // end while

	if (bApply)
	{
		// apply another Refinance discount if applic.
		nDisc = percentcalc(nDisc, nRate)
	}

	return Math.max(nDisc, nMinprem)
}
// eofct: SpecDisc()


function ExcessCalc(cRegion, cCode, nOwnercvg, nLendercvg, nPriorcvg, lOwnerCalc, 
			lNoOwnerPrior, lFullstep, nPriorExcess) {
/*
  Step-thru of rate matrix(ices) based upon supplied region and code,
  and return calculated entity premium.
  Pretty difficult to understand and implement. Basically, have to step in and out of
  of mulitple rate matrices within a single coverage amount. In some cases, we want a 
  full step-thru of the matrix with a calculated excess, and in others we want a
  partial step-thru using the full coverage, excess portion, and rate per K of the 
  final matrix bracket only. Took me a week to write!
  Specific usage for New Jersey Refinance
  created ROD 10/24/02
*/

	var cCode
	var nRemain         
	var nCalc
	var nDiscExcess = 0
	var nRegExcess = 0
	var nExcess

	var nAmt = 0.00
	var nPrem = 0.00
	var nApplied = 0.00
	var nRate = 0.00	


	if (!lOwnerCalc)
	{
		// lender side calc

		// init total excess
		nExcess = Math.max(nLendercvg - nOwnercvg,0)

		if (lNoOwnerPrior)
		{
			// without owner prior, full excess at discount level
			nDiscExcess = nExcess
		}
		else
		{
			if (nPriorExcess != 0)
			{
				// unique need...diff between prior cvgs (O_prior less M_prior)
				nDiscExcess = nPriorExcess
			}
			else
			{
				// init excess portion at discount rate
				nDiscExcess = Math.max(nPriorcvg - nOwnercvg, 0)
			}
						
			// determine excess portion at reg rate
			if (nDiscExcess > 0)
			{
				nRegExcess = Math.max(nLendercvg - nPriorcvg,0)
			}
			else
			{
				nRegExcess = Math.max(nLendercvg - nOwnercvg,0)
			}
		}
		
		// alert("nDiscExcess = " + nDiscExcess + gs_crlf + "nRegExcess = " + nRegExcess)

	}
	else
	{
		// owner side calc

		if (nOwnercvg > nPriorcvg)
		{
			// portions at discount and regular
			nDiscExcess = nPriorcvg
			nRegExcess = nOwnercvg - nPriorcvg
			
			// this value allows entry into the conditions that follow
			nExcess = 1

		}
		else
		{
			
			// discount full owner cvg using reissue matrix
			nPrem = PremCalc(cRegion, cCode, nOwnercvg, 0)
								
			// this value prevents entry into the conditions that follow
			nExcess = 0

			// alert("nPrem = " + nPrem)

		}
		
	}
		
	
	if (nExcess > 0 && nDiscExcess > 0)
	{
		// calc excess at refi rate

		nCalc = 0
		nRemain = nPriorcvg

		var i = aSeek(cRegion, cCode)       // find the 1st discount matrix method element
		
		// step thru the rate matrix levels TO OBTAIN THE APPLICABLE RATE ONLY
		while (i > -1 && i < gaMatrix.length && nRemain > 0.00 && cRegion + cCode == gaMatrix[i][gnCol_region] + gaMatrix[i][gnCol_code].substring(0, cCode.length) )
		{
			
			// all other calcs use rate per $k 
			nAmt = Math.min( gaMatrix[i][gnCol_maxlimit] - nApplied, nPriorcvg - nApplied )
			
			// save off the last rate per k
			nRate = gaMatrix[i][gnCol_rate]


			if (lFullstep)
			{
				// calc an amount at each level
				nCalc += extcalc(nAmt, nRate * .001)
			}

			// update cvg accumulators
			nApplied += nAmt
			nRemain -= nAmt
		
			i++
		}

		if (!lFullstep)
		{
			// calc excess cvg against applic rate level 
			nCalc = extcalc(nDiscExcess, nRate * .001)
		}
		
		nPrem += nCalc

//		debugLog("DiscExcess = " + nDiscExcess + gs_crlf + "nRate = " + nRate + gs_crlf + "Premium = " + nCalc)

	}


	if (nExcess > 0 && nRegExcess > 0)
	{
		// calc excess at regular rate

		nRemain = (lOwnerCalc) ? nOwnercvg : nLendercvg
//		debugLog("(lOwnerCalc) ? nOwnercvg : nLendercvg .   lOwnerCalc="+lOwnerCalc+" nOwnercvg="+nOwnercvg+" nLendercvg="+nLendercvg)
	//	debugLog("nRemain="+nRemain)
		nApplied = 0	// reset
		
		cCode = "MOL"
		var i = aSeek(cRegion, cCode)       // find the 1st regular matrix method element
		
		// step thru the rate matrix levels TO OBTAIN THE APPLICABLE RATE ONLY
		while (i > -1 && i < gaMatrix.length && nRemain > 0.00 && cRegion + cCode == gaMatrix[i][gnCol_region] + gaMatrix[i][gnCol_code].substring(0, cCode.length) )
		{
			// all other calcs use rate per $k 
			nAmt = Math.min( gaMatrix[i][gnCol_maxlimit] - nApplied, nLendercvg - nApplied )
			
			// save off the last rate per k
			nRate = gaMatrix[i][gnCol_rate]

			// update cvg accumulators
			nApplied += nAmt
			nRemain -= nAmt
		
		//	debugLog('i='+i+" Max="+gaMatrix[i][gnCol_maxlimit]+" nRemain="+nRemain+" nRate="+nRate+" nAmt="+nAmt+" nApplied="+nApplied+" nRemain="+nRemain)
			i++
		}

		// calc excess cvg against applic rate level 
		nCalc = extcalc(nRegExcess, nRate * .001)
		nPrem += nCalc

//		 debugLog("nRegExcess = " + nRegExcess + gs_crlf + "nRate = " + nRate + gs_crlf + "Premium = " + nCalc)

	}
	
	return nPrem
}
// eofct: ExcessCalc()




function GetSimulfee(cRegion, nOwnercvg, nLendercvg) {
/*
  Retrieve any simul issue fee, if applic.
  created ROD 05/01/01
*/
	var nSimulfee = 0
	var x
	if (nOwnercvg > 0 && nLendercvg > 0)
	{
		x = aSeek(cRegion, "SIOM")      // find the simul fee element
		if (x > -1)
		{
			// got one
			nSimulfee = gaMatrix[x][gnCol_rate]
		}
	}
	return nSimulfee
}
// eofct: GetSimulfee()


function GetCommitmentfee(cRegion, nCvg) {
/*
  Retrieve any commitment fee, if applic.
  Invoke only for rate methods that automatially assess this charge
  created ROD 05/01/01 
*/
	var nCommfee = 0
	var x
	if (nCvg > 0)
	{
		x = aSeek(cRegion, "BCOF")      // find the binder-commitment fee
		if (x > -1)
		{
			// got one
			nCommfee = gaMatrix[x][gnCol_rate]
		}
	}
	return nCommfee
}
// eofct: GetCommitmentfee()


function GetAgeCeiling(cRegion) {
/*
  Retrieve any reissue ceiling for prior policy age
  created ROD 09/25/02
*/
	var nValue = 0
	var x
	
	x = aSeek(cRegion, "CEIL")      // find the ceiling element
	if (x > -1)
	{
		// got one
		nValue = gaMatrix[x][gnCol_rate]
	}
	
	return nValue
}
// eofct: GetAgeCeiling()





//////////////////////////////////////////////////////////
// form, data and properties management functions below //
//////////////////////////////////////////////////////////


function format (expr, decplaces)  {
/*
  embed decimal and comma(s) within numeric string
  created by DRH; modified by ROD for embedded comma support
*/

	var i
	var xstr
	var aseg = new Array()
	var newstr
	var str
	
	// convert expression to numeric; eliminates occassional error in formating
	expr = expr * 1

	str = "" +  Math.round(eval(expr) * Math.pow(10,decplaces))

	while(str.length <= decplaces)
		{
			str = "0" + str
		}
	var decpoint = str.length - decplaces

	// return str.substring(0,decpoint) + "." + str.substring(decpoint, str.length);

	// embed comma(s) within the string; borrowed from GCC e-flite
	xstr = str.substring(0,decpoint)

	// determine how many comma segments there are
	i = Math.ceil(xstr.length / 3) - 1
	while (xstr.length > 0)
	{
		// place each segment into array element
		aseg[i] = xstr.substring(xstr.length - 3, xstr.length)
		xstr = xstr.substring(0, xstr.length - 3)
		i--
	}
	
	//  join each array element with a comma and concatenate with decimal portion
	newstr = (aseg.join(",") + "." + str.substring(decpoint, str.length))

	if (gbNav4)
	{
		newstr = padl(newstr,14)
	}

	return newstr
}
// eofct: format()


function setOption(index) {
/*
  dynamically populate the rate method list box based upon region selection
  created 03/13/01 ROD
*/
	var i
	var x
	var cRegion

	// (re)init global document form name

	/*
	   use this disabled reference should we have to resort to using layers in NS4:
	   goCalcform = !gbNav4 ? document.cal : document.calLayer.document.cal
	*/

	
	// reset NS4 focus positioning tool between region selection
	gnLastIdentFocus = -1


	// reset method text and values
	for (i=0; i < goCalcform.method.length ; i++ )
	{
		goCalcform.method.options[i].text = ""
		goCalcform.method.options[i].value = ""
	}

	cRegion = goCalcform.region.options[index].value
	cMethod = goCalcform.method.options[goCalcform.method.selectedIndex].value
//alert(cRegion);
	
	// set coverage field prompts
	setfields(cRegion,cMethod)


	/*
	  resize the method listbox length using the region method count; 
	  note: NS4 lets you shorten the length, but doesn't allow increase
	  above orginal number of option tags established. Strange...
	  IE resizes length and width
	*/
	goCalcform.method.options.length = getRegionMethodCount(cRegion)

	
	// find the first element of the region in options array
	x = aOptSeek(cRegion)

	// step-thru options array for that region; contruct option text and values
	i = 0
	while (x > -1 && x < gaOption.length && gaOption[x][gnCol_opt_region] == cRegion)
   	{
		goCalcform.method.options[i].text = gaOption[x][gnCol_opt_text]
		goCalcform.method.options[i].value = gaOption[x][gnCol_opt_value]
		x++
		i++
	}

	//  set default selection
	goCalcform.method.selectedIndex = 0

	// reset entry field selections
	goCalcform.premium.value = ""
	// goCalcform.priorcvg.value = ""
	// goCalcform.years.value = ""
	goCalcform.priordate.value = ""

	if (!goCalcform.coverage.disabled)
	{
		goCalcform.coverage.value = ""
	}

	if (!goCalcform.ownercvg.disabled)
	{
		goCalcform.ownercvg.value = ""
	}

	if (!goCalcform.lendercvg.disabled)
	{
		goCalcform.lendercvg.value = ""
	}

	if (!goCalcform.search.disabled)
	{
		goCalcform.search.value = ""
	}

	if (!goCalcform.allincl.disabled)
	{
		goCalcform.allincl.value = ""
	}

	if (!goCalcform.ownprem.disabled)
	{
		goCalcform.ownprem.value = ""
	}

	if (!goCalcform.mtgprem.disabled)
	{
		goCalcform.mtgprem.value = ""
	}

	if (!goCalcform.priorcvg.disabled)
	{
		goCalcform.priorcvg.value = ""
	}

	// these two distinct prior cvgs for NJ Refi
	if (!goCalcform.opriorcvg.disabled)
	{
		goCalcform.opriorcvg.value = ""
	}
	
	if (!goCalcform.mpriorcvg.disabled)
	{
		goCalcform.mpriorcvg.value = ""
	}
}
		
// eofct: setoption()


function getRegionMethodCount(cRegion) {
/*
  Get the number of methods for a given region
  created ROD 03/13/01
*/
	var nCount = 0

	// find the first element of the region in options array
	var x = aOptSeek(cRegion)

	// step-thru options array for that region
	while (x > -1 && x < gaOption.length && gaOption[x][gnCol_opt_region] == cRegion)
   	{
		x++
		nCount++
	}
	return nCount
}
// eofct: getRegionMethodCount()


function setRegionValues() {
/*
   Determine max region methods count and max description width from options array;
   Discovered I don't actually need seeded values for gnMaxRegionCount, gnMaxRegionWidth,
   but keeping the code in place in case needed. Resizing of method listbox
   without these values takes place within setoption(). If needed, place within 
   window_onload(), preceding setoption().
   Created 03/14/01 ROD
*/
	
	gnMaxRegionCount = 1
	gnMaxRegionWidth = 0
	var i = 0
	var cRegion
	var nCount = 0

	cRegion = gaOption[0][gnCol_opt_region]

	for (i=0; i < gaOption.length ; i++ )
	{
		if (cRegion == gaOption[i][gnCol_opt_region])
		{
			nCount++
		}
		else
		{
			gnMaxRegionCount = Math.max(gnMaxRegionCount, nCount)
			nCount = 1
			cRegion = gaOption[i][gnCol_opt_region]
		}

		// init global values for dynamic method listbox
		gnMaxRegionCount = Math.max(gnMaxRegionCount, nCount)
		gnMaxRegionWidth = Math.max(gnMaxRegionWidth, gaOption[i][gnCol_opt_text].length)
	}

	// set method listbox length to max region methods in gaOptions array (IE only)
  	goCalcform.method.options.length = gnMaxRegionCount

}
// eofct: setRegionValues()


function setfields(cRegion,cMethod) {
/*
   set varying coverage fields based upon region;
   either a shared coverage field or separate 
   owner and mortgagee coverage fields
   created 03/16/01 ROD
*/
	var sharedDisplay
	var sharedDisable
	var dualDisplay
	var dualDisable
	var searchDisplay
	var searchDisable

	var opremDisplay
	var opremDisable
	var mpremDisplay
	var mpremDisable

	// shared prior cvg elements
	var priorDisable					
	var priorDisplay

	// distinct prior cvgs for NJ refi
	var opriorDisable
	var opriorDisplay
	var mpriorDisable
	var mpriorDisplay
	
	// set search fee attributes based upon selected region
	if (cRegion == "TND" || cRegion == "TNK" || cRegion == "TNS" || cRegion == "TNH")
	{
		searchDisplay = ""
		searchDisable = false
	}
	else
	{
		searchDisplay = "none"
		searchDisable = true
	}



	// set coverage prompt attributes
	if (cRegion == "NC")
	{
		// init values to enabled shared coverage; disable dual coverage prompts
		sharedDisplay = ""
		dualDisplay = "none"
		sharedDisable = false
		dualDisable = true

		// disable breakdown
		opremDisplay = "none"
		opremDisable = true
		mpremDisplay = "none"
		mpremDisable = true
	}
	else
	{
		// init values to disable shared coverage; enable dual coverage prompts 
		sharedDisplay = "none"
		dualDisplay = ""
		sharedDisable = true
		dualDisable = false

		// enable premium breakdown by entity
		opremDisplay = ""
		opremDisable = false
		mpremDisplay = ""
		mpremDisable = false
	}


	// set distinct entity prior cvg attributes on region
	if (cRegion == "NJ")
	{
		// enable distinct prior cvg elements; disable shared prior cvg element
		
		opriorDisplay = ""
		mpriorDisplay = ""
		
		priorDisplay = "none"           
		opriorDisable = false
		mpriorDisable = false
		priorDisable = true
		
		document.getElementById('priordaterow').style.display='none'
		document.getElementById('discountrow').style.display='none'
		
	}
	else
	{
		// disable distinct prior cvg elements; enable shared prior cvg elements
		opriorDisplay = "none"
		mpriorDisplay = "none"
		priorDisplay = ""
		opriorDisable = true
		mpriorDisable = true
		priorDisable = false
		
		document.getElementById('priordaterow').style.display=''
		document.getElementById('discountrow').style.display=''
	}



/*	
	// owner and mortgagee premium breakdown
	if (cRegion == "MI1" || cRegion == "MI2" || cRegion == "MIK" 
			|| cRegion == "MI1x" || cRegion == "MI2x" || cRegion == "MIKx"
			|| cRegion == "MI1m" || cRegion == "MI2m" || cRegion == "MIKm"
			|| cRegion == "MIC")
	{
		// enable breakdown
		opremDisplay = "block"
		opremDisable = false
		mpremDisplay = "block"
		mpremDisable = false
	}
	else
	{
		// disable breakdown
		opremDisplay = "none"
		opremDisable = true
		mpremDisplay = "none"
		mpremDisable = true
	}
*/

	// set the visiblity attributes; 
	if (!gbNav4)
	{
		// IE specific
		document.getElementById('cvgtext').style.display=sharedDisplay
		document.getElementById('cvgdata').style.display=sharedDisplay
		document.getElementById('cvg').disabled=sharedDisable

		document.getElementById('ownertext').style.display=dualDisplay
		document.getElementById('ownerdata').style.display=dualDisplay
		document.getElementById('ownercvg').disabled=dualDisable

		document.getElementById('lendertext').style.display=dualDisplay
		document.getElementById('lenderdata').style.display=dualDisplay
		document.getElementById('lendercvg').disabled=dualDisable

		document.getElementById('cvg').style.textAlign="right"
		document.getElementById('ownercvg').style.textAlign="right"
		document.getElementById('lendercvg').style.textAlign="right"
		document.getElementById('priorcvg').style.textAlign="right"
		// document.getElementById('years').style.textAlign="right"
		document.getElementById('premium').style.textAlign="right"
		
		document.getElementById('searchtext').style.display=searchDisplay
		document.getElementById('searchdata').style.display=searchDisplay
		document.getElementById('search').disabled=searchDisable
		document.getElementById('search').style.textAlign="right"

		document.getElementById('allincltext').style.display=searchDisplay
		document.getElementById('allincldata').style.display=searchDisplay
		document.getElementById('allincl').disabled=searchDisable
		document.getElementById('allincl').style.textAlign="right"	

		document.getElementById('ownpremtext').style.display=opremDisplay
		document.getElementById('ownpremdata').style.display=opremDisplay
		document.getElementById('ownprem').disabled=opremDisable
		document.getElementById('ownprem').style.textAlign="right"	

		document.getElementById('mtgpremtext').style.display=mpremDisplay
		document.getElementById('mtgpremdata').style.display=mpremDisplay
		document.getElementById('mtgprem').disabled=mpremDisable
		document.getElementById('mtgprem').style.textAlign="right"	

		// shared prior cvg 
		document.getElementById('priorcvgtext').style.display=priorDisplay
		//document.getElementById('priorcvg').style.display=priorDisplay
		document.getElementById('priorcvgdata').style.display=priorDisplay
		document.getElementById('priorcvg').disabled=priorDisable
		document.getElementById('priorcvg').style.textAlign="right"	

		// owner prior cvg
		document.getElementById('opriorcvgtext').style.display=opriorDisplay
		//document.getElementById('opriorcvg').style.display=opriorDisplay
		document.getElementById('opriorcvgdata').style.display=opriorDisplay
		document.getElementById('opriorcvg').disabled=opriorDisable
		document.getElementById('opriorcvg').style.textAlign="right"	

		// mtg prior cvg
		document.getElementById('mpriorcvgtext').style.display=mpriorDisplay
		//document.getElementById('mpriorcvg').style.display=mpriorDisplay
		document.getElementById('mpriorcvgdata').style.display=mpriorDisplay
		document.getElementById('mpriorcvg').disabled=mpriorDisable
		document.getElementById('mpriorcvg').style.textAlign="right"	
		
	}
	else
	{
		// NS4 specific
			
		for (i=0; i < goCalcform.elements.length ; i++ )
		{
			// toggle disabled property for each coverage field for later examination
			// note: be sure to omit field validation on disabled fields

			if (goCalcform.elements[i].name == "coverage")
			{
				goCalcform.coverage.disabled = sharedDisable
				goCalcform.coverage.value = sharedDisable ? "N/A" : ""
			}
			if (goCalcform.elements[i].name == "ownercvg")
			{
				goCalcform.ownercvg.disabled = dualDisable
				goCalcform.ownercvg.value = dualDisable ? "N/A" : ""
			}
			if (goCalcform.elements[i].name == "lendercvg")
			{
				goCalcform.lendercvg.disabled = dualDisable
				goCalcform.lendercvg.value = dualDisable ? "N/A" : ""
			}

			if (goCalcform.elements[i].name == "search")
			{
				goCalcform.search.disabled = searchDisable
				goCalcform.search.value = searchDisable ? "N/A" : ""
			}

			if (goCalcform.elements[i].name == "allincl")
			{
				goCalcform.allincl.disabled = searchDisable
				goCalcform.allincl.value = searchDisable ? "N/A" : ""
			}

			if (goCalcform.elements[i].name == "ownprem")
			{
				goCalcform.ownprem.disabled = opremDisable
				goCalcform.ownprem.value = opremDisable ? "N/A" : ""
			}

			if (goCalcform.elements[i].name == "mtgprem")
			{
				goCalcform.mtgprem.disabled = mpremDisable
				goCalcform.mtgprem.value = mpremDisable ? "N/A" : ""
			}

			if (goCalcform.elements[i].name == "priorcvg")
			{
				goCalcform.priorcvg.disabled = priorDisable
				goCalcform.priorcvg.value = priorDisable ? "N/A" : ""
			}

			if (goCalcform.elements[i].name == "opriorcvg")
			{
				goCalcform.opriorcvg.disabled = opriorDisable
				goCalcform.opriorcvg.value = opriorDisable ? "N/A" : ""
			}

			if (goCalcform.elements[i].name == "mpriorcvg")
			{
				goCalcform.mpriorcvg.disabled = mpriorDisable
				goCalcform.mpriorcvg.value = mpriorDisable ? "N/A" : ""
			}


			// assign a sequential identifer to form element
			goCalcform.elements[i].ident = i

		}

	} // endif
	if (cRegion == "NJ")
		calc();
}
// eofct: setfields()


function checkEnabled(bdisabled, cname) {
/*
   Check the enabled status of various coverage fields;
   NS4 only kludge for disabling non-applic. form fields 
   and shifting focus to next/previous applic form element.
   created 03/23/01 ROD
*/
	if (gbNav4 && bdisabled)
	{
		setTimeout( "goCalcform." + cname + ".blur()",1)

		/*
			Note: gnLastIdentFocus is used to determine directional movement by user
			when using Tab/Shift-Tab for navigation

			Don't worry about whether or not a control is disabled. Just move to it and 
			and set the next/previous to element that naturally occurs.

		*/
		
		if (cname == "coverage")
		{		
			if (gnLastIdentFocus < goCalcform.coverage.ident)
			{
				goCalcform.ownercvg.focus()				// move focus to next form element
			}
			else
			{
				goCalcform.method.focus()				// move focus to previous form element
			}
		}
		
		if (cname == "ownercvg")
		{
			if (gnLastIdentFocus < goCalcform.ownercvg.ident)
			{
				goCalcform.lendercvg.focus()			// move focus to next form element
			}
			else
			{
				goCalcform.coverage.focus()				// move focus to previous form element
			}
		}
	
		if (cname == "lendercvg")
		{
			if (gnLastIdentFocus < goCalcform.lendercvg.ident)
			{
				goCalcform.priorcvg.focus()				// move focus to next form element
			}
			else
			{
				goCalcform.ownercvg.focus()				// move focus to previous form element
			}
		}

		
		if (cname == "priorcvg")
		{

			if (gnLastIdentFocus < goCalcform.priorcvg.ident)
			{
				goCalcform.opriorcvg.focus()			// move focus to next form element
			}
			else
			{
				goCalcform.lendercvg.focus()			// move focus to previous form element
			}
		}
				

		if (cname == "search")
		{
			if (gnLastIdentFocus < goCalcform.search.ident)
			{
				goCalcform.ownprem.focus()				// move focus to next form element
			}
			else
			{
				goCalcform.priordate.focus()			// move focus to previous form element
			}
		}

		if (cname == "allincl")
		{
			if (gnLastIdentFocus < goCalcform.allincl.ident)
			{
				goCalcform.calcbutton.focus()			// move focus to next form element
			}
			else
			{
				goCalcform.premium.focus()				// move focus to previous form element
			}
		}

		if (cname == "ownprem")
		{
			if (gnLastIdentFocus < goCalcform.ownprem.ident)
			{
				goCalcform.premium.focus()				// move focus to next form element
			}
			else
			{
				goCalcform.priordate.focus()			// move focus to previous form element
			}
		}

		if (cname == "mtgprem")
		{
			if (gnLastIdentFocus < goCalcform.mtgprem.ident)
			{
				goCalcform.premium.focus()				// move focus to next form element
			}
			else
			{
				goCalcform.priordate.focus()			// move focus to previous form element
			}
		}


		if (cname == "opriorcvg")
		{
			if (gnLastIdentFocus < goCalcform.opriorcvg.ident)
			{
				goCalcform.mpriorcvg.focus()			// move focus to next form element
			}
			else
			{
				goCalcform.priorcvg.focus()				// move focus to previous form element
			}
		}

		if (cname == "mpriorcvg")
		{
			if (gnLastIdentFocus < goCalcform.mpriorcvg.ident)
			{
				goCalcform.priordate.focus()			// move focus to next form element
			}
			else
			{
				goCalcform.opriorcvg.focus()			// move focus to previous form element
			}
		}

		

	}

}
// eofct: checkEnabled()


function setIdent(cname) {
/*
   init ident property into global positioning var for 
   examination within checkEnabled()
   created 03/23/01 ROD
*/
	gnLastIdentFocus = eval("goCalcform." + cname + ".ident")
}
// eofct: setIdent()


function formReset() {
/*
	Reset form entries
	created 03/29/01 ROD
*/
	
	if (!gbNav4)
	{
		goCalcform.reset()
	}
	else
	{

		/*
		   manually reset in NS4; for whatever reason setoption() has no effect when
		   after invoking goCalcform.reset() within this function.
		*/

		var i
		for (i = 0; i < goCalcform.elements.length ; i++ )
		{
			
			/********
			if (goCalcform.elements[i].name == "years")
			{
				goCalcform.years.value = "0"		
			}
			******* */

			if (goCalcform.elements[i].name == "priordate")
			{
				goCalcform.priordate.value = ""
			}

			if (goCalcform.elements[i].name == "coverage")
			{
				goCalcform.coverage.value = "0.00"
			}

			if (goCalcform.elements[i].name == "ownercvg")
			{
				goCalcform.ownercvg.value = "0.00"
			}

			if (goCalcform.elements[i].name == "lendercvg")
			{
				goCalcform.lendercvg.value = "0.00"
			}

			if (goCalcform.elements[i].name == "priorcvg")
			{
				goCalcform.priorcvg.value = "0.00"
			}

			if (goCalcform.elements[i].name == "premium")
			{
				goCalcform.premium.value = "0.00"
			}

			if (goCalcform.elements[i].name == "search")
			{
				goCalcform.search.value = "0.00"
			}

			if (goCalcform.elements[i].name == "allincl")
			{
				goCalcform.allincl.value = "0.00"
			}

			if (goCalcform.elements[i].name == "region")
			{
				goCalcform.region.selectedIndex = 0
			}

			if (goCalcform.elements[i].name == "method")
			{
				goCalcform.method.selectedIndex = 0
			}

			if (goCalcform.elements[i].name == "ownprem")
			{
				goCalcform.ownprem.value = "0.00"
			}

			if (goCalcform.elements[i].name == "mtgprem")
			{
				goCalcform.mtgprem.value = "0.00"
			}

			if (goCalcform.elements[i].name == "opriorcvg")
			{
				goCalcform.opriorcvg.value = "0.00"
			}

			if (goCalcform.elements[i].name == "mpriorcvg")
			{
				goCalcform.mpriorcvg.value = "0.00"
			}


		
		}
	
	}

	// rebuild option list and fields
	setOption(goCalcform.region.selectedIndex)
}
// eofct: formReset()


function padl(number, length) {
/*
  format a numeric form entry for left-padded right-alignment; NS4 kludge
  created 04/05/01 ROD
*/
	var str = '' + number
	while (str.length < length)
	{
		str = ' ' + str
	}
	return str
}
// eofct: padl()


function StrToNum(uValue) {
/*
  Examines and converts string value to numeric; used for coverage amounts
  created 04/05/01 ROD
*/
	var nValue

	if (uValue != 0)
	{
		while (uValue.indexOf(",") != -1)
		{
			uValue = uValue.replace(",", "")
		}
				
		uValue = uValue * 1
	}

	if (uValue == "")
	{
		uValue = 0
	}

	nValue = uValue
	return nValue
}
// eofct: StrToNum()


function verifyDate(sDate) {
/*
	validate a date string
    returns boolean: True for validated; False for invalidated
	ROD created 06/13/02: from GCC's eflite script
*/
	var date1 = "";
	var date2 = "";
	var month1 = "";
	var month2 = "";
	var year2 = "";
	var year1 = "";
	var sString1;
	var sString2;
	var slash = "/";

	sNewDate = "";
	if (sDate == "")
		return true;

	sString = sDate;
	var pos = sString.indexOf(slash);
	if (pos >= 0)
	{
		month1 = sString.substring(0,pos);
		sString = sString.substring(pos + 1, sString.length);
		//alert("pos = " + pos + crlf + "month = " + month + crlf + "sString = " + sString);

		pos = sString.indexOf(slash);
		if (pos >= 0)
		{
			date1 = sString.substring(0,pos);
			year1 = sString.substring(pos + 1, sString.length);
			//alert("pos = " + pos + crlf + "day = " + day + crlf + "year = " + year);
		}
	}
	if ((month1 > 0) && (month1 < 13) && (date1 > 0) && (date1 < 32) && (year1 > 1700) && (year1 < 2200))
	{
		var newDateObj = new Date();

		var d, s = "Today's date is: ";
		d = new Date();
		d.setFullYear(year1);
		//SET DATE TO ONE BEFORE SETTING MONTH TO AVOID INVALID DATE ERROR!
		d.setDate(1);
		d.setMonth(month1-1);
		d.setDate(date1);

		//newDateObj.setFullYear(year1);
		//newDateObj.setMonth(month1 - 1);
		//newDateObj.setDate(date1);
		if (date1.length == 1)
			date1 = "0" + date1;
		if (month1.length == 1)
			month1 = "0" + month1;
		sString1 = month1 + "/" + date1 + "/" + year1
		//alert("sString1=" + sString1);

		date2 = (d.getDate()) + "/";
		//alert("date2=" + date2);
		//day2 = getDate();

		month2 = (d.getMonth() + 1) + "/";
		//alert("month2=" + month2);
		//month2 = getMonth();


		s += (d.getMonth() + 1) + "/";
		s += d.getDate() + "/";
		s += d.getYear();
		//alert(s);


		if (date2.length == 2)
			date2 = "0" + date2;
		if (month2.length == 2)
			month2 = "0" + month2;
		sString2 = month2 + date2 + d.getFullYear();
		//alert("sString2=" + sString2);

		if (sString1 == sString2)
		{
			sNewDate = sString1;
			return true;
		}
		else
			return false;

	}
	else
		return false;
}
// eofct: verifyDate()



function getAge(dateString,dateType) {
/*
   ROD 06/13/02 created
   Public domain code obtained from http://developer.irt.org/script/29.htm
   Added Y2k() support throughout when using .getyear()
   Modified to return three element array...Years, months, days

   author's comments follow:
   dateString is a date passed as a string in the following
   formats:

   type 1 : 19970529
   type 2 : 970529
   type 3 : 29/05/1997
   type 4 : 29/05/97
   type 5 : mm/dd/yyyy      // ROD addition: type 5

   dateType is a numeric integer from 1 to 4, representing
   the type of dateString passed, as defined above.

*/

    var now = new Date();
    var today = new Date(y2k(now.getYear()),now.getMonth(),now.getDate());

    var yearNow = y2k(now.getYear());       
    var monthNow = now.getMonth();
    var dateNow = now.getDate();

	var sAge
	var aAge
	var i

    if (dateType == 1)
	   var dob = new Date(dateString.substring(0,4),
                            dateString.substring(4,6)-1,
                            dateString.substring(6,8));
	
    else if (dateType == 2)
	  var dob = new Date(dateString.substring(0,2),
                            dateString.substring(2,4)-1,
                            dateString.substring(4,6));
	
    else if (dateType == 3)
	   var dob = new Date(dateString.substring(6,10),
                            dateString.substring(3,5)-1,
                            dateString.substring(0,2));
    else if (dateType == 4)
        var dob = new Date(dateString.substring(6,8),
                            dateString.substring(3,5)-1,
                            dateString.substring(0,2));

	else if (dateType == 5)
		// ROD addition - type 5
        var dob = new Date(dateString.substring(6,10),
                            dateString.substring(0,2)-1,
                            dateString.substring(3,5));

    else
	{
		// ROD make sure we return an array
        // return '';
	 	return new Array(0,0,0)
	}

    var yearDob = y2k(dob.getYear());
    var monthDob = dob.getMonth();
    var dateDob = dob.getDate();

    yearAge = yearNow - yearDob;

    if (monthNow >= monthDob)
        var monthAge = monthNow - monthDob;
    else {
        yearAge--;
        var monthAge = 12 + monthNow -monthDob;
    }

    if (dateNow >= dateDob)
        var dateAge = dateNow - dateDob;
    else {
        monthAge--;
        var dateAge = 31 + dateNow - dateDob;

        if (monthAge < 0) {
            monthAge = 11;
            yearAge--; 
        }
    }

	// ROD changes from here down

	// make a delimited string
    sAge = yearAge + '~' + monthAge + '~' + dateAge 
  
	// convert the delimited string into an array
	aAge = sAge.split("~");
	
	for (i=0; i < aAge.length ; i++ )
	{
		// convert string to number
		aAge[i] = StrToNum(aAge[i])
		// alert("aAge " + i + " = " + aAge[i])
	}	
	
	return  aAge

}
// eofct: getAge()


function y2k(number) {
/*
	Return y2k compliant year
	06/13/02 ROD created
*/
	return (number < 1000) ? number + 1900 : number; 
}
// eofct: y2k()


function formatDateString(sdate){
/*
	format and return a date string with embedded slashes when absent
	example: 01012001 returns as 01/01/2001; 01-01-2001 returns as 01/01/2001
	06/27/02 ROD created
*/

	var slash = "/"

	// replace any hypen with backslash
	while (sdate.indexOf("-") != -1)
	{
		sdate = sdate.replace("-", "/")
	}
	
	/*
	if (sdate.substring(5,6) == slash && sdate.length == 8 )
	{
		sdate = sdate.substring(0,6) + "20" + sdate.substring(6,8)
	}
	*/

	// scan for slash
	var pos = sdate.indexOf(slash);
	if (pos < 0 && sdate.length == 8)
	{	
		// embed slashes in string
		sdate = sdate.substring(0,2) + slash + sdate.substring(2,4) + slash + sdate.substring(4,8)
	}

	// alert("formated date = " + sdate)
	return sdate

}
// eofct: formatDateString()
function clearLog(){
	document.getElementById('debugtxt').innerHTML=""
}
function debugLog(stringss){
	document.getElementById('debugtxt').innerHTML=document.getElementById('debugtxt').innerHTML+stringss+"<br>";
}
// eof: RateCalc.js
