//Funcion chequear los caracteres que se introducen en los campos de texto
//Se utiliza desde los ficheros: 

function CheckChar(YourChar)
	{var checkOK = 'ABCDEFGHIJKLMNÑOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyz\u00e1\u00e9\u00ed\u00f3\u00fa\u00c1\u00c9\u00cd\u00d3\u00da\u00f1\u00d1)(-@.:;_,!¡¿?\u20AC$ \u00C7/"';
 	var checkStr = YourChar;
 	var AllValid = true;
 
 	lengthTo = checkOK.length;

 	for (i = 0; i < checkStr.length; i++)
 		{ch = checkStr.charAt(i);
 	 	for (j = 0; j < lengthTo; j++)
   			if (ch == checkOK.charAt(j)){
   				break;
				
			}else if (j == lengthTo - 1){
   				if ((isNaN(ch) == false) || (ch == '_'))
    					{break;} 
   	 			else
    					{AllValid = false;
    						alert("El car\u00e1cter "+ch+" no est\u00e1 permito insertarlo. Disculpe las molestias");
    					 break;
    				}
   		}
 	}
 	return AllValid;
}

//Para llamarla:
//if(!CheckChar(cadena_a_validar)){	alert('No se permiten caracteres especiales');} else{ funcion}


//Funcion para cambiar la vista de busqueda basica o avanzada
//Se llama desde buscarbar.php

function muestracapa(id)
  {
    if(ie)
    {
      document.all['BASICA'].style.visibility="hidden";
      document.all['BUSCARPALABRA'].style.visibility="hidden";
      document.all['AVANZADA'].style.visibility="hidden";
      document.all['NOVEDADES'].style.visibility="hidden";
      document.all['globalNavBuscar'].style.visibility="hidden";
      document.all['globalNavBuscarPalabra'].style.visibility="hidden";
      document.all['globalNavBuscarAv'].style.visibility="hidden";
      document.all['globalNavBuscarMapa'].style.visibility="hidden";
      document.all['globalNavBuscarMapaAdv'].style.visibility="hidden";
			document.all['globalNavBuscarMapaPalabra'].style.visibility="hidden";
      document.all[id].style.visibility="visible";
      if(id=='BASICA'){ 
      	document.all['globalNavBuscar'].style.visibility="visible";
      	document.all['globalNavBuscarMapa'].style.visibility="visible";
      }else if(id=='BUSCARPALABRA'){
      	document.all['globalNavBuscarPalabra'].style.visibility="visible";
      	document.all['globalNavBuscarMapaPalabra'].style.visibility="visible";
      	document.all['NOVEDADES'].style.visibility="visible";
      }else{
      	document.all['globalNavBuscarAv'].style.visibility="visible";
      	document.all['globalNavBuscarMapaAdv'].style.visibility="visible";
      }
    }
    else if(nc)
    {
      document.principal.document.fondo.document.layers['BASICA'].visibility="hidde";
      document.principal.document.fondo.document.layers['AVANZADA'].visibility="hidde";
			document.principal.document.fondo.document.layers['BUSCARPALABRA'].visibility="hidde";
			document.principal.document.fondo.document.layers['NOVEDADES'].visibility="hidde";
      document.principal.document.fondo.document.layers['globalNavBuscar'].visibility="hidde";
      document.principal.document.fondo.document.layers['globalNavBuscarAv'].visibility="hidde";
      document.principal.document.fondo.document.layers['globalNavBuscarMapa'].visibility="hidde";
      document.principal.document.fondo.document.layers['globalNavBuscarMapaAdv'].visibility="hidde";
			document.principal.document.fondo.document.layers['globalNavBuscarPalabra'].visibility="hidde";
			document.principal.document.fondo.document.layers['globalNavBuscarMapaPalabra'].visibility="hidde";
      document.principal.document.fondo.document.layers[id].visibility="show";
      if(id=='BASICA'){
				document.principal.document.fondo.document.layers['globalNavBuscar'].visibility="show";
				document.principal.document.fondo.document.layers['globalNavBuscarMapa'].visibility="show";
			}else if(id=='BUSCARPALABRA'){ 
				document.principal.document.fondo.document.layers['globalNavBuscarPalabra'].visibility="show";
				document.principal.document.fondo.document.layers['globalNavBuscarMapaPalabra'].visibility="show";
				document.principal.document.fondo.document.layers['NOVEDADES'].visibility="show";
			}else{ 
				document.principal.document.fondo.document.layers['globalNavBuscarAv'].visibility="show";
				document.principal.document.fondo.document.layers['globalNavBuscarMapaAdv'].visibility="show";
			}
    }
    else if(n6)
    {
      document.getElementById('BASICA').style.visibility="hidden";
      document.getElementById('AVANZADA').style.visibility="hidden";
			document.getElementById('BUSCARPALABRA').style.visibility="hidden";
			document.getElementById('NOVEDADES').style.visibility="hidden";
      document.getElementById('globalNavBuscar').style.visibility="hidden";
      document.getElementById('globalNavBuscarAv').style.visibility="hidden";
			document.getElementById('globalNavBuscarPalabra').style.visibility="hidden";
      document.getElementById('globalNavBuscarMapa').style.visibility="hidden";
      document.getElementById('globalNavBuscarMapaAdv').style.visibility="hidden";
      document.getElementById('globalNavBuscarMapaPalabra').style.visibility="hidden";
      document.getElementById(id).style.visibility="visible";
      if(id=='BASICA'){
				document.getElementById('globalNavBuscar').style.visibility="visible";
				document.getElementById('globalNavBuscarMapa').style.visibility="visible";
			}else if(id=='BUSCARPALABRA'){ 
				document.getElementById('globalNavBuscarPalabra').style.visibility="visible";
				document.getElementById('globalNavBuscarMapaPalabra').style.visibility="visible";
				document.getElementById('NOVEDADES').style.visibility="visible";
			}else{ 
				document.getElementById('globalNavBuscarAv').style.visibility="visible";
				document.getElementById('globalNavBuscarMapaAdv').style.visibility="visible";
			}
    }
  }

