var _submit_accepted = false;

function survey_field(id,min, max, type, elements, question_text)
{
  this.id    = id;
  this.min   = min;
  this.max   = max;
  this.type  = type;
  this.elements = elements;
  this.question_text = question_text;
}

var _survey_fields = new Array ();

function _do_submit(form)
{

	if (_submit_accepted)
	return(false);
	
	chk_val = true;
	chk_val = _check_fields(form.name, fld_data, _fields);

	
	document.getElementById("submit_btn").disabled = chk_val;
	_submit_accepted = chk_val;
	
	if(chk_val)
		form.p_val_validated.value = 1;
	
	return(chk_val);
  
}

var fld_data = new field_data(
"is not an integer.",
"requires a value.",
"is not completely specified.",
"The text entered for \'%s\' exceeds its size limit of %d characters by %d characters.",
"must only contain valid ascii characters.",
"does not seem to be a valid email address.",
"Must contain valid furigana characters",
"Need to select more options.",
"Need to select fewer options.",
"Month",
"Day",
"Year",
"Hour",
"Minute",
"^(([-!#$%&\'*+/=?^~`{|}\\w]+(\\.[-!#$%&\'*+/=?^~`{|}\\w]+)*)|(\"[^\"]+\"))@[0-9A-Za-z]+(-[0-9A-Za-z]+)*(\\.[0-9A-Za-z]+(-[0-9A-Za-z]+)*)+",
0,
2010,
"must not contain either \'<\' or \'>\'",
"cannot be negative",
"Field contains too many characters.",
"Must contain a valid format character.",
"is not a valid format character.",
"Must contain a valid number.",
"is not a valid number.",
"Must contain a valid alpha-numeric.",
"is not a valid alphanumeric.",
"Must contain a valid letter.",
"is not a valid letter.",
"Must contain a valid character.",
"is not a valid character.",
"The correct format is",
"The value you have entered is less than the smallest value allowed for this field.",
"The value you have entered is greater than the largest value allowed for this field.",
"is not a valid date.",
"is not a valid date. Please enter a date in format",
"MM",
"DD",
"YYYY",
"Minimum year is:",
"Maximum year is:");