﻿var idiomaGen = "es";

/* Funciones generales */
function ajaxFunction(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	return ajaxRequest;
}

function cargarBack()
{
    //var back = document.getElementById("numBack").value;
    //document.getElementById("cualBack").className="top back" + back;
}
/* Pre cargar imagenes */
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function precargar()
{
	MM_preloadImages('../../img/' + idiomaGen + '/menu1/0_on.png','../../img/' + idiomaGen + '/menu1/1_on.png',
	        '../../img/' + idiomaGen + '/menu1/2_on.png'
	);
}

function cargarFondo()
{
    var numBack = document.getElementById("backPrin_num").value;
    document.getElementById("backPrin").className = "top back" + numBack;
}

function insertar_flash(nombre, w, h, ruta)
{
    
       document.write("<object style='z-index:0;' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='" + w + "' height='" + h + "' id='" + nombre + "' align='middle' VIEWASTEXT>");
       document.write(" <param name='allowScriptAccess' value='sameDomain' />");
       document.write("<param name='movie' value='" + ruta + "/" + nombre + ".swf' />");
       document.write("<param name='quality' value='high' />");
       document.write("<param name='wmode' value='transparent'>");
       document.write("<embed wmode='transparent' src='" + ruta + "/" + nombre + ".swf' quality='high' width='" + w + "' height='" + h + "' name='" + nombre + "' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
       document.write("</object>");
}

/* Menu1 */
var currMenu1;
function m1Over(cual)
{
    currMenu1 = cual;
    var xx = cual.substr(cual.length-1,1);
    document.getElementById(cual).className = "divMenu1_stay";
    document.getElementById("i" + cual.substring(1)).src = "../../img/" + idiomaGen + "/menu1/" + xx + "_on.png";
} 
function m1Out(cual)
{
    document.getElementById(cual).className = "divMenu1_on";
}
function m1Out2(cual)
{
    document.getElementById(cual).className = "divMenu1";
    var xx = cual.substr(cual.length-1,1);
    document.getElementById("i" + cual.substring(1)).src = "../../img/" + idiomaGen + "/menu1/" + xx + ".png";
} 

function changeIdioma(cual)
{
    document.getElementById("img_idioma").src="../../img/" + cual + "/idioma_on.png";
}
function changeIdioma2(cual)
{
    document.getElementById("img_idioma").src="../../img/" + cual + "/idioma.png";
}

function buscadorOver()
{
    document.getElementById("tblBusc").className = "tablaBuscador2";
}
function buscadorOut()
{
    document.getElementById("tblBusc").className = "tablaBuscador";
}
/* Menu 2 */
var currMenu2;
function m2Over(cual)
{
    currMenu2 = cual;
    document.getElementById(cual).className = "divMenu2_stay";
} 
function m2Out(cual)
{
    document.getElementById(cual).className = "divMenu2_on";
}
function m2Out2(cual)
{
    document.getElementById(cual).className = "divMenu2";
}
/* Menu 3 */
var currMenu3;
function m3Over(cual)
{
    currMenu3 = cual;
    document.getElementById(cual).className = "divMenu3_stay";
    document.getElementById("i" + cual.substring(1)).style.display = "none";
    document.getElementById("i" + cual.substring(1) + "_on").style.display = "";
} 
function m3Out(cual)
{
    document.getElementById(cual).className = "divMenu3";
    document.getElementById("i" + cual.substring(1)).style.display = "";
    document.getElementById("i" + cual.substring(1) + "_on").style.display = "none";
}

/* Home */

var rutaTemp = "", tarTemp = "";
function bannerHit(id, ruta, tar)
{
    // Create a function that will receive data sent from the server
	var ajaxRequest = ajaxFunction();
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		    if (tarTemp == 0)
		    {
		        window.open(rutaTemp,"_blank");
		    }
		    else
		    {
		        window.location = rutaTemp;
		    }
		    rutaTemp = ""; tarTemp = "";
		}
	}
	rutaTemp = ruta;
	tarTemp = tar;
	ajaxRequest.open("GET", "../inicio/bannerhit.aspx?id=" + id, true);
	ajaxRequest.send(null);    
}


