var query = location.search;
var pattern = new RegExp('os=[0-9]');
var os = query.match(pattern);

if (os == null) {
  os = "os=1";
}

document.write('<table><tr>');
document.write('<td>オペレーティングシステム</td>');
document.write('<td>');
document.write('<select name="os" size="1" onChange="redrawtable(this)">');

if (os == "os=1") {
  document.write('<option value="1" selected >Windows');
  document.write('<option value="2">Linux');
  document.write('<option value="5">Mac OS X');
  document.write('<option value="4">Solaris SPARC');
  document.write('<option value="8">Solaris x86');
} else if (os == "os=2"){
  document.write('<option value="1">Windows');
  document.write('<option value="2" selected >Linux');
  document.write('<option value="5">Mac OS X');
  document.write('<option value="4">Solaris SPARC');
  document.write('<option value="8">Solaris x86');
} else if (os == "os=4"){
  document.write('<option value="1">Windows');
  document.write('<option value="2">Linux');
  document.write('<option value="5">Mac OS X');
  document.write('<option value="4" selected >Solaris SPARC');
  document.write('<option value="8">Solaris x86');
} else if (os == "os=8"){
  document.write('<option value="1">Windows');
  document.write('<option value="2">Linux');
  document.write('<option value="5">Mac OS X');
  document.write('<option value="4">Solaris SPARC');
  document.write('<option value="8" selected >Solaris x86');
} else if (os == "os=5"){
  document.write('<option value="1">Windows');
  document.write('<option value="2">Linux');
  document.write('<option value="5" selected >Mac OS X');
  document.write('<option value="4">Solaris SPARC');
  document.write('<option value="8">Solaris x86');
} else {
  document.write('<option value="0" selected> ');
  document.write('<option value="1">Windows');
  document.write('<option value="2">Linux');
  document.write('<option value="5">Mac OS X');
  document.write('<option value="4">Solaris SPARC');
  document.write('<option value="8">Solaris x86');
}

document.write('</script>');
document.write('</select>');
document.write('</td>');
document.write('<tr>');
document.write('<td>言語</td>');
document.write('<td>英語</td>');
document.write('</tr>');
document.write('</table>');

