function irAlIndice() {

    if(confirm("La venta de semillas de Cánnabis no esta prohibida en España. Es responsabilidad del comprador informarse de las leyes existentes al respecto en su pais o región. No nos responsabilizamos en ningún caso de los futuros tratamientos que los clientes hagan de las semillas. Le rogamos que se informe de las leyes que rigen en su país o región para así no cometer ningún tipo de infracción. Esta prohibido el acceso a esta web a menores de 18 años!")) {

        document.location.href= 'http://www.mundoenteogeno.com/nueva';

    }
	else{
		document.location.href= 'http://www.google.es';

	}

}

   function recarga(idA,pvp){
         var f = document.forms['formulario'];
		 var n=f.sumaCant.value.length;
		 var n2=document.getElementById('total_'+idA).value.length;
         var sumTotal=f.sumaCant.value.substring(0,(n-1)); 
		 

		 sumTotal -= document.getElementById('total_'+idA).value.substring(0,(n2-1)); 	
		 
         document.getElementById('total_'+idA).value = document.getElementById('cant_'+idA).value*pvp+" €";
         f.sumaCant.value='';
		 
		 var total=(document.getElementById('cant_'+idA).value*pvp)+sumTotal;
		 
         f.sumaCant.value = total+" €";
		 
		 f.submit();

   }


function cantidadOnBlur(idA){
         var mascaraEnteros= new RegExp("^[0-9]*$");
         if(!mascaraEnteros.test(document.getElementById('cant_'+idA).value)){
            document.getElementById('cant_'+idA).value="1";
         };
};

      function emailOnBlur(){
         var mascaraEmail= new RegExp("(^[0-9a-zA-Z]+(?:[-._][0-9a-zA-Z]+)*)@([0-9a-zA-Z]+(?:[._-][0-9a-zA-Z]+)*\.[0-9a-zA-Z]{2,3})$");
         if(!mascaraEmail.test(document.getElementById('email').value)){
            document.getElementById('email').value="";
         };
      };
      function telefonoOnBlur(){
         var mascaraTelefono= new RegExp("^[0-9]{9}$");
         if(!mascaraTelefono.test(document.getElementById('telefono').value)){
            document.getElementById('telefono').value="";
         };
      };
      function movilOnBlur(){
         var mascaraTelefono= new RegExp("^[0-9]{9}$");
         if(!mascaraTelefono.test(document.getElementById('movil').value)){
            document.getElementById('movil').value="";
         };
      };

      function dniOnBlur(){
         var mascaraDni= new RegExp("^[0-9]{8}[a-zA-Z]{1}$");
         if(!mascaraDni.test(document.getElementById('nif').value)){
            document.getElementById('nif').value="";
         };
      };

      function cpOnBlur(){
         var mascaraCp= new RegExp("^[0-9]{5}$");
         if(!mascaraCp.test(document.getElementById('cp').value)){
            document.getElementById('cp').value="";
         };
      };

      function validarCamposVaciosFormContacto(){
         if(document.getElementById('nombre').value==""){
            alert("Es obligatorio inidicar un NOMBRE...");
            document.getElementById('nombre').focus();
            return 0;
         }else if(document.getElementById('email').value==""){
            alert("Es obligatorio indicar un E-MAIL...");
            document.getElementById('email').focus();
            return 0;
         }else if(document.getElementById('mensaje').value==""){
            alert("Es obligatorio indicar un MENSAJE...");
            document.getElementById('mensaje').focus();
            return 0;
         }else{
            return 1;
         };
      };



   var ventana
   var cont=0
   var titulopordefecto = "Imagen grande"

   function ventanaFoto(imagen,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" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="' + imagen + '" onLoad="opener.redimensionar(this.width, this.height)">')
      ventana.document.close()
      cont++
   }

   function redimensionar(ancho,alto)
   {
      ventana.resizeTo(ancho+12,alto+28)
      ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2)
   }

      function validarCamposVaciosFormCliente(){
         document.getElementById('lbNombre').style.color="#000";
         document.getElementById('lbApellidos').style.color="#000";
         document.getElementById('lbTelefono').style.color="#000";
         document.getElementById('lbDireccion').style.color="#000";
         document.getElementById('lbLocalidad').style.color="#000";
         document.getElementById('lbProvincia').style.color="#000";
         document.getElementById('lbCp').style.color="#000";
         document.getElementById('lbEmail').style.color="#000";
		 document.getElementById('lbPass').style.color="#000";

         var ok=0;

		if(document.getElementById('pass').value!=document.getElementById('pass2').value){
			alert('Las contraseñas introducidas son distintas.','Error');
			document.getElementById('pass').value='';
			document.getElementById('pass2').value='';
            document.getElementById('pass').focus();
            ok=1;
         };
		 if(document.getElementById('pass').value==""){
            document.getElementById('pass').focus();
            document.getElementById('lbPass').style.color="red";
			document.getElementById('lbPass').style.fontWeight="bold";
            ok=1;
         };
         if(document.getElementById('email').value==""){
            document.getElementById('email').focus();
            document.getElementById('lbEmail').style.color="red";
            ok=1;
         };
         if(document.getElementById('cp').value==""){
            document.getElementById('cp').focus();
            document.getElementById('lbCp').style.color="red";
            ok=1;
         };
         if(document.getElementById('provincia').value==""){
            document.getElementById('provincia').focus();
            document.getElementById('lbProvincia').style.color="red";
            ok=1;
         };
         if(document.getElementById('localidad').value==""){
            document.getElementById('localidad').focus();
            document.getElementById('lbLocalidad').style.color="red";
            ok=1;
         };
         if(document.getElementById('direccion').value==""){
            document.getElementById('direccion').focus();
            document.getElementById('lbDireccion').style.color="red";
            ok=1;
         };
         if(document.getElementById('telefono').value==""){
            document.getElementById('telefono').focus();
            document.getElementById('lbTelefono').style.color="red";
            ok=1;
         };
         if(document.getElementById('apellidos').value==""){
            document.getElementById('apellidos').focus();
            document.getElementById('lbApellidos').style.color="red";
            ok=1;
         };
         if(document.getElementById('nombre').value==""){
            document.getElementById('nombre').focus();
            document.getElementById('lbNombre').style.color="red";
            ok=1;
         };

         if(ok==0){
            return 1;
         }else{
            return 0;
         };
      };
	  
	function abrirCapa(idCapa) {
      document.getElementById(idCapa).style.height='auto';	  
	  document.getElementById(idCapa).style.visibility="visible"; 
   }
   function cerrarCapa(idCapa) {
      document.getElementById(idCapa).style.height=2+'px';
      document.getElementById(idCapa).style.overflow='hidden'; 
	  document.getElementById(idCapa).style.visibility="hidden"; 
   }
   var cerrada=true;
   function abrirCerrarNuevaConsulta() {   
      if (cerrada) {
         abrirCapa('nuevaConsulta');
         cerrada=false;
      } else {
         cerrarCapa('nuevaConsulta');
         cerrada=true;     
      }        
   }	  