//Funcion para leer datos del fichero de xml de provincias
//Se llama desde buscarbar.php

  function leerDatos(){
       if (oXML.readyState == 4) {
               var xml  = oXML.responseXML.documentElement;
               num=xml.getElementsByTagName('provincia').length;
               document.forms['seleccion'].provincia.options.length=num+1;
               ////document.forms['seleccion2'].provincia.options.length=num+1;
		//alert(xml.getElementsByTagName('provincia').length);
               for (i = 0; i < xml.getElementsByTagName('provincia').length; i++){
                       var provincia = xml.getElementsByTagName('provincia')[i];
                       var nombre = provincia.getElementsByTagName('nombre')[0].firstChild.data;
                       var codprov = provincia.getElementsByTagName('cod_prov')[0].firstChild.data;
                        document.seleccion.provincia.options[i+1].value=codprov; 
                        //document.seleccion.provincia.options[i+1].value=nombre; 
          		document.seleccion.provincia.options[i+1].text=nombre;
        		
          		////document.seleccion2.provincia.options[i+1].value=codprov;
          		//document.seleccion2.provincia.options[i+1].value=nombre;
          		////document.seleccion2.provincia.options[i+1].text=nombre;
          		
                       //alert(nombre);
               }
       }
  }

//Funcion para leer datos del fichero de xml de provincias
//Se llama desde buscarbar.php

   function leerDatosADV(){
       if (oXML.readyState == 4) {
               var xml  = oXML.responseXML.documentElement;
               num=xml.getElementsByTagName('provincia').length;
               document.forms['seleccion2'].provincia.options.length=num+1;
               for (i = 0; i < xml.getElementsByTagName('provincia').length; i++){
                       var provincia = xml.getElementsByTagName('provincia')[i];
                       var nombre = provincia.getElementsByTagName('nombre')[0].firstChild.data;
                       var codprov = provincia.getElementsByTagName('cod_prov')[0].firstChild.data;
                        document.seleccion2.provincia.options[i+1].value=codprov;
                        document.seleccion2.provincia.options[i+1].text=nombre;
                       //alert(provArray[i]);
               }
       }
  }

