//-------------------------------------------------	
function textbox_to_number(obj) {
	var t1;
	var i;
	var v;
	t1 = obj.value;
	// quitamos puntos
	t1 = t1.replace(/[.]/gi,"");
	// si hay una , quitamos de ahí al final
	i = t1.indexOf(",");
	if (i != -1) {
		t1 = t1.substr(0,i);
	}
  // quitamos todo lo que no sean números
	t1 = t1.replace(/[^\d]*/gi,"");
	// si no es un número, ponemos 0
	v = parseInt(t1);
	if (isNaN(v)) v = 0;
	obj.value = v;
}

//-------------------------------------------------
function textbox_to_euros(obj) {
	v = parseInt(obj.value);
	v = Math.round(v / 166.386);
	obj.value = v;
}