/* Menu Interior */
var currInt;
function intOver(cual)
{
    cual = cual.substring(2); 
    if (cual != currInt)
    {  
        document.getElementById("m_" + cual).className = "menu_int_over";
    }
}
function intOut(cual)
{
    cual = cual.substring(2); 
    if (cual != currInt)
    {  
        document.getElementById("m_" + cual).className = "menu_int";
    }
}
function intCual(cual)
{
    if (cual != "-1")
    {
    currInt = cual;
    document.getElementById("m_" + cual).className = "menu_int_on";
    }
}

/* Scroll */
var s, cScroll=0;
function iniciar(funcion,cual)
{
    document.getElementById(cual).src = "../../img/" + cual + "_on.gif";
	var w ="";
    if (funcion == "mas")
        w = "mover";
    else
        w = "movermenos";
    s = window.setInterval(w + "(20)", 180); 
}

function parar(cual)
{
document.getElementById(cual).src = "../../img/" + cual + ".gif";
    window.clearInterval(s);
}
  var v_scroll = 0;
    function mover(amount) {
    var o = document.getElementById("scroll");
    var t = parseInt(document.getElementById("tbl_1").offsetHeight);
    t = t - o.offsetHeight;
     if (v_scroll < t)
        v_scroll = v_scroll + amount;
    o.scrollTop = v_scroll;
} 
 function movermenos(amount) {
    var o = document.getElementById("scroll");
    if (v_scroll > 0)
        v_scroll = v_scroll - amount;
    o.scrollTop = v_scroll;
} 


function scrollear(cual)
{
    var puntodescroll = document.getElementById(cual).offsetTop;
        document.getElementById('scroll').scrollTop = puntodescroll + 15;
        v_scroll = document.getElementById('scroll').scrollTop;
}

function scrollArriba()
{
    var o = parent.document.getElementById("scroll");
    o.scrollTop = 0;
}


/* Tablas imagenes */
var currTabla = 1, currSetNumeros = 0;

function mostrarTabla(cual,tabla)
{
   document.getElementById("tbl" + currTabla).style.display = "none";
   if (cual != -1)
   {
     currTabla = cual;
   }
   else
   {
    siguienteSetNumeros(tabla+1);
   }
   document.getElementById("tbl" + currTabla).style.display = "";
   validarUltima();
   validarPrimera();
}
function anteriorSetNumeros(cual)
{
    document.getElementById("tblNum_" + currSetNumeros).style.display = "none";
    currSetNumeros = cual;
    document.getElementById("tblNum_" + currSetNumeros).style.display = "";
}
function siguienteSetNumeros(cual)
{
    document.getElementById("tblNum_" + currSetNumeros).style.display = "none";
    if (cual == 0)
        currTabla = 1;
    else
        currTabla = ((cual+1)*3)-1;
    currSetNumeros = cual;
    document.getElementById("tblNum_" + currSetNumeros).style.display = "";
}
function siguiente()
{
    document.getElementById("tbl" + currTabla).style.display = "none";
    currTabla++;
    if (currTabla==5 || currTabla==8 || currTabla==11 || currTabla == 14 || currTabla == 17)
    {
        siguienteSetNumeros(currSetNumeros +1);
    }
    document.getElementById("tbl" + currTabla).style.display = "";
    validarUltima();
    validarPrimera();
}
function anterior()
{
document.getElementById("tbl" + currTabla).style.display = "none";
    currTabla--;
    if (currTabla == 4 || currTabla==7 || currTabla==10 || currTabla==13 || currTabla == 16 || currTabla == 19)
    {
        anteriorSetNumeros(currSetNumeros-1);
    }
    document.getElementById("tbl" + currTabla).style.display = "";
    validarUltima();
    validarPrimera();
}
function validarUltima()
{
    var cantidad = document.getElementById("cantidad").value;
    cantidad = parseInt(cantidad);
    if (currTabla == cantidad)
    {
        document.getElementById("flecha4").style.visibility="hidden";
    }
    else
        document.getElementById("flecha4").style.visibility="";
}
function validarPrimera()
{
    var cantidad = document.getElementById("cantidad").value;
    cantidad = parseInt(cantidad);
    if (currTabla == 1)
    {
        document.getElementById("flecha3").style.visibility="hidden";
    }
    else
        document.getElementById("flecha3").style.visibility="";
}
function flechaOver(cual)
{
    document.getElementById("flecha" + cual).src = "../../img/flecha" + cual + "_on.png";
}
function flechaOut(cual)
{
    document.getElementById("flecha" + cual).src = "../../img/flecha" + cual + ".png";
}

