
<!--

//* function to clear all parameter and result values

function blank(data)
{
   var f = document.vaporsite;
//*   f.thetawarning.visibility = hide;

 if (data=="clear") {clearAllforward(f,'all');}
 if (data=="results") {clearAllforward(f,'results');}

}
//* -----------------------------------------------------------------------------------------------------------------------------------------------
//* function to supply building parameter values

function bparams()
{
   var f = document.vaporsite;
 clearAllforward(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]
//* Fb(building footprint area)[m2]; Ab(TOTAL foundation area, including buried walls)[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');
     Fb = build(btype,'Fb');
     Ab = build(btype,'Ab');
     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;
 clearAllforward(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;
}
//* -----------------------------------------------------------------------------------------------------------------------------------------------
//* function to supply temperature dependent Henry's Law Constant

function henryslaw()
{
       var f = document.vaporsite;
       clearAllforward(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;
 clearAllforward(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 Fb = Input(f.Fb.value);
     var Ab = Input(f.Ab.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);


//* 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 Indoor Air Concentrations based on Sample Concentration and appropriate alpha

     var sconc = Input(f.sconc.value);
     var sunits = f.sunits.options[f.sunits.selectedIndex].value;
     var smedia = f.smedia.options[f.smedia.selectedIndex].value;

//* Output only one "A" coefficient and alpha value

     if (smedia=="GW") {alphab = alphacapb; A[5]=Acap[5];}
    
//* First, get consistency in units (mcg/m3 for SG)
     if (smedia=="SG") {
        if (sunits=="ppbV") {
           sconc = (sconc/24.4658)*MW;
                       }    }
//* Compute indoor air concentrations for three alpha levels for groundwater (GW) or soil gas (SG)
//* IA for GW = Cgw * alphacap * H /(1E-3)   results in mcg/m3
//* IAClV (et al.) are indoor air concentrations converted to ppbV
//* Next compute cancer risk and hazard quotient


     var IACl = 0; var IACb = 0; var IACh = 0;
     var IAClV= 0; var IACbV= 0; var IAChV= 0;
     var CRl = 0; var CRb = 0; var CRh = 0;
     var HQl = 0; var HQb = 0; var HQh = 0;
     var mflag = "";

//* need averaging time in [days] because exposure frequency is in [days/year] and exposure duration is in [years]
       ATC = ATC * 365; 
       ATNC = ATNC * 365;

     if (smedia=="GW") {
        IACl=alphacapl*sconc*H/(1E-3);
        IAClV = IACl * 24.4658/MW;
        IACb=alphacapb*sconc*H/(1E-3);
        IACbV = IACb * 24.4658/MW;
        IACh=alphacaph*sconc*H/(1E-3);
        IAChV = IACh * 24.4658/MW;
       mflag = "GROUND WATER";
      if (URF!=0) {
         CRl = URF*EFC*EDC*IACl/(ATC);
         CRb = URF*EFC*EDC*IACb/(ATC);
         CRh = URF*EFC*EDC*IACh/(ATC);
                  }
      if (RfC!=0) {
         HQl = (EFNC*EDNC*IACl/(ATNC*RfC*1000));
         HQb = (EFNC*EDNC*IACb/(ATNC*RfC*1000));
         HQh = (EFNC*EDNC*IACh/(ATNC*RfC*1000));
                  }
                       }
        
     if (smedia=="SG") {
        IACl=alphal*sconc;
        IAClV = IACl * 24.4658/MW;
        IACb=alphab*sconc;
        IACbV = IACb * 24.4658/MW;
        IACh=alphah*sconc;
        IAChV = IACh * 24.4658/MW;
       mflag = "SOIL GAS";
      if (URF!=0) {
         CRl = URF*EFC*EDC*IACl/(ATC);
         CRb = URF*EFC*EDC*IACb/(ATC);
         CRh = URF*EFC*EDC*IACh/(ATC);
                  }
      if (RfC!=0) {
         HQl = (EFNC*EDNC*IACl/(ATNC*RfC*1000));
         HQb = (EFNC*EDNC*IACb/(ATNC*RfC*1000));
         HQh = (EFNC*EDNC*IACh/(ATNC*RfC*1000));
                  }
                        }


//* Push results to HTML page

 if (smedia=="SG") {
 f.deffT.value= 'Not Applicable';}
 else {f.deffT.value = Num2String(deffT[5],4,-10,10,-7,7);}

f.deff.value = Num2String(deff[2],4,-10,10,-7,7);
f.A.value = Num2String(A[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.mflag.value = mflag;
f.IACl.value = Num2String(IACl,4,-10,10,-3,3);
f.IAClV.value = Num2String(IAClV,4,-10,10,-3,3);
f.IACb.value = Num2String(IACb,4,-10,10,-3,3);
f.IACbV.value = Num2String(IACbV,4,-10,10,-3,3);
f.IACh.value = Num2String(IACh,4,-10,10,-3,3);
f.IAChV.value = Num2String(IAChV,4,-10,10,-3,3);
f.CRl.value = Num2String(CRl,4,-10,10,-3,3);
f.HQl.value = Num2String(HQl,4,-10,10,-3,3);
f.CRb.value = Num2String(CRb,4,-10,10,-3,3);
f.HQb.value = Num2String(HQb,4,-10,10,-3,3);
f.CRh.value = Num2String(CRh,4,-10,10,-3,3);
f.HQh.value = Num2String(HQh,4,-10,10,-3,3);

f.thetafl.value = thetafl;
f.depthfl.value = depthfl;
f.thetafh.value = thetafh;
f.depthfh.value = depthfh;

var text1="";
paramtestforward('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]) {
                clearAllforward(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) {
                clearAllforward(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==''))) {
                clearAllforward(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]) {
                clearAllforward(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==''){clearAllforward(f,'results');
                                  alert("ERROR: Enter missing parameter values");}
   else if (n==''|thetaw==''|thetawcap==''|capht==''|Qsoil==''|Eb==''|Hb==''|Fb==''|Ab==''|eta==''|Lcrack==''|LT=='') {clearAllforward(f,'results');
                                  alert("ERROR: Enter missing parameter values");}
        if (sconc=='' | sconc==0 | sunits=='none'|smedia=='none') {clearAllforward(f,'results');
                                  alert("ERROR: Enter missing Sample Concentration, Sample Units or Sample Media Type");}

//* Ensure correct units are chosen for groundwater or soil gas samples
        if (smedia=="GW" & (sunits=="ppbV" | sunits=="mcgm")) {clearAllforward(f,'results');
                                  alert("ERROR: For Ground Water samples, units must be [micrograms/L] or [ppb-water]");}
        if (smedia=="SG" & (sunits=="ppbG" | sunits=="mcgL")) {clearAllforward(f,'results');
                                  alert("ERROR: For Soil Gas samples, units must be [micrograms/m3] or [ppb-soilgas]");}

//* THE FOLLOWING ALERTS ARE BASED ON OSWER GUIDANCE FOR BUILDING AND SOIL PARAMETERS

//* 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.");}  


}

// -->
<!-- end JnE_lite_forward_1.js -->