//Funcion para leer datos del fichero de xml de provincias
//Se llama desde buscarbar.php
    
  function leerDatos2(){
  	 //alert(document.seleccion.provincia.options[document.seleccion.provincia.selectedIndex].value+'.xml');
 	 oXML2.open('get', 'xml/'+document.seleccion.provincia.options[document.seleccion.provincia.selectedIndex].value+'.xml',true);
 	 oXML2.onreadystatechange = function(){
         if (oXML2.readyState == 4 && document.seleccion.provincia.selectedIndex!=0) {
  	       var xml  = oXML2.responseXML.documentElement;
  	       var nombreProv = document.seleccion.provincia[document.seleccion.provincia.selectedIndex].text;
  	       document.seleccion.nomprovincia.value=nombreProv;
		//alert(nombreProv);
		//alert(document.seleccion.provincia.value);
  	       //var provincia = xml.getElementsByTagName('provincia')[document.seleccion.provincia.selectedIndex-1];
  	       var provincia = xml.getElementsByTagName('provincia')[0];
  	       var nummunicipio=provincia.getElementsByTagName('municipio').length;
  	       document.forms['seleccion'].municipio.options.length=nummunicipio+1;
  	       //alert(nummunicipio);
  	       if (provincia.getElementsByTagName('municipio').length > 0){
  	             for (j = 0; j < provincia.getElementsByTagName('municipio').length; j++){
  	                  var municipio = provincia.getElementsByTagName('municipio')[j];
  	                  var nombre = municipio.getElementsByTagName('nombre')[0].firstChild.data;
  	                  var codmunicipio = municipio.getElementsByTagName('cod_municipio')[0].firstChild.data;
  	                  document.seleccion.municipio.options[j+1].value=codmunicipio; 
  	          	  	document.seleccion.municipio.options[j+1].text=nombre.toUpperCase();
  	       	     }
  	       }
  	       document.seleccion.municipio.options[0].selected = true;
  	       document.forms['seleccion'].zona.options.length=1;
  	}
	}
	oXML2.send('');
  }

//Funcion para leer datos del fichero de xml de provincias
//Se llama desde buscarbar.php

  function leerDatos2ADV(){
         //alert(document.seleccion2.provincia.options[document.seleccion2.provincia.selectedIndex].value+'.xml');
 	 oXML3.open('get', 'xml/'+document.seleccion2.provincia.options[document.seleccion2.provincia.selectedIndex].value+'.xml',true);
 	 oXML3.onreadystatechange = function(){
         if (oXML3.readyState == 4 && document.seleccion2.provincia.selectedIndex!=0) {
  	       var xml  = oXML3.responseXML.documentElement;
  	       var nombreProv = document.seleccion2.provincia[document.seleccion2.provincia.selectedIndex].text;
  	       document.seleccion2.nomprovincia.value=nombreProv;
		//alert(document.seleccion2.provincia.selectedIndex);
  	       //var provincia = xml.getElementsByTagName('provincia')[document.seleccion2.provincia.selectedIndex-1];
  	       var provincia = xml.getElementsByTagName('provincia')[0];
  	       var nummunicipio=provincia.getElementsByTagName('municipio').length;
  	       document.forms['seleccion2'].municipio.options.length=nummunicipio+1;
  	       //alert(nummunicipio);
  	       if (provincia.getElementsByTagName('municipio').length > 0){
  	             for (j = 0; j < provincia.getElementsByTagName('municipio').length; j++){
  	                  var municipio = provincia.getElementsByTagName('municipio')[j];
  	                  var codmunicipio = municipio.getElementsByTagName('cod_municipio')[0].firstChild.data;
  	                  var nombre = municipio.getElementsByTagName('nombre')[0].firstChild.data;
  	                  document.seleccion2.municipio.options[j+1].value=codmunicipio; 
  	          	  document.seleccion2.municipio.options[j+1].text=nombre.toUpperCase();
  	       	     }
  	       }
  	       document.seleccion2.municipio.options[0].selected = true;
  	       document.forms['seleccion2'].zona.options.length=1;
  	}
	}
	oXML3.send('');
  }