if ((os == "os=1") || (os == "os=2") ||
    (os == "os=4") || (os == "os=8") ||
    (os == "os=5")) {

  /* Table for download links */

  document.write('<p><table valign="top" border="0" cellspacing="0" cellpadding="0">');
  document.write('<tr><td class="tblheader" colspan="2"</b>インストーラー</b></td></tr>');

  /* IDE */
  document.write('<tr>');
  document.write('  <td valign="top" class="tbltd1" style="width:70%">');
  document.write('    <b>NetBeans IDE 5.5 RC 2 インストーラー (英語版)</b><br>');

  if (os == "os=1") {
    document.write('netbeans-5_5-rc2-windows.exe (44.06 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: 7436857a973ac2e48e369cdb46858c0b</span>');
  } else if (os == "os=2"){
    document.write('netbeans-5_5-rc2-linux.bin (43.82 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: d7410b18dcdf984decef5fa05b1ca350</span>');
  } else if (os == "os=4"){
    document.write('netbeans-5_5-rc2-solaris-sparc.bin (43.82 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: 13e12b5454e975332b83b72fc417b2f9</span>');
  } else if (os == "os=5"){
    document.write('netbeans-5_5-rc2-macosx.tar.gz (70 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: 19c1ead90fecc8a476364ff4b109c5be</span>');
  } else if (os == "os=8"){
    document.write('netbeans-5_5-rc2-solaris-x86.bin (43.82 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: 13e12b5454e975332b83b72fc417b2f9</span>');
  }

  document.write('  </td>');
  document.write('  <td align="middle" valign="top" class="tbltd1">');
  document.write('    <div style="float:left; text-align:center; margin:6;">');

  if (os == "os=1") {
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-5_5-rc2-windows.exe">');
  } else if (os == "os=2"){
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-5_5-rc2-linux.bin">');
  } else if (os == "os=4"){
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-5_5-rc2-solaris-sparc.bin">');
  } else if (os == "os=5"){
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-5_5-rc2-macosx.tar.gz">');
  } else if (os == "os=8"){
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-5_5-rc2-solaris-x86.bin">');
  }

  document.write('    <img src="/images/v4/btn_down_ja.gif" alt="Download from Primary site" title="Download from Primary site" width="75" height="13" border="0"></a>');
  document.write('    </div>');
  document.write('    <div style="float:left; margin:6;">');
  document.write('    <span style="font-size:11px;">');
  document.write('    <a href="http://www.netbeans.org/about/legal/product-licences.html">');
  document.write('ライセンス情報 (英語)');
  document.write('    </a>');
  document.write('    </span>');
  document.write('    </div>');
  document.write('</tr>');

  /* Profiler */
  document.write('<tr>');
  document.write('  <td valign="top" class="tbltd0" style="width:70%">');
  document.write('    <b>NetBeans Profiler 5.5 RC 2 インストーラー (英語版)</b><br>');

  if (os == "os=1") {
    document.write('netbeans-profiler-5_5-rc2-win.exe (8.14 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: 6dd58155a2f392df834ef1a077e51043</span>');
  } else if (os == "os=2"){
    document.write('netbeans-profiler-5_5-rc2-linux.bin (7.9 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: 21532b83c39133ffb3b482fc426a01eb</span>');
  } else if (os == "os=4"){
    document.write('netbeans-profiler-5_5-rc2-solsparc.bin (7.9 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: a5222a59db1abb2bceec850e18eb9c90</span>');
  } else if (os == "os=5"){
    document.write('netbeans-profiler-5_5-rc2-mac.jar (6.33 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: cb9d78471eaf962f9ce3360e02e3fd82</span>');
  } else if (os == "os=8"){
    document.write('netbeans-profiler-5_5-rc2-solx86.bin (7.9 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: a5222a59db1abb2bceec850e18eb9c90</span>');
  }

  document.write('  </td>');
  document.write('  <td align="middle" valign="top" class="tbltd0">');
  document.write('    <div style="float:left; text-align:center; margin:6;">');

  if (os == "os=1") {
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-profiler-5_5-rc2-win.exe">');
  } else if (os == "os=2"){
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-profiler-5_5-rc2-linux.bin">');
  } else if (os == "os=4"){
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-profiler-5_5-rc2-solsparc.bin">');
  } else if (os == "os=5"){
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-profiler-5_5-rc2-mac.jar">');
  } else if (os == "os=8"){
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans-profiler-5_5-rc2-solx86.bin">');
  }

  document.write('    <img src="/images/v4/btn_down_ja.gif" alt="Download from Primary site" title="Download from Primary site" width="75" height="13" border="0"></a>');
  document.write('    </div>');
  document.write('    <div style="float:left; margin:6;">');
  document.write('    <span style="font-size:11px;">');
  document.write('    <a href="http://www.netbeans.org/about/legal/product-licences.html">');
  document.write('ライセンス情報 (英語)');
  document.write('    </a>');
  document.write('    </span>');
  document.write('    </div>');
  document.write('</tr>');

  /* except Mac OS X */
  if (os != "os=5") {

  /* Mobility - Only Windows and Linux */
  if ((os == "os=1") || (os == "os=2")) {
  document.write('<tr>');
  document.write('  <td valign="top" class="tbltd1" style="width:70%">');
  document.write('    <b>NetBeans Mobility 5.5 RC 2 インストーラー (英語版)</b><br>');

  if (os == "os=1") {
    document.write('netbeans_mobility-5_5-rc2-win.exe (23.54 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: e3b150a2ce7a458ce0b19821517602fb</span>');
  } else if (os == "os=2"){
    document.write('netbeans_mobility-5_5-rc2-linux.bin (24.23 MB)<br>');
    document.write('<span class="rtext" style="margin-left:0px;">');
    document.write('MD5: af534b18ecc128f98e854718ed1ddeaa</span>');
  }

  document.write('  </td>');
  document.write('  <td align="middle" valign="top" class="tbltd1">');
  document.write('    <div style="float:left; text-align:center; margin:6;">');

  if (os == "os=1") {
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans_mobility-5_5-rc2-win.exe">');
  } else if (os == "os=2"){
    document.write('<a href="http://us1.mirror.netbeans.org/download/5_5/rc2/200610160000/netbeans_mobility-5_5-rc2-linux.bin">');
  }

  document.write('    <img src="/images/v4/btn_down_ja.gif" alt="Download from Primary site" title="Download from Primary site" width="75" height="13" border="0"></a>');
  document.write('    </div>');
  document.write('    <div style="float:left; margin:6;">');
  document.write('    <span style="font-size:11px;">');
  document.write('    <a href="http://www.netbeans.org/about/legal/product-licences.html">');
  document.write('ライセンス情報 (英語)');
  document.write('    </a>');
  document.write('    </span>');
  document.write('    </div>');
  document.write('</tr>');

  }
  /* end of Mobility */

  }
  /* end of except Mac OS X */

  document.write('</table>');

  document.write('<p>&nbsp;<br>');

  /* Release Document */

  document.write('<h2>リリースドキュメント</h2>');

  document.write('<div class="rarticle">');
  document.write('<div class="rarticletitle">');
  document.write('<a href="http://www.netbeans.org/community/releases/55/relnotes.html">');
  document.write('IDE Release Notes</a>:');
  document.write('<span style="font-weight:normal;">');
  document.write('システム要件と IDE の最新情報 (英語版)</span></div>');
  document.write('</div>');

  document.write('<div class="rarticle">');
  document.write('<div class="rarticletitle">');
  document.write('<a href="http://www.netbeans.org/community/releases/55/install.html">');
  document.write('IDE Installation Instruction</a>:');
  document.write('<span style="font-weight:normal;">');
  document.write('NetBeans IDE のインストール手順 (英語版)</span></div>');
  document.write('</div>');

  document.write('<div class="rarticle">');
  document.write('<div class="rarticletitle">');
  document.write('<a href="http://profiler.netbeans.org/download/55rc.html">');
  document.write('Profiler: More information</a>:');
  document.write('<span style="font-weight:normal;">');
  document.write('インストール手順、新機能、修正内容、ヘルプなど (英語版)</span></div>');
  document.write('</div>');

  if ((os == "os=1") || (os == "os=2")){
    document.write('<div class="rarticle">');
    document.write('<div class="rarticletitle">');
    document.write('<a href="http://www.netbeans.org/community/releases/55/relnotes-mobility.html">');
    document.write('Mobility Pack Release Notes</a>:');
    document.write('<span style="font-weight:normal;">');
    document.write('システム要件と Mobility Pack についての情報 (英語版)</span></div>');
    document.write('</div>');
  }

}

