function showStuff(id) {
	document.getElementById('blogger1').style.display = 'none';
	document.getElementById('blogger2').style.display = 'none';
	document.getElementById('blogger3').style.display = 'none';
	document.getElementById('blogger4').style.display = 'none';
	
	document.getElementById(id).style.display = 'block';
}
function enviarMail(email) {
	if (echeck(email))
	{
		crearXmlHttp();
		xmlHttp.onreadystatechange=funcionNotificada;
		xmlHttp.open("GET","destinoAJAX.php?mail=" + email,true);
		xmlHttp.send(null);
	}	
}
function funcionNotificada()
{
    if(xmlHttp.readyState==4)
    {
		if(xmlHttp.status==200)
      	{
      		alert("Se ha recibido el correo electrónico " + xmlHttp.responseText + ", durante los proximos dias empezará a recibir novedades en su mail");
     	}
	}
}
var xmlHttp;
function crearXmlHttp()
{
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("No se pudo enviar su email debido a un problema con su navegador, disculpe las molestias, esperamos que disfrute de nuestro sitio.");
      return false;
      }
    }
  }
 }
 function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Email invalido, revise la sintaxis");
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Email invalido, revise la sintaxis");
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Email invalido, revise la sintaxis");
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Email invalido, revise la sintaxis");
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Email invalido, revise la sintaxis");
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Email invalido, revise la sintaxis");
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Email invalido, revise la sintaxis");
		    return false
		 }

 		 return true					
	}