(function($) {
 $.fn.typeOut = function(_dur, _callbackFunc, _theCursorJqueryObj) {
	if($(this).data('jquery_plugin_typeOut_timerId')) {
		clearTimeout($(this).data('jquery_plugin_typeOut_timerId'));
	}
	var _this = this;
	var dur = _dur;
	var callbackFunc = _callbackFunc;
	var originalText = _this.text();
	var theCursorJqueryObj = _theCursorJqueryObj;
	_this.text(" ");
	_this.show();
	var textCount = 0;
	//var timerId = setTimeout(typeALetterOut, _dur);
	$(this).data('jquery_plugin_typeOut_timerId',setTimeout(typeALetterOut, _dur));
	function typeALetterOut() {
		if(textCount > originalText.length) {
			if(callbackFunc) {
				callbackFunc();
			}
		}else {
			_this.text(originalText.substring(0, textCount));
			if(theCursorJqueryObj != null) {
				theCursorJqueryObj.offset({left:(_this.offset().left+_this.width()+4), top:(_this.offset().top+6)});
				theCursorJqueryObj.fadeIn(250);
			}
			textCount++;
			timerId = setTimeout(typeALetterOut, dur);
		}

	}
}})(jQuery);
