<SCRIPT LANGUAGE="Javascript">

// Send thema  alert box and then put the focus on the offending widget
function validatePrompt(widget, string) {
		
	alert(string);	
	widget.focus();
	return;
}

// Take a widget and see if we can validate it, if we can, validate it
// if not return true by default.  validate(this.form, this) is the way
// it should appear in the -onChange event handler
function validate(form, widget) {
	test = true;
	return(test);
}

function submitForm(form, widget) {
	document.form[0].submit();
}


// This is page specific code.  Anything below this point may not be
// transferable to other HTML pages.
function test_fkjob_id(form) {

	Widget = form.fkjob_id;
	if(Widget.value.length < 1) {
		validatePrompt(Widget, "You must select a Job Number");
		return(false);
	}

}

function test_total_hours(form) {

	Widget = form.total_hours;
	if (Widget.value.length < 1) {
		validatePrompt(Widget, "Total Hours must by filled in!");
		return(false);
	}
	value = eval(Widget.value);
	if(isNaN(value)) {
		validatePrompt(Widget, "Total Hours must be a number!");
		return(false);
	}
	if (value > 24 || value < .5) {
		validatePrompt(Widget, "Total Hours must be between 24 and .5 hours!");
		return(false);
	}
}

</SCRIPT>



    <TABLE>
      <TR>
	<TD COLSPAN=4>
	  $vars{'heading'}
	</TD>
      </TR>
      <TR>
	<TD COLSPAN=4>
	  <B>Select a Job Number</B><BR> $vars{'jobs'}
	</TD>
      </TR>
      <TR>
	<TD HALIGN=LEFT >
	  <B>Date:<BR></B>
	  (mm/dd/yy)
	</TD>
	<TD HALIGN=RIGHT>
	  $vars{'date_entered'}
	</TD>
	<TD HALIGN=LEFT>
	  <B>Hours:</B>
	</TD>
	<TD HALIGN=RIGHT>
	  $vars{'total_hours'}
	</TD>
      </TR>
      <TR>
	<TD HALIGN=LEFT>
	  Time In:
	</TD>
	<TD HALIGN=RIGHT>
	  $vars{'time_in'}
	</TD>
	<TD HALIGN=LEFT>
	  Time Out:
	</TD>
	<TD HALIGN=RIGHT>
	  $vars{'time_out'}
	</TD>
      </TR>
      <TR>
	<TD HALIGN=LEFT>
	  Parking/Cab:
	</TD>
	<TD HALIGN=RIGHT>
	  $vars{'parking'}
	</TD>
	<TD HALIGN=LEFT>
	</TD>
	<TD HALIGN=RIGHT>
	</TD>
      </TR>
      <TR>
	<TD HALIGN=LEFT>
	  <B>Billable Hours:</B>
	</TD>
	<TD COLSPAN=3 HALIGN=LEFT>
	  $vars{'billable'}
	</TD>
      </TR>
      <TR>
	<TD COLSPAN=4>
	  <B>Description of Hours</B><BR>
	  $vars{'hours_description'}
	</TD>
      </TR>
      <TR>
	<TD COLSPAN=4>
	  Comments<BR>
	  $vars{'comment'}
	</TD>
      </TR>
      <TR>
	<TD COLSPAN=4>
	  $vars{'submit'}
	</TD>
      </TR>
    </TABLE>
    
	
