var varietyname = "";
var varietykey = "";
var varietytypekey = "";   //"burley", "fluecured", or "dark"
var varietytypename = "";
var userlockey = "";       //"us" or "intl"
var uplevel = "1";
var updir = "../";
var changedate = "Dec 15, 2006";           //default change date
var burleychangedate = "Dec 15, 2006";     //most recent date in burleychart array, displayed on "compare" page
var fluecuredchangedate = "Jan 1, 2007";   //most recent date in fluecuredchart array, displayed on "compare" page
 
// 0=varkey, 1=varname, 
var darkchart = new Array(
  ["ky160lc",     "KY 160 LC"],
  ["ky171lc",     "KY 171 LC"],
  ["ktd4lc",      "KTD 4 LC"],
  ["va309",       "VA 309"],
  ["va359",       "VA 359"],
  ["brownleaf",   "Brownleaf"],
  ["lcrittenden", "Little Crittenden"],
  ["nlmadolelc",  "Narrow Leaf Madole LC"],
  ["shirey",      "Shirey"]
 );

// 0=varkey, 1=varname, 2=picture, 3=picwidth, 4=piclength, 5=relyield, 6=screened, 7=lowconverter, 8=bsrace0, 9=bsrace1, 10=blackrootrot, 11=fusariumwilt, 12=tmv, 13=viruscomplex, 14=lastupdated
// NOTE: changedate value does not only include this table, but also pictures changes, description changes, etc
// NOTE: must update burleychangedate in global var
var burleychart = new Array(
  ["kt200lc",   "KT 200 LC",   "n","400","600", "8",  "--", "Y",  "6",  "6", "H", "0", "R", "R", "Dec 15, 2006"],
  ["kt204lc",   "KT 204 LC",   "n","400","600", "10", "--", "Y",  "7",  "7", "H", "2", "R", "R", "Dec 15, 2006"],
  ["ky14xl8lc", "KY 14xL8 LC", "n","400","600", "7",  "--", "Y",  "10", "0", "M", "6", "R", "S", "Dec 15, 2006"],
  ["tn86",      "TN 86",       "n","400","600", "7",  "Y",  "--", "4",  "4", "H", "0", "S", "R", "Dec 15, 2006"],
  ["tn86lc",    "TN 86 LC",    "n","400","600", "7",  "--", "Y",  "4",  "4", "H", "0", "S", "R", "Dec 15, 2006"],
  ["tn90",      "TN 90",       "n","400","600", "7",  "Y",  "--", "4",  "4", "H", "0", "R", "R", "Dec 15, 2006"],
  ["tn90lc",    "TN 90 LC",    "n","400","600", "7",  "--", "Y",  "4",  "4", "H", "0", "R", "R", "Dec 15, 2006"],
  ["tn97lc",    "TN 97 LC",    "n","400","600", "6",  "--", "Y",  "5",  "5", "H", "0", "R", "R", "Dec 15, 2006"]
 );
 