//Funcion para leer datos del fichero de xml de provincias
//Se llama desde buscarbar.php

  function leerDatos3(){
         if (oXML2.readyState == 4 && document.seleccion.municipio.selectedIndex!=0) {
  	       var xml  = oXML2.responseXML.documentElement;
  	       //var provincia = xml.getElementsByTagName('provincia')[document.seleccion.provincia.selectedIndex-1];
  	       var provincia = xml.getElementsByTagName('provincia')[0];
  	       var municipio = provincia.getElementsByTagName('municipio')[document.seleccion.municipio.selectedIndex-1];
  	       var nombreCiu = document.seleccion.municipio[document.seleccion.municipio.selectedIndex].text;
  	       document.seleccion.nommunicipio.value=nombreCiu;
  	       //alert(nombreCiu);
  	       //alert(document.seleccion.municipio.value);
  	       var numZonas=municipio.getElementsByTagName('zona').length;
  	       document.forms['seleccion'].zona.options.length=numZonas+1;
  	       if (municipio.getElementsByTagName('zona').length > 0){
  	             for (k = 0; k < municipio.getElementsByTagName('zona').length; k++){
  	             	  var zona = municipio.getElementsByTagName('zona')[k];
  	             	  var codzona = zona.getElementsByTagName('cod_zona')[0].firstChild.data;
  	                  var nombre = zona.getElementsByTagName('nombre')[0].firstChild.data;
  	                  document.seleccion.zona.options[k+1].value=codzona; 
  	          	  document.seleccion.zona.options[k+1].text=nombre;
  	          	  document.seleccion.nomzona.value=nombre;
  	       	     }
  	       	     if (municipio.getElementsByTagName('zona').length==1) document.seleccion.zona.options[1].selected = true;
  	       	     else document.seleccion.zona.options[0].selected = true;
  	       }
  	       //alert(document.seleccion.zona.value);
  	       //alert(document.seleccion.nomzona.value);
 	}
  }

//Funcion para leer datos del fichero de xml de provincias
//Se llama desde buscarbar.php

  function leerDatos3ADV(){
         if (oXML3.readyState == 4 && document.seleccion2.municipio.selectedIndex!=0) {
  	       var xml  = oXML3.responseXML.documentElement;
  	       var provincia = xml.getElementsByTagName('provincia')[0];
  	       var municipio = provincia.getElementsByTagName('municipio')[document.seleccion2.municipio.selectedIndex-1];
  	       var nombreCiu = document.seleccion2.municipio[document.seleccion2.municipio.selectedIndex].text;
  	       document.seleccion2.nommunicipio.value=nombreCiu;
  	       var numZonas=municipio.getElementsByTagName('zona').length;
  	       document.forms['seleccion2'].zona.options.length=numZonas+1;
  	       if (municipio.getElementsByTagName('zona').length > 0){
  	             for (k = 0; k < municipio.getElementsByTagName('zona').length; k++){
  	                  var zona = municipio.getElementsByTagName('zona')[k];
  	                  var codzona = zona.getElementsByTagName('cod_zona')[0].firstChild.data;
  	                  var nombre = zona.getElementsByTagName('nombre')[0].firstChild.data;
  	                  document.seleccion2.zona.options[k+1].value=codzona; 
  	          	  document.seleccion2.zona.options[k+1].text=nombre;
  	          	  document.seleccion2.nomzona.value=nombre;
  	       	     }
  	       	     if (municipio.getElementsByTagName('zona').length==1) document.seleccion2.zona.options[1].selected = true;
  	       	     else document.seleccion2.zona.options[0].selected = true;
  	       }
  	}
  }

