function checknumchar(control,event,mantissa,exponent,decimalsep){
	if((event.keyCode < 48) || (event.keyCode > 57)){
		if (event.keyCode!=decimalsep.charCodeAt()){
			event.returnValue = false;
			return;
		}
	}

	if (exponent>0){
		if((control.value.indexOf(decimalsep)!=-1)&&(event.keyCode==decimalsep.charCodeAt())){
			event.returnValue = false;					
			return;
		}
	}else{
		if((event.keyCode==(decimalsep.charCodeAt()))||(control.length==mantissa)){
			event.returnValue = false;
			return;
		}
	}

	if (control.value.indexOf(decimalsep)>=0){
		var szdecimalstring =control.value.substr(control.value.indexOf(decimalsep)+1);
		if (szdecimalstring.length>=exponent){
			event.returnValue = false;
			return;
		}
	}

	if (control.value.indexOf(decimalsep)>=0){
		if(control.value.substr(0,control.value.indexOf(decimalsep)).length>mantissa)
		event.returnValue = false;
		return;
	}else{
		if((control.value.length>=(mantissa-exponent))&&(event.keyCode!=decimalsep.charCodeAt())){
			event.returnValue = false;
			return;
		}
		if(((control.value.length+1)==(mantissa-exponent))&&(event.keyCode!=decimalsep.charCodeAt())&&(exponent>0)){
			control.value=control.value+String.fromCharCode(event.keyCode) +decimalsep;
			event.returnValue = false;
			return;
		}
	}
}

