// menú js

opcio01= new Image();
opcio01On= new Image();
opcio02= new Image();
opcio02On= new Image();
opcio03= new Image();
opcio03On= new Image();
opcio04= new Image();
opcio04On= new Image();
opcio05= new Image();
opcio05On= new Image();
opcio06= new Image();
opcio06On= new Image();

opcio01.src="img/01.png";
opcio01On.src="img/01_act.png";

opcio02.src="img/02.png";
opcio02On.src="img/02_act.png";

opcio03.src="img/03.png";
opcio03On.src="img/03_act.png";


opcio04.src="img/04.png";
opcio04On.src="img/04_act.png";

opcio05.src="img/05.png";
opcio05On.src="img/05_act.png";

opcio06.src="img/06.png";
opcio06On.src="img/06_act.png";


function canvia (nom,activa)
{

document.images[nom].src=activa.src;
}


//valida formulari

function validar()
{
        with (document.contactar)
        {
        result1 = esta_ple(nom);
		result2 = esta_ple(cognoms);
		result3 = esta_ple(empresa);
		result4 = comprova_telefon(telefon);
        result5 = mira_email(email);
        result6 = esta_ple(comentaris);
		
        if (result1 == 0)
        {
		alerta_es('Nombre');
		nom.focus();
		return false;
	    }

		else if (result2 == 0)
		{
		alerta_es('Apellidos');
		cognoms.focus();
		return false;
		}

		else if (result3 == 0)
		{
		alerta_es('Empresa');
		empresa.focus();
		return false;
		}

		else if (result4 == false)
		{
		alerta_es('Teléfono');
		telefon.focus();
		return false;
		}

        else if (result5 != 1)
        {
        alert('Introduce una dirección de correo electrónico valida');
	    email.focus();
		return false;
        }

		else if (result6 == 0)
		{
		alerta_es('Comentarios');
		comentaris.focus();
		return false;
		}	
		
		 else submit();
       }
}


// obre imatge


function obreImatge01(x)
{
vent= window.open(x,"aol","width=680,height=630,top=200,left=200,scrollbars=1");
}

function obreImatge02(x)
{
vent= window.open(x,"aol","width=680,height=430,top=200,left=200,scrollbars=1");
}

function obreImatge03(x)
{
vent= window.open(x,"aol","width=850,height=500,top=200,left=200,scrollbars=1");
}

function obreImatge04(x)
{
vent= window.open(x,"aol","width=680,height=630,top=200,left=200,scrollbars=1");
}
