function error(objeto, tipo, mensaje){
	if(tipo=="text" || tipo=="password" || tipo=="textarea"){
		objeto.focus();
		objeto.select();
	}
	if(tipo=="select")
		objeto.focus();
	if(tipo=="radio"||tipo=="checkbox"){
		if(objeto[0])
			objeto[0].focus();
		else
			objeto.focus();
	}
alert(mensaje);
return true;
}

function revisarForma(objeto, tipo){
	if(tipo=="text" || tipo=="password" || tipo=="textarea"){
		if(objeto.value.length==0 || objeto.value=="")
			return false;
		else
			return true;
	}
	if(tipo=="select"){
		if(objeto.selectedIndex==0 || objeto.selectedIndex==-1)
			return false;
		else
			return true;
	}
	if(tipo=="radio"||tipo=="checkbox"){
		if(objeto[0]){
			for(i=0;i<objeto.length;i++){
				if(objeto[i].checked)
					return true;
			}
			return false;
		}
		else{
			if(objeto.checked)
				return true;
			else
				return false;
		}
	}
}

function longitud(valor,long){ //checa que el campo tenga al menos determinada longitud
if(valor.length<long)
	return false;
return true;
}

function numeroEntero(valor){ //checa que el número sea entero
if(valor.indexOf(".")!=-1||valor.indexOf(" ")!=-1)
	return false;
if(isNaN(valor))
	return false;
return true;
}