
<!--

//* function to clear all parameter and result values

function blank(data)
{
   var f = document.vaporsite;
//*   f.thetawarning.visibility = hide;

 if (data=="clear") {clearAll(f,'all');}
 if (data=="results") {clearAll(f,'results');}

}
//* -----------------------------------------------------------------------------------------------------------------------------------------------
//* function to supply building parameter values

function bparams()
{
   var f = document.vaporsite;
 clearAll(f,'results');

//* Building parameters taken from Appendix G, Table G-13 of the OSWER Draft Guidance on Vapor Intrusion
//* Eb(building air exchange rate)[hr^-1]; Hb(slab-on-grade mixing height)[m]
//* Ab(building footprint area for slab)[m2]; eta(slab-on-grade building crack ratio); Lcrack(slab thickness)[m]
//* deffcrack (effective diffusion coefficient of slab crack, set equal to unsat deff)[cm2/s]

     btype = f.btype.options[f.btype.selectedIndex].value;
    
     Eb = build(btype,'Eb');
     Hb = build(btype,'Hb');
     Ab = build(btype,'Ab');
     Fb = build(btype,'Fb');
     eta = build(btype,'eta');
     Lcrack = build(btype,'Lcrack');


//* output default values to HTML page

  f.Eb.value = Num2String(Eb,3,-10,10,-4,4);
  f.Hb.value = Num2String(Hb,3,-10,10,-4,4);
  f.Fb.value = Num2String(Fb,4,-10,10,-4,4);
  f.Ab.value = Num2String(Ab,4,-10,10,-4,4);
  f.eta.value = Num2String(eta,2,-10,10,-7,7);
  f.Lcrack.value = Num2String(Lcrack,3,-10,10,-4,4);

}

//* -----------------------------------------------------------------------------------------------------------------------------------------------
//* function to supply contaminant parameter values

function cocparams()
{
   var f = document.vaporsite;
 clearAll(f,'results');

//* Contaminant data taken from VLOOKUP Table of OERR-issued J&E spreadsheets
//* Contaminant parameter values in contable.js function
//* Koc[cm3/g]; Da[cm2/s]; Dw[cm2/s]; S[mg/L]; H[unitless]; Href[atm-m3/mol]; Tref[K]; Tb[K]; Tc[K]; delHv[cal/mol]; URF[(mcg/m3)^-1]; RfC[mg/m3] 
//* MW[g/mole]


   var coc="";var CAS="";var Koc="";var Da="";var Dw="";var S="";var H="";var Href="";var Tref="";var Tb="";var Tc="";var delHv="";var URF="";var RfC="";var MW="";
    coc = f.coc.options[f.coc.selectedIndex].value;
 var temp = Input(f.temp.value);
 if ((coc != 'empty') & (temp != '')) {
     var tempunits = f.tempunits.options[f.tempunits.selectedIndex].value;
     henry(coc,temp,tempunits);}
    CAS = cont(coc,'CAS');
    Koc = cont(coc,'Koc');
    Da = cont(coc,'Da');
    Dw = cont(coc,'Dw');
//*    H = cont(coc,'H');
    URF = cont(coc,'URF');
    RfC = cont(coc,'RfC');
    MW = cont(coc,'MW');

//* Set Default Exposure Data
    var EFC = 350;
    var EDC = 30;
    var ATC = 70;
    var EFNC = 365;
    var EDNC = 30;
    var ATNC = 30;
    var THQ = 1;

//* output default values to HTML page
  f.CAS.value = CAS;
  f.MW.value = MW;
//*  f.H.value = Num2String(H,5,-10,10,-7,7);
  f.Da.value = Num2String(Da,4,-10,10,-1,1);
  f.Dw.value = Num2String(Dw,4,-10,10,-4,4);
  f.URF.value = Num2String(URF,3,-10,10,-1,1);
  f.RfC.value = Num2String(RfC,3,-10,10,-1,1);
  f.EFC.value = EFC;
  f.EDC.value = EDC;
  f.ATC.value = ATC;
  f.EFNC.value = EFNC;
  f.EDNC.value = EDNC;
  f.ATNC.value = ATNC;
  f.THQ.value = THQ;

}
//* -----------------------------------------------------------------------------------------------------------------------------------------------
//* function to supply temperature dependent Henry's Law Constant

