
  function getInput() {
    var whichselected1,whichselected2, whichselected3;
    whichselected1 = document.myform1.cc.selectedIndex;
    whichselected2 = document.myform1.mon.selectedIndex;
    whichselected3 = document.myform1.year.selectedIndex;

//    if (whichselected1 == "")
//      alert("Please enter in a Commodity");
      document.myform1.sym.value = document.myform1.cc.options[whichselected1].value + document.myform1.mon.options[whichselected2].value + document.myform1.year.options[whichselected3].value;
  }

  function validate(f) {
    if(f.sym.value == '') {
      alert('Please select the symbol with correct month and year before you try to download data.');
      return false;
    }
  }

document.write('<table border="0" width="100%">\n\n');
document.write('  <tr>\n\n');
document.write('    <td width="100%"><p>\n\n');
document.write('      <FONT FACE="Arial, Helvetica" SIZE="+2" COLOR="35346D"><B>MGEX </B></FONT>\n\n');
document.write('      <b>\n\n');
document.write('      <font face="Arial, Helvetica" size="+2" color="#35346D">\n\n');
document.write('      Historical Data Download</font></b><P>\n\n');
document.write('  <FORM ACTION="http://customer1.barchart.com/cgi-bin/mri/mgexdata.csv" METHOD="GET" NAME="myform1" onSubmit="return validate(this)" target="_new">\n\n');
document.write('  <table width=500>\n\n');
document.write('    <tr>\n\n');
document.write('      <td width="100%">\n\n');
document.write('        <FONT FACE="Arial, Helvetica">Enter Symbol: <INPUT SIZE="6" MAXLENGTH="5" name="sym" TYPE="text" VALUE="">&nbsp;&nbsp;<INPUT TYPE="SUBMIT" VALUE="Download Data" style="font-family: Arial, MS Sans Serif, sans-serif; font-size: 11px;"></TD>\n\n');
document.write('          <input type="hidden" name="ivol" value="Y"></tr><tr><TD>\n\n');
document.write('          <SELECT NAME="cc" onChange="getInput()">\n\n');
document.write('            <OPTION VALUE="MW">MW - Spring Wheat, Hard Red</OPTION>\n\n');
document.write('            <OPTION VALUE="ME">ME - Spring Wheat, Hard Red (E)</OPTION>\n\n');
document.write('            <OPTION VALUE="IH">IH - HRWI Hard Red Wheat</OPTION>\n\n');
document.write('            <OPTION VALUE="IC">IC - NCI National Corn</OPTION>\n\n');
document.write('            <OPTION VALUE="IS">IS - NSI National Soybean</OPTION>\n\n');
document.write('            <OPTION VALUE="IP">IP - HRSI Hard Red Spring</OPTION>\n\n');
document.write('            <OPTION VALUE="IW">IW - SRWI Soft Red Wheat</OPTION>\n\n');
document.write('          </SELECT>&nbsp;\n\n');
document.write('          <SELECT NAME="mon" onChange="getInput()">\n\n');
document.write('            <OPTION value="">Month\n\n');
document.write('            <OPTION value="F">F - Jan\n\n');
document.write('            <OPTION value="G">G - Feb\n\n');
document.write('            <OPTION value="H">H - Mar\n\n');
document.write('            <OPTION value="J">J - Apr\n\n');
document.write('            <OPTION value="K">K - May\n\n');
document.write('            <OPTION value="M">M - Jun\n\n');
document.write('            <OPTION value="N">N - Jul\n\n');
document.write('            <OPTION value="Q">Q - Aug\n\n');
document.write('            <OPTION value="U">U - Sep\n\n');
document.write('            <OPTION value="V">V - Oct\n\n');
document.write('            <OPTION value="X">X - Nov\n\n');
document.write('            <OPTION value="Z">Z - Dec\n\n');
document.write('          </SELECT>\n\n');
document.write('&nbsp;/&nbsp;<SELECT name="year" onChange="getInput()">\n\n');
document.write('               <OPTION VALUE ="">Year\n\n');
document.write('               <option value ="11">11 - 2011\n\n');
document.write('               <option value ="10">10 - 2010\n\n');
document.write('               <option value ="09" selected">09 - 2009\n\n');
document.write('               <option value ="08">08 - 2008\n\n');
document.write('               <option value ="07">07 - 2007\n\n');
document.write('               <option value ="06">06 - 2006\n\n');
document.write('               <OPTION VALUE ="05">05 - 2005\n\n');
document.write('               <OPTION VALUE ="04">04 - 2004\n\n');
document.write('               <OPTION VALUE ="03">03 - 2003\n\n');
document.write('               <OPTION VALUE ="02">02 - 2002\n\n');
document.write('               <OPTION VALUE ="01">01 - 2001\n\n');
document.write('               <OPTION VALUE ="00">00 - 2000\n\n');
document.write('               <OPTION VALUE ="99">99 - 1999\n\n');
document.write('               <OPTION VALUE ="98">98 - 1998\n\n');
document.write('               <OPTION VALUE ="97">97 - 1997\n\n');
document.write('               <OPTION VALUE ="96">96 - 1996\n\n');
document.write('               <OPTION VALUE ="95">95 - 1995\n\n');
document.write('               <OPTION VALUE ="94">94 - 1994\n\n');
document.write('               <OPTION VALUE ="93">93 - 1993\n\n');
document.write('               <OPTION VALUE ="92">92 - 1992\n\n');
document.write('               <OPTION VALUE ="91">91 - 1991\n\n');
document.write('               <OPTION VALUE ="90">90 - 1990\n\n');
document.write('               <OPTION VALUE ="89">89 - 1989\n\n');
document.write('             </SELECT>\n\n');
document.write('             <input type="hidden" name="data" value="d.csv"></TD>\n\n');
document.write('           </TR></TABLE>\n\n');
document.write('         </form>\n\n');
document.write('       </td>\n\n');
document.write('   </tr>\n\n');
document.write('</table>\n\n');
