function printfriendforward()
{
//***********************************************************************
//*
//* Function  printfriendforward - opens new window with printer-friendly version of report
//*
//* Language:  JavaScript1.1
//*
//* Inputs:
//*   object   form object
//*
//* Returns:
//*   none
//*
//* Limitations:
//*   
//*   
//*
//* Author:
//*  Dr. Fred Tillman
//*  National Research Council Research Associate
//*  Regulatory Support Branch
//*  Ecosystems Research Division
//*  National Exposure Research Laboratory
//*  United States Environmental Protection Agency
//*  960 College Station Road
//*  Athens, Georgia 30605
//*  tillman.fred@epa.gov
//* 
//*
//* Reference:
//*  Flanagan, D., 1997, JavaScript: The Definitive Guide, 2ed, O'Reilly and Associates
//*
//* Created: 4-14-2004
//*
//* Required functions: none
//*
//* Required scripts: none
//*
//***********************************************************************
  

     var f = document.vaporsite;

//* Pull necessary variable values from HTML form (not from Tables as user may have changed inputs)

     var sitename = f.sitename.value;
     var btype = f.btype.options[f.btype.selectedIndex].value;
     var coc = f.coc.options[f.coc.selectedIndex].value;
     var cname = cont(coc,'cname');
     var sconc = f.sconc.value;
     var sunits = f.sunits.options[f.sunits.selectedIndex].value;
     var smedia = f.smedia.options[f.smedia.selectedIndex].value;
     var mflag = f.mflag.value;

     var soiltype = f.soiltype.options[f.soiltype.selectedIndex].value;
     var sname = soil(soiltype,'sname');

     var CAS = Input(f.CAS.value);
     var MW = Input(f.MW.value);
     var H = Input(f.H.value);
     var Da = f.Da.value;
     var Dw = f.Dw.value;
     var URF = Input(f.URF.value);
     var RfC = Input(f.RfC.value);
     var temp = Input(f.temp.value);
     var tempunits = f.tempunits.options[f.tempunits.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 btype = f.btype.options[f.btype.selectedIndex].value;
     var bname = build(btype,'bname');
     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;

     var EFC = Input(f.EFC.value);
     var EFNC = Input(f.EFNC.value);
     var EDC = Input(f.EDC.value);
     var EDNC = Input(f.EDNC.value);
     var ATC = Input(f.ATC.value);
     var ATNC = Input(f.ATNC.value);


     var deff = Input(f.deff.value);
     var deffT = Input(f.deffT.value);
     var A = Input(f.A.value);
     var B = Input(f.B.value);
     var C = Input(f.C.value);
     var text1 = f.text1.value;
     var alpha = Input(f.alpha.value);
     var IACl = f.IACl.value;
     var IAClV = f.IAClV.value;
     var IACb = f.IACb.value;
     var IACbV = f.IACbV.value;
     var IACh = f.IACh.value;
     var IAChV = f.IAChV.value;

     var CRl = f.CRl.value;
     var CRb = f.CRb.value;
     var CRh = f.CRh.value;
     var HQl = f.HQl.value;
     var HQb = f.HQb.value;
     var HQh = f.HQh.value;

     var thetafl = f.thetafl.value;
     var depthfl = f.depthfl.value;
     var thetafh = f.thetafh.value;
     var depthfh = f.depthfh.value;

     var w = window.open('','printwindow','menubar=yes,width=750,height=800,scrollbars=yes');
     var d = w.document;
     d.write('<img src=images/EPAseal.gif align=right width=100 height=100>');
     d.write('<H3>INDOOR AIR SIMULATION RESULTS</H3>');
     d.write('<H4>Screening-Level Johnson and Ettinger Model</H4>');
     d.write('<font size=3><code>');
     d.write('<br>Site Name: &nbsp ',sitename);
     d.write('<br>Report Date: ',new Date());
     d.write('<br>Report Generated From: http://www.epa.gov/athens/learn2model/part-two/onsite/JnE_lite_forward.htm ');
     if (sunits=="mcgL"){sunits="[&#956g/L]"}
     if (sunits=="mcgm"){sunits="[&#956g/m<sup>3</sup>]"}
     if (sunits=="ppbG"){sunits="[ppb-water]"}
     if (sunits=="ppbV"){sunits="[ppb-gas]"}
     d.write('<br>Type of sample: ', mflag,'&nbsp &nbsp Concentration = ',sconc,sunits);
     if (smedia=="GW") {d.write('<br>Depth to ground water table: ',L, Lunits,' +/- ',LTr, Lrunits);}
     if (smedia=="SG") {d.write('<br>Depth of soil gas sample: ',L, Lunits,' +/- ',LTr, Lrunits);}
     d.write('<br>Average soil/ground water temperature: &nbsp ',temp , tempunits);

     d.write('<p><code><strong>CHEMICAL PROPERTIES</strong>');
        d.write('<br>Chemical of Concern: ',cname, '&nbsp &nbsp CAS Number: ',coc);
        d.write('<br>Molecular Weight: ',MW, ' [g/mole]', '&nbsp &nbsp Henrys Constant: ',H,' [unitless]');
        d.write('<br>Diffusivity in Air: ',Da,' [cm<sup>2</sup>/sec]', '&nbsp &nbsp Diffusivity in Water: ',Dw,' [cm<sup>2</sup>/sec]');
        d.write('<br>Unit Risk Factor: ',URF,' [(&#956g/m<sup>3</sup>)<sup>-1</sup>]', '&nbsp &nbsp Reference Concentration: ',RfC,' [mg/m<sup>3</sup>]');
     
     d.write('<p><code><strong>SOIL PROPERTIES</strong>');
       d.write('<br>Soil Type: ',sname, '&nbsp &nbsp Total Porosity: ',n);
       d.write('<br>Unsaturated Zone Moisture Content:'); 
       d.write('<br>&nbsp &nbsp low= ',thetaw[3], '&nbsp best estimate= ',thetaw[2], '&nbsp high= ', thetaw[1]);
       d.write('<br>Capillary Zone Moisture Content: ',thetawcap, '&nbsp &nbsp Height of Capillary Rise: ',capht,' [m]');
       d.write('<br>Soil-Gas Flow Rate into Building: ',Qsoil,' [L/min]');
     
     d.write('<p><code><strong>BUILDING PROPERTIES</strong>');
       d.write('<br>Building Type: ',bname, '&nbsp &nbsp Air Exchange Rate: ',Eb,'[hr<sup>-1</sup>]');
       d.write('<br>Building Mixing Height: ',Hb, '[m]','&nbsp &nbsp Building Footprint Area: ',Fb,'[m<sup>2</sup>]');
       d.write('<br>Subsurface Foundation Area: ',Ab,'[m<sup>2</sup>]', '&nbsp &nbsp Building Crack Ratio: ',eta, '[unitless]');
       d.write('<br>Foundation Slab Thickness: ',Lcrack,'[m]');

     d.write('<p><code><strong>EXPOSURE PARAMETERS</strong>');
       d.write('<br>Exposure Duration: carcinogens ',EDC,' [years] &nbsp &nbsp non-carcinogens: ',EDNC,' [years]');
       d.write('<br>Exposure Frequency: carcinogens ',EFC,' [days/year] &nbsp &nbsp non-carcinogens: ',EFNC,' [days/year]');
       d.write('<br>Averaging Time: carcinogens ',ATC,' [years] &nbsp &nbsp non-carcinogens: ',ATNC,' [years]');
     
     d.write('<p><code><strong>JOHNSON & ETTINGER SIMULATION RESULTS</strong>');

       if (smedia=="GW") {d.write('<br>Effective Diffusion Coefficient (D<sup>T</sup><sub>eff</sub>): ',deffT,'[cm<sup>2</sup>/s]');
                          d.write('<br>Ground Water to Indoor Air Attenuation Factor (<big>&#945<sub>GW</sub></big>) = ',alpha);}
       if (smedia=="SG") {d.write('<br>Effective Diffusion Coefficient (D<sub>eff</sub>): ',deff,'[cm<sup>2</sup>/s]');
                          d.write('<br>Soil Gas to Indoor Air Attenuation Factor (<big>&#945<sub>SG</sub></big>) = ',alpha);}
       d.write('<br>');
       d.write('<br><sup>1</sup><u>Low Indoor Air Prediction:</u> ',IACl,' [&#956g/m<sup>3</sup>] or &nbsp ',IAClV,' [ppbv]');
       d.write('<br>Cancer Risk of this concentration: ',CRl, '&nbsp Hazard Risk of this concentration: ',HQl);     
       d.write('<br>');
       d.write('<br><u>Best Estimate Indoor Air Prediction:</u> ',IACb,'[&#956g/m<sup>3</sup>] or &nbsp ',IACbV,' [ppbv]');
       d.write('<br>Cancer Risk of this concentration: ',CRb, '&nbsp Hazard Risk of this concentration: ',HQb);     
       d.write('<br>');
       d.write('<br><sup>2</sup><u>High Indoor Air Prediction:</u> ',IACh,'[&#956g/m<sup>3</sup>] or &nbsp ',IAChV,' [ppbv]');
       d.write('<br>Cancer Risk of this concentration: ',CRh, '&nbsp Hazard Risk of this concentration: ',HQh);     
       d.write('<br>');
       d.write('<p>');

       d.write('<TABLE width = 90%>');
       d.write('<TR><TD align=center bgcolor=#000000 height=1></TD>');
       d.write('</TR></TABLE>');

     d.write('<p><p><code><small>',text1);
     if (LTr==0 & (thetaw[3]!=thetaw[2] | thetaw[2]!=thetaw[1])) {d.write('<p><p><code><sup>1</sup>"Low Prediction" concentrations produced with ',thetafl,' moisture content.');
                                                                  d.write('<br><sup>2</sup>"High Prediction" concentrations produced with ',thetafh,' moisture content.');}
     if (LTr!=0 & (thetaw[3]==thetaw[2] & thetaw[2]==thetaw[1])) {d.write('<p><p><code><sup>1</sup>"Low Prediction" concentrations produced with ', depthfl,' depth to contamination.');
                                                                   d.write('<br><sup>2</sup>"High Prediction" concentrations produced with ',depthfh,' depth to contamination.');}

     if (LTr!=0 & (thetaw[3]!=thetaw[2] | thetaw[2]!=thetaw[1])) {d.write('<p><p><code><sup>1</sup>"Low Prediction" concentrations produced with ',thetafl,' moisture content and ',depthfl,' depth to contamination.');
                                                                   d.write('<br><sup>2</sup>"High Prediction" concentrations produced with ',thetafh,' moisture content and ',depthfh,' depth to contamination.');}
     if (LTr==0 & (thetaw[3]==thetaw[2] & thetaw[2]==thetaw[1])) {d.write('<p><p><code>No range of moisture content or depth to contamination was entered, therefore no range of results is produced.');}

    d.write('<p><p>');

//* 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');

    if ((thetaw[1]<thetawtl) | (thetaw[2]<thetawtl) | (thetaw[3]<thetawtl) | (thetaw[1]>thetawth) | (thetaw[2]>thetawth) | (thetaw[3]>thetawth)) {d.write('<br><code> A moisture content value is outside the recommended range for this soil type.');}

//* Alert if Qsoil value is outside of OSWER reasonable range
    if ((Qsoil<1) | (Qsoil>10)) {d.write('<br><code> Qsoil is outside the recommended range for this parameter.');}
                                
//* Alert if Eb (air exchange) value is outside of OSWER reasonable range
    if ((Eb<0.1) | (Eb>1.5)) {d.write('<br><code> Building Air Exchange is outside the recommended range for this parameter.');}

//* Alert if Hb (building mixing height) value is outside of OSWER reasonable range
    if (((btype=='base') & ((Hb<2.44)|(Hb>4.88))) | ((btype=='slab') & ((Hb<2.13)|(Hb>3.05)))) 
       {d.write('<br><code> Building Mixing Height is outside the recommended range for this 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)))) 
       {d.write('<br><code> Building Footpring Area is outside the recommended range for this 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)))) 
       {d.write('<br><code> Subsurface Foundation Area is outside the recommended range for this 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)))) 
       {d.write('<br><code> Building Crack Ratio is outside the recommended range for this building type.');}

//* Alert if GW temperature is outside of reasonable range
    if (((tempunits=='C') & ((temp<0)|(temp>25))) | ((tempunits=='F') & ((temp<32)|(temp>77)))) 
       {d.write('<br><code> Ground Water Temperature is outside the typical range for this parameter.');}

//* Alert if any of the exposure values are different than OSWER defaults
    if (ATC != 70) 
       {d.write('<br><code> Averaging Time for carcinogens has been changed from default value of 70 years.');}

    if (EFC != 350) 
       {d.write('<br><code> Exposure Frequency for carcinogens has been changed from default value of 350 days/year.');}

    if (EDC != 30) 
       {d.write('<br><code> Exposure Duration for carcinogens has been changed from default value of 30 years.');}

    if (ATNC != EDNC) 
       {d.write('<br><code> OSWER draft guidance recommends averaging time = exposure duration for non-carcinogens.');}

    if (EFNC != 365) 
       {d.write('<br><code> Exposure Frequency for non-carcinogens has been changed from default value of 365 days/year.');}


    d.close();
}


