//########### DETECCIÓN DEL NAVEGADOR
IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);

if (navigator.appName == "Netscape") {
        layerRef="document.layers";
        styleSwitch="";
    } else {
        layerRef="document.all";
        styleSwitch=".style";
    }

function showLayer(layerName) {
        eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
}
        
function hideLayer(layerName) {
        eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}

ns=0;
layerRef="document.all"
styleSwitch=".style"
if (navigator.appName == "Netscape") {
        ns=1;
        layerRef="document.layers"
        styleSwitch=""

}

//########### ENCUESTA
var radval = 0;
var newWin=null;

function popup(loc, name, width, height, scroll) {
	if (scroll == 'yes'){
	scroll = 'yes';
	}
	else
	{
	scroll = 'no';
	}
        var _params = "width="+width+",height="+height+",resizable=no, scrollbars="+scroll+",status=no";

        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-width) >>1 );
                 _top = ( (screen.height-height) >>1 );
        } else {
                 _left = ( (800-width) >>1 );
                 _top = ( (600-height) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;
        
		newWin = window.open(loc, name, _params);
        if ( newWin!=null && !(IE && bVer<5) )
        newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}

function selctx(radIndex)
{
   var returnValue = true;

      radval = radIndex;
   }
function vote() 
{
	var resultado = true;
	
	FormatoSel = document.formaenc.FormatoSel.value;
	NumResp = document.formaenc.NumResp.value;
	idenc = document.formaenc.idenc.value;
	VO = document.formaenc.VO[radval].value;

	
	if (VO=="vacio")
	{
		alert("Debe seleccionar una opción para votar en la encuesta");
	}	
	else {
	popup( 'encuestas/votar.php?VO='+ VO, 'Encuestas', 270, 250);
	
	}
}

//########### VALIDAR BUSQUEDA
function ValidarBusqueda(theform) {
  checkResult = true;
  if (theform.palabra.value.length==0) {
     alert('Debe de escribir una palabra (s)');
     theform.palabra.focus();
     checkResult = false;
  }
  else
	theform.b1.disabled = true;
	return checkResult;
}

//########### VALIDAR POSTALES
function ValidarPostal(theForm3)
{
  checkResult = true;
  if (theForm3.nombre_destinatario.value.length==0)
  {
     alert("Debe de escribir El Nombre de la persona a quien le envirá la Postal");
     theForm3.nombre_destinatario.focus();
     return (false);
     checkResult = false;
  }
  if (theForm3.correo_destinatario.value.length==0)
  {
     alert("Debe de escribir La Dirección de E-mail de la persona a quien le envirá la Postal");
     theForm3.correo_destinatario.focus();
     return (false);
     checkResult = false;
  }
  if (theForm3.nombre_remitente.value.length==0)
  {
     alert("Debe de escribir su Nombre");
     theForm3.nombre_remitente.focus();
     return (false);
     checkResult = false;
  }
  if (theForm3.correo_remitente.value.length==0)
  {
     alert("Debe de escribir su Dirección de E-mail");
     theForm3.correo_remitente.focus();
     return (false);
     checkResult = false;
  }
  if (theForm3.mensaje.value.length==0)
  {
     alert("Debe de escribir un Mensaje a la persona a quien le envirá la Postal");
     theForm3.mensaje.focus();
     return (false);
     checkResult = false;
  }
  if (checkResult == true)
  {
  theForm3.B1.disabled = true;
  theForm3.B2.disabled = true;
  }
  return checkResult;
}

//########### VALIDAR ENVIAR POSTALES
function ValidarPostal2(theForm4)
{
  theForm4.B1.disabled = true;
  theForm5.B1.disabled = true;
}

//########### BARRA DEL NAVEGADOR
var message = 'Fundación AndígenA';
statuss();
function statuss()
    {
    window.status = message;
    //timerID = setTimeout("statuss()", 25);
}
function dynAnimation() {}
function clickSwapImg() {}

//########### EFECTO DE BARRA
function onOver(src,clrOver) {
 if (!src.contains(event.fromElement)) {
  src.style.cursor = 'hand';
  src.bgColor = clrOver;
        }
  }
function onOut(src,clrIn) {
        if (!src.contains(event.toElement)) {
     src.style.cursor = 'default';
     src.bgColor = clrIn;
        }
  }

//########### POP UP
function ventana(pagina) {
  var date = new Date ();
  window.open(pagina,date.getTime(),'toolbar=no,menubar=no,width=500,height=500,scrollbars=yes,resizable=no');
}
function ventana2(pagina,foto) {
  var date = new Date ();
  pagina = pagina + "&foto="+ foto
  window.open(pagina,date.getTime(),'toolbar=no,menubar=no,width=550,height=500,scrollbars=no,resizable=no');
}
function ventana3(pagina) {
  var date = new Date ();
  window.open(pagina,date.getTime(),'toolbar=no,menubar=no,width=850,height=300,scrollbars=no,resizable=no');
}
function ventana4(pagina) {
  var date = new Date ();
  window.open(pagina,date.getTime(),'toolbar=no,menubar=no,width=375,height=450,scrollbars=yes,resizable=no');
}

//########### PORTAFOLIO
function resena(pagina){
	popup( pagina, 'Reseñas', 451, 340, 'yes');
}

//########### MINI WEBSITE
function minisite(pagina){
	popup( pagina, 'Reseñas', 700, 500, 'yes');
}

//########### AYUDA DE PEDIDOS
function ayuda(pagina){
	popup( pagina, 'Ayuda', 500, 400, 'yes');
}

//########### POLITICAS DE PRIVACIDAD
function politicas(){
	popup( '/politicas/politica_privacidad.asp', 'POLITICAS', 500, 550, 'yes');
}

//########### ACCESESIBILIDAD
function accesibilidad(){
	popup( '/politicas/accesibilidad.asp', 'ACCESESIBILIDAD', 500, 550, 'yes');
}

//########### GALERIA - HERPETOLOGICA
function galeria_herpetologica(url){
	popup( '/herpetologica/galeria.asp?file='+ url, 'GALERIA', 780, 550, 'yes');
}

//########### GALERIAS
function galerias(url){
	popup( url, 'GALERIA', 780, 550, 'yes');
}