// 0=varkey, 1=varname, 2=locationkey, 3=picture, 4=picwidth, 5=piclength, 6=yield, 7=gradeindex, 8=value, 9=height, 10=daysflower, 11=leavesplant, 12=bsrace0, 13=bsrace1, 14=tmv, 15=granvillewilt, 16=rootknot, 17=pvy, 18=lastupdated
// NOTE: changedate value does not only include this table, but also pictures changes, description changes, etc
// NOTE: must update fluecuredchangedate in global var
var fluecuredchart = new Array(
  ["cc13",      "CC 13 *",    "us",   "y","400","600", "3050","85","4275","41","68","17.2","M","M","S","M","R","S",    "Jan 1, 2007"],
  ["cc27",      "CC 27",      "us",   "y","400","600", "3152","85","4288","41","69","17.3","VH","M","R","M","R","S",   "Jan 1, 2007"],
  ["cc400",     "CC 400 *",   "intl", "y","400","600", "3190","85","4084","40","69","17.4","L","L","R","L","R","S",    "Dec 15, 2006"],
  ["cc504",     "CC 504 *",   "intl", "y","400","600", "3050","84","3886","41","66","16.6","L","L","S","L","R","R",    "Dec 15, 2006"],
  ["cc506",     "CC 506 *",   "intl", "y","400","600", "3071","84","3899","43","65","16.7","L","L","R","L","R","R",    "Dec 15, 2006"],
  ["k149",      "K 149",      "us",   "y","400","600", "2939","86","4080","40","67","17.5","L","L","S","H","R","S",    "Dec 15, 2006"],
  ["k326",      "K 326",      "us",   "y","400","600", "3179","86","4384","40","68","17.2","L","L","S","L","R","S",    "Dec 15, 2006"],
  ["k326pvy",   "K 326PVY *", "intl", "n","400","600", "3100","86","4005","40","68","17.2","L","L","S","L","R","R",    "Dec 15, 2006"],
  ["k394",      "K 394",      "intl", "y","400","600", "3048","83","3946","39","69","16.5","H","M","S","L","S","S",    "Dec 15, 2006"],
  ["k399",      "K 399",      "intl", "n","400","600", "2743","86","3799","39","69","17.1","M","M","S","M","R","S",    "Dec 15, 2006"],
  ["mcnair944", "McNair 944", "intl", "y","400","600", "2588","83","3349","38","66","16.1","M","M","S","L","S","S",    "Dec 15, 2006"],
  ["nc291",     "NC 291",     "us",   "y","400","600", "3083","87","4316","38","68","16.5","VH","M","S","L","R","R",   "Jan 1, 2007"],
  ["nc299",     "NC 299",     "us",   "y","400","600", "3129","87","4391","39","69","16.5","VH","M","S","M","R","S",   "Jan 1, 2007"],
  ["nc810",     "NC 810",     "us",   "y","600","400", "2757","86","3805","39","72","18.0","H","H","S","VH","R","S",   "Dec 15, 2006"],
  ["rg17",      "RG 17",      "intl", "n","400","600", "2664","87","3711","39","69","17.1","L","L","S","H","R","S",    "Dec 15, 2006"],
  ["rjr35",     "RJR 35 *",   "intl", "y","400","600", "3536","86","4877","42","76","17.8","H","L","S","L","R","S",    "Jan 1, 2007"],
  ["sp168",     "SP 168",     "intl", "n","400","600", "2654","86","3681","38","68","16.2","VH","L","S","VH","R","S",  "Dec 15, 2006"],
  ["sp225",     "SP 225 *",   "us",   "y","400","600", "2645","85","3552","40","67","16.5","VH","VH","S","VH","R","S", "Dec 15, 2006"],
  ["sp227",     "SP 227 *",   "us",   "y","400","600", "2722","85","3624","40","69","16.9","H","H","S","VH","R","S",   "Dec 15, 2006"],
  ["sp234",     "SP 234 *",   "us",   "y","400","600", "2677","85","3599","39","69","15.9","H","H","S","H","R","S",    "Dec 15, 2006"]
 );

function putBurleyOverview() {

  if (varietykey == "kt200lc")
    {document.write('A recent release from the joint tobacco breeding program at the Universities of Tennessee and Kentucky with level 6 resistance to both races of black shank. It also has resistance to black root rot, wildfire, tobacco mosaic virus, and the virus complex. KT 200LC is a semi-erect, late-maturing hybrid with high yield potential. Because of its late maturity, KT 200LC should be topped early and allowed to stand 5 weeks before harvest to optimize its curing potential.' ); }
  else if (varietykey == "kt204lc")
    {document.write('A medium to late maturing variety that has level 7 resistance to both races of black shank. The growth habit of KT 204LC is semi-upright, similiar to TN90. KT 204LC produces cured leaves that are medium to heavy bodied and tan to reddish-tan in color under normal curing conditions. KT 204LC has significantly better leaf color than KT 200LC and is comparable to the other popular burley varieties.' ); }
  else if (varietykey == "ky14xl8lc")
    {document.write('Has high mosaic and wildfire resistance, medium resistance to black root rot, fusarium wilt, and high resistance to race 0 blank shank. It is susceptible to race 1 black shank. It has consistent yield and excellent color. It needs to be topped early for sucker control.' ); }
  else if (varietykey == "tn86" || varietykey == "tn86lc")
    {document.write('A large, high-yielding variety with level 4 resistance to race 0 and race 1 black shank. High resistance to black root rot, wildfire, vein mottling virus and medium resistance to tobacco etch virus. It is a late-maturing variety.' ); }
  else if (varietykey == "tn90" || varietykey == "tn90lc")
    {document.write('Has level 4 resistance to race 0 and race 1 black shank. Resistance to black root rot and wildfire, plus tobacco mosaic, vein mottling and etch viruses.  It has consistent yielding ability along with the smallest stalk of any black shank resistant variety.' ); }
  else if (varietykey == "tn97lc")
    {document.write('A high-yielding hybrid with good black shank resistance, resistance to tobacco vein mottling, tobacco etch and mosaic virus. Also has high black root rot and wildfire resistance.' ); }
  else 
    {document.write(' ' ); }
}

