	function comprueba() {
	if (document.ficha.nombre.value=="") {
		alert ("Por favor, indique su nombre.");
		document.ficha.nombre.focus();
		return false;
	} else if (document.ficha.telefono.value=="") {
		alert ("Por favor, indique un tel&eacute;fono de contacto.");
		document.ficha.telefono.focus();
		return false;
	} else if (document.ficha.email.value=="") {
		alert ("Por favor, indique un email v&aacute;lido.");
		document.ficha.email.focus();
		return false;
	} else if (document.ficha.consulta.value=="") {
		alert ("Por favor, indique su consulta");
		document.ficha.consulta.focus();
		return false;
	}

}

var peticionMenu=0;
var peticionPagina=0;

function whenResponsePagina(){
	peticionPagina=1;
	div=document.getElementById("contenido");
	div.innerHTML = this.response;
	scripts=div.getElementsByTagName('script');
	for(i=0;i<scripts.length;i++)
		eval(scripts[i].text);
	if(peticionMenu==1){
		div=document.getElementById('cargando'); 
		div.style.visibility='hidden';
		div=document.getElementById('cuadro');
		div.style.visibility='hidden';
	}
}

function whenResponseMenu(){
	div=document.getElementById("menu");
	div.innerHTML = this.response;
	peticionMenu=1;
	if(peticionPagina==1){
		div=document.getElementById('cargando'); 
		div.style.visibility='hidden';
		div=document.getElementById('cuadro');
		div.style.visibility='hidden';
	}
}

// INICIO MENU

// Documento JavaScript
// Esta función cargará las paginas
function paginas (url, id_contenedor)
{
    var pagina_requerida = false;
    if (window.XMLHttpRequest)
    {
        // Si es Mozilla, Safari etc
        pagina_requerida = new XMLHttpRequest ();
    } else if (window.ActiveXObject)
    {
        // pero si es IE
        try 
        {
            pagina_requerida = new ActiveXObject ("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            // en caso que sea una versión antigua
            try
            {
                pagina_requerida = new ActiveXObject ("Microsoft.XMLHTTP");
            }
            catch (e)
            {
            }
        }
    } 
    else
    return false;
    pagina_requerida.onreadystatechange = function ()
    {
        // función de respuesta
        cargarpagina (pagina_requerida, id_contenedor);
    }
    pagina_requerida.open ('GET', url, true); // asignamos los métodos open y send
    pagina_requerida.send (null);
}
// todo es correcto y ha llegado el momento de poner la información requerida
// en su sitio en la pagina xhtml
function cargarpagina (pagina_requerida, id_contenedor)
{
    if (pagina_requerida.readyState == 4 && (pagina_requerida.status == 200 || window.location.href.indexOf ("http") == - 1))
    document.getElementById (id_contenedor).innerHTML = pagina_requerida.responseText;
}

//	FIN DE LA PARTE DE MENUS

function chequea(){
	//peticion
	var peticion = new sack(); //creamos peticion AJAX
	peticion.requestFile = "paginas/chequea.php"; //Archivo a pedir
	peticion.method = "POST"; //Tipo de peticion
	peticion.onCompletion = whenResponsePeticion; //Funcion a ejecutar cuando se complete
	peticion.runAJAX(); //Ejecutamos
	setTimeout(chequea,60000); //volvemos a ejecutar la funcion
}

var speed = 4;
var real = 0;
var zoom = 4;

function scaleIn()
{
  var myimg = this.getElementsByTagName('img')[0];
  this.style.zIndex = 20;
  myimg.src = myimg.smallSrc;
  var count = 0;
  var real = 0;
  intervalIn = window.setInterval(scaleStepIn, 1);
  return false;

  
function scaleStepIn(){
	var widthIn = parseInt(myimg.style['width']);
	var heightIn = parseInt(myimg.style['height']);
	var topIn = parseInt(myimg.style['top']);
	var leftIn = parseInt(myimg.style['left']);
	if(widthIn >= heightIn) {
	  widthIn += speed;
	  heightIn += Math.floor(speed * (3/4));
	  topIn -= (Math.floor(speed * (3/8)));
	  leftIn -= (speed/2);
	}
	else
	{
	  widthIn += Math.floor(speed * (3/4));
	  heightIn += speed;
	  topIn -= (speed/2);
	  leftIn -= (Math.floor(speed * (3/8)));
	}
	myimg.style['width'] = widthIn;
	myimg.style['height'] = heightIn;
	myimg.style['top'] = topIn;
	myimg.style['left'] = leftIn;
	count++;
	if (count >= zoom)
	  window.clearInterval(intervalIn);
  }			
}

function scaleOut(){
  window.clearInterval(intervalIn);
  var myimg = this.getElementsByTagName('img')[0];
  myimg.src = myimg.smallSrc;
  this.style.zIndex = 10;
  var mydiv = this;
  var interval = window.setInterval(scaleStepOut, 1);
  return false;

function scaleStepOut()
  {
	var width = parseInt(myimg.style['width']);
	var height = parseInt(myimg.style['height']);
	var top = parseInt(myimg.style['top']);
	var left = parseInt(myimg.style['left']);
	if(width >= height) {
	  width -= speed;
	  height -= Math.floor(speed * (3/4));
  	  if(width < myimg.smallWidth + 4) {
	    myimg.style['width'] = myimg.smallWidth;
	    myimg.style['height'] = myimg.smallHeight;
	    myimg.style['top'] = 0;
	    myimg.style['left'] = 0;
		mydiv.style['zIndex'] = 1;
		window.clearInterval(interval);
	  }
	  else{
	    myimg.style['width'] = width;
	    myimg.style['height'] = height;
	    myimg.style['left'] = left + (speed/2);
	    myimg.style['top'] = top + (Math.floor(speed * (3/8)));
	  }
	}
	else
	{
	  width -= Math.floor(speed * (3/4));
	  height -= speed;
	  if(real==1)
	  {
	    if(width < myimg.smallWidth + 4)
	    {
	      myimg.style['width'] = myimg.smallWidth;
	      myimg.style['height'] = myimg.smallHeight;
		  myimg.style['top'] = 0;
	      myimg.style['left'] = 0;
		  mydiv.style['zIndex'] = 1;
	      window.clearInterval(interval);
		}
		else{
		  myimg.style['width'] = width;
	      myimg.style['height'] = height;
	      myimg.style['top'] = top + (speed/2);
	      myimg.style['left'] = left + (Math.floor(speed * (3/8)));
		}
	  }
	  else
	  {
	  	if(height < myimg.smallWidth + 4)
	    {
	      myimg.style['width'] = myimg.smallHeight;
	      myimg.style['height'] = myimg.smallWidth;
		  myimg.style['top'] = 0;
	      myimg.style['left'] = 0;
		  mydiv.style['zIndex'] = 1;
	      window.clearInterval(interval);
		}
		else{
		  myimg.style['width'] = width;
	      myimg.style['height'] = height;
	      myimg.style['top'] = top + (speed/2);
	      myimg.style['left'] = left + (Math.floor(speed * (3/8)));
		}
	  }
	}	  
  }
}