function henryslaw()
{
       var f = document.vaporsite;
       clearAll(f,'results');
       var coc = f.coc.options[f.coc.selectedIndex].value;
       var temp = Input(f.temp.value);
       var tempunits = f.tempunits.options[f.tempunits.selectedIndex].value;
       var H = '';
       f.H.value = H;

       if ((coc != 'empty') & (temp != '')) {
            henry(coc,temp,tempunits);}
  
}
//* -----------------------------------------------------------------------------------------------------------------------------------------------
//* function to supply soil parameter values

function soilparams()
{
   var f = document.vaporsite;
 clearAll(f,'results');


//* Soil-dependent parameters taken from Appendix G, Table G-4 of the OSWER Draft Guidance on Vapor Intrusion
//* n(porosity)[unitless]; thetaw(volumetric moisture content)[unitless]; thetav(volumetric gas content)[unitless]
//* thetawcap(capillary water content at air-entry pressure); capht(height of capillary zone)[m]
//* Qsoil(gas flow into building)[L/min];

   var n = 0; var thetaw = 0; var thetawl = 0; var thetawh = 0; var thetawcap = 0; var capht = 0; var Qsoil = 0;
   var soiltype = "";
   soiltype = f.soiltype.options[f.soiltype.selectedIndex].value;

    n = soil(soiltype,'n');
     var thetaw = new Array();
     thetaw[3] = soil(soiltype,'thetawl');
     thetaw[2] = soil(soiltype,'thetaw');
     thetaw[1] = soil(soiltype,'thetawh');
    thetawcap = soil(soiltype,'thetawcap');
    capht = soil(soiltype,'capht');
    Qsoil = soil(soiltype,'Qsoil');

//* output default values to HTML page

  f.n.value = Num2String(n,3,-10,10,-7,7);
  f.thetawl.value = Num2String(thetaw[3],3,-10,10,-7,7);
  f.thetaw.value = Num2String(thetaw[2],3,-10,10,-7,7);
  f.thetawh.value = Num2String(thetaw[1],3,-10,10,-7,7);
  f.thetawcap.value = Num2String(thetawcap,3,-10,10,-7,7);
  f.capht.value = Num2String(capht,3,-10,10,-7,7);
  f.Qsoil.value = Num2String(Qsoil,3,-10,10,-4,4);

}

//* -----------------------------------------------------------------------------------------------------------------------------------------------
//* function to calculate Deff, A, B & C coefficients and attenuation 