function putFlueCuredOverview() {

  if (varietykey == "cc27")
    {document.write('New F-1 hybrid. It has high resistance to Tobacco Mosaic Virus, Root-Knot and Cyst Nematodes, and Black Shank. Moderate resistance to Bacterial Wilt. It has high yields and a high grade index. A very good curing variety.' ); }
  else if (varietykey == "cc13")
    {document.write('Released in 2006, CC 13 is the first approved hybrid with resistance to all root knot species including <i>M. javanica</i> and <i>M. arenaria</i>.  Yield and quality are equal to K 326 yet it has more resistance to black shank and bacterial wilt.  Excellent choice for many African regions.' ); }
  else if (varietykey == "cc400")
    {document.write('Excellent curing variety with high yields.  Similar to K 326.  Resistant to TMV and root knot nematodes.  Excellent choice where K 326 is planted to ensure resistance to TMV.' ); }
  else if (varietykey == "cc504")
    {document.write('New hybrid by Cross Creek Seed.  Resistant to PVY and root knot nematodes.   Earlier maturing variety with good yields and very good quality.' ); }
  else if (varietykey == "cc506")
    {document.write('New hybrid by Cross Creek Seed.  Resistant to TMV, PVY and root knot nematodes.  Earlier maturing variety with very good cured leaf and very good quality.' ); }
  else if (varietykey == "k149")
    {document.write('Moderate resistance to Black Shank and high resistance to Granville Wilt. Is resistant to Root-Knot Nematode but susceptible to Tobacco Mosaic Virus and Potato Virus Y. It has a medium stalk size with average leaf number and has good &quot;holding ability&quot;.' ); }
  else if (varietykey == "k326")
    {document.write('Low resistance to black shank and bacterial wilt and is resistant to the common root-knot nematodes. It is known for high quality and curability. It has a moderate number of leaves on a low stalk. It is tolerant to brown spot and has excellent &quot;holding ability&quot;.' ); }
  else if (varietykey == "k326pvy")
    {document.write('New release by Cross Creek Seed.  This variety was developed by breeding in the PVY gene into K 326.  All agronomic data is similar between K 326 and K 326PVY.' ); }
  else if (varietykey == "k394")
    {document.write('Good quality tobacco with good resistance to black shank.  Has good yields but it susceptible to root knot nematodes and Granville wilt.' ); }
  else if (varietykey == "k399")
    {document.write('High resistance to black shank and bacterial wilt. It carries good resistance to root-knot nematode.' ); }
  else if (varietykey == "mcnair944")
    {document.write('Moderate resistance to black shank and low resistance to Granville wilt. Is susceptible to tobacco mosaic virus, root-knot nematodes and potato virus Y. It is an early maturing and high yielding variety.' ); }
  else if (varietykey == "nc291")
    {document.write('Hybrid developed by NC State University. It has high resistance to Black Shank, Root-Knot, and Cyst Nematodes and is resistant to Potato Virus Y and Tobacco Etch. It is a very high yielding variety that cures to an orange color. ' ); }
  else if (varietykey == "nc299")
    {document.write('New hybrid developed by NC State University. It has excellent resistance to Black Shank, Root-Knot and Cyst Nematodes. It has an extremely high yield. Leaf cures to an orange color. ' ); }
  else if (varietykey == "nc810")
    {document.write('New release from NC State University. High resistance to Black Shank and very high resistance to Bacterial Wilt. Quality and cured leaf similar to K 346. Yields are higher than K 346.' ); }
  else if (varietykey == "rg17")
    {document.write('A high-yielding, good quality variety with high resistance to bacterial wilt, resistance to races 1 and 3 of the Southern root knot nematode, and tolerance to brown spot. It has low resistance to black shank. RG 17 is fairly easy to cure with nearly 19 leaves on a medium height stalk. Leaves ripen at a moderate rate, and RG 17 has excellent holding ability.' ); }
  else if (varietykey == "rjr35")
    {document.write('New hybrid.  Huge yielding variety.  University tests have shown RJR 35 to out yield K 326 by as much as 300lbs/acre.  Excellent quality and cured leaf if managed correctly.  Resistance to Alternaria, White Mold, Wildfire, <i>M. javanica</i>, <i>M. arenaria</i> and <i>M. incognito</i>.  It flowers out late with 35-40 leaves, however it MUST be topped early around 20-23 leaves.  Very good holding variety.  It is an ideal hybrid for fast ripening areas but must be properly managed to achieve optimum potential.' ); }
  else if (varietykey == "sp168")
    {document.write('Excellent resistance to black shank and bacterial wilt. Average yields with excellent curability.' ); }
  else if (varietykey == "sp225")
    {document.write('New release from Cross Creek Seed and Speight Seed Farm. Highest resistance to Race 1 Black Shank and Granville Wilt of all released varieties. Also has same resistance to Race 0 as NC 71. Good yielding and excellent curing tobacco. Should be first choice in Race 1 field. ' ); }
  else if (varietykey == "sp227")
    {document.write('New release from Cross Creek Seed and Speight Seed Farm. Excellent resistance to Race 1 Black Shank. Very high resistance to Granville Wilt. Yield is similar to K 346. ' ); }
  else if (varietykey == "sp234")
    {document.write('New release from Cross Creek Seed and Speight Seed Farm. Good yielding variety with excellent cured leaf. High resistance to Race 0, Race 1 and Granville Wilt. Very comparable to GL 350. ' ); }
  else 
    {document.write(' ' ); }
}