/* Numeracion */
function ovNum1(cual)
{
    cual = cual.substr(2);
    var num = cual.substring(0,1);
    document.getElementById("i_" + num + "_0").src = "../../img/num/" + num + "_on.png";
    
}
function ouNum1(cual)
{
    cual = cual.substr(2);
    var num = cual.substring(0,1);
    document.getElementById("i_" + num + "_0").src = "../../img/num/" + num + ".png";
    
}
function ovNum2(cual,num1,num2)
{
    cual = cual.substr(2);
    var num = cual.substring(0,2);
    document.getElementById("i_" + num + "_0").src = "../../img/num/" + num1 + "_on.png";
    document.getElementById("i_" + num + "_1").src = "../../img/num/" + num2 + "_on.png";
}
function ouNum2(cual,num1,num2)
{
    cual = cual.substr(2);
    var num = cual.substring(0,2);
    document.getElementById("i_" + num + "_0").src = "../../img/num/" + num1 + ".png";
    document.getElementById("i_" + num + "_1").src = "../../img/num/" + num2 + ".png";
}
function ovNum3(cual,num1,num2,num3)
{
    cual = cual.substr(2);
    var num = cual.substring(0,2);
    document.getElementById("i_" + num + "_0").src = "../../img/num/" + num1 + "_on.png";
    document.getElementById("i_" + num + "_1").src = "../../img/num/" + num2 + "_on.png";
}
function ovNum3(cual,num1,num2,num3)
{
    cual = cual.substr(2);
    var num = cual.substring(0,3);
    document.getElementById("i_" + num + "_0").src = "../../img/num/" + num1 + "_on.png";
    document.getElementById("i_" + num + "_1").src = "../../img/num/" + num2 + "_on.png";
    document.getElementById("i_" + num + "_2").src = "../../img/num/" + num3 + "_on.png";
}
function ouNum3(cual,num1,num2,num3)
{
    cual = cual.substr(2);
    var num = cual.substring(0,3);
    document.getElementById("i_" + num + "_0").src = "../../img/num/" + num1 + ".png";
    document.getElementById("i_" + num + "_1").src = "../../img/num/" + num2 + ".png";
    document.getElementById("i_" + num + "_2").src = "../../img/num/" + num3 + ".png";
}


/* PDF */

var rutaTemp2 = "";
function abrirPDF(ruta,id)
{
    // Create a function that will receive data sent from the server
	var ajaxRequest = ajaxFunction();
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		    window.open("../../fotos/pdf/" + rutaTemp2,"_blank");
		    rutaTemp2 = "";
		}
	}
	rutaTemp2 = ruta;
	ajaxRequest.open("GET", "../inicio/pdfhit.aspx?id=" + id, true);
	ajaxRequest.send(null);    
}

