  var StaticApp = {

    ajaxExecute : function (b, action) {
      var buf = b.value;
      if (!b.disabled) {
        b.disabled = true;
        b.value = "データを送信中です。";
        if (action) {
          b.form.action = action;
        }
        new Ajax.Request(b.form.action,
          {
            asynchronous:true,
            evalScripts:true,
            parameters:Form.serialize(b.form),
            onComplete:function(request){b.disabled = false; b.value = buf;}
          }
        );
      }
    },

    execute : function (b, action, text) {
      var buf = b.value;
      if (!b.disabled) {
        b.disabled = true;
        if (text) {
          b.value = text;
        } else {
          b.value = "データを送信中です。";
        }
        if (action) {
          b.form.action = action;
        }
        b.form.submit();
      }
    },

    resetForm : function (id) {
      $$('.text').each(function(element) {
        element.value = "";
      });
      $$('.pulldown').each(function(element) {
        element.selectedIndex = 0;
      });
      $$('.checkbox').each(function(element) {
        element.checked = false;
      });
      $$('.radio').each(function(element) {
        element.checked = false;
      });
    },

    allCheck : function (checked, targets_name) {
      $A(document.getElementsByName(targets_name)).each(function(element) {
        element.checked = checked;
      });
    },

    collectChecked : function (target_class_name) {
      var ret = '';
      $A($$('.' + target_class_name)).each(function(element) {
        if (element.checked) {
          ret = (ret.length == 0) ? (element.value) : (ret + ',' + element.value);
        }
      })
      return ret;
    }

  }