function init(inituplevel,inituserloc,initvartype,initchangedate) {

  awmSelectedItem = 0;
  varietyname = "";
  varietykey = "";
  varietytypekey = initvartype;
  varietytypename = initvartype;
  userlockey = inituserloc;
  uplevel = inituplevel;
  changedate = initchangedate;  //default date, unless on variety compare or detail page, then get from chart

  var myParm = new String(document.location.search);
  if (myParm.length > 1) varietykey = myParm.substr(1);  //remove questionmark

  updir = '';
  if (uplevel == "0") updir='';
  if (uplevel == "1") updir='../';
  if (uplevel == "2") updir='../../';
  if (uplevel == "3") updir='../../../';

  if (varietytypekey == "burley")
    {
      varietytypename = "BURLEY";
      changedate = burleychangedate;
      for (i=0; i<burleychart.length; i++)
        {
        if (varietykey == burleychart[i][0])
          {
          varietyname = burleychart[i][1];
          changedate = burleychart[i][14];
          }
        }
    }
  else if (varietytypekey == "fluecured")
    {
      varietytypename = "FLUE CURED";
      changedate = fluecuredchangedate;
      for (i=0; i<fluecuredchart.length; i++)
        {
        if (varietykey == fluecuredchart[i][0])
          {
          varietyname = fluecuredchart[i][1];
          changedate = fluecuredchart[i][18];
          }
        }
    }
  else if (varietytypekey == "dark")
    {
      varietytypename = "DARK";
      for (i=0; i<darkchart.length; i++)
        {
        if (varietykey == darkchart[i][0])
          {
          varietyname = darkchart[i][1];
          }
        }
    }
}

function markNavBar() {
  var itemnum=1;
  awmSelectedItem=0;

  if (varietykey == "compare")
    {
      awmSelectedItem = 1;
    }
  else if (varietytypekey == "dark")
    {
      for (i=0; i<darkchart.length; i++)
        {
        ++itemnum;
        if (varietykey == darkchart[i][0])
          {awmSelectedItem = itemnum; return;}
        }
    }
  else if (varietytypekey == "burley")
    {
      for (i=0; i<burleychart.length; i++)
        {
        ++itemnum;
        if (varietykey == burleychart[i][0])
          {awmSelectedItem = itemnum; return;}
        }
    }
  else if (varietytypekey == "fluecured")
    {
      for (i=0; i<fluecuredchart.length; i++)
        {
        if (userlockey == fluecuredchart[i][2] || fluecuredchart[i][2] == "us")
          {
          ++itemnum;
          if (varietykey == fluecuredchart[i][0])
            {awmSelectedItem = itemnum; return;}
          }
        }
    }
}

