function MenuSalto(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 Ampliada" //texto por defecto a mostrar en la barra de título en caso de omitir el argumento titulo 

function afoto(cual,titulo) 
{ 
if(cont==1){ventana.close();ventana=null} 
if(titulo==null){titulo=titulopordefecto} 
ventana=window.open('','ventana','resizable=yes,scrollbars=no') 
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" bgcolor="#FFFFFF" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="productos/' + cual + '" onLoad="opener.redimensionar(this.width, this.height)"></body></html>') 
ventana.document.close() 
cont++ 
}
function afotob(cual,titulo) 
{ 
if(cont==1){ventana.close();ventana=null} 
if(titulo==null){titulo=titulopordefecto} 
ventana=window.open('','ventana','resizable=yes,scrollbars=no') 
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" bgcolor="#FFFFFF" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="anuncios/' + cual + '" onLoad="opener.redimensionar(this.width, this.height)"></body></html>') 
ventana.document.close() 
cont++ 
} 
function redimensionar(ancho,alto) 
{ 
ventana.resizeTo(ancho+12,alto+82) 
ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2) //centra la ventana. Eliminar si no se quiere centrar el popup 
}

// 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 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 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="<span style='font-family:Tahoma; color:#8A8A8A; font-size:8pt;'>Procesando.......</span>";
         }
         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 lugar(id,vista){
   var t1, t2, t3, contenedor;
   contenedor = document.getElementById('cargajax');
   //t1 = document.getElementById('nombreform').value;
   //t2 = document.getElementById('mailform').value;
   //t3 = document.getElementById('idform').value;


   ajax=nuevoAjax();
   ajax.open("GET", "includes/ficha.php?id="+id+"&vista="+vista,true);
   //ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   //ajax.send("id="+id+"&vista="+vista); //+"&id="+t3
   ajax.onreadystatechange=function() {
	  if (ajax.readyState==1) {
         contenedor.innerHTML="<div align='center'><img src='img/spinner.gif' /><br /><span style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:small; font-weight:bold; color:#EA5908;'>Cargando.......</span></div>";
      }
      if (ajax.readyState==4) {
         contenedor.innerHTML = ajax.responseText
      }
   }
   ajax.send(null)
}

function blanco(){
   var t1, t2, t3, contenedor;
   contenedor = document.getElementById('cargajax');
   //t1 = document.getElementById('nombreform').value;
   //t2 = document.getElementById('mailform').value;
   //t3 = document.getElementById('idform').value;


   ajax=nuevoAjax();
   ajax.open("GET", "includes/blanco.php",true);
   //ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   //ajax.send("id="+id+"&vista="+vista); //+"&id="+t3
   ajax.onreadystatechange=function() {
	  if (ajax.readyState==1) {
         contenedor.innerHTML="<div align='center'><img src='img/spinner.gif' /><br /><span style='font-family:Verdana, Arial, Helvetica, sans-serif; font-size:small; font-weight:bold; color:#EA5908;'>Cargando.......</span></div>";
      }
      if (ajax.readyState==4) {
         contenedor.innerHTML = ajax.responseText
      }
   }
   ajax.send(null)
}

function cambiaidioma(idioma){
   var t1, t2, t3, idioma, contenedor;
   contenedor = document.getElementById('modidioma');
   //t1 = document.getElementById('nombreform').value;
   //t2 = document.getElementById('mailform').value;
   //t3 = document.getElementById('idform').value;


   ajax=nuevoAjax();
   ajax.open("GET", "includes/idioma.php?idioma="+idioma,true);
   //ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
   //ajax.send("id="+id+"&vista="+vista); //+"&id="+t3
   ajax.onreadystatechange=function() {
	  if (ajax.readyState==1) {
         contenedor.innerHTML="";
      }
      if (ajax.readyState==4) {
         contenedor.innerHTML = ajax.responseText
      }
   }
   ajax.send(null)
}

function recarga(){ 
setTimeout("window.location.reload()",500) 
} 


function Validar(form){

if (document.entusu.usuario.value == "")
{ alert("Debe escribir su nombre de usuario"); document.entusu.usuario.focus(); return 0; }

if (document.entusu.pass.value == "")
{ alert("Debe escribir su contrase\xF1a"); document.entusu.pass.focus(); return 0; }

document.entusu.submit();
}

function Enviar(form){
document.fbsq.submit();
}

<!-- Principio
function emailCheck (emailStr) {
/* Verificar si el email tiene el formato user@dominio. */
var emailPat=/^(.+)@(.+)$/; 

/* Verificar la existencia de caracteres. ( ) < > @ , ; : \ " . [ ] */
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"; 

/* Verifica los caracteres que son válidos en una dirección de email */
var validChars="\[^\\s" + specialChars + "\]"; 

var quotedUser="(\"[^\"]*\")"; 

/* Verifica si la dirección de email está representada con una dirección IP Válida */ 


var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;


/* Verificar caracteres inválidos */ 

var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
/* domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");


var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
/*alert("Email address seems incorrect (check @ and .'s)");*/
return false
}
var user=matchArray[1]
var domain=matchArray[2]

// Si el user "user" es valido 
if (user.match(userPat)==null) {
// Si no
/*alert("El nombre de usuario no es válido.");*/
return false
}

/* Si la dirección IP es válida */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
/*alert("IP de destino inválida");*/
return false
}
}
return true
}

var domainArray=domain.match(domainPat)
if (domainArray==null) {
/*alert("El dominio parece no ser válido.");*/
return false
}

var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) { 

/*alert("La dicrección debe tener 3 letras si es .'com' o 2 si en de algún pais.");*/
return false
}

if (len<2) {
var errStr="La dirección es erronea"
/*alert(errStr);*/
return false
}

// La dirección de email ingresada es Válida
return true;
}
// End -->



function ValidarC(form){
var mail=emailCheck(document.contacto.email.value);
if (document.contacto.Nombre.value == "")
{ alert("Debe proporcionarnos su Nombre"); document.contacto.Nombre.focus(); return 0; }

if (mail == false)
{ alert("Debe especificar un correo de contacto"); document.contacto.email.focus(); return 0; }

if (document.contacto.Telefono.value == "")
{ alert("Debe proporcionarnos su numero de Telefono"); document.contacto.Telefono.focus(); return 0; }

if (document.contacto.Privacidad.checked == false)
{ alert("Debe aceptar la politica de privacidad"); document.contacto.Privacidad.focus(); return 0; }

document.contacto.submit();
}


function ValidarCCC(form){
var mail=emailCheck(document.contacto.email.value);

if (mail == false)
{ alert("Debe especificar el correo con el que se registro"); document.contacto.email.focus(); return 0; }

document.contacto.submit();
}