function solubilityT(chemical,temperature)
{
  var sol = 0;
  var b = 0;
  var m = 0;
  var tempK = 0;
  var logSol = 0;

  //estimate the solubility from coefficients established from
  //running SPARC
  tempK = temperature + 273.

/*
  if (chemical=="mtbe") 
  {
    //no data for MTBE--
    b = Math.LOG10E*Math.log(solubility(chemical));
    m = 0;
  }
*/

  if (chemical=="mtbe") {m=681.62; b = 2.3965;}
  if (chemical=="benzene") {m = -1812.9; b = 9.4044;}
  if (chemical=="toluene") {m = -2069.3; b = 9.732;}
  if (chemical=="ethylbenzene") {m = -2414.1; b = 10.427;}
  if (chemical=="o-xylene") {m = -2363.5; b = 10.321;}
  if (chemical=="m-xylene") {m = -2237; b = 9.7924;}
  if (chemical=="p-xylene") {m = -2367.5; b = 10.209;}
  if (chemical=="totalxylene") {m = -2322.7; b = 10.108;}

  logSol = m/tempK + b;
  sol = Math.pow(10,logSol);

  return sol;

}
function solubilityTR(chemical,temperature)
{
  //est solubility using SRC recommended values and SPARC rates of change

}
function solubility(chemical)
{
  var sol = 0;

  if (chemical=="mtbe") {sol = 48000}
  if (chemical=="benzene") {sol = 1780}
  if (chemical=="toluene") {sol = 535}
  if (chemical=="ethylbenzene") {sol = 152}
  if (chemical=="o-xylene") {sol = 175}
  if (chemical=="m-xylene") {sol = 130}
  if (chemical=="p-xylene") {sol = 196}
  if (chemical=="totalxylene") {sol = 167}
  return sol;
}
function mole (chemical)
{
  var mw = 0;

  if (chemical=="benzene") {mw=78}
  if (chemical=="toluene") {mw=92}
  if (chemical=="mtbe") {mw = 88}
  if (chemical=="ethylbenzene") {mw = 106}
  if (chemical=="o-xylene") {mw = 106}
  if (chemical=="p-xylene") {mw = 106}
  if (chemical=="m-xylene") {mw = 106}
  if (chemical=="totalxylene") {mw = 106}
  
  return mw;
  
}

function getKOC (chemical)
{
  var koc = 0;
  
  if (chemical=="benzene") {koc = 83}
  if (chemical=="toluene") {koc = 300}
  if (chemical=="mtbe") {koc = 11}
  if (chemical=="ethylbenzene") {koc = 1100}
  if (chemical=="o-xylene") {koc = 830}
  if (chemical=="p-xylene") {koc = 870}
  if (chemical=="m-xylene") {koc = 982}
  if (chemical=="totalxylene") {koc = 894}
  
  return koc;
  
}

function getKOCFromDataSet (chemical,datasource)
{
  var koc = 0;
  
  if (datasource=="onsite")
  {
    if (chemical=="benzene") {koc = 83}
    if (chemical=="toluene") {koc = 300}
    if (chemical=="mtbe") {koc = 11}
    if (chemical=="ethylbenzene") {koc = 1100}
    if (chemical=="o-xylene") {koc = 830}
    if (chemical=="p-xylene") {koc = 870}
    if (chemical=="m-xylene") {koc = 982}
    if (chemical=="totalxylene") {koc = 894}
  }

  //Data from Pennsylvania Code Title 25. Chapter 250. Administration of the Land Recycyling Program
  //Appendix A, Table 5 Physical and Toxicological Properties, A. Organic Regulated Substances
  if (datasource=="pa25250")
  {
    if (chemical=="benzene") {koc = 58}
    if (chemical=="toluene") {koc = 130}
    if (chemical=="mtbe") {koc = 12}
    if (chemical=="ethylbenzene") {koc = 220}
    if (chemical=="o-xylene") {koc = 830}
    if (chemical=="p-xylene") {koc = 870}
    if (chemical=="m-xylene") {koc = 982}
    if (chemical=="totalxylene") {koc = 350}
  

  }


  return koc;
  
}


function getKH (chemical)
{
  var kh = 0;

  if (chemical=="benzene") {kh = 0.229}
  if (chemical=="toluene") {kh = 0.265}
  if (chemical=="mtbe") {kh = .0228}
  if (chemical=="ethylbenzene") {kh = 0.267}
  if (chemical=="o-xylene") {kh = 0.212}
  if (chemical=="p-xylene") {kh = -1}
  if (chemical=="m-xylene") {kh = -1}
  if (chemical=="totalxylene") {kh = 0.212}
  
  return kh;
  
}