function putVarietyDetails() {

  document.write(' ' +
      '<div class="VarHeader">' + varietytypename + ' VARIETY<br><br>' + varietyname + '</div>' +
      '<br><hr><br>' +
      '<div style="padding-left: 25px">' +
      '  <table border="0" class="VarDetails" cellspacing="0" cellpadding="0" align="left" >' +
      '    <tr>' +
      '      <td rowspan="2" height="330" width="225" valign="top" align="left">' );

  if (varietytypekey == "burley")
    {putBurleyPicture();}
  else if (varietytypekey == "fluecured")
    {putFlueCuredPicture();}

  document.write(' ' +
      '      </td>' +
      '      <td height="100" width="190" valign="top" align="left">' +
      '        <b>&nbsp;&nbsp;Characteristics</b><br><br>' +
      '        <table class="VarDetails" cellspacing="0" cellpadding="0" align="left"' );

  if (varietytypekey == "burley")
    {putBurleyTraits();}
  else if (varietytypekey == "fluecured")
    {putFlueCuredTraits();}

  document.write(' ' +
      '        </table>' +
      '      </td>' +
      '      <td height="100" width="190" valign="top" align="left">' +
      '        <b>&nbsp;&nbsp;Disease Resistance</b><br><br>' +
      '        <table class="VarDetails" cellspacing="0" cellpadding="0" align="left"' );

  if (varietytypekey == "burley")
    {putBurleyResistance();}
  else if (varietytypekey == "fluecured")
    {putFlueCuredResistance();}

  document.write(' ' +
      '        </table>' +
      '      </td>' +
      '    </tr>' +
      '    <tr>' +
      '      <td colspan="2" height="130" width="380" valign="top" align="left" style="line-height: 120%">' +
      '        ' );

  if (varietytypekey == "burley")
    {putBurleyOverview();}
  else if (varietytypekey == "fluecured")
    {putFlueCuredOverview();}

  document.write(' ' +
      '      </td>' +
      '    </tr>' +
      '  </table>' +
      '</div>'  +
      '<br clear="all"><hr>' );

  if (varietytypekey == "burley")
    {putBurleyResistanceKey();}
  else if (varietytypekey == "fluecured")
    {putFlueCuredResistanceKey();}

}

function putBurleyPicture() {

  for (i=0; i<burleychart.length; i++)
    {
    if (varietykey == burleychart[i][0])
      {
      if (burleychart[i][2] == "y")
        {
        document.write('<span class="HotLink" onClick="openPicture(' + burleychart[i][3] + ',' + burleychart[i][4] + ')"><img src="../00Pictures/' + varietykey + '_thumb.jpg" border="1"><br>' +
                       'Click picture to enlarge</span>' );
        }
      else
        {
        document.write('<div style="margin-left: 50px">' +
                       '  <table border="1" bordercolor="#932524" cellspacing="0" cellpadding="0" align="left">' +
                       '    <tr><td><img src="../00Pictures/NoPic1_thumb.jpg" border="0"></td></tr>' +
                       '    <tr><td class="VarPicName">' + varietyname + '</td></tr>' +
                       '  </table>' +
                       '</div>' );
        }
      return;
      }
    }
}

function putFlueCuredPicture() {

  for (i=0; i<fluecuredchart.length; i++)
    {
    if (varietykey == fluecuredchart[i][0])
      {
      if (fluecuredchart[i][3] == "y")
        {
        document.write('<span class="HotLink" onClick="openPicture(' + fluecuredchart[i][4] + ',' + fluecuredchart[i][5] + ')"><img src="../00Pictures/' + varietykey + '_thumb.jpg" border="1"><br>' +
                       'Click picture to enlarge</span>' );
        }
      else
        {
        document.write('<div style="margin-left: 50px">' +
                       '  <table border="1" bordercolor="#932524" cellspacing="0" cellpadding="0" align="left">' +
                       '    <tr><td><img src="../00Pictures/NoPic1_thumb.jpg" border="0"></td></tr>' +
                       '    <tr><td class="VarPicName">' + varietyname + '</td></tr>' +
                       '  </table>' +
                       '</div>' );
        }
      return;
      }
    }
}

function putBurleyTraits() {

  for (i=0; i<burleychart.length; i++)
    {
    if (varietykey == burleychart[i][0])
      {
      writeDetails("Relative Yield", burleychart[i][5]);
      writeDetails("Screened (5%)", burleychart[i][6]);
      writeDetails("Low Converter (3%)", burleychart[i][7]);
      return;
      }
    }
  writeDetails("Relative Yield", "--");
  writeDetails("Screened (5%)", "--");
  writeDetails("Low Converter (3%)", "--");
}

