function validar_presupuesto(formulario, msg) {

	//Información general
	if (formulario.mercaderia.value == '') { alert(msg); formulario.mercaderia.focus(); return false; }
	if (formulario.valor.value == '') { alert(msg); formulario.valor.focus(); return false; }
	if (formulario.pesoneto.value == '') { alert(msg); formulario.pesoneto.focus(); return false; }
	if (formulario.pesobruto.value == '') { alert(msg); formulario.pesobruto.focus(); return false; }

	//Datos Tipo de operación
	var tipodeoperacion = get_tipodeope(formulario.tipodeoperacion);
	if (tipodeoperacion=='') { alert(msg); formulario.tipodeoperacion[0].focus(); return false; }
	if (tipodeoperacion == 'Otros' && formulario.otros.value=='') { alert(msg); formulario.otros.focus(); return false; }
	
	//Datos del solicitante
	if (formulario.nombre.value == '') { alert(msg); formulario.nombre.focus(); return false; }
	if (formulario.email.value.indexOf('@') < 0 || formulario.email.value.indexOf('.') < 0 || formulario.email.value.indexOf(',') >= 0) { alert(msg); formulario.email.focus(); return false; }
	if (formulario.pais.value == '') { alert('Debe indicar un pais.'); formulario.pais.focus(); return false; }
	if (formulario.direccion.value == '') { alert(msg); formulario.direccion.focus(); return false; }
	if (formulario.telefono.value == '') { alert(msg); formulario.telefono.focus(); return false; }
	if (formulario.email.value!=formulario.confirmaremail.value) { alert(msg); formulario.confirmaremail.focus(); return false; }
	
	return true;
}

function get_tipodeope(obj) {
	var var_ret="";
	for (i=0;i<obj.length;i++) {
		if (obj[i].checked) {var_ret = obj[i].value;break;}
	}
	return var_ret;
}