//(state,min rule,asset allowance,monthly income allowance,medicaid recipient asset allowance,maximum combined asset allowance,monthly income allowance from injured spouse,combined min asset allowance)

states = new Array();
states["AL"] = new Array("x","$2,000","$30","$2,000","$109,560","$1,750","$25,000");
states["AK"] = new Array("x","$2,000","$75","$2,000","$109,560","$2,187","$109,560"); 
states["AZ"] = new Array("x","$2,000","$90.45","$2,000","$109,560","$1,750","$21,912");
states["AR"] = new Array("x","$2,000","$40","$2,000","$109,560","$1,750","$21,912");
states["CA"] = new Array("","$2,000","$35","$2,000","$109,560","$2,610","$109,560"); 
states["CO"] = new Array("x","$2,000","$50","$2,000","$109,560","$1,750","$109,560"); 
states["CT"] = new Array("","$1,600","$63","$1,600","$109,560","$1,750","$21,912");
states["DE"] = new Array("x","$2,000","$44","$2,000","$109,560","$1,750","$25,000");
states["DC"] = new Array("","$2,600","$70","$2,600","$109,560","$2,610","109,560"); 
states["FL"] = new Array("","$2,000","$35","$2,000","$109,560","$1,750","$109,560"); 
states["GA"] = new Array("","$2,000","$50","$2,000","$109,560","$2,610","$109,560"); 
states["HI"] = new Array("","$2,000","$30","$2,000","$109,560","$2,610","$109,560"); 
states["ID"] = new Array("x","$2,000","$40","$2,000","$109,560","$1,750","$21,912");
states["IL"] = new Array("","$2,000","$30","$2,000","$109,560","$2,610","$109,560"); 
states["IN"] = new Array("","$1,500","$52","$1,500","$109,560","$1,750","$21,912");
states["IA"] = new Array("x","$2,000","$50","$2,000","$109,560","$2,610","$24,000");
states["KS"] = new Array("","$2,000","$30","$2,000","$109,560","$1,750","$21,912");
states["KY"] = new Array("","$2,000","$40","$2,000","$109,560","$2,610","$21,912");
states["LA"] = new Array("x","$2,000","$38","$2,000","$109,560","$2,610","$109,560"); 
states["ME"] = new Array("","$2,000","$40","$2,000","$109,560","$1,750","$109,560"); 
states["MD"] = new Array("","$2,500","$62","$2,500","$109,560","$1,750","$21,912");
states["MA"] = new Array("","$2,000","$60","$2,000","$109,560","$1,750","$109,560"); 
states["MI"] = new Array("","$2,000","$60","$2,000","$109,560","$1,750","$21,912");
states["MN"] = new Array("","$3,000","$84","$3,000","$109,560","$1,751","$29,389");
states["MS"] = new Array("x","$2,000","$44","$2,000","$109,560","$2,610","$109,560"); 
states["MO"] = new Array("","$1,000","$30","$1,000","$109,560","$1,750","$21,912");
states["MT"] = new Array("","$2,000","$40","$2,000","$109,560","$1,750","$21,912");
states["NE"] = new Array("","$4,000","$50","$4,000","$109,560","$2,610","$21,912");
states["NV"] = new Array("x","$2,000","$35","$2,000","$109,560","$1,750","$21,912");
states["NH"] = new Array("","$2,500","$50","$2,500","$109,560","$1,750","$21,912");
states["NJ"] = new Array("x","$2,000","$35","$2,000","$109,560","$1,750","$21,912");
states["NM"] = new Array("x","$2,000","$57","$2,000","$109,560","$1,789","$109,560");
states["NY"] = new Array("","$4,150","$50","$3,850","$109,560","$2,610","$74,820");
states["NC"] = new Array("","$2,000","$30","$2,000","$109,560","$1,750","$21,912");
states["ND"] = new Array("","$3,000","$50","$3,000","$109,560","$2,610","$109,560"); 
states["OH"] = new Array("","$1,500","$40","$1,500","$109,560","$1,750","$21,912");
states["OK"] = new Array("x","$2,000","$50","$2,000","$109,560","$2,610","$25,000");
states["OR"] = new Array("x","$2,000","$30","$2,000","$109,560","$1,911","$21,912");
states["PA"] = new Array("","$2,400","$45","$2,400","$109,560","$1,750","$21,912");
states["RI"] = new Array("","$4,000","$50","$4,000","$109,560","$1,750","$21,912");
states["SC"] = new Array("x","$2,000","$30","$2,000","$109,560","$2,610","$66,480");
states["SD"] = new Array("x","$2,000","$60","$2,000","$109,560","$1,750","$21,912");
states["TN"] = new Array("x","$2,000","$40","$2,000","$109,560","$1,750","$21,912");
states["TX"] = new Array("x","$2,000","$60","$2,000","$109,560","$2,610","$21,912");
states["UT"] = new Array("x","$2,000","$45","$2,000","$109,560","$1,750","$21,912");
states["VT"] = new Array("","$2,000","$47.66","$2,000","$109,560","$1,750","$109,560"); 
states["VA"] = new Array("","$2,000","$30","$2,000","$109,560","$1,750","$21,912");
states["WA"] = new Array("","$2,000","$41.62","$2,000","$109,560","$1,750","$41,493");
states["WV"] = new Array("","$2,000","$50","$2,000","$109,560","$1,750","$21,912");
states["WI"] = new Array("x","$2,000","$45","$2,000","$109,560","$2,281","$50,000");
states["WY"] = new Array("x","$2,000","$50","$2,000","$109,560","$2,610","$109,560"); 