function putFlueCuredTraits() {

  for (i=0; i<fluecuredchart.length; i++)
    {
    if (varietykey == fluecuredchart[i][0])
      {
      writeDetails("Yield", fluecuredchart[i][6]);
      writeDetails("Grade Index", fluecuredchart[i][7]);
      writeDetails("Value ($/A)", fluecuredchart[i][8]);
      writeDetails("Height (in.)", fluecuredchart[i][9]);
      writeDetails("Days to Flower", fluecuredchart[i][10]);
      writeDetails("Leaves per Plant", fluecuredchart[i][11]);
      return;
      }
    }
  writeDetails("Yield", "--");
  writeDetails("Grade Index", "--");
  writeDetails("Value ($/A)", "--");
  writeDetails("Height (in.)", "--");
  writeDetails("Days to Flower", "--");
  writeDetails("Leaves per Plant", "--");
}

function putBurleyResistance() {

  for (i=0; i<burleychart.length; i++)
    {
    if (varietykey == burleychart[i][0])
      {
      writeDetails("Black Shank, Race 0", burleychart[i][8]);
      writeDetails("Black Shank, Race 1", burleychart[i][9]);
      writeDetails("Black Root Rot", burleychart[i][10]);
      writeDetails("Fusarium Wilt", burleychart[i][11]);
      writeDetails("Tobacco Mosaic Virus", burleychart[i][12]);
      writeDetails("Virus Complex*", burleychart[i][13]);
      return;
      }
    }
  writeDetails("Black Shank, Race 0", "--");
  writeDetails("Black Shank, Race 1", "--");
  writeDetails("Black Root Rot", "--");
  writeDetails("Fusarium Wilt", "--");
  writeDetails("Tobacco Mosaic Virus", "--");
  writeDetails("Virus Complex*", "--");
}

function putFlueCuredResistance() {

  for (i=0; i<fluecuredchart.length; i++)
    {
    if (varietykey == fluecuredchart[i][0])
      {
      writeDetails("Black Shank, Race 0", fluecuredchart[i][12]);
      writeDetails("Black Shank, Race 1", fluecuredchart[i][13]);
      writeDetails("Tobacco Mosaic Virus", fluecuredchart[i][14]);
      writeDetails("Granville Wilt", fluecuredchart[i][15]);
      writeDetails("Root Knot Nematode", fluecuredchart[i][16]);
      writeDetails("PVY", fluecuredchart[i][17]);
      return;
      }
    }
  writeDetails("Black Shank, Race 0", "--");
  writeDetails("Black Shank, Race 1", "--");
  writeDetails("Tobacco Mosaic Virus", "--");
  writeDetails("Granville Wilt", "--");
  writeDetails("Root Knot Nematode", "--");
  writeDetails("PVY", "--");
}

function putFlueCuredVarietyChart() {
    for (i=0; i<fluecuredchart.length; i++)
      {
      if (userlockey == fluecuredchart[i][2] || fluecuredchart[i][2] == "us")
        {
        document.write(' ' +
          '<tr>' +
          '   <td class="ChartCellVar" width="93">&nbsp;&nbsp;&nbsp;<a href="fluecured_details.html?' + fluecuredchart[i][0] + '" class="normalLink">' + fluecuredchart[i][1] + '</a></td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][6] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][7] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][8] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][9] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][10] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][11] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][12] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][13] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][14] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][15] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][16] + '</td>' +
          '   <td class="ChartCell" width="38">' + fluecuredchart[i][17] + '</td>' +
          ' </tr>'  );
        }
      }
}

function putBurleyVarietyChart() {
    for (i=0; i<burleychart.length; i++)
      {
      document.write(' ' +
        '<tr>' +
        '   <td class="ChartCellVar" width="93">&nbsp;&nbsp;&nbsp;<a href="burley_details.html?' + burleychart[i][0] + '" class="normalLink">' + burleychart[i][1] + '</a></td>' +
        '   <td class="ChartCell" width="38">' + burleychart[i][5] + '</td>' +
        '   <td class="ChartCell" width="38">' + burleychart[i][6] + '</td>' +
        '   <td class="ChartCell" width="38">' + burleychart[i][7] + '</td>' +
        '   <td class="ChartCell" width="38">' + burleychart[i][8] + '</td>' +
        '   <td class="ChartCell" width="38">' + burleychart[i][9] + '</td>' +
        '   <td class="ChartCell" width="38">' + burleychart[i][10] + '</td>' +
        '   <td class="ChartCell" width="38">' + burleychart[i][11] + '</td>' +
        '   <td class="ChartCell" width="38">' + burleychart[i][12] + '</td>' +
        '   <td class="ChartCell" width="38">' + burleychart[i][13] + '</td>' +
        ' </tr>'  );
      }
}

