function cero(obj)
{
  v = obj.value;
  if(v.substr(0,1) != '0')
  {
    v = '0'+ v;
    obj.value = v;
  }
}

function soloNum(e)
{
   var charCode;
   if (navigator.appName == "Netscape")
   {
      charCode = e.which;
   }
   else
   {
      charCode = e.keyCode;
   }
   if (charCode < 48 || charCode > 57)
   {
      if(charCode==46 || charCode==8 || charCode==9){return true;}
	  else{
	  return false;
	  }
   }
   else
   {
      return true;
   }
}

//set value of select input
function Select_Value_Set(SelectName, Value) {
  eval('SelectObject = document.form1.' + 
    SelectName + ';');
  for(index = 0; 
    index < SelectObject.length; 
    index++) {
   if(SelectObject[index].value == Value)
     SelectObject.selectedIndex = index;
   }
}

//set value of radio input
function Radio_Value_Set(RadioName, newValue) {
  eval('radioObj = document.form1.' + 
    RadioName + ';');
  if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

//set value of check box input
function CheckBox_Value_Set(CheckBoxName, newValue) {
  eval('CheckBoxObject = document.form1.' + 
    CheckBoxName + ';');
  if(!CheckBoxObject)
		return;
	var CheckBoxLength = CheckBoxObject.length;
	if(CheckBoxLength == undefined) {
		CheckBoxObject.checked = (CheckBoxObject.value == newValue.toString());
		return;
	}
	for(var i = 0; i < CheckBoxLength; i++) {
		CheckBoxObject[i].checked = false;
		if(CheckBoxObject[i].value == newValue.toString()) {
			CheckBoxObject[i].checked = true;
		}
	}
}
