	function setheight(s,h) {
		var o = document.getElementById("x_"+s.name)
		o.style.height=h; 
		if (s.value=="Yes") { o.style.visibility='visible';} else {o.style.visibility='hidden';}
	}
 
	// calculate the ASCII code of the given character
	function CalcKeyCode(aChar) {
	  var character = aChar.substring(0,1);
	  var code = aChar.charCodeAt(0);
	  return code;
	}
	
	function checkNumber(val,extra) {
	  var strPass = val.value;
	  var strLength = strPass.length;
	  var lchar = val.value.charAt((strLength) - 1);
	  var cCode = CalcKeyCode(lchar);
	
	  /* Check if the keyed in character is a number
	     do you want alphabetic UPPERCASE only ?
	     or lower case only just check their respective
	     codes and replace the 48 and 57 	
	*/
		//document.getElementById('debug').value= extra +'|'+ strPass +'|'+ lchar +'|'+ extra.indexOf(lchar) ;
	
	  if ( (cCode < 48 || cCode > 57) && extra.indexOf(lchar)==-1 ) {
	    var myNumber = val.value.substring(0, (strLength) - 1);
	    val.value = myNumber;
	  }
	  return false;
	} 

	
	function toInt(s) {
		if (isNaN(parseInt(s))) { return 0; } else { return parseInt(s);}
	}
	
	function recalcrow(thisdate) {
		document.getElementById('tr'+thisdate).value = 
		 toInt(document.getElementById('1b'+thisdate).value)+
 		 toInt(document.getElementById('2b'+thisdate).value)+
 		 toInt(document.getElementById('su'+thisdate).value)
	}
	
	function setfocus() {
		
		if (document.getElementById('focus').value!='') {
			document.getElementById(document.getElementById('focus').value).focus();
			document.getElementById('focus').value='';
		}
	} 