function calculate() {
   var form = document.medicaid;
   var sState = form.sState.value;
   var sMarital = form.sMarital.value;
   //make sure they arent over the limit
   if (sMarital == "Single") {
      //single
      document.getElementById("assetspenddown").innerHTML = "<p>To qualify for Medicaid, single people must spend their <a href=\"#countable\">countable assets</a> down to <span class=\"result\">" + states[sState][1] + "</span>.</p>";
      document.getElementById("incomeallowance").innerHTML = "<p>A single Medicaid recipient must spend all their income except  <span class=\"result\">" + states[sState][2] + "</span> per month.</p>";      
   } else {
      //married - min rule
      if (states[sState][0] == "x") {
         document.getElementById("assetspenddown").innerHTML = "<p>To qualify for Medicaid, a married person must spend their assets down to the greater of one half of the couples combined <a href=\"#countable\">countable assets</a> up to a maximum of <span class=\"result\">" + states[sState][4] + "</span>, but no less than <span class=\"result\">" + states[sState][6] + "</span>. It does not matter whose name the assets are in. Medicaid treats the assets of a married couple as one regardless of whose name they are in.</p>";
         document.getElementById("assetspenddown").innerHTML += "<p>In addition, a Medicaid recipient can retain <span class=\"result\">" + states[sState][3] + "</span> of assets in their own name.</p>"; 
         document.getElementById("incomeallowance").innerHTML = "<p>The Medicaid recipient can keep a maximum monthly income allowance of <span class=\"result\">" + states[sState][2] + "</span>. The healthy spouse can retain 100%  of their income. If that income is less than <span class=\"result\">" + states[sState][5] + "</span> they can keep income from the injured spouse up to that amount.</p>";  
      //married - std
      } else {
         document.getElementById("assetspenddown").innerHTML = "<p>To qualify for Medicaid, a married person must spend their assets down to the greater of one half of the couples combined <a href=\"#countable\">countable assets</a> up to a maximum of <span class=\"result\">" + states[sState][4] + "</span>. It does not matter whose name the assets are in. Medicaid treats the assets of a married couple as one regardless of whose name they are in.</p>";
         document.getElementById("assetspenddown").innerHTML += "<p>In addition, a Medicaid recipient can retain <span class=\"result\">" + states[sState][3] + "</span> of assets in their own name.</p>"; 
         document.getElementById("incomeallowance").innerHTML = "<p>The healthy spouse retains 100% of their income. If that income is less than <span class=\"result\">" + states[sState][5] + "</span> they can keep income from the injured spouse up to that amount.</p>";   
      }
   }
   showElement('results');
}
preload('submit','/images/shared/butt/butt_submit');