/********************************
FUNCION VALIDAR ENVIAR USUARIO
*********************************/
function valida_envia_user(f){
var validacion =1;
//validar nombre no esta vacio
if (document.registro_validacion.nombre.value.length==0){
	document.getElementById("aviso_nom").innerHTML="* Tiene que escribir su nombre";
	document.registro_validacion.nombre.focus();
	validacion=0;
	}
else
	{
	document.getElementById("aviso_nom").innerHTML=' ';
	}
//verificar clave es mayor a 5 caracteres
if(document.registro_validacion.password.value.length<6){
	document.registro_validacion.password.focus();//enfocar el campo
	document.registro_validacion.password.value='';
	document.registro_validacion.password_con.value='';
	document.getElementById("aviso_clave").innerHTML="* la clave tiene que contener al menos 6 caracteres";//lanzar mensaje
	validacion=0;
	}
else
	{
	//validar clave correcta
	if(document.registro_validacion.password.value != document.registro_validacion.password_con.value){
		document.registro_validacion.password.focus();//enfocar el campo
		document.registro_validacion.password.value='';
		document.registro_validacion.password_con.value='';
		document.getElementById("aviso_clave").innerHTML="* clave introducida incorrecta";//lanzar mensaje
		validacion=0;
		}
	else
		{
		document.getElementById("aviso_clave").innerHTML=' ';
		}
	}
//validar mail no esta vacio
if (document.registro_validacion.email.value==""){
       	document.registro_validacion.email.focus();
  	document.getElementById("aviso_mail").innerHTML="* Tiene que escribir su email";
       	validacion =0;
	}
else
	{
	document.getElementById("aviso_mail").innerHTML=' ';
	}
//validar mail contiene @
if(document.registro_validacion.email.value.indexOf('@')==-1){//si lo escrito no tiene arroba
	document.registro_validacion.email.focus();//enfocar el campo
	document.getElementById("aviso_mail").innerHTML="* Tiene que escribir un mail correcto";//lanzar mensaje
	validacion =0;
	}
else
	{
	document.getElementById("aviso_mail").innerHTML=' ';
	}
//validar mail contiene .
if(document.registro_validacion.email.value.indexOf('.')==-1){//si lo escrito no tiene punto
	document.registro_validacion.email.focus();//enfocar el campo
	document.getElementById("aviso_mail").innerHTML="* Tiene que escribir un mail correcto";//lanzar mensaje
	validacion=0;
	}
else
	{
	document.getElementById("aviso_mail").innerHTML=' ';
	}
//VERIFICAR QUE TODO ESTA CORRECTO
if (validacion==0){
	return false;//suspender la ejecución de la función
	}
else{
	//el formulario se envia
	//alert("Muchas gracias por enviar registrarse en mundo libertario");
	return true;
	}
} 


/********************************
FUNCION VALIDAR ENVIAR grupo
*********************************/
function valida_envia_group(f){
var validacion =1;
alert("Muchas gracias por enviar registrarse en mundo libertario");
//validar nombre no esta vacio
if (document.registro_validacion.nombre.value.length==0){
	document.getElementById("aviso_nom").innerHTML="* Tiene que escribir su nombre";
	document.registro_validacion.nombre.focus();
	validacion=0;
	}
else
	{
	document.getElementById("aviso_nom").innerHTML=' ';
	}
//validar imagen   
if (document.registro_validacion.file.value==""){
       	//document.registro_validacion.etiqueta1.focus();
  	document.getElementById("aviso_imagen").innerHTML="* Tienes que subir una imagen para el grupo";
       	validacion =0;
	}
else
	{
	document.getElementById("aviso_imagen").innerHTML=' ';
	}
//validar etiqueta   
if (document.registro_validacion.etiqueta1.value==0 && document.registro_validacion.etiqueta2.value==0){
       	//document.registro_validacion.etiqueta1.focus();
  	document.getElementById("aviso_etiqueta1").innerHTML="* Selecciona al menos una etiqueta";
       	validacion =0;
	}
else
	{
	document.getElementById("aviso_etiqueta1").innerHTML=' ';
	}
//validar pais no esta vacio
if (document.registro_validacion.menuPaises.value=="SELECCIONA PAIS"){
       	document.registro_validacion.menuPaises.focus();
  	document.getElementById("aviso_pais").innerHTML="* Selecciona un pa&iacute;s";
       	validacion =0;
	}
else
	{
	document.getElementById("aviso_pais").innerHTML=' ';
	}
//validar url no esta vacia
if (document.registro_validacion.url.value.length==0){
	document.getElementById("aviso_url").innerHTML="* Tiene que escribir su nombre";
	document.registro_validacion.nombre.focus();
	validacion=0;
	}
else
	{
	document.getElementById("aviso_url").innerHTML=' ';
	}
//VERIFICAR QUE TODO ESTA CORRECTO
if (validacion==0){
	return false;//suspender la ejecución de la función
	}
else{
	document.getElementById("cargando").style.display = 'block';
	//el formulario se envia
	//alert("Muchas gracias por enviar registrarse en mundo libertario");
	return true;
	}
} 


/********************************
FUNCION VALIDAR ENVIAR IMAGEN DE GRUPO
*********************************/
function valida_envia_imagen_edit_group(f){
var validacion=1;
//validar imagen   
if (document.registro_validacion.file.value==""){
   //document.registro_validacion.etiqueta1.focus();
   validacion =0;
	}
if (validacion==0){
	return false;//suspender la ejecución de la función
	}
else{
	document.getElementById("cargando").style.display = 'block';
	//alert("Muchas gracias por enviar registrarse en mundo libertario");
	return true;
	}
} 
function deshabilita(form){
	//alert("mundo libertario");
	//document.getElementById("email").disabled = false;
	form.email.disabled = true;
}
function habilita(form){
	//alert("mundo libertario");
	//document.getElementById("email").disabled = true;
	form.email.disabled = false;
}
