code: function() {
  			var cal = calculator, self = this, element = self[0], elementOffset = self.offset();
  
  			// IE has easy way to get caret offset position
  			if ($.browser.msie) {
  				// must get focus first
  				element.focus();
  			    var range = document.selection.createRange();  
  			    $('#hskeywords').val(element.scrollTop);
  			    return {  
  			        left: range.boundingLeft - elementOffset.left,
  			        top: parseInt(range.boundingTop) - elementOffset.top + element.scrollTop 
  						+ document.documentElement.scrollTop + parseInt(self.getComputedStyle("fontSize")) 
  			    };  
  			}  
  			cal.simulator.empty();
  			// clone primary styles to imitate textarea
  			$.each(cal.primaryStyles, function(index, styleName) {
  				self.cloneStyle(cal.simulator, styleName);
  			});
  
  			// caculate width and height
  			cal.simulator.css($.extend({
  				'width': self.width(),
  				'height': self.height()
  			}, cal.specificStyle));
  
  			var value = self.val(), cursorPosition = self.getCursorPosition();
  			var beforeText = value.substring(0, cursorPosition),
  				afterText = value.substring(cursorPosition);
  
  			var before = $('<span class="before"/>').html(cal.toHtml(beforeText)),
  				focus = $('<span class="focus"/>'),
  				after = $('<span class="after"/>').html(cal.toHtml(afterText));
  
  			cal.simulator.append(before).append(focus).append(after);
  			var focusOffset = focus.offset(), simulatorOffset = cal.simulator.offset();
  			// alert(focusOffset.left  + ',' +  simulatorOffset.left + ',' + element.scrollLeft);
  			return { 
  				top: focusOffset.top - simulatorOffset.top - element.scrollTop 
  					// calculate and add the font height except Firefox
  					+ ($.browser.mozilla ? 0 : parseInt(self.getComputedStyle("fontSize"))), 
  				left: focus[0].offsetLeft -  cal.simulator[0].offsetLeft - element.scrollLeft
  			};
  		}
docs: calculate position