function check_field(value,regex)
{
	re = new RegExp(regex);

	r=re.exec(value);
	if (r==null) return false; else return true;
}

function check_form(form,nombreform)
{
	
	switch (nombreform) {
		case "solicitudclave":
			fields=	new Array('organizacion','telefono','contacto','email');
			texts=	new Array("Organización","Teléfono","Persona de contacto","E-Mail");
			types=	new Array('.+','.+','.+','.+','.+');
			break;
	}


	for (i=0;i<fields.length;i++) {
		v=eval("form."+fields[i]+".value");
		r=check_field(v,types[i]);
		if (r==false) {
			alert ("Por favor, compruebe campo "+texts[i]);
			return false;
		}
	}

	return true;
}