//Funcion para leer datos del fichero de xml de provincias
//Se llama desde buscarbar.php

  function leerDatos4(){
  	         document.seleccion.nomzona.value=document.seleccion.zona[document.seleccion.zona.selectedIndex].text;
  }

//Funcion para leer datos del fichero de xml de provincias
//Se llama desde buscarbar.php

  function leerDatos4Adv(){
  	       document.seleccion2.nomzona.value=document.seleccion2.zona[document.seleccion2.zona.selectedIndex].text;
  }

//Funcion para leer datos del fichero de xml de provincias
//Se llama desde buscarbar.php
  
  function AJAXCrearObjeto(){
	  var obj;
	  if(window.XMLHttpRequest) { // no es IE
	  	obj = new XMLHttpRequest();
	  } else { // Es IE o no tiene el objeto
	  try {
	  	obj = new ActiveXObject("Microsoft.XMLHTTP");
	  }
	  catch (e) {
	  	alert('El navegador utilizado no est� soportado');
	  }
	  }
	  return obj;
  }

//Funcion para enviar formulario al darle al enter
//Se llama desde buscarbar.php

//Para buscar por palabra
// Se llama desde buscarbar.php

   function buscarPorPalabra(texto,pagina){
	if(!CheckChar(texto)){
		alert('No se permiten caracteres especiales');
	} else{ 
		document.BuscarPalabra.PAGINA.value=pagina;
		document.BuscarPalabra.submit();
	}
   }



//  function iSubmitEnter(oEvento, oFormulario, pagina){
  function iSubmitEnter(oEvento){
	     var iAscii;
	
	     if (oEvento.keyCode)
	         iAscii = oEvento.keyCode;
	     else if (oEvento.which)
	         iAscii = oEvento.which;
	     else
	         return false;
	
	     if (iAscii == 13){
	     	 //document.oFormulario.PAGINA.value=pagina;
	     	 //oFormulario.submit();
		 return true;
	     }else return false;
		
     		//return true;
   } 

//Funcion para guardar en variable si ha marcado la casilla de mispuntuaciones
//Se llama desde buscarbar.php

   function misPuntuaciones(checkbox){
   	if(checkbox.checked){
   		document.seleccion.MISPUNTUACIONES.value="1";
   		document.seleccion2.MISPUNTUACIONES.value="1";
   		document.BuscarPalabra.MISPUNTUACIONES.value="1";
   	}else{
   		document.seleccion.MISPUNTUACIONES.value="0";
   		document.seleccion2.MISPUNTUACIONES.value="0";
   		document.BuscarPalabra.MISPUNTUACIONES.value="0";
	}
   }

//Funcion para mover el texto del cuadro de texto de abajo
// Se llama desde index.php

function mueve_texto(){
   if (posicion < texto_estado.length) 
       posicion ++;
   else
       posicion = 1;
   string_actual = texto_estado.substring(posicion) + texto_estado.substring(0,posicion)
   window.status = string_actual
   setTimeout("mueve_texto()",100)
} 

//Funcion para chequear los campos del registro de usuario
//Usado por registrarUsuario.php


