// -----------------HACER PÁGINA PRINCIPAL-----------


<!-- PREGUNTA ANTES DE ENVIAR A URL -->
function confirmacion(pregunta,URL)
{
confirmar=confirm(pregunta);
	if (confirmar)
	{
    location.href=URL;
  	}
}
<!-- -->


<!-- NUEVA VENTANA CON ANCHO, ALTO Y SIN BARRAS NI BOTONES -->
function abrir_ventana(theURL,title,w,h)
	{
	var windowprops ="top=0,left=0,toolbar=no,location=no,status=no, menubar=no,scrollbars=no, resizable=no,width=" + w + ",height=" + h;

	window.open(theURL,title,windowprops);
	}
<!-- -->


//Funcion Favoritos---------------
function favoritos(pagina,descripcion){
if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
var url=pagina;
var titulo=descripcion;
window.external.AddFavorite(url,titulo);
}
else {
if(navigator.appName == "Netscape") 
alert ("Presione Crtl+D para añadir esta direccion a Favoritos");
}
}
//---------------------


function verif(f,m){
maximo=50///maximo de caracteres consecutivos
separador=/\s/g;
palabras=f[m].value.split(separador);
for(x=0;x<palabras.length;x++){
	if(palabras[x].length>maximo){
	alert("No puedes introducir palabras mayores a 50 caracteres");
	return false;
	}
}
return true;
}


function LimitAttach(tField) { 
file=tField.value; 
extArray = new Array(".jpg",".jpeg"); 

allowSubmit = false; 
if (!file) return; 
while (file.indexOf("\\") != -1) file = file.slice(file.indexOf("\\") + 1); 
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) { 
if (extArray[i] == ext) { 
allowSubmit = true; 
break; 
} 
} 
if (allowSubmit) { 
} else { 
tField.value=""; 
alert("El archivo que ha seleccionado no es valido. \n Usted sólo puede subir archivos con extensiones " + (extArray.join(" ")) + "\n Por favor seleccione un nuevo archivo"); 
} 
}
/*
function validaJPG(f) {
if (f.value.substr(f.value.length - 3).toUpperCase() == "JPG")
 alert("Ok")
else
{
 alert("No")
 siguiente = f.nextSibling;
 fff = f.cloneNode(true);
 fff.value = "";
 f.form.insertBefore(fff, siguiente);
f.form.removeChild(f);

}
}
*/
function comprueba_extension(formulario, archivo) { 
   extensiones_permitidas = new Array(".jpg", ".jpeg"); 
   mierror = ""; 
   if (!archivo) { 
      //Si no tengo archivo, es que no se ha seleccionado un archivo en el formulario 
       mierror = "No has seleccionado ningún archivo"; 
   }else{ 
      //recupero la extensión de este nombre de archivo 
      extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase(); 
      //alert (extension); 
      //compruebo si la extensión está entre las permitidas 
      permitida = false; 
      for (var i = 0; i < extensiones_permitidas.length; i++) { 
         if (extensiones_permitidas[i] == extension) { 
         permitida = true; 
         break; 
         } 
      } 
      if (!permitida) {
		  document.form1.reset();
         mierror = "Comprueba la extensión de los archivos a subir. \nSólo se pueden subir archivos con extensiones: " + extensiones_permitidas.join(); 
       }else{ 
         return 1; 
       } 
   } 
   //si estoy aqui es que no se ha podido submitir 
   alert (mierror); 
   return 0; 
}

function ampliar(dato)
{  
	document.getElementById('fgaleria').src=dato+"-grande.jpg"; 
	document.getElementById('galeria').style.visibility="visible"
	
}

function flip(objeto)
  		{
			
			if (objeto.value=="si"){
				document.getElementById('emoficial').style.display = 'block'
				
    		//current=(document.getElementById('emoficial').style.display == 'none') ? 'block' : 'none';
    		//document.getElementById('emoficial').style.display = current;
			
			}else{
				document.getElementById('emoficial').style.display = 'none'
				
			}
  		}
		
function flip_simple()
  		{
				
    		current=(document.getElementById('contactar').style.display == 'none') ? 'block' : 'none';
    		document.getElementById('contactar').style.display = current;
			
  		}