function putBurleyResistanceKey() {
   document.write(' ' +
      '<div class="ChartKey">' +
      '  * Virus Complex includes Tobacco Etch Virus(TEV), Tobacco Vein Mottling Virus(TVMV) and Potato Virus(PVY)<br><br>' +  
      '  Disease Resistance:&nbsp;&nbsp;L = Low;&nbsp;&nbsp;M = Medium;&nbsp;&nbsp;H = High;&nbsp;&nbsp;VH = Very High;&nbsp;&nbsp;R = Resistant;&nbsp;&nbsp;S = Susceptible<br><br>' +
      '</div> ');
}

function putFlueCuredResistanceKey() {
   document.write(' ' +
      '<div class="ChartKey">' +
      '  Disease Resistance:&nbsp;&nbsp;L = Low;&nbsp;&nbsp;M = Medium;&nbsp;&nbsp;H = High;&nbsp;&nbsp;VH = Very High;&nbsp;&nbsp;R = Resistant;&nbsp;&nbsp;S = Susceptible<br><br>' +
      '  TMV = Tobacco Mosaic Virus<br>PVY = Potato Virus Y<br><br>' +  
      '</div> ');
}

function writeDetails(col1, col2) {
    document.write('<tr><td>&nbsp;&nbsp;' + col1 + '&nbsp;&nbsp;</td><td>&nbsp;&nbsp;' + col2 + '&nbsp;&nbsp;</td></tr>' );
}

function putIntroHeader() {
  document.write('<table class="HeaderTable" bgcolor="#932524" width="775" border="0" cellspacing="0" cellpadding="0" align="center" >' +
                   '<tr>' + 
                     '<td align="right" valign="top" background="' + updir + 'Crosscreek.jpg" width="774" height="150" border="0">' +
                       '<font face="Arial, Helvetica, verdana, sans-serif" color="#932524" size="2">' +
                         '<br><br><br><b><i>"Farmer owned,&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Farmer oriented"&nbsp;&nbsp;</i></b>' +
                       '</font>' +
                     '</td>' +
                   '</tr>' +
                '</table>' );
}

function putHeader() {
  document.write('<table class="HeaderTable" bgcolor="#932524" width="775" border="0" cellspacing="0" cellpadding="0" align="center" >' +
                   '<tr>' + 
                     '<td align="right" valign="top" background="' + updir + 'Crosscreek.jpg" width="774" height="150" border="0">' +
                       '<a href="' + updir + 'us/index.html" class="LocUL">USA</a>&nbsp;&nbsp;&nbsp;' + 
                       '<a href="' + updir + 'intl/index.html" class="LocUL">International</a>&nbsp;&nbsp;' +
                       '<font face="Arial, Helvetica, verdana, sans-serif" color="#932524" size="2">' +
                         '<br><br><br><b><i>"Farmer owned,&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Farmer oriented"&nbsp;&nbsp;</i></b>' +
                       '</font>' +
                     '</td>' +
                   '</tr>' +
                '</table>' );
}

function putFooter() {
	thisdate = new Date();
	document.write('<br clear=all>' +
	              '<table width="775" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#dabf64"><tr><td>' +
                '<font color="#000000" size="1" face="arial,helvetica,verdana,sans-serif"><br>' +
                'Page last updated: ' + changedate + '. <a class="footer" href="' + updir + 'webreports/index.html">Administrator login</a><br>' +
               	'Copyright 2004-' + thisdate.getFullYear() + ', Cross Creek Seed, Inc. All rights reserved. ' +
                'Site maintained by <a class="footer" HREF="http://www.agrenaissance.com">AgRenaissance Software LLC.</a>' +
                '</font></td></tr></table>'	+
                '<br clear=all>' );
}

function putNavBar() {
  document.write(' ' +
         '<td height="500" valign="top" width="125">' +
         '  <div><img src="' + updir + '00Images/blank.gif" height="15" border="0"></div>' +
         '  <div id="awmAnchor-' + userlockey + '_main" style="margin-left: 5px"><img src="' + updir + '00Images/blank.gif" height="128" border="0"></div>' +
         '  <div id="awmAnchor-' + userlockey + '_varieties" style="margin-left: 5px"><img src="'  + updir + '00Images/blank.gif" height="110" border="0"></div>' +
         '  <div id="awmAnchor-' + userlockey + '_' + varietytypekey + '" style="margin-left: 5px"></div>' +
         '</td>' );
}

