// JavaScript Document
color1="#96cd00";
color2="#57a80d";


function suscripcion(email)
{
	
window. open('suscripcion.php?email='+email,'ventana','toolbar=no,directories=no,scrollbar=yes,height=300,width=395,resizable=no,Top=100,Left=100');
	
	}
//______________________________________________________________________________________________
function VerGaleria(foto)
{
	
	  var theURL="verimagen.php?foto="+foto;
  var winName="InterfaceAmigo";
  var features="scrollbars=no,width=590,height=490";

  var _W=window.open(theURL,winName,features); 
      _W.focus(); 

    iz=(screen.width-590) / 2;
    de=(screen.height-490) / 2;
    _W.moveTo(iz,de);
	
}
//______________________________________________________________________________________________
function CheckFormContacto()
{
	if(document.form.NOMBRE.value==''){ alert('Por favor, escriba su nombre');}
	else if(document.form.EMAIL.value==''){ alert('Por favor, escriba su E-Mail');}
	else if(!CheckEmail(document.form.EMAIL.value)){ alert("Por favor, escriba un E-Mail Válido");}
	else if(document.form.TELEFONO.value==''){ alert('Por favor, escriba su Teléfono');}
	else if(document.form.COMENTARIOS.value==''){ alert('Por favor, escriba sus comentarios');}
	else{
		document.form.submit();
		}
	
	
}
//______________________________________________________________________________________________
function CheckEmail(e) { 
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM"; 
for(i=0; i < e.length ;i++){ 
if(ok.indexOf(e.charAt(i))<0){ 
return (false); } } 
if (document.images) { re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/; 
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 
if (!e.match(re) && e.match(re_two)) { return (-1); } } }
//______________________________________________________________________________________________
function recomendar()  { 
 
  var theURL="recomendar/enviaraunamigo.html";
  var winName="InterfaceAmigo";
  var features="scrollbars=no,width=590,height=490";

  var _W=window.open(theURL,winName,features); 
      _W.focus(); 
      _W.moveTo(20,20); 
 }
//______________________________________________________________________________________________
function agregarFavoritos(){ 

	var url="http://riegointeligente.com";
	var titulo="Riego Inteligente";

    if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) { 
      window.external.AddFavorite(url,titulo);     } 
    else {        if(navigator.appName == "Netscape")  alert ("Presione Crtl+D para agregar este sitio en sus Bookmarks"); 
    }  } 
//______________________________________________________________________________________________
 function checkEnviarAmigo()						{
if(document.form.nombre.value==""){ alert("Por favor, llene todos los campos"); document.form.nombre.focus();}
else if(document.form.email.value==""){ alert("Por favor, llene todos los campos"); document.form.email.focus();}
else if(!CheckEmail(document.form.email.value)){ alert("Por favor, proporcióne un E-Mail válido"); document.form.email.focus();}
else if(document.form.anombre.value==""){ alert("Por favor, llene todos los campos"); document.form.anombre.focus();}
else if(document.form.aemail.value==""){ alert("Por favor, llene todos los campos"); document.form.aemail.focus();}
else if(!CheckEmail(document.form.aemail.value)){ alert("Por favor, proporcióne un E-Mail válido"); document.form.aemail.focus();}
else if(document.form.comentario.value==""){ alert("Por favor, llene todos los campos"); document.form.comentario.focus();}
else{
document.form.submit();
}}
//______________________________________________________________________________________________
function cerrar(){
//setInterval("xajax_MostrarDestacado();",10000);
setTimeout("cerraventana();",4000);
}
function cerraventana(){	window.close();	}
//______________________________________________________________________________________________