/* Validaciones */
function func_gracias(cual, id, objeto)
{    
    scrollArriba();
     window.location = "../inicio/gracias.aspx?grax=" + cual + "&id=" +id + "&objeto=" + objeto;
}
function func_gracias2(cual, id, objeto)
{    
     window.location = "../apoya/gracias_membresias.aspx?grax=" + cual + "&id=" +id + "&objeto=" + objeto;
}
function alerta(cual)
{
    cual = cual.replace('á','\u00e1');
    cual = cual.replace('é','\u00e9');
     cual = cual.replace('í','\u00ed');
     cual = cual.replace('ó','\u00f3');
     cual = cual.replace('ú','\u00fa');
     cual = cual.replace('Á','\u00c1');
     cual = cual.replace('É','\u00c9');
     cual = cual.replace('Í','\u00cd');
     cual = cual.replace('Ó','\u00d3');
     cual = cual.replace('Ú','\u00da');
     cual = cual.replace('ñ','\u00f1');
     cual = cual.replace('Ñ','\u00d1');
     alert(cual);
}
function validarVoluntario()
{
    if (document.getElementById("txt_1").value == "")
    {
        alerta("Favor de ingresar su nombre");
        document.getElementById("txt_1").focus();
        return false;
    }
    if (document.getElementById("txt_2").value == "")
    {
        alerta("Favor de ingresar su edad");
        document.getElementById("txt_2").focus();
        return false;
    }
    if (document.getElementById("txt_3").value == "")
    {
        alerta("Favor de ingresar su teléfono");
        document.getElementById("txt_3").focus();
        return false;
    }
    if (document.getElementById("txt_5").value == "")
    {
        alerta("Favor de ingresar su e-mail");
        document.getElementById("txt_5").focus();
        return false;
    }
    if (document.getElementById("txt_6").value == "")
    {
        alerta("Favor de ingresar su dirección");
        document.getElementById("txt_6").focus();
        return false;
    }
    if (document.getElementById("txt_7").value == "")
    {
        alerta("Favor de ingresar su estado");
        document.getElementById("txt_7").focus();
        return false;
    }
    if (document.getElementById("txt_9").value == "")
    {
        alerta("Favor de ingresar su país");
        document.getElementById("txt_9").focus();
        return false;
    }
    if (document.getElementById("txt_cp").value == "")
    {
        alerta("Favor de ingresar su código postal");
        document.getElementById("txt_cp").focus();
        return false;
    }
    if (document.getElementById("txt_10").value == "")
    {
        alerta("Favor de ingresar su ocupación");
        document.getElementById("txt_10").focus();
        return false;
    }
    if (document.getElementById("txt_11").value == "")
    {
        alerta("Favor de ingresar su horarios");
        document.getElementById("txt_11").focus();
        return false;
    }
    if (document.getElementById("txt_12").value == "" && document.getElementById("rd_2").checked == true)
    {
        alerta("Favor de ingresar su participación en proyectos similares");
        document.getElementById("txt_12").focus();
        return false;
    }
    return true;
}


function validarVoluntarioEn()
{
    if (document.getElementById("txt_1").value == "")
    {
        alerta("Please insert your name");
        document.getElementById("txt_1").focus();
        return false;
    }
    if (document.getElementById("txt_2").value == "")
    {
        alerta("Please insert your age");
        document.getElementById("txt_2").focus();
        return false;
    }
    if (document.getElementById("txt_3").value == "")
    {
        alerta("Please insert your phone numbre");
        document.getElementById("txt_3").focus();
        return false;
    }
    if (document.getElementById("txt_5").value == "")
    {
        alerta("Please insert your e-mail");
        document.getElementById("txt_5").focus();
        return false;
    }
    if (document.getElementById("txt_6").value == "")
    {
        alerta("Please insert your address");
        document.getElementById("txt_6").focus();
        return false;
    }
    if (document.getElementById("txt_7").value == "")
    {
        alerta("Please insert your state");
        document.getElementById("txt_7").focus();
        return false;
    }
    if (document.getElementById("txt_9").value == "")
    {
        alerta("Please insert your country");
        document.getElementById("txt_9").focus();
        return false;
    }
    if (document.getElementById("txt_cp").value == "")
    {
        alerta("Please insert your zip code");
        document.getElementById("txt_cp").focus();
        return false;
    }
    if (document.getElementById("txt_10").value == "")
    {
        alerta("Please insert your occupation ");
        document.getElementById("txt_10").focus();
        return false;
    }
    if (document.getElementById("txt_11").value == "")
    {
        alerta("Please insert your available hours");
        document.getElementById("txt_11").focus();
        return false;
    }
    if (document.getElementById("txt_12").value == "" && document.getElementById("rd_2").checked == true)
    {
        alerta("Please insert your participation in similar projects");
        document.getElementById("txt_12").focus();
        return false;
    }
    return true;
}

