function enviarlo(form){
form.submit();
}

function muestra(id) {
document.getElementById(id).style.display = "block";
document.getElementById(id).style.visibility = "visible";
}

function oculta(id) {
document.getElementById(id).style.display = "none";
document.getElementById(id).style.visibility = "hidden";

}

function show(b,id) {
document.getElementById(id).style.display = "block";
document.getElementById(id).style.visibility = "visible";
document.getElementById(b).className = "lista-bsq-on";
}

function hide(b,id) {
document.getElementById(id).style.display = "none";
document.getElementById(id).style.visibility = "hidden";
document.getElementById(b).className = "lista-bsq";

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
var ventana 
var cont=0 
var titulopordefecto = "Fotografia" //texto por defecto a mostrar en la barra de título en caso de omitir el argumento titulo 
function redimensionar(ancho,alto) 
{ 
ventana.resizeTo(ancho+12,alto+80) 
ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2) //centra la ventana. Eliminar si no se quiere centrar el popup 
}

function afotoa(cual,titulo,w,h) 
{ 
if(cont==1){ventana.close();ventana=null} 
if(titulo==null){titulo=titulopordefecto} 
ventana=window.open('','ventana','width=600,height=600,resizable=yes,scrollbars=no') 
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onLoad="opener.redimensionar('+ w +', '+ h +')" onUnload="opener.cont=0"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ w +'" height="'+ h +'"><param name="movie" value="http://www.feriadental.es/archivos/swf/' + cual + '" /><param name="quality" value="high" /><embed src="http://www.feriadental.es/archivos/swf/' + cual + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ w +'" height="'+ h +'"></embed></object></body></html>') 
ventana.document.close() 
cont++ 
} 
function afoto(cual,titulo) 
{ 
if(cont==1){ventana.close();ventana=null} 
if(titulo==null){titulo=titulopordefecto} 
ventana=window.open('','ventana','width=600,height=600,resizable=yes,scrollbars=no') 
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="../archivos/jpg/' + cual + '" onLoad="opener.redimensionar(this.width, this.height)"></body></html>') 
ventana.document.close() 
cont++ 
}
function video(cual,titulo) 
{ 
if(cont==1){ventana.close();ventana=null} 
if(titulo==null){titulo=titulopordefecto} 
ventana=window.open('','ventana','width=600,height=600,resizable=yes,scrollbars=no') 
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0" onLoad="opener.redimensionar(600, 600)"></body></html>') 
ventana.window.location="http://www.feriadental.es/includes/vervideo.php?id=" + cual + "&q=" + titulo + "";
ventana.document.close() 
cont++ 
}


// Documento JavaScript
// Esta función cargará las paginas
function llamarasincrono (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 paginaxhtml
function cargarpagina (pagina_requerida, id_contenedor)
{
if (pagina_requerida.readyState==1) {
document.getElementById (id_contenedor).innerHTML="<img src='img/spinner.gif' /><br />Cargando.......";
}
else if (pagina_requerida.readyState == 4 && (pagina_requerida.status == 200 || window.location.href.indexOf ("http") == - 1))    document.getElementById (id_contenedor).innerHTML = pagina_requerida.responseText;}


function nuevoAjax(){
   var xmlhttp=false;
   try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
   }

   if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
      xmlhttp = new XMLHttpRequest();
   }
   return xmlhttp;
}

function creaAjax(){
  var objetoAjax=false;
  try {
   /*Para navegadores distintos a internet explorer*/
   objetoAjax = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
   try {
     /*Para explorer*/
     objetoAjax = new ActiveXObject("Microsoft.XMLHTTP");
     } 
     catch (E) {
     objetoAjax = false;
   }
  }

  if (!objetoAjax && typeof XMLHttpRequest!='undefined') {
   objetoAjax = new XMLHttpRequest();
  }
  return objetoAjax;
}

function PFAjax (url,capa,valores,metodo)
{
   var ajax=creaAjax();
   var capaContenedora = document.getElementById(capa);

/*Creamos y ejecutamos la instancia si el metodo elegido es POST*/
 if(metodo.toUpperCase()=='POST'){
    ajax.open ('POST', url, true);
    ajax.onreadystatechange = function() {
         if (ajax.readyState==1) {
                 capaContenedora.innerHTML="<div align='center' style='margin:5px 0 5px 0; background-color:#efefef; padding:10px;'><img src='img/spinner.gif' /><br /><span style='font-family:Tahoma; color:#8A8A8A; font-size:8pt;'>Enviando.......</span></div>";
         }
         else if (ajax.readyState==4){
            if(ajax.status==200)
            {
                 document.getElementById(capa).innerHTML=ajax.responseText; 
            }
            else if(ajax.status==404)
                 {

                     capaContenedora.innerHTML = "La direccion existe";
                 }
             else
                 {
                     capaContenedora.innerHTML = "Error: ".ajax.status;
                 }
        }
    }
    ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    ajax.send(valores);
    return;
}
/*Creamos y ejecutamos la instancia si el metodo elegido es GET*/
if (metodo.toUpperCase()=='GET'){

    ajax.open ('GET', url, true);
    ajax.onreadystatechange = function() {
         if (ajax.readyState==1) {
                 capaContenedora.innerHTML="Procesando.......";
         }
         else if (ajax.readyState==4){
            if(ajax.status==200){ 
                 document.getElementById(capa).innerHTML=ajax.responseText; 
            }
            else if(ajax.status==404)
                 {

                     capaContenedora.innerHTML = "La direccion existe";
                 }
                 else
                 {
                     capaContenedora.innerHTML = "Error: ".ajax.status;
                 }
        }
    }
    ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    ajax.send(null);
    return
}
}
function cargarContenido(url,capa,valores){

contenedor = document.getElementById(capa);

ajax=nuevoAjax();
ajax.open("GET", url+"?"+valores,true);

ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
contenedor.innerHTML = ajax.responseText
}
}
ajax.send(null)
} 

function solicitar(){
   var t1, t2, t3, contenedor;
   contenedor = document.getElementById('solicitar');
   t1 = document.getElementById('nombreform').value;
   t2 = document.getElementById('mailform').value;
   t3 = document.getElementById('idform').value;


   ajax=nuevoAjax();
   ajax.open("POST", "modulos/solicitar.php",true);
   ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   ajax.send("nombre="+t1+"&correo="+t2+"&id="+t3);
   ajax.onreadystatechange=function() {
	  if (ajax.readyState==1) {
         contenedor.innerHTML="<img src='img/spinner.gif' /><br />Enviando.......";
      }
      if (ajax.readyState==4) {
         contenedor.innerHTML = ajax.responseText
      }
   }
}