ImatgeActiva_sum = new Image();
ImatgeInactiva_sum = new Image();
ImatgeActiva_sum.src = "imagenes/boto_4petit.gif";
ImatgeInactiva_sum.src = "imagenes/boto_4petit_fora.gif";

function canviaenllac(enllac,estat)
{
	if (estat==0)
	{
		enllac.style.color="#ffffff";
		enllac.style.fontSize = "20pt";
	}
	else
	{
		enllac.style.color="ffffff";
		enllac.style.fontSize = "24pt";
	}
}

function AlSenyalar_sum(novaimatge)
{ 
	novaimatge.src = ImatgeActiva_sum.src
} 

function AlNoSenyalar_sum(novaimatge)
{ 
	novaimatge.src = ImatgeInactiva_sum.src
}

function canvialink(enllac,situacio)
{
	if (situacio==0) enllac.style.color="#ffffff"
	else enllac.style.color="#eaaac0";
}

function ensenyam()
{
	if (cert == 0) document.all.llista.style.display = "none"
	else document.all.llista.style.display = "";
	cert = !cert;
}


function error(err_n)
{
	if (err_n==1) alert ("Los campos marcados con * son obligatorios");
	if (err_n==2) alert ("Debe introducir los datos de su cuenta corriente completos");
	if (err_n==3) alert ("Debe introducir los datos de su tarjeta de crédito completos");
}

function validar(formulari)
{
	var correcto ;
	with (formulari)
	{
		if (nombrepersona.value == "" || nombreempresa.value == "") { error(1) ; return false;}
		if (direccion.value == "") { error(1) ; return false;}
		if (cp.value == "") { error(1) ; return false;}
		if (poblacion.value == "") { error(1) ; return false;}
		if (nif.value == "") { error(1) ; return false;}
		if (telefono.value == "") { error(1) ; return false;}
		if (mail.value == "") { error(1) ; return false;}
		if ((forma_pago[3].checked == true) && (entitat.value == "" || oficina.value == "" || dc.value == "" || n_compte.value == "")) { error(2) ; return false;}
		if ((forma_pago[4].checked == true) && (sel_tarj.value == "0" || n_tarj.value == "" || data_cad.value == "")) { error(3) ; return false;}
		return true;
	}
	return false ;
}

function canviarefectes(imatge,estat)
{
	if (estat==0)
	{
		 imatge.style.filter="blur(strength=0)";
	}
	else
	{
		 imatge.style.filter="blur(strength=50)";
	}
}