function validarRegistro(){

       if(document.Registrar.LOGIN.value==""){
               alert("El login es Obligatorio");
       }else if(document.Registrar.LOGIN.value.length< 6){
       		alert("El login tiene que tener 6 caracteres como minimo");
       }else if(document.Registrar.PASSWORD.value==""){
               alert("La password es Obligatorio");
       }else if(document.Registrar.PASSWORD.value.length< 6){
       		alert("La password tiene que tener 6 caracteres como minimo");
       }else if(document.Registrar.PASSWORD2.value==""){
               alert("Repetir la password es Obligatorio")
       }else if(document.Registrar.EMAIL.value==""){
               alert("El mail es Obligatorio");
       }else if(document.Registrar.PASSWORD.value!=document.Registrar.PASSWORD2.value){
               alert("La Password y Repita Password son diferentes");
       }else if(document.Registrar.EMAIL.value.lastIndexOf("@")==-1){
               alert("El email no es correcto");
       }else if(document.Registrar.EMAIL.value!=document.Registrar.EMAIL2.value){
               alert("Los dos email deber ser iguales");
       }else if(document.Registrar.LEGALES.checked==false){
               alert("Tiene que leer y aceptar las condiciones legales");
	 }else if(!CheckChar(document.Registrar.LOGIN.value)){
		   alert("No se permiten car�cteres especiales");
	 }else if(!CheckChar(document.Registrar.PASSWORD.value)){
		   alert("No se permiten car�cteres especiales");
	 }else if(!CheckChar(document.Registrar.EMAIL.value)){
		   alert("No se permiten car�cteres especiales");
       }else{
               document.Registrar.submit();

       }
}

//Funcion para chequear que el usuario esta logado al crear bar
//usado por Form_general.php

	function noregis(){
		alert("Tienes que estar registrado para introducir un bar");
	}
	
//Usado para a�adir a los favoritos de los navegadores
//usado por Form_general.php

function favoritos(){
  if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
    var url="http://www.taapas.es";
    var titulo="taapas";
    window.external.AddFavorite(url,titulo);
  }
  else {
    if(navigator.appName == "Netscape") 
    alert ("Presione Crtl+D para agregar este sitio en sus Favoritos");
  }
}


//Funciones de form_libro.php
//

function detectBrowser() {
var nav= new String(navigator.appName.toUpperCase());

if (nav.indexOf("MICROSOFT")!=-1){
  ie=true;
}
else if (nav.indexOf("NETSCAPE")!=-1){
  ne=true;
}
}

function InitFocus(){
  document.getElementById("comentario").focus();
}

function HayComentario(obj){
  if (document.getElementById("comentario").value.length == 0){
    alert ("No ha introducido el comentario   ");
  }
  else{
  	if(CheckChar(document.getElementById("comentario").value))document.getElementById("form").submit();
  }
}


function Validar(obj, e) {
	
if (obj.value.length>MAX_CAR) {
  obj.value=obj.value.substring(0,MAX_CAR)
  return true;
}

if (ie) tecla = e.keyCode;
else if (ne) tecla=e.which;

//alert(tecla);

if (tecla==8) {
  return true; //permite tecla de borrar
  intro=0;
}
else if ((tecla==13) || (tecla==0)){
  intro=intro+1;
}
else{
  intro=0;
}

//alert (intro);

if (intro>2){
  //alert (obj.value.length);
  if (tecla==13){
    if (ie){
      obj.value=obj.value.substring(0,obj.value.length-2);
    }
    else if (ne){
      obj.value=obj.value.substring(0,obj.value.length-1);
    }
  }
}

patron="";
te = String.fromCharCode(tecla);
//alert(patron.test(te));
return patron.test(te);
} 

//Funciones de menuUsuarios.php
//

	function iSubmitEnter2(oEvento, Formulario){
	     var iAscii;
	
	     if (oEvento.keyCode)
	         iAscii = oEvento.keyCode;
	     else if (oEvento.which)
	         iAscii = oEvento.which;
	     else
	         return false;
	
	     if (iAscii == 13) Formulario.submit();
	
	     return true;
	} 

//Funcion para manejar las capas de verBar.php
//

