<script language="JavaScript" type="text/javascript">
<!--
function chkFormular() {
	if(document.post.title.value == "") {
		alert("You have to enter a title!");
		document.post.title.focus();
   		return false;
	}
	
	if(document.post.op1.value == "") {
		alert("You have to enter at least 2 options!");
		document.post.op1.focus();
   		return false;
	}
	
	if(document.post.op2.value == "") {
		alert("You have to enter at least 2 options!");
		document.post.op2.focus();
   		return false;
	}

  if(document.post.laufzeit_hour.value == "hh") {
		alert("You have to enter the endingtime!");
		document.post.laufzeit_hour.focus();
   		return false;
	}

  if(document.post.laufzeit_minute.value == "mm") {
		alert("You have to enter the endingtime!");
		document.post.laufzeit_minute.focus();
   		return false;
	}
  if(document.post.laufzeit_day.value == "DD") {
		alert("You have to enter the endingtime!");
		document.post.laufzeit_day.focus();
   		return false;
	}
  if(document.post.laufzeit_month.value == "MM") {
		alert("You have to enter the endingtime!");
		document.post.laufzeit_month.focus();
   		return false;
	}
  if(document.post.laufzeit_year.value == "YY") {
		alert("You have to enter the endingtime!");
		document.post.laufzeit_year.focus();
   		return false;
	}
}
-->
</script>

<form name="post" method="post" action="polls.php" onSubmit="return chkFormular()">
  <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="$border">
    <tr> 
      <td class="title" align="center" bgcolor="$bghead">edit poll</td>
    </tr>
    <tr> 
      <td bgcolor="$pagebg"></td>
    </tr>
    <tr> 
      <td bgcolor="$bg1">
	     	<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class="formtable">
          <tr>
            <td align="right" class="subhead">Title/Question:</td>
            <td><input type="text" name="title" size="50" value="$ds[titel]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></tr>

          <tr>
            <td align="right">Endingtime:</td>
            <td>
             <input type="text" name="laufzeit_hour" class="form_off" size="2" onFocus="this.className='form_on'" onBlur="this.className='form_off'" value="$ds[laufzeit_hour]"> :
             <input type="text" name="laufzeit_minute" class="form_off" size="2" onFocus="this.className='form_on'" onBlur="this.className='form_off'" value="$ds[laufzeit_minute]"> on


             <input type="text" name="laufzeit_day" class="form_off" size="2" onFocus="this.className='form_on'" onBlur="this.className='form_off'" value="$ds[laufzeit_day]">
             <input type="text" name="laufzeit_month" class="form_off" size="2" onFocus="this.className='form_on'" onBlur="this.className='form_off'" value="$ds[laufzeit_month]">
             <input type="text" name="laufzeit_year" class="form_off" size="2" onFocus="this.className='form_on'" onBlur="this.className='form_off'" value="$ds[laufzeit_year]">
            </td>
          </tr>

          <tr>
            <td align="right">Option 1:</td>
            <td><input type="text" name="op1" value="$ds[o1]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">Option 2:</td>
            <td><input type="text" name="op2" value="$ds[o2]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">Option 3:</td>
            <td><input type="text" name="op3" value="$ds[o3]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">Option 4:</td>
            <td><input type="text" name="op4" value="$ds[o4]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">Option 5:</td>
            <td><input type="text" name="op5" value="$ds[o5]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">Option 6:</td>
            <td><input type="text" name="op6" value="$ds[o6]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">Option 7:</td>
            <td><input type="text" name="op7" value="$ds[o7]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">Option 8:</td>
            <td><input type="text" name="op8" value="$ds[o8]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">Option 9:</td>
            <td><input type="text" name="op9" value="$ds[o9]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">Option 10:</td>
            <td><input type="text" name="op10" value="$ds[o10]" class="form_off" onFocus="this.className='form_on'" onBlur="this.className='form_off'"></td>
          </tr>
          <tr>
            <td align="right">votes:</td>
            <td><input class="input" type="checkbox" name="reset" value="1">
              reset votes?</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><select name="comments">$comments</select></td>
          </tr>
          <tr>
            <td align="right">votes:</td>
            <td><input class="input" type="checkbox" name="intern" value="1" $intern>
              intern?</td>
          </tr>
          <tr>
            <td><input type="hidden" name="pollID" value="$ds[pollID]"></td>
            <td><input type="submit" name="saveedit" value="update poll"></td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>