function openPicture(PicWidth, PicHeight) {
	thisdate = new Date();
   WinWidth = PicWidth + 35;
   WinHeight = PicHeight + 90;
   var newWin = window.open('',varietykey,'width=' + WinWidth + ',height=' + WinHeight + ',scrollbars,resizable,top=0,left=0,screenX=0,screenY=0');
   newWin.document.writeln('<HTML>');
   newWin.document.writeln('<HEAD>');
   newWin.document.writeln('<title>' + varietyname + '</title>');
   newWin.document.writeln('</head>');
   newWin.document.writeln('<body style="background-color: #ffffff; color: #000000; font-family: Arial, Helvetica, sans-serif; margin-left: 0px; margin-top: 0px;">');
   newWin.document.writeln('<div align="center"><br><b>' + varietyname + '</b><br><br>');
   newWin.document.writeln('<img src="../00Pictures/' + varietykey + '_popup.jpg">');
   newWin.document.writeln('<font size="1">');
   newWin.document.writeln('<br>Copyright 2004-' + thisdate.getFullYear() + ', Cross Creek Seed, Inc. All rights reserved.');
   newWin.document.writeln('</font></div>');
   newWin.document.writeln('</BODY>');
   newWin.document.writeln('</HTML>');
   newWin.document.close();
   newWin.focus();
}

function openPhotoWindow(pName,pImg) { 
   var newWin = window.open('','photo','resizable=no,width=320,height=500');
   newWin.document.writeln('<HTML>');
   newWin.document.writeln('<HEAD>');
   newWin.document.writeln('<title>' + pName + '</title>');
   newWin.document.writeln('</head>');
   newWin.document.writeln('<body style="background-color: #ffffff; color: #000000; font-family: Arial, Helvetica, sans-serif; margin-left: 0px; margin-top: 0px;">');
   newWin.document.writeln('<div align="center"><br><b>' + pName + '</b><br><br></div>');
   newWin.document.writeln('<div align="center"><img src="' + pImg + '"></div>');
   newWin.document.writeln('</BODY>');
   newWin.document.writeln('</HTML>');
   newWin.document.close();
   newWin.focus();
}

function initIntroSlideShow() {
   slideShowSpeed = 2500;
   crossFadeDuration = 1;
   Pic = new Array();
   Pic[0] = '00Pictures/intro_1.jpg'
   Pic[1] = '00Pictures/intro_2.jpg'
   Pic[2] = '00Pictures/intro_3.jpg'
   j = 0;
   p = Pic.length;
   preLoad = new Array();
   for (i = 0; i < p; i++) 
     {
     preLoad[i] = new Image();
     preLoad[i].src = Pic[i];
     }
}

function runSlideShow() {
   if (document.all) {
   document.images.SlideShow.style.filter="blendTrans(duration=2)";
   document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
   document.images.SlideShow.filters.blendTrans.Apply();
   }
   document.images.SlideShow.src = preLoad[j].src;
   if (document.all) {
   document.images.SlideShow.filters.blendTrans.Play();
   }
   j = j + 1;
   if (j > (p - 1)) j = 0;
   t = setTimeout('runSlideShow()', slideShowSpeed);
}

function Login(form) {
    var username = "anonymous";
    var password = "ccseed";
    var server = "ftp.crosscreekseed.com/incoming";
   alert("Open File Explorer (or My Computer) and click and drag files from your hard drive to the " +
         "FTP window (the FTP will open automatically after clicking OK). Ignore the PERMISSION DENIED error message.");
   window.open("ftp://" + username + ":" + 
     password + "@" + server, '_blank', 
     'toolbar=yes,location=yes,status=yes,' + 
     'scrollbars=auto,copyhistory=no,menubar=no,width=' +
     ((screen.AvailWidth/2)-12) + ',height='  +
     (screen.AvailHeight-124) +',left=' + ((screen.AvailWidth/2)) +
     '),top=0,resizable=yes');
}

function contactemail(pname)
{
   if (pname == "ccseed")
      {
         pemailid = "CrossCreekSeed";
         pemaildom = "aol.com";
      }
   else if (pname == "cccoating")
      {
         pemailid = "CrossCreekCoating";
         pemaildom = "msn.com";
      }
   else
      {
         pemailid = "";
         pemaildom = "";
      }
      
   pemail = pemailid + "@" + pemaildom;
   document.write('<a href="mailto:' + pemail + '" class="email">' + pemail + '</a>');
   
return;
}
