function JSNetUi() {

  this.names = [];

  this.anchorFormSubmit = function(netuiName, newAction) {
    for (var i=0; i < document.forms.length; i++) {
      var f = document.forms[i];
      if (f.id == netuiName) {
         f.method = "POST";
         f.action = newAction;
	 if (f.submitContent) {
	   f.submitContent()
	 } else {
           f.submit();
	 }
      }
    }
  }

  this.setFocus = function(netuiFormName, netuiInputName) {
    var f = document.forms[netuiFormName];
    if (f) {
      var i = f[netuiInputName];
      if (i && i.type != "hidden") {
        i.focus();
      }
    }
  }

  this.swapImage = function (control, image) {
    control.src = image;
  }

  this.addMapping = function(name, realName) {
    this.names[name] = realName;
  }

  this.getMapping = function(name) {
    return this.names[name];
  }

}

var NetUi = new JSNetUi();
