function valida_numero()
{	if (!(((event.keyCode>=48) && (event.keyCode<=57)) || (event.keyCode==45)||(event.keyCode==46)))
		event.returnValue=false;
	else
	{	var a=document.activeElement;
		if ((trim(a.value)!="") && (event.keyCode==45))
			event.returnValue=false;
		else
			if ((event.keyCode==46) && ((trim(a.value)=="") || (a.value.indexOf(".",0)!=-1)))
				event.returnValue=false; } }
				
function trim(cadena)
{	while (cadena.substr(0,1)==" ")
		cadena=cadena.substr(1);
	while (cadena.substr(cadena.length-1,1)==" ")
		cadena=cadena.substr(0,cadena.length-1);
	while (cadena.search(/  /)!=-1)
		cadena=cadena.replace("  "," "); 
	return(cadena); }
	
function Redirect(pag)
{	
		window.location.href=pag;			
			
}

function New01(t)
{	if (t==1)
		window.location.href='r_mantenimiento.asp';			
	else
		window.location.href='r_mantenimiento.asp';				
}

//fin de funcion


//funcion para modificar 
function fBus(TheForm)
{

	TheForm.target='_self';
	TheForm.method='post';
	TheForm.action='m_serg.asp';	
	TheForm.submit();
}
//fin funcion


//funcion para Buscar 
function GoOrdena(TheForm,Indice)
{
TheForm.altcodigo.value=Indice;
	TheForm.target='_self';
	TheForm.method='post';
	TheForm.action='m_serg.asp';	
	TheForm.submit();
	
}
//fin funcion


//pais
function fChangePais(TheForm,t)
{
	TheForm.target='_self';
	TheForm.method='post';
	if (t == 0){
			TheForm.action='c_ser.asp';
	}
	else{
			TheForm.action='u_regirl.asp';
	}
	TheForm.submit();		
}



function Del01 (TheForm,t)
{  
	var i, j
	j=0;
	for (i = 0 ;i < TheForm.elements.length;  i++)  
			{
			if (TheForm.elements[i].type == "radio")  
					{
					if (TheForm.elements[i].checked)
						{
						j=j+1;
						}
					}
			}
	        
	if (j > 0)
			{
			if ( confirm("Usted va a Eliminar un Registro existente. Esta seguro?")==true )
				{		
				TheForm.target='_self';
				TheForm.method='post';
				TheForm.action='g_ser.asp?Accion=2';
				TheForm.submit();
				}
			else
				{
				
				}			
			}     
	else
			{
			alert(" Debe seleccionar el Registro a Eliminar. ");	
			}	 
			
}


function Mod01 (TheForm,t)
{  
var i, j
var idv

j=0;
for (i = 0 ;i < TheForm.elements.length;  i++)  
        {
        if (TheForm.elements[i].type == "radio")  
                {
                if (TheForm.elements[i].checked)
					{
					idv=TheForm.elements[i].value;
					j=1;
					i = TheForm.elements.length;
					}
                }
        }
        
if (j > 0)
		{
			//window.open('fu_regirl.asp','Cuerpo'); 
			TheForm.target='_self';
			TheForm.method='post';
			if (t==1)	
				TheForm.action='u_mantenimiento.asp';
			else
				TheForm.action='u_mantenimiento.asp';
			TheForm.submit();
//window.open('frmmodvar1.asp','variable');
		}     
else
		{
		alert(" Debe seleccionar el Registro a Modificar. ");	
		}	 
}
//funcion para modificar 




function fRetorna()
{

	window.location.href='m_ser.asp';
}
//fin funcion

//funcion para Buscar arturo
function GoModBusca(TheForm,Indice)
{
	TheForm.target='_self';
	TheForm.method='post';
	TheForm.action='m_serg.asp?i='+Indice;	
	
	TheForm.submit();
	
}
//fin funcion


         