// JavaScript Document
//funcion que verifica que algún campo del formulario de la página principal www.rinconatural.cl no venga en blanco
function blancos(formulario)
{
	if ((formulario.usuario.value=="") && (formulario.clave.value==""))
		{
			return false;
			}
	else
		{
			formulario.submit();
			}
	}
	
function abrirventana_reg(archivo, ventana)
{
	var atributos='resizable=0,';
	var height=530;
	var top=((screen.availHeight-height)/2);
	var width=480;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
	window.close();
	//window.open(archivo, ventana,'top=20,left=20,width=480,height=530,resizable=0');
}
function abrirventana_recetas(archivo, ventana)
{
	var atributos='resizable=0,';
	var height=screen.availHeight;
	var top=0;
	var width=780;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
	window.close();
	//window.open(archivo, ventana,'top=20,left=20,width=480,height=530,resizable=0');
}


function abrirventana_nr(archivo, ventana)
{
	var atributos='resizable=0,'
	var height=550;
	var top=((screen.availHeight-height)/2);
	var width=500;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
	//window.open(archivo, ventana,'top=20,left=20,width=480,height=530,resizable=0');
}
function abrirventana_nr2(archivo, ventana)
{
	var atributos='resizable=0,'
	var height=550;
	var top=((screen.availHeight-height)/2);
	var width=600;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
	//window.open(archivo, ventana,'top=20,left=20,width=480,height=530,resizable=0');
}

function abrirventana_r(archivo, ventana)
{
	var atributos='resizable=1,scrollbars=1,';
	var height=490;
	var top=((screen.availHeight-height)/2);
	var width=490;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
}
/*function abrirventana_recetas(archivo, ventana)
{
	window.open(archivo, ventana,'top=0,left=0,width=762,height=851,resizable=1,scrollbars=1');
}*/

function Verifica_Blancos(formulario)
  {
     blancos=true;
          if ((formulario.nombre.value=="")||(formulario.emaila.value=="")||(formulario.emailb.value=="")||(formulario.passw.value==""))
            {
				alert("Debe Ingresar al menos\nNombre, E-mail completo y Password");
			}
         else
            {blancos=false;}
     return(blancos);
  } 
  
 function Verificar_Enviar(formulario)
  {
	if (Verifica_Blancos(formulario)==false)
		{			
			if (confirm("Los datos serán enviadas ahora.\nEstán todos correctos?"))
			{
				formulario.submit();								
			}
		}                      	   
  }
  
  function Verifica_BlancosRecuperaContrase(formulario)
  {
     blancos=true;
          if ((formulario.emaila.value=="")||(formulario.emailb.value==""))
            {
				alert("Debe Ingresar E-mail completo");
			}
         else
            {blancos=false;}
     return(blancos);
  } 
  
 function VerificarRecuperaContrase(formulario)
  {
	if (Verifica_BlancosRecuperaContrase(formulario)==false)
		{			
			if (confirm("Los datos serán enviadas ahora.\nEstán todos correctos?"))
			{
				formulario.submit();								
			}
		}                      	   
  }
  
   function Verifica_BlancosCambiaContrase(formulario)
  {
     blancos=true;
          if ((formulario.emaila.value=="")||(formulario.emailb.value=="")||(formulario.pass1.value=="")||(formulario.pass2.value==""))
            {
				alert("Debe completar todos los campos");
			}
         else
            {blancos=false;}
     return(blancos);
  } 
  
 function VerificarCambiaContrase(formulario)
  {
	if (Verifica_BlancosCambiaContrase(formulario)==false)
		{			
			if (confirm("Los datos serán enviadas ahora.\nEstán todos correctos?"))
			{
				formulario.submit();								
			}
		}                      	   
  }
  function abrirventana_emol(archivo, ventana)
{
	var atributos='resizable=1,scrollbars=1,'
	var height=500;
	var top=((screen.availHeight-height)/2);
	var width=500;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);	
}
function abrirventana_contacto(archivo, ventana)
{
	var atributos='resizable=1,'
	var height=500;
	var top=((screen.availHeight-height)/2);
	var width=480;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
}
function abrirventana_prensa(archivo, ventana)
{
	var atributos='resizable=1,scrollbars=1,menubar=1,toolbar=1,';
	var height=350;
	var top=((screen.availHeight-height)/2);
	var width=650;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
}
function abrirventana_pago(archivo, ventana)
{
	var atributos='resizable=1,scrollbars=1,';
	var height=650;
	var top=((screen.availHeight-height)/2);
	var width=500;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
}
function abrirventana_rse(archivo, ventana)
{
	var atributos='resizable=1,scrollbars=1,menubar=1,toolbar=1,';
	var height=550;
	var top=((screen.availHeight-height)/2);
	var width=650;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
}
function abrirventana_noni(archivo, ventana)
{
	var atributos='resizable=1,scrollbars=0,menubar=0,toolbar=1,';
	var height=250;
	var top=((screen.availHeight-height)/2);
	var width=650;
	var left=((screen.availWidth-width)/2);
	atributos=atributos+'width='+width+','+'left='+left+','+'top='+top+','+'height='+height;
	window.open(archivo, ventana, atributos);
}
