/*
Description:	Information/Validation for Checkbox Input, in the form of
						<input type="checkbox">
Author:			Tim Chan
Version:		1.0
Date:			6 May 2004
Specification:	Javascript v1.2
				Netscape 4+
				Explorer 4+
Feature:		First version.
Next Feature:   Need to sort out the checkbox group and so is the other group
*/

function FormInputCheckbox(){
  return FormInputCheckbox();
}

FormInputCheckbox.hasValue = function(obj) {
  if(Expression.isBlank(obj.value) || !obj.checked) return false;
	return true;
}
  
FormInputCheckbox.isDecimal = function(obj) {
  if(obj.checked)
    return Expression.isDecimal(obj.value);
  return true;
}
  
FormInputCheckbox.isPositive = function(obj) {
  if(obj.checked)
	return Expression.isPositive(obj.value);
  return true;
}
	
FormInputCheckbox.isInteger = function(obj) {
  if(obj.checked)
	return Expression.isInteger(obj.value);
  return true;
}

FormInputCheckbox.isEmail = function(obj) {
  if(obj.checked)
    return Expression.isEmail(obj.value);
  return true;
}
  
FormInputCheckbox.isPostcode = function(obj) {
  if(obj.checked)
    return Expression.isPostcode(obj.value);
  return true;
}

FormInputCheckbox.isExpression = function(obj, expr) {
  if(obj.checked)
    return Expression.isExpression(obj.value, expr);
  return true;
}

FormInputCheckbox.putValue = function(obj, value) {
  if(obj.value == value) obj.checked = true;
}

