+ '.amount': function(e) {
+ if(e.onblur==undefined) {
+ e.onblur = function() {
+ var dec = this.getAttribute("dec");
+ price_format(this.name, get_amount(this.name), dec);
+ };
+ }
+ },
+ '.searchbox': // emulated onchange event handling for text inputs
+ function(e) {
+ e.setAttribute('_last_val', e.value);
+ e.setAttribute('autocomplete', 'off'); //must be off when calling onblur
+ e.onblur = function() {
+ var val = this.getAttribute('_last_val');
+ if (val != this.value) {
+ this.setAttribute('_last_val', this.value);
+ JsHttpRequest.request('_'+this.name+'_changed', this.form);
+ }
+ }
+ e.onkeydown = function(ev) {
+ ev = ev||window.event;
+ key = ev.keyCode||ev.which;
+ if (key == 13 && (this.value != this.getAttribute('_last_val'))) {
+ this.blur();
+ return false;
+ }
+ }
+ },
+ 'select': function(e) {
+ if(e.onfocus==undefined) {
+ e.onfocus = function() {
+ save_focus(this);
+ };
+ var c = e.className;
+ if (c == 'combo' || c == 'combo2')
+ _set_combo_select(e);
+ }
+ },
+ 'textarea,a': function(e) {
+ if(e.onfocus==undefined) {
+ e.onfocus = function() {
+ save_focus(this);
+ };
+ }