function comprobar_email(email)
{
 if(
 	(email.indexOf("@")!=-1)&&
	(email.indexOf(".")!=-1)
	)
	{
	 return true;
	}
	else
	{
	 return false;
	} 
}

function validar_contacte()
{
 nombre=document.getElementById("cajaNombre").value; 
 email=document.getElementById("cajaEmail").value; 
mensaje = document.getElementById("areaMensaje").value
 cuerpoform=document.getElementById("formularioContacte");
 
if (nombre=='') alert('Faltan datos.');
else if (!comprobar_email(email)) alert('Faltan datos.');
               else if (mensaje=='') alert('Faltan datos.');
                      else cuerpoform.submit();
 
}

function validar_contacte_partner()
{

 nombre=document.getElementById("cajaNombre").value; 
 email=document.getElementById("cajaEmail").value; 
 empresa=document.getElementById("cajaEmpresa").value; 
 cargo=document.getElementById("cajaCargo").value; 
 telefono=document.getElementById("cajaTelefono").value; 
 ciduad=document.getElementById("cajaCiudad").value; 
 pais=document.getElementById("cajaPais").value; 
 cuerpoform=document.getElementById("formularioContacte");
 
if (nombre=='') alert('Faltan datos.');
else if (!comprobar_email(email)) alert('Faltan datos.');
    else if (empresa=='') alert('Faltan datos.');
        else if (cargo=='') alert('Faltan datos.');
            else if (telefono=='') alert('Faltan datos.');
                else if (ciduad=='') alert('Faltan datos.');
                    else if (pais=='') alert('Faltan datos.');
                        else cuerpoform.submit();


}



function validar_unete()
{
 nombre=document.getElementById("cajaNombre"); 
 email=document.getElementById("cajaEmail"); 
 telefono=document.getElementById("cajaTelf");
 mensaje=document.getElementById("areaMensaje");
 cuerpoform=document.getElementById("formularioUnete");
 if(
    (nombre.value.length>0) &&
    ( 	
     comprobar_email(email.value)|| 
     (telefono.value.length>0)
    )
   )
 {
 cuerpoform.submit();
 }
 else
 {
  alert("faltan datos");
 }
 
}

// función para abrir ventanas externas

var CWIN;
var miURL;
var altura=screen.height;
var anchura=screen.width;
var alto = (altura/2)-215;
var ancho = (anchura/2)-355;
	function openIT(direccion, nombre){
		
		url= direccion;
		myname = nombre;
		win="fullscreen=0,directories=0,resizable=0,width=10,height=10,location=0,status=0,scrollbars=0,toolbar=0,menubar=0,titlebar=0";
		CWIN = window.open(url,myname,win);

		CWIN.resizeTo( Math.ceil( 800 ) , Math.ceil( 484 ) );
		CWIN.moveTo  ( Math.ceil( ancho ) , Math.ceil( alto ) );
		CWIN.focus();
		}

