/**
 * set a  form element's value
 * @author kevin_li  
 */
$.fn.fvalue = function(option) {
	
	return true;
	  // if possible, return "this" to not break the chain
};

/**
 * 
 * @param {Object} mode
 */
$.fn.fchecked=function(){
	 if(this.get(0)==null){
	  return 0;	
	 }
    
     if(this.get(0).type=="checkbox"){
	  var elength=0;
	  this.each(function(){
	  	if(this.checked==true)
			elength++;
	  });
	  return elength;
	}		
};
/**
 * you can use $("adb").check('on') 
 */
$.fn.fcheck=function(mode) {
	var mode = mode || 'on'; // if mode is undefined, use 'on' as default
	return this.each(function() {
		switch(mode) {
		case 'on':
			this.checked = true;
			break;
		case 'off':
			this.checked = false;
			break;
		case 'toggle':
			this.checked = !this.checked;
			break;
		}
	});
}