function calculate()
{
var f = document.vaporsite;

//* Pull necessary variable values from HTML form (not from Tables as user may have changed inputs)

     var Eb = Input(f.Eb.value);
     var Hb = Input(f.Hb.value);
     var Ab = Input(f.Ab.value);
     var Fb = Input(f.Fb.value);
     var eta = Input(f.eta.value);
     var Lcrack = Input(f.Lcrack.value);

     var L = Input(f.LT.value);
     var Lunits = f.Lunits.options[f.Lunits.selectedIndex].value;
     var LTr = Input(f.LTr.value);
     var Lrunits = f.Lunits.options[f.Lunits.selectedIndex].value;

     coc = f.coc.options[f.coc.selectedIndex].value;
     var CAS = Input(f.CAS.value);
     var MW = Input(f.MW.value);
     var H = Input(f.H.value);
     var Da = Input(f.Da.value);
     var Dw = Input(f.Dw.value);
     var URF = Input(f.URF.value);
     var RfC = Input(f.RfC.value);
     var MCL = cont(coc,'MCL');

     var temp = Input(f.temp.value);
     var tempunits = f.tempunits.options[f.tempunits.selectedIndex].value;

     soiltype = f.soiltype.options[f.soiltype.selectedIndex].value;
     var n = Input(f.n.value);
     var thetaw = new Array();
     thetaw[3] = Input(f.thetawl.value);
     thetaw[2] = Input(f.thetaw.value);
     thetaw[1] = Input(f.thetawh.value);
     var thetawcap = Input(f.thetawcap.value);
     var capht = Input(f.capht.value);
     var Qsoil = Input(f.Qsoil.value);

     var EFC = Input(f.EFC.value);
     var EDC = Input(f.EDC.value);
     var ATC = Input(f.ATC.value);
     var EFNC = Input(f.EFNC.value);
     var EDNC = Input(f.EDNC.value);
     var ATNC = Input(f.ATNC.value);
     var THQ = Input(f.THQ.value);
     var TCR = f.TCR.options[f.TCR.selectedIndex].value;


//* First need to get depth to contamination (L]) and confidence interval (LTr) in meters
 
    if (Lunits == 'ft') {L = L*0.3048};
    if (Lrunits == 'ft') {LTr = LTr*0.3048};

//* Change confidence interval LTr to min (LT[1]) and max (LT[3]) values  
    var LT = new Array();
   
    LT[2] = L;
    LT[1] = L - LTr;
    LT[3] = L + LTr;

//* Compute unsaturated zone Effective Diffusion Coefficient (deff[cm2/s]) using Millington relationship

       var deff = new Array(3); var thetav = new Array(3);
   
       for(i = 1; i<4; i++) {   
       thetav[i] = n - thetaw[i];
       deff[i] = Da*(Math.pow(thetav[i],3.33))/(Math.pow(n,2)) + ((Dw/H)*(Math.pow(thetaw[i],3.33)/Math.pow(n,2)))
                             }

//* Compute Effective Diffusion Coefficient through Capillary Zone (deffcap[cm2/s]) for Groundwater Concentrations
 
       var thetavcap = n - thetawcap;

       deffcap = Da*(Math.pow(thetavcap,3.33))/(Math.pow(n,2)) + ((Dw/H)*(Math.pow(thetawcap,3.33)/Math.pow(n,2)))


//* Calculate A,B and C coefficients according to Johnson (2002)
//* First, compute Total Effective Diffusion Coefficient (deffT) that includes both Capillary and Unsaturated Zones
//* For coefficient B, assume that the foundation crack is dry (i.e. Deff of crack = Deff of unsat zone)
//* note:  need all units in meters and seconds
//* Deff[cm2/sec]/10000=[m2/sec]; Eb[1/hr]/3600=[1/sec]; Qsoil[L/min]/60000=[m3/sec]
//* note: footprint area of both building types set to 100 m, enclosed space volume (Vb) computed as footprint area x mixing height

    var Vb = Hb * Fb;
    var Qb = Vb*Eb/3600;
    var C = (Qsoil/60000)/Qb;

        var deffT = new Array(9); var Acap = new Array(9); var A = new Array(9); var deffck = new Array(3); var B = new Array(9);
        
        for(i = 1; i<4; i++) {   
             j = 1; k=i; 
             deffT[i] =  LT[k]/((capht/deffcap) + ((LT[k]-capht)/deff[j]));
             Acap[i] = (deffT[i]/10000)/((Eb/3600)*(Vb/Ab)*LT[k]);
                A[i] = (deff[j]/10000)/((Eb/3600)*(Vb/Ab)*LT[k]);
                deffck[j]=deff[j];
                B[i] = (((Qsoil/60000)/Qb)*(Eb/3600)*(Vb/Ab)*Lcrack)/((deffck[j]/10000)*eta);
                            }
        for(i = 4; i<7; i++) {   
             j = 2; k=i-3; 
             deffT[i] =  LT[k]/((capht/deffcap) + ((LT[k]-capht)/deff[j]));
             Acap[i] = (deffT[i]/10000)/((Eb/3600)*(Vb/Ab)*LT[k]);
                A[i] = (deff[j]/10000)/((Eb/3600)*(Vb/Ab)*LT[k]);
                deffck[j]=deff[j];
                B[i] = (((Qsoil/60000)/Qb)*(Eb/3600)*(Vb/Ab)*Lcrack)/((deffck[j]/10000)*eta);
                             }
        for(i = 7; i<10; i++) {   
             j = 3; k=i-6; 
             deffT[i] =  LT[k]/((capht/deffcap) + ((LT[k]-capht)/deff[j]));
             Acap[i] = (deffT[i]/10000)/((Eb/3600)*(Vb/Ab)*LT[k]);
                A[i] = (deff[j]/10000)/((Eb/3600)*(Vb/Ab)*LT[k]);
                deffck[j]=deff[j];
                B[i] = (((Qsoil/60000)/Qb)*(Eb/3600)*(Vb/Ab)*Lcrack)/((deffck[j]/10000)*eta);
                             }


//* Calculate attenuation coefficient for both soil gas (alpha) and groundwater systems (alphacap)
//* First, test peclet number and if too large, compute alpha with limit relation
     
        var alpha = new Array(9); var alphacap = new Array(9);
       
        for(i = 1; i<10; i++) {   
            if (B[i] >= 709.5)  {
		   alpha[i] = (A[i]/((A[i]/C)+1)); 
               alphacap[i] = (Acap[i]/((Acap[i]/C)+1));
                                } 
            else {      
               alpha[i] = (A[i]*Math.exp(B[i]))/(Math.exp(B[i])+A[i]+(A[i]/C)*(Math.exp(B[i])-1));
               alphacap[i] = (Acap[i]*Math.exp(B[i]))/(Math.exp(B[i])+Acap[i]+(Acap[i]/C)*(Math.exp(B[i])-1));
                 }               
                              }
 
//* Choose low (alphal), best estimate (alphab) and high (alphah) alpha values
//* alpha value chosen is held in variables low and hi

        var alphal = 0; var alphab = 0; var alphah = 0; var low =1; var hi = 1;
        var alphacapl = 0; var alphacapb = 0; var alphacaph = 0; var caplow = 1; var caphi = 1;

        alphab = alpha[5]; 
        alphacapb = alphacap[5];
          
        alphal = alpha[1]; low = 1;
        alphah = alpha[1]; hi = 1;
        alphacapl = alphacap[1]; caplow = 1;
        alphacaph = alphacap[1]; caphi = 1;
	  
        for (i=2; i<10; i++)   {
           if (alpha[i] < alphal)            {
                 alphal = alpha[i]; low = i; }
       
           if (alpha[i] > alphah)            {
                 alphah = alpha[i];  hi = i; }
                                }
        for (i=2; i<10; i++)   {
           if (alphacap[i] < alphacapl)               {
                 alphacapl = alphacap[i]; caplow = i; }
       
           if (alphacap[i] > alphacaph)               {
                 alphacaph = alphacap[i];  caphi = i; }
                                }
//* Prepare output flag for high and low estimate parameter sets
//* For Deff, i from 1-3=low (high thetaw); 4-6=best estimate; 7-9=high Deff (low thetaw)
//* For LT, 1,4,7=shallow depth; 2,5,8=best estimate; 3,6,9=deepest depth        
//* thetafl = thetaw flag least protective; thetafh = thetaw flag most protective; L=low thetaw; BW=best estimate of thetaw; H=high thetaw
//* depthfl = depth flag least protective; depthfh = depth flag most protective; S=shallow; BD=best estimate of depth; D=deep

        var thetafl; var thetafh; var depthfl; var depthh; 
           if (low==1 | low==2 | low==3) {thetafl='HIGHEST';}
           if (low==4 | low==5 | low==6) {thetafl='BEST ESTIMATE';}
           if (low==7 | low==8 | low==9) {thetafl='LOWEST';}
           if (low==1 | low==4 | low==7) {depthfl='SHALLOWEST';}
           if (low==2 | low==5 | low==8) {depthfl='BEST ESTIMATE';}
           if (low==3 | low==6 | low==9) {depthfl='DEEPEST';}

           if (hi==1 | hi==2 | hi==3) {thetafh='HIGHEST';}
           if (hi==4 | hi==5 | hi==6) {thetafh='BEST ESTIMATE';}
           if (hi==7 | hi==8 | hi==9) {thetafh='LOWEST';}
           if (hi==1 | hi==4 | hi==7) {depthfh='SHALLOWEST';}
           if (hi==2 | hi==5 | hi==8) {depthfh='BEST ESTIMATE';}
           if (hi==3 | hi==6 | hi==9) {depthfh='DEEPEST';}

           if (LTr==''|LTr==0){depthfl='BEST ESTIMATE';depthfh='BEST ESTIMATE';}

//* Compute Target Indoor Air Concentrations based on Risk Levels
//* All concentrations are in units [mcg/m3], then converted to ppbv
//* Cc is cancer-based concentrations for high (Cch), medium (Ccm) and low (CCl) risk levels
//* Cnonc is the hazard-based concentration

//* need averaging time in [days] because exposure frequency is in [days/year] and exposure duration is in [years]
       ATC = ATC * 365; 
       ATNC = ATNC * 365;

       var Cc = 1e6;   
         if (URF != 0)  {
           Cc = (TCR * ATC)/(EFC * EDC * URF);
                        }
         if (RfC != 0)  {
           var Cnonc = (THQ * RfC * 1000 * ATNC)/(EFNC * EDNC);
                         }

//* Choose smaller of URF or RfC-computed concentration and note which was used
  
      var cflag = "CANCER";
        if (Cnonc<Cc) {Cc = Cnonc; cflag = "NON-CANCER";}

//* Provide vapor units in ppb

       CcV = Cc * 24.4658 / MW;


//* Compute Target Soil Gas Concentrations using Risk Based-IA Concentrations and Computed Attenuation
//* All concentrations are in units [mcg/m3], then converted to ppbv

     var SG  = new Array(3); var SGV = new Array(3);
     
         SG[1] = Cc/alphal; SGV[1] = CcV/alphal; SG[2]=Cc/alphab; SGV[2]=CcV/alphab; SG[3]=Cc/alphah; SGV[3]=CcV/alphah;

//* Compute Target Groundwater Concentrations using Risk Based-IA Concentrations, GW Attenuation and H
//* All concentrations are in units [mcg/L]

     var GW  = new Array(3);

         GW[1] = Cc*1e-3*(1/H)*(1/alphacapl);GW[2] = Cc*1e-3*(1/H)*(1/alphacapb);GW[3] = Cc*1e-3*(1/H)*(1/alphacaph);
 

//* If GW conc. is greater than solubility or SG or IA conc. greater than vapor pressure --> FLAG

    var S = cont(coc,'S');
    var VP = S * H * 1E6;

    if (Cc>VP) {Cc = 'Saturation'; CcV = 'Saturation'};

    for(i = 1; i<4; i++) {   
    if (SG[i]>VP) {SG[i] = 'Saturation'; SGV[i] = 'Saturation'};
    if (GW[i]>(S*1000)) {GW[i] = 'Solubility'};
                         }
//* NOTE:  REMOVING THE <MCL TEST PER HENRY SCHUVER RECOMMENDATION
//* If GW concentration is less than MCL, set target GW concentration to MCL

//*    if (GW[1]<MCL) {GW[1]=MCL;}
//*    if (GW[2]<MCL) {GW[2]=MCL;}
//*    if (GW[3]<MCL) {GW[3]=MCL;}
 
//* Push results to HTML page

//* f.deffcap.value=Num2String(deffcap,4,-10,10,-7,7);

f.deff.value = Num2String(deff[2],4,-10,10,-7,7);
f.deffT.value = Num2String(deffT[5],4,-10,10,-7,7);
f.A.value = Num2String(A[5],4,-10,10,-3,3);
f.Acap.value = Num2String(Acap[5],4,-10,10,-3,3);
f.B.value = Num2String(B[5],4,-10,10,-5,5);
f.C.value = Num2String(C,4,-10,10,-3,3);
f.alpha.value = Num2String(alphab,4,-10,10,-3,3);
f.alphacap.value = Num2String(alphacapb,4,-10,10,-3,3);
f.cflag.value = cflag;
f.Cc.value = Num2String(Cc,4,-10,10,-4,4);
f.CcV.value = Num2String(CcV,4,-10,10,-4,4);
f.SG1.value = Num2String(SG[1],4,-10,10,-4,4);
f.SGV1.value = Num2String(SGV[1],4,-10,10,-4,4);
f.GW1.value = Num2String(GW[1],4,-10,10,-4,4);
f.SG2.value = Num2String(SG[2],4,-10,10,-4,4);
f.SGV2.value = Num2String(SGV[2],4,-10,10,-4,4);
f.GW2.value = Num2String(GW[2],4,-10,10,-4,4);
f.SG3.value = Num2String(SG[3],4,-10,10,-4,4);
f.SGV3.value = Num2String(SGV[3],4,-10,10,-4,4);
f.GW3.value = Num2String(GW[3],4,-10,10,-4,4);
f.thetafl.value = thetafl;
f.depthfl.value = depthfl;
f.thetafh.value = thetafh;
f.depthfh.value = depthfh;

var text1="";
paramtest('txt1');
f.text1.value = txt1;

//* This section flags any input errors, clears the results and displays an appropriate error message

//* Ensure that moisture content range is less than total porosity
     if (n<thetaw[1] | n<thetaw[2] | n<thetaw[3]) {
                clearAll(f,'results'); alert("         ERROR: A Moisture Content value is greater than porosity\n\n" +
                                             "Please ensure that all moisture content values are less than total porosity.");       
                                     } 
//* Ensure that capillary zone moisture content is less than total porosity
     if (n<thetawcap) {
                clearAll(f,'results'); alert("          ERROR: Capillary Zone moisture content is greater than porosity\n\n" +
                                             "Please ensure that the capillary zone moisture content is less than total porosity.");  
                                     } 
//* Ensure that there is either a URF or Rfc value
     if (((URF==0)|(URF==''))&((RfC==0)|(RfC==''))) {
                clearAll(f,'results'); alert("ERROR: Either URF or RfC must be non-zero");  
                                     } 
//* Ensure that capillary rise is less than depth to contamination
     if (capht>LT[1] | capht>LT[2] | capht>LT[3]) {
                clearAll(f,'results'); alert("           ERROR: Capillary rise is greater than depth to contamination\n\n" +
                                             "Please ensure that the height of capillary rise is less than the depth to contamination.");       
                                     } 

//* If any of the parameter values are blank, then don't compute results
        if (MW==''|H==''|Da==''|Dw==''|(URF==''& RfC=='')|ATC==''|ATNC==''|EFC==''|EFNC==''|EDC==''|EDNC==''|THQ==''){clearAll(f,'results');
                                  alert("ERROR: Enter missing parameter values");}
   else if (n==''|thetaw==''|thetawcap==''|capht==''|Qsoil==''|Eb==''|Hb==''|Fb==''|Ab==''|eta==''|Lcrack==''|LT=='') {clearAll(f,'results');
                                  alert("ERROR: Enter missing parameter values");}

//* Alert if moisture content values are outside of OSWER reasonable range
        soiltype = f.soiltype.options[f.soiltype.selectedIndex].value;
        thetawtl = soil(soiltype,'thetawl');
        thetawth = soil(soiltype,'thetawh');

    for(i = 1; i<4; i++) {   
    if ((thetaw[i]<thetawtl) | (thetaw[i]>thetawth)) {alert("A moisture content value is outside the typical range for this soil type.\n\n" +
                                             "The model will run with current values, but please check OSWER draft guidance for\n" +
                                             "a reasonable range of drained moisture contents for your soil type.");}  
                         }
                                      
//* Alert if Qsoil value is outside of OSWER reasonable range
    if ((Qsoil<1) | (Qsoil>10)) {alert("Qsoil is outside the typical range for this parameter.\n\n" +
                                                 "The model will run with the current value, but OSWER draft guidance\n" +
                                             "recommends Qsoil values between 1 and 10 L/min.");}  
                                
//* Alert if Eb (air exchange) value is outside of OSWER reasonable range
    if ((Eb<0.1) | (Eb>1.5)) {alert("Building Air Exchange is outside the typical range for this parameter.\n\n" +
                                                 "The model will run with the current value, but OSWER draft guidance\n" +
                                             "recommends Eb values between 0.1 and 1.5 (1/hour).");}  

//* Alert if Hb (building mixing height) value is outside of OSWER reasonable range
    btype = f.btype.options[f.btype.selectedIndex].value;
    if (((btype=='base') & ((Hb<2.44)|(Hb>4.88))) | ((btype=='slab') & ((Hb<2.13)|(Hb>3.05)))) 
       {alert("Building Mixing Height is outside the typical range for this parameter.\n\n" +
             "The model will run with the current value, but please check OSWER draft guidance for\n" +
            "a reasonable range of mixing heights for your building type.");}  

//* Alert if Fb (building footpring area) value is outside of OSWER reasonable range
    if (((btype=='base') & ((Fb<80)|(Fb>200))) | ((btype=='slab') & ((Fb<80)|(Fb>200)))) 
       {alert("Building Footpring Area is outside the typical range for this parameter.\n\n" +
             "The model will run with the current value, but please check OSWER draft guidance for\n" +
            "a typical range of values for your building type.");}  

//* Alert if Ab (subsurface foundation area) value is outside of OSWER reasonable range
    if (((btype=='base') & ((Ab<152)|(Ab>313))) | ((btype=='slab') & ((Ab<85)|(Ab>208)))) 
       {alert("Subsurface Foundation Area is outside the typical range for this parameter.\n\n" +
             "The model will run with the current value, but please check OSWER draft guidance for\n" +
            "a reasonable range of values for your building type.");}  

//* Alert if eta (crack ratio) value is outside of OSWER reasonable range
    if (((btype=='base') & ((eta<0.0001)|(eta>0.001))) | ((btype=='slab') & ((eta<0.00019)|(eta>0.0019)))) 
       {alert("Building Crack Ratio is outside the typical range for this parameter.\n\n" +
             "The model will run with the current value, but please check OSWER draft guidance for\n" +
            "a reasonable range of values for your building type.");}  

//* Alert if GW temperature is outside of reasonable range
    if (((tempunits=='C') & ((temp<0)|(temp>25))) | ((tempunits=='F') & ((temp<32)|(temp>77)))) 
       {alert("Soil/Groundwater Temperature is outside the typical range for this parameter.\n\n" +
             "The model will run with the current value, but please check link on\n" +
             "input section of model for average U.S. ground water temperatures.");}

//* Alert if any of the exposure values are different than OSWER defaults
    if (ATC != (70*365)) {alert("Averaging Time for carcinogens has been changed from default value.\n\n" +
                                                 "The model will run with the current value, but OSWER draft guidance\n" +
                                             "recommends a residential averaging time of 70 years.");}  

    if (EFC != 350) {alert("Exposure Frequency for carcinogens has been changed from default value.\n\n" +
                                                 "The model will run with the current value, but OSWER draft guidance\n" +
                                             "recommends a residential exposure frequency of 350 days/year.");}  

    if (EDC != 30) {alert("Exposure Duration for carcinogens has been changed from default value.\n\n" +
                                                 "The model will run with the current value, but OSWER draft guidance\n" +
                                             "recommends a residential exposure duration of 30 years.");}  

    if (ATNC != (EDNC*365)) {alert("OSWER draft guidance recommends for non-carcinogens that\n" +
                                                 "averaging time = exposure duration\n\n" +
                                                 "The model will run with current values, but check OSWER draft guidance\n" +
                                             "for further information.");}  

    if (EFNC != 365) {alert("Exposure Frequency for non-carcinogens has been changed from default value.\n\n" +
                                                 "The model will run with the current value, but OSWER draft guidance\n" +
                                             "recommends a residential exposure frequency of 365 days/year.");}  

//* Alert if Target Hazard Quotient is different than OSWER default
    if (THQ != 1) {alert("Target Hazard Quotient has been changed from default value.\n\n" +
                                                 "The model will run with the current value, but OSWER draft guidance\n" +
                                             "recommends a hazard quotient of 1.");}  

}

// -->
<!-- end JnE_lite_1.js -->