function showRegForm()
{
    $intcount = 0;
    $resultdist = mysql_query("select * from district");
    while ($rowdist = mysql_fetch_array($resultdist)) {
        $arrDistrict[$intcount] = $rowdist['name'];
        $intcount++;
    }
    ?>
  <table>
    <tr>
      <td class="tdSpecial">
        <?php 
    displayMenuBar();
    ?>
      </td>
    </tr>
    <tr>
      <td class="tdContent1">
        <table  class="specialTbl">
          <tr>
            <td colspan="2" class="tdHeading">
              <h4>GMO Registration</h4>
            </td>
          </tr>
          <tr>
            <td colspan="2">
              <i> ( Fields marked with * are compulsary. )</i>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Name *
            </td>
            <td class="formContent">
              <input type="text" name="txtName" id="txtName"
                     maxlength="100" value="">
              <br>
              <i> ( Enter Name of the GMO. )</i><br>
              <div class="dsplyWarning" id="errName">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Designation *
            </td>
            <td class="formContent">
              <input type="text" name="txtDesignation" id="txtDesignation"
                     maxlength="100" value="">
              <br>
              <i> ( Enter designation of the GMO. )</i><br>
              <div class="dsplyWarning" id="errDesignation">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Address 1 *
            </td>
            <td class="formContent">
              <input type="text" name="txtAddress1" id="txtAddress1"
                     maxlength="50" value='' >
              <br>
              <i> ( Enter address of the GMO. )</i><br>
              <div class="dsplyWarning" id="errAddress1">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Address 2
            </td>
            <td class="formContent">
              <input type="text" name="txtAddress2" id="txtAddress2"
                     maxlength="50" value=''>
              <br>
              <div class="dsplyWarning" id="errAddress2">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Email Address
            </td>
            <td class="formContent">
              <input type="text" name="txtEmail" id="txtEmail"
                     maxlength="150" value='' >
              <br>
              <div class="dsplyWarning" id="errEmail">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Phone Number 1 *
            </td>
            <td class="formContent">
              <input type="text" name="txtPhone1" id="txtPhone1"
                     maxlength="15" value='' >
              <br>
              <i> ( Enter phone number of the GMO. )</i><br>
              <div class="dsplyWarning" id="errPhoneNumber1">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Phone Number 2
            </td>
            <td class="formContent">
              <input type="text" name="txtPhone2" id="txtPhone2"
                     maxlength="15" value=''>
              <br>
              <div class="dsplyWarning" id="errPhoneNumber2">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Mobile Number
            </td>
            <td class="formContent">
              <input type="text" name="txtMobile" id="txtMobile"
                     maxlength="15" value=''>
              <br>
              <div class="dsplyWarning" id="errMobile">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              District *
            </td>
            <td class="formContent">
              <?php 
    echo "\n\t\t\t\t\t\t\t<select name=\"District\" id=\"cmpDistrict\">";
    for ($intCount = 0; $intCount < count($arrDistrict); $intCount++) {
        if (isset($_GET['District'])) {
            if ($arrDistrict[$intCount] == $_GET['District']) {
                echo '<option selected  value="' . $arrDistrict[$intCount] . '">' . $arrDistrict[$intCount] . '</option>';
            } else {
                echo '<option value="' . $arrDistrict[$intCount] . '">' . $arrDistrict[$intCount] . '</option>';
            }
        } else {
            echo '<option value="' . $arrDistrict[$intCount] . '">' . $arrDistrict[$intCount] . '</option>';
        }
    }
    echo "</select>";
    ?>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              UserName *
            </td>
            <td class="formContent">
              <input type="text" name="txtUserName" id="txtUserName"
                     maxlength="25" value=''>
              <br>
              <i> ( Enter username of the GMO. Username must have 5-25
                characters. Only alphanumeric characters allowed.
                Starting letter should be an alphabet. )</i><br>
              <div class="dsplyWarning" id="errUserName">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Password *
            </td>
            <td class="formContent">
              <input type="password" name="txtPassword" id="txtPassword"
                     maxlength="25" value=''>
              <br>
              <i> ( Must have 5-25 characters. Starting letter should
                be	an alphabet.)</i>
              <br>
              <div class="dsplyWarning" id="errPassword">
              </div>
            </td>
          </tr>
          <tr>
            <td class="formLabel">
              Retype Password *
            </td>
            <td class="formContent">
              <input type="password" name="txtRePassword" id="txtRePassword"
                     maxlength="25" value=''>
              <br>
              <div class="dsplyWarning" id="errRePassword">
              </div>
            </td>
          </tr>
          <tr>
            <td>
              <div class="dsplyWarning" id="err">
              </div>
            </td>
            <td>
            </td>
          </tr>
          <tr>
            <td  class="formLabel">
              <br>

              <a href="#" onclick="javascript:validateGMOForm();
                    return false;">
                <img src="../images/submit01.gif" alt="Submit">

              </a>
            </td>
            <td>
              <br>
              <a href="moreinfo.php" >
                <img src="../images/backbutton01.gif" alt="Back">
              </a>
            </td>
          </tr>
          <tr>
            <td colspan='2'>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <?php 
}
function showFormContent()
{
    echo '<table  class="specialTbl">	
				<tr>
					<td class="tdSpecial">';
    displayMenuBar();
    ?>
  </td>
  </tr>
  <tr>
    <td>
      <table>
        <tr>
          <td class="tdAlign">
            <h4>
              About Kerala Health Monitor
            </h4>
            <p>This is a public service application created for free by <a href="http://www.zyxware.com" target="_blank">Zyxware Technologies</a> for Government of Kerala. The application helps to identify and track in realtime the occurence and spread of diseases, specifically the potent and the communicable ones, over the web. It uses an easy to use web based interface integrated with the display of the collected information on a navigable map. Using this software public authorities can identify trends and patterns in the spread of diseases and take timely remedial action. Additionally this system would make reporting of diseases by the hospitals to the District Medical officials much more easier, efficent and environment friendly(paper-less).
            </p> 
          </td>
        </tr>
        <tr>
          <td class="tdAlign">
            <h5>
              Employees of Hospitals
            </h5>
            <p>
              If you are an employee of the hospital and your work involves reporting of diseases to the Government Health Officials you can click on the following link to create a userid for yourself. Once your request is verified and processed you will get an approved userid which you can use to access the system.
            </p>

            <a href="hospitalregform.php" >
              Register here
            </a>
          </td>
        </tr>
        <tr>
          <td class="tdAlign">
            <h5>
              Public Health Officials
            </h5>
            <p>
              If you are a public health official working under Government of Kerala and you are involved with collection of disease reports from hospitals you may please click on the following link to create a userid for yourself. Once your request is verified and processed you will get an approved userid which you can use to access the system
            </p>

            <a href="gmoregform.php" >
              Register here
            </a>
          </td>
        </tr>
        <tr>
          <td class="tdAlign">
            <h5>
              Government Data Entry Operators
            </h5>
            <p>
              If you are a data entry operator working with the Kerala Health Monitor Project you can click on the following link to create a userid for yourself. Once your request is verified and processed you will get an approved userid which you can use to access the system.
            </p>
            <a href="deoregform.php" >
              Register here
            </a>
            <br><br>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </table>
  <?php 
}
function showInfo()
{
    $diseaseName = "";
    if (isset($_GET['strDiseaseName'])) {
        $diseaseName = $_GET['strDiseaseName'];
    }
    $intCount = 0;
    $Eresult = mysql_query("select * from disease") or die(mysql_error());
    while ($erow = mysql_fetch_array($Eresult)) {
        $content = $erow['name'];
        $arrDisease[$intCount] = $content;
        $intCount++;
    }
    ?>
  <table>
    <tr>
      <td class="tdSpecial">
        <?php 
    displayMenuBar();
    ?>
      </td>
    </tr>
    <tr>
      <td class="tdContent1">
        <form action="diseaseinfo.php"  method="POST">
          <table>
            <tr>
              <td class="tdContentDisease">
                Disease
              </td>
              <td  class="tdContentDisease">
                <select name="cmbDisease" id="cmbDisease" onchange="javascript:showDiseaseInfo(this);">
                  <?php 
    for ($intCount = 0; $intCount < count($arrDisease); $intCount++) {
        if ($arrDisease[$intCount] == $diseaseName) {
            echo '<option selected	value="' . $arrDisease[$intCount] . '">' . $arrDisease[$intCount] . '</option>';
        } else {
            echo '<option value="' . $arrDisease[$intCount] . '">' . $arrDisease[$intCount] . '</option>';
        }
    }
    ?>
                </select>
              </td>
            </tr>
          </table>
        </form>
      </td>
    </tr>
    <tr>
      <td  class="tdContentDiseaseInfo">
        <?php 
    if (isset($_GET['strDiseaseName'])) {
        $strDiseaseName = $_GET['strDiseaseName'];
        echo displayContent($strDiseaseName);
    } else {
        echo displayContent($arrDisease[0]);
    }
    ?>
      </td>
    </tr>
  </table>
  <?php 
}
function showFormContent()
{
    $intcount = 0;
    $resultdis = mysql_query("select * from disease") or die(mysql_error());
    while ($rowdis = mysql_fetch_array($resultdis)) {
        $arrDisease[$intcount] = $rowdis['name'];
        $intcount++;
    }
    if (isset($_GET['popup'])) {
        ?>
    <table>
      <tr>
        <td style="padding-top:50px;vertical-align:top;">
          <div id="map" style="width:675px; height:550px; float:left; border: 1px solid black;">
          </div><br />
        </td>
        <td style="vertical-align:top;">
          <?php 
    }
    ?>
				
        <table>
          <tr id="trMenu">
            <td class="tdSpecial">
              <?php 
    displayMenuBar();
    ?>
            </td>
          </tr>
          <tr>
            <td>
              <table class="specialTbl" >
                <tr id="trOption">
                  <td colspan="2" >
                    <p>
                      <input type="radio" name="rdoType" id="rdoType1" 
                             value="By District" checked="checked" 
                             onclick="javascript:changeContentDisease(this, '1')">	By District
                      <br><br>
                      <input type="radio" name="rdoType" id="rdoType2" 
                             value="By Disease" onclick="javascript:showDiseases('1')">
                      By Disease
                      <br><br>
                      <input type="radio" name="rdoType" id="rdoType3" 
                             value="By Age Group" onclick="javascript:showDiseases('2')">
                      By Age Group
                    <p/>
                  </td>
                </tr>
                <tr class="hideTr" id="hideTrDisease" >
                  <td class="tdmapLabel">
                    Disease
                  </td>
                  <td class="tdmapContent">
                    <select name="Disease" id="cmpDisease1" 
                            onchange="javascript:changeContentDisease(this, '2')">
                              <?php 
    for ($intCount = 0; $intCount < count($arrDisease); $intCount++) {
        if (isset($_GET['Disease'])) {
            if ($arrDisease[$intCount] == $_GET['Disease']) {
                echo '<option selected	value="' . $arrDisease[$intCount] . '">' . $arrDisease[$intCount] . '</option>';
            } else {
                echo '<option	value="' . $arrDisease[$intCount] . '">' . $arrDisease[$intCount] . '</option>';
            }
        } else {
            echo '<option	value="' . $arrDisease[$intCount] . '">' . $arrDisease[$intCount] . '</option>';
        }
    }
    ?>
                    </select>
                  </td>
                </tr>
                <tr class="hideTr" id="hideTrAgeDisease">
                  <td class="tdmapLabel">
                    Disease
                  </td>
                  <td class="tdmapContent">
                    <select name="Disease" id="cmpDisease2" 
                            onchange="javascript:changeContentDisease(this, '4')">
                              <?php 
    for ($intCount = 0; $intCount < count($arrDisease); $intCount++) {
        if (isset($_GET['Disease'])) {
            if ($arrDisease[$intCount] == $_GET['Disease']) {
                echo '<option selected	value="' . $arrDisease[$intCount] . '">' . $arrDisease[$intCount] . '</option>';
            } else {
                echo '<option	value="' . $arrDisease[$intCount] . '">' . $arrDisease[$intCount] . '</option>';
            }
        } else {
            echo '<option	value="' . $arrDisease[$intCount] . '">' . $arrDisease[$intCount] . '</option>';
        }
    }
    ?>
                    </select>
                    <br/>
                  </td>
                </tr>
                <tr  id="contentTr" > 
                  <td class="tdContent1" id="contentTd" colspan="2" >
                    <?php 
    if (isset($_GET['popup'])) {
        $strContent = displayContent($_GET['chrOption'], $_GET['chrVal']);
        echo $strContent;
    } else {
        $strContent = displayContent('Summary', 1);
        echo $strContent;
    }
    ?>
							
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
        <?php 
    if (isset($_GET['popup'])) {
        ?>
        </td>
      </tr>
    </table>
    <?php 
    }
}
function showFormContent()
{
    ?>
  <table class="specialTbl" >	
    <tr>
      <td class="tdSpecial">
        <?php 
    displayMenuBar();
    ?>
      </td>
    </tr>
    <tr>
      <td>
        <table>
          <tr>
            <td style="padding:20px;">
              Check disease to view information in the map
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <form name="frmLayer" action="POST">
      <tr>
        <td>
          <table class="specialTbl">
            <?php 
    $resultdiseases = mysql_query("select * from disease");
    while ($rowdis = mysql_fetch_array($resultdiseases)) {
        echo '<tr>
									<td style="padding-left:10px;width:30px;">
										<input type="checkbox" id="' . $rowdis['name'] . '"  value="' . $rowdis['name'] . '" onclick="javascript:selectDisease(this)">
									</td>
									<td style="text-align:left;width:30px;">
										<img  src="../images/diseases/' . $rowdis['imagename'] . '" alt="Disease">
									</td>
									<td style="text-align:left">
											' . $rowdis['name'] . '
									</td>
								</tr>';
    }
    ?>
          </table>
        </td>
      </tr>
      <tr>
        <td>
          <table>
            <tr>
              <td style="padding-left:10px;width:30px;">
                <input id="chkDistrict" name="District" value="District" type="checkbox"  onclick="javascript:toggleKml()">
              </td>
              <td style="text-align:left;width:30px;">
                <img src="../images/districticon.png" alt="District">
              </td>
              <td style="text-align:left">
                Show/Hide District Head Quarters 
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </form>
  </table>	

  <?php 
}