text: 
  /**
   * 扩展jquery
   */
  $.fn.qdata = function(){
  	var res = {};
  	
  	var data = $(this).attr('data');
  	if(data){
  		var options = data.split(';');
  		for(var i=0; i<options.length; i++){
  			if(options[i]){
  				var opt = options[i].split(':');
  				res[opt[0]] = opt[1];
  			}
  		}
  	}
  	
  	return res;
  };
  $.fn.qser = function(){
  	var obj = {};
  	
  	var objs = $(this).serializeArray();
  	if(objs.length != 0){
  		for(var i=0; i<objs.length; i++){
  			obj[objs[i].name] = objs[i].value;
  		}
  	}
  
  	return obj;
  };
  
  
  /**
   * formToArray() gathers form element data into an array of objects that can
   * be passed to any of the following ajax functions: $.get, $.post, or load.
   * Each object in the array has both a 'name' and 'value' property.  An example of
   * an array for a simple login form might be:
   *
   * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
   *
   * It is this array that is passed to pre-submit callback functions provided to the
   * ajaxSubmit() and ajaxForm() methods.
   */
  $.fn.formToArray = function(semantic, elements) {
      var a = [];
      if (this.length === 0) {
          return a;
      }
  
      var form = this[0];
      var els = semantic ? form.getElementsByTagName('*') : form.elements;
      if (!els) {
          return a;
      }
  
      var i,j,n,v,el,max,jmax;
      for(i=0, max=els.length; i < max; i++) {
          el = els[i];
          n = el.name;
          if (!n || el.disabled) {
              continue;
          }
  
          if (semantic && form.clk && el.type == "image") {
              // handle image inputs on the fly when semantic == true
              if(form.clk == el) {
                  a.push({name: n, value: $(el).val(), type: el.type });
                  a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
              }
              continue;
          }
  
          v = $.fieldValue(el, true);
          if (v && v.constructor == Array) {
              if (elements)
                  elements.push(el);
              for(j=0, jmax=v.length; j < jmax; j++) {
                  a.push({name: n, value: v[j]});
              }
          }
          else if (v !== null && typeof v != 'undefined') {
              if (elements)
                  elements.push(el);
              a.push({name: n, value: v, type: el.type, required: el.required});
          }
      }
  
      if (!semantic && form.clk) {
          // input type=='image' are not found in elements array! handle it here
          var $input = $(form.clk), input = $input[0];
          n = input.name;
          if (n && !input.disabled && input.type == 'image') {
              a.push({name: n, value: $input.val()});
              a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
          }
      }
      return a;
  };
  
  /**
   * Serializes form data into a 'submittable' string. This method will return a string
   * in the format: name1=value1&amp;name2=value2
   */
  $.fn.formSerialize = function(semantic) {
      //hand off to jQuery.param for proper encoding
      return $.param(this.formToArray(semantic));
  };
  
  /**
   * Serializes all field elements in the jQuery object into a query string.
   * This method will return a string in the format: name1=value1&amp;name2=value2
   */
  $.fn.fieldSerialize = function(successful) {
      var a = [];
      this.each(function() {
          var n = this.name;
          if (!n) {
              return;
          }
          var v = $.fieldValue(this, successful);
          if (v && v.constructor == Array) {
              for (var i=0,max=v.length; i < max; i++) {
                  a.push({name: n, value: v[i]});
              }
          }
          else if (v !== null && typeof v != 'undefined') {
              a.push({name: this.name, value: v});
          }
      });
      //hand off to jQuery.param for proper encoding
      return $.param(a);
  };
  
  /**
   * Returns the value(s) of the element in the matched set.  For example, consider the following form:
   *
   *  <form><fieldset>
   *      <input name="A" type="text" />
   *      <input name="A" type="text" />
   *      <input name="B" type="checkbox" value="B1" />
   *      <input name="B" type="checkbox" value="B2"/>
   *      <input name="C" type="radio" value="C1" />
   *      <input name="C" type="radio" value="C2" />
   *  </fieldset></form>
   *
   *  var v = $('input[type=text]').fieldValue();
   *  // if no values are entered into the text inputs
   *  v == ['','']
   *  // if values entered into the text inputs are 'foo' and 'bar'
   *  v == ['foo','bar']
   *
   *  var v = $('input[type=checkbox]').fieldValue();
   *  // if neither checkbox is checked
   *  v === undefined
   *  // if both checkboxes are checked
   *  v == ['B1', 'B2']
   *
   *  var v = $('input[type=radio]').fieldValue();
   *  // if neither radio is checked
   *  v === undefined
   *  // if first radio is checked
   *  v == ['C1']
   *
   * The successful argument controls whether or not the field element must be 'successful'
   * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
   * The default value of the successful argument is true.  If this value is false the value(s)
   * for each element is returned.
   *
   * Note: This method *always* returns an array.  If no valid value can be determined the
   *    array will be empty, otherwise it will contain one or more values.
   */
  $.fn.fieldValue = function(successful) {
      for (var val=[], i=0, max=this.length; i < max; i++) {
          var el = this[i];
          var v = $.fieldValue(el, successful);
          if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
              continue;
          }
          if (v.constructor == Array)
              $.merge(val, v);
          else
              val.push(v);
      }
      return val;
  };
  
  /**
   * Returns the value of the field element.
   */
  $.fieldValue = function(el, successful) {
      var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
      if (successful === undefined) {
          successful = true;
      }
  
      if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
          (t == 'checkbox' || t == 'radio') && !el.checked ||
          (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
          tag == 'select' && el.selectedIndex == -1)) {
              return null;
      }
  
      if (tag == 'select') {
          var index = el.selectedIndex;
          if (index < 0) {
              return null;
          }
          var a = [], ops = el.options;
          var one = (t == 'select-one');
          var max = (one ? index+1 : ops.length);
          for(var i=(one ? index : 0); i < max; i++) {
              var op = ops[i];
              if (op.selected) {
                  var v = op.value;
                  if (!v) { // extra pain for IE...
                      v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
                  }
                  if (one) {
                      return v;
                  }
                  a.push(v);
              }
          }
          return a;
      }
      return $(el).val();
  };
  
  /**
   * Clears the form data.  Takes the following actions on the form's input fields:
   *  - input text fields will have their 'value' property set to the empty string
   *  - select elements will have their 'selectedIndex' property set to -1
   *  - checkbox and radio inputs will have their 'checked' property set to false
   *  - inputs of type submit, button, reset, and hidden will *not* be effected
   *  - button elements will *not* be effected
   */
  $.fn.clearForm = function(includeHidden) {
      return this.each(function() {
          $('input,select,textarea', this).clearFields(includeHidden);
      });
  };
  
  /**
   * Clears the selected form elements.
   */
  $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
      var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
      return this.each(function() {
          var t = this.type, tag = this.tagName.toLowerCase();
          if (re.test(t) || tag == 'textarea') {
              this.value = '';
          }
          else if (t == 'checkbox' || t == 'radio') {
              this.checked = false;
          }
          else if (tag == 'select') {
              this.selectedIndex = -1;
          }
          else if (includeHidden) {
              // includeHidden can be the value true, or it can be a selector string
              // indicating a special test; for example:
              //  $('#myForm').clearForm('.special:hidden')
              // the above would clean hidden inputs that have the class of 'special'
              if ( (includeHidden === true && /hidden/.test(t)) ||
                   (typeof includeHidden == 'string' && $(this).is(includeHidden)) )
                  this.value = '';
          }
      });
  };
  
  /**
   * Resets the form data.  Causes all form elements to be reset to their original value.
   */
  $.fn.resetForm = function() {
      return this.each(function() {
          // guard against an input with the name of 'reset'
          // note that IE reports the reset function as an 'object'
          if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
              this.reset();
          }
      });
  };
  
  /**
   * Enables or disables any matching elements.
   */
  $.fn.enable = function(b) {
      if (b === undefined) {
          b = true;
      }
      return this.each(function() {
          this.disabled = !b;
      });
  };
  
  /**
   * Checks/unchecks any matching checkboxes or radio buttons and
   * selects/deselects and matching option elements.
   */
  $.fn.selected = function(select) {
      if (select === undefined) {
          select = true;
      }
      return this.each(function() {
          var t = this.type;
          if (t == 'checkbox' || t == 'radio') {
              this.checked = select;
          }
          else if (this.tagName.toLowerCase() == 'option') {
              var $sel = $(this).parent('select');
              if (select && $sel[0] && $sel[0].type == 'select-one') {
                  // deselect all other options
                  $sel.find('option').selected(false);
              }
              this.selected = select;
          }
      });
  };