function popup(url,windowname,width,height,features) { 

width=(width)?width:screen.width/2; 
height=(height)?height:screen.height/2; 
var screenX = (screen.width/2 - width/2); 
var screenY = (screen.height/2 - height/2); 
var features= "width=" + width + ",height=" + height +",scrollbars=no,status=no"; 
features += ",screenX=" + screenX + ",left=" + screenX; 
features += ",screenY=" + screenY + ",top=" + screenY; 

var mywin=window.open(url, windowname, features); 
if (mywin) 
mywin.focus(); 
return mywin; 
} 

function checkscript(){
// valors obligatoris
nom = document.forms['frm_contacte'].elements['f_nombre'];
empresa = document.forms['frm_contacte'].elements['f_empresa'];
email = document.forms['frm_contacte'].elements['f_email'];
sector = document.forms['frm_contacte'].elements['f_sector'];
telefono = document.forms['frm_contacte'].elements['f_telefono'];

alerta_generica = "Por favor, compruebe que ha completado\ntodos los campos obligatorios";

if (nom.value == '')	{
	alert(alerta_generica);
	nom.focus();
	return false;
}
else if (empresa.value == '')	{
	alert(alerta_generica);
	empresa.focus();
	return false;
}
else if (sector.value == '')	{
	alert(alerta_generica);
	sector.focus();
	return false;
}
else if (telefono.value == '')	{
	alert(alerta_generica);
	telefono.focus();
	return false;
}
else if (email.value == '')	{
	alert(alerta_generica);
	email.focus();
	return false;
}
return true;
}