function muestracapaVerBar(id)
  {
    if(ie)
    {
      document.all['VERBAR1'].style.visibility="hidden";
      document.all['VERBAR2'].style.visibility="hidden";
      document.all['VERBAR3'].style.visibility="hidden";
      document.all['VERBAR4'].style.visibility="hidden";
      document.all['VERBAR25'].style.visibility="hidden";
      document.all[id].style.visibility="visible";
      
    }
    else if(nc)
    {
      document.principal.document.fondo.document.layers['VERBAR1'].visibility="hidde";
      document.principal.document.fondo.document.layers['VERBAR2'].visibility="hidde";
      document.principal.document.fondo.document.layers['VERBAR4'].visibility="hidde";
      document.principal.document.fondo.document.layers['VERBAR3'].visibility="hidde";
      document.principal.document.fondo.document.layers['VERBAR25'].visibility="hidde";
      document.principal.document.fondo.document.layers[id].visibility="show";
    }
    else if(n6)
    {
      document.getElementById('VERBAR1').style.visibility="hidden";
      document.getElementById('VERBAR2').style.visibility="hidden";
      document.getElementById('VERBAR3').style.visibility="hidden";
      document.getElementById('VERBAR4').style.visibility="hidden";
      document.getElementById('VERBAR25').style.visibility="hidden";
      document.getElementById(id).style.visibility="visible";
    }
  }
  
  
  //Funciones de modificarusuario.php
  //Cuando pincha un usuario en misdatos para ver que datos estan 
  
  
function validarModificarPassword(){
		if (document.ModificarPassword.PASSWORD_ACTUAL.value==""){
            alert("La password actual es obligatoria");
       }else if (document.ModificarPassword.NUEVO_PASSWORD.value==""){
            alert("La nueva password es obligatoria");
       }else if(!CheckChar(document.ModificarPassword.PASSWORD_ACTUAL.value)){
	   		alert('No se permiten caracteres especiales');
       }else if(!CheckChar(document.ModificarPassword.NUEVO_PASSWORD.value)){
	   		alert('No se permiten caracteres especiales');
       }else if(document.ModificarPassword.NUEVO_PASSWORD.value.length<6){
       		alert("La password tiene que tener <?php echo LONGITUD_PASSWORD ?> caracteres como minimo");
       }else if(document.ModificarPassword.NUEVA_CONFIRMACION.value==""){
            alert("Repetir la password es obligatorio")
       }else{
            document.ModificarPassword.submit();
		}
       
}

function validarModificarDatos(){
		if(!CheckChar(document.ModificarDatos.NUEVO_NOMBRE.value)){
	   		alert('No se permiten caracteres especiales');
       }else if(!CheckChar(document.ModificarDatos.NUEVOS_APELLIDOS.value)){
	   		alert('No se permiten caracteres especiales');
       }else{
               document.ModificarDatos.submit();
	   }
        
}


function validarModificarEmail(){

       if(document.ModificarEmail.NUEVO_EMAIL.value==""){
               alert("El mail es Obligatorio");
       }else if(document.ModificarEmail.NUEVO_EMAIL.value.lastIndexOf("@")==-1){
               alert("El mail no es correcto");
       }else if(!CheckChar(document.ModificarEmail.NUEVO_EMAIL.value)){
		alert('No se permiten caracteres especiales');
       }else{
               document.ModificarEmail.submit();
	   }
       
}


