/*------------------------------------index---------------------------------------*/

function crearAjax()
{
    var xmlhttp=false;
    try 
    {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch (e) 
    {
        try 
        {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } 
        catch (E) 
        {
            xmlhttp = false;
        }
    }

    if (!xmlhttp && typeof XMLHttpRequest!='undefined') 
    {
        xmlhttp = new XMLHttpRequest();
    }
    return xmlhttp;
}




function Contenido(url)
{
    var contenedor;
    contenedor = document.getElementById('content');
    var ajax=false;

    // creamos un nuevo objeto ajax
    ajax=crearAjax();
	//ajax= ( window.ActiveXObject ) ? new ActiveXObject("Microsoft.XMLHTTP") :  new XMLHttpRequest();	

    //cargar el archivo html por el método GET
    ajax.open("GET", url,true);

    ajax.onreadystatechange=function() 
    {
        if ((ajax.readyState==4) && (ajax.status == 200)) // Readystate 4 significa que ya acabó de cargarlo
        {
            contenedor.innerHTML = ajax.responseText;
        }
    }
        ajax.send(null);
}



/*------------------------------------seccion5---------------------------------------*/
		
function borrartxt()
{
    document.getElementById("formu").coment.value="";
}


 //Verifica que los datos introducidos son correctos
function compruebamail(email)
{
    if (email.indexOf("@") == -1)
        {
        
        return false;
        }
    return true;
}

        
function Comprobar()
{
    var nom = document.getElementById("formu").nombre.value;
    var mail = document.getElementById("formu").email.value;
    var txt = document.getElementById("formu").coment.value;
    if ((nom == "") || (txt == ""))
    {
        alert("Introduce todos los campos obligatorios!");
        return false;
    }
    else
    {
        if(!compruebamail(mail))
        {
            alert("Email incorrecto");
            return false;
        }
        else
            return true;
    }
}
	
