<!--
/*Valida los atributos de textbox numérico*/
function vNUM(source, arguments)
{	
	//Reviewed by WRG (16-JULY-2008): make a few changes on functions below, to get compatibility with new browsers	
	var ctrTxt
	var ctrST = Trim(source.ctrNUMST)
	ctrTxt = Trim( coreGetElementByName( source.ctrCore, "t" ).value)		
	var str = '' + 0.1;
	var SepDef = str.charAt(1);

	while (ctrTxt.charAt(0) == '0')
	{
		ctrTxt = ctrTxt.substring(1);
	}	

	var isReq = ( typeof(source.isRq)== "string" )
	
	if (  ctrTxt == "") 
	{
		if ( isReq  )
			arguments.IsValid = false
		else
			arguments.IsValid = true
		return;
	}

	switch (ctrST)
	{
		case "I":
		
						
						if (( isNaN(parseInt(ctrTxt))) || (parseInt(ctrTxt) != ctrTxt))
						{
							arguments.IsValid = false
							return;
						}			
						break;
		case "F":
		case "W":
		case "H":
						if (SepDef != ".")
							ctrTxt = ctrTxt.replace('.','~');
						ctrTxt = ctrTxt.replace(SepDef,'.');
						
						if (( isNaN(parseFloat(ctrTxt))) || (parseFloat(ctrTxt) != ctrTxt))
						{
							arguments.IsValid = false
							return;
						}
						break;
		case "X": //Esta seccion serviria para valores del tipo pies'pulgadas''
						var subTypeVal = Trim( coreGetElementByName( source.ctrCore, "cb" ).value)
						
						if (subTypeVal == "1")
						{												
							var prueba = /\d+'[0-11]+''/.exec(ctrTxt);
							
							if ( prueba && ((prueba.index == 0)&&(prueba[0] == ctrTxt)))
							{
								arguments.IsValid = true
								return;						
							}
							else {
									arguments.IsValid = false
									return;
								 }
						}
						else if (( isNaN(parseInt(ctrTxt))) || (parseInt(ctrTxt) != ctrTxt))
						{							
							arguments.IsValid = false
							return;
						}					
						break;
	}
}

function vGenNUMKP(evt)
{	
	alert( evt.charCode );	
	alert( evt.keyCode );	
}

function vNUMKP(field)
{

 //Modified by WRG (16-July-2008): Change browser type identifier, with the correct way to do it
//this was made to get compatibility with new browser versions
	// if (window.event != undefined) //wrong way
	if(navigator.appName == 'Microsoft Internet Explorer') //correct way: IE
 {
	var inputKey =  event.keyCode;
	var source = event.srcElement;
	var returnCode = true;
	var str = '' + 0.1;
	var SepDef = str.charAt(1);
	 
	 if (((inputKey == 46)||(inputKey == 44)||(inputKey == 48)) && ((source.value.length == 0)||(source.value.indexOf(SepDef)!=-1)))
	{
		returnCode = false;
		event.keyCode = 0;
	} else if (( inputKey > 47 && inputKey < 58) || inputKey == 13)
	{
		return;
	}
	else if (((SepDef=='.')&&(inputKey == 46))||((SepDef==',')&&(inputKey == 44)))
	{
		return;
	}
	else
	{
	returnCode = false;
	event.keyCode = 0;
	}
	event.returnValue = returnCode;
 }
 else //Mozilla
 {
		//if (isNaN(parseInt(field.value)))
			//if (field.value.length > 1)
			//	field.value = field.value.substring(0, field.value.length -1);
		//	field.value = '';
 }
}

-->