//funcion para la pagina de suscripciones.php. Pone o quita si seleccionas la casilla de bares
function clickBares(check){
	if(check.checked){
		 document.SUSCRIPCIONES.PROV02.checked=true;
		 document.SUSCRIPCIONES.PROV04.checked=true;
		 document.SUSCRIPCIONES.PROV05.checked=true;
		 document.SUSCRIPCIONES.PROV08.checked=true;
		 document.SUSCRIPCIONES.PROV10.checked=true;
		 document.SUSCRIPCIONES.PROV39.checked=true;
		 document.SUSCRIPCIONES.PROV51.checked=true;
		 document.SUSCRIPCIONES.PROV14.checked=true;
		 document.SUSCRIPCIONES.PROV16.checked=true;
		 document.SUSCRIPCIONES.PROV18.checked=true;
		 document.SUSCRIPCIONES.PROV20.checked=true;
		 document.SUSCRIPCIONES.PROV22.checked=true;
		 document.SUSCRIPCIONES.PROV23.checked=true;
		 document.SUSCRIPCIONES.PROV35.checked=true;
		 document.SUSCRIPCIONES.PROV25.checked=true;
		 document.SUSCRIPCIONES.PROV28.checked=true;
		 document.SUSCRIPCIONES.PROV52.checked=true;
		 document.SUSCRIPCIONES.PROV31.checked=true;
		 document.SUSCRIPCIONES.PROV34.checked=true;
		 document.SUSCRIPCIONES.PROV37.checked=true;
		 document.SUSCRIPCIONES.PROV40.checked=true;
		 document.SUSCRIPCIONES.PROV42.checked=true;
		 document.SUSCRIPCIONES.PROV44.checked=true;
		 document.SUSCRIPCIONES.PROV46.checked=true;
		 document.SUSCRIPCIONES.PROV48.checked=true;
		 document.SUSCRIPCIONES.PROV50.checked=true;		 
	}
	else{
		 document.SUSCRIPCIONES.PROV02.checked=false;
		 document.SUSCRIPCIONES.PROV04.checked=false;
		 document.SUSCRIPCIONES.PROV05.checked=false;
		 document.SUSCRIPCIONES.PROV08.checked=false;
		 document.SUSCRIPCIONES.PROV10.checked=false;
		 document.SUSCRIPCIONES.PROV39.checked=false;
		 document.SUSCRIPCIONES.PROV51.checked=false;
		 document.SUSCRIPCIONES.PROV14.checked=false;
		 document.SUSCRIPCIONES.PROV16.checked=false;
		 document.SUSCRIPCIONES.PROV18.checked=false;
		 document.SUSCRIPCIONES.PROV20.checked=false;
		 document.SUSCRIPCIONES.PROV22.checked=false;
		 document.SUSCRIPCIONES.PROV23.checked=false;
		 document.SUSCRIPCIONES.PROV35.checked=false;
		 document.SUSCRIPCIONES.PROV25.checked=false;
		 document.SUSCRIPCIONES.PROV28.checked=false;
		 document.SUSCRIPCIONES.PROV52.checked=false;
		 document.SUSCRIPCIONES.PROV31.checked=false;
		 document.SUSCRIPCIONES.PROV34.checked=false;
		 document.SUSCRIPCIONES.PROV37.checked=false;
		 document.SUSCRIPCIONES.PROV40.checked=false;
		 document.SUSCRIPCIONES.PROV42.checked=false;
		 document.SUSCRIPCIONES.PROV44.checked=false;
		 document.SUSCRIPCIONES.PROV46.checked=false;
		 document.SUSCRIPCIONES.PROV48.checked=false;
		 document.SUSCRIPCIONES.PROV50.checked=false;	
	}
	
}
//en suscripciones.php para marcar todo
function clickTodo(check){
	if(check.checked){
		 document.SUSCRIPCIONES.GENERALES.checked=true;
		 document.SUSCRIPCIONES.EVENTOS.checked=true;
		 document.SUSCRIPCIONES.OTROS.checked=true;
		 document.SUSCRIPCIONES.BARES.checked=true;
		 clickBares(document.SUSCRIPCIONES.BARES);
	}else{
		 document.SUSCRIPCIONES.GENERALES.checked=false;
		 document.SUSCRIPCIONES.EVENTOS.checked=false;
		 document.SUSCRIPCIONES.OTROS.checked=false;
		 document.SUSCRIPCIONES.BARES.checked=false;
		 clickBares(document.SUSCRIPCIONES.BARES);
	}
}