<!--
function convert_to_decimal(x_value, len)
{
	var numericExpression = /^(-)?(\d*)(\.?)(\d*)$/;
	var x_result = document.getElementById(x_value).value;	
	if ((!x_result.match(numericExpression)) || (x_result == ''))
	{
		x_result = '0';
	}
	document.getElementById(x_value).value = parseFloat(x_result).toFixed(len); // Format to decimal places
}

function requiredField(x_id)
{
	document.getElementById(x_id).style.backgroundColor = '#FAF8CC';
}

function isEmpty(elem, helperMsg){
  elem = document.getElementById(elem);
  if(elem.value.length == 0){
    alert(helperMsg);
    elem.focus(); // set the focus to this input
    return false;
  }
  return true;
}

function isNumeric(elem, helperMsg){
  elem = document.getElementById(elem);
  var numericExpression = /^[0-9]+$/;
  if(elem.value.match(numericExpression)){
    return true;
  }else{
    alert(helperMsg);
    elem.focus();
    return false;
  }
}

function isAlphabet(elem, helperMsg){
  elem = document.getElementById(elem);
  var alphaExp = /^[a-zA-Z]+$/;
  if(elem.value.match(alphaExp)){
    return true;
  }else{
    alert(helperMsg);
    elem.focus();
    return false;
  }
}

function isAlphanumeric(elem, helperMsg){
  elem = document.getElementById(elem);
  var alphaExp = /^[0-9a-zA-Z]+$/;
  if(elem.value.match(alphaExp)){
    return true;
  }else{
    alert(helperMsg);
    elem.focus();
    return false;
  }
}

function isLengthMin(elem, min){
  elem = document.getElementById(elem);
  var uInput = elem.value;
  if(uInput.length >= min){
    return true;
  }else{
    alert("Please enter at least " +min+ " characters");
    elem.focus();
    return false;
  }
}

function isLengthMax(elem, max){
  elem = document.getElementById(elem);
  var uInput = elem.value;
  if(uInput.length <= max){
    return true;
  }else{
    alert("Please enter a maximum of " +max+ " characters");
    elem.focus();
    return false;
  }
}

function isSelected(elem, helperMsg){
  elem = document.getElementById(elem);
  if(elem.value == 0){
    alert(helperMsg);
    elem.focus();
    return false;
  }else{
    return true;
  }
}

function isEmail(elem, helperMsg){
  elem = document.getElementById(elem);
  var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
  if(elem.value.match(emailExp)){
    return true;
  }else{
    alert(helperMsg);
	elem.focus();
    return false;
  }
}

function is00(elem, helperMsg){
  elem = document.getElementById(elem);
  if(elem.value == '00'){
    alert(helperMsg);
    elem.focus();
    return false;
  }else{
    return true;
  }
}

-->