function otro(sel){

	sel.disabled=!sel.disabled;

}

function chekNum(numero) {

var contador=0, posicion, valor, nuevo_numero="";

	for ( posicion=0; posicion<numero.value.length; posicion++)
	{

		valor = numero.value.substring (posicion, posicion+1);

        if (valor != "0" && valor !="1" && valor !="2" && valor !="3" && valor !="4" && valor !="5" && valor !="6" && valor !="7" && valor !="8" && valor !="9" && valor !="." && valor !=",")
		{

        	numero.value = "";

            numero.focus ();                                

            alert("Debe ingresar un valor númerico");

            return(false);

		} else {

             if (valor=="." || valor==",") contador++;

             else {

					nuevo_numero=nuevo_numero + valor;

					contador++;

			}

        }

	}    

	numero.value=nuevo_numero;

	return(true);

}

function chekNulo(campo)
{

	if (campo.value=='')
	{

		alert("Este campo no puede estar vacio");

		campo.focus();

		return (false);

	} else {

		return(true);

	}

}

function chekPass(campo1,campo2)
{
	if (campo1.value == campo2.value)
	{
		return (true);

	}else{

		alert('Las contraseñas no coinciden');

		campo1.value='';

		campo2.value='';		

		campo1.focus();

		return(false);

	}
}

function chekCorreo(campo)
{

	if (campo.value.indexOf('@')==-1 || campo.value.indexOf('@')>= campo.value.length - 3)

	{

		alert("Ingrese una direccion de correo válida!");

		campo.focus();

		return (false);

	}else{

		return(true);

	}

}

function chekFecha(campo)
{

	if (campo.value.indexOf('-')==-1 || campo.value.indexOf('-')>= campo.value.length - 3)
	{

		alert("Ingrese una fecha válida (dd-mm-aaaa)!");

		campo.focus();

		return (false);

	}else{

		return(true);

	}

}

function chekCombo(combo)
{

	if(combo.value=="0")
	{

		alert("Debe elegir una opción valida.");

		combo.focus();

		return(false);

	} else {

		return(true);

	}

}
//esta función es para las selecciones con item Otro
// Parametros: combo ,frm (formulario que contiene la seleccion), ntxt (número de elemento en el formulario del txt)
//valor (valor del item del select correspondiente a 'OTROS')
function selOtro(combo,frm,ntxt,valor)
{
	if(frm.elements[ntxt].type=="text")
	{
		if(combo.value==valor)
		{
		frm.elements[ntxt].disabled=false;
		frm.elements[ntxt].focus();		
		}else{
			frm.elements[ntxt].value="";	
			frm.elements[ntxt].disabled=true;	
		}
	}		
}