function validarEmpresa()
{
    if (document.getElementById("txt_1").value == "")
    {
        alerta("Favor de ingresar el nombre de la empresa");
        document.getElementById("txt_1").focus();
        return false;
    }
    if (document.getElementById("txt_2").value == "")
    {
        alerta("Favor de ingresar el representante");
        document.getElementById("txt_2").focus();
        return false;
    }
    if (document.getElementById("txt_3").value == "")
    {
        alerta("Favor de ingresar su teléfono");
        document.getElementById("txt_3").focus();
        return false;
    }
    if (document.getElementById("txt_5").value == "")
    {
        alerta("Favor de ingresar su e-mail");
        document.getElementById("txt_5").focus();
        return false;
    }
    if (document.getElementById("txt_6").value == "")
    {
        alerta("Favor de ingresar su dirección");
        document.getElementById("txt_6").focus();
        return false;
    }
    if (document.getElementById("txt_7").value == "")
    {
        alerta("Favor de ingresar su estado");
        document.getElementById("txt_7").focus();
        return false;
    }
    if (document.getElementById("txt_10").value == "")
    {
        alerta("Favor de ingresar el giro de la empresa");
        document.getElementById("txt_10").focus();
        return false;
    }
   if (document.getElementById("txt_13").value == "")
    {
        alerta("Favor de ingresar el número de personas");
        document.getElementById("txt_13").focus();
        return false;
    }
    if (document.getElementById("txt_14").value == "")
    {
        alerta("Favor de ingresar las fechas de reforestación");
        document.getElementById("txt_14").focus();
        return false;
    }
    return true;
}
function validarEmpresaEn()
{
    if (document.getElementById("txt_1").value == "")
    {
        alerta("Please insert the name of the company");
        document.getElementById("txt_1").focus();
        return false;
    }
    if (document.getElementById("txt_2").value == "")
    {
        alerta("Please insert the company's representative");
        document.getElementById("txt_2").focus();
        return false;
    }
    if (document.getElementById("txt_3").value == "")
    {
        alerta("Please insert your phone number");
        document.getElementById("txt_3").focus();
        return false;
    }
    if (document.getElementById("txt_5").value == "")
    {
        alerta("Please insert your e-mail");
        document.getElementById("txt_5").focus();
        return false;
    }
    if (document.getElementById("txt_6").value == "")
    {
        alerta("Please insert your address");
        document.getElementById("txt_6").focus();
        return false;
    }
    if (document.getElementById("txt_7").value == "")
    {
        alerta("Please insert your state");
        document.getElementById("txt_7").focus();
        return false;
    }
    if (document.getElementById("txt_10").value == "")
    {
        alerta("Please insert the line of business");
        document.getElementById("txt_10").focus();
        return false;
    }
   if (document.getElementById("txt_13").value == "")
    {
        alerta("Please insert the number of people");
        document.getElementById("txt_13").focus();
        return false;
    }
    if (document.getElementById("txt_14").value == "")
    {
        alerta("Please insert the dates");
        document.getElementById("txt_14").focus();
        return false;
    }
    return true;
}
function validarBoletin()
{
    if (document.getElementById("txt_1").value == "")
    {
        alerta("Favor de ingresar su nombre");
        document.getElementById("txt_1").focus();
        return false;
    }
  
    if (document.getElementById("txt_3").value == "")
    {
        alerta("Favor de ingresar su e-mail");
        document.getElementById("txt_3").focus();
        return false;
    }
    
    if (document.getElementById("txt_5").value == "")
    {
        alerta("Favor de ingresar su país");
        document.getElementById("txt_5").focus();
        return false;
    }
   
    return true;
}
function validarBoletinEn()
{
    if (document.getElementById("txt_1").value == "")
    {
        alerta("Please insert your name");
        document.getElementById("txt_1").focus();
        return false;
    }
  
    if (document.getElementById("txt_3").value == "")
    {
        alerta("Please insert your e-mail");
        document.getElementById("txt_3").focus();
        return false;
    }
    
    if (document.getElementById("txt_5").value == "")
    {
        alerta("Please insert your country");
        document.getElementById("txt_5").focus();
        return false;
    }
   
    return true;
}
function validarMembresia()
{
    var ph = "_ctl0_ContentPlaceHolder1_";
    if (document.getElementById(ph + "txt_1").value == "")
    {
        alerta("Favor de ingresar su nombre");
        document.getElementById(ph + "txt_1").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_4").value == "")
    {
        alerta("Favor de ingresar su ocupación");
        document.getElementById(ph + "txt_4").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_5").value == "")
    {
        alerta("Favor de ingresar su domicilio");
        document.getElementById(ph + "txt_5").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_6").value == "")
    {
        alerta("Favor de ingresar su estado");
        document.getElementById(ph + "txt_6").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_8").value == "")
    {
        alerta("Favor de ingresar su país");
        document.getElementById(ph + "txt_8").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_9").value == "")
    {
        alerta("Favor de ingresar su teléfono");
        document.getElementById(ph + "txt_9").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_10").value == "")
    {
        alerta("Favor de ingresar su e-mail");
        document.getElementById(ph + "txt_10").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_cp").value == "")
    {
        alerta("Favor de ingresar su código postal");
        document.getElementById(ph + "txt_cp").focus();
        return false;
    }
    if (document.getElementById(ph + "rd_5").checked == true)
    {
        if (document.getElementById(ph + "txt_16").value == "")
        {
            alerta("Favor de ingresar la cantidad que desea donar anual");
            document.getElementById(ph + "txt_16").focus();
            return false;
        }
        if (!parseFloat(document.getElementById(ph + "txt_16").value))
        {
            alerta("La cantidad debe de ser numérica");
            document.getElementById(ph + "txt_16").focus();
            return false;
        }
        
    }
    return true;
}
function validarMembresiaEn()
{
    var ph = "_ctl0_ContentPlaceHolder1_";
    if (document.getElementById(ph + "txt_1").value == "")
    {
        alerta("Please insert your name");
        document.getElementById(ph + "txt_1").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_4").value == "")
    {
        alerta("Please insert your occupation");
        document.getElementById(ph + "txt_4").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_5").value == "")
    {
        alerta("Please insert your address");
        document.getElementById(ph + "txt_5").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_6").value == "")
    {
        alerta("Please insert your state");
        document.getElementById(ph + "txt_6").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_8").value == "")
    {
        alerta("Please insert your country");
        document.getElementById(ph + "txt_8").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_9").value == "")
    {
        alerta("Please insert your phone numbre");
        document.getElementById(ph + "txt_9").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_10").value == "")
    {
        alerta("Please insert your e-mail");
        document.getElementById(ph + "txt_10").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_cp").value == "")
    {
        alerta("Please insert your zip code");
        document.getElementById(ph + "txt_cp").focus();
        return false;
    }
    if (document.getElementById(ph + "rd_5").checked == true)
    {
        if (document.getElementById(ph + "txt_16").value == "")
        {
            alerta("Please insert the amount you want to donate annually");
            document.getElementById(ph + "txt_16").focus();
            return false;
        }
        if (!parseFloat(document.getElementById(ph + "txt_16").value))
        {
            alerta("The amount must be numeric");
            document.getElementById(ph + "txt_16").focus();
            return false;
        }
        
    }
    return true;
}
function validarSuscripcion()
{
    var ph = "";
    if (document.getElementById(ph + "txt_1").value == "")
    {
        alerta("Favor de ingresar su nombre");
        document.getElementById(ph + "txt_1").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_4").value == "")
    {
        alerta("Favor de ingresar su ocupación");
        document.getElementById(ph + "txt_4").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_5").value == "")
    {
        alerta("Favor de ingresar su domicilio");
        document.getElementById(ph + "txt_5").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_6").value == "")
    {
        alerta("Favor de ingresar su estado");
        document.getElementById(ph + "txt_6").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_8").value == "")
    {
        alerta("Favor de ingresar su país");
        document.getElementById(ph + "txt_8").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_cp").value == "")
    {
        alerta("Favor de ingresar su código postal");
        document.getElementById(ph + "txt_cp").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_9").value == "")
    {
        alerta("Favor de ingresar su teléfono");
        document.getElementById(ph + "txt_9").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_10").value == "")
    {
        alerta("Favor de ingresar su e-mail");
        document.getElementById(ph + "txt_10").focus();
        return false;
    }
    return true;
}
function validarSuscripcionEn()
{
    var ph = "";
    if (document.getElementById(ph + "txt_1").value == "")
    {
        alerta("Please insert your name");
        document.getElementById(ph + "txt_1").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_4").value == "")
    {
        alerta("Please insert your occupation");
        document.getElementById(ph + "txt_4").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_5").value == "")
    {
        alerta("Please insert your address");
        document.getElementById(ph + "txt_5").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_6").value == "")
    {
        alerta("Please insert your state");
        document.getElementById(ph + "txt_6").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_8").value == "")
    {
        alerta("Please insert your country");
        document.getElementById(ph + "txt_8").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_cp").value == "")
    {
        alerta("Please insert your zip code");
        document.getElementById(ph + "txt_cp").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_9").value == "")
    {
        alerta("Please insert your phone number");
        document.getElementById(ph + "txt_9").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_10").value == "")
    {
        alerta("Please insert your e-mail");
        document.getElementById(ph + "txt_10").focus();
        return false;
    }
    return true;
}
function validarPedido()
{
    var ph = "";
    if (document.getElementById(ph + "txt_1").value == "")
    {
        alerta("Favor de ingresar su nombre");
        document.getElementById(ph + "txt_1").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_4").value == "")
    {
        alerta("Favor de ingresar su ocupación");
        document.getElementById(ph + "txt_4").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_5").value == "")
    {
        alerta("Favor de ingresar su domicilio");
        document.getElementById(ph + "txt_5").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_6").value == "")
    {
        alerta("Favor de ingresar su estado");
        document.getElementById(ph + "txt_6").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_8").value == "")
    {
        alerta("Favor de ingresar su país");
        document.getElementById(ph + "txt_8").focus();
        return false;
    }
     if (document.getElementById(ph + "txt_cp").value == "")
    {
        alerta("Favor de ingresar su código postal");
        document.getElementById(ph + "txt_cp").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_9").value == "")
    {
        alerta("Favor de ingresar su teléfono");
        document.getElementById(ph + "txt_9").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_10").value == "")
    {
        alerta("Favor de ingresar su e-mail");
        document.getElementById(ph + "txt_10").focus();
        return false;
    }
    var i =0;
    while (document.getElementById("dtl_1__ctl" + i + "_txt_1"))
    {
        if (document.getElementById("dtl_1__ctl" + i + "_chk_1").checked && document.getElementById("dtl_1__ctl" + i + "_txt_1").value =="")
        {
            alert("Favor de insertar la cantidad");
            document.getElementById("dtl_1__ctl" + i + "_txt_1").focus();
            return false;
        }
        i++;
    }
    return true;
}
function validarPedidoEn()
{
    var ph = "";
    if (document.getElementById(ph + "txt_1").value == "")
    {
        alerta("Please insert your name");
        document.getElementById(ph + "txt_1").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_4").value == "")
    {
        alerta("Please insert your occupation");
        document.getElementById(ph + "txt_4").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_5").value == "")
    {
        alerta("Please insert your address");
        document.getElementById(ph + "txt_5").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_6").value == "")
    {
        alerta("Please insert your state");
        document.getElementById(ph + "txt_6").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_8").value == "")
    {
        alerta("Please insert your country");
        document.getElementById(ph + "txt_8").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_cp").value == "")
    {
        alerta("Please insert your zip code");
        document.getElementById(ph + "txt_cp").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_9").value == "")
    {
        alerta("Please insert your phone number");
        document.getElementById(ph + "txt_9").focus();
        return false;
    }
    if (document.getElementById(ph + "txt_10").value == "")
    {
        alerta("Please insert your e-mail");
        document.getElementById(ph + "txt_10").focus();
        return false;
    }
    var i =0;
    while (document.getElementById("dtl_1__ctl" + i + "_txt_1"))
    {
        if (document.getElementById("dtl_1__ctl" + i + "_chk_1").checked && document.getElementById("dtl_1__ctl" + i + "_txt_1").value =="")
        {
            alert("Please insert the amount");
            document.getElementById("dtl_1__ctl" + i + "_txt_1").focus();
            return false;
        }
        i++;
    }
    return true;
}
function validarDonador()
{
    var ph = "";
 
    if (document.getElementById(ph + "txt_3").value == "")
    {
        alerta("Favor de ingresar su e-mail");
        document.getElementById(ph + "txt_3").focus();
        return false;
    }
    return true;
}
function validarDonadorEn()
{
    var ph = "";
 
    if (document.getElementById(ph + "txt_3").value == "")
    {
        alerta("Please insert your e-mail");
        document.getElementById(ph + "txt_3").focus();
        return false;
    }
    return true;
}

/* Ajustar altura */
function calcHeight(frame)
{
  //find the height of the internal page
	frame.height = 0;
  var the_height=frame.contentWindow.document.body.scrollHeight;
	frame.height=the_